diff --git a/lib/cs/diagnosticMessages.generated.json b/lib/cs/diagnosticMessages.generated.json
index 7271e1a2328..bd5bf11f505 100644
--- a/lib/cs/diagnosticMessages.generated.json
+++ b/lib/cs/diagnosticMessages.generated.json
@@ -106,6 +106,7 @@
"Add_initializer_to_property_0_95019": "Přidat inicializační výraz k vlastnosti {0}",
"Add_initializers_to_all_uninitialized_properties_95027": "Přidat inicializátory do všech neinicializovaných vlastností",
"Add_missing_super_call_90001": "Přidat chybějící volání metody super()",
+ "Add_missing_typeof_95052": "Přidat chybějící typeof",
"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037": "Přidat kvalifikátor do všech nerozpoznaných proměnných odpovídajících názvu členu",
"Add_to_all_uncalled_decorators_95044": "Přidat () do všech nevolaných dekorátorů",
"Add_ts_ignore_to_all_error_messages_95042": "Přidat @ts-ignore do všech chybových zpráv",
@@ -119,6 +120,7 @@
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Všechny deklarace abstraktní metody musí jít po sobě.",
"All_destructured_elements_are_unused_6198": "Žádný z destrukturovaných elementů se nepoužívá.",
"All_imports_in_import_declaration_are_unused_6192": "Žádné importy z deklarace importu se nepoužívají.",
+ "All_variables_are_unused_6199": "Žádná z proměnných se nepoužívá.",
"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "Povolte výchozí importy z modulů bez výchozího exportu. Nebude to mít vliv na generování kódu, jenom na kontrolu typů.",
"Allow_javascript_files_to_be_compiled_6102": "Povolí kompilaci souborů javascript.",
"Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209": "Když se zadá příznak --isolatedModules, nepovolují se ambientní výčty.",
@@ -255,6 +257,7 @@
"Class_0_used_before_its_declaration_2449": "Třída {0} se používá dříve, než se deklaruje.",
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Deklarace tříd nemůžou mít více než jednu značku @augments nebo @extends.",
"Class_name_cannot_be_0_2414": "Třída nemůže mít název {0}.",
+ "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725": "Když se cílí na ES5 s modulem {0}, název třídy nemůže být Object.",
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "Statická strana třídy {0} nesprávně rozšiřuje statickou stranu základní třídy {1}.",
"Classes_can_only_extend_a_single_class_1174": "Třídy můžou rozšířit jenom jednu třídu.",
"Classes_containing_abstract_methods_must_be_marked_abstract_2514": "Třídy obsahující abstraktní metody musí být označené jako abstraktní.",
@@ -273,11 +276,14 @@
"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "Konstruktor třídy {0} je chráněný a dostupný jenom v rámci deklarace třídy.",
"Constructors_for_derived_classes_must_contain_a_super_call_2377": "Konstruktory odvozených tříd musí obsahovat volání příkazu super.",
"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Není zadaný obsažený soubor a nedá se určit kořenový adresář – přeskakuje se vyhledávání ve složce node_modules.",
+ "Convert_0_to_mapped_object_type_95055": "Převést {0} na typ mapovaného objektu",
"Convert_all_constructor_functions_to_classes_95045": "Převést všechny funkce konstruktoru na třídy",
"Convert_all_require_to_import_95048": "Převést všechna volání require na import",
"Convert_all_to_default_imports_95035": "Převést vše na výchozí importy",
"Convert_function_0_to_class_95002": "Převést funkci {0} na třídu",
"Convert_function_to_an_ES2015_class_95001": "Převést funkci na třídu ES2015",
+ "Convert_named_imports_to_namespace_import_95057": "Převést pojmenované importy na import oboru názvů",
+ "Convert_namespace_import_to_named_imports_95056": "Převést import oboru názvů na pojmenované importy",
"Convert_require_to_import_95047": "Převést require na import",
"Convert_to_ES6_module_95017": "Převést na modul ES6",
"Convert_to_default_import_95013": "Převést na výchozí import",
@@ -580,6 +586,7 @@
"Not_all_code_paths_return_a_value_7030": "Ne všechny cesty kódu vracejí hodnotu.",
"Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "Typ číselného indexu {0} se nedá přiřadit k typu indexu řetězce {1}.",
"Numeric_separators_are_not_allowed_here_6188": "Číselné oddělovače tady nejsou povolené.",
+ "Object_is_of_type_unknown_2571": "Objekt je typu Neznámý.",
"Object_is_possibly_null_2531": "Objekt je pravděpodobně null.",
"Object_is_possibly_null_or_undefined_2533": "Objekt je pravděpodobně null nebo undefined.",
"Object_is_possibly_undefined_2532": "Objekt je pravděpodobně undefined.",
@@ -708,10 +715,13 @@
"Redirect_output_structure_to_the_directory_6006": "Přesměrování výstupní struktury do adresáře",
"Referenced_project_0_must_have_setting_composite_Colon_true_6306": "Odkazovaný projekt {0} musí mít nastavení \"composite\": true.",
"Remove_all_unreachable_code_95051": "Odebrat veškerý nedosažitelný kód",
+ "Remove_all_unused_labels_95054": "Odebrat všechny nepoužívané popisky",
"Remove_declaration_for_Colon_0_90004": "Odebrat deklaraci pro {0}",
"Remove_destructuring_90009": "Odebrat destrukci",
"Remove_import_from_0_90005": "Odebrat import z {0}",
"Remove_unreachable_code_95050": "Odebrat nedosažitelný kód",
+ "Remove_unused_label_95053": "Odebrat nepoužitý popisek",
+ "Remove_variable_statement_90010": "Odebrat příkaz proměnné",
"Replace_import_with_0_95015": "Nahradí import použitím: {0}.",
"Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "Oznámí se chyba, když některé cesty kódu ve funkci nevracejí hodnotu.",
"Report_errors_for_fallthrough_cases_in_switch_statement_6076": "Oznámí se chyby v případech fallthrough v příkazu switch.",
diff --git a/lib/de/diagnosticMessages.generated.json b/lib/de/diagnosticMessages.generated.json
index 61c5a4bc241..01dc8cbf466 100644
--- a/lib/de/diagnosticMessages.generated.json
+++ b/lib/de/diagnosticMessages.generated.json
@@ -106,6 +106,7 @@
"Add_initializer_to_property_0_95019": "Initialisierer zu Eigenschaft \"{0}\" hinzufügen",
"Add_initializers_to_all_uninitialized_properties_95027": "Allen nicht initialisierten Eigenschaften Initialisierer hinzufügen",
"Add_missing_super_call_90001": "Fehlenden super()-Aufruf hinzufügen",
+ "Add_missing_typeof_95052": "Fehlenden \"typeof\" hinzufügen",
"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037": "Allen nicht aufgelösten Variablen, die einem Membernamen entsprechen, Qualifizierer hinzufügen",
"Add_to_all_uncalled_decorators_95044": "Allen nicht aufgerufenen Decorators \"()\" hinzufügen",
"Add_ts_ignore_to_all_error_messages_95042": "Allen Fehlermeldungen \"@ts-ignore\" hinzufügen",
@@ -119,6 +120,7 @@
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Alle Deklarationen einer abstrakten Methode müssen aufeinanderfolgend sein.",
"All_destructured_elements_are_unused_6198": "Alle destrukturierten Elemente werden nicht verwendet.",
"All_imports_in_import_declaration_are_unused_6192": "Keiner der Importe in der Importdeklaration wird verwendet.",
+ "All_variables_are_unused_6199": "Alle Variablen werden nicht verwendet.",
"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "Standardimporte von Modulen ohne Standardexport zulassen. Dies wirkt sich nicht auf die Codeausgabe aus, lediglich auf die Typprüfung.",
"Allow_javascript_files_to_be_compiled_6102": "Kompilierung von JavaScript-Dateien zulassen.",
"Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209": "const-Umgebungsenumerationen sind unzulässig, wenn das Flag \"-isolatedModules\" angegeben wird.",
@@ -255,6 +257,7 @@
"Class_0_used_before_its_declaration_2449": "Klasse \"{0}\", die vor der Deklaration verwendet wurde.",
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Klassendeklarationen dürfen maximal ein \"@augments\"- oder \"@extends\"-Tag aufweisen.",
"Class_name_cannot_be_0_2414": "Der Klassenname darf nicht \"{0}\" sein.",
+ "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725": "Der Klassenname darf nicht \"Object\" lauten, wenn ES5 mit Modul \"{0}\" als Ziel verwendet wird.",
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "Die statische Seite der Klasse \"{0}\" erweitert fälschlicherweise die statische Seite der Basisklasse \"{1}\".",
"Classes_can_only_extend_a_single_class_1174": "Klassen dürfen nur eine einzelne Klasse erweitern.",
"Classes_containing_abstract_methods_must_be_marked_abstract_2514": "Klassen, die abstrakte Methoden enthalten, müssen als abstrakt markiert werden.",
@@ -273,6 +276,7 @@
"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "Der Konstruktor der Klasse \"{0}\" ist geschützt. Auf ihn kann nur innerhalb der Klassendeklaration zugegriffen werden.",
"Constructors_for_derived_classes_must_contain_a_super_call_2377": "Konstruktoren für abgeleitete Klassen müssen einen Aufruf \"super\" enthalten.",
"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Die enthaltene Datei wird nicht angegeben, und das Stammverzeichnis kann nicht ermittelt werden. Die Suche im Ordner \"node_modules\" wird übersprungen.",
+ "Convert_0_to_mapped_object_type_95055": "\"{0}\" in zugeordneten Objekttyp konvertieren",
"Convert_all_constructor_functions_to_classes_95045": "Alle Konstruktorfunktionen in Klassen konvertieren",
"Convert_all_require_to_import_95048": "Alle Aufrufe von \"require\" in \"import\" konvertieren",
"Convert_all_to_default_imports_95035": "Alle in Standardimporte konvertieren",
@@ -708,10 +712,13 @@
"Redirect_output_structure_to_the_directory_6006": "Die Ausgabestruktur in das Verzeichnis umleiten.",
"Referenced_project_0_must_have_setting_composite_Colon_true_6306": "Das referenzierte Projekt \"{0}\" muss für die Einstellung \"composite\" den Wert TRUE aufweisen.",
"Remove_all_unreachable_code_95051": "Gesamten nicht erreichbaren Code entfernen",
+ "Remove_all_unused_labels_95054": "Alle nicht verwendeten Bezeichnungen entfernen",
"Remove_declaration_for_Colon_0_90004": "Deklaration entfernen für: {0}",
"Remove_destructuring_90009": "Destrukturierung entfernen",
"Remove_import_from_0_90005": "Import aus \"{0}\" entfernen",
"Remove_unreachable_code_95050": "Nicht erreichbaren Code entfernen",
+ "Remove_unused_label_95053": "Nicht verwendete Bezeichnung entfernen",
+ "Remove_variable_statement_90010": "Variablenanweisung entfernen",
"Replace_import_with_0_95015": "Ersetzen Sie den Import durch \"{0}\".",
"Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "Fehler melden, wenn nicht alle Codepfade in der Funktion einen Wert zurückgeben.",
"Report_errors_for_fallthrough_cases_in_switch_statement_6076": "Für FallTrough-Fälle in switch-Anweisung Fehler melden.",
diff --git a/lib/enu/diagnosticMessages.generated.json.lcg b/lib/enu/diagnosticMessages.generated.json.lcg
index 3ea2129b89b..dfa254800c9 100644
--- a/lib/enu/diagnosticMessages.generated.json.lcg
+++ b/lib/enu/diagnosticMessages.generated.json.lcg
@@ -735,6 +735,12 @@
+ -
+
+
+
+
+
-
@@ -1551,6 +1557,12 @@
+ -
+
+
+
+
+
-
@@ -1659,6 +1671,12 @@
+ -
+
+
+
+
+
-
@@ -1689,6 +1707,18 @@
+ -
+
+
+
+
+
+ -
+
+
+
+
+
-
@@ -3501,6 +3531,12 @@
+ -
+
+
+
+
+
-
@@ -4305,6 +4341,12 @@
+ -
+
+
+
+
+
-
@@ -5619,6 +5661,12 @@
+ -
+
+
+
+
+
-
diff --git a/lib/es/diagnosticMessages.generated.json b/lib/es/diagnosticMessages.generated.json
index 9d6ee4cc1f9..debe11fef02 100644
--- a/lib/es/diagnosticMessages.generated.json
+++ b/lib/es/diagnosticMessages.generated.json
@@ -106,7 +106,7 @@
"Add_initializer_to_property_0_95019": "Agregar inicializador a la propiedad \"{0}\"",
"Add_initializers_to_all_uninitialized_properties_95027": "Agregar inicializadores a todas las propiedades sin inicializar",
"Add_missing_super_call_90001": "Agregar la llamada a \"super()\" que falta",
- "Add_missing_typeof_95052": "Agregar el objeto typeof que falta",
+ "Add_missing_typeof_95052": "Agregar el elemento \"typeof\" que falta",
"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037": "Agregar un calificador a todas las variables no resueltas que coincidan con un nombre de miembro",
"Add_to_all_uncalled_decorators_95044": "Agregar \"()\" a todos los elementos Decorator a los que no se llama",
"Add_ts_ignore_to_all_error_messages_95042": "Agregar \"@ts-ignore\" a todos los mensajes de error",
@@ -120,6 +120,7 @@
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Todas las declaraciones de un método abstracto deben ser consecutivas.",
"All_destructured_elements_are_unused_6198": "Todos los elementos desestructurados están sin utilizar.",
"All_imports_in_import_declaration_are_unused_6192": "Todas las importaciones de la declaración de importación están sin utilizar.",
+ "All_variables_are_unused_6199": "Todas las variables son no utilizadas.",
"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "Permitir las importaciones predeterminadas de los módulos sin exportación predeterminada. Esto no afecta a la emisión de código, solo a la comprobación de tipos.",
"Allow_javascript_files_to_be_compiled_6102": "Permitir que se compilen los archivos de JavaScript.",
"Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209": "No se permiten enumeraciones const de ambiente cuando se proporciona la marca \"--isolatedModules\".",
@@ -256,6 +257,7 @@
"Class_0_used_before_its_declaration_2449": "Se ha usado la clase \"{0}\" antes de declararla.",
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Las declaraciones de clase no pueden tener más de una etiqueta \"@augments\" o \"@extends\".",
"Class_name_cannot_be_0_2414": "El nombre de la clase no puede ser \"{0}\".",
+ "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725": "El nombre de clase no puede ser \"Object\" cuando el destino es ES5 con un módulo {0}.",
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "El lado estático de la clase '{0}' extiende el lado estático de la clase base '{1}' de forma incorrecta.",
"Classes_can_only_extend_a_single_class_1174": "Las clases solo pueden extender una clase única.",
"Classes_containing_abstract_methods_must_be_marked_abstract_2514": "Las clases con métodos abstractos deben marcarse como abstractas.",
@@ -274,11 +276,14 @@
"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "El constructor de la clase '{0}' está protegido y solo es accesible desde la declaración de la clase.",
"Constructors_for_derived_classes_must_contain_a_super_call_2377": "Los constructores de las clases derivadas deben contener una llamada a \"super\".",
"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "El archivo contenedor no se ha especificado y no se puede determinar el directorio raíz. Se omitirá la búsqueda en la carpeta 'node_modules'.",
+ "Convert_0_to_mapped_object_type_95055": "Convertir \"{0}\" en el tipo de objeto asignado",
"Convert_all_constructor_functions_to_classes_95045": "Convertir todas las funciones de constructor en clases",
"Convert_all_require_to_import_95048": "Convertir todas las repeticiones de \"require\" en \"import\"",
"Convert_all_to_default_imports_95035": "Convertir todo en importaciones predeterminadas",
"Convert_function_0_to_class_95002": "Convertir la función \"{0}\" en una clase",
"Convert_function_to_an_ES2015_class_95001": "Convertir la función en una clase ES2015",
+ "Convert_named_imports_to_namespace_import_95057": "Convertir importaciones con nombre en una importación de espacio de nombres",
+ "Convert_namespace_import_to_named_imports_95056": "Convertir una importación de espacio de nombres en importaciones con nombre",
"Convert_require_to_import_95047": "Convertir \"require\" en \"import\"",
"Convert_to_ES6_module_95017": "Convertir en módulo ES6",
"Convert_to_default_import_95013": "Convertir en importación predeterminada",
@@ -581,6 +586,7 @@
"Not_all_code_paths_return_a_value_7030": "No todas las rutas de acceso de código devuelven un valor.",
"Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "El tipo de índice numérico '{0}' no se puede asignar a un tipo de índice de cadena '{1}'.",
"Numeric_separators_are_not_allowed_here_6188": "Aquí no se permiten separadores numéricos.",
+ "Object_is_of_type_unknown_2571": "El objeto es de tipo \"desconocido\".",
"Object_is_possibly_null_2531": "El objeto es posiblemente \"null\".",
"Object_is_possibly_null_or_undefined_2533": "El objeto es posiblemente \"null\" o \"undefined\".",
"Object_is_possibly_undefined_2532": "El objeto es posiblemente \"undefined\".",
@@ -709,12 +715,13 @@
"Redirect_output_structure_to_the_directory_6006": "Redirija la estructura de salida al directorio.",
"Referenced_project_0_must_have_setting_composite_Colon_true_6306": "El proyecto \"{0}\" al que se hace referencia debe tener el valor \"composite\": true.",
"Remove_all_unreachable_code_95051": "Quitar todo el código inaccesible",
- "Remove_all_unused_labels_95054": "Remove all unused labels",
+ "Remove_all_unused_labels_95054": "Quitar todas las etiquetas no utilizadas",
"Remove_declaration_for_Colon_0_90004": "Quitar declaración de: \"{0}\"",
"Remove_destructuring_90009": "Quitar la desestructuración",
"Remove_import_from_0_90005": "Quitar importación de \"{0}\"",
"Remove_unreachable_code_95050": "Quitar el código inaccesible",
- "Remove_unused_label_95053": "Remove unused label",
+ "Remove_unused_label_95053": "Quitar etiqueta no utilizada",
+ "Remove_variable_statement_90010": "Quitar la declaración de variable",
"Replace_import_with_0_95015": "Reemplazar importación por \"{0}\".",
"Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "Notificar un error cuando no todas las rutas de acceso de código en funcionamiento devuelven un valor.",
"Report_errors_for_fallthrough_cases_in_switch_statement_6076": "Notificar errores de los casos de fallthrough en la instrucción switch.",
diff --git a/lib/fr/diagnosticMessages.generated.json b/lib/fr/diagnosticMessages.generated.json
index 23f0d175862..55ad54ddf55 100644
--- a/lib/fr/diagnosticMessages.generated.json
+++ b/lib/fr/diagnosticMessages.generated.json
@@ -106,7 +106,7 @@
"Add_initializer_to_property_0_95019": "Ajouter un initialiseur à la propriété '{0}'",
"Add_initializers_to_all_uninitialized_properties_95027": "Ajouter des initialiseurs à toutes les propriétés non initialisées",
"Add_missing_super_call_90001": "Ajouter l'appel manquant à 'super()'",
- "Add_missing_typeof_95052": "Ajouter un typeof manquant",
+ "Add_missing_typeof_95052": "Ajouter un 'typeof' manquant",
"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037": "Ajouter un qualificateur à toutes les variables non résolues correspondant à un nom de membre",
"Add_to_all_uncalled_decorators_95044": "Ajouter '()' à tous les décorateurs non appelés",
"Add_ts_ignore_to_all_error_messages_95042": "Ajouter '@ts-ignore' à tous les messages d'erreur",
@@ -120,6 +120,7 @@
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Toutes les déclarations d'une méthode abstraite doivent être consécutives.",
"All_destructured_elements_are_unused_6198": "Tous les éléments déstructurés sont inutilisés.",
"All_imports_in_import_declaration_are_unused_6192": "Les importations de la déclaration d'importation ne sont pas toutes utilisées.",
+ "All_variables_are_unused_6199": "Toutes les variables sont inutilisées.",
"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "Autorisez les importations par défaut à partir des modules sans exportation par défaut. Cela n'affecte pas l'émission du code, juste le contrôle de type.",
"Allow_javascript_files_to_be_compiled_6102": "Autorisez la compilation des fichiers JavaScript.",
"Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209": "Les enums const ambiants ne sont pas autorisés quand l'indicateur '--isolatedModules' est fourni.",
@@ -256,6 +257,7 @@
"Class_0_used_before_its_declaration_2449": "Classe '{0}' utilisée avant sa déclaration.",
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Les déclarations de classes ne peuvent pas avoir plusieurs balises '@augments' ou '@extends'.",
"Class_name_cannot_be_0_2414": "Le nom de la classe ne peut pas être '{0}'.",
+ "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725": "Le nom de la classe ne peut pas être 'Object' quand ES5 est ciblé avec le module {0}.",
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "Le côté statique de la classe '{0}' étend de manière incorrecte le côté statique de la classe de base '{1}'.",
"Classes_can_only_extend_a_single_class_1174": "Les classes ne peuvent étendre qu'une seule classe.",
"Classes_containing_abstract_methods_must_be_marked_abstract_2514": "Les classes contenant des méthodes abstraites doivent être marquées comme étant abstraites.",
@@ -274,11 +276,14 @@
"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "Le constructeur de la classe '{0}' est protégé et uniquement accessible dans la déclaration de classe.",
"Constructors_for_derived_classes_must_contain_a_super_call_2377": "Les constructeurs pour les classes dérivées doivent contenir un appel de 'super'.",
"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Fichier conteneur non spécifié et répertoire racine impossible à déterminer. Recherche ignorée dans le dossier 'node_modules'.",
+ "Convert_0_to_mapped_object_type_95055": "Convertir '{0}' en type d'objet mappé",
"Convert_all_constructor_functions_to_classes_95045": "Convertir toutes les fonctions de constructeur en classes",
"Convert_all_require_to_import_95048": "Convertir tous les 'require' en 'import'",
"Convert_all_to_default_imports_95035": "Convertir tout en importations par défaut",
"Convert_function_0_to_class_95002": "Convertir la fonction '{0}' en classe",
"Convert_function_to_an_ES2015_class_95001": "Convertir la fonction en classe ES2015",
+ "Convert_named_imports_to_namespace_import_95057": "Convertir les importations nommées en importation d'espace de noms",
+ "Convert_namespace_import_to_named_imports_95056": "Convertir l'importation d'espace de noms en importations nommées",
"Convert_require_to_import_95047": "Convertir 'require' en 'import'",
"Convert_to_ES6_module_95017": "Convertir en module ES6",
"Convert_to_default_import_95013": "Convertir en importation par défaut",
@@ -581,6 +586,7 @@
"Not_all_code_paths_return_a_value_7030": "Les chemins de code ne retournent pas tous une valeur.",
"Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "Impossible d'assigner le type d'index numérique '{0}' au type d'index de chaîne '{1}'.",
"Numeric_separators_are_not_allowed_here_6188": "Les séparateurs numériques ne sont pas autorisés ici.",
+ "Object_is_of_type_unknown_2571": "L'objet est de type 'unknown'.",
"Object_is_possibly_null_2531": "L'objet a peut-être la valeur 'null'.",
"Object_is_possibly_null_or_undefined_2533": "L'objet a peut-être la valeur 'null' ou 'undefined'.",
"Object_is_possibly_undefined_2532": "L'objet a peut-être la valeur 'undefined'.",
@@ -709,10 +715,13 @@
"Redirect_output_structure_to_the_directory_6006": "Rediriger la structure de sortie vers le répertoire.",
"Referenced_project_0_must_have_setting_composite_Colon_true_6306": "Le projet référencé '{0}' doit avoir le paramètre \"composite\" avec la valeur true.",
"Remove_all_unreachable_code_95051": "Supprimer tout le code inaccessible",
+ "Remove_all_unused_labels_95054": "Supprimer toutes les étiquettes inutilisées",
"Remove_declaration_for_Colon_0_90004": "Supprimer la déclaration pour : '{0}'",
"Remove_destructuring_90009": "Supprimer la déstructuration",
"Remove_import_from_0_90005": "Supprimer l'importation de '{0}'",
"Remove_unreachable_code_95050": "Supprimer le code inaccessible",
+ "Remove_unused_label_95053": "Supprimer l'étiquette inutilisée",
+ "Remove_variable_statement_90010": "Supprimer l'instruction de variable",
"Replace_import_with_0_95015": "Remplacez l'importation par '{0}'.",
"Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "Signalez une erreur quand les chemins de code de la fonction ne retournent pas tous une valeur.",
"Report_errors_for_fallthrough_cases_in_switch_statement_6076": "Signalez les erreurs pour les case avec fallthrough dans une instruction switch.",
diff --git a/lib/it/diagnosticMessages.generated.json b/lib/it/diagnosticMessages.generated.json
index b7463e378ef..d69031f584a 100644
--- a/lib/it/diagnosticMessages.generated.json
+++ b/lib/it/diagnosticMessages.generated.json
@@ -106,6 +106,7 @@
"Add_initializer_to_property_0_95019": "Aggiungere l'inizializzatore alla proprietà '{0}'",
"Add_initializers_to_all_uninitialized_properties_95027": "Aggiungere gli inizializzatori a tutte le proprietà non inizializzate",
"Add_missing_super_call_90001": "Aggiungere la chiamata mancante a 'super()'",
+ "Add_missing_typeof_95052": "Aggiungere l'elemento 'typeof' mancante",
"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037": "Aggiungere il qualificatore a tutte le variabili non risolte corrispondenti a un nome di membro",
"Add_to_all_uncalled_decorators_95044": "Aggiungere '()' a tutti gli elementi Decorator non chiamati",
"Add_ts_ignore_to_all_error_messages_95042": "Aggiungere '@ts-ignore' a tutti i messaggi di errore",
@@ -119,6 +120,7 @@
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Tutte le dichiarazioni di un metodo astratto devono essere consecutive.",
"All_destructured_elements_are_unused_6198": "Tutti gli elementi destrutturati sono inutilizzati.",
"All_imports_in_import_declaration_are_unused_6192": "Tutte le importazioni nella dichiarazione di importazione sono inutilizzate.",
+ "All_variables_are_unused_6199": "Tutte le variabili sono inutilizzate.",
"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "Consente di eseguire importazioni predefinite da moduli senza esportazione predefinita. Non influisce sulla creazione del codice ma solo sul controllo dei tipi.",
"Allow_javascript_files_to_be_compiled_6102": "Consente la compilazione di file JavaScript.",
"Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209": "Le enumerazioni const di ambiente non sono consentite quando viene specificato il flag '--isolatedModules'.",
@@ -255,6 +257,7 @@
"Class_0_used_before_its_declaration_2449": "La classe '{0}' è stata usata prima di essere stata dichiarata.",
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Le dichiarazioni di classe non possono contenere più di un tag `@augments` o `@extends`.",
"Class_name_cannot_be_0_2414": "Il nome della classe non può essere '{0}'.",
+ "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725": "Il nome della classe non può essere 'Object' quando la destinazione è ES5 con il modulo {0}.",
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "Il lato statico '{0}' della classe estende in modo errato il lato statico '{1}' della classe di base.",
"Classes_can_only_extend_a_single_class_1174": "Le classi possono estendere solo un'unica classe.",
"Classes_containing_abstract_methods_must_be_marked_abstract_2514": "Le classi che contengono metodi astratti devono essere contrassegnate come astratte.",
@@ -273,11 +276,14 @@
"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "Il costruttore della classe '{0}' è protetto e accessibile solo all'interno della dichiarazione di classe.",
"Constructors_for_derived_classes_must_contain_a_super_call_2377": "I costruttori di classi derivate devono contenere una chiamata 'super'.",
"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Il file contenitore non è specificato e non è possibile determinare la directory radice. La ricerca nella cartella 'node_modules' verrà ignorata.",
+ "Convert_0_to_mapped_object_type_95055": "Convertire '{0}' nel tipo di oggetto con mapping",
"Convert_all_constructor_functions_to_classes_95045": "Convertire tutte le funzioni di costruttore in classi",
"Convert_all_require_to_import_95048": "Convertire tutte le occorrenze di 'require' in 'import'",
"Convert_all_to_default_imports_95035": "Convertire tutte le impostazioni predefinite",
"Convert_function_0_to_class_95002": "Converti la funzione '{0}' in classe",
"Convert_function_to_an_ES2015_class_95001": "Converti la funzione in una classe ES2015",
+ "Convert_named_imports_to_namespace_import_95057": "Convertire le importazioni denominate in importazione spazi dei nomi",
+ "Convert_namespace_import_to_named_imports_95056": "Convertire l'importazione spazi dei nomi in importazioni denominate",
"Convert_require_to_import_95047": "Convertire 'require' in 'import'",
"Convert_to_ES6_module_95017": "Converti in modulo ES6",
"Convert_to_default_import_95013": "Converti nell'importazione predefinita",
@@ -580,6 +586,7 @@
"Not_all_code_paths_return_a_value_7030": "Non tutti i percorsi del codice restituiscono un valore.",
"Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "Il tipo di indice numerico '{0}' non è assegnabile al tipo di indice stringa '{1}'.",
"Numeric_separators_are_not_allowed_here_6188": "I separatori numerici non sono consentiti in questa posizione.",
+ "Object_is_of_type_unknown_2571": "L'oggetto è di tipo 'unknown'.",
"Object_is_possibly_null_2531": "L'oggetto è probabilmente 'null'.",
"Object_is_possibly_null_or_undefined_2533": "L'oggetto è probabilmente 'null' o 'undefined'.",
"Object_is_possibly_undefined_2532": "L'oggetto è probabilmente 'undefined'.",
@@ -708,10 +715,13 @@
"Redirect_output_structure_to_the_directory_6006": "Reindirizza la struttura di output alla directory.",
"Referenced_project_0_must_have_setting_composite_Colon_true_6306": "Il progetto di riferimento '{0}' deve includere l'impostazione \"composite\": true.",
"Remove_all_unreachable_code_95051": "Rimuovere tutto il codice non eseguibile",
+ "Remove_all_unused_labels_95054": "Rimuovere tutte le etichette inutilizzate",
"Remove_declaration_for_Colon_0_90004": "Rimuovere la dichiarazione per '{0}'",
"Remove_destructuring_90009": "Rimuovere la destrutturazione",
"Remove_import_from_0_90005": "Rimuovere l'importazione da '{0}'",
"Remove_unreachable_code_95050": "Rimuovere il codice non eseguibile",
+ "Remove_unused_label_95053": "Rimuovere l'etichetta inutilizzata",
+ "Remove_variable_statement_90010": "Rimuovere l'istruzione di variabile",
"Replace_import_with_0_95015": "Sostituire l'importazione con '{0}'.",
"Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "Segnala l'errore quando non tutti i percorsi del codice nella funzione restituiscono un valore.",
"Report_errors_for_fallthrough_cases_in_switch_statement_6076": "Segnala errori per i casi di fallthrough nell'istruzione switch.",
diff --git a/lib/ja/diagnosticMessages.generated.json b/lib/ja/diagnosticMessages.generated.json
index 6189d07adce..21721d5f147 100644
--- a/lib/ja/diagnosticMessages.generated.json
+++ b/lib/ja/diagnosticMessages.generated.json
@@ -106,6 +106,7 @@
"Add_initializer_to_property_0_95019": "プロパティ '{0}' に初期化子を追加します",
"Add_initializers_to_all_uninitialized_properties_95027": "初期化されていないすべてのプロパティに初期化子を追加します",
"Add_missing_super_call_90001": "欠落している 'super()' 呼び出しを追加する",
+ "Add_missing_typeof_95052": "不足している 'typeof' を追加します",
"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037": "メンバー名と一致するすべての未解決の変数に修飾子を追加します",
"Add_to_all_uncalled_decorators_95044": "呼び出されていないすべてのデコレーターに '()' を追加します",
"Add_ts_ignore_to_all_error_messages_95042": "すべてのエラー メッセージに '@ts-ignore' を追加します",
@@ -119,6 +120,7 @@
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "抽象メソッドの宣言はすべて連続している必要があります。",
"All_destructured_elements_are_unused_6198": "非構造化要素はいずれも使用されていません。",
"All_imports_in_import_declaration_are_unused_6192": "インポート宣言内のインポートはすべて未使用です。",
+ "All_variables_are_unused_6199": "すべての変数は未使用です。",
"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "既定のエクスポートがないモジュールからの既定のインポートを許可します。これは、型チェックのみのため、コード生成には影響を与えません。",
"Allow_javascript_files_to_be_compiled_6102": "javascript ファイルのコンパイルを許可します。",
"Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209": "'--isolatedModules' フラグが指定されている場合、アンビエント const 列挙型は使用できません。",
@@ -255,6 +257,7 @@
"Class_0_used_before_its_declaration_2449": "クラス '{0}' は宣言の前に使用されました。",
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "クラス宣言で複数の '@augments' または `@extends` タグを使用することはできません。",
"Class_name_cannot_be_0_2414": "クラス名を '{0}' にすることはできません。",
+ "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725": "モジュール {0} を使用して ES5 をターゲットとするときに、クラス名を 'オブジェクト' にすることはできません。",
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "クラス側の静的な '{0}' が基底クラス側の静的な '{1}' を正しく拡張していません。",
"Classes_can_only_extend_a_single_class_1174": "クラスで拡張できるクラスは 1 つのみです。",
"Classes_containing_abstract_methods_must_be_marked_abstract_2514": "抽象メソッドを含むクラスは abstract に指定する必要があります。",
@@ -273,6 +276,7 @@
"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "クラス '{0}' のコンストラクターは保護されており、クラス宣言内でのみアクセス可能です。",
"Constructors_for_derived_classes_must_contain_a_super_call_2377": "派生クラスのコンストラクターには 'super' の呼び出しを含める必要があります。",
"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "包含するファイルが指定されていないため、ルート ディレクトリを決定できません。'node_modules' フォルダーのルックアップをスキップします。",
+ "Convert_0_to_mapped_object_type_95055": "'{0}' をマップされたオブジェクト型に変換する",
"Convert_all_constructor_functions_to_classes_95045": "すべてのコンストラクター関数をクラスに変換します",
"Convert_all_require_to_import_95048": "'require' をすべて 'import' に変換",
"Convert_all_to_default_imports_95035": "すべてを既定のインポートに変換します",
@@ -708,10 +712,13 @@
"Redirect_output_structure_to_the_directory_6006": "ディレクトリへ出力構造をリダイレクトします。",
"Referenced_project_0_must_have_setting_composite_Colon_true_6306": "参照されているプロジェクト '{0}' には、設定 \"composite\": true が必要です。",
"Remove_all_unreachable_code_95051": "到達できないコードをすべて削除します",
+ "Remove_all_unused_labels_95054": "すべての未使用のラベルを削除します",
"Remove_declaration_for_Colon_0_90004": "次に対する宣言を削除する: '{0}'",
"Remove_destructuring_90009": "非構造化を削除します",
"Remove_import_from_0_90005": "'{0}' からのインポートを削除",
"Remove_unreachable_code_95050": "到達できないコードを削除します",
+ "Remove_unused_label_95053": "未使用のラベルを削除します",
+ "Remove_variable_statement_90010": "変数のステートメントを削除します",
"Replace_import_with_0_95015": "インポートを '{0}' に置換します。",
"Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "関数の一部のコード パスが値を返さない場合にエラーを報告します。",
"Report_errors_for_fallthrough_cases_in_switch_statement_6076": "switch ステートメントに case のフォールスルーがある場合にエラーを報告します。",
diff --git a/lib/ko/diagnosticMessages.generated.json b/lib/ko/diagnosticMessages.generated.json
index 9ab72b1379f..a75f68d2b77 100644
--- a/lib/ko/diagnosticMessages.generated.json
+++ b/lib/ko/diagnosticMessages.generated.json
@@ -106,6 +106,7 @@
"Add_initializer_to_property_0_95019": "'{0}' 속성에 이니셜라이저 추가",
"Add_initializers_to_all_uninitialized_properties_95027": "초기화되지 않은 모든 속성에 이니셜라이저 추가",
"Add_missing_super_call_90001": "누락된 'super()' 호출 추가",
+ "Add_missing_typeof_95052": "누락된 'typeof' 추가",
"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037": "멤버 이름과 일치하는 모든 확인되지 않은 변수에 한정자 추가",
"Add_to_all_uncalled_decorators_95044": "호출되지 않는 모든 데코레이터에 '()' 추가",
"Add_ts_ignore_to_all_error_messages_95042": "모든 오류 메시지에 '@ts-ignore' 추가",
@@ -119,6 +120,7 @@
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "추상 메서드의 모든 선언은 연속적이어야 합니다.",
"All_destructured_elements_are_unused_6198": "구조 파괴된 요소가 모두 사용되지 않습니다.",
"All_imports_in_import_declaration_are_unused_6192": "가져오기 선언의 모든 가져오기가 사용되지 않습니다.",
+ "All_variables_are_unused_6199": "모든 변수가 사용되지 않습니다.",
"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "기본 내보내기가 없는 모듈에서 기본 가져오기를 허용합니다. 여기서는 코드 내보내기에는 영향을 주지 않고 형식 검사만 합니다.",
"Allow_javascript_files_to_be_compiled_6102": "Javascript 파일을 컴파일하도록 허용합니다.",
"Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209": "'--isolatedModules' 플래그가 제공된 경우 앰비언트 const 열거형이 허용되지 않습니다.",
@@ -255,6 +257,7 @@
"Class_0_used_before_its_declaration_2449": "선언 전에 사용된 '{0}' 클래스입니다.",
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "클래스 선언은 '@augments' 또는 `@extends` 태그를 둘 이상 가질 수 없습니다.",
"Class_name_cannot_be_0_2414": "클래스 이름은 '{0}'일 수 없습니다.",
+ "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725": "{0} 모듈을 사용하는 ES5를 대상으로 하는 경우 클래스 이름은 'Object'일 수 없습니다.",
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "클래스 정적 측면 '{0}'이(가) 기본 클래스 정적 측면 '{1}'을(를) 잘못 확장합니다.",
"Classes_can_only_extend_a_single_class_1174": "클래스는 단일 클래스만 확장할 수 있습니다.",
"Classes_containing_abstract_methods_must_be_marked_abstract_2514": "추상 메서드를 포함하는 클래스는 abstract로 표시되어 있어야 합니다.",
@@ -273,11 +276,14 @@
"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "'{0}' 클래스의 생성자는 protected이며 클래스 선언 내에서만 액세스할 수 있습니다.",
"Constructors_for_derived_classes_must_contain_a_super_call_2377": "파생 클래스의 생성자는 'super' 호출을 포함해야 합니다.",
"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "포함 파일이 지정되지 않았고 루트 디렉터리를 확인할 수 없어 'node_modules' 폴더 조회를 건너뜁니다.",
+ "Convert_0_to_mapped_object_type_95055": "'{0}'을(를) 매핑된 개체 형식으로 변환",
"Convert_all_constructor_functions_to_classes_95045": "모든 생성자 함수를 클래스로 변환",
"Convert_all_require_to_import_95048": "모든 'require'를 'import'로 변환",
"Convert_all_to_default_imports_95035": "모든 항목을 기본 가져오기로 변환",
"Convert_function_0_to_class_95002": "'{0}' 함수를 클래스로 변환",
"Convert_function_to_an_ES2015_class_95001": "함수를 ES2015 클래스로 변환",
+ "Convert_named_imports_to_namespace_import_95057": "명명된 가져오기를 네임스페이스 가져오기로 변환",
+ "Convert_namespace_import_to_named_imports_95056": "네임스페이스 가져오기를 명명된 가져오기로 변환",
"Convert_require_to_import_95047": "'require'를 'import'로 변환",
"Convert_to_ES6_module_95017": "ES6 모듈로 변환",
"Convert_to_default_import_95013": "기본 가져오기로 변환",
@@ -580,6 +586,7 @@
"Not_all_code_paths_return_a_value_7030": "일부 코드 경로가 값을 반환하지 않습니다.",
"Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "숫자 인덱스 형식 '{0}'을(를) 문자열 인덱스 형식 '{1}'에 할당할 수 없습니다.",
"Numeric_separators_are_not_allowed_here_6188": "숫자 구분 기호는 여기에서 허용되지 않습니다.",
+ "Object_is_of_type_unknown_2571": "개체가 '알 수 없는' 형식입니다.",
"Object_is_possibly_null_2531": "개체가 'null'인 것 같습니다.",
"Object_is_possibly_null_or_undefined_2533": "개체가 'null' 또는 'undefined'인 것 같습니다.",
"Object_is_possibly_undefined_2532": "개체가 'undefined'인 것 같습니다.",
@@ -708,10 +715,13 @@
"Redirect_output_structure_to_the_directory_6006": "출력 구조를 디렉터리로 리디렉션합니다.",
"Referenced_project_0_must_have_setting_composite_Colon_true_6306": "참조되는 프로젝트 '{0}'에는 \"composite\": true 설정이 있어야 합니다.",
"Remove_all_unreachable_code_95051": "접근할 수 없는 코드 모두 제거",
+ "Remove_all_unused_labels_95054": "사용되지 않는 레이블 모두 제거",
"Remove_declaration_for_Colon_0_90004": "'{0}'에 대한 선언 제거",
"Remove_destructuring_90009": "구조 파괴 제거",
"Remove_import_from_0_90005": "'{0}'에서 가져오기 제거",
"Remove_unreachable_code_95050": "접근할 수 없는 코드 제거",
+ "Remove_unused_label_95053": "사용되지 않는 레이블 제거",
+ "Remove_variable_statement_90010": "변수 문 제거",
"Replace_import_with_0_95015": "가져오기를 '{0}'(으)로 바꿉니다.",
"Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "함수의 일부 코드 경로가 값을 반환하지 않는 경우 오류를 보고합니다.",
"Report_errors_for_fallthrough_cases_in_switch_statement_6076": "switch 문의 fallthrough case에 대한 오류를 보고합니다.",
diff --git a/lib/lib.es2015.core.d.ts b/lib/lib.es2015.core.d.ts
index 16105331f1f..7c43b36c424 100644
--- a/lib/lib.es2015.core.d.ts
+++ b/lib/lib.es2015.core.d.ts
@@ -222,29 +222,29 @@ interface NumberConstructor {
* Returns true if passed value is finite.
* Unlike the global isFinite, Number.isFinite doesn't forcibly convert the parameter to a
* number. Only finite values of the type number, result in true.
- * @param value The value you want to test.
+ * @param number A numeric value.
*/
- isFinite(value: any): boolean;
+ isFinite(number: number): boolean;
/**
* Returns true if the value passed is an integer, false otherwise.
- * @param value The value you want to test.
+ * @param number A numeric value.
*/
- isInteger(value: any): boolean;
+ isInteger(number: number): boolean;
/**
* Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
* number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter
* to a number. Only values of the type number, that are also NaN, result in true.
- * @param value The value you want to test.
+ * @param number A numeric value.
*/
- isNaN(number: any): boolean;
+ isNaN(number: number): boolean;
/**
* Returns true if the value passed is a safe integer.
- * @param value The value you want to test
+ * @param number A numeric value.
*/
- isSafeInteger(value: any): boolean;
+ isSafeInteger(number: number): boolean;
/**
* The value of the largest integer n such that n and n + 1 are both exactly representable as
diff --git a/lib/lib.esnext.array.d.ts b/lib/lib.esnext.array.d.ts
index ce26358d3d6..3da8562d2ea 100644
--- a/lib/lib.esnext.array.d.ts
+++ b/lib/lib.esnext.array.d.ts
@@ -23,7 +23,7 @@ interface ReadonlyArray {
/**
* Calls a defined callback function on each element of an array. Then, flattens the result into
* a new array.
- * This is identical to a map followed by a flatten of depth 1.
+ * This is identical to a map followed by flat with depth 1.
*
* @param callback A function that accepts up to three arguments. The flatMap method calls the
* callback function one time for each element in the array.
@@ -42,7 +42,7 @@ interface ReadonlyArray {
*
* @param depth The maximum recursion depth
*/
- flatten(this:
+ flat(this:
ReadonlyArray |
ReadonlyArray> |
@@ -71,7 +71,7 @@ interface ReadonlyArray {
*
* @param depth The maximum recursion depth
*/
- flatten(this:
+ flat(this:
ReadonlyArray |
ReadonlyArray[][]> |
@@ -91,7 +91,7 @@ interface ReadonlyArray {
*
* @param depth The maximum recursion depth
*/
- flatten(this:
+ flat(this:
ReadonlyArray |
ReadonlyArray> |
@@ -106,7 +106,7 @@ interface ReadonlyArray {
*
* @param depth The maximum recursion depth
*/
- flatten(this:
+ flat(this:
ReadonlyArray |
ReadonlyArray>,
depth?: 1
@@ -118,18 +118,18 @@ interface ReadonlyArray {
*
* @param depth The maximum recursion depth
*/
- flatten(this:
+ flat(this:
ReadonlyArray,
depth: 0
): U[];
/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
- * specified depth. If no depth is provided, flatten method defaults to the depth of 1.
+ * specified depth. If no depth is provided, flat method defaults to the depth of 1.
*
* @param depth The maximum recursion depth
*/
- flatten(depth?: number): any[];
+ flat(depth?: number): any[];
}
interface Array {
@@ -137,7 +137,7 @@ interface Array {
/**
* Calls a defined callback function on each element of an array. Then, flattens the result into
* a new array.
- * This is identical to a map followed by a flatten of depth 1.
+ * This is identical to a map followed by flat with depth 1.
*
* @param callback A function that accepts up to three arguments. The flatMap method calls the
* callback function one time for each element in the array.
@@ -155,7 +155,7 @@ interface Array {
*
* @param depth The maximum recursion depth
*/
- flatten(this: U[][][][][][][][], depth: 7): U[];
+ flat(this: U[][][][][][][][], depth: 7): U[];
/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
@@ -163,7 +163,7 @@ interface Array {
*
* @param depth The maximum recursion depth
*/
- flatten(this: U[][][][][][][], depth: 6): U[];
+ flat(this: U[][][][][][][], depth: 6): U[];
/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
@@ -171,7 +171,7 @@ interface Array {
*
* @param depth The maximum recursion depth
*/
- flatten(this: U[][][][][][], depth: 5): U[];
+ flat(this: U[][][][][][], depth: 5): U[];
/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
@@ -179,7 +179,7 @@ interface Array {
*
* @param depth The maximum recursion depth
*/
- flatten(this: U[][][][][], depth: 4): U[];
+ flat(this: U[][][][][], depth: 4): U[];
/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
@@ -187,7 +187,7 @@ interface Array {
*
* @param depth The maximum recursion depth
*/
- flatten(this: U[][][][], depth: 3): U[];
+ flat(this: U[][][][], depth: 3): U[];
/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
@@ -195,7 +195,7 @@ interface Array {
*
* @param depth The maximum recursion depth
*/
- flatten(this: U[][][], depth: 2): U[];
+ flat(this: U[][][], depth: 2): U[];
/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
@@ -203,7 +203,7 @@ interface Array {
*
* @param depth The maximum recursion depth
*/
- flatten(this: U[][], depth?: 1): U[];
+ flat(this: U[][], depth?: 1): U[];
/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
@@ -211,13 +211,13 @@ interface Array {
*
* @param depth The maximum recursion depth
*/
- flatten(this: U[], depth: 0): U[];
+ flat(this: U[], depth: 0): U[];
/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
- * specified depth. If no depth is provided, flatten method defaults to the depth of 1.
+ * specified depth. If no depth is provided, flat method defaults to the depth of 1.
*
* @param depth The maximum recursion depth
*/
- flatten(depth?: number): any[];
+ flat(depth?: number): any[];
}
diff --git a/lib/lib.esnext.d.ts b/lib/lib.esnext.d.ts
index 095e46de36f..c81534fc03b 100644
--- a/lib/lib.esnext.d.ts
+++ b/lib/lib.esnext.d.ts
@@ -21,3 +21,4 @@ and limitations under the License.
///
///
///
+///
diff --git a/lib/lib.esnext.full.d.ts b/lib/lib.esnext.full.d.ts
index 76d3c72b283..bc9e7060f9e 100644
--- a/lib/lib.esnext.full.d.ts
+++ b/lib/lib.esnext.full.d.ts
@@ -21,6 +21,7 @@ and limitations under the License.
///
///
///
+///
/////////////////////////////
diff --git a/lib/lib.esnext.symbol.d.ts b/lib/lib.esnext.symbol.d.ts
new file mode 100644
index 00000000000..98293eaf572
--- /dev/null
+++ b/lib/lib.esnext.symbol.d.ts
@@ -0,0 +1,26 @@
+/*! *****************************************************************************
+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 Symbol {
+ /**
+ * expose the [[Description]] internal slot of a symbol directly
+ */
+ readonly description: string;
+}
diff --git a/lib/pl/diagnosticMessages.generated.json b/lib/pl/diagnosticMessages.generated.json
index 7a5316e7673..f2891354fe4 100644
--- a/lib/pl/diagnosticMessages.generated.json
+++ b/lib/pl/diagnosticMessages.generated.json
@@ -106,6 +106,7 @@
"Add_initializer_to_property_0_95019": "Dodaj inicjator do właściwości „{0}”",
"Add_initializers_to_all_uninitialized_properties_95027": "Dodaj inicjatory do wszystkich niezainicjowanych właściwości",
"Add_missing_super_call_90001": "Dodaj brakujące wywołanie „super()”",
+ "Add_missing_typeof_95052": "Dodaj brakujący element „typeof”",
"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037": "Dodaj kwalifikator do wszystkich nierozpoznanych zmiennych pasujących do nazwy składowej",
"Add_to_all_uncalled_decorators_95044": "Dodaj element „()” do wszystkich niewywoływanych dekoratorów",
"Add_ts_ignore_to_all_error_messages_95042": "Dodaj element „@ts-ignore” do wszystkich komunikatów o błędach",
@@ -119,6 +120,7 @@
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Wszystkie deklaracje metody abstrakcyjnej muszą występować obok siebie.",
"All_destructured_elements_are_unused_6198": "Wszystkie elementy, których strukturę usunięto, są nieużywane.",
"All_imports_in_import_declaration_are_unused_6192": "Wszystkie importy w deklaracji importu są nieużywane.",
+ "All_variables_are_unused_6199": "Wszystkie zmienne są nieużywane.",
"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "Zezwalaj na domyślne importy z modułów bez domyślnego eksportu. To nie wpływa na emitowanie kodu, a tylko na sprawdzanie typów.",
"Allow_javascript_files_to_be_compiled_6102": "Zezwalaj na kompilowanie plików JavaScript.",
"Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209": "Otaczające wyliczenia ze specyfikacją const nie są dozwolone w przypadku podania flagi „--isolatedModules”.",
@@ -255,6 +257,7 @@
"Class_0_used_before_its_declaration_2449": "Klasa „{0}” została użyta przed zadeklarowaniem.",
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Deklaracje klas nie mogą mieć więcej niż jeden tag „@augments” lub „@extends”.",
"Class_name_cannot_be_0_2414": "Klasa nie może mieć nazwy „{0}”.",
+ "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725": "Nazwą klasy nie może być słowo „Object”, gdy docelowym językiem jest ES5 z modułem {0}.",
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "Strona statyczna klasy „{0}” niepoprawnie rozszerza stronę statyczną klasy bazowej „{1}”.",
"Classes_can_only_extend_a_single_class_1174": "Klasy mogą rozszerzać tylko pojedynczą klasę.",
"Classes_containing_abstract_methods_must_be_marked_abstract_2514": "Klasy zawierające metody abstrakcyjne muszą być oznaczone jako abstrakcyjne.",
@@ -273,11 +276,14 @@
"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "Konstruktor klasy „{0}” jest chroniony i dostępny tylko w ramach deklaracji klasy.",
"Constructors_for_derived_classes_must_contain_a_super_call_2377": "Konstruktory klas pochodnych muszą zawierać wywołanie „super”.",
"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Nie podano pliku zawierającego i nie można określić katalogu głównego. Pomijanie wyszukiwania w folderze „node_modules”.",
+ "Convert_0_to_mapped_object_type_95055": "Konwertuj element „{0}” na zamapowany typ obiektu",
"Convert_all_constructor_functions_to_classes_95045": "Przekonwertuj wszystkie funkcje konstruktora na klasy",
"Convert_all_require_to_import_95048": "Konwertuj wszystkie wywołania „require” na wywołania „import”",
"Convert_all_to_default_imports_95035": "Przekonwertuj wszystko na domyślne importowanie",
"Convert_function_0_to_class_95002": "Konwertuj funkcję „{0}” na klasę",
"Convert_function_to_an_ES2015_class_95001": "Konwertuj funkcję na klasę ES2015",
+ "Convert_named_imports_to_namespace_import_95057": "Konwertuj importy nazwane na import przestrzeni nazw",
+ "Convert_namespace_import_to_named_imports_95056": "Konwertuj import przestrzeni nazw na importy nazwane",
"Convert_require_to_import_95047": "Konwertuj wywołanie „require” na wywołanie „import”",
"Convert_to_ES6_module_95017": "Konwertuj na moduł ES6",
"Convert_to_default_import_95013": "Konwertuj na import domyślny",
@@ -580,6 +586,7 @@
"Not_all_code_paths_return_a_value_7030": "Nie wszystkie ścieżki kodu zwracają wartość.",
"Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "Nie można przypisać typu indeksu numerycznego „{0}” do typu indeksu ciągu „{1}”.",
"Numeric_separators_are_not_allowed_here_6188": "Separatory liczbowe nie są dozwolone w tym miejscu.",
+ "Object_is_of_type_unknown_2571": "Obiekt jest typu „nieznany”.",
"Object_is_possibly_null_2531": "Obiekt ma prawdopodobnie wartość „null”.",
"Object_is_possibly_null_or_undefined_2533": "Obiekt ma prawdopodobnie wartość „null” lub „undefined”.",
"Object_is_possibly_undefined_2532": "Obiekt ma prawdopodobnie wartość „undefined”.",
@@ -708,10 +715,13 @@
"Redirect_output_structure_to_the_directory_6006": "Przekieruj strukturę wyjściową do katalogu.",
"Referenced_project_0_must_have_setting_composite_Colon_true_6306": "Przywoływany projekt „{0}” musi mieć ustawienie „composite” o wartości true.",
"Remove_all_unreachable_code_95051": "Usuń cały nieosiągalny kod",
+ "Remove_all_unused_labels_95054": "Usuń wszystkie nieużywane etykiety",
"Remove_declaration_for_Colon_0_90004": "Usuń deklarację dla: „{0}”",
"Remove_destructuring_90009": "Usuń usuwanie struktury",
"Remove_import_from_0_90005": "Usuń import z „{0}”",
"Remove_unreachable_code_95050": "Usuń nieosiągalny kod",
+ "Remove_unused_label_95053": "Usuń nieużywaną etykietę",
+ "Remove_variable_statement_90010": "Usuń instrukcję zmiennej",
"Replace_import_with_0_95015": "Zamień import na element „{0}”.",
"Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "Zgłoś błąd, gdy nie wszystkie ścieżki kodu zwracają wartość.",
"Report_errors_for_fallthrough_cases_in_switch_statement_6076": "Zgłoś błędy dla przepuszczających klauzul case w instrukcji switch.",
diff --git a/lib/protocol.d.ts b/lib/protocol.d.ts
index dc13cb5f575..b75a2c10e52 100644
--- a/lib/protocol.d.ts
+++ b/lib/protocol.d.ts
@@ -3,6 +3,7 @@
*/
declare namespace ts.server.protocol {
const enum CommandTypes {
+ JsxClosingTag = "jsxClosingTag",
Brace = "brace",
BraceCompletion = "braceCompletion",
GetSpanOfEnclosingComment = "getSpanOfEnclosingComment",
@@ -672,6 +673,15 @@ declare namespace ts.server.protocol {
*/
openingBrace: string;
}
+ interface JsxClosingTagRequest extends FileLocationRequest {
+ readonly command: CommandTypes.JsxClosingTag;
+ readonly arguments: JsxClosingTagRequestArgs;
+ }
+ interface JsxClosingTagRequestArgs extends FileLocationRequestArgs {
+ }
+ interface JsxClosingTagResponse extends Response {
+ readonly body: TextInsertion;
+ }
/**
* @deprecated
* Get occurrences request; value of command field is
@@ -1363,7 +1373,7 @@ declare namespace ts.server.protocol {
}
interface CompletionEntryIdentifier {
name: string;
- source: string;
+ source?: string;
}
/**
* Completion entry details request; value of command field is
@@ -1403,7 +1413,7 @@ declare namespace ts.server.protocol {
/**
* Optional modifiers for the kind (such as 'public').
*/
- kindModifiers: string;
+ kindModifiers?: string;
/**
* A string that is used for comparing completion items so that they can be ordered. This
* is often the same as the name but may be different in certain circumstances.
@@ -1460,11 +1470,11 @@ declare namespace ts.server.protocol {
/**
* Documentation strings for the symbol.
*/
- documentation: SymbolDisplayPart[];
+ documentation?: SymbolDisplayPart[];
/**
* JSDoc tags for the symbol.
*/
- tags: JSDocTagInfo[];
+ tags?: JSDocTagInfo[];
/**
* The associated code actions for this entry
*/
diff --git a/lib/pt-br/diagnosticMessages.generated.json b/lib/pt-br/diagnosticMessages.generated.json
index fd953b416a9..e4a7dfc1ee6 100644
--- a/lib/pt-br/diagnosticMessages.generated.json
+++ b/lib/pt-br/diagnosticMessages.generated.json
@@ -106,7 +106,7 @@
"Add_initializer_to_property_0_95019": "Adicionar inicializador à propriedade '{0}'",
"Add_initializers_to_all_uninitialized_properties_95027": "Adicionar inicializadores a todas as propriedades não inicializadas",
"Add_missing_super_call_90001": "Adicionar chamada 'super()' ausente",
- "Add_missing_typeof_95052": "Adicionar typeof ausente",
+ "Add_missing_typeof_95052": "Adicionar 'typeof' ausente",
"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037": "Adicionar um qualificador a todas as variáveis não resolvidas correspondentes a um nome de membro",
"Add_to_all_uncalled_decorators_95044": "Adicionar '()' a todos os decoradores não chamados",
"Add_ts_ignore_to_all_error_messages_95042": "Adicionar '@ts-ignore' a todas as mensagens de erro",
@@ -120,6 +120,7 @@
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Todas as declarações de um método abstrato devem ser consecutivas.",
"All_destructured_elements_are_unused_6198": "Todos os elementos desestruturados são inutilizados.",
"All_imports_in_import_declaration_are_unused_6192": "Nenhuma das importações na declaração de importação está sendo utilizada.",
+ "All_variables_are_unused_6199": "Nenhuma das variáveis está sendo utilizada.",
"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "Permita importações padrão de módulos sem exportação padrão. Isso não afeta a emissão do código, apenas a verificação de digitação.",
"Allow_javascript_files_to_be_compiled_6102": "Permita que arquivos javascript sejam compilados.",
"Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209": "As enumerações de constante de ambiente não são permitidas quando o sinalizador '--isolatedModules' é fornecido.",
@@ -256,6 +257,7 @@
"Class_0_used_before_its_declaration_2449": "Classe '{0}' usada antes de sua declaração.",
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Declarações de classe não podem ter mais de uma marca `@augments` ou `@extends`.",
"Class_name_cannot_be_0_2414": "O nome de classe não pode ser '{0}'.",
+ "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725": "O nome da classe não pode ser 'Object' ao direcionar ES5 com módulo {0}.",
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "O lado estático da classe '{0}' incorretamente estende o lado estático da classe base '{1}'.",
"Classes_can_only_extend_a_single_class_1174": "Classes só podem estender uma única classe.",
"Classes_containing_abstract_methods_must_be_marked_abstract_2514": "As classes que contêm métodos abstratos devem ser marcadas como abstratas.",
@@ -274,11 +276,14 @@
"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "O construtor de classe '{0}' é protegido e somente acessível na declaração de classe.",
"Constructors_for_derived_classes_must_contain_a_super_call_2377": "Construtores para classes derivadas devem conter uma chamada 'super'.",
"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "O arquivo contido não foi especificado e o diretório raiz não pode ser determinado, ignorando a pesquisa na pasta 'node_modules'.",
+ "Convert_0_to_mapped_object_type_95055": "Converter '{0}' para o tipo de objeto mapeado",
"Convert_all_constructor_functions_to_classes_95045": "Converter todas as funções de construtor em classes",
"Convert_all_require_to_import_95048": "Converter todos os 'require' em 'import'",
"Convert_all_to_default_imports_95035": "Converter tudo para importações padrão",
"Convert_function_0_to_class_95002": "Converter função '{0}' em classe",
"Convert_function_to_an_ES2015_class_95001": "Converter função em uma classe ES2015",
+ "Convert_named_imports_to_namespace_import_95057": "Converter importações nomeadas em importação de namespace",
+ "Convert_namespace_import_to_named_imports_95056": "Converter importação de namespace em importações nomeadas",
"Convert_require_to_import_95047": "Converter 'require' em 'import'",
"Convert_to_ES6_module_95017": "Converter em módulo ES6",
"Convert_to_default_import_95013": "Converter para importação padrão",
@@ -581,6 +586,7 @@
"Not_all_code_paths_return_a_value_7030": "Nem todos os caminhos de código retornam um valor.",
"Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "O tipo de índice numérico '{0}' não é atribuível ao tipo de índice de cadeia de caracteres '{1}'.",
"Numeric_separators_are_not_allowed_here_6188": "Separadores numéricos não são permitidos aqui.",
+ "Object_is_of_type_unknown_2571": "O objeto é do tipo 'desconhecido'.",
"Object_is_possibly_null_2531": "Possivelmente, o objeto é 'nulo'.",
"Object_is_possibly_null_or_undefined_2533": "Possivelmente, o objeto é 'nulo' ou 'indefinido'.",
"Object_is_possibly_undefined_2532": "Possivelmente, o objeto é 'nulo'.",
@@ -709,10 +715,13 @@
"Redirect_output_structure_to_the_directory_6006": "Redirecione a estrutura de saída para o diretório.",
"Referenced_project_0_must_have_setting_composite_Colon_true_6306": "O projeto referenciado '{0}' deve ter a configuração de \"composite\": true.",
"Remove_all_unreachable_code_95051": "Remover todo o código inacessível",
+ "Remove_all_unused_labels_95054": "Remover todos os rótulos não utilizados",
"Remove_declaration_for_Colon_0_90004": "Remover declaração para: '{0}'",
"Remove_destructuring_90009": "Remover desestruturação",
"Remove_import_from_0_90005": "Remover importação do '{0}'",
"Remove_unreachable_code_95050": "Remover código inacessível",
+ "Remove_unused_label_95053": "Remover rótulo não utilizado",
+ "Remove_variable_statement_90010": "Remover instrução de variável",
"Replace_import_with_0_95015": "Substitua a importação com '{0}'.",
"Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "Relate erro quando nem todos os caminhos de código na função retornarem um valor.",
"Report_errors_for_fallthrough_cases_in_switch_statement_6076": "Relate erros para casos de fallthrough na instrução switch.",
diff --git a/lib/ru/diagnosticMessages.generated.json b/lib/ru/diagnosticMessages.generated.json
index dc4efb499e5..fbae0dbc63a 100644
--- a/lib/ru/diagnosticMessages.generated.json
+++ b/lib/ru/diagnosticMessages.generated.json
@@ -106,6 +106,7 @@
"Add_initializer_to_property_0_95019": "Добавить инициализатор к свойству \"{0}\"",
"Add_initializers_to_all_uninitialized_properties_95027": "Добавить инициализаторы ко всем неинициализированным свойствам",
"Add_missing_super_call_90001": "Добавьте отсутствующий вызов \"super()\"",
+ "Add_missing_typeof_95052": "Добавить отсутствующий \"typeof\"",
"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037": "Добавить квалификатор ко всем неразрешенным переменным, соответствующим имени члена",
"Add_to_all_uncalled_decorators_95044": "Добавить \"()\" ко всем невызванным декораторам",
"Add_ts_ignore_to_all_error_messages_95042": "Добавить \"@ts-ignore\" ко всем сообщениям об ошибках",
@@ -119,6 +120,7 @@
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Все объявления абстрактных методов должны быть последовательными.",
"All_destructured_elements_are_unused_6198": "Все деструктурированные элементы не используются.",
"All_imports_in_import_declaration_are_unused_6192": "Ни один из импортов в объявлении импорта не используется.",
+ "All_variables_are_unused_6199": "Ни одна переменная не используется.",
"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "Разрешить импорт по умолчанию из модулей без экспорта по умолчанию. Это не повлияет на выведение кода — только на проверку типов.",
"Allow_javascript_files_to_be_compiled_6102": "Разрешить компиляцию файлов javascript.",
"Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209": "Перечисление внешних констант не разрешено, если задан флаг \"--isolatedModules\".",
@@ -255,6 +257,7 @@
"Class_0_used_before_its_declaration_2449": "Класс \"{0}\" использован прежде, чем объявлен.",
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "В объявлении класса не может использоваться более одного тега \"@augments\" или \"@extends\".",
"Class_name_cannot_be_0_2414": "Имя класса не может иметь значение \"{0}\".",
+ "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725": "Класс не может иметь имя \"Object\" при выборе ES5 с модулем {0} в качестве целевого.",
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "Статическая сторона класса \"{0}\" неправильно расширяет статическую сторону базового класса \"{1}\".",
"Classes_can_only_extend_a_single_class_1174": "Классы могут расширить только один класс.",
"Classes_containing_abstract_methods_must_be_marked_abstract_2514": "Классы, содержащие абстрактные методы, должны быть отмечены как абстрактные.",
@@ -273,11 +276,14 @@
"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "Конструктор класса \"{0}\" защищен и доступен только в объявлении класса.",
"Constructors_for_derived_classes_must_contain_a_super_call_2377": "Конструкторы производных классов должны содержать вызов super.",
"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Содержащий файл не указан, корневой каталог невозможно определить. Выполняется пропуск поиска в папке node_modules.",
+ "Convert_0_to_mapped_object_type_95055": "Преобразовать \"{0}\" в тип сопоставленного объекта",
"Convert_all_constructor_functions_to_classes_95045": "Преобразовать все функции конструктора в классы",
"Convert_all_require_to_import_95048": "Преобразовать все \"require\" в \"import\"",
"Convert_all_to_default_imports_95035": "Преобразовать все в импорт по умолчанию",
"Convert_function_0_to_class_95002": "Преобразование функции \"{0}\" в класс",
"Convert_function_to_an_ES2015_class_95001": "Преобразование функции в класс ES2015",
+ "Convert_named_imports_to_namespace_import_95057": "Преобразовать операции импорта имен в импорт пространства имен",
+ "Convert_namespace_import_to_named_imports_95056": "Преобразовать импорт пространства имен в операции импорта имен",
"Convert_require_to_import_95047": "Преобразовать \"require\" в \"import\"",
"Convert_to_ES6_module_95017": "Преобразовать в модуль ES6",
"Convert_to_default_import_95013": "Преобразовать в импорт по умолчанию",
@@ -580,6 +586,7 @@
"Not_all_code_paths_return_a_value_7030": "Не все пути кода возвращают значение.",
"Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "Тип числового индекса \"{0}\" нельзя назначить типу строкового индекса \"{1}\".",
"Numeric_separators_are_not_allowed_here_6188": "Числовые разделители здесь запрещены.",
+ "Object_is_of_type_unknown_2571": "Объект имеет тип \"Неизвестный\".",
"Object_is_possibly_null_2531": "Возможно, объект равен null.",
"Object_is_possibly_null_or_undefined_2533": "Возможно, объект равен null или undefined.",
"Object_is_possibly_undefined_2532": "Возможно, объект равен undefined.",
@@ -708,10 +715,13 @@
"Redirect_output_structure_to_the_directory_6006": "Перенаправить структуру вывода в каталог.",
"Referenced_project_0_must_have_setting_composite_Colon_true_6306": "Указанный в ссылке проект \"{0}\" должен иметь следующее значение параметра composite: true.",
"Remove_all_unreachable_code_95051": "Удалить весь недостижимый код",
+ "Remove_all_unused_labels_95054": "Удалить все неиспользуемые метки",
"Remove_declaration_for_Colon_0_90004": "Удалите объявление: \"{0}\"",
"Remove_destructuring_90009": "Удалить деструктурирование",
"Remove_import_from_0_90005": "Удалить импорт из \"{0}\"",
"Remove_unreachable_code_95050": "Удалить недостижимый код",
+ "Remove_unused_label_95053": "Удалить неиспользуемую метку",
+ "Remove_variable_statement_90010": "Удалить оператор с переменной",
"Replace_import_with_0_95015": "Замена импорта на \"{0}\".",
"Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "Сообщать об ошибке, если не все пути кода в функции возвращают значение.",
"Report_errors_for_fallthrough_cases_in_switch_statement_6076": "Сообщать об ошибках для случаев передачи управления в операторе switch.",
diff --git a/lib/tr/diagnosticMessages.generated.json b/lib/tr/diagnosticMessages.generated.json
index d037f7d0d20..7ebbf4a0622 100644
--- a/lib/tr/diagnosticMessages.generated.json
+++ b/lib/tr/diagnosticMessages.generated.json
@@ -106,6 +106,7 @@
"Add_initializer_to_property_0_95019": "'{0}' özelliğine başlatıcı ekle",
"Add_initializers_to_all_uninitialized_properties_95027": "Tüm başlatılmamış özelliklere başlatıcılar ekle",
"Add_missing_super_call_90001": "Eksik 'super()' çağrısını ekle",
+ "Add_missing_typeof_95052": "Eksik 'typeof' öğesini ekle",
"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037": "Bir üye adıyla eşleşen tüm çözülmemiş değişkenlere niteleyici ekle",
"Add_to_all_uncalled_decorators_95044": "Çağrılmayan tüm dekoratörlere '()' ekle",
"Add_ts_ignore_to_all_error_messages_95042": "Tüm hata iletilerine '@ts-ignore' ekle",
@@ -119,6 +120,7 @@
"All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Soyut metoda ait tüm bildirimler ardışık olmalıdır.",
"All_destructured_elements_are_unused_6198": "Yok edilen öğelerin hiçbiri kullanılmamış.",
"All_imports_in_import_declaration_are_unused_6192": "İçeri aktarma bildirimindeki hiçbir içeri aktarma kullanılmadı.",
+ "All_variables_are_unused_6199": "Hiçbir değişken kullanılmıyor.",
"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "Varsayılan dışarı aktarmaya sahip olmayan modüllerde varsayılan içeri aktarmalara izin verin. Bu işlem kod üretimini etkilemez, yalnızca tür denetimini etkiler.",
"Allow_javascript_files_to_be_compiled_6102": "Javascript dosyalarının derlenmesine izin ver.",
"Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209": "'--isolatedModules' bayrağı sağlandığında çevresel const sabit listesi değerlerine izin verilmez.",
@@ -255,6 +257,7 @@
"Class_0_used_before_its_declaration_2449": "'{0}' sınıfı, bildiriminden önce kullanıldı.",
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Sınıf bildirimlerinde birden fazla `@augments` veya `@extends` etiketi olamaz.",
"Class_name_cannot_be_0_2414": "Sınıf adı '{0}' olamaz.",
+ "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725": "Modül {0} ile ES5 hedeflendiğinde sınıf adı 'Object' olamaz.",
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "'{0}' statik sınıf tarafı, '{1}' statik temel sınıf tarafını yanlış genişletiyor.",
"Classes_can_only_extend_a_single_class_1174": "Sınıflar yalnızca bir sınıfı genişletebilir.",
"Classes_containing_abstract_methods_must_be_marked_abstract_2514": "Soyut metotlar içeren sınıflar abstract olarak işaretlenmelidir.",
@@ -273,6 +276,7 @@
"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "'{0}' sınıfının oluşturucusu korumalı olduğundan, oluşturucuya yalnızca sınıf bildiriminden erişilebilir.",
"Constructors_for_derived_classes_must_contain_a_super_call_2377": "Türetilmiş sınıflara ilişkin oluşturucular bir 'super' çağrısı içermelidir.",
"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Kapsayıcı dosya belirtilmedi ve kök dizini belirlenemiyor; 'node_modules' klasöründe arama atlanıyor.",
+ "Convert_0_to_mapped_object_type_95055": "'{0}' öğesini eşlenen nesne türüne dönüştür",
"Convert_all_constructor_functions_to_classes_95045": "Tüm oluşturucu işlevleri sınıflara dönüştür",
"Convert_all_require_to_import_95048": "Tüm 'require' öğelerini 'import' olarak dönüştür",
"Convert_all_to_default_imports_95035": "Tümünü varsayılan içeri aktarmalara dönüştür",
@@ -708,10 +712,13 @@
"Redirect_output_structure_to_the_directory_6006": "Çıktı yapısını dizine yeniden yönlendir.",
"Referenced_project_0_must_have_setting_composite_Colon_true_6306": "Başvurulan proje '{0}' \"composite\": true ayarına sahip olmalıdır.",
"Remove_all_unreachable_code_95051": "Tüm erişilemeyen kodları kaldır",
+ "Remove_all_unused_labels_95054": "Kullanılmayan tüm etiketleri kaldır",
"Remove_declaration_for_Colon_0_90004": "'{0}' bildirimini kaldır",
"Remove_destructuring_90009": "Yıkmayı kaldır",
"Remove_import_from_0_90005": "'{0}' öğesinden içeri aktarmayı kaldır",
"Remove_unreachable_code_95050": "Erişilemeyen kodları kaldır",
+ "Remove_unused_label_95053": "Kullanılmayan etiketi kaldır",
+ "Remove_variable_statement_90010": "Değişken deyimini kaldır",
"Replace_import_with_0_95015": "İçeri aktarma işlemini '{0}' ile değiştirin.",
"Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "İşlevdeki tüm kod yolları bir değer döndürmediğinde hata bildir.",
"Report_errors_for_fallthrough_cases_in_switch_statement_6076": "switch deyiminde sonraki ifadelere geçiş ile ilgili hataları bildir.",
diff --git a/lib/tsc.js b/lib/tsc.js
index f39c393bfd1..bed2ef28383 100644
--- a/lib/tsc.js
+++ b/lib/tsc.js
@@ -173,7 +173,7 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
- ts.versionMajorMinor = "2.9";
+ ts.versionMajorMinor = "3.0";
ts.version = ts.versionMajorMinor + ".0-dev";
})(ts || (ts = {}));
(function (ts) {
@@ -304,6 +304,10 @@ var ts;
return array ? array.length : 0;
}
ts.length = length;
+ function hasEntries(map) {
+ return !!map && !!map.size;
+ }
+ ts.hasEntries = hasEntries;
function forEach(array, callback) {
if (array) {
for (var i = 0; i < array.length; i++) {
@@ -444,7 +448,7 @@ var ts;
return result;
}
}
- Debug.fail();
+ return Debug.fail();
}
ts.findMap = findMap;
function contains(array, value, equalityComparer) {
@@ -974,15 +978,6 @@ var ts;
return to;
}
ts.addRange = addRange;
- function prependRange(to, from) {
- if (from === undefined || from.length === 0)
- return to;
- if (to === undefined)
- return from.slice();
- to.unshift.apply(to, from);
- return to;
- }
- ts.prependRange = prependRange;
function pushIfUnique(array, toAdd, equalityComparer) {
if (contains(array, toAdd, equalityComparer)) {
return false;
@@ -1375,10 +1370,10 @@ var ts;
if (value !== undefined && test(value))
return value;
if (value && typeof value.kind === "number") {
- Debug.fail("Invalid cast. The supplied " + Debug.showSyntaxKind(value) + " did not pass the test '" + Debug.getFunctionName(test) + "'.");
+ return Debug.fail("Invalid cast. The supplied " + Debug.showSyntaxKind(value) + " did not pass the test '" + Debug.getFunctionName(test) + "'.");
}
else {
- Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'.");
+ return Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'.");
}
}
ts.cast = cast;
@@ -1458,7 +1453,7 @@ var ts;
}
ts.compose = compose;
function formatStringFromArgs(text, args, baseIndex) {
- baseIndex = baseIndex || 0;
+ if (baseIndex === void 0) { baseIndex = 0; }
return text.replace(/{(\d+)}/g, function (_match, index) { return Debug.assertDefined(args[+index + baseIndex]); });
}
ts.formatStringFromArgs = formatStringFromArgs;
@@ -1695,7 +1690,9 @@ var ts;
return compareValues(a ? 1 : 0, b ? 1 : 0);
}
ts.compareBooleans = compareBooleans;
- function compareMessageText(text1, text2) {
+ function compareMessageText(t1, t2) {
+ var text1 = t1;
+ var text2 = t2;
while (text1 && text2) {
var string1 = isString(text1) ? text1 : text1.messageText;
var string2 = isString(text2) ? text2 : text2.messageText;
@@ -1729,6 +1726,14 @@ var ts;
return moduleResolution;
}
ts.getEmitModuleResolutionKind = getEmitModuleResolutionKind;
+ function unreachableCodeIsError(options) {
+ return options.allowUnreachableCode === false;
+ }
+ ts.unreachableCodeIsError = unreachableCodeIsError;
+ function unusedLabelIsError(options) {
+ return options.allowUnusedLabels === false;
+ }
+ ts.unusedLabelIsError = unusedLabelIsError;
function getAreDeclarationMapsEnabled(options) {
return !!(options.declaration && options.declarationMap);
}
@@ -1747,7 +1752,7 @@ var ts;
}
ts.getEmitDeclarations = getEmitDeclarations;
function getStrictOptionValue(compilerOptions, flag) {
- return compilerOptions[flag] === undefined ? compilerOptions.strict : compilerOptions[flag];
+ return compilerOptions[flag] === undefined ? !!compilerOptions.strict : !!compilerOptions[flag];
}
ts.getStrictOptionValue = getStrictOptionValue;
function hasZeroOrOneAsteriskCharacter(str) {
@@ -2125,6 +2130,23 @@ var ts;
return startsWith(str, prefix) ? str.substr(prefix.length) : str;
}
ts.removePrefix = removePrefix;
+ function tryRemovePrefix(str, prefix) {
+ return startsWith(str, prefix) ? str.substring(prefix.length) : undefined;
+ }
+ ts.tryRemovePrefix = tryRemovePrefix;
+ function tryRemoveDirectoryPrefix(path, dirPath) {
+ var a = tryRemovePrefix(path, dirPath);
+ if (a === undefined)
+ return undefined;
+ switch (a.charCodeAt(0)) {
+ case 47:
+ case 92:
+ return a.slice(1);
+ default:
+ return undefined;
+ }
+ }
+ ts.tryRemoveDirectoryPrefix = tryRemoveDirectoryPrefix;
function endsWith(str, suffix) {
var expectedPos = str.length - suffix.length;
return expectedPos >= 0 && str.indexOf(suffix, expectedPos) === expectedPos;
@@ -2134,6 +2156,10 @@ var ts;
return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : str;
}
ts.removeSuffix = removeSuffix;
+ function tryRemoveSuffix(str, suffix) {
+ return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : undefined;
+ }
+ ts.tryRemoveSuffix = tryRemoveSuffix;
function stringContains(str, substring) {
return str.indexOf(substring) !== -1;
}
@@ -2207,7 +2233,7 @@ var ts;
var subpattern = "";
var hasWrittenComponent = false;
var components = getNormalizedPathComponents(spec, basePath);
- var lastComponent = lastOrUndefined(components);
+ var lastComponent = last(components);
if (usage !== "exclude" && lastComponent === "**") {
return undefined;
}
@@ -2273,14 +2299,17 @@ var ts;
};
}
ts.getFileMatcherPatterns = getFileMatcherPatterns;
+ function getRegexFromPattern(pattern, useCaseSensitiveFileNames) {
+ return new RegExp(pattern, useCaseSensitiveFileNames ? "" : "i");
+ }
+ ts.getRegexFromPattern = getRegexFromPattern;
function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries) {
path = normalizePath(path);
currentDirectory = normalizePath(currentDirectory);
var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
- var regexFlag = useCaseSensitiveFileNames ? "" : "i";
- var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return new RegExp(pattern, regexFlag); });
- var includeDirectoryRegex = patterns.includeDirectoryPattern && new RegExp(patterns.includeDirectoryPattern, regexFlag);
- var excludeRegex = patterns.excludePattern && new RegExp(patterns.excludePattern, regexFlag);
+ var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return getRegexFromPattern(pattern, useCaseSensitiveFileNames); });
+ var includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames);
+ var excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames);
var results = includeFileRegexes ? includeFileRegexes.map(function () { return []; }) : [[]];
for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) {
var basePath = _a[_i];
@@ -2398,11 +2427,11 @@ var ts;
return scriptKind === 1 || scriptKind === 2;
}
function hasJavaScriptFileExtension(fileName) {
- return forEach(ts.supportedJavascriptExtensions, function (extension) { return fileExtensionIs(fileName, extension); });
+ return some(ts.supportedJavascriptExtensions, function (extension) { return fileExtensionIs(fileName, extension); });
}
ts.hasJavaScriptFileExtension = hasJavaScriptFileExtension;
function hasTypeScriptFileExtension(fileName) {
- return forEach(ts.supportedTypeScriptExtensions, function (extension) { return fileExtensionIs(fileName, extension); });
+ return some(ts.supportedTypeScriptExtensions, function (extension) { return fileExtensionIs(fileName, extension); });
}
ts.hasTypeScriptFileExtension = hasTypeScriptFileExtension;
function isSupportedSourceFileName(fileName, compilerOptions, extraFileExtensions) {
@@ -2576,7 +2605,8 @@ var ts;
}
Debug.fail = fail;
function assertDefined(value, message) {
- assert(value !== undefined && value !== null, message);
+ if (value === undefined || value === null)
+ return fail(message);
return value;
}
Debug.assertDefined = assertDefined;
@@ -2734,10 +2764,7 @@ var ts;
ts.resolutionExtensionIsTypeScriptOrJson = resolutionExtensionIsTypeScriptOrJson;
function extensionFromPath(path) {
var ext = tryGetExtensionFromPath(path);
- if (ext !== undefined) {
- return ext;
- }
- Debug.fail("File " + path + " has unknown extension.");
+ return ext !== undefined ? ext : Debug.fail("File " + path + " has unknown extension.");
}
ts.extensionFromPath = extensionFromPath;
function isAnySupportedFileExtension(path) {
@@ -3286,6 +3313,7 @@ var ts;
return watchDirectoryRecursively(directoryName, callback);
}
watchDirectory(directoryName, callback);
+ return undefined;
};
}
function createNonPollingWatchFile() {
@@ -3516,6 +3544,7 @@ var ts;
switch (entryKind) {
case 0: return stat.isFile();
case 1: return stat.isDirectory();
+ default: return false;
}
}
catch (e) {
@@ -3694,6 +3723,7 @@ var ts;
The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type: diag(1064, ts.DiagnosticCategory.Error, "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1064", "The return type of an async function or method must be the global Promise type."),
In_ambient_enum_declarations_member_initializer_must_be_constant_expression: diag(1066, ts.DiagnosticCategory.Error, "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066", "In ambient enum declarations member initializer must be constant expression."),
Unexpected_token_A_constructor_method_accessor_or_property_was_expected: diag(1068, ts.DiagnosticCategory.Error, "Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068", "Unexpected token. A constructor, method, accessor, or property was expected."),
+ Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces: diag(1069, ts.DiagnosticCategory.Error, "Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069", "Unexpected token. A type parameter name was expected without curly braces."),
_0_modifier_cannot_appear_on_a_type_member: diag(1070, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_a_type_member_1070", "'{0}' modifier cannot appear on a type member."),
_0_modifier_cannot_appear_on_an_index_signature: diag(1071, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_an_index_signature_1071", "'{0}' modifier cannot appear on an index signature."),
A_0_modifier_cannot_be_used_with_an_import_declaration: diag(1079, ts.DiagnosticCategory.Error, "A_0_modifier_cannot_be_used_with_an_import_declaration_1079", "A '{0}' modifier cannot be used with an import declaration."),
@@ -4145,6 +4175,7 @@ var ts;
Type_0_is_not_an_array_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators: diag(2568, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators_2568", "Type '{0}' is not an array type. Use compiler option '--downlevelIteration' to allow iterating of iterators."),
Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators: diag(2569, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569", "Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators."),
Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await: diag(2570, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await_2570", "Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?"),
+ Object_is_of_type_unknown: diag(2571, ts.DiagnosticCategory.Error, "Object_is_of_type_unknown_2571", "Object is of type 'unknown'."),
JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."),
The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."),
JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."),
@@ -4198,7 +4229,7 @@ var ts;
_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, ts.DiagnosticCategory.Error, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."),
_0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."),
Namespace_0_has_no_exported_member_1: diag(2694, ts.DiagnosticCategory.Error, "Namespace_0_has_no_exported_member_1_2694", "Namespace '{0}' has no exported member '{1}'."),
- Left_side_of_comma_operator_is_unused_and_has_no_side_effects: diag(2695, ts.DiagnosticCategory.Error, "Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695", "Left side of comma operator is unused and has no side effects."),
+ Left_side_of_comma_operator_is_unused_and_has_no_side_effects: diag(2695, ts.DiagnosticCategory.Error, "Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695", "Left side of comma operator is unused and has no side effects.", true),
The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead: diag(2696, ts.DiagnosticCategory.Error, "The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696", "The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?"),
An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: diag(2697, ts.DiagnosticCategory.Error, "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697", "An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your `--lib` option."),
Spread_types_may_only_be_created_from_object_types: diag(2698, ts.DiagnosticCategory.Error, "Spread_types_may_only_be_created_from_object_types_2698", "Spread types may only be created from object types."),
@@ -4228,6 +4259,7 @@ var ts;
Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."),
Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."),
Module_0_has_no_exported_member_1_Did_you_mean_2: diag(2724, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_Did_you_mean_2_2724", "Module '{0}' has no exported member '{1}'. Did you mean '{2}'?"),
+ Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, ts.DiagnosticCategory.Error, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."),
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}'."),
@@ -4526,6 +4558,7 @@ var ts;
_0_is_declared_but_never_used: diag(6196, ts.DiagnosticCategory.Error, "_0_is_declared_but_never_used_6196", "'{0}' is declared but never used.", true),
Include_modules_imported_with_json_extension: diag(6197, ts.DiagnosticCategory.Message, "Include_modules_imported_with_json_extension_6197", "Include modules imported with '.json' extension"),
All_destructured_elements_are_unused: diag(6198, ts.DiagnosticCategory.Error, "All_destructured_elements_are_unused_6198", "All destructured elements are unused.", true),
+ All_variables_are_unused: diag(6199, ts.DiagnosticCategory.Error, "All_variables_are_unused_6199", "All variables are unused.", true),
Projects_to_reference: diag(6300, ts.DiagnosticCategory.Message, "Projects_to_reference_6300", "Projects to reference"),
Enable_project_compilation: diag(6302, ts.DiagnosticCategory.Message, "Enable_project_compilation_6302", "Enable project compilation"),
Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: diag(6202, ts.DiagnosticCategory.Error, "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202", "Project references may not form a circular graph. Cycle detected: {0}"),
@@ -4553,7 +4586,7 @@ var ts;
Function_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: diag(7024, ts.DiagnosticCategory.Error, "Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024", "Function 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."),
Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type: diag(7025, ts.DiagnosticCategory.Error, "Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_typ_7025", "Generator implicitly has type '{0}' because it does not yield any values. Consider supplying a return type."),
JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: diag(7026, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists."),
- Unreachable_code_detected: diag(7027, ts.DiagnosticCategory.Error, "Unreachable_code_detected_7027", "Unreachable code detected."),
+ Unreachable_code_detected: diag(7027, ts.DiagnosticCategory.Error, "Unreachable_code_detected_7027", "Unreachable code detected.", true),
Unused_label: diag(7028, ts.DiagnosticCategory.Error, "Unused_label_7028", "Unused label.", true),
Fallthrough_case_in_switch: diag(7029, ts.DiagnosticCategory.Error, "Fallthrough_case_in_switch_7029", "Fallthrough case in switch."),
Not_all_code_paths_return_a_value: diag(7030, ts.DiagnosticCategory.Error, "Not_all_code_paths_return_a_value_7030", "Not all code paths return a value."),
@@ -4634,6 +4667,7 @@ var ts;
Implement_inherited_abstract_class: diag(90007, ts.DiagnosticCategory.Message, "Implement_inherited_abstract_class_90007", "Implement inherited abstract class"),
Add_0_to_unresolved_variable: diag(90008, ts.DiagnosticCategory.Message, "Add_0_to_unresolved_variable_90008", "Add '{0}.' to unresolved variable"),
Remove_destructuring: diag(90009, ts.DiagnosticCategory.Message, "Remove_destructuring_90009", "Remove destructuring"),
+ Remove_variable_statement: diag(90010, ts.DiagnosticCategory.Message, "Remove_variable_statement_90010", "Remove variable statement"),
Import_0_from_module_1: diag(90013, ts.DiagnosticCategory.Message, "Import_0_from_module_1_90013", "Import '{0}' from module \"{1}\""),
Change_0_to_1: diag(90014, ts.DiagnosticCategory.Message, "Change_0_to_1_90014", "Change '{0}' to '{1}'"),
Add_0_to_existing_import_declaration_from_1: diag(90015, ts.DiagnosticCategory.Message, "Add_0_to_existing_import_declaration_from_1_90015", "Add '{0}' to existing import declaration from \"{1}\""),
@@ -4703,6 +4737,9 @@ var ts;
Add_missing_typeof: diag(95052, ts.DiagnosticCategory.Message, "Add_missing_typeof_95052", "Add missing 'typeof'"),
Remove_unused_label: diag(95053, ts.DiagnosticCategory.Message, "Remove_unused_label_95053", "Remove unused label"),
Remove_all_unused_labels: diag(95054, ts.DiagnosticCategory.Message, "Remove_all_unused_labels_95054", "Remove all unused labels"),
+ Convert_0_to_mapped_object_type: diag(95055, ts.DiagnosticCategory.Message, "Convert_0_to_mapped_object_type_95055", "Convert '{0}' to mapped object type"),
+ Convert_namespace_import_to_named_imports: diag(95056, ts.DiagnosticCategory.Message, "Convert_namespace_import_to_named_imports_95056", "Convert namespace import to named imports"),
+ Convert_named_imports_to_namespace_import: diag(95057, ts.DiagnosticCategory.Message, "Convert_named_imports_to_namespace_import_95057", "Convert named imports to namespace import"),
};
})(ts || (ts = {}));
var ts;
@@ -4739,7 +4776,7 @@ var ts;
"false": 86,
"finally": 87,
"for": 88,
- "from": 142,
+ "from": 143,
"function": 89,
"get": 125,
"if": 90,
@@ -4765,7 +4802,7 @@ var ts;
"public": 114,
"readonly": 132,
"require": 133,
- "global": 143,
+ "global": 144,
"return": 96,
"set": 136,
"static": 115,
@@ -4781,6 +4818,7 @@ var ts;
"typeof": 103,
"undefined": 140,
"unique": 141,
+ "unknown": 142,
"var": 104,
"void": 105,
"while": 106,
@@ -4788,7 +4826,7 @@ var ts;
"yield": 116,
"async": 120,
"await": 121,
- "of": 144,
+ "of": 145,
"{": 17,
"}": 18,
"(": 19,
@@ -5294,8 +5332,9 @@ var ts;
return true;
}
ts.isIdentifierText = isIdentifierText;
- function createScanner(languageVersion, skipTrivia, languageVariant, text, onError, start, length) {
+ function createScanner(languageVersion, skipTrivia, languageVariant, textInitial, onError, start, length) {
if (languageVariant === void 0) { languageVariant = 0; }
+ var text = textInitial;
var pos;
var end;
var startPos;
@@ -6493,7 +6532,7 @@ var ts;
}
ts.moduleResolutionIsEqualTo = moduleResolutionIsEqualTo;
function packageIdIsEqual(a, b) {
- return a === b || a && b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
+ return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
}
function packageIdToString(_a) {
var name = _a.name, subModuleName = _a.subModuleName, version = _a.version;
@@ -6536,7 +6575,7 @@ var ts;
}
}
function getSourceFileOfNode(node) {
- while (node && node.kind !== 273) {
+ while (node && node.kind !== 274) {
node = node.parent;
}
return node;
@@ -6544,11 +6583,11 @@ var ts;
ts.getSourceFileOfNode = getSourceFileOfNode;
function isStatementWithLocals(node) {
switch (node.kind) {
- case 212:
- case 240:
- case 219:
+ case 213:
+ case 241:
case 220:
case 221:
+ case 222:
return true;
}
return false;
@@ -6584,9 +6623,8 @@ var ts;
}
}
ts.getEndLinePosition = getEndLinePosition;
- function isFileLevelUniqueName(currentSourceFile, name, hasGlobalName) {
- return !(hasGlobalName && hasGlobalName(name))
- && !currentSourceFile.identifiers.has(name);
+ function isFileLevelUniqueName(sourceFile, name, hasGlobalName) {
+ return !(hasGlobalName && hasGlobalName(name)) && !sourceFile.identifiers.has(name);
}
ts.isFileLevelUniqueName = isFileLevelUniqueName;
function nodeIsMissing(node) {
@@ -6600,6 +6638,19 @@ var ts;
return !nodeIsMissing(node);
}
ts.nodeIsPresent = nodeIsPresent;
+ function prependStatements(to, from) {
+ if (from === undefined || from.length === 0)
+ return to;
+ if (to === undefined)
+ return from.slice();
+ var prologue = to.length && isPrologueDirective(to[0]) && to.shift();
+ to.unshift.apply(to, from);
+ if (prologue) {
+ to.unshift(prologue);
+ }
+ return to;
+ }
+ ts.prependStatements = prependStatements;
function isRecognizedTripleSlashComment(text, commentPos, commentEnd) {
if (text.charCodeAt(commentPos + 1) === 47 &&
commentPos + 2 < commentEnd &&
@@ -6629,7 +6680,7 @@ var ts;
if (includeJsDoc && ts.hasJSDocNodes(node)) {
return getTokenPosOfNode(node.jsDoc[0]);
}
- if (node.kind === 298 && node._children.length > 0) {
+ if (node.kind === 299 && node._children.length > 0) {
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
}
return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos);
@@ -6669,7 +6720,7 @@ var ts;
ts.indexOfNode = indexOfNode;
function getEmitFlags(node) {
var emitNode = node.emitNode;
- return emitNode && emitNode.flags;
+ return emitNode && emitNode.flags || 0;
}
ts.getEmitFlags = getEmitFlags;
function getLiteralText(node, sourceFile) {
@@ -6697,7 +6748,7 @@ var ts;
case 12:
return node.text;
}
- ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for.");
+ return ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for.");
}
ts.getLiteralText = getLiteralText;
function getTextOfConstantValue(value) {
@@ -6723,7 +6774,7 @@ var ts;
ts.isBlockOrCatchScoped = isBlockOrCatchScoped;
function isCatchClauseVariableDeclarationOrBindingElement(declaration) {
var node = getRootDeclaration(declaration);
- return node.kind === 231 && node.parent.kind === 268;
+ return node.kind === 232 && node.parent.kind === 269;
}
ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement;
function isAmbientModule(node) {
@@ -6743,11 +6794,11 @@ var ts;
}
ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol;
function isShorthandAmbientModule(node) {
- return node && node.kind === 238 && (!node.body);
+ return node && node.kind === 239 && (!node.body);
}
function isBlockScopedContainerTopLevel(node) {
- return node.kind === 273 ||
- node.kind === 238 ||
+ return node.kind === 274 ||
+ node.kind === 239 ||
ts.isFunctionLike(node);
}
ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel;
@@ -6761,9 +6812,9 @@ var ts;
ts.isExternalModuleAugmentation = isExternalModuleAugmentation;
function isModuleAugmentationExternal(node) {
switch (node.parent.kind) {
- case 273:
+ case 274:
return ts.isExternalModule(node.parent);
- case 239:
+ case 240:
return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent);
}
return false;
@@ -6775,51 +6826,51 @@ var ts;
ts.isEffectiveExternalModule = isEffectiveExternalModule;
function isBlockScope(node, parentNode) {
switch (node.kind) {
- case 273:
- case 240:
- case 268:
- case 238:
- case 219:
+ case 274:
+ case 241:
+ case 269:
+ case 239:
case 220:
case 221:
- case 154:
- case 153:
+ case 222:
case 155:
+ case 154:
case 156:
- case 233:
- case 191:
+ case 157:
+ case 234:
case 192:
+ case 193:
return true;
- case 212:
- return parentNode && !ts.isFunctionLike(parentNode);
+ case 213:
+ return !ts.isFunctionLike(parentNode);
}
return false;
}
ts.isBlockScope = isBlockScope;
function isDeclarationWithTypeParameters(node) {
switch (node.kind) {
- case 157:
case 158:
- case 152:
case 159:
- case 162:
- case 163:
- case 283:
- case 234:
- case 204:
- case 235:
- case 236:
- case 295:
- case 233:
case 153:
+ case 160:
+ case 163:
+ case 164:
+ case 284:
+ case 235:
+ case 205:
+ case 236:
+ case 237:
+ case 296:
+ case 234:
case 154:
case 155:
case 156:
- case 191:
+ case 157:
case 192:
- case 291:
- case 296:
- case 287:
+ case 193:
+ case 292:
+ case 297:
+ case 288:
return true;
default:
ts.assertTypeIsNever(node);
@@ -6829,8 +6880,8 @@ var ts;
ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters;
function isAnyImportSyntax(node) {
switch (node.kind) {
+ case 244:
case 243:
- case 242:
return true;
default:
return false;
@@ -6839,15 +6890,15 @@ var ts;
ts.isAnyImportSyntax = isAnyImportSyntax;
function isLateVisibilityPaintedStatement(node) {
switch (node.kind) {
+ case 244:
case 243:
- case 242:
- case 213:
- case 234:
- case 233:
- case 238:
- case 236:
+ case 214:
case 235:
+ case 234:
+ case 239:
case 237:
+ case 236:
+ case 238:
return true;
default:
return false;
@@ -6877,7 +6928,7 @@ var ts;
case 9:
case 8:
return escapeLeadingUnderscores(name.text);
- case 146:
+ case 147:
return isStringOrNumericLiteral(name.expression) ? escapeLeadingUnderscores(name.expression.text) : undefined;
default:
ts.Debug.assertNever(name);
@@ -6888,10 +6939,12 @@ var ts;
switch (name.kind) {
case 71:
return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name);
- case 145:
+ case 146:
return entityNameToString(name.left) + "." + entityNameToString(name.right);
- case 184:
+ case 185:
return entityNameToString(name.expression) + "." + entityNameToString(name.name);
+ default:
+ throw ts.Debug.assertNever(name);
}
}
ts.entityNameToString = entityNameToString;
@@ -6910,11 +6963,6 @@ var ts;
return ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3);
}
ts.createDiagnosticForNodeInSourceFile = createDiagnosticForNodeInSourceFile;
- function createDiagnosticForNodeSpan(sourceFile, startNode, endNode, message, arg0, arg1, arg2, arg3) {
- var start = ts.skipTrivia(sourceFile.text, startNode.pos);
- return ts.createFileDiagnostic(sourceFile, start, endNode.end - start, message, arg0, arg1, arg2, arg3);
- }
- ts.createDiagnosticForNodeSpan = createDiagnosticForNodeSpan;
function createDiagnosticForNodeFromMessageChain(node, messageChain) {
var sourceFile = getSourceFileOfNode(node);
var span = getErrorSpanForNode(sourceFile, node);
@@ -6937,7 +6985,7 @@ var ts;
ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition;
function getErrorSpanForArrowFunction(sourceFile, node) {
var pos = ts.skipTrivia(sourceFile.text, node.pos);
- if (node.body && node.body.kind === 212) {
+ if (node.body && node.body.kind === 213) {
var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line;
var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line;
if (startLine < endLine) {
@@ -6949,31 +6997,31 @@ var ts;
function getErrorSpanForNode(sourceFile, node) {
var errorNode = node;
switch (node.kind) {
- case 273:
+ case 274:
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 231:
- case 181:
- case 234:
- case 204:
+ case 232:
+ case 182:
case 235:
- case 238:
- case 237:
- case 272:
- case 233:
- case 191:
- case 153:
- case 155:
- case 156:
+ case 205:
case 236:
+ case 239:
+ case 238:
+ case 273:
+ case 234:
+ case 192:
+ case 154:
+ case 156:
+ case 157:
+ case 237:
+ case 152:
case 151:
- case 150:
errorNode = node.name;
break;
- case 192:
+ case 193:
return getErrorSpanForArrowFunction(sourceFile, node);
}
if (errorNode === undefined) {
@@ -7003,7 +7051,7 @@ var ts;
}
ts.isJsonSourceFile = isJsonSourceFile;
function isConstEnumDeclaration(node) {
- return node.kind === 237 && isConst(node);
+ return node.kind === 238 && isConst(node);
}
ts.isConstEnumDeclaration = isConstEnumDeclaration;
function isConst(node) {
@@ -7016,21 +7064,21 @@ var ts;
}
ts.isLet = isLet;
function isSuperCall(n) {
- return n.kind === 186 && n.expression.kind === 97;
+ return n.kind === 187 && n.expression.kind === 97;
}
ts.isSuperCall = isSuperCall;
function isImportCall(n) {
- return n.kind === 186 && n.expression.kind === 91;
+ return n.kind === 187 && n.expression.kind === 91;
}
ts.isImportCall = isImportCall;
function isLiteralImportTypeNode(n) {
- return n.kind === 178 &&
- n.argument.kind === 177 &&
+ return n.kind === 179 &&
+ n.argument.kind === 178 &&
ts.isStringLiteral(n.argument.literal);
}
ts.isLiteralImportTypeNode = isLiteralImportTypeNode;
function isPrologueDirective(node) {
- return node.kind === 215
+ return node.kind === 216
&& node.expression.kind === 9;
}
ts.isPrologueDirective = isPrologueDirective;
@@ -7039,11 +7087,11 @@ var ts;
}
ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode;
function getJSDocCommentRanges(node, text) {
- var commentRanges = (node.kind === 148 ||
- node.kind === 147 ||
- node.kind === 191 ||
+ var commentRanges = (node.kind === 149 ||
+ node.kind === 148 ||
node.kind === 192 ||
- node.kind === 190) ?
+ node.kind === 193 ||
+ node.kind === 191) ?
ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) :
ts.getLeadingCommentRanges(text, node.pos);
return ts.filter(commentRanges, function (comment) {
@@ -7058,11 +7106,12 @@ var ts;
ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/;
var defaultLibReferenceRegEx = /^(\/\/\/\s*/;
function isPartOfTypeNode(node) {
- if (160 <= node.kind && node.kind <= 178) {
+ if (161 <= node.kind && node.kind <= 179) {
return true;
}
switch (node.kind) {
case 119:
+ case 142:
case 134:
case 137:
case 122:
@@ -7071,63 +7120,64 @@ var ts;
case 131:
return true;
case 105:
- return node.parent.kind !== 195;
- case 206:
+ return node.parent.kind !== 196;
+ case 207:
return !isExpressionWithTypeArgumentsInClassExtendsClause(node);
- case 147:
- return node.parent.kind === 176 || node.parent.kind === 171;
+ case 148:
+ return node.parent.kind === 177 || node.parent.kind === 172;
case 71:
- if (node.parent.kind === 145 && node.parent.right === node) {
+ if (node.parent.kind === 146 && node.parent.right === node) {
node = node.parent;
}
- else if (node.parent.kind === 184 && node.parent.name === node) {
+ else if (node.parent.kind === 185 && node.parent.name === node) {
node = node.parent;
}
- ts.Debug.assert(node.kind === 71 || node.kind === 145 || node.kind === 184, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
- case 145:
- case 184:
- case 99:
+ ts.Debug.assert(node.kind === 71 || node.kind === 146 || node.kind === 185, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
+ case 146:
+ case 185:
+ case 99: {
var parent = node.parent;
- if (parent.kind === 164) {
+ if (parent.kind === 165) {
return false;
}
- if (parent.kind === 178) {
+ if (parent.kind === 179) {
return !parent.isTypeOf;
}
- if (160 <= parent.kind && parent.kind <= 178) {
+ if (161 <= parent.kind && parent.kind <= 179) {
return true;
}
switch (parent.kind) {
- case 206:
+ case 207:
return !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
- case 147:
- return node === parent.constraint;
- case 151:
- case 150:
case 148:
- case 231:
+ return node === parent.constraint;
+ case 152:
+ case 151:
+ case 149:
+ case 232:
return node === parent.type;
- case 233:
- case 191:
+ case 234:
case 192:
+ case 193:
+ case 155:
case 154:
case 153:
- case 152:
- case 155:
case 156:
- return node === parent.type;
case 157:
+ return node === parent.type;
case 158:
case 159:
+ case 160:
return node === parent.type;
- case 189:
+ case 190:
return node === parent.type;
- case 186:
case 187:
- return ts.contains(parent.typeArguments, node);
case 188:
+ return ts.contains(parent.typeArguments, node);
+ case 189:
return false;
}
+ }
}
return false;
}
@@ -7146,23 +7196,23 @@ var ts;
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 224:
+ case 225:
return visitor(node);
- case 240:
- case 212:
- case 216:
+ case 241:
+ case 213:
case 217:
case 218:
case 219:
case 220:
case 221:
- case 225:
+ case 222:
case 226:
- case 265:
- case 266:
case 227:
- case 229:
- case 268:
+ case 266:
+ case 267:
+ case 228:
+ case 230:
+ case 269:
return ts.forEachChild(node, traverse);
}
}
@@ -7172,23 +7222,23 @@ var ts;
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 202:
+ case 203:
visitor(node);
var operand = node.expression;
if (operand) {
traverse(operand);
}
return;
- case 237:
- case 235:
case 238:
case 236:
- case 234:
- case 204:
+ case 239:
+ case 237:
+ case 235:
+ case 205:
return;
default:
if (ts.isFunctionLike(node)) {
- if (node.name && node.name.kind === 146) {
+ if (node.name && node.name.kind === 147) {
traverse(node.name.expression);
return;
}
@@ -7201,10 +7251,10 @@ var ts;
}
ts.forEachYieldExpression = forEachYieldExpression;
function getRestParameterElementType(node) {
- if (node && node.kind === 166) {
+ if (node && node.kind === 167) {
return node.elementType;
}
- else if (node && node.kind === 161) {
+ else if (node && node.kind === 162) {
return ts.singleOrUndefined(node.typeArguments);
}
else {
@@ -7214,12 +7264,12 @@ var ts;
ts.getRestParameterElementType = getRestParameterElementType;
function getMembersOfDeclaration(node) {
switch (node.kind) {
+ case 236:
case 235:
- case 234:
- case 204:
- case 165:
+ case 205:
+ case 166:
return node.members;
- case 183:
+ case 184:
return node.properties;
}
}
@@ -7227,14 +7277,14 @@ var ts;
function isVariableLike(node) {
if (node) {
switch (node.kind) {
- case 181:
- case 272:
- case 148:
- case 269:
- case 151:
- case 150:
+ case 182:
+ case 273:
+ case 149:
case 270:
- case 231:
+ case 152:
+ case 151:
+ case 271:
+ case 232:
return true;
}
}
@@ -7246,8 +7296,8 @@ var ts;
}
ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor;
function isVariableDeclarationInVariableStatement(node) {
- return node.parent.kind === 232
- && node.parent.parent.kind === 213;
+ return node.parent.kind === 233
+ && node.parent.parent.kind === 214;
}
ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement;
function isValidESSymbolDeclaration(node) {
@@ -7258,13 +7308,13 @@ var ts;
ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration;
function introducesArgumentsExoticObject(node) {
switch (node.kind) {
- case 153:
- case 152:
case 154:
+ case 153:
case 155:
case 156:
- case 233:
- case 191:
+ case 157:
+ case 234:
+ case 192:
return true;
}
return false;
@@ -7275,7 +7325,7 @@ var ts;
if (beforeUnwrapLabelCallback) {
beforeUnwrapLabelCallback(node);
}
- if (node.statement.kind !== 227) {
+ if (node.statement.kind !== 228) {
return node.statement;
}
node = node.statement;
@@ -7283,17 +7333,17 @@ var ts;
}
ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel;
function isFunctionBlock(node) {
- return node && node.kind === 212 && ts.isFunctionLike(node.parent);
+ return node && node.kind === 213 && ts.isFunctionLike(node.parent);
}
ts.isFunctionBlock = isFunctionBlock;
function isObjectLiteralMethod(node) {
- return node && node.kind === 153 && node.parent.kind === 183;
+ return node && node.kind === 154 && node.parent.kind === 184;
}
ts.isObjectLiteralMethod = isObjectLiteralMethod;
function isObjectLiteralOrClassExpressionMethod(node) {
- return node.kind === 153 &&
- (node.parent.kind === 183 ||
- node.parent.kind === 204);
+ return node.kind === 154 &&
+ (node.parent.kind === 184 ||
+ node.parent.kind === 205);
}
ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod;
function isIdentifierTypePredicate(predicate) {
@@ -7305,31 +7355,35 @@ var ts;
}
ts.isThisTypePredicate = isThisTypePredicate;
function getPropertyAssignment(objectLiteral, key, key2) {
- return ts.filter(objectLiteral.properties, function (property) {
- if (property.kind === 269) {
+ return objectLiteral.properties.filter(function (property) {
+ if (property.kind === 270) {
var propName = getTextOfPropertyName(property.name);
- return key === propName || (key2 && key2 === propName);
+ return key === propName || (!!key2 && key2 === propName);
}
+ return false;
});
}
ts.getPropertyAssignment = getPropertyAssignment;
function getTsConfigObjectLiteralExpression(tsConfigSourceFile) {
if (tsConfigSourceFile && tsConfigSourceFile.statements.length) {
var expression = tsConfigSourceFile.statements[0].expression;
- return ts.isObjectLiteralExpression(expression) && expression;
+ return ts.tryCast(expression, ts.isObjectLiteralExpression);
}
}
ts.getTsConfigObjectLiteralExpression = getTsConfigObjectLiteralExpression;
function getTsConfigPropArrayElementValue(tsConfigSourceFile, propKey, elementValue) {
- var jsonObjectLiteral = getTsConfigObjectLiteralExpression(tsConfigSourceFile);
- return jsonObjectLiteral &&
- ts.firstDefined(getPropertyAssignment(jsonObjectLiteral, propKey), function (property) {
- return ts.isArrayLiteralExpression(property.initializer) ?
- ts.find(property.initializer.elements, function (element) { return ts.isStringLiteral(element) && element.text === elementValue; }) :
- undefined;
- });
+ return ts.firstDefined(getTsConfigPropArray(tsConfigSourceFile, propKey), function (property) {
+ return ts.isArrayLiteralExpression(property.initializer) ?
+ ts.find(property.initializer.elements, function (element) { return ts.isStringLiteral(element) && element.text === elementValue; }) :
+ undefined;
+ });
}
ts.getTsConfigPropArrayElementValue = getTsConfigPropArrayElementValue;
+ function getTsConfigPropArray(tsConfigSourceFile, propKey) {
+ var jsonObjectLiteral = getTsConfigObjectLiteralExpression(tsConfigSourceFile);
+ return jsonObjectLiteral ? getPropertyAssignment(jsonObjectLiteral, propKey) : ts.emptyArray;
+ }
+ ts.getTsConfigPropArray = getTsConfigPropArray;
function getContainingFunction(node) {
return ts.findAncestor(node.parent, ts.isFunctionLike);
}
@@ -7339,45 +7393,46 @@ var ts;
}
ts.getContainingClass = getContainingClass;
function getThisContainer(node, includeArrowFunctions) {
+ ts.Debug.assert(node.kind !== 274);
while (true) {
node = node.parent;
if (!node) {
- return undefined;
+ return ts.Debug.fail();
}
switch (node.kind) {
- case 146:
+ case 147:
if (ts.isClassLike(node.parent.parent)) {
return node;
}
node = node.parent;
break;
- case 149:
- if (node.parent.kind === 148 && ts.isClassElement(node.parent.parent)) {
+ case 150:
+ if (node.parent.kind === 149 && ts.isClassElement(node.parent.parent)) {
node = node.parent.parent;
}
else if (ts.isClassElement(node.parent)) {
node = node.parent;
}
break;
- case 192:
+ case 193:
if (!includeArrowFunctions) {
continue;
}
- case 233:
- case 191:
- case 238:
- case 151:
- case 150:
- case 153:
+ case 234:
+ case 192:
+ case 239:
case 152:
+ case 151:
case 154:
+ case 153:
case 155:
case 156:
case 157:
case 158:
case 159:
- case 237:
- case 273:
+ case 160:
+ case 238:
+ case 274:
return node;
}
}
@@ -7387,9 +7442,9 @@ var ts;
var container = getThisContainer(node, false);
if (container) {
switch (container.kind) {
- case 154:
- case 233:
- case 191:
+ case 155:
+ case 234:
+ case 192:
return container;
}
}
@@ -7403,25 +7458,25 @@ var ts;
return node;
}
switch (node.kind) {
- case 146:
+ case 147:
node = node.parent;
break;
- case 233:
- case 191:
+ case 234:
case 192:
+ case 193:
if (!stopOnFunctions) {
continue;
}
- case 151:
- case 150:
- case 153:
case 152:
+ case 151:
case 154:
+ case 153:
case 155:
case 156:
+ case 157:
return node;
- case 149:
- if (node.parent.kind === 148 && ts.isClassElement(node.parent.parent)) {
+ case 150:
+ if (node.parent.kind === 149 && ts.isClassElement(node.parent.parent)) {
node = node.parent.parent;
}
else if (ts.isClassElement(node.parent)) {
@@ -7433,14 +7488,14 @@ var ts;
}
ts.getSuperContainer = getSuperContainer;
function getImmediatelyInvokedFunctionExpression(func) {
- if (func.kind === 191 || func.kind === 192) {
+ if (func.kind === 192 || func.kind === 193) {
var prev = func;
var parent = func.parent;
- while (parent.kind === 190) {
+ while (parent.kind === 191) {
prev = parent;
parent = parent.parent;
}
- if (parent.kind === 186 && parent.expression === prev) {
+ if (parent.kind === 187 && parent.expression === prev) {
return parent;
}
}
@@ -7448,26 +7503,26 @@ var ts;
ts.getImmediatelyInvokedFunctionExpression = getImmediatelyInvokedFunctionExpression;
function isSuperProperty(node) {
var kind = node.kind;
- return (kind === 184 || kind === 185)
+ return (kind === 185 || kind === 186)
&& node.expression.kind === 97;
}
ts.isSuperProperty = isSuperProperty;
function isThisProperty(node) {
var kind = node.kind;
- return (kind === 184 || kind === 185)
+ return (kind === 185 || kind === 186)
&& node.expression.kind === 99;
}
ts.isThisProperty = isThisProperty;
function getEntityNameFromTypeNode(node) {
switch (node.kind) {
- case 161:
+ case 162:
return node.typeName;
- case 206:
+ case 207:
return isEntityNameExpression(node.expression)
? node.expression
: undefined;
case 71:
- case 145:
+ case 146:
return node;
}
return undefined;
@@ -7475,10 +7530,10 @@ var ts;
ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode;
function getInvokedExpression(node) {
switch (node.kind) {
- case 188:
+ case 189:
return node.tag;
+ case 257:
case 256:
- case 255:
return node.tagName;
default:
return node.expression;
@@ -7487,21 +7542,21 @@ var ts;
ts.getInvokedExpression = getInvokedExpression;
function nodeCanBeDecorated(node, parent, grandparent) {
switch (node.kind) {
- case 234:
+ case 235:
return true;
- case 151:
- return parent.kind === 234;
- case 155:
+ case 152:
+ return parent.kind === 235;
case 156:
- case 153:
+ case 157:
+ case 154:
return node.body !== undefined
- && parent.kind === 234;
- case 148:
+ && parent.kind === 235;
+ case 149:
return parent.body !== undefined
- && (parent.kind === 154
- || parent.kind === 153
- || parent.kind === 156)
- && grandparent.kind === 234;
+ && (parent.kind === 155
+ || parent.kind === 154
+ || parent.kind === 157)
+ && grandparent.kind === 235;
}
return false;
}
@@ -7517,19 +7572,21 @@ var ts;
ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated;
function childIsDecorated(node, parent) {
switch (node.kind) {
- case 234:
- return ts.forEach(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); });
- case 153:
- case 156:
- return ts.forEach(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); });
+ case 235:
+ return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); });
+ case 154:
+ case 157:
+ return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); });
+ default:
+ return false;
}
}
ts.childIsDecorated = childIsDecorated;
function isJSXTagName(node) {
var parent = node.parent;
- if (parent.kind === 256 ||
- parent.kind === 255 ||
- parent.kind === 257) {
+ if (parent.kind === 257 ||
+ parent.kind === 256 ||
+ parent.kind === 258) {
return parent.tagName === node;
}
return false;
@@ -7542,45 +7599,45 @@ var ts;
case 101:
case 86:
case 12:
- case 182:
case 183:
case 184:
case 185:
case 186:
case 187:
case 188:
- case 207:
case 189:
case 208:
case 190:
+ case 209:
case 191:
- case 204:
case 192:
- case 195:
+ case 205:
case 193:
+ case 196:
case 194:
- case 197:
+ case 195:
case 198:
case 199:
case 200:
- case 203:
case 201:
- case 13:
- case 205:
- case 254:
- case 255:
- case 258:
+ case 204:
case 202:
- case 196:
- case 209:
+ case 13:
+ case 206:
+ case 255:
+ case 256:
+ case 259:
+ case 203:
+ case 197:
+ case 210:
return true;
- case 145:
- while (node.parent.kind === 145) {
+ case 146:
+ while (node.parent.kind === 146) {
node = node.parent;
}
- return node.parent.kind === 164 || isJSXTagName(node);
+ return node.parent.kind === 165 || isJSXTagName(node);
case 71:
- if (node.parent.kind === 164 || isJSXTagName(node)) {
+ if (node.parent.kind === 165 || isJSXTagName(node)) {
return true;
}
case 8:
@@ -7595,47 +7652,47 @@ var ts;
function isInExpressionContext(node) {
var parent = node.parent;
switch (parent.kind) {
- case 231:
- case 148:
+ case 232:
+ case 149:
+ case 152:
case 151:
- case 150:
- case 272:
- case 269:
- case 181:
+ case 273:
+ case 270:
+ case 182:
return parent.initializer === node;
- case 215:
case 216:
case 217:
case 218:
- case 224:
+ case 219:
case 225:
case 226:
- case 265:
- case 228:
+ case 227:
+ case 266:
+ case 229:
return parent.expression === node;
- case 219:
+ case 220:
var forStatement = parent;
- return (forStatement.initializer === node && forStatement.initializer.kind !== 232) ||
+ return (forStatement.initializer === node && forStatement.initializer.kind !== 233) ||
forStatement.condition === node ||
forStatement.incrementor === node;
- case 220:
case 221:
+ case 222:
var forInStatement = parent;
- return (forInStatement.initializer === node && forInStatement.initializer.kind !== 232) ||
+ return (forInStatement.initializer === node && forInStatement.initializer.kind !== 233) ||
forInStatement.expression === node;
- case 189:
- case 207:
+ case 190:
+ case 208:
return node === parent.expression;
- case 210:
+ case 211:
return node === parent.expression;
- case 146:
+ case 147:
return node === parent.expression;
- case 149:
+ case 150:
+ case 265:
case 264:
- case 263:
- case 271:
+ case 272:
return true;
- case 206:
+ case 207:
return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent);
default:
return isExpressionNode(parent);
@@ -7643,7 +7700,7 @@ var ts;
}
ts.isInExpressionContext = isInExpressionContext;
function isExternalModuleImportEqualsDeclaration(node) {
- return node.kind === 242 && node.moduleReference.kind === 253;
+ return node.kind === 243 && node.moduleReference.kind === 254;
}
ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration;
function getExternalModuleImportEqualsDeclarationExpression(node) {
@@ -7652,7 +7709,7 @@ var ts;
}
ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression;
function isInternalModuleImportEqualsDeclaration(node) {
- return node.kind === 242 && node.moduleReference.kind !== 253;
+ return node.kind === 243 && node.moduleReference.kind !== 254;
}
ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration;
function isSourceFileJavaScript(file) {
@@ -7664,15 +7721,15 @@ var ts;
}
ts.isSourceFileNotJavaScript = isSourceFileNotJavaScript;
function isInJavaScriptFile(node) {
- return node && !!(node.flags & 65536);
+ return !!node && !!(node.flags & 65536);
}
ts.isInJavaScriptFile = isInJavaScriptFile;
function isInJsonFile(node) {
- return node && !!(node.flags & 16777216);
+ return !!node && !!(node.flags & 16777216);
}
ts.isInJsonFile = isInJsonFile;
function isInJSDoc(node) {
- return node && !!(node.flags & 2097152);
+ return !!node && !!(node.flags & 2097152);
}
ts.isInJSDoc = isInJSDoc;
function isJSDocIndexSignature(node) {
@@ -7684,7 +7741,7 @@ var ts;
}
ts.isJSDocIndexSignature = isJSDocIndexSignature;
function isRequireCall(callExpression, checkArgumentIsStringLiteralLike) {
- if (callExpression.kind !== 186) {
+ if (callExpression.kind !== 187) {
return false;
}
var _a = callExpression, expression = _a.expression, args = _a.arguments;
@@ -7706,22 +7763,48 @@ var ts;
return getSourceTextOfNodeFromSourceFile(sourceFile, str).charCodeAt(0) === 34;
}
ts.isStringDoubleQuoted = isStringDoubleQuoted;
- function getJSInitializerSymbol(symbol) {
- if (!symbol || !symbol.valueDeclaration) {
- return symbol;
+ function getDeclarationOfJSInitializer(node) {
+ if (!isInJavaScriptFile(node) || !node.parent) {
+ return undefined;
}
- var declaration = symbol.valueDeclaration;
- var e = getDeclaredJavascriptInitializer(declaration) || getAssignedJavascriptInitializer(declaration);
- return e && e.symbol ? e.symbol : symbol;
- }
- ts.getJSInitializerSymbol = getJSInitializerSymbol;
- function getDeclaredJavascriptInitializer(node) {
- if (node && ts.isVariableDeclaration(node) && node.initializer) {
- return getJavascriptInitializer(node.initializer, false) ||
- ts.isIdentifier(node.name) && getDefaultedJavascriptInitializer(node.name, node.initializer, false);
+ var name;
+ var decl;
+ if (ts.isVariableDeclaration(node.parent) && node.parent.initializer === node) {
+ name = node.parent.name;
+ decl = node.parent;
}
+ else if (ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 58 && node.parent.right === node) {
+ name = node.parent.left;
+ decl = name;
+ }
+ else if (ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 54) {
+ if (ts.isVariableDeclaration(node.parent.parent) && node.parent.parent.initializer === node.parent) {
+ name = node.parent.parent.name;
+ decl = node.parent.parent;
+ }
+ else if (ts.isBinaryExpression(node.parent.parent) && node.parent.parent.operatorToken.kind === 58 && node.parent.parent.right === node.parent) {
+ name = node.parent.parent.left;
+ decl = name;
+ }
+ if (!name || !isEntityNameExpression(name) || !isSameEntityName(name, node.parent.left)) {
+ return undefined;
+ }
+ }
+ if (!name || !getJavascriptInitializer(node, isPrototypeAccess(name))) {
+ return undefined;
+ }
+ return decl;
}
- ts.getDeclaredJavascriptInitializer = getDeclaredJavascriptInitializer;
+ ts.getDeclarationOfJSInitializer = getDeclarationOfJSInitializer;
+ function getEffectiveInitializer(node) {
+ if (isInJavaScriptFile(node) && node.initializer &&
+ ts.isBinaryExpression(node.initializer) && node.initializer.operatorToken.kind === 54 &&
+ node.name && isEntityNameExpression(node.name) && isSameEntityName(node.name, node.initializer.left)) {
+ return node.initializer.right;
+ }
+ return node.initializer;
+ }
+ ts.getEffectiveInitializer = getEffectiveInitializer;
function getAssignedJavascriptInitializer(node) {
if (node && node.parent && ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 58) {
var isPrototypeAssignment = isPrototypeAccess(node.parent.left);
@@ -7733,11 +7816,11 @@ var ts;
function getJavascriptInitializer(initializer, isPrototypeAssignment) {
if (ts.isCallExpression(initializer)) {
var e = skipParentheses(initializer.expression);
- return e.kind === 191 || e.kind === 192 ? initializer : undefined;
+ return e.kind === 192 || e.kind === 193 ? initializer : undefined;
}
- if (initializer.kind === 191 ||
- initializer.kind === 204 ||
- initializer.kind === 192) {
+ if (initializer.kind === 192 ||
+ initializer.kind === 205 ||
+ initializer.kind === 193) {
return initializer;
}
if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) {
@@ -7751,6 +7834,13 @@ var ts;
return e;
}
}
+ function isDefaultedJavascriptInitializer(node) {
+ var name = ts.isVariableDeclaration(node.parent) ? node.parent.name :
+ ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 58 ? node.parent.left :
+ undefined;
+ return name && getJavascriptInitializer(node.right, isPrototypeAccess(name)) && isEntityNameExpression(name) && isSameEntityName(name, node.left);
+ }
+ ts.isDefaultedJavascriptInitializer = isDefaultedJavascriptInitializer;
function getOuterNameOfJsInitializer(node) {
if (ts.isBinaryExpression(node.parent)) {
var parent = (node.parent.operatorToken.kind === 54 && ts.isBinaryExpression(node.parent.parent)) ? node.parent.parent : node.parent;
@@ -7843,7 +7933,7 @@ var ts;
ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment;
function isSpecialPropertyDeclaration(expr) {
return isInJavaScriptFile(expr) &&
- expr.parent && expr.parent.kind === 215 &&
+ expr.parent && expr.parent.kind === 216 &&
!!ts.getJSDocTypeTag(expr.parent);
}
ts.isSpecialPropertyDeclaration = isSpecialPropertyDeclaration;
@@ -7853,14 +7943,14 @@ var ts;
ts.importFromModuleSpecifier = importFromModuleSpecifier;
function tryGetImportFromModuleSpecifier(node) {
switch (node.parent.kind) {
- case 243:
- case 249:
+ case 244:
+ case 250:
return node.parent;
- case 253:
+ case 254:
return node.parent.parent;
- case 186:
+ case 187:
return node.parent;
- case 177:
+ case 178:
ts.Debug.assert(ts.isStringLiteral(node));
return ts.tryCast(node.parent.parent, ts.isImportTypeNode);
default:
@@ -7870,12 +7960,12 @@ var ts;
ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier;
function getExternalModuleName(node) {
switch (node.kind) {
- case 243:
- case 249:
+ case 244:
+ case 250:
return node.moduleSpecifier;
- case 242:
- return node.moduleReference.kind === 253 ? node.moduleReference.expression : undefined;
- case 178:
+ case 243:
+ return node.moduleReference.kind === 254 ? node.moduleReference.expression : undefined;
+ case 179:
return isLiteralImportTypeNode(node) ? node.argument.literal : undefined;
default:
return ts.Debug.assertNever(node);
@@ -7884,11 +7974,11 @@ var ts;
ts.getExternalModuleName = getExternalModuleName;
function getNamespaceDeclarationNode(node) {
switch (node.kind) {
- case 243:
+ case 244:
return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport);
- case 242:
+ case 243:
return node;
- case 249:
+ case 250:
return undefined;
default:
return ts.Debug.assertNever(node);
@@ -7896,19 +7986,19 @@ var ts;
}
ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode;
function isDefaultImport(node) {
- return node.kind === 243 && node.importClause && !!node.importClause.name;
+ return node.kind === 244 && !!node.importClause && !!node.importClause.name;
}
ts.isDefaultImport = isDefaultImport;
function hasQuestionToken(node) {
if (node) {
switch (node.kind) {
- case 148:
+ case 149:
+ case 154:
case 153:
- case 152:
+ case 271:
case 270:
- case 269:
+ case 152:
case 151:
- case 150:
return node.questionToken !== undefined;
}
}
@@ -7916,14 +8006,14 @@ var ts;
}
ts.hasQuestionToken = hasQuestionToken;
function isJSDocConstructSignature(node) {
- return node.kind === 283 &&
+ return node.kind === 284 &&
node.parameters.length > 0 &&
node.parameters[0].name &&
node.parameters[0].name.escapedText === "new";
}
ts.isJSDocConstructSignature = isJSDocConstructSignature;
function isJSDocTypeAlias(node) {
- return node.kind === 296 || node.kind === 291;
+ return node.kind === 297 || node.kind === 292;
}
ts.isJSDocTypeAlias = isJSDocTypeAlias;
function isTypeAlias(node) {
@@ -7933,38 +8023,39 @@ var ts;
function getSourceOfAssignment(node) {
return ts.isExpressionStatement(node) &&
node.expression && ts.isBinaryExpression(node.expression) &&
- node.expression.operatorToken.kind === 58 &&
- node.expression.right;
+ node.expression.operatorToken.kind === 58
+ ? node.expression.right
+ : undefined;
}
function getSourceOfDefaultedAssignment(node) {
return ts.isExpressionStatement(node) &&
ts.isBinaryExpression(node.expression) &&
getSpecialPropertyAssignmentKind(node.expression) !== 0 &&
ts.isBinaryExpression(node.expression.right) &&
- node.expression.right.operatorToken.kind === 54 &&
- node.expression.right.right;
+ node.expression.right.operatorToken.kind === 54
+ ? node.expression.right.right
+ : undefined;
}
function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) {
switch (node.kind) {
- case 213:
+ case 214:
var v = getSingleVariableOfVariableStatement(node);
return v && v.initializer;
- case 151:
+ case 152:
return node.initializer;
- case 269:
+ case 270:
return node.initializer;
}
}
function getSingleVariableOfVariableStatement(node) {
- return ts.isVariableStatement(node) &&
- node.declarationList.declarations.length > 0 &&
- node.declarationList.declarations[0];
+ return ts.isVariableStatement(node) ? ts.firstOrUndefined(node.declarationList.declarations) : undefined;
}
function getNestedModuleDeclaration(node) {
- return node.kind === 238 &&
+ return ts.isModuleDeclaration(node) &&
node.body &&
- node.body.kind === 238 &&
- node.body;
+ node.body.kind === 239
+ ? node.body
+ : undefined;
}
function getJSDocCommentsAndTags(hostNode) {
var result;
@@ -7974,7 +8065,7 @@ var ts;
var parent = node.parent;
if (!parent)
return;
- if (parent.kind === 269 || parent.kind === 151 || getNestedModuleDeclaration(parent)) {
+ if (parent.kind === 270 || parent.kind === 152 || getNestedModuleDeclaration(parent)) {
getJSDocCommentsAndTagsWorker(parent);
}
if (parent.parent && (getSingleVariableOfVariableStatement(parent.parent) === node)) {
@@ -7988,10 +8079,10 @@ var ts;
}
if (ts.isBinaryExpression(node) && node.operatorToken.kind === 58 ||
ts.isBinaryExpression(parent) && parent.operatorToken.kind === 58 ||
- node.kind === 184 && node.parent && node.parent.kind === 215) {
+ node.kind === 185 && node.parent && node.parent.kind === 216) {
getJSDocCommentsAndTagsWorker(parent);
}
- if (node.kind === 148) {
+ if (node.kind === 149) {
result = ts.addRange(result, ts.getJSDocParameterTags(node));
}
if (isVariableLike(node) && ts.hasInitializer(node) && node.initializer !== hostNode && ts.hasJSDocNodes(node.initializer)) {
@@ -8045,43 +8136,43 @@ var ts;
ts.getTypeParameterFromJsDoc = getTypeParameterFromJsDoc;
function hasRestParameter(s) {
var last = ts.lastOrUndefined(s.parameters);
- return last && isRestParameter(last);
+ return !!last && isRestParameter(last);
}
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 === 284;
+ return node.dotDotDotToken !== undefined || !!type && type.kind === 285;
}
ts.isRestParameter = isRestParameter;
function getAssignmentTargetKind(node) {
var parent = node.parent;
while (true) {
switch (parent.kind) {
- case 199:
+ case 200:
var binaryOperator = parent.operatorToken.kind;
return isAssignmentOperator(binaryOperator) && parent.left === node ?
binaryOperator === 58 ? 1 : 2 :
0;
- case 197:
case 198:
+ case 199:
var unaryOperator = parent.operator;
return unaryOperator === 43 || unaryOperator === 44 ? 2 : 0;
- case 220:
case 221:
+ case 222:
return parent.initializer === node ? 1 : 0;
- case 190:
- case 182:
- case 203:
- case 208:
+ case 191:
+ case 183:
+ case 204:
+ case 209:
node = parent;
break;
- case 270:
+ case 271:
if (parent.name !== node) {
return 0;
}
node = parent.parent;
break;
- case 269:
+ case 270:
if (parent.name === node) {
return 0;
}
@@ -8100,22 +8191,22 @@ var ts;
ts.isAssignmentTarget = isAssignmentTarget;
function isNodeWithPossibleHoistedDeclaration(node) {
switch (node.kind) {
- case 212:
case 213:
- case 225:
- case 216:
+ case 214:
case 226:
- case 240:
- case 265:
- case 266:
+ case 217:
case 227:
- case 219:
+ case 241:
+ case 266:
+ case 267:
+ case 228:
case 220:
case 221:
- case 217:
+ case 222:
case 218:
- case 229:
- case 268:
+ case 219:
+ case 230:
+ case 269:
return true;
}
return false;
@@ -8132,26 +8223,26 @@ var ts;
return node;
}
function walkUpParenthesizedTypes(node) {
- return walkUp(node, 172);
+ return walkUp(node, 173);
}
ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes;
function walkUpParenthesizedExpressions(node) {
- return walkUp(node, 190);
+ return walkUp(node, 191);
}
ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions;
function skipParentheses(node) {
- while (node.kind === 190) {
+ while (node.kind === 191) {
node = node.expression;
}
return node;
}
ts.skipParentheses = skipParentheses;
function isDeleteTarget(node) {
- if (node.kind !== 184 && node.kind !== 185) {
+ if (node.kind !== 185 && node.kind !== 186) {
return false;
}
node = walkUpParenthesizedExpressions(node.parent);
- return node && node.kind === 193;
+ return node && node.kind === 194;
}
ts.isDeleteTarget = isDeleteTarget;
function isNodeDescendantOf(node, ancestor) {
@@ -8171,9 +8262,10 @@ var ts;
switch (name.kind) {
case 71:
case 9:
- case 8:
- if (ts.isDeclaration(name.parent)) {
- return name.parent.name === name;
+ case 8: {
+ var parent = name.parent;
+ if (ts.isDeclaration(parent)) {
+ return parent.name === name;
}
else if (ts.isQualifiedName(name.parent)) {
var tag = name.parent.parent;
@@ -8183,6 +8275,7 @@ var ts;
var binExp = name.parent.parent;
return ts.isBinaryExpression(binExp) && getSpecialPropertyAssignmentKind(binExp) !== 0 && ts.getNameOfDeclaration(binExp) === name;
}
+ }
default:
return false;
}
@@ -8190,49 +8283,49 @@ var ts;
ts.isAnyDeclarationName = isAnyDeclarationName;
function isLiteralComputedPropertyDeclarationName(node) {
return (node.kind === 9 || node.kind === 8) &&
- node.parent.kind === 146 &&
+ node.parent.kind === 147 &&
ts.isDeclaration(node.parent.parent);
}
ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName;
function isIdentifierName(node) {
var parent = node.parent;
switch (parent.kind) {
- case 151:
- case 150:
- case 153:
case 152:
- case 155:
+ case 151:
+ case 154:
+ case 153:
case 156:
- case 272:
- case 269:
- case 184:
+ case 157:
+ case 273:
+ case 270:
+ case 185:
return parent.name === node;
- case 145:
+ case 146:
if (parent.right === node) {
- while (parent.kind === 145) {
+ while (parent.kind === 146) {
parent = parent.parent;
}
- return parent.kind === 164 || parent.kind === 161;
+ return parent.kind === 165 || parent.kind === 162;
}
return false;
- case 181:
- case 247:
+ case 182:
+ case 248:
return parent.propertyName === node;
- case 251:
- case 261:
+ case 252:
+ case 262:
return true;
}
return false;
}
ts.isIdentifierName = isIdentifierName;
function isAliasSymbolDeclaration(node) {
- return node.kind === 242 ||
- node.kind === 241 ||
- node.kind === 244 && !!node.name ||
- node.kind === 245 ||
- node.kind === 247 ||
- node.kind === 251 ||
- node.kind === 248 && exportAssignmentIsAlias(node) ||
+ return node.kind === 243 ||
+ node.kind === 242 ||
+ node.kind === 245 && !!node.name ||
+ node.kind === 246 ||
+ node.kind === 248 ||
+ node.kind === 252 ||
+ node.kind === 249 && exportAssignmentIsAlias(node) ||
ts.isBinaryExpression(node) && getSpecialPropertyAssignmentKind(node) === 2;
}
ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration;
@@ -8292,11 +8385,11 @@ var ts;
}
ts.getAncestor = getAncestor;
function isKeyword(token) {
- return 72 <= token && token <= 144;
+ return 72 <= token && token <= 145;
}
ts.isKeyword = isKeyword;
function isContextualKeyword(token) {
- return 117 <= token && token <= 144;
+ return 117 <= token && token <= 145;
}
ts.isContextualKeyword = isContextualKeyword;
function isNonContextualKeyword(token) {
@@ -8318,13 +8411,13 @@ var ts;
}
var flags = 0;
switch (node.kind) {
- case 233:
- case 191:
- case 153:
+ case 234:
+ case 192:
+ case 154:
if (node.asteriskToken) {
flags |= 1;
}
- case 192:
+ case 193:
if (hasModifier(node, 256)) {
flags |= 2;
}
@@ -8338,10 +8431,10 @@ var ts;
ts.getFunctionFlags = getFunctionFlags;
function isAsyncFunction(node) {
switch (node.kind) {
- case 233:
- case 191:
+ case 234:
case 192:
- case 153:
+ case 193:
+ case 154:
return node.body !== undefined
&& node.asteriskToken === undefined
&& hasModifier(node, 256);
@@ -8357,11 +8450,11 @@ var ts;
ts.isStringOrNumericLiteral = isStringOrNumericLiteral;
function hasDynamicName(declaration) {
var name = ts.getNameOfDeclaration(declaration);
- return name && isDynamicName(name);
+ return !!name && isDynamicName(name);
}
ts.hasDynamicName = hasDynamicName;
function isDynamicName(name) {
- return name.kind === 146 &&
+ return name.kind === 147 &&
!isStringOrNumericLiteral(name.expression) &&
!isWellKnownSymbolSyntactically(name.expression);
}
@@ -8377,7 +8470,7 @@ var ts;
if (name.kind === 9 || name.kind === 8) {
return escapeLeadingUnderscores(name.text);
}
- if (name.kind === 146) {
+ if (name.kind === 147) {
var nameExpression = name.expression;
if (isWellKnownSymbolSyntactically(nameExpression)) {
return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name));
@@ -8427,11 +8520,11 @@ var ts;
ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier;
function isParameterDeclaration(node) {
var root = getRootDeclaration(node);
- return root.kind === 148;
+ return root.kind === 149;
}
ts.isParameterDeclaration = isParameterDeclaration;
function getRootDeclaration(node) {
- while (node.kind === 181) {
+ while (node.kind === 182) {
node = node.parent.parent;
}
return node;
@@ -8439,15 +8532,15 @@ var ts;
ts.getRootDeclaration = getRootDeclaration;
function nodeStartsNewLexicalEnvironment(node) {
var kind = node.kind;
- return kind === 154
- || kind === 191
- || kind === 233
+ return kind === 155
|| kind === 192
- || kind === 153
- || kind === 155
+ || kind === 234
+ || kind === 193
+ || kind === 154
|| kind === 156
- || kind === 238
- || kind === 273;
+ || kind === 157
+ || kind === 239
+ || kind === 274;
}
ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment;
function nodeIsSynthesized(range) {
@@ -8461,23 +8554,23 @@ var ts;
ts.getOriginalSourceFile = getOriginalSourceFile;
function getExpressionAssociativity(expression) {
var operator = getOperator(expression);
- var hasArguments = expression.kind === 187 && expression.arguments !== undefined;
+ var hasArguments = expression.kind === 188 && expression.arguments !== undefined;
return getOperatorAssociativity(expression.kind, operator, hasArguments);
}
ts.getExpressionAssociativity = getExpressionAssociativity;
function getOperatorAssociativity(kind, operator, hasArguments) {
switch (kind) {
- case 187:
+ case 188:
return hasArguments ? 0 : 1;
- case 197:
- case 194:
+ case 198:
case 195:
- case 193:
case 196:
- case 200:
- case 202:
+ case 194:
+ case 197:
+ case 201:
+ case 203:
return 1;
- case 199:
+ case 200:
switch (operator) {
case 40:
case 58:
@@ -8501,15 +8594,15 @@ var ts;
ts.getOperatorAssociativity = getOperatorAssociativity;
function getExpressionPrecedence(expression) {
var operator = getOperator(expression);
- var hasArguments = expression.kind === 187 && expression.arguments !== undefined;
+ var hasArguments = expression.kind === 188 && expression.arguments !== undefined;
return getOperatorPrecedence(expression.kind, operator, hasArguments);
}
ts.getExpressionPrecedence = getExpressionPrecedence;
function getOperator(expression) {
- if (expression.kind === 199) {
+ if (expression.kind === 200) {
return expression.operatorToken.kind;
}
- else if (expression.kind === 197 || expression.kind === 198) {
+ else if (expression.kind === 198 || expression.kind === 199) {
return expression.operator;
}
else {
@@ -8519,15 +8612,15 @@ var ts;
ts.getOperator = getOperator;
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
switch (nodeKind) {
- case 301:
+ case 302:
return 0;
- case 203:
+ case 204:
return 1;
- case 202:
+ case 203:
return 2;
- case 200:
+ case 201:
return 4;
- case 199:
+ case 200:
switch (operatorKind) {
case 26:
return 0;
@@ -8548,21 +8641,21 @@ var ts;
default:
return getBinaryOperatorPrecedence(operatorKind);
}
- case 197:
- case 194:
- case 195:
- case 193:
- case 196:
- return 16;
case 198:
+ case 195:
+ case 196:
+ case 194:
+ case 197:
+ return 16;
+ case 199:
return 17;
- case 186:
- return 18;
case 187:
- return hasArguments ? 19 : 18;
+ return 18;
case 188:
- case 184:
+ return hasArguments ? 19 : 18;
+ case 189:
case 185:
+ case 186:
return 19;
case 99:
case 97:
@@ -8572,19 +8665,19 @@ var ts;
case 86:
case 8:
case 9:
- case 182:
case 183:
- case 191:
+ case 184:
case 192:
- case 204:
- case 254:
+ case 193:
+ case 205:
case 255:
- case 258:
+ case 256:
+ case 259:
case 12:
case 13:
- case 201:
- case 190:
- case 205:
+ case 202:
+ case 191:
+ case 206:
return 20;
default:
return -1;
@@ -8784,7 +8877,7 @@ var ts;
var lineStartsOfS = ts.computeLineStarts(s);
if (lineStartsOfS.length > 1) {
lineCount = lineCount + lineStartsOfS.length - 1;
- linePos = output.length - s.length + ts.lastOrUndefined(lineStartsOfS);
+ linePos = output.length - s.length + ts.last(lineStartsOfS);
}
}
}
@@ -8943,7 +9036,7 @@ var ts;
}
ts.parameterIsThisKeyword = parameterIsThisKeyword;
function isThisIdentifier(node) {
- return node && node.kind === 71 && identifierIsThisKeyword(node);
+ return !!node && node.kind === 71 && identifierIsThisKeyword(node);
}
ts.isThisIdentifier = isThisIdentifier;
function identifierIsThisKeyword(id) {
@@ -8957,10 +9050,10 @@ var ts;
var setAccessor;
if (hasDynamicName(accessor)) {
firstAccessor = accessor;
- if (accessor.kind === 155) {
+ if (accessor.kind === 156) {
getAccessor = accessor;
}
- else if (accessor.kind === 156) {
+ else if (accessor.kind === 157) {
setAccessor = accessor;
}
else {
@@ -8969,7 +9062,7 @@ var ts;
}
else {
ts.forEach(declarations, function (member) {
- if ((member.kind === 155 || member.kind === 156)
+ if ((member.kind === 156 || member.kind === 157)
&& hasModifier(member, 32) === hasModifier(accessor, 32)) {
var memberName = getPropertyNameForPropertyNameNode(member.name);
var accessorName = getPropertyNameForPropertyNameNode(accessor.name);
@@ -8980,10 +9073,10 @@ var ts;
else if (!secondAccessor) {
secondAccessor = member;
}
- if (member.kind === 155 && !getAccessor) {
+ if (member.kind === 156 && !getAccessor) {
getAccessor = member;
}
- if (member.kind === 156 && !setAccessor) {
+ if (member.kind === 157 && !setAccessor) {
setAccessor = member;
}
}
@@ -9018,24 +9111,19 @@ var ts;
return ts.emptyArray;
}
if (isJSDocTypeAlias(node)) {
- ts.Debug.assert(node.parent.kind === 285);
- var templateTags = ts.flatMap(ts.filter(node.parent.tags, ts.isJSDocTemplateTag), function (tag) { return tag.typeParameters; });
- var templateTagNodes = templateTags;
- templateTagNodes.pos = templateTagNodes.length > 0 ? ts.first(templateTagNodes).pos : node.pos;
- templateTagNodes.end = templateTagNodes.length > 0 ? ts.last(templateTagNodes).end : node.end;
- templateTagNodes.hasTrailingComma = false;
- return templateTagNodes;
+ ts.Debug.assert(node.parent.kind === 286);
+ return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; });
}
return node.typeParameters || (isInJavaScriptFile(node) ? getJSDocTypeParameterDeclarations(node) : ts.emptyArray);
}
ts.getEffectiveTypeParameterDeclarations = getEffectiveTypeParameterDeclarations;
function getJSDocTypeParameterDeclarations(node) {
- var tag = ts.find(ts.getJSDocTags(node), function (tag) {
- return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 285 && tag.parent.tags.some(isJSDocTypeAlias));
- });
- return (tag && tag.typeParameters) || ts.emptyArray;
+ return ts.flatMap(ts.getJSDocTags(node), function (tag) { return isNonTypeAliasTemplate(tag) ? tag.typeParameters : undefined; });
}
ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations;
+ function isNonTypeAliasTemplate(tag) {
+ return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 286 && tag.parent.tags.some(isJSDocTypeAlias));
+ }
function getEffectiveSetAccessorTypeAnnotationNode(node) {
var parameter = getSetAccessorValueParameter(node);
return parameter && getEffectiveTypeAnnotationNode(parameter);
@@ -9112,12 +9200,12 @@ var ts;
lastComment = comment;
}
if (detachedComments.length) {
- var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, ts.lastOrUndefined(detachedComments).end);
+ var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, ts.last(detachedComments).end);
var nodeLine = getLineOfLocalPositionFromLineMap(lineMap, ts.skipTrivia(text, node.pos));
if (nodeLine >= lastCommentLine + 2) {
emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments);
emitComments(text, lineMap, writer, detachedComments, false, true, newLine, writeComment);
- currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: ts.lastOrUndefined(detachedComments).end };
+ currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: ts.last(detachedComments).end };
}
}
}
@@ -9260,7 +9348,7 @@ var ts;
}
ts.isAssignmentOperator = isAssignmentOperator;
function tryGetClassExtendingExpressionWithTypeArguments(node) {
- if (node.kind === 206 &&
+ if (ts.isExpressionWithTypeArguments(node) &&
node.parent.token === 85 &&
ts.isClassLike(node.parent.parent)) {
return node.parent.parent;
@@ -9278,8 +9366,8 @@ var ts;
function isDestructuringAssignment(node) {
if (isAssignmentExpression(node, true)) {
var kind = node.left.kind;
- return kind === 183
- || kind === 182;
+ return kind === 184
+ || kind === 183;
}
return false;
}
@@ -9289,7 +9377,7 @@ var ts;
}
ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause;
function isExpressionWithTypeArgumentsInClassImplementsClause(node) {
- return node.kind === 206
+ return node.kind === 207
&& isEntityNameExpression(node.expression)
&& node.parent
&& node.parent.token === 108
@@ -9310,17 +9398,17 @@ var ts;
}
ts.isPrototypeAccess = isPrototypeAccess;
function isRightSideOfQualifiedNameOrPropertyAccess(node) {
- return (node.parent.kind === 145 && node.parent.right === node) ||
- (node.parent.kind === 184 && node.parent.name === node);
+ return (node.parent.kind === 146 && node.parent.right === node) ||
+ (node.parent.kind === 185 && node.parent.name === node);
}
ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess;
function isEmptyObjectLiteral(expression) {
- return expression.kind === 183 &&
+ return expression.kind === 184 &&
expression.properties.length === 0;
}
ts.isEmptyObjectLiteral = isEmptyObjectLiteral;
function isEmptyArrayLiteral(expression) {
- return expression.kind === 182 &&
+ return expression.kind === 183 &&
expression.elements.length === 0;
}
ts.isEmptyArrayLiteral = isEmptyArrayLiteral;
@@ -9417,14 +9505,14 @@ var ts;
return output;
}
function base64encode(host, input) {
- if (host.base64encode) {
+ if (host && host.base64encode) {
return host.base64encode(input);
}
return convertToBase64(input);
}
ts.base64encode = base64encode;
function base64decode(host, input) {
- if (host.base64decode) {
+ if (host && host.base64decode) {
return host.base64decode(input);
}
var length = input.length;
@@ -9600,8 +9688,8 @@ var ts;
var parseNode = ts.getParseTreeNode(node);
if (parseNode) {
switch (parseNode.parent.kind) {
- case 237:
case 238:
+ case 239:
return parseNode === parseNode.parent.name;
}
}
@@ -9663,20 +9751,20 @@ var ts;
if (!parent)
return 0;
switch (parent.kind) {
+ case 199:
case 198:
- case 197:
var operator = parent.operator;
return operator === 43 || operator === 44 ? writeOrReadWrite() : 0;
- case 199:
+ case 200:
var _a = parent, left = _a.left, operatorToken = _a.operatorToken;
return left === node && isAssignmentOperator(operatorToken.kind) ? writeOrReadWrite() : 0;
- case 184:
+ case 185:
return parent.name !== node ? 0 : accessKind(parent);
default:
return 0;
}
function writeOrReadWrite() {
- return parent.parent && parent.parent.kind === 215 ? 1 : 2;
+ return parent.parent && parent.parent.kind === 216 ? 1 : 2;
}
}
function compareDataObjects(dst, src) {
@@ -9753,7 +9841,7 @@ var ts;
}
ts.getClassLikeDeclarationOfSymbol = getClassLikeDeclarationOfSymbol;
function getObjectFlags(type) {
- return type.flags & 65536 ? type.objectFlags : 0;
+ return type.flags & 131072 ? type.objectFlags : 0;
}
ts.getObjectFlags = getObjectFlags;
function typeHasCallOrConstructSignatures(type, checker) {
@@ -9932,9 +10020,9 @@ var ts;
}
ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions;
function getTypeParameterOwner(d) {
- if (d && d.kind === 147) {
+ if (d && d.kind === 148) {
for (var current = d; current; current = current.parent) {
- if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 235) {
+ if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 236) {
return current;
}
}
@@ -9942,7 +10030,7 @@ var ts;
}
ts.getTypeParameterOwner = getTypeParameterOwner;
function isParameterPropertyDeclaration(node) {
- return ts.hasModifier(node, 92) && node.parent.kind === 154;
+ return ts.hasModifier(node, 92) && node.parent.kind === 155;
}
ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration;
function isEmptyBindingPattern(node) {
@@ -9960,7 +10048,7 @@ var ts;
}
ts.isEmptyBindingElement = isEmptyBindingElement;
function walkUpBindingElementsAndPatterns(node) {
- while (node && (node.kind === 181 || ts.isBindingPattern(node))) {
+ while (node && (node.kind === 182 || ts.isBindingPattern(node))) {
node = node.parent;
}
return node;
@@ -9968,14 +10056,14 @@ var ts;
function getCombinedModifierFlags(node) {
node = walkUpBindingElementsAndPatterns(node);
var flags = ts.getModifierFlags(node);
- if (node.kind === 231) {
+ if (node.kind === 232) {
node = node.parent;
}
- if (node && node.kind === 232) {
+ if (node && node.kind === 233) {
flags |= ts.getModifierFlags(node);
node = node.parent;
}
- if (node && node.kind === 213) {
+ if (node && node.kind === 214) {
flags |= ts.getModifierFlags(node);
}
return flags;
@@ -9984,14 +10072,14 @@ var ts;
function getCombinedNodeFlags(node) {
node = walkUpBindingElementsAndPatterns(node);
var flags = node.flags;
- if (node.kind === 231) {
+ if (node.kind === 232) {
node = node.parent;
}
- if (node && node.kind === 232) {
+ if (node && node.kind === 233) {
flags |= node.flags;
node = node.parent;
}
- if (node && node.kind === 213) {
+ if (node && node.kind === 214) {
flags |= node.flags;
}
return flags;
@@ -10035,7 +10123,7 @@ var ts;
try {
ts.localizedDiagnosticMessages = JSON.parse(fileContents);
}
- catch (e) {
+ catch (_a) {
if (errors) {
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Corrupted_locale_file_0, filePath));
}
@@ -10095,17 +10183,17 @@ var ts;
return getDeclarationIdentifier(hostNode);
}
switch (hostNode.kind) {
- case 213:
+ case 214:
if (hostNode.declarationList && hostNode.declarationList.declarations[0]) {
return getDeclarationIdentifier(hostNode.declarationList.declarations[0]);
}
return undefined;
- case 215:
+ case 216:
var expr = hostNode.expression;
switch (expr.kind) {
- case 184:
- return expr.name;
case 185:
+ return expr.name;
+ case 186:
var arg = expr.argumentExpression;
if (ts.isIdentifier(arg)) {
return arg;
@@ -10114,10 +10202,10 @@ var ts;
return undefined;
case 1:
return undefined;
- case 190: {
+ case 191: {
return getDeclarationIdentifier(hostNode.expression);
}
- case 227: {
+ case 228: {
if (ts.isDeclaration(hostNode.statement) || ts.isExpression(hostNode.statement)) {
return getDeclarationIdentifier(hostNode.statement);
}
@@ -10144,23 +10232,23 @@ var ts;
return undefined;
}
switch (declaration.kind) {
- case 204:
- case 191:
+ case 205:
+ case 192:
if (!declaration.name) {
return getAssignedName(declaration);
}
break;
case 71:
return declaration;
- case 297:
- case 292: {
+ case 298:
+ case 293: {
var name = declaration.name;
- if (name.kind === 145) {
+ if (name.kind === 146) {
return name.right;
}
break;
}
- case 199: {
+ case 200: {
var expr = declaration;
switch (ts.getSpecialPropertyAssignmentKind(expr)) {
case 1:
@@ -10172,11 +10260,11 @@ var ts;
return undefined;
}
}
- case 291:
+ case 292:
return declaration.name;
- case 296:
+ case 297:
return getNameOfJSDocTypedef(declaration);
- case 248: {
+ case 249: {
var expression = declaration.expression;
return ts.isIdentifier(expression) ? expression : undefined;
}
@@ -10315,628 +10403,628 @@ var ts;
}
ts.isIdentifier = isIdentifier;
function isQualifiedName(node) {
- return node.kind === 145;
+ return node.kind === 146;
}
ts.isQualifiedName = isQualifiedName;
function isComputedPropertyName(node) {
- return node.kind === 146;
+ return node.kind === 147;
}
ts.isComputedPropertyName = isComputedPropertyName;
function isTypeParameterDeclaration(node) {
- return node.kind === 147;
+ return node.kind === 148;
}
ts.isTypeParameterDeclaration = isTypeParameterDeclaration;
function isParameter(node) {
- return node.kind === 148;
+ return node.kind === 149;
}
ts.isParameter = isParameter;
function isDecorator(node) {
- return node.kind === 149;
+ return node.kind === 150;
}
ts.isDecorator = isDecorator;
function isPropertySignature(node) {
- return node.kind === 150;
+ return node.kind === 151;
}
ts.isPropertySignature = isPropertySignature;
function isPropertyDeclaration(node) {
- return node.kind === 151;
+ return node.kind === 152;
}
ts.isPropertyDeclaration = isPropertyDeclaration;
function isMethodSignature(node) {
- return node.kind === 152;
+ return node.kind === 153;
}
ts.isMethodSignature = isMethodSignature;
function isMethodDeclaration(node) {
- return node.kind === 153;
+ return node.kind === 154;
}
ts.isMethodDeclaration = isMethodDeclaration;
function isConstructorDeclaration(node) {
- return node.kind === 154;
+ return node.kind === 155;
}
ts.isConstructorDeclaration = isConstructorDeclaration;
function isGetAccessorDeclaration(node) {
- return node.kind === 155;
+ return node.kind === 156;
}
ts.isGetAccessorDeclaration = isGetAccessorDeclaration;
function isSetAccessorDeclaration(node) {
- return node.kind === 156;
+ return node.kind === 157;
}
ts.isSetAccessorDeclaration = isSetAccessorDeclaration;
function isCallSignatureDeclaration(node) {
- return node.kind === 157;
+ return node.kind === 158;
}
ts.isCallSignatureDeclaration = isCallSignatureDeclaration;
function isConstructSignatureDeclaration(node) {
- return node.kind === 158;
+ return node.kind === 159;
}
ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration;
function isIndexSignatureDeclaration(node) {
- return node.kind === 159;
+ return node.kind === 160;
}
ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration;
function isGetOrSetAccessorDeclaration(node) {
- return node.kind === 156 || node.kind === 155;
+ return node.kind === 157 || node.kind === 156;
}
ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration;
function isTypePredicateNode(node) {
- return node.kind === 160;
+ return node.kind === 161;
}
ts.isTypePredicateNode = isTypePredicateNode;
function isTypeReferenceNode(node) {
- return node.kind === 161;
+ return node.kind === 162;
}
ts.isTypeReferenceNode = isTypeReferenceNode;
function isFunctionTypeNode(node) {
- return node.kind === 162;
+ return node.kind === 163;
}
ts.isFunctionTypeNode = isFunctionTypeNode;
function isConstructorTypeNode(node) {
- return node.kind === 163;
+ return node.kind === 164;
}
ts.isConstructorTypeNode = isConstructorTypeNode;
function isTypeQueryNode(node) {
- return node.kind === 164;
+ return node.kind === 165;
}
ts.isTypeQueryNode = isTypeQueryNode;
function isTypeLiteralNode(node) {
- return node.kind === 165;
+ return node.kind === 166;
}
ts.isTypeLiteralNode = isTypeLiteralNode;
function isArrayTypeNode(node) {
- return node.kind === 166;
+ return node.kind === 167;
}
ts.isArrayTypeNode = isArrayTypeNode;
function isTupleTypeNode(node) {
- return node.kind === 167;
+ return node.kind === 168;
}
ts.isTupleTypeNode = isTupleTypeNode;
function isUnionTypeNode(node) {
- return node.kind === 168;
+ return node.kind === 169;
}
ts.isUnionTypeNode = isUnionTypeNode;
function isIntersectionTypeNode(node) {
- return node.kind === 169;
+ return node.kind === 170;
}
ts.isIntersectionTypeNode = isIntersectionTypeNode;
function isConditionalTypeNode(node) {
- return node.kind === 170;
+ return node.kind === 171;
}
ts.isConditionalTypeNode = isConditionalTypeNode;
function isInferTypeNode(node) {
- return node.kind === 171;
+ return node.kind === 172;
}
ts.isInferTypeNode = isInferTypeNode;
function isParenthesizedTypeNode(node) {
- return node.kind === 172;
+ return node.kind === 173;
}
ts.isParenthesizedTypeNode = isParenthesizedTypeNode;
function isThisTypeNode(node) {
- return node.kind === 173;
+ return node.kind === 174;
}
ts.isThisTypeNode = isThisTypeNode;
function isTypeOperatorNode(node) {
- return node.kind === 174;
+ return node.kind === 175;
}
ts.isTypeOperatorNode = isTypeOperatorNode;
function isIndexedAccessTypeNode(node) {
- return node.kind === 175;
+ return node.kind === 176;
}
ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode;
function isMappedTypeNode(node) {
- return node.kind === 176;
+ return node.kind === 177;
}
ts.isMappedTypeNode = isMappedTypeNode;
function isLiteralTypeNode(node) {
- return node.kind === 177;
+ return node.kind === 178;
}
ts.isLiteralTypeNode = isLiteralTypeNode;
function isImportTypeNode(node) {
- return node.kind === 178;
+ return node.kind === 179;
}
ts.isImportTypeNode = isImportTypeNode;
function isObjectBindingPattern(node) {
- return node.kind === 179;
+ return node.kind === 180;
}
ts.isObjectBindingPattern = isObjectBindingPattern;
function isArrayBindingPattern(node) {
- return node.kind === 180;
+ return node.kind === 181;
}
ts.isArrayBindingPattern = isArrayBindingPattern;
function isBindingElement(node) {
- return node.kind === 181;
+ return node.kind === 182;
}
ts.isBindingElement = isBindingElement;
function isArrayLiteralExpression(node) {
- return node.kind === 182;
+ return node.kind === 183;
}
ts.isArrayLiteralExpression = isArrayLiteralExpression;
function isObjectLiteralExpression(node) {
- return node.kind === 183;
+ return node.kind === 184;
}
ts.isObjectLiteralExpression = isObjectLiteralExpression;
function isPropertyAccessExpression(node) {
- return node.kind === 184;
+ return node.kind === 185;
}
ts.isPropertyAccessExpression = isPropertyAccessExpression;
function isElementAccessExpression(node) {
- return node.kind === 185;
+ return node.kind === 186;
}
ts.isElementAccessExpression = isElementAccessExpression;
function isCallExpression(node) {
- return node.kind === 186;
+ return node.kind === 187;
}
ts.isCallExpression = isCallExpression;
function isNewExpression(node) {
- return node.kind === 187;
+ return node.kind === 188;
}
ts.isNewExpression = isNewExpression;
function isTaggedTemplateExpression(node) {
- return node.kind === 188;
+ return node.kind === 189;
}
ts.isTaggedTemplateExpression = isTaggedTemplateExpression;
function isTypeAssertion(node) {
- return node.kind === 189;
+ return node.kind === 190;
}
ts.isTypeAssertion = isTypeAssertion;
function isParenthesizedExpression(node) {
- return node.kind === 190;
+ return node.kind === 191;
}
ts.isParenthesizedExpression = isParenthesizedExpression;
function skipPartiallyEmittedExpressions(node) {
- while (node.kind === 300) {
+ while (node.kind === 301) {
node = node.expression;
}
return node;
}
ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions;
function isFunctionExpression(node) {
- return node.kind === 191;
+ return node.kind === 192;
}
ts.isFunctionExpression = isFunctionExpression;
function isArrowFunction(node) {
- return node.kind === 192;
+ return node.kind === 193;
}
ts.isArrowFunction = isArrowFunction;
function isDeleteExpression(node) {
- return node.kind === 193;
+ return node.kind === 194;
}
ts.isDeleteExpression = isDeleteExpression;
function isTypeOfExpression(node) {
- return node.kind === 194;
+ return node.kind === 195;
}
ts.isTypeOfExpression = isTypeOfExpression;
function isVoidExpression(node) {
- return node.kind === 195;
+ return node.kind === 196;
}
ts.isVoidExpression = isVoidExpression;
function isAwaitExpression(node) {
- return node.kind === 196;
+ return node.kind === 197;
}
ts.isAwaitExpression = isAwaitExpression;
function isPrefixUnaryExpression(node) {
- return node.kind === 197;
+ return node.kind === 198;
}
ts.isPrefixUnaryExpression = isPrefixUnaryExpression;
function isPostfixUnaryExpression(node) {
- return node.kind === 198;
+ return node.kind === 199;
}
ts.isPostfixUnaryExpression = isPostfixUnaryExpression;
function isBinaryExpression(node) {
- return node.kind === 199;
+ return node.kind === 200;
}
ts.isBinaryExpression = isBinaryExpression;
function isConditionalExpression(node) {
- return node.kind === 200;
+ return node.kind === 201;
}
ts.isConditionalExpression = isConditionalExpression;
function isTemplateExpression(node) {
- return node.kind === 201;
+ return node.kind === 202;
}
ts.isTemplateExpression = isTemplateExpression;
function isYieldExpression(node) {
- return node.kind === 202;
+ return node.kind === 203;
}
ts.isYieldExpression = isYieldExpression;
function isSpreadElement(node) {
- return node.kind === 203;
+ return node.kind === 204;
}
ts.isSpreadElement = isSpreadElement;
function isClassExpression(node) {
- return node.kind === 204;
+ return node.kind === 205;
}
ts.isClassExpression = isClassExpression;
function isOmittedExpression(node) {
- return node.kind === 205;
+ return node.kind === 206;
}
ts.isOmittedExpression = isOmittedExpression;
function isExpressionWithTypeArguments(node) {
- return node.kind === 206;
+ return node.kind === 207;
}
ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments;
function isAsExpression(node) {
- return node.kind === 207;
+ return node.kind === 208;
}
ts.isAsExpression = isAsExpression;
function isNonNullExpression(node) {
- return node.kind === 208;
+ return node.kind === 209;
}
ts.isNonNullExpression = isNonNullExpression;
function isMetaProperty(node) {
- return node.kind === 209;
+ return node.kind === 210;
}
ts.isMetaProperty = isMetaProperty;
function isTemplateSpan(node) {
- return node.kind === 210;
+ return node.kind === 211;
}
ts.isTemplateSpan = isTemplateSpan;
function isSemicolonClassElement(node) {
- return node.kind === 211;
+ return node.kind === 212;
}
ts.isSemicolonClassElement = isSemicolonClassElement;
function isBlock(node) {
- return node.kind === 212;
+ return node.kind === 213;
}
ts.isBlock = isBlock;
function isVariableStatement(node) {
- return node.kind === 213;
+ return node.kind === 214;
}
ts.isVariableStatement = isVariableStatement;
function isEmptyStatement(node) {
- return node.kind === 214;
+ return node.kind === 215;
}
ts.isEmptyStatement = isEmptyStatement;
function isExpressionStatement(node) {
- return node.kind === 215;
+ return node.kind === 216;
}
ts.isExpressionStatement = isExpressionStatement;
function isIfStatement(node) {
- return node.kind === 216;
+ return node.kind === 217;
}
ts.isIfStatement = isIfStatement;
function isDoStatement(node) {
- return node.kind === 217;
+ return node.kind === 218;
}
ts.isDoStatement = isDoStatement;
function isWhileStatement(node) {
- return node.kind === 218;
+ return node.kind === 219;
}
ts.isWhileStatement = isWhileStatement;
function isForStatement(node) {
- return node.kind === 219;
+ return node.kind === 220;
}
ts.isForStatement = isForStatement;
function isForInStatement(node) {
- return node.kind === 220;
+ return node.kind === 221;
}
ts.isForInStatement = isForInStatement;
function isForOfStatement(node) {
- return node.kind === 221;
+ return node.kind === 222;
}
ts.isForOfStatement = isForOfStatement;
function isContinueStatement(node) {
- return node.kind === 222;
+ return node.kind === 223;
}
ts.isContinueStatement = isContinueStatement;
function isBreakStatement(node) {
- return node.kind === 223;
+ return node.kind === 224;
}
ts.isBreakStatement = isBreakStatement;
function isBreakOrContinueStatement(node) {
- return node.kind === 223 || node.kind === 222;
+ return node.kind === 224 || node.kind === 223;
}
ts.isBreakOrContinueStatement = isBreakOrContinueStatement;
function isReturnStatement(node) {
- return node.kind === 224;
+ return node.kind === 225;
}
ts.isReturnStatement = isReturnStatement;
function isWithStatement(node) {
- return node.kind === 225;
+ return node.kind === 226;
}
ts.isWithStatement = isWithStatement;
function isSwitchStatement(node) {
- return node.kind === 226;
+ return node.kind === 227;
}
ts.isSwitchStatement = isSwitchStatement;
function isLabeledStatement(node) {
- return node.kind === 227;
+ return node.kind === 228;
}
ts.isLabeledStatement = isLabeledStatement;
function isThrowStatement(node) {
- return node.kind === 228;
+ return node.kind === 229;
}
ts.isThrowStatement = isThrowStatement;
function isTryStatement(node) {
- return node.kind === 229;
+ return node.kind === 230;
}
ts.isTryStatement = isTryStatement;
function isDebuggerStatement(node) {
- return node.kind === 230;
+ return node.kind === 231;
}
ts.isDebuggerStatement = isDebuggerStatement;
function isVariableDeclaration(node) {
- return node.kind === 231;
+ return node.kind === 232;
}
ts.isVariableDeclaration = isVariableDeclaration;
function isVariableDeclarationList(node) {
- return node.kind === 232;
+ return node.kind === 233;
}
ts.isVariableDeclarationList = isVariableDeclarationList;
function isFunctionDeclaration(node) {
- return node.kind === 233;
+ return node.kind === 234;
}
ts.isFunctionDeclaration = isFunctionDeclaration;
function isClassDeclaration(node) {
- return node.kind === 234;
+ return node.kind === 235;
}
ts.isClassDeclaration = isClassDeclaration;
function isInterfaceDeclaration(node) {
- return node.kind === 235;
+ return node.kind === 236;
}
ts.isInterfaceDeclaration = isInterfaceDeclaration;
function isTypeAliasDeclaration(node) {
- return node.kind === 236;
+ return node.kind === 237;
}
ts.isTypeAliasDeclaration = isTypeAliasDeclaration;
function isEnumDeclaration(node) {
- return node.kind === 237;
+ return node.kind === 238;
}
ts.isEnumDeclaration = isEnumDeclaration;
function isModuleDeclaration(node) {
- return node.kind === 238;
+ return node.kind === 239;
}
ts.isModuleDeclaration = isModuleDeclaration;
function isModuleBlock(node) {
- return node.kind === 239;
+ return node.kind === 240;
}
ts.isModuleBlock = isModuleBlock;
function isCaseBlock(node) {
- return node.kind === 240;
+ return node.kind === 241;
}
ts.isCaseBlock = isCaseBlock;
function isNamespaceExportDeclaration(node) {
- return node.kind === 241;
+ return node.kind === 242;
}
ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration;
function isImportEqualsDeclaration(node) {
- return node.kind === 242;
+ return node.kind === 243;
}
ts.isImportEqualsDeclaration = isImportEqualsDeclaration;
function isImportDeclaration(node) {
- return node.kind === 243;
+ return node.kind === 244;
}
ts.isImportDeclaration = isImportDeclaration;
function isImportClause(node) {
- return node.kind === 244;
+ return node.kind === 245;
}
ts.isImportClause = isImportClause;
function isNamespaceImport(node) {
- return node.kind === 245;
+ return node.kind === 246;
}
ts.isNamespaceImport = isNamespaceImport;
function isNamedImports(node) {
- return node.kind === 246;
+ return node.kind === 247;
}
ts.isNamedImports = isNamedImports;
function isImportSpecifier(node) {
- return node.kind === 247;
+ return node.kind === 248;
}
ts.isImportSpecifier = isImportSpecifier;
function isExportAssignment(node) {
- return node.kind === 248;
+ return node.kind === 249;
}
ts.isExportAssignment = isExportAssignment;
function isExportDeclaration(node) {
- return node.kind === 249;
+ return node.kind === 250;
}
ts.isExportDeclaration = isExportDeclaration;
function isNamedExports(node) {
- return node.kind === 250;
+ return node.kind === 251;
}
ts.isNamedExports = isNamedExports;
function isExportSpecifier(node) {
- return node.kind === 251;
+ return node.kind === 252;
}
ts.isExportSpecifier = isExportSpecifier;
function isMissingDeclaration(node) {
- return node.kind === 252;
+ return node.kind === 253;
}
ts.isMissingDeclaration = isMissingDeclaration;
function isExternalModuleReference(node) {
- return node.kind === 253;
+ return node.kind === 254;
}
ts.isExternalModuleReference = isExternalModuleReference;
function isJsxElement(node) {
- return node.kind === 254;
+ return node.kind === 255;
}
ts.isJsxElement = isJsxElement;
function isJsxSelfClosingElement(node) {
- return node.kind === 255;
+ return node.kind === 256;
}
ts.isJsxSelfClosingElement = isJsxSelfClosingElement;
function isJsxOpeningElement(node) {
- return node.kind === 256;
+ return node.kind === 257;
}
ts.isJsxOpeningElement = isJsxOpeningElement;
function isJsxClosingElement(node) {
- return node.kind === 257;
+ return node.kind === 258;
}
ts.isJsxClosingElement = isJsxClosingElement;
function isJsxFragment(node) {
- return node.kind === 258;
+ return node.kind === 259;
}
ts.isJsxFragment = isJsxFragment;
function isJsxOpeningFragment(node) {
- return node.kind === 259;
+ return node.kind === 260;
}
ts.isJsxOpeningFragment = isJsxOpeningFragment;
function isJsxClosingFragment(node) {
- return node.kind === 260;
+ return node.kind === 261;
}
ts.isJsxClosingFragment = isJsxClosingFragment;
function isJsxAttribute(node) {
- return node.kind === 261;
+ return node.kind === 262;
}
ts.isJsxAttribute = isJsxAttribute;
function isJsxAttributes(node) {
- return node.kind === 262;
+ return node.kind === 263;
}
ts.isJsxAttributes = isJsxAttributes;
function isJsxSpreadAttribute(node) {
- return node.kind === 263;
+ return node.kind === 264;
}
ts.isJsxSpreadAttribute = isJsxSpreadAttribute;
function isJsxExpression(node) {
- return node.kind === 264;
+ return node.kind === 265;
}
ts.isJsxExpression = isJsxExpression;
function isCaseClause(node) {
- return node.kind === 265;
+ return node.kind === 266;
}
ts.isCaseClause = isCaseClause;
function isDefaultClause(node) {
- return node.kind === 266;
+ return node.kind === 267;
}
ts.isDefaultClause = isDefaultClause;
function isHeritageClause(node) {
- return node.kind === 267;
+ return node.kind === 268;
}
ts.isHeritageClause = isHeritageClause;
function isCatchClause(node) {
- return node.kind === 268;
+ return node.kind === 269;
}
ts.isCatchClause = isCatchClause;
function isPropertyAssignment(node) {
- return node.kind === 269;
+ return node.kind === 270;
}
ts.isPropertyAssignment = isPropertyAssignment;
function isShorthandPropertyAssignment(node) {
- return node.kind === 270;
+ return node.kind === 271;
}
ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment;
function isSpreadAssignment(node) {
- return node.kind === 271;
+ return node.kind === 272;
}
ts.isSpreadAssignment = isSpreadAssignment;
function isEnumMember(node) {
- return node.kind === 272;
+ return node.kind === 273;
}
ts.isEnumMember = isEnumMember;
function isSourceFile(node) {
- return node.kind === 273;
+ return node.kind === 274;
}
ts.isSourceFile = isSourceFile;
function isBundle(node) {
- return node.kind === 274;
+ return node.kind === 275;
}
ts.isBundle = isBundle;
function isJSDocTypeExpression(node) {
- return node.kind === 277;
+ return node.kind === 278;
}
ts.isJSDocTypeExpression = isJSDocTypeExpression;
function isJSDocAllType(node) {
- return node.kind === 278;
+ return node.kind === 279;
}
ts.isJSDocAllType = isJSDocAllType;
function isJSDocUnknownType(node) {
- return node.kind === 279;
+ return node.kind === 280;
}
ts.isJSDocUnknownType = isJSDocUnknownType;
function isJSDocNullableType(node) {
- return node.kind === 280;
+ return node.kind === 281;
}
ts.isJSDocNullableType = isJSDocNullableType;
function isJSDocNonNullableType(node) {
- return node.kind === 281;
+ return node.kind === 282;
}
ts.isJSDocNonNullableType = isJSDocNonNullableType;
function isJSDocOptionalType(node) {
- return node.kind === 282;
+ return node.kind === 283;
}
ts.isJSDocOptionalType = isJSDocOptionalType;
function isJSDocFunctionType(node) {
- return node.kind === 283;
+ return node.kind === 284;
}
ts.isJSDocFunctionType = isJSDocFunctionType;
function isJSDocVariadicType(node) {
- return node.kind === 284;
+ return node.kind === 285;
}
ts.isJSDocVariadicType = isJSDocVariadicType;
function isJSDoc(node) {
- return node.kind === 285;
+ return node.kind === 286;
}
ts.isJSDoc = isJSDoc;
function isJSDocAugmentsTag(node) {
- return node.kind === 289;
+ return node.kind === 290;
}
ts.isJSDocAugmentsTag = isJSDocAugmentsTag;
function isJSDocClassTag(node) {
- return node.kind === 290;
+ return node.kind === 291;
}
ts.isJSDocClassTag = isJSDocClassTag;
function isJSDocParameterTag(node) {
- return node.kind === 292;
+ return node.kind === 293;
}
ts.isJSDocParameterTag = isJSDocParameterTag;
function isJSDocReturnTag(node) {
- return node.kind === 293;
+ return node.kind === 294;
}
ts.isJSDocReturnTag = isJSDocReturnTag;
function isJSDocTypeTag(node) {
- return node.kind === 294;
+ return node.kind === 295;
}
ts.isJSDocTypeTag = isJSDocTypeTag;
function isJSDocTemplateTag(node) {
- return node.kind === 295;
+ return node.kind === 296;
}
ts.isJSDocTemplateTag = isJSDocTemplateTag;
function isJSDocTypedefTag(node) {
- return node.kind === 296;
+ return node.kind === 297;
}
ts.isJSDocTypedefTag = isJSDocTypedefTag;
function isJSDocPropertyTag(node) {
- return node.kind === 297;
+ return node.kind === 298;
}
ts.isJSDocPropertyTag = isJSDocPropertyTag;
function isJSDocPropertyLikeTag(node) {
- return node.kind === 297 || node.kind === 292;
+ return node.kind === 298 || node.kind === 293;
}
ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag;
function isJSDocTypeLiteral(node) {
- return node.kind === 286;
+ return node.kind === 287;
}
ts.isJSDocTypeLiteral = isJSDocTypeLiteral;
function isJSDocCallbackTag(node) {
- return node.kind === 291;
+ return node.kind === 292;
}
ts.isJSDocCallbackTag = isJSDocCallbackTag;
function isJSDocSignature(node) {
- return node.kind === 287;
+ return node.kind === 288;
}
ts.isJSDocSignature = isJSDocSignature;
})(ts || (ts = {}));
(function (ts) {
function isSyntaxList(n) {
- return n.kind === 298;
+ return n.kind === 299;
}
ts.isSyntaxList = isSyntaxList;
function isNode(node) {
@@ -10944,11 +11032,11 @@ var ts;
}
ts.isNode = isNode;
function isNodeKind(kind) {
- return kind >= 145;
+ return kind >= 146;
}
ts.isNodeKind = isNodeKind;
function isToken(n) {
- return n.kind >= 0 && n.kind <= 144;
+ return n.kind >= 0 && n.kind <= 145;
}
ts.isToken = isToken;
function isNodeArray(array) {
@@ -10967,6 +11055,10 @@ var ts;
return 13 <= kind && kind <= 16;
}
ts.isTemplateLiteralKind = isTemplateLiteralKind;
+ function isTemplateLiteralToken(node) {
+ return isTemplateLiteralKind(node.kind);
+ }
+ ts.isTemplateLiteralToken = isTemplateLiteralToken;
function isTemplateMiddleOrTemplateTail(node) {
var kind = node.kind;
return kind === 15
@@ -11013,7 +11105,7 @@ var ts;
ts.isModifier = isModifier;
function isEntityName(node) {
var kind = node.kind;
- return kind === 145
+ return kind === 146
|| kind === 71;
}
ts.isEntityName = isEntityName;
@@ -11022,14 +11114,14 @@ var ts;
return kind === 71
|| kind === 9
|| kind === 8
- || kind === 146;
+ || kind === 147;
}
ts.isPropertyName = isPropertyName;
function isBindingName(node) {
var kind = node.kind;
return kind === 71
- || kind === 179
- || kind === 180;
+ || kind === 180
+ || kind === 181;
}
ts.isBindingName = isBindingName;
function isFunctionLike(node) {
@@ -11042,13 +11134,13 @@ var ts;
ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration;
function isFunctionLikeDeclarationKind(kind) {
switch (kind) {
- case 233:
- case 153:
+ case 234:
case 154:
case 155:
case 156:
- case 191:
+ case 157:
case 192:
+ case 193:
return true;
default:
return false;
@@ -11056,14 +11148,14 @@ var ts;
}
function isFunctionLikeKind(kind) {
switch (kind) {
- case 152:
- case 157:
- case 287:
+ case 153:
case 158:
+ case 288:
case 159:
- case 162:
- case 283:
+ case 160:
case 163:
+ case 284:
+ case 164:
return true;
default:
return isFunctionLikeDeclarationKind(kind);
@@ -11076,28 +11168,28 @@ var ts;
ts.isFunctionOrModuleBlock = isFunctionOrModuleBlock;
function isClassElement(node) {
var kind = node.kind;
- return kind === 154
- || kind === 151
- || kind === 153
- || kind === 155
+ return kind === 155
+ || kind === 152
+ || kind === 154
|| kind === 156
- || kind === 159
- || kind === 211;
+ || kind === 157
+ || kind === 160
+ || kind === 212;
}
ts.isClassElement = isClassElement;
function isClassLike(node) {
- return node && (node.kind === 234 || node.kind === 204);
+ return node && (node.kind === 235 || node.kind === 205);
}
ts.isClassLike = isClassLike;
function isAccessor(node) {
- return node && (node.kind === 155 || node.kind === 156);
+ return node && (node.kind === 156 || node.kind === 157);
}
ts.isAccessor = isAccessor;
function isMethodOrAccessor(node) {
switch (node.kind) {
- case 153:
- case 155:
+ case 154:
case 156:
+ case 157:
return true;
default:
return false;
@@ -11106,11 +11198,11 @@ var ts;
ts.isMethodOrAccessor = isMethodOrAccessor;
function isTypeElement(node) {
var kind = node.kind;
- return kind === 158
- || kind === 157
- || kind === 150
- || kind === 152
- || kind === 159;
+ return kind === 159
+ || kind === 158
+ || kind === 151
+ || kind === 153
+ || kind === 160;
}
ts.isTypeElement = isTypeElement;
function isClassOrTypeElement(node) {
@@ -11119,17 +11211,18 @@ var ts;
ts.isClassOrTypeElement = isClassOrTypeElement;
function isObjectLiteralElementLike(node) {
var kind = node.kind;
- return kind === 269
- || kind === 270
+ return kind === 270
|| kind === 271
- || kind === 153
- || kind === 155
- || kind === 156;
+ || kind === 272
+ || kind === 154
+ || kind === 156
+ || kind === 157;
}
ts.isObjectLiteralElementLike = isObjectLiteralElementLike;
function isTypeNodeKind(kind) {
- return (kind >= 160 && kind <= 178)
+ return (kind >= 161 && kind <= 179)
|| kind === 119
+ || kind === 142
|| kind === 134
|| kind === 135
|| kind === 122
@@ -11140,14 +11233,14 @@ var ts;
|| kind === 140
|| kind === 95
|| kind === 131
- || kind === 206
- || kind === 278
+ || kind === 207
|| kind === 279
|| kind === 280
|| kind === 281
|| kind === 282
|| kind === 283
- || kind === 284;
+ || kind === 284
+ || kind === 285;
}
function isTypeNode(node) {
return isTypeNodeKind(node.kind);
@@ -11155,8 +11248,8 @@ var ts;
ts.isTypeNode = isTypeNode;
function isFunctionOrConstructorTypeNode(node) {
switch (node.kind) {
- case 162:
case 163:
+ case 164:
return true;
}
return false;
@@ -11165,29 +11258,29 @@ var ts;
function isBindingPattern(node) {
if (node) {
var kind = node.kind;
- return kind === 180
- || kind === 179;
+ return kind === 181
+ || kind === 180;
}
return false;
}
ts.isBindingPattern = isBindingPattern;
function isAssignmentPattern(node) {
var kind = node.kind;
- return kind === 182
- || kind === 183;
+ return kind === 183
+ || kind === 184;
}
ts.isAssignmentPattern = isAssignmentPattern;
function isArrayBindingElement(node) {
var kind = node.kind;
- return kind === 181
- || kind === 205;
+ return kind === 182
+ || kind === 206;
}
ts.isArrayBindingElement = isArrayBindingElement;
function isDeclarationBindingElement(bindingElement) {
switch (bindingElement.kind) {
- case 231:
- case 148:
- case 181:
+ case 232:
+ case 149:
+ case 182:
return true;
}
return false;
@@ -11200,8 +11293,8 @@ var ts;
ts.isBindingOrAssignmentPattern = isBindingOrAssignmentPattern;
function isObjectBindingOrAssignmentPattern(node) {
switch (node.kind) {
- case 179:
- case 183:
+ case 180:
+ case 184:
return true;
}
return false;
@@ -11209,8 +11302,8 @@ var ts;
ts.isObjectBindingOrAssignmentPattern = isObjectBindingOrAssignmentPattern;
function isArrayBindingOrAssignmentPattern(node) {
switch (node.kind) {
- case 180:
- case 182:
+ case 181:
+ case 183:
return true;
}
return false;
@@ -11218,25 +11311,25 @@ var ts;
ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern;
function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) {
var kind = node.kind;
- return kind === 184
- || kind === 145
- || kind === 178;
+ return kind === 185
+ || kind === 146
+ || kind === 179;
}
ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode;
function isPropertyAccessOrQualifiedName(node) {
var kind = node.kind;
- return kind === 184
- || kind === 145;
+ return kind === 185
+ || kind === 146;
}
ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName;
function isCallLikeExpression(node) {
switch (node.kind) {
+ case 257:
case 256:
- case 255:
- case 186:
case 187:
case 188:
- case 149:
+ case 189:
+ case 150:
return true;
default:
return false;
@@ -11244,12 +11337,12 @@ var ts;
}
ts.isCallLikeExpression = isCallLikeExpression;
function isCallOrNewExpression(node) {
- return node.kind === 186 || node.kind === 187;
+ return node.kind === 187 || node.kind === 188;
}
ts.isCallOrNewExpression = isCallOrNewExpression;
function isTemplateLiteral(node) {
var kind = node.kind;
- return kind === 201
+ return kind === 202
|| kind === 13;
}
ts.isTemplateLiteral = isTemplateLiteral;
@@ -11259,32 +11352,32 @@ var ts;
ts.isLeftHandSideExpression = isLeftHandSideExpression;
function isLeftHandSideExpressionKind(kind) {
switch (kind) {
- case 184:
case 185:
- case 187:
case 186:
- case 254:
- case 255:
- case 258:
case 188:
- case 182:
- case 190:
+ case 187:
+ case 255:
+ case 256:
+ case 259:
+ case 189:
case 183:
- case 204:
case 191:
+ case 184:
+ case 205:
+ case 192:
case 71:
case 12:
case 8:
case 9:
case 13:
- case 201:
+ case 202:
case 86:
case 95:
case 99:
case 101:
case 97:
- case 208:
case 209:
+ case 210:
case 91:
return true;
default:
@@ -11297,13 +11390,13 @@ var ts;
ts.isUnaryExpression = isUnaryExpression;
function isUnaryExpressionKind(kind) {
switch (kind) {
- case 197:
case 198:
- case 193:
+ case 199:
case 194:
case 195:
case 196:
- case 189:
+ case 197:
+ case 190:
return true;
default:
return isLeftHandSideExpressionKind(kind);
@@ -11311,9 +11404,9 @@ var ts;
}
function isUnaryExpressionWithWrite(expr) {
switch (expr.kind) {
- case 198:
+ case 199:
return true;
- case 197:
+ case 198:
return expr.operator === 43 ||
expr.operator === 44;
default:
@@ -11327,15 +11420,15 @@ var ts;
ts.isExpression = isExpression;
function isExpressionKind(kind) {
switch (kind) {
- case 200:
- case 202:
- case 192:
- case 199:
+ case 201:
case 203:
- case 207:
- case 205:
+ case 193:
+ case 200:
+ case 204:
+ case 208:
+ case 206:
+ case 302:
case 301:
- case 300:
return true;
default:
return isUnaryExpressionKind(kind);
@@ -11343,16 +11436,16 @@ var ts;
}
function isAssertionExpression(node) {
var kind = node.kind;
- return kind === 189
- || kind === 207;
+ return kind === 190
+ || kind === 208;
}
ts.isAssertionExpression = isAssertionExpression;
function isPartiallyEmittedExpression(node) {
- return node.kind === 300;
+ return node.kind === 301;
}
ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression;
function isNotEmittedStatement(node) {
- return node.kind === 299;
+ return node.kind === 300;
}
ts.isNotEmittedStatement = isNotEmittedStatement;
function isNotEmittedOrPartiallyEmittedNode(node) {
@@ -11362,20 +11455,20 @@ var ts;
ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode;
function isIterationStatement(node, lookInLabeledStatements) {
switch (node.kind) {
- case 219:
case 220:
case 221:
- case 217:
+ case 222:
case 218:
+ case 219:
return true;
- case 227:
+ case 228:
return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements);
}
return false;
}
ts.isIterationStatement = isIterationStatement;
function isForInOrOfStatement(node) {
- return node.kind === 220 || node.kind === 221;
+ return node.kind === 221 || node.kind === 222;
}
ts.isForInOrOfStatement = isForInOrOfStatement;
function isConciseBody(node) {
@@ -11394,108 +11487,108 @@ var ts;
ts.isForInitializer = isForInitializer;
function isModuleBody(node) {
var kind = node.kind;
- return kind === 239
- || kind === 238
+ return kind === 240
+ || kind === 239
|| kind === 71;
}
ts.isModuleBody = isModuleBody;
function isNamespaceBody(node) {
var kind = node.kind;
- return kind === 239
- || kind === 238;
+ return kind === 240
+ || kind === 239;
}
ts.isNamespaceBody = isNamespaceBody;
function isJSDocNamespaceBody(node) {
var kind = node.kind;
return kind === 71
- || kind === 238;
+ || kind === 239;
}
ts.isJSDocNamespaceBody = isJSDocNamespaceBody;
function isNamedImportBindings(node) {
var kind = node.kind;
- return kind === 246
- || kind === 245;
+ return kind === 247
+ || kind === 246;
}
ts.isNamedImportBindings = isNamedImportBindings;
function isModuleOrEnumDeclaration(node) {
- return node.kind === 238 || node.kind === 237;
+ return node.kind === 239 || node.kind === 238;
}
ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration;
function isDeclarationKind(kind) {
- return kind === 192
- || kind === 181
- || kind === 234
- || kind === 204
- || kind === 154
- || kind === 237
- || kind === 272
- || kind === 251
- || kind === 233
- || kind === 191
- || kind === 155
- || kind === 244
- || kind === 242
- || kind === 247
+ return kind === 193
+ || kind === 182
|| kind === 235
- || kind === 261
- || kind === 153
- || kind === 152
+ || kind === 205
+ || kind === 155
|| kind === 238
- || kind === 241
- || kind === 245
- || kind === 148
- || kind === 269
- || kind === 151
- || kind === 150
- || kind === 156
- || kind === 270
- || kind === 236
- || kind === 147
- || kind === 231
- || kind === 296
- || kind === 291
- || kind === 297;
- }
- function isDeclarationStatementKind(kind) {
- return kind === 233
+ || kind === 273
|| kind === 252
|| kind === 234
+ || kind === 192
+ || kind === 156
+ || kind === 245
+ || kind === 243
+ || kind === 248
+ || kind === 236
+ || kind === 262
+ || kind === 154
+ || kind === 153
+ || kind === 239
+ || kind === 242
+ || kind === 246
+ || kind === 149
+ || kind === 270
+ || kind === 152
+ || kind === 151
+ || kind === 157
+ || kind === 271
+ || kind === 237
+ || kind === 148
+ || kind === 232
+ || kind === 297
+ || kind === 292
+ || kind === 298;
+ }
+ function isDeclarationStatementKind(kind) {
+ return kind === 234
+ || kind === 253
|| kind === 235
|| kind === 236
|| kind === 237
|| kind === 238
+ || kind === 239
+ || kind === 244
|| kind === 243
- || kind === 242
+ || kind === 250
|| kind === 249
- || kind === 248
- || kind === 241;
+ || kind === 242;
}
function isStatementKindButNotDeclarationKind(kind) {
- return kind === 223
- || kind === 222
- || kind === 230
- || kind === 217
- || kind === 215
- || kind === 214
- || kind === 220
- || kind === 221
- || kind === 219
- || kind === 216
- || kind === 227
- || kind === 224
- || kind === 226
- || kind === 228
- || kind === 229
- || kind === 213
+ return kind === 224
+ || kind === 223
+ || kind === 231
|| kind === 218
+ || kind === 216
+ || kind === 215
+ || kind === 221
+ || kind === 222
+ || kind === 220
+ || kind === 217
+ || kind === 228
|| kind === 225
- || kind === 299
- || kind === 303
- || kind === 302;
+ || kind === 227
+ || kind === 229
+ || kind === 230
+ || kind === 214
+ || kind === 219
+ || kind === 226
+ || kind === 300
+ || kind === 304
+ || kind === 303;
}
function isDeclaration(node) {
- if (node.kind === 147) {
- return node.parent.kind !== 295 || ts.isInJavaScriptFile(node);
+ if (node.kind === 148) {
+ return node.parent.kind !== 296 || ts.isInJavaScriptFile(node);
}
return isDeclarationKind(node.kind);
}
@@ -11516,10 +11609,10 @@ var ts;
}
ts.isStatement = isStatement;
function isBlockStatement(node) {
- if (node.kind !== 212)
+ if (node.kind !== 213)
return false;
if (node.parent !== undefined) {
- if (node.parent.kind === 229 || node.parent.kind === 268) {
+ if (node.parent.kind === 230 || node.parent.kind === 269) {
return false;
}
}
@@ -11527,8 +11620,8 @@ var ts;
}
function isModuleReference(node) {
var kind = node.kind;
- return kind === 253
- || kind === 145
+ return kind === 254
+ || kind === 146
|| kind === 71;
}
ts.isModuleReference = isModuleReference;
@@ -11536,64 +11629,65 @@ var ts;
var kind = node.kind;
return kind === 99
|| kind === 71
- || kind === 184;
+ || kind === 185;
}
ts.isJsxTagNameExpression = isJsxTagNameExpression;
function isJsxChild(node) {
var kind = node.kind;
- return kind === 254
- || kind === 264
- || kind === 255
+ return kind === 255
+ || kind === 265
+ || kind === 256
|| kind === 10
- || kind === 258;
+ || kind === 259;
}
ts.isJsxChild = isJsxChild;
function isJsxAttributeLike(node) {
var kind = node.kind;
- return kind === 261
- || kind === 263;
+ return kind === 262
+ || kind === 264;
}
ts.isJsxAttributeLike = isJsxAttributeLike;
function isStringLiteralOrJsxExpression(node) {
var kind = node.kind;
return kind === 9
- || kind === 264;
+ || kind === 265;
}
ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression;
function isJsxOpeningLikeElement(node) {
var kind = node.kind;
- return kind === 256
- || kind === 255;
+ return kind === 257
+ || kind === 256;
}
ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement;
function isCaseOrDefaultClause(node) {
var kind = node.kind;
- return kind === 265
- || kind === 266;
+ return kind === 266
+ || kind === 267;
}
ts.isCaseOrDefaultClause = isCaseOrDefaultClause;
function isJSDocNode(node) {
- return node.kind >= 277 && node.kind <= 297;
+ return node.kind >= 278 && node.kind <= 298;
}
ts.isJSDocNode = isJSDocNode;
function isJSDocCommentContainingNode(node) {
- return node.kind === 285 || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node);
+ return node.kind === 286 || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node);
}
ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode;
function isJSDocTag(node) {
- return node.kind >= 288 && node.kind <= 297;
+ return node.kind >= 289 && node.kind <= 298;
}
ts.isJSDocTag = isJSDocTag;
function isSetAccessor(node) {
- return node.kind === 156;
+ return node.kind === 157;
}
ts.isSetAccessor = isSetAccessor;
function isGetAccessor(node) {
- return node.kind === 155;
+ return node.kind === 156;
}
ts.isGetAccessor = isGetAccessor;
function hasJSDocNodes(node) {
- return !!node.jsDoc && node.jsDoc.length > 0;
+ var jsDoc = node.jsDoc;
+ return !!jsDoc && jsDoc.length > 0;
}
ts.hasJSDocNodes = hasJSDocNodes;
function hasType(node) {
@@ -11602,8 +11696,7 @@ var ts;
ts.hasType = hasType;
function couldHaveType(node) {
switch (node.kind) {
- case 148:
- case 150:
+ case 149:
case 151:
case 152:
case 153:
@@ -11614,24 +11707,25 @@ var ts;
case 158:
case 159:
case 160:
- case 162:
+ case 161:
case 163:
- case 172:
- case 174:
- case 176:
- case 189:
- case 191:
+ case 164:
+ case 173:
+ case 175:
+ case 177:
+ case 190:
case 192:
- case 207:
- case 231:
- case 233:
- case 236:
- case 277:
- case 280:
+ case 193:
+ case 208:
+ case 232:
+ case 234:
+ case 237:
+ case 278:
case 281:
case 282:
case 283:
case 284:
+ case 285:
return true;
}
return false;
@@ -11647,13 +11741,13 @@ var ts;
ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer;
function isObjectLiteralElement(node) {
switch (node.kind) {
- case 261:
- case 263:
- case 269:
+ case 262:
+ case 264:
case 270:
- case 153:
- case 155:
+ case 271:
+ case 154:
case 156:
+ case 157:
return true;
default:
return false;
@@ -11661,7 +11755,7 @@ var ts;
}
ts.isObjectLiteralElement = isObjectLiteralElement;
function isTypeReferenceType(node) {
- return node.kind === 161 || node.kind === 206;
+ return node.kind === 162 || node.kind === 207;
}
ts.isTypeReferenceType = isTypeReferenceType;
var MAX_SMI_X86 = 1073741823;
@@ -11693,7 +11787,7 @@ var ts;
}
ts.isStringLiteralLike = isStringLiteralLike;
function isNamedImportsOrExports(node) {
- return node.kind === 246 || node.kind === 250;
+ return node.kind === 247 || node.kind === 251;
}
ts.isNamedImportsOrExports = isNamedImportsOrExports;
})(ts || (ts = {}));
@@ -11704,7 +11798,7 @@ var ts;
var IdentifierConstructor;
var SourceFileConstructor;
function createNode(kind, pos, end) {
- if (kind === 273) {
+ if (kind === 274) {
return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end);
}
else if (kind === 71) {
@@ -11742,28 +11836,28 @@ var ts;
}
ts.isJSDocLikeText = isJSDocLikeText;
function forEachChild(node, cbNode, cbNodes) {
- if (!node || node.kind <= 144) {
+ if (!node || node.kind <= 145) {
return;
}
switch (node.kind) {
- case 145:
+ case 146:
return visitNode(cbNode, node.left) ||
visitNode(cbNode, node.right);
- case 147:
+ case 148:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.constraint) ||
visitNode(cbNode, node.default) ||
visitNode(cbNode, node.expression);
- case 270:
+ case 271:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.equalsToken) ||
visitNode(cbNode, node.objectAssignmentInitializer);
- case 271:
+ case 272:
return visitNode(cbNode, node.expression);
- case 148:
+ case 149:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.dotDotDotToken) ||
@@ -11771,59 +11865,59 @@ var ts;
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.initializer);
+ case 152:
+ return visitNodes(cbNode, cbNodes, node.decorators) ||
+ visitNodes(cbNode, cbNodes, node.modifiers) ||
+ visitNode(cbNode, node.name) ||
+ visitNode(cbNode, node.questionToken) ||
+ visitNode(cbNode, node.exclamationToken) ||
+ visitNode(cbNode, node.type) ||
+ visitNode(cbNode, node.initializer);
case 151:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.questionToken) ||
- visitNode(cbNode, node.exclamationToken) ||
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.initializer);
- case 150:
- 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 269:
+ case 270:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.initializer);
- case 231:
+ case 232:
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 181:
+ case 182:
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 162:
case 163:
- case 157:
+ case 164:
case 158:
case 159:
+ case 160:
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 153:
- case 152:
case 154:
+ case 153:
case 155:
case 156:
- case 191:
- case 233:
+ case 157:
case 192:
+ case 234:
+ case 193:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.asteriskToken) ||
@@ -11834,187 +11928,180 @@ var ts;
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.equalsGreaterThanToken) ||
visitNode(cbNode, node.body);
- case 161:
+ case 162:
return visitNode(cbNode, node.typeName) ||
visitNodes(cbNode, cbNodes, node.typeArguments);
- case 160:
+ case 161:
return visitNode(cbNode, node.parameterName) ||
visitNode(cbNode, node.type);
- case 164:
- return visitNode(cbNode, node.exprName);
case 165:
- return visitNodes(cbNode, cbNodes, node.members);
+ return visitNode(cbNode, node.exprName);
case 166:
- return visitNode(cbNode, node.elementType);
+ return visitNodes(cbNode, cbNodes, node.members);
case 167:
- return visitNodes(cbNode, cbNodes, node.elementTypes);
+ return visitNode(cbNode, node.elementType);
case 168:
+ return visitNodes(cbNode, cbNodes, node.elementTypes);
case 169:
- return visitNodes(cbNode, cbNodes, node.types);
case 170:
+ return visitNodes(cbNode, cbNodes, node.types);
+ case 171:
return visitNode(cbNode, node.checkType) ||
visitNode(cbNode, node.extendsType) ||
visitNode(cbNode, node.trueType) ||
visitNode(cbNode, node.falseType);
- case 171:
+ case 172:
return visitNode(cbNode, node.typeParameter);
- case 178:
+ case 179:
return visitNode(cbNode, node.argument) ||
visitNode(cbNode, node.qualifier) ||
visitNodes(cbNode, cbNodes, node.typeArguments);
- case 172:
- case 174:
- return visitNode(cbNode, node.type);
+ case 173:
case 175:
+ return visitNode(cbNode, node.type);
+ case 176:
return visitNode(cbNode, node.objectType) ||
visitNode(cbNode, node.indexType);
- case 176:
+ case 177:
return visitNode(cbNode, node.readonlyToken) ||
visitNode(cbNode, node.typeParameter) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.type);
- case 177:
+ case 178:
return visitNode(cbNode, node.literal);
- case 179:
case 180:
- return visitNodes(cbNode, cbNodes, node.elements);
- case 182:
+ case 181:
return visitNodes(cbNode, cbNodes, node.elements);
case 183:
- return visitNodes(cbNode, cbNodes, node.properties);
+ return visitNodes(cbNode, cbNodes, node.elements);
case 184:
- return visitNode(cbNode, node.expression) ||
- visitNode(cbNode, node.name);
+ return visitNodes(cbNode, cbNodes, node.properties);
case 185:
return visitNode(cbNode, node.expression) ||
- visitNode(cbNode, node.argumentExpression);
+ visitNode(cbNode, node.name);
case 186:
+ return visitNode(cbNode, node.expression) ||
+ visitNode(cbNode, node.argumentExpression);
case 187:
+ case 188:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNode, cbNodes, node.typeArguments) ||
visitNodes(cbNode, cbNodes, node.arguments);
- case 188:
+ case 189:
return visitNode(cbNode, node.tag) ||
visitNodes(cbNode, cbNodes, node.typeArguments) ||
visitNode(cbNode, node.template);
- case 189:
+ case 190:
return visitNode(cbNode, node.type) ||
visitNode(cbNode, node.expression);
- case 190:
- return visitNode(cbNode, node.expression);
- case 193:
+ case 191:
return visitNode(cbNode, node.expression);
case 194:
return visitNode(cbNode, node.expression);
case 195:
return visitNode(cbNode, node.expression);
- case 197:
- return visitNode(cbNode, node.operand);
- case 202:
- return visitNode(cbNode, node.asteriskToken) ||
- visitNode(cbNode, node.expression);
case 196:
return visitNode(cbNode, node.expression);
case 198:
return visitNode(cbNode, node.operand);
+ case 203:
+ return visitNode(cbNode, node.asteriskToken) ||
+ visitNode(cbNode, node.expression);
+ case 197:
+ return visitNode(cbNode, node.expression);
case 199:
+ return visitNode(cbNode, node.operand);
+ case 200:
return visitNode(cbNode, node.left) ||
visitNode(cbNode, node.operatorToken) ||
visitNode(cbNode, node.right);
- case 207:
+ case 208:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.type);
- case 208:
- return visitNode(cbNode, node.expression);
case 209:
+ return visitNode(cbNode, node.expression);
+ case 210:
return visitNode(cbNode, node.name);
- case 200:
+ case 201:
return visitNode(cbNode, node.condition) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.whenTrue) ||
visitNode(cbNode, node.colonToken) ||
visitNode(cbNode, node.whenFalse);
- case 203:
+ case 204:
return visitNode(cbNode, node.expression);
- case 212:
- case 239:
+ case 213:
+ case 240:
return visitNodes(cbNode, cbNodes, node.statements);
- case 273:
+ case 274:
return visitNodes(cbNode, cbNodes, node.statements) ||
visitNode(cbNode, node.endOfFileToken);
- case 213:
+ case 214:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.declarationList);
- case 232:
+ case 233:
return visitNodes(cbNode, cbNodes, node.declarations);
- case 215:
- return visitNode(cbNode, node.expression);
case 216:
+ return visitNode(cbNode, node.expression);
+ case 217:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.thenStatement) ||
visitNode(cbNode, node.elseStatement);
- case 217:
+ case 218:
return visitNode(cbNode, node.statement) ||
visitNode(cbNode, node.expression);
- case 218:
+ case 219:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
- case 219:
+ case 220:
return visitNode(cbNode, node.initializer) ||
visitNode(cbNode, node.condition) ||
visitNode(cbNode, node.incrementor) ||
visitNode(cbNode, node.statement);
- case 220:
+ case 221:
return visitNode(cbNode, node.initializer) ||
visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
- case 221:
+ case 222:
return visitNode(cbNode, node.awaitModifier) ||
visitNode(cbNode, node.initializer) ||
visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
- case 222:
case 223:
- return visitNode(cbNode, node.label);
case 224:
- return visitNode(cbNode, node.expression);
+ return visitNode(cbNode, node.label);
case 225:
- return visitNode(cbNode, node.expression) ||
- visitNode(cbNode, node.statement);
+ return visitNode(cbNode, node.expression);
case 226:
+ return visitNode(cbNode, node.expression) ||
+ visitNode(cbNode, node.statement);
+ case 227:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.caseBlock);
- case 240:
+ case 241:
return visitNodes(cbNode, cbNodes, node.clauses);
- case 265:
+ case 266:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNode, cbNodes, node.statements);
- case 266:
+ case 267:
return visitNodes(cbNode, cbNodes, node.statements);
- case 227:
+ case 228:
return visitNode(cbNode, node.label) ||
visitNode(cbNode, node.statement);
- case 228:
- return visitNode(cbNode, node.expression);
case 229:
+ return visitNode(cbNode, node.expression);
+ case 230:
return visitNode(cbNode, node.tryBlock) ||
visitNode(cbNode, node.catchClause) ||
visitNode(cbNode, node.finallyBlock);
- case 268:
+ case 269:
return visitNode(cbNode, node.variableDeclaration) ||
visitNode(cbNode, node.block);
- case 149:
+ case 150:
return visitNode(cbNode, node.expression);
- case 234:
- case 204:
- 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 235:
+ case 205:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
@@ -12026,112 +12113,119 @@ var ts;
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNodes(cbNode, cbNodes, node.typeParameters) ||
- visitNode(cbNode, node.type);
+ visitNodes(cbNode, cbNodes, node.heritageClauses) ||
+ visitNodes(cbNode, cbNodes, node.members);
case 237:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
- visitNodes(cbNode, cbNodes, node.members);
- case 272:
- return visitNode(cbNode, node.name) ||
- visitNode(cbNode, node.initializer);
+ visitNodes(cbNode, cbNodes, node.typeParameters) ||
+ visitNode(cbNode, node.type);
case 238:
+ return visitNodes(cbNode, cbNodes, node.decorators) ||
+ visitNodes(cbNode, cbNodes, node.modifiers) ||
+ visitNode(cbNode, node.name) ||
+ visitNodes(cbNode, cbNodes, node.members);
+ case 273:
+ return visitNode(cbNode, node.name) ||
+ visitNode(cbNode, node.initializer);
+ case 239:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.body);
- case 242:
+ case 243:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.moduleReference);
- case 243:
+ case 244:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.importClause) ||
visitNode(cbNode, node.moduleSpecifier);
- case 244:
+ case 245:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.namedBindings);
- case 241:
- return visitNode(cbNode, node.name);
- case 245:
+ case 242:
return visitNode(cbNode, node.name);
case 246:
- case 250:
+ return visitNode(cbNode, node.name);
+ case 247:
+ case 251:
return visitNodes(cbNode, cbNodes, node.elements);
- case 249:
+ case 250:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.exportClause) ||
visitNode(cbNode, node.moduleSpecifier);
- case 247:
- case 251:
+ case 248:
+ case 252:
return visitNode(cbNode, node.propertyName) ||
visitNode(cbNode, node.name);
- case 248:
+ case 249:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.expression);
- case 201:
+ case 202:
return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans);
- case 210:
+ case 211:
return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal);
- case 146:
+ case 147:
return visitNode(cbNode, node.expression);
- case 267:
+ case 268:
return visitNodes(cbNode, cbNodes, node.types);
- case 206:
+ case 207:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNode, cbNodes, node.typeArguments);
- case 253:
- return visitNode(cbNode, node.expression);
- case 252:
- return visitNodes(cbNode, cbNodes, node.decorators);
- case 301:
- return visitNodes(cbNode, cbNodes, node.elements);
case 254:
+ return visitNode(cbNode, node.expression);
+ case 253:
+ return visitNodes(cbNode, cbNodes, node.decorators);
+ case 302:
+ return visitNodes(cbNode, cbNodes, node.elements);
+ case 255:
return visitNode(cbNode, node.openingElement) ||
visitNodes(cbNode, cbNodes, node.children) ||
visitNode(cbNode, node.closingElement);
- case 258:
+ case 259:
return visitNode(cbNode, node.openingFragment) ||
visitNodes(cbNode, cbNodes, node.children) ||
visitNode(cbNode, node.closingFragment);
- case 255:
case 256:
+ case 257:
return visitNode(cbNode, node.tagName) ||
visitNodes(cbNode, cbNodes, node.typeArguments) ||
visitNode(cbNode, node.attributes);
- case 262:
+ case 263:
return visitNodes(cbNode, cbNodes, node.properties);
- case 261:
+ case 262:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.initializer);
- case 263:
- return visitNode(cbNode, node.expression);
case 264:
+ return visitNode(cbNode, node.expression);
+ case 265:
return visitNode(cbNode, node.dotDotDotToken) ||
visitNode(cbNode, node.expression);
- case 257:
+ case 258:
return visitNode(cbNode, node.tagName);
- case 277:
- return visitNode(cbNode, node.type);
- case 281:
- return visitNode(cbNode, node.type);
- case 280:
+ case 278:
return visitNode(cbNode, node.type);
case 282:
return visitNode(cbNode, node.type);
+ case 281:
+ return visitNode(cbNode, node.type);
case 283:
+ return visitNode(cbNode, node.type);
+ case 284:
return visitNodes(cbNode, cbNodes, node.parameters) ||
visitNode(cbNode, node.type);
- case 284:
- return visitNode(cbNode, node.type);
case 285:
+ return visitNode(cbNode, node.type);
+ case 286:
return visitNodes(cbNode, cbNodes, node.tags);
- case 292:
- case 297:
+ case 293:
+ case 298:
if (node.isNameFirst) {
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.typeExpression);
@@ -12140,17 +12234,17 @@ var ts;
return visitNode(cbNode, node.typeExpression) ||
visitNode(cbNode, node.name);
}
- case 293:
- return visitNode(cbNode, node.typeExpression);
case 294:
return visitNode(cbNode, node.typeExpression);
- case 289:
- return visitNode(cbNode, node.class);
case 295:
- return visitNodes(cbNode, cbNodes, node.typeParameters);
+ return visitNode(cbNode, node.typeExpression);
+ case 290:
+ return visitNode(cbNode, node.class);
case 296:
+ return visitNodes(cbNode, cbNodes, node.typeParameters);
+ case 297:
if (node.typeExpression &&
- node.typeExpression.kind === 277) {
+ node.typeExpression.kind === 278) {
return visitNode(cbNode, node.typeExpression) ||
visitNode(cbNode, node.fullName);
}
@@ -12158,16 +12252,16 @@ var ts;
return visitNode(cbNode, node.fullName) ||
visitNode(cbNode, node.typeExpression);
}
- case 291:
+ case 292:
return visitNode(cbNode, node.fullName) ||
visitNode(cbNode, node.typeExpression);
- case 287:
+ case 288:
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 286:
+ case 287:
if (node.jsDocPropertyTags) {
for (var _i = 0, _a = node.jsDocPropertyTags; _i < _a.length; _i++) {
var tag = _a[_i];
@@ -12175,7 +12269,7 @@ var ts;
}
}
return;
- case 300:
+ case 301:
return visitNode(cbNode, node.expression);
}
}
@@ -12208,6 +12302,7 @@ var ts;
}
ts.isExternalModule = isExternalModule;
function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) {
+ if (aggressiveChecks === void 0) { aggressiveChecks = false; }
var newSourceFile = IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
newSourceFile.flags |= (sourceFile.flags & 1572864);
return newSourceFile;
@@ -12245,6 +12340,7 @@ var ts;
var contextFlags;
var parseErrorBeforeNextFinishedNode = false;
function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes, scriptKind) {
+ if (setParentNodes === void 0) { setParentNodes = false; }
scriptKind = ts.ensureScriptKind(fileName, scriptKind);
if (scriptKind === 6) {
var result_1 = parseJsonText(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes);
@@ -12272,6 +12368,7 @@ var ts;
if (languageVersion === void 0) { languageVersion = 2; }
initializeState(sourceText, languageVersion, syntaxCursor, 6);
sourceFile = createSourceFile(fileName, 2, 6, false);
+ sourceFile.flags = contextFlags;
nextToken();
var pos = getNodePos();
if (token() === 1) {
@@ -12279,7 +12376,7 @@ var ts;
sourceFile.endOfFileToken = parseTokenNode();
}
else {
- var statement = createNode(215);
+ var statement = createNode(216);
switch (token()) {
case 21:
statement.expression = parseArrayLiteralExpression();
@@ -12422,10 +12519,11 @@ var ts;
}
Parser.fixupParentReferences = fixupParentReferences;
function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) {
- var sourceFile = new SourceFileConstructor(273, 0, sourceText.length);
+ var sourceFile = new SourceFileConstructor(274, 0, sourceText.length);
nodeCount++;
sourceFile.text = sourceText;
sourceFile.bindDiagnostics = [];
+ sourceFile.bindSuggestionDiagnostics = undefined;
sourceFile.languageVersion = languageVersion;
sourceFile.fileName = ts.normalizePath(fileName);
sourceFile.languageVariant = getLanguageVariant(scriptKind);
@@ -12739,7 +12837,7 @@ var ts;
return parsePropertyNameWorker(true);
}
function parseComputedPropertyName() {
- var node = createNode(146);
+ var node = createNode(147);
parseExpected(21);
node.expression = allowInAnd(parseExpression);
parseExpected(22);
@@ -12853,7 +12951,7 @@ var ts;
case 14:
return true;
}
- ts.Debug.fail("Non-exhaustive case in 'isListElement'.");
+ return ts.Debug.fail("Non-exhaustive case in 'isListElement'.");
}
function isValidHeritageClauseObjectLiteral() {
ts.Debug.assert(token() === 17);
@@ -12929,6 +13027,8 @@ var ts;
return token() === 29 || token() === 41;
case 14:
return token() === 27 && lookAhead(nextTokenIsSlash);
+ default:
+ return false;
}
}
function isVariableDeclaratorListTerminator() {
@@ -13047,14 +13147,14 @@ var ts;
function isReusableClassMember(node) {
if (node) {
switch (node.kind) {
- case 154:
- case 159:
case 155:
+ case 160:
case 156:
- case 151:
- case 211:
+ case 157:
+ case 152:
+ case 212:
return true;
- case 153:
+ case 154:
var methodDeclaration = node;
var nameIsConstructor = methodDeclaration.name.kind === 71 &&
methodDeclaration.name.originalKeywordKind === 123;
@@ -13066,8 +13166,8 @@ var ts;
function isReusableSwitchClause(node) {
if (node) {
switch (node.kind) {
- case 265:
case 266:
+ case 267:
return true;
}
}
@@ -13076,65 +13176,65 @@ var ts;
function isReusableStatement(node) {
if (node) {
switch (node.kind) {
- case 233:
+ case 234:
+ case 214:
case 213:
- case 212:
+ case 217:
case 216:
- case 215:
- case 228:
+ case 229:
+ case 225:
+ case 227:
case 224:
- case 226:
case 223:
+ case 221:
case 222:
case 220:
- case 221:
case 219:
- case 218:
- case 225:
- case 214:
- case 229:
- case 227:
- case 217:
+ case 226:
+ case 215:
case 230:
+ case 228:
+ case 218:
+ case 231:
+ case 244:
case 243:
- case 242:
+ case 250:
case 249:
- case 248:
- case 238:
- case 234:
+ case 239:
case 235:
- case 237:
case 236:
+ case 238:
+ case 237:
return true;
}
}
return false;
}
function isReusableEnumMember(node) {
- return node.kind === 272;
+ return node.kind === 273;
}
function isReusableTypeMember(node) {
if (node) {
switch (node.kind) {
- case 158:
- case 152:
case 159:
- case 150:
- case 157:
+ case 153:
+ case 160:
+ case 151:
+ case 158:
return true;
}
}
return false;
}
function isReusableVariableDeclaration(node) {
- if (node.kind !== 231) {
+ if (node.kind !== 232) {
return false;
}
var variableDeclarator = node;
return variableDeclarator.initializer === undefined;
}
function isReusableParameter(node) {
- if (node.kind !== 148) {
+ if (node.kind !== 149) {
return false;
}
var parameter = node;
@@ -13173,6 +13273,7 @@ var ts;
case 22: return ts.Diagnostics.Identifier_expected;
case 13: return ts.Diagnostics.Identifier_expected;
case 14: return ts.Diagnostics.Identifier_expected;
+ default: return undefined;
}
}
function parseDelimitedList(kind, parseElement, considerSemicolonAsDelimiter) {
@@ -13241,7 +13342,7 @@ var ts;
return entity;
}
function createQualifiedName(entity, name) {
- var node = createNode(145, entity.pos);
+ var node = createNode(146, entity.pos);
node.left = entity;
node.right = name;
return finishNode(node);
@@ -13256,19 +13357,19 @@ var ts;
return allowIdentifierNames ? parseIdentifierName() : parseIdentifier();
}
function parseTemplateExpression() {
- var template = createNode(201);
+ var template = createNode(202);
template.head = parseTemplateHead();
ts.Debug.assert(template.head.kind === 14, "Template head has wrong token kind");
var list = [];
var listPos = getNodePos();
do {
list.push(parseTemplateSpan());
- } while (ts.lastOrUndefined(list).literal.kind === 15);
+ } while (ts.last(list).literal.kind === 15);
template.templateSpans = createNodeArray(list, listPos);
return finishNode(template);
}
function parseTemplateSpan() {
- var span = createNode(210);
+ var span = createNode(211);
span.expression = allowInAnd(parseExpression);
var literal;
if (token() === 18) {
@@ -13312,7 +13413,7 @@ var ts;
return node;
}
function parseTypeReference() {
- var node = createNode(161);
+ var node = createNode(162);
node.typeName = parseEntityName(true, ts.Diagnostics.Type_expected);
if (!scanner.hasPrecedingLineBreak() && token() === 27) {
node.typeArguments = parseBracketedList(19, parseType, 27, 29);
@@ -13321,20 +13422,20 @@ var ts;
}
function parseThisTypePredicate(lhs) {
nextToken();
- var node = createNode(160, lhs.pos);
+ var node = createNode(161, lhs.pos);
node.parameterName = lhs;
node.type = parseType();
return finishNode(node);
}
function parseThisTypeNode() {
- var node = createNode(173);
+ var node = createNode(174);
nextToken();
return finishNode(node);
}
function parseJSDocAllType(postFixEquals) {
- var result = createNode(278);
+ var result = createNode(279);
if (postFixEquals) {
- return createJSDocPostfixType(282, result);
+ return createJSDocPostfixType(283, result);
}
else {
nextToken();
@@ -13342,7 +13443,7 @@ var ts;
return finishNode(result);
}
function parseJSDocNonNullableType() {
- var result = createNode(281);
+ var result = createNode(282);
nextToken();
result.type = parseNonArrayType();
return finishNode(result);
@@ -13356,28 +13457,28 @@ var ts;
token() === 29 ||
token() === 58 ||
token() === 49) {
- var result = createNode(279, pos);
+ var result = createNode(280, pos);
return finishNode(result);
}
else {
- var result = createNode(280, pos);
+ var result = createNode(281, pos);
result.type = parseType();
return finishNode(result);
}
}
function parseJSDocFunctionType() {
if (lookAhead(nextTokenIsOpenParen)) {
- var result = createNodeWithJSDoc(283);
+ var result = createNodeWithJSDoc(284);
nextToken();
fillSignature(56, 4 | 32, result);
return finishNode(result);
}
- var node = createNode(161);
+ var node = createNode(162);
node.typeName = parseIdentifierName();
return finishNode(node);
}
function parseJSDocParameter() {
- var parameter = createNode(148);
+ var parameter = createNode(149);
if (token() === 99 || token() === 94) {
parameter.name = parseIdentifierName();
parseExpected(56);
@@ -13389,23 +13490,23 @@ var ts;
var dotdotdot = parseOptionalToken(24);
var type = parseType();
if (dotdotdot) {
- var variadic = createNode(284, dotdotdot.pos);
+ var variadic = createNode(285, dotdotdot.pos);
variadic.type = type;
type = finishNode(variadic);
}
if (token() === 58) {
- return createJSDocPostfixType(282, type);
+ return createJSDocPostfixType(283, type);
}
return type;
}
function parseTypeQuery() {
- var node = createNode(164);
+ var node = createNode(165);
parseExpected(103);
node.exprName = parseEntityName(true);
return finishNode(node);
}
function parseTypeParameter() {
- var node = createNode(147);
+ var node = createNode(148);
node.name = parseIdentifier();
if (parseOptional(85)) {
if (isStartOfType() || !isStartOfExpression()) {
@@ -13439,7 +13540,7 @@ var ts;
isStartOfType(true);
}
function parseParameter() {
- var node = createNodeWithJSDoc(148);
+ var node = createNodeWithJSDoc(149);
if (token() === 99) {
node.name = createIdentifier(true);
node.type = parseParameterType();
@@ -13507,7 +13608,7 @@ var ts;
}
function parseSignatureMember(kind) {
var node = createNodeWithJSDoc(kind);
- if (kind === 158) {
+ if (kind === 159) {
parseExpected(94);
}
fillSignature(56, 4, node);
@@ -13544,7 +13645,7 @@ var ts;
return token() === 56 || token() === 26 || token() === 22;
}
function parseIndexSignatureDeclaration(node) {
- node.kind = 159;
+ node.kind = 160;
node.parameters = parseBracketedList(16, parseParameter, 21, 22);
node.type = parseTypeAnnotation();
parseTypeMemberSemicolon();
@@ -13554,11 +13655,11 @@ var ts;
node.name = parsePropertyName();
node.questionToken = parseOptionalToken(55);
if (token() === 19 || token() === 27) {
- node.kind = 152;
+ node.kind = 153;
fillSignature(56, 4, node);
}
else {
- node.kind = 150;
+ node.kind = 151;
node.type = parseTypeAnnotation();
if (token() === 58) {
node.initializer = parseInitializer();
@@ -13571,7 +13672,7 @@ var ts;
if (token() === 19 || token() === 27) {
return true;
}
- var idToken;
+ var idToken = false;
while (ts.isModifierKind(token())) {
idToken = true;
nextToken();
@@ -13595,10 +13696,10 @@ var ts;
}
function parseTypeMember() {
if (token() === 19 || token() === 27) {
- return parseSignatureMember(157);
+ return parseSignatureMember(158);
}
if (token() === 94 && lookAhead(nextTokenIsOpenParenOrLessThan)) {
- return parseSignatureMember(158);
+ return parseSignatureMember(159);
}
var node = createNodeWithJSDoc(0);
node.modifiers = parseModifiers();
@@ -13624,7 +13725,7 @@ var ts;
return false;
}
function parseTypeLiteral() {
- var node = createNode(165);
+ var node = createNode(166);
node.members = parseObjectTypeMembers();
return finishNode(node);
}
@@ -13650,14 +13751,14 @@ var ts;
return token() === 21 && nextTokenIsIdentifier() && nextToken() === 92;
}
function parseMappedTypeParameter() {
- var node = createNode(147);
+ var node = createNode(148);
node.name = parseIdentifier();
parseExpected(92);
node.constraint = parseType();
return finishNode(node);
}
function parseMappedType() {
- var node = createNode(176);
+ var node = createNode(177);
parseExpected(17);
if (token() === 132 || token() === 37 || token() === 38) {
node.readonlyToken = parseTokenNode();
@@ -13680,12 +13781,12 @@ var ts;
return finishNode(node);
}
function parseTupleType() {
- var node = createNode(167);
+ var node = createNode(168);
node.elementTypes = parseBracketedList(20, parseType, 21, 22);
return finishNode(node);
}
function parseParenthesizedType() {
- var node = createNode(172);
+ var node = createNode(173);
parseExpected(19);
node.type = parseType();
if (!node.type) {
@@ -13696,7 +13797,7 @@ var ts;
}
function parseFunctionOrConstructorType(kind) {
var node = createNodeWithJSDoc(kind);
- if (kind === 163) {
+ if (kind === 164) {
parseExpected(94);
}
if (!fillSignature(36, 4 | (sourceFile.languageVariant === 1 ? 8 : 0), node)) {
@@ -13712,10 +13813,10 @@ var ts;
return token() === 23 ? undefined : node;
}
function parseLiteralTypeNode(negative) {
- var node = createNode(177);
+ var node = createNode(178);
var unaryMinusExpression;
if (negative) {
- unaryMinusExpression = createNode(197);
+ unaryMinusExpression = createNode(198);
unaryMinusExpression.operator = 38;
nextToken();
}
@@ -13736,7 +13837,7 @@ var ts;
}
function parseImportType() {
sourceFile.flags |= 524288;
- var node = createNode(178);
+ var node = createNode(179);
if (parseOptional(103)) {
node.isTypeOf = true;
}
@@ -13756,6 +13857,7 @@ var ts;
function parseNonArrayType() {
switch (token()) {
case 119:
+ case 142:
case 137:
case 134:
case 138:
@@ -13811,6 +13913,7 @@ var ts;
function isStartOfType(inStartOfParameter) {
switch (token()) {
case 119:
+ case 142:
case 137:
case 134:
case 122:
@@ -13857,25 +13960,25 @@ var ts;
while (!scanner.hasPrecedingLineBreak()) {
switch (token()) {
case 51:
- type = createJSDocPostfixType(281, type);
+ type = createJSDocPostfixType(282, type);
break;
case 55:
if (!(contextFlags & 2097152) && lookAhead(nextTokenIsStartOfType)) {
return type;
}
- type = createJSDocPostfixType(280, type);
+ type = createJSDocPostfixType(281, type);
break;
case 21:
parseExpected(21);
if (isStartOfType()) {
- var node = createNode(175, type.pos);
+ var node = createNode(176, type.pos);
node.objectType = type;
node.indexType = parseType();
parseExpected(22);
type = finishNode(node);
}
else {
- var node = createNode(166, type.pos);
+ var node = createNode(167, type.pos);
node.elementType = type;
parseExpected(22);
type = finishNode(node);
@@ -13894,16 +13997,16 @@ var ts;
return finishNode(postfix);
}
function parseTypeOperator(operator) {
- var node = createNode(174);
+ var node = createNode(175);
parseExpected(operator);
node.operator = operator;
node.type = parseTypeOperatorOrHigher();
return finishNode(node);
}
function parseInferType() {
- var node = createNode(171);
+ var node = createNode(172);
parseExpected(126);
- var typeParameter = createNode(147);
+ var typeParameter = createNode(148);
typeParameter.name = parseIdentifier();
node.typeParameter = finishNode(typeParameter);
return finishNode(node);
@@ -13934,10 +14037,10 @@ var ts;
return type;
}
function parseIntersectionTypeOrHigher() {
- return parseUnionOrIntersectionType(169, parseTypeOperatorOrHigher, 48);
+ return parseUnionOrIntersectionType(170, parseTypeOperatorOrHigher, 48);
}
function parseUnionTypeOrHigher() {
- return parseUnionOrIntersectionType(168, parseIntersectionTypeOrHigher, 49);
+ return parseUnionOrIntersectionType(169, parseIntersectionTypeOrHigher, 49);
}
function isStartOfFunctionType() {
if (token() === 27) {
@@ -13983,7 +14086,7 @@ var ts;
var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix);
var type = parseType();
if (typePredicateVariable) {
- var node = createNode(160, typePredicateVariable.pos);
+ var node = createNode(161, typePredicateVariable.pos);
node.parameterName = typePredicateVariable;
node.type = type;
return finishNode(node);
@@ -14004,14 +14107,14 @@ var ts;
}
function parseTypeWorker(noConditionalTypes) {
if (isStartOfFunctionType()) {
- return parseFunctionOrConstructorType(162);
+ return parseFunctionOrConstructorType(163);
}
if (token() === 94) {
- return parseFunctionOrConstructorType(163);
+ return parseFunctionOrConstructorType(164);
}
var type = parseUnionTypeOrHigher();
if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(85)) {
- var node = createNode(170, type.pos);
+ var node = createNode(171, type.pos);
node.checkType = type;
node.extendsType = parseTypeWorker(true);
parseExpected(55);
@@ -14133,7 +14236,7 @@ var ts;
return !scanner.hasPrecedingLineBreak() && isIdentifier();
}
function parseYieldExpression() {
- var node = createNode(202);
+ var node = createNode(203);
nextToken();
if (!scanner.hasPrecedingLineBreak() &&
(token() === 39 || isStartOfExpression())) {
@@ -14149,13 +14252,13 @@ var ts;
ts.Debug.assert(token() === 36, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
var node;
if (asyncModifier) {
- node = createNode(192, asyncModifier.pos);
+ node = createNode(193, asyncModifier.pos);
node.modifiers = asyncModifier;
}
else {
- node = createNode(192, identifier.pos);
+ node = createNode(193, identifier.pos);
}
- var parameter = createNode(148, identifier.pos);
+ var parameter = createNode(149, identifier.pos);
parameter.name = identifier;
finishNode(parameter);
node.parameters = createNodeArray([parameter], parameter.pos, parameter.end);
@@ -14301,7 +14404,7 @@ var ts;
return 0;
}
function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) {
- var node = createNodeWithJSDoc(192);
+ var node = createNodeWithJSDoc(193);
node.modifiers = parseModifiersForArrowFunction();
var isAsync = ts.hasModifier(node, 256) ? 2 : 0;
if (!fillSignature(56, isAsync | (allowAmbiguity ? 0 : 8), node)) {
@@ -14335,7 +14438,7 @@ var ts;
if (!questionToken) {
return leftOperand;
}
- var node = createNode(200, leftOperand.pos);
+ var node = createNode(201, leftOperand.pos);
node.condition = leftOperand;
node.questionToken = questionToken;
node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher);
@@ -14350,7 +14453,7 @@ var ts;
return parseBinaryExpressionRest(precedence, leftOperand);
}
function isInOrOfKeyword(t) {
- return t === 92 || t === 144;
+ return t === 92 || t === 145;
}
function parseBinaryExpressionRest(precedence, leftOperand) {
while (true) {
@@ -14387,43 +14490,43 @@ var ts;
return ts.getBinaryOperatorPrecedence(token()) > 0;
}
function makeBinaryExpression(left, operatorToken, right) {
- var node = createNode(199, left.pos);
+ var node = createNode(200, left.pos);
node.left = left;
node.operatorToken = operatorToken;
node.right = right;
return finishNode(node);
}
function makeAsExpression(left, right) {
- var node = createNode(207, left.pos);
+ var node = createNode(208, left.pos);
node.expression = left;
node.type = right;
return finishNode(node);
}
function parsePrefixUnaryExpression() {
- var node = createNode(197);
+ var node = createNode(198);
node.operator = token();
nextToken();
node.operand = parseSimpleUnaryExpression();
return finishNode(node);
}
function parseDeleteExpression() {
- var node = createNode(193);
- nextToken();
- node.expression = parseSimpleUnaryExpression();
- return finishNode(node);
- }
- function parseTypeOfExpression() {
var node = createNode(194);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
- function parseVoidExpression() {
+ function parseTypeOfExpression() {
var node = createNode(195);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
+ function parseVoidExpression() {
+ var node = createNode(196);
+ nextToken();
+ node.expression = parseSimpleUnaryExpression();
+ return finishNode(node);
+ }
function isAwaitExpression() {
if (token() === 121) {
if (inAwaitContext()) {
@@ -14434,7 +14537,7 @@ var ts;
return false;
}
function parseAwaitExpression() {
- var node = createNode(196);
+ var node = createNode(197);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
@@ -14451,7 +14554,7 @@ var ts;
if (token() === 40) {
var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos);
var end = simpleUnaryExpression.end;
- if (simpleUnaryExpression.kind === 189) {
+ if (simpleUnaryExpression.kind === 190) {
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 {
@@ -14504,7 +14607,7 @@ var ts;
}
function parseUpdateExpression() {
if (token() === 43 || token() === 44) {
- var node = createNode(197);
+ var node = createNode(198);
node.operator = token();
nextToken();
node.operand = parseLeftHandSideExpressionOrHigher();
@@ -14516,7 +14619,7 @@ var ts;
var expression = parseLeftHandSideExpressionOrHigher();
ts.Debug.assert(ts.isLeftHandSideExpression(expression));
if ((token() === 43 || token() === 44) && !scanner.hasPrecedingLineBreak()) {
- var node = createNode(198, expression.pos);
+ var node = createNode(199, expression.pos);
node.operand = expression;
node.operator = token();
nextToken();
@@ -14535,7 +14638,7 @@ var ts;
var fullStart = scanner.getStartPos();
nextToken();
nextToken();
- var node = createNode(209, fullStart);
+ var node = createNode(210, fullStart);
node.keywordToken = 91;
node.name = parseIdentifierName();
expression = finishNode(node);
@@ -14559,30 +14662,17 @@ var ts;
if (token() === 19 || token() === 23 || token() === 21) {
return expression;
}
- var node = createNode(184, expression.pos);
+ var node = createNode(185, expression.pos);
node.expression = expression;
parseExpectedToken(23, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access);
node.name = parseRightSideOfDot(true);
return finishNode(node);
}
- function tagNamesAreEquivalent(lhs, rhs) {
- if (lhs.kind !== rhs.kind) {
- return false;
- }
- if (lhs.kind === 71) {
- return lhs.escapedText === rhs.escapedText;
- }
- if (lhs.kind === 99) {
- return true;
- }
- return lhs.name.escapedText === rhs.name.escapedText &&
- tagNamesAreEquivalent(lhs.expression, rhs.expression);
- }
function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) {
var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext);
var result;
- if (opening.kind === 256) {
- var node = createNode(254, opening.pos);
+ if (opening.kind === 257) {
+ var node = createNode(255, opening.pos);
node.openingElement = opening;
node.children = parseJsxChildren(node.openingElement);
node.closingElement = parseJsxClosingElement(inExpressionContext);
@@ -14591,22 +14681,22 @@ var ts;
}
result = finishNode(node);
}
- else if (opening.kind === 259) {
- var node = createNode(258, opening.pos);
+ else if (opening.kind === 260) {
+ var node = createNode(259, opening.pos);
node.openingFragment = opening;
node.children = parseJsxChildren(node.openingFragment);
node.closingFragment = parseJsxClosingFragment(inExpressionContext);
result = finishNode(node);
}
else {
- ts.Debug.assert(opening.kind === 255);
+ ts.Debug.assert(opening.kind === 256);
result = opening;
}
if (inExpressionContext && token() === 27) {
var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(true); });
if (invalidElement) {
parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element);
- var badNode = createNode(199, result.pos);
+ var badNode = createNode(200, result.pos);
badNode.end = invalidElement.end;
badNode.left = result;
badNode.right = invalidElement;
@@ -14662,7 +14752,7 @@ var ts;
return createNodeArray(list, listPos);
}
function parseJsxAttributes() {
- var jsxAttributes = createNode(262);
+ var jsxAttributes = createNode(263);
jsxAttributes.properties = parseList(13, parseJsxAttribute);
return finishNode(jsxAttributes);
}
@@ -14670,7 +14760,7 @@ var ts;
var fullStart = scanner.getStartPos();
parseExpected(27);
if (token() === 29) {
- var node_1 = createNode(259, fullStart);
+ var node_1 = createNode(260, fullStart);
scanJsxText();
return finishNode(node_1);
}
@@ -14679,7 +14769,7 @@ var ts;
var attributes = parseJsxAttributes();
var node;
if (token() === 29) {
- node = createNode(256, fullStart);
+ node = createNode(257, fullStart);
scanJsxText();
}
else {
@@ -14691,7 +14781,7 @@ var ts;
parseExpected(29, undefined, false);
scanJsxText();
}
- node = createNode(255, fullStart);
+ node = createNode(256, fullStart);
}
node.tagName = tagName;
node.typeArguments = typeArguments;
@@ -14703,7 +14793,7 @@ var ts;
var expression = token() === 99 ?
parseTokenNode() : parseIdentifierName();
while (parseOptional(23)) {
- var propertyAccess = createNode(184, expression.pos);
+ var propertyAccess = createNode(185, expression.pos);
propertyAccess.expression = expression;
propertyAccess.name = parseRightSideOfDot(true);
expression = finishNode(propertyAccess);
@@ -14711,7 +14801,7 @@ var ts;
return expression;
}
function parseJsxExpression(inExpressionContext) {
- var node = createNode(264);
+ var node = createNode(265);
if (!parseExpected(17)) {
return undefined;
}
@@ -14733,7 +14823,7 @@ var ts;
return parseJsxSpreadAttribute();
}
scanJsxIdentifier();
- var node = createNode(261);
+ var node = createNode(262);
node.name = parseIdentifierName();
if (token() === 58) {
switch (scanJsxAttributeValue()) {
@@ -14748,7 +14838,7 @@ var ts;
return finishNode(node);
}
function parseJsxSpreadAttribute() {
- var node = createNode(263);
+ var node = createNode(264);
parseExpected(17);
parseExpected(24);
node.expression = parseExpression();
@@ -14756,7 +14846,7 @@ var ts;
return finishNode(node);
}
function parseJsxClosingElement(inExpressionContext) {
- var node = createNode(257);
+ var node = createNode(258);
parseExpected(28);
node.tagName = parseJsxElementName();
if (inExpressionContext) {
@@ -14769,7 +14859,7 @@ var ts;
return finishNode(node);
}
function parseJsxClosingFragment(inExpressionContext) {
- var node = createNode(260);
+ var node = createNode(261);
parseExpected(28);
if (ts.tokenIsIdentifierOrKeyword(token())) {
parseErrorAtRange(parseJsxElementName(), ts.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment);
@@ -14784,7 +14874,7 @@ var ts;
return finishNode(node);
}
function parseTypeAssertion() {
- var node = createNode(189);
+ var node = createNode(190);
parseExpected(27);
node.type = parseType();
parseExpected(29);
@@ -14795,7 +14885,7 @@ var ts;
while (true) {
var dotToken = parseOptionalToken(23);
if (dotToken) {
- var propertyAccess = createNode(184, expression.pos);
+ var propertyAccess = createNode(185, expression.pos);
propertyAccess.expression = expression;
propertyAccess.name = parseRightSideOfDot(true);
expression = finishNode(propertyAccess);
@@ -14803,13 +14893,13 @@ var ts;
}
if (token() === 51 && !scanner.hasPrecedingLineBreak()) {
nextToken();
- var nonNullExpression = createNode(208, expression.pos);
+ var nonNullExpression = createNode(209, expression.pos);
nonNullExpression.expression = expression;
expression = finishNode(nonNullExpression);
continue;
}
if (!inDecoratorContext() && parseOptional(21)) {
- var indexedAccess = createNode(185, expression.pos);
+ var indexedAccess = createNode(186, expression.pos);
indexedAccess.expression = expression;
if (token() === 22) {
indexedAccess.argumentExpression = createMissingNode(71, true, ts.Diagnostics.An_element_access_expression_should_take_an_argument);
@@ -14836,7 +14926,7 @@ var ts;
return token() === 13 || token() === 14;
}
function parseTaggedTemplateRest(tag, typeArguments) {
- var tagExpression = createNode(188, tag.pos);
+ var tagExpression = createNode(189, tag.pos);
tagExpression.tag = tag;
tagExpression.typeArguments = typeArguments;
tagExpression.template = token() === 13
@@ -14856,7 +14946,7 @@ var ts;
expression = parseTaggedTemplateRest(expression, typeArguments);
continue;
}
- var callExpr = createNode(186, expression.pos);
+ var callExpr = createNode(187, expression.pos);
callExpr.expression = expression;
callExpr.typeArguments = typeArguments;
callExpr.arguments = parseArgumentList();
@@ -14864,7 +14954,7 @@ var ts;
continue;
}
else if (token() === 19) {
- var callExpr = createNode(186, expression.pos);
+ var callExpr = createNode(187, expression.pos);
callExpr.expression = expression;
callExpr.arguments = parseArgumentList();
expression = finishNode(callExpr);
@@ -14961,28 +15051,28 @@ var ts;
return parseIdentifier(ts.Diagnostics.Expression_expected);
}
function parseParenthesizedExpression() {
- var node = createNodeWithJSDoc(190);
+ var node = createNodeWithJSDoc(191);
parseExpected(19);
node.expression = allowInAnd(parseExpression);
parseExpected(20);
return finishNode(node);
}
function parseSpreadElement() {
- var node = createNode(203);
+ var node = createNode(204);
parseExpected(24);
node.expression = parseAssignmentExpressionOrHigher();
return finishNode(node);
}
function parseArgumentOrArrayLiteralElement() {
return token() === 24 ? parseSpreadElement() :
- token() === 26 ? createNode(205) :
+ token() === 26 ? createNode(206) :
parseAssignmentExpressionOrHigher();
}
function parseArgumentExpression() {
return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement);
}
function parseArrayLiteralExpression() {
- var node = createNode(182);
+ var node = createNode(183);
parseExpected(21);
if (scanner.hasPrecedingLineBreak()) {
node.multiLine = true;
@@ -14994,17 +15084,17 @@ var ts;
function parseObjectLiteralElement() {
var node = createNodeWithJSDoc(0);
if (parseOptionalToken(24)) {
- node.kind = 271;
+ node.kind = 272;
node.expression = parseAssignmentExpressionOrHigher();
return finishNode(node);
}
node.decorators = parseDecorators();
node.modifiers = parseModifiers();
if (parseContextualModifier(125)) {
- return parseAccessorDeclaration(node, 155);
+ return parseAccessorDeclaration(node, 156);
}
if (parseContextualModifier(136)) {
- return parseAccessorDeclaration(node, 156);
+ return parseAccessorDeclaration(node, 157);
}
var asteriskToken = parseOptionalToken(39);
var tokenIsIdentifier = isIdentifier();
@@ -15015,7 +15105,7 @@ var ts;
}
var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 26 || token() === 18 || token() === 58);
if (isShorthandPropertyAssignment) {
- node.kind = 270;
+ node.kind = 271;
var equalsToken = parseOptionalToken(58);
if (equalsToken) {
node.equalsToken = equalsToken;
@@ -15023,14 +15113,14 @@ var ts;
}
}
else {
- node.kind = 269;
+ node.kind = 270;
parseExpected(56);
node.initializer = allowInAnd(parseAssignmentExpressionOrHigher);
}
return finishNode(node);
}
function parseObjectLiteralExpression() {
- var node = createNode(183);
+ var node = createNode(184);
parseExpected(17);
if (scanner.hasPrecedingLineBreak()) {
node.multiLine = true;
@@ -15044,7 +15134,7 @@ var ts;
if (saveDecoratorContext) {
setDecoratorContext(false);
}
- var node = createNodeWithJSDoc(191);
+ var node = createNodeWithJSDoc(192);
node.modifiers = parseModifiers();
parseExpected(89);
node.asteriskToken = parseOptionalToken(39);
@@ -15069,7 +15159,7 @@ var ts;
var fullStart = scanner.getStartPos();
parseExpected(94);
if (parseOptional(23)) {
- var node_2 = createNode(209, fullStart);
+ var node_2 = createNode(210, fullStart);
node_2.keywordToken = 94;
node_2.name = parseIdentifierName();
return finishNode(node_2);
@@ -15086,7 +15176,7 @@ var ts;
}
break;
}
- var node = createNode(187, fullStart);
+ var node = createNode(188, fullStart);
node.expression = expression;
node.typeArguments = typeArguments;
if (node.typeArguments || token() === 19) {
@@ -15095,7 +15185,7 @@ var ts;
return finishNode(node);
}
function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) {
- var node = createNode(212);
+ var node = createNode(213);
if (parseExpected(17, diagnosticMessage) || ignoreMissingOpenBrace) {
if (scanner.hasPrecedingLineBreak()) {
node.multiLine = true;
@@ -15126,12 +15216,12 @@ var ts;
return block;
}
function parseEmptyStatement() {
- var node = createNode(214);
+ var node = createNode(215);
parseExpected(25);
return finishNode(node);
}
function parseIfStatement() {
- var node = createNode(216);
+ var node = createNode(217);
parseExpected(90);
parseExpected(19);
node.expression = allowInAnd(parseExpression);
@@ -15141,7 +15231,7 @@ var ts;
return finishNode(node);
}
function parseDoStatement() {
- var node = createNode(217);
+ var node = createNode(218);
parseExpected(81);
node.statement = parseStatement();
parseExpected(106);
@@ -15152,7 +15242,7 @@ var ts;
return finishNode(node);
}
function parseWhileStatement() {
- var node = createNode(218);
+ var node = createNode(219);
parseExpected(106);
parseExpected(19);
node.expression = allowInAnd(parseExpression);
@@ -15175,8 +15265,8 @@ var ts;
}
}
var forOrForInOrForOfStatement;
- if (awaitToken ? parseExpected(144) : parseOptional(144)) {
- var forOfStatement = createNode(221, pos);
+ if (awaitToken ? parseExpected(145) : parseOptional(145)) {
+ var forOfStatement = createNode(222, pos);
forOfStatement.awaitModifier = awaitToken;
forOfStatement.initializer = initializer;
forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher);
@@ -15184,14 +15274,14 @@ var ts;
forOrForInOrForOfStatement = forOfStatement;
}
else if (parseOptional(92)) {
- var forInStatement = createNode(220, pos);
+ var forInStatement = createNode(221, pos);
forInStatement.initializer = initializer;
forInStatement.expression = allowInAnd(parseExpression);
parseExpected(20);
forOrForInOrForOfStatement = forInStatement;
}
else {
- var forStatement = createNode(219, pos);
+ var forStatement = createNode(220, pos);
forStatement.initializer = initializer;
parseExpected(25);
if (token() !== 25 && token() !== 20) {
@@ -15209,7 +15299,7 @@ var ts;
}
function parseBreakOrContinueStatement(kind) {
var node = createNode(kind);
- parseExpected(kind === 223 ? 72 : 77);
+ parseExpected(kind === 224 ? 72 : 77);
if (!canParseSemicolon()) {
node.label = parseIdentifier();
}
@@ -15217,7 +15307,7 @@ var ts;
return finishNode(node);
}
function parseReturnStatement() {
- var node = createNode(224);
+ var node = createNode(225);
parseExpected(96);
if (!canParseSemicolon()) {
node.expression = allowInAnd(parseExpression);
@@ -15226,7 +15316,7 @@ var ts;
return finishNode(node);
}
function parseWithStatement() {
- var node = createNode(225);
+ var node = createNode(226);
parseExpected(107);
parseExpected(19);
node.expression = allowInAnd(parseExpression);
@@ -15235,7 +15325,7 @@ var ts;
return finishNode(node);
}
function parseCaseClause() {
- var node = createNode(265);
+ var node = createNode(266);
parseExpected(73);
node.expression = allowInAnd(parseExpression);
parseExpected(56);
@@ -15243,7 +15333,7 @@ var ts;
return finishNode(node);
}
function parseDefaultClause() {
- var node = createNode(266);
+ var node = createNode(267);
parseExpected(79);
parseExpected(56);
node.statements = parseList(3, parseStatement);
@@ -15253,12 +15343,12 @@ var ts;
return token() === 73 ? parseCaseClause() : parseDefaultClause();
}
function parseSwitchStatement() {
- var node = createNode(226);
+ var node = createNode(227);
parseExpected(98);
parseExpected(19);
node.expression = allowInAnd(parseExpression);
parseExpected(20);
- var caseBlock = createNode(240);
+ var caseBlock = createNode(241);
parseExpected(17);
caseBlock.clauses = parseList(2, parseCaseOrDefaultClause);
parseExpected(18);
@@ -15266,14 +15356,14 @@ var ts;
return finishNode(node);
}
function parseThrowStatement() {
- var node = createNode(228);
+ var node = createNode(229);
parseExpected(100);
node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression);
parseSemicolon();
return finishNode(node);
}
function parseTryStatement() {
- var node = createNode(229);
+ var node = createNode(230);
parseExpected(102);
node.tryBlock = parseBlock(false);
node.catchClause = token() === 74 ? parseCatchClause() : undefined;
@@ -15284,7 +15374,7 @@ var ts;
return finishNode(node);
}
function parseCatchClause() {
- var result = createNode(268);
+ var result = createNode(269);
parseExpected(74);
if (parseOptional(19)) {
result.variableDeclaration = parseVariableDeclaration();
@@ -15297,7 +15387,7 @@ var ts;
return finishNode(result);
}
function parseDebuggerStatement() {
- var node = createNode(230);
+ var node = createNode(231);
parseExpected(78);
parseSemicolon();
return finishNode(node);
@@ -15306,12 +15396,12 @@ var ts;
var node = createNodeWithJSDoc(0);
var expression = allowInAnd(parseExpression);
if (expression.kind === 71 && parseOptional(56)) {
- node.kind = 227;
+ node.kind = 228;
node.label = expression;
node.statement = parseStatement();
}
else {
- node.kind = 215;
+ node.kind = 216;
node.expression = expression;
parseSemicolon();
}
@@ -15361,7 +15451,7 @@ var ts;
return false;
}
continue;
- case 143:
+ case 144:
nextToken();
return token() === 17 || token() === 71 || token() === 84;
case 91:
@@ -15423,7 +15513,7 @@ var ts;
case 129:
case 130:
case 139:
- case 143:
+ case 144:
return true;
case 114:
case 112:
@@ -15449,16 +15539,16 @@ var ts;
case 17:
return parseBlock(false);
case 104:
- return parseVariableStatement(createNodeWithJSDoc(231));
+ return parseVariableStatement(createNodeWithJSDoc(232));
case 110:
if (isLetDeclaration()) {
- return parseVariableStatement(createNodeWithJSDoc(231));
+ return parseVariableStatement(createNodeWithJSDoc(232));
}
break;
case 89:
- return parseFunctionDeclaration(createNodeWithJSDoc(233));
+ return parseFunctionDeclaration(createNodeWithJSDoc(234));
case 75:
- return parseClassDeclaration(createNodeWithJSDoc(234));
+ return parseClassDeclaration(createNodeWithJSDoc(235));
case 90:
return parseIfStatement();
case 81:
@@ -15468,9 +15558,9 @@ var ts;
case 88:
return parseForOrForInOrForOfStatement();
case 77:
- return parseBreakOrContinueStatement(222);
- case 72:
return parseBreakOrContinueStatement(223);
+ case 72:
+ return parseBreakOrContinueStatement(224);
case 96:
return parseReturnStatement();
case 107:
@@ -15503,7 +15593,7 @@ var ts;
case 117:
case 115:
case 132:
- case 143:
+ case 144:
if (isStartOfDeclaration()) {
return parseDeclaration();
}
@@ -15545,7 +15635,7 @@ var ts;
return parseTypeAliasDeclaration(node);
case 83:
return parseEnumDeclaration(node);
- case 143:
+ case 144:
case 129:
case 130:
return parseModuleDeclaration(node);
@@ -15564,12 +15654,13 @@ var ts;
}
default:
if (node.decorators || node.modifiers) {
- var missing = createMissingNode(252, true, ts.Diagnostics.Declaration_expected);
+ var missing = createMissingNode(253, true, ts.Diagnostics.Declaration_expected);
missing.pos = node.pos;
missing.decorators = node.decorators;
missing.modifiers = node.modifiers;
return finishNode(missing);
}
+ return undefined;
}
}
function nextTokenIsIdentifierOrStringLiteralOnSameLine() {
@@ -15585,16 +15676,16 @@ var ts;
}
function parseArrayBindingElement() {
if (token() === 26) {
- return createNode(205);
+ return createNode(206);
}
- var node = createNode(181);
+ var node = createNode(182);
node.dotDotDotToken = parseOptionalToken(24);
node.name = parseIdentifierOrPattern();
node.initializer = parseInitializer();
return finishNode(node);
}
function parseObjectBindingElement() {
- var node = createNode(181);
+ var node = createNode(182);
node.dotDotDotToken = parseOptionalToken(24);
var tokenIsIdentifier = isIdentifier();
var propertyName = parsePropertyName();
@@ -15610,14 +15701,14 @@ var ts;
return finishNode(node);
}
function parseObjectBindingPattern() {
- var node = createNode(179);
+ var node = createNode(180);
parseExpected(17);
node.elements = parseDelimitedList(9, parseObjectBindingElement);
parseExpected(18);
return finishNode(node);
}
function parseArrayBindingPattern() {
- var node = createNode(180);
+ var node = createNode(181);
parseExpected(21);
node.elements = parseDelimitedList(10, parseArrayBindingElement);
parseExpected(22);
@@ -15639,7 +15730,7 @@ var ts;
return parseVariableDeclaration(true);
}
function parseVariableDeclaration(allowExclamation) {
- var node = createNode(231);
+ var node = createNode(232);
node.name = parseIdentifierOrPattern();
if (allowExclamation && node.name.kind === 71 &&
token() === 51 && !scanner.hasPrecedingLineBreak()) {
@@ -15652,7 +15743,7 @@ var ts;
return finishNode(node);
}
function parseVariableDeclarationList(inForStatementInitializer) {
- var node = createNode(232);
+ var node = createNode(233);
switch (token()) {
case 104:
break;
@@ -15666,7 +15757,7 @@ var ts;
ts.Debug.fail();
}
nextToken();
- if (token() === 144 && lookAhead(canFollowContextualOfKeyword)) {
+ if (token() === 145 && lookAhead(canFollowContextualOfKeyword)) {
node.declarations = createMissingList();
}
else {
@@ -15681,13 +15772,13 @@ var ts;
return nextTokenIsIdentifier() && nextToken() === 20;
}
function parseVariableStatement(node) {
- node.kind = 213;
+ node.kind = 214;
node.declarationList = parseVariableDeclarationList(false);
parseSemicolon();
return finishNode(node);
}
function parseFunctionDeclaration(node) {
- node.kind = 233;
+ node.kind = 234;
parseExpected(89);
node.asteriskToken = parseOptionalToken(39);
node.name = ts.hasModifier(node, 512) ? parseOptionalIdentifier() : parseIdentifier();
@@ -15698,14 +15789,14 @@ var ts;
return finishNode(node);
}
function parseConstructorDeclaration(node) {
- node.kind = 154;
+ node.kind = 155;
parseExpected(123);
fillSignature(56, 0, node);
node.body = parseFunctionBlockOrSemicolon(0, ts.Diagnostics.or_expected);
return finishNode(node);
}
function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) {
- node.kind = 153;
+ node.kind = 154;
node.asteriskToken = asteriskToken;
var isGenerator = asteriskToken ? 1 : 0;
var isAsync = ts.hasModifier(node, 256) ? 2 : 0;
@@ -15714,7 +15805,7 @@ var ts;
return finishNode(node);
}
function parsePropertyDeclaration(node) {
- node.kind = 151;
+ node.kind = 152;
if (!node.questionToken && token() === 51 && !scanner.hasPrecedingLineBreak()) {
node.exclamationToken = parseTokenNode();
}
@@ -15789,7 +15880,7 @@ var ts;
if (!parseOptional(57)) {
break;
}
- var decorator = createNode(149, decoratorStart);
+ var decorator = createNode(150, decoratorStart);
decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher);
finishNode(decorator);
(list || (list = [])).push(decorator);
@@ -15830,7 +15921,7 @@ var ts;
}
function parseClassElement() {
if (token() === 25) {
- var result = createNode(211);
+ var result = createNode(212);
nextToken();
return finishNode(result);
}
@@ -15838,10 +15929,10 @@ var ts;
node.decorators = parseDecorators();
node.modifiers = parseModifiers(true);
if (parseContextualModifier(125)) {
- return parseAccessorDeclaration(node, 155);
+ return parseAccessorDeclaration(node, 156);
}
if (parseContextualModifier(136)) {
- return parseAccessorDeclaration(node, 156);
+ return parseAccessorDeclaration(node, 157);
}
if (token() === 123) {
return parseConstructorDeclaration(node);
@@ -15860,13 +15951,13 @@ var ts;
node.name = createMissingNode(71, true, ts.Diagnostics.Declaration_expected);
return parsePropertyDeclaration(node);
}
- ts.Debug.fail("Should not have attempted to parse class member declaration.");
+ return ts.Debug.fail("Should not have attempted to parse class member declaration.");
}
function parseClassExpression() {
- return parseClassDeclarationOrExpression(createNodeWithJSDoc(0), 204);
+ return parseClassDeclarationOrExpression(createNodeWithJSDoc(0), 205);
}
function parseClassDeclaration(node) {
- return parseClassDeclarationOrExpression(node, 234);
+ return parseClassDeclarationOrExpression(node, 235);
}
function parseClassDeclarationOrExpression(node, kind) {
node.kind = kind;
@@ -15899,17 +15990,15 @@ var ts;
}
function parseHeritageClause() {
var tok = token();
- if (tok === 85 || tok === 108) {
- var node = createNode(267);
- node.token = tok;
- nextToken();
- node.types = parseDelimitedList(7, parseExpressionWithTypeArguments);
- return finishNode(node);
- }
- return undefined;
+ ts.Debug.assert(tok === 85 || tok === 108);
+ var node = createNode(268);
+ node.token = tok;
+ nextToken();
+ node.types = parseDelimitedList(7, parseExpressionWithTypeArguments);
+ return finishNode(node);
}
function parseExpressionWithTypeArguments() {
- var node = createNode(206);
+ var node = createNode(207);
node.expression = parseLeftHandSideExpressionOrHigher();
node.typeArguments = tryParseTypeArguments();
return finishNode(node);
@@ -15926,7 +16015,7 @@ var ts;
return parseList(5, parseClassElement);
}
function parseInterfaceDeclaration(node) {
- node.kind = 235;
+ node.kind = 236;
parseExpected(109);
node.name = parseIdentifier();
node.typeParameters = parseTypeParameters();
@@ -15935,7 +16024,7 @@ var ts;
return finishNode(node);
}
function parseTypeAliasDeclaration(node) {
- node.kind = 236;
+ node.kind = 237;
parseExpected(139);
node.name = parseIdentifier();
node.typeParameters = parseTypeParameters();
@@ -15945,13 +16034,13 @@ var ts;
return finishNode(node);
}
function parseEnumMember() {
- var node = createNodeWithJSDoc(272);
+ var node = createNodeWithJSDoc(273);
node.name = parsePropertyName();
node.initializer = allowInAnd(parseInitializer);
return finishNode(node);
}
function parseEnumDeclaration(node) {
- node.kind = 237;
+ node.kind = 238;
parseExpected(83);
node.name = parseIdentifier();
if (parseExpected(17)) {
@@ -15964,7 +16053,7 @@ var ts;
return finishNode(node);
}
function parseModuleBlock() {
- var node = createNode(239);
+ var node = createNode(240);
if (parseExpected(17)) {
node.statements = parseList(1, parseStatement);
parseExpected(18);
@@ -15975,7 +16064,7 @@ var ts;
return finishNode(node);
}
function parseModuleOrNamespaceDeclaration(node, flags) {
- node.kind = 238;
+ node.kind = 239;
var namespaceFlag = flags & 16;
node.flags |= flags;
node.name = parseIdentifier();
@@ -15985,8 +16074,8 @@ var ts;
return finishNode(node);
}
function parseAmbientExternalModuleDeclaration(node) {
- node.kind = 238;
- if (token() === 143) {
+ node.kind = 239;
+ if (token() === 144) {
node.name = parseIdentifier();
node.flags |= 512;
}
@@ -16004,7 +16093,7 @@ var ts;
}
function parseModuleDeclaration(node) {
var flags = 0;
- if (token() === 143) {
+ if (token() === 144) {
return parseAmbientExternalModuleDeclaration(node);
}
else if (parseOptional(130)) {
@@ -16029,7 +16118,7 @@ var ts;
return nextToken() === 41;
}
function parseNamespaceExportDeclaration(node) {
- node.kind = 241;
+ node.kind = 242;
parseExpected(118);
parseExpected(130);
node.name = parseIdentifier();
@@ -16042,23 +16131,23 @@ var ts;
var identifier;
if (isIdentifier()) {
identifier = parseIdentifier();
- if (token() !== 26 && token() !== 142) {
+ if (token() !== 26 && token() !== 143) {
return parseImportEqualsDeclaration(node, identifier);
}
}
- node.kind = 243;
+ node.kind = 244;
if (identifier ||
token() === 39 ||
token() === 17) {
node.importClause = parseImportClause(identifier, afterImportPos);
- parseExpected(142);
+ parseExpected(143);
}
node.moduleSpecifier = parseModuleSpecifier();
parseSemicolon();
return finishNode(node);
}
function parseImportEqualsDeclaration(node, identifier) {
- node.kind = 242;
+ node.kind = 243;
node.name = identifier;
parseExpected(58);
node.moduleReference = parseModuleReference();
@@ -16066,13 +16155,13 @@ var ts;
return finishNode(node);
}
function parseImportClause(identifier, fullStart) {
- var importClause = createNode(244, fullStart);
+ var importClause = createNode(245, fullStart);
if (identifier) {
importClause.name = identifier;
}
if (!importClause.name ||
parseOptional(26)) {
- importClause.namedBindings = token() === 39 ? parseNamespaceImport() : parseNamedImportsOrExports(246);
+ importClause.namedBindings = token() === 39 ? parseNamespaceImport() : parseNamedImportsOrExports(247);
}
return finishNode(importClause);
}
@@ -16082,7 +16171,7 @@ var ts;
: parseEntityName(false);
}
function parseExternalModuleReference() {
- var node = createNode(253);
+ var node = createNode(254);
parseExpected(133);
parseExpected(19);
node.expression = parseModuleSpecifier();
@@ -16100,7 +16189,7 @@ var ts;
}
}
function parseNamespaceImport() {
- var namespaceImport = createNode(245);
+ var namespaceImport = createNode(246);
parseExpected(39);
parseExpected(118);
namespaceImport.name = parseIdentifier();
@@ -16108,14 +16197,14 @@ var ts;
}
function parseNamedImportsOrExports(kind) {
var node = createNode(kind);
- node.elements = parseBracketedList(22, kind === 246 ? parseImportSpecifier : parseExportSpecifier, 17, 18);
+ node.elements = parseBracketedList(22, kind === 247 ? parseImportSpecifier : parseExportSpecifier, 17, 18);
return finishNode(node);
}
function parseExportSpecifier() {
- return parseImportOrExportSpecifier(251);
+ return parseImportOrExportSpecifier(252);
}
function parseImportSpecifier() {
- return parseImportOrExportSpecifier(247);
+ return parseImportOrExportSpecifier(248);
}
function parseImportOrExportSpecifier(kind) {
var node = createNode(kind);
@@ -16134,21 +16223,21 @@ var ts;
else {
node.name = identifierName;
}
- if (kind === 247 && checkIdentifierIsKeyword) {
+ if (kind === 248 && checkIdentifierIsKeyword) {
parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected);
}
return finishNode(node);
}
function parseExportDeclaration(node) {
- node.kind = 249;
+ node.kind = 250;
if (parseOptional(39)) {
- parseExpected(142);
+ parseExpected(143);
node.moduleSpecifier = parseModuleSpecifier();
}
else {
- node.exportClause = parseNamedImportsOrExports(250);
- if (token() === 142 || (token() === 9 && !scanner.hasPrecedingLineBreak())) {
- parseExpected(142);
+ node.exportClause = parseNamedImportsOrExports(251);
+ if (token() === 143 || (token() === 9 && !scanner.hasPrecedingLineBreak())) {
+ parseExpected(143);
node.moduleSpecifier = parseModuleSpecifier();
}
}
@@ -16156,7 +16245,7 @@ var ts;
return finishNode(node);
}
function parseExportAssignment(node) {
- node.kind = 248;
+ node.kind = 249;
if (parseOptional(58)) {
node.isExportEquals = true;
}
@@ -16174,10 +16263,10 @@ var ts;
}
function isAnExternalModuleIndicatorNode(node) {
return ts.hasModifier(node, 1)
- || node.kind === 242 && node.moduleReference.kind === 253
- || node.kind === 243
- || node.kind === 248
+ || node.kind === 243 && node.moduleReference.kind === 254
+ || node.kind === 244
|| node.kind === 249
+ || node.kind === 250
? node
: undefined;
}
@@ -16206,7 +16295,7 @@ var ts;
}
JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests;
function parseJSDocTypeExpression(mayOmitBraces) {
- var result = createNode(277, scanner.getTokenPos());
+ var result = createNode(278, scanner.getTokenPos());
var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(17);
result.type = doInsideOfContext(2097152, parseJSDocType);
if (!mayOmitBraces || hasBrace) {
@@ -16247,8 +16336,8 @@ var ts;
}
JSDocParser.parseJSDocComment = parseJSDocComment;
function parseJSDocCommentWorker(start, length) {
+ if (start === void 0) { start = 0; }
var content = sourceText;
- start = start || 0;
var end = length === undefined ? content.length : start + length;
length = end - start;
ts.Debug.assert(start >= 0);
@@ -16273,17 +16362,15 @@ var ts;
comments.push(text);
indent += text.length;
}
- var t = nextJSDocToken();
- while (t === 5) {
- t = nextJSDocToken();
- }
- if (t === 4) {
+ nextJSDocToken();
+ while (parseOptionalJsdoc(5))
+ ;
+ if (parseOptionalJsdoc(4)) {
state = 0;
indent = 0;
- t = nextJSDocToken();
}
loop: while (true) {
- switch (t) {
+ switch (token()) {
case 57:
if (state === 0 || state === 1) {
removeTrailingNewlines(comments);
@@ -16333,7 +16420,7 @@ var ts;
pushComment(scanner.getTokenText());
break;
}
- t = nextJSDocToken();
+ nextJSDocToken();
}
removeLeadingNewlines(comments);
removeTrailingNewlines(comments);
@@ -16351,7 +16438,7 @@ var ts;
}
}
function createJSDocComment() {
- var result = createNode(285, start);
+ var result = createNode(286, start);
result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd);
result.comment = comments.length ? comments.join("") : undefined;
return finishNode(result, end);
@@ -16489,7 +16576,7 @@ var ts;
return comments.length === 0 ? undefined : comments.join("");
}
function parseUnknownTag(atToken, tagName) {
- var result = createNode(288, atToken.pos);
+ var result = createNode(289, atToken.pos);
result.atToken = atToken;
result.tagName = tagName;
return finishNode(result);
@@ -16530,7 +16617,7 @@ var ts;
switch (node.kind) {
case 135:
return true;
- case 166:
+ case 167:
return isObjectOrObjectArrayTypeReference(node.elementType);
default:
return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object";
@@ -16546,12 +16633,12 @@ var ts;
typeExpression = tryParseTypeExpression();
}
var result = target === 1 ?
- createNode(297, atToken.pos) :
- createNode(292, atToken.pos);
+ createNode(298, atToken.pos) :
+ createNode(293, atToken.pos);
var comment;
if (indent !== undefined)
comment = parseTagComments(indent + scanner.getStartPos() - atToken.pos);
- var nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name, target);
+ var nestedTypeLiteral = target !== 4 && parseNestedTypeLiteral(typeExpression, name, target);
if (nestedTypeLiteral) {
typeExpression = nestedTypeLiteral;
isNameFirst = true;
@@ -16567,20 +16654,20 @@ var ts;
}
function parseNestedTypeLiteral(typeExpression, name, target) {
if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) {
- var typeLiteralExpression = createNode(277, scanner.getTokenPos());
+ var typeLiteralExpression = createNode(278, scanner.getTokenPos());
var child = void 0;
var jsdocTypeLiteral = void 0;
var start_2 = scanner.getStartPos();
var children = void 0;
while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, name); })) {
- if (child.kind === 292 || child.kind === 297) {
+ if (child.kind === 293 || child.kind === 298) {
children = ts.append(children, child);
}
}
if (children) {
- jsdocTypeLiteral = createNode(286, start_2);
+ jsdocTypeLiteral = createNode(287, start_2);
jsdocTypeLiteral.jsDocPropertyTags = children;
- if (typeExpression.type.kind === 166) {
+ if (typeExpression.type.kind === 167) {
jsdocTypeLiteral.isArrayType = true;
}
typeLiteralExpression.type = finishNode(jsdocTypeLiteral);
@@ -16589,27 +16676,27 @@ var ts;
}
}
function parseReturnTag(atToken, tagName) {
- if (ts.forEach(tags, function (t) { return t.kind === 293; })) {
- parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText);
- }
- var result = createNode(293, atToken.pos);
- result.atToken = atToken;
- result.tagName = tagName;
- result.typeExpression = tryParseTypeExpression();
- return finishNode(result);
- }
- function parseTypeTag(atToken, tagName) {
if (ts.forEach(tags, function (t) { return t.kind === 294; })) {
parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText);
}
var result = createNode(294, atToken.pos);
result.atToken = atToken;
result.tagName = tagName;
+ result.typeExpression = tryParseTypeExpression();
+ return finishNode(result);
+ }
+ function parseTypeTag(atToken, tagName) {
+ if (ts.forEach(tags, function (t) { return t.kind === 295; })) {
+ parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText);
+ }
+ var result = createNode(295, atToken.pos);
+ result.atToken = atToken;
+ result.tagName = tagName;
result.typeExpression = parseJSDocTypeExpression(true);
return finishNode(result);
}
function parseAugmentsTag(atToken, tagName) {
- var result = createNode(289, atToken.pos);
+ var result = createNode(290, atToken.pos);
result.atToken = atToken;
result.tagName = tagName;
result.class = parseExpressionWithTypeArgumentsForAugments();
@@ -16617,7 +16704,7 @@ var ts;
}
function parseExpressionWithTypeArgumentsForAugments() {
var usedBrace = parseOptional(17);
- var node = createNode(206);
+ var node = createNode(207);
node.expression = parsePropertyAccessEntityNameExpression();
node.typeArguments = tryParseTypeArguments();
var res = finishNode(node);
@@ -16629,7 +16716,7 @@ var ts;
function parsePropertyAccessEntityNameExpression() {
var node = parseJSDocIdentifierName(true);
while (parseOptional(23)) {
- var prop = createNode(184, node.pos);
+ var prop = createNode(185, node.pos);
prop.expression = node;
prop.name = parseJSDocIdentifierName();
node = finishNode(prop);
@@ -16637,7 +16724,7 @@ var ts;
return node;
}
function parseClassTag(atToken, tagName) {
- var tag = createNode(290, atToken.pos);
+ var tag = createNode(291, atToken.pos);
tag.atToken = atToken;
tag.tagName = tagName;
return finishNode(tag);
@@ -16645,7 +16732,7 @@ var ts;
function parseTypedefTag(atToken, tagName, indent) {
var typeExpression = tryParseTypeExpression();
skipWhitespace();
- var typedefTag = createNode(296, atToken.pos);
+ var typedefTag = createNode(297, atToken.pos);
typedefTag.atToken = atToken;
typedefTag.tagName = tagName;
typedefTag.fullName = parseJSDocTypeNameWithNamespace();
@@ -16661,9 +16748,9 @@ var ts;
var start_3 = scanner.getStartPos();
while (child = tryParse(function () { return parseChildPropertyTag(); })) {
if (!jsdocTypeLiteral) {
- jsdocTypeLiteral = createNode(286, start_3);
+ jsdocTypeLiteral = createNode(287, start_3);
}
- if (child.kind === 294) {
+ if (child.kind === 295) {
if (childTypeTag) {
break;
}
@@ -16676,7 +16763,7 @@ var ts;
}
}
if (jsdocTypeLiteral) {
- if (typeExpression && typeExpression.type.kind === 166) {
+ if (typeExpression && typeExpression.type.kind === 167) {
jsdocTypeLiteral.isArrayType = true;
}
typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ?
@@ -16691,7 +16778,7 @@ var ts;
var pos = scanner.getTokenPos();
var typeNameOrNamespaceName = parseJSDocIdentifierName();
if (typeNameOrNamespaceName && parseOptional(23)) {
- var jsDocNamespaceNode = createNode(238, pos);
+ var jsDocNamespaceNode = createNode(239, pos);
if (nested) {
jsDocNamespaceNode.flags |= 4;
}
@@ -16705,7 +16792,7 @@ var ts;
return typeNameOrNamespaceName;
}
function parseCallbackTag(atToken, tagName, indent) {
- var callbackTag = createNode(291, atToken.pos);
+ var callbackTag = createNode(292, atToken.pos);
callbackTag.atToken = atToken;
callbackTag.tagName = tagName;
callbackTag.fullName = parseJSDocTypeNameWithNamespace();
@@ -16714,16 +16801,15 @@ var ts;
callbackTag.comment = parseTagComments(indent);
var child;
var start = scanner.getStartPos();
- var jsdocSignature = createNode(287, start);
+ var jsdocSignature = createNode(288, start);
jsdocSignature.parameters = [];
while (child = tryParse(function () { return parseChildParameterOrPropertyTag(4); })) {
jsdocSignature.parameters = ts.append(jsdocSignature.parameters, child);
}
var returnTag = tryParse(function () {
- if (token() === 57) {
- nextJSDocToken();
+ if (parseOptionalJsdoc(57)) {
var tag = parseTag(indent);
- if (tag && tag.kind === 293) {
+ if (tag && tag.kind === 294) {
return tag;
}
}
@@ -16768,7 +16854,7 @@ var ts;
case 57:
if (canParseTag) {
var child = tryParseChildTag(target);
- if (child && child.kind === 292 &&
+ if (child && child.kind === 293 &&
target !== 4 &&
(ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
return false;
@@ -16829,48 +16915,44 @@ var ts;
return tag;
}
function parseTemplateTag(atToken, tagName) {
- if (ts.some(tags, ts.isJSDocTemplateTag)) {
- parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText);
+ var constraint;
+ if (token() === 17) {
+ constraint = parseJSDocTypeExpression();
}
var typeParameters = [];
var typeParametersPos = getNodePos();
- while (true) {
- var typeParameter = createNode(147);
- var name = parseJSDocIdentifierNameWithOptionalBraces();
+ do {
skipWhitespace();
- if (!name) {
- parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected);
+ var typeParameter = createNode(148);
+ if (!ts.tokenIsIdentifierOrKeyword(token())) {
+ parseErrorAtCurrentToken(ts.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);
return undefined;
}
- typeParameter.name = name;
+ typeParameter.name = parseJSDocIdentifierName();
+ skipWhitespace();
finishNode(typeParameter);
typeParameters.push(typeParameter);
- if (token() === 26) {
- nextJSDocToken();
- skipWhitespace();
- }
- else {
- break;
- }
+ } while (parseOptionalJsdoc(26));
+ if (constraint) {
+ ts.first(typeParameters).constraint = constraint.type;
}
- var result = createNode(295, atToken.pos);
+ var result = createNode(296, atToken.pos);
result.atToken = atToken;
result.tagName = tagName;
result.typeParameters = createNodeArray(typeParameters, typeParametersPos);
finishNode(result);
return result;
}
- function parseJSDocIdentifierNameWithOptionalBraces() {
- var parsedBrace = parseOptional(17);
- var res = parseJSDocIdentifierName();
- if (parsedBrace) {
- parseExpected(18);
- }
- return res;
- }
function nextJSDocToken() {
return currentToken = scanner.scanJSDocToken();
}
+ function parseOptionalJsdoc(t) {
+ if (token() === t) {
+ nextJSDocToken();
+ return true;
+ }
+ return false;
+ }
function parseJSDocEntityName() {
var entity = parseJSDocIdentifierName(true);
if (parseOptional(21)) {
@@ -17260,10 +17342,7 @@ var ts;
break;
}
case "amd-dependency": {
- context.amdDependencies = ts.map(ts.toArray(entryOrList), function (_a) {
- var _b = _a.arguments, name = _b.name, path = _b.path;
- return ({ name: name, path: path });
- });
+ context.amdDependencies = ts.map(ts.toArray(entryOrList), function (x) { return ({ name: x.arguments.name, path: x.arguments.path }); });
break;
}
case "amd-module": {
@@ -17395,6 +17474,20 @@ var ts;
}
return argMap;
}
+ function tagNamesAreEquivalent(lhs, rhs) {
+ if (lhs.kind !== rhs.kind) {
+ return false;
+ }
+ if (lhs.kind === 71) {
+ return lhs.escapedText === rhs.escapedText;
+ }
+ if (lhs.kind === 99) {
+ return true;
+ }
+ return lhs.name.escapedText === rhs.name.escapedText &&
+ tagNamesAreEquivalent(lhs.expression, rhs.expression);
+ }
+ ts.tagNamesAreEquivalent = tagNamesAreEquivalent;
})(ts || (ts = {}));
var ts;
(function (ts) {
@@ -17404,21 +17497,21 @@ var ts;
ts.getModuleInstanceState = getModuleInstanceState;
function getModuleInstanceStateWorker(node) {
switch (node.kind) {
- case 235:
case 236:
- return 0;
case 237:
+ return 0;
+ case 238:
if (ts.isConst(node)) {
return 2;
}
break;
+ case 244:
case 243:
- case 242:
if (!(ts.hasModifier(node, 1))) {
return 0;
}
break;
- case 239: {
+ case 240: {
var state_1 = 0;
ts.forEachChild(node, function (n) {
var childState = getModuleInstanceStateWorker(n);
@@ -17437,7 +17530,7 @@ var ts;
});
return state_1;
}
- case 238:
+ case 239:
return getModuleInstanceState(node);
case 71:
if (node.isInJSDocNamespace) {
@@ -17548,13 +17641,13 @@ var ts;
if (symbolFlags & 67216319) {
var valueDeclaration = symbol.valueDeclaration;
if (!valueDeclaration ||
- (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 238)) {
+ (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 239)) {
symbol.valueDeclaration = node;
}
}
}
function getDeclarationName(node) {
- if (node.kind === 248) {
+ if (node.kind === 249) {
return node.isExportEquals ? "export=" : "default";
}
var name = ts.getNameOfDeclaration(node);
@@ -17563,7 +17656,7 @@ var ts;
var moduleName = ts.getTextOfIdentifierOrLiteral(name);
return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\"");
}
- if (name.kind === 146) {
+ if (name.kind === 147) {
var nameExpression = name.expression;
if (ts.isStringOrNumericLiteral(nameExpression)) {
return ts.escapeLeadingUnderscores(nameExpression.text);
@@ -17574,31 +17667,31 @@ var ts;
return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined;
}
switch (node.kind) {
- case 154:
+ case 155:
return "__constructor";
- case 162:
- case 157:
- case 287:
- return "__call";
case 163:
case 158:
- return "__new";
+ case 288:
+ return "__call";
+ case 164:
case 159:
+ return "__new";
+ case 160:
return "__index";
- case 249:
+ case 250:
return "__export";
- case 273:
+ case 274:
return "export=";
- case 199:
+ case 200:
if (ts.getSpecialPropertyAssignmentKind(node) === 2) {
return "export=";
}
ts.Debug.fail("Unknown binary declaration kind");
break;
- case 283:
+ case 284:
return (ts.isJSDocConstructSignature(node) ? "__new" : "__call");
- case 148:
- ts.Debug.assert(node.parent.kind === 283, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; });
+ case 149:
+ ts.Debug.assert(node.parent.kind === 284, "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;
@@ -17648,7 +17741,7 @@ var ts;
}
else {
if (symbol.declarations && symbol.declarations.length &&
- (node.kind === 248 && !node.isExportEquals)) {
+ (node.kind === 249 && !node.isExportEquals)) {
message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports;
}
}
@@ -17673,7 +17766,7 @@ var ts;
function declareModuleMember(node, symbolFlags, symbolExcludes) {
var hasExportModifier = ts.getCombinedModifierFlags(node) & 1;
if (symbolFlags & 2097152) {
- if (node.kind === 251 || (node.kind === 242 && hasExportModifier)) {
+ if (node.kind === 252 || (node.kind === 243 && hasExportModifier)) {
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
}
else {
@@ -17703,7 +17796,7 @@ var ts;
var saveThisParentContainer = thisParentContainer;
var savedBlockScopeContainer = blockScopeContainer;
if (containerFlags & 1) {
- if (node.kind !== 192) {
+ if (node.kind !== 193) {
thisParentContainer = container;
}
container = blockScopeContainer = node;
@@ -17731,7 +17824,7 @@ var ts;
currentFlow.container = node;
}
}
- currentReturnTarget = isIIFE || node.kind === 154 ? createBranchLabel() : undefined;
+ currentReturnTarget = isIIFE || node.kind === 155 ? createBranchLabel() : undefined;
currentBreakTarget = undefined;
currentContinueTarget = undefined;
activeLabels = undefined;
@@ -17743,13 +17836,13 @@ var ts;
if (hasExplicitReturn)
node.flags |= 256;
}
- if (node.kind === 273) {
+ if (node.kind === 274) {
node.flags |= emitFlags;
}
if (currentReturnTarget) {
addAntecedent(currentReturnTarget, currentFlow);
currentFlow = finishFlowLabel(currentReturnTarget);
- if (node.kind === 154) {
+ if (node.kind === 155) {
node.returnFlowNode = currentFlow;
}
}
@@ -17792,8 +17885,8 @@ var ts;
}
}
function bindEachFunctionsFirst(nodes) {
- bindEach(nodes, function (n) { return n.kind === 233 ? bind(n) : undefined; });
- bindEach(nodes, function (n) { return n.kind !== 233 ? bind(n) : undefined; });
+ bindEach(nodes, function (n) { return n.kind === 234 ? bind(n) : undefined; });
+ bindEach(nodes, function (n) { return n.kind !== 234 ? bind(n) : undefined; });
}
function bindEach(nodes, bindFunction) {
if (bindFunction === void 0) { bindFunction = bind; }
@@ -17825,76 +17918,76 @@ var ts;
return;
}
switch (node.kind) {
- case 218:
+ case 219:
bindWhileStatement(node);
break;
- case 217:
+ case 218:
bindDoStatement(node);
break;
- case 219:
+ case 220:
bindForStatement(node);
break;
- case 220:
case 221:
+ case 222:
bindForInOrForOfStatement(node);
break;
- case 216:
+ case 217:
bindIfStatement(node);
break;
- case 224:
- case 228:
+ case 225:
+ case 229:
bindReturnOrThrow(node);
break;
+ case 224:
case 223:
- case 222:
bindBreakOrContinueStatement(node);
break;
- case 229:
+ case 230:
bindTryStatement(node);
break;
- case 226:
+ case 227:
bindSwitchStatement(node);
break;
- case 240:
+ case 241:
bindCaseBlock(node);
break;
- case 265:
+ case 266:
bindCaseClause(node);
break;
- case 227:
+ case 228:
bindLabeledStatement(node);
break;
- case 197:
+ case 198:
bindPrefixUnaryExpressionFlow(node);
break;
- case 198:
+ case 199:
bindPostfixUnaryExpressionFlow(node);
break;
- case 199:
+ case 200:
bindBinaryExpressionFlow(node);
break;
- case 193:
+ case 194:
bindDeleteExpressionFlow(node);
break;
- case 200:
+ case 201:
bindConditionalExpressionFlow(node);
break;
- case 231:
+ case 232:
bindVariableDeclarationFlow(node);
break;
- case 186:
+ case 187:
bindCallExpressionFlow(node);
break;
- case 296:
- case 291:
+ case 297:
+ case 292:
bindJSDocTypeAlias(node);
break;
- case 273:
+ case 274:
bindEachFunctionsFirst(node.statements);
bind(node.endOfFileToken);
break;
- case 212:
- case 239:
+ case 213:
+ case 240:
bindEachFunctionsFirst(node.statements);
break;
default:
@@ -17907,15 +18000,15 @@ var ts;
switch (expr.kind) {
case 71:
case 99:
- case 184:
+ case 185:
return isNarrowableReference(expr);
- case 186:
+ case 187:
return hasNarrowableArgument(expr);
- case 190:
+ case 191:
return isNarrowingExpression(expr.expression);
- case 199:
+ case 200:
return isNarrowingBinaryExpression(expr);
- case 197:
+ case 198:
return expr.operator === 51 && isNarrowingExpression(expr.operand);
}
return false;
@@ -17924,7 +18017,7 @@ var ts;
return expr.kind === 71 ||
expr.kind === 99 ||
expr.kind === 97 ||
- expr.kind === 184 && isNarrowableReference(expr.expression);
+ expr.kind === 185 && isNarrowableReference(expr.expression);
}
function hasNarrowableArgument(expr) {
if (expr.arguments) {
@@ -17935,7 +18028,7 @@ var ts;
}
}
}
- if (expr.expression.kind === 184 &&
+ if (expr.expression.kind === 185 &&
isNarrowableReference(expr.expression.expression)) {
return true;
}
@@ -17968,9 +18061,9 @@ var ts;
}
function isNarrowableOperand(expr) {
switch (expr.kind) {
- case 190:
+ case 191:
return isNarrowableOperand(expr.expression);
- case 199:
+ case 200:
switch (expr.operatorToken.kind) {
case 58:
return isNarrowableOperand(expr.left);
@@ -18047,33 +18140,33 @@ var ts;
function isStatementCondition(node) {
var parent = node.parent;
switch (parent.kind) {
- case 216:
- case 218:
case 217:
- return parent.expression === node;
case 219:
- case 200:
+ case 218:
+ return parent.expression === node;
+ case 220:
+ case 201:
return parent.condition === node;
}
return false;
}
function isLogicalExpression(node) {
while (true) {
- if (node.kind === 190) {
+ if (node.kind === 191) {
node = node.expression;
}
- else if (node.kind === 197 && node.operator === 51) {
+ else if (node.kind === 198 && node.operator === 51) {
node = node.operand;
}
else {
- return node.kind === 199 && (node.operatorToken.kind === 53 ||
+ return node.kind === 200 && (node.operatorToken.kind === 53 ||
node.operatorToken.kind === 54);
}
}
}
function isTopLevelLogicalExpression(node) {
- while (node.parent.kind === 190 ||
- node.parent.kind === 197 &&
+ while (node.parent.kind === 191 ||
+ node.parent.kind === 198 &&
node.parent.operator === 51) {
node = node.parent;
}
@@ -18115,7 +18208,7 @@ var ts;
}
function bindDoStatement(node) {
var preDoLabel = createLoopLabel();
- var enclosingLabeledStatement = node.parent.kind === 227
+ var enclosingLabeledStatement = node.parent.kind === 228
? ts.lastOrUndefined(activeLabels)
: undefined;
var preConditionLabel = enclosingLabeledStatement ? enclosingLabeledStatement.continueTarget : createBranchLabel();
@@ -18147,13 +18240,13 @@ var ts;
var postLoopLabel = createBranchLabel();
addAntecedent(preLoopLabel, currentFlow);
currentFlow = preLoopLabel;
- if (node.kind === 221) {
+ if (node.kind === 222) {
bind(node.awaitModifier);
}
bind(node.expression);
addAntecedent(postLoopLabel, currentFlow);
bind(node.initializer);
- if (node.initializer.kind !== 232) {
+ if (node.initializer.kind !== 233) {
bindAssignmentTargetFlow(node.initializer);
}
bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
@@ -18175,7 +18268,7 @@ var ts;
}
function bindReturnOrThrow(node) {
bind(node.expression);
- if (node.kind === 224) {
+ if (node.kind === 225) {
hasExplicitReturn = true;
if (currentReturnTarget) {
addAntecedent(currentReturnTarget, currentFlow);
@@ -18195,7 +18288,7 @@ var ts;
return undefined;
}
function bindBreakOrContinueFlow(node, breakTarget, continueTarget) {
- var flowLabel = node.kind === 223 ? breakTarget : continueTarget;
+ var flowLabel = node.kind === 224 ? breakTarget : continueTarget;
if (flowLabel) {
addAntecedent(flowLabel, currentFlow);
currentFlow = unreachableFlow;
@@ -18258,7 +18351,7 @@ var ts;
preSwitchCaseFlow = currentFlow;
bind(node.caseBlock);
addAntecedent(postSwitchLabel, currentFlow);
- var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 266; });
+ var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 267; });
node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents;
if (!hasDefault) {
addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0));
@@ -18280,6 +18373,7 @@ var ts;
}
var preCaseLabel = createBranchLabel();
addAntecedent(preCaseLabel, createFlowSwitchClause(preSwitchCaseFlow, node.parent, clauseStart, i + 1));
+ addAntecedent(preCaseLabel, createFlowSwitchClause(preSwitchCaseFlow, node.parent, clauseStart, i + 1));
addAntecedent(preCaseLabel, fallthroughFlow);
currentFlow = finishFlowLabel(preCaseLabel);
var clause = clauses[i];
@@ -18321,15 +18415,15 @@ var ts;
bind(node.statement);
popActiveLabel();
if (!activeLabel.referenced && !options.allowUnusedLabels) {
- file.bindDiagnostics.push(createDiagnosticForNode(node.label, ts.Diagnostics.Unused_label));
+ errorOrSuggestionOnFirstToken(ts.unusedLabelIsError(options), node, ts.Diagnostics.Unused_label);
}
- if (!node.statement || node.statement.kind !== 217) {
+ if (!node.statement || node.statement.kind !== 218) {
addAntecedent(postStatementLabel, currentFlow);
currentFlow = finishFlowLabel(postStatementLabel);
}
}
function bindDestructuringTargetFlow(node) {
- if (node.kind === 199 && node.operatorToken.kind === 58) {
+ if (node.kind === 200 && node.operatorToken.kind === 58) {
bindAssignmentTargetFlow(node.left);
}
else {
@@ -18340,10 +18434,10 @@ var ts;
if (isNarrowableReference(node)) {
currentFlow = createFlowAssignment(currentFlow, node);
}
- else if (node.kind === 182) {
+ else if (node.kind === 183) {
for (var _i = 0, _a = node.elements; _i < _a.length; _i++) {
var e = _a[_i];
- if (e.kind === 203) {
+ if (e.kind === 204) {
bindAssignmentTargetFlow(e.expression);
}
else {
@@ -18351,16 +18445,16 @@ var ts;
}
}
}
- else if (node.kind === 183) {
+ else if (node.kind === 184) {
for (var _b = 0, _c = node.properties; _b < _c.length; _b++) {
var p = _c[_b];
- if (p.kind === 269) {
+ if (p.kind === 270) {
bindDestructuringTargetFlow(p.initializer);
}
- else if (p.kind === 270) {
+ else if (p.kind === 271) {
bindAssignmentTargetFlow(p.name);
}
- else if (p.kind === 271) {
+ else if (p.kind === 272) {
bindAssignmentTargetFlow(p.expression);
}
}
@@ -18416,7 +18510,7 @@ var ts;
bindEachChild(node);
if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) {
bindAssignmentTargetFlow(node.left);
- if (operator === 58 && node.left.kind === 185) {
+ if (operator === 58 && node.left.kind === 186) {
var elementAccess = node.left;
if (isNarrowableOperand(elementAccess.expression)) {
currentFlow = createFlowArrayMutation(currentFlow, node);
@@ -18427,7 +18521,7 @@ var ts;
}
function bindDeleteExpressionFlow(node) {
bindEachChild(node);
- if (node.expression.kind === 184) {
+ if (node.expression.kind === 185) {
bindAssignmentTargetFlow(node.expression);
}
}
@@ -18471,10 +18565,10 @@ var ts;
}
function bindCallExpressionFlow(node) {
var expr = node.expression;
- while (expr.kind === 190) {
+ while (expr.kind === 191) {
expr = expr.expression;
}
- if (expr.kind === 191 || expr.kind === 192) {
+ if (expr.kind === 192 || expr.kind === 193) {
bindEach(node.typeArguments);
bindEach(node.arguments);
bind(node.expression);
@@ -18482,7 +18576,7 @@ var ts;
else {
bindEachChild(node);
}
- if (node.expression.kind === 184) {
+ if (node.expression.kind === 185) {
var propertyAccess = node.expression;
if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) {
currentFlow = createFlowArrayMutation(currentFlow, node);
@@ -18491,53 +18585,53 @@ var ts;
}
function getContainerFlags(node) {
switch (node.kind) {
- case 204:
- case 234:
- case 237:
- case 183:
- case 165:
- case 286:
- case 262:
- return 1;
+ case 205:
case 235:
- return 1 | 64;
case 238:
+ case 184:
+ case 166:
+ case 287:
+ case 263:
+ return 1;
case 236:
- case 176:
+ return 1 | 64;
+ case 239:
+ case 237:
+ case 177:
return 1 | 32;
- case 273:
+ case 274:
return 1 | 4 | 32;
- case 153:
+ case 154:
if (ts.isObjectLiteralOrClassExpressionMethod(node)) {
return 1 | 4 | 32 | 8 | 128;
}
- case 154:
- case 233:
- case 152:
case 155:
+ case 234:
+ case 153:
case 156:
case 157:
- case 287:
- case 283:
- case 162:
case 158:
- case 159:
+ case 288:
+ case 284:
case 163:
+ case 159:
+ case 160:
+ case 164:
return 1 | 4 | 32 | 8;
- case 191:
case 192:
+ case 193:
return 1 | 4 | 32 | 8 | 16;
- case 239:
+ case 240:
return 4;
- case 151:
+ case 152:
return node.initializer ? 4 : 0;
- case 268:
- case 219:
+ case 269:
case 220:
case 221:
- case 240:
+ case 222:
+ case 241:
return 2;
- case 212:
+ case 213:
return ts.isFunctionLike(node.parent) ? 0 : 2;
}
return 0;
@@ -18550,40 +18644,40 @@ var ts;
}
function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) {
switch (container.kind) {
- case 238:
+ case 239:
return declareModuleMember(node, symbolFlags, symbolExcludes);
- case 273:
+ case 274:
return declareSourceFileMember(node, symbolFlags, symbolExcludes);
- case 204:
- case 234:
- return declareClassMember(node, symbolFlags, symbolExcludes);
- case 237:
- return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
- case 165:
- case 286:
- case 183:
+ case 205:
case 235:
- case 262:
- return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes);
- case 162:
- case 163:
- case 157:
- case 158:
+ return declareClassMember(node, symbolFlags, symbolExcludes);
+ case 238:
+ return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
+ case 166:
case 287:
+ case 184:
+ case 236:
+ case 263:
+ return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes);
+ case 163:
+ case 164:
+ case 158:
case 159:
- case 153:
- case 152:
+ case 288:
+ case 160:
case 154:
+ case 153:
case 155:
case 156:
- case 233:
- case 191:
+ case 157:
+ case 234:
case 192:
- case 283:
- case 296:
- case 291:
- case 236:
- case 176:
+ case 193:
+ case 284:
+ case 297:
+ case 292:
+ case 237:
+ case 177:
return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes);
}
}
@@ -18598,11 +18692,11 @@ var ts;
: declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes);
}
function hasExportDeclarations(node) {
- var body = node.kind === 273 ? node : node.body;
- if (body && (body.kind === 273 || body.kind === 239)) {
+ var body = node.kind === 274 ? node : node.body;
+ if (body && (body.kind === 274 || body.kind === 240)) {
for (var _i = 0, _a = body.statements; _i < _a.length; _i++) {
var stat = _a[_i];
- if (stat.kind === 249 || stat.kind === 248) {
+ if (stat.kind === 250 || stat.kind === 249) {
return true;
}
}
@@ -18670,11 +18764,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 === 271 || prop.name.kind !== 71) {
+ if (prop.kind === 272 || prop.name.kind !== 71) {
continue;
}
var identifier = prop.name;
- var currentKind = prop.kind === 269 || prop.kind === 270 || prop.kind === 153
+ var currentKind = prop.kind === 270 || prop.kind === 271 || prop.kind === 154
? 1
: 2;
var existingKind = seen.get(identifier.escapedText);
@@ -18702,13 +18796,14 @@ var ts;
symbol.parent = container.symbol;
}
addDeclarationToSymbol(symbol, node, symbolFlags);
+ return symbol;
}
function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) {
switch (blockScopeContainer.kind) {
- case 238:
+ case 239:
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
- case 273:
+ case 274:
if (ts.isExternalOrCommonJsModule(container)) {
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
@@ -18828,8 +18923,8 @@ var ts;
}
function checkStrictModeFunctionDeclaration(node) {
if (languageVersion < 2) {
- if (blockScopeContainer.kind !== 273 &&
- blockScopeContainer.kind !== 238 &&
+ if (blockScopeContainer.kind !== 274 &&
+ blockScopeContainer.kind !== 239 &&
!ts.isFunctionLike(blockScopeContainer)) {
var errorSpan = ts.getErrorSpanForNode(file, node);
file.bindDiagnostics.push(ts.createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node)));
@@ -18862,6 +18957,16 @@ var ts;
var span = ts.getSpanOfTokenAtPosition(file, node.pos);
file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, message, arg0, arg1, arg2));
}
+ function errorOrSuggestionOnFirstToken(isError, node, message, arg0, arg1, arg2) {
+ var span = ts.getSpanOfTokenAtPosition(file, node.pos);
+ var diag = ts.createFileDiagnostic(file, span.start, span.length, message, arg0, arg1, arg2);
+ if (isError) {
+ file.bindDiagnostics.push(diag);
+ }
+ else {
+ file.bindSuggestionDiagnostics = ts.append(file.bindSuggestionDiagnostics, __assign({}, diag, { category: ts.DiagnosticCategory.Suggestion }));
+ }
+ }
function bind(node) {
if (!node) {
return;
@@ -18869,7 +18974,7 @@ var ts;
node.parent = parent;
var saveInStrictMode = inStrictMode;
bindWorker(node);
- if (node.kind > 144) {
+ if (node.kind > 145) {
var saveParent = parent;
parent = node;
var containerFlags = getContainerFlags(node);
@@ -18933,11 +19038,11 @@ var ts;
break;
}
case 99:
- if (currentFlow && (ts.isExpression(node) || parent.kind === 270)) {
+ if (currentFlow && (ts.isExpression(node) || parent.kind === 271)) {
node.flowNode = currentFlow;
}
return checkStrictModeIdentifier(node);
- case 184:
+ case 185:
if (currentFlow && isNarrowableReference(node)) {
node.flowNode = currentFlow;
}
@@ -18945,7 +19050,7 @@ var ts;
bindSpecialPropertyDeclaration(node);
}
break;
- case 199:
+ case 200:
var specialKind = ts.getSpecialPropertyAssignmentKind(node);
switch (specialKind) {
case 1:
@@ -18972,127 +19077,127 @@ var ts;
ts.Debug.fail("Unknown special property assignment kind");
}
return checkStrictModeBinaryExpression(node);
- case 268:
+ case 269:
return checkStrictModeCatchClause(node);
- case 193:
+ case 194:
return checkStrictModeDeleteExpression(node);
case 8:
return checkStrictModeNumericLiteral(node);
- case 198:
+ case 199:
return checkStrictModePostfixUnaryExpression(node);
- case 197:
+ case 198:
return checkStrictModePrefixUnaryExpression(node);
- case 225:
+ case 226:
return checkStrictModeWithStatement(node);
- case 173:
+ case 174:
seenThisKeyword = true;
return;
- case 160:
+ case 161:
break;
- case 147:
- return bindTypeParameter(node);
case 148:
+ return bindTypeParameter(node);
+ case 149:
return bindParameter(node);
- case 231:
+ case 232:
return bindVariableDeclarationOrBindingElement(node);
- case 181:
+ case 182:
node.flowNode = currentFlow;
return bindVariableDeclarationOrBindingElement(node);
+ case 152:
case 151:
- case 150:
return bindPropertyWorker(node);
- case 269:
case 270:
+ case 271:
return bindPropertyOrMethodOrAccessor(node, 4, 0);
- case 272:
+ case 273:
return bindPropertyOrMethodOrAccessor(node, 8, 68008959);
- case 157:
case 158:
case 159:
+ case 160:
return declareSymbolAndAddToSymbolTable(node, 131072, 0);
- case 153:
- case 152:
- return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 16777216 : 0), ts.isObjectLiteralMethod(node) ? 0 : 67208127);
- case 233:
- return bindFunctionDeclaration(node);
case 154:
- return declareSymbolAndAddToSymbolTable(node, 16384, 0);
+ case 153:
+ return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 16777216 : 0), ts.isObjectLiteralMethod(node) ? 0 : 67208127);
+ case 234:
+ return bindFunctionDeclaration(node);
case 155:
- return bindPropertyOrMethodOrAccessor(node, 32768, 67150783);
+ return declareSymbolAndAddToSymbolTable(node, 16384, 0);
case 156:
+ return bindPropertyOrMethodOrAccessor(node, 32768, 67150783);
+ case 157:
return bindPropertyOrMethodOrAccessor(node, 65536, 67183551);
- case 162:
- case 283:
- case 287:
case 163:
+ case 284:
+ case 288:
+ case 164:
return bindFunctionOrConstructorType(node);
- case 165:
- case 286:
- case 176:
+ case 166:
+ case 287:
+ case 177:
return bindAnonymousTypeWorker(node);
- case 183:
+ case 184:
return bindObjectLiteralExpression(node);
- case 191:
case 192:
+ case 193:
return bindFunctionExpression(node);
- case 186:
+ case 187:
if (ts.isInJavaScriptFile(node)) {
bindCallExpression(node);
}
break;
- case 204:
- case 234:
+ case 205:
+ case 235:
inStrictMode = true;
return bindClassLikeDeclaration(node);
- case 235:
- return bindBlockScopedDeclaration(node, 64, 67901832);
case 236:
- return bindBlockScopedDeclaration(node, 524288, 67901928);
+ return bindBlockScopedDeclaration(node, 64, 67901832);
case 237:
- return bindEnumDeclaration(node);
+ return bindBlockScopedDeclaration(node, 524288, 67901928);
case 238:
+ return bindEnumDeclaration(node);
+ case 239:
return bindModuleDeclaration(node);
- case 262:
+ case 263:
return bindJsxAttributes(node);
- case 261:
+ case 262:
return bindJsxAttribute(node, 4, 0);
- case 242:
- case 245:
- case 247:
- case 251:
- return declareSymbolAndAddToSymbolTable(node, 2097152, 2097152);
- case 241:
- return bindNamespaceExportDeclaration(node);
- case 244:
- return bindImportClause(node);
- case 249:
- return bindExportDeclaration(node);
+ case 243:
+ case 246:
case 248:
+ case 252:
+ return declareSymbolAndAddToSymbolTable(node, 2097152, 2097152);
+ case 242:
+ return bindNamespaceExportDeclaration(node);
+ case 245:
+ return bindImportClause(node);
+ case 250:
+ return bindExportDeclaration(node);
+ case 249:
return bindExportAssignment(node);
- case 273:
+ case 274:
updateStrictModeStatementList(node.statements);
return bindSourceFileIfExternalModule();
- case 212:
+ case 213:
if (!ts.isFunctionLike(node.parent)) {
return;
}
- case 239:
+ case 240:
return updateStrictModeStatementList(node.statements);
- case 292:
- if (node.parent.kind === 287) {
+ case 293:
+ if (node.parent.kind === 288) {
return bindParameter(node);
}
- if (node.parent.kind !== 286) {
+ if (node.parent.kind !== 287) {
break;
}
- case 297:
+ case 298:
var propTag = node;
- var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 282 ?
+ var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 283 ?
4 | 16777216 :
4;
return declareSymbolAndAddToSymbolTable(propTag, flags, 0);
- case 296:
- case 291:
+ case 297:
+ case 292:
return (delayedTypeAliases || (delayedTypeAliases = [])).push(node);
}
}
@@ -19122,7 +19227,7 @@ var ts;
bindAnonymousDeclaration(node, 2097152, getDeclarationName(node));
}
else {
- var flags = node.kind === 248 && ts.exportAssignmentIsAlias(node)
+ var flags = node.kind === 249 && ts.exportAssignmentIsAlias(node)
? 2097152
: 4;
declareSymbol(container.symbol.exports, container.symbol, node, flags, 67108863);
@@ -19132,7 +19237,7 @@ var ts;
if (node.modifiers && node.modifiers.length) {
file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Modifiers_cannot_appear_here));
}
- if (node.parent.kind !== 273) {
+ if (node.parent.kind !== 274) {
file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_at_top_level));
return;
}
@@ -19174,13 +19279,11 @@ var ts;
function bindExportsPropertyAssignment(node) {
setCommonJsModuleIndicator(node);
var lhs = node.left;
- var symbol = forEachIdentifierInEntityName(lhs.expression, function (id, original) {
- if (!original) {
- return undefined;
+ var symbol = forEachIdentifierInEntityName(lhs.expression, undefined, function (id, symbol) {
+ if (symbol) {
+ addDeclarationToSymbol(symbol, id, 1536 | 67108864);
}
- var s = ts.getJSInitializerSymbol(original);
- addDeclarationToSymbol(s, id, 1536 | 67108864);
- return s;
+ return symbol;
});
if (symbol) {
var flags = ts.isClassExpression(node.right) ?
@@ -19205,13 +19308,13 @@ var ts;
ts.Debug.assert(ts.isInJavaScriptFile(node));
var thisContainer = ts.getThisContainer(node, false);
switch (thisContainer.kind) {
- case 233:
- case 191:
+ case 234:
+ case 192:
var constructorSymbol = thisContainer.symbol;
if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 58) {
var l = thisContainer.parent.left;
if (ts.isPropertyAccessEntityNameExpression(l) && ts.isPrototypeAccess(l.expression)) {
- constructorSymbol = getJSInitializerSymbolFromName(l.expression.expression, thisParentContainer);
+ constructorSymbol = lookupSymbolForPropertyAccess(l.expression.expression, thisParentContainer);
}
}
if (constructorSymbol) {
@@ -19219,16 +19322,16 @@ var ts;
declareSymbol(constructorSymbol.members, constructorSymbol, node, 4, 0 & ~4);
}
break;
- case 154:
- case 151:
- case 153:
case 155:
+ case 152:
+ case 154:
case 156:
+ case 157:
var containingClass = thisContainer.parent;
var symbolTable = ts.hasModifier(thisContainer, 32) ? containingClass.symbol.exports : containingClass.symbol.members;
declareSymbol(symbolTable, containingClass.symbol, node, 4, 0, true);
break;
- case 273:
+ case 274:
break;
default:
ts.Debug.fail(ts.Debug.showSyntaxKind(thisContainer));
@@ -19238,7 +19341,7 @@ var ts;
if (node.expression.kind === 99) {
bindThisPropertyAssignment(node);
}
- else if (ts.isPropertyAccessEntityNameExpression(node) && node.parent.parent.kind === 273) {
+ else if (ts.isPropertyAccessEntityNameExpression(node) && node.parent.parent.kind === 274) {
if (ts.isPrototypeAccess(node.expression)) {
bindPrototypePropertyAssignment(node, node.parent);
}
@@ -19276,39 +19379,52 @@ var ts;
node.expression.parent = node;
bindPropertyAssignment(node.expression, node, false);
}
- function getJSInitializerSymbolFromName(name, lookupContainer) {
- return ts.getJSInitializerSymbol(lookupSymbolForPropertyAccess(name, lookupContainer));
- }
function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty) {
- var symbol = getJSInitializerSymbolFromName(name);
+ var namespaceSymbol = lookupSymbolForPropertyAccess(name);
var isToplevelNamespaceableInitializer = ts.isBinaryExpression(propertyAccess.parent)
- ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 273 &&
+ ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 274 &&
!!ts.getJavascriptInitializer(ts.getInitializerOfBinaryExpression(propertyAccess.parent), ts.isPrototypeAccess(propertyAccess.parent.left))
- : propertyAccess.parent.parent.kind === 273;
- if (!isPrototypeProperty && (!symbol || !(symbol.flags & 1920)) && isToplevelNamespaceableInitializer) {
+ : propertyAccess.parent.parent.kind === 274;
+ if (!isPrototypeProperty && (!namespaceSymbol || !(namespaceSymbol.flags & 1920)) && isToplevelNamespaceableInitializer) {
var flags_1 = 1536 | 67108864;
var excludeFlags_1 = 67215503 & ~67108864;
- forEachIdentifierInEntityName(propertyAccess.expression, function (id, original) {
- if (original) {
- addDeclarationToSymbol(original, id, flags_1);
- return original;
+ namespaceSymbol = forEachIdentifierInEntityName(propertyAccess.expression, namespaceSymbol, function (id, symbol, parent) {
+ if (symbol) {
+ addDeclarationToSymbol(symbol, id, flags_1);
+ return symbol;
}
else {
- return symbol = declareSymbol(symbol ? symbol.exports : container.locals, symbol, id, flags_1, excludeFlags_1);
+ return declareSymbol(parent ? parent.exports : container.locals, parent, id, flags_1, excludeFlags_1);
}
});
}
- if (!symbol || !(symbol.flags & (16 | 32 | 1024 | 4096))) {
+ if (!namespaceSymbol || !isJavascriptContainer(namespaceSymbol)) {
return;
}
var symbolTable = isPrototypeProperty ?
- (symbol.members || (symbol.members = ts.createSymbolTable())) :
- (symbol.exports || (symbol.exports = ts.createSymbolTable()));
+ (namespaceSymbol.members || (namespaceSymbol.members = ts.createSymbolTable())) :
+ (namespaceSymbol.exports || (namespaceSymbol.exports = ts.createSymbolTable()));
var jsContainerFlag = isToplevelNamespaceableInitializer ? 67108864 : 0;
var isMethod = ts.isFunctionLikeDeclaration(ts.getAssignedJavascriptInitializer(propertyAccess));
var symbolFlags = (isMethod ? 8192 : 4) | jsContainerFlag;
var symbolExcludes = (isMethod ? 67208127 : 0) & ~jsContainerFlag;
- declareSymbol(symbolTable, symbol, propertyAccess, symbolFlags, symbolExcludes);
+ declareSymbol(symbolTable, namespaceSymbol, propertyAccess, symbolFlags, symbolExcludes);
+ }
+ function isJavascriptContainer(symbol) {
+ if (symbol.flags & (16 | 32 | 1024)) {
+ return true;
+ }
+ var node = symbol.valueDeclaration;
+ var init = !node ? undefined :
+ ts.isVariableDeclaration(node) ? node.initializer :
+ ts.isBinaryExpression(node) ? node.right :
+ ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) ? node.parent.right :
+ undefined;
+ if (init) {
+ var isPrototypeAssignment = ts.isPrototypeAccess(ts.isVariableDeclaration(node) ? node.name : ts.isBinaryExpression(node) ? node.left : node);
+ return !!ts.getJavascriptInitializer(ts.isBinaryExpression(init) && init.operatorToken.kind === 54 ? init.right : init, isPrototypeAssignment);
+ }
+ return false;
}
function getParentOfBinaryExpression(expr) {
while (ts.isBinaryExpression(expr.parent)) {
@@ -19322,21 +19438,22 @@ var ts;
return lookupSymbolForNameWorker(lookupContainer, node.escapedText);
}
else {
- var symbol = ts.getJSInitializerSymbol(lookupSymbolForPropertyAccess(node.expression));
+ var symbol = lookupSymbolForPropertyAccess(node.expression);
return symbol && symbol.exports && symbol.exports.get(node.name.escapedText);
}
}
- function forEachIdentifierInEntityName(e, action) {
+ function forEachIdentifierInEntityName(e, parent, action) {
if (isExportsOrModuleExportsOrAlias(file, e)) {
return file.symbol;
}
else if (ts.isIdentifier(e)) {
- return action(e, lookupSymbolForPropertyAccess(e));
+ return action(e, lookupSymbolForPropertyAccess(e), parent);
}
else {
- var s = ts.getJSInitializerSymbol(forEachIdentifierInEntityName(e.expression, action));
- ts.Debug.assert(!!s && !!s.exports);
- return action(e.name, s.exports.get(e.name.escapedText));
+ var s = forEachIdentifierInEntityName(e.expression, parent, action);
+ if (!s || !s.exports)
+ return ts.Debug.fail();
+ return action(e.name, s.exports.get(e.name.escapedText), s);
}
}
function bindCallExpression(node) {
@@ -19345,7 +19462,7 @@ var ts;
}
}
function bindClassLikeDeclaration(node) {
- if (node.kind === 234) {
+ if (node.kind === 235) {
bindBlockScopedDeclaration(node, 32, 68008383);
}
else {
@@ -19389,7 +19506,7 @@ var ts;
}
}
function bindParameter(node) {
- if (node.kind === 292 && container.kind !== 287) {
+ if (node.kind === 293 && container.kind !== 288) {
return;
}
if (inStrictMode && !(node.flags & 4194304)) {
@@ -19462,7 +19579,7 @@ var ts;
declareSymbolAndAddToSymbolTable(node, 262144, 67639784);
}
}
- else if (node.parent.kind === 171) {
+ else if (node.parent.kind === 172) {
var container_2 = getInferTypeContainer(node.parent);
if (container_2) {
if (!container_2.locals) {
@@ -19480,26 +19597,26 @@ var ts;
}
function shouldReportErrorOnModuleDeclaration(node) {
var instanceState = getModuleInstanceState(node);
- return instanceState === 1 || (instanceState === 2 && options.preserveConstEnums);
+ return instanceState === 1 || (instanceState === 2 && !!options.preserveConstEnums);
}
function checkUnreachable(node) {
if (!(currentFlow.flags & 1)) {
return false;
}
if (currentFlow === unreachableFlow) {
- var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 214) ||
- node.kind === 234 ||
- (node.kind === 238 && shouldReportErrorOnModuleDeclaration(node)) ||
- (node.kind === 237 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums));
+ var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 215) ||
+ node.kind === 235 ||
+ (node.kind === 239 && shouldReportErrorOnModuleDeclaration(node)) ||
+ (node.kind === 238 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums));
if (reportError) {
currentFlow = reportedUnreachableFlow;
- var reportUnreachableCode = !options.allowUnreachableCode &&
- !(node.flags & 4194304) &&
- (node.kind !== 213 ||
- ts.getCombinedNodeFlags(node.declarationList) & 3 ||
- ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; }));
- if (reportUnreachableCode) {
- errorOnFirstToken(node, ts.Diagnostics.Unreachable_code_detected);
+ if (!options.allowUnreachableCode) {
+ var isError = ts.unreachableCodeIsError(options) &&
+ !(node.flags & 4194304) &&
+ (!ts.isVariableStatement(node) ||
+ !!(ts.getCombinedNodeFlags(node.declarationList) & 3) ||
+ node.declarationList.declarations.some(function (d) { return !!d.initializer; }));
+ errorOrSuggestionOnFirstToken(isError, node, ts.Diagnostics.Unreachable_code_detected);
}
}
}
@@ -19514,8 +19631,8 @@ var ts;
ts.isExportsOrModuleExportsOrAlias = isExportsOrModuleExportsOrAlias;
function isNameOfExportsOrModuleExportsAliasDeclaration(sourceFile, node) {
var symbol = lookupSymbolForNameWorker(sourceFile, node.escapedText);
- return symbol && symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) &&
- symbol.valueDeclaration.initializer && isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, symbol.valueDeclaration.initializer);
+ return !!symbol && !!symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) &&
+ !!symbol.valueDeclaration.initializer && isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, symbol.valueDeclaration.initializer);
}
function isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node) {
return isExportsOrModuleExportsOrAlias(sourceFile, node) ||
@@ -19531,58 +19648,58 @@ var ts;
function computeTransformFlagsForNode(node, subtreeFlags) {
var kind = node.kind;
switch (kind) {
- case 186:
- return computeCallExpression(node, subtreeFlags);
case 187:
+ return computeCallExpression(node, subtreeFlags);
+ case 188:
return computeNewExpression(node, subtreeFlags);
- case 238:
+ case 239:
return computeModuleDeclaration(node, subtreeFlags);
- case 190:
- return computeParenthesizedExpression(node, subtreeFlags);
- case 199:
- return computeBinaryExpression(node, subtreeFlags);
- case 215:
- return computeExpressionStatement(node, subtreeFlags);
- case 148:
- return computeParameter(node, subtreeFlags);
- case 192:
- return computeArrowFunction(node, subtreeFlags);
case 191:
+ return computeParenthesizedExpression(node, subtreeFlags);
+ case 200:
+ return computeBinaryExpression(node, subtreeFlags);
+ case 216:
+ return computeExpressionStatement(node, subtreeFlags);
+ case 149:
+ return computeParameter(node, subtreeFlags);
+ case 193:
+ return computeArrowFunction(node, subtreeFlags);
+ case 192:
return computeFunctionExpression(node, subtreeFlags);
- case 233:
- return computeFunctionDeclaration(node, subtreeFlags);
- case 231:
- return computeVariableDeclaration(node, subtreeFlags);
- case 232:
- return computeVariableDeclarationList(node, subtreeFlags);
- case 213:
- return computeVariableStatement(node, subtreeFlags);
- case 227:
- return computeLabeledStatement(node, subtreeFlags);
case 234:
+ return computeFunctionDeclaration(node, subtreeFlags);
+ case 232:
+ return computeVariableDeclaration(node, subtreeFlags);
+ case 233:
+ return computeVariableDeclarationList(node, subtreeFlags);
+ case 214:
+ return computeVariableStatement(node, subtreeFlags);
+ case 228:
+ return computeLabeledStatement(node, subtreeFlags);
+ case 235:
return computeClassDeclaration(node, subtreeFlags);
- case 204:
+ case 205:
return computeClassExpression(node, subtreeFlags);
- case 267:
- return computeHeritageClause(node, subtreeFlags);
case 268:
+ return computeHeritageClause(node, subtreeFlags);
+ case 269:
return computeCatchClause(node, subtreeFlags);
- case 206:
+ case 207:
return computeExpressionWithTypeArguments(node, subtreeFlags);
- case 154:
- return computeConstructor(node, subtreeFlags);
- case 151:
- return computePropertyDeclaration(node, subtreeFlags);
- case 153:
- return computeMethod(node, subtreeFlags);
case 155:
+ return computeConstructor(node, subtreeFlags);
+ case 152:
+ return computePropertyDeclaration(node, subtreeFlags);
+ case 154:
+ return computeMethod(node, subtreeFlags);
case 156:
+ case 157:
return computeAccessor(node, subtreeFlags);
- case 242:
+ case 243:
return computeImportEquals(node, subtreeFlags);
- case 184:
- return computePropertyAccess(node, subtreeFlags);
case 185:
+ return computePropertyAccess(node, subtreeFlags);
+ case 186:
return computeElementAccess(node, subtreeFlags);
default:
return computeOther(node, kind, subtreeFlags);
@@ -19626,10 +19743,10 @@ var ts;
var transformFlags = subtreeFlags;
var operatorTokenKind = node.operatorToken.kind;
var leftKind = node.left.kind;
- if (operatorTokenKind === 58 && leftKind === 183) {
+ if (operatorTokenKind === 58 && leftKind === 184) {
transformFlags |= 8 | 192 | 3072;
}
- else if (operatorTokenKind === 58 && leftKind === 182) {
+ else if (operatorTokenKind === 58 && leftKind === 183) {
transformFlags |= 192 | 3072;
}
else if (operatorTokenKind === 40
@@ -19667,8 +19784,8 @@ var ts;
var expression = node.expression;
var expressionKind = expression.kind;
var expressionTransformFlags = expression.transformFlags;
- if (expressionKind === 207
- || expressionKind === 189) {
+ if (expressionKind === 208
+ || expressionKind === 190) {
transformFlags |= 3;
}
if (expressionTransformFlags & 1024) {
@@ -19967,12 +20084,12 @@ var ts;
var excludeFlags = 939525441;
switch (kind) {
case 120:
- case 196:
+ case 197:
transformFlags |= 8 | 16;
break;
- case 189:
- case 207:
- case 300:
+ case 190:
+ case 208:
+ case 301:
transformFlags |= 3;
excludeFlags = 536872257;
break;
@@ -19982,17 +20099,16 @@ var ts;
case 117:
case 124:
case 76:
- case 237:
- case 272:
- case 208:
+ case 238:
+ case 273:
+ case 209:
case 132:
transformFlags |= 3;
break;
- case 254:
case 255:
case 256:
- case 10:
case 257:
+ case 10:
case 258:
case 259:
case 260:
@@ -20000,17 +20116,18 @@ var ts;
case 262:
case 263:
case 264:
+ case 265:
transformFlags |= 4;
break;
case 13:
case 14:
case 15:
case 16:
- case 201:
- case 188:
- case 270:
+ case 202:
+ case 189:
+ case 271:
case 115:
- case 209:
+ case 210:
transformFlags |= 192;
break;
case 9:
@@ -20023,13 +20140,13 @@ var ts;
transformFlags |= 192;
}
break;
- case 221:
+ case 222:
if (node.awaitModifier) {
transformFlags |= 8;
}
transformFlags |= 192;
break;
- case 202:
+ case 203:
transformFlags |= 8 | 192 | 16777216;
break;
case 119:
@@ -20040,10 +20157,9 @@ var ts;
case 122:
case 138:
case 105:
- case 147:
- case 150:
- case 152:
- case 157:
+ case 148:
+ case 151:
+ case 153:
case 158:
case 159:
case 160:
@@ -20059,27 +20175,28 @@ var ts;
case 170:
case 171:
case 172:
- case 235:
- case 236:
case 173:
+ case 236:
+ case 237:
case 174:
case 175:
case 176:
case 177:
- case 241:
+ case 178:
+ case 242:
transformFlags = 3;
excludeFlags = -3;
break;
- case 146:
+ case 147:
transformFlags |= 2097152;
if (subtreeFlags & 16384) {
transformFlags |= 65536;
}
break;
- case 203:
+ case 204:
transformFlags |= 192 | 524288;
break;
- case 271:
+ case 272:
transformFlags |= 8 | 1048576;
break;
case 97:
@@ -20089,27 +20206,27 @@ var ts;
case 99:
transformFlags |= 16384;
break;
- case 179:
+ case 180:
transformFlags |= 192 | 8388608;
if (subtreeFlags & 524288) {
transformFlags |= 8 | 1048576;
}
excludeFlags = 940049729;
break;
- case 180:
+ case 181:
transformFlags |= 192 | 8388608;
excludeFlags = 940049729;
break;
- case 181:
+ case 182:
transformFlags |= 192;
if (node.dotDotDotToken) {
transformFlags |= 524288;
}
break;
- case 149:
+ case 150:
transformFlags |= 3 | 4096;
break;
- case 183:
+ case 184:
excludeFlags = 942740801;
if (subtreeFlags & 2097152) {
transformFlags |= 192;
@@ -20121,29 +20238,31 @@ var ts;
transformFlags |= 8;
}
break;
- case 182:
- case 187:
+ case 183:
+ case 188:
excludeFlags = 940049729;
if (subtreeFlags & 524288) {
transformFlags |= 192;
}
break;
- case 217:
case 218:
case 219:
case 220:
+ case 221:
if (subtreeFlags & 4194304) {
transformFlags |= 192;
}
break;
- case 273:
+ case 274:
if (subtreeFlags & 32768) {
transformFlags |= 192;
}
break;
- case 224:
- case 222:
+ case 225:
+ transformFlags |= 33554432 | 8;
+ break;
case 223:
+ case 224:
transformFlags |= 33554432;
break;
}
@@ -20151,33 +20270,33 @@ var ts;
return transformFlags & ~excludeFlags;
}
function getTransformFlagsSubtreeExclusions(kind) {
- if (kind >= 160 && kind <= 178) {
+ if (kind >= 161 && kind <= 179) {
return -3;
}
switch (kind) {
- case 186:
case 187:
- case 182:
+ case 188:
+ case 183:
return 940049729;
- case 238:
+ case 239:
return 977327425;
- case 148:
+ case 149:
return 939525441;
- case 192:
+ case 193:
return 1003902273;
- case 191:
- case 233:
- return 1003935041;
- case 232:
- return 948962625;
+ case 192:
case 234:
- case 204:
+ return 1003935041;
+ case 233:
+ return 948962625;
+ case 235:
+ case 205:
return 942011713;
- case 154:
- return 1003668801;
- case 153:
case 155:
+ return 1003668801;
+ case 154:
case 156:
+ case 157:
return 1003668801;
case 119:
case 134:
@@ -20187,30 +20306,30 @@ var ts;
case 122:
case 138:
case 105:
- case 147:
- case 150:
- case 152:
- case 157:
+ case 148:
+ case 151:
+ case 153:
case 158:
case 159:
- case 235:
+ case 160:
case 236:
+ case 237:
return -3;
- case 183:
+ case 184:
return 942740801;
- case 268:
+ case 269:
return 940574017;
- case 179:
case 180:
+ case 181:
return 940049729;
- case 189:
- case 207:
- case 300:
case 190:
+ case 208:
+ case 301:
+ case 191:
case 97:
return 536872257;
- case 184:
case 185:
+ case 186:
return 671089985;
default:
return 939525441;
@@ -20263,7 +20382,7 @@ var ts;
var shouldBail = visitSymbol(type.symbol);
if (shouldBail)
return;
- if (type.flags & 65536) {
+ if (type.flags & 131072) {
var objectType = type;
var objectFlags = objectType.objectFlags;
if (objectFlags & 4) {
@@ -20279,16 +20398,16 @@ var ts;
visitObjectType(objectType);
}
}
- if (type.flags & 32768) {
+ if (type.flags & 65536) {
visitTypeParameter(type);
}
- if (type.flags & 393216) {
+ if (type.flags & 786432) {
visitUnionOrIntersectionType(type);
}
- if (type.flags & 524288) {
+ if (type.flags & 1048576) {
visitIndexType(type);
}
- if (type.flags & 1048576) {
+ if (type.flags & 2097152) {
visitIndexedAccessType(type);
}
}
@@ -20356,11 +20475,11 @@ var ts;
}
function visitSymbol(symbol) {
if (!symbol) {
- return;
+ return false;
}
var symbolId = ts.getSymbolId(symbol);
if (visitedSymbols[symbolId]) {
- return;
+ return false;
}
visitedSymbols[symbolId] = symbol;
if (!accept(symbol)) {
@@ -20372,12 +20491,13 @@ var ts;
symbol.exports.forEach(visitSymbol);
}
ts.forEach(symbol.declarations, function (d) {
- if (d.type && d.type.kind === 164) {
+ if (d.type && d.type.kind === 165) {
var query = d.type;
var entity = getResolvedSymbol(getFirstIdentifier(query.exprName));
visitSymbol(entity);
}
});
+ return false;
}
}
}
@@ -20390,7 +20510,7 @@ var ts;
}
ts.trace = trace;
function isTraceEnabled(compilerOptions, host) {
- return compilerOptions.traceResolution && host.trace !== undefined;
+ return !!compilerOptions.traceResolution && host.trace !== undefined;
}
ts.isTraceEnabled = isTraceEnabled;
function withPackageId(packageId, r) {
@@ -20551,14 +20671,13 @@ var ts;
}
}
function secondaryLookup() {
- var resolvedFile;
var initialLocationForSecondaryLookup = containingFile && ts.getDirectoryPath(containingFile);
if (initialLocationForSecondaryLookup !== undefined) {
if (traceEnabled) {
trace(host, ts.Diagnostics.Looking_up_in_node_modules_folder_initial_location_0, initialLocationForSecondaryLookup);
}
var result = loadModuleFromNodeModules(Extensions.DtsOnly, typeReferenceDirectiveName, initialLocationForSecondaryLookup, failedLookupLocations, moduleResolutionState, undefined);
- resolvedFile = resolvedTypeScriptOnly(result && result.value);
+ var resolvedFile = resolvedTypeScriptOnly(result && result.value);
if (!resolvedFile && traceEnabled) {
trace(host, ts.Diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName);
}
@@ -20710,7 +20829,7 @@ var ts;
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache);
break;
default:
- ts.Debug.fail("Unexpected moduleResolution: " + moduleResolution);
+ return ts.Debug.fail("Unexpected moduleResolution: " + moduleResolution);
}
if (perFolderCache) {
perFolderCache.set(moduleName, result);
@@ -20888,7 +21007,7 @@ var ts;
var originalPath = void 0;
if (!compilerOptions.preserveSymlinks && resolvedValue) {
originalPath = resolvedValue.path;
- var path = realPath(resolved_1.value.path, host, traceEnabled);
+ var path = realPath(resolvedValue.path, host, traceEnabled);
if (path === originalPath) {
originalPath = undefined;
}
@@ -20988,7 +21107,7 @@ var ts;
function loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) {
if (extensions === Extensions.Json) {
var extensionLess = ts.tryRemoveExtension(candidate, ".json");
- return extensionLess && tryAddingExtensions(extensionLess, extensions, failedLookupLocations, onlyRecordFailures, state);
+ return extensionLess === undefined ? undefined : tryAddingExtensions(extensionLess, extensions, failedLookupLocations, onlyRecordFailures, state);
}
var resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, failedLookupLocations, onlyRecordFailures, state);
if (resolvedByAddingExtension) {
@@ -21022,7 +21141,7 @@ var ts;
}
function tryExtension(ext) {
var path = tryFile(candidate + ext, failedLookupLocations, onlyRecordFailures, state);
- return path && { path: path, ext: ext };
+ return path === undefined ? undefined : { path: path, ext: ext };
}
}
function tryFile(fileName, failedLookupLocations, onlyRecordFailures, state) {
@@ -21393,11 +21512,12 @@ var ts;
getGlobalDiagnostics: getGlobalDiagnostics,
getTypeOfSymbolAtLocation: function (symbol, location) {
location = ts.getParseTreeNode(location);
- return location ? getTypeOfSymbolAtLocation(symbol, location) : unknownType;
+ return location ? getTypeOfSymbolAtLocation(symbol, location) : errorType;
},
- getSymbolsOfParameterPropertyDeclaration: function (parameter, parameterName) {
- parameter = ts.getParseTreeNode(parameter, ts.isParameter);
- ts.Debug.assert(parameter !== undefined, "Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node.");
+ getSymbolsOfParameterPropertyDeclaration: function (parameterIn, parameterName) {
+ var parameter = ts.getParseTreeNode(parameterIn, ts.isParameter);
+ if (parameter === undefined)
+ return ts.Debug.fail("Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node.");
return getSymbolsOfParameterPropertyDeclaration(parameter, ts.escapeLeadingUnderscores(parameterName));
},
getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol,
@@ -21409,9 +21529,9 @@ var ts;
getBaseTypes: getBaseTypes,
getBaseTypeOfLiteralType: getBaseTypeOfLiteralType,
getWidenedType: getWidenedType,
- getTypeFromTypeNode: function (node) {
- node = ts.getParseTreeNode(node, ts.isTypeNode);
- return node ? getTypeFromTypeNode(node) : unknownType;
+ getTypeFromTypeNode: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isTypeNode);
+ return node ? getTypeFromTypeNode(node) : errorType;
},
getParameterType: getTypeAtPosition,
getReturnTypeOfSignature: getReturnTypeOfSignature,
@@ -21437,8 +21557,8 @@ var ts;
node = ts.getParseTreeNode(node);
return node ? getShorthandAssignmentValueSymbol(node) : undefined;
},
- getExportSpecifierLocalTargetSymbol: function (node) {
- node = ts.getParseTreeNode(node, ts.isExportSpecifier);
+ getExportSpecifierLocalTargetSymbol: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isExportSpecifier);
return node ? getExportSpecifierLocalTargetSymbol(node) : undefined;
},
getExportSymbolOfSymbol: function (symbol) {
@@ -21446,10 +21566,10 @@ var ts;
},
getTypeAtLocation: function (node) {
node = ts.getParseTreeNode(node);
- return node ? getTypeOfNode(node) : unknownType;
+ return node ? getTypeOfNode(node) : errorType;
},
- getPropertySymbolOfDestructuringAssignment: function (location) {
- location = ts.getParseTreeNode(location, ts.isIdentifier);
+ getPropertySymbolOfDestructuringAssignment: function (locationIn) {
+ var location = ts.getParseTreeNode(locationIn, ts.isIdentifier);
return location ? getPropertySymbolOfDestructuringAssignment(location) : undefined;
},
signatureToString: function (signature, enclosingDeclaration, flags, kind) {
@@ -21479,41 +21599,41 @@ var ts;
getSymbolDisplayBuilder: getSymbolDisplayBuilder,
getAugmentedPropertiesOfType: getAugmentedPropertiesOfType,
getRootSymbols: getRootSymbols,
- getContextualType: function (node) {
- node = ts.getParseTreeNode(node, ts.isExpression);
+ getContextualType: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isExpression);
return node ? getContextualType(node) : undefined;
},
- getContextualTypeForArgumentAtIndex: function (node, argIndex) {
- node = ts.getParseTreeNode(node, ts.isCallLikeExpression);
+ getContextualTypeForArgumentAtIndex: function (nodeIn, argIndex) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isCallLikeExpression);
return node && getContextualTypeForArgumentAtIndex(node, argIndex);
},
- getContextualTypeForJsxAttribute: function (node) {
- node = ts.getParseTreeNode(node, ts.isJsxAttributeLike);
+ getContextualTypeForJsxAttribute: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isJsxAttributeLike);
return node && getContextualTypeForJsxAttribute(node);
},
isContextSensitive: isContextSensitive,
getFullyQualifiedName: getFullyQualifiedName,
- getResolvedSignature: function (node, candidatesOutArray, theArgumentCount) {
- node = ts.getParseTreeNode(node, ts.isCallLikeExpression);
+ getResolvedSignature: function (nodeIn, candidatesOutArray, theArgumentCount) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isCallLikeExpression);
apparentArgumentCount = theArgumentCount;
var res = node ? getResolvedSignature(node, candidatesOutArray) : undefined;
apparentArgumentCount = undefined;
return res;
},
- getConstantValue: function (node) {
- node = ts.getParseTreeNode(node, canHaveConstantValue);
+ getConstantValue: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, canHaveConstantValue);
return node ? getConstantValue(node) : undefined;
},
- isValidPropertyAccess: function (node, propertyName) {
- node = ts.getParseTreeNode(node, ts.isPropertyAccessOrQualifiedNameOrImportTypeNode);
+ isValidPropertyAccess: function (nodeIn, propertyName) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isPropertyAccessOrQualifiedNameOrImportTypeNode);
return !!node && isValidPropertyAccess(node, ts.escapeLeadingUnderscores(propertyName));
},
- isValidPropertyAccessForCompletions: function (node, type, property) {
- node = ts.getParseTreeNode(node, ts.isPropertyAccessExpression);
+ isValidPropertyAccessForCompletions: function (nodeIn, type, property) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isPropertyAccessExpression);
return !!node && isValidPropertyAccessForCompletions(node, type, property);
},
- getSignatureFromDeclaration: function (declaration) {
- declaration = ts.getParseTreeNode(declaration, ts.isFunctionLike);
+ getSignatureFromDeclaration: function (declarationIn) {
+ var declaration = ts.getParseTreeNode(declarationIn, ts.isFunctionLike);
return declaration ? getSignatureFromDeclaration(declaration) : undefined;
},
isImplementationOfOverload: function (node) {
@@ -21525,7 +21645,8 @@ var ts;
var links = getSymbolLinks(symbol);
if (!links.immediateTarget) {
var node = getDeclarationOfAliasSymbol(symbol);
- ts.Debug.assert(!!node);
+ if (!node)
+ return ts.Debug.fail();
links.immediateTarget = getTargetOfAliasDeclaration(node, true);
}
return links.immediateTarget;
@@ -21536,13 +21657,13 @@ var ts;
getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule,
getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier),
getAmbientModules: getAmbientModules,
- getAllAttributesTypeFromJsxOpeningLikeElement: function (node) {
- node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement);
+ getAllAttributesTypeFromJsxOpeningLikeElement: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isJsxOpeningLikeElement);
return node ? getAllAttributesTypeFromJsxOpeningLikeElement(node) : undefined;
},
getJsxIntrinsicTagNamesAt: getJsxIntrinsicTagNamesAt,
- isOptionalParameter: function (node) {
- node = ts.getParseTreeNode(node, ts.isParameter);
+ isOptionalParameter: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isParameter);
return node ? isOptionalParameter(node) : false;
},
tryGetMemberInModuleExports: function (name, symbol) { return tryGetMemberInModuleExports(ts.escapeLeadingUnderscores(name), symbol); },
@@ -21574,7 +21695,7 @@ var ts;
getSuggestionForNonexistentSymbol: function (location, name, meaning) { return getSuggestionForNonexistentSymbol(location, ts.escapeLeadingUnderscores(name), meaning); },
getSuggestionForNonexistentModule: function (node, target) { return getSuggestionForNonexistentModule(node, target); },
getBaseConstraintOfType: getBaseConstraintOfType,
- getDefaultFromTypeParameter: function (type) { return type && type.flags & 32768 ? getDefaultFromTypeParameter(type) : undefined; },
+ getDefaultFromTypeParameter: function (type) { return type && type.flags & 65536 ? getDefaultFromTypeParameter(type) : undefined; },
resolveName: function (name, location, meaning, excludeGlobals) {
return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, undefined, undefined, false, excludeGlobals);
},
@@ -21586,24 +21707,31 @@ var ts;
node = ts.getParseTreeNode(node);
return node && tryGetThisTypeAt(node);
},
- getTypeArgumentConstraint: function (node) {
- node = ts.getParseTreeNode(node, ts.isTypeNode);
+ getTypeArgumentConstraint: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isTypeNode);
return node && getTypeArgumentConstraint(node);
},
- getSuggestionDiagnostics: function (file) {
- return (suggestionDiagnostics.get(file.fileName) || ts.emptyArray).concat(getUnusedDiagnostics());
- function getUnusedDiagnostics() {
- if (file.isDeclarationFile)
- return ts.emptyArray;
+ getSuggestionDiagnostics: function (file, ct) {
+ var diagnostics;
+ try {
+ cancellationToken = ct;
checkSourceFile(file);
- var diagnostics = [];
ts.Debug.assert(!!(getNodeLinks(file).flags & 1));
+ diagnostics = ts.addRange(diagnostics, suggestionDiagnostics.get(file.fileName));
+ if (!file.isDeclarationFile && (!unusedIsError(0) || !unusedIsError(1))) {
+ addUnusedDiagnostics();
+ }
+ return diagnostics || ts.emptyArray;
+ }
+ finally {
+ cancellationToken = undefined;
+ }
+ function addUnusedDiagnostics() {
checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(file), function (kind, diag) {
if (!unusedIsError(kind)) {
- diagnostics.push(__assign({}, diag, { category: ts.DiagnosticCategory.Suggestion }));
+ (diagnostics || (diagnostics = [])).push(__assign({}, diag, { category: ts.DiagnosticCategory.Suggestion }));
}
});
- return diagnostics;
}
},
runWithCancellationToken: function (token, callback) {
@@ -21628,22 +21756,23 @@ var ts;
var anyType = createIntrinsicType(1, "any");
var autoType = createIntrinsicType(1, "any");
var wildcardType = createIntrinsicType(1, "any");
- var unknownType = createIntrinsicType(1, "unknown");
- var undefinedType = createIntrinsicType(4096, "undefined");
- var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(4096 | 16777216, "undefined");
- var nullType = createIntrinsicType(8192, "null");
- var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(8192 | 16777216, "null");
- var stringType = createIntrinsicType(2, "string");
- var numberType = createIntrinsicType(4, "number");
- var trueType = createIntrinsicType(128, "true");
- var falseType = createIntrinsicType(128, "false");
+ var errorType = createIntrinsicType(1, "error");
+ var unknownType = createIntrinsicType(2, "unknown");
+ var undefinedType = createIntrinsicType(8192, "undefined");
+ var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(8192 | 134217728, "undefined");
+ var nullType = createIntrinsicType(16384, "null");
+ var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(16384 | 134217728, "null");
+ var stringType = createIntrinsicType(4, "string");
+ var numberType = createIntrinsicType(8, "number");
+ var trueType = createIntrinsicType(256, "true");
+ var falseType = createIntrinsicType(256, "false");
var booleanType = createBooleanType([trueType, falseType]);
- var esSymbolType = createIntrinsicType(512, "symbol");
- var voidType = createIntrinsicType(2048, "void");
- var neverType = createIntrinsicType(16384, "never");
- var silentNeverType = createIntrinsicType(16384, "never");
- var implicitNeverType = createIntrinsicType(16384, "never");
- var nonPrimitiveType = createIntrinsicType(134217728, "object");
+ var esSymbolType = createIntrinsicType(1024, "symbol");
+ var voidType = createIntrinsicType(4096, "void");
+ var neverType = createIntrinsicType(32768, "never");
+ var silentNeverType = createIntrinsicType(32768, "never");
+ var implicitNeverType = createIntrinsicType(32768, "never");
+ var nonPrimitiveType = createIntrinsicType(16777216, "object");
var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]);
var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType;
var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
@@ -21653,17 +21782,17 @@ var ts;
var emptyGenericType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
emptyGenericType.instantiations = ts.createMap();
var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
- anyFunctionType.flags |= 67108864;
+ anyFunctionType.flags |= 536870912;
var noConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
var circularConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
var resolvingDefaultType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
- var markerSuperType = createType(32768);
- var markerSubType = createType(32768);
+ var markerSuperType = createType(65536);
+ var markerSubType = createType(65536);
markerSubType.constraint = markerSuperType;
- var markerOtherType = createType(32768);
+ var markerOtherType = createType(65536);
var noTypePredicate = createIdentifierTypePredicate("<>", 0, anyType);
var anySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, undefined, 0, false, false);
- var unknownSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, unknownType, undefined, 0, false, false);
+ var unknownSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, errorType, undefined, 0, false, false);
var resolvingSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, undefined, 0, false, false);
var silentNeverSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, silentNeverType, undefined, 0, false, false);
var resolvingSignaturesArray = [resolvingSignature];
@@ -21773,6 +21902,7 @@ var ts;
typeToString(type, enclosingDeclaration, flags, emitTextWriterWrapper(writer));
},
buildSymbolDisplay: function (symbol, writer, enclosingDeclaration, meaning, flags) {
+ if (flags === void 0) { flags = 0; }
symbolToString(symbol, enclosingDeclaration, meaning, flags | 4, emitTextWriterWrapper(writer));
},
buildSignatureDisplay: function (signature, writer, enclosing, flags, kind) {
@@ -22022,15 +22152,17 @@ var ts;
function mergeSymbol(target, source) {
if (!(target.flags & getExcludedSymbolFlags(source.flags)) ||
(source.flags | target.flags) & 67108864) {
- var targetValueDeclaration = target.valueDeclaration;
- ts.Debug.assert(!!(target.flags & 33554432));
+ ts.Debug.assert(source !== target);
+ if (!(target.flags & 33554432)) {
+ target = cloneSymbol(target);
+ }
if (source.flags & 512 && target.flags & 512 && target.constEnumOnlyModule && !source.constEnumOnlyModule) {
target.constEnumOnlyModule = false;
}
target.flags |= source.flags;
if (source.valueDeclaration &&
(!target.valueDeclaration ||
- (target.valueDeclaration.kind === 238 && source.valueDeclaration.kind !== 238))) {
+ (target.valueDeclaration.kind === 239 && source.valueDeclaration.kind !== 239))) {
target.valueDeclaration = source.valueDeclaration;
}
ts.addRange(target.declarations, source.declarations);
@@ -22044,18 +22176,6 @@ var ts;
target.exports = ts.createSymbolTable();
mergeSymbolTable(target.exports, source.exports);
}
- if ((source.flags | target.flags) & 67108864) {
- var sourceInitializer = ts.getJSInitializerSymbol(source);
- var init = ts.getDeclaredJavascriptInitializer(targetValueDeclaration) || ts.getAssignedJavascriptInitializer(targetValueDeclaration);
- var targetInitializer = init && init.symbol ? init.symbol : target;
- if (!(targetInitializer.flags & 33554432)) {
- var mergedInitializer = getMergedSymbol(targetInitializer);
- targetInitializer = mergedInitializer === targetInitializer ? cloneSymbol(targetInitializer) : mergedInitializer;
- }
- if (sourceInitializer !== source || targetInitializer !== target) {
- mergeSymbol(targetInitializer, sourceInitializer);
- }
- }
recordMergedSymbol(target, source);
}
else if (target.flags & 1024) {
@@ -22076,11 +22196,12 @@ var ts;
error(errorNode, message_2, symbolToString(source));
});
}
+ return target;
}
function combineSymbolTables(first, second) {
- if (!first || first.size === 0)
+ if (!ts.hasEntries(first))
return second;
- if (!second || second.size === 0)
+ if (!ts.hasEntries(second))
return first;
var combined = ts.createSymbolTable();
mergeSymbolTable(combined, first);
@@ -22089,17 +22210,7 @@ var ts;
}
function mergeSymbolTable(target, source) {
source.forEach(function (sourceSymbol, id) {
- var targetSymbol = target.get(id);
- if (!targetSymbol) {
- target.set(id, sourceSymbol);
- }
- else {
- if (!(targetSymbol.flags & 33554432)) {
- targetSymbol = cloneSymbol(targetSymbol);
- target.set(id, targetSymbol);
- }
- mergeSymbol(targetSymbol, sourceSymbol);
- }
+ target.set(id, target.has(id) ? mergeSymbol(target.get(id), sourceSymbol) : sourceSymbol);
});
}
function mergeModuleAugmentation(moduleName) {
@@ -22121,8 +22232,7 @@ var ts;
}
mainModule = resolveExternalModuleSymbol(mainModule);
if (mainModule.flags & 1920) {
- mainModule = mainModule.flags & 33554432 ? mainModule : cloneSymbol(mainModule);
- mergeSymbol(mainModule, moduleAugmentation.symbol);
+ mainModule = mergeSymbol(mainModule, moduleAugmentation.symbol);
}
else {
error(moduleName, ts.Diagnostics.Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity, moduleName.text);
@@ -22154,7 +22264,7 @@ var ts;
return nodeLinks[nodeId] || (nodeLinks[nodeId] = { flags: 0 });
}
function isGlobalSourceFile(node) {
- return node.kind === 273 && !ts.isExternalOrCommonJsModule(node);
+ return node.kind === 274 && !ts.isExternalOrCommonJsModule(node);
}
function getSymbol(symbols, name, meaning) {
if (meaning) {
@@ -22181,7 +22291,7 @@ var ts;
if (parameterSymbol && propertySymbol) {
return [parameterSymbol, propertySymbol];
}
- ts.Debug.fail("There should exist two symbols, one as property declaration and one as parameter declaration");
+ return ts.Debug.fail("There should exist two symbols, one as property declaration and one as parameter declaration");
}
function isBlockScopedNameDeclaredBeforeUse(declaration, usage) {
var declarationFile = ts.getSourceFileOfNode(declaration);
@@ -22200,15 +22310,15 @@ var ts;
return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile);
}
if (declaration.pos <= usage.pos) {
- if (declaration.kind === 181) {
- var errorBindingElement = ts.getAncestor(usage, 181);
+ if (declaration.kind === 182) {
+ var errorBindingElement = ts.getAncestor(usage, 182);
if (errorBindingElement) {
return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) ||
declaration.pos < errorBindingElement.pos;
}
- return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 231), usage);
+ return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 232), usage);
}
- else if (declaration.kind === 231) {
+ else if (declaration.kind === 232) {
return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage);
}
else if (ts.isClassDeclaration(declaration)) {
@@ -22216,10 +22326,10 @@ var ts;
}
return true;
}
- if (usage.parent.kind === 251 || (usage.parent.kind === 248 && usage.parent.isExportEquals)) {
+ if (usage.parent.kind === 252 || (usage.parent.kind === 249 && usage.parent.isExportEquals)) {
return true;
}
- if (usage.kind === 248 && usage.isExportEquals) {
+ if (usage.kind === 249 && usage.isExportEquals) {
return true;
}
var container = ts.getEnclosingBlockScopeContainer(declaration);
@@ -22227,15 +22337,16 @@ var ts;
function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) {
var container = ts.getEnclosingBlockScopeContainer(declaration);
switch (declaration.parent.parent.kind) {
- case 213:
- case 219:
- case 221:
+ case 214:
+ case 220:
+ case 222:
if (isSameScopeDescendentOf(usage, declaration, container)) {
return true;
}
break;
}
- return ts.isForInOrOfStatement(declaration.parent.parent) && isSameScopeDescendentOf(usage, declaration.parent.parent.expression, container);
+ var grandparent = declaration.parent.parent;
+ return ts.isForInOrOfStatement(grandparent) && isSameScopeDescendentOf(usage, grandparent.expression, container);
}
function isUsedInFunctionOrInstanceProperty(usage, declaration, container) {
return !!ts.findAncestor(usage, function (current) {
@@ -22246,21 +22357,22 @@ var ts;
return true;
}
var initializerOfProperty = current.parent &&
- current.parent.kind === 151 &&
+ current.parent.kind === 152 &&
current.parent.initializer === current;
if (initializerOfProperty) {
if (ts.hasModifier(current.parent, 32)) {
- if (declaration.kind === 153) {
+ if (declaration.kind === 154) {
return true;
}
}
else {
- var isDeclarationInstanceProperty = declaration.kind === 151 && !ts.hasModifier(declaration, 32);
+ var isDeclarationInstanceProperty = declaration.kind === 152 && !ts.hasModifier(declaration, 32);
if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) {
return true;
}
}
}
+ return false;
});
}
}
@@ -22282,21 +22394,21 @@ var ts;
if (result = lookup(location.locals, name, meaning)) {
var useResult = true;
if (ts.isFunctionLike(location) && lastLocation && lastLocation !== location.body) {
- if (meaning & result.flags & 67901928 && lastLocation.kind !== 285) {
+ if (meaning & result.flags & 67901928 && lastLocation.kind !== 286) {
useResult = result.flags & 262144
? lastLocation === location.type ||
- lastLocation.kind === 148 ||
- lastLocation.kind === 147
+ lastLocation.kind === 149 ||
+ lastLocation.kind === 148
: false;
}
if (meaning & 67216319 && result.flags & 1) {
useResult =
- lastLocation.kind === 148 ||
+ lastLocation.kind === 149 ||
(lastLocation === location.type &&
!!ts.findAncestor(result.valueDeclaration, ts.isParameter));
}
}
- else if (location.kind === 170) {
+ else if (location.kind === 171) {
useResult = lastLocation === location.trueType;
}
if (useResult) {
@@ -22308,13 +22420,13 @@ var ts;
}
}
switch (location.kind) {
- case 273:
+ case 274:
if (!ts.isExternalOrCommonJsModule(location))
break;
isInExternalModule = true;
- case 238:
+ case 239:
var moduleExports = getSymbolOfNode(location).exports;
- if (location.kind === 273 || ts.isAmbientModule(location)) {
+ if (location.kind === 274 || ts.isAmbientModule(location)) {
if (result = moduleExports.get("default")) {
var localSymbol = ts.getLocalSymbolForExportDefault(result);
if (localSymbol && (result.flags & meaning) && localSymbol.escapedName === name) {
@@ -22325,21 +22437,26 @@ var ts;
var moduleExport = moduleExports.get(name);
if (moduleExport &&
moduleExport.flags === 2097152 &&
- ts.getDeclarationOfKind(moduleExport, 251)) {
+ ts.getDeclarationOfKind(moduleExport, 252)) {
break;
}
}
if (name !== "default" && (result = lookup(moduleExports, name, meaning & 2623475))) {
- break loop;
+ if (ts.isSourceFile(location) && location.commonJsModuleIndicator && !result.declarations.some(ts.isJSDocTypeAlias)) {
+ result = undefined;
+ }
+ else {
+ break loop;
+ }
}
break;
- case 237:
+ case 238:
if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8)) {
break loop;
}
break;
+ case 152:
case 151:
- case 150:
if (ts.isClassLike(location.parent) && !ts.hasModifier(location, 32)) {
var ctor = findConstructorDeclaration(location.parent);
if (ctor && ctor.locals) {
@@ -22349,9 +22466,9 @@ var ts;
}
}
break;
- case 234:
- case 204:
case 235:
+ case 205:
+ case 236:
if (result = lookup(getMembersOfSymbol(getSymbolOfNode(location)), name, meaning & 67901928)) {
if (!isTypeParameterSymbolDeclaredInContainer(result, location)) {
result = undefined;
@@ -22363,7 +22480,7 @@ var ts;
}
break loop;
}
- if (location.kind === 204 && meaning & 32) {
+ if (location.kind === 205 && meaning & 32) {
var className = location.name;
if (className && name === className.escapedText) {
result = location.symbol;
@@ -22371,7 +22488,7 @@ var ts;
}
}
break;
- case 206:
+ case 207:
if (lastLocation === location.expression && location.parent.token === 85) {
var container = location.parent.parent;
if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 67901928))) {
@@ -22382,28 +22499,28 @@ var ts;
}
}
break;
- case 146:
+ case 147:
grandparent = location.parent.parent;
- if (ts.isClassLike(grandparent) || grandparent.kind === 235) {
+ if (ts.isClassLike(grandparent) || grandparent.kind === 236) {
if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 67901928)) {
error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);
return undefined;
}
}
break;
- case 153:
- case 152:
case 154:
+ case 153:
case 155:
case 156:
- case 233:
- case 192:
+ case 157:
+ case 234:
+ case 193:
if (meaning & 3 && name === "arguments") {
result = argumentsSymbol;
break loop;
}
break;
- case 191:
+ case 192:
if (meaning & 3 && name === "arguments") {
result = argumentsSymbol;
break loop;
@@ -22416,19 +22533,18 @@ var ts;
}
}
break;
- case 149:
- if (location.parent && location.parent.kind === 148) {
+ case 150:
+ if (location.parent && location.parent.kind === 149) {
location = location.parent;
}
if (location.parent && ts.isClassElement(location.parent)) {
location = location.parent;
}
break;
- case 296:
- case 291:
- lastLocation = location;
- location = ts.getJSDocHost(location).parent;
- continue;
+ case 297:
+ case 292:
+ location = ts.getJSDocHost(location);
+ break;
}
if (isSelfReferenceLocation(location)) {
lastSelfReferenceLocation = location;
@@ -22441,7 +22557,7 @@ var ts;
}
if (!result) {
if (lastLocation) {
- ts.Debug.assert(lastLocation.kind === 273);
+ ts.Debug.assert(lastLocation.kind === 274);
if (lastLocation.commonJsModuleIndicator && name === "exports") {
return lastLocation.symbol;
}
@@ -22500,7 +22616,7 @@ var ts;
}
if (result && isInExternalModule && (meaning & 67216319) === 67216319 && !(originalLocation.flags & 2097152)) {
var decls = result.declarations;
- if (decls && decls.length === 1 && decls[0].kind === 241) {
+ if (decls && decls.length === 1 && decls[0].kind === 242) {
error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, ts.unescapeLeadingUnderscores(name));
}
}
@@ -22509,12 +22625,12 @@ var ts;
}
function isSelfReferenceLocation(node) {
switch (node.kind) {
- case 233:
case 234:
case 235:
- case 237:
case 236:
case 238:
+ case 237:
+ case 239:
return true;
default:
return false;
@@ -22526,7 +22642,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 === 147) {
+ if (decl.kind === 148) {
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));
@@ -22566,18 +22682,18 @@ var ts;
}
function checkAndReportErrorForExtendingInterface(errorLocation) {
var expression = getEntityNameForExtendingInterface(errorLocation);
- var isError = !!(expression && resolveEntityName(expression, 64, true));
- if (isError) {
+ if (expression && resolveEntityName(expression, 64, true)) {
error(errorLocation, ts.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements, ts.getTextOfNode(expression));
+ return true;
}
- return isError;
+ return false;
}
function getEntityNameForExtendingInterface(node) {
switch (node.kind) {
case 71:
- case 184:
+ case 185:
return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined;
- case 206:
+ case 207:
if (ts.isEntityNameExpression(node.expression)) {
return node.expression;
}
@@ -22639,8 +22755,9 @@ var ts;
}
function checkResolvedBlockScopedVariable(result, errorLocation) {
ts.Debug.assert(!!(result.flags & 2 || result.flags & 32 || result.flags & 384));
- var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 237) ? d : undefined; });
- ts.Debug.assert(declaration !== undefined, "Declaration to checkResolvedBlockScopedVariable is undefined");
+ var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 238) ? d : undefined; });
+ if (declaration === undefined)
+ return ts.Debug.fail("Declaration to checkResolvedBlockScopedVariable is undefined");
if (!(declaration.flags & 4194304) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) {
if (result.flags & 2) {
error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)));
@@ -22654,17 +22771,17 @@ var ts;
}
}
function isSameScopeDescendentOf(initial, parent, stopAt) {
- return parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; });
+ return !!parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; });
}
function getAnyImportSyntax(node) {
switch (node.kind) {
- case 242:
+ case 243:
return node;
- case 244:
- return node.parent;
case 245:
+ return node.parent;
+ case 246:
return node.parent.parent;
- case 247:
+ case 248:
return node.parent.parent.parent;
default:
return undefined;
@@ -22674,7 +22791,7 @@ var ts;
return ts.find(symbol.declarations, ts.isAliasSymbolDeclaration);
}
function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) {
- if (node.moduleReference.kind === 253) {
+ if (node.moduleReference.kind === 254) {
return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)));
}
return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias);
@@ -22686,7 +22803,7 @@ var ts;
: resolveSymbol(moduleSymbol.exports.get(name), dontResolveAlias);
}
function isSyntacticDefault(node) {
- return ((ts.isExportAssignment(node) && !node.isExportEquals) || ts.hasModifier(node, 512));
+ return ((ts.isExportAssignment(node) && !node.isExportEquals) || ts.hasModifier(node, 512) || ts.isExportSpecifier(node));
}
function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias) {
if (!allowSyntheticDefaultImports) {
@@ -22764,6 +22881,7 @@ var ts;
}
}
function getExternalModuleMember(node, specifier, dontResolveAlias) {
+ if (dontResolveAlias === void 0) { dontResolveAlias = false; }
var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier);
var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier, dontResolveAlias);
if (targetSymbol) {
@@ -22826,33 +22944,35 @@ var ts;
return getNodeLinks(expression).resolvedSymbol;
}
function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) {
+ if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; }
switch (node.kind) {
- case 242:
+ case 243:
return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve);
- case 244:
- return getTargetOfImportClause(node, dontRecursivelyResolve);
case 245:
+ return getTargetOfImportClause(node, dontRecursivelyResolve);
+ case 246:
return getTargetOfNamespaceImport(node, dontRecursivelyResolve);
- case 247:
- return getTargetOfImportSpecifier(node, dontRecursivelyResolve);
- case 251:
- return getTargetOfExportSpecifier(node, 67216319 | 67901928 | 1920, dontRecursivelyResolve);
case 248:
- case 199:
+ return getTargetOfImportSpecifier(node, dontRecursivelyResolve);
+ case 252:
+ return getTargetOfExportSpecifier(node, 67216319 | 67901928 | 1920, dontRecursivelyResolve);
+ case 249:
+ case 200:
return getTargetOfExportAssignment(node, dontRecursivelyResolve);
- case 241:
+ case 242:
return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve);
+ default:
+ return ts.Debug.fail();
}
}
function isNonLocalAlias(symbol, excludes) {
if (excludes === void 0) { excludes = 67216319 | 67901928 | 1920; }
if (!symbol)
return false;
- return (symbol.flags & (2097152 | excludes)) === 2097152 || (symbol.flags & 2097152 && symbol.flags & 67108864);
+ return (symbol.flags & (2097152 | excludes)) === 2097152 || !!(symbol.flags & 2097152 && symbol.flags & 67108864);
}
function resolveSymbol(symbol, dontResolveAlias) {
- var shouldResolve = !dontResolveAlias && isNonLocalAlias(symbol);
- return shouldResolve ? resolveAlias(symbol) : symbol;
+ return !dontResolveAlias && isNonLocalAlias(symbol) ? resolveAlias(symbol) : symbol;
}
function resolveAlias(symbol) {
ts.Debug.assert((symbol.flags & 2097152) !== 0, "Should only get Alias here.");
@@ -22860,7 +22980,8 @@ var ts;
if (!links.target) {
links.target = resolvingSymbol;
var node = getDeclarationOfAliasSymbol(symbol);
- ts.Debug.assert(!!node);
+ if (!node)
+ return ts.Debug.fail();
var target = getTargetOfAliasDeclaration(node);
if (links.target === resolvingSymbol) {
links.target = target || unknownSymbol;
@@ -22890,11 +23011,12 @@ var ts;
if (!links.referenced) {
links.referenced = true;
var node = getDeclarationOfAliasSymbol(symbol);
- ts.Debug.assert(!!node);
- if (node.kind === 248) {
+ if (!node)
+ return ts.Debug.fail();
+ if (node.kind === 249) {
checkExpressionCached(node.expression);
}
- else if (node.kind === 251) {
+ else if (node.kind === 252) {
checkExpressionCached(node.propertyName || node.name);
}
else if (ts.isInternalModuleImportEqualsDeclaration(node)) {
@@ -22906,11 +23028,11 @@ var ts;
if (entityName.kind === 71 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
entityName = entityName.parent;
}
- if (entityName.kind === 71 || entityName.parent.kind === 145) {
+ if (entityName.kind === 71 || entityName.parent.kind === 146) {
return resolveEntityName(entityName, 1920, false, dontResolveAlias);
}
else {
- ts.Debug.assert(entityName.parent.kind === 242);
+ ts.Debug.assert(entityName.parent.kind === 243);
return resolveEntityName(entityName, 67216319 | 67901928 | 1920, false, dontResolveAlias);
}
}
@@ -22931,9 +23053,9 @@ var ts;
return symbolFromJSPrototype;
}
}
- else if (name.kind === 145 || name.kind === 184) {
- var left = name.kind === 145 ? name.left : name.expression;
- var right = name.kind === 145 ? name.right : name.name;
+ else if (name.kind === 146 || name.kind === 185) {
+ var left = name.kind === 146 ? name.left : name.expression;
+ var right = name.kind === 146 ? name.right : name.name;
var namespace_1 = resolveEntityName(left, namespaceMeaning, ignoreErrors, false, location);
if (!namespace_1 || ts.nodeIsMissing(right)) {
return undefined;
@@ -22942,13 +23064,6 @@ var ts;
return namespace_1;
}
if (ts.isInJavaScriptFile(name)) {
- var initializer = ts.getDeclaredJavascriptInitializer(namespace_1.valueDeclaration) || ts.getAssignedJavascriptInitializer(namespace_1.valueDeclaration);
- if (initializer) {
- namespace_1 = getSymbolOfNode(initializer);
- }
- if (!namespace_1) {
- return undefined;
- }
if (namespace_1.valueDeclaration &&
ts.isVariableDeclaration(namespace_1.valueDeclaration) &&
namespace_1.valueDeclaration.initializer &&
@@ -22972,7 +23087,7 @@ var ts;
}
}
else {
- ts.Debug.assertNever(name, "Unknown entity name kind.");
+ throw ts.Debug.assertNever(name, "Unknown entity name kind.");
}
ts.Debug.assert((ts.getCheckFlags(symbol) & 1) === 0, "Should never get an instantiated symbol here.");
return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol);
@@ -23110,14 +23225,7 @@ var ts;
moduleSymbol.exports.forEach(function (s, name) {
if (name === "export=")
return;
- if (!merged.exports.has(name)) {
- merged.exports.set(name, s);
- }
- else {
- var ms = cloneSymbol(merged.exports.get(name));
- mergeSymbol(ms, s);
- merged.exports.set(name, ms);
- }
+ merged.exports.set(name, merged.exports.has(name) ? mergeSymbol(merged.exports.get(name), s) : s);
});
return merged;
}
@@ -23191,7 +23299,7 @@ var ts;
return undefined;
}
var type = getTypeOfSymbol(exportEquals);
- return type.flags & 16382 ? undefined : getPropertyOfType(type, memberName);
+ return type.flags & 32764 ? undefined : getPropertyOfType(type, memberName);
}
function getExportsOfSymbol(symbol) {
return symbol.flags & 32 ? getResolvedMembersOrExportsOfSymbol(symbol, "resolvedExports") :
@@ -23272,6 +23380,38 @@ var ts;
function getParentOfSymbol(symbol) {
return getMergedSymbol(symbol.parent && getLateBoundSymbol(symbol.parent));
}
+ function getContainerOfSymbol(symbol) {
+ var container = getParentOfSymbol(symbol);
+ if (container) {
+ return container;
+ }
+ var candidate = ts.forEach(symbol.declarations, function (d) { return !ts.isAmbientModule(d) && d.parent && hasNonGlobalAugmentationExternalModuleSymbol(d.parent) ? getSymbolOfNode(d.parent) : undefined; });
+ if (!candidate) {
+ return undefined;
+ }
+ var alias = getAliasForSymbolInContainer(candidate, symbol);
+ return alias ? candidate : undefined;
+ }
+ function getAliasForSymbolInContainer(container, symbol) {
+ if (container === getParentOfSymbol(symbol)) {
+ return symbol;
+ }
+ var exports = getExportsOfSymbol(container);
+ var quick = exports.get(symbol.escapedName);
+ if (quick && symbolRefersToTarget(quick)) {
+ return quick;
+ }
+ return ts.forEachEntry(exports, function (exported) {
+ if (symbolRefersToTarget(exported)) {
+ return exported;
+ }
+ });
+ function symbolRefersToTarget(s) {
+ if (s === symbol || resolveSymbol(s) === symbol || resolveSymbol(s) === resolveSymbol(symbol)) {
+ return s;
+ }
+ }
+ }
function getExportSymbolOfValueSymbolIfExported(symbol) {
return symbol && (symbol.flags & 1048576) !== 0
? getMergedSymbol(symbol.exportSymbol)
@@ -23284,7 +23424,7 @@ var ts;
var members = node.members;
for (var _i = 0, members_2 = members; _i < members_2.length; _i++) {
var member = members_2[_i];
- if (member.kind === 154 && ts.nodeIsPresent(member.body)) {
+ if (member.kind === 155 && ts.nodeIsPresent(member.body)) {
return member;
}
}
@@ -23302,12 +23442,12 @@ var ts;
}
function createBooleanType(trueFalseTypes) {
var type = getUnionType(trueFalseTypes);
- type.flags |= 8;
+ type.flags |= 16;
type.intrinsicName = "boolean";
return type;
}
function createObjectType(objectFlags, symbol) {
- var type = createType(65536);
+ var type = createType(131072);
type.objectFlags = objectFlags;
type.symbol = symbol;
return type;
@@ -23357,11 +23497,11 @@ var ts;
}
}
switch (location.kind) {
- case 273:
+ case 274:
if (!ts.isExternalOrCommonJsModule(location)) {
break;
}
- case 238:
+ case 239:
if (result = callback(getSymbolOfNode(location).exports)) {
return result;
}
@@ -23398,7 +23538,7 @@ var ts;
}
function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol, ignoreQualification) {
return symbol === (resolvedAliasSymbol || symbolFromSymbolTable) &&
- !ts.some(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) &&
+ !ts.some(symbolFromSymbolTable.declarations, hasNonGlobalAugmentationExternalModuleSymbol) &&
(ignoreQualification || canQualifySymbol(symbolFromSymbolTable, meaning));
}
function trySymbolTable(symbols, ignoreQualification) {
@@ -23421,20 +23561,25 @@ var ts;
return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports);
}
}
+ if (symbolFromSymbolTable.escapedName === symbol.escapedName && symbolFromSymbolTable.exportSymbol) {
+ if (isAccessible(getMergedSymbol(symbolFromSymbolTable.exportSymbol), undefined, ignoreQualification)) {
+ return [symbol];
+ }
+ }
});
}
}
function needsQualification(symbol, enclosingDeclaration, meaning) {
var qualify = false;
forEachSymbolTableInScope(enclosingDeclaration, function (symbolTable) {
- var symbolFromSymbolTable = symbolTable.get(symbol.escapedName);
+ var symbolFromSymbolTable = getMergedSymbol(symbolTable.get(symbol.escapedName));
if (!symbolFromSymbolTable) {
return false;
}
if (symbolFromSymbolTable === symbol) {
return true;
}
- symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 251)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
+ symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 252)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
if (symbolFromSymbolTable.flags & meaning) {
qualify = true;
return true;
@@ -23448,10 +23593,10 @@ var ts;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
switch (declaration.kind) {
- case 151:
- case 153:
- case 155:
+ case 152:
+ case 154:
case 156:
+ case 157:
continue;
default:
return false;
@@ -23487,14 +23632,14 @@ var ts;
return hasAccessibleDeclarations;
}
else {
- if (ts.some(symbol.declarations, hasExternalModuleSymbol)) {
+ if (ts.some(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
return {
accessibility: 0
};
}
}
meaningToLook = getQualifiedLeftMeaning(meaning);
- symbol = getParentOfSymbol(symbol);
+ symbol = getContainerOfSymbol(symbol);
}
var symbolExternalModule = ts.forEach(initialSymbol.declarations, getExternalModuleContainer);
if (symbolExternalModule) {
@@ -23519,7 +23664,10 @@ var ts;
}
}
function hasExternalModuleSymbol(declaration) {
- return ts.isAmbientModule(declaration) || (declaration.kind === 273 && ts.isExternalOrCommonJsModule(declaration));
+ return ts.isAmbientModule(declaration) || (declaration.kind === 274 && ts.isExternalOrCommonJsModule(declaration));
+ }
+ function hasNonGlobalAugmentationExternalModuleSymbol(declaration) {
+ return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 274 && ts.isExternalOrCommonJsModule(declaration));
}
function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) {
var aliasesToMakeVisible;
@@ -23559,13 +23707,13 @@ var ts;
}
function isEntityNameVisible(entityName, enclosingDeclaration) {
var meaning;
- if (entityName.parent.kind === 164 ||
+ if (entityName.parent.kind === 165 ||
ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) ||
- entityName.parent.kind === 146) {
+ entityName.parent.kind === 147) {
meaning = 67216319 | 1048576;
}
- else if (entityName.kind === 145 || entityName.kind === 184 ||
- entityName.parent.kind === 242) {
+ else if (entityName.kind === 146 || entityName.kind === 185 ||
+ entityName.parent.kind === 243) {
meaning = 1920;
}
else {
@@ -23602,14 +23750,15 @@ var ts;
}
}
function signatureToString(signature, enclosingDeclaration, flags, kind, writer) {
+ if (flags === void 0) { flags = 0; }
return writer ? signatureToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(signatureToStringWorker);
function signatureToStringWorker(writer) {
var sigOutput;
if (flags & 262144) {
- sigOutput = kind === 1 ? 163 : 162;
+ sigOutput = kind === 1 ? 164 : 163;
}
else {
- sigOutput = kind === 1 ? 158 : 157;
+ sigOutput = kind === 1 ? 159 : 158;
}
var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 | 512);
var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true });
@@ -23619,10 +23768,11 @@ var ts;
}
}
function typeToString(type, enclosingDeclaration, flags, writer) {
- if (flags === void 0) { flags = 1048576; }
+ if (flags === void 0) { flags = 1048576 | 16384; }
if (writer === void 0) { writer = ts.createTextWriter(""); }
var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960, writer);
- ts.Debug.assert(typeNode !== undefined, "should always get typenode");
+ if (typeNode === undefined)
+ return ts.Debug.fail("should always get typenode");
var options = { removeComments: true };
var printer = ts.createPrinter(options);
var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration);
@@ -23635,6 +23785,7 @@ var ts;
return result;
}
function toNodeBuilderFlags(flags) {
+ if (flags === void 0) { flags = 0; }
return flags & 9469291;
}
function createNodeBuilder() {
@@ -23699,7 +23850,7 @@ var ts;
function createNodeBuilderContext(enclosingDeclaration, flags, tracker) {
return {
enclosingDeclaration: enclosingDeclaration,
- flags: flags,
+ flags: flags || 0,
tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop },
encounteredError: false,
visitedSymbols: undefined,
@@ -23720,34 +23871,37 @@ var ts;
return ts.createKeywordTypeNode(119);
}
if (type.flags & 2) {
- return ts.createKeywordTypeNode(137);
+ return ts.createKeywordTypeNode(142);
}
if (type.flags & 4) {
- return ts.createKeywordTypeNode(134);
+ return ts.createKeywordTypeNode(137);
}
if (type.flags & 8) {
+ return ts.createKeywordTypeNode(134);
+ }
+ if (type.flags & 16) {
return ts.createKeywordTypeNode(122);
}
- if (type.flags & 256 && !(type.flags & 131072)) {
+ if (type.flags & 512 && !(type.flags & 262144)) {
var parentSymbol = getParentOfSymbol(type.symbol);
var parentName = symbolToName(parentSymbol, context, 67901928, false);
var enumLiteralName = getDeclaredTypeOfSymbol(parentSymbol) === type ? parentName : ts.createQualifiedName(parentName, ts.symbolName(type.symbol));
return ts.createTypeReferenceNode(enumLiteralName, undefined);
}
- if (type.flags & 272) {
+ if (type.flags & 544) {
var name = symbolToName(type.symbol, context, 67901928, false);
return ts.createTypeReferenceNode(name, undefined);
}
- if (type.flags & (32)) {
+ if (type.flags & (64)) {
return ts.createLiteralTypeNode(ts.setEmitFlags(ts.createLiteral(type.value), 16777216));
}
- if (type.flags & (64)) {
+ if (type.flags & (128)) {
return ts.createLiteralTypeNode((ts.createLiteral(type.value)));
}
- if (type.flags & 128) {
+ if (type.flags & 256) {
return type.intrinsicName === "true" ? ts.createTrue() : ts.createFalse();
}
- if (type.flags & 1024) {
+ if (type.flags & 2048) {
if (!(context.flags & 1048576)) {
if (isValueSymbolAccessible(type.symbol, context.enclosingDeclaration)) {
return symbolToTypeNode(type.symbol, context, 67216319);
@@ -23758,25 +23912,25 @@ var ts;
}
return ts.createTypeOperatorNode(141, ts.createKeywordTypeNode(138));
}
- if (type.flags & 2048) {
+ if (type.flags & 4096) {
return ts.createKeywordTypeNode(105);
}
- if (type.flags & 4096) {
+ if (type.flags & 8192) {
return ts.createKeywordTypeNode(140);
}
- if (type.flags & 8192) {
+ if (type.flags & 16384) {
return ts.createKeywordTypeNode(95);
}
- if (type.flags & 16384) {
+ if (type.flags & 32768) {
return ts.createKeywordTypeNode(131);
}
- if (type.flags & 512) {
+ if (type.flags & 1024) {
return ts.createKeywordTypeNode(138);
}
- if (type.flags & 134217728) {
+ if (type.flags & 16777216) {
return ts.createKeywordTypeNode(135);
}
- if (type.flags & 32768 && type.isThisType) {
+ if (type.flags & 65536 && type.isThisType) {
if (context.flags & 4194304) {
if (!context.encounteredError && !(context.flags & 32768)) {
context.encounteredError = true;
@@ -23789,23 +23943,24 @@ var ts;
}
var objectFlags = ts.getObjectFlags(type);
if (objectFlags & 4) {
- ts.Debug.assert(!!(type.flags & 65536));
+ ts.Debug.assert(!!(type.flags & 131072));
return typeReferenceToTypeNode(type);
}
- if (type.flags & 32768 || objectFlags & 3) {
- if (type.flags & 32768 && ts.contains(context.inferTypeParameters, type)) {
+ if (type.flags & 65536 || objectFlags & 3) {
+ if (type.flags & 65536 && ts.contains(context.inferTypeParameters, type)) {
return ts.createInferTypeNode(typeParameterToDeclarationWithConstraint(type, context, undefined));
}
if (context.flags & 4 &&
- type.flags & 32768 &&
+ type.flags & 65536 &&
ts.length(type.symbol.declarations) &&
ts.isTypeParameterDeclaration(type.symbol.declarations[0]) &&
typeParameterShadowsNameInScope(type, context) &&
!isTypeSymbolAccessible(type.symbol, context.enclosingDeclaration)) {
return ts.createTypeReferenceNode(ts.getGeneratedNameForNode(type.symbol.declarations[0].name, 16 | 8), undefined);
}
- var name = type.symbol ? symbolToName(type.symbol, context, 67901928, false) : ts.createIdentifier("?");
- return ts.createTypeReferenceNode(name, undefined);
+ return type.symbol
+ ? symbolToTypeNode(type.symbol, context, 67901928)
+ : ts.createTypeReferenceNode(ts.createIdentifier("?"), undefined);
}
if (!inTypeAlias && type.aliasSymbol && (context.flags & 16384 || isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration))) {
var typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context);
@@ -23813,11 +23968,11 @@ var ts;
return ts.createTypeReferenceNode(ts.createIdentifier(""), typeArgumentNodes);
return symbolToTypeNode(type.aliasSymbol, context, 67901928, typeArgumentNodes);
}
- if (type.flags & (131072 | 262144)) {
- var types = type.flags & 131072 ? formatUnionTypes(type.types) : type.types;
+ if (type.flags & (262144 | 524288)) {
+ var types = type.flags & 262144 ? formatUnionTypes(type.types) : type.types;
var typeNodes = mapToTypeNodes(types, context);
if (typeNodes && typeNodes.length > 0) {
- var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 131072 ? 168 : 169, typeNodes);
+ var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 262144 ? 169 : 170, typeNodes);
return unionOrIntersectionTypeNode;
}
else {
@@ -23828,20 +23983,20 @@ var ts;
}
}
if (objectFlags & (16 | 32)) {
- ts.Debug.assert(!!(type.flags & 65536));
+ ts.Debug.assert(!!(type.flags & 131072));
return createAnonymousTypeNode(type);
}
- if (type.flags & 524288) {
+ if (type.flags & 1048576) {
var indexedType = type.type;
var indexTypeNode = typeToTypeNodeHelper(indexedType, context);
return ts.createTypeOperatorNode(indexTypeNode);
}
- if (type.flags & 1048576) {
+ if (type.flags & 2097152) {
var objectTypeNode = typeToTypeNodeHelper(type.objectType, context);
var indexTypeNode = typeToTypeNodeHelper(type.indexType, context);
return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode);
}
- if (type.flags & 2097152) {
+ if (type.flags & 4194304) {
var checkTypeNode = typeToTypeNodeHelper(type.checkType, context);
var saveInferTypeParameters = context.inferTypeParameters;
context.inferTypeParameters = type.root.inferTypeParameters;
@@ -23851,12 +24006,12 @@ var ts;
var falseTypeNode = typeToTypeNodeHelper(getFalseTypeFromConditionalType(type), context);
return ts.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode);
}
- if (type.flags & 4194304) {
+ if (type.flags & 8388608) {
return typeToTypeNodeHelper(type.typeVariable, context);
}
- ts.Debug.fail("Should be unreachable.");
+ return ts.Debug.fail("Should be unreachable.");
function createMappedTypeNodeFromType(type) {
- ts.Debug.assert(!!(type.flags & 65536));
+ ts.Debug.assert(!!(type.flags & 131072));
var readonlyToken = type.declaration.readonlyToken ? ts.createToken(type.declaration.readonlyToken.kind) : undefined;
var questionToken = type.declaration.questionToken ? ts.createToken(type.declaration.questionToken.kind) : undefined;
var appropriateConstraintTypeNode;
@@ -23881,7 +24036,7 @@ var ts;
var isInstanceType = type === getInferredClassType(symbol) ? 67901928 : 67216319;
return symbolToTypeNode(symbol, context, isInstanceType);
}
- else if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 204 && context.flags & 2048) ||
+ else if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 205 && context.flags & 2048) ||
symbol.flags & (384 | 512) ||
shouldWriteTypeOfFunctionSymbol()) {
return symbolToTypeNode(symbol, context, 67216319);
@@ -23914,7 +24069,7 @@ var ts;
var isNonLocalFunctionSymbol = !!(symbol.flags & 16) &&
(symbol.parent ||
ts.forEach(symbol.declarations, function (declaration) {
- return declaration.parent.kind === 273 || declaration.parent.kind === 239;
+ return declaration.parent.kind === 274 || declaration.parent.kind === 240;
}));
if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
return (!!(context.flags & 4096) || (context.visitedSymbols && context.visitedSymbols.has(id))) &&
@@ -23933,12 +24088,12 @@ var ts;
}
if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) {
var signature = resolved.callSignatures[0];
- var signatureNode = signatureToSignatureDeclarationHelper(signature, 162, context);
+ var signatureNode = signatureToSignatureDeclarationHelper(signature, 163, context);
return signatureNode;
}
if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) {
var signature = resolved.constructSignatures[0];
- var signatureNode = signatureToSignatureDeclarationHelper(signature, 163, context);
+ var signatureNode = signatureToSignatureDeclarationHelper(signature, 164, context);
return signatureNode;
}
}
@@ -24052,11 +24207,11 @@ var ts;
var typeElements = [];
for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) {
var signature = _a[_i];
- typeElements.push(signatureToSignatureDeclarationHelper(signature, 157, context));
+ typeElements.push(signatureToSignatureDeclarationHelper(signature, 158, context));
}
for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) {
var signature = _c[_b];
- typeElements.push(signatureToSignatureDeclarationHelper(signature, 158, context));
+ typeElements.push(signatureToSignatureDeclarationHelper(signature, 159, context));
}
if (resolvedType.stringIndexInfo) {
var indexInfo = resolvedType.objectFlags & 2048 ?
@@ -24086,7 +24241,7 @@ var ts;
var saveEnclosingDeclaration = context.enclosingDeclaration;
context.enclosingDeclaration = undefined;
if (ts.getCheckFlags(propertySymbol) & 1024) {
- var decl = ts.firstOrUndefined(propertySymbol.declarations);
+ var decl = ts.first(propertySymbol.declarations);
var name = hasLateBindableName(decl) && resolveEntityName(decl.name.expression, 67216319);
if (name && context.tracker.trackSymbol) {
context.tracker.trackSymbol(name, saveEnclosingDeclaration, 67216319);
@@ -24099,7 +24254,7 @@ var ts;
var signatures = getSignaturesOfType(propertyType, 0);
for (var _e = 0, signatures_1 = signatures; _e < signatures_1.length; _e++) {
var signature = signatures_1[_e];
- var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 152, context);
+ var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 153, context);
methodDeclaration.name = propertyName;
methodDeclaration.questionToken = optionalToken;
if (propertySymbol.valueDeclaration) {
@@ -24141,7 +24296,7 @@ var ts;
var name = ts.getNameFromIndexInfo(indexInfo) || "x";
var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 ? 137 : 134);
var indexingParameter = ts.createParameter(undefined, undefined, undefined, name, undefined, indexerTypeNode, undefined);
- var typeNode = indexInfo.type ? typeToTypeNodeHelper(indexInfo.type, context) : typeToTypeNodeHelper(anyType, context);
+ var typeNode = typeToTypeNodeHelper(indexInfo.type || anyType, context);
if (!indexInfo.type && !(context.flags & 2097152)) {
context.encounteredError = true;
}
@@ -24156,7 +24311,7 @@ var ts;
else {
typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); });
}
- var parameters = signature.parameters.map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 154); });
+ var parameters = signature.parameters.map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 155); });
if (signature.thisParameter) {
var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context);
parameters.unshift(thisParameter);
@@ -24208,22 +24363,22 @@ var ts;
return typeParameterToDeclarationWithConstraint(type, context, constraintNode);
}
function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) {
- var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 148);
+ var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 149);
if (!parameterDeclaration && !isTransientSymbol(parameterSymbol)) {
- parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 292);
+ parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 293);
}
var parameterType = getTypeOfSymbol(parameterSymbol);
if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) {
parameterType = getOptionalType(parameterType);
}
var parameterTypeNode = typeToTypeNodeHelper(parameterType, context);
- var modifiers = !(context.flags & 8192) && preserveModifierFlags && parameterDeclaration && parameterDeclaration.modifiers && parameterDeclaration.modifiers.map(ts.getSynthesizedClone);
+ var modifiers = !(context.flags & 8192) && preserveModifierFlags && parameterDeclaration && parameterDeclaration.modifiers ? parameterDeclaration.modifiers.map(ts.getSynthesizedClone) : undefined;
var isRest = parameterDeclaration ? ts.isRestParameter(parameterDeclaration) : parameterSymbol.isRestParameter;
var dotDotDotToken = isRest ? ts.createToken(24) : undefined;
var name = parameterDeclaration
? parameterDeclaration.name ?
parameterDeclaration.name.kind === 71 ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name), 16777216) :
- parameterDeclaration.name.kind === 145 ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216) :
+ parameterDeclaration.name.kind === 146 ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216) :
cloneBindingName(parameterDeclaration.name) :
ts.symbolName(parameterSymbol)
: ts.symbolName(parameterSymbol);
@@ -24235,7 +24390,7 @@ var ts;
function elideInitializerAndSetEmitFlags(node) {
var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, undefined, elideInitializerAndSetEmitFlags);
var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited);
- if (clone.kind === 181) {
+ if (clone.kind === 182) {
clone.initializer = undefined;
}
return ts.setEmitFlags(clone, 1 | 16777216);
@@ -24247,7 +24402,7 @@ var ts;
var chain;
var isTypeParameter = symbol.flags & 262144;
if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64)) {
- chain = getSymbolChain(symbol, meaning, true);
+ chain = ts.Debug.assertDefined(getSymbolChain(symbol, meaning, true));
ts.Debug.assert(chain && chain.length > 0);
}
else {
@@ -24259,12 +24414,12 @@ var ts;
var parentSymbol;
if (!accessibleSymbolChain ||
needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) {
- var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol);
+ var parent = getContainerOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol);
if (parent) {
var parentChain = getSymbolChain(parent, getQualifiedLeftMeaning(meaning), false);
if (parentChain) {
parentSymbol = parent;
- accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [symbol]);
+ accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [getAliasForSymbolInContainer(parent, symbol) || symbol]);
}
}
}
@@ -24272,7 +24427,7 @@ var ts;
return accessibleSymbolChain;
}
if (endOfChain ||
- (yieldModuleSymbol || !(!parentSymbol && ts.forEach(symbol.declarations, hasExternalModuleSymbol))) &&
+ (yieldModuleSymbol || !(!parentSymbol && ts.forEach(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol))) &&
!(symbol.flags & (2048 | 4096))) {
return [symbol];
}
@@ -24443,6 +24598,7 @@ var ts;
}
}
function typePredicateToString(typePredicate, enclosingDeclaration, flags, writer) {
+ if (flags === void 0) { flags = 16384; }
return writer ? typePredicateToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(typePredicateToStringWorker);
function typePredicateToStringWorker(writer) {
var predicate = ts.createTypePredicateNode(typePredicate.kind === 1 ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(), nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 | 512));
@@ -24458,10 +24614,10 @@ var ts;
for (var i = 0; i < types.length; i++) {
var t = types[i];
flags |= t.flags;
- if (!(t.flags & 12288)) {
- if (t.flags & (128 | 256)) {
- var baseType = t.flags & 128 ? booleanType : getBaseTypeOfEnumLiteralType(t);
- if (baseType.flags & 131072) {
+ if (!(t.flags & 24576)) {
+ if (t.flags & (256 | 512)) {
+ var baseType = t.flags & 256 ? booleanType : getBaseTypeOfEnumLiteralType(t);
+ if (baseType.flags & 262144) {
var count = baseType.types.length;
if (i + count <= types.length && types[i + count - 1] === baseType.types[count - 1]) {
result.push(baseType);
@@ -24473,9 +24629,9 @@ var ts;
result.push(t);
}
}
- if (flags & 8192)
+ if (flags & 16384)
result.push(nullType);
- if (flags & 4096)
+ if (flags & 8192)
result.push(undefinedType);
return result || types;
}
@@ -24490,8 +24646,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 !== 172; });
- if (node.kind === 236) {
+ var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 173; });
+ if (node.kind === 237) {
return getSymbolOfNode(node);
}
}
@@ -24499,11 +24655,11 @@ var ts;
}
function isTopLevelInExternalModuleAugmentation(node) {
return node && node.parent &&
- node.parent.kind === 239 &&
+ node.parent.kind === 240 &&
ts.isExternalModuleAugmentation(node.parent.parent);
}
function isDefaultBindingContext(location) {
- return location.kind === 273 || ts.isAmbientModule(location);
+ return location.kind === 274 || ts.isAmbientModule(location);
}
function getNameOfSymbolAsWritten(symbol, context) {
if (context && symbol.escapedName === "default" && !(context.flags & 16384) &&
@@ -24514,7 +24670,7 @@ var ts;
}
if (symbol.declarations && symbol.declarations.length) {
if (ts.some(symbol.declarations, hasExternalModuleSymbol) && context.enclosingDeclaration) {
- var file_3 = ts.getDeclarationOfKind(symbol, 273);
+ var file_3 = ts.getDeclarationOfKind(symbol, 274);
if (!file_3 || !context.tracker.moduleResolverHost) {
if (context.tracker.trackReferencedAmbientModule) {
var ambientDecls = ts.filter(symbol.declarations, ts.isAmbientModule);
@@ -24535,26 +24691,26 @@ var ts;
if (name) {
return ts.declarationNameToString(name);
}
- if (declaration.parent && declaration.parent.kind === 231) {
+ if (declaration.parent && declaration.parent.kind === 232) {
return ts.declarationNameToString(declaration.parent.name);
}
if (context && !context.encounteredError && !(context.flags & 131072)) {
context.encounteredError = true;
}
switch (declaration.kind) {
- case 204:
+ case 205:
return "(Anonymous class)";
- case 191:
case 192:
+ case 193:
return "(Anonymous function)";
}
}
var nameType = symbol.nameType;
if (nameType) {
- if (nameType.flags & 32 && !ts.isIdentifierText(nameType.value, compilerOptions.target)) {
+ if (nameType.flags & 64 && !ts.isIdentifierText(nameType.value, compilerOptions.target)) {
return "\"" + ts.escapeString(nameType.value, 34) + "\"";
}
- if (nameType && nameType.flags & 1024) {
+ if (nameType && nameType.flags & 2048) {
return "[" + getNameOfSymbolAsWritten(nameType.symbol, context) + "]";
}
}
@@ -24571,67 +24727,67 @@ var ts;
return false;
function determineIfDeclarationIsVisible() {
switch (node.kind) {
- case 291:
- case 296:
+ case 292:
+ case 297:
return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent));
- case 181:
+ case 182:
return isDeclarationVisible(node.parent.parent);
- case 231:
+ case 232:
if (ts.isBindingPattern(node.name) &&
!node.name.elements.length) {
return false;
}
- case 238:
- case 234:
+ case 239:
case 235:
case 236:
- case 233:
case 237:
- case 242:
+ case 234:
+ case 238:
+ case 243:
if (ts.isExternalModuleAugmentation(node)) {
return true;
}
var parent = getDeclarationContainer(node);
if (!(ts.getCombinedModifierFlags(node) & 1) &&
- !(node.kind !== 242 && parent.kind !== 273 && parent.flags & 4194304)) {
+ !(node.kind !== 243 && parent.kind !== 274 && parent.flags & 4194304)) {
return isGlobalSourceFile(parent);
}
return isDeclarationVisible(parent);
- case 151:
- case 150:
- case 155:
- case 156:
- case 153:
case 152:
+ case 151:
+ case 156:
+ case 157:
+ case 154:
+ case 153:
if (ts.hasModifier(node, 8 | 16)) {
return false;
}
- case 154:
- case 158:
- case 157:
+ case 155:
case 159:
- case 148:
- case 239:
- case 162:
+ case 158:
+ case 160:
+ case 149:
+ case 240:
case 163:
- case 165:
- case 161:
+ case 164:
case 166:
+ case 162:
case 167:
case 168:
case 169:
- case 172:
+ case 170:
+ case 173:
return isDeclarationVisible(node.parent);
- case 244:
case 245:
- case 247:
- return false;
- case 147:
- case 273:
- case 241:
- return true;
+ case 246:
case 248:
return false;
+ case 148:
+ case 274:
+ case 242:
+ return true;
+ case 249:
+ return false;
default:
return false;
}
@@ -24639,10 +24795,10 @@ var ts;
}
function collectLinkedAliases(node, setVisibility) {
var exportSymbol;
- if (node.parent && node.parent.kind === 248) {
+ if (node.parent && node.parent.kind === 249) {
exportSymbol = resolveName(node, node.escapedText, 67216319 | 67901928 | 1920 | 2097152, undefined, node, false);
}
- else if (node.parent.kind === 251) {
+ else if (node.parent.kind === 252) {
exportSymbol = getTargetOfExportSpecifier(node.parent, 67216319 | 67901928 | 1920 | 2097152);
}
var result;
@@ -24698,22 +24854,22 @@ var ts;
}
function hasType(target, propertyName) {
if (propertyName === 0) {
- return getSymbolLinks(target).type;
+ return !!getSymbolLinks(target).type;
}
if (propertyName === 2) {
- return getSymbolLinks(target).declaredType;
+ return !!getSymbolLinks(target).declaredType;
}
if (propertyName === 1) {
- return target.resolvedBaseConstructorType;
+ return !!target.resolvedBaseConstructorType;
}
if (propertyName === 3) {
- return target.resolvedReturnType;
+ return !!target.resolvedReturnType;
}
if (propertyName === 4) {
var bc = target.resolvedBaseConstraint;
- return bc && bc !== circularConstraintType;
+ return !!bc && bc !== circularConstraintType;
}
- ts.Debug.fail("Unhandled TypeSystemPropertyName " + propertyName);
+ return ts.Debug.fail("Unhandled TypeSystemPropertyName " + propertyName);
}
function popTypeResolution() {
resolutionTargets.pop();
@@ -24721,20 +24877,19 @@ var ts;
return resolutionResults.pop();
}
function getDeclarationContainer(node) {
- node = ts.findAncestor(ts.getRootDeclaration(node), function (node) {
+ return ts.findAncestor(ts.getRootDeclaration(node), function (node) {
switch (node.kind) {
- case 231:
case 232:
+ case 233:
+ case 248:
case 247:
case 246:
case 245:
- case 244:
return false;
default:
return true;
}
- });
- return node && node.parent;
+ }).parent;
}
function getTypeOfPrototypeProperty(prototype) {
var classType = getDeclaredTypeOfSymbol(getParentOfSymbol(prototype));
@@ -24752,14 +24907,14 @@ var ts;
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, false);
}
function isComputedNonLiteralName(name) {
- return name.kind === 146 && !ts.isStringOrNumericLiteral(name.expression);
+ return name.kind === 147 && !ts.isStringOrNumericLiteral(name.expression);
}
function getRestType(source, properties, symbol) {
- source = filterType(source, function (t) { return !(t.flags & 12288); });
- if (source.flags & 16384) {
+ source = filterType(source, function (t) { return !(t.flags & 24576); });
+ if (source.flags & 32768) {
return emptyObjectType;
}
- if (source.flags & 131072) {
+ if (source.flags & 262144) {
return mapType(source, function (t) { return getRestType(t, properties, symbol); });
}
var members = ts.createSymbolTable();
@@ -24784,8 +24939,8 @@ var ts;
function getTypeForBindingElement(declaration) {
var pattern = declaration.parent;
var parentType = getTypeForBindingElementParent(pattern.parent);
- if (parentType === unknownType) {
- return unknownType;
+ if (parentType === errorType) {
+ return errorType;
}
if (!parentType) {
return declaration.initializer ? checkDeclarationInitializer(declaration) : parentType;
@@ -24794,11 +24949,11 @@ var ts;
return parentType;
}
var type;
- if (pattern.kind === 179) {
+ if (pattern.kind === 180) {
if (declaration.dotDotDotToken) {
- if (!isValidSpreadType(parentType)) {
+ if (parentType.flags & 2 || !isValidSpreadType(parentType)) {
error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types);
- return unknownType;
+ return errorType;
}
var literalMembers = [];
for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {
@@ -24815,13 +24970,13 @@ var ts;
var isWellKnown = ts.isComputedPropertyName(name) && ts.isWellKnownSymbolSyntactically(name.expression);
if (!isLate && !isWellKnown && isComputedNonLiteralName(name)) {
var exprType = checkExpression(name.expression);
- if (isTypeAssignableToKind(exprType, 1536)) {
+ if (isTypeAssignableToKind(exprType, 3072)) {
if (noImplicitAny) {
error(declaration, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(exprType), typeToString(parentType));
}
return anyType;
}
- var indexerType = isTypeAssignableToKind(exprType, 84) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0);
+ var indexerType = isTypeAssignableToKind(exprType, 168) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0);
if (!indexerType && noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) {
if (getIndexTypeOfType(parentType, 1)) {
error(declaration, ts.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number);
@@ -24832,14 +24987,14 @@ var ts;
}
return indexerType || anyType;
}
- var nameType = isLate && checkComputedPropertyName(name);
+ var nameType = isLate ? checkComputedPropertyName(name) : undefined;
var text = isLate ? getLateBoundNameFromType(nameType) :
isWellKnown ? ts.getPropertyNameForKnownSymbolName(ts.idText(name.expression.name)) :
ts.getTextOfPropertyName(name);
if (strictNullChecks && declaration.flags & 4194304 && ts.isParameterDeclaration(declaration)) {
parentType = getNonNullableType(parentType);
}
- if (isLate && nameType && !getPropertyOfType(parentType, text) && isTypeAssignableToKind(nameType, 1536)) {
+ if (isLate && nameType && !getPropertyOfType(parentType, text) && isTypeAssignableToKind(nameType, 3072)) {
if (noImplicitAny) {
error(declaration, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(nameType), typeToString(parentType));
}
@@ -24851,7 +25006,7 @@ var ts;
getIndexTypeOfType(parentType, 0);
if (!type) {
error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name));
- return unknownType;
+ return errorType;
}
}
}
@@ -24872,11 +25027,11 @@ var ts;
else {
error(declaration, ts.Diagnostics.Type_0_has_no_property_1, typeToString(parentType), propName);
}
- return unknownType;
+ return errorType;
}
}
}
- if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkExpressionCached(declaration.initializer)) & 4096)) {
+ if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkExpressionCached(declaration.initializer)) & 8192)) {
type = getTypeWithFacts(type, 131072);
}
return declaration.initializer ?
@@ -24896,18 +25051,18 @@ var ts;
}
function isEmptyArrayLiteral(node) {
var expr = ts.skipParentheses(node);
- return expr.kind === 182 && expr.elements.length === 0;
+ return expr.kind === 183 && 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 === 220) {
- var indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression));
- return indexType.flags & (32768 | 524288) ? getExtractStringType(indexType) : stringType;
- }
if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 221) {
+ var indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression));
+ return indexType.flags & (65536 | 1048576) ? getExtractStringType(indexType) : stringType;
+ }
+ if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 222) {
var forOfStatement = declaration.parent.parent;
return checkRightHandSideOfForOf(forOfStatement.expression, forOfStatement.awaitModifier) || anyType;
}
@@ -24921,7 +25076,7 @@ var ts;
return addOptionality(declaredType, isOptional);
}
if ((noImplicitAny || ts.isInJavaScriptFile(declaration)) &&
- declaration.kind === 231 && !ts.isBindingPattern(declaration.name) &&
+ declaration.kind === 232 && !ts.isBindingPattern(declaration.name) &&
!(ts.getCombinedModifierFlags(declaration) & 1) && !(declaration.flags & 4194304)) {
if (!(ts.getCombinedNodeFlags(declaration) & 2) && (!declaration.initializer || isNullOrUndefined(declaration.initializer))) {
return autoType;
@@ -24930,10 +25085,10 @@ var ts;
return autoArrayType;
}
}
- if (declaration.kind === 148) {
+ if (declaration.kind === 149) {
var func = declaration.parent;
- if (func.kind === 156 && !hasNonBindableDynamicName(func)) {
- var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 155);
+ if (func.kind === 157 && !hasNonBindableDynamicName(func)) {
+ var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 156);
if (getter) {
var getterSignature = getSignatureFromDeclaration(getter);
var thisParameter = getAccessorThisParameter(func);
@@ -24979,18 +25134,18 @@ var ts;
var jsDocType;
var _loop_3 = function (declaration) {
var declarationInConstructor = false;
- var expression = declaration.kind === 199 ? declaration :
- declaration.kind === 184 ? ts.cast(declaration.parent, ts.isBinaryExpression) :
+ var expression = declaration.kind === 200 ? declaration :
+ declaration.kind === 185 ? ts.cast(declaration.parent, ts.isBinaryExpression) :
undefined;
if (!expression) {
- return { value: unknownType };
+ return { value: errorType };
}
var special = ts.getSpecialPropertyAssignmentKind(expression);
if (special === 4) {
var thisContainer = ts.getThisContainer(expression, false);
- declarationInConstructor = thisContainer.kind === 154 ||
- thisContainer.kind === 233 ||
- (thisContainer.kind === 191 && !ts.isPrototypePropertyAssignment(thisContainer.parent));
+ declarationInConstructor = thisContainer.kind === 155 ||
+ thisContainer.kind === 234 ||
+ (thisContainer.kind === 192 && !ts.isPrototypePropertyAssignment(thisContainer.parent));
if (declarationInConstructor) {
definedInConstructor = true;
}
@@ -25004,7 +25159,7 @@ var ts;
if (!jsDocType) {
jsDocType = declarationType;
}
- else if (jsDocType !== unknownType && declarationType !== unknownType &&
+ else if (jsDocType !== errorType && declarationType !== errorType &&
!isTypeIdenticalTo(jsDocType, declarationType) &&
!(symbol.flags & 67108864)) {
errorNextVariableOrPropertyDeclarationMustHaveSameType(jsDocType, declaration, declarationType);
@@ -25059,11 +25214,11 @@ var ts;
definedInConstructor = true;
}
}
- var sourceTypes = ts.some(constructorTypes, function (t) { return !!(t.flags & ~(12288 | 16777216)); }) ? constructorTypes : types;
+ var sourceTypes = ts.some(constructorTypes, function (t) { return !!(t.flags & ~(24576 | 134217728)); }) ? constructorTypes : types;
type = getUnionType(sourceTypes, 2);
}
var widened = getWidenedType(addOptionality(type, definedInMethod && !definedInConstructor));
- if (filterType(widened, function (t) { return !!(t.flags & ~12288); }) === neverType) {
+ if (filterType(widened, function (t) { return !!(t.flags & ~24576); }) === neverType) {
if (noImplicitAny) {
reportImplicitAnyError(symbol.valueDeclaration, anyType);
}
@@ -25118,7 +25273,7 @@ var ts;
members.set(symbol.escapedName, symbol);
});
var result = createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, undefined);
- result.flags |= 33554432;
+ result.flags |= 268435456;
result.objectFlags |= objectFlags;
if (includePatternInType) {
result.pattern = pattern;
@@ -25128,7 +25283,7 @@ var ts;
function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) {
var elements = pattern.elements;
var lastElement = ts.lastOrUndefined(elements);
- if (elements.length === 0 || (!ts.isOmittedExpression(lastElement) && lastElement.dotDotDotToken)) {
+ if (!lastElement || (!ts.isOmittedExpression(lastElement) && lastElement.dotDotDotToken)) {
return languageVersion >= 2 ? createIterableType(anyType) : anyArrayType;
}
var elementTypes = ts.map(elements, function (e) { return ts.isOmittedExpression(e) ? anyType : getTypeFromBindingElement(e, includePatternInType, reportErrors); });
@@ -25140,7 +25295,9 @@ var ts;
return result;
}
function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) {
- return pattern.kind === 179
+ if (includePatternInType === void 0) { includePatternInType = false; }
+ if (reportErrors === void 0) { reportErrors = false; }
+ return pattern.kind === 180
? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors)
: getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors);
}
@@ -25150,7 +25307,7 @@ var ts;
if (reportErrors) {
reportErrorsFromWidening(declaration, type);
}
- if (type.flags & 1024 && (ts.isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfNode(declaration)) {
+ if (type.flags & 2048 && (ts.isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfNode(declaration)) {
type = esSymbolType;
}
return getWidenedType(type);
@@ -25165,7 +25322,7 @@ var ts;
}
function declarationBelongsToPrivateAmbientMember(declaration) {
var root = ts.getRootDeclaration(declaration);
- var memberDeclaration = root.kind === 148 ? root.parent : root;
+ var memberDeclaration = root.kind === 149 ? root.parent : root;
return isPrivateWithinAmbient(memberDeclaration);
}
function tryGetTypeFromEffectiveTypeNode(declaration) {
@@ -25191,23 +25348,25 @@ var ts;
var jsonSourceFile = ts.cast(declaration, ts.isJsonSourceFile);
return links.type = jsonSourceFile.statements.length ? checkExpression(jsonSourceFile.statements[0].expression) : emptyObjectType;
}
- if (declaration.kind === 248) {
+ if (declaration.kind === 249) {
return links.type = checkExpression(declaration.expression);
}
if (ts.isInJavaScriptFile(declaration) && ts.isJSDocPropertyLikeTag(declaration) && declaration.typeExpression) {
return links.type = getTypeFromTypeNode(declaration.typeExpression.type);
}
if (!pushTypeResolution(symbol, 0)) {
- return unknownType;
+ return errorType;
}
var type = void 0;
- if (declaration.kind === 199 ||
- declaration.kind === 184 && declaration.parent.kind === 199) {
+ if (declaration.kind === 200 ||
+ declaration.kind === 185 && declaration.parent.kind === 200) {
type = getWidenedTypeFromJSSpecialPropertyDeclarations(symbol);
}
else if (ts.isJSDocPropertyLikeTag(declaration)
|| ts.isPropertyAccessExpression(declaration)
|| ts.isIdentifier(declaration)
+ || ts.isClassDeclaration(declaration)
+ || ts.isFunctionDeclaration(declaration)
|| (ts.isMethodDeclaration(declaration) && !ts.isObjectLiteralMethod(declaration))
|| ts.isMethodSignature(declaration)) {
if (symbol.flags & (16 | 8192 | 32 | 384 | 512)) {
@@ -25235,7 +25394,7 @@ var ts;
type = getWidenedTypeForVariableLikeDeclaration(declaration, true);
}
else {
- ts.Debug.fail("Unhandled declaration kind! " + ts.Debug.showSyntaxKind(declaration));
+ return ts.Debug.fail("Unhandled declaration kind! " + ts.Debug.showSyntaxKind(declaration) + " for " + ts.Debug.showSymbol(symbol));
}
if (!popTypeResolution()) {
type = reportCircularityError(symbol);
@@ -25246,7 +25405,7 @@ var ts;
}
function getAnnotatedAccessorType(accessor) {
if (accessor) {
- if (accessor.kind === 155) {
+ if (accessor.kind === 156) {
var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor);
return getterTypeAnnotation && getTypeFromTypeNode(getterTypeAnnotation);
}
@@ -25267,8 +25426,8 @@ var ts;
function getTypeOfAccessors(symbol) {
var links = getSymbolLinks(symbol);
if (!links.type) {
- var getter = ts.getDeclarationOfKind(symbol, 155);
- var setter = ts.getDeclarationOfKind(symbol, 156);
+ var getter = ts.getDeclarationOfKind(symbol, 156);
+ var setter = ts.getDeclarationOfKind(symbol, 157);
if (getter && ts.isInJavaScriptFile(getter)) {
var jsDocType = getTypeForDeclarationFromJSDocComment(getter);
if (jsDocType) {
@@ -25276,7 +25435,7 @@ var ts;
}
}
if (!pushTypeResolution(symbol, 0)) {
- return unknownType;
+ return errorType;
}
var type = void 0;
var getterReturnType = getAnnotatedAccessorType(getter);
@@ -25309,7 +25468,7 @@ var ts;
if (!popTypeResolution()) {
type = anyType;
if (noImplicitAny) {
- var getter_1 = ts.getDeclarationOfKind(symbol, 155);
+ var getter_1 = ts.getDeclarationOfKind(symbol, 156);
error(getter_1, 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));
}
}
@@ -25319,16 +25478,32 @@ var ts;
}
function getBaseTypeVariableOfClass(symbol) {
var baseConstructorType = getBaseConstructorTypeOfClass(getDeclaredTypeOfClassOrInterface(symbol));
- return baseConstructorType.flags & 1081344 ? baseConstructorType : undefined;
+ return baseConstructorType.flags & 2162688 ? baseConstructorType : undefined;
}
function getTypeOfFuncClassEnumModule(symbol) {
var links = getSymbolLinks(symbol);
if (!links.type) {
+ var jsDeclaration = ts.getDeclarationOfJSInitializer(symbol.valueDeclaration);
+ if (jsDeclaration) {
+ var jsSymbol = getSymbolOfNode(jsDeclaration);
+ if (jsSymbol && (ts.hasEntries(jsSymbol.exports) || ts.hasEntries(jsSymbol.members))) {
+ symbol = cloneSymbol(symbol);
+ links = symbol;
+ if (ts.hasEntries(jsSymbol.exports)) {
+ symbol.exports = symbol.exports || ts.createSymbolTable();
+ mergeSymbolTable(symbol.exports, jsSymbol.exports);
+ }
+ if (ts.hasEntries(jsSymbol.members)) {
+ symbol.members = symbol.members || ts.createSymbolTable();
+ mergeSymbolTable(symbol.members, jsSymbol.members);
+ }
+ }
+ }
if (symbol.flags & 1536 && ts.isShorthandAmbientModuleSymbol(symbol)) {
links.type = anyType;
}
- else if (symbol.valueDeclaration.kind === 199 ||
- symbol.valueDeclaration.kind === 184 && symbol.valueDeclaration.parent.kind === 199) {
+ else if (symbol.valueDeclaration.kind === 200 ||
+ symbol.valueDeclaration.kind === 185 && symbol.valueDeclaration.parent.kind === 200) {
links.type = getWidenedTypeFromJSSpecialPropertyDeclarations(symbol);
}
else {
@@ -25357,7 +25532,7 @@ var ts;
var targetSymbol = resolveAlias(symbol);
links.type = targetSymbol.flags & 67216319
? getTypeOfSymbol(targetSymbol)
- : unknownType;
+ : errorType;
}
return links.type;
}
@@ -25366,11 +25541,11 @@ var ts;
if (!links.type) {
if (symbolInstantiationDepth === 100) {
error(symbol.valueDeclaration, ts.Diagnostics.Generic_type_instantiation_is_excessively_deep_and_possibly_infinite);
- links.type = unknownType;
+ links.type = errorType;
}
else {
if (!pushTypeResolution(symbol, 0)) {
- return unknownType;
+ return errorType;
}
symbolInstantiationDepth++;
var type = instantiateType(getTypeOfSymbol(links.target), links.mapper);
@@ -25386,7 +25561,7 @@ var ts;
function reportCircularityError(symbol) {
if (ts.getEffectiveTypeAnnotationNode(symbol.valueDeclaration)) {
error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol));
- return unknownType;
+ return errorType;
}
if (noImplicitAny) {
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));
@@ -25415,7 +25590,7 @@ var ts;
if (symbol.flags & 2097152) {
return getTypeOfAlias(symbol);
}
- return unknownType;
+ return errorType;
}
function isReferenceToType(type, target) {
return type !== undefined
@@ -25431,11 +25606,12 @@ var ts;
function check(type) {
if (ts.getObjectFlags(type) & (3 | 4)) {
var target = getTargetType(type);
- return target === checkBase || ts.forEach(getBaseTypes(target), check);
+ return target === checkBase || ts.some(getBaseTypes(target), check);
}
- else if (type.flags & 262144) {
- return ts.forEach(type.types, check);
+ else if (type.flags & 524288) {
+ return ts.some(type.types, check);
}
+ return false;
}
}
function appendTypeParameters(typeParameters, declarations) {
@@ -25452,51 +25628,51 @@ var ts;
return undefined;
}
switch (node.kind) {
- case 234:
- case 204:
case 235:
- case 157:
- case 158:
- case 152:
- case 162:
- case 163:
- case 283:
- case 233:
- case 153:
- case 191:
- case 192:
+ case 205:
case 236:
- case 295:
+ case 158:
+ case 159:
+ case 153:
+ case 163:
+ case 164:
+ case 284:
+ case 234:
+ case 154:
+ case 192:
+ case 193:
+ case 237:
case 296:
- case 291:
- case 176:
- case 170:
+ case 297:
+ case 292:
+ case 177:
+ case 171:
var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
- if (node.kind === 176) {
+ if (node.kind === 177) {
return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)));
}
- else if (node.kind === 170) {
+ else if (node.kind === 171) {
return ts.concatenate(outerTypeParameters, getInferTypeParameters(node));
}
var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node));
var thisType = includeThisTypes &&
- (node.kind === 234 || node.kind === 204 || node.kind === 235) &&
+ (node.kind === 235 || node.kind === 205 || node.kind === 236) &&
getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType;
return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters;
}
}
}
function getOuterTypeParametersOfClassOrInterface(symbol) {
- var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 235);
+ var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 236);
return getOuterTypeParameters(declaration);
}
function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) {
var result;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var node = _a[_i];
- if (node.kind === 235 ||
- node.kind === 234 ||
- node.kind === 204 ||
+ if (node.kind === 236 ||
+ node.kind === 235 ||
+ node.kind === 205 ||
ts.isTypeAlias(node)) {
var declaration = node;
result = appendTypeParameters(result, ts.getEffectiveTypeParameterDeclarations(declaration));
@@ -25519,9 +25695,9 @@ var ts;
if (isValidBaseType(type) && getSignaturesOfType(type, 1).length > 0) {
return true;
}
- if (type.flags & 1081344) {
+ if (type.flags & 2162688) {
var constraint = getBaseConstraintOfType(type);
- return constraint && isValidBaseType(constraint) && isMixinConstructorType(constraint);
+ return !!constraint && isValidBaseType(constraint) && isMixinConstructorType(constraint);
}
return false;
}
@@ -25554,23 +25730,23 @@ var ts;
return type.resolvedBaseConstructorType = undefinedType;
}
if (!pushTypeResolution(type, 1)) {
- return unknownType;
+ return errorType;
}
var baseConstructorType = checkExpression(baseTypeNode.expression);
if (extended && baseTypeNode !== extended) {
ts.Debug.assert(!extended.typeArguments);
checkExpression(extended.expression);
}
- if (baseConstructorType.flags & (65536 | 262144)) {
+ if (baseConstructorType.flags & (131072 | 524288)) {
resolveStructuredTypeMembers(baseConstructorType);
}
if (!popTypeResolution()) {
error(type.symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression, symbolToString(type.symbol));
- return type.resolvedBaseConstructorType = unknownType;
+ return type.resolvedBaseConstructorType = errorType;
}
if (!(baseConstructorType.flags & 1) && baseConstructorType !== nullWideningType && !isConstructorType(baseConstructorType)) {
error(baseTypeNode.expression, ts.Diagnostics.Type_0_is_not_a_constructor_function_type, typeToString(baseConstructorType));
- return type.resolvedBaseConstructorType = unknownType;
+ return type.resolvedBaseConstructorType = errorType;
}
type.resolvedBaseConstructorType = baseConstructorType;
}
@@ -25598,7 +25774,7 @@ var ts;
function resolveBaseTypesOfClass(type) {
type.resolvedBaseTypes = ts.resolvingEmptyArray;
var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type));
- if (!(baseConstructorType.flags & (65536 | 262144 | 1))) {
+ if (!(baseConstructorType.flags & (131072 | 524288 | 1))) {
return type.resolvedBaseTypes = ts.emptyArray;
}
var baseTypeNode = getBaseTypeNodeOfClass(type);
@@ -25620,7 +25796,7 @@ var ts;
}
baseType = getReturnTypeOfSignature(constructors[0]);
}
- if (baseType === unknownType) {
+ if (baseType === errorType) {
return type.resolvedBaseTypes = ts.emptyArray;
}
if (!isValidBaseType(baseType)) {
@@ -25646,18 +25822,18 @@ var ts;
return true;
}
function isValidBaseType(type) {
- return type.flags & (65536 | 134217728 | 1) && !isGenericMappedType(type) ||
- type.flags & 262144 && !ts.forEach(type.types, function (t) { return !isValidBaseType(t); });
+ return !!(type.flags & (131072 | 16777216 | 1)) && !isGenericMappedType(type) ||
+ !!(type.flags & 524288) && !ts.some(type.types, function (t) { return !isValidBaseType(t); });
}
function resolveBaseTypesOfInterface(type) {
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 === 235 && ts.getInterfaceBaseTypeNodes(declaration)) {
+ if (declaration.kind === 236 && ts.getInterfaceBaseTypeNodes(declaration)) {
for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) {
var node = _c[_b];
var baseType = getTypeFromTypeNode(node);
- if (baseType !== unknownType) {
+ if (baseType !== errorType) {
if (isValidBaseType(baseType)) {
if (type !== baseType && !hasBaseType(baseType, type)) {
if (type.resolvedBaseTypes === ts.emptyArray) {
@@ -25682,7 +25858,7 @@ var ts;
function isThislessInterface(symbol) {
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 235) {
+ if (declaration.kind === 236) {
if (declaration.flags & 64) {
return false;
}
@@ -25718,7 +25894,7 @@ var ts;
type.instantiations.set(getTypeListId(type.typeParameters), type);
type.target = type;
type.typeArguments = type.typeParameters;
- type.thisType = createType(32768);
+ type.thisType = createType(65536);
type.thisType.isThisType = true;
type.thisType.symbol = symbol;
type.thisType.constraint = type;
@@ -25730,13 +25906,13 @@ var ts;
var links = getSymbolLinks(symbol);
if (!links.declaredType) {
if (!pushTypeResolution(symbol, 2)) {
- return unknownType;
+ return errorType;
}
var declaration = ts.find(symbol.declarations, function (d) {
- return ts.isJSDocTypeAlias(d) || d.kind === 236;
+ return ts.isJSDocTypeAlias(d) || d.kind === 237;
});
var typeNode = ts.isJSDocTypeAlias(declaration) ? declaration.typeExpression : declaration.type;
- var type = typeNode ? getTypeFromTypeNode(typeNode) : unknownType;
+ var type = typeNode ? getTypeFromTypeNode(typeNode) : errorType;
if (popTypeResolution()) {
var typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol);
if (typeParameters) {
@@ -25746,7 +25922,7 @@ var ts;
}
}
else {
- type = unknownType;
+ type = errorType;
error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol));
}
links.declaredType = type;
@@ -25757,7 +25933,7 @@ var ts;
if (expr.kind === 9) {
return true;
}
- else if (expr.kind === 199) {
+ else if (expr.kind === 200) {
return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right);
}
return false;
@@ -25771,12 +25947,12 @@ var ts;
case 9:
case 8:
return true;
- case 197:
+ case 198:
return expr.operator === 38 &&
expr.operand.kind === 8;
case 71:
return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText);
- case 199:
+ case 200:
return isStringConcatExpression(expr);
default:
return false;
@@ -25790,7 +25966,7 @@ var ts;
var hasNonLiteralMember = false;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 237) {
+ if (declaration.kind === 238) {
for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) {
var member = _c[_b];
if (member.initializer && member.initializer.kind === 9) {
@@ -25805,7 +25981,7 @@ var ts;
return links.enumKind = hasNonLiteralMember ? 0 : 1;
}
function getBaseTypeOfEnumLiteralType(type) {
- return type.flags & 256 && !(type.flags & 131072) ? getDeclaredTypeOfSymbol(getParentOfSymbol(type.symbol)) : type;
+ return type.flags & 512 && !(type.flags & 262144) ? getDeclaredTypeOfSymbol(getParentOfSymbol(type.symbol)) : type;
}
function getDeclaredTypeOfEnum(symbol) {
var links = getSymbolLinks(symbol);
@@ -25817,7 +25993,7 @@ var ts;
var memberTypeList = [];
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 237) {
+ if (declaration.kind === 238) {
for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) {
var member = _c[_b];
var memberType = getLiteralType(getEnumMemberValue(member), enumCount, getSymbolOfNode(member));
@@ -25828,14 +26004,14 @@ var ts;
}
if (memberTypeList.length) {
var enumType_1 = getUnionType(memberTypeList, 1, symbol, undefined);
- if (enumType_1.flags & 131072) {
- enumType_1.flags |= 256;
+ if (enumType_1.flags & 262144) {
+ enumType_1.flags |= 512;
enumType_1.symbol = symbol;
}
return links.declaredType = enumType_1;
}
}
- var enumType = createType(16);
+ var enumType = createType(32);
enumType.symbol = symbol;
return links.declaredType = enumType;
}
@@ -25852,7 +26028,7 @@ var ts;
function getDeclaredTypeOfTypeParameter(symbol) {
var links = getSymbolLinks(symbol);
if (!links.declaredType) {
- var type = createType(32768);
+ var type = createType(65536);
type.symbol = symbol;
links.declaredType = type;
}
@@ -25866,7 +26042,7 @@ var ts;
return links.declaredType;
}
function getDeclaredTypeOfSymbol(symbol) {
- return tryGetDeclaredTypeOfSymbol(symbol) || unknownType;
+ return tryGetDeclaredTypeOfSymbol(symbol) || errorType;
}
function tryGetDeclaredTypeOfSymbol(symbol) {
if (symbol.flags & (32 | 64)) {
@@ -25892,6 +26068,7 @@ var ts;
function isThislessType(node) {
switch (node.kind) {
case 119:
+ case 142:
case 137:
case 134:
case 122:
@@ -25901,11 +26078,11 @@ var ts;
case 140:
case 95:
case 131:
- case 177:
+ case 178:
return true;
- case 166:
+ case 167:
return isThislessType(node.elementType);
- case 161:
+ case 162:
return !node.typeArguments || node.typeArguments.every(isThislessType);
}
return false;
@@ -25920,7 +26097,7 @@ var ts;
function isThislessFunctionLikeDeclaration(node) {
var returnType = ts.getEffectiveReturnTypeNode(node);
var typeParameters = ts.getEffectiveTypeParameterDeclarations(node);
- return (node.kind === 154 || (returnType && isThislessType(returnType))) &&
+ return (node.kind === 155 || (!!returnType && isThislessType(returnType))) &&
node.parameters.every(isThislessVariableLikeDeclaration) &&
typeParameters.every(isThislessTypeParameter);
}
@@ -25929,12 +26106,12 @@ var ts;
var declaration = symbol.declarations[0];
if (declaration) {
switch (declaration.kind) {
- case 151:
- case 150:
- return isThislessVariableLikeDeclaration(declaration);
- case 153:
case 152:
+ case 151:
+ return isThislessVariableLikeDeclaration(declaration);
case 154:
+ case 153:
+ case 155:
return isThislessFunctionLikeDeclaration(declaration);
}
}
@@ -25972,7 +26149,7 @@ var ts;
return type;
}
function isTypeUsableAsLateBoundName(type) {
- return !!(type.flags & 1120);
+ return !!(type.flags & 2240);
}
function isLateBindableName(node) {
return ts.isComputedPropertyName(node)
@@ -25981,7 +26158,7 @@ var ts;
}
function hasLateBindableName(node) {
var name = ts.getNameOfDeclaration(node);
- return name && isLateBindableName(name);
+ return !!name && isLateBindableName(name);
}
function hasNonBindableDynamicName(node) {
return ts.hasDynamicName(node) && !hasLateBindableName(node);
@@ -25990,12 +26167,13 @@ var ts;
return ts.isDynamicName(node) && !isLateBindableName(node);
}
function getLateBoundNameFromType(type) {
- if (type.flags & 1024) {
+ if (type.flags & 2048) {
return "__@" + type.symbol.escapedName + "@" + getSymbolId(type.symbol);
}
- if (type.flags & 96) {
+ if (type.flags & 192) {
return ts.escapeLeadingUnderscores("" + type.value);
}
+ return ts.Debug.fail();
}
function addDeclarationToLateBoundSymbol(symbol, member, symbolFlags) {
ts.Debug.assert(!!(ts.getCheckFlags(symbol) & 1024), "Expected a late-bound symbol.");
@@ -26008,8 +26186,7 @@ var ts;
symbol.declarations.push(member);
}
if (symbolFlags & 67216319) {
- var valueDeclaration = symbol.valueDeclaration;
- if (!valueDeclaration || valueDeclaration.kind !== member.kind) {
+ if (!symbol.valueDeclaration || symbol.valueDeclaration.kind !== member.kind) {
symbol.valueDeclaration = member;
}
}
@@ -26101,7 +26278,7 @@ var ts;
return needApparentType ? getApparentType(ref) : ref;
}
}
- else if (type.flags & 262144) {
+ else if (type.flags & 524288) {
return getIntersectionType(ts.map(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument, needApparentType); }));
}
return needApparentType ? getApparentType(type) : type;
@@ -26360,7 +26537,7 @@ var ts;
if (symbol.flags & 32) {
var classType = getDeclaredTypeOfClassOrInterface(symbol);
var baseConstructorType = getBaseConstructorTypeOfClass(classType);
- if (baseConstructorType.flags & (65536 | 262144 | 1081344)) {
+ if (baseConstructorType.flags & (131072 | 524288 | 2162688)) {
members = ts.createSymbolTable(getNamedMembers(members));
addInheritedMembers(members, getPropertiesOfType(baseConstructorType));
}
@@ -26412,7 +26589,7 @@ var ts;
var templateType = getTemplateTypeFromMappedType(type.target || type);
var modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
var templateModifiers = getMappedTypeModifiers(type);
- var include = keyofStringsOnly ? 32 : 1120;
+ var include = keyofStringsOnly ? 64 : 2240;
if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
for (var _i = 0, _a = getPropertiesOfType(modifiersType); _i < _a.length; _i++) {
var prop = _a[_i];
@@ -26426,15 +26603,15 @@ var ts;
}
}
else {
- var keyType = constraintType.flags & 7372800 ? getApparentType(constraintType) : constraintType;
- var iterationType = keyType.flags & 524288 ? getIndexType(getApparentType(keyType.type)) : keyType;
+ var keyType = constraintType.flags & 14745600 ? getApparentType(constraintType) : constraintType;
+ var iterationType = keyType.flags & 1048576 ? getIndexType(getApparentType(keyType.type)) : keyType;
forEachType(iterationType, addMemberForKeyType);
}
setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo);
function addMemberForKeyType(t, _index, origin) {
var templateMapper = combineTypeMappers(type.mapper, createTypeMapper([typeParameter], [t]));
var propType = instantiateType(templateType, templateMapper);
- if (t.flags & 1120) {
+ if (t.flags & 2240) {
var propName = getLateBoundNameFromType(t);
var modifiersProp = getPropertyOfType(modifiersType, propName);
var isOptional = !!(templateModifiers & 4 ||
@@ -26452,10 +26629,10 @@ var ts;
prop.nameType = t;
members.set(propName, prop);
}
- else if (t.flags & (1 | 2)) {
+ else if (t.flags & (1 | 4)) {
stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1));
}
- else if (t.flags & 4) {
+ else if (t.flags & 8) {
numberIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1));
}
}
@@ -26466,20 +26643,20 @@ var ts;
}
function getConstraintTypeFromMappedType(type) {
return type.constraintType ||
- (type.constraintType = instantiateType(getConstraintOfTypeParameter(getTypeParameterFromMappedType(type)), type.mapper || identityMapper) || unknownType);
+ (type.constraintType = instantiateType(getConstraintOfTypeParameter(getTypeParameterFromMappedType(type)), type.mapper || identityMapper) || errorType);
}
function getTemplateTypeFromMappedType(type) {
return type.templateType ||
(type.templateType = type.declaration.type ?
instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4)), type.mapper || identityMapper) :
- unknownType);
+ errorType);
}
function getConstraintDeclarationForMappedType(type) {
return type.declaration.typeParameter.constraint;
}
function isMappedTypeWithKeyofConstraintDeclaration(type) {
var constraintDeclaration = getConstraintDeclarationForMappedType(type);
- return constraintDeclaration.kind === 174 &&
+ return constraintDeclaration.kind === 175 &&
constraintDeclaration.operator === 128;
}
function getModifiersTypeFromMappedType(type) {
@@ -26490,8 +26667,8 @@ var ts;
else {
var declaredType = getTypeFromMappedTypeNode(type.declaration);
var constraint = getConstraintTypeFromMappedType(declaredType);
- var extendedConstraint = constraint && constraint.flags & 32768 ? getConstraintOfTypeParameter(constraint) : constraint;
- type.modifiersType = extendedConstraint && extendedConstraint.flags & 524288 ? instantiateType(extendedConstraint.type, type.mapper || identityMapper) : emptyObjectType;
+ var extendedConstraint = constraint && constraint.flags & 65536 ? getConstraintOfTypeParameter(constraint) : constraint;
+ type.modifiersType = extendedConstraint && extendedConstraint.flags & 1048576 ? instantiateType(extendedConstraint.type, type.mapper || identityMapper) : emptyObjectType;
}
}
return type.modifiersType;
@@ -26514,11 +26691,11 @@ var ts;
return !!(ts.getObjectFlags(type) & 32 && getMappedTypeModifiers(type) & 4);
}
function isGenericMappedType(type) {
- return ts.getObjectFlags(type) & 32 && isGenericIndexType(getConstraintTypeFromMappedType(type));
+ return !!(ts.getObjectFlags(type) & 32) && isGenericIndexType(getConstraintTypeFromMappedType(type));
}
function resolveStructuredTypeMembers(type) {
if (!type.members) {
- if (type.flags & 65536) {
+ if (type.flags & 131072) {
if (type.objectFlags & 4) {
resolveTypeReferenceMembers(type);
}
@@ -26535,23 +26712,23 @@ var ts;
resolveMappedTypeMembers(type);
}
}
- else if (type.flags & 131072) {
+ else if (type.flags & 262144) {
resolveUnionTypeMembers(type);
}
- else if (type.flags & 262144) {
+ else if (type.flags & 524288) {
resolveIntersectionTypeMembers(type);
}
}
return type;
}
function getPropertiesOfObjectType(type) {
- if (type.flags & 65536) {
+ if (type.flags & 131072) {
return resolveStructuredTypeMembers(type).properties;
}
return ts.emptyArray;
}
function getPropertyOfObjectType(type, name) {
- if (type.flags & 65536) {
+ if (type.flags & 131072) {
var resolved = resolveStructuredTypeMembers(type);
var symbol = resolved.members.get(name);
if (symbol && symbolIsValue(symbol)) {
@@ -26573,7 +26750,7 @@ var ts;
}
}
}
- if (type.flags & 131072) {
+ if (type.flags & 262144) {
break;
}
}
@@ -26583,13 +26760,13 @@ var ts;
}
function getPropertiesOfType(type) {
type = getApparentType(type);
- return type.flags & 393216 ?
+ return type.flags & 786432 ?
getPropertiesOfUnionOrIntersectionType(type) :
getPropertiesOfObjectType(type);
}
function getAllPossiblePropertiesOfTypes(types) {
var unionType = getUnionType(types);
- if (!(unionType.flags & 131072)) {
+ if (!(unionType.flags & 262144)) {
return getAugmentedPropertiesOfType(unionType);
}
var props = ts.createSymbolTable();
@@ -26607,9 +26784,9 @@ var ts;
return ts.arrayFrom(props.values());
}
function getConstraintOfType(type) {
- return type.flags & 32768 ? getConstraintOfTypeParameter(type) :
- type.flags & 1048576 ? getConstraintOfIndexedAccess(type) :
- type.flags & 2097152 ? getConstraintOfConditionalType(type) :
+ return type.flags & 65536 ? getConstraintOfTypeParameter(type) :
+ type.flags & 2097152 ? getConstraintOfIndexedAccess(type) :
+ type.flags & 4194304 ? getConstraintOfConditionalType(type) :
getBaseConstraintOfType(type);
}
function getConstraintOfTypeParameter(typeParameter) {
@@ -26619,12 +26796,12 @@ var ts;
var objectType = getBaseConstraintOfType(type.objectType) || type.objectType;
var indexType = getBaseConstraintOfType(type.indexType) || type.indexType;
var constraint = !isGenericObjectType(objectType) && !isGenericIndexType(indexType) ? getIndexedAccessType(objectType, indexType) : undefined;
- return constraint && constraint !== unknownType ? constraint : undefined;
+ return constraint && constraint !== errorType ? constraint : undefined;
}
function getDefaultConstraintOfConditionalType(type) {
if (!type.resolvedDefaultConstraint) {
var rootTrueType = type.root.trueType;
- var rootTrueConstraint = rootTrueType.flags & 4194304 ? rootTrueType.substitute : rootTrueType;
+ var rootTrueConstraint = rootTrueType.flags & 8388608 ? rootTrueType.substitute : rootTrueType;
type.resolvedDefaultConstraint = getUnionType([instantiateType(rootTrueConstraint, type.combinedMapper || type.mapper), getFalseTypeFromConditionalType(type)]);
}
return type.resolvedDefaultConstraint;
@@ -26635,7 +26812,7 @@ var ts;
if (constraint) {
var mapper = makeUnaryTypeMapper(type.root.checkType, constraint);
var instantiated = getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper));
- if (!(instantiated.flags & 16384)) {
+ if (!(instantiated.flags & 32768)) {
return instantiated;
}
}
@@ -26650,19 +26827,19 @@ var ts;
var hasDisjointDomainType = false;
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
var t = _a[_i];
- if (t.flags & 7897088) {
+ if (t.flags & 15794176) {
var constraint = getConstraintOfType(t);
- while (constraint && constraint.flags & (32768 | 524288 | 2097152)) {
+ while (constraint && constraint.flags & (65536 | 1048576 | 4194304)) {
constraint = getConstraintOfType(constraint);
}
if (constraint) {
- if (!(constraint.flags & 131072)) {
+ if (!(constraint.flags & 262144)) {
return undefined;
}
constraints = ts.append(constraints, constraint);
}
}
- else if (t.flags & 134233854) {
+ else if (t.flags & 16809468) {
hasDisjointDomainType = true;
}
}
@@ -26670,7 +26847,7 @@ var ts;
if (hasDisjointDomainType) {
for (var _b = 0, _c = type.types; _b < _c.length; _b++) {
var t = _c[_b];
- if (t.flags & 134233854) {
+ if (t.flags & 16809468) {
constraints = ts.append(constraints, t);
}
}
@@ -26680,7 +26857,7 @@ var ts;
return undefined;
}
function getBaseConstraintOfInstantiableNonPrimitiveUnionOrIntersection(type) {
- if (type.flags & (7372800 | 393216)) {
+ if (type.flags & (14745600 | 786432)) {
var constraint = getResolvedBaseConstraint(type);
if (constraint !== noConstraintType && constraint !== circularConstraintType) {
return constraint;
@@ -26689,7 +26866,7 @@ var ts;
}
function getBaseConstraintOfType(type) {
var constraint = getBaseConstraintOfInstantiableNonPrimitiveUnionOrIntersection(type);
- if (!constraint && type.flags & 524288) {
+ if (!constraint && type.flags & 1048576) {
return keyofConstraintType;
}
return constraint;
@@ -26720,13 +26897,13 @@ var ts;
return result;
}
function computeBaseConstraint(t) {
- if (t.flags & 32768) {
+ if (t.flags & 65536) {
var constraint = getConstraintFromTypeParameter(t);
return t.isThisType || !constraint ?
constraint :
getBaseConstraint(constraint);
}
- if (t.flags & 393216) {
+ if (t.flags & 786432) {
var types = t.types;
var baseTypes = [];
for (var _i = 0, types_4 = types; _i < types_4.length; _i++) {
@@ -26736,24 +26913,24 @@ var ts;
baseTypes.push(baseType);
}
}
- return t.flags & 131072 && baseTypes.length === types.length ? getUnionType(baseTypes) :
- t.flags & 262144 && baseTypes.length ? getIntersectionType(baseTypes) :
+ return t.flags & 262144 && baseTypes.length === types.length ? getUnionType(baseTypes) :
+ t.flags & 524288 && baseTypes.length ? getIntersectionType(baseTypes) :
undefined;
}
- if (t.flags & 524288) {
+ if (t.flags & 1048576) {
return keyofConstraintType;
}
- if (t.flags & 1048576) {
+ if (t.flags & 2097152) {
var baseObjectType = getBaseConstraint(t.objectType);
var baseIndexType = getBaseConstraint(t.indexType);
var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined;
- return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined;
+ return baseIndexedAccess && baseIndexedAccess !== errorType ? getBaseConstraint(baseIndexedAccess) : undefined;
}
- if (t.flags & 2097152) {
+ if (t.flags & 4194304) {
var constraint = getConstraintOfConditionalType(t);
return constraint && getBaseConstraint(constraint);
}
- if (t.flags & 4194304) {
+ if (t.flags & 8388608) {
return getBaseConstraint(t.substitute);
}
if (isGenericMappedType(t)) {
@@ -26796,19 +26973,19 @@ var ts;
return !!(typeParameter.symbol && ts.forEach(typeParameter.symbol.declarations, function (decl) { return ts.isTypeParameterDeclaration(decl) && decl.default; }));
}
function getApparentType(type) {
- var t = type.flags & 7897088 ? getBaseConstraintOfType(type) || emptyObjectType : type;
- return t.flags & 262144 ? getApparentTypeOfIntersectionType(t) :
- t.flags & 34 ? globalStringType :
- t.flags & 84 ? globalNumberType :
- t.flags & 136 ? globalBooleanType :
- t.flags & 1536 ? getGlobalESSymbolType(languageVersion >= 2) :
- t.flags & 134217728 ? emptyObjectType :
- t.flags & 524288 ? keyofConstraintType :
+ var t = type.flags & 15794176 ? getBaseConstraintOfType(type) || emptyObjectType : type;
+ return t.flags & 524288 ? getApparentTypeOfIntersectionType(t) :
+ t.flags & 68 ? globalStringType :
+ t.flags & 168 ? globalNumberType :
+ t.flags & 272 ? globalBooleanType :
+ t.flags & 3072 ? getGlobalESSymbolType(languageVersion >= 2) :
+ t.flags & 16777216 ? emptyObjectType :
+ t.flags & 1048576 ? keyofConstraintType :
t;
}
function createUnionOrIntersectionProperty(containingType, name) {
var props;
- var isUnion = containingType.flags & 131072;
+ var isUnion = containingType.flags & 262144;
var excludeModifiers = isUnion ? 24 : 0;
var commonFlags = isUnion ? 0 : 16777216;
var syntheticFlag = 4;
@@ -26816,7 +26993,7 @@ var ts;
for (var _i = 0, _a = containingType.types; _i < _a.length; _i++) {
var current = _a[_i];
var type = getApparentType(current);
- if (type !== unknownType) {
+ if (type !== errorType) {
var prop = getPropertyOfType(type, name);
var modifiers = prop ? ts.getDeclarationModifierFlagsFromSymbol(prop) : 0;
if (prop && !(modifiers & excludeModifiers)) {
@@ -26898,7 +27075,7 @@ var ts;
}
function getPropertyOfType(type, name) {
type = getApparentType(type);
- if (type.flags & 65536) {
+ if (type.flags & 131072) {
var resolved = resolveStructuredTypeMembers(type);
var symbol = resolved.members.get(name);
if (symbol && symbolIsValue(symbol)) {
@@ -26912,13 +27089,13 @@ var ts;
}
return getPropertyOfObjectType(globalObjectType, name);
}
- if (type.flags & 393216) {
+ if (type.flags & 786432) {
return getPropertyOfUnionOrIntersectionType(type, name);
}
return undefined;
}
function getSignaturesOfStructuredType(type, kind) {
- if (type.flags & 458752) {
+ if (type.flags & 917504) {
var resolved = resolveStructuredTypeMembers(type);
return kind === 0 ? resolved.callSignatures : resolved.constructSignatures;
}
@@ -26928,7 +27105,7 @@ var ts;
return getSignaturesOfStructuredType(getApparentType(type), kind);
}
function getIndexInfoOfStructuredType(type, kind) {
- if (type.flags & 458752) {
+ if (type.flags & 917504) {
var resolved = resolveStructuredTypeMembers(type);
return kind === 0 ? resolved.stringIndexInfo : resolved.numberIndexInfo;
}
@@ -26976,10 +27153,10 @@ var ts;
return result;
}
function isJSDocOptionalParameter(node) {
- return ts.isInJavaScriptFile(node) && (node.type && node.type.kind === 282
+ return ts.isInJavaScriptFile(node) && (node.type && node.type.kind === 283
|| ts.getJSDocParameterTags(node).some(function (_a) {
var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression;
- return isBracketed || !!typeExpression && typeExpression.type.kind === 282;
+ return isBracketed || !!typeExpression && typeExpression.type.kind === 283;
}));
}
function tryFindAmbientModule(moduleName, withAugmentations) {
@@ -27012,7 +27189,7 @@ var ts;
return false;
}
var isBracketed = node.isBracketed, typeExpression = node.typeExpression;
- return isBracketed || !!typeExpression && typeExpression.type.kind === 282;
+ return isBracketed || !!typeExpression && typeExpression.type.kind === 283;
}
function createTypePredicateFromTypePredicateNode(node) {
var parameterName = node.parameterName;
@@ -27072,7 +27249,7 @@ var ts;
var hasLiteralTypes = false;
var minArgumentCount = 0;
var thisParameter = void 0;
- var hasThisParameter = void 0;
+ var hasThisParameter = false;
var iife = ts.getImmediatelyInvokedFunctionExpression(declaration);
var isJSConstructSignature = ts.isJSDocConstructSignature(declaration);
var isUntypedSignatureInJSFile = !iife &&
@@ -27095,7 +27272,7 @@ var ts;
else {
parameters.push(paramSymbol);
}
- if (type && type.kind === 177) {
+ if (type && type.kind === 178) {
hasLiteralTypes = true;
}
var isOptionalParameter_1 = isOptionalJSDocParameterTag(param) ||
@@ -27107,16 +27284,16 @@ var ts;
minArgumentCount = parameters.length;
}
}
- if ((declaration.kind === 155 || declaration.kind === 156) &&
+ if ((declaration.kind === 156 || declaration.kind === 157) &&
!hasNonBindableDynamicName(declaration) &&
(!hasThisParameter || !thisParameter)) {
- var otherKind = declaration.kind === 155 ? 156 : 155;
+ var otherKind = declaration.kind === 156 ? 157 : 156;
var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind);
if (other) {
thisParameter = getAnnotatedAccessorThisParameter(other);
}
}
- var classType = declaration.kind === 154 ?
+ var classType = declaration.kind === 155 ?
getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol))
: undefined;
var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration);
@@ -27155,8 +27332,8 @@ var ts;
if (typeNode) {
return getTypeFromTypeNode(typeNode);
}
- if (declaration.kind === 155 && !hasNonBindableDynamicName(declaration)) {
- var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 156);
+ if (declaration.kind === 156 && !hasNonBindableDynamicName(declaration)) {
+ var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 157);
return getAnnotatedAccessorType(setter);
}
if (ts.nodeIsMissing(declaration.body)) {
@@ -27180,14 +27357,14 @@ var ts;
switch (node.kind) {
case 71:
return node.escapedText === "arguments" && ts.isExpressionNode(node);
- case 151:
- case 153:
- case 155:
+ case 152:
+ case 154:
case 156:
- return node.name.kind === 146
+ case 157:
+ return node.name.kind === 147
&& traverse(node.name);
default:
- return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && ts.forEachChild(node, traverse);
+ return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse);
}
}
}
@@ -27197,16 +27374,15 @@ var ts;
var result = [];
for (var i = 0; i < symbol.declarations.length; i++) {
var decl = symbol.declarations[i];
- var node = ts.isPropertyAccessExpression(decl) ? ts.getAssignedJavascriptInitializer(decl) : decl;
- if (!ts.isFunctionLike(node))
+ if (!ts.isFunctionLike(decl))
continue;
- if (i > 0 && node.body) {
+ if (i > 0 && decl.body) {
var previous = symbol.declarations[i - 1];
- if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) {
+ if (decl.parent === previous.parent && decl.kind === previous.kind && decl.pos === previous.end) {
continue;
}
}
- result.push(getSignatureFromDeclaration(node));
+ result.push(getSignatureFromDeclaration(decl));
}
return result;
}
@@ -27239,7 +27415,7 @@ var ts;
}
else {
var declaration = signature.declaration;
- signature.resolvedTypePredicate = declaration && declaration.type && declaration.type.kind === 160 ?
+ signature.resolvedTypePredicate = declaration && declaration.type && declaration.type.kind === 161 ?
createTypePredicateFromTypePredicateNode(declaration.type) :
noTypePredicate;
}
@@ -27250,7 +27426,7 @@ var ts;
function getReturnTypeOfSignature(signature) {
if (!signature.resolvedReturnType) {
if (!pushTypeResolution(signature, 3)) {
- return unknownType;
+ return errorType;
}
var type = void 0;
if (signature.target) {
@@ -27284,7 +27460,7 @@ var ts;
}
function getRestTypeOfSignature(signature) {
if (signature.hasRestParameter) {
- var type = getTypeOfSymbol(ts.lastOrUndefined(signature.parameters));
+ var type = getTypeOfSymbol(ts.last(signature.parameters));
if (ts.getObjectFlags(type) & 4 && type.target === globalArrayType) {
return type.typeArguments[0];
}
@@ -27334,7 +27510,7 @@ var ts;
}
function getOrCreateTypeFromSignature(signature) {
if (!signature.isolatedSignatureType) {
- var isConstructor = signature.declaration.kind === 154 || signature.declaration.kind === 158;
+ var isConstructor = signature.declaration.kind === 155 || signature.declaration.kind === 159;
var type = createObjectType(16);
type.members = emptySymbols;
type.properties = ts.emptyArray;
@@ -27375,7 +27551,7 @@ var ts;
return undefined;
}
function getConstraintDeclaration(type) {
- var decl = type.symbol && ts.getDeclarationOfKind(type.symbol, 147);
+ var decl = type.symbol && ts.getDeclarationOfKind(type.symbol, 148);
return decl && decl.constraint;
}
function getInferredTypeParameterConstraint(typeParameter) {
@@ -27383,7 +27559,7 @@ 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 === 171 && declaration.parent.parent.kind === 161) {
+ if (declaration.parent.kind === 172 && declaration.parent.parent.kind === 162) {
var typeReference = declaration.parent.parent;
var typeParameters = getTypeParametersForTypeReference(typeReference);
if (typeParameters) {
@@ -27419,7 +27595,7 @@ var ts;
return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint;
}
function getParentSymbolOfTypeParameter(typeParameter) {
- return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 147).parent);
+ return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 148).parent);
}
function getTypeListId(types) {
var result = "";
@@ -27452,7 +27628,7 @@ var ts;
result |= type.flags;
}
}
- return result & 117440512;
+ return result & 939524096;
}
function createTypeReference(target, typeArguments) {
var id = getTypeListId(typeArguments);
@@ -27486,7 +27662,7 @@ var ts;
var isJs = ts.isInJavaScriptFile(node);
var isJsImplicitAny = !noImplicitAny && isJs;
if (!isJsImplicitAny && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) {
- var missingAugmentsTag = isJs && node.parent.kind !== 289;
+ var missingAugmentsTag = isJs && node.parent.kind !== 290;
var diag = minTypeArgumentCount === typeParameters.length
? missingAugmentsTag
? ts.Diagnostics.Expected_0_type_arguments_provide_these_with_an_extends_tag
@@ -27497,13 +27673,13 @@ var ts;
var typeStr = typeToString(type, undefined, 2);
error(node, diag, typeStr, minTypeArgumentCount, typeParameters.length);
if (!isJs) {
- return unknownType;
+ return errorType;
}
}
var typeArguments = ts.concatenate(type.outerTypeParameters, fillMissingTypeArguments(typeArgs, typeParameters, minTypeArgumentCount, isJs));
return createTypeReference(type, typeArguments);
}
- return checkNoTypeArguments(node, symbol) ? type : unknownType;
+ return checkNoTypeArguments(node, symbol) ? type : errorType;
}
function getTypeAliasInstantiation(symbol, typeArguments) {
var type = getDeclaredTypeOfSymbol(symbol);
@@ -27526,17 +27702,17 @@ var ts;
error(node, minTypeArgumentCount === typeParameters.length
? ts.Diagnostics.Generic_type_0_requires_1_type_argument_s
: ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, symbolToString(symbol), minTypeArgumentCount, typeParameters.length);
- return unknownType;
+ return errorType;
}
return getTypeAliasInstantiation(symbol, typeArguments);
}
- return checkNoTypeArguments(node, symbol) ? type : unknownType;
+ return checkNoTypeArguments(node, symbol) ? type : errorType;
}
function getTypeReferenceName(node) {
switch (node.kind) {
- case 161:
+ case 162:
return node.typeName;
- case 206:
+ case 207:
var expr = node.expression;
if (ts.isEntityNameExpression(expr)) {
return expr;
@@ -27553,7 +27729,7 @@ var ts;
function getTypeReferenceType(node, symbol) {
var typeArguments = typeArgumentsFromTypeReferenceNode(node);
if (symbol === unknownSymbol) {
- return unknownType;
+ return errorType;
}
var type = getTypeReferenceTypeWorker(node, symbol, typeArguments);
if (type) {
@@ -27562,11 +27738,11 @@ var ts;
var res = tryGetDeclaredTypeOfSymbol(symbol);
if (res) {
return checkNoTypeArguments(node, symbol) ?
- res.flags & 32768 ? getConstrainedTypeVariable(res, node) : res :
- unknownType;
+ res.flags & 65536 ? getConstrainedTypeVariable(res, node) : res :
+ errorType;
}
if (!(symbol.flags & 67216319 && isJSDocTypeReference(node))) {
- return unknownType;
+ return errorType;
}
var jsdocType = getJSDocTypeReference(node, symbol, typeArguments);
if (jsdocType) {
@@ -27580,7 +27756,7 @@ var ts;
var valueType = getTypeOfSymbol(symbol);
var referenceType = valueType.symbol && valueType.symbol !== symbol && !isInferredClassType(valueType) && getTypeReferenceTypeWorker(node, valueType.symbol, typeArguments);
if (referenceType || assignedType) {
- return referenceType && assignedType ? getIntersectionType([assignedType, referenceType]) : referenceType || assignedType;
+ return (referenceType && assignedType ? getIntersectionType([assignedType, referenceType]) : referenceType || assignedType);
}
}
function getTypeReferenceTypeWorker(node, symbol, typeArguments) {
@@ -27603,13 +27779,13 @@ var ts;
}
}
function getSubstitutionType(typeVariable, substitute) {
- var result = createType(4194304);
+ var result = createType(8388608);
result.typeVariable = typeVariable;
result.substitute = substitute;
return result;
}
function isUnaryTupleTypeNode(node) {
- return node.kind === 167 && node.elementTypes.length === 1;
+ return node.kind === 168 && node.elementTypes.length === 1;
}
function getImpliedConstraint(typeVariable, checkNode, extendsNode) {
return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(typeVariable, checkNode.elementTypes[0], extendsNode.elementTypes[0]) :
@@ -27618,9 +27794,9 @@ var ts;
}
function getConstrainedTypeVariable(typeVariable, node) {
var constraints;
- while (node && !ts.isStatement(node) && node.kind !== 285) {
+ while (node && !ts.isStatement(node) && node.kind !== 286) {
var parent = node.parent;
- if (parent.kind === 170 && node === parent.trueType) {
+ if (parent.kind === 171 && node === parent.trueType) {
var constraint = getImpliedConstraint(typeVariable, parent.checkType, parent.extendsType);
if (constraint) {
constraints = ts.append(constraints, constraint);
@@ -27631,7 +27807,7 @@ var ts;
return constraints ? getSubstitutionType(typeVariable, getIntersectionType(ts.append(constraints, typeVariable))) : typeVariable;
}
function isJSDocTypeReference(node) {
- return node.flags & 2097152 && node.kind === 161;
+ return !!(node.flags & 2097152) && node.kind === 162;
}
function checkNoTypeArguments(node, symbol) {
if (node.typeArguments) {
@@ -27678,7 +27854,7 @@ var ts;
var indexed = getTypeFromTypeNode(typeArgs[0]);
var target = getTypeFromTypeNode(typeArgs[1]);
var index = createIndexInfo(target, false);
- return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType && index, indexed === numberType && index);
+ return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType ? index : undefined, indexed === numberType ? index : undefined);
}
return anyType;
}
@@ -27689,7 +27865,7 @@ var ts;
}
function getTypeFromJSDocNullableTypeNode(node) {
var type = getTypeFromTypeNode(node.type);
- return strictNullChecks ? getNullableType(type, 8192) : type;
+ return strictNullChecks ? getNullableType(type, 16384) : type;
}
function getTypeFromTypeReference(node) {
var links = getNodeLinks(node);
@@ -27726,9 +27902,9 @@ var ts;
for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) {
var declaration = declarations_3[_i];
switch (declaration.kind) {
- case 234:
case 235:
- case 237:
+ case 236:
+ case 238:
return declaration;
}
}
@@ -27737,7 +27913,7 @@ var ts;
return arity ? emptyGenericType : emptyObjectType;
}
var type = getDeclaredTypeOfSymbol(symbol);
- if (!(type.flags & 65536)) {
+ if (!(type.flags & 131072)) {
error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, ts.symbolName(symbol));
return arity ? emptyGenericType : emptyObjectType;
}
@@ -27842,7 +28018,7 @@ var ts;
var typeParameters = [];
var properties = [];
for (var i = 0; i < arity; i++) {
- var typeParameter = createType(32768);
+ var typeParameter = createType(65536);
typeParameters.push(typeParameter);
var property = createSymbol(4, "" + i);
property.type = typeParameter;
@@ -27859,7 +28035,7 @@ var ts;
type.instantiations.set(getTypeListId(type.typeParameters), type);
type.target = type;
type.typeArguments = type.typeParameters;
- type.thisType = createType(32768);
+ type.thisType = createType(65536);
type.thisType.isThisType = true;
type.thisType.constraint = type;
type.declaredProperties = properties;
@@ -27892,16 +28068,16 @@ var ts;
var combined = 0;
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
var t = _a[_i];
- if (t.flags & 13536 && combined & 13536) {
+ if (t.flags & 27072 && combined & 27072) {
return true;
}
combined |= t.flags;
- if (combined & 12288 && combined & (65536 | 134217728) ||
- combined & 134217728 && combined & (134233854 & ~134217728) ||
- combined & 34 && combined & (134233854 & ~34) ||
- combined & 84 && combined & (134233854 & ~84) ||
- combined & 1536 && combined & (134233854 & ~1536) ||
- combined & 6144 && combined & (134233854 & ~6144)) {
+ if (combined & 24576 && combined & (131072 | 16777216) ||
+ combined & 16777216 && combined & (16809468 & ~16777216) ||
+ combined & 68 && combined & (16809468 & ~68) ||
+ combined & 168 && combined & (16809468 & ~168) ||
+ combined & 3072 && combined & (16809468 & ~3072) ||
+ combined & 12288 && combined & (16809468 & ~12288)) {
return true;
}
}
@@ -27909,24 +28085,24 @@ var ts;
}
function addTypeToUnion(typeSet, includes, type) {
var flags = type.flags;
- if (flags & 131072) {
+ if (flags & 262144) {
return addTypesToUnion(typeSet, includes, type.types);
}
- if (!(flags & 16384 || flags & 262144 && isEmptyIntersectionType(type))) {
- includes |= flags & ~117440512;
- if (flags & 1) {
+ if (!(flags & 32768 || flags & 524288 && isEmptyIntersectionType(type))) {
+ includes |= flags & ~939524096;
+ if (flags & 3) {
if (type === wildcardType)
- includes |= 33554432;
+ includes |= 268435456;
}
- else if (!strictNullChecks && flags & 12288) {
- if (!(flags & 16777216))
- includes |= 16777216;
+ else if (!strictNullChecks && flags & 24576) {
+ if (!(flags & 134217728))
+ includes |= 134217728;
}
else {
var len = typeSet.length;
var index = len && type.id > typeSet[len - 1].id ? ~len : ts.binarySearch(typeSet, type, getTypeId, ts.compareValues);
if (index < 0) {
- if (!(flags & 65536 && type.objectFlags & 16 &&
+ if (!(flags & 131072 && type.objectFlags & 16 &&
type.symbol && type.symbol.flags & (16 | 8192) && containsIdenticalType(typeSet, type))) {
typeSet.splice(~index, 0, type);
}
@@ -27964,11 +28140,11 @@ var ts;
}
function isSetOfLiteralsFromSameEnum(types) {
var first = types[0];
- if (first.flags & 256) {
+ if (first.flags & 512) {
var firstEnum = getParentOfSymbol(first.symbol);
for (var i = 1; i < types.length; i++) {
var other = types[i];
- if (!(other.flags & 256) || (firstEnum !== getParentOfSymbol(other.symbol))) {
+ if (!(other.flags & 512) || (firstEnum !== getParentOfSymbol(other.symbol))) {
return false;
}
}
@@ -27993,10 +28169,10 @@ var ts;
while (i > 0) {
i--;
var t = types[i];
- var remove = t.flags & 32 && includes & 2 ||
- t.flags & 64 && includes & 4 ||
- t.flags & 1024 && includes & 512 ||
- t.flags & 96 && t.flags & 8388608 && containsType(types, t.regularType);
+ var remove = t.flags & 64 && includes & 4 ||
+ t.flags & 128 && includes & 8 ||
+ t.flags & 2048 && includes & 1024 ||
+ t.flags & 192 && t.flags & 33554432 && containsType(types, t.regularType);
if (remove) {
ts.orderedRemoveItemAt(types, i);
}
@@ -28012,12 +28188,12 @@ var ts;
}
var typeSet = [];
var includes = addTypesToUnion(typeSet, 0, types);
- if (includes & 1) {
- return includes & 33554432 ? wildcardType : anyType;
+ if (includes & 3) {
+ return includes & 1 ? includes & 268435456 ? wildcardType : anyType : unknownType;
}
switch (unionReduction) {
case 1:
- if (includes & 1120) {
+ if (includes & 2240) {
removeRedundantLiteralTypes(typeSet, includes);
}
break;
@@ -28026,11 +28202,11 @@ var ts;
break;
}
if (typeSet.length === 0) {
- return includes & 8192 ? includes & 16777216 ? nullType : nullWideningType :
- includes & 4096 ? includes & 16777216 ? undefinedType : undefinedWideningType :
+ return includes & 16384 ? includes & 134217728 ? nullType : nullWideningType :
+ includes & 8192 ? includes & 134217728 ? undefinedType : undefinedWideningType :
neverType;
}
- return getUnionTypeFromSortedList(typeSet, includes & 8374815 ? 0 : 268435456, aliasSymbol, aliasTypeArguments);
+ return getUnionTypeFromSortedList(typeSet, includes & 16749629 ? 0 : 67108864, aliasSymbol, aliasTypeArguments);
}
function getUnionTypePredicate(signatures) {
var first;
@@ -28074,8 +28250,8 @@ var ts;
var id = getTypeListId(types);
var type = unionTypes.get(id);
if (!type) {
- var propagatedFlags = getPropagatingFlagsOfTypes(types, 12288);
- type = createType(131072 | propagatedFlags | unionOfUnitTypes);
+ var propagatedFlags = getPropagatingFlagsOfTypes(types, 24576);
+ type = createType(262144 | propagatedFlags | unionOfUnitTypes);
unionTypes.set(id, type);
type.types = types;
type.aliasSymbol = aliasSymbol;
@@ -28093,20 +28269,20 @@ var ts;
}
function addTypeToIntersection(typeSet, includes, type) {
var flags = type.flags;
- if (flags & 262144) {
+ if (flags & 524288) {
return addTypesToIntersection(typeSet, includes, type.types);
}
if (ts.getObjectFlags(type) & 16 && isEmptyObjectType(type)) {
- includes |= 67108864;
+ includes |= 536870912;
}
else {
- includes |= flags & ~117440512;
- if (flags & 1) {
+ includes |= flags & ~939524096;
+ if (flags & 3) {
if (type === wildcardType)
- includes |= 33554432;
+ includes |= 268435456;
}
- else if ((strictNullChecks || !(flags & 12288)) && !ts.contains(typeSet, type) &&
- !(flags & 65536 && type.objectFlags & 16 &&
+ else if ((strictNullChecks || !(flags & 24576)) && !ts.contains(typeSet, type) &&
+ !(flags & 131072 && type.objectFlags & 16 &&
type.symbol && type.symbol.flags & (16 | 8192) &&
containsIdenticalType(typeSet, type))) {
typeSet.push(type);
@@ -28126,22 +28302,22 @@ var ts;
while (i > 0) {
i--;
var t = types[i];
- var remove = t.flags & 2 && includes & 32 ||
- t.flags & 4 && includes & 64 ||
- t.flags & 512 && includes & 1024;
+ var remove = t.flags & 4 && includes & 64 ||
+ t.flags & 8 && includes & 128 ||
+ t.flags & 1024 && includes & 2048;
if (remove) {
ts.orderedRemoveItemAt(types, i);
}
}
}
function intersectUnionsOfUnitTypes(types) {
- var unionIndex = ts.findIndex(types, function (t) { return (t.flags & 268435456) !== 0; });
+ var unionIndex = ts.findIndex(types, function (t) { return (t.flags & 67108864) !== 0; });
var unionType = types[unionIndex];
var intersection = unionType.types;
var i = types.length - 1;
var _loop_5 = function () {
var t = types[i];
- if (t.flags & 268435456) {
+ if (t.flags & 67108864) {
intersection = ts.filter(intersection, function (u) { return containsType(t.types, u); });
ts.orderedRemoveItemAt(types, i);
}
@@ -28153,45 +28329,48 @@ var ts;
if (intersection === unionType.types) {
return false;
}
- types[unionIndex] = getUnionTypeFromSortedList(intersection, unionType.flags & 268435456);
+ types[unionIndex] = getUnionTypeFromSortedList(intersection, unionType.flags & 67108864);
return true;
}
function getIntersectionType(types, aliasSymbol, aliasTypeArguments) {
- if (types.length === 0) {
- return emptyObjectType;
- }
var typeSet = [];
var includes = addTypesToIntersection(typeSet, 0, types);
- if (includes & 16384) {
+ if (includes & 32768) {
return neverType;
}
if (includes & 1) {
- return includes & 33554432 ? wildcardType : anyType;
+ return includes & 268435456 ? wildcardType : anyType;
}
- if (includes & 2 && includes & 32 ||
- includes & 4 && includes & 64 ||
- includes & 512 && includes & 1024) {
+ if (!strictNullChecks && includes & 24576) {
+ return includes & 8192 ? undefinedType : nullType;
+ }
+ if (includes & 4 && includes & 64 ||
+ includes & 8 && includes & 128 ||
+ includes & 1024 && includes & 2048) {
removeRedundantPrimitiveTypes(typeSet, includes);
}
- if (includes & 67108864 && !(includes & 65536)) {
+ if (includes & 536870912 && !(includes & 131072)) {
typeSet.push(emptyObjectType);
}
+ if (typeSet.length === 0) {
+ return unknownType;
+ }
if (typeSet.length === 1) {
return typeSet[0];
}
- if (includes & 131072) {
- if (includes & 268435456 && intersectUnionsOfUnitTypes(typeSet)) {
+ if (includes & 262144) {
+ if (includes & 67108864 && intersectUnionsOfUnitTypes(typeSet)) {
return getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
}
- var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 131072) !== 0; });
+ var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 262144) !== 0; });
var unionType = typeSet[unionIndex_1];
return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex_1, t)); }), 1, aliasSymbol, aliasTypeArguments);
}
var id = getTypeListId(typeSet);
var type = intersectionTypes.get(id);
if (!type) {
- var propagatedFlags = getPropagatingFlagsOfTypes(typeSet, 12288);
- type = createType(262144 | propagatedFlags);
+ var propagatedFlags = getPropagatingFlagsOfTypes(typeSet, 24576);
+ type = createType(524288 | propagatedFlags);
intersectionTypes.set(id, type);
type.types = typeSet;
type.aliasSymbol = aliasSymbol;
@@ -28208,7 +28387,7 @@ var ts;
return links.resolvedType;
}
function createIndexType(type, stringsOnly) {
- var result = createType(524288);
+ var result = createType(1048576);
result.type = type;
result.stringsOnly = stringsOnly;
return result;
@@ -28224,7 +28403,7 @@ var ts;
if (!type && !ts.isKnownSymbol(prop)) {
var name = ts.getNameOfDeclaration(prop.valueDeclaration);
type = name && ts.isNumericLiteral(name) ? getLiteralType(+name.text) :
- name && name.kind === 146 && ts.isNumericLiteral(name.expression) ? getLiteralType(+name.expression.text) :
+ name && name.kind === 147 && ts.isNumericLiteral(name.expression) ? getLiteralType(+name.expression.text) :
getLiteralType(ts.symbolName(prop));
}
if (type && type.flags & include) {
@@ -28242,16 +28421,16 @@ var ts;
}
function getIndexType(type, stringsOnly) {
if (stringsOnly === void 0) { stringsOnly = keyofStringsOnly; }
- return type.flags & 131072 ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly); })) :
- type.flags & 262144 ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly); })) :
- maybeTypeOfKind(type, 7372800) ? getIndexTypeForGenericType(type, stringsOnly) :
+ return type.flags & 262144 ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly); })) :
+ type.flags & 524288 ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly); })) :
+ maybeTypeOfKind(type, 14745600) ? getIndexTypeForGenericType(type, stringsOnly) :
ts.getObjectFlags(type) & 32 ? getConstraintTypeFromMappedType(type) :
type === wildcardType ? wildcardType :
type.flags & 1 ? keyofConstraintType :
- stringsOnly ? getIndexInfoOfType(type, 0) ? stringType : getLiteralTypeFromPropertyNames(type, 32) :
- getIndexInfoOfType(type, 0) ? getUnionType([stringType, numberType, getLiteralTypeFromPropertyNames(type, 1024)]) :
- getNonEnumNumberIndexInfo(type) ? getUnionType([numberType, getLiteralTypeFromPropertyNames(type, 32 | 1024)]) :
- getLiteralTypeFromPropertyNames(type, 1120);
+ stringsOnly ? getIndexInfoOfType(type, 0) ? stringType : getLiteralTypeFromPropertyNames(type, 64) :
+ getIndexInfoOfType(type, 0) ? getUnionType([stringType, numberType, getLiteralTypeFromPropertyNames(type, 2048)]) :
+ getNonEnumNumberIndexInfo(type) ? getUnionType([numberType, getLiteralTypeFromPropertyNames(type, 64 | 2048)]) :
+ getLiteralTypeFromPropertyNames(type, 2240);
}
function getExtractStringType(type) {
if (keyofStringsOnly) {
@@ -28262,7 +28441,7 @@ var ts;
}
function getIndexTypeOrString(type) {
var indexType = getExtractStringType(getIndexType(type));
- return indexType.flags & 16384 ? stringType : indexType;
+ return indexType.flags & 32768 ? stringType : indexType;
}
function getTypeFromTypeOperatorNode(node) {
var links = getNodeLinks(node);
@@ -28274,20 +28453,20 @@ var ts;
case 141:
links.resolvedType = node.type.kind === 138
? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent))
- : unknownType;
+ : errorType;
break;
}
}
return links.resolvedType;
}
function createIndexedAccessType(objectType, indexType) {
- var type = createType(1048576);
+ var type = createType(2097152);
type.objectType = objectType;
type.indexType = indexType;
return type;
}
function getPropertyTypeForIndexType(objectType, indexType, accessNode, cacheSymbol) {
- var accessExpression = accessNode && accessNode.kind === 185 ? accessNode : undefined;
+ var accessExpression = accessNode && accessNode.kind === 186 ? accessNode : undefined;
var propName = isTypeUsableAsLateBoundName(indexType) ? getLateBoundNameFromType(indexType) :
accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, false) ?
ts.getPropertyNameForKnownSymbolName(ts.idText(accessExpression.argumentExpression.name)) :
@@ -28299,7 +28478,7 @@ var ts;
markPropertyAsReferenced(prop, accessExpression, accessExpression.expression.kind === 99);
if (ts.isAssignmentTarget(accessExpression) && (isReferenceToReadonlyEntity(accessExpression, prop) || isReferenceThroughNamespaceImport(accessExpression))) {
error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(prop));
- return unknownType;
+ return errorType;
}
if (cacheSymbol) {
getNodeLinks(accessNode).resolvedSymbol = prop;
@@ -28308,16 +28487,16 @@ var ts;
return getTypeOfSymbol(prop);
}
}
- if (!(indexType.flags & 12288) && isTypeAssignableToKind(indexType, 34 | 84 | 1536)) {
+ if (!(indexType.flags & 24576) && isTypeAssignableToKind(indexType, 68 | 168 | 3072)) {
if (isTypeAny(objectType)) {
return objectType;
}
- var indexInfo = isTypeAssignableToKind(indexType, 84) && getIndexInfoOfType(objectType, 1) ||
+ var indexInfo = isTypeAssignableToKind(indexType, 168) && getIndexInfoOfType(objectType, 1) ||
getIndexInfoOfType(objectType, 0) ||
undefined;
if (indexInfo) {
- if (accessNode && !isTypeAssignableToKind(indexType, 2 | 4)) {
- var indexNode = accessNode.kind === 185 ? accessNode.argumentExpression : accessNode.indexType;
+ if (accessNode && !isTypeAssignableToKind(indexType, 4 | 8)) {
+ var indexNode = accessNode.kind === 186 ? accessNode.argumentExpression : accessNode.indexType;
error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType));
}
else if (accessExpression && indexInfo.isReadonly && (ts.isAssignmentTarget(accessExpression) || ts.isDeleteTarget(accessExpression))) {
@@ -28325,7 +28504,7 @@ var ts;
}
return indexInfo.type;
}
- if (indexType.flags & 16384) {
+ if (indexType.flags & 32768) {
return neverType;
}
if (accessExpression && !isConstEnumObjectType(objectType)) {
@@ -28341,47 +28520,47 @@ var ts;
}
}
if (accessNode) {
- var indexNode = accessNode.kind === 185 ? accessNode.argumentExpression : accessNode.indexType;
- if (indexType.flags & (32 | 64)) {
+ var indexNode = accessNode.kind === 186 ? accessNode.argumentExpression : accessNode.indexType;
+ if (indexType.flags & (64 | 128)) {
error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, "" + indexType.value, typeToString(objectType));
}
- else if (indexType.flags & (2 | 4)) {
+ else if (indexType.flags & (4 | 8)) {
error(indexNode, ts.Diagnostics.Type_0_has_no_matching_index_signature_for_type_1, typeToString(objectType), typeToString(indexType));
}
else {
error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType));
}
}
- return unknownType;
+ return errorType;
}
function isGenericObjectType(type) {
- return maybeTypeOfKind(type, 7372800 | 536870912);
+ return maybeTypeOfKind(type, 14745600 | 134217728);
}
function isGenericIndexType(type) {
- return maybeTypeOfKind(type, 7372800 | 524288);
+ return maybeTypeOfKind(type, 14745600 | 1048576);
}
function isStringIndexOnlyType(type) {
- if (type.flags & 65536 && !isGenericMappedType(type)) {
+ if (type.flags & 131072 && !isGenericMappedType(type)) {
var t = resolveStructuredTypeMembers(type);
return t.properties.length === 0 &&
t.callSignatures.length === 0 && t.constructSignatures.length === 0 &&
- t.stringIndexInfo && !t.numberIndexInfo;
+ !!t.stringIndexInfo && !t.numberIndexInfo;
}
return false;
}
function isMappedTypeToNever(type) {
- return ts.getObjectFlags(type) & 32 && getTemplateTypeFromMappedType(type) === neverType;
+ return !!(ts.getObjectFlags(type) & 32) && getTemplateTypeFromMappedType(type) === neverType;
}
function getSimplifiedType(type) {
- return type.flags & 1048576 ? getSimplifiedIndexedAccessType(type) : type;
+ return type.flags & 2097152 ? getSimplifiedIndexedAccessType(type) : type;
}
function getSimplifiedIndexedAccessType(type) {
if (type.simplified) {
return type.simplified === circularConstraintType ? type : type.simplified;
}
type.simplified = circularConstraintType;
- var objectType = type.objectType;
- if (objectType.flags & 262144 && isGenericObjectType(objectType)) {
+ var objectType = getSimplifiedType(type.objectType);
+ if (objectType.flags & 524288 && isGenericObjectType(objectType)) {
if (ts.some(objectType.types, isStringIndexOnlyType)) {
var regularTypes = [];
var stringIndexTypes = [];
@@ -28407,7 +28586,7 @@ var ts;
if (isGenericMappedType(objectType)) {
return type.simplified = substituteIndexedMappedType(objectType, type);
}
- if (objectType.flags & 32768) {
+ if (objectType.flags & 65536) {
var constraint = getConstraintFromTypeParameter(objectType);
if (constraint && isGenericMappedType(constraint)) {
return type.simplified = substituteIndexedMappedType(constraint, type);
@@ -28424,8 +28603,8 @@ var ts;
if (objectType === wildcardType || indexType === wildcardType) {
return wildcardType;
}
- if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 185) && isGenericObjectType(objectType)) {
- if (objectType.flags & 1) {
+ if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 186) && isGenericObjectType(objectType)) {
+ if (objectType.flags & 3) {
return objectType;
}
var id = objectType.id + "," + indexType.id;
@@ -28436,13 +28615,13 @@ var ts;
return type;
}
var apparentObjectType = getApparentType(objectType);
- if (indexType.flags & 131072 && !(indexType.flags & 8)) {
+ if (indexType.flags & 262144 && !(indexType.flags & 16)) {
var propTypes = [];
for (var _i = 0, _a = indexType.types; _i < _a.length; _i++) {
var t = _a[_i];
var propType = getPropertyTypeForIndexType(apparentObjectType, t, accessNode, false);
- if (propType === unknownType) {
- return unknownType;
+ if (propType === errorType) {
+ return errorType;
}
propTypes.push(propType);
}
@@ -28456,7 +28635,7 @@ var ts;
var objectType = getTypeFromTypeNode(node.objectType);
var indexType = getTypeFromTypeNode(node.indexType);
var resolved = getIndexedAccessType(objectType, indexType, node);
- links.resolvedType = resolved.flags & 1048576 &&
+ links.resolvedType = resolved.flags & 2097152 &&
resolved.objectType === objectType &&
resolved.indexType === indexType ?
getConstrainedTypeVariable(resolved, node) : resolved;
@@ -28476,7 +28655,7 @@ var ts;
return links.resolvedType;
}
function getActualTypeVariable(type) {
- return type.flags & 4194304 ? type.typeVariable : type;
+ return type.flags & 8388608 ? type.typeVariable : type;
}
function getConditionalType(root, mapper) {
var checkType = instantiateType(root.checkType, mapper);
@@ -28484,7 +28663,7 @@ var ts;
if (checkType === wildcardType || extendsType === wildcardType) {
return wildcardType;
}
- var isDeferred = root.isDistributive && maybeTypeOfKind(checkType, 7897088);
+ var isDeferred = root.isDistributive && maybeTypeOfKind(checkType, 15794176);
var combinedMapper;
if (root.inferTypeParameters) {
var context_1 = createInferenceContext(root.inferTypeParameters, undefined, 0);
@@ -28494,6 +28673,9 @@ var ts;
combinedMapper = combineTypeMappers(mapper, context_1);
}
if (!isDeferred) {
+ if (extendsType.flags & 3) {
+ return instantiateType(root.trueType, mapper);
+ }
if (checkType.flags & 1) {
return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), instantiateType(root.falseType, mapper)]);
}
@@ -28506,7 +28688,7 @@ var ts;
}
}
var erasedCheckType = getActualTypeVariable(checkType);
- var result = createType(2097152);
+ var result = createType(4194304);
result.root = root;
result.checkType = erasedCheckType;
result.extendsType = extendsType;
@@ -28538,7 +28720,7 @@ var ts;
return true;
}
while (node) {
- if (node.kind === 170) {
+ if (node.kind === 171) {
if (isTypeParameterPossiblyReferenced(tp, node.extendsType)) {
return true;
}
@@ -28561,7 +28743,7 @@ var ts;
extendsType: getTypeFromTypeNode(node.extendsType),
trueType: getTypeFromTypeNode(node.trueType),
falseType: getTypeFromTypeNode(node.falseType),
- isDistributive: !!(checkType.flags & 32768),
+ isDistributive: !!(checkType.flags & 65536),
inferTypeParameters: getInferTypeParameters(node),
outerTypeParameters: outerTypeParameters,
instantiations: undefined,
@@ -28597,12 +28779,12 @@ var ts;
if (node.isTypeOf && node.typeArguments) {
error(node, ts.Diagnostics.Type_arguments_cannot_be_used_here);
links.resolvedSymbol = unknownSymbol;
- return links.resolvedType = unknownType;
+ return links.resolvedType = errorType;
}
if (!ts.isLiteralImportTypeNode(node)) {
error(node.argument, ts.Diagnostics.String_literal_expected);
links.resolvedSymbol = unknownSymbol;
- return links.resolvedType = unknownType;
+ return links.resolvedType = errorType;
}
var argumentType = getTypeFromTypeNode(node.argument);
var targetMeaning = node.isTypeOf ? 67216319 : 67901928;
@@ -28610,7 +28792,7 @@ var ts;
var innerModuleSymbol = resolveExternalModule(node, moduleName, ts.Diagnostics.Cannot_find_module_0, node, false);
if (!innerModuleSymbol) {
links.resolvedSymbol = unknownSymbol;
- return links.resolvedType = unknownType;
+ return links.resolvedType = errorType;
}
var moduleSymbol_1 = resolveExternalModuleSymbol(innerModuleSymbol, false);
if (!ts.nodeIsMissing(node.qualifier)) {
@@ -28622,7 +28804,7 @@ var ts;
var next = getSymbol(getExportsOfSymbol(getMergedSymbol(resolveSymbol(currentNamespace))), current.escapedText, meaning);
if (!next) {
error(current, ts.Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(currentNamespace), ts.declarationNameToString(current));
- return links.resolvedType = unknownType;
+ return links.resolvedType = errorType;
}
getNodeLinks(current).resolvedSymbol = next;
getNodeLinks(current.parent).resolvedSymbol = next;
@@ -28637,7 +28819,7 @@ var ts;
else {
error(node, targetMeaning === 67216319 ? ts.Diagnostics.Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here : ts.Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here, moduleName);
links.resolvedSymbol = unknownSymbol;
- links.resolvedType = unknownType;
+ links.resolvedType = errorType;
}
}
}
@@ -28681,19 +28863,22 @@ var ts;
if (left.flags & 1 || right.flags & 1) {
return anyType;
}
- if (left.flags & 16384) {
+ if (left.flags & 2 || right.flags & 2) {
+ return unknownType;
+ }
+ if (left.flags & 32768) {
return right;
}
- if (right.flags & 16384) {
+ if (right.flags & 32768) {
return left;
}
- if (left.flags & 131072) {
+ if (left.flags & 262144) {
return mapType(left, function (t) { return getSpreadType(t, right, symbol, typeFlags, objectFlags); });
}
- if (right.flags & 131072) {
+ if (right.flags & 262144) {
return mapType(right, function (t) { return getSpreadType(left, t, symbol, typeFlags, objectFlags); });
}
- if (right.flags & (136 | 84 | 34 | 272 | 134217728 | 524288)) {
+ if (right.flags & (272 | 168 | 68 | 544 | 16777216 | 1048576)) {
return left;
}
var members = ts.createSymbolTable();
@@ -28745,7 +28930,7 @@ var ts;
}
}
var spread = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getNonReadonlyIndexSignature(stringIndexInfo), getNonReadonlyIndexSignature(numberIndexInfo));
- spread.flags |= typeFlags | 33554432;
+ spread.flags |= typeFlags | 268435456;
spread.objectFlags |= objectFlags | (128 | 1024);
return spread;
}
@@ -28777,9 +28962,9 @@ var ts;
return type;
}
function getFreshTypeOfLiteralType(type) {
- if (type.flags & 96 && !(type.flags & 8388608)) {
+ if (type.flags & 192 && !(type.flags & 33554432)) {
if (!type.freshType) {
- var freshType = createLiteralType(type.flags | 8388608, type.value, type.symbol);
+ var freshType = createLiteralType(type.flags | 33554432, type.value, type.symbol);
freshType.regularType = type;
type.freshType = freshType;
}
@@ -28788,14 +28973,16 @@ var ts;
return type;
}
function getRegularTypeOfLiteralType(type) {
- return type.flags & 96 && type.flags & 8388608 ? type.regularType : type;
+ return type.flags & 192 && type.flags & 33554432 ? type.regularType :
+ type.flags & 262144 ? getUnionType(ts.sameMap(type.types, getRegularTypeOfLiteralType)) :
+ type;
}
function getLiteralType(value, enumId, symbol) {
var qualifier = typeof value === "number" ? "#" : "@";
var key = enumId ? enumId + qualifier + value : qualifier + value;
var type = literalTypes.get(key);
if (!type) {
- var flags = (typeof value === "number" ? 64 : 32) | (enumId ? 256 : 0);
+ var flags = (typeof value === "number" ? 128 : 64) | (enumId ? 512 : 0);
literalTypes.set(key, type = createLiteralType(flags, value, symbol));
}
return type;
@@ -28808,7 +28995,7 @@ var ts;
return links.resolvedType;
}
function createUniqueESSymbolType(symbol) {
- var type = createType(1024);
+ var type = createType(2048);
type.symbol = symbol;
return type;
}
@@ -28823,14 +29010,14 @@ var ts;
function getThisType(node) {
var container = ts.getThisContainer(node, false);
var parent = container && container.parent;
- if (parent && (ts.isClassLike(parent) || parent.kind === 235)) {
+ if (parent && (ts.isClassLike(parent) || parent.kind === 236)) {
if (!ts.hasModifier(container, 32) &&
- (container.kind !== 154 || ts.isNodeDescendantOf(node, container.body))) {
+ (container.kind !== 155 || ts.isNodeDescendantOf(node, container.body))) {
return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType;
}
}
error(node, ts.Diagnostics.A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface);
- return unknownType;
+ return errorType;
}
function getTypeFromThisTypeNode(node) {
var links = getNodeLinks(node);
@@ -28842,9 +29029,11 @@ var ts;
function getTypeFromTypeNode(node) {
switch (node.kind) {
case 119:
- case 278:
case 279:
+ case 280:
return anyType;
+ case 142:
+ return unknownType;
case 137:
return stringType;
case 134:
@@ -28863,62 +29052,62 @@ var ts;
return neverType;
case 135:
return node.flags & 65536 ? anyType : nonPrimitiveType;
- case 173:
+ case 174:
case 99:
return getTypeFromThisTypeNode(node);
- case 177:
- return getTypeFromLiteralTypeNode(node);
- case 161:
- return getTypeFromTypeReference(node);
- case 160:
- return booleanType;
- case 206:
- return getTypeFromTypeReference(node);
- case 164:
- return getTypeFromTypeQueryNode(node);
- case 166:
- return getTypeFromArrayTypeNode(node);
- case 167:
- return getTypeFromTupleTypeNode(node);
- case 168:
- return getTypeFromUnionTypeNode(node);
- case 169:
- return getTypeFromIntersectionTypeNode(node);
- case 280:
- return getTypeFromJSDocNullableTypeNode(node);
- case 282:
- return addOptionality(getTypeFromTypeNode(node.type));
- case 172:
- case 281:
- case 277:
- return getTypeFromTypeNode(node.type);
- case 284:
- return getTypeFromJSDocVariadicType(node);
- case 162:
- case 163:
- case 165:
- case 286:
- case 283:
- case 287:
- return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
- case 174:
- return getTypeFromTypeOperatorNode(node);
- case 175:
- return getTypeFromIndexedAccessTypeNode(node);
- case 176:
- return getTypeFromMappedTypeNode(node);
- case 170:
- return getTypeFromConditionalTypeNode(node);
- case 171:
- return getTypeFromInferTypeNode(node);
case 178:
+ return getTypeFromLiteralTypeNode(node);
+ case 162:
+ return getTypeFromTypeReference(node);
+ case 161:
+ return booleanType;
+ case 207:
+ return getTypeFromTypeReference(node);
+ case 165:
+ return getTypeFromTypeQueryNode(node);
+ case 167:
+ return getTypeFromArrayTypeNode(node);
+ case 168:
+ return getTypeFromTupleTypeNode(node);
+ case 169:
+ return getTypeFromUnionTypeNode(node);
+ case 170:
+ return getTypeFromIntersectionTypeNode(node);
+ case 281:
+ return getTypeFromJSDocNullableTypeNode(node);
+ case 283:
+ return addOptionality(getTypeFromTypeNode(node.type));
+ case 173:
+ case 282:
+ case 278:
+ return getTypeFromTypeNode(node.type);
+ case 285:
+ return getTypeFromJSDocVariadicType(node);
+ case 163:
+ case 164:
+ case 166:
+ case 287:
+ case 284:
+ case 288:
+ return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
+ case 175:
+ return getTypeFromTypeOperatorNode(node);
+ case 176:
+ return getTypeFromIndexedAccessTypeNode(node);
+ case 177:
+ return getTypeFromMappedTypeNode(node);
+ case 171:
+ return getTypeFromConditionalTypeNode(node);
+ case 172:
+ return getTypeFromInferTypeNode(node);
+ case 179:
return getTypeFromImportTypeNode(node);
case 71:
- case 145:
+ case 146:
var symbol = getSymbolAtLocation(node);
- return symbol && getDeclaredTypeOfSymbol(symbol);
+ return (symbol && getDeclaredTypeOfSymbol(symbol));
default:
- return unknownType;
+ return errorType;
}
}
function instantiateList(items, mapper, instantiator) {
@@ -28991,10 +29180,10 @@ var ts;
return function (t) { return t === source ? target : baseMapper(t); };
}
function wildcardMapper(type) {
- return type.flags & 32768 ? wildcardType : type;
+ return type.flags & 65536 ? wildcardType : type;
}
function cloneTypeParameter(typeParameter) {
- var result = createType(32768);
+ var result = createType(65536);
result.symbol = typeParameter.symbol;
result.target = typeParameter;
return result;
@@ -29032,7 +29221,7 @@ var ts;
}
function instantiateSymbol(symbol, mapper) {
var links = getSymbolLinks(symbol);
- if (links.type && !maybeTypeOfKind(links.type, 65536 | 7897088)) {
+ if (links.type && !maybeTypeOfKind(links.type, 131072 | 15794176)) {
return symbol;
}
if (ts.getCheckFlags(symbol) & 1) {
@@ -29103,35 +29292,35 @@ var ts;
return type;
}
function maybeTypeParameterReference(node) {
- return !(node.kind === 145 ||
- node.parent.kind === 161 && node.parent.typeArguments && node === node.parent.typeName);
+ return !(node.kind === 146 ||
+ node.parent.kind === 162 && node.parent.typeArguments && node === node.parent.typeName);
}
function isTypeParameterPossiblyReferenced(tp, node) {
if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) {
var container_3 = tp.symbol.declarations[0].parent;
- if (ts.findAncestor(node, function (n) { return n.kind === 212 ? "quit" : n === container_3; })) {
- return ts.forEachChild(node, containsReference);
+ if (ts.findAncestor(node, function (n) { return n.kind === 213 ? "quit" : n === container_3; })) {
+ return !!ts.forEachChild(node, containsReference);
}
}
return true;
function containsReference(node) {
switch (node.kind) {
- case 173:
- return tp.isThisType;
+ case 174:
+ return !!tp.isThisType;
case 71:
return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) &&
getTypeFromTypeNode(node) === tp;
- case 164:
+ case 165:
return true;
}
- return ts.forEachChild(node, containsReference);
+ return !!ts.forEachChild(node, containsReference);
}
}
function instantiateMappedType(type, mapper) {
var constraintType = getConstraintTypeFromMappedType(type);
- if (constraintType.flags & 524288) {
+ if (constraintType.flags & 1048576) {
var typeVariable_1 = constraintType.type;
- if (typeVariable_1.flags & 32768) {
+ if (typeVariable_1.flags & 65536) {
var mappedTypeVariable = instantiateType(typeVariable_1, mapper);
if (typeVariable_1 !== mappedTypeVariable) {
return mapType(mappedTypeVariable, function (t) {
@@ -29146,7 +29335,7 @@ var ts;
return instantiateAnonymousType(type, mapper);
}
function isMappableType(type) {
- return type.flags & (1 | 7372800 | 65536 | 262144);
+ return type.flags & (3 | 14745600 | 131072 | 524288);
}
function instantiateAnonymousType(type, mapper) {
var result = createObjectType(type.objectFlags | 64, type.symbol);
@@ -29178,7 +29367,7 @@ var ts;
if (root.isDistributive) {
var checkType_1 = root.checkType;
var instantiatedType = mapper(checkType_1);
- if (checkType_1 !== instantiatedType && instantiatedType.flags & (131072 | 16384)) {
+ if (checkType_1 !== instantiatedType && instantiatedType.flags & (262144 | 32768)) {
return mapType(instantiatedType, function (t) { return getConditionalType(root, createReplacementMapper(checkType_1, t, mapper)); });
}
}
@@ -29186,10 +29375,10 @@ var ts;
}
function instantiateType(type, mapper) {
if (type && mapper && mapper !== identityMapper) {
- if (type.flags & 32768) {
+ if (type.flags & 65536) {
return mapper(type);
}
- if (type.flags & 65536) {
+ if (type.flags & 131072) {
if (type.objectFlags & 16) {
return type.symbol && type.symbol.flags & (16 | 8192 | 32 | 2048 | 4096) && type.symbol.declarations ?
getAnonymousTypeInstantiation(type, mapper) : type;
@@ -29203,65 +29392,69 @@ var ts;
return newTypeArguments !== typeArguments ? createTypeReference(type.target, newTypeArguments) : type;
}
}
- if (type.flags & 131072 && !(type.flags & 16382)) {
+ if (type.flags & 262144 && !(type.flags & 32764)) {
var types = type.types;
var newTypes = instantiateTypes(types, mapper);
return newTypes !== types ? getUnionType(newTypes, 1, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type;
}
- if (type.flags & 262144) {
+ if (type.flags & 524288) {
var types = type.types;
var newTypes = instantiateTypes(types, mapper);
return newTypes !== types ? getIntersectionType(newTypes, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type;
}
- if (type.flags & 524288) {
+ if (type.flags & 1048576) {
return getIndexType(instantiateType(type.type, mapper));
}
- if (type.flags & 1048576) {
+ if (type.flags & 2097152) {
return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper));
}
- if (type.flags & 2097152) {
+ if (type.flags & 4194304) {
return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper));
}
- if (type.flags & 4194304) {
+ if (type.flags & 8388608) {
return instantiateType(type.typeVariable, mapper);
}
}
return type;
}
function getWildcardInstantiation(type) {
- return type.flags & (16382 | 1 | 16384) ? type :
+ return type.flags & (32764 | 3 | 32768) ? type :
type.wildcardInstantiation || (type.wildcardInstantiation = instantiateType(type, wildcardMapper));
}
function instantiateIndexInfo(info, mapper) {
return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration);
}
function isContextSensitive(node) {
- ts.Debug.assert(node.kind !== 153 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 154 || ts.isObjectLiteralMethod(node));
switch (node.kind) {
- case 191:
case 192:
- case 153:
+ case 193:
+ case 154:
return isContextSensitiveFunctionLikeDeclaration(node);
+ case 184:
+ return ts.some(node.properties, isContextSensitive);
case 183:
- return ts.forEach(node.properties, isContextSensitive);
- case 182:
- return ts.forEach(node.elements, isContextSensitive);
- case 200:
+ return ts.some(node.elements, isContextSensitive);
+ case 201:
return isContextSensitive(node.whenTrue) ||
isContextSensitive(node.whenFalse);
- case 199:
+ case 200:
return node.operatorToken.kind === 54 &&
(isContextSensitive(node.left) || isContextSensitive(node.right));
- case 269:
+ case 270:
return isContextSensitive(node.initializer);
- case 190:
+ case 191:
return isContextSensitive(node.expression);
- case 262:
- return ts.forEach(node.properties, isContextSensitive);
- case 261:
- return node.initializer && isContextSensitive(node.initializer);
- case 264:
- return node.expression && isContextSensitive(node.expression);
+ case 263:
+ return ts.some(node.properties, isContextSensitive);
+ case 262: {
+ var initializer = node.initializer;
+ return !!initializer && isContextSensitive(initializer);
+ }
+ case 265: {
+ var expression = node.expression;
+ return !!expression && isContextSensitive(expression);
+ }
}
return false;
}
@@ -29269,23 +29462,24 @@ var ts;
if (node.typeParameters) {
return false;
}
- if (ts.forEach(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) {
+ if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) {
return true;
}
- if (node.kind !== 192) {
+ if (node.kind !== 193) {
var parameter = ts.firstOrUndefined(node.parameters);
if (!(parameter && ts.parameterIsThisKeyword(parameter))) {
return true;
}
}
- return node.body.kind === 212 ? false : isContextSensitive(node.body);
+ var body = node.body;
+ return body.kind === 213 ? false : isContextSensitive(body);
}
function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
return (ts.isInJavaScriptFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) &&
isContextSensitiveFunctionLikeDeclaration(func);
}
function getTypeWithoutSignatures(type) {
- if (type.flags & 65536) {
+ if (type.flags & 131072) {
var resolved = resolveStructuredTypeMembers(type);
if (resolved.constructSignatures.length) {
var result = createObjectType(16, type.symbol);
@@ -29296,7 +29490,7 @@ var ts;
return result;
}
}
- else if (type.flags & 262144) {
+ else if (type.flags & 524288) {
return getIntersectionType(ts.map(type.types, getTypeWithoutSignatures));
}
return type;
@@ -29317,9 +29511,9 @@ var ts;
return isTypeRelatedTo(source, target, assignableRelation);
}
function isTypeDerivedFrom(source, target) {
- return source.flags & 131072 ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) :
- target.flags & 131072 ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) :
- source.flags & 7372800 ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) :
+ return source.flags & 262144 ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) :
+ target.flags & 262144 ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) :
+ source.flags & 14745600 ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) :
target === globalObjectType || target === globalFunctionType ? isTypeSubtypeOf(source, target) :
hasBaseType(source, getTargetType(target));
}
@@ -29350,8 +29544,8 @@ var ts;
source = instantiateSignatureInContextOf(source, target, undefined, compareTypes);
}
var kind = target.declaration ? target.declaration.kind : 0;
- var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 153 &&
- kind !== 152 && kind !== 154;
+ var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 154 &&
+ kind !== 153 && kind !== 155;
var result = -1;
var sourceThisType = getThisTypeOfSignature(source);
if (sourceThisType && sourceThisType !== voidType) {
@@ -29379,7 +29573,7 @@ var ts;
var sourceSig = callbackCheck ? undefined : getSingleCallSignature(getNonNullableType(sourceType));
var targetSig = callbackCheck ? undefined : getSingleCallSignature(getNonNullableType(targetType));
var callbacks = sourceSig && targetSig && !signatureHasTypePredicate(sourceSig) && !signatureHasTypePredicate(targetSig) &&
- (getFalsyFlags(sourceType) & 12288) === (getFalsyFlags(targetType) & 12288);
+ (getFalsyFlags(sourceType) & 24576) === (getFalsyFlags(targetType) & 24576);
var related = callbacks ?
compareSignaturesRelated(targetSig, sourceSig, strictVariance ? 2 : 1, false, reportErrors, errorReporter, compareTypes) :
!callbackCheck && !strictVariance && compareTypes(sourceType, targetType, false) || compareTypes(targetType, sourceType, reportErrors);
@@ -29484,10 +29678,10 @@ var ts;
!t.numberIndexInfo;
}
function isEmptyObjectType(type) {
- return type.flags & 65536 ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) :
- type.flags & 134217728 ? true :
- type.flags & 131072 ? ts.forEach(type.types, isEmptyObjectType) :
- type.flags & 262144 ? !ts.forEach(type.types, function (t) { return !isEmptyObjectType(t); }) :
+ return type.flags & 131072 ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) :
+ type.flags & 16777216 ? true :
+ type.flags & 262144 ? ts.some(type.types, isEmptyObjectType) :
+ type.flags & 524288 ? !ts.some(type.types, function (t) { return !isEmptyObjectType(t); }) :
false;
}
function isEnumTypeRelatedTo(sourceSymbol, targetSymbol, errorReporter) {
@@ -29523,71 +29717,71 @@ var ts;
function isSimpleTypeRelatedTo(source, target, relation, errorReporter) {
var s = source.flags;
var t = target.flags;
- if (t & 1 || s & 16384 || source === wildcardType)
+ if (t & 3 || s & 32768 || source === wildcardType)
return true;
- if (t & 16384)
+ if (t & 32768)
return false;
- if (s & 34 && t & 2)
+ if (s & 68 && t & 4)
return true;
- if (s & 32 && s & 256 &&
- t & 32 && !(t & 256) &&
+ if (s & 64 && s & 512 &&
+ t & 64 && !(t & 512) &&
source.value === target.value)
return true;
- if (s & 84 && t & 4)
+ if (s & 168 && t & 8)
return true;
- if (s & 64 && s & 256 &&
- t & 64 && !(t & 256) &&
+ if (s & 128 && s & 512 &&
+ t & 128 && !(t & 512) &&
source.value === target.value)
return true;
- if (s & 136 && t & 8)
+ if (s & 272 && t & 16)
return true;
- if (s & 1536 && t & 512)
+ if (s & 3072 && t & 1024)
return true;
- if (s & 16 && t & 16 && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter))
+ if (s & 32 && t & 32 && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter))
return true;
- if (s & 256 && t & 256) {
- if (s & 131072 && t & 131072 && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter))
+ if (s & 512 && t & 512) {
+ if (s & 262144 && t & 262144 && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter))
return true;
- if (s & 224 && t & 224 &&
+ if (s & 448 && t & 448 &&
source.value === target.value &&
isEnumTypeRelatedTo(getParentOfSymbol(source.symbol), getParentOfSymbol(target.symbol), errorReporter))
return true;
}
- if (s & 4096 && (!strictNullChecks || t & (4096 | 2048)))
+ if (s & 8192 && (!strictNullChecks || t & (8192 | 4096)))
return true;
- if (s & 8192 && (!strictNullChecks || t & 8192))
+ if (s & 16384 && (!strictNullChecks || t & 16384))
return true;
- if (s & 65536 && t & 134217728)
+ if (s & 131072 && t & 16777216)
return true;
- if (s & 1024 || t & 1024)
+ if (s & 2048 || t & 2048)
return false;
if (relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) {
if (s & 1)
return true;
- if (s & (4 | 64) && !(s & 256) && (t & 16 || t & 64 && t & 256))
+ if (s & (8 | 128) && !(s & 512) && (t & 32 || t & 128 && t & 512))
return true;
}
return false;
}
function isTypeRelatedTo(source, target, relation) {
- if (source.flags & 96 && source.flags & 8388608) {
+ if (source.flags & 192 && source.flags & 33554432) {
source = source.regularType;
}
- if (target.flags & 96 && target.flags & 8388608) {
+ if (target.flags & 192 && target.flags & 33554432) {
target = target.regularType;
}
if (source === target ||
- relation === comparableRelation && !(target.flags & 16384) && isSimpleTypeRelatedTo(target, source, relation) ||
+ relation === comparableRelation && !(target.flags & 32768) && isSimpleTypeRelatedTo(target, source, relation) ||
relation !== identityRelation && isSimpleTypeRelatedTo(source, target, relation)) {
return true;
}
- if (source.flags & 65536 && target.flags & 65536) {
+ if (source.flags & 131072 && target.flags & 131072) {
var related = relation.get(getRelationKey(source, target, relation));
if (related !== undefined) {
return related === 1;
}
}
- if (source.flags & 8355840 || target.flags & 8355840) {
+ if (source.flags & 16711680 || target.flags & 16711680) {
return checkTypeRelatedTo(source, target, relation, undefined);
}
return false;
@@ -29664,13 +29858,13 @@ var ts;
}
}
function isUnionOrIntersectionTypeWithoutNullableConstituents(type) {
- if (!(type.flags & 393216)) {
+ if (!(type.flags & 786432)) {
return false;
}
var seenNonNullable = false;
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
var t = _a[_i];
- if (t.flags & 12288) {
+ if (t.flags & 24576) {
continue;
}
if (seenNonNullable) {
@@ -29681,22 +29875,23 @@ var ts;
return false;
}
function isRelatedTo(source, target, reportErrors, headMessage) {
- if (source.flags & 96 && source.flags & 8388608) {
+ if (reportErrors === void 0) { reportErrors = false; }
+ if (source.flags & 192 && source.flags & 33554432) {
source = source.regularType;
}
- if (target.flags & 96 && target.flags & 8388608) {
+ if (target.flags & 192 && target.flags & 33554432) {
target = target.regularType;
}
- if (source.flags & 4194304) {
+ if (source.flags & 8388608) {
source = relation === definitelyAssignableRelation ? source.typeVariable : source.substitute;
}
- if (target.flags & 4194304) {
+ if (target.flags & 8388608) {
target = target.typeVariable;
}
- if (source.flags & 1048576) {
+ if (source.flags & 2097152) {
source = getSimplifiedType(source);
}
- if (target.flags & 1048576) {
+ if (target.flags & 2097152) {
target = getSimplifiedType(target);
}
if (source === target)
@@ -29704,11 +29899,11 @@ var ts;
if (relation === identityRelation) {
return isIdenticalTo(source, target);
}
- if (relation === comparableRelation && !(target.flags & 16384) && isSimpleTypeRelatedTo(target, source, relation) ||
+ if (relation === comparableRelation && !(target.flags & 32768) && isSimpleTypeRelatedTo(target, source, relation) ||
isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined))
return -1;
- if (isObjectLiteralType(source) && source.flags & 8388608) {
- var discriminantType = target.flags & 131072 ? findMatchingDiscriminantType(source, target) : undefined;
+ if (isObjectLiteralType(source) && source.flags & 33554432) {
+ var discriminantType = target.flags & 262144 ? findMatchingDiscriminantType(source, target) : undefined;
if (hasExcessProperties(source, target, discriminantType, reportErrors)) {
if (reportErrors) {
reportRelationError(headMessage, source, target);
@@ -29720,8 +29915,8 @@ var ts;
}
}
if (relation !== comparableRelation &&
- !(source.flags & 393216) &&
- !(target.flags & 131072) &&
+ !(source.flags & 786432) &&
+ !(target.flags & 262144) &&
!isIntersectionConstituent &&
source !== globalObjectType &&
(getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source)) &&
@@ -29744,30 +29939,30 @@ var ts;
var saveErrorInfo = errorInfo;
var saveIsIntersectionConstituent = isIntersectionConstituent;
isIntersectionConstituent = false;
- if (source.flags & 131072) {
+ if (source.flags & 262144) {
result = relation === comparableRelation ?
- someTypeRelatedToType(source, target, reportErrors && !(source.flags & 16382)) :
- eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 16382));
+ someTypeRelatedToType(source, target, reportErrors && !(source.flags & 32764)) :
+ eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 32764));
}
else {
- if (target.flags & 131072) {
- result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & 16382) && !(target.flags & 16382));
+ if (target.flags & 262144) {
+ result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & 32764) && !(target.flags & 32764));
}
- else if (target.flags & 262144) {
+ else if (target.flags & 524288) {
isIntersectionConstituent = true;
result = typeRelatedToEachType(source, target, reportErrors);
}
- else if (source.flags & 262144) {
+ else if (source.flags & 524288) {
result = someTypeRelatedToType(source, target, false);
}
- if (!result && (source.flags & 8355840 || target.flags & 8355840)) {
+ if (!result && (source.flags & 16711680 || target.flags & 16711680)) {
if (result = recursiveTypeRelatedTo(source, target, reportErrors)) {
errorInfo = saveErrorInfo;
}
}
}
- if (!result && source.flags & 262144) {
- var constraint = getUnionConstraintOfIntersection(source, !!(target.flags & 131072));
+ if (!result && source.flags & 524288) {
+ var constraint = getUnionConstraintOfIntersection(source, !!(target.flags & 262144));
if (constraint) {
if (result = isRelatedTo(constraint, target, reportErrors)) {
errorInfo = saveErrorInfo;
@@ -29776,12 +29971,21 @@ var ts;
}
isIntersectionConstituent = saveIsIntersectionConstituent;
if (!result && reportErrors) {
- if (source.flags & 65536 && target.flags & 16382) {
+ if (source.flags & 131072 && target.flags & 32764) {
tryElaborateErrorsForPrimitivesAndObjects(source, target);
}
- else if (source.symbol && source.flags & 65536 && globalObjectType === source) {
+ else if (source.symbol && source.flags & 131072 && globalObjectType === source) {
reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
}
+ else if (ts.getObjectFlags(source) & 4096 && target.flags & 524288) {
+ var targetTypes = target.types;
+ var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
+ var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
+ if (intrinsicAttributes !== errorType && intrinsicClassAttributes !== errorType &&
+ (ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
+ return result;
+ }
+ }
reportRelationError(headMessage, source, target);
}
return result;
@@ -29789,27 +29993,27 @@ var ts;
function isIdenticalTo(source, target) {
var result;
var flags = source.flags & target.flags;
- if (flags & 65536) {
+ if (flags & 131072) {
return recursiveTypeRelatedTo(source, target, false);
}
- if (flags & (131072 | 262144)) {
+ if (flags & (262144 | 524288)) {
if (result = eachTypeRelatedToSomeType(source, target)) {
if (result &= eachTypeRelatedToSomeType(target, source)) {
return result;
}
}
}
- if (flags & 524288) {
+ if (flags & 1048576) {
return isRelatedTo(source.type, target.type, false);
}
- if (flags & 1048576) {
+ if (flags & 2097152) {
if (result = isRelatedTo(source.objectType, target.objectType, false)) {
if (result &= isRelatedTo(source.indexType, target.indexType, false)) {
return result;
}
}
}
- if (flags & 2097152) {
+ if (flags & 4194304) {
if (source.root.isDistributive === target.root.isDistributive) {
if (result = isRelatedTo(source.checkType, target.checkType, false)) {
if (result &= isRelatedTo(source.extendsType, target.extendsType, false)) {
@@ -29822,13 +30026,13 @@ var ts;
}
}
}
- if (flags & 4194304) {
+ if (flags & 8388608) {
return isRelatedTo(source.substitute, target.substitute, false);
}
return 0;
}
function hasExcessProperties(source, target, discriminant, reportErrors) {
- if (maybeTypeOfKind(target, 65536) && !(ts.getObjectFlags(target) & 512)) {
+ if (maybeTypeOfKind(target, 131072) && !(ts.getObjectFlags(target) & 512)) {
var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096);
if ((relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) &&
(isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) {
@@ -29840,7 +30044,8 @@ var ts;
var _loop_6 = function (prop) {
if (!isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) {
if (reportErrors) {
- ts.Debug.assert(!!errorNode);
+ if (!errorNode)
+ return { value: ts.Debug.fail() };
if (ts.isJsxAttributes(errorNode) || ts.isJsxOpeningLikeElement(errorNode)) {
reportError(ts.Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target));
}
@@ -29851,8 +30056,9 @@ var ts;
var propDeclaration = prop.valueDeclaration;
ts.Debug.assertNode(propDeclaration, ts.isObjectLiteralElementLike);
errorNode = propDeclaration;
- if (ts.isIdentifier(propDeclaration.name)) {
- suggestion = getSuggestionForNonexistentProperty(propDeclaration.name, target);
+ var name = propDeclaration.name;
+ if (ts.isIdentifier(name)) {
+ suggestion = getSuggestionForNonexistentProperty(name, target);
}
}
if (suggestion !== undefined) {
@@ -29890,7 +30096,7 @@ var ts;
}
function typeRelatedToSomeType(source, target, reportErrors) {
var targetTypes = target.types;
- if (target.flags & 131072 && containsType(targetTypes, source)) {
+ if (target.flags & 262144 && containsType(targetTypes, source)) {
return -1;
}
for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) {
@@ -29947,7 +30153,7 @@ var ts;
}
function someTypeRelatedToType(source, target, reportErrors) {
var sourceTypes = source.types;
- if (source.flags & 131072 && containsType(sourceTypes, target)) {
+ if (source.flags & 262144 && containsType(sourceTypes, target)) {
return -1;
}
var len = sourceTypes.length;
@@ -30077,7 +30283,7 @@ var ts;
var result;
var originalErrorInfo;
var saveErrorInfo = errorInfo;
- if (target.flags & 32768) {
+ if (target.flags & 65536) {
if (ts.getObjectFlags(source) & 32 && getConstraintTypeFromMappedType(source) === getIndexType(target)) {
if (!(getMappedTypeModifiers(source) & 4)) {
var templateType = getTemplateTypeFromMappedType(source);
@@ -30088,8 +30294,8 @@ var ts;
}
}
}
- else if (target.flags & 524288) {
- if (source.flags & 524288) {
+ else if (target.flags & 1048576) {
+ if (source.flags & 1048576) {
if (result = isRelatedTo(target.type, source.type, false)) {
return result;
}
@@ -30104,7 +30310,7 @@ var ts;
}
}
}
- else if (target.flags & 1048576) {
+ else if (target.flags & 2097152) {
var constraint = getConstraintForRelation(target);
if (constraint) {
if (result = isRelatedTo(source, constraint, reportErrors)) {
@@ -30117,7 +30323,7 @@ var ts;
var template = getTemplateTypeFromMappedType(target);
var modifiers = getMappedTypeModifiers(target);
if (!(modifiers & 8)) {
- if (template.flags & 1048576 && template.objectType === source &&
+ if (template.flags & 2097152 && template.objectType === source &&
template.indexType === getTypeParameterFromMappedType(target)) {
return -1;
}
@@ -30131,8 +30337,8 @@ var ts;
}
}
}
- if (source.flags & 1081344) {
- if (source.flags & 1048576 && target.flags & 1048576) {
+ if (source.flags & 2162688) {
+ if (source.flags & 2097152 && target.flags & 2097152) {
if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) {
result &= isRelatedTo(source.indexType, target.indexType, reportErrors);
}
@@ -30142,8 +30348,8 @@ var ts;
}
}
var constraint = getConstraintForRelation(source);
- if (!constraint || (source.flags & 32768 && constraint.flags & 1)) {
- if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~134217728))) {
+ if (!constraint || (source.flags & 65536 && constraint.flags & 3)) {
+ if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~16777216))) {
errorInfo = saveErrorInfo;
return result;
}
@@ -30156,14 +30362,14 @@ var ts;
}
}
}
- else if (source.flags & 524288) {
+ else if (source.flags & 1048576) {
if (result = isRelatedTo(keyofConstraintType, target, reportErrors)) {
errorInfo = saveErrorInfo;
return result;
}
}
- else if (source.flags & 2097152) {
- if (target.flags & 2097152) {
+ else if (source.flags & 4194304) {
+ if (target.flags & 4194304) {
if (isTypeIdenticalTo(source.extendsType, target.extendsType) &&
(isRelatedTo(source.checkType, target.checkType) || isRelatedTo(target.checkType, source.checkType))) {
if (result = isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), reportErrors)) {
@@ -30207,11 +30413,11 @@ var ts;
errorInfo = saveErrorInfo;
}
}
- var sourceIsPrimitive = !!(source.flags & 16382);
+ var sourceIsPrimitive = !!(source.flags & 32764);
if (relation !== identityRelation) {
source = getApparentType(source);
}
- if (source.flags & (65536 | 262144) && target.flags & 65536) {
+ if (source.flags & (131072 | 524288) && target.flags & 131072) {
var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !sourceIsPrimitive;
if (isPartialMappedType(target) && !isGenericMappedType(source) && isEmptyObjectType(source)) {
result = -1;
@@ -30349,14 +30555,14 @@ var ts;
return result;
}
function isWeakType(type) {
- if (type.flags & 65536) {
+ if (type.flags & 131072) {
var resolved = resolveStructuredTypeMembers(type);
return resolved.callSignatures.length === 0 && resolved.constructSignatures.length === 0 &&
!resolved.stringIndexInfo && !resolved.numberIndexInfo &&
resolved.properties.length > 0 &&
ts.every(resolved.properties, function (p) { return !!(p.flags & 16777216); });
}
- if (type.flags & 262144) {
+ if (type.flags & 524288) {
return ts.every(type.types, isWeakType);
}
return false;
@@ -30372,7 +30578,7 @@ var ts;
return false;
}
function propertiesIdenticalTo(source, target) {
- if (!(source.flags & 65536 && target.flags & 65536)) {
+ if (!(source.flags & 131072 && target.flags & 131072)) {
return 0;
}
var sourceProperties = getPropertiesOfObjectType(source);
@@ -30427,7 +30633,7 @@ var ts;
}
}
else if (sourceSignatures.length === 1 && targetSignatures.length === 1) {
- var eraseGenerics = relation === comparableRelation || compilerOptions.noStrictGenericChecks;
+ var eraseGenerics = relation === comparableRelation || !!compilerOptions.noStrictGenericChecks;
result = signatureRelatedTo(sourceSignatures[0], targetSignatures[0], eraseGenerics, reportErrors);
}
else {
@@ -30478,7 +30684,7 @@ var ts;
if (isIgnoredJsxProperty(source, prop, undefined)) {
continue;
}
- if (prop.nameType && prop.nameType.flags & 1024) {
+ if (prop.nameType && prop.nameType.flags & 2048) {
continue;
}
if (kind === 0 || isNumericLiteralName(prop.escapedName)) {
@@ -30506,7 +30712,7 @@ var ts;
return indexTypesIdenticalTo(source, target, kind);
}
var targetInfo = getIndexInfoOfType(target, kind);
- if (!targetInfo || targetInfo.type.flags & 1 && !sourceIsPrimitive) {
+ if (!targetInfo || targetInfo.type.flags & 3 && !sourceIsPrimitive) {
return -1;
}
var sourceInfo = getIndexInfoOfType(source, kind) ||
@@ -30515,7 +30721,7 @@ var ts;
return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors);
}
if (isGenericMappedType(source)) {
- return kind === 0 && isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, reportErrors);
+ return (kind === 0 && isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, reportErrors));
}
if (isObjectTypeWithInferableIndex(source)) {
var related = -1;
@@ -30603,17 +30809,17 @@ var ts;
}
function hasCovariantVoidArgument(type, variances) {
for (var i = 0; i < variances.length; i++) {
- if (variances[i] === 1 && type.typeArguments[i].flags & 2048) {
+ if (variances[i] === 1 && type.typeArguments[i].flags & 4096) {
return true;
}
}
return false;
}
function isUnconstrainedTypeParameter(type) {
- return type.flags & 32768 && !getConstraintFromTypeParameter(type);
+ return type.flags & 65536 && !getConstraintFromTypeParameter(type);
}
function isTypeReferenceWithGenericArguments(type) {
- return ts.getObjectFlags(type) & 4 && ts.some(type.typeArguments, function (t) { return isUnconstrainedTypeParameter(t) || isTypeReferenceWithGenericArguments(t); });
+ return !!(ts.getObjectFlags(type) & 4) && ts.some(type.typeArguments, function (t) { return isUnconstrainedTypeParameter(t) || isTypeReferenceWithGenericArguments(t); });
}
function getTypeReferenceId(type, typeParameters, depth) {
if (depth === void 0) { depth = 0; }
@@ -30681,13 +30887,13 @@ var ts;
!hasBaseType(checkClass, getDeclaringClass(p)) : false; }) ? undefined : checkClass;
}
function isDeeplyNestedType(type, stack, depth) {
- if (depth >= 5 && type.flags & 65536) {
+ if (depth >= 5 && type.flags & 131072) {
var symbol = type.symbol;
if (symbol) {
var count = 0;
for (var i = 0; i < depth; i++) {
var t = stack[i];
- if (t.flags & 65536 && t.symbol === symbol) {
+ if (t.flags & 131072 && t.symbol === symbol) {
count++;
if (count >= 5)
return true;
@@ -30812,20 +31018,20 @@ var ts;
if (!strictNullChecks) {
return getSupertypeOrUnion(types);
}
- var primaryTypes = ts.filter(types, function (t) { return !(t.flags & 12288); });
+ var primaryTypes = ts.filter(types, function (t) { return !(t.flags & 24576); });
return primaryTypes.length ?
- getNullableType(getSupertypeOrUnion(primaryTypes), getFalsyFlagsOfTypes(types) & 12288) :
+ getNullableType(getSupertypeOrUnion(primaryTypes), getFalsyFlagsOfTypes(types) & 24576) :
getUnionType(types, 2);
}
function getCommonSubtype(types) {
return ts.reduceLeft(types, function (s, t) { return isTypeSubtypeOf(t, s) ? t : s; });
}
function isArrayType(type) {
- return ts.getObjectFlags(type) & 4 && type.target === globalArrayType;
+ return !!(ts.getObjectFlags(type) & 4) && type.target === globalArrayType;
}
function isArrayLikeType(type) {
return ts.getObjectFlags(type) & 4 && (type.target === globalArrayType || type.target === globalReadonlyArrayType) ||
- !(type.flags & 12288) && isTypeAssignableTo(type, anyReadonlyArrayType);
+ !(type.flags & 24576) && isTypeAssignableTo(type, anyReadonlyArrayType);
}
function isEmptyArrayLiteralType(type) {
var elementType = isArrayType(type) ? type.typeArguments[0] : undefined;
@@ -30835,35 +31041,35 @@ var ts;
return !!getPropertyOfType(type, "0");
}
function isNeitherUnitTypeNorNever(type) {
- return !(type.flags & (13536 | 16384));
+ return !(type.flags & (27072 | 32768));
}
function isUnitType(type) {
- return !!(type.flags & 13536);
+ return !!(type.flags & 27072);
}
function isLiteralType(type) {
- return type.flags & 8 ? true :
- type.flags & 131072 ? type.flags & 256 ? true : !ts.forEach(type.types, function (t) { return !isUnitType(t); }) :
+ return type.flags & 16 ? true :
+ type.flags & 262144 ? type.flags & 512 ? true : !ts.forEach(type.types, function (t) { return !isUnitType(t); }) :
isUnitType(type);
}
function getBaseTypeOfLiteralType(type) {
- return type.flags & 256 ? getBaseTypeOfEnumLiteralType(type) :
- type.flags & 32 ? stringType :
- type.flags & 64 ? numberType :
- type.flags & 128 ? booleanType :
- type.flags & 131072 ? getUnionType(ts.sameMap(type.types, getBaseTypeOfLiteralType)) :
+ return type.flags & 512 ? getBaseTypeOfEnumLiteralType(type) :
+ type.flags & 64 ? stringType :
+ type.flags & 128 ? numberType :
+ type.flags & 256 ? booleanType :
+ type.flags & 262144 ? getUnionType(ts.sameMap(type.types, getBaseTypeOfLiteralType)) :
type;
}
function getWidenedLiteralType(type) {
- return type.flags & 256 ? getBaseTypeOfEnumLiteralType(type) :
- type.flags & 32 && type.flags & 8388608 ? stringType :
- type.flags & 64 && type.flags & 8388608 ? numberType :
- type.flags & 128 ? booleanType :
- type.flags & 131072 ? getUnionType(ts.sameMap(type.types, getWidenedLiteralType)) :
+ return type.flags & 512 ? getBaseTypeOfEnumLiteralType(type) :
+ type.flags & 64 && type.flags & 33554432 ? stringType :
+ type.flags & 128 && type.flags & 33554432 ? numberType :
+ type.flags & 256 ? booleanType :
+ type.flags & 262144 ? getUnionType(ts.sameMap(type.types, getWidenedLiteralType)) :
type;
}
function getWidenedUniqueESSymbolType(type) {
- return type.flags & 1024 ? esSymbolType :
- type.flags & 131072 ? getUnionType(ts.sameMap(type.types, getWidenedUniqueESSymbolType)) :
+ return type.flags & 2048 ? esSymbolType :
+ type.flags & 262144 ? getUnionType(ts.sameMap(type.types, getWidenedUniqueESSymbolType)) :
type;
}
function getWidenedLiteralLikeTypeForContextualType(type, contextualType) {
@@ -30884,39 +31090,39 @@ var ts;
return result;
}
function getFalsyFlags(type) {
- return type.flags & 131072 ? getFalsyFlagsOfTypes(type.types) :
- type.flags & 32 ? type.value === "" ? 32 : 0 :
- type.flags & 64 ? type.value === 0 ? 64 : 0 :
- type.flags & 128 ? type === falseType ? 128 : 0 :
- type.flags & 14574;
+ return type.flags & 262144 ? getFalsyFlagsOfTypes(type.types) :
+ type.flags & 64 ? type.value === "" ? 64 : 0 :
+ type.flags & 128 ? type.value === 0 ? 128 : 0 :
+ type.flags & 256 ? type === falseType ? 256 : 0 :
+ type.flags & 29148;
}
function removeDefinitelyFalsyTypes(type) {
- return getFalsyFlags(type) & 14560 ?
- filterType(type, function (t) { return !(getFalsyFlags(t) & 14560); }) :
+ return getFalsyFlags(type) & 29120 ?
+ filterType(type, function (t) { return !(getFalsyFlags(t) & 29120); }) :
type;
}
function extractDefinitelyFalsyTypes(type) {
return mapType(type, getDefinitelyFalsyPartOfType);
}
function getDefinitelyFalsyPartOfType(type) {
- return type.flags & 2 ? emptyStringType :
- type.flags & 4 ? zeroType :
- type.flags & 8 || type === falseType ? falseType :
- type.flags & (2048 | 4096 | 8192) ||
- type.flags & 32 && type.value === "" ||
- type.flags & 64 && type.value === 0 ? type :
+ return type.flags & 4 ? emptyStringType :
+ type.flags & 8 ? zeroType :
+ type.flags & 16 || type === falseType ? falseType :
+ type.flags & (4096 | 8192 | 16384) ||
+ type.flags & 64 && type.value === "" ||
+ type.flags & 128 && type.value === 0 ? type :
neverType;
}
function getNullableType(type, flags) {
- var missing = (flags & ~type.flags) & (4096 | 8192);
+ var missing = (flags & ~type.flags) & (8192 | 16384);
return missing === 0 ? type :
- missing === 4096 ? getUnionType([type, undefinedType]) :
- missing === 8192 ? getUnionType([type, nullType]) :
+ missing === 8192 ? getUnionType([type, undefinedType]) :
+ missing === 16384 ? getUnionType([type, nullType]) :
getUnionType([type, undefinedType, nullType]);
}
function getOptionalType(type) {
ts.Debug.assert(strictNullChecks);
- return type.flags & 4096 ? type : getUnionType([type, undefinedType]);
+ return type.flags & 8192 ? type : getUnionType([type, undefinedType]);
}
function getGlobalNonNullableTypeInstantiation(type) {
if (!deferredGlobalNonNullableTypeAlias) {
@@ -30959,7 +31165,7 @@ var ts;
return members;
}
function getRegularTypeOfObjectLiteral(type) {
- if (!(isObjectLiteralType(type) && type.flags & 8388608)) {
+ if (!(isObjectLiteralType(type) && type.flags & 33554432)) {
return type;
}
var regularType = type.regularType;
@@ -30969,7 +31175,7 @@ var ts;
var resolved = type;
var members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral);
var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.stringIndexInfo, resolved.numberIndexInfo);
- regularNew.flags = resolved.flags & ~8388608;
+ regularNew.flags = resolved.flags & ~33554432;
regularNew.objectFlags |= 128;
type.regularType = regularNew;
return regularNew;
@@ -31049,16 +31255,16 @@ var ts;
return getWidenedTypeWithContext(type, undefined);
}
function getWidenedTypeWithContext(type, context) {
- if (type.flags & 50331648) {
- if (type.flags & 12288) {
+ if (type.flags & 402653184) {
+ if (type.flags & 24576) {
return anyType;
}
if (isObjectLiteralType(type)) {
return getWidenedTypeOfObjectLiteral(type, context);
}
- if (type.flags & 131072) {
+ if (type.flags & 262144) {
var unionContext_1 = context || createWideningContext(undefined, undefined, type.types);
- var widenedTypes = ts.sameMap(type.types, function (t) { return t.flags & 12288 ? t : getWidenedTypeWithContext(t, unionContext_1); });
+ var widenedTypes = ts.sameMap(type.types, function (t) { return t.flags & 24576 ? t : getWidenedTypeWithContext(t, unionContext_1); });
return getUnionType(widenedTypes, ts.some(widenedTypes, isEmptyObjectType) ? 2 : 1);
}
if (isArrayType(type) || isTupleType(type)) {
@@ -31069,8 +31275,8 @@ var ts;
}
function reportWideningErrorsInType(type) {
var errorReported = false;
- if (type.flags & 16777216) {
- if (type.flags & 131072) {
+ if (type.flags & 134217728) {
+ if (type.flags & 262144) {
if (ts.some(type.types, isEmptyObjectType)) {
errorReported = true;
}
@@ -31095,7 +31301,7 @@ var ts;
for (var _d = 0, _e = getPropertiesOfObjectType(type); _d < _e.length; _d++) {
var p = _e[_d];
var t = getTypeOfSymbol(p);
- if (t.flags & 16777216) {
+ if (t.flags & 134217728) {
if (!reportWideningErrorsInType(t)) {
error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t)));
}
@@ -31110,33 +31316,33 @@ var ts;
var typeAsString = typeToString(getWidenedType(type));
var diagnostic;
switch (declaration.kind) {
- case 199:
+ case 200:
+ case 152:
case 151:
- case 150:
diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type;
break;
- case 148:
+ case 149:
diagnostic = declaration.dotDotDotToken ?
ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type :
ts.Diagnostics.Parameter_0_implicitly_has_an_1_type;
break;
- case 181:
+ case 182:
diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type;
break;
- case 233:
+ case 234:
+ case 154:
case 153:
- case 152:
- case 155:
case 156:
- case 191:
+ case 157:
case 192:
+ case 193:
if (!declaration.name) {
error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
return;
}
diagnostic = ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type;
break;
- case 176:
+ case 177:
error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type);
return;
default:
@@ -31145,7 +31351,7 @@ var ts;
error(declaration, diagnostic, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)), typeAsString);
}
function reportErrorsFromWidening(declaration, type) {
- if (produceDiagnostics && noImplicitAny && type.flags & 16777216) {
+ if (produceDiagnostics && noImplicitAny && type.flags & 134217728) {
if (!reportWideningErrorsInType(type)) {
reportImplicitAnyError(declaration, type);
}
@@ -31214,25 +31420,25 @@ var ts;
}
function couldContainTypeVariables(type) {
var objectFlags = ts.getObjectFlags(type);
- return !!(type.flags & 7897088 ||
+ return !!(type.flags & 15794176 ||
objectFlags & 4 && ts.forEach(type.typeArguments, couldContainTypeVariables) ||
objectFlags & 16 && type.symbol && type.symbol.flags & (16 | 8192 | 2048 | 32) ||
objectFlags & 32 ||
- type.flags & 393216 && couldUnionOrIntersectionContainTypeVariables(type));
+ type.flags & 786432 && couldUnionOrIntersectionContainTypeVariables(type));
}
function couldUnionOrIntersectionContainTypeVariables(type) {
if (type.couldContainTypeVariables === undefined) {
- type.couldContainTypeVariables = ts.forEach(type.types, couldContainTypeVariables);
+ type.couldContainTypeVariables = ts.some(type.types, couldContainTypeVariables);
}
return type.couldContainTypeVariables;
}
function isTypeParameterAtTopLevel(type, typeParameter) {
- return type === typeParameter || type.flags & 393216 && ts.forEach(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); });
+ return type === typeParameter || !!(type.flags & 786432) && ts.some(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); });
}
function createEmptyObjectTypeFromStringLiteral(type) {
var members = ts.createSymbolTable();
forEachType(type, function (t) {
- if (!(t.flags & 32)) {
+ if (!(t.flags & 64)) {
return;
}
var name = ts.escapeLeadingUnderscores(t.value);
@@ -31244,7 +31450,7 @@ var ts;
}
members.set(name, literalProp);
});
- var indexInfo = type.flags & 2 ? createIndexInfo(emptyObjectType, false) : undefined;
+ var indexInfo = type.flags & 4 ? createIndexInfo(emptyObjectType, false) : undefined;
return createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, indexInfo, undefined);
}
function inferTypeForHomomorphicMappedType(source, target) {
@@ -31264,7 +31470,7 @@ var ts;
}
for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) {
var prop = properties_4[_i];
- if (getTypeOfSymbol(prop).flags & 67108864) {
+ if (getTypeOfSymbol(prop).flags & 536870912) {
return undefined;
}
}
@@ -31284,7 +31490,7 @@ var ts;
return getTypeFromInference(inference);
}
function getUnmatchedProperty(source, target, requireOptionalProperties) {
- var properties = target.flags & 262144 ? getPropertiesOfUnionOrIntersectionType(target) : getPropertiesOfObjectType(target);
+ var properties = target.flags & 524288 ? getPropertiesOfUnionOrIntersectionType(target) : getPropertiesOfObjectType(target);
for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) {
var targetProp = properties_5[_i];
if (requireOptionalProperties || !(targetProp.flags & 16777216)) {
@@ -31331,8 +31537,8 @@ var ts;
}
return;
}
- if (source.flags & 131072 && target.flags & 131072 && !(source.flags & 256 && target.flags & 256) ||
- source.flags & 262144 && target.flags & 262144) {
+ if (source.flags & 262144 && target.flags & 262144 && !(source.flags & 512 && target.flags & 512) ||
+ source.flags & 524288 && target.flags & 524288) {
if (source === target) {
for (var _i = 0, _a = source.types; _i < _a.length; _i++) {
var t = _a[_i];
@@ -31347,7 +31553,7 @@ var ts;
(matchingTypes || (matchingTypes = [])).push(t);
inferFromTypes(t, t);
}
- else if (t.flags & (64 | 32)) {
+ else if (t.flags & (128 | 64)) {
var b = getBaseTypeOfLiteralType(t);
if (typeIdenticalToSomeType(b, target.types)) {
(matchingTypes || (matchingTypes = [])).push(t, b);
@@ -31359,8 +31565,8 @@ var ts;
target = removeTypesFromUnionOrIntersection(target, matchingTypes);
}
}
- if (target.flags & 1081344) {
- if (source.flags & 67108864 || source === silentNeverType) {
+ if (target.flags & 2162688) {
+ if (source.flags & 536870912 || source === silentNeverType) {
return;
}
var inference = getInferenceInfoForType(target);
@@ -31380,7 +31586,7 @@ var ts;
inference.candidates = ts.append(inference.candidates, candidate);
}
}
- if (!(priority & 8) && target.flags & 32768 && !isTypeParameterAtTopLevel(originalTarget, target)) {
+ if (!(priority & 8) && target.flags & 65536 && !isTypeParameterAtTopLevel(originalTarget, target)) {
inference.topLevel = false;
}
}
@@ -31401,12 +31607,12 @@ var ts;
}
}
}
- else if (source.flags & 524288 && target.flags & 524288) {
+ else if (source.flags & 1048576 && target.flags & 1048576) {
contravariant = !contravariant;
inferFromTypes(source.type, target.type);
contravariant = !contravariant;
}
- else if ((isLiteralType(source) || source.flags & 2) && target.flags & 524288) {
+ else if ((isLiteralType(source) || source.flags & 4) && target.flags & 1048576) {
var empty = createEmptyObjectTypeFromStringLiteral(source);
contravariant = !contravariant;
var savePriority = priority;
@@ -31415,17 +31621,17 @@ var ts;
priority = savePriority;
contravariant = !contravariant;
}
- else if (source.flags & 1048576 && target.flags & 1048576) {
+ else if (source.flags & 2097152 && target.flags & 2097152) {
inferFromTypes(source.objectType, target.objectType);
inferFromTypes(source.indexType, target.indexType);
}
- else if (source.flags & 2097152 && target.flags & 2097152) {
+ else if (source.flags & 4194304 && target.flags & 4194304) {
inferFromTypes(source.checkType, target.checkType);
inferFromTypes(source.extendsType, target.extendsType);
inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target));
inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target));
}
- else if (target.flags & 393216) {
+ else if (target.flags & 786432) {
var targetTypes = target.types;
var typeVariableCount = 0;
var typeVariable = void 0;
@@ -31446,7 +31652,7 @@ var ts;
priority = savePriority;
}
}
- else if (source.flags & 131072) {
+ else if (source.flags & 262144) {
var sourceTypes = source.types;
for (var _e = 0, sourceTypes_3 = sourceTypes; _e < sourceTypes_3.length; _e++) {
var sourceType = sourceTypes_3[_e];
@@ -31454,16 +31660,16 @@ var ts;
}
}
else {
- if (!(priority & 32 && source.flags & (262144 | 7897088))) {
+ if (!(priority & 32 && source.flags & (524288 | 15794176))) {
source = getApparentType(source);
}
- if (source.flags & (65536 | 262144)) {
+ if (source.flags & (131072 | 524288)) {
var key = source.id + "," + target.id;
if (visited && visited.get(key)) {
return;
}
(visited || (visited = ts.createMap())).set(key, true);
- var isNonConstructorObject = target.flags & 65536 &&
+ var isNonConstructorObject = target.flags & 131072 &&
!(ts.getObjectFlags(target) & 16 && target.symbol && target.symbol.flags & 32);
var symbol = isNonConstructorObject ? target.symbol : undefined;
if (symbol) {
@@ -31491,7 +31697,7 @@ var ts;
}
}
function getInferenceInfoForType(type) {
- if (type.flags & 1081344) {
+ if (type.flags & 2162688) {
for (var _i = 0, inferences_1 = inferences; _i < inferences_1.length; _i++) {
var inference = inferences_1[_i];
if (type === inference.typeParameter) {
@@ -31508,7 +31714,7 @@ var ts;
}
if (ts.getObjectFlags(target) & 32) {
var constraintType = getConstraintTypeFromMappedType(target);
- if (constraintType.flags & 524288) {
+ if (constraintType.flags & 1048576) {
var inference = getInferenceInfoForType(constraintType.type);
if (inference && !inference.isFixed) {
var inferredType = inferTypeForHomomorphicMappedType(source, target);
@@ -31521,7 +31727,7 @@ var ts;
}
return;
}
- if (constraintType.flags & 32768) {
+ if (constraintType.flags & 65536) {
var savePriority = priority;
priority |= 4;
inferFromTypes(getIndexType(source), constraintType);
@@ -31605,11 +31811,11 @@ var ts;
reducedTypes.push(t);
}
}
- return type.flags & 131072 ? getUnionType(reducedTypes) : getIntersectionType(reducedTypes);
+ return type.flags & 262144 ? getUnionType(reducedTypes) : getIntersectionType(reducedTypes);
}
function hasPrimitiveConstraint(type) {
var constraint = getConstraintOfTypeParameter(type);
- return constraint && maybeTypeOfKind(constraint, 16382 | 524288);
+ return !!constraint && maybeTypeOfKind(constraint, 32764 | 1048576);
}
function isObjectLiteralType(type) {
return !!(ts.getObjectFlags(type) & 128);
@@ -31629,10 +31835,12 @@ var ts;
}
function getCovariantInference(inference, context, signature) {
var candidates = widenObjectLiteralCandidates(inference.candidates);
- var widenLiteralTypes = inference.topLevel &&
- !hasPrimitiveConstraint(inference.typeParameter) &&
+ var primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter);
+ var widenLiteralTypes = !primitiveConstraint && inference.topLevel &&
(inference.isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), inference.typeParameter));
- var baseCandidates = widenLiteralTypes ? ts.sameMap(candidates, getWidenedLiteralType) : candidates;
+ var baseCandidates = primitiveConstraint ? ts.sameMap(candidates, getRegularTypeOfLiteralType) :
+ widenLiteralTypes ? ts.sameMap(candidates, getWidenedLiteralType) :
+ candidates;
var unwidenedType = context.flags & 1 || inference.priority & 28 ?
getUnionType(baseCandidates, 2) :
getCommonSupertype(baseCandidates);
@@ -31646,7 +31854,7 @@ var ts;
if (signature) {
if (inference.candidates) {
inferredType = getCovariantInference(inference, context, signature);
- if (inferredType.flags & 16384 && inference.contraCandidates) {
+ if (inferredType.flags & 32768 && inference.contraCandidates) {
inferredType = getContravariantInference(inference);
}
}
@@ -31699,7 +31907,7 @@ var ts;
return links.resolvedSymbol;
}
function isInTypeQuery(node) {
- return !!ts.findAncestor(node, function (n) { return n.kind === 164 ? true : n.kind === 71 || n.kind === 145 ? false : "quit"; });
+ return !!ts.findAncestor(node, function (n) { return n.kind === 165 ? true : n.kind === 71 || n.kind === 146 ? false : "quit"; });
}
function getFlowCacheKey(node) {
if (node.kind === 71) {
@@ -31709,13 +31917,13 @@ var ts;
if (node.kind === 99) {
return "0";
}
- if (node.kind === 184) {
+ if (node.kind === 185) {
var key = getFlowCacheKey(node.expression);
return key && key + "." + ts.idText(node.name);
}
- if (node.kind === 181) {
+ if (node.kind === 182) {
var container = node.parent.parent;
- var key = container.kind === 181 ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer));
+ var key = container.kind === 182 ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer));
var text = getBindingElementNameText(node);
var result = key && text && (key + "." + text);
return result;
@@ -31723,12 +31931,13 @@ var ts;
return undefined;
}
function getBindingElementNameText(element) {
- if (element.parent.kind === 179) {
+ var parent = element.parent;
+ if (parent.kind === 180) {
var name = element.propertyName || element.name;
switch (name.kind) {
case 71:
return ts.idText(name);
- case 146:
+ case 147:
return ts.isStringOrNumericLiteral(name.expression) ? name.expression.text : undefined;
case 9:
case 8:
@@ -31738,41 +31947,41 @@ var ts;
}
}
else {
- return "" + element.parent.elements.indexOf(element);
+ return "" + parent.elements.indexOf(element);
}
}
function isMatchingReference(source, target) {
switch (source.kind) {
case 71:
return target.kind === 71 && getResolvedSymbol(source) === getResolvedSymbol(target) ||
- (target.kind === 231 || target.kind === 181) &&
+ (target.kind === 232 || target.kind === 182) &&
getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target);
case 99:
return target.kind === 99;
case 97:
return target.kind === 97;
- case 184:
- return target.kind === 184 &&
+ case 185:
+ return target.kind === 185 &&
source.name.escapedText === target.name.escapedText &&
isMatchingReference(source.expression, target.expression);
- case 181:
- if (target.kind !== 184)
+ case 182:
+ if (target.kind !== 185)
return false;
var t = target;
if (t.name.escapedText !== getBindingElementNameText(source))
return false;
- if (source.parent.parent.kind === 181 && isMatchingReference(source.parent.parent, t.expression)) {
+ if (source.parent.parent.kind === 182 && isMatchingReference(source.parent.parent, t.expression)) {
return true;
}
- if (source.parent.parent.kind === 231) {
+ if (source.parent.parent.kind === 232) {
var maybeId = source.parent.parent.initializer;
- return maybeId && isMatchingReference(maybeId, t.expression);
+ return !!maybeId && isMatchingReference(maybeId, t.expression);
}
}
return false;
}
function containsMatchingReference(source, target) {
- while (source.kind === 184) {
+ while (source.kind === 185) {
source = source.expression;
if (isMatchingReference(source, target)) {
return true;
@@ -31781,7 +31990,7 @@ var ts;
return false;
}
function containsMatchingReferenceDiscriminant(source, target) {
- return target.kind === 184 &&
+ return target.kind === 185 &&
containsMatchingReference(source, target.expression) &&
isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.escapedText);
}
@@ -31789,18 +31998,18 @@ var ts;
if (expr.kind === 71) {
return getTypeOfSymbol(getResolvedSymbol(expr));
}
- if (expr.kind === 184) {
+ if (expr.kind === 185) {
var type = getDeclaredTypeOfReference(expr.expression);
return type && getTypeOfPropertyOfType(type, expr.name.escapedText);
}
return undefined;
}
function isDiscriminantProperty(type, name) {
- if (type && type.flags & 131072) {
+ if (type && type.flags & 262144) {
var prop = getUnionOrIntersectionProperty(type, name);
if (prop && ts.getCheckFlags(prop) & 2) {
if (prop.isDiscriminantProperty === undefined) {
- prop.isDiscriminantProperty = prop.checkFlags & 32 && isLiteralType(getTypeOfSymbol(prop));
+ prop.isDiscriminantProperty = !!(prop.checkFlags & 32) && isLiteralType(getTypeOfSymbol(prop));
}
return prop.isDiscriminantProperty;
}
@@ -31833,7 +32042,7 @@ var ts;
}
}
}
- if (callExpression.expression.kind === 184 &&
+ if (callExpression.expression.kind === 185 &&
isOrContainsMatchingReference(reference, callExpression.expression.expression)) {
return true;
}
@@ -31847,7 +32056,7 @@ var ts;
return flow.id;
}
function typeMaybeAssignableTo(source, target) {
- if (!(source.flags & 131072)) {
+ if (!(source.flags & 262144)) {
return isTypeAssignableTo(source, target);
}
for (var _i = 0, _a = source.types; _i < _a.length; _i++) {
@@ -31860,11 +32069,11 @@ var ts;
}
function getAssignmentReducedType(declaredType, assignedType) {
if (declaredType !== assignedType) {
- if (assignedType.flags & 16384) {
+ if (assignedType.flags & 32768) {
return assignedType;
}
var reducedType = filterType(declaredType, function (t) { return typeMaybeAssignableTo(assignedType, t); });
- if (!(reducedType.flags & 16384)) {
+ if (!(reducedType.flags & 32768)) {
return reducedType;
}
}
@@ -31885,53 +32094,53 @@ var ts;
}
function getTypeFacts(type) {
var flags = type.flags;
- if (flags & 2) {
+ if (flags & 4) {
return strictNullChecks ? 4079361 : 4194049;
}
- if (flags & 32) {
+ if (flags & 64) {
var isEmpty = type.value === "";
return strictNullChecks ?
isEmpty ? 3030785 : 1982209 :
isEmpty ? 3145473 : 4194049;
}
- if (flags & (4 | 16)) {
+ if (flags & (8 | 32)) {
return strictNullChecks ? 4079234 : 4193922;
}
- if (flags & 64) {
+ if (flags & 128) {
var isZero = type.value === 0;
return strictNullChecks ?
isZero ? 3030658 : 1982082 :
isZero ? 3145346 : 4193922;
}
- if (flags & 8) {
+ if (flags & 16) {
return strictNullChecks ? 4078980 : 4193668;
}
- if (flags & 136) {
+ if (flags & 272) {
return strictNullChecks ?
type === falseType ? 3030404 : 1981828 :
type === falseType ? 3145092 : 4193668;
}
- if (flags & 65536) {
+ if (flags & 131072) {
return isFunctionObjectType(type) ?
strictNullChecks ? 1970144 : 4181984 :
strictNullChecks ? 1972176 : 4184016;
}
- if (flags & (2048 | 4096)) {
+ if (flags & (4096 | 8192)) {
return 2457472;
}
- if (flags & 8192) {
+ if (flags & 16384) {
return 2340752;
}
- if (flags & 1536) {
+ if (flags & 3072) {
return strictNullChecks ? 1981320 : 4193160;
}
- if (flags & 134217728) {
+ if (flags & 16777216) {
return strictNullChecks ? 1972176 : 4184016;
}
- if (flags & 7897088) {
+ if (flags & 15794176) {
return getTypeFacts(getBaseConstraintOfType(type) || emptyObjectType);
}
- if (flags & 393216) {
+ if (flags & 786432) {
return getTypeFactsOfTypes(type.types);
}
return 4194303;
@@ -31951,26 +32160,26 @@ var ts;
return getConstraintForLocation(getTypeOfPropertyOfType(type, text), name) ||
isNumericLiteralName(text) && getIndexTypeOfType(type, 1) ||
getIndexTypeOfType(type, 0) ||
- unknownType;
+ errorType;
}
function getTypeOfDestructuredArrayElement(type, index) {
return isTupleLikeType(type) && getTypeOfPropertyOfType(type, "" + index) ||
checkIteratedTypeOrElementType(type, undefined, false, false) ||
- unknownType;
+ errorType;
}
function getTypeOfDestructuredSpreadExpression(type) {
- return createArrayType(checkIteratedTypeOrElementType(type, undefined, false, false) || unknownType);
+ return createArrayType(checkIteratedTypeOrElementType(type, undefined, false, false) || errorType);
}
function getAssignedTypeOfBinaryExpression(node) {
- var isDestructuringDefaultAssignment = node.parent.kind === 182 && isDestructuringAssignmentTarget(node.parent) ||
- node.parent.kind === 269 && isDestructuringAssignmentTarget(node.parent.parent);
+ var isDestructuringDefaultAssignment = node.parent.kind === 183 && isDestructuringAssignmentTarget(node.parent) ||
+ node.parent.kind === 270 && isDestructuringAssignmentTarget(node.parent.parent);
return isDestructuringDefaultAssignment ?
getTypeWithDefault(getAssignedType(node), node.right) :
getTypeOfExpression(node.right);
}
function isDestructuringAssignmentTarget(parent) {
- return parent.parent.kind === 199 && parent.parent.left === parent ||
- parent.parent.kind === 221 && parent.parent.initializer === parent;
+ return parent.parent.kind === 200 && parent.parent.left === parent ||
+ parent.parent.kind === 222 && parent.parent.initializer === parent;
}
function getAssignedTypeOfArrayLiteralElement(node, element) {
return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element));
@@ -31987,29 +32196,29 @@ var ts;
function getAssignedType(node) {
var parent = node.parent;
switch (parent.kind) {
- case 220:
- return stringType;
case 221:
- return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || unknownType;
- case 199:
+ return stringType;
+ case 222:
+ return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || errorType;
+ case 200:
return getAssignedTypeOfBinaryExpression(parent);
- case 193:
+ case 194:
return undefinedType;
- case 182:
+ case 183:
return getAssignedTypeOfArrayLiteralElement(parent, node);
- case 203:
+ case 204:
return getAssignedTypeOfSpreadExpression(parent);
- case 269:
- return getAssignedTypeOfPropertyAssignment(parent);
case 270:
+ return getAssignedTypeOfPropertyAssignment(parent);
+ case 271:
return getAssignedTypeOfShorthandPropertyAssignment(parent);
}
- return unknownType;
+ return errorType;
}
function getInitialTypeOfBindingElement(node) {
var pattern = node.parent;
var parentType = getInitialType(pattern.parent);
- var type = pattern.kind === 179 ?
+ var type = pattern.kind === 180 ?
getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) :
!node.dotDotDotToken ?
getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) :
@@ -32024,35 +32233,35 @@ var ts;
if (node.initializer) {
return getTypeOfInitializer(node.initializer);
}
- if (node.parent.parent.kind === 220) {
+ if (node.parent.parent.kind === 221) {
return stringType;
}
- if (node.parent.parent.kind === 221) {
- return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || unknownType;
+ if (node.parent.parent.kind === 222) {
+ return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || errorType;
}
- return unknownType;
+ return errorType;
}
function getInitialType(node) {
- return node.kind === 231 ?
+ return node.kind === 232 ?
getInitialTypeOfVariableDeclaration(node) :
getInitialTypeOfBindingElement(node);
}
function getInitialOrAssignedType(node) {
- return node.kind === 231 || node.kind === 181 ?
+ return node.kind === 232 || node.kind === 182 ?
getInitialType(node) :
getAssignedType(node);
}
function isEmptyArrayAssignment(node) {
- return node.kind === 231 && node.initializer &&
+ return node.kind === 232 && node.initializer &&
isEmptyArrayLiteral(node.initializer) ||
- node.kind !== 181 && node.parent.kind === 199 &&
+ node.kind !== 182 && node.parent.kind === 200 &&
isEmptyArrayLiteral(node.parent.right);
}
function getReferenceCandidate(node) {
switch (node.kind) {
- case 190:
+ case 191:
return getReferenceCandidate(node.expression);
- case 199:
+ case 200:
switch (node.operatorToken.kind) {
case 58:
return getReferenceCandidate(node.left);
@@ -32064,13 +32273,13 @@ var ts;
}
function getReferenceRoot(node) {
var parent = node.parent;
- return parent.kind === 190 ||
- parent.kind === 199 && parent.operatorToken.kind === 58 && parent.left === node ||
- parent.kind === 199 && parent.operatorToken.kind === 26 && parent.right === node ?
+ return parent.kind === 191 ||
+ parent.kind === 200 && parent.operatorToken.kind === 58 && parent.left === node ||
+ parent.kind === 200 && parent.operatorToken.kind === 26 && parent.right === node ?
getReferenceRoot(parent) : node;
}
function getTypeOfSwitchClause(clause) {
- if (clause.kind === 265) {
+ if (clause.kind === 266) {
return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression));
}
return neverType;
@@ -32087,13 +32296,13 @@ var ts;
return links.switchTypes;
}
function eachTypeContainedIn(source, types) {
- return source.flags & 131072 ? !ts.forEach(source.types, function (t) { return !ts.contains(types, t); }) : ts.contains(types, source);
+ return source.flags & 262144 ? !ts.forEach(source.types, function (t) { return !ts.contains(types, t); }) : ts.contains(types, source);
}
function isTypeSubsetOf(source, target) {
- return source === target || target.flags & 131072 && isTypeSubsetOfUnion(source, target);
+ return source === target || target.flags & 262144 && isTypeSubsetOfUnion(source, target);
}
function isTypeSubsetOfUnion(source, target) {
- if (source.flags & 131072) {
+ if (source.flags & 262144) {
for (var _i = 0, _a = source.types; _i < _a.length; _i++) {
var t = _a[_i];
if (!containsType(target.types, t)) {
@@ -32102,27 +32311,27 @@ var ts;
}
return true;
}
- if (source.flags & 256 && getBaseTypeOfEnumLiteralType(source) === target) {
+ if (source.flags & 512 && getBaseTypeOfEnumLiteralType(source) === target) {
return true;
}
return containsType(target.types, source);
}
function forEachType(type, f) {
- return type.flags & 131072 ? ts.forEach(type.types, f) : f(type);
+ return type.flags & 262144 ? ts.forEach(type.types, f) : f(type);
}
function filterType(type, f) {
- if (type.flags & 131072) {
+ if (type.flags & 262144) {
var types = type.types;
var filtered = ts.filter(types, f);
- return filtered === types ? type : getUnionTypeFromSortedList(filtered, type.flags & 268435456);
+ return filtered === types ? type : getUnionTypeFromSortedList(filtered, type.flags & 67108864);
}
return f(type) ? type : neverType;
}
function mapType(type, mapper, noReductions) {
- if (type.flags & 16384) {
+ if (type.flags & 32768) {
return type;
}
- if (!(type.flags & 131072)) {
+ if (!(type.flags & 262144)) {
return mapper(type);
}
var types = type.types;
@@ -32149,11 +32358,11 @@ var ts;
return filterType(type, function (t) { return (t.flags & kind) !== 0; });
}
function replacePrimitivesWithLiterals(typeWithPrimitives, typeWithLiterals) {
- if (isTypeSubsetOf(stringType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 32) ||
- isTypeSubsetOf(numberType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 64)) {
+ if (isTypeSubsetOf(stringType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 64) ||
+ isTypeSubsetOf(numberType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 128)) {
return mapType(typeWithPrimitives, function (t) {
- return t.flags & 2 ? extractTypesOfKind(typeWithLiterals, 2 | 32) :
- t.flags & 4 ? extractTypesOfKind(typeWithLiterals, 4 | 64) :
+ return t.flags & 4 ? extractTypesOfKind(typeWithLiterals, 4 | 64) :
+ t.flags & 8 ? extractTypesOfKind(typeWithLiterals, 8 | 128) :
t;
});
}
@@ -32181,9 +32390,9 @@ var ts;
return isTypeSubsetOf(elementType, evolvingArrayType.elementType) ? evolvingArrayType : getEvolvingArrayType(getUnionType([evolvingArrayType.elementType, elementType]));
}
function createFinalArrayType(elementType) {
- return elementType.flags & 16384 ?
+ return elementType.flags & 32768 ?
autoArrayType :
- createArrayType(elementType.flags & 131072 ?
+ createArrayType(elementType.flags & 262144 ?
getUnionType(elementType.types, 2) :
elementType);
}
@@ -32200,7 +32409,7 @@ var ts;
var hasEvolvingArrayType = false;
for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
var t = types_14[_i];
- if (!(t.flags & 16384)) {
+ if (!(t.flags & 32768)) {
if (!(ts.getObjectFlags(t) & 256)) {
return false;
}
@@ -32217,15 +32426,15 @@ var ts;
function isEvolvingArrayOperationTarget(node) {
var root = getReferenceRoot(node);
var parent = root.parent;
- var isLengthPushOrUnshift = parent.kind === 184 && (parent.name.escapedText === "length" ||
- parent.parent.kind === 186 && ts.isPushOrUnshiftIdentifier(parent.name));
- var isElementAssignment = parent.kind === 185 &&
+ var isLengthPushOrUnshift = parent.kind === 185 && (parent.name.escapedText === "length" ||
+ parent.parent.kind === 187 && ts.isPushOrUnshiftIdentifier(parent.name));
+ var isElementAssignment = parent.kind === 186 &&
parent.expression === root &&
- parent.parent.kind === 199 &&
+ parent.parent.kind === 200 &&
parent.parent.operatorToken.kind === 58 &&
parent.parent.left === parent &&
!ts.isAssignmentTarget(parent.parent) &&
- isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 84);
+ isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 168);
return isLengthPushOrUnshift || isElementAssignment;
}
function maybeTypePredicateCall(node) {
@@ -32240,7 +32449,7 @@ var ts;
var funcType = checkNonNullExpression(node.expression);
if (funcType !== silentNeverType) {
var apparentType = getApparentType(funcType);
- return apparentType !== unknownType && ts.some(getSignaturesOfType(apparentType, 0), signatureHasTypePredicate);
+ return apparentType !== errorType && ts.some(getSignaturesOfType(apparentType, 0), signatureHasTypePredicate);
}
}
return false;
@@ -32256,16 +32465,16 @@ var ts;
var key;
var flowDepth = 0;
if (flowAnalysisDisabled) {
- return unknownType;
+ return errorType;
}
- if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 142575359)) {
+ if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 33492479)) {
return declaredType;
}
var sharedFlowStart = sharedFlowCount;
var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode));
sharedFlowCount = sharedFlowStart;
var resultType = ts.getObjectFlags(evolvedType) & 256 && isEvolvingArrayOperationTarget(reference) ? anyArrayType : finalizeEvolvingArrayType(evolvedType);
- if (reference.parent && reference.parent.kind === 208 && getTypeWithFacts(resultType, 524288).flags & 16384) {
+ if (reference.parent && reference.parent.kind === 209 && getTypeWithFacts(resultType, 524288).flags & 32768) {
return declaredType;
}
return resultType;
@@ -32273,7 +32482,7 @@ var ts;
if (flowDepth === 2500) {
flowAnalysisDisabled = true;
reportFlowControlError(reference);
- return unknownType;
+ return errorType;
}
flowDepth++;
while (true) {
@@ -32327,7 +32536,7 @@ var ts;
}
else if (flags & 2) {
var container = flow.container;
- if (container && container !== flowContainer && reference.kind !== 184 && reference.kind !== 99) {
+ if (container && container !== flowContainer && reference.kind !== 185 && reference.kind !== 99) {
flow = container.flowNode;
continue;
}
@@ -32359,7 +32568,7 @@ var ts;
var assignedType = getBaseTypeOfLiteralType(getInitialOrAssignedType(node));
return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType;
}
- if (declaredType.flags & 131072) {
+ if (declaredType.flags & 262144) {
return getAssignmentReducedType(declaredType, getInitialOrAssignedType(node));
}
return declaredType;
@@ -32372,7 +32581,7 @@ var ts;
function getTypeAtFlowArrayMutation(flow) {
if (declaredType === autoType || declaredType === autoArrayType) {
var node = flow.node;
- var expr = node.kind === 186 ?
+ var expr = node.kind === 187 ?
node.expression.expression :
node.left.expression;
if (isMatchingReference(reference, getReferenceCandidate(expr))) {
@@ -32380,7 +32589,7 @@ var ts;
var type = getTypeFromFlowType(flowType);
if (ts.getObjectFlags(type) & 256) {
var evolvedType_1 = type;
- if (node.kind === 186) {
+ if (node.kind === 187) {
for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) {
var arg = _a[_i];
evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg);
@@ -32388,7 +32597,7 @@ var ts;
}
else {
var indexType = getTypeOfExpression(node.left.argumentExpression);
- if (isTypeAssignableToKind(indexType, 84)) {
+ if (isTypeAssignableToKind(indexType, 168)) {
evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, node.right);
}
}
@@ -32402,7 +32611,7 @@ var ts;
function getTypeAtFlowCondition(flow) {
var flowType = getTypeAtFlowNode(flow.antecedent);
var type = getTypeFromFlowType(flowType);
- if (type.flags & 16384) {
+ if (type.flags & 32768) {
return flowType;
}
var assumeTrue = (flow.flags & 32) !== 0;
@@ -32412,7 +32621,7 @@ var ts;
return flowType;
}
var incomplete = isIncomplete(flowType);
- var resultType = incomplete && narrowedType.flags & 16384 ? silentNeverType : narrowedType;
+ var resultType = incomplete && narrowedType.flags & 32768 ? silentNeverType : narrowedType;
return createFlowType(resultType, incomplete);
}
function getTypeAtSwitchClause(flow) {
@@ -32504,8 +32713,8 @@ var ts;
return result;
}
function isMatchingReferenceDiscriminant(expr, computedType) {
- return expr.kind === 184 &&
- computedType.flags & 131072 &&
+ return expr.kind === 185 &&
+ computedType.flags & 262144 &&
isMatchingReference(reference, expr.expression) &&
isDiscriminantProperty(computedType, expr.name.escapedText);
}
@@ -32538,7 +32747,7 @@ var ts;
return !assumeTrue;
}
function narrowByInKeyword(type, literal, assumeTrue) {
- if ((type.flags & (131072 | 65536)) || (type.flags & 32768 && type.isThisType)) {
+ if ((type.flags & (262144 | 131072)) || (type.flags & 65536 && type.isThisType)) {
var propName_1 = ts.escapeLeadingUnderscores(literal.text);
return filterType(type, function (t) { return isTypePresencePossible(t, propName_1, assumeTrue); });
}
@@ -32555,10 +32764,10 @@ var ts;
var operator_1 = expr.operatorToken.kind;
var left_1 = getReferenceCandidate(expr.left);
var right_1 = getReferenceCandidate(expr.right);
- if (left_1.kind === 194 && ts.isStringLiteralLike(right_1)) {
+ if (left_1.kind === 195 && ts.isStringLiteralLike(right_1)) {
return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue);
}
- if (right_1.kind === 194 && ts.isStringLiteralLike(left_1)) {
+ if (right_1.kind === 195 && ts.isStringLiteralLike(left_1)) {
return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue);
}
if (isMatchingReference(reference, left_1)) {
@@ -32598,24 +32807,24 @@ var ts;
assumeTrue = !assumeTrue;
}
var valueType = getTypeOfExpression(value);
- if (valueType.flags & 12288) {
+ if (valueType.flags & 24576) {
if (!strictNullChecks) {
return type;
}
var doubleEquals = operator === 32 || operator === 33;
var facts = doubleEquals ?
assumeTrue ? 65536 : 524288 :
- valueType.flags & 8192 ?
+ valueType.flags & 16384 ?
assumeTrue ? 32768 : 262144 :
assumeTrue ? 16384 : 131072;
return getTypeWithFacts(type, facts);
}
- if (type.flags & 134283777) {
+ if (type.flags & 16909315) {
return type;
}
if (assumeTrue) {
var narrowedType = filterType(type, function (t) { return areTypesComparable(t, valueType); });
- return narrowedType.flags & 16384 ? type : replacePrimitivesWithLiterals(narrowedType, valueType);
+ return narrowedType.flags & 32768 ? type : replacePrimitivesWithLiterals(narrowedType, valueType);
}
if (isUnitType(valueType)) {
var regularType_1 = getRegularTypeOfLiteralType(valueType);
@@ -32634,13 +32843,16 @@ var ts;
if (operator === 33 || operator === 35) {
assumeTrue = !assumeTrue;
}
- if (assumeTrue && !(type.flags & 131072)) {
- var targetType = typeofTypesByName.get(literal.text);
+ if (type.flags & 1 && literal.text === "function") {
+ return type;
+ }
+ if (assumeTrue && !(type.flags & 262144)) {
+ var targetType = literal.text === "function" ? globalFunctionType : typeofTypesByName.get(literal.text);
if (targetType) {
if (isTypeSubtypeOf(targetType, type)) {
return targetType;
}
- if (type.flags & 7897088) {
+ if (type.flags & 15794176) {
var constraint = getBaseConstraintOfType(type) || anyType;
if (isTypeSubtypeOf(targetType, constraint)) {
return getIntersectionType([type, targetType]);
@@ -32661,13 +32873,13 @@ var ts;
var clauseTypes = switchTypes.slice(clauseStart, clauseEnd);
var hasDefaultClause = clauseStart === clauseEnd || ts.contains(clauseTypes, neverType);
var discriminantType = getUnionType(clauseTypes);
- var caseType = discriminantType.flags & 16384 ? neverType :
+ var caseType = discriminantType.flags & 32768 ? neverType :
replacePrimitivesWithLiterals(filterType(type, function (t) { return areTypesComparable(discriminantType, t); }), discriminantType);
if (!hasDefaultClause) {
return caseType;
}
var defaultType = filterType(type, function (t) { return !(isUnitType(t) && ts.contains(switchTypes, getRegularTypeOfLiteralType(t))); });
- return caseType.flags & 16384 ? defaultType : getUnionType([caseType, defaultType]);
+ return caseType.flags & 32768 ? defaultType : getUnionType([caseType, defaultType]);
}
function narrowTypeByInstanceof(type, expr, assumeTrue) {
var left = getReferenceCandidate(expr.left);
@@ -32713,9 +32925,9 @@ var ts;
if (!assumeTrue) {
return filterType(type, function (t) { return !isRelated(t, candidate); });
}
- if (type.flags & 131072) {
+ if (type.flags & 262144) {
var assignableType = filterType(type, function (t) { return isRelated(t, candidate); });
- if (!(assignableType.flags & 16384)) {
+ if (!(assignableType.flags & 32768)) {
return assignableType;
}
}
@@ -32749,7 +32961,7 @@ var ts;
}
else {
var invokedExpression = ts.skipParentheses(callExpression.expression);
- if (invokedExpression.kind === 185 || invokedExpression.kind === 184) {
+ if (invokedExpression.kind === 186 || invokedExpression.kind === 185) {
var accessExpression = invokedExpression;
var possibleReference = ts.skipParentheses(accessExpression.expression);
if (isMatchingReference(reference, possibleReference)) {
@@ -32767,15 +32979,15 @@ var ts;
case 71:
case 99:
case 97:
- case 184:
+ case 185:
return narrowTypeByTruthiness(type, expr, assumeTrue);
- case 186:
+ case 187:
return narrowTypeByTypePredicate(type, expr, assumeTrue);
- case 190:
+ case 191:
return narrowType(type, expr.expression, assumeTrue);
- case 199:
+ case 200:
return narrowTypeByBinaryExpression(type, expr, assumeTrue);
- case 197:
+ case 198:
if (expr.operator === 51) {
return narrowType(type, expr.operand, !assumeTrue);
}
@@ -32802,9 +33014,9 @@ var ts;
function getControlFlowContainer(node) {
return ts.findAncestor(node.parent, function (node) {
return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) ||
- node.kind === 239 ||
- node.kind === 273 ||
- node.kind === 151;
+ node.kind === 240 ||
+ node.kind === 274 ||
+ node.kind === 152;
});
}
function isParameterAssigned(symbol) {
@@ -32825,7 +33037,7 @@ var ts;
if (node.kind === 71) {
if (ts.isAssignmentTarget(node)) {
var symbol = getResolvedSymbol(node);
- if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 148) {
+ if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 149) {
symbol.isAssigned = true;
}
}
@@ -32839,21 +33051,21 @@ var ts;
}
function removeOptionalityFromDeclaredType(declaredType, declaration) {
var annotationIncludesUndefined = strictNullChecks &&
- declaration.kind === 148 &&
+ declaration.kind === 149 &&
declaration.initializer &&
- getFalsyFlags(declaredType) & 4096 &&
- !(getFalsyFlags(checkExpression(declaration.initializer)) & 4096);
+ getFalsyFlags(declaredType) & 8192 &&
+ !(getFalsyFlags(checkExpression(declaration.initializer)) & 8192);
return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 131072) : declaredType;
}
function isConstraintPosition(node) {
var parent = node.parent;
- return parent.kind === 184 ||
+ return parent.kind === 185 ||
+ parent.kind === 187 && parent.expression === node ||
parent.kind === 186 && parent.expression === node ||
- parent.kind === 185 && parent.expression === node ||
- parent.kind === 181 && parent.name === node && !!parent.initializer;
+ parent.kind === 182 && parent.name === node && !!parent.initializer;
}
function typeHasNullableConstraint(type) {
- return type.flags & 7372800 && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 12288);
+ return type.flags & 14745600 && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 24576);
}
function getConstraintForLocation(type, node) {
if (type && isConstraintPosition(node) && forEachType(type, typeHasNullableConstraint)) {
@@ -32869,12 +33081,12 @@ var ts;
function checkIdentifier(node) {
var symbol = getResolvedSymbol(node);
if (symbol === unknownSymbol) {
- return unknownType;
+ return errorType;
}
if (symbol === argumentsSymbol) {
var container = ts.getContainingFunction(node);
if (languageVersion < 2) {
- if (container.kind === 192) {
+ if (container.kind === 193) {
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)) {
@@ -32890,7 +33102,7 @@ var ts;
var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
var declaration = localOrExportSymbol.valueDeclaration;
if (localOrExportSymbol.flags & 32) {
- if (declaration.kind === 234
+ if (declaration.kind === 235
&& ts.nodeIsDecorated(declaration)) {
var container = ts.getContainingClass(node);
while (container !== undefined) {
@@ -32902,11 +33114,11 @@ var ts;
container = ts.getContainingClass(container);
}
}
- else if (declaration.kind === 204) {
+ else if (declaration.kind === 205) {
var container = ts.getThisContainer(node, false);
- while (container !== undefined) {
+ while (container.kind !== 274) {
if (container.parent === declaration) {
- if (container.kind === 151 && ts.hasModifier(container, 32)) {
+ if (container.kind === 152 && ts.hasModifier(container, 32)) {
getNodeLinks(declaration).flags |= 8388608;
getNodeLinks(node).flags |= 16777216;
}
@@ -32923,11 +33135,11 @@ var ts;
if (!(localOrExportSymbol.flags & 3) &&
!(ts.isInJavaScriptFile(node) && localOrExportSymbol.flags & 512)) {
error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_not_a_variable, symbolToString(symbol));
- return unknownType;
+ return errorType;
}
if (isReadonlySymbol(localOrExportSymbol)) {
error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(symbol));
- return unknownType;
+ return errorType;
}
}
var isAlias = localOrExportSymbol.flags & 2097152;
@@ -32945,21 +33157,21 @@ var ts;
if (!declaration) {
return type;
}
- var isParameter = ts.getRootDeclaration(declaration).kind === 148;
+ var isParameter = ts.getRootDeclaration(declaration).kind === 149;
var declarationContainer = getControlFlowContainer(declaration);
var flowContainer = getControlFlowContainer(node);
var isOuterVariable = flowContainer !== declarationContainer;
var isSpreadDestructuringAsignmentTarget = node.parent && node.parent.parent && ts.isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
- while (flowContainer !== declarationContainer && (flowContainer.kind === 191 ||
- flowContainer.kind === 192 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) &&
+ while (flowContainer !== declarationContainer && (flowContainer.kind === 192 ||
+ flowContainer.kind === 193 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) &&
(isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) {
flowContainer = getControlFlowContainer(flowContainer);
}
var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAsignmentTarget ||
- type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1) !== 0 ||
- isInTypeQuery(node) || node.parent.kind === 251) ||
- node.parent.kind === 208 ||
- declaration.kind === 231 && declaration.exclamationToken ||
+ type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 3) !== 0 ||
+ isInTypeQuery(node) || node.parent.kind === 252) ||
+ node.parent.kind === 209 ||
+ declaration.kind === 232 && declaration.exclamationToken ||
declaration.flags & 4194304;
var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) :
type === autoType || type === autoArrayType ? undefinedType :
@@ -32974,7 +33186,7 @@ var ts;
return convertAutoToAny(flowType);
}
}
- else if (!assumeInitialized && !(getFalsyFlags(type) & 4096) && getFalsyFlags(flowType) & 4096) {
+ else if (!assumeInitialized && !(getFalsyFlags(type) & 8192) && getFalsyFlags(flowType) & 8192) {
error(node, ts.Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol));
return type;
}
@@ -32986,7 +33198,7 @@ var ts;
function checkNestedBlockScopedBinding(node, symbol) {
if (languageVersion >= 2 ||
(symbol.flags & (2 | 32)) === 0 ||
- symbol.valueDeclaration.parent.kind === 268) {
+ symbol.valueDeclaration.parent.kind === 269) {
return;
}
var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration);
@@ -33004,8 +33216,8 @@ var ts;
if (usedInFunction) {
getNodeLinks(current).flags |= 65536;
}
- if (container.kind === 219 &&
- ts.getAncestor(symbol.valueDeclaration, 232).parent === container &&
+ if (container.kind === 220 &&
+ ts.getAncestor(symbol.valueDeclaration, 233).parent === container &&
isAssignedInBodyOfForStatement(node, container)) {
getNodeLinks(symbol.valueDeclaration).flags |= 2097152;
}
@@ -33017,14 +33229,14 @@ var ts;
}
function isAssignedInBodyOfForStatement(node, container) {
var current = node;
- while (current.parent.kind === 190) {
+ while (current.parent.kind === 191) {
current = current.parent;
}
var isAssigned = false;
if (ts.isAssignmentTarget(current)) {
isAssigned = true;
}
- else if ((current.parent.kind === 197 || current.parent.kind === 198)) {
+ else if ((current.parent.kind === 198 || current.parent.kind === 199)) {
var expr = current.parent;
isAssigned = expr.operator === 43 || expr.operator === 44;
}
@@ -33035,7 +33247,7 @@ var ts;
}
function captureLexicalThis(node, container) {
getNodeLinks(node).flags |= 2;
- if (container.kind === 151 || container.kind === 154) {
+ if (container.kind === 152 || container.kind === 155) {
var classNode = container.parent;
getNodeLinks(classNode).flags |= 4;
}
@@ -33079,32 +33291,32 @@ var ts;
function checkThisExpression(node) {
var container = ts.getThisContainer(node, true);
var needToCaptureLexicalThis = false;
- if (container.kind === 154) {
+ if (container.kind === 155) {
checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class);
}
- if (container.kind === 192) {
+ if (container.kind === 193) {
container = ts.getThisContainer(container, false);
needToCaptureLexicalThis = (languageVersion < 2);
}
switch (container.kind) {
- case 238:
+ case 239:
error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body);
break;
- case 237:
+ case 238:
error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location);
break;
- case 154:
+ case 155:
if (isInConstructorArgumentInitializer(node, container)) {
error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments);
}
break;
+ case 152:
case 151:
- case 150:
if (ts.hasModifier(container, 32)) {
error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer);
}
break;
- case 146:
+ case 147:
error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name);
break;
}
@@ -33121,8 +33333,8 @@ var ts;
if (container === void 0) { container = ts.getThisContainer(node, false); }
if (ts.isFunctionLike(container) &&
(!isInParameterInitializerBeforeContainingFunction(node) || ts.getThisParameter(container))) {
- if (container.kind === 191 &&
- container.parent.kind === 199 &&
+ if (container.kind === 192 &&
+ container.parent.kind === 200 &&
ts.getSpecialPropertyAssignmentKind(container.parent) === 3) {
var className = container.parent
.left
@@ -33145,14 +33357,14 @@ var ts;
}
if (ts.isInJavaScriptFile(node)) {
var type = getTypeForThisExpressionFromJSDoc(container);
- if (type && type !== unknownType) {
+ if (type && type !== errorType) {
return getFlowTypeOfReference(node, type);
}
}
}
function getTypeForThisExpressionFromJSDoc(node) {
var jsdocType = ts.getJSDocType(node);
- if (jsdocType && jsdocType.kind === 283) {
+ if (jsdocType && jsdocType.kind === 284) {
var jsDocFunctionType = jsdocType;
if (jsDocFunctionType.parameters.length > 0 &&
jsDocFunctionType.parameters[0].name &&
@@ -33162,14 +33374,14 @@ var ts;
}
}
function isInConstructorArgumentInitializer(node, constructorDecl) {
- return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 148; });
+ return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 149; });
}
function checkSuperExpression(node) {
- var isCallExpression = node.parent.kind === 186 && node.parent.expression === node;
+ var isCallExpression = node.parent.kind === 187 && node.parent.expression === node;
var container = ts.getSuperContainer(node, true);
var needToCaptureLexicalThis = false;
if (!isCallExpression) {
- while (container && container.kind === 192) {
+ while (container && container.kind === 193) {
container = ts.getSuperContainer(container, true);
needToCaptureLexicalThis = languageVersion < 2;
}
@@ -33177,22 +33389,22 @@ var ts;
var canUseSuperExpression = isLegalUsageOfSuperExpression(container);
var nodeCheckFlag = 0;
if (!canUseSuperExpression) {
- var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 146; });
- if (current && current.kind === 146) {
+ var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 147; });
+ if (current && current.kind === 147) {
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 === 183)) {
+ else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 184)) {
error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions);
}
else {
error(node, ts.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class);
}
- return unknownType;
+ return errorType;
}
- if (!isCallExpression && container.kind === 154) {
+ if (!isCallExpression && container.kind === 155) {
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) {
@@ -33202,7 +33414,7 @@ var ts;
nodeCheckFlag = 256;
}
getNodeLinks(node).flags |= nodeCheckFlag;
- if (container.kind === 153 && ts.hasModifier(container, 256)) {
+ if (container.kind === 154 && ts.hasModifier(container, 256)) {
if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) {
getNodeLinks(container).flags |= 4096;
}
@@ -33213,10 +33425,10 @@ var ts;
if (needToCaptureLexicalThis) {
captureLexicalThis(node.parent, container);
}
- if (container.parent.kind === 183) {
+ if (container.parent.kind === 184) {
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 unknownType;
+ return errorType;
}
else {
return anyType;
@@ -33225,16 +33437,16 @@ var ts;
var classLikeDeclaration = container.parent;
if (!ts.getClassExtendsHeritageClauseElement(classLikeDeclaration)) {
error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class);
- return unknownType;
+ return errorType;
}
var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(classLikeDeclaration));
var baseClassType = classType && getBaseTypes(classType)[0];
if (!baseClassType) {
- return unknownType;
+ return errorType;
}
- if (container.kind === 154 && isInConstructorArgumentInitializer(node, container)) {
+ if (container.kind === 155 && isInConstructorArgumentInitializer(node, container)) {
error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments);
- return unknownType;
+ return errorType;
}
return nodeCheckFlag === 512
? getBaseConstructorTypeOfClass(classType)
@@ -33244,24 +33456,24 @@ var ts;
return false;
}
if (isCallExpression) {
- return container.kind === 154;
+ return container.kind === 155;
}
else {
- if (ts.isClassLike(container.parent) || container.parent.kind === 183) {
+ if (ts.isClassLike(container.parent) || container.parent.kind === 184) {
if (ts.hasModifier(container, 32)) {
- return container.kind === 153 ||
- container.kind === 152 ||
- container.kind === 155 ||
- container.kind === 156;
+ return container.kind === 154 ||
+ container.kind === 153 ||
+ container.kind === 156 ||
+ container.kind === 157;
}
else {
- return container.kind === 153 ||
- container.kind === 152 ||
- container.kind === 155 ||
+ return container.kind === 154 ||
+ container.kind === 153 ||
container.kind === 156 ||
+ container.kind === 157 ||
+ container.kind === 152 ||
container.kind === 151 ||
- container.kind === 150 ||
- container.kind === 154;
+ container.kind === 155;
}
}
}
@@ -33269,10 +33481,10 @@ var ts;
}
}
function getContainingObjectLiteral(func) {
- return (func.kind === 153 ||
- func.kind === 155 ||
- func.kind === 156) && func.parent.kind === 183 ? func.parent :
- func.kind === 191 && func.parent.kind === 269 ? func.parent.parent :
+ return (func.kind === 154 ||
+ func.kind === 156 ||
+ func.kind === 157) && func.parent.kind === 184 ? func.parent :
+ func.kind === 192 && func.parent.kind === 270 ? func.parent.parent :
undefined;
}
function getThisTypeArgument(type) {
@@ -33280,11 +33492,11 @@ var ts;
}
function getThisTypeFromContextualType(type) {
return mapType(type, function (t) {
- return t.flags & 262144 ? ts.forEach(t.types, getThisTypeArgument) : getThisTypeArgument(t);
+ return t.flags & 524288 ? ts.forEach(t.types, getThisTypeArgument) : getThisTypeArgument(t);
});
}
function getContextualThisParameterType(func) {
- if (func.kind === 192) {
+ if (func.kind === 193) {
return undefined;
}
if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
@@ -33308,7 +33520,7 @@ var ts;
if (thisType) {
return instantiateType(thisType, getContextualMapper(containingLiteral));
}
- if (literal.parent.kind !== 269) {
+ if (literal.parent.kind !== 270) {
break;
}
literal = literal.parent.parent;
@@ -33317,9 +33529,9 @@ var ts;
return contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral);
}
var parent = func.parent;
- if (parent.kind === 199 && parent.operatorToken.kind === 58) {
+ if (parent.kind === 200 && parent.operatorToken.kind === 58) {
var target = parent.left;
- if (target.kind === 184 || target.kind === 185) {
+ if (target.kind === 185 || target.kind === 186) {
var expression = target.expression;
if (inJs && ts.isIdentifier(expression)) {
var sourceFile = ts.getSourceFileOfNode(parent);
@@ -33372,7 +33584,7 @@ var ts;
if (funcHasRestParameters &&
indexOfParameter === (func.parameters.length - 1) &&
isRestParameterIndex(contextualSignature, func.parameters.length - 1)) {
- return getTypeOfSymbol(ts.lastOrUndefined(contextualSignature.parameters));
+ return getTypeOfSymbol(ts.last(contextualSignature.parameters));
}
}
}
@@ -33383,7 +33595,7 @@ var ts;
if (typeNode) {
return getTypeFromTypeNode(typeNode);
}
- if (declaration.kind === 148) {
+ if (declaration.kind === 149) {
var type = getContextuallyTypedParameterType(declaration);
if (type) {
return type;
@@ -33395,7 +33607,7 @@ var ts;
if (ts.isBindingPattern(declaration.parent)) {
var parentDeclaration = declaration.parent.parent;
var name = declaration.propertyName || declaration.name;
- if (parentDeclaration.kind !== 181) {
+ if (parentDeclaration.kind !== 182) {
var parentTypeNode = ts.getEffectiveTypeAnnotationNode(parentDeclaration);
if (parentTypeNode && !ts.isBindingPattern(name)) {
var text = ts.getTextOfPropertyName(name);
@@ -33449,7 +33661,7 @@ var ts;
return false;
}
function getContextualReturnType(functionDecl) {
- if (functionDecl.kind === 154 ||
+ if (functionDecl.kind === 155 ||
ts.getEffectiveReturnTypeNode(functionDecl) ||
isGetAccessorWithAnnotatedSetAccessor(functionDecl)) {
return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl));
@@ -33470,7 +33682,7 @@ var ts;
return getTypeAtPosition(signature, argIndex);
}
function getContextualTypeForSubstitutionExpression(template, substitutionExpression) {
- if (template.parent.kind === 188) {
+ if (template.parent.kind === 189) {
return getContextualTypeForArgument(template.parent, substitutionExpression);
}
return undefined;
@@ -33483,7 +33695,7 @@ var ts;
return node === right && isContextSensitiveAssignment(binaryExpression) ? getTypeOfExpression(left) : undefined;
case 54:
var type = getContextualType(binaryExpression);
- return !type && node === right && !ts.getDeclaredJavascriptInitializer(binaryExpression.parent) && !ts.getAssignedJavascriptInitializer(binaryExpression) ?
+ return !type && node === right && !ts.isDefaultedJavascriptInitializer(binaryExpression) ?
getTypeOfExpression(left) : type;
case 53:
case 26:
@@ -33506,12 +33718,12 @@ var ts;
case 6:
return false;
default:
- ts.Debug.assertNever(kind);
+ return ts.Debug.assertNever(kind);
}
}
function getTypeOfPropertyOfContextualType(type, name) {
return mapType(type, function (t) {
- var prop = t.flags & 458752 ? getPropertyOfType(t, name) : undefined;
+ var prop = t.flags & 917504 ? getPropertyOfType(t, name) : undefined;
return prop ? getTypeOfSymbol(prop) : undefined;
}, true);
}
@@ -33519,7 +33731,7 @@ var ts;
return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }, true);
}
function contextualTypeIsTupleLikeType(type) {
- return !!(type.flags & 131072 ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type));
+ return !!(type.flags & 262144 ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type));
}
function getContextualTypeForObjectLiteralMethod(node) {
ts.Debug.assert(ts.isObjectLiteralMethod(node));
@@ -33578,10 +33790,26 @@ var ts;
return getContextualType(attribute.parent);
}
}
+ function isPossiblyDiscriminantValue(node) {
+ switch (node.kind) {
+ case 9:
+ case 8:
+ case 13:
+ case 101:
+ case 86:
+ case 95:
+ case 71:
+ return true;
+ case 185:
+ case 191:
+ return isPossiblyDiscriminantValue(node.expression);
+ }
+ return false;
+ }
function getApparentTypeOfContextualType(node) {
var contextualType = getContextualType(node);
contextualType = contextualType && mapType(contextualType, getApparentType);
- if (!(contextualType && contextualType.flags & 131072 && ts.isObjectLiteralExpression(node))) {
+ if (!(contextualType && contextualType.flags & 262144 && ts.isObjectLiteralExpression(node))) {
return contextualType;
}
var match;
@@ -33589,10 +33817,10 @@ var ts;
var prop = _a[_i];
if (!prop.symbol)
continue;
- if (prop.kind !== 269)
+ if (prop.kind !== 270)
continue;
- if (isDiscriminantProperty(contextualType, prop.symbol.escapedName)) {
- var discriminatingType = getTypeOfNode(prop.initializer);
+ if (isPossiblyDiscriminantValue(prop.initializer) && isDiscriminantProperty(contextualType, prop.symbol.escapedName)) {
+ var discriminatingType = checkExpression(prop.initializer);
for (var _b = 0, _c = contextualType.types; _b < _c.length; _b++) {
var type = _c[_b];
var targetType = getTypeOfPropertyOfType(type, prop.symbol.escapedName);
@@ -33619,58 +33847,58 @@ var ts;
}
var parent = node.parent;
switch (parent.kind) {
- case 231:
- case 148:
+ case 232:
+ case 149:
+ case 152:
case 151:
- case 150:
- case 181:
+ case 182:
return getContextualTypeForInitializerExpression(node);
- case 192:
- case 224:
+ case 193:
+ case 225:
return getContextualTypeForReturnExpression(node);
- case 202:
+ case 203:
return getContextualTypeForYieldOperand(parent);
- case 186:
case 187:
+ case 188:
return getContextualTypeForArgument(parent, node);
- case 189:
- case 207:
+ case 190:
+ case 208:
return getTypeFromTypeNode(parent.type);
- case 199:
+ case 200:
return getContextualTypeForBinaryOperand(node);
- case 269:
case 270:
- return getContextualTypeForObjectLiteralElement(parent);
case 271:
+ return getContextualTypeForObjectLiteralElement(parent);
+ case 272:
return getApparentTypeOfContextualType(parent.parent);
- case 182: {
+ case 183: {
var arrayLiteral = parent;
var type = getApparentTypeOfContextualType(arrayLiteral);
return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node));
}
- case 200:
+ case 201:
return getContextualTypeForConditionalOperand(node);
- case 210:
- ts.Debug.assert(parent.parent.kind === 201);
+ case 211:
+ ts.Debug.assert(parent.parent.kind === 202);
return getContextualTypeForSubstitutionExpression(parent.parent, node);
- case 190: {
+ case 191: {
var tag = ts.isInJavaScriptFile(parent) ? ts.getJSDocTypeTag(parent) : undefined;
return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent);
}
- case 264:
+ case 265:
return getContextualTypeForJsxExpression(parent);
- case 261:
- case 263:
+ case 262:
+ case 264:
return getContextualTypeForJsxAttribute(parent);
+ case 257:
case 256:
- case 255:
return getContextualJsxElementAttributesType(parent);
}
return undefined;
}
function getContextualMapper(node) {
- node = ts.findAncestor(node, function (n) { return !!n.contextualMapper; });
- return node ? node.contextualMapper : identityMapper;
+ var ancestor = ts.findAncestor(node, function (n) { return !!n.contextualMapper; });
+ return ancestor ? ancestor.contextualMapper : identityMapper;
}
function getContextualJsxElementAttributesType(node) {
if (isJsxIntrinsicIdentifier(node.tagName)) {
@@ -33684,12 +33912,12 @@ var ts;
return mapType(valueType, function (t) { return getJsxSignaturesParameterTypes(t, isJs, node); });
}
function getJsxSignaturesParameterTypes(valueType, isJs, context) {
- if (valueType.flags & 2) {
+ if (valueType.flags & 4) {
return anyType;
}
- else if (valueType.flags & 32) {
+ else if (valueType.flags & 64) {
var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, context);
- if (intrinsicElementsType !== unknownType) {
+ if (intrinsicElementsType !== errorType) {
var stringLiteralTypeName = valueType.value;
var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName));
if (intrinsicProp) {
@@ -33708,7 +33936,7 @@ var ts;
signatures = getSignaturesOfType(valueType, 0);
ctor = false;
if (signatures.length === 0) {
- return unknownType;
+ return errorType;
}
}
var links = getNodeLinks(context);
@@ -33729,7 +33957,7 @@ var ts;
function getJsxPropsTypeFromCallSignature(sig, context) {
var propsType = getTypeOfFirstParameterOfSignatureWithFallback(sig, emptyObjectType);
var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context);
- if (intrinsicAttribs !== unknownType) {
+ if (intrinsicAttribs !== errorType) {
propsType = intersectTypes(intrinsicAttribs, propsType);
}
return propsType;
@@ -33757,7 +33985,7 @@ var ts;
else {
var apparentAttributesType = attributesType;
var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes, context);
- if (intrinsicClassAttribs !== unknownType) {
+ if (intrinsicClassAttribs !== errorType) {
var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol);
var hostClassType = getReturnTypeOfSignature(sig);
apparentAttributesType = intersectTypes(typeParams
@@ -33765,7 +33993,7 @@ var ts;
: intrinsicClassAttribs, apparentAttributesType);
}
var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context);
- if (intrinsicAttribs !== unknownType) {
+ if (intrinsicAttribs !== errorType) {
apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType);
}
return apparentAttributesType;
@@ -33795,7 +34023,7 @@ var ts;
return sourceLength < targetParameterCount;
}
function isFunctionExpressionOrArrowFunction(node) {
- return node.kind === 191 || node.kind === 192;
+ return node.kind === 192 || node.kind === 193;
}
function getContextualSignatureForFunctionLikeDeclaration(node) {
return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node)
@@ -33808,7 +34036,7 @@ var ts;
getApparentTypeOfContextualType(node);
}
function getContextualSignature(node) {
- ts.Debug.assert(node.kind !== 153 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 154 || ts.isObjectLiteralMethod(node));
var type;
if (ts.isInJavaScriptFile(node)) {
var jsdoc = ts.getJSDocType(node);
@@ -33822,7 +34050,7 @@ var ts;
if (!type) {
return undefined;
}
- if (!(type.flags & 131072)) {
+ if (!(type.flags & 262144)) {
return getContextualCallSignature(type, node);
}
var signatureList;
@@ -33857,8 +34085,8 @@ var ts;
return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false, false);
}
function hasDefaultValue(node) {
- return (node.kind === 181 && !!node.initializer) ||
- (node.kind === 199 && node.operatorToken.kind === 58);
+ return (node.kind === 182 && !!node.initializer) ||
+ (node.kind === 200 && node.operatorToken.kind === 58);
}
function checkArrayLiteral(node, checkMode) {
var elements = node.elements;
@@ -33868,7 +34096,7 @@ var ts;
var contextualType = getApparentTypeOfContextualType(node);
for (var index = 0; index < elements.length; index++) {
var e = elements[index];
- if (inDestructuringPattern && e.kind === 203) {
+ if (inDestructuringPattern && e.kind === 204) {
var restArrayType = checkExpression(e.expression, checkMode);
var restElementType = getIndexTypeOfType(restArrayType, 1) ||
getIteratedTypeOrElementType(restArrayType, undefined, false, false, false);
@@ -33881,7 +34109,7 @@ var ts;
var type = checkExpressionForMutableLocation(e, checkMode, elementContextualType);
elementTypes.push(type);
}
- hasSpreadElement = hasSpreadElement || e.kind === 203;
+ hasSpreadElement = hasSpreadElement || e.kind === 204;
}
if (!hasSpreadElement) {
if (inDestructuringPattern && elementTypes.length) {
@@ -33891,7 +34119,7 @@ var ts;
}
if (contextualType && contextualTypeIsTupleLikeType(contextualType)) {
var pattern = contextualType.pattern;
- if (pattern && (pattern.kind === 180 || pattern.kind === 182)) {
+ if (pattern && (pattern.kind === 181 || pattern.kind === 183)) {
var patternElements = pattern.elements;
for (var i = elementTypes.length; i < patternElements.length; i++) {
var patternElement = patternElements[i];
@@ -33899,7 +34127,7 @@ var ts;
elementTypes.push(contextualType.typeArguments[i]);
}
else {
- if (patternElement.kind !== 205) {
+ if (patternElement.kind !== 206) {
error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value);
}
elementTypes.push(strictNullChecks ? implicitNeverType : undefinedWideningType);
@@ -33917,7 +34145,7 @@ var ts;
}
function isNumericName(name) {
switch (name.kind) {
- case 146:
+ case 147:
return isNumericComputedName(name);
case 71:
return isNumericLiteralName(name.escapedText);
@@ -33929,7 +34157,7 @@ var ts;
}
}
function isNumericComputedName(name) {
- return isTypeAssignableToKind(checkComputedPropertyName(name), 84);
+ return isTypeAssignableToKind(checkComputedPropertyName(name), 168);
}
function isInfinityOrNaNString(name) {
return name === "Infinity" || name === "-Infinity" || name === "NaN";
@@ -33941,8 +34169,8 @@ var ts;
var links = getNodeLinks(node.expression);
if (!links.resolvedType) {
links.resolvedType = checkExpression(node.expression);
- if (links.resolvedType.flags & 12288 ||
- !isTypeAssignableToKind(links.resolvedType, 34 | 84 | 1536) &&
+ if (links.resolvedType.flags & 24576 ||
+ !isTypeAssignableToKind(links.resolvedType, 68 | 168 | 3072) &&
!isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) {
error(node, ts.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any);
}
@@ -33968,22 +34196,25 @@ var ts;
var propertiesTable;
var propertiesArray = [];
var spread = emptyObjectType;
- var propagatedFlags = 8388608;
+ var propagatedFlags = 33554432;
var contextualType = getApparentTypeOfContextualType(node);
var contextualTypeHasPattern = contextualType && contextualType.pattern &&
- (contextualType.pattern.kind === 179 || contextualType.pattern.kind === 183);
+ (contextualType.pattern.kind === 180 || contextualType.pattern.kind === 184);
var isInJSFile = ts.isInJavaScriptFile(node) && !ts.isInJsonFile(node);
var isJSObjectLiteral = !contextualType && isInJSFile;
var typeFlags = 0;
var patternWithComputedProperties = false;
var hasComputedStringProperty = false;
var hasComputedNumberProperty = false;
- if (isInJSFile && node.properties.length === 0) {
- var symbol = getSymbolOfNode(node);
- if (symbol.exports) {
- propertiesTable = symbol.exports;
- symbol.exports.forEach(function (symbol) { return propertiesArray.push(getMergedSymbol(symbol)); });
- return createObjectLiteralType();
+ if (isInJSFile) {
+ var decl = ts.getDeclarationOfJSInitializer(node);
+ if (decl) {
+ var symbol = getMergedSymbol(decl.symbol);
+ if (symbol && ts.hasEntries(symbol.exports)) {
+ propertiesTable = symbol.exports;
+ symbol.exports.forEach(function (symbol) { return propertiesArray.push(getMergedSymbol(symbol)); });
+ return createObjectLiteralType();
+ }
}
}
propertiesTable = ts.createSymbolTable();
@@ -33991,13 +34222,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 === 146 && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ?
+ var computedNameType = memberDecl.name && memberDecl.name.kind === 147 && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ?
checkComputedPropertyName(memberDecl.name) : undefined;
- if (memberDecl.kind === 269 ||
- memberDecl.kind === 270 ||
+ if (memberDecl.kind === 270 ||
+ memberDecl.kind === 271 ||
ts.isObjectLiteralMethod(memberDecl)) {
- var type = memberDecl.kind === 269 ? checkPropertyAssignment(memberDecl, checkMode) :
- memberDecl.kind === 270 ? checkExpressionForMutableLocation(memberDecl.name, checkMode) :
+ var type = memberDecl.kind === 270 ? checkPropertyAssignment(memberDecl, checkMode) :
+ memberDecl.kind === 271 ? checkExpressionForMutableLocation(memberDecl.name, checkMode) :
checkObjectLiteralMethod(memberDecl, checkMode);
if (isInJSFile) {
var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl);
@@ -34007,7 +34238,7 @@ var ts;
}
}
typeFlags |= type.flags;
- var nameType = computedNameType && computedNameType.flags & 1120 ?
+ var nameType = computedNameType && computedNameType.flags & 2240 ?
computedNameType : undefined;
var prop = nameType ?
createSymbol(4 | member.flags, getLateBoundNameFromType(nameType), 1024) :
@@ -34016,8 +34247,8 @@ var ts;
prop.nameType = nameType;
}
if (inDestructuringPattern) {
- var isOptional = (memberDecl.kind === 269 && hasDefaultValue(memberDecl.initializer)) ||
- (memberDecl.kind === 270 && memberDecl.objectAssignmentInitializer);
+ var isOptional = (memberDecl.kind === 270 && hasDefaultValue(memberDecl.initializer)) ||
+ (memberDecl.kind === 271 && memberDecl.objectAssignmentInitializer);
if (isOptional) {
prop.flags |= 16777216;
}
@@ -34040,7 +34271,7 @@ var ts;
prop.target = member;
member = prop;
}
- else if (memberDecl.kind === 271) {
+ else if (memberDecl.kind === 272) {
if (languageVersion < 2) {
checkExternalEmitHelpers(memberDecl, 2);
}
@@ -34055,17 +34286,17 @@ var ts;
var type = checkExpression(memberDecl.expression);
if (!isValidSpreadType(type)) {
error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types);
- return unknownType;
+ return errorType;
}
spread = getSpreadType(spread, type, node.symbol, propagatedFlags, 0);
offset = i + 1;
continue;
}
else {
- ts.Debug.assert(memberDecl.kind === 155 || memberDecl.kind === 156);
+ ts.Debug.assert(memberDecl.kind === 156 || memberDecl.kind === 157);
checkNodeDeferred(memberDecl);
}
- if (computedNameType && !(computedNameType.flags & 1120)) {
+ if (computedNameType && !(computedNameType.flags & 2240)) {
if (isTypeAssignableTo(computedNameType, stringNumberSymbolType)) {
if (isTypeAssignableTo(computedNameType, numberType)) {
hasComputedNumberProperty = true;
@@ -34106,8 +34337,8 @@ var ts;
var stringIndexInfo = isJSObjectLiteral ? jsObjectLiteralIndexInfo : hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0) : undefined;
var numberIndexInfo = hasComputedNumberProperty && !isJSObjectLiteral ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1) : undefined;
var result = createAnonymousType(node.symbol, propertiesTable, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo);
- var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8388608;
- result.flags |= 33554432 | freshObjectLiteralFlag | (typeFlags & 117440512);
+ var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 33554432;
+ result.flags |= 268435456 | freshObjectLiteralFlag | (typeFlags & 939524096);
result.objectFlags |= 128;
if (patternWithComputedProperties) {
result.objectFlags |= 512;
@@ -34115,17 +34346,17 @@ var ts;
if (inDestructuringPattern) {
result.pattern = node;
}
- if (!(result.flags & 12288)) {
- propagatedFlags |= (result.flags & 117440512);
+ if (!(result.flags & 24576)) {
+ propagatedFlags |= (result.flags & 939524096);
}
return result;
}
}
function isValidSpreadType(type) {
- return !!(type.flags & (1 | 134217728) ||
- getFalsyFlags(type) & 14560 && isValidSpreadType(removeDefinitelyFalsyTypes(type)) ||
- type.flags & 65536 && !isGenericMappedType(type) ||
- type.flags & 393216 && !ts.forEach(type.types, function (t) { return !isValidSpreadType(t); }));
+ return !!(type.flags & (3 | 16777216) ||
+ getFalsyFlags(type) & 29120 && isValidSpreadType(removeDefinitelyFalsyTypes(type)) ||
+ type.flags & 131072 && !isGenericMappedType(type) ||
+ type.flags & 786432 && !ts.forEach(type.types, function (t) { return !isValidSpreadType(t); }));
}
function checkJsxSelfClosingElement(node, checkMode) {
checkJsxOpeningLikeElementOrOpeningFragment(node, checkMode);
@@ -34155,13 +34386,13 @@ var ts;
}
function isJsxIntrinsicIdentifier(tagName) {
switch (tagName.kind) {
- case 184:
+ case 185:
case 99:
return false;
case 71:
return ts.isIntrinsicJsxName(tagName.escapedText);
default:
- ts.Debug.fail();
+ return ts.Debug.fail();
}
}
function checkJsxAttribute(node, checkMode) {
@@ -34196,7 +34427,7 @@ var ts;
}
}
else {
- ts.Debug.assert(attributeDecl.kind === 263);
+ ts.Debug.assert(attributeDecl.kind === 264);
if (attributesTable.size > 0) {
spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, 0, 4096);
attributesTable = ts.createSymbolTable();
@@ -34218,7 +34449,7 @@ var ts;
spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, 0, 4096);
}
}
- var parent = openingLikeElement.parent.kind === 254 ? openingLikeElement.parent : undefined;
+ var parent = openingLikeElement.parent.kind === 255 ? openingLikeElement.parent : undefined;
if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) {
var childrenTypes = checkJsxChildren(parent, checkMode);
if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") {
@@ -34243,7 +34474,7 @@ var ts;
return typeToIntersect || (spread === emptyObjectType ? createJsxAttributesType() : spread);
function createJsxAttributesType() {
var result = createAnonymousType(attributes.symbol, attributesTable, ts.emptyArray, ts.emptyArray, undefined, undefined);
- result.flags |= 33554432;
+ result.flags |= 268435456;
result.objectFlags |= 128 | 4096;
return result;
}
@@ -34270,13 +34501,13 @@ var ts;
var namespace = getJsxNamespaceAt(location);
var exports = namespace && getExportsOfSymbol(namespace);
var typeSymbol = exports && getSymbol(exports, name, 67901928);
- return typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : unknownType;
+ return typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : errorType;
}
function getIntrinsicTagSymbol(node) {
var links = getNodeLinks(node);
if (!links.resolvedSymbol) {
var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, node);
- if (intrinsicElementsType !== unknownType) {
+ if (intrinsicElementsType !== errorType) {
if (!ts.isIdentifier(node.tagName))
return ts.Debug.fail();
var intrinsicProp = getPropertyOfType(intrinsicElementsType, node.tagName.escapedText);
@@ -34338,6 +34569,7 @@ var ts;
return instantiatedSignatures;
}
function getJsxSignatureTypeArgumentInstantiation(signature, node, isJavascript, reportErrors) {
+ if (reportErrors === void 0) { reportErrors = false; }
if (!node.typeArguments) {
return;
}
@@ -34388,7 +34620,7 @@ var ts;
if (!propsType) {
return undefined;
}
- if (propsType.flags & 262144) {
+ if (propsType.flags & 524288) {
var propsApparentType = [];
for (var _i = 0, _a = propsType.types; _i < _a.length; _i++) {
var t = _a[_i];
@@ -34399,7 +34631,7 @@ var ts;
return getApparentType(propsType);
}
function defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) {
- ts.Debug.assert(!(elementType.flags & 131072));
+ ts.Debug.assert(!(elementType.flags & 262144));
if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) {
var jsxStatelessElementType = getJsxStatelessElementTypeAt(openingLikeElement);
if (jsxStatelessElementType) {
@@ -34410,7 +34642,7 @@ var ts;
paramType = getApparentTypeOfJsxPropsType(paramType);
if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) {
var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, openingLikeElement);
- if (intrinsicAttributes !== unknownType) {
+ if (intrinsicAttributes !== errorType) {
paramType = intersectTypes(intrinsicAttributes, paramType);
}
return paramType;
@@ -34421,7 +34653,7 @@ var ts;
return undefined;
}
function tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) {
- ts.Debug.assert(!(elementType.flags & 131072));
+ ts.Debug.assert(!(elementType.flags & 262144));
if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) {
var jsxStatelessElementType = getJsxStatelessElementTypeAt(openingLikeElement);
if (jsxStatelessElementType) {
@@ -34455,7 +34687,7 @@ var ts;
result = allMatchingAttributesType;
}
var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, openingLikeElement);
- if (intrinsicAttributes !== unknownType) {
+ if (intrinsicAttributes !== errorType) {
result = intersectTypes(intrinsicAttributes, result);
}
return result;
@@ -34491,7 +34723,7 @@ var ts;
return results;
}
function resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, elementType, elementClassType) {
- if (elementType.flags & 131072) {
+ if (elementType.flags & 262144) {
var types = elementType.types;
return getUnionType(types.map(function (type) {
return resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, type, elementClassType);
@@ -34500,12 +34732,12 @@ var ts;
if (isTypeAny(elementType)) {
return elementType;
}
- else if (elementType.flags & 2) {
+ else if (elementType.flags & 4) {
return anyType;
}
- else if (elementType.flags & 32) {
+ else if (elementType.flags & 64) {
var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, openingLikeElement);
- if (intrinsicElementsType !== unknownType) {
+ if (intrinsicElementsType !== errorType) {
var stringLiteralTypeName = elementType.value;
var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName));
if (intrinsicProp) {
@@ -34521,9 +34753,9 @@ var ts;
}
var instantiatedSignatures = getInstantiatedJsxSignatures(openingLikeElement, elementType, true);
if (!ts.length(instantiatedSignatures)) {
- return unknownType;
+ return errorType;
}
- var elemInstanceType = getUnionType(ts.map(instantiatedSignatures, getReturnTypeOfSignature), 2);
+ var elemInstanceType = getUnionType(instantiatedSignatures.map(getReturnTypeOfSignature), 2);
var statelessAttributesType = shouldIncludeAllStatelessAttributesType ?
tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) :
defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType);
@@ -34534,7 +34766,7 @@ var ts;
checkTypeRelatedTo(elemInstanceType, elementClassType, assignableRelation, openingLikeElement, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements);
}
var isJs = ts.isInJavaScriptFile(openingLikeElement);
- return getUnionType(ts.map(instantiatedSignatures, function (sig) { return getJsxPropsTypeFromClassType(sig, isJs, openingLikeElement, true); }));
+ return getUnionType(instantiatedSignatures.map(function (sig) { return getJsxPropsTypeFromClassType(sig, isJs, openingLikeElement, true); }));
}
function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) {
ts.Debug.assert(isJsxIntrinsicIdentifier(node.tagName));
@@ -34548,7 +34780,7 @@ var ts;
return links.resolvedJsxElementAttributesType = getIndexInfoOfSymbol(symbol, 0).type;
}
else {
- return links.resolvedJsxElementAttributesType = unknownType;
+ return links.resolvedJsxElementAttributesType = errorType;
}
}
return links.resolvedJsxElementAttributesType;
@@ -34579,7 +34811,7 @@ var ts;
}
function getJsxElementClassTypeAt(location) {
var type = getJsxType(JsxNames.ElementClass, location);
- if (type === unknownType)
+ if (type === errorType)
return undefined;
return type;
}
@@ -34630,7 +34862,7 @@ var ts;
}
}
function isKnownProperty(targetType, name, isComparingJsxAttributes) {
- if (targetType.flags & 65536) {
+ if (targetType.flags & 131072) {
var resolved = resolveStructuredTypeMembers(targetType);
if (resolved.stringIndexInfo ||
resolved.numberIndexInfo && isNumericLiteralName(name) ||
@@ -34639,7 +34871,7 @@ var ts;
return true;
}
}
- else if (targetType.flags & 393216) {
+ else if (targetType.flags & 786432) {
for (var _i = 0, _a = targetType.types; _i < _a.length; _i++) {
var t = _a[_i];
if (isKnownProperty(t, name, isComparingJsxAttributes)) {
@@ -34703,11 +34935,11 @@ var ts;
return type;
}
else {
- return unknownType;
+ return errorType;
}
}
function getDeclarationKindFromSymbol(s) {
- return s.valueDeclaration ? s.valueDeclaration.kind : 151;
+ return s.valueDeclaration ? s.valueDeclaration.kind : 152;
}
function getDeclarationNodeFlagsFromSymbol(s) {
return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : 0;
@@ -34724,9 +34956,9 @@ var ts;
}
function checkPropertyAccessibility(node, left, type, prop) {
var flags = ts.getDeclarationModifierFlagsFromSymbol(prop);
- var errorNode = node.kind === 184 || node.kind === 231 ?
+ var errorNode = node.kind === 185 || node.kind === 232 ?
node.name :
- node.kind === 178 ?
+ node.kind === 179 ?
node :
node.right;
if (ts.getCheckFlags(prop) & 256) {
@@ -34777,7 +35009,7 @@ var ts;
if (flags & 32) {
return true;
}
- if (type.flags & 32768) {
+ if (type.flags & 65536) {
type = type.isThisType ? getConstraintOfTypeParameter(type) : getBaseConstraintOfType(type);
}
if (!type || !hasBaseType(type, enclosingClass)) {
@@ -34789,21 +35021,25 @@ var ts;
function symbolHasNonMethodDeclaration(symbol) {
return forEachProperty(symbol, function (prop) {
var propKind = getDeclarationKindFromSymbol(prop);
- return propKind !== 153 && propKind !== 152;
+ return propKind !== 154 && propKind !== 153;
});
}
function checkNonNullExpression(node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic) {
return checkNonNullType(checkExpression(node), node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic);
}
function checkNonNullType(type, node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic) {
- var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 12288;
+ if (type.flags & 2) {
+ error(node, ts.Diagnostics.Object_is_of_type_unknown);
+ return errorType;
+ }
+ var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 24576;
if (kind) {
- error(node, kind & 4096 ? kind & 8192 ?
+ error(node, kind & 8192 ? kind & 16384 ?
(nullOrUndefinedDiagnostic || ts.Diagnostics.Object_is_possibly_null_or_undefined) :
(undefinedDiagnostic || ts.Diagnostics.Object_is_possibly_undefined) :
(nullDiagnostic || ts.Diagnostics.Object_is_possibly_null));
var t = getNonNullableType(type);
- return t.flags & (12288 | 16384) ? unknownType : t;
+ return t.flags & (24576 | 32768) ? errorType : t;
}
return type;
}
@@ -34833,9 +35069,9 @@ var ts;
var indexInfo = getIndexInfoOfType(apparentType, 0);
if (!(indexInfo && indexInfo.type)) {
if (right.escapedText && !checkAndReportErrorForExtendingInterface(node)) {
- reportNonexistentProperty(right, leftType.flags & 32768 && leftType.isThisType ? apparentType : leftType);
+ reportNonexistentProperty(right, leftType.flags & 65536 && leftType.isThisType ? apparentType : leftType);
}
- return unknownType;
+ return errorType;
}
if (indexInfo.isReadonly && (ts.isAssignmentTarget(node) || ts.isDeleteTarget(node))) {
error(node, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType));
@@ -34850,14 +35086,14 @@ var ts;
if (assignmentKind) {
if (isReferenceToReadonlyEntity(node, prop) || isReferenceThroughNamespaceImport(node)) {
error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, ts.idText(right));
- return unknownType;
+ return errorType;
}
}
propType = getConstraintForLocation(getTypeOfSymbol(prop), node);
}
- if (node.kind !== 184 ||
+ if (node.kind !== 185 ||
assignmentKind === 1 ||
- prop && !(prop.flags & (3 | 4 | 98304)) && !(prop.flags & 8192 && propType.flags & 131072)) {
+ prop && !(prop.flags & (3 | 4 | 98304)) && !(prop.flags & 8192 && propType.flags & 262144)) {
return propType;
}
var assumeUninitialized = false;
@@ -34865,13 +35101,13 @@ var ts;
var declaration = prop && prop.valueDeclaration;
if (declaration && isInstancePropertyWithoutInitializer(declaration)) {
var flowContainer = getControlFlowContainer(node);
- if (flowContainer.kind === 154 && flowContainer.parent === declaration.parent) {
+ if (flowContainer.kind === 155 && flowContainer.parent === declaration.parent) {
assumeUninitialized = true;
}
}
}
var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);
- if (assumeUninitialized && !(getFalsyFlags(propType) & 4096) && getFalsyFlags(flowType) & 4096) {
+ if (assumeUninitialized && !(getFalsyFlags(propType) & 8192) && getFalsyFlags(flowType) & 8192) {
error(right, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop));
return propType;
}
@@ -34887,8 +35123,8 @@ var ts;
&& !isPropertyDeclaredInAncestorClass(prop)) {
error(right, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.idText(right));
}
- else if (valueDeclaration.kind === 234 &&
- node.parent.kind !== 161 &&
+ else if (valueDeclaration.kind === 235 &&
+ node.parent.kind !== 162 &&
!(valueDeclaration.flags & 4194304) &&
!isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
error(right, ts.Diagnostics.Class_0_used_before_its_declaration, ts.idText(right));
@@ -34897,9 +35133,9 @@ var ts;
function isInPropertyInitializer(node) {
return !!ts.findAncestor(node, function (node) {
switch (node.kind) {
- case 151:
+ case 152:
return true;
- case 269:
+ case 270:
return false;
default:
return ts.isExpressionNode(node) ? false : "quit";
@@ -34931,7 +35167,7 @@ var ts;
}
function reportNonexistentProperty(propNode, containingType) {
var errorInfo;
- if (containingType.flags & 131072 && !(containingType.flags & 16382)) {
+ if (containingType.flags & 262144 && !(containingType.flags & 32764)) {
for (var _i = 0, _a = containingType.types; _i < _a.length; _i++) {
var subtype = _a[_i];
if (!getPropertyOfType(subtype, propNode.escapedText)) {
@@ -35064,20 +35300,20 @@ var ts;
}
function isValidPropertyAccess(node, propertyName) {
switch (node.kind) {
- case 184:
+ case 185:
return isValidPropertyAccessWithType(node, node.expression, propertyName, getWidenedType(checkExpression(node.expression)));
- case 145:
+ case 146:
return isValidPropertyAccessWithType(node, node.left, propertyName, getWidenedType(checkExpression(node.left)));
- case 178:
+ case 179:
return isValidPropertyAccessWithType(node, node, propertyName, getTypeFromTypeNode(node));
}
}
function isValidPropertyAccessForCompletions(node, type, property) {
- return isValidPropertyAccessWithType(node, node.kind === 178 ? node : node.expression, property.escapedName, type)
+ return isValidPropertyAccessWithType(node, node.kind === 179 ? node : node.expression, property.escapedName, type)
&& (!(property.flags & 8192) || isValidMethodAccess(property, type));
}
function isValidMethodAccess(method, actualThisType) {
- var propType = getTypeOfFuncClassEnumModule(method);
+ var propType = getTypeOfPropertyOfType(actualThisType, method.escapedName);
var signatures = getSignaturesOfType(getNonNullableType(propType), 0);
ts.Debug.assert(signatures.length !== 0);
return signatures.some(function (sig) {
@@ -35094,16 +35330,16 @@ var ts;
return instantiateType(signatureThisType, createSignatureTypeMapper(sig, getInferredTypes(context)));
}
function isValidPropertyAccessWithType(node, left, propertyName, type) {
- if (type === unknownType || isTypeAny(type)) {
+ if (type === errorType || isTypeAny(type)) {
return true;
}
var prop = getPropertyOfType(type, propertyName);
return prop ? checkPropertyAccessibility(node, left, type, prop)
- : ts.isInJavaScriptFile(node) && (type.flags & 131072) && type.types.some(function (elementType) { return isValidPropertyAccessWithType(node, left, propertyName, elementType); });
+ : ts.isInJavaScriptFile(node) && (type.flags & 262144) !== 0 && type.types.some(function (elementType) { return isValidPropertyAccessWithType(node, left, propertyName, elementType); });
}
function getForInVariableSymbol(node) {
var initializer = node.initializer;
- if (initializer.kind === 232) {
+ if (initializer.kind === 233) {
var variable = initializer.declarations[0];
if (variable && !ts.isBindingPattern(variable.name)) {
return getSymbolOfNode(variable);
@@ -35125,7 +35361,7 @@ var ts;
var child = expr;
var node = expr.parent;
while (node) {
- if (node.kind === 220 &&
+ if (node.kind === 221 &&
child === node.statement &&
getForInVariableSymbol(node) === symbol &&
hasNumericPropertyNames(getTypeOfExpression(node.expression))) {
@@ -35143,7 +35379,7 @@ var ts;
var indexExpression = node.argumentExpression;
if (!indexExpression) {
var sourceFile = ts.getSourceFileOfNode(node);
- if (node.parent.kind === 187 && node.parent.expression === node) {
+ if (node.parent.kind === 188 && node.parent.expression === node) {
var start = ts.skipTrivia(sourceFile.text, node.expression.end);
var end = node.end;
grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead);
@@ -35153,26 +35389,26 @@ var ts;
var end = node.end;
grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Expression_expected);
}
- return unknownType;
+ return errorType;
}
var indexType = isForInVariableForNumericPropertyNames(indexExpression) ? numberType : checkExpression(indexExpression);
- if (objectType === unknownType || objectType === silentNeverType) {
+ if (objectType === errorType || objectType === silentNeverType) {
return objectType;
}
if (isConstEnumObjectType(objectType) && indexExpression.kind !== 9) {
error(indexExpression, ts.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal);
- return unknownType;
+ return errorType;
}
return checkIndexedAccessIndexType(getIndexedAccessType(objectType, indexType, node), node);
}
function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) {
- if (expressionType === unknownType) {
+ if (expressionType === errorType) {
return false;
}
if (!ts.isWellKnownSymbolSyntactically(expression)) {
return false;
}
- if ((expressionType.flags & 1536) === 0) {
+ if ((expressionType.flags & 3072) === 0) {
if (reportError) {
error(expression, ts.Diagnostics.A_computed_property_name_of_the_form_0_must_be_of_type_symbol, ts.getTextOfNode(expression));
}
@@ -35202,10 +35438,10 @@ var ts;
if (callLikeExpressionMayHaveTypeArguments(node)) {
ts.forEach(node.typeArguments, checkSourceElement);
}
- if (node.kind === 188) {
+ if (node.kind === 189) {
checkExpression(node.template);
}
- else if (node.kind !== 149) {
+ else if (node.kind !== 150) {
ts.forEach(node.arguments, function (argument) {
checkExpression(argument);
});
@@ -35230,7 +35466,7 @@ var ts;
var parent = signature.declaration && signature.declaration.parent;
if (!lastSymbol || symbol === lastSymbol) {
if (lastParent && parent === lastParent) {
- index++;
+ index = index + 1;
}
else {
lastParent = parent;
@@ -35256,7 +35492,7 @@ var ts;
function getSpreadArgumentIndex(args) {
for (var i = 0; i < args.length; i++) {
var arg = args[i];
- if (arg && arg.kind === 203) {
+ if (arg && arg.kind === 204) {
return i;
}
}
@@ -35266,17 +35502,16 @@ var ts;
if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; }
var argCount;
var typeArguments;
- var callIsIncomplete;
+ var callIsIncomplete = false;
var spreadArgIndex = -1;
if (ts.isJsxOpeningLikeElement(node)) {
return true;
}
- if (node.kind === 188) {
+ if (node.kind === 189) {
argCount = args.length;
- typeArguments = undefined;
- if (node.template.kind === 201) {
- var lastSpan = ts.lastOrUndefined(node.template.templateSpans);
- ts.Debug.assert(lastSpan !== undefined);
+ typeArguments = node.typeArguments;
+ if (node.template.kind === 202) {
+ var lastSpan = ts.last(node.template.templateSpans);
callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated;
}
else {
@@ -35285,13 +35520,13 @@ var ts;
callIsIncomplete = !!templateLiteral.isUnterminated;
}
}
- else if (node.kind === 149) {
+ else if (node.kind === 150) {
typeArguments = undefined;
argCount = getEffectiveArgumentCount(node, undefined, signature);
}
else {
if (!node.arguments) {
- ts.Debug.assert(node.kind === 187);
+ ts.Debug.assert(node.kind === 188);
return signature.minArgumentCount === 0;
}
argCount = signatureHelpTrailingComma ? args.length + 1 : args.length;
@@ -35319,7 +35554,7 @@ var ts;
(typeArguments.length >= minTypeArgumentCount && typeArguments.length <= numTypeParameters);
}
function getSingleCallSignature(type) {
- if (type.flags & 65536) {
+ if (type.flags & 131072) {
var resolved = resolveStructuredTypeMembers(type);
if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 &&
resolved.properties.length === 0 && !resolved.stringIndexInfo && !resolved.numberIndexInfo) {
@@ -35354,7 +35589,7 @@ var ts;
inference.inferredType = undefined;
}
}
- if (node.kind !== 149) {
+ if (node.kind !== 150) {
var contextualType = getContextualType(node);
if (contextualType) {
var instantiatedType = instantiateType(contextualType, cloneTypeMapper(getContextualMapper(node)));
@@ -35375,7 +35610,7 @@ var ts;
var argCount = getEffectiveArgumentCount(node, args, signature);
for (var i = 0; i < argCount; i++) {
var arg = getEffectiveArgument(node, args, i);
- if (arg === undefined || arg.kind !== 205) {
+ if (arg === undefined || arg.kind !== 206) {
var paramType = getTypeAtPosition(signature, i);
var argType = getEffectiveArgumentType(node, i);
if (argType === undefined) {
@@ -35406,7 +35641,7 @@ var ts;
var constraint = getConstraintOfTypeParameter(typeParameters[i]);
if (!constraint)
continue;
- var errorInfo = reportErrors && headMessage && (function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); });
+ var errorInfo = reportErrors && headMessage ? (function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); }) : undefined;
var typeArgumentHeadMessage = headMessage || ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1;
if (!mapper) {
mapper = createTypeMapper(typeParameters, typeArgumentTypes);
@@ -35440,12 +35675,12 @@ var ts;
return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation);
}
var thisType = getThisTypeOfSignature(signature);
- if (thisType && thisType !== voidType && node.kind !== 187) {
+ if (thisType && thisType !== voidType && node.kind !== 188) {
var thisArgumentNode = getThisArgumentOfCall(node);
var thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType;
var errorNode = reportErrors ? (thisArgumentNode || node) : undefined;
var headMessage_1 = ts.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1;
- if (!checkTypeRelatedTo(thisArgumentType, getThisTypeOfSignature(signature), relation, errorNode, headMessage_1)) {
+ if (!checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage_1)) {
return false;
}
}
@@ -35453,7 +35688,7 @@ var ts;
var argCount = getEffectiveArgumentCount(node, args, signature);
for (var i = 0; i < argCount; i++) {
var arg = getEffectiveArgument(node, args, i);
- if (arg === undefined || arg.kind !== 205) {
+ if (arg === undefined || arg.kind !== 206) {
var paramType = getTypeAtPosition(signature, i);
var argType = getEffectiveArgumentType(node, i) ||
checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined);
@@ -35467,25 +35702,25 @@ var ts;
return true;
}
function getThisArgumentOfCall(node) {
- if (node.kind === 186) {
+ if (node.kind === 187) {
var callee = ts.skipOuterExpressions(node.expression);
- if (callee.kind === 184 || callee.kind === 185) {
+ if (callee.kind === 185 || callee.kind === 186) {
return callee.expression;
}
}
}
function getEffectiveCallArguments(node) {
- if (node.kind === 188) {
+ if (node.kind === 189) {
var template = node.template;
var args_4 = [undefined];
- if (template.kind === 201) {
+ if (template.kind === 202) {
ts.forEach(template.templateSpans, function (span) {
args_4.push(span.expression);
});
}
return args_4;
}
- else if (node.kind === 149) {
+ else if (node.kind === 150) {
return undefined;
}
else if (ts.isJsxOpeningLikeElement(node)) {
@@ -35496,22 +35731,24 @@ var ts;
}
}
function getEffectiveArgumentCount(node, args, signature) {
- if (node.kind === 149) {
+ if (node.kind === 150) {
switch (node.parent.kind) {
- case 234:
- case 204:
+ case 235:
+ case 205:
return 1;
- case 151:
+ case 152:
return 2;
- case 153:
- case 155:
+ case 154:
case 156:
+ case 157:
if (languageVersion === 0) {
return 2;
}
return signature.parameters.length >= 3 ? 3 : 2;
- case 148:
+ case 149:
return 3;
+ default:
+ return ts.Debug.fail();
}
}
else {
@@ -35519,51 +35756,52 @@ var ts;
}
}
function getEffectiveDecoratorFirstArgumentType(node) {
- if (node.kind === 234) {
+ if (node.kind === 235) {
var classSymbol = getSymbolOfNode(node);
return getTypeOfSymbol(classSymbol);
}
- if (node.kind === 148) {
+ if (node.kind === 149) {
node = node.parent;
- if (node.kind === 154) {
+ if (node.kind === 155) {
var classSymbol = getSymbolOfNode(node);
return getTypeOfSymbol(classSymbol);
}
}
- if (node.kind === 151 ||
- node.kind === 153 ||
- node.kind === 155 ||
- node.kind === 156) {
+ if (node.kind === 152 ||
+ node.kind === 154 ||
+ node.kind === 156 ||
+ node.kind === 157) {
return getParentTypeOfClassElement(node);
}
ts.Debug.fail("Unsupported decorator target.");
- return unknownType;
+ return errorType;
}
function getEffectiveDecoratorSecondArgumentType(node) {
- if (node.kind === 234) {
+ if (node.kind === 235) {
ts.Debug.fail("Class decorators should not have a second synthetic argument.");
- return unknownType;
+ return errorType;
}
- if (node.kind === 148) {
+ if (node.kind === 149) {
node = node.parent;
- if (node.kind === 154) {
+ if (node.kind === 155) {
return anyType;
}
}
- if (node.kind === 151 ||
- node.kind === 153 ||
- node.kind === 155 ||
- node.kind === 156) {
+ if (node.kind === 152 ||
+ node.kind === 154 ||
+ node.kind === 156 ||
+ node.kind === 157) {
var element = node;
- switch (element.name.kind) {
+ var name = element.name;
+ switch (name.kind) {
case 71:
- return getLiteralType(ts.idText(element.name));
+ return getLiteralType(ts.idText(name));
case 8:
case 9:
- return getLiteralType(element.name.text);
- case 146:
- var nameType = checkComputedPropertyName(element.name);
- if (isTypeAssignableToKind(nameType, 1536)) {
+ return getLiteralType(name.text);
+ case 147:
+ var nameType = checkComputedPropertyName(name);
+ if (isTypeAssignableToKind(nameType, 3072)) {
return nameType;
}
else {
@@ -35571,32 +35809,32 @@ var ts;
}
default:
ts.Debug.fail("Unsupported property name.");
- return unknownType;
+ return errorType;
}
}
ts.Debug.fail("Unsupported decorator target.");
- return unknownType;
+ return errorType;
}
function getEffectiveDecoratorThirdArgumentType(node) {
- if (node.kind === 234) {
+ if (node.kind === 235) {
ts.Debug.fail("Class decorators should not have a third synthetic argument.");
- return unknownType;
+ return errorType;
}
- if (node.kind === 148) {
+ if (node.kind === 149) {
return numberType;
}
- if (node.kind === 151) {
+ if (node.kind === 152) {
ts.Debug.fail("Property decorators should not have a third synthetic argument.");
- return unknownType;
+ return errorType;
}
- if (node.kind === 153 ||
- node.kind === 155 ||
- node.kind === 156) {
+ if (node.kind === 154 ||
+ node.kind === 156 ||
+ node.kind === 157) {
var propertyType = getTypeOfNode(node);
return createTypedPropertyDescriptorType(propertyType);
}
ts.Debug.fail("Unsupported decorator target.");
- return unknownType;
+ return errorType;
}
function getEffectiveDecoratorArgumentType(node, argIndex) {
if (argIndex === 0) {
@@ -35609,29 +35847,29 @@ var ts;
return getEffectiveDecoratorThirdArgumentType(node.parent);
}
ts.Debug.fail("Decorators should not have a fourth synthetic argument.");
- return unknownType;
+ return errorType;
}
function getEffectiveArgumentType(node, argIndex) {
- if (node.kind === 149) {
+ if (node.kind === 150) {
return getEffectiveDecoratorArgumentType(node, argIndex);
}
- else if (argIndex === 0 && node.kind === 188) {
+ else if (argIndex === 0 && node.kind === 189) {
return getGlobalTemplateStringsArrayType();
}
return undefined;
}
function getEffectiveArgument(node, args, argIndex) {
- if (node.kind === 149 ||
- (argIndex === 0 && node.kind === 188)) {
+ if (node.kind === 150 ||
+ (argIndex === 0 && node.kind === 189)) {
return undefined;
}
return args[argIndex];
}
function getEffectiveArgumentErrorNode(node, argIndex, arg) {
- if (node.kind === 149) {
+ if (node.kind === 150) {
return node.expression;
}
- else if (argIndex === 0 && node.kind === 188) {
+ else if (argIndex === 0 && node.kind === 189) {
return node.template;
}
else {
@@ -35650,8 +35888,8 @@ var ts;
return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length);
}
function resolveCall(node, signatures, candidatesOutArray, fallbackError) {
- var isTaggedTemplate = node.kind === 188;
- var isDecorator = node.kind === 149;
+ var isTaggedTemplate = node.kind === 189;
+ var isDecorator = node.kind === 150;
var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node);
var typeArguments;
if (!isDecorator) {
@@ -35684,7 +35922,7 @@ var ts;
var candidateForArgumentError;
var candidateForTypeArgumentError;
var result;
- var signatureHelpTrailingComma = candidatesOutArray && node.kind === 186 && node.arguments.hasTrailingComma;
+ var signatureHelpTrailingComma = candidatesOutArray && node.kind === 187 && node.arguments.hasTrailingComma;
if (candidates.length > 1) {
result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma);
}
@@ -35835,9 +36073,10 @@ var ts;
if (node.expression.kind === 97) {
var superType = checkSuperExpression(node.expression);
if (isTypeAny(superType)) {
+ ts.forEach(node.arguments, checkExpression);
return anySignature;
}
- if (superType !== unknownType) {
+ if (superType !== errorType) {
var baseTypeNode = ts.getClassExtendsHeritageClauseElement(ts.getContainingClass(node));
if (baseTypeNode) {
var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode);
@@ -35851,13 +36090,13 @@ var ts;
return silentNeverSignature;
}
var apparentType = getApparentType(funcType);
- if (apparentType === unknownType) {
+ if (apparentType === errorType) {
return resolveErrorCall(node);
}
var callSignatures = getSignaturesOfType(apparentType, 0);
var constructSignatures = getSignaturesOfType(apparentType, 1);
if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, constructSignatures.length)) {
- if (funcType !== unknownType && node.typeArguments) {
+ if (funcType !== errorType && node.typeArguments) {
error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments);
}
return resolveUntypedCall(node);
@@ -35874,8 +36113,8 @@ var ts;
return resolveCall(node, callSignatures, candidatesOutArray);
}
function isUntypedFunctionCall(funcType, apparentFuncType, numCallSignatures, numConstructSignatures) {
- return isTypeAny(funcType) || isTypeAny(apparentFuncType) && funcType.flags & 32768 ||
- !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & (131072 | 16384)) && isTypeAssignableTo(funcType, globalFunctionType);
+ return isTypeAny(funcType) || isTypeAny(apparentFuncType) && funcType.flags & 65536 ||
+ !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & (262144 | 32768)) && isTypeAssignableTo(funcType, globalFunctionType);
}
function resolveNewExpression(node, candidatesOutArray) {
if (node.arguments && languageVersion < 1) {
@@ -35889,7 +36128,7 @@ var ts;
return silentNeverSignature;
}
expressionType = getApparentType(expressionType);
- if (expressionType === unknownType) {
+ if (expressionType === errorType) {
return resolveErrorCall(node);
}
if (isTypeAny(expressionType)) {
@@ -35980,7 +36219,7 @@ var ts;
function resolveTaggedTemplateExpression(node, candidatesOutArray) {
var tagType = checkExpression(node.tag);
var apparentType = getApparentType(tagType);
- if (apparentType === unknownType) {
+ if (apparentType === errorType) {
return resolveErrorCall(node);
}
var callSignatures = getSignaturesOfType(apparentType, 0);
@@ -35996,23 +36235,25 @@ var ts;
}
function getDiagnosticHeadMessageForDecoratorResolution(node) {
switch (node.parent.kind) {
- case 234:
- case 204:
+ case 235:
+ case 205:
return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression;
- case 148:
+ case 149:
return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression;
- case 151:
+ case 152:
return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;
- case 153:
- case 155:
+ case 154:
case 156:
+ case 157:
return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression;
+ default:
+ return ts.Debug.fail();
}
}
function resolveDecorator(node, candidatesOutArray) {
var funcType = checkExpression(node.expression);
var apparentType = getApparentType(funcType);
- if (apparentType === unknownType) {
+ if (apparentType === errorType) {
return resolveErrorCall(node);
}
var callSignatures = getSignaturesOfType(apparentType, 0);
@@ -36027,8 +36268,7 @@ var ts;
}
var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
if (!callSignatures.length) {
- var errorInfo = void 0;
- errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType));
+ var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType));
errorInfo = ts.chainDiagnosticMessages(errorInfo, headMessage);
diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(node, errorInfo));
invocationErrorRecovery(apparentType, 0);
@@ -36044,7 +36284,7 @@ var ts;
});
}
function getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, candidatesOutArray) {
- ts.Debug.assert(!(elementType.flags & 131072));
+ ts.Debug.assert(!(elementType.flags & 262144));
var callSignatures = elementType && getSignaturesOfType(elementType, 0);
if (callSignatures && callSignatures.length > 0) {
return resolveCall(openingLikeElement, callSignatures, candidatesOutArray);
@@ -36053,16 +36293,16 @@ var ts;
}
function resolveSignature(node, candidatesOutArray) {
switch (node.kind) {
- case 186:
- return resolveCallExpression(node, candidatesOutArray);
case 187:
- return resolveNewExpression(node, candidatesOutArray);
+ return resolveCallExpression(node, candidatesOutArray);
case 188:
+ return resolveNewExpression(node, candidatesOutArray);
+ case 189:
return resolveTaggedTemplateExpression(node, candidatesOutArray);
- case 149:
+ case 150:
return resolveDecorator(node, candidatesOutArray);
+ case 257:
case 256:
- case 255:
var exprTypes = checkExpression(node.tagName);
return forEachType(exprTypes, function (exprType) {
var sfcResult = getResolvedJsxStatelessFunctionSignature(node, exprType, candidatesOutArray);
@@ -36076,7 +36316,7 @@ var ts;
return ts.length(sigs) ? sigs[0] : unknownSignature;
}) || unknownSignature;
}
- ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable.");
+ throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable.");
}
function getResolvedSignature(node, candidatesOutArray) {
var links = getNodeLinks(node);
@@ -36096,15 +36336,11 @@ var ts;
var symbol = ts.isFunctionDeclaration(node) || ts.isFunctionExpression(node) ? getSymbolOfNode(node) :
ts.isVariableDeclaration(node) && node.initializer && ts.isFunctionExpression(node.initializer) ? getSymbolOfNode(node.initializer) :
undefined;
- return symbol && symbol.members !== undefined;
+ return !!symbol && symbol.members !== undefined;
}
return false;
}
function getJavaScriptClassType(symbol) {
- var initializer = ts.getDeclaredJavascriptInitializer(symbol.valueDeclaration);
- if (initializer) {
- symbol = getSymbolOfNode(initializer);
- }
var inferred;
if (isJavaScriptConstructor(symbol.valueDeclaration)) {
inferred = getInferredClassType(symbol);
@@ -36135,7 +36371,7 @@ var ts;
return false;
}
var parent = node.parent;
- while (parent && parent.kind === 184) {
+ while (parent && parent.kind === 185) {
parent = parent.parent;
}
if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 58) {
@@ -36162,12 +36398,12 @@ var ts;
if (node.expression.kind === 97) {
return voidType;
}
- if (node.kind === 187) {
+ if (node.kind === 188) {
var declaration = signature.declaration;
if (declaration &&
- declaration.kind !== 154 &&
- declaration.kind !== 158 &&
- declaration.kind !== 163 &&
+ declaration.kind !== 155 &&
+ declaration.kind !== 159 &&
+ declaration.kind !== 164 &&
!ts.isJSDocConstructSignature(declaration)) {
var funcSymbol = checkExpression(node.expression).symbol;
if (!funcSymbol && node.expression.kind === 71) {
@@ -36187,10 +36423,20 @@ var ts;
return resolveExternalModuleTypeByLiteral(node.arguments[0]);
}
var returnType = getReturnTypeOfSignature(signature);
- if (returnType.flags & 1536 && isSymbolOrSymbolForCall(node)) {
+ if (returnType.flags & 3072 && isSymbolOrSymbolForCall(node)) {
return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent));
}
- return returnType;
+ var jsAssignmentType;
+ if (ts.isInJavaScriptFile(node)) {
+ var decl = ts.getDeclarationOfJSInitializer(node);
+ if (decl) {
+ var jsSymbol = getSymbolOfNode(decl);
+ if (jsSymbol && ts.hasEntries(jsSymbol.exports)) {
+ jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts.emptyArray, ts.emptyArray, jsObjectLiteralIndexInfo, undefined);
+ }
+ }
+ }
+ return jsAssignmentType ? getIntersectionType([returnType, jsAssignmentType]) : returnType;
}
function isSymbolOrSymbolForCall(node) {
if (!ts.isCallExpression(node))
@@ -36219,7 +36465,7 @@ var ts;
for (var i = 1; i < node.arguments.length; ++i) {
checkExpressionCached(node.arguments[i]);
}
- if (specifierType.flags & 4096 || specifierType.flags & 8192 || !isTypeAssignableTo(specifierType, stringType)) {
+ if (specifierType.flags & 8192 || specifierType.flags & 16384 || !isTypeAssignableTo(specifierType, stringType)) {
error(specifier, ts.Diagnostics.Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0, typeToString(specifierType));
}
var moduleSymbol = resolveExternalModuleName(node, specifier);
@@ -36232,7 +36478,7 @@ var ts;
return createPromiseReturnType(node, anyType);
}
function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol) {
- if (allowSyntheticDefaultImports && type && type !== unknownType) {
+ if (allowSyntheticDefaultImports && type && type !== errorType) {
var synthType = type;
if (!synthType.syntheticType) {
var file_4 = ts.find(originalSymbol.declarations, ts.isSourceFile);
@@ -36269,9 +36515,9 @@ var ts;
return false;
}
var targetDeclarationKind = resolvedRequire.flags & 16
- ? 233
+ ? 234
: resolvedRequire.flags & 3
- ? 231
+ ? 232
: 0;
if (targetDeclarationKind !== 0) {
var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind);
@@ -36293,7 +36539,7 @@ var ts;
var exprType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(checkExpression(expression, checkMode)));
checkSourceElement(type);
var targetType = getTypeFromTypeNode(type);
- if (produceDiagnostics && targetType !== unknownType) {
+ if (produceDiagnostics && targetType !== errorType) {
var widenedType = getWidenedType(exprType);
if (!isTypeComparableTo(targetType, widenedType)) {
checkTypeComparableTo(exprType, targetType, errNode, ts.Diagnostics.Type_0_cannot_be_converted_to_type_1);
@@ -36312,14 +36558,15 @@ var ts;
if (node.keywordToken === 91) {
return checkImportMetaProperty(node);
}
+ return ts.Debug.assertNever(node.keywordToken);
}
function checkNewTargetMetaProperty(node) {
var container = ts.getNewTargetContainer(node);
if (!container) {
error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target");
- return unknownType;
+ return errorType;
}
- else if (container.kind === 154) {
+ else if (container.kind === 155) {
var symbol = getSymbolOfNode(container.parent);
return getTypeOfSymbol(symbol);
}
@@ -36335,7 +36582,7 @@ var ts;
var file = ts.getSourceFileOfNode(node);
ts.Debug.assert(!!(file.flags & 1048576), "Containing file is missing import meta node flag.");
ts.Debug.assert(!!file.externalModuleIndicator, "Containing file should be a module.");
- return node.name.escapedText === "meta" ? getGlobalImportMetaType() : unknownType;
+ return node.name.escapedText === "meta" ? getGlobalImportMetaType() : errorType;
}
function getTypeOfParameter(symbol) {
var type = getTypeOfSymbol(symbol);
@@ -36390,9 +36637,9 @@ var ts;
}
}
if (signature.hasRestParameter && isRestParameterIndex(context, signature.parameters.length - 1)) {
- var parameter = ts.lastOrUndefined(signature.parameters);
+ var parameter = ts.last(signature.parameters);
if (isTransientSymbol(parameter) || !ts.getEffectiveTypeAnnotationNode(parameter.valueDeclaration)) {
- var contextualParameterType = getTypeOfSymbol(ts.lastOrUndefined(context.parameters));
+ var contextualParameterType = getTypeOfSymbol(ts.last(context.parameters));
assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType);
}
}
@@ -36437,7 +36684,7 @@ var ts;
error(func, ts.isImportCall(func) ?
ts.Diagnostics.A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option :
ts.Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option);
- return unknownType;
+ return errorType;
}
else if (!getGlobalPromiseConstructorSymbol(true)) {
error(func, ts.isImportCall(func) ?
@@ -36448,11 +36695,11 @@ var ts;
}
function getReturnTypeFromBody(func, checkMode) {
if (!func.body) {
- return unknownType;
+ return errorType;
}
var functionFlags = ts.getFunctionFlags(func);
var type;
- if (func.body.kind !== 212) {
+ if (func.body.kind !== 213) {
type = checkExpressionCached(func.body, checkMode);
if (functionFlags & 2) {
type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
@@ -36555,7 +36802,7 @@ var ts;
if (!(func.flags & 128)) {
return false;
}
- if (ts.some(func.body.statements, function (statement) { return statement.kind === 226 && isExhaustiveSwitchStatement(statement); })) {
+ if (ts.some(func.body.statements, function (statement) { return statement.kind === 227 && isExhaustiveSwitchStatement(statement); })) {
return false;
}
return true;
@@ -36572,7 +36819,7 @@ var ts;
if (functionFlags & 2) {
type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
}
- if (type.flags & 16384) {
+ if (type.flags & 32768) {
hasReturnOfTypeNever = true;
}
ts.pushIfUnique(aggregatedTypes, type);
@@ -36592,11 +36839,11 @@ var ts;
}
function mayReturnNever(func) {
switch (func.kind) {
- case 191:
case 192:
+ case 193:
return true;
- case 153:
- return func.parent.kind === 183;
+ case 154:
+ return func.parent.kind === 184;
default:
return false;
}
@@ -36605,14 +36852,14 @@ var ts;
if (!produceDiagnostics) {
return;
}
- if (returnType && maybeTypeOfKind(returnType, 1 | 2048)) {
+ if (returnType && maybeTypeOfKind(returnType, 3 | 4096)) {
return;
}
- if (func.kind === 152 || ts.nodeIsMissing(func.body) || func.body.kind !== 212 || !functionHasImplicitReturn(func)) {
+ if (func.kind === 153 || ts.nodeIsMissing(func.body) || func.body.kind !== 213 || !functionHasImplicitReturn(func)) {
return;
}
var hasExplicitReturn = func.flags & 256;
- if (returnType && returnType.flags & 16384) {
+ if (returnType && returnType.flags & 32768) {
error(ts.getEffectiveReturnTypeNode(func), ts.Diagnostics.A_function_returning_never_cannot_have_a_reachable_end_point);
}
else if (returnType && !hasExplicitReturn) {
@@ -36635,12 +36882,12 @@ var ts;
}
}
function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) {
- ts.Debug.assert(node.kind !== 153 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 154 || ts.isObjectLiteralMethod(node));
if (checkMode === 1 && isContextSensitive(node)) {
return anyFunctionType;
}
var hasGrammarError = checkGrammarFunctionLikeDeclaration(node);
- if (!hasGrammarError && node.kind === 191) {
+ if (!hasGrammarError && node.kind === 192) {
checkGrammarForGenerator(node);
}
var links = getNodeLinks(node);
@@ -36677,7 +36924,7 @@ var ts;
return type;
}
function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) {
- ts.Debug.assert(node.kind !== 153 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 154 || ts.isObjectLiteralMethod(node));
var functionFlags = ts.getFunctionFlags(node);
var returnTypeNode = ts.getEffectiveReturnTypeNode(node);
var returnOrPromisedType = returnTypeNode &&
@@ -36691,7 +36938,7 @@ var ts;
if (!returnTypeNode) {
getReturnTypeOfSignature(getSignatureFromDeclaration(node));
}
- if (node.body.kind === 212) {
+ if (node.body.kind === 213) {
checkSourceElement(node.body);
}
else {
@@ -36709,7 +36956,7 @@ var ts;
}
}
function checkArithmeticOperandType(operand, type, diagnostic) {
- if (!isTypeAssignableToKind(type, 84)) {
+ if (!isTypeAssignableToKind(type, 168)) {
error(operand, diagnostic);
return false;
}
@@ -36725,10 +36972,10 @@ var ts;
function isReferenceToReadonlyEntity(expr, symbol) {
if (isReadonlySymbol(symbol)) {
if (symbol.flags & 4 &&
- (expr.kind === 184 || expr.kind === 185) &&
+ (expr.kind === 185 || expr.kind === 186) &&
expr.expression.kind === 99) {
var func = ts.getContainingFunction(expr);
- if (!(func && func.kind === 154)) {
+ if (!(func && func.kind === 155)) {
return true;
}
return !(func.parent === symbol.valueDeclaration.parent || func === symbol.valueDeclaration.parent);
@@ -36738,13 +36985,13 @@ var ts;
return false;
}
function isReferenceThroughNamespaceImport(expr) {
- if (expr.kind === 184 || expr.kind === 185) {
+ if (expr.kind === 185 || expr.kind === 186) {
var node = ts.skipParentheses(expr.expression);
if (node.kind === 71) {
var symbol = getNodeLinks(node).resolvedSymbol;
if (symbol.flags & 2097152) {
var declaration = getDeclarationOfAliasSymbol(symbol);
- return declaration && declaration.kind === 245;
+ return !!declaration && declaration.kind === 246;
}
}
}
@@ -36752,7 +36999,7 @@ var ts;
}
function checkReferenceExpression(expr, invalidReferenceMessage) {
var node = ts.skipOuterExpressions(expr, 2 | 1);
- if (node.kind !== 71 && node.kind !== 184 && node.kind !== 185) {
+ if (node.kind !== 71 && node.kind !== 185 && node.kind !== 186) {
error(expr, invalidReferenceMessage);
return false;
}
@@ -36761,7 +37008,7 @@ var ts;
function checkDeleteExpression(node) {
checkExpression(node.expression);
var expr = ts.skipParentheses(node.expression);
- if (expr.kind !== 184 && expr.kind !== 185) {
+ if (expr.kind !== 185 && expr.kind !== 186) {
error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference);
return booleanType;
}
@@ -36810,7 +37057,7 @@ var ts;
case 38:
case 52:
checkNonNullType(operandType, node.operand);
- if (maybeTypeOfKind(operandType, 1536)) {
+ if (maybeTypeOfKind(operandType, 3072)) {
error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator));
}
return numberType;
@@ -36827,7 +37074,7 @@ var ts;
}
return numberType;
}
- return unknownType;
+ return errorType;
}
function checkPostfixUnaryExpression(node) {
var operandType = checkExpression(node.operand);
@@ -36841,10 +37088,10 @@ var ts;
return numberType;
}
function maybeTypeOfKind(type, kind) {
- if (type.flags & kind || kind & 536870912 && isGenericMappedType(type)) {
+ if (type.flags & kind & ~134217728 || kind & 134217728 && isGenericMappedType(type)) {
return true;
}
- if (type.flags & 393216) {
+ if (type.flags & 786432) {
var types = type.types;
for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
var t = types_16[_i];
@@ -36859,26 +37106,26 @@ var ts;
if (source.flags & kind) {
return true;
}
- if (strict && source.flags & (1 | 2048 | 4096 | 8192)) {
+ if (strict && source.flags & (3 | 4096 | 8192 | 16384)) {
return false;
}
- return (kind & 84 && isTypeAssignableTo(source, numberType)) ||
- (kind & 34 && isTypeAssignableTo(source, stringType)) ||
- (kind & 136 && isTypeAssignableTo(source, booleanType)) ||
- (kind & 2048 && isTypeAssignableTo(source, voidType)) ||
- (kind & 16384 && isTypeAssignableTo(source, neverType)) ||
- (kind & 8192 && isTypeAssignableTo(source, nullType)) ||
- (kind & 4096 && isTypeAssignableTo(source, undefinedType)) ||
- (kind & 512 && isTypeAssignableTo(source, esSymbolType)) ||
- (kind & 134217728 && isTypeAssignableTo(source, nonPrimitiveType));
+ return !!(kind & 168) && isTypeAssignableTo(source, numberType) ||
+ !!(kind & 68) && isTypeAssignableTo(source, stringType) ||
+ !!(kind & 272) && isTypeAssignableTo(source, booleanType) ||
+ !!(kind & 4096) && isTypeAssignableTo(source, voidType) ||
+ !!(kind & 32768) && isTypeAssignableTo(source, neverType) ||
+ !!(kind & 16384) && isTypeAssignableTo(source, nullType) ||
+ !!(kind & 8192) && isTypeAssignableTo(source, undefinedType) ||
+ !!(kind & 1024) && isTypeAssignableTo(source, esSymbolType) ||
+ !!(kind & 16777216) && isTypeAssignableTo(source, nonPrimitiveType);
}
function allTypesAssignableToKind(source, kind, strict) {
- return source.flags & 131072 ?
+ return source.flags & 262144 ?
ts.every(source.types, function (subType) { return allTypesAssignableToKind(subType, kind, strict); }) :
isTypeAssignableToKind(source, kind, strict);
}
function isConstEnumObjectType(type) {
- return ts.getObjectFlags(type) & 16 && type.symbol && isConstEnumSymbol(type.symbol);
+ return !!(ts.getObjectFlags(type) & 16) && !!type.symbol && isConstEnumSymbol(type.symbol);
}
function isConstEnumSymbol(symbol) {
return (symbol.flags & 128) !== 0;
@@ -36888,7 +37135,7 @@ var ts;
return silentNeverType;
}
if (!isTypeAny(leftType) &&
- allTypesAssignableToKind(leftType, 16382)) {
+ allTypesAssignableToKind(leftType, 32764)) {
error(left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter);
}
if (!(isTypeAny(rightType) || typeHasCallOrConstructSignatures(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) {
@@ -36902,10 +37149,10 @@ var ts;
}
leftType = checkNonNullType(leftType, left);
rightType = checkNonNullType(rightType, right);
- if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 84 | 1536))) {
+ if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 168 | 3072))) {
error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol);
}
- if (!isTypeAssignableToKind(rightType, 134217728 | 7372800)) {
+ if (!isTypeAssignableToKind(rightType, 16777216 | 14745600)) {
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;
@@ -36923,9 +37170,9 @@ var ts;
return sourceType;
}
function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, allProperties) {
- if (property.kind === 269 || property.kind === 270) {
+ if (property.kind === 270 || property.kind === 271) {
var name = property.name;
- if (name.kind === 146) {
+ if (name.kind === 147) {
checkComputedPropertyName(name);
}
if (isComputedNonLiteralName(name)) {
@@ -36938,7 +37185,7 @@ var ts;
isNumericLiteralName(text) && getIndexTypeOfType(objectLiteralType, 1) ||
getIndexTypeOfType(objectLiteralType, 0);
if (type) {
- if (property.kind === 270) {
+ if (property.kind === 271) {
return checkDestructuringAssignment(property, type);
}
else {
@@ -36949,7 +37196,7 @@ var ts;
error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name));
}
}
- else if (property.kind === 271) {
+ else if (property.kind === 272) {
if (languageVersion < 6) {
checkExternalEmitHelpers(property, 4);
}
@@ -36972,7 +37219,7 @@ var ts;
if (languageVersion < 2 && compilerOptions.downlevelIteration) {
checkExternalEmitHelpers(node, 512);
}
- var elementType = checkIteratedTypeOrElementType(sourceType, node, false, false) || unknownType;
+ var elementType = checkIteratedTypeOrElementType(sourceType, node, false, false) || errorType;
for (var i = 0; i < elements.length; i++) {
checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, checkMode);
}
@@ -36981,8 +37228,8 @@ var ts;
function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) {
var elements = node.elements;
var element = elements[elementIndex];
- if (element.kind !== 205) {
- if (element.kind !== 203) {
+ if (element.kind !== 206) {
+ if (element.kind !== 204) {
var propName = "" + elementIndex;
var type = isTypeAny(sourceType)
? sourceType
@@ -37008,7 +37255,7 @@ var ts;
}
else {
var restExpression = element.expression;
- if (restExpression.kind === 199 && restExpression.operatorToken.kind === 58) {
+ if (restExpression.kind === 200 && restExpression.operatorToken.kind === 58) {
error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer);
}
else {
@@ -37021,11 +37268,11 @@ var ts;
}
function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode) {
var target;
- if (exprOrAssignment.kind === 270) {
+ if (exprOrAssignment.kind === 271) {
var prop = exprOrAssignment;
if (prop.objectAssignmentInitializer) {
if (strictNullChecks &&
- !(getFalsyFlags(checkExpression(prop.objectAssignmentInitializer)) & 4096)) {
+ !(getFalsyFlags(checkExpression(prop.objectAssignmentInitializer)) & 8192)) {
sourceType = getTypeWithFacts(sourceType, 131072);
}
checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode);
@@ -37035,21 +37282,21 @@ var ts;
else {
target = exprOrAssignment;
}
- if (target.kind === 199 && target.operatorToken.kind === 58) {
+ if (target.kind === 200 && target.operatorToken.kind === 58) {
checkBinaryExpression(target, checkMode);
target = target.left;
}
- if (target.kind === 183) {
+ if (target.kind === 184) {
return checkObjectLiteralAssignment(target, sourceType);
}
- if (target.kind === 182) {
+ if (target.kind === 183) {
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 === 271 ?
+ var error = target.parent.kind === 272 ?
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;
if (checkReferenceExpression(target, error)) {
@@ -37063,35 +37310,35 @@ var ts;
case 71:
case 9:
case 12:
- case 188:
- case 201:
+ case 189:
+ case 202:
case 13:
case 8:
case 101:
case 86:
case 95:
case 140:
- case 191:
- case 204:
case 192:
- case 182:
+ case 205:
+ case 193:
case 183:
- case 194:
- case 208:
+ case 184:
+ case 195:
+ case 209:
+ case 256:
case 255:
- case 254:
return true;
- case 200:
+ case 201:
return isSideEffectFree(node.whenTrue) &&
isSideEffectFree(node.whenFalse);
- case 199:
+ case 200:
if (ts.isAssignmentOperator(node.operatorToken.kind)) {
return false;
}
return isSideEffectFree(node.left) &&
isSideEffectFree(node.right);
- case 197:
case 198:
+ case 199:
switch (node.operator) {
case 51:
case 37:
@@ -37100,15 +37347,15 @@ var ts;
return true;
}
return false;
- case 195:
- case 189:
- case 207:
+ case 196:
+ case 190:
+ case 208:
default:
return false;
}
}
function isTypeEqualityComparableTo(source, target) {
- return (target.flags & 12288) !== 0 || isTypeComparableTo(source, target);
+ return (target.flags & 24576) !== 0 || isTypeComparableTo(source, target);
}
function checkBinaryExpression(node, checkMode) {
if (ts.isInJavaScriptFile(node) && ts.getAssignedJavascriptInitializer(node)) {
@@ -37118,7 +37365,7 @@ var ts;
}
function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) {
var operator = operatorToken.kind;
- if (operator === 58 && (left.kind === 183 || left.kind === 182)) {
+ if (operator === 58 && (left.kind === 184 || left.kind === 183)) {
return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode);
}
var leftType = checkExpression(left, checkMode);
@@ -37152,8 +37399,8 @@ var ts;
leftType = checkNonNullType(leftType, left);
rightType = checkNonNullType(rightType, right);
var suggestedOperator = void 0;
- if ((leftType.flags & 136) &&
- (rightType.flags & 136) &&
+ if ((leftType.flags & 272) &&
+ (rightType.flags & 272) &&
(suggestedOperator = getSuggestedBooleanOperator(operatorToken.kind)) !== undefined) {
error(errorNode || operatorToken, ts.Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, ts.tokenToString(operatorToken.kind), ts.tokenToString(suggestedOperator));
}
@@ -37170,19 +37417,19 @@ var ts;
if (leftType === silentNeverType || rightType === silentNeverType) {
return silentNeverType;
}
- if (!isTypeAssignableToKind(leftType, 34) && !isTypeAssignableToKind(rightType, 34)) {
+ if (!isTypeAssignableToKind(leftType, 68) && !isTypeAssignableToKind(rightType, 68)) {
leftType = checkNonNullType(leftType, left);
rightType = checkNonNullType(rightType, right);
}
var resultType = void 0;
- if (isTypeAssignableToKind(leftType, 84, true) && isTypeAssignableToKind(rightType, 84, true)) {
+ if (isTypeAssignableToKind(leftType, 168, true) && isTypeAssignableToKind(rightType, 168, true)) {
resultType = numberType;
}
- else if (isTypeAssignableToKind(leftType, 34, true) || isTypeAssignableToKind(rightType, 34, true)) {
+ else if (isTypeAssignableToKind(leftType, 68, true) || isTypeAssignableToKind(rightType, 68, true)) {
resultType = stringType;
}
else if (isTypeAny(leftType) || isTypeAny(rightType)) {
- resultType = leftType === unknownType || rightType === unknownType ? unknownType : anyType;
+ resultType = leftType === errorType || rightType === errorType ? errorType : anyType;
}
if (resultType && !checkForDisallowedESSymbolOperand(operator)) {
return resultType;
@@ -37242,6 +37489,8 @@ var ts;
error(left, ts.Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects);
}
return rightType;
+ default:
+ return ts.Debug.fail();
}
function checkSpecialAssignment(left, right) {
var special = ts.getSpecialPropertyAssignmentKind(left.parent);
@@ -37253,7 +37502,7 @@ var ts;
if (propType.symbol && propType.symbol.flags & 32) {
var name = prop.escapedName;
var symbol = resolveName(prop.valueDeclaration, name, 67901928, undefined, name, false);
- if (symbol) {
+ if (symbol && symbol.declarations.some(function (d) { return d.kind === 297; })) {
grammarErrorOnNode(symbol.declarations[0], ts.Diagnostics.Duplicate_identifier_0, ts.unescapeLeadingUnderscores(name));
return grammarErrorOnNode(prop.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0, ts.unescapeLeadingUnderscores(name));
}
@@ -37265,8 +37514,8 @@ var ts;
return node.kind === 71 && node.escapedText === "eval";
}
function checkForDisallowedESSymbolOperand(operator) {
- var offendingSymbolOperand = maybeTypeOfKind(leftType, 1536) ? left :
- maybeTypeOfKind(rightType, 1536) ? right :
+ var offendingSymbolOperand = maybeTypeOfKind(leftType, 3072) ? left :
+ maybeTypeOfKind(rightType, 3072) ? right :
undefined;
if (offendingSymbolOperand) {
error(offendingSymbolOperand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(operator));
@@ -37326,7 +37575,9 @@ var ts;
}
}
var func = ts.getContainingFunction(node);
- var functionFlags = func ? ts.getFunctionFlags(func) : 0;
+ if (!func)
+ return anyType;
+ var functionFlags = ts.getFunctionFlags(func);
if (!(functionFlags & 1)) {
return anyType;
}
@@ -37357,14 +37608,14 @@ var ts;
}
function checkTemplateExpression(node) {
ts.forEach(node.templateSpans, function (templateSpan) {
- if (maybeTypeOfKind(checkExpression(templateSpan.expression), 1536)) {
+ if (maybeTypeOfKind(checkExpression(templateSpan.expression), 3072)) {
error(templateSpan.expression, ts.Diagnostics.Type_0_cannot_be_converted_to_type_1, typeToString(esSymbolType), typeToString(stringType));
}
});
return stringType;
}
function getContextNode(node) {
- if (node.kind === 262) {
+ if (node.kind === 263) {
return node.parent.parent;
}
return node;
@@ -37397,17 +37648,16 @@ var ts;
}
function isTypeAssertion(node) {
node = ts.skipParentheses(node);
- return node.kind === 189 || node.kind === 207;
+ return node.kind === 190 || node.kind === 208;
}
function checkDeclarationInitializer(declaration) {
- var inJs = ts.isInJavaScriptFile(declaration);
- var initializer = inJs && ts.getDeclaredJavascriptInitializer(declaration) || declaration.initializer;
+ var initializer = ts.getEffectiveInitializer(declaration);
var type = getTypeOfExpression(initializer, true);
var widened = ts.getCombinedNodeFlags(declaration) & 2 ||
(ts.getCombinedModifierFlags(declaration) & 64 && !ts.isParameterPropertyDeclaration(declaration)) ||
isTypeAssertion(initializer) ? type : getWidenedLiteralType(type);
- if (inJs) {
- if (widened.flags & 12288) {
+ if (ts.isInJavaScriptFile(declaration)) {
+ if (widened.flags & 24576) {
if (noImplicitAny) {
reportImplicitAnyError(declaration, anyType);
}
@@ -37422,33 +37672,23 @@ var ts;
}
return widened;
}
- function isTypeParameterWithKeyofConstraint(type) {
- if (type.flags & 32768) {
- var constraintDeclaration = getConstraintDeclaration(type);
- return constraintDeclaration && constraintDeclaration.kind === 174 &&
- constraintDeclaration.operator === 128;
- }
- return false;
- }
function isLiteralOfContextualType(candidateType, contextualType) {
if (contextualType) {
- if (contextualType.flags & 393216) {
+ if (contextualType.flags & 786432) {
var types = contextualType.types;
return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); });
}
- if (contextualType.flags & 7372800) {
+ if (contextualType.flags & 14745600) {
var constraint = getBaseConstraintOfType(contextualType) || emptyObjectType;
- return isTypeParameterWithKeyofConstraint(contextualType) && maybeTypeOfKind(candidateType, 32 | 64 | 1024) ||
- constraint.flags & 2 && maybeTypeOfKind(candidateType, 32) ||
- constraint.flags & 4 && maybeTypeOfKind(candidateType, 64) ||
- constraint.flags & 8 && maybeTypeOfKind(candidateType, 128) ||
- constraint.flags & 512 && maybeTypeOfKind(candidateType, 1024) ||
+ return maybeTypeOfKind(constraint, 4) && maybeTypeOfKind(candidateType, 64) ||
+ maybeTypeOfKind(constraint, 8) && maybeTypeOfKind(candidateType, 128) ||
+ maybeTypeOfKind(constraint, 1024) && maybeTypeOfKind(candidateType, 2048) ||
isLiteralOfContextualType(candidateType, constraint);
}
- return contextualType.flags & (32 | 524288) && maybeTypeOfKind(candidateType, 32) ||
- contextualType.flags & 64 && maybeTypeOfKind(candidateType, 64) ||
+ return !!(contextualType.flags & (64 | 1048576) && maybeTypeOfKind(candidateType, 64) ||
contextualType.flags & 128 && maybeTypeOfKind(candidateType, 128) ||
- contextualType.flags & 1024 && maybeTypeOfKind(candidateType, 1024);
+ contextualType.flags & 256 && maybeTypeOfKind(candidateType, 256) ||
+ contextualType.flags & 2048 && maybeTypeOfKind(candidateType, 2048));
}
return false;
}
@@ -37461,14 +37701,14 @@ var ts;
getWidenedLiteralLikeTypeForContextualType(type, contextualType);
}
function checkPropertyAssignment(node, checkMode) {
- if (node.name.kind === 146) {
+ if (node.name.kind === 147) {
checkComputedPropertyName(node.name);
}
return checkExpressionForMutableLocation(node.initializer, checkMode);
}
function checkObjectLiteralMethod(node, checkMode) {
checkGrammarMethod(node);
- if (node.name.kind === 146) {
+ if (node.name.kind === 147) {
checkComputedPropertyName(node.name);
}
var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);
@@ -37490,7 +37730,7 @@ var ts;
return type;
}
function getTypeOfExpression(node, cache) {
- if (node.kind === 186 && node.expression.kind !== 97 && !ts.isRequireCall(node, true) && !isSymbolOrSymbolForCall(node)) {
+ if (node.kind === 187 && node.expression.kind !== 97 && !ts.isRequireCall(node, true) && !isSymbolOrSymbolForCall(node)) {
var funcType = checkNonNullExpression(node.expression);
var signature = getSingleCallSignature(funcType);
if (signature && !signature.typeParameters) {
@@ -37508,7 +37748,7 @@ var ts;
}
function checkExpression(node, checkMode) {
var type;
- if (node.kind === 145) {
+ if (node.kind === 146) {
type = checkQualifiedName(node);
}
else {
@@ -37516,10 +37756,10 @@ var ts;
type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode);
}
if (isConstEnumObjectType(type)) {
- var ok = (node.parent.kind === 184 && node.parent.expression === node) ||
- (node.parent.kind === 185 && node.parent.expression === node) ||
- ((node.kind === 71 || node.kind === 145) && isInRightSideOfImportOrExportAssignment(node) ||
- (node.parent.kind === 164 && node.parent.exprName === node));
+ var ok = (node.parent.kind === 185 && node.parent.expression === node) ||
+ (node.parent.kind === 186 && node.parent.expression === node) ||
+ ((node.kind === 71 || node.kind === 146) && isInRightSideOfImportOrExportAssignment(node) ||
+ (node.parent.kind === 165 && node.parent.exprName === node));
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);
}
@@ -37553,76 +37793,76 @@ var ts;
return trueType;
case 86:
return falseType;
- case 201:
+ case 202:
return checkTemplateExpression(node);
case 12:
return globalRegExpType;
- case 182:
- return checkArrayLiteral(node, checkMode);
case 183:
- return checkObjectLiteral(node, checkMode);
+ return checkArrayLiteral(node, checkMode);
case 184:
- return checkPropertyAccessExpression(node);
+ return checkObjectLiteral(node, checkMode);
case 185:
- return checkIndexedAccess(node);
+ return checkPropertyAccessExpression(node);
case 186:
+ return checkIndexedAccess(node);
+ case 187:
if (node.expression.kind === 91) {
return checkImportCallExpression(node);
}
- case 187:
- return checkCallExpression(node);
case 188:
- return checkTaggedTemplateExpression(node);
- case 190:
- return checkParenthesizedExpression(node, checkMode);
- case 204:
- return checkClassExpression(node);
- case 191:
- case 192:
- return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);
- case 194:
- return checkTypeOfExpression(node);
+ return checkCallExpression(node);
case 189:
- case 207:
- return checkAssertion(node);
- case 208:
- return checkNonNullAssertion(node);
- case 209:
- return checkMetaProperty(node);
- case 193:
- return checkDeleteExpression(node);
- case 195:
- return checkVoidExpression(node);
- case 196:
- return checkAwaitExpression(node);
- case 197:
- return checkPrefixUnaryExpression(node);
- case 198:
- return checkPostfixUnaryExpression(node);
- case 199:
- return checkBinaryExpression(node, checkMode);
- case 200:
- return checkConditionalExpression(node, checkMode);
- case 203:
- return checkSpreadExpression(node, checkMode);
+ return checkTaggedTemplateExpression(node);
+ case 191:
+ return checkParenthesizedExpression(node, checkMode);
case 205:
+ return checkClassExpression(node);
+ case 192:
+ case 193:
+ return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);
+ case 195:
+ return checkTypeOfExpression(node);
+ case 190:
+ case 208:
+ return checkAssertion(node);
+ case 209:
+ return checkNonNullAssertion(node);
+ case 210:
+ return checkMetaProperty(node);
+ case 194:
+ return checkDeleteExpression(node);
+ case 196:
+ return checkVoidExpression(node);
+ case 197:
+ return checkAwaitExpression(node);
+ case 198:
+ return checkPrefixUnaryExpression(node);
+ case 199:
+ return checkPostfixUnaryExpression(node);
+ case 200:
+ return checkBinaryExpression(node, checkMode);
+ case 201:
+ return checkConditionalExpression(node, checkMode);
+ case 204:
+ return checkSpreadExpression(node, checkMode);
+ case 206:
return undefinedWideningType;
- case 202:
+ case 203:
return checkYieldExpression(node);
- case 264:
+ case 265:
return checkJsxExpression(node, checkMode);
- case 254:
- return checkJsxElement(node, checkMode);
case 255:
- return checkJsxSelfClosingElement(node, checkMode);
- case 258:
- return checkJsxFragment(node, checkMode);
- case 262:
- return checkJsxAttributes(node, checkMode);
+ return checkJsxElement(node, checkMode);
case 256:
+ return checkJsxSelfClosingElement(node, checkMode);
+ case 259:
+ return checkJsxFragment(node, checkMode);
+ case 263:
+ return checkJsxAttributes(node, checkMode);
+ case 257:
ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement");
}
- return unknownType;
+ return errorType;
}
function checkTypeParameter(node) {
if (node.expression) {
@@ -37651,7 +37891,7 @@ var ts;
checkVariableLikeDeclaration(node);
var func = ts.getContainingFunction(node);
if (ts.hasModifier(node, 92)) {
- if (!(func.kind === 154 && ts.nodeIsPresent(func.body))) {
+ if (!(func.kind === 155 && ts.nodeIsPresent(func.body))) {
error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
}
}
@@ -37662,7 +37902,7 @@ 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 === 154 || func.kind === 158 || func.kind === 163) {
+ if (func.kind === 155 || func.kind === 159 || func.kind === 164) {
error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter);
}
}
@@ -37724,13 +37964,13 @@ var ts;
}
function getTypePredicateParent(node) {
switch (node.parent.kind) {
+ case 193:
+ case 158:
+ case 234:
case 192:
- case 157:
- case 233:
- case 191:
- case 162:
+ case 163:
+ case 154:
case 153:
- case 152:
var parent = node.parent;
if (node === parent.type) {
return parent;
@@ -37748,7 +37988,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 === 180 || name.kind === 179) {
+ else if (name.kind === 181 || name.kind === 180) {
if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) {
return true;
}
@@ -37756,12 +37996,12 @@ var ts;
}
}
function checkSignatureDeclaration(node) {
- if (node.kind === 159) {
+ if (node.kind === 160) {
checkGrammarIndexSignature(node);
}
- else if (node.kind === 162 || node.kind === 233 || node.kind === 163 ||
- node.kind === 157 || node.kind === 154 ||
- node.kind === 158) {
+ else if (node.kind === 163 || node.kind === 234 || node.kind === 164 ||
+ node.kind === 158 || node.kind === 155 ||
+ node.kind === 159) {
checkGrammarFunctionLikeDeclaration(node);
}
var functionFlags = ts.getFunctionFlags(node);
@@ -37786,10 +38026,10 @@ var ts;
var returnTypeNode = ts.getEffectiveReturnTypeNode(node);
if (noImplicitAny && !returnTypeNode) {
switch (node.kind) {
- case 158:
+ case 159:
error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
- case 157:
+ case 158:
error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
}
@@ -37813,7 +38053,7 @@ var ts;
checkAsyncFunctionReturnType(node);
}
}
- if (node.kind !== 159 && node.kind !== 283) {
+ if (node.kind !== 160 && node.kind !== 284) {
registerForUnusedIdentifiersCheck(node);
}
}
@@ -37823,7 +38063,7 @@ var ts;
var staticNames = ts.createUnderscoreEscapedMap();
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
- if (member.kind === 154) {
+ if (member.kind === 155) {
for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) {
var param = _c[_b];
if (ts.isParameterPropertyDeclaration(param) && !ts.isBindingPattern(param.name)) {
@@ -37834,20 +38074,21 @@ var ts;
else {
var isStatic = ts.hasModifier(member, 32);
var names = isStatic ? staticNames : instanceNames;
- var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name);
- if (memberName) {
+ var name = member.name;
+ var memberName = name && ts.getPropertyNameForPropertyNameNode(name);
+ if (name && memberName) {
switch (member.kind) {
- case 155:
- addName(names, member.name, memberName, 1);
- break;
case 156:
- addName(names, member.name, memberName, 2);
+ addName(names, name, memberName, 1);
break;
- case 151:
- addName(names, member.name, memberName, 3);
+ case 157:
+ addName(names, name, memberName, 2);
break;
- case 153:
- addName(names, member.name, memberName, 4);
+ case 152:
+ addName(names, name, memberName, 3);
+ break;
+ case 154:
+ addName(names, name, memberName, 4);
break;
}
}
@@ -37898,15 +38139,16 @@ var ts;
var names = ts.createMap();
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
- if (member.kind === 150) {
+ if (member.kind === 151) {
var memberName = void 0;
- switch (member.name.kind) {
+ var name = member.name;
+ switch (name.kind) {
case 9:
case 8:
- memberName = member.name.text;
+ memberName = name.text;
break;
case 71:
- memberName = ts.idText(member.name);
+ memberName = ts.idText(name);
break;
default:
continue;
@@ -37922,7 +38164,7 @@ var ts;
}
}
function checkTypeForDuplicateIndexSignatures(node) {
- if (node.kind === 235) {
+ if (node.kind === 236) {
var nodeSymbol = getSymbolOfNode(node);
if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) {
return;
@@ -37967,7 +38209,7 @@ var ts;
if (!checkGrammarMethod(node))
checkGrammarComputedPropertyName(node.name);
checkFunctionOrMethodDeclaration(node);
- if (ts.hasModifier(node, 128) && node.kind === 153 && node.body) {
+ if (ts.hasModifier(node, 128) && node.kind === 154 && node.body) {
error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name));
}
}
@@ -37988,7 +38230,7 @@ var ts;
return;
}
function isInstancePropertyWithInitializer(n) {
- return n.kind === 151 &&
+ return n.kind === 152 &&
!ts.hasModifier(n, 32) &&
!!n.initializer;
}
@@ -38008,7 +38250,7 @@ var ts;
var superCallStatement = void 0;
for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) {
var statement = statements_2[_i];
- if (statement.kind === 215 && ts.isSuperCall(statement.expression)) {
+ if (statement.kind === 216 && ts.isSuperCall(statement.expression)) {
superCallStatement = statement;
break;
}
@@ -38032,18 +38274,18 @@ var ts;
checkGrammarComputedPropertyName(node.name);
checkDecorators(node);
checkSignatureDeclaration(node);
- if (node.kind === 155) {
+ if (node.kind === 156) {
if (!(node.flags & 4194304) && ts.nodeIsPresent(node.body) && (node.flags & 128)) {
if (!(node.flags & 256)) {
error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value);
}
}
}
- if (node.name.kind === 146) {
+ if (node.name.kind === 147) {
checkComputedPropertyName(node.name);
}
if (!hasNonBindableDynamicName(node)) {
- var otherKind = node.kind === 155 ? 156 : 155;
+ var otherKind = node.kind === 156 ? 157 : 156;
var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind);
if (otherAccessor) {
var nodeFlags = ts.getModifierFlags(node);
@@ -38059,7 +38301,7 @@ var ts;
}
}
var returnType = getTypeOfAccessors(getSymbolOfNode(node));
- if (node.kind === 155) {
+ if (node.kind === 156) {
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType);
}
}
@@ -38096,7 +38338,7 @@ var ts;
}
function getTypeParametersForTypeReference(node) {
var type = getTypeFromTypeReference(node);
- if (type !== unknownType) {
+ if (type !== errorType) {
var symbol = getNodeLinks(node).resolvedSymbol;
if (symbol) {
return symbol.flags & 524288 && getSymbolLinks(symbol).typeParameters ||
@@ -38107,11 +38349,11 @@ var ts;
}
function checkTypeReferenceNode(node) {
checkGrammarTypeArguments(node, node.typeArguments);
- if (node.kind === 161 && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) {
+ if (node.kind === 162 && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) {
grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);
}
var type = getTypeFromTypeReference(node);
- if (type !== unknownType) {
+ if (type !== errorType) {
if (node.typeArguments) {
ts.forEach(node.typeArguments, checkSourceElement);
if (produceDiagnostics) {
@@ -38121,7 +38363,7 @@ var ts;
}
}
}
- if (type.flags & 16 && getNodeLinks(node).resolvedSymbol.flags & 8) {
+ if (type.flags & 32 && getNodeLinks(node).resolvedSymbol.flags & 8) {
error(node, ts.Diagnostics.Enum_type_0_has_members_with_initializers_that_are_not_literals, typeToString(type));
}
}
@@ -38160,19 +38402,19 @@ var ts;
ts.forEach(node.types, checkSourceElement);
}
function checkIndexedAccessIndexType(type, accessNode) {
- if (!(type.flags & 1048576)) {
+ if (!(type.flags & 2097152)) {
return type;
}
var objectType = type.objectType;
var indexType = type.indexType;
if (isTypeAssignableTo(indexType, getIndexType(objectType, false))) {
- if (accessNode.kind === 185 && ts.isAssignmentTarget(accessNode) &&
+ if (accessNode.kind === 186 && ts.isAssignmentTarget(accessNode) &&
ts.getObjectFlags(objectType) & 32 && getMappedTypeModifiers(objectType) & 1) {
error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
}
return type;
}
- if (getIndexInfoOfType(getApparentType(objectType), 1) && isTypeAssignableToKind(indexType, 84)) {
+ if (getIndexInfoOfType(getApparentType(objectType), 1) && isTypeAssignableToKind(indexType, 168)) {
return type;
}
error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType));
@@ -38201,7 +38443,7 @@ var ts;
ts.forEachChild(node, checkSourceElement);
}
function checkInferType(node) {
- if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 170 && n.parent.extendsType === n; })) {
+ if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 171 && n.parent.extendsType === n; })) {
grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type);
}
checkSourceElement(node.typeParameter);
@@ -38215,9 +38457,9 @@ var ts;
}
function getEffectiveDeclarationFlags(n, flagsToCheck) {
var flags = ts.getCombinedModifierFlags(n);
- if (n.parent.kind !== 235 &&
- n.parent.kind !== 234 &&
- n.parent.kind !== 204 &&
+ if (n.parent.kind !== 236 &&
+ n.parent.kind !== 235 &&
+ n.parent.kind !== 205 &&
n.flags & 4194304) {
if (!(flags & 2) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) {
flags |= 1;
@@ -38297,7 +38539,7 @@ var ts;
if (node.name && subsequentName &&
(ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) ||
!ts.isComputedPropertyName(node.name) && !ts.isComputedPropertyName(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) {
- var reportError = (node.kind === 153 || node.kind === 152) &&
+ var reportError = (node.kind === 154 || node.kind === 153) &&
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;
@@ -38330,11 +38572,11 @@ var ts;
var current = declarations_4[_i];
var node = current;
var inAmbientContext = node.flags & 4194304;
- var inAmbientContextOrInterface = node.parent.kind === 235 || node.parent.kind === 165 || inAmbientContext;
+ var inAmbientContextOrInterface = node.parent.kind === 236 || node.parent.kind === 166 || inAmbientContext;
if (inAmbientContextOrInterface) {
previousDeclaration = undefined;
}
- if (node.kind === 233 || node.kind === 153 || node.kind === 152 || node.kind === 154) {
+ if (node.kind === 234 || node.kind === 154 || node.kind === 153 || node.kind === 155) {
var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck);
someNodeFlags |= currentNodeFlags;
allNodeFlags &= currentNodeFlags;
@@ -38447,39 +38689,39 @@ var ts;
function getDeclarationSpaces(decl) {
var d = decl;
switch (d.kind) {
- case 235:
case 236:
- case 296:
- case 291:
+ case 237:
+ case 297:
+ case 292:
return 2;
- case 238:
+ case 239:
return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0
? 4 | 1
: 4;
- case 234:
- case 237:
+ case 235:
+ case 238:
return 2 | 1;
- case 273:
+ case 274:
return 2 | 1 | 4;
- case 248:
+ case 249:
if (!ts.isEntityNameExpression(d.expression)) {
return 1;
}
d = d.expression;
- case 242:
+ case 243:
+ case 246:
case 245:
- case 244:
var result_3 = 0;
var target = resolveAlias(getSymbolOfNode(d));
ts.forEach(target.declarations, function (d) { result_3 |= getDeclarationSpaces(d); });
return result_3;
- case 231:
- case 181:
- case 233:
- case 247:
+ case 232:
+ case 182:
+ case 234:
+ case 248:
return 1;
default:
- ts.Debug.fail(ts.Debug.showSyntaxKind(d));
+ return ts.Debug.fail(ts.Debug.showSyntaxKind(d));
}
}
}
@@ -38523,7 +38765,7 @@ var ts;
return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), 2);
}
function checkAwaitedType(type, errorNode, diagnosticMessage) {
- return getAwaitedType(type, errorNode, diagnosticMessage) || unknownType;
+ return getAwaitedType(type, errorNode, diagnosticMessage) || errorType;
}
function getAwaitedType(type, errorNode, diagnosticMessage) {
var typeAsAwaitable = type;
@@ -38533,7 +38775,7 @@ var ts;
if (isTypeAny(type)) {
return typeAsAwaitable.awaitedTypeOfType = type;
}
- if (type.flags & 131072) {
+ if (type.flags & 262144) {
var types = void 0;
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
var constituentType = _a[_i];
@@ -38563,7 +38805,8 @@ var ts;
var thenFunction = getTypeOfPropertyOfType(type, "then");
if (thenFunction && getSignaturesOfType(thenFunction, 0).length > 0) {
if (errorNode) {
- ts.Debug.assert(!!diagnosticMessage);
+ if (!diagnosticMessage)
+ return ts.Debug.fail();
error(errorNode, diagnosticMessage);
}
return undefined;
@@ -38574,49 +38817,49 @@ var ts;
var returnTypeNode = ts.getEffectiveReturnTypeNode(node);
var returnType = getTypeFromTypeNode(returnTypeNode);
if (languageVersion >= 2) {
- if (returnType === unknownType) {
- return unknownType;
+ if (returnType === errorType) {
+ return errorType;
}
var globalPromiseType = getGlobalPromiseType(true);
if (globalPromiseType !== emptyGenericType && !isReferenceToType(returnType, globalPromiseType)) {
error(returnTypeNode, ts.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type);
- return unknownType;
+ return errorType;
}
}
else {
markTypeNodeAsReferenced(returnTypeNode);
- if (returnType === unknownType) {
- return unknownType;
+ if (returnType === errorType) {
+ return errorType;
}
var promiseConstructorName = ts.getEntityNameFromTypeNode(returnTypeNode);
if (promiseConstructorName === undefined) {
error(returnTypeNode, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, typeToString(returnType));
- return unknownType;
+ return errorType;
}
var promiseConstructorSymbol = resolveEntityName(promiseConstructorName, 67216319, true);
- var promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : unknownType;
- if (promiseConstructorType === unknownType) {
+ var promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : errorType;
+ if (promiseConstructorType === errorType) {
if (promiseConstructorName.kind === 71 && promiseConstructorName.escapedText === "Promise" && getTargetType(returnType) === getGlobalPromiseType(false)) {
error(returnTypeNode, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option);
}
else {
error(returnTypeNode, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts.entityNameToString(promiseConstructorName));
}
- return unknownType;
+ return errorType;
}
var globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType(true);
if (globalPromiseConstructorLikeType === emptyObjectType) {
error(returnTypeNode, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts.entityNameToString(promiseConstructorName));
- return unknownType;
+ return errorType;
}
if (!checkTypeAssignableTo(promiseConstructorType, globalPromiseConstructorLikeType, returnTypeNode, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value)) {
- return unknownType;
+ return errorType;
}
var rootName = promiseConstructorName && getFirstIdentifier(promiseConstructorName);
var collidingSymbol = getSymbol(node.locals, rootName.escapedText, 67216319);
if (collidingSymbol) {
error(collidingSymbol.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, ts.idText(rootName), ts.entityNameToString(promiseConstructorName));
- return unknownType;
+ return errorType;
}
}
return checkAwaitedType(returnType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
@@ -38631,26 +38874,28 @@ var ts;
var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
var errorInfo;
switch (node.parent.kind) {
- case 234:
+ case 235:
var classSymbol = getSymbolOfNode(node.parent);
var classConstructorType = getTypeOfSymbol(classSymbol);
expectedReturnType = getUnionType([classConstructorType, voidType]);
break;
- case 148:
+ case 149:
expectedReturnType = voidType;
- errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
+ errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
break;
- case 151:
+ case 152:
expectedReturnType = voidType;
- errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
+ errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
break;
- case 153:
- case 155:
+ case 154:
case 156:
+ case 157:
var methodType = getTypeOfNode(node.parent);
var descriptorType = createTypedPropertyDescriptorType(methodType);
expectedReturnType = getUnionType([descriptorType, voidType]);
break;
+ default:
+ return ts.Debug.fail();
}
checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, function () { return errorInfo; });
}
@@ -38679,12 +38924,12 @@ var ts;
function getEntityNameForDecoratorMetadata(node) {
if (node) {
switch (node.kind) {
+ case 170:
case 169:
- case 168:
var commonEntityName = void 0;
for (var _i = 0, _a = node.types; _i < _a.length; _i++) {
var typeNode = _a[_i];
- while (typeNode.kind === 172) {
+ while (typeNode.kind === 173) {
typeNode = typeNode.type;
}
if (typeNode.kind === 131) {
@@ -38709,9 +38954,9 @@ var ts;
}
}
return commonEntityName;
- case 172:
+ case 173:
return getEntityNameForDecoratorMetadata(node.type);
- case 161:
+ case 162:
return node.typeName;
}
}
@@ -38732,13 +38977,13 @@ var ts;
}
var firstDecorator = node.decorators[0];
checkExternalEmitHelpers(firstDecorator, 8);
- if (node.kind === 148) {
+ if (node.kind === 149) {
checkExternalEmitHelpers(firstDecorator, 32);
}
if (compilerOptions.emitDecoratorMetadata) {
checkExternalEmitHelpers(firstDecorator, 16);
switch (node.kind) {
- case 234:
+ case 235:
var constructor = ts.getFirstConstructorWithBody(node);
if (constructor) {
for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) {
@@ -38747,19 +38992,19 @@ var ts;
}
}
break;
- case 153:
- case 155:
+ case 154:
case 156:
+ case 157:
for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) {
var parameter = _c[_b];
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
}
markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node));
break;
- case 151:
+ case 152:
markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node));
break;
- case 148:
+ case 149:
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node));
var containingSignature = node.parent;
for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) {
@@ -38798,12 +39043,12 @@ var ts;
return;
}
if (!containsArgumentsReference(decl)) {
- error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 145 ? node.name.right : node.name));
+ error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 146 ? node.name.right : node.name));
}
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 === 145 ? 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 === 146 ? node.name.right : node.name));
}
}
}
@@ -38832,7 +39077,7 @@ var ts;
switch (node.kind) {
case 71:
return node;
- case 184:
+ case 185:
return node.name;
default:
return undefined;
@@ -38842,7 +39087,7 @@ var ts;
checkDecorators(node);
checkSignatureDeclaration(node);
var functionFlags = ts.getFunctionFlags(node);
- if (node.name && node.name.kind === 146) {
+ if (node.name && node.name.kind === 147) {
checkComputedPropertyName(node.name);
}
if (!hasNonBindableDynamicName(node)) {
@@ -38858,7 +39103,7 @@ var ts;
}
}
}
- var body = node.kind === 152 ? undefined : node.body;
+ var body = node.kind === 153 ? undefined : node.body;
checkSourceElement(body);
var returnTypeNode = ts.getEffectiveReturnTypeNode(node);
if ((functionFlags & 1) === 0) {
@@ -38891,41 +39136,41 @@ var ts;
for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) {
var node = potentiallyUnusedIdentifiers_1[_i];
switch (node.kind) {
- case 234:
- case 204:
+ case 235:
+ case 205:
checkUnusedClassMembers(node, addDiagnostic);
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 235:
+ case 236:
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 273:
- case 238:
- case 212:
- case 240:
- case 219:
+ case 274:
+ case 239:
+ case 213:
+ case 241:
case 220:
case 221:
+ case 222:
checkUnusedLocalsAndParameters(node, addDiagnostic);
break;
- case 154:
- case 191:
- case 233:
- case 192:
- case 153:
case 155:
+ case 192:
+ case 234:
+ case 193:
+ case 154:
case 156:
+ case 157:
if (node.body) {
checkUnusedLocalsAndParameters(node, addDiagnostic);
}
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 152:
- case 157:
+ case 153:
case 158:
- case 162:
+ case 159:
case 163:
- case 236:
+ case 164:
+ case 237:
checkUnusedTypeParameters(node, addDiagnostic);
break;
default:
@@ -38935,15 +39180,8 @@ var ts;
}
function errorUnusedLocal(declaration, name, addDiagnostic) {
var node = ts.getNameOfDeclaration(declaration) || declaration;
- if (isIdentifierThatStartsWithUnderScore(node)) {
- var declaration_2 = ts.getRootDeclaration(node.parent);
- if ((declaration_2.kind === 231 && ts.isForInOrOfStatement(declaration_2.parent.parent)) ||
- declaration_2.kind === 147) {
- return;
- }
- }
var message = isTypeDeclaration(declaration) ? ts.Diagnostics._0_is_declared_but_never_used : ts.Diagnostics._0_is_declared_but_its_value_is_never_read;
- addDiagnostic(0, ts.createDiagnosticForNodeSpan(ts.getSourceFileOfNode(declaration), declaration, node, message, name));
+ addDiagnostic(0, ts.createDiagnosticForNode(node, message, name));
}
function parameterNameStartsWithUnderscore(parameterName) {
return parameterName && isIdentifierThatStartsWithUnderScore(parameterName);
@@ -38956,11 +39194,11 @@ var ts;
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
switch (member.kind) {
- case 153:
- case 151:
- case 155:
+ case 154:
+ case 152:
case 156:
- if (member.kind === 156 && member.symbol.flags & 32768) {
+ case 157:
+ if (member.kind === 157 && member.symbol.flags & 32768) {
break;
}
var symbol = getSymbolOfNode(member);
@@ -38968,7 +39206,7 @@ var ts;
addDiagnostic(0, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)));
}
break;
- case 154:
+ case 155:
for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) {
var parameter = _c[_b];
if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8)) {
@@ -38976,8 +39214,8 @@ var ts;
}
}
break;
- case 159:
- case 211:
+ case 160:
+ case 212:
break;
default:
ts.Debug.fail();
@@ -39014,6 +39252,7 @@ var ts;
return;
var unusedImports = ts.createMap();
var unusedDestructures = ts.createMap();
+ var unusedVariables = ts.createMap();
nodeWithLocals.locals.forEach(function (local) {
if (local.flags & 262144 ? !(local.flags & 3 && !(local.isReferenced & 3)) : local.isReferenced || local.exportSymbol) {
return;
@@ -39031,6 +39270,11 @@ var ts;
addToGroup(unusedDestructures, declaration.parent, declaration, getNodeId);
}
}
+ else if (ts.isVariableDeclaration(declaration)) {
+ if (!isIdentifierThatStartsWithUnderScore(declaration.name) || !ts.isForInOrOfStatement(declaration.parent.parent)) {
+ addToGroup(unusedVariables, declaration.parent, declaration, getNodeId);
+ }
+ }
else {
var parameter = local.valueDeclaration && tryGetRootParameterDeclaration(local.valueDeclaration);
if (parameter) {
@@ -39048,49 +39292,76 @@ var ts;
unusedImports.forEach(function (_a) {
var importClause = _a[0], unuseds = _a[1];
var importDecl = importClause.parent;
- if (forEachImportedDeclaration(importClause, function (d) { return !ts.contains(unuseds, d); })) {
+ var nDeclarations = (importClause.name ? 1 : 0) +
+ (importClause.namedBindings ?
+ (importClause.namedBindings.kind === 246 ? 1 : importClause.namedBindings.elements.length)
+ : 0);
+ if (nDeclarations === unuseds.length) {
+ addDiagnostic(0, unuseds.length === 1
+ ? ts.createDiagnosticForNode(importDecl, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(ts.first(unuseds).name))
+ : ts.createDiagnosticForNode(importDecl, ts.Diagnostics.All_imports_in_import_declaration_are_unused));
+ }
+ else {
for (var _i = 0, unuseds_1 = unuseds; _i < unuseds_1.length; _i++) {
var unused = unuseds_1[_i];
errorUnusedLocal(unused, ts.idText(unused.name), addDiagnostic);
}
}
- else if (unuseds.length === 1) {
- addDiagnostic(0, ts.createDiagnosticForNode(importDecl, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(ts.first(unuseds).name)));
- }
- else {
- addDiagnostic(0, ts.createDiagnosticForNode(importDecl, ts.Diagnostics.All_imports_in_import_declaration_are_unused));
- }
});
unusedDestructures.forEach(function (_a) {
var bindingPattern = _a[0], bindingElements = _a[1];
var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 : 0;
- if (!bindingPattern.elements.every(function (e) { return ts.contains(bindingElements, e); })) {
+ if (bindingPattern.elements.length === bindingElements.length) {
+ if (bindingElements.length === 1 && bindingPattern.parent.kind === 232 && bindingPattern.parent.parent.kind === 233) {
+ addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId);
+ }
+ else {
+ addDiagnostic(kind, bindingElements.length === 1
+ ? ts.createDiagnosticForNode(bindingPattern, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(ts.cast(ts.first(bindingElements).name, ts.isIdentifier)))
+ : ts.createDiagnosticForNode(bindingPattern, ts.Diagnostics.All_destructured_elements_are_unused));
+ }
+ }
+ else {
for (var _i = 0, bindingElements_1 = bindingElements; _i < bindingElements_1.length; _i++) {
var e = bindingElements_1[_i];
addDiagnostic(kind, ts.createDiagnosticForNode(e, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(ts.cast(e.name, ts.isIdentifier))));
}
}
- else if (bindingElements.length === 1) {
- addDiagnostic(kind, ts.createDiagnosticForNode(bindingPattern, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(ts.cast(ts.first(bindingElements).name, ts.isIdentifier))));
+ });
+ unusedVariables.forEach(function (_a) {
+ var declarationList = _a[0], declarations = _a[1];
+ if (declarationList.declarations.length === declarations.length) {
+ addDiagnostic(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 === 214 ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused));
}
else {
- addDiagnostic(kind, ts.createDiagnosticForNode(bindingPattern, ts.Diagnostics.All_destructured_elements_are_unused));
+ for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) {
+ var decl = declarations_5[_i];
+ addDiagnostic(0, ts.createDiagnosticForNode(decl, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(ts.cast(decl.name, ts.isIdentifier))));
+ }
}
});
}
+ function bindingNameText(name) {
+ switch (name.kind) {
+ case 71:
+ return ts.idText(name);
+ case 181:
+ case 180:
+ return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name);
+ default:
+ return ts.Debug.assertNever(name);
+ }
+ }
function isImportedDeclaration(node) {
- return node.kind === 244 || node.kind === 247 || node.kind === 245;
+ return node.kind === 245 || node.kind === 248 || node.kind === 246;
}
function importClauseFromImported(decl) {
- return decl.kind === 244 ? decl : decl.kind === 245 ? decl.parent : decl.parent.parent;
- }
- function forEachImportedDeclaration(importClause, cb) {
- var defaultName = importClause.name, namedBindings = importClause.namedBindings;
- return (defaultName && cb(importClause)) ||
- namedBindings && (namedBindings.kind === 245 ? cb(namedBindings) : ts.forEach(namedBindings.elements, cb));
+ return decl.kind === 245 ? decl : decl.kind === 246 ? decl.parent : decl.parent.parent;
}
function checkBlock(node) {
- if (node.kind === 212) {
+ if (node.kind === 213) {
checkGrammarStatementInAmbientContext(node);
}
if (ts.isFunctionOrModuleBlock(node)) {
@@ -39119,19 +39390,19 @@ var ts;
if (!(identifier && identifier.escapedText === name)) {
return false;
}
- if (node.kind === 151 ||
- node.kind === 150 ||
+ if (node.kind === 152 ||
+ node.kind === 151 ||
+ node.kind === 154 ||
node.kind === 153 ||
- node.kind === 152 ||
- node.kind === 155 ||
- node.kind === 156) {
+ node.kind === 156 ||
+ node.kind === 157) {
return false;
}
if (node.flags & 4194304) {
return false;
}
var root = ts.getRootDeclaration(node);
- if (root.kind === 148 && ts.nodeIsMissing(root.parent.body)) {
+ if (root.kind === 149 && ts.nodeIsMissing(root.parent.body)) {
return false;
}
return true;
@@ -39148,6 +39419,7 @@ var ts;
}
return true;
}
+ return false;
});
}
function checkIfNewTargetIsCapturedInEnclosingScope(node) {
@@ -39162,6 +39434,7 @@ var ts;
}
return true;
}
+ return false;
});
}
function checkCollisionWithRequireExportsInGeneratedCode(node, name) {
@@ -39175,7 +39448,7 @@ var ts;
return;
}
var parent = getDeclarationContainer(node);
- if (parent.kind === 273 && ts.isExternalOrCommonJsModule(parent)) {
+ if (parent.kind === 274 && 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));
}
}
@@ -39187,7 +39460,7 @@ var ts;
return;
}
var parent = getDeclarationContainer(node);
- if (parent.kind === 273 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024) {
+ if (parent.kind === 274 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024) {
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));
}
}
@@ -39195,7 +39468,7 @@ var ts;
if ((ts.getCombinedNodeFlags(node) & 3) !== 0 || ts.isParameterDeclaration(node)) {
return;
}
- if (node.kind === 231 && !node.initializer) {
+ if (node.kind === 232 && !node.initializer) {
return;
}
var symbol = getSymbolOfNode(node);
@@ -39207,15 +39480,15 @@ var ts;
localDeclarationSymbol !== symbol &&
localDeclarationSymbol.flags & 2) {
if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3) {
- var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 232);
- var container = varDeclList.parent.kind === 213 && varDeclList.parent.parent
+ var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 233);
+ var container = varDeclList.parent.kind === 214 && varDeclList.parent.parent
? varDeclList.parent.parent
: undefined;
var namesShareScope = container &&
- (container.kind === 212 && ts.isFunctionLike(container.parent) ||
+ (container.kind === 213 && ts.isFunctionLike(container.parent) ||
+ container.kind === 240 ||
container.kind === 239 ||
- container.kind === 238 ||
- container.kind === 273);
+ container.kind === 274);
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);
@@ -39225,7 +39498,7 @@ var ts;
}
}
function checkParameterInitializer(node) {
- if (ts.getRootDeclaration(node).kind !== 148) {
+ if (ts.getRootDeclaration(node).kind !== 149) {
return;
}
var func = ts.getContainingFunction(node);
@@ -39234,7 +39507,7 @@ var ts;
if (ts.isTypeNode(n) || ts.isDeclarationName(n)) {
return;
}
- if (n.kind === 184) {
+ if (n.kind === 185) {
return visit(n.expression);
}
else if (n.kind === 71) {
@@ -39248,8 +39521,8 @@ var ts;
}
var enclosingContainer = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration);
if (enclosingContainer === func) {
- if (symbol.valueDeclaration.kind === 148 ||
- symbol.valueDeclaration.kind === 181) {
+ if (symbol.valueDeclaration.kind === 149 ||
+ symbol.valueDeclaration.kind === 182) {
if (symbol.valueDeclaration.pos < node.pos) {
return;
}
@@ -39258,7 +39531,7 @@ var ts;
return "quit";
}
return ts.isFunctionLike(current.parent) ||
- (current.parent.kind === 151 &&
+ (current.parent.kind === 152 &&
!(ts.hasModifier(current.parent, 32)) &&
ts.isClassLike(current.parent.parent));
})) {
@@ -39284,17 +39557,17 @@ var ts;
if (!node.name) {
return;
}
- if (node.name.kind === 146) {
+ if (node.name.kind === 147) {
checkComputedPropertyName(node.name);
if (node.initializer) {
checkExpressionCached(node.initializer);
}
}
- if (node.kind === 181) {
- if (node.parent.kind === 179 && languageVersion < 6) {
+ if (node.kind === 182) {
+ if (node.parent.kind === 180 && languageVersion < 6) {
checkExternalEmitHelpers(node, 4);
}
- if (node.propertyName && node.propertyName.kind === 146) {
+ if (node.propertyName && node.propertyName.kind === 147) {
checkComputedPropertyName(node.propertyName);
}
var parent = node.parent.parent;
@@ -39309,17 +39582,17 @@ var ts;
}
}
if (ts.isBindingPattern(node.name)) {
- if (node.name.kind === 180 && languageVersion < 2 && compilerOptions.downlevelIteration) {
+ if (node.name.kind === 181 && languageVersion < 2 && compilerOptions.downlevelIteration) {
checkExternalEmitHelpers(node, 512);
}
ts.forEach(node.name.elements, checkSourceElement);
}
- if (node.initializer && ts.getRootDeclaration(node).kind === 148 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) {
+ if (node.initializer && ts.getRootDeclaration(node).kind === 149 && 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)) {
- if (node.initializer && node.parent.parent.kind !== 220) {
+ if (node.initializer && node.parent.parent.kind !== 221) {
var initializerType = checkExpressionCached(node.initializer);
if (strictNullChecks && node.name.elements.length === 0) {
checkNonNullType(initializerType, node);
@@ -39334,15 +39607,15 @@ var ts;
var symbol = getSymbolOfNode(node);
var type = convertAutoToAny(getTypeOfSymbol(symbol));
if (node === symbol.valueDeclaration) {
- if (node.initializer && node.parent.parent.kind !== 220) {
- var initializer = ts.isInJavaScriptFile(node) && ts.getDeclaredJavascriptInitializer(node) || node.initializer;
+ var initializer = ts.getEffectiveInitializer(node);
+ if (initializer && node.parent.parent.kind !== 221) {
checkTypeAssignableTo(checkExpressionCached(initializer), type, node, undefined);
checkParameterInitializer(node);
}
}
else {
var declarationType = convertAutoToAny(getWidenedTypeForVariableLikeDeclaration(node));
- if (type !== unknownType && declarationType !== unknownType &&
+ if (type !== errorType && declarationType !== errorType &&
!isTypeIdenticalTo(type, declarationType) &&
!(symbol.flags & 67108864)) {
errorNextVariableOrPropertyDeclarationMustHaveSameType(type, node, declarationType);
@@ -39355,9 +39628,9 @@ var ts;
error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name));
}
}
- if (node.kind !== 151 && node.kind !== 150) {
+ if (node.kind !== 152 && node.kind !== 151) {
checkExportsOnMergedDeclarations(node);
- if (node.kind === 231 || node.kind === 181) {
+ if (node.kind === 232 || node.kind === 182) {
checkVarDeclaredNamesNotShadowed(node);
}
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
@@ -39366,14 +39639,14 @@ var ts;
}
function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstType, nextDeclaration, nextType) {
var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration);
- var message = nextDeclaration.kind === 151 || nextDeclaration.kind === 150
+ var message = nextDeclaration.kind === 152 || nextDeclaration.kind === 151
? 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;
error(nextDeclarationName, message, ts.declarationNameToString(nextDeclarationName), typeToString(firstType), typeToString(nextType));
}
function areDeclarationFlagsIdentical(left, right) {
- if ((left.kind === 148 && right.kind === 231) ||
- (left.kind === 231 && right.kind === 148)) {
+ if ((left.kind === 149 && right.kind === 232) ||
+ (left.kind === 232 && right.kind === 149)) {
return true;
}
if (ts.hasQuestionToken(left) !== ts.hasQuestionToken(right)) {
@@ -39408,7 +39681,7 @@ var ts;
checkGrammarStatementInAmbientContext(node);
checkExpression(node.expression);
checkSourceElement(node.thenStatement);
- if (node.thenStatement.kind === 214) {
+ if (node.thenStatement.kind === 215) {
error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement);
}
checkSourceElement(node.elseStatement);
@@ -39425,12 +39698,12 @@ var ts;
}
function checkForStatement(node) {
if (!checkGrammarStatementInAmbientContext(node)) {
- if (node.initializer && node.initializer.kind === 232) {
+ if (node.initializer && node.initializer.kind === 233) {
checkGrammarVariableDeclarationList(node.initializer);
}
}
if (node.initializer) {
- if (node.initializer.kind === 232) {
+ if (node.initializer.kind === 233) {
ts.forEach(node.initializer.declarations, checkVariableDeclaration);
}
else {
@@ -39457,14 +39730,14 @@ var ts;
else if (compilerOptions.downlevelIteration && languageVersion < 2) {
checkExternalEmitHelpers(node, 256);
}
- if (node.initializer.kind === 232) {
+ if (node.initializer.kind === 233) {
checkForInOrForOfVariableDeclaration(node);
}
else {
var varExpr = node.initializer;
var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier);
- if (varExpr.kind === 182 || varExpr.kind === 183) {
- checkDestructuringAssignment(varExpr, iteratedType || unknownType);
+ if (varExpr.kind === 183 || varExpr.kind === 184) {
+ checkDestructuringAssignment(varExpr, iteratedType || errorType);
}
else {
var leftType = checkExpression(varExpr);
@@ -39482,7 +39755,7 @@ var ts;
function checkForInStatement(node) {
checkGrammarForInOrForOfStatement(node);
var rightType = checkNonNullExpression(node.expression);
- if (node.initializer.kind === 232) {
+ if (node.initializer.kind === 233) {
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);
@@ -39492,7 +39765,7 @@ var ts;
else {
var varExpr = node.initializer;
var leftType = checkExpression(varExpr);
- if (varExpr.kind === 182 || varExpr.kind === 183) {
+ if (varExpr.kind === 183 || varExpr.kind === 184) {
error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
}
else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) {
@@ -39502,7 +39775,7 @@ var ts;
checkReferenceExpression(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access);
}
}
- if (rightType === neverType || !isTypeAssignableToKind(rightType, 134217728 | 7372800)) {
+ if (rightType === neverType || !isTypeAssignableToKind(rightType, 16777216 | 14745600)) {
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);
@@ -39544,14 +39817,14 @@ var ts;
var reportedError = false;
var hasStringConstituent = false;
if (allowStringInput) {
- if (arrayType.flags & 131072) {
+ if (arrayType.flags & 262144) {
var arrayTypes = inputType.types;
- var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 34); });
+ var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 68); });
if (filteredTypes !== arrayTypes) {
arrayType = getUnionType(filteredTypes, 2);
}
}
- else if (arrayType.flags & 34) {
+ else if (arrayType.flags & 68) {
arrayType = neverType;
}
hasStringConstituent = arrayType !== inputType;
@@ -39562,7 +39835,7 @@ var ts;
reportedError = true;
}
}
- if (arrayType.flags & 16384) {
+ if (arrayType.flags & 32768) {
return stringType;
}
}
@@ -39587,7 +39860,7 @@ var ts;
}
var arrayElementType = getIndexTypeOfType(arrayType, 1);
if (hasStringConstituent && arrayElementType) {
- if (arrayElementType.flags & 34) {
+ if (arrayElementType.flags & 68) {
return stringType;
}
return getUnionType([arrayElementType, stringType], 2);
@@ -39620,11 +39893,11 @@ var ts;
}
}
var asyncMethodType = allowAsyncIterables && getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("asyncIterator"));
- var methodType = asyncMethodType || (allowSyncIterables && getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("iterator")));
+ var methodType = asyncMethodType || (allowSyncIterables ? getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("iterator")) : undefined);
if (isTypeAny(methodType)) {
return undefined;
}
- var signatures = methodType && getSignaturesOfType(methodType, 0);
+ var signatures = methodType ? getSignaturesOfType(methodType, 0) : undefined;
if (!ts.some(signatures)) {
if (errorNode) {
reportTypeNotIterableError(errorNode, type, allowAsyncIterables);
@@ -39711,14 +39984,14 @@ var ts;
checkGrammarBreakOrContinueStatement(node);
}
function isGetAccessorWithAnnotatedSetAccessor(node) {
- return node.kind === 155
- && ts.getEffectiveSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 156)) !== undefined;
+ return node.kind === 156
+ && ts.getEffectiveSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 157)) !== undefined;
}
function isUnwrappedReturnTypeVoidOrAny(func, returnType) {
var unwrappedReturnType = (ts.getFunctionFlags(func) & 3) === 2
? getPromisedTypeOfPromise(returnType)
: returnType;
- return unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, 2048 | 1);
+ return !!unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, 4096 | 3);
}
function checkReturnStatement(node) {
if (checkGrammarStatementInAmbientContext(node)) {
@@ -39733,17 +40006,17 @@ var ts;
var returnType = getReturnTypeOfSignature(signature);
var functionFlags = ts.getFunctionFlags(func);
var isGenerator = functionFlags & 1;
- if (strictNullChecks || node.expression || returnType.flags & 16384) {
+ if (strictNullChecks || node.expression || returnType.flags & 32768) {
var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType;
if (isGenerator) {
return;
}
- else if (func.kind === 156) {
+ else if (func.kind === 157) {
if (node.expression) {
error(node, ts.Diagnostics.Setters_cannot_return_a_value);
}
}
- else if (func.kind === 154) {
+ else if (func.kind === 155) {
if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) {
error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);
}
@@ -39761,7 +40034,7 @@ var ts;
}
}
}
- else if (func.kind !== 154 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType) && !isGenerator) {
+ else if (func.kind !== 155 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType) && !isGenerator) {
error(node, ts.Diagnostics.Not_all_code_paths_return_a_value);
}
}
@@ -39786,7 +40059,7 @@ var ts;
var expressionType = checkExpression(node.expression);
var expressionIsLiteral = isLiteralType(expressionType);
ts.forEach(node.caseBlock.clauses, function (clause) {
- if (clause.kind === 266 && !hasDuplicateDefaultClause) {
+ if (clause.kind === 267 && !hasDuplicateDefaultClause) {
if (firstDefaultClause === undefined) {
firstDefaultClause = clause;
}
@@ -39798,7 +40071,7 @@ var ts;
hasDuplicateDefaultClause = true;
}
}
- if (produceDiagnostics && clause.kind === 265) {
+ if (produceDiagnostics && clause.kind === 266) {
var caseType = checkExpression(clause.expression);
var caseIsLiteral = isLiteralType(caseType);
var comparedExpressionType = expressionType;
@@ -39822,10 +40095,11 @@ var ts;
if (ts.isFunctionLike(current)) {
return "quit";
}
- if (current.kind === 227 && current.label.escapedText === node.label.escapedText) {
+ if (current.kind === 228 && current.label.escapedText === node.label.escapedText) {
grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label));
return true;
}
+ return false;
});
}
checkSourceElement(node.statement);
@@ -39881,8 +40155,8 @@ var ts;
checkIndexConstraintForProperty(prop, propType, type, declaredStringIndexer, stringIndexType, 0);
checkIndexConstraintForProperty(prop, propType, type, declaredNumberIndexer, numberIndexType, 1);
});
- if (ts.getObjectFlags(type) & 1 && ts.isClassLike(type.symbol.valueDeclaration)) {
- var classDeclaration = type.symbol.valueDeclaration;
+ var classDeclaration = type.symbol.valueDeclaration;
+ if (ts.getObjectFlags(type) & 1 && ts.isClassLike(classDeclaration)) {
for (var _i = 0, _a = classDeclaration.members; _i < _a.length; _i++) {
var member = _a[_i];
if (!ts.hasModifier(member, 32) && hasNonBindableDynamicName(member)) {
@@ -39915,8 +40189,8 @@ var ts;
}
var errorNode;
if (propDeclaration &&
- (propDeclaration.kind === 199 ||
- ts.getNameOfDeclaration(propDeclaration).kind === 146 ||
+ (propDeclaration.kind === 200 ||
+ ts.getNameOfDeclaration(propDeclaration).kind === 147 ||
prop.parent === containingType.symbol)) {
errorNode = propDeclaration;
}
@@ -39938,6 +40212,7 @@ var ts;
function checkTypeNameIsReserved(name, message) {
switch (name.escapedText) {
case "any":
+ case "unknown":
case "number":
case "boolean":
case "string":
@@ -39947,6 +40222,12 @@ var ts;
error(name, message, name.escapedText);
}
}
+ function checkClassNameCollisionWithObject(name) {
+ if (languageVersion === 1 && name.escapedText === "Object"
+ && moduleKind !== ts.ModuleKind.ES2015 && moduleKind !== ts.ModuleKind.ESNext) {
+ error(name, ts.Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ts.ModuleKind[moduleKind]);
+ }
+ }
function checkTypeParameters(typeParameterDeclarations) {
if (typeParameterDeclarations) {
var seenDefault = false;
@@ -39983,8 +40264,8 @@ var ts;
var type = getDeclaredTypeOfSymbol(symbol);
if (!areTypeParametersIdentical(declarations, type.localTypeParameters)) {
var name = symbolToString(symbol);
- for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) {
- var declaration = declarations_5[_i];
+ for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) {
+ var declaration = declarations_6[_i];
error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name);
}
}
@@ -39993,8 +40274,8 @@ var ts;
function areTypeParametersIdentical(declarations, targetParameters) {
var maxTypeArgumentCount = ts.length(targetParameters);
var minTypeArgumentCount = getMinTypeArgumentCount(targetParameters);
- for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) {
- var declaration = declarations_6[_i];
+ for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) {
+ var declaration = declarations_7[_i];
var sourceParameters = ts.getEffectiveTypeParameterDeclarations(declaration);
var numTypeParameters = sourceParameters.length;
if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) {
@@ -40046,6 +40327,9 @@ var ts;
checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0);
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
+ if (!(node.flags & 4194304)) {
+ checkClassNameCollisionWithObject(node.name);
+ }
}
checkTypeParameters(ts.getEffectiveTypeParameterDeclarations(node));
checkExportsOnMergedDeclarations(node);
@@ -40084,10 +40368,10 @@ var ts;
issueMemberSpecificError(node, typeWithThis, baseWithThis, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1);
}
checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1);
- if (baseConstructorType.flags & 1081344 && !isMixinConstructorType(staticType)) {
+ if (baseConstructorType.flags & 2162688 && !isMixinConstructorType(staticType)) {
error(node.name || node, ts.Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any);
}
- if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32) && !(baseConstructorType.flags & 1081344)) {
+ if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32) && !(baseConstructorType.flags & 2162688)) {
var constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode);
if (ts.forEach(constructors, function (sig) { return getReturnTypeOfSignature(sig) !== baseType_1; })) {
error(baseTypeNode.expression, ts.Diagnostics.Base_constructors_must_all_have_the_same_return_type);
@@ -40106,7 +40390,7 @@ var ts;
checkTypeReferenceNode(typeRefNode);
if (produceDiagnostics) {
var t = getTypeFromTypeNode(typeRefNode);
- if (t !== unknownType) {
+ if (t !== errorType) {
if (isValidBaseType(t)) {
var genericDiag = t.symbol && t.symbol.flags & 32 ?
ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass :
@@ -40172,7 +40456,7 @@ var ts;
}
function getClassOrInterfaceDeclarationsOfSymbol(symbol) {
return ts.filter(symbol.declarations, function (d) {
- return d.kind === 234 || d.kind === 235;
+ return d.kind === 235 || d.kind === 236;
});
}
function checkKindsOfPropertyMemberOverrides(type, baseType) {
@@ -40190,7 +40474,7 @@ var ts;
if (derived === base) {
var derivedClassDecl = ts.getClassLikeDeclarationOfSymbol(type.symbol);
if (baseDeclarationFlags & 128 && (!derivedClassDecl || !ts.hasModifier(derivedClassDecl, 128))) {
- if (derivedClassDecl.kind === 204) {
+ if (derivedClassDecl.kind === 205) {
error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType));
}
else {
@@ -40203,7 +40487,7 @@ var ts;
if (baseDeclarationFlags & 8 || derivedDeclarationFlags & 8) {
continue;
}
- if (isPrototypeProperty(base) && isPrototypeProperty(derived) || base.flags & 98308 && derived.flags & 98308) {
+ if (isPrototypeProperty(base) || base.flags & 98308 && derived.flags & 98308) {
continue;
}
var errorMessage = void 0;
@@ -40269,7 +40553,7 @@ var ts;
var propName = member.name;
if (ts.isIdentifier(propName)) {
var type = getTypeOfSymbol(getSymbolOfNode(member));
- if (!(type.flags & 1 || getFalsyFlags(type) & 4096)) {
+ if (!(type.flags & 3 || getFalsyFlags(type) & 8192)) {
if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
error(member.name, ts.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor, ts.declarationNameToString(propName));
}
@@ -40279,7 +40563,7 @@ var ts;
}
}
function isInstancePropertyWithoutInitializer(node) {
- return node.kind === 151 &&
+ return node.kind === 152 &&
!ts.hasModifier(node, 32 | 128) &&
!node.exclamationToken &&
!node.initializer;
@@ -40288,7 +40572,7 @@ var ts;
var reference = ts.createPropertyAccess(ts.createThis(), propName);
reference.flowNode = constructor.returnFlowNode;
var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
- return !(getFalsyFlags(flowType) & 4096);
+ return !(getFalsyFlags(flowType) & 8192);
}
function checkInterfaceDeclaration(node) {
if (!checkGrammarDecoratorsAndModifiers(node))
@@ -40299,7 +40583,7 @@ var ts;
checkExportsOnMergedDeclarations(node);
var symbol = getSymbolOfNode(node);
checkTypeParameterListsIdentical(symbol);
- var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 235);
+ var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 236);
if (node === firstInterfaceDecl) {
var type = getDeclaredTypeOfSymbol(symbol);
var typeWithThis = getTypeWithThisArgument(type);
@@ -40395,7 +40679,7 @@ var ts;
return value;
function evaluate(expr) {
switch (expr.kind) {
- case 197:
+ case 198:
var value_2 = evaluate(expr.operand);
if (typeof value_2 === "number") {
switch (expr.operator) {
@@ -40405,7 +40689,7 @@ var ts;
}
}
break;
- case 199:
+ case 200:
var left = evaluate(expr.left);
var right = evaluate(expr.right);
if (typeof left === "number" && typeof right === "number") {
@@ -40433,18 +40717,22 @@ var ts;
case 8:
checkGrammarNumericLiteral(expr);
return +expr.text;
- case 190:
+ case 191:
return evaluate(expr.expression);
case 71:
- return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), expr.escapedText);
+ var identifier = expr;
+ if (isInfinityOrNaNString(identifier.escapedText)) {
+ return +(identifier.escapedText);
+ }
+ return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
+ case 186:
case 185:
- case 184:
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 === 184) {
+ if (ex.kind === 185) {
name = ex.name.escapedText;
}
else {
@@ -40476,8 +40764,8 @@ var ts;
}
function isConstantMemberAccess(node) {
return node.kind === 71 ||
- node.kind === 184 && isConstantMemberAccess(node.expression) ||
- node.kind === 185 && isConstantMemberAccess(node.expression) &&
+ node.kind === 185 && isConstantMemberAccess(node.expression) ||
+ node.kind === 186 && isConstantMemberAccess(node.expression) &&
node.argumentExpression.kind === 9;
}
function checkEnumDeclaration(node) {
@@ -40506,7 +40794,7 @@ var ts;
}
var seenEnumMissingInitialInitializer_1 = false;
ts.forEach(enumSymbol.declarations, function (declaration) {
- if (declaration.kind !== 237) {
+ if (declaration.kind !== 238) {
return false;
}
var enumDeclaration = declaration;
@@ -40527,10 +40815,10 @@ var ts;
}
function getFirstNonAmbientClassOrFunctionDeclaration(symbol) {
var declarations = symbol.declarations;
- for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) {
- var declaration = declarations_7[_i];
- if ((declaration.kind === 234 ||
- (declaration.kind === 233 && ts.nodeIsPresent(declaration.body))) &&
+ for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) {
+ var declaration = declarations_8[_i];
+ if ((declaration.kind === 235 ||
+ (declaration.kind === 234 && ts.nodeIsPresent(declaration.body))) &&
!(declaration.flags & 4194304)) {
return declaration;
}
@@ -40578,7 +40866,7 @@ var ts;
if (symbol.flags & 512
&& symbol.declarations.length > 1
&& !inAmbientContext
- && isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules)) {
+ && isInstantiatedModule(node, !!compilerOptions.preserveConstEnums || !!compilerOptions.isolatedModules)) {
var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol);
if (firstNonAmbientClassOrFunc) {
if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(firstNonAmbientClassOrFunc)) {
@@ -40588,7 +40876,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, 234);
+ var mergedClass = ts.getDeclarationOfKind(symbol, 235);
if (mergedClass &&
inSameLexicalScope(node, mergedClass)) {
getNodeLinks(node).flags |= 32768;
@@ -40631,22 +40919,22 @@ var ts;
}
function checkModuleAugmentationElement(node, isGlobalAugmentation) {
switch (node.kind) {
- case 213:
+ case 214:
for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {
var decl = _a[_i];
checkModuleAugmentationElement(decl, isGlobalAugmentation);
}
break;
- case 248:
case 249:
+ case 250:
grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);
break;
- case 242:
case 243:
+ case 244:
grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);
break;
- case 181:
- case 231:
+ case 182:
+ case 232:
var name = node.name;
if (ts.isBindingPattern(name)) {
for (var _b = 0, _c = name.elements; _b < _c.length; _b++) {
@@ -40655,12 +40943,12 @@ var ts;
}
break;
}
- case 234:
- case 237:
- case 233:
case 235:
case 238:
+ case 234:
case 236:
+ case 239:
+ case 237:
if (isGlobalAugmentation) {
return;
}
@@ -40678,12 +40966,12 @@ var ts;
switch (node.kind) {
case 71:
return node;
- case 145:
+ case 146:
do {
node = node.left;
} while (node.kind !== 71);
return node;
- case 184:
+ case 185:
do {
node = node.expression;
} while (node.kind !== 71);
@@ -40692,16 +40980,16 @@ var ts;
}
function checkExternalImportOrExportDeclaration(node) {
var moduleName = ts.getExternalModuleName(node);
- if (ts.nodeIsMissing(moduleName)) {
+ if (!moduleName || ts.nodeIsMissing(moduleName)) {
return false;
}
if (!ts.isStringLiteral(moduleName)) {
error(moduleName, ts.Diagnostics.String_literal_expected);
return false;
}
- var inAmbientExternalModule = node.parent.kind === 239 && ts.isAmbientModule(node.parent.parent);
- if (node.parent.kind !== 273 && !inAmbientExternalModule) {
- error(moduleName, node.kind === 249 ?
+ var inAmbientExternalModule = node.parent.kind === 240 && ts.isAmbientModule(node.parent.parent);
+ if (node.parent.kind !== 274 && !inAmbientExternalModule) {
+ error(moduleName, node.kind === 250 ?
ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace :
ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);
return false;
@@ -40722,13 +41010,13 @@ var ts;
(symbol.flags & 67901928 ? 67901928 : 0) |
(symbol.flags & 1920 ? 1920 : 0);
if (target.flags & excludedMeanings) {
- var message = node.kind === 251 ?
+ var message = node.kind === 252 ?
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 === 251
+ && node.kind === 252
&& !(target.flags & 67216319)
&& !(node.flags & 4194304)) {
error(node, ts.Diagnostics.Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided);
@@ -40754,7 +41042,7 @@ var ts;
checkImportBinding(importClause);
}
if (importClause.namedBindings) {
- if (importClause.namedBindings.kind === 245) {
+ if (importClause.namedBindings.kind === 246) {
checkImportBinding(importClause.namedBindings);
}
else {
@@ -40777,7 +41065,7 @@ var ts;
if (ts.hasModifier(node, 1)) {
markExportAsReferenced(node);
}
- if (node.moduleReference.kind !== 253) {
+ if (node.moduleReference.kind !== 254) {
var target = resolveAlias(getSymbolOfNode(node));
if (target !== unknownSymbol) {
if (target.flags & 67216319) {
@@ -40808,10 +41096,10 @@ var ts;
if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) {
if (node.exportClause) {
ts.forEach(node.exportClause.elements, checkExportSpecifier);
- var inAmbientExternalModule = node.parent.kind === 239 && ts.isAmbientModule(node.parent.parent);
- var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 239 &&
+ var inAmbientExternalModule = node.parent.kind === 240 && ts.isAmbientModule(node.parent.parent);
+ var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 240 &&
!node.moduleSpecifier && node.flags & 4194304;
- if (node.parent.kind !== 273 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
+ if (node.parent.kind !== 274 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);
}
}
@@ -40827,7 +41115,7 @@ var ts;
}
}
function checkGrammarModuleElementContext(node, errorMessage) {
- var isInAppropriateContext = node.parent.kind === 273 || node.parent.kind === 239 || node.parent.kind === 238;
+ var isInAppropriateContext = node.parent.kind === 274 || node.parent.kind === 240 || node.parent.kind === 239;
if (!isInAppropriateContext) {
grammarErrorOnFirstToken(node, errorMessage);
}
@@ -40853,8 +41141,8 @@ var ts;
if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) {
return;
}
- var container = node.parent.kind === 273 ? node.parent : node.parent.parent;
- if (container.kind === 238 && !ts.isAmbientModule(container)) {
+ var container = node.parent.kind === 274 ? node.parent : node.parent.parent;
+ if (container.kind === 239 && !ts.isAmbientModule(container)) {
if (node.isExportEquals) {
error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace);
}
@@ -40917,8 +41205,8 @@ var ts;
return;
}
if (exportedDeclarationsCount > 1) {
- for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) {
- var declaration = declarations_8[_i];
+ for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) {
+ var declaration = declarations_9[_i];
if (isNotOverload(declaration)) {
diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, ts.unescapeLeadingUnderscores(id)));
}
@@ -40933,165 +41221,165 @@ var ts;
return !ts.isAccessor(declaration);
}
function isNotOverload(declaration) {
- return (declaration.kind !== 233 && declaration.kind !== 153) ||
+ return (declaration.kind !== 234 && declaration.kind !== 154) ||
!!declaration.body;
}
function checkSourceElement(node) {
if (!node) {
return;
}
- if (ts.isInJavaScriptFile(node) && node.jsDoc) {
- for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) {
- var tags = _a[_i].tags;
- ts.forEach(tags, checkSourceElement);
- }
+ if (ts.isInJavaScriptFile(node)) {
+ ts.forEach(node.jsDoc, function (_a) {
+ var tags = _a.tags;
+ return ts.forEach(tags, checkSourceElement);
+ });
}
var kind = node.kind;
if (cancellationToken) {
switch (kind) {
- case 238:
- case 234:
+ case 239:
case 235:
- case 233:
+ case 236:
+ case 234:
cancellationToken.throwIfCancellationRequested();
}
}
switch (kind) {
- case 147:
- return checkTypeParameter(node);
case 148:
+ return checkTypeParameter(node);
+ case 149:
return checkParameter(node);
+ case 152:
case 151:
- case 150:
return checkPropertyDeclaration(node);
- case 162:
case 163:
- case 157:
+ case 164:
case 158:
case 159:
- return checkSignatureDeclaration(node);
- case 153:
- case 152:
- return checkMethodDeclaration(node);
- case 154:
- return checkConstructorDeclaration(node);
- case 155:
- case 156:
- return checkAccessorDeclaration(node);
- case 161:
- return checkTypeReferenceNode(node);
case 160:
+ return checkSignatureDeclaration(node);
+ case 154:
+ case 153:
+ return checkMethodDeclaration(node);
+ case 155:
+ return checkConstructorDeclaration(node);
+ case 156:
+ case 157:
+ return checkAccessorDeclaration(node);
+ case 162:
+ return checkTypeReferenceNode(node);
+ case 161:
return checkTypePredicate(node);
- case 164:
- return checkTypeQuery(node);
case 165:
- return checkTypeLiteral(node);
+ return checkTypeQuery(node);
case 166:
- return checkArrayType(node);
+ return checkTypeLiteral(node);
case 167:
- return checkTupleType(node);
+ return checkArrayType(node);
case 168:
+ return checkTupleType(node);
case 169:
- return checkUnionOrIntersectionType(node);
- case 172:
- return checkSourceElement(node.type);
- case 174:
- return checkTypeOperator(node);
case 170:
- return checkConditionalType(node);
+ return checkUnionOrIntersectionType(node);
+ case 173:
+ return checkSourceElement(node.type);
+ case 175:
+ return checkTypeOperator(node);
case 171:
+ return checkConditionalType(node);
+ case 172:
return checkInferType(node);
- case 178:
+ case 179:
return checkImportType(node);
- case 289:
+ case 290:
return checkJSDocAugmentsTag(node);
- case 296:
- case 291:
- return checkJSDocTypeAliasTag(node);
+ case 297:
case 292:
+ return checkJSDocTypeAliasTag(node);
+ case 293:
return checkJSDocParameterTag(node);
- case 283:
+ case 284:
checkSignatureDeclaration(node);
+ case 282:
case 281:
- case 280:
- case 278:
case 279:
- case 286:
+ case 280:
+ case 287:
checkJSDocTypeIsInJsFile(node);
ts.forEachChild(node, checkSourceElement);
return;
- case 284:
+ case 285:
checkJSDocVariadicType(node);
return;
- case 277:
+ case 278:
return checkSourceElement(node.type);
- case 175:
- return checkIndexedAccessType(node);
case 176:
+ return checkIndexedAccessType(node);
+ case 177:
return checkMappedType(node);
- case 233:
- return checkFunctionDeclaration(node);
- case 212:
- case 239:
- return checkBlock(node);
- case 213:
- return checkVariableStatement(node);
- case 215:
- return checkExpressionStatement(node);
- case 216:
- return checkIfStatement(node);
- case 217:
- return checkDoStatement(node);
- case 218:
- return checkWhileStatement(node);
- case 219:
- return checkForStatement(node);
- case 220:
- return checkForInStatement(node);
- case 221:
- return checkForOfStatement(node);
- case 222:
- case 223:
- return checkBreakOrContinueStatement(node);
- case 224:
- return checkReturnStatement(node);
- case 225:
- return checkWithStatement(node);
- case 226:
- return checkSwitchStatement(node);
- case 227:
- return checkLabeledStatement(node);
- case 228:
- return checkThrowStatement(node);
- case 229:
- return checkTryStatement(node);
- case 231:
- return checkVariableDeclaration(node);
- case 181:
- return checkBindingElement(node);
case 234:
- return checkClassDeclaration(node);
- case 235:
- return checkInterfaceDeclaration(node);
- case 236:
- return checkTypeAliasDeclaration(node);
- case 237:
- return checkEnumDeclaration(node);
- case 238:
- return checkModuleDeclaration(node);
- case 243:
- return checkImportDeclaration(node);
- case 242:
- return checkImportEqualsDeclaration(node);
- case 249:
- return checkExportDeclaration(node);
- case 248:
- return checkExportAssignment(node);
+ return checkFunctionDeclaration(node);
+ case 213:
+ case 240:
+ return checkBlock(node);
case 214:
+ return checkVariableStatement(node);
+ case 216:
+ return checkExpressionStatement(node);
+ case 217:
+ return checkIfStatement(node);
+ case 218:
+ return checkDoStatement(node);
+ case 219:
+ return checkWhileStatement(node);
+ case 220:
+ return checkForStatement(node);
+ case 221:
+ return checkForInStatement(node);
+ case 222:
+ return checkForOfStatement(node);
+ case 223:
+ case 224:
+ return checkBreakOrContinueStatement(node);
+ case 225:
+ return checkReturnStatement(node);
+ case 226:
+ return checkWithStatement(node);
+ case 227:
+ return checkSwitchStatement(node);
+ case 228:
+ return checkLabeledStatement(node);
+ case 229:
+ return checkThrowStatement(node);
case 230:
+ return checkTryStatement(node);
+ case 232:
+ return checkVariableDeclaration(node);
+ case 182:
+ return checkBindingElement(node);
+ case 235:
+ return checkClassDeclaration(node);
+ case 236:
+ return checkInterfaceDeclaration(node);
+ case 237:
+ return checkTypeAliasDeclaration(node);
+ case 238:
+ return checkEnumDeclaration(node);
+ case 239:
+ return checkModuleDeclaration(node);
+ case 244:
+ return checkImportDeclaration(node);
+ case 243:
+ return checkImportEqualsDeclaration(node);
+ case 250:
+ return checkExportDeclaration(node);
+ case 249:
+ return checkExportAssignment(node);
+ case 215:
+ case 231:
checkGrammarStatementInAmbientContext(node);
return;
- case 252:
+ case 253:
return checkMissingDeclaration(node);
}
}
@@ -41113,7 +41401,7 @@ var ts;
if (!ts.isJSDocTypeExpression(parent)) {
error(node, ts.Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature);
}
- var paramTag = parent.parent;
+ var paramTag = node.parent.parent;
if (!ts.isJSDocParameterTag(paramTag)) {
error(node, ts.Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature);
return;
@@ -41130,8 +41418,8 @@ var ts;
function getTypeFromJSDocVariadicType(node) {
var type = getTypeFromTypeNode(node.type);
var parent = node.parent;
- var paramTag = parent.parent;
- if (ts.isJSDocTypeExpression(parent) && ts.isJSDocParameterTag(paramTag)) {
+ var paramTag = node.parent.parent;
+ if (ts.isJSDocTypeExpression(node.parent) && ts.isJSDocParameterTag(paramTag)) {
var host_1 = ts.getHostSignatureFromJSDoc(paramTag);
if (host_1) {
var lastParamDeclaration = ts.lastOrUndefined(host_1.parameters);
@@ -41153,20 +41441,20 @@ var ts;
}
}
function checkDeferredNodes() {
- for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) {
- var node = deferredNodes_1[_i];
+ for (var _i = 0, _a = deferredNodes; _i < _a.length; _i++) {
+ var node = _a[_i];
switch (node.kind) {
- case 191:
case 192:
+ case 193:
+ case 154:
case 153:
- case 152:
checkFunctionExpressionOrObjectLiteralMethodDeferred(node);
break;
- case 155:
case 156:
+ case 157:
checkAccessorDeclaration(node);
break;
- case 204:
+ case 205:
checkClassExpressionDeferred(node);
break;
}
@@ -41181,9 +41469,9 @@ var ts;
function unusedIsError(kind) {
switch (kind) {
case 0:
- return compilerOptions.noUnusedLocals;
+ return !!compilerOptions.noUnusedLocals;
case 1:
- return compilerOptions.noUnusedParameters;
+ return !!compilerOptions.noUnusedParameters;
default:
return ts.Debug.assertNever(kind);
}
@@ -41280,24 +41568,24 @@ var ts;
copySymbols(location.locals, meaning);
}
switch (location.kind) {
- case 238:
+ case 239:
copySymbols(getSymbolOfNode(location).exports, meaning & 2623475);
break;
- case 237:
+ case 238:
copySymbols(getSymbolOfNode(location).exports, meaning & 8);
break;
- case 204:
+ case 205:
var className = location.name;
if (className) {
copySymbol(location.symbol, meaning);
}
- case 234:
case 235:
+ case 236:
if (!isStatic) {
copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 67901928);
}
break;
- case 191:
+ case 192:
var funcName = location.name;
if (funcName) {
copySymbol(location.symbol, meaning);
@@ -41335,27 +41623,27 @@ var ts;
}
function isTypeDeclaration(node) {
switch (node.kind) {
- case 147:
- case 234:
+ case 148:
case 235:
case 236:
case 237:
+ case 238:
return true;
+ default:
+ return false;
}
}
- function isTypeReferenceIdentifier(entityName) {
- var node = entityName;
- while (node.parent && node.parent.kind === 145) {
+ function isTypeReferenceIdentifier(node) {
+ while (node.parent.kind === 146) {
node = node.parent;
}
- return node.parent && node.parent.kind === 161;
+ return node.parent.kind === 162;
}
- function isHeritageClauseElementIdentifier(entityName) {
- var node = entityName;
- while (node.parent && node.parent.kind === 184) {
+ function isHeritageClauseElementIdentifier(node) {
+ while (node.parent.kind === 185) {
node = node.parent;
}
- return node.parent && node.parent.kind === 206;
+ return node.parent.kind === 207;
}
function forEachEnclosingClass(node, callback) {
var result;
@@ -41383,14 +41671,14 @@ var ts;
return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; });
}
function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) {
- while (nodeOnRightSide.parent.kind === 145) {
+ while (nodeOnRightSide.parent.kind === 146) {
nodeOnRightSide = nodeOnRightSide.parent;
}
- if (nodeOnRightSide.parent.kind === 242) {
- return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent;
+ if (nodeOnRightSide.parent.kind === 243) {
+ return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined;
}
- if (nodeOnRightSide.parent.kind === 248) {
- return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent;
+ if (nodeOnRightSide.parent.kind === 249) {
+ return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined;
}
return undefined;
}
@@ -41415,7 +41703,7 @@ var ts;
node = parent;
parent = parent.parent;
}
- if (parent && parent.kind === 178 && parent.qualifier === node) {
+ if (parent && parent.kind === 179 && parent.qualifier === node) {
return parent;
}
return undefined;
@@ -41425,21 +41713,21 @@ var ts;
return getSymbolOfNode(entityName.parent);
}
if (ts.isInJavaScriptFile(entityName) &&
- entityName.parent.kind === 184 &&
+ entityName.parent.kind === 185 &&
entityName.parent === entityName.parent.parent.left) {
var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(entityName);
if (specialPropertyAssignmentSymbol) {
return specialPropertyAssignmentSymbol;
}
}
- if (entityName.parent.kind === 248 && ts.isEntityNameExpression(entityName)) {
+ if (entityName.parent.kind === 249 && ts.isEntityNameExpression(entityName)) {
var success = resolveEntityName(entityName, 67216319 | 67901928 | 1920 | 2097152, true);
if (success && success !== unknownSymbol) {
return success;
}
}
else if (!ts.isPropertyAccessExpression(entityName) && isInRightSideOfImportOrExportAssignment(entityName)) {
- var importEqualsDeclaration = ts.getAncestor(entityName, 242);
+ var importEqualsDeclaration = ts.getAncestor(entityName, 243);
ts.Debug.assert(importEqualsDeclaration !== undefined);
return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, true);
}
@@ -41456,7 +41744,7 @@ var ts;
}
if (isHeritageClauseElementIdentifier(entityName)) {
var meaning = 0;
- if (entityName.parent.kind === 206) {
+ if (entityName.parent.kind === 207) {
meaning = 67901928;
if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) {
meaning |= 67216319;
@@ -41471,10 +41759,10 @@ var ts;
return entityNameSymbol;
}
}
- if (entityName.parent.kind === 292) {
+ if (entityName.parent.kind === 293) {
return ts.getParameterSymbolFromJSDoc(entityName.parent);
}
- if (entityName.parent.kind === 147 && entityName.parent.parent.kind === 295) {
+ if (entityName.parent.kind === 148 && entityName.parent.parent.kind === 296) {
ts.Debug.assert(!ts.isInJavaScriptFile(entityName));
var typeParameter = ts.getTypeParameterFromJsDoc(entityName.parent);
return typeParameter && typeParameter.symbol;
@@ -41490,12 +41778,12 @@ var ts;
}
return resolveEntityName(entityName, 67216319, false, true);
}
- else if (entityName.kind === 184 || entityName.kind === 145) {
+ else if (entityName.kind === 185 || entityName.kind === 146) {
var links = getNodeLinks(entityName);
if (links.resolvedSymbol) {
return links.resolvedSymbol;
}
- if (entityName.kind === 184) {
+ if (entityName.kind === 185) {
checkPropertyAccessExpression(entityName);
}
else {
@@ -41505,38 +41793,40 @@ var ts;
}
}
else if (isTypeReferenceIdentifier(entityName)) {
- var meaning = entityName.parent.kind === 161 ? 67901928 : 1920;
+ var meaning = entityName.parent.kind === 162 ? 67901928 : 1920;
return resolveEntityName(entityName, meaning, false, true);
}
- else if (entityName.parent.kind === 261) {
+ else if (entityName.parent.kind === 262) {
return getJsxAttributePropertySymbol(entityName.parent);
}
- if (entityName.parent.kind === 160) {
+ if (entityName.parent.kind === 161) {
return resolveEntityName(entityName, 1);
}
return undefined;
}
function getSymbolAtLocation(node) {
- if (node.kind === 273) {
+ if (node.kind === 274) {
return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined;
}
+ var parent = node.parent;
+ var grandParent = parent.parent;
if (node.flags & 8388608) {
return undefined;
}
if (isDeclarationNameOrImportPropertyName(node)) {
- return getSymbolOfNode(node.parent);
+ return getSymbolOfNode(parent);
}
else if (ts.isLiteralComputedPropertyDeclarationName(node)) {
- return getSymbolOfNode(node.parent.parent);
+ return getSymbolOfNode(parent.parent);
}
if (node.kind === 71) {
if (isInRightSideOfImportOrExportAssignment(node)) {
return getSymbolOfEntityNameOrPropertyAccessExpression(node);
}
- else if (node.parent.kind === 181 &&
- node.parent.parent.kind === 179 &&
- node === node.parent.propertyName) {
- var typeOfPattern = getTypeOfNode(node.parent.parent);
+ else if (parent.kind === 182 &&
+ grandParent.kind === 180 &&
+ node === parent.propertyName) {
+ var typeOfPattern = getTypeOfNode(grandParent);
var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.escapedText);
if (propertyDeclaration) {
return propertyDeclaration;
@@ -41545,8 +41835,8 @@ var ts;
}
switch (node.kind) {
case 71:
- case 184:
- case 145:
+ case 185:
+ case 146:
return getSymbolOfEntityNameOrPropertyAccessExpression(node);
case 99:
var container = ts.getThisContainer(node, false);
@@ -41559,43 +41849,43 @@ var ts;
if (ts.isInExpressionContext(node)) {
return checkExpression(node).symbol;
}
- case 173:
+ case 174:
return getTypeFromThisTypeNode(node).symbol;
case 97:
return checkExpression(node).symbol;
case 123:
var constructorDeclaration = node.parent;
- if (constructorDeclaration && constructorDeclaration.kind === 154) {
+ if (constructorDeclaration && constructorDeclaration.kind === 155) {
return constructorDeclaration.parent.symbol;
}
return undefined;
case 9:
case 13:
if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) ||
- ((node.parent.kind === 243 || node.parent.kind === 249) && node.parent.moduleSpecifier === node) ||
+ ((node.parent.kind === 244 || node.parent.kind === 250) && node.parent.moduleSpecifier === node) ||
((ts.isInJavaScriptFile(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);
}
case 8:
- var objectType = ts.isElementAccessExpression(node.parent)
- ? node.parent.argumentExpression === node ? getTypeOfExpression(node.parent.expression) : undefined
- : ts.isLiteralTypeNode(node.parent) && ts.isIndexedAccessTypeNode(node.parent.parent)
- ? getTypeFromTypeNode(node.parent.parent.objectType)
+ var objectType = ts.isElementAccessExpression(parent)
+ ? parent.argumentExpression === node ? getTypeOfExpression(parent.expression) : undefined
+ : ts.isLiteralTypeNode(parent) && ts.isIndexedAccessTypeNode(grandParent)
+ ? getTypeFromTypeNode(grandParent.objectType)
: undefined;
return objectType && getPropertyOfType(objectType, ts.escapeLeadingUnderscores(node.text));
case 79:
case 89:
case 36:
return getSymbolOfNode(node.parent);
- case 178:
+ case 179:
return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal) : undefined;
default:
return undefined;
}
}
function getShorthandAssignmentValueSymbol(location) {
- if (location && location.kind === 270) {
+ if (location && location.kind === 271) {
return resolveEntityName(location.name, 67216319 | 2097152);
}
return undefined;
@@ -41607,7 +41897,7 @@ var ts;
}
function getTypeOfNode(node) {
if (node.flags & 8388608) {
- return unknownType;
+ return errorType;
}
if (ts.isPartOfTypeNode(node)) {
var typeFromTypeNode = getTypeFromTypeNode(node);
@@ -41650,29 +41940,29 @@ var ts;
var symbol = getSymbolAtLocation(node);
if (symbol) {
var declaredType = getDeclaredTypeOfSymbol(symbol);
- return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol);
+ return declaredType !== errorType ? declaredType : getTypeOfSymbol(symbol);
}
}
- return unknownType;
+ return errorType;
}
function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) {
- ts.Debug.assert(expr.kind === 183 || expr.kind === 182);
- if (expr.parent.kind === 221) {
+ ts.Debug.assert(expr.kind === 184 || expr.kind === 183);
+ if (expr.parent.kind === 222) {
var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier);
- return checkDestructuringAssignment(expr, iteratedType || unknownType);
+ return checkDestructuringAssignment(expr, iteratedType || errorType);
}
- if (expr.parent.kind === 199) {
+ if (expr.parent.kind === 200) {
var iteratedType = getTypeOfExpression(expr.parent.right);
- return checkDestructuringAssignment(expr, iteratedType || unknownType);
+ return checkDestructuringAssignment(expr, iteratedType || errorType);
}
- if (expr.parent.kind === 269) {
+ if (expr.parent.kind === 270) {
var typeOfParentObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent.parent);
- return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || unknownType, expr.parent);
+ return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || errorType, expr.parent);
}
- ts.Debug.assert(expr.parent.kind === 182);
+ ts.Debug.assert(expr.parent.kind === 183);
var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent);
- var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, false, false) || unknownType;
- return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, expr.parent.elements.indexOf(expr), elementType || unknownType);
+ var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || errorType, expr.parent, false, false) || errorType;
+ return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, expr.parent.elements.indexOf(expr), elementType || errorType);
}
function getPropertySymbolOfDestructuringAssignment(location) {
var typeOfObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(location.parent.parent);
@@ -41729,11 +42019,11 @@ var ts;
}
return target;
}
- function isArgumentsLocalBinding(node) {
- if (!ts.isGeneratedIdentifier(node)) {
- node = ts.getParseTreeNode(node, ts.isIdentifier);
+ function isArgumentsLocalBinding(nodeIn) {
+ if (!ts.isGeneratedIdentifier(nodeIn)) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);
if (node) {
- var isPropertyName_1 = node.parent.kind === 184 && node.parent.name === node;
+ var isPropertyName_1 = node.parent.kind === 185 && node.parent.name === node;
return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol;
}
}
@@ -41759,11 +42049,10 @@ var ts;
}
}
function isNameOfModuleOrEnumDeclaration(node) {
- var parent = node.parent;
- return parent && ts.isModuleOrEnumDeclaration(parent) && node === parent.name;
+ return ts.isModuleOrEnumDeclaration(node.parent) && node === node.parent.name;
}
- function getReferencedExportContainer(node, prefixLocals) {
- node = ts.getParseTreeNode(node, ts.isIdentifier);
+ function getReferencedExportContainer(nodeIn, prefixLocals) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);
if (node) {
var symbol = getReferencedValueSymbol(node, isNameOfModuleOrEnumDeclaration(node));
if (symbol) {
@@ -41776,7 +42065,7 @@ var ts;
}
var parentSymbol_1 = getParentOfSymbol(symbol);
if (parentSymbol_1) {
- if (parentSymbol_1.flags & 512 && parentSymbol_1.valueDeclaration.kind === 273) {
+ if (parentSymbol_1.flags & 512 && parentSymbol_1.valueDeclaration.kind === 274) {
var symbolFile = parentSymbol_1.valueDeclaration;
var referenceFile = ts.getSourceFileOfNode(node);
var symbolIsUmdExport = symbolFile !== referenceFile;
@@ -41787,8 +42076,8 @@ var ts;
}
}
}
- function getReferencedImportDeclaration(node) {
- node = ts.getParseTreeNode(node, ts.isIdentifier);
+ function getReferencedImportDeclaration(nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);
if (node) {
var symbol = getReferencedValueSymbol(node);
if (isNonLocalAlias(symbol, 67216319)) {
@@ -41810,7 +42099,7 @@ var ts;
else if (nodeLinks_1.flags & 131072) {
var isDeclaredInLoop = nodeLinks_1.flags & 262144;
var inLoopInitializer = ts.isIterationStatement(container, false);
- var inLoopBodyBlock = container.kind === 212 && ts.isIterationStatement(container.parent, false);
+ var inLoopBodyBlock = container.kind === 213 && ts.isIterationStatement(container.parent, false);
links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock));
}
else {
@@ -41822,9 +42111,9 @@ var ts;
}
return false;
}
- function getReferencedDeclarationWithCollidingName(node) {
- if (!ts.isGeneratedIdentifier(node)) {
- node = ts.getParseTreeNode(node, ts.isIdentifier);
+ function getReferencedDeclarationWithCollidingName(nodeIn) {
+ if (!ts.isGeneratedIdentifier(nodeIn)) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);
if (node) {
var symbol = getReferencedValueSymbol(node);
if (symbol && isSymbolOfDeclarationWithCollidingName(symbol)) {
@@ -41834,8 +42123,8 @@ var ts;
}
return undefined;
}
- function isDeclarationWithCollidingName(node) {
- node = ts.getParseTreeNode(node, ts.isDeclaration);
+ function isDeclarationWithCollidingName(nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isDeclaration);
if (node) {
var symbol = getSymbolOfNode(node);
if (symbol) {
@@ -41846,16 +42135,16 @@ var ts;
}
function isValueAliasDeclaration(node) {
switch (node.kind) {
- case 242:
- case 244:
+ case 243:
case 245:
- case 247:
- case 251:
- return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol);
- case 249:
- var exportClause = node.exportClause;
- return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration);
+ case 246:
case 248:
+ case 252:
+ return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol);
+ case 250:
+ var exportClause = node.exportClause;
+ return !!exportClause && ts.some(exportClause.elements, isValueAliasDeclaration);
+ case 249:
return node.expression
&& node.expression.kind === 71
? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol)
@@ -41863,9 +42152,9 @@ var ts;
}
return false;
}
- function isTopLevelValueImportEqualsWithEntityName(node) {
- node = ts.getParseTreeNode(node, ts.isImportEqualsDeclaration);
- if (node === undefined || node.parent.kind !== 273 || !ts.isInternalModuleImportEqualsDeclaration(node)) {
+ function isTopLevelValueImportEqualsWithEntityName(nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration);
+ if (node === undefined || node.parent.kind !== 274 || !ts.isInternalModuleImportEqualsDeclaration(node)) {
return false;
}
var isValue = isAliasResolvedToValue(getSymbolOfNode(node));
@@ -41876,11 +42165,11 @@ var ts;
if (target === unknownSymbol) {
return true;
}
- return target.flags & 67216319 &&
+ return !!(target.flags & 67216319) &&
(compilerOptions.preserveConstEnums || !isConstEnumOrConstEnumOnlyModule(target));
}
function isConstEnumOrConstEnumOnlyModule(s) {
- return isConstEnumSymbol(s) || s.constEnumOnlyModule;
+ return isConstEnumSymbol(s) || !!s.constEnumOnlyModule;
}
function isReferencedAliasDeclaration(node, checkChildren) {
if (ts.isAliasSymbolDeclaration(node)) {
@@ -41894,7 +42183,7 @@ var ts;
}
}
if (checkChildren) {
- return ts.forEachChild(node, function (node) { return isReferencedAliasDeclaration(node, checkChildren); });
+ return !!ts.forEachChild(node, function (node) { return isReferencedAliasDeclaration(node, checkChildren); });
}
return false;
}
@@ -41910,10 +42199,10 @@ var ts;
return false;
}
function isRequiredInitializedParameter(parameter) {
- return strictNullChecks &&
+ return !!strictNullChecks &&
!isOptionalParameter(parameter) &&
!ts.isJSDocParameterTag(parameter) &&
- parameter.initializer &&
+ !!parameter.initializer &&
!ts.hasModifier(parameter, 92);
}
function isOptionalUninitializedParameterProperty(parameter) {
@@ -41923,7 +42212,7 @@ var ts;
ts.hasModifier(parameter, 92);
}
function getNodeCheckFlags(node) {
- return getNodeLinks(node).flags;
+ return getNodeLinks(node).flags || 0;
}
function getEnumMemberValue(node) {
computeEnumMemberValues(node.parent);
@@ -41931,15 +42220,15 @@ var ts;
}
function canHaveConstantValue(node) {
switch (node.kind) {
- case 272:
- case 184:
+ case 273:
case 185:
+ case 186:
return true;
}
return false;
}
function getConstantValue(node) {
- if (node.kind === 272) {
+ if (node.kind === 273) {
return getEnumMemberValue(node);
}
var symbol = getNodeLinks(node).resolvedSymbol;
@@ -41951,10 +42240,10 @@ var ts;
return undefined;
}
function isFunctionType(type) {
- return type.flags & 65536 && getSignaturesOfType(type, 0).length > 0;
+ return !!(type.flags & 131072) && getSignaturesOfType(type, 0).length > 0;
}
- function getTypeReferenceSerializationKind(typeName, location) {
- typeName = ts.getParseTreeNode(typeName, ts.isEntityName);
+ function getTypeReferenceSerializationKind(typeNameIn, location) {
+ var typeName = ts.getParseTreeNode(typeNameIn, ts.isEntityName);
if (!typeName)
return ts.TypeReferenceSerializationKind.Unknown;
if (location) {
@@ -41975,31 +42264,31 @@ var ts;
}
}
if (!typeSymbol) {
- return ts.TypeReferenceSerializationKind.ObjectType;
- }
- var type = getDeclaredTypeOfSymbol(typeSymbol);
- if (type === unknownType) {
return ts.TypeReferenceSerializationKind.Unknown;
}
- else if (type.flags & 1) {
+ var type = getDeclaredTypeOfSymbol(typeSymbol);
+ if (type === errorType) {
+ return ts.TypeReferenceSerializationKind.Unknown;
+ }
+ else if (type.flags & 3) {
return ts.TypeReferenceSerializationKind.ObjectType;
}
- else if (isTypeAssignableToKind(type, 2048 | 12288 | 16384)) {
+ else if (isTypeAssignableToKind(type, 4096 | 24576 | 32768)) {
return ts.TypeReferenceSerializationKind.VoidNullableOrNeverType;
}
- else if (isTypeAssignableToKind(type, 136)) {
+ else if (isTypeAssignableToKind(type, 272)) {
return ts.TypeReferenceSerializationKind.BooleanType;
}
- else if (isTypeAssignableToKind(type, 84)) {
+ else if (isTypeAssignableToKind(type, 168)) {
return ts.TypeReferenceSerializationKind.NumberLikeType;
}
- else if (isTypeAssignableToKind(type, 34)) {
+ else if (isTypeAssignableToKind(type, 68)) {
return ts.TypeReferenceSerializationKind.StringLikeType;
}
else if (isTupleType(type)) {
return ts.TypeReferenceSerializationKind.ArrayLikeType;
}
- else if (isTypeAssignableToKind(type, 1536)) {
+ else if (isTypeAssignableToKind(type, 3072)) {
return ts.TypeReferenceSerializationKind.ESSymbolType;
}
else if (isFunctionType(type)) {
@@ -42012,16 +42301,16 @@ var ts;
return ts.TypeReferenceSerializationKind.ObjectType;
}
}
- function createTypeOfDeclaration(declaration, enclosingDeclaration, flags, tracker, addUndefined) {
- declaration = ts.getParseTreeNode(declaration, ts.isVariableLikeOrAccessor);
+ function createTypeOfDeclaration(declarationIn, enclosingDeclaration, flags, tracker, addUndefined) {
+ var declaration = ts.getParseTreeNode(declarationIn, ts.isVariableLikeOrAccessor);
if (!declaration) {
return ts.createToken(119);
}
var symbol = getSymbolOfNode(declaration);
var type = symbol && !(symbol.flags & (2048 | 131072))
? getWidenedLiteralType(getTypeOfSymbol(symbol))
- : unknownType;
- if (type.flags & 1024 &&
+ : errorType;
+ if (type.flags & 2048 &&
type.symbol === symbol) {
flags |= 1048576;
}
@@ -42030,16 +42319,16 @@ var ts;
}
return nodeBuilder.typeToTypeNode(type, enclosingDeclaration, flags | 1024, tracker);
}
- function createReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, tracker) {
- signatureDeclaration = ts.getParseTreeNode(signatureDeclaration, ts.isFunctionLike);
+ function createReturnTypeOfSignatureDeclaration(signatureDeclarationIn, enclosingDeclaration, flags, tracker) {
+ var signatureDeclaration = ts.getParseTreeNode(signatureDeclarationIn, ts.isFunctionLike);
if (!signatureDeclaration) {
return ts.createToken(119);
}
var signature = getSignatureFromDeclaration(signatureDeclaration);
return nodeBuilder.typeToTypeNode(getReturnTypeOfSignature(signature), enclosingDeclaration, flags | 1024, tracker);
}
- function createTypeOfExpression(expr, enclosingDeclaration, flags, tracker) {
- expr = ts.getParseTreeNode(expr, ts.isExpression);
+ function createTypeOfExpression(exprIn, enclosingDeclaration, flags, tracker) {
+ var expr = ts.getParseTreeNode(exprIn, ts.isExpression);
if (!expr) {
return ts.createToken(119);
}
@@ -42063,9 +42352,9 @@ var ts;
}
return resolveName(location, reference.escapedText, 67216319 | 1048576 | 2097152, undefined, undefined, true);
}
- function getReferencedValueDeclaration(reference) {
- if (!ts.isGeneratedIdentifier(reference)) {
- reference = ts.getParseTreeNode(reference, ts.isIdentifier);
+ function getReferencedValueDeclaration(referenceIn) {
+ if (!ts.isGeneratedIdentifier(referenceIn)) {
+ var reference = ts.getParseTreeNode(referenceIn, ts.isIdentifier);
if (reference) {
var symbol = getReferencedValueSymbol(reference);
if (symbol) {
@@ -42078,7 +42367,7 @@ var ts;
function isLiteralConstDeclaration(node) {
if (ts.isConst(node)) {
var type = getTypeOfSymbol(getSymbolOfNode(node));
- return !!(type.flags & 96 && type.flags & 8388608);
+ return !!(type.flags & 192 && type.flags & 33554432);
}
return false;
}
@@ -42118,7 +42407,7 @@ var ts;
},
getNodeCheckFlags: function (node) {
node = ts.getParseTreeNode(node);
- return node ? getNodeCheckFlags(node) : undefined;
+ return node ? getNodeCheckFlags(node) : 0;
},
isTopLevelValueImportEqualsWithEntityName: isTopLevelValueImportEqualsWithEntityName,
isDeclarationVisible: isDeclarationVisible,
@@ -42131,8 +42420,8 @@ var ts;
createLiteralConstValue: createLiteralConstValue,
isSymbolAccessible: isSymbolAccessible,
isEntityNameVisible: isEntityNameVisible,
- getConstantValue: function (node) {
- node = ts.getParseTreeNode(node, canHaveConstantValue);
+ getConstantValue: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, canHaveConstantValue);
return node ? getConstantValue(node) : undefined;
},
collectLinkedAliases: collectLinkedAliases,
@@ -42145,20 +42434,20 @@ var ts;
getTypeReferenceDirectivesForEntityName: getTypeReferenceDirectivesForEntityName,
getTypeReferenceDirectivesForSymbol: getTypeReferenceDirectivesForSymbol,
isLiteralConstDeclaration: isLiteralConstDeclaration,
- isLateBound: function (node) {
- node = ts.getParseTreeNode(node, ts.isDeclaration);
+ isLateBound: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isDeclaration);
var symbol = node && getSymbolOfNode(node);
return !!(symbol && ts.getCheckFlags(symbol) & 1024);
},
getJsxFactoryEntity: function (location) { return location ? (getJsxNamespace(location), (ts.getSourceFileOfNode(location).localJsxFactory || _jsxFactoryEntity)) : _jsxFactoryEntity; },
getAllAccessorDeclarations: function (accessor) {
accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration);
- var otherKind = accessor.kind === 156 ? 155 : 156;
+ var otherKind = accessor.kind === 157 ? 156 : 157;
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 === 156 ? accessor : otherAccessor;
- var getAccessor = accessor.kind === 155 ? accessor : otherAccessor;
+ var setAccessor = accessor.kind === 157 ? accessor : otherAccessor;
+ var getAccessor = accessor.kind === 156 ? accessor : otherAccessor;
return {
firstAccessor: firstAccessor,
secondAccessor: secondAccessor,
@@ -42168,14 +42457,14 @@ var ts;
}
};
function isInHeritageClause(node) {
- return node.parent && node.parent.kind === 206 && node.parent.parent && node.parent.parent.kind === 267;
+ return node.parent && node.parent.kind === 207 && node.parent.parent && node.parent.parent.kind === 268;
}
function getTypeReferenceDirectivesForEntityName(node) {
if (!fileToDirective) {
return undefined;
}
var meaning = 67901928 | 1920;
- if ((node.kind === 71 && isInTypeQuery(node)) || (node.kind === 184 && !isInHeritageClause(node))) {
+ if ((node.kind === 71 && isInTypeQuery(node)) || (node.kind === 185 && !isInHeritageClause(node))) {
meaning = 67216319 | 1048576;
}
var symbol = resolveEntityName(node, meaning, true);
@@ -42218,7 +42507,7 @@ var ts;
break;
}
}
- if (current.valueDeclaration && current.valueDeclaration.kind === 273 && current.flags & 512) {
+ if (current.valueDeclaration && current.valueDeclaration.kind === 274 && current.flags & 512) {
return false;
}
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
@@ -42232,12 +42521,12 @@ var ts;
}
}
function getExternalModuleFileFromDeclaration(declaration) {
- var specifier = declaration.kind === 238 ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration);
+ var specifier = declaration.kind === 239 ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration);
var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, undefined);
if (!moduleSymbol) {
return undefined;
}
- return ts.getDeclarationOfKind(moduleSymbol, 273);
+ return ts.getDeclarationOfKind(moduleSymbol, 274);
}
function initializeTypeChecker() {
for (var _i = 0, _a = host.getSourceFiles(); _i < _a.length; _i++) {
@@ -42279,7 +42568,7 @@ var ts;
addToSymbolTable(globals, builtinGlobals, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0);
getSymbolLinks(undefinedSymbol).type = undefinedWideningType;
getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments", 0, true);
- getSymbolLinks(unknownSymbol).type = unknownType;
+ getSymbolLinks(unknownSymbol).type = errorType;
globalArrayType = getGlobalType("Array", 1, true);
globalObjectType = getGlobalType("Object", 0, true);
globalFunctionType = getGlobalType("Function", 0, true);
@@ -42347,7 +42636,7 @@ var ts;
case 16384: return "__asyncValues";
case 32768: return "__exportStar";
case 65536: return "__makeTemplateObject";
- default: ts.Debug.fail("Unrecognized helper");
+ default: return ts.Debug.fail("Unrecognized helper");
}
}
function resolveHelpersModule(node, errorNode) {
@@ -42364,14 +42653,14 @@ var ts;
return false;
}
if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) {
- if (node.kind === 153 && !ts.nodeIsPresent(node.body)) {
+ if (node.kind === 154 && !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 === 155 || node.kind === 156) {
+ else if (node.kind === 156 || node.kind === 157) {
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);
@@ -42389,16 +42678,16 @@ var ts;
for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) {
var modifier = _a[_i];
if (modifier.kind !== 132) {
- if (node.kind === 150 || node.kind === 152) {
+ if (node.kind === 151 || node.kind === 153) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind));
}
- if (node.kind === 159) {
+ if (node.kind === 160) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind));
}
}
switch (modifier.kind) {
case 76:
- if (node.kind !== 237 && node.parent.kind === 234) {
+ if (node.kind !== 238 && node.parent.kind === 235) {
return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(76));
}
break;
@@ -42418,7 +42707,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 === 239 || node.parent.kind === 273) {
+ else if (node.parent.kind === 240 || node.parent.kind === 274) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text);
}
else if (flags & 128) {
@@ -42441,10 +42730,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 === 239 || node.parent.kind === 273) {
+ else if (node.parent.kind === 240 || node.parent.kind === 274) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static");
}
- else if (node.kind === 148) {
+ else if (node.kind === 149) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static");
}
else if (flags & 128) {
@@ -42457,7 +42746,7 @@ var ts;
if (flags & 64) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly");
}
- else if (node.kind !== 151 && node.kind !== 150 && node.kind !== 159 && node.kind !== 148) {
+ else if (node.kind !== 152 && node.kind !== 151 && node.kind !== 160 && node.kind !== 149) {
return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
}
flags |= 64;
@@ -42476,17 +42765,17 @@ var ts;
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async");
}
- else if (node.parent.kind === 234) {
+ else if (node.parent.kind === 235) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export");
}
- else if (node.kind === 148) {
+ else if (node.kind === 149) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export");
}
flags |= 1;
break;
case 79:
- var container = node.parent.kind === 273 ? node.parent : node.parent.parent;
- if (container.kind === 238 && !ts.isAmbientModule(container)) {
+ var container = node.parent.kind === 274 ? node.parent : node.parent.parent;
+ if (container.kind === 239 && !ts.isAmbientModule(container)) {
return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);
}
flags |= 512;
@@ -42498,13 +42787,13 @@ var ts;
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
}
- else if (node.parent.kind === 234) {
+ else if (node.parent.kind === 235) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare");
}
- else if (node.kind === 148) {
+ else if (node.kind === 149) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare");
}
- else if ((node.parent.flags & 4194304) && node.parent.kind === 239) {
+ else if ((node.parent.flags & 4194304) && node.parent.kind === 240) {
return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
}
flags |= 2;
@@ -42514,14 +42803,14 @@ var ts;
if (flags & 128) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract");
}
- if (node.kind !== 234) {
- if (node.kind !== 153 &&
- node.kind !== 151 &&
- node.kind !== 155 &&
- node.kind !== 156) {
+ if (node.kind !== 235) {
+ if (node.kind !== 154 &&
+ node.kind !== 152 &&
+ node.kind !== 156 &&
+ node.kind !== 157) {
return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
}
- if (!(node.parent.kind === 234 && ts.hasModifier(node.parent, 128))) {
+ if (!(node.parent.kind === 235 && ts.hasModifier(node.parent, 128))) {
return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class);
}
if (flags & 32) {
@@ -42540,7 +42829,7 @@ var ts;
else if (flags & 2 || node.parent.flags & 4194304) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
}
- else if (node.kind === 148) {
+ else if (node.kind === 149) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async");
}
flags |= 256;
@@ -42548,7 +42837,7 @@ var ts;
break;
}
}
- if (node.kind === 154) {
+ if (node.kind === 155) {
if (flags & 32) {
return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static");
}
@@ -42561,20 +42850,21 @@ var ts;
else if (flags & 64) {
return grammarErrorOnNode(lastReadonly, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "readonly");
}
- return;
+ return false;
}
- else if ((node.kind === 243 || node.kind === 242) && flags & 2) {
+ else if ((node.kind === 244 || node.kind === 243) && flags & 2) {
return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare");
}
- else if (node.kind === 148 && (flags & 92) && ts.isBindingPattern(node.name)) {
+ else if (node.kind === 149 && (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 === 148 && (flags & 92) && node.dotDotDotToken) {
+ else if (node.kind === 149 && (flags & 92) && node.dotDotDotToken) {
return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter);
}
if (flags & 256) {
return checkGrammarAsyncModifier(node, lastAsync);
}
+ return false;
}
function reportObviousModifierErrors(node) {
return !node.modifiers
@@ -42585,37 +42875,37 @@ var ts;
}
function shouldReportBadModifier(node) {
switch (node.kind) {
- case 155:
case 156:
- case 154:
- case 151:
- case 150:
- case 153:
+ case 157:
+ case 155:
case 152:
- case 159:
- case 238:
+ case 151:
+ case 154:
+ case 153:
+ case 160:
+ case 239:
+ case 244:
case 243:
- case 242:
+ case 250:
case 249:
- case 248:
- case 191:
case 192:
- case 148:
+ case 193:
+ case 149:
return false;
default:
- if (node.parent.kind === 239 || node.parent.kind === 273) {
+ if (node.parent.kind === 240 || node.parent.kind === 274) {
return false;
}
switch (node.kind) {
- case 233:
- return nodeHasAnyModifiersExcept(node, 120);
case 234:
- return nodeHasAnyModifiersExcept(node, 117);
+ return nodeHasAnyModifiersExcept(node, 120);
case 235:
- case 213:
+ return nodeHasAnyModifiersExcept(node, 117);
case 236:
- return true;
+ case 214:
case 237:
+ return true;
+ case 238:
return nodeHasAnyModifiersExcept(node, 76);
default:
ts.Debug.fail();
@@ -42628,10 +42918,10 @@ var ts;
}
function checkGrammarAsyncModifier(node, asyncModifier) {
switch (node.kind) {
- case 153:
- case 233:
- case 191:
+ case 154:
+ case 234:
case 192:
+ case 193:
return false;
}
return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async");
@@ -42641,6 +42931,7 @@ var ts;
if (list && list.hasTrailingComma) {
return grammarErrorAtPos(list[0], list.end - ",".length, ",".length, diag);
}
+ return false;
}
function checkGrammarTypeParameterList(typeParameters, file) {
if (typeParameters && typeParameters.length === 0) {
@@ -42648,6 +42939,7 @@ var ts;
var end = ts.skipTrivia(file.text, typeParameters.end) + ">".length;
return grammarErrorAtPos(file, start, end - start, ts.Diagnostics.Type_parameter_list_cannot_be_empty);
}
+ return false;
}
function checkGrammarParameterList(parameters) {
var seenOptionalParameter = false;
@@ -42727,10 +43019,10 @@ var ts;
}
if (parameter.type.kind !== 137 && parameter.type.kind !== 134) {
var type = getTypeFromTypeNode(parameter.type);
- if (type.flags & 2 || type.flags & 4) {
+ 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(getTypeFromTypeNode(node.type)));
}
- if (type.flags & 131072 && allTypesAssignableToKind(type, 32, true)) {
+ if (type.flags & 262144 && allTypesAssignableToKind(type, 64, true)) {
return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead);
}
return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number);
@@ -42738,6 +43030,7 @@ var ts;
if (!node.type) {
return grammarErrorOnNode(node, ts.Diagnostics.An_index_signature_must_have_a_type_annotation);
}
+ return false;
}
function checkGrammarIndexSignature(node) {
return checkGrammarDecoratorsAndModifiers(node) || checkGrammarIndexSignatureParameters(node);
@@ -42749,6 +43042,7 @@ var ts;
var end = ts.skipTrivia(sourceFile.text, typeArguments.end) + ">".length;
return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Type_argument_list_cannot_be_empty);
}
+ return false;
}
function checkGrammarTypeArguments(node, typeArguments) {
return checkGrammarForDisallowedTrailingComma(typeArguments) ||
@@ -42758,11 +43052,12 @@ var ts;
if (args) {
for (var _i = 0, args_5 = args; _i < args_5.length; _i++) {
var arg = args_5[_i];
- if (arg.kind === 205) {
+ if (arg.kind === 206) {
return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
}
}
}
+ return false;
}
function checkGrammarArguments(args) {
return checkGrammarForOmittedArgument(args);
@@ -42776,7 +43071,7 @@ var ts;
var listType = ts.tokenToString(node.token);
return grammarErrorAtPos(node, types.pos, 0, ts.Diagnostics._0_list_cannot_be_empty, listType);
}
- return ts.forEach(types, checkGrammarExpressionWithTypeArguments);
+ return ts.some(types, checkGrammarExpressionWithTypeArguments);
}
function checkGrammarExpressionWithTypeArguments(node) {
return checkGrammarTypeArguments(node, node.typeArguments);
@@ -42831,19 +43126,20 @@ var ts;
return false;
}
function checkGrammarComputedPropertyName(node) {
- if (node.kind !== 146) {
+ if (node.kind !== 147) {
return false;
}
var computedPropertyName = node;
- if (computedPropertyName.expression.kind === 199 && computedPropertyName.expression.operatorToken.kind === 26) {
+ if (computedPropertyName.expression.kind === 200 && computedPropertyName.expression.operatorToken.kind === 26) {
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 === 233 ||
- node.kind === 191 ||
- node.kind === 153);
+ ts.Debug.assert(node.kind === 234 ||
+ node.kind === 192 ||
+ node.kind === 154);
if (node.flags & 4194304) {
return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context);
}
@@ -42853,51 +43149,49 @@ var ts;
}
}
function checkGrammarForInvalidQuestionMark(questionToken, message) {
- if (questionToken) {
- return grammarErrorOnNode(questionToken, message);
- }
+ return !!questionToken && grammarErrorOnNode(questionToken, message);
}
function checkGrammarObjectLiteralExpression(node, inDestructuring) {
var seen = ts.createUnderscoreEscapedMap();
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var prop = _a[_i];
- if (prop.kind === 271) {
+ if (prop.kind === 272) {
continue;
}
var name = prop.name;
- if (name.kind === 146) {
+ if (name.kind === 147) {
checkGrammarComputedPropertyName(name);
}
- if (prop.kind === 270 && !inDestructuring && prop.objectAssignmentInitializer) {
+ if (prop.kind === 271 && !inDestructuring && prop.objectAssignmentInitializer) {
return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment);
}
if (prop.modifiers) {
for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) {
var mod = _c[_b];
- if (mod.kind !== 120 || prop.kind !== 153) {
+ if (mod.kind !== 120 || prop.kind !== 154) {
grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod));
}
}
}
var currentKind = void 0;
switch (prop.kind) {
- case 269:
case 270:
+ case 271:
checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional);
if (name.kind === 8) {
checkGrammarNumericLiteral(name);
}
- case 153:
+ case 154:
currentKind = 1;
break;
- case 155:
+ case 156:
currentKind = 2;
break;
- case 156:
+ case 157:
currentKind = 4;
break;
default:
- ts.Debug.assertNever(prop, "Unexpected syntax kind:" + prop.kind);
+ throw ts.Debug.assertNever(prop, "Unexpected syntax kind:" + prop.kind);
}
var effectiveName = ts.getPropertyNameForPropertyNameNode(name);
if (effectiveName === undefined) {
@@ -42930,7 +43224,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 === 263) {
+ if (attr.kind === 264) {
continue;
}
var name = attr.name, initializer = attr.initializer;
@@ -42940,7 +43234,7 @@ var ts;
else {
return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name);
}
- if (initializer && initializer.kind === 264 && !initializer.expression) {
+ if (initializer && initializer.kind === 265 && !initializer.expression) {
return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression);
}
}
@@ -42949,12 +43243,12 @@ var ts;
if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) {
return true;
}
- if (forInOrOfStatement.kind === 221 && forInOrOfStatement.awaitModifier) {
+ if (forInOrOfStatement.kind === 222 && forInOrOfStatement.awaitModifier) {
if ((forInOrOfStatement.flags & 16384) === 0) {
return grammarErrorOnNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator);
}
}
- if (forInOrOfStatement.initializer.kind === 232) {
+ if (forInOrOfStatement.initializer.kind === 233) {
var variableList = forInOrOfStatement.initializer;
if (!checkGrammarVariableDeclarationList(variableList)) {
var declarations = variableList.declarations;
@@ -42962,20 +43256,20 @@ var ts;
return false;
}
if (declarations.length > 1) {
- var diagnostic = forInOrOfStatement.kind === 220
+ var diagnostic = forInOrOfStatement.kind === 221
? 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 === 220
+ var diagnostic = forInOrOfStatement.kind === 221
? 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 === 220
+ var diagnostic = forInOrOfStatement.kind === 221
? 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);
@@ -43002,11 +43296,11 @@ var ts;
return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters);
}
else if (!doesAccessorHaveCorrectParameterCount(accessor)) {
- return grammarErrorOnNode(accessor.name, kind === 155 ?
+ return grammarErrorOnNode(accessor.name, kind === 156 ?
ts.Diagnostics.A_get_accessor_cannot_have_parameters :
ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter);
}
- else if (kind === 156) {
+ else if (kind === 157) {
if (accessor.type) {
return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation);
}
@@ -43023,12 +43317,13 @@ var ts;
}
}
}
+ return false;
}
function doesAccessorHaveCorrectParameterCount(accessor) {
- return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 155 ? 0 : 1);
+ return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 156 ? 0 : 1);
}
function getAccessorThisParameter(accessor) {
- if (accessor.parameters.length === (accessor.kind === 155 ? 1 : 2)) {
+ if (accessor.parameters.length === (accessor.kind === 156 ? 1 : 2)) {
return ts.getThisParameter(accessor);
}
}
@@ -43039,7 +43334,7 @@ var ts;
}
var parent = ts.walkUpParenthesizedTypes(node.parent);
switch (parent.kind) {
- case 231:
+ case 232:
var decl = parent;
if (decl.name.kind !== 71) {
return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name);
@@ -43051,13 +43346,13 @@ var ts;
return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const);
}
break;
- case 151:
+ case 152:
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 150:
+ case 151:
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);
}
@@ -43076,8 +43371,8 @@ var ts;
if (checkGrammarFunctionLikeDeclaration(node)) {
return true;
}
- if (node.kind === 153) {
- if (node.parent.kind === 183) {
+ if (node.kind === 154) {
+ if (node.parent.kind === 184) {
if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 120)) {
return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here);
}
@@ -43096,14 +43391,14 @@ var ts;
if (node.flags & 4194304) {
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 === 153 && !node.body) {
+ else if (node.kind === 154 && !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 === 235) {
+ else if (node.parent.kind === 236) {
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 === 165) {
+ else if (node.parent.kind === 166) {
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);
}
}
@@ -43114,9 +43409,9 @@ var ts;
return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary);
}
switch (current.kind) {
- case 227:
+ case 228:
if (node.label && current.label.escapedText === node.label.escapedText) {
- var isMisplacedContinueLabel = node.kind === 222
+ var isMisplacedContinueLabel = node.kind === 223
&& !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);
@@ -43124,8 +43419,8 @@ var ts;
return false;
}
break;
- case 226:
- if (node.kind === 223 && !node.label) {
+ case 227:
+ if (node.kind === 224 && !node.label) {
return false;
}
break;
@@ -43138,13 +43433,13 @@ var ts;
current = current.parent;
}
if (node.label) {
- var message = node.kind === 223
+ var message = node.kind === 224
? 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 === 223
+ var message = node.kind === 224
? 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);
@@ -43157,7 +43452,7 @@ var ts;
return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);
}
checkGrammarForDisallowedTrailingComma(elements, ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma);
- if (node.name.kind === 180 || node.name.kind === 179) {
+ if (node.name.kind === 181 || node.name.kind === 180) {
return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern);
}
if (node.propertyName) {
@@ -43170,11 +43465,11 @@ var ts;
}
function isStringOrNumberLiteralExpression(expr) {
return expr.kind === 9 || expr.kind === 8 ||
- expr.kind === 197 && expr.operator === 38 &&
+ expr.kind === 198 && expr.operator === 38 &&
expr.operand.kind === 8;
}
function checkGrammarVariableDeclaration(node) {
- if (node.parent.parent.kind !== 220 && node.parent.parent.kind !== 221) {
+ if (node.parent.parent.kind !== 221 && node.parent.parent.kind !== 222) {
if (node.flags & 4194304) {
if (node.initializer) {
if (ts.isConst(node) && !node.type) {
@@ -43201,7 +43496,7 @@ var ts;
}
}
}
- if (node.exclamationToken && (node.parent.parent.kind !== 213 || !node.type || node.initializer || node.flags & 4194304)) {
+ if (node.exclamationToken && (node.parent.parent.kind !== 214 || !node.type || node.initializer || node.flags & 4194304)) {
return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context);
}
if (compilerOptions.module !== ts.ModuleKind.ES2015 && compilerOptions.module !== ts.ModuleKind.ESNext && compilerOptions.module !== ts.ModuleKind.System && !compilerOptions.noEmit &&
@@ -43226,6 +43521,7 @@ var ts;
}
}
}
+ return false;
}
function checkGrammarNameInLetOrConstDeclarations(name) {
if (name.kind === 71) {
@@ -43242,6 +43538,7 @@ var ts;
}
}
}
+ return false;
}
function checkGrammarVariableDeclarationList(declarationList) {
var declarations = declarationList.declarations;
@@ -43251,18 +43548,19 @@ var ts;
if (!declarationList.declarations.length) {
return grammarErrorAtPos(declarationList, declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.Variable_declaration_list_cannot_be_empty);
}
+ return false;
}
function allowLetAndConstDeclarations(parent) {
switch (parent.kind) {
- case 216:
case 217:
case 218:
- case 225:
case 219:
+ case 226:
case 220:
case 221:
+ case 222:
return false;
- case 227:
+ case 228:
return allowLetAndConstDeclarations(parent.parent);
}
return true;
@@ -43302,6 +43600,7 @@ var ts;
diagnostics.add(ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2));
return true;
}
+ return false;
}
function grammarErrorAtPos(nodeForSourceFile, start, length, message, arg0, arg1, arg2) {
var sourceFile = ts.getSourceFileOfNode(nodeForSourceFile);
@@ -43309,6 +43608,7 @@ var ts;
diagnostics.add(ts.createFileDiagnostic(sourceFile, start, length, message, arg0, arg1, arg2));
return true;
}
+ return false;
}
function grammarErrorOnNode(node, message, arg0, arg1, arg2) {
var sourceFile = ts.getSourceFileOfNode(node);
@@ -43316,11 +43616,12 @@ var ts;
diagnostics.add(ts.createDiagnosticForNode(node, message, arg0, arg1, arg2));
return true;
}
+ return false;
}
function checkGrammarConstructorTypeParameters(node) {
- var typeParameters = ts.getEffectiveTypeParameterDeclarations(node);
- if (ts.isNodeArray(typeParameters)) {
- var pos = typeParameters.pos, end = typeParameters.end;
+ var jsdocTypeParameters = ts.isInJavaScriptFile(node) && ts.getJSDocTypeParameterDeclarations(node);
+ if (node.typeParameters || jsdocTypeParameters && jsdocTypeParameters.length) {
+ var _a = node.typeParameters || jsdocTypeParameters && jsdocTypeParameters[0] || node, pos = _a.pos, end = _a.end;
return grammarErrorAtPos(node, pos, end - pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration);
}
}
@@ -43336,7 +43637,7 @@ var ts;
return true;
}
}
- else if (node.parent.kind === 235) {
+ else if (node.parent.kind === 236) {
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;
}
@@ -43344,7 +43645,7 @@ var ts;
return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer);
}
}
- else if (node.parent.kind === 165) {
+ else if (node.parent.kind === 166) {
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;
}
@@ -43361,13 +43662,13 @@ var ts;
}
}
function checkGrammarTopLevelElementForRequiredDeclareModifier(node) {
- if (node.kind === 235 ||
- node.kind === 236 ||
+ if (node.kind === 236 ||
+ node.kind === 237 ||
+ node.kind === 244 ||
node.kind === 243 ||
- node.kind === 242 ||
+ node.kind === 250 ||
node.kind === 249 ||
- node.kind === 248 ||
- node.kind === 241 ||
+ node.kind === 242 ||
ts.hasModifier(node, 2 | 1 | 512)) {
return false;
}
@@ -43376,12 +43677,13 @@ 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 === 213) {
+ if (ts.isDeclaration(decl) || decl.kind === 214) {
if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) {
return true;
}
}
}
+ return false;
}
function checkGrammarSourceFile(node) {
return !!(node.flags & 4194304) && checkGrammarTopLevelElementsForRequiredDeclareModifier(node);
@@ -43395,7 +43697,7 @@ var ts;
if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) {
return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);
}
- if (node.parent.kind === 212 || node.parent.kind === 239 || node.parent.kind === 273) {
+ if (node.parent.kind === 213 || node.parent.kind === 240 || node.parent.kind === 274) {
var links_1 = getNodeLinks(node.parent);
if (!links_1.hasReportedStatementInAmbientContext) {
return links_1.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts);
@@ -43404,6 +43706,7 @@ var ts;
else {
}
}
+ return false;
}
function checkGrammarNumericLiteral(node) {
if (node.numericLiteralFlags & 32) {
@@ -43411,10 +43714,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, 177)) {
+ else if (ts.isChildOfNodeWithKind(node, 178)) {
diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0;
}
- else if (ts.isChildOfNodeWithKind(node, 272)) {
+ else if (ts.isChildOfNodeWithKind(node, 273)) {
diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0;
}
if (diagnosticMessage) {
@@ -43423,6 +43726,7 @@ var ts;
return grammarErrorOnNode(withMinus ? node.parent : node, diagnosticMessage, literal);
}
}
+ return false;
}
function grammarErrorAfterFirstToken(node, message, arg0, arg1, arg2) {
var sourceFile = ts.getSourceFileOfNode(node);
@@ -43431,6 +43735,7 @@ var ts;
diagnostics.add(ts.createFileDiagnostic(sourceFile, ts.textSpanEnd(span), 0, message, arg0, arg1, arg2));
return true;
}
+ return false;
}
function getAmbientModules() {
if (!ambientModulesCache) {
@@ -43457,13 +43762,14 @@ var ts;
if (ts.isSpreadElement(nodeArguments[0])) {
return grammarErrorOnNode(nodeArguments[0], ts.Diagnostics.Specifier_of_dynamic_import_cannot_be_spread_element);
}
+ return false;
}
}
ts.createTypeChecker = createTypeChecker;
function isDeclarationNameOrImportPropertyName(name) {
switch (name.parent.kind) {
- case 247:
- case 251:
+ case 248:
+ case 252:
return ts.isIdentifier(name);
default:
return ts.isDeclarationName(name);
@@ -43471,13 +43777,13 @@ var ts;
}
function isSomeImportDeclaration(decl) {
switch (decl.kind) {
- case 244:
- case 242:
case 245:
- case 247:
+ case 243:
+ case 246:
+ case 248:
return true;
case 71:
- return decl.parent.kind === 247;
+ return decl.parent.kind === 248;
default:
return false;
}
@@ -43526,7 +43832,7 @@ var ts;
ts.createNodeArray = createNodeArray;
function getSynthesizedClone(node) {
if (node === undefined) {
- return undefined;
+ return node;
}
var clone = createSynthesizedNode(node.kind);
clone.flags |= node.flags;
@@ -43719,7 +44025,7 @@ var ts;
}
ts.createModifiersFromModifierFlags = createModifiersFromModifierFlags;
function createQualifiedName(left, right) {
- var node = createSynthesizedNode(145);
+ var node = createSynthesizedNode(146);
node.left = left;
node.right = asName(right);
return node;
@@ -43734,12 +44040,12 @@ var ts;
ts.updateQualifiedName = updateQualifiedName;
function parenthesizeForComputedName(expression) {
return (ts.isBinaryExpression(expression) && expression.operatorToken.kind === 26) ||
- expression.kind === 301 ?
+ expression.kind === 302 ?
createParen(expression) :
expression;
}
function createComputedPropertyName(expression) {
- var node = createSynthesizedNode(146);
+ var node = createSynthesizedNode(147);
node.expression = parenthesizeForComputedName(expression);
return node;
}
@@ -43751,7 +44057,7 @@ var ts;
}
ts.updateComputedPropertyName = updateComputedPropertyName;
function createTypeParameterDeclaration(name, constraint, defaultType) {
- var node = createSynthesizedNode(147);
+ var node = createSynthesizedNode(148);
node.name = asName(name);
node.constraint = constraint;
node.default = defaultType;
@@ -43767,7 +44073,7 @@ var ts;
}
ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration;
function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) {
- var node = createSynthesizedNode(148);
+ var node = createSynthesizedNode(149);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.dotDotDotToken = dotDotDotToken;
@@ -43791,7 +44097,7 @@ var ts;
}
ts.updateParameter = updateParameter;
function createDecorator(expression) {
- var node = createSynthesizedNode(149);
+ var node = createSynthesizedNode(150);
node.expression = ts.parenthesizeForAccess(expression);
return node;
}
@@ -43803,7 +44109,7 @@ var ts;
}
ts.updateDecorator = updateDecorator;
function createPropertySignature(modifiers, name, questionToken, type, initializer) {
- var node = createSynthesizedNode(150);
+ var node = createSynthesizedNode(151);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
node.questionToken = questionToken;
@@ -43823,7 +44129,7 @@ var ts;
}
ts.updatePropertySignature = updatePropertySignature;
function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) {
- var node = createSynthesizedNode(151);
+ var node = createSynthesizedNode(152);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -43847,7 +44153,7 @@ var ts;
}
ts.updateProperty = updateProperty;
function createMethodSignature(typeParameters, parameters, type, name, questionToken) {
- var node = createSignatureDeclaration(152, typeParameters, parameters, type);
+ var node = createSignatureDeclaration(153, typeParameters, parameters, type);
node.name = asName(name);
node.questionToken = questionToken;
return node;
@@ -43864,7 +44170,7 @@ var ts;
}
ts.updateMethodSignature = updateMethodSignature;
function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) {
- var node = createSynthesizedNode(153);
+ var node = createSynthesizedNode(154);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.asteriskToken = asteriskToken;
@@ -43892,7 +44198,7 @@ var ts;
}
ts.updateMethod = updateMethod;
function createConstructor(decorators, modifiers, parameters, body) {
- var node = createSynthesizedNode(154);
+ var node = createSynthesizedNode(155);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.typeParameters = undefined;
@@ -43912,7 +44218,7 @@ var ts;
}
ts.updateConstructor = updateConstructor;
function createGetAccessor(decorators, modifiers, name, parameters, type, body) {
- var node = createSynthesizedNode(155);
+ var node = createSynthesizedNode(156);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -43935,7 +44241,7 @@ var ts;
}
ts.updateGetAccessor = updateGetAccessor;
function createSetAccessor(decorators, modifiers, name, parameters, body) {
- var node = createSynthesizedNode(156);
+ var node = createSynthesizedNode(157);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -43956,7 +44262,7 @@ var ts;
}
ts.updateSetAccessor = updateSetAccessor;
function createCallSignature(typeParameters, parameters, type) {
- return createSignatureDeclaration(157, typeParameters, parameters, type);
+ return createSignatureDeclaration(158, typeParameters, parameters, type);
}
ts.createCallSignature = createCallSignature;
function updateCallSignature(node, typeParameters, parameters, type) {
@@ -43964,7 +44270,7 @@ var ts;
}
ts.updateCallSignature = updateCallSignature;
function createConstructSignature(typeParameters, parameters, type) {
- return createSignatureDeclaration(158, typeParameters, parameters, type);
+ return createSignatureDeclaration(159, typeParameters, parameters, type);
}
ts.createConstructSignature = createConstructSignature;
function updateConstructSignature(node, typeParameters, parameters, type) {
@@ -43972,7 +44278,7 @@ var ts;
}
ts.updateConstructSignature = updateConstructSignature;
function createIndexSignature(decorators, modifiers, parameters, type) {
- var node = createSynthesizedNode(159);
+ var node = createSynthesizedNode(160);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.parameters = createNodeArray(parameters);
@@ -44010,7 +44316,7 @@ var ts;
}
ts.createKeywordTypeNode = createKeywordTypeNode;
function createTypePredicateNode(parameterName, type) {
- var node = createSynthesizedNode(160);
+ var node = createSynthesizedNode(161);
node.parameterName = asName(parameterName);
node.type = type;
return node;
@@ -44024,7 +44330,7 @@ var ts;
}
ts.updateTypePredicateNode = updateTypePredicateNode;
function createTypeReferenceNode(typeName, typeArguments) {
- var node = createSynthesizedNode(161);
+ var node = createSynthesizedNode(162);
node.typeName = asName(typeName);
node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments);
return node;
@@ -44038,7 +44344,7 @@ var ts;
}
ts.updateTypeReferenceNode = updateTypeReferenceNode;
function createFunctionTypeNode(typeParameters, parameters, type) {
- return createSignatureDeclaration(162, typeParameters, parameters, type);
+ return createSignatureDeclaration(163, typeParameters, parameters, type);
}
ts.createFunctionTypeNode = createFunctionTypeNode;
function updateFunctionTypeNode(node, typeParameters, parameters, type) {
@@ -44046,7 +44352,7 @@ var ts;
}
ts.updateFunctionTypeNode = updateFunctionTypeNode;
function createConstructorTypeNode(typeParameters, parameters, type) {
- return createSignatureDeclaration(163, typeParameters, parameters, type);
+ return createSignatureDeclaration(164, typeParameters, parameters, type);
}
ts.createConstructorTypeNode = createConstructorTypeNode;
function updateConstructorTypeNode(node, typeParameters, parameters, type) {
@@ -44054,7 +44360,7 @@ var ts;
}
ts.updateConstructorTypeNode = updateConstructorTypeNode;
function createTypeQueryNode(exprName) {
- var node = createSynthesizedNode(164);
+ var node = createSynthesizedNode(165);
node.exprName = exprName;
return node;
}
@@ -44066,7 +44372,7 @@ var ts;
}
ts.updateTypeQueryNode = updateTypeQueryNode;
function createTypeLiteralNode(members) {
- var node = createSynthesizedNode(165);
+ var node = createSynthesizedNode(166);
node.members = createNodeArray(members);
return node;
}
@@ -44078,7 +44384,7 @@ var ts;
}
ts.updateTypeLiteralNode = updateTypeLiteralNode;
function createArrayTypeNode(elementType) {
- var node = createSynthesizedNode(166);
+ var node = createSynthesizedNode(167);
node.elementType = ts.parenthesizeArrayTypeMember(elementType);
return node;
}
@@ -44090,7 +44396,7 @@ var ts;
}
ts.updateArrayTypeNode = updateArrayTypeNode;
function createTupleTypeNode(elementTypes) {
- var node = createSynthesizedNode(167);
+ var node = createSynthesizedNode(168);
node.elementTypes = createNodeArray(elementTypes);
return node;
}
@@ -44102,7 +44408,7 @@ var ts;
}
ts.updateTypleTypeNode = updateTypleTypeNode;
function createUnionTypeNode(types) {
- return createUnionOrIntersectionTypeNode(168, types);
+ return createUnionOrIntersectionTypeNode(169, types);
}
ts.createUnionTypeNode = createUnionTypeNode;
function updateUnionTypeNode(node, types) {
@@ -44110,7 +44416,7 @@ var ts;
}
ts.updateUnionTypeNode = updateUnionTypeNode;
function createIntersectionTypeNode(types) {
- return createUnionOrIntersectionTypeNode(169, types);
+ return createUnionOrIntersectionTypeNode(170, types);
}
ts.createIntersectionTypeNode = createIntersectionTypeNode;
function updateIntersectionTypeNode(node, types) {
@@ -44129,7 +44435,7 @@ var ts;
: node;
}
function createConditionalTypeNode(checkType, extendsType, trueType, falseType) {
- var node = createSynthesizedNode(170);
+ var node = createSynthesizedNode(171);
node.checkType = ts.parenthesizeConditionalTypeMember(checkType);
node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType);
node.trueType = trueType;
@@ -44147,7 +44453,7 @@ var ts;
}
ts.updateConditionalTypeNode = updateConditionalTypeNode;
function createInferTypeNode(typeParameter) {
- var node = createSynthesizedNode(171);
+ var node = createSynthesizedNode(172);
node.typeParameter = typeParameter;
return node;
}
@@ -44159,7 +44465,7 @@ var ts;
}
ts.updateInferTypeNode = updateInferTypeNode;
function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) {
- var node = createSynthesizedNode(178);
+ var node = createSynthesizedNode(179);
node.argument = argument;
node.qualifier = qualifier;
node.typeArguments = asNodeArray(typeArguments);
@@ -44177,7 +44483,7 @@ var ts;
}
ts.updateImportTypeNode = updateImportTypeNode;
function createParenthesizedType(type) {
- var node = createSynthesizedNode(172);
+ var node = createSynthesizedNode(173);
node.type = type;
return node;
}
@@ -44189,11 +44495,11 @@ var ts;
}
ts.updateParenthesizedType = updateParenthesizedType;
function createThisTypeNode() {
- return createSynthesizedNode(173);
+ return createSynthesizedNode(174);
}
ts.createThisTypeNode = createThisTypeNode;
function createTypeOperatorNode(operatorOrType, type) {
- var node = createSynthesizedNode(174);
+ var node = createSynthesizedNode(175);
node.operator = typeof operatorOrType === "number" ? operatorOrType : 128;
node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType);
return node;
@@ -44204,7 +44510,7 @@ var ts;
}
ts.updateTypeOperatorNode = updateTypeOperatorNode;
function createIndexedAccessTypeNode(objectType, indexType) {
- var node = createSynthesizedNode(175);
+ var node = createSynthesizedNode(176);
node.objectType = ts.parenthesizeElementTypeMember(objectType);
node.indexType = indexType;
return node;
@@ -44218,7 +44524,7 @@ var ts;
}
ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode;
function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) {
- var node = createSynthesizedNode(176);
+ var node = createSynthesizedNode(177);
node.readonlyToken = readonlyToken;
node.typeParameter = typeParameter;
node.questionToken = questionToken;
@@ -44236,7 +44542,7 @@ var ts;
}
ts.updateMappedTypeNode = updateMappedTypeNode;
function createLiteralTypeNode(literal) {
- var node = createSynthesizedNode(177);
+ var node = createSynthesizedNode(178);
node.literal = literal;
return node;
}
@@ -44248,7 +44554,7 @@ var ts;
}
ts.updateLiteralTypeNode = updateLiteralTypeNode;
function createObjectBindingPattern(elements) {
- var node = createSynthesizedNode(179);
+ var node = createSynthesizedNode(180);
node.elements = createNodeArray(elements);
return node;
}
@@ -44260,7 +44566,7 @@ var ts;
}
ts.updateObjectBindingPattern = updateObjectBindingPattern;
function createArrayBindingPattern(elements) {
- var node = createSynthesizedNode(180);
+ var node = createSynthesizedNode(181);
node.elements = createNodeArray(elements);
return node;
}
@@ -44272,7 +44578,7 @@ var ts;
}
ts.updateArrayBindingPattern = updateArrayBindingPattern;
function createBindingElement(dotDotDotToken, propertyName, name, initializer) {
- var node = createSynthesizedNode(181);
+ var node = createSynthesizedNode(182);
node.dotDotDotToken = dotDotDotToken;
node.propertyName = asName(propertyName);
node.name = asName(name);
@@ -44290,7 +44596,7 @@ var ts;
}
ts.updateBindingElement = updateBindingElement;
function createArrayLiteral(elements, multiLine) {
- var node = createSynthesizedNode(182);
+ var node = createSynthesizedNode(183);
node.elements = ts.parenthesizeListElements(createNodeArray(elements));
if (multiLine)
node.multiLine = true;
@@ -44304,7 +44610,7 @@ var ts;
}
ts.updateArrayLiteral = updateArrayLiteral;
function createObjectLiteral(properties, multiLine) {
- var node = createSynthesizedNode(183);
+ var node = createSynthesizedNode(184);
node.properties = createNodeArray(properties);
if (multiLine)
node.multiLine = true;
@@ -44318,7 +44624,7 @@ var ts;
}
ts.updateObjectLiteral = updateObjectLiteral;
function createPropertyAccess(expression, name) {
- var node = createSynthesizedNode(184);
+ var node = createSynthesizedNode(185);
node.expression = ts.parenthesizeForAccess(expression);
node.name = asName(name);
setEmitFlags(node, 131072);
@@ -44333,7 +44639,7 @@ var ts;
}
ts.updatePropertyAccess = updatePropertyAccess;
function createElementAccess(expression, index) {
- var node = createSynthesizedNode(185);
+ var node = createSynthesizedNode(186);
node.expression = ts.parenthesizeForAccess(expression);
node.argumentExpression = asExpression(index);
return node;
@@ -44347,7 +44653,7 @@ var ts;
}
ts.updateElementAccess = updateElementAccess;
function createCall(expression, typeArguments, argumentsArray) {
- var node = createSynthesizedNode(186);
+ var node = createSynthesizedNode(187);
node.expression = ts.parenthesizeForAccess(expression);
node.typeArguments = asNodeArray(typeArguments);
node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray));
@@ -44363,7 +44669,7 @@ var ts;
}
ts.updateCall = updateCall;
function createNew(expression, typeArguments, argumentsArray) {
- var node = createSynthesizedNode(187);
+ var node = createSynthesizedNode(188);
node.expression = ts.parenthesizeForNew(expression);
node.typeArguments = asNodeArray(typeArguments);
node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined;
@@ -44379,7 +44685,7 @@ var ts;
}
ts.updateNew = updateNew;
function createTaggedTemplate(tag, typeArgumentsOrTemplate, template) {
- var node = createSynthesizedNode(188);
+ var node = createSynthesizedNode(189);
node.tag = ts.parenthesizeForAccess(tag);
if (template) {
node.typeArguments = asNodeArray(typeArgumentsOrTemplate);
@@ -44402,7 +44708,7 @@ var ts;
}
ts.updateTaggedTemplate = updateTaggedTemplate;
function createTypeAssertion(type, expression) {
- var node = createSynthesizedNode(189);
+ var node = createSynthesizedNode(190);
node.type = type;
node.expression = ts.parenthesizePrefixOperand(expression);
return node;
@@ -44416,7 +44722,7 @@ var ts;
}
ts.updateTypeAssertion = updateTypeAssertion;
function createParen(expression) {
- var node = createSynthesizedNode(190);
+ var node = createSynthesizedNode(191);
node.expression = expression;
return node;
}
@@ -44428,7 +44734,7 @@ var ts;
}
ts.updateParen = updateParen;
function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
- var node = createSynthesizedNode(191);
+ var node = createSynthesizedNode(192);
node.modifiers = asNodeArray(modifiers);
node.asteriskToken = asteriskToken;
node.name = asName(name);
@@ -44452,7 +44758,7 @@ var ts;
}
ts.updateFunctionExpression = updateFunctionExpression;
function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) {
- var node = createSynthesizedNode(192);
+ var node = createSynthesizedNode(193);
node.modifiers = asNodeArray(modifiers);
node.typeParameters = asNodeArray(typeParameters);
node.parameters = createNodeArray(parameters);
@@ -44486,7 +44792,7 @@ var ts;
}
ts.updateArrowFunction = updateArrowFunction;
function createDelete(expression) {
- var node = createSynthesizedNode(193);
+ var node = createSynthesizedNode(194);
node.expression = ts.parenthesizePrefixOperand(expression);
return node;
}
@@ -44498,7 +44804,7 @@ var ts;
}
ts.updateDelete = updateDelete;
function createTypeOf(expression) {
- var node = createSynthesizedNode(194);
+ var node = createSynthesizedNode(195);
node.expression = ts.parenthesizePrefixOperand(expression);
return node;
}
@@ -44510,7 +44816,7 @@ var ts;
}
ts.updateTypeOf = updateTypeOf;
function createVoid(expression) {
- var node = createSynthesizedNode(195);
+ var node = createSynthesizedNode(196);
node.expression = ts.parenthesizePrefixOperand(expression);
return node;
}
@@ -44522,7 +44828,7 @@ var ts;
}
ts.updateVoid = updateVoid;
function createAwait(expression) {
- var node = createSynthesizedNode(196);
+ var node = createSynthesizedNode(197);
node.expression = ts.parenthesizePrefixOperand(expression);
return node;
}
@@ -44534,7 +44840,7 @@ var ts;
}
ts.updateAwait = updateAwait;
function createPrefix(operator, operand) {
- var node = createSynthesizedNode(197);
+ var node = createSynthesizedNode(198);
node.operator = operator;
node.operand = ts.parenthesizePrefixOperand(operand);
return node;
@@ -44547,7 +44853,7 @@ var ts;
}
ts.updatePrefix = updatePrefix;
function createPostfix(operand, operator) {
- var node = createSynthesizedNode(198);
+ var node = createSynthesizedNode(199);
node.operand = ts.parenthesizePostfixOperand(operand);
node.operator = operator;
return node;
@@ -44560,7 +44866,7 @@ var ts;
}
ts.updatePostfix = updatePostfix;
function createBinary(left, operator, right) {
- var node = createSynthesizedNode(199);
+ var node = createSynthesizedNode(200);
var operatorToken = asToken(operator);
var operatorKind = operatorToken.kind;
node.left = ts.parenthesizeBinaryOperand(operatorKind, left, true, undefined);
@@ -44577,7 +44883,7 @@ var ts;
}
ts.updateBinary = updateBinary;
function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) {
- var node = createSynthesizedNode(200);
+ var node = createSynthesizedNode(201);
node.condition = ts.parenthesizeForConditionalHead(condition);
node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(55);
node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue);
@@ -44607,7 +44913,7 @@ var ts;
}
ts.updateConditional = updateConditional;
function createTemplateExpression(head, templateSpans) {
- var node = createSynthesizedNode(201);
+ var node = createSynthesizedNode(202);
node.head = head;
node.templateSpans = createNodeArray(templateSpans);
return node;
@@ -44645,7 +44951,7 @@ var ts;
}
ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral;
function createYield(asteriskTokenOrExpression, expression) {
- var node = createSynthesizedNode(202);
+ var node = createSynthesizedNode(203);
node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 39 ? asteriskTokenOrExpression : undefined;
node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 39 ? asteriskTokenOrExpression : expression;
return node;
@@ -44659,7 +44965,7 @@ var ts;
}
ts.updateYield = updateYield;
function createSpread(expression) {
- var node = createSynthesizedNode(203);
+ var node = createSynthesizedNode(204);
node.expression = ts.parenthesizeExpressionForList(expression);
return node;
}
@@ -44671,7 +44977,7 @@ var ts;
}
ts.updateSpread = updateSpread;
function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) {
- var node = createSynthesizedNode(204);
+ var node = createSynthesizedNode(205);
node.decorators = undefined;
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -44692,11 +44998,11 @@ var ts;
}
ts.updateClassExpression = updateClassExpression;
function createOmittedExpression() {
- return createSynthesizedNode(205);
+ return createSynthesizedNode(206);
}
ts.createOmittedExpression = createOmittedExpression;
function createExpressionWithTypeArguments(typeArguments, expression) {
- var node = createSynthesizedNode(206);
+ var node = createSynthesizedNode(207);
node.expression = ts.parenthesizeForAccess(expression);
node.typeArguments = asNodeArray(typeArguments);
return node;
@@ -44710,7 +45016,7 @@ var ts;
}
ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments;
function createAsExpression(expression, type) {
- var node = createSynthesizedNode(207);
+ var node = createSynthesizedNode(208);
node.expression = expression;
node.type = type;
return node;
@@ -44724,7 +45030,7 @@ var ts;
}
ts.updateAsExpression = updateAsExpression;
function createNonNullExpression(expression) {
- var node = createSynthesizedNode(208);
+ var node = createSynthesizedNode(209);
node.expression = ts.parenthesizeForAccess(expression);
return node;
}
@@ -44736,7 +45042,7 @@ var ts;
}
ts.updateNonNullExpression = updateNonNullExpression;
function createMetaProperty(keywordToken, name) {
- var node = createSynthesizedNode(209);
+ var node = createSynthesizedNode(210);
node.keywordToken = keywordToken;
node.name = name;
return node;
@@ -44749,7 +45055,7 @@ var ts;
}
ts.updateMetaProperty = updateMetaProperty;
function createTemplateSpan(expression, literal) {
- var node = createSynthesizedNode(210);
+ var node = createSynthesizedNode(211);
node.expression = expression;
node.literal = literal;
return node;
@@ -44763,11 +45069,11 @@ var ts;
}
ts.updateTemplateSpan = updateTemplateSpan;
function createSemicolonClassElement() {
- return createSynthesizedNode(211);
+ return createSynthesizedNode(212);
}
ts.createSemicolonClassElement = createSemicolonClassElement;
function createBlock(statements, multiLine) {
- var block = createSynthesizedNode(212);
+ var block = createSynthesizedNode(213);
block.statements = createNodeArray(statements);
if (multiLine)
block.multiLine = multiLine;
@@ -44775,7 +45081,7 @@ var ts;
}
ts.createBlock = createBlock;
function createExpressionStatement(expression) {
- var node = createSynthesizedNode(215);
+ var node = createSynthesizedNode(216);
node.expression = expression;
return node;
}
@@ -44787,7 +45093,7 @@ var ts;
}
ts.updateBlock = updateBlock;
function createVariableStatement(modifiers, declarationList) {
- var node = createSynthesizedNode(213);
+ var node = createSynthesizedNode(214);
node.decorators = undefined;
node.modifiers = asNodeArray(modifiers);
node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList;
@@ -44802,7 +45108,7 @@ var ts;
}
ts.updateVariableStatement = updateVariableStatement;
function createEmptyStatement() {
- return createSynthesizedNode(214);
+ return createSynthesizedNode(215);
}
ts.createEmptyStatement = createEmptyStatement;
function createStatement(expression) {
@@ -44816,7 +45122,7 @@ var ts;
}
ts.updateStatement = updateStatement;
function createIf(expression, thenStatement, elseStatement) {
- var node = createSynthesizedNode(216);
+ var node = createSynthesizedNode(217);
node.expression = expression;
node.thenStatement = thenStatement;
node.elseStatement = elseStatement;
@@ -44832,7 +45138,7 @@ var ts;
}
ts.updateIf = updateIf;
function createDo(statement, expression) {
- var node = createSynthesizedNode(217);
+ var node = createSynthesizedNode(218);
node.statement = statement;
node.expression = expression;
return node;
@@ -44846,7 +45152,7 @@ var ts;
}
ts.updateDo = updateDo;
function createWhile(expression, statement) {
- var node = createSynthesizedNode(218);
+ var node = createSynthesizedNode(219);
node.expression = expression;
node.statement = statement;
return node;
@@ -44860,7 +45166,7 @@ var ts;
}
ts.updateWhile = updateWhile;
function createFor(initializer, condition, incrementor, statement) {
- var node = createSynthesizedNode(219);
+ var node = createSynthesizedNode(220);
node.initializer = initializer;
node.condition = condition;
node.incrementor = incrementor;
@@ -44878,7 +45184,7 @@ var ts;
}
ts.updateFor = updateFor;
function createForIn(initializer, expression, statement) {
- var node = createSynthesizedNode(220);
+ var node = createSynthesizedNode(221);
node.initializer = initializer;
node.expression = expression;
node.statement = statement;
@@ -44894,7 +45200,7 @@ var ts;
}
ts.updateForIn = updateForIn;
function createForOf(awaitModifier, initializer, expression, statement) {
- var node = createSynthesizedNode(221);
+ var node = createSynthesizedNode(222);
node.awaitModifier = awaitModifier;
node.initializer = initializer;
node.expression = expression;
@@ -44912,7 +45218,7 @@ var ts;
}
ts.updateForOf = updateForOf;
function createContinue(label) {
- var node = createSynthesizedNode(222);
+ var node = createSynthesizedNode(223);
node.label = asName(label);
return node;
}
@@ -44924,7 +45230,7 @@ var ts;
}
ts.updateContinue = updateContinue;
function createBreak(label) {
- var node = createSynthesizedNode(223);
+ var node = createSynthesizedNode(224);
node.label = asName(label);
return node;
}
@@ -44936,7 +45242,7 @@ var ts;
}
ts.updateBreak = updateBreak;
function createReturn(expression) {
- var node = createSynthesizedNode(224);
+ var node = createSynthesizedNode(225);
node.expression = expression;
return node;
}
@@ -44948,7 +45254,7 @@ var ts;
}
ts.updateReturn = updateReturn;
function createWith(expression, statement) {
- var node = createSynthesizedNode(225);
+ var node = createSynthesizedNode(226);
node.expression = expression;
node.statement = statement;
return node;
@@ -44962,7 +45268,7 @@ var ts;
}
ts.updateWith = updateWith;
function createSwitch(expression, caseBlock) {
- var node = createSynthesizedNode(226);
+ var node = createSynthesizedNode(227);
node.expression = ts.parenthesizeExpressionForList(expression);
node.caseBlock = caseBlock;
return node;
@@ -44976,7 +45282,7 @@ var ts;
}
ts.updateSwitch = updateSwitch;
function createLabel(label, statement) {
- var node = createSynthesizedNode(227);
+ var node = createSynthesizedNode(228);
node.label = asName(label);
node.statement = statement;
return node;
@@ -44990,7 +45296,7 @@ var ts;
}
ts.updateLabel = updateLabel;
function createThrow(expression) {
- var node = createSynthesizedNode(228);
+ var node = createSynthesizedNode(229);
node.expression = expression;
return node;
}
@@ -45002,7 +45308,7 @@ var ts;
}
ts.updateThrow = updateThrow;
function createTry(tryBlock, catchClause, finallyBlock) {
- var node = createSynthesizedNode(229);
+ var node = createSynthesizedNode(230);
node.tryBlock = tryBlock;
node.catchClause = catchClause;
node.finallyBlock = finallyBlock;
@@ -45018,11 +45324,11 @@ var ts;
}
ts.updateTry = updateTry;
function createDebuggerStatement() {
- return createSynthesizedNode(230);
+ return createSynthesizedNode(231);
}
ts.createDebuggerStatement = createDebuggerStatement;
function createVariableDeclaration(name, type, initializer) {
- var node = createSynthesizedNode(231);
+ var node = createSynthesizedNode(232);
node.name = asName(name);
node.type = type;
node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined;
@@ -45038,7 +45344,8 @@ var ts;
}
ts.updateVariableDeclaration = updateVariableDeclaration;
function createVariableDeclarationList(declarations, flags) {
- var node = createSynthesizedNode(232);
+ if (flags === void 0) { flags = 0; }
+ var node = createSynthesizedNode(233);
node.flags |= flags & 3;
node.declarations = createNodeArray(declarations);
return node;
@@ -45051,7 +45358,7 @@ var ts;
}
ts.updateVariableDeclarationList = updateVariableDeclarationList;
function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
- var node = createSynthesizedNode(233);
+ var node = createSynthesizedNode(234);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.asteriskToken = asteriskToken;
@@ -45077,7 +45384,7 @@ var ts;
}
ts.updateFunctionDeclaration = updateFunctionDeclaration;
function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) {
- var node = createSynthesizedNode(234);
+ var node = createSynthesizedNode(235);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -45099,7 +45406,7 @@ var ts;
}
ts.updateClassDeclaration = updateClassDeclaration;
function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) {
- var node = createSynthesizedNode(235);
+ var node = createSynthesizedNode(236);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -45121,7 +45428,7 @@ var ts;
}
ts.updateInterfaceDeclaration = updateInterfaceDeclaration;
function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) {
- var node = createSynthesizedNode(236);
+ var node = createSynthesizedNode(237);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -45141,7 +45448,7 @@ var ts;
}
ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration;
function createEnumDeclaration(decorators, modifiers, name, members) {
- var node = createSynthesizedNode(237);
+ var node = createSynthesizedNode(238);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -45159,7 +45466,8 @@ var ts;
}
ts.updateEnumDeclaration = updateEnumDeclaration;
function createModuleDeclaration(decorators, modifiers, name, body, flags) {
- var node = createSynthesizedNode(238);
+ if (flags === void 0) { flags = 0; }
+ var node = createSynthesizedNode(239);
node.flags |= flags & (16 | 4 | 512);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
@@ -45178,7 +45486,7 @@ var ts;
}
ts.updateModuleDeclaration = updateModuleDeclaration;
function createModuleBlock(statements) {
- var node = createSynthesizedNode(239);
+ var node = createSynthesizedNode(240);
node.statements = createNodeArray(statements);
return node;
}
@@ -45190,7 +45498,7 @@ var ts;
}
ts.updateModuleBlock = updateModuleBlock;
function createCaseBlock(clauses) {
- var node = createSynthesizedNode(240);
+ var node = createSynthesizedNode(241);
node.clauses = createNodeArray(clauses);
return node;
}
@@ -45202,7 +45510,7 @@ var ts;
}
ts.updateCaseBlock = updateCaseBlock;
function createNamespaceExportDeclaration(name) {
- var node = createSynthesizedNode(241);
+ var node = createSynthesizedNode(242);
node.name = asName(name);
return node;
}
@@ -45214,7 +45522,7 @@ var ts;
}
ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration;
function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) {
- var node = createSynthesizedNode(242);
+ var node = createSynthesizedNode(243);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -45232,7 +45540,7 @@ var ts;
}
ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration;
function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) {
- var node = createSynthesizedNode(243);
+ var node = createSynthesizedNode(244);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.importClause = importClause;
@@ -45250,7 +45558,7 @@ var ts;
}
ts.updateImportDeclaration = updateImportDeclaration;
function createImportClause(name, namedBindings) {
- var node = createSynthesizedNode(244);
+ var node = createSynthesizedNode(245);
node.name = name;
node.namedBindings = namedBindings;
return node;
@@ -45264,7 +45572,7 @@ var ts;
}
ts.updateImportClause = updateImportClause;
function createNamespaceImport(name) {
- var node = createSynthesizedNode(245);
+ var node = createSynthesizedNode(246);
node.name = name;
return node;
}
@@ -45276,7 +45584,7 @@ var ts;
}
ts.updateNamespaceImport = updateNamespaceImport;
function createNamedImports(elements) {
- var node = createSynthesizedNode(246);
+ var node = createSynthesizedNode(247);
node.elements = createNodeArray(elements);
return node;
}
@@ -45288,7 +45596,7 @@ var ts;
}
ts.updateNamedImports = updateNamedImports;
function createImportSpecifier(propertyName, name) {
- var node = createSynthesizedNode(247);
+ var node = createSynthesizedNode(248);
node.propertyName = propertyName;
node.name = name;
return node;
@@ -45302,7 +45610,7 @@ var ts;
}
ts.updateImportSpecifier = updateImportSpecifier;
function createExportAssignment(decorators, modifiers, isExportEquals, expression) {
- var node = createSynthesizedNode(248);
+ var node = createSynthesizedNode(249);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.isExportEquals = isExportEquals;
@@ -45319,7 +45627,7 @@ var ts;
}
ts.updateExportAssignment = updateExportAssignment;
function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier) {
- var node = createSynthesizedNode(249);
+ var node = createSynthesizedNode(250);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.exportClause = exportClause;
@@ -45337,7 +45645,7 @@ var ts;
}
ts.updateExportDeclaration = updateExportDeclaration;
function createNamedExports(elements) {
- var node = createSynthesizedNode(250);
+ var node = createSynthesizedNode(251);
node.elements = createNodeArray(elements);
return node;
}
@@ -45349,7 +45657,7 @@ var ts;
}
ts.updateNamedExports = updateNamedExports;
function createExportSpecifier(propertyName, name) {
- var node = createSynthesizedNode(251);
+ var node = createSynthesizedNode(252);
node.propertyName = asName(propertyName);
node.name = asName(name);
return node;
@@ -45363,7 +45671,7 @@ var ts;
}
ts.updateExportSpecifier = updateExportSpecifier;
function createExternalModuleReference(expression) {
- var node = createSynthesizedNode(253);
+ var node = createSynthesizedNode(254);
node.expression = expression;
return node;
}
@@ -45375,7 +45683,7 @@ var ts;
}
ts.updateExternalModuleReference = updateExternalModuleReference;
function createJsxElement(openingElement, children, closingElement) {
- var node = createSynthesizedNode(254);
+ var node = createSynthesizedNode(255);
node.openingElement = openingElement;
node.children = createNodeArray(children);
node.closingElement = closingElement;
@@ -45391,7 +45699,7 @@ var ts;
}
ts.updateJsxElement = updateJsxElement;
function createJsxSelfClosingElement(tagName, typeArguments, attributes) {
- var node = createSynthesizedNode(255);
+ var node = createSynthesizedNode(256);
node.tagName = tagName;
node.typeArguments = typeArguments && createNodeArray(typeArguments);
node.attributes = attributes;
@@ -45407,7 +45715,7 @@ var ts;
}
ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement;
function createJsxOpeningElement(tagName, typeArguments, attributes) {
- var node = createSynthesizedNode(256);
+ var node = createSynthesizedNode(257);
node.tagName = tagName;
node.typeArguments = typeArguments && createNodeArray(typeArguments);
node.attributes = attributes;
@@ -45423,7 +45731,7 @@ var ts;
}
ts.updateJsxOpeningElement = updateJsxOpeningElement;
function createJsxClosingElement(tagName) {
- var node = createSynthesizedNode(257);
+ var node = createSynthesizedNode(258);
node.tagName = tagName;
return node;
}
@@ -45435,7 +45743,7 @@ var ts;
}
ts.updateJsxClosingElement = updateJsxClosingElement;
function createJsxFragment(openingFragment, children, closingFragment) {
- var node = createSynthesizedNode(258);
+ var node = createSynthesizedNode(259);
node.openingFragment = openingFragment;
node.children = createNodeArray(children);
node.closingFragment = closingFragment;
@@ -45451,7 +45759,7 @@ var ts;
}
ts.updateJsxFragment = updateJsxFragment;
function createJsxAttribute(name, initializer) {
- var node = createSynthesizedNode(261);
+ var node = createSynthesizedNode(262);
node.name = name;
node.initializer = initializer;
return node;
@@ -45465,7 +45773,7 @@ var ts;
}
ts.updateJsxAttribute = updateJsxAttribute;
function createJsxAttributes(properties) {
- var node = createSynthesizedNode(262);
+ var node = createSynthesizedNode(263);
node.properties = createNodeArray(properties);
return node;
}
@@ -45477,7 +45785,7 @@ var ts;
}
ts.updateJsxAttributes = updateJsxAttributes;
function createJsxSpreadAttribute(expression) {
- var node = createSynthesizedNode(263);
+ var node = createSynthesizedNode(264);
node.expression = expression;
return node;
}
@@ -45489,7 +45797,7 @@ var ts;
}
ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute;
function createJsxExpression(dotDotDotToken, expression) {
- var node = createSynthesizedNode(264);
+ var node = createSynthesizedNode(265);
node.dotDotDotToken = dotDotDotToken;
node.expression = expression;
return node;
@@ -45502,7 +45810,7 @@ var ts;
}
ts.updateJsxExpression = updateJsxExpression;
function createCaseClause(expression, statements) {
- var node = createSynthesizedNode(265);
+ var node = createSynthesizedNode(266);
node.expression = ts.parenthesizeExpressionForList(expression);
node.statements = createNodeArray(statements);
return node;
@@ -45516,7 +45824,7 @@ var ts;
}
ts.updateCaseClause = updateCaseClause;
function createDefaultClause(statements) {
- var node = createSynthesizedNode(266);
+ var node = createSynthesizedNode(267);
node.statements = createNodeArray(statements);
return node;
}
@@ -45528,7 +45836,7 @@ var ts;
}
ts.updateDefaultClause = updateDefaultClause;
function createHeritageClause(token, types) {
- var node = createSynthesizedNode(267);
+ var node = createSynthesizedNode(268);
node.token = token;
node.types = createNodeArray(types);
return node;
@@ -45541,7 +45849,7 @@ var ts;
}
ts.updateHeritageClause = updateHeritageClause;
function createCatchClause(variableDeclaration, block) {
- var node = createSynthesizedNode(268);
+ var node = createSynthesizedNode(269);
node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration;
node.block = block;
return node;
@@ -45555,7 +45863,7 @@ var ts;
}
ts.updateCatchClause = updateCatchClause;
function createPropertyAssignment(name, initializer) {
- var node = createSynthesizedNode(269);
+ var node = createSynthesizedNode(270);
node.name = asName(name);
node.questionToken = undefined;
node.initializer = ts.parenthesizeExpressionForList(initializer);
@@ -45570,7 +45878,7 @@ var ts;
}
ts.updatePropertyAssignment = updatePropertyAssignment;
function createShorthandPropertyAssignment(name, objectAssignmentInitializer) {
- var node = createSynthesizedNode(270);
+ var node = createSynthesizedNode(271);
node.name = asName(name);
node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined;
return node;
@@ -45584,7 +45892,7 @@ var ts;
}
ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment;
function createSpreadAssignment(expression) {
- var node = createSynthesizedNode(271);
+ var node = createSynthesizedNode(272);
node.expression = expression !== undefined ? ts.parenthesizeExpressionForList(expression) : undefined;
return node;
}
@@ -45596,7 +45904,7 @@ var ts;
}
ts.updateSpreadAssignment = updateSpreadAssignment;
function createEnumMember(name, initializer) {
- var node = createSynthesizedNode(272);
+ var node = createSynthesizedNode(273);
node.name = asName(name);
node.initializer = initializer && ts.parenthesizeExpressionForList(initializer);
return node;
@@ -45615,7 +45923,7 @@ var ts;
(referencedFiles !== undefined && node.referencedFiles !== referencedFiles) ||
(typeReferences !== undefined && node.typeReferenceDirectives !== typeReferences) ||
(hasNoDefaultLib !== undefined && node.hasNoDefaultLib !== hasNoDefaultLib)) {
- var updated = createSynthesizedNode(273);
+ var updated = createSynthesizedNode(274);
updated.flags |= node.flags;
updated.statements = createNodeArray(statements);
updated.endOfFileToken = node.endOfFileToken;
@@ -45654,6 +45962,8 @@ var ts;
updated.parseDiagnostics = node.parseDiagnostics;
if (node.bindDiagnostics !== undefined)
updated.bindDiagnostics = node.bindDiagnostics;
+ if (node.bindSuggestionDiagnostics !== undefined)
+ updated.bindSuggestionDiagnostics = node.bindSuggestionDiagnostics;
if (node.lineMap !== undefined)
updated.lineMap = node.lineMap;
if (node.classifiableNames !== undefined)
@@ -45686,28 +45996,28 @@ var ts;
}
ts.getMutableClone = getMutableClone;
function createNotEmittedStatement(original) {
- var node = createSynthesizedNode(299);
+ var node = createSynthesizedNode(300);
node.original = original;
setTextRange(node, original);
return node;
}
ts.createNotEmittedStatement = createNotEmittedStatement;
function createEndOfDeclarationMarker(original) {
- var node = createSynthesizedNode(303);
+ var node = createSynthesizedNode(304);
node.emitNode = {};
node.original = original;
return node;
}
ts.createEndOfDeclarationMarker = createEndOfDeclarationMarker;
function createMergeDeclarationMarker(original) {
- var node = createSynthesizedNode(302);
+ var node = createSynthesizedNode(303);
node.emitNode = {};
node.original = original;
return node;
}
ts.createMergeDeclarationMarker = createMergeDeclarationMarker;
function createPartiallyEmittedExpression(expression, original) {
- var node = createSynthesizedNode(300);
+ var node = createSynthesizedNode(301);
node.expression = expression;
node.original = original;
setTextRange(node, original);
@@ -45723,7 +46033,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 === 301) {
+ if (node.kind === 302) {
return node.elements;
}
if (ts.isBinaryExpression(node) && node.operatorToken.kind === 26) {
@@ -45733,7 +46043,7 @@ var ts;
return node;
}
function createCommaList(elements) {
- var node = createSynthesizedNode(301);
+ var node = createSynthesizedNode(302);
node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements));
return node;
}
@@ -45746,20 +46056,20 @@ var ts;
ts.updateCommaList = updateCommaList;
function createBundle(sourceFiles, prepends) {
if (prepends === void 0) { prepends = ts.emptyArray; }
- var node = ts.createNode(274);
+ var node = ts.createNode(275);
node.prepends = prepends;
node.sourceFiles = sourceFiles;
return node;
}
ts.createBundle = createBundle;
function createUnparsedSourceFile(text) {
- var node = ts.createNode(275);
+ var node = ts.createNode(276);
node.text = text;
return node;
}
ts.createUnparsedSourceFile = createUnparsedSourceFile;
function createInputFiles(javascript, declaration) {
- var node = ts.createNode(276);
+ var node = ts.createNode(277);
node.javascriptText = javascript;
node.declarationText = declaration;
return node;
@@ -45864,7 +46174,7 @@ var ts;
function getOrCreateEmitNode(node) {
if (!node.emitNode) {
if (ts.isParseTreeNode(node)) {
- if (node.kind === 273) {
+ if (node.kind === 274) {
return node.emitNode = { annotatedNodes: [node] };
}
var sourceFile = ts.getSourceFileOfNode(node);
@@ -46272,7 +46582,7 @@ var ts;
ts.createSpreadHelper = createSpreadHelper;
function createForOfBindingStatement(node, boundValue) {
if (ts.isVariableDeclarationList(node)) {
- var firstDeclaration = ts.firstOrUndefined(node.declarations);
+ var firstDeclaration = ts.first(node.declarations);
var updatedDeclaration = ts.updateVariableDeclaration(firstDeclaration, firstDeclaration.name, undefined, boundValue);
return ts.setTextRange(ts.createVariableStatement(undefined, ts.updateVariableDeclarationList(node, [updatedDeclaration])), node);
}
@@ -46295,7 +46605,7 @@ var ts;
if (!outermostLabeledStatement) {
return node;
}
- var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 227
+ var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 228
? restoreEnclosingLabel(node, outermostLabeledStatement.statement)
: node);
if (afterRestoreLabelCallback) {
@@ -46313,19 +46623,20 @@ var ts;
case 8:
case 9:
return false;
- case 182:
+ case 183:
var elements = target.elements;
if (elements.length === 0) {
return false;
}
return true;
- case 183:
+ case 184:
return target.properties.length > 0;
default:
return true;
}
}
function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers) {
+ if (cacheIdentifiers === void 0) { cacheIdentifiers = false; }
var callee = skipOuterExpressions(expression, 7);
var thisArg;
var target;
@@ -46345,7 +46656,7 @@ var ts;
}
else {
switch (callee.kind) {
- case 184: {
+ case 185: {
if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) {
thisArg = ts.createTempVariable(recordTempVariable);
target = ts.createPropertyAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.name);
@@ -46357,7 +46668,7 @@ var ts;
}
break;
}
- case 185: {
+ case 186: {
if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) {
thisArg = ts.createTempVariable(recordTempVariable);
target = ts.createElementAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.argumentExpression);
@@ -46410,14 +46721,14 @@ var ts;
ts.createExpressionForPropertyName = createExpressionForPropertyName;
function createExpressionForObjectLiteralElementLike(node, property, receiver) {
switch (property.kind) {
- case 155:
case 156:
- return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine);
- case 269:
- return createExpressionForPropertyAssignment(property, receiver);
+ case 157:
+ return createExpressionForAccessorDeclaration(node.properties, property, receiver, !!node.multiLine);
case 270:
+ return createExpressionForPropertyAssignment(property, receiver);
+ case 271:
return createExpressionForShorthandPropertyAssignment(property, receiver);
- case 153:
+ case 154:
return createExpressionForMethodDeclaration(property, receiver);
}
}
@@ -46489,6 +46800,7 @@ var ts;
}
ts.getDeclarationName = getDeclarationName;
function getName(node, allowComments, allowSourceMaps, emitFlags) {
+ if (emitFlags === void 0) { emitFlags = 0; }
var nodeName = ts.getNameOfDeclaration(node);
if (nodeName && ts.isIdentifier(nodeName) && !ts.isGeneratedIdentifier(nodeName)) {
var name = ts.getMutableClone(nodeName);
@@ -46513,7 +46825,7 @@ var ts;
function getNamespaceMemberName(ns, name, allowComments, allowSourceMaps) {
var qualifiedName = ts.createPropertyAccess(ns, ts.nodeIsSynthesized(name) ? name : ts.getSynthesizedClone(name));
ts.setTextRange(qualifiedName, name);
- var emitFlags;
+ var emitFlags = 0;
if (!allowSourceMaps)
emitFlags |= 48;
if (!allowComments)
@@ -46528,7 +46840,8 @@ var ts;
}
ts.convertToFunctionBody = convertToFunctionBody;
function convertFunctionDeclarationToExpression(node) {
- ts.Debug.assert(!!node.body);
+ if (!node.body)
+ return ts.Debug.fail();
var updated = ts.createFunctionExpression(node.modifiers, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body);
ts.setOriginalNode(updated, node);
ts.setTextRange(updated, node);
@@ -46573,7 +46886,7 @@ var ts;
ts.addStandardPrologue = addStandardPrologue;
function addCustomPrologue(target, source, statementOffset, visitor) {
var numStatements = source.length;
- while (statementOffset < numStatements) {
+ while (statementOffset !== undefined && statementOffset < numStatements) {
var statement = source[statementOffset];
if (ts.getEmitFlags(statement) & 1048576) {
ts.append(target, visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement);
@@ -46617,7 +46930,7 @@ var ts;
ts.ensureUseStrict = ensureUseStrict;
function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
var skipped = ts.skipPartiallyEmittedExpressions(operand);
- if (skipped.kind === 190) {
+ if (skipped.kind === 191) {
return operand;
}
return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand)
@@ -46626,15 +46939,15 @@ var ts;
}
ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand;
function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
- var binaryOperatorPrecedence = ts.getOperatorPrecedence(199, binaryOperator);
- var binaryOperatorAssociativity = ts.getOperatorAssociativity(199, binaryOperator);
+ var binaryOperatorPrecedence = ts.getOperatorPrecedence(200, binaryOperator);
+ var binaryOperatorAssociativity = ts.getOperatorAssociativity(200, binaryOperator);
var emittedOperand = ts.skipPartiallyEmittedExpressions(operand);
var operandPrecedence = ts.getExpressionPrecedence(emittedOperand);
switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) {
case -1:
if (!isLeftSideOfBinary
&& binaryOperatorAssociativity === 1
- && operand.kind === 202) {
+ && operand.kind === 203) {
return false;
}
return true;
@@ -46673,7 +46986,7 @@ var ts;
if (ts.isLiteralKind(node.kind)) {
return node.kind;
}
- if (node.kind === 199 && node.operatorToken.kind === 37) {
+ if (node.kind === 200 && node.operatorToken.kind === 37) {
if (node.cachedLiteralKind !== undefined) {
return node.cachedLiteralKind;
}
@@ -46688,7 +47001,7 @@ var ts;
return 0;
}
function parenthesizeForConditionalHead(condition) {
- var conditionalPrecedence = ts.getOperatorPrecedence(200, 55);
+ var conditionalPrecedence = ts.getOperatorPrecedence(201, 55);
var emittedCondition = ts.skipPartiallyEmittedExpressions(condition);
var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition);
if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1) {
@@ -46699,17 +47012,17 @@ var ts;
ts.parenthesizeForConditionalHead = parenthesizeForConditionalHead;
function parenthesizeSubexpressionOfConditionalExpression(e) {
var emittedExpression = ts.skipPartiallyEmittedExpressions(e);
- return emittedExpression.kind === 199 && emittedExpression.operatorToken.kind === 26 ||
- emittedExpression.kind === 301
+ return emittedExpression.kind === 200 && emittedExpression.operatorToken.kind === 26 ||
+ emittedExpression.kind === 302
? ts.createParen(e)
: e;
}
ts.parenthesizeSubexpressionOfConditionalExpression = parenthesizeSubexpressionOfConditionalExpression;
function parenthesizeDefaultExpression(e) {
var check = ts.skipPartiallyEmittedExpressions(e);
- return (check.kind === 204 ||
- check.kind === 191 ||
- check.kind === 301 ||
+ return (check.kind === 205 ||
+ check.kind === 192 ||
+ check.kind === 302 ||
ts.isBinaryExpression(check) && check.operatorToken.kind === 26)
? ts.createParen(e)
: e;
@@ -46718,9 +47031,9 @@ var ts;
function parenthesizeForNew(expression) {
var leftmostExpr = getLeftmostExpression(expression, true);
switch (leftmostExpr.kind) {
- case 186:
- return ts.createParen(expression);
case 187:
+ return ts.createParen(expression);
+ case 188:
return !leftmostExpr.arguments
? ts.createParen(expression)
: expression;
@@ -46731,7 +47044,7 @@ var ts;
function parenthesizeForAccess(expression) {
var emittedExpression = ts.skipPartiallyEmittedExpressions(expression);
if (ts.isLeftHandSideExpression(emittedExpression)
- && (emittedExpression.kind !== 187 || emittedExpression.arguments)) {
+ && (emittedExpression.kind !== 188 || emittedExpression.arguments)) {
return expression;
}
return ts.setTextRange(ts.createParen(expression), expression);
@@ -46769,7 +47082,7 @@ var ts;
function parenthesizeExpressionForList(expression) {
var emittedExpression = ts.skipPartiallyEmittedExpressions(expression);
var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression);
- var commaPrecedence = ts.getOperatorPrecedence(199, 26);
+ var commaPrecedence = ts.getOperatorPrecedence(200, 26);
return expressionPrecedence > commaPrecedence
? expression
: ts.setTextRange(ts.createParen(expression), expression);
@@ -46780,29 +47093,29 @@ var ts;
if (ts.isCallExpression(emittedExpression)) {
var callee = emittedExpression.expression;
var kind = ts.skipPartiallyEmittedExpressions(callee).kind;
- if (kind === 191 || kind === 192) {
+ if (kind === 192 || kind === 193) {
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 === 183 || leftmostExpressionKind === 191) {
+ if (leftmostExpressionKind === 184 || leftmostExpressionKind === 192) {
return ts.setTextRange(ts.createParen(expression), expression);
}
return expression;
}
ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement;
function parenthesizeConditionalTypeMember(member) {
- return member.kind === 170 ? ts.createParenthesizedType(member) : member;
+ return member.kind === 171 ? ts.createParenthesizedType(member) : member;
}
ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember;
function parenthesizeElementTypeMember(member) {
switch (member.kind) {
- case 168:
case 169:
- case 162:
+ case 170:
case 163:
+ case 164:
return ts.createParenthesizedType(member);
}
return parenthesizeConditionalTypeMember(member);
@@ -46810,9 +47123,9 @@ var ts;
ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember;
function parenthesizeArrayTypeMember(member) {
switch (member.kind) {
- case 164:
- case 174:
- case 171:
+ case 165:
+ case 175:
+ case 172:
return ts.createParenthesizedType(member);
}
return parenthesizeElementTypeMember(member);
@@ -46838,24 +47151,24 @@ var ts;
function getLeftmostExpression(node, stopAtCallExpressions) {
while (true) {
switch (node.kind) {
- case 198:
+ case 199:
node = node.operand;
continue;
- case 199:
+ case 200:
node = node.left;
continue;
- case 200:
+ case 201:
node = node.condition;
continue;
- case 186:
+ case 187:
if (stopAtCallExpressions) {
return node;
}
+ case 186:
case 185:
- case 184:
node = node.expression;
continue;
- case 300:
+ case 301:
node = node.expression;
continue;
}
@@ -46863,7 +47176,7 @@ var ts;
}
}
function parenthesizeConciseBody(body) {
- if (!ts.isBlock(body) && getLeftmostExpression(body, false).kind === 183) {
+ if (!ts.isBlock(body) && getLeftmostExpression(body, false).kind === 184) {
return ts.setTextRange(ts.createParen(body), body);
}
return body;
@@ -46872,13 +47185,13 @@ var ts;
function isOuterExpression(node, kinds) {
if (kinds === void 0) { kinds = 7; }
switch (node.kind) {
- case 190:
+ case 191:
return (kinds & 1) !== 0;
- case 189:
- case 207:
+ case 190:
case 208:
+ case 209:
return (kinds & 2) !== 0;
- case 300:
+ case 301:
return (kinds & 4) !== 0;
}
return false;
@@ -46903,7 +47216,7 @@ var ts;
}
ts.skipOuterExpressions = skipOuterExpressions;
function skipAssertions(node) {
- while (ts.isAssertionExpression(node) || node.kind === 208) {
+ while (ts.isAssertionExpression(node) || node.kind === 209) {
node = node.expression;
}
return node;
@@ -46911,15 +47224,15 @@ var ts;
ts.skipAssertions = skipAssertions;
function updateOuterExpression(outerExpression, expression) {
switch (outerExpression.kind) {
- case 190: return ts.updateParen(outerExpression, expression);
- case 189: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression);
- case 207: return ts.updateAsExpression(outerExpression, expression, outerExpression.type);
- case 208: return ts.updateNonNullExpression(outerExpression, expression);
- case 300: return ts.updatePartiallyEmittedExpression(outerExpression, expression);
+ case 191: return ts.updateParen(outerExpression, expression);
+ case 190: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression);
+ case 208: return ts.updateAsExpression(outerExpression, expression, outerExpression.type);
+ case 209: return ts.updateNonNullExpression(outerExpression, expression);
+ case 301: return ts.updatePartiallyEmittedExpression(outerExpression, expression);
}
}
function isIgnorableParen(node) {
- return node.kind === 190
+ return node.kind === 191
&& ts.nodeIsSynthesized(node)
&& ts.nodeIsSynthesized(ts.getSourceMapRange(node))
&& ts.nodeIsSynthesized(ts.getCommentRange(node))
@@ -46981,10 +47294,10 @@ var ts;
var name = namespaceDeclaration.name;
return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name));
}
- if (node.kind === 243 && node.importClause) {
+ if (node.kind === 244 && node.importClause) {
return ts.getGeneratedNameForNode(node);
}
- if (node.kind === 249 && node.moduleSpecifier) {
+ if (node.kind === 250 && node.moduleSpecifier) {
return ts.getGeneratedNameForNode(node);
}
return undefined;
@@ -47025,8 +47338,9 @@ var ts;
return bindingElement.initializer;
}
if (ts.isPropertyAssignment(bindingElement)) {
- return ts.isAssignmentExpression(bindingElement.initializer, true)
- ? bindingElement.initializer.right
+ var initializer = bindingElement.initializer;
+ return ts.isAssignmentExpression(initializer, true)
+ ? initializer.right
: undefined;
}
if (ts.isShorthandPropertyAssignment(bindingElement)) {
@@ -47046,11 +47360,11 @@ var ts;
}
if (ts.isObjectLiteralElementLike(bindingElement)) {
switch (bindingElement.kind) {
- case 269:
- return getTargetOfBindingOrAssignmentElement(bindingElement.initializer);
case 270:
- return bindingElement.name;
+ return getTargetOfBindingOrAssignmentElement(bindingElement.initializer);
case 271:
+ return bindingElement.name;
+ case 272:
return getTargetOfBindingOrAssignmentElement(bindingElement.expression);
}
return undefined;
@@ -47066,11 +47380,11 @@ var ts;
ts.getTargetOfBindingOrAssignmentElement = getTargetOfBindingOrAssignmentElement;
function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) {
switch (bindingElement.kind) {
- case 148:
- case 181:
+ case 149:
+ case 182:
return bindingElement.dotDotDotToken;
- case 203:
- case 271:
+ case 204:
+ case 272:
return bindingElement;
}
return undefined;
@@ -47078,7 +47392,7 @@ var ts;
ts.getRestIndicatorOfBindingOrAssignmentElement = getRestIndicatorOfBindingOrAssignmentElement;
function getPropertyNameOfBindingOrAssignmentElement(bindingElement) {
switch (bindingElement.kind) {
- case 181:
+ case 182:
if (bindingElement.propertyName) {
var propertyName = bindingElement.propertyName;
return ts.isComputedPropertyName(propertyName) && ts.isStringOrNumericLiteral(propertyName.expression)
@@ -47086,7 +47400,7 @@ var ts;
: propertyName;
}
break;
- case 269:
+ case 270:
if (bindingElement.name) {
var propertyName = bindingElement.name;
return ts.isComputedPropertyName(propertyName) && ts.isStringOrNumericLiteral(propertyName.expression)
@@ -47094,7 +47408,7 @@ var ts;
: propertyName;
}
break;
- case 271:
+ case 272:
return bindingElement.name;
}
var target = getTargetOfBindingOrAssignmentElement(bindingElement);
@@ -47108,11 +47422,11 @@ var ts;
ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement;
function getElementsOfBindingOrAssignmentPattern(name) {
switch (name.kind) {
- case 179:
case 180:
- case 182:
- return name.elements;
+ case 181:
case 183:
+ return name.elements;
+ case 184:
return name.properties;
}
}
@@ -47151,11 +47465,11 @@ var ts;
ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement;
function convertToAssignmentPattern(node) {
switch (node.kind) {
- case 180:
- case 182:
- return convertToArrayAssignmentPattern(node);
- case 179:
+ case 181:
case 183:
+ return convertToArrayAssignmentPattern(node);
+ case 180:
+ case 184:
return convertToObjectAssignmentPattern(node);
}
}
@@ -47292,257 +47606,257 @@ var ts;
return undefined;
}
var kind = node.kind;
- if ((kind > 0 && kind <= 144) || kind === 173) {
+ if ((kind > 0 && kind <= 145) || kind === 174) {
return node;
}
switch (kind) {
case 71:
return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration));
- case 145:
- return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier));
case 146:
- 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 147:
- 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 148:
- 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 149:
- 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 150:
- 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 151:
- 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, 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 152:
- 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, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression));
case 153:
- 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 154:
- 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 155:
- 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 156:
- 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 157:
- 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 158:
- 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 159:
- 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 160:
- return ts.updateTypePredicateNode(node, 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 161:
- return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode));
+ return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode));
case 162:
- 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 163:
- 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 164:
- 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 165:
- return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement));
+ return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName));
case 166:
- return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode));
+ return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement));
case 167:
- return ts.updateTypleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode));
+ return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode));
case 168:
- return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode));
+ return ts.updateTypleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode));
case 169:
- return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode));
+ return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode));
case 170:
- 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 171:
- return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration));
- case 178:
- return ts.updateImportTypeNode(node, visitNode(node.argument, visitor, ts.isTypeNode), visitNode(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf);
+ 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 172:
- return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode));
- case 174:
- return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode));
- case 175:
- return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode));
- case 176:
- 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 177:
- return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression));
+ return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration));
case 179:
- return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement));
+ 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 173:
+ return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode));
+ case 175:
+ return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode));
+ case 176:
+ return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode));
+ case 177:
+ 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 178:
+ return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression));
case 180:
- return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement));
+ return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement));
case 181:
- 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 182:
- 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 183:
- return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike));
+ return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression));
case 184:
- return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike));
case 185:
- return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression));
+ return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier));
case 186:
- return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression));
+ return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression));
case 187:
- return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), 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 188:
- 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 189:
- 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 190:
- 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 191:
- 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 192:
- 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 193:
- 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, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context));
case 194:
- return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression));
case 195:
- return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression));
case 196:
- return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression));
case 197:
- return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression));
+ return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression));
case 198:
- return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression));
+ return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression));
case 199:
- 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 200:
- 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, visitor, ts.isToken));
case 201:
- 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, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression));
case 202:
- 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 203:
- 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 204:
+ return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 205:
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 206:
- return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression));
case 207:
- 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 208:
- 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 209:
- return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression));
case 210:
+ return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier));
+ case 211:
return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail));
- case 212:
- return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement));
case 213:
+ return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement));
+ case 214:
return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList));
- case 215:
- return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression));
case 216:
- 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.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression));
case 217:
- 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 218:
- 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 219:
- 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 220:
- 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 221:
- 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 222:
- return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier));
+ 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 223:
- return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier));
+ return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier));
case 224:
- return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier));
case 225:
- 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 226:
- 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 227:
- 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 228:
- 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 229:
+ return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 230:
return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock));
- case 231:
- return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression));
case 232:
- return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration));
+ return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression));
case 233:
- 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 234:
- 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 235:
- 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 236:
- 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 237:
- 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 238:
- 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 239:
- 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 240:
- return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause));
+ return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement));
case 241:
- return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause));
case 242:
- 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 243:
- 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 244:
- return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings));
+ 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 245:
- return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings));
case 246:
- return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier));
+ return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier));
case 247:
- 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 248:
- 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 249:
- return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression));
+ return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression));
case 250:
- return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier));
+ return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression));
case 251:
+ return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier));
+ case 252:
return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier));
- case 253:
- return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression));
case 254:
- 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 255:
- 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 256:
- 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 257:
- 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 258:
+ return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression));
+ case 259:
return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment));
- case 261:
- return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression));
case 262:
- 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 263:
- return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike));
case 264:
- return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression));
case 265:
- 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 266:
- 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 267:
- return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments));
+ return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement));
case 268:
- 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 269:
- 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 270:
- 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 271:
- 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 272:
- return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression));
+ return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression));
case 273:
+ return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression));
+ case 274:
return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context));
- case 300:
- return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression));
case 301:
+ return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 302:
return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression));
default:
return node;
@@ -47568,52 +47882,52 @@ var ts;
var reduceNodes = cbNodeArray ? reduceNodeArray : ts.reduceLeft;
var cbNodes = cbNodeArray || cbNode;
var kind = node.kind;
- if ((kind > 0 && kind <= 144)) {
+ if ((kind > 0 && kind <= 145)) {
return initial;
}
- if ((kind >= 160 && kind <= 177)) {
+ if ((kind >= 161 && kind <= 178)) {
return initial;
}
var result = initial;
switch (node.kind) {
- case 211:
- case 214:
- case 205:
- case 230:
- case 299:
+ case 212:
+ case 215:
+ case 206:
+ case 231:
+ case 300:
break;
- case 145:
+ case 146:
result = reduceNode(node.left, cbNode, result);
result = reduceNode(node.right, cbNode, result);
break;
- case 146:
+ case 147:
result = reduceNode(node.expression, cbNode, result);
break;
- case 148:
+ case 149:
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 149:
+ case 150:
result = reduceNode(node.expression, cbNode, result);
break;
- case 150:
+ case 151:
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 151:
+ case 152:
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 153:
+ case 154:
result = reduceNodes(node.decorators, cbNodes, result);
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.name, cbNode, result);
@@ -47622,53 +47936,48 @@ var ts;
result = reduceNode(node.type, cbNode, result);
result = reduceNode(node.body, cbNode, result);
break;
- case 154:
- result = reduceNodes(node.modifiers, cbNodes, result);
- result = reduceNodes(node.parameters, cbNodes, result);
- result = reduceNode(node.body, cbNode, result);
- break;
case 155:
- 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.type, cbNode, result);
result = reduceNode(node.body, cbNode, result);
break;
case 156:
+ 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.type, cbNode, result);
+ result = reduceNode(node.body, cbNode, result);
+ break;
+ case 157:
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 179:
case 180:
+ case 181:
result = reduceNodes(node.elements, cbNodes, result);
break;
- case 181:
+ case 182:
result = reduceNode(node.propertyName, cbNode, result);
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.initializer, cbNode, result);
break;
- case 182:
+ case 183:
result = reduceNodes(node.elements, cbNodes, result);
break;
- case 183:
- result = reduceNodes(node.properties, cbNodes, result);
- break;
case 184:
- result = reduceNode(node.expression, cbNode, result);
- result = reduceNode(node.name, cbNode, result);
+ result = reduceNodes(node.properties, cbNodes, result);
break;
case 185:
result = reduceNode(node.expression, cbNode, result);
- result = reduceNode(node.argumentExpression, cbNode, result);
+ result = reduceNode(node.name, cbNode, result);
break;
case 186:
result = reduceNode(node.expression, cbNode, result);
- result = reduceNodes(node.typeArguments, cbNodes, result);
- result = reduceNodes(node.arguments, cbNodes, result);
+ result = reduceNode(node.argumentExpression, cbNode, result);
break;
case 187:
result = reduceNode(node.expression, cbNode, result);
@@ -47676,14 +47985,19 @@ var ts;
result = reduceNodes(node.arguments, cbNodes, result);
break;
case 188:
+ result = reduceNode(node.expression, cbNode, result);
+ result = reduceNodes(node.typeArguments, cbNodes, result);
+ result = reduceNodes(node.arguments, cbNodes, result);
+ break;
+ case 189:
result = reduceNode(node.tag, cbNode, result);
result = reduceNode(node.template, cbNode, result);
break;
- case 189:
+ case 190:
result = reduceNode(node.type, cbNode, result);
result = reduceNode(node.expression, cbNode, result);
break;
- case 191:
+ case 192:
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.name, cbNode, result);
result = reduceNodes(node.typeParameters, cbNodes, result);
@@ -47691,262 +48005,262 @@ var ts;
result = reduceNode(node.type, cbNode, result);
result = reduceNode(node.body, cbNode, result);
break;
- case 192:
+ case 193:
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 190:
- case 193:
+ case 191:
case 194:
case 195:
case 196:
- case 202:
+ case 197:
case 203:
- case 208:
+ case 204:
+ case 209:
result = reduceNode(node.expression, cbNode, result);
break;
- case 197:
case 198:
+ case 199:
result = reduceNode(node.operand, cbNode, result);
break;
- case 199:
+ case 200:
result = reduceNode(node.left, cbNode, result);
result = reduceNode(node.right, cbNode, result);
break;
- case 200:
+ case 201:
result = reduceNode(node.condition, cbNode, result);
result = reduceNode(node.whenTrue, cbNode, result);
result = reduceNode(node.whenFalse, cbNode, result);
break;
- case 201:
+ case 202:
result = reduceNode(node.head, cbNode, result);
result = reduceNodes(node.templateSpans, cbNodes, result);
break;
- case 204:
+ case 205:
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 206:
+ case 207:
result = reduceNode(node.expression, cbNode, result);
result = reduceNodes(node.typeArguments, cbNodes, result);
break;
- case 207:
+ case 208:
result = reduceNode(node.expression, cbNode, result);
result = reduceNode(node.type, cbNode, result);
break;
- case 210:
+ case 211:
result = reduceNode(node.expression, cbNode, result);
result = reduceNode(node.literal, cbNode, result);
break;
- case 212:
+ case 213:
result = reduceNodes(node.statements, cbNodes, result);
break;
- case 213:
+ case 214:
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.declarationList, cbNode, result);
break;
- case 215:
+ case 216:
result = reduceNode(node.expression, cbNode, result);
break;
- case 216:
+ case 217:
result = reduceNode(node.expression, cbNode, result);
result = reduceNode(node.thenStatement, cbNode, result);
result = reduceNode(node.elseStatement, cbNode, result);
break;
- case 217:
- result = reduceNode(node.statement, cbNode, result);
- result = reduceNode(node.expression, cbNode, result);
- break;
case 218:
- case 225:
- result = reduceNode(node.expression, cbNode, result);
result = reduceNode(node.statement, cbNode, result);
+ result = reduceNode(node.expression, cbNode, result);
break;
case 219:
+ case 226:
+ result = reduceNode(node.expression, cbNode, result);
+ result = reduceNode(node.statement, cbNode, result);
+ break;
+ case 220:
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 220:
case 221:
+ case 222:
result = reduceNode(node.initializer, cbNode, result);
result = reduceNode(node.expression, cbNode, result);
result = reduceNode(node.statement, cbNode, result);
break;
- case 224:
- case 228:
+ case 225:
+ case 229:
result = reduceNode(node.expression, cbNode, result);
break;
- case 226:
+ case 227:
result = reduceNode(node.expression, cbNode, result);
result = reduceNode(node.caseBlock, cbNode, result);
break;
- case 227:
+ case 228:
result = reduceNode(node.label, cbNode, result);
result = reduceNode(node.statement, cbNode, result);
break;
- case 229:
+ case 230:
result = reduceNode(node.tryBlock, cbNode, result);
result = reduceNode(node.catchClause, cbNode, result);
result = reduceNode(node.finallyBlock, cbNode, result);
break;
- case 231:
+ case 232:
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.type, cbNode, result);
result = reduceNode(node.initializer, cbNode, result);
break;
- case 232:
- result = reduceNodes(node.declarations, cbNodes, result);
- break;
case 233:
- result = reduceNodes(node.decorators, cbNodes, result);
- result = reduceNodes(node.modifiers, cbNodes, result);
- result = reduceNode(node.name, cbNode, 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);
+ result = reduceNodes(node.declarations, cbNodes, result);
break;
case 234:
result = reduceNodes(node.decorators, cbNodes, result);
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);
+ result = reduceNodes(node.parameters, cbNodes, result);
+ result = reduceNode(node.type, cbNode, result);
+ result = reduceNode(node.body, cbNode, result);
break;
- case 237:
+ case 235:
result = reduceNodes(node.decorators, cbNodes, result);
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 238:
result = reduceNodes(node.decorators, cbNodes, result);
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.name, cbNode, result);
- result = reduceNode(node.body, cbNode, result);
+ result = reduceNodes(node.members, cbNodes, result);
break;
case 239:
- result = reduceNodes(node.statements, cbNodes, result);
+ 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 240:
+ result = reduceNodes(node.statements, cbNodes, result);
+ break;
+ case 241:
result = reduceNodes(node.clauses, cbNodes, result);
break;
- case 242:
+ case 243:
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 243:
+ case 244:
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 244:
+ case 245:
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.namedBindings, cbNode, result);
break;
- case 245:
- result = reduceNode(node.name, cbNode, result);
- break;
case 246:
- case 250:
- result = reduceNodes(node.elements, cbNodes, result);
+ result = reduceNode(node.name, cbNode, result);
break;
case 247:
case 251:
+ result = reduceNodes(node.elements, cbNodes, result);
+ break;
+ case 248:
+ case 252:
result = reduceNode(node.propertyName, cbNode, result);
result = reduceNode(node.name, cbNode, result);
break;
- case 248:
+ case 249:
result = ts.reduceLeft(node.decorators, cbNode, result);
result = ts.reduceLeft(node.modifiers, cbNode, result);
result = reduceNode(node.expression, cbNode, result);
break;
- case 249:
+ case 250:
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 253:
+ case 254:
result = reduceNode(node.expression, cbNode, result);
break;
- case 254:
+ case 255:
result = reduceNode(node.openingElement, cbNode, result);
result = ts.reduceLeft(node.children, cbNode, result);
result = reduceNode(node.closingElement, cbNode, result);
break;
- case 258:
+ case 259:
result = reduceNode(node.openingFragment, cbNode, result);
result = ts.reduceLeft(node.children, cbNode, result);
result = reduceNode(node.closingFragment, cbNode, result);
break;
- case 255:
case 256:
+ case 257:
result = reduceNode(node.tagName, cbNode, result);
result = reduceNode(node.attributes, cbNode, result);
break;
- case 262:
+ case 263:
result = reduceNodes(node.properties, cbNodes, result);
break;
- case 257:
+ case 258:
result = reduceNode(node.tagName, cbNode, result);
break;
- case 261:
+ case 262:
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.initializer, cbNode, result);
break;
- case 263:
- result = reduceNode(node.expression, cbNode, result);
- break;
case 264:
result = reduceNode(node.expression, cbNode, result);
break;
case 265:
result = reduceNode(node.expression, cbNode, result);
+ break;
case 266:
+ result = reduceNode(node.expression, cbNode, result);
+ case 267:
result = reduceNodes(node.statements, cbNodes, result);
break;
- case 267:
+ case 268:
result = reduceNodes(node.types, cbNodes, result);
break;
- case 268:
+ case 269:
result = reduceNode(node.variableDeclaration, cbNode, result);
result = reduceNode(node.block, cbNode, result);
break;
- case 269:
+ case 270:
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.initializer, cbNode, result);
break;
- case 270:
+ case 271:
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.objectAssignmentInitializer, cbNode, result);
break;
- case 271:
+ case 272:
result = reduceNode(node.expression, cbNode, result);
break;
- case 272:
+ case 273:
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.initializer, cbNode, result);
break;
- case 273:
+ case 274:
result = reduceNodes(node.statements, cbNodes, result);
break;
- case 300:
+ case 301:
result = reduceNode(node.expression, cbNode, result);
break;
- case 301:
+ case 302:
result = reduceNodes(node.elements, cbNodes, result);
break;
default:
@@ -47960,8 +48274,8 @@ var ts;
return statements;
}
return ts.isNodeArray(statements)
- ? ts.setTextRange(ts.createNodeArray(ts.concatenate(declarations, statements)), statements)
- : ts.prependRange(statements, declarations);
+ ? ts.setTextRange(ts.createNodeArray(ts.prependStatements(statements.slice(), declarations)), statements)
+ : ts.prependStatements(statements, declarations);
}
ts.mergeLexicalEnvironment = mergeLexicalEnvironment;
function liftToBlock(nodes) {
@@ -47999,7 +48313,7 @@ var ts;
return subtreeFlags;
}
function aggregateTransformFlagsForSubtree(node) {
- if (ts.hasModifier(node, 2) || (ts.isTypeNode(node) && node.kind !== 206)) {
+ if (ts.hasModifier(node, 2) || (ts.isTypeNode(node) && node.kind !== 207)) {
return 0;
}
return reduceEachChild(node, 0, aggregateTransformFlagsForChildNode, aggregateTransformFlagsForChildNodes);
@@ -48040,7 +48354,7 @@ var ts;
});
Object.defineProperties(ts.objectAllocator.getTypeConstructor().prototype, {
__debugFlags: { get: function () { return ts.formatTypeFlags(this.flags); } },
- __debugObjectFlags: { get: function () { return this.flags & 65536 ? ts.formatObjectFlags(this.objectFlags) : ""; } },
+ __debugObjectFlags: { get: function () { return this.flags & 131072 ? ts.formatObjectFlags(this.objectFlags) : ""; } },
__debugTypeToString: { value: function () { return this.checker.typeToString(this); } },
});
var nodeConstructors = [
@@ -48089,12 +48403,12 @@ var ts;
return ts.some(node.elements, isNamedDefaultReference);
}
function isNamedDefaultReference(e) {
- return e.propertyName && e.propertyName.escapedText === "default";
+ return e.propertyName !== undefined && e.propertyName.escapedText === "default";
}
function chainBundle(transformSourceFile) {
return transformSourceFileOrBundle;
function transformSourceFileOrBundle(node) {
- return node.kind === 273 ? transformSourceFile(node) : transformBundle(node);
+ return node.kind === 274 ? transformSourceFile(node) : transformBundle(node);
}
function transformBundle(node) {
return ts.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends);
@@ -48122,7 +48436,7 @@ var ts;
}
ts.getImportNeedsImportStarHelper = getImportNeedsImportStarHelper;
function getImportNeedsImportDefaultHelper(node) {
- return !getImportNeedsImportStarHelper(node) && (ts.isDefaultImport(node) || (node.importClause && ts.isNamedImports(node.importClause.namedBindings) && containsDefaultReference(node.importClause.namedBindings)));
+ return !getImportNeedsImportStarHelper(node) && (ts.isDefaultImport(node) || (!!node.importClause && ts.isNamedImports(node.importClause.namedBindings) && containsDefaultReference(node.importClause.namedBindings)));
}
ts.getImportNeedsImportDefaultHelper = getImportNeedsImportDefaultHelper;
function collectExternalModuleInfo(sourceFile, resolver, compilerOptions) {
@@ -48138,16 +48452,16 @@ var ts;
for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {
var node = _a[_i];
switch (node.kind) {
- case 243:
+ case 244:
externalImports.push(node);
hasImportStarOrImportDefault = hasImportStarOrImportDefault || getImportNeedsImportStarHelper(node) || getImportNeedsImportDefaultHelper(node);
break;
- case 242:
- if (node.moduleReference.kind === 253) {
+ case 243:
+ if (node.moduleReference.kind === 254) {
externalImports.push(node);
}
break;
- case 249:
+ case 250:
if (node.moduleSpecifier) {
if (!node.exportClause) {
externalImports.push(node);
@@ -48174,12 +48488,12 @@ var ts;
}
}
break;
- case 248:
+ case 249:
if (node.isExportEquals && !exportEquals) {
exportEquals = node;
}
break;
- case 213:
+ case 214:
if (ts.hasModifier(node, 1)) {
for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) {
var decl = _e[_d];
@@ -48187,7 +48501,7 @@ var ts;
}
}
break;
- case 233:
+ case 234:
if (ts.hasModifier(node, 1)) {
if (ts.hasModifier(node, 512)) {
if (!hasExportDefault) {
@@ -48205,7 +48519,7 @@ var ts;
}
}
break;
- case 234:
+ case 235:
if (ts.hasModifier(node, 1)) {
if (ts.hasModifier(node, 512)) {
if (!hasExportDefault) {
@@ -48307,7 +48621,7 @@ var ts;
var flattenContext = {
context: context,
level: level,
- downlevelIteration: context.getCompilerOptions().downlevelIteration,
+ downlevelIteration: !!context.getCompilerOptions().downlevelIteration,
hoistTempVariables: true,
emitExpression: emitExpression,
emitBindingOrAssignment: emitBindingOrAssignment,
@@ -48372,13 +48686,14 @@ var ts;
return false;
}
function flattenDestructuringBinding(node, visitor, context, level, rval, hoistTempVariables, skipInitializer) {
+ if (hoistTempVariables === void 0) { hoistTempVariables = false; }
var pendingExpressions;
var pendingDeclarations = [];
var declarations = [];
var flattenContext = {
context: context,
level: level,
- downlevelIteration: context.getCompilerOptions().downlevelIteration,
+ downlevelIteration: !!context.getCompilerOptions().downlevelIteration,
hoistTempVariables: hoistTempVariables,
emitExpression: emitExpression,
emitBindingOrAssignment: emitBindingOrAssignment,
@@ -48404,7 +48719,7 @@ var ts;
}
else {
context.hoistVariableDeclaration(temp);
- var pendingDeclaration = ts.lastOrUndefined(pendingDeclarations);
+ var pendingDeclaration = ts.last(pendingDeclarations);
pendingDeclaration.pendingExpressions = ts.append(pendingDeclaration.pendingExpressions, ts.createAssignment(temp, pendingDeclaration.value));
ts.addRange(pendingDeclaration.pendingExpressions, pendingExpressions);
pendingDeclaration.value = temp;
@@ -48649,8 +48964,8 @@ var ts;
var previousOnSubstituteNode = context.onSubstituteNode;
context.onEmitNode = onEmitNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableSubstitution(184);
context.enableSubstitution(185);
+ context.enableSubstitution(186);
var currentSourceFile;
var currentNamespace;
var currentNamespaceContainerName;
@@ -48662,14 +48977,14 @@ var ts;
var pendingExpressions;
return transformSourceFileOrBundle;
function transformSourceFileOrBundle(node) {
- if (node.kind === 274) {
+ if (node.kind === 275) {
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 === 276) {
+ if (prepend.kind === 277) {
return ts.createUnparsedSourceFile(prepend.javascriptText);
}
return prepend;
@@ -48698,15 +49013,15 @@ var ts;
}
function onBeforeVisitNode(node) {
switch (node.kind) {
- case 273:
+ case 274:
+ case 241:
case 240:
- case 239:
- case 212:
+ case 213:
currentScope = node;
currentScopeFirstDeclarationsOfName = undefined;
break;
+ case 235:
case 234:
- case 233:
if (ts.hasModifier(node, 2)) {
break;
}
@@ -48714,7 +49029,7 @@ var ts;
recordEmittedDeclarationInScope(node);
}
else {
- ts.Debug.assert(node.kind === 234 || ts.hasModifier(node, 512));
+ ts.Debug.assert(node.kind === 235 || ts.hasModifier(node, 512));
}
break;
}
@@ -48736,10 +49051,10 @@ var ts;
}
function sourceElementVisitorWorker(node) {
switch (node.kind) {
+ case 244:
case 243:
- case 242:
- case 248:
case 249:
+ case 250:
return visitEllidableStatement(node);
default:
return visitorWorker(node);
@@ -48754,13 +49069,13 @@ var ts;
return node;
}
switch (node.kind) {
- case 243:
+ case 244:
return visitImportDeclaration(node);
- case 242:
+ case 243:
return visitImportEqualsDeclaration(node);
- case 248:
- return visitExportAssignment(node);
case 249:
+ return visitExportAssignment(node);
+ case 250:
return visitExportDeclaration(node);
default:
ts.Debug.fail("Unhandled ellided statement");
@@ -48770,11 +49085,11 @@ var ts;
return saveStateAndInvoke(node, namespaceElementVisitorWorker);
}
function namespaceElementVisitorWorker(node) {
- if (node.kind === 249 ||
- node.kind === 243 ||
+ if (node.kind === 250 ||
node.kind === 244 ||
- (node.kind === 242 &&
- node.moduleReference.kind === 253)) {
+ node.kind === 245 ||
+ (node.kind === 243 &&
+ node.moduleReference.kind === 254)) {
return undefined;
}
else if (node.transformFlags & 1 || ts.hasModifier(node, 1)) {
@@ -48790,15 +49105,15 @@ var ts;
}
function classElementVisitorWorker(node) {
switch (node.kind) {
- case 154:
- return undefined;
- case 151:
- case 159:
case 155:
+ return undefined;
+ case 152:
+ case 160:
case 156:
- case 153:
+ case 157:
+ case 154:
return visitorWorker(node);
- case 211:
+ case 212:
return node;
default:
return ts.Debug.failBadSyntaxKind(node);
@@ -48828,87 +49143,88 @@ var ts;
case 76:
case 124:
case 132:
- case 166:
case 167:
- case 165:
- case 160:
- case 147:
+ case 168:
+ case 166:
+ case 161:
+ case 148:
case 119:
+ case 142:
case 122:
case 137:
case 134:
case 131:
case 105:
case 138:
- case 163:
- case 162:
case 164:
- case 161:
- case 168:
+ case 163:
+ case 165:
+ case 162:
case 169:
case 170:
- case 172:
+ case 171:
case 173:
case 174:
case 175:
case 176:
case 177:
- case 159:
- case 149:
- case 236:
- return undefined;
- case 151:
- return visitPropertyDeclaration(node);
- case 241:
- return undefined;
- case 154:
- return visitConstructor(node);
- case 235:
- return ts.createNotEmittedStatement(node);
- case 234:
- return visitClassDeclaration(node);
- case 204:
- return visitClassExpression(node);
- case 267:
- return visitHeritageClause(node);
- case 206:
- return visitExpressionWithTypeArguments(node);
- case 153:
- return visitMethodDeclaration(node);
- case 155:
- return visitGetAccessor(node);
- case 156:
- return visitSetAccessor(node);
- case 233:
- return visitFunctionDeclaration(node);
- case 191:
- return visitFunctionExpression(node);
- case 192:
- return visitArrowFunction(node);
- case 148:
- return visitParameter(node);
- case 190:
- return visitParenthesizedExpression(node);
- case 189:
- case 207:
- return visitAssertionExpression(node);
- case 186:
- return visitCallExpression(node);
- case 187:
- return visitNewExpression(node);
- case 188:
- return visitTaggedTemplateExpression(node);
- case 208:
- return visitNonNullExpression(node);
+ case 178:
+ case 160:
+ case 150:
case 237:
- return visitEnumDeclaration(node);
- case 213:
- return visitVariableStatement(node);
- case 231:
- return visitVariableDeclaration(node);
- case 238:
- return visitModuleDeclaration(node);
+ return undefined;
+ case 152:
+ return visitPropertyDeclaration(node);
case 242:
+ return undefined;
+ case 155:
+ return visitConstructor(node);
+ case 236:
+ return ts.createNotEmittedStatement(node);
+ case 235:
+ return visitClassDeclaration(node);
+ case 205:
+ return visitClassExpression(node);
+ case 268:
+ return visitHeritageClause(node);
+ case 207:
+ return visitExpressionWithTypeArguments(node);
+ case 154:
+ return visitMethodDeclaration(node);
+ case 156:
+ return visitGetAccessor(node);
+ case 157:
+ return visitSetAccessor(node);
+ case 234:
+ return visitFunctionDeclaration(node);
+ case 192:
+ return visitFunctionExpression(node);
+ case 193:
+ return visitArrowFunction(node);
+ case 149:
+ return visitParameter(node);
+ case 191:
+ return visitParenthesizedExpression(node);
+ case 190:
+ case 208:
+ return visitAssertionExpression(node);
+ case 187:
+ return visitCallExpression(node);
+ case 188:
+ return visitNewExpression(node);
+ case 189:
+ return visitTaggedTemplateExpression(node);
+ case 209:
+ return visitNonNullExpression(node);
+ case 238:
+ return visitEnumDeclaration(node);
+ case 214:
+ return visitVariableStatement(node);
+ case 232:
+ return visitVariableDeclaration(node);
+ case 239:
+ return visitModuleDeclaration(node);
+ case 243:
return visitImportEqualsDeclaration(node);
default:
return ts.Debug.failBadSyntaxKind(node);
@@ -48916,7 +49232,8 @@ var ts;
}
function visitSourceFile(node) {
var alwaysStrict = ts.getStrictOptionValue(compilerOptions, "alwaysStrict") &&
- !(ts.isExternalModule(node) && moduleKind >= ts.ModuleKind.ES2015);
+ !(ts.isExternalModule(node) && moduleKind >= ts.ModuleKind.ES2015) &&
+ !ts.isJsonSourceFile(node);
return ts.updateSourceFileNode(node, ts.visitLexicalEnvironment(node.statements, sourceElementVisitor, context, 0, alwaysStrict));
}
function shouldEmitDecorateCallForClass(node) {
@@ -48986,7 +49303,7 @@ var ts;
statement.pos = closingBraceLocation.pos;
ts.setEmitFlags(statement, 1536 | 384);
statements.push(statement);
- ts.prependRange(statements, context.endLexicalEnvironment());
+ ts.prependStatements(statements, context.endLexicalEnvironment());
var iife = ts.createImmediatelyInvokedArrowFunction(statements);
ts.setEmitFlags(iife, 33554432);
var varStatement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
@@ -49128,7 +49445,7 @@ var ts;
return index;
}
var statement = statements[index];
- if (statement.kind === 215 && ts.isSuperCall(statement.expression)) {
+ if (statement.kind === 216 && ts.isSuperCall(statement.expression)) {
result.push(ts.visitNode(statement, visitor, ts.isStatement));
return index + 1;
}
@@ -49162,7 +49479,7 @@ var ts;
return isInitializedProperty(member, false);
}
function isInitializedProperty(member, isStatic) {
- return member.kind === 151
+ return member.kind === 152
&& isStatic === ts.hasModifier(member, 32)
&& member.initializer !== undefined;
}
@@ -49237,12 +49554,12 @@ var ts;
}
function getAllDecoratorsOfClassElement(node, member) {
switch (member.kind) {
- case 155:
case 156:
+ case 157:
return getAllDecoratorsOfAccessors(node, member);
- case 153:
+ case 154:
return getAllDecoratorsOfMethod(member);
- case 151:
+ case 152:
return getAllDecoratorsOfProperty(member);
default:
return undefined;
@@ -49321,7 +49638,7 @@ var ts;
var prefix = getClassMemberPrefix(node, member);
var memberName = getExpressionForPropertyName(member, true);
var descriptor = languageVersion > 0
- ? member.kind === 151
+ ? member.kind === 152
? ts.createVoidZero()
: ts.createNull()
: undefined;
@@ -49405,37 +49722,37 @@ var ts;
}
function shouldAddTypeMetadata(node) {
var kind = node.kind;
- return kind === 153
- || kind === 155
+ return kind === 154
|| kind === 156
- || kind === 151;
+ || kind === 157
+ || kind === 152;
}
function shouldAddReturnTypeMetadata(node) {
- return node.kind === 153;
+ return node.kind === 154;
}
function shouldAddParamTypesMetadata(node) {
switch (node.kind) {
- case 234:
- case 204:
+ case 235:
+ case 205:
return ts.getFirstConstructorWithBody(node) !== undefined;
- case 153:
- case 155:
+ case 154:
case 156:
+ case 157:
return true;
}
return false;
}
function serializeTypeOfNode(node) {
switch (node.kind) {
- case 151:
- case 148:
- case 155:
- return serializeTypeNode(node.type);
+ case 152:
+ case 149:
case 156:
+ return serializeTypeNode(node.type);
+ case 157:
return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node));
- case 234:
- case 204:
- case 153:
+ case 235:
+ case 205:
+ case 154:
return ts.createIdentifier("Function");
default:
return ts.createVoidZero();
@@ -49467,7 +49784,7 @@ var ts;
return ts.createArrayLiteral(expressions);
}
function getParametersOfDecoratedDeclaration(node, container) {
- if (container && node.kind === 155) {
+ if (container && node.kind === 156) {
var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor;
if (setAccessor) {
return setAccessor.parameters;
@@ -49494,22 +49811,22 @@ var ts;
case 95:
case 131:
return ts.createVoidZero();
- case 172:
+ case 173:
return serializeTypeNode(node.type);
- case 162:
case 163:
+ case 164:
return ts.createIdentifier("Function");
- case 166:
case 167:
+ case 168:
return ts.createIdentifier("Array");
- case 160:
+ case 161:
case 122:
return ts.createIdentifier("Boolean");
case 137:
return ts.createIdentifier("String");
case 135:
return ts.createIdentifier("Object");
- case 177:
+ case 178:
switch (node.literal.kind) {
case 9:
return ts.createIdentifier("String");
@@ -49527,18 +49844,19 @@ var ts;
return languageVersion < 2
? getGlobalSymbolNameWithFallback()
: ts.createIdentifier("Symbol");
- case 161:
+ case 162:
return serializeTypeReferenceNode(node);
+ case 170:
case 169:
- case 168:
return serializeUnionOrIntersectionType(node);
- case 164:
- case 174:
+ case 165:
case 175:
case 176:
- case 165:
+ case 177:
+ case 166:
case 119:
- case 173:
+ case 142:
+ case 174:
break;
default:
return ts.Debug.failBadSyntaxKind(node);
@@ -49549,7 +49867,7 @@ var ts;
var serializedUnion;
for (var _i = 0, _a = node.types; _i < _a.length; _i++) {
var typeNode = _a[_i];
- while (typeNode.kind === 172) {
+ while (typeNode.kind === 173) {
typeNode = typeNode.type;
}
if (typeNode.kind === 131) {
@@ -49576,7 +49894,8 @@ var ts;
return serializedUnion || ts.createVoidZero();
}
function serializeTypeReferenceNode(node) {
- switch (resolver.getTypeReferenceSerializationKind(node.typeName, currentScope)) {
+ var kind = resolver.getTypeReferenceSerializationKind(node.typeName, currentScope);
+ switch (kind) {
case ts.TypeReferenceSerializationKind.Unknown:
var serialized = serializeEntityNameAsExpression(node.typeName, true);
var temp = ts.createTempVariable(hoistVariableDeclaration);
@@ -49602,8 +49921,9 @@ var ts;
case ts.TypeReferenceSerializationKind.Promise:
return ts.createIdentifier("Promise");
case ts.TypeReferenceSerializationKind.ObjectType:
- default:
return ts.createIdentifier("Object");
+ default:
+ return ts.Debug.assertNever(kind);
}
}
function serializeEntityNameAsExpression(node, useFallback) {
@@ -49617,7 +49937,7 @@ var ts;
return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name), ts.createLiteral("undefined")), name);
}
return name;
- case 145:
+ case 146:
return serializeQualifiedNameAsExpression(node, useFallback);
}
}
@@ -49872,7 +50192,7 @@ var ts;
var statements = [];
startLexicalEnvironment();
var members = ts.map(node.members, transformEnumMember);
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
ts.addRange(statements, members);
currentNamespaceContainerName = savedCurrentNamespaceLocalName;
return ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), node.members), true);
@@ -49902,7 +50222,7 @@ var ts;
}
}
function shouldEmitModuleDeclaration(node) {
- return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules);
+ return ts.isInstantiatedModule(node, !!compilerOptions.preserveConstEnums || !!compilerOptions.isolatedModules);
}
function hasNamespaceQualifiedExportName(node) {
return isExportOfNamespace(node)
@@ -49934,11 +50254,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))
- ], currentScope.kind === 273 ? 0 : 1));
+ ], currentScope.kind === 274 ? 0 : 1));
ts.setOriginalNode(statement, node);
recordEmittedDeclarationInScope(node);
if (isFirstEmittedDeclarationInScope(node)) {
- if (node.kind === 237) {
+ if (node.kind === 238) {
ts.setSourceMapRange(statement.declarationList, node);
}
else {
@@ -49999,7 +50319,7 @@ var ts;
var statementsLocation;
var blockLocation;
var body = node.body;
- if (body.kind === 239) {
+ if (body.kind === 240) {
saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); });
statementsLocation = body.statements;
blockLocation = body;
@@ -50017,19 +50337,19 @@ var ts;
var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body;
statementsLocation = ts.moveRangePos(moduleBlock.statements, -1);
}
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
currentNamespaceContainerName = savedCurrentNamespaceContainerName;
currentNamespace = savedCurrentNamespace;
currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName;
var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), true);
ts.setTextRange(block, blockLocation);
- if (body.kind !== 239) {
+ if (body.kind !== 240) {
ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536);
}
return block;
}
function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) {
- if (moduleDeclaration.body.kind === 238) {
+ if (moduleDeclaration.body.kind === 239) {
var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body);
return recursiveInnerModule || moduleDeclaration.body;
}
@@ -50049,7 +50369,7 @@ var ts;
return (name || namedBindings) ? ts.updateImportClause(node, name, namedBindings) : undefined;
}
function visitNamedImportBindings(node) {
- if (node.kind === 245) {
+ if (node.kind === 246) {
return resolver.isReferencedAliasDeclaration(node) ? node : undefined;
}
else {
@@ -50184,15 +50504,15 @@ var ts;
if ((enabledSubstitutions & 2) === 0) {
enabledSubstitutions |= 2;
context.enableSubstitution(71);
- context.enableSubstitution(270);
- context.enableEmitNotification(238);
+ context.enableSubstitution(271);
+ context.enableEmitNotification(239);
}
}
function isTransformedModuleDeclaration(node) {
- return ts.getOriginalNode(node).kind === 238;
+ return ts.getOriginalNode(node).kind === 239;
}
function isTransformedEnumDeclaration(node) {
- return ts.getOriginalNode(node).kind === 237;
+ return ts.getOriginalNode(node).kind === 238;
}
function onEmitNode(hint, node, emitCallback) {
var savedApplicableSubstitutions = applicableSubstitutions;
@@ -50238,9 +50558,9 @@ var ts;
switch (node.kind) {
case 71:
return substituteExpressionIdentifier(node);
- case 184:
- return substitutePropertyAccessExpression(node);
case 185:
+ return substitutePropertyAccessExpression(node);
+ case 186:
return substituteElementAccessExpression(node);
}
return node;
@@ -50270,9 +50590,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 !== 273) {
- var substitute = (applicableSubstitutions & 2 && container.kind === 238) ||
- (applicableSubstitutions & 8 && container.kind === 237);
+ if (container && container.kind !== 274) {
+ var substitute = (applicableSubstitutions & 2 && container.kind === 239) ||
+ (applicableSubstitutions & 8 && container.kind === 238);
if (substitute) {
return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), node);
}
@@ -50385,15 +50705,15 @@ var ts;
switch (node.kind) {
case 120:
return undefined;
- case 196:
+ case 197:
return visitAwaitExpression(node);
- case 153:
+ case 154:
return visitMethodDeclaration(node);
- case 233:
+ case 234:
return visitFunctionDeclaration(node);
- case 191:
- return visitFunctionExpression(node);
case 192:
+ return visitFunctionExpression(node);
+ case 193:
return visitArrowFunction(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -50402,27 +50722,27 @@ var ts;
function asyncBodyVisitor(node) {
if (ts.isNodeWithPossibleHoistedDeclaration(node)) {
switch (node.kind) {
- case 213:
+ case 214:
return visitVariableStatementInAsyncBody(node);
- case 219:
- return visitForStatementInAsyncBody(node);
case 220:
- return visitForInStatementInAsyncBody(node);
+ return visitForStatementInAsyncBody(node);
case 221:
+ return visitForInStatementInAsyncBody(node);
+ case 222:
return visitForOfStatementInAsyncBody(node);
- case 268:
+ case 269:
return visitCatchClauseInAsyncBody(node);
- case 212:
- case 226:
- case 240:
- case 265:
- case 266:
- case 229:
- case 217:
- case 218:
- case 216:
- case 225:
+ case 213:
case 227:
+ case 241:
+ case 266:
+ case 267:
+ case 230:
+ case 218:
+ case 219:
+ case 217:
+ case 226:
+ case 228:
return ts.visitEachChild(node, asyncBodyVisitor, context);
default:
return ts.Debug.assertNever(node, "Unhandled node.");
@@ -50471,8 +50791,9 @@ var ts;
: ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, ts.liftToBlock));
}
function visitForStatementInAsyncBody(node) {
- return ts.updateFor(node, isVariableDeclarationListWithCollidingName(node.initializer)
- ? visitVariableDeclarationListWithCollidingNames(node.initializer, false)
+ var initializer = node.initializer;
+ return ts.updateFor(node, isVariableDeclarationListWithCollidingName(initializer)
+ ? visitVariableDeclarationListWithCollidingNames(initializer, false)
: ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, ts.liftToBlock));
}
function visitAwaitExpression(node) {
@@ -50513,10 +50834,10 @@ var ts;
}
}
function isVariableDeclarationListWithCollidingName(node) {
- return node
+ return !!node
&& ts.isVariableDeclarationList(node)
&& !(node.flags & 3)
- && ts.forEach(node.declarations, collidesWithParameterName);
+ && node.declarations.some(collidesWithParameterName);
}
function visitVariableDeclarationListWithCollidingNames(node, hasReceiver) {
hoistVariableDeclarationList(node);
@@ -50570,7 +50891,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 === 192;
+ var isArrowFunction = node.kind === 193;
var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0;
var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames;
enclosingFunctionParameterNames = ts.createUnderscoreEscapedMap();
@@ -50583,7 +50904,7 @@ var ts;
var statements = [];
var statementOffset = ts.addPrologue(statements, node.body.statements, false, visitor);
statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformAsyncFunctionBodyWorker(node.body, statementOffset))));
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
var block = ts.createBlock(statements, true);
ts.setTextRange(block, node.body);
if (languageVersion >= 2) {
@@ -50634,14 +50955,14 @@ var ts;
function enableSubstitutionForAsyncMethodsWithSuper() {
if ((enabledSubstitutions & 1) === 0) {
enabledSubstitutions |= 1;
- context.enableSubstitution(186);
- context.enableSubstitution(184);
+ context.enableSubstitution(187);
context.enableSubstitution(185);
- context.enableEmitNotification(234);
- context.enableEmitNotification(153);
- context.enableEmitNotification(155);
- context.enableEmitNotification(156);
+ context.enableSubstitution(186);
+ context.enableEmitNotification(235);
context.enableEmitNotification(154);
+ context.enableEmitNotification(156);
+ context.enableEmitNotification(157);
+ context.enableEmitNotification(155);
}
}
function onEmitNode(hint, node, emitCallback) {
@@ -50666,11 +50987,11 @@ var ts;
}
function substituteExpression(node) {
switch (node.kind) {
- case 184:
- return substitutePropertyAccessExpression(node);
case 185:
- return substituteElementAccessExpression(node);
+ return substitutePropertyAccessExpression(node);
case 186:
+ return substituteElementAccessExpression(node);
+ case 187:
return substituteCallExpression(node);
}
return node;
@@ -50701,11 +51022,11 @@ var ts;
}
function isSuperContainer(node) {
var kind = node.kind;
- return kind === 234
- || kind === 154
- || kind === 153
+ return kind === 235
|| kind === 155
- || kind === 156;
+ || kind === 154
+ || kind === 156
+ || kind === 157;
}
function createSuperAccessInAsyncMethod(argumentExpression, location) {
if (enclosingSuperContainerFlags & 4096) {
@@ -50785,45 +51106,47 @@ var ts;
return node;
}
switch (node.kind) {
- case 196:
+ case 197:
return visitAwaitExpression(node);
- case 202:
+ case 203:
return visitYieldExpression(node);
- case 227:
+ case 225:
+ return visitReturnStatement(node);
+ case 228:
return visitLabeledStatement(node);
- case 183:
+ case 184:
return visitObjectLiteralExpression(node);
- case 199:
+ case 200:
return visitBinaryExpression(node, noDestructuringValue);
- case 231:
+ case 232:
return visitVariableDeclaration(node);
- case 221:
+ case 222:
return visitForOfStatement(node, undefined);
- case 219:
+ case 220:
return visitForStatement(node);
- case 195:
+ case 196:
return visitVoidExpression(node);
- case 154:
- return visitConstructorDeclaration(node);
- case 153:
- return visitMethodDeclaration(node);
case 155:
- return visitGetAccessorDeclaration(node);
+ return visitConstructorDeclaration(node);
+ case 154:
+ return visitMethodDeclaration(node);
case 156:
+ return visitGetAccessorDeclaration(node);
+ case 157:
return visitSetAccessorDeclaration(node);
- case 233:
+ case 234:
return visitFunctionDeclaration(node);
- case 191:
- return visitFunctionExpression(node);
case 192:
+ return visitFunctionExpression(node);
+ case 193:
return visitArrowFunction(node);
- case 148:
+ case 149:
return visitParameter(node);
- case 215:
+ case 216:
return visitExpressionStatement(node);
- case 190:
+ case 191:
return visitParenthesizedExpression(node, noDestructuringValue);
- case 268:
+ case 269:
return visitCatchClause(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -50847,10 +51170,16 @@ var ts;
}
return ts.visitEachChild(node, visitor, context);
}
+ function visitReturnStatement(node) {
+ if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) {
+ return ts.updateReturn(node, createDownlevelAwait(node.expression ? ts.visitNode(node.expression, visitor, ts.isExpression) : ts.createVoidZero()));
+ }
+ return ts.visitEachChild(node, visitor, context);
+ }
function visitLabeledStatement(node) {
if (enclosingFunctionFlags & 2) {
var statement = ts.unwrapInnermostStatementOfLabel(node);
- if (statement.kind === 221 && statement.awaitModifier) {
+ if (statement.kind === 222 && statement.awaitModifier) {
return visitForOfStatement(statement, node);
}
return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node);
@@ -50862,7 +51191,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 === 271) {
+ if (e.kind === 272) {
if (chunkObject) {
objects.push(ts.createObjectLiteral(chunkObject));
chunkObject = undefined;
@@ -50871,7 +51200,7 @@ var ts;
objects.push(ts.visitNode(target, visitor, ts.isExpression));
}
else {
- chunkObject = ts.append(chunkObject, e.kind === 269
+ chunkObject = ts.append(chunkObject, e.kind === 270
? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression))
: ts.visitNode(e, visitor, ts.isObjectLiteralElementLike));
}
@@ -50884,7 +51213,7 @@ var ts;
function visitObjectLiteralExpression(node) {
if (node.transformFlags & 1048576) {
var objects = chunkObjectLiteralElements(node.properties);
- if (objects.length && objects[0].kind !== 183) {
+ if (objects.length && objects[0].kind !== 184) {
objects.unshift(ts.createObjectLiteral());
}
return createAssignHelper(context, objects);
@@ -50996,7 +51325,7 @@ var ts;
var forStatement = ts.setEmitFlags(ts.setTextRange(ts.createFor(ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([
ts.setTextRange(ts.createVariableDeclaration(iterator, undefined, callValues), node.expression),
ts.createVariableDeclaration(result)
- ]), node.expression), 2097152), ts.createComma(ts.createAssignment(result, createDownlevelAwait(callNext)), ts.createLogicalNot(getDone)), undefined, convertForOfStatementHead(node, createDownlevelAwait(getValue))), node), 256);
+ ]), node.expression), 2097152), ts.createComma(ts.createAssignment(result, createDownlevelAwait(callNext)), ts.createLogicalNot(getDone)), undefined, convertForOfStatementHead(node, getValue)), node), 256);
return ts.createTry(ts.createBlock([
ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement)
]), ts.createCatchClause(ts.createVariableDeclaration(catchVariable), ts.setEmitFlags(ts.createBlock([
@@ -51090,7 +51419,7 @@ var ts;
var statementOffset = ts.addPrologue(statements, node.body.statements, false, visitor);
appendObjectRestAssignmentsIfNeeded(statements, node);
statements.push(ts.createReturn(createAsyncGeneratorHelper(context, ts.createFunctionExpression(undefined, ts.createToken(39), node.name && ts.getGeneratedNameForNode(node.name), undefined, [], undefined, ts.updateBlock(node.body, ts.visitLexicalEnvironment(node.body.statements, visitor, context, statementOffset))))));
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
var block = ts.updateBlock(node.body, statements);
if (languageVersion >= 2) {
if (resolver.getNodeCheckFlags(node) & 4096) {
@@ -51116,7 +51445,7 @@ var ts;
var leadingStatements = endLexicalEnvironment();
if (statementOffset > 0 || ts.some(statements) || ts.some(leadingStatements)) {
var block = ts.convertToFunctionBody(body, true);
- ts.prependRange(statements, leadingStatements);
+ ts.prependStatements(statements, leadingStatements);
ts.addRange(statements, block.statements.slice(statementOffset));
return ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(statements), block.statements));
}
@@ -51140,14 +51469,14 @@ var ts;
function enableSubstitutionForAsyncMethodsWithSuper() {
if ((enabledSubstitutions & 1) === 0) {
enabledSubstitutions |= 1;
- context.enableSubstitution(186);
- context.enableSubstitution(184);
+ context.enableSubstitution(187);
context.enableSubstitution(185);
- context.enableEmitNotification(234);
- context.enableEmitNotification(153);
- context.enableEmitNotification(155);
- context.enableEmitNotification(156);
+ context.enableSubstitution(186);
+ context.enableEmitNotification(235);
context.enableEmitNotification(154);
+ context.enableEmitNotification(156);
+ context.enableEmitNotification(157);
+ context.enableEmitNotification(155);
}
}
function onEmitNode(hint, node, emitCallback) {
@@ -51172,11 +51501,11 @@ var ts;
}
function substituteExpression(node) {
switch (node.kind) {
- case 184:
- return substitutePropertyAccessExpression(node);
case 185:
- return substituteElementAccessExpression(node);
+ return substitutePropertyAccessExpression(node);
case 186:
+ return substituteElementAccessExpression(node);
+ case 187:
return substituteCallExpression(node);
}
return node;
@@ -51207,11 +51536,11 @@ var ts;
}
function isSuperContainer(node) {
var kind = node.kind;
- return kind === 234
- || kind === 154
- || kind === 153
+ return kind === 235
|| kind === 155
- || kind === 156;
+ || kind === 154
+ || kind === 156
+ || kind === 157;
}
function createSuperAccessInAsyncMethod(argumentExpression, location) {
if (enclosingSuperContainerFlags & 4096) {
@@ -51306,13 +51635,13 @@ var ts;
}
function visitorWorker(node) {
switch (node.kind) {
- case 254:
- return visitJsxElement(node, false);
case 255:
+ return visitJsxElement(node, false);
+ case 256:
return visitJsxSelfClosingElement(node, false);
- case 258:
+ case 259:
return visitJsxFragment(node, false);
- case 264:
+ case 265:
return visitJsxExpression(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -51322,13 +51651,13 @@ var ts;
switch (node.kind) {
case 10:
return visitJsxText(node);
- case 264:
+ case 265:
return visitJsxExpression(node);
- case 254:
- return visitJsxElement(node, true);
case 255:
+ return visitJsxElement(node, true);
+ case 256:
return visitJsxSelfClosingElement(node, true);
- case 258:
+ case 259:
return visitJsxFragment(node, true);
default:
return ts.Debug.failBadSyntaxKind(node);
@@ -51392,7 +51721,7 @@ var ts;
literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile);
return ts.setTextRange(literal, node);
}
- else if (node.kind === 264) {
+ else if (node.kind === 265) {
if (node.expression === undefined) {
return ts.createTrue();
}
@@ -51452,7 +51781,7 @@ var ts;
return decoded === text ? undefined : decoded;
}
function getTagName(node) {
- if (node.kind === 254) {
+ if (node.kind === 255) {
return getTagName(node.openingElement);
}
else {
@@ -51752,7 +52081,7 @@ var ts;
return node;
}
switch (node.kind) {
- case 199:
+ case 200:
return visitBinaryExpression(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -51841,14 +52170,14 @@ var ts;
hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -16384 | ancestorFacts;
}
function isReturnVoidStatementInConstructorWithCapturedSuper(node) {
- return hierarchyFacts & 4096
- && node.kind === 224
+ return (hierarchyFacts & 4096) !== 0
+ && node.kind === 225
&& !node.expression;
}
function shouldVisitNode(node) {
return (node.transformFlags & 128) !== 0
|| convertedLoopState !== undefined
- || (hierarchyFacts & 4096 && (ts.isStatement(node) || (node.kind === 212)))
+ || (hierarchyFacts & 4096 && (ts.isStatement(node) || (node.kind === 213)))
|| (ts.isIterationStatement(node, false) && shouldConvertIterationStatementBody(node))
|| (ts.getEmitFlags(node) & 33554432) !== 0;
}
@@ -51876,63 +52205,63 @@ var ts;
switch (node.kind) {
case 115:
return undefined;
- case 234:
+ case 235:
return visitClassDeclaration(node);
- case 204:
+ case 205:
return visitClassExpression(node);
- case 148:
+ case 149:
return visitParameter(node);
- case 233:
+ case 234:
return visitFunctionDeclaration(node);
- case 192:
+ case 193:
return visitArrowFunction(node);
- case 191:
+ case 192:
return visitFunctionExpression(node);
- case 231:
+ case 232:
return visitVariableDeclaration(node);
case 71:
return visitIdentifier(node);
- case 232:
+ case 233:
return visitVariableDeclarationList(node);
- case 226:
- return visitSwitchStatement(node);
- case 240:
- return visitCaseBlock(node);
- case 212:
- return visitBlock(node, false);
- case 223:
- case 222:
- return visitBreakOrContinueStatement(node);
case 227:
+ return visitSwitchStatement(node);
+ case 241:
+ return visitCaseBlock(node);
+ case 213:
+ return visitBlock(node, false);
+ case 224:
+ case 223:
+ return visitBreakOrContinueStatement(node);
+ case 228:
return visitLabeledStatement(node);
- case 217:
case 218:
- return visitDoOrWhileStatement(node, undefined);
case 219:
- return visitForStatement(node, undefined);
+ return visitDoOrWhileStatement(node, undefined);
case 220:
- return visitForInStatement(node, undefined);
+ return visitForStatement(node, undefined);
case 221:
+ return visitForInStatement(node, undefined);
+ case 222:
return visitForOfStatement(node, undefined);
- case 215:
+ case 216:
return visitExpressionStatement(node);
- case 183:
+ case 184:
return visitObjectLiteralExpression(node);
- case 268:
+ case 269:
return visitCatchClause(node);
- case 270:
+ case 271:
return visitShorthandPropertyAssignment(node);
- case 146:
+ case 147:
return visitComputedPropertyName(node);
- case 182:
+ case 183:
return visitArrayLiteralExpression(node);
- case 186:
- return visitCallExpression(node);
case 187:
+ return visitCallExpression(node);
+ case 188:
return visitNewExpression(node);
- case 190:
+ case 191:
return visitParenthesizedExpression(node, true);
- case 199:
+ case 200:
return visitBinaryExpression(node, true);
case 13:
case 14:
@@ -51943,28 +52272,28 @@ var ts;
return visitStringLiteral(node);
case 8:
return visitNumericLiteral(node);
- case 188:
+ case 189:
return visitTaggedTemplateExpression(node);
- case 201:
- return visitTemplateExpression(node);
case 202:
- return visitYieldExpression(node);
+ return visitTemplateExpression(node);
case 203:
+ return visitYieldExpression(node);
+ case 204:
return visitSpreadElement(node);
case 97:
return visitSuperKeyword(false);
case 99:
return visitThisKeyword(node);
- case 209:
+ case 210:
return visitMetaProperty(node);
- case 153:
+ case 154:
return visitMethodDeclaration(node);
- case 155:
case 156:
+ case 157:
return visitAccessorDeclaration(node);
- case 213:
+ case 214:
return visitVariableStatement(node);
- case 224:
+ case 225:
return visitReturnStatement(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -51981,7 +52310,7 @@ var ts;
if (taggedTemplateStringDeclarations) {
statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList(taggedTemplateStringDeclarations)));
}
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
exitSubtree(ancestorFacts, 0, 0);
return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements));
}
@@ -52045,13 +52374,14 @@ var ts;
}
function visitBreakOrContinueStatement(node) {
if (convertedLoopState) {
- var jump = node.kind === 223 ? 2 : 4;
+ var jump = node.kind === 224 ? 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;
- if (!node.label) {
- if (node.kind === 223) {
+ var label = node.label;
+ if (!label) {
+ if (node.kind === 224) {
convertedLoopState.nonLocalJumps |= 2;
labelMarker = "break";
}
@@ -52061,13 +52391,13 @@ var ts;
}
}
else {
- if (node.kind === 223) {
- labelMarker = "break-" + node.label.escapedText;
- setLabeledJump(convertedLoopState, true, ts.idText(node.label), labelMarker);
+ if (node.kind === 224) {
+ labelMarker = "break-" + label.escapedText;
+ setLabeledJump(convertedLoopState, true, ts.idText(label), labelMarker);
}
else {
- labelMarker = "continue-" + node.label.escapedText;
- setLabeledJump(convertedLoopState, false, ts.idText(node.label), labelMarker);
+ labelMarker = "continue-" + label.escapedText;
+ setLabeledJump(convertedLoopState, false, ts.idText(label), labelMarker);
}
}
var returnExpression = ts.createLiteral(labelMarker);
@@ -52150,7 +52480,7 @@ var ts;
statement.pos = closingBraceLocation.pos;
ts.setEmitFlags(statement, 1536 | 384);
statements.push(statement);
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), node.members), true);
ts.setEmitFlags(block, 1536);
return block;
@@ -52176,7 +52506,7 @@ var ts;
convertedLoopState = savedConvertedLoopState;
}
function transformConstructorParameters(constructor, hasSynthesizedSuper) {
- return ts.visitParameterList(constructor && !hasSynthesizedSuper && constructor.parameters, visitor, context)
+ return ts.visitParameterList(constructor && !hasSynthesizedSuper ? constructor.parameters : undefined, visitor, context)
|| [];
}
function transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper) {
@@ -52197,7 +52527,7 @@ var ts;
}
ts.Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!");
}
- var isDerivedClass = extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 95;
+ var isDerivedClass = !!extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 95;
var superCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, isDerivedClass, hasSynthesizedSuper, statementOffset);
if (superCaptureStatus === 1 || superCaptureStatus === 2) {
statementOffset++;
@@ -52213,7 +52543,7 @@ var ts;
&& !(constructor && isSufficientlyCoveredByReturnStatements(constructor.body))) {
statements.push(ts.createReturn(ts.createFileLevelUniqueName("_this")));
}
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
if (constructor) {
prependCaptureNewTargetIfNeeded(statements, constructor, false);
}
@@ -52225,17 +52555,17 @@ var ts;
return block;
}
function isSufficientlyCoveredByReturnStatements(statement) {
- if (statement.kind === 224) {
+ if (statement.kind === 225) {
return true;
}
- else if (statement.kind === 216) {
+ else if (statement.kind === 217) {
var ifStatement = statement;
if (ifStatement.elseStatement) {
return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) &&
isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement);
}
}
- else if (statement.kind === 212) {
+ else if (statement.kind === 213) {
var lastStatement = ts.lastOrUndefined(statement.statements);
if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) {
return true;
@@ -52264,7 +52594,7 @@ var ts;
var ctorStatements = ctor.body.statements;
if (statementOffset < ctorStatements.length) {
firstStatement = ctorStatements[statementOffset];
- if (firstStatement.kind === 215 && ts.isSuperCall(firstStatement.expression)) {
+ if (firstStatement.kind === 216 && ts.isSuperCall(firstStatement.expression)) {
superCallExpression = visitImmediateSuperCallInBody(firstStatement.expression);
}
}
@@ -52272,8 +52602,8 @@ var ts;
&& statementOffset === ctorStatements.length - 1
&& !(ctor.transformFlags & (16384 | 32768))) {
var returnStatement = ts.createReturn(superCallExpression);
- if (superCallExpression.kind !== 199
- || superCallExpression.left.kind !== 186) {
+ if (superCallExpression.kind !== 200
+ || superCallExpression.left.kind !== 187) {
ts.Debug.fail("Assumed generated super call would have form 'super.call(...) || this'.");
}
ts.setCommentRange(returnStatement, ts.getCommentRange(ts.setEmitFlags(superCallExpression.left, 1536)));
@@ -52374,7 +52704,7 @@ var ts;
statements.push(forStatement);
}
function addCaptureThisForNodeIfNeeded(statements, node) {
- if (node.transformFlags & 32768 && node.kind !== 192) {
+ if (node.transformFlags & 32768 && node.kind !== 193) {
captureThisForNode(statements, node, ts.createThis());
}
}
@@ -52392,18 +52722,18 @@ var ts;
if (hierarchyFacts & 16384) {
var newTarget = void 0;
switch (node.kind) {
- case 192:
+ case 193:
return statements;
- case 153:
- case 155:
+ case 154:
case 156:
+ case 157:
newTarget = ts.createVoidZero();
break;
- case 154:
+ case 155:
newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor");
break;
- case 233:
- case 191:
+ case 234:
+ case 192:
newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4), 93, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor"), ts.createVoidZero());
break;
default:
@@ -52423,20 +52753,20 @@ var ts;
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
switch (member.kind) {
- case 211:
+ case 212:
statements.push(transformSemicolonClassElementToStatement(member));
break;
- case 153:
+ case 154:
statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node));
break;
- case 155:
case 156:
+ case 157:
var accessors = ts.getAllAccessorDeclarations(node.members, member);
if (member === accessors.firstAccessor) {
statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node));
}
break;
- case 154:
+ case 155:
break;
default:
ts.Debug.failBadSyntaxKind(node);
@@ -52561,7 +52891,7 @@ var ts;
: enterSubtree(16286, 65);
var parameters = ts.visitParameterList(node.parameters, visitor, context);
var body = transformFunctionBody(node);
- if (hierarchyFacts & 16384 && !name && (node.kind === 233 || node.kind === 191)) {
+ if (hierarchyFacts & 16384 && !name && (node.kind === 234 || node.kind === 192)) {
name = ts.getGeneratedNameForNode(node);
}
exitSubtree(ancestorFacts, 49152, 0);
@@ -52595,7 +52925,7 @@ var ts;
}
}
else {
- ts.Debug.assert(node.kind === 192);
+ ts.Debug.assert(node.kind === 193);
statementsLocation = ts.moveRangeEnd(body, -1);
var equalsGreaterThanToken = node.equalsGreaterThanToken;
if (!ts.nodeIsSynthesized(equalsGreaterThanToken) && !ts.nodeIsSynthesized(body)) {
@@ -52615,7 +52945,7 @@ var ts;
closeBraceLocation = body;
}
var lexicalEnvironment = context.endLexicalEnvironment();
- ts.prependRange(statements, lexicalEnvironment);
+ ts.prependStatements(statements, lexicalEnvironment);
prependCaptureNewTargetIfNeeded(statements, node, false);
if (!multiLine && lexicalEnvironment && lexicalEnvironment.length) {
multiLine = true;
@@ -52648,9 +52978,9 @@ var ts;
}
function visitExpressionStatement(node) {
switch (node.expression.kind) {
- case 190:
+ case 191:
return ts.updateStatement(node, visitParenthesizedExpression(node.expression, false));
- case 199:
+ case 200:
return ts.updateStatement(node, visitBinaryExpression(node.expression, false));
}
return ts.visitEachChild(node, visitor, context);
@@ -52658,9 +52988,9 @@ var ts;
function visitParenthesizedExpression(node, needsDestructuringValue) {
if (!needsDestructuringValue) {
switch (node.expression.kind) {
- case 190:
+ case 191:
return ts.updateParen(node, visitParenthesizedExpression(node.expression, false));
- case 199:
+ case 200:
return ts.updateParen(node, visitBinaryExpression(node.expression, false));
}
}
@@ -52718,11 +53048,10 @@ var ts;
ts.setTextRange(declarationList, node);
ts.setCommentRange(declarationList, node);
if (node.transformFlags & 8388608
- && (ts.isBindingPattern(node.declarations[0].name) || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) {
+ && (ts.isBindingPattern(node.declarations[0].name) || ts.isBindingPattern(ts.last(node.declarations).name))) {
var firstDeclaration = ts.firstOrUndefined(declarations);
if (firstDeclaration) {
- var lastDeclaration = ts.lastOrUndefined(declarations);
- ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end));
+ ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, ts.last(declarations).end));
}
}
return declarationList;
@@ -52786,14 +53115,14 @@ var ts;
}
function visitIterationStatement(node, outermostLabeledStatement) {
switch (node.kind) {
- case 217:
case 218:
- return visitDoOrWhileStatement(node, outermostLabeledStatement);
case 219:
- return visitForStatement(node, outermostLabeledStatement);
+ return visitDoOrWhileStatement(node, outermostLabeledStatement);
case 220:
- return visitForInStatement(node, outermostLabeledStatement);
+ return visitForStatement(node, outermostLabeledStatement);
case 221:
+ return visitForInStatement(node, outermostLabeledStatement);
+ case 222:
return visitForOfStatement(node, outermostLabeledStatement);
}
}
@@ -52817,35 +53146,34 @@ var ts;
}
function convertForOfStatementHead(node, boundValue, convertedLoopBodyStatements) {
var statements = [];
- if (ts.isVariableDeclarationList(node.initializer)) {
+ var initializer = node.initializer;
+ if (ts.isVariableDeclarationList(initializer)) {
if (node.initializer.flags & 3) {
enableSubstitutionsForBlockScopedBindings();
}
- var firstOriginalDeclaration = ts.firstOrUndefined(node.initializer.declarations);
+ var firstOriginalDeclaration = ts.firstOrUndefined(initializer.declarations);
if (firstOriginalDeclaration && ts.isBindingPattern(firstOriginalDeclaration.name)) {
var declarations = ts.flattenDestructuringBinding(firstOriginalDeclaration, visitor, context, 0, boundValue);
var declarationList = ts.setTextRange(ts.createVariableDeclarationList(declarations), node.initializer);
ts.setOriginalNode(declarationList, node.initializer);
- var firstDeclaration = declarations[0];
- var lastDeclaration = ts.lastOrUndefined(declarations);
- ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end));
+ ts.setSourceMapRange(declarationList, ts.createRange(declarations[0].pos, ts.last(declarations).end));
statements.push(ts.createVariableStatement(undefined, declarationList));
}
else {
statements.push(ts.setTextRange(ts.createVariableStatement(undefined, ts.setOriginalNode(ts.setTextRange(ts.createVariableDeclarationList([
ts.createVariableDeclaration(firstOriginalDeclaration ? firstOriginalDeclaration.name : ts.createTempVariable(undefined), undefined, boundValue)
- ]), ts.moveRangePos(node.initializer, -1)), node.initializer)), ts.moveRangeEnd(node.initializer, -1)));
+ ]), ts.moveRangePos(initializer, -1)), initializer)), ts.moveRangeEnd(initializer, -1)));
}
}
else {
- var assignment = ts.createAssignment(node.initializer, boundValue);
+ var assignment = ts.createAssignment(initializer, boundValue);
if (ts.isDestructuringAssignment(assignment)) {
ts.aggregateTransformFlags(assignment);
statements.push(ts.createStatement(visitBinaryExpression(assignment, false)));
}
else {
- assignment.end = node.initializer.end;
- statements.push(ts.setTextRange(ts.createStatement(ts.visitNode(assignment, visitor, ts.isExpression)), ts.moveRangeEnd(node.initializer, -1)));
+ assignment.end = initializer.end;
+ statements.push(ts.setTextRange(ts.createStatement(ts.visitNode(assignment, visitor, ts.isExpression)), ts.moveRangeEnd(initializer, -1)));
}
}
if (convertedLoopBodyStatements) {
@@ -52918,7 +53246,7 @@ var ts;
&& i < numInitialPropertiesWithoutYield) {
numInitialPropertiesWithoutYield = i;
}
- if (property.name.kind === 146) {
+ if (property.name.kind === 147) {
numInitialProperties = i;
break;
}
@@ -52980,11 +53308,11 @@ var ts;
var functionName = ts.createUniqueName("_loop");
var loopInitializer;
switch (node.kind) {
- case 219:
case 220:
case 221:
+ case 222:
var initializer = node.initializer;
- if (initializer && initializer.kind === 232) {
+ if (initializer && initializer.kind === 233) {
loopInitializer = initializer;
}
break;
@@ -53020,7 +53348,7 @@ var ts;
if (loopOutParameters.length) {
copyOutParameters(loopOutParameters, 1, statements_4);
}
- ts.prependRange(statements_4, lexicalEnvironment);
+ ts.prependStatements(statements_4, lexicalEnvironment);
loopBody = ts.createBlock(statements_4, true);
}
if (ts.isBlock(loopBody)) {
@@ -53210,20 +53538,20 @@ var ts;
for (var i = start; i < numProperties; i++) {
var property = properties[i];
switch (property.kind) {
- case 155:
case 156:
+ case 157:
var accessors = ts.getAllAccessorDeclarations(node.properties, property);
if (property === accessors.firstAccessor) {
- expressions.push(transformAccessorsToExpression(receiver, accessors, node, node.multiLine));
+ expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine));
}
break;
- case 153:
+ case 154:
expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine));
break;
- case 269:
+ case 270:
expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine));
break;
- case 270:
+ case 271:
expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine));
break;
default:
@@ -53298,7 +53626,7 @@ var ts;
var body = node.transformFlags & (32768 | 128)
? transformFunctionBody(node)
: visitFunctionBodyDownLevel(node);
- if (node.kind === 155) {
+ if (node.kind === 156) {
updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body);
}
else {
@@ -53322,7 +53650,7 @@ var ts;
}
function visitArrayLiteralExpression(node) {
if (node.transformFlags & 64) {
- return transformAndSpreadElements(node.elements, true, node.multiLine, node.elements.hasTrailingComma);
+ return transformAndSpreadElements(node.elements, true, !!node.multiLine, !!node.elements.hasTrailingComma);
}
return ts.visitEachChild(node, visitor, context);
}
@@ -53337,11 +53665,11 @@ var ts;
}
function visitTypeScriptClassWrapper(node) {
var body = ts.cast(ts.cast(ts.skipOuterExpressions(node.expression), ts.isArrowFunction).body, ts.isBlock);
- var isVariableStatementWithInitializer = function (stmt) { return ts.isVariableStatement(stmt) && !!ts.firstOrUndefined(stmt.declarationList.declarations).initializer; };
+ var isVariableStatementWithInitializer = function (stmt) { return ts.isVariableStatement(stmt) && !!ts.first(stmt.declarationList.declarations).initializer; };
var bodyStatements = ts.visitNodes(body.statements, visitor, ts.isStatement);
var classStatements = ts.filter(bodyStatements, isVariableStatementWithInitializer);
var remainingStatements = ts.filter(bodyStatements, function (stmt) { return !isVariableStatementWithInitializer(stmt); });
- var varStatement = ts.cast(ts.firstOrUndefined(classStatements), ts.isVariableStatement);
+ var varStatement = ts.cast(ts.first(classStatements), ts.isVariableStatement);
var variable = varStatement.declarationList.declarations[0];
var initializer = ts.skipOuterExpressions(variable.initializer);
var aliasAssignment = ts.tryCast(initializer, ts.isAssignmentExpression);
@@ -53429,7 +53757,7 @@ var ts;
else {
if (segments.length === 1) {
var firstElement = elements[0];
- return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 182
+ return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 183
? ts.createArraySlice(segments[0])
: segments[0];
}
@@ -53575,13 +53903,13 @@ var ts;
if ((enabledSubstitutions & 1) === 0) {
enabledSubstitutions |= 1;
context.enableSubstitution(99);
- context.enableEmitNotification(154);
- context.enableEmitNotification(153);
context.enableEmitNotification(155);
+ context.enableEmitNotification(154);
context.enableEmitNotification(156);
+ context.enableEmitNotification(157);
+ context.enableEmitNotification(193);
context.enableEmitNotification(192);
- context.enableEmitNotification(191);
- context.enableEmitNotification(233);
+ context.enableEmitNotification(234);
}
}
function onSubstituteNode(hint, node) {
@@ -53604,14 +53932,13 @@ var ts;
return node;
}
function isNameOfDeclarationWithCollidingName(node) {
- var parent = node.parent;
- switch (parent.kind) {
- case 181:
- case 234:
- case 237:
- case 231:
- return parent.name === node
- && resolver.isDeclarationWithCollidingName(parent);
+ switch (node.parent.kind) {
+ case 182:
+ case 235:
+ case 238:
+ case 232:
+ return node.parent.name === node
+ && resolver.isDeclarationWithCollidingName(node.parent);
}
return false;
}
@@ -53670,11 +53997,11 @@ var ts;
return false;
}
var statement = ts.firstOrUndefined(constructor.body.statements);
- if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 215) {
+ if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 216) {
return false;
}
var statementExpression = statement.expression;
- if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 186) {
+ if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 187) {
return false;
}
var callTarget = statementExpression.expression;
@@ -53682,7 +54009,7 @@ var ts;
return false;
}
var callArgument = ts.singleOrUndefined(statementExpression.arguments);
- if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 203) {
+ if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 204) {
return false;
}
var expression = callArgument.expression;
@@ -53726,24 +54053,24 @@ var ts;
if (compilerOptions.jsx === 1 || compilerOptions.jsx === 3) {
previousOnEmitNode = context.onEmitNode;
context.onEmitNode = onEmitNode;
- context.enableEmitNotification(256);
context.enableEmitNotification(257);
- context.enableEmitNotification(255);
+ context.enableEmitNotification(258);
+ context.enableEmitNotification(256);
noSubstitution = [];
}
var previousOnSubstituteNode = context.onSubstituteNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableSubstitution(184);
- context.enableSubstitution(269);
+ context.enableSubstitution(185);
+ context.enableSubstitution(270);
return ts.chainBundle(transformSourceFile);
function transformSourceFile(node) {
return node;
}
function onEmitNode(hint, node, emitCallback) {
switch (node.kind) {
- case 256:
case 257:
- case 255:
+ case 258:
+ case 256:
var tagName = node.tagName;
noSubstitution[ts.getOriginalNodeId(tagName)] = true;
break;
@@ -53779,7 +54106,7 @@ var ts;
}
function trySubstituteReservedName(name) {
var token = name.originalKeywordKind || (ts.nodeIsSynthesized(name) ? ts.stringToToken(ts.idText(name)) : undefined);
- if (token >= 72 && token <= 107) {
+ if (token !== undefined && token >= 72 && token <= 107) {
return ts.setTextRange(ts.createLiteral(name), name);
}
return undefined;
@@ -53796,6 +54123,7 @@ var ts;
case 4: return "yield";
case 5: return "yield*";
case 7: return "endfinally";
+ default: return undefined;
}
}
function transformGenerators(context) {
@@ -53859,13 +54187,13 @@ var ts;
}
function visitJavaScriptInStatementContainingYield(node) {
switch (node.kind) {
- case 217:
- return visitDoStatement(node);
case 218:
+ return visitDoStatement(node);
+ case 219:
return visitWhileStatement(node);
- case 226:
- return visitSwitchStatement(node);
case 227:
+ return visitSwitchStatement(node);
+ case 228:
return visitLabeledStatement(node);
default:
return visitJavaScriptInGeneratorFunctionBody(node);
@@ -53873,24 +54201,24 @@ var ts;
}
function visitJavaScriptInGeneratorFunctionBody(node) {
switch (node.kind) {
- case 233:
+ case 234:
return visitFunctionDeclaration(node);
- case 191:
+ case 192:
return visitFunctionExpression(node);
- case 155:
case 156:
+ case 157:
return visitAccessorDeclaration(node);
- case 213:
+ case 214:
return visitVariableStatement(node);
- case 219:
- return visitForStatement(node);
case 220:
+ return visitForStatement(node);
+ case 221:
return visitForInStatement(node);
- case 223:
- return visitBreakStatement(node);
- case 222:
- return visitContinueStatement(node);
case 224:
+ return visitBreakStatement(node);
+ case 223:
+ return visitContinueStatement(node);
+ case 225:
return visitReturnStatement(node);
default:
if (node.transformFlags & 16777216) {
@@ -53906,21 +54234,21 @@ var ts;
}
function visitJavaScriptContainingYield(node) {
switch (node.kind) {
- case 199:
- return visitBinaryExpression(node);
case 200:
+ return visitBinaryExpression(node);
+ case 201:
return visitConditionalExpression(node);
- case 202:
+ case 203:
return visitYieldExpression(node);
- case 182:
- return visitArrayLiteralExpression(node);
case 183:
+ return visitArrayLiteralExpression(node);
+ case 184:
return visitObjectLiteralExpression(node);
- case 185:
- return visitElementAccessExpression(node);
case 186:
- return visitCallExpression(node);
+ return visitElementAccessExpression(node);
case 187:
+ return visitCallExpression(node);
+ case 188:
return visitNewExpression(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -53928,9 +54256,9 @@ var ts;
}
function visitGenerator(node) {
switch (node.kind) {
- case 233:
+ case 234:
return visitFunctionDeclaration(node);
- case 191:
+ case 192:
return visitFunctionExpression(node);
default:
return ts.Debug.failBadSyntaxKind(node);
@@ -54014,7 +54342,7 @@ var ts;
var statementOffset = ts.addPrologue(statements, body.statements, false, visitor);
transformAndEmitStatements(body.statements, statementOffset);
var buildResult = build();
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
statements.push(ts.createReturn(buildResult));
inGeneratorFunctionBody = savedInGeneratorFunctionBody;
inStatementContainingYield = savedInStatementContainingYield;
@@ -54052,13 +54380,14 @@ var ts;
}
}
function visitBinaryExpression(node) {
- switch (ts.getExpressionAssociativity(node)) {
+ var assoc = ts.getExpressionAssociativity(node);
+ switch (assoc) {
case 0:
return visitLeftAssociativeBinaryExpression(node);
case 1:
return visitRightAssociativeBinaryExpression(node);
default:
- ts.Debug.fail("Unknown associativity.");
+ return ts.Debug.assertNever(assoc);
}
}
function isCompoundAssignment(kind) {
@@ -54086,10 +54415,10 @@ var ts;
if (containsYield(right)) {
var target = void 0;
switch (left.kind) {
- case 184:
+ case 185:
target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name);
break;
- case 185:
+ case 186:
target = ts.updateElementAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), cacheExpression(ts.visitNode(left.argumentExpression, visitor, ts.isExpression)));
break;
default:
@@ -54290,35 +54619,35 @@ var ts;
}
function transformAndEmitStatementWorker(node) {
switch (node.kind) {
- case 212:
+ case 213:
return transformAndEmitBlock(node);
- case 215:
- return transformAndEmitExpressionStatement(node);
case 216:
- return transformAndEmitIfStatement(node);
+ return transformAndEmitExpressionStatement(node);
case 217:
- return transformAndEmitDoStatement(node);
+ return transformAndEmitIfStatement(node);
case 218:
- return transformAndEmitWhileStatement(node);
+ return transformAndEmitDoStatement(node);
case 219:
- return transformAndEmitForStatement(node);
+ return transformAndEmitWhileStatement(node);
case 220:
+ return transformAndEmitForStatement(node);
+ case 221:
return transformAndEmitForInStatement(node);
- case 222:
- return transformAndEmitContinueStatement(node);
case 223:
- return transformAndEmitBreakStatement(node);
+ return transformAndEmitContinueStatement(node);
case 224:
- return transformAndEmitReturnStatement(node);
+ return transformAndEmitBreakStatement(node);
case 225:
- return transformAndEmitWithStatement(node);
+ return transformAndEmitReturnStatement(node);
case 226:
- return transformAndEmitSwitchStatement(node);
+ return transformAndEmitWithStatement(node);
case 227:
- return transformAndEmitLabeledStatement(node);
+ return transformAndEmitSwitchStatement(node);
case 228:
- return transformAndEmitThrowStatement(node);
+ return transformAndEmitLabeledStatement(node);
case 229:
+ return transformAndEmitThrowStatement(node);
+ case 230:
return transformAndEmitTryStatement(node);
default:
return emitStatement(ts.visitNode(node, visitor, ts.isStatement));
@@ -54612,7 +54941,7 @@ var ts;
for (var i = 0; i < numClauses; i++) {
var clause = caseBlock.clauses[i];
clauseLabels.push(defineLabel());
- if (clause.kind === 266 && defaultClauseIndex === -1) {
+ if (clause.kind === 267 && defaultClauseIndex === -1) {
defaultClauseIndex = i;
}
}
@@ -54622,7 +54951,7 @@ var ts;
var defaultClausesSkipped = 0;
for (var i = clausesWritten; i < numClauses; i++) {
var clause = caseBlock.clauses[i];
- if (clause.kind === 265) {
+ if (clause.kind === 266) {
if (containsYield(clause.expression) && pendingClauses.length > 0) {
break;
}
@@ -54712,7 +55041,7 @@ var ts;
}
}
function containsYield(node) {
- return node && (node.transformFlags & 16777216) !== 0;
+ return !!node && (node.transformFlags & 16777216) !== 0;
}
function countInitialNodesWithoutYield(nodes) {
var numNodes = nodes.length;
@@ -54799,7 +55128,8 @@ var ts;
}
function endBlock() {
var block = peekBlock();
- ts.Debug.assert(block !== undefined, "beginBlock was never called.");
+ if (block === undefined)
+ return ts.Debug.fail("beginBlock was never called.");
var index = blockActions.length;
blockActions[index] = 1;
blockOffsets[index] = operations ? operations.length : 0;
@@ -55042,7 +55372,7 @@ var ts;
return 0;
}
function createLabel(label) {
- if (label > 0) {
+ if (label !== undefined && label > 0) {
if (labelExpressions === undefined) {
labelExpressions = [];
}
@@ -55413,7 +55743,7 @@ var ts;
name: "typescript:generator",
scoped: false,
priority: 6,
- text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };"
+ text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };"
};
})(ts || (ts = {}));
var ts;
@@ -55437,11 +55767,11 @@ var ts;
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
context.enableSubstitution(71);
- context.enableSubstitution(199);
- context.enableSubstitution(197);
+ context.enableSubstitution(200);
context.enableSubstitution(198);
- context.enableSubstitution(270);
- context.enableEmitNotification(273);
+ context.enableSubstitution(199);
+ context.enableSubstitution(271);
+ context.enableEmitNotification(274);
var moduleInfoMap = [];
var deferredExports = [];
var currentSourceFile;
@@ -55480,7 +55810,7 @@ var ts;
ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement));
ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset));
addExportEqualsIfNeeded(statements, false);
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements));
if (currentModuleInfo.hasExportStarsToExportValues && !compilerOptions.importHelpers) {
ts.addEmitHelper(updated, exportStarHelper);
@@ -55595,7 +55925,7 @@ var ts;
}
ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset));
addExportEqualsIfNeeded(statements, true);
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
var body = ts.createBlock(statements, true);
if (currentModuleInfo.hasExportStarsToExportValues && !compilerOptions.importHelpers) {
ts.addEmitHelper(body, exportStarHelper);
@@ -55626,23 +55956,23 @@ var ts;
}
function sourceElementVisitor(node) {
switch (node.kind) {
- case 243:
+ case 244:
return visitImportDeclaration(node);
- case 242:
+ case 243:
return visitImportEqualsDeclaration(node);
- case 249:
+ case 250:
return visitExportDeclaration(node);
- case 248:
+ case 249:
return visitExportAssignment(node);
- case 213:
+ case 214:
return visitVariableStatement(node);
- case 233:
- return visitFunctionDeclaration(node);
case 234:
+ return visitFunctionDeclaration(node);
+ case 235:
return visitClassDeclaration(node);
- case 302:
- return visitMergeDeclarationMarker(node);
case 303:
+ return visitMergeDeclarationMarker(node);
+ case 304:
return visitEndOfDeclarationMarker(node);
default:
return ts.visitEachChild(node, moduleExpressionElementVisitor, context);
@@ -55667,24 +55997,24 @@ var ts;
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var elem = _a[_i];
switch (elem.kind) {
- case 269:
+ case 270:
if (destructuringNeedsFlattening(elem.initializer)) {
return true;
}
break;
- case 270:
+ case 271:
if (destructuringNeedsFlattening(elem.name)) {
return true;
}
break;
- case 271:
+ case 272:
if (destructuringNeedsFlattening(elem.expression)) {
return true;
}
break;
- case 153:
- case 155:
+ case 154:
case 156:
+ case 157:
return false;
default: ts.Debug.assertNever(elem, "Unhandled object member kind");
}
@@ -55999,7 +56329,7 @@ var ts;
}
}
function visitMergeDeclarationMarker(node) {
- if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 213) {
+ if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 214) {
var id = ts.getOriginalNodeId(node);
deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original);
}
@@ -56031,10 +56361,10 @@ var ts;
var namedBindings = importClause.namedBindings;
if (namedBindings) {
switch (namedBindings.kind) {
- case 245:
+ case 246:
statements = appendExportsOfDeclaration(statements, namedBindings);
break;
- case 246:
+ case 247:
for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) {
var importBinding = _a[_i];
statements = appendExportsOfDeclaration(statements, importBinding);
@@ -56142,7 +56472,7 @@ var ts;
return node;
}
function onEmitNode(hint, node, emitCallback) {
- if (node.kind === 273) {
+ if (node.kind === 274) {
currentSourceFile = node;
currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)];
noSubstitution = [];
@@ -56184,10 +56514,10 @@ var ts;
switch (node.kind) {
case 71:
return substituteExpressionIdentifier(node);
- case 199:
+ case 200:
return substituteBinaryExpression(node);
+ case 199:
case 198:
- case 197:
return substituteUnaryExpression(node);
}
return node;
@@ -56202,7 +56532,7 @@ var ts;
}
if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) {
var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node));
- if (exportContainer && exportContainer.kind === 273) {
+ if (exportContainer && exportContainer.kind === 274) {
return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), node);
}
var importDeclaration = resolver.getReferencedImportDeclaration(node);
@@ -56245,7 +56575,7 @@ var ts;
&& !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) {
var exportedNames = getExports(node.operand);
if (exportedNames) {
- var expression = node.kind === 198
+ var expression = node.kind === 199
? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 43 ? 59 : 60), ts.createLiteral(1)), node)
: node;
for (var _i = 0, exportedNames_3 = exportedNames; _i < exportedNames_3.length; _i++) {
@@ -56309,11 +56639,11 @@ var ts;
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
context.enableSubstitution(71);
- context.enableSubstitution(270);
- context.enableSubstitution(199);
- context.enableSubstitution(197);
+ context.enableSubstitution(271);
+ context.enableSubstitution(200);
context.enableSubstitution(198);
- context.enableEmitNotification(273);
+ context.enableSubstitution(199);
+ context.enableEmitNotification(274);
var moduleInfoMap = [];
var deferredExports = [];
var exportFunctionsMap = [];
@@ -56399,7 +56729,7 @@ var ts;
ts.visitNode(moduleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement);
var executeStatements = ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset);
ts.addRange(statements, hoistedStatements);
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
var exportStarFunction = addExportStarIfNeeded(statements);
var moduleObject = ts.createObjectLiteral([
ts.createPropertyAssignment("setters", createSettersArray(exportStarFunction, dependencyGroups)),
@@ -56417,7 +56747,7 @@ var ts;
var hasExportDeclarationWithExportClause = false;
for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) {
var externalImport = _a[_i];
- if (externalImport.kind === 249 && externalImport.exportClause) {
+ if (externalImport.kind === 250 && externalImport.exportClause) {
hasExportDeclarationWithExportClause = true;
break;
}
@@ -56440,7 +56770,7 @@ var ts;
}
for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) {
var externalImport = _e[_d];
- if (externalImport.kind !== 249) {
+ if (externalImport.kind !== 250) {
continue;
}
if (!externalImport.exportClause) {
@@ -56491,15 +56821,15 @@ var ts;
var entry = _b[_a];
var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile);
switch (entry.kind) {
- case 243:
+ case 244:
if (!entry.importClause) {
break;
}
- case 242:
+ case 243:
ts.Debug.assert(importVariableName !== undefined);
statements.push(ts.createStatement(ts.createAssignment(importVariableName, parameterName)));
break;
- case 249:
+ case 250:
ts.Debug.assert(importVariableName !== undefined);
if (entry.exportClause) {
var properties = [];
@@ -56521,13 +56851,13 @@ var ts;
}
function sourceElementVisitor(node) {
switch (node.kind) {
- case 243:
+ case 244:
return visitImportDeclaration(node);
- case 242:
+ case 243:
return visitImportEqualsDeclaration(node);
- case 249:
+ case 250:
return undefined;
- case 248:
+ case 249:
return visitExportAssignment(node);
default:
return nestedElementVisitor(node);
@@ -56648,7 +56978,7 @@ var ts;
}
function shouldHoistVariableDeclarationList(node) {
return (ts.getEmitFlags(node) & 2097152) === 0
- && (enclosingBlockScopedContainer.kind === 273
+ && (enclosingBlockScopedContainer.kind === 274
|| (ts.getOriginalNode(node).flags & 3) === 0);
}
function transformInitializedVariable(node, isExportedDeclaration) {
@@ -56670,7 +57000,7 @@ var ts;
: preventSubstitution(ts.setTextRange(ts.createAssignment(name, value), location));
}
function visitMergeDeclarationMarker(node) {
- if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 213) {
+ if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 214) {
var id = ts.getOriginalNodeId(node);
var isExportedDeclaration = ts.hasModifier(node.original, 1);
deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration);
@@ -56709,10 +57039,10 @@ var ts;
var namedBindings = importClause.namedBindings;
if (namedBindings) {
switch (namedBindings.kind) {
- case 245:
+ case 246:
statements = appendExportsOfDeclaration(statements, namedBindings);
break;
- case 246:
+ case 247:
for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) {
var importBinding = _a[_i];
statements = appendExportsOfDeclaration(statements, importBinding);
@@ -56812,43 +57142,43 @@ var ts;
}
function nestedElementVisitor(node) {
switch (node.kind) {
- case 213:
+ case 214:
return visitVariableStatement(node);
- case 233:
- return visitFunctionDeclaration(node);
case 234:
+ return visitFunctionDeclaration(node);
+ case 235:
return visitClassDeclaration(node);
- case 219:
- return visitForStatement(node);
case 220:
- return visitForInStatement(node);
+ return visitForStatement(node);
case 221:
+ return visitForInStatement(node);
+ case 222:
return visitForOfStatement(node);
- case 217:
- return visitDoStatement(node);
case 218:
+ return visitDoStatement(node);
+ case 219:
return visitWhileStatement(node);
- case 227:
+ case 228:
return visitLabeledStatement(node);
- case 225:
- return visitWithStatement(node);
case 226:
+ return visitWithStatement(node);
+ case 227:
return visitSwitchStatement(node);
- case 240:
+ case 241:
return visitCaseBlock(node);
- case 265:
- return visitCaseClause(node);
case 266:
+ return visitCaseClause(node);
+ case 267:
return visitDefaultClause(node);
- case 229:
+ case 230:
return visitTryStatement(node);
- case 268:
+ case 269:
return visitCatchClause(node);
- case 212:
+ case 213:
return visitBlock(node);
- case 302:
- return visitMergeDeclarationMarker(node);
case 303:
+ return visitMergeDeclarationMarker(node);
+ case 304:
return visitEndOfDeclarationMarker(node);
default:
return destructuringAndImportCallVisitor(node);
@@ -56857,7 +57187,7 @@ var ts;
function visitForStatement(node) {
var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer;
enclosingBlockScopedContainer = node;
- node = ts.updateFor(node, visitForInitializer(node.initializer), ts.visitNode(node.condition, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.incrementor, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement));
+ node = ts.updateFor(node, node.initializer && visitForInitializer(node.initializer), ts.visitNode(node.condition, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.incrementor, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement));
enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer;
return node;
}
@@ -56880,9 +57210,6 @@ var ts;
&& shouldHoistVariableDeclarationList(node);
}
function visitForInitializer(node) {
- if (!node) {
- return node;
- }
if (shouldHoistForInitializer(node)) {
var expressions = void 0;
for (var _i = 0, _a = node.declarations; _i < _a.length; _i++) {
@@ -56945,7 +57272,7 @@ var ts;
}
function destructuringAndImportCallVisitor(node) {
if (node.transformFlags & 1024
- && node.kind === 199) {
+ && node.kind === 200) {
return visitDestructuringAssignment(node);
}
else if (ts.isImportCall(node)) {
@@ -56988,7 +57315,7 @@ var ts;
}
else if (ts.isIdentifier(node)) {
var container = resolver.getReferencedExportContainer(node);
- return container !== undefined && container.kind === 273;
+ return container !== undefined && container.kind === 274;
}
else {
return false;
@@ -57003,7 +57330,7 @@ var ts;
return node;
}
function onEmitNode(hint, node, emitCallback) {
- if (node.kind === 273) {
+ if (node.kind === 274) {
var id = ts.getOriginalNodeId(node);
currentSourceFile = node;
moduleInfo = moduleInfoMap[id];
@@ -57037,7 +57364,7 @@ var ts;
}
function substituteUnspecified(node) {
switch (node.kind) {
- case 270:
+ case 271:
return substituteShorthandPropertyAssignment(node);
}
return node;
@@ -57061,10 +57388,10 @@ var ts;
switch (node.kind) {
case 71:
return substituteExpressionIdentifier(node);
- case 199:
+ case 200:
return substituteBinaryExpression(node);
- case 197:
case 198:
+ case 199:
return substituteUnaryExpression(node);
}
return node;
@@ -57116,14 +57443,14 @@ var ts;
&& !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) {
var exportedNames = getExports(node.operand);
if (exportedNames) {
- var expression = node.kind === 198
+ var expression = node.kind === 199
? 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 === 198) {
+ if (node.kind === 199) {
expression = node.operator === 43
? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1))
: ts.createAdd(preventSubstitution(expression), ts.createLiteral(1));
@@ -57140,7 +57467,7 @@ var ts;
|| resolver.getReferencedValueDeclaration(name);
if (valueDeclaration) {
var exportContainer = resolver.getReferencedExportContainer(name, false);
- if (exportContainer && exportContainer.kind === 273) {
+ if (exportContainer && exportContainer.kind === 274) {
exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration));
}
exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]);
@@ -57168,7 +57495,7 @@ var ts;
var previousOnSubstituteNode = context.onSubstituteNode;
context.onEmitNode = onEmitNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableEmitNotification(273);
+ context.enableEmitNotification(274);
context.enableSubstitution(71);
var currentSourceFile;
return ts.chainBundle(transformSourceFile);
@@ -57195,9 +57522,9 @@ var ts;
}
function visitor(node) {
switch (node.kind) {
- case 242:
+ case 243:
return undefined;
- case 248:
+ case 249:
return visitExportAssignment(node);
}
return node;
@@ -57283,7 +57610,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 === 234) {
+ else if (node.parent.kind === 235) {
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 :
@@ -57312,7 +57639,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 === 234) {
+ else if (node.parent.kind === 235) {
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 :
@@ -57356,18 +57683,18 @@ var ts;
return getTypeAliasDeclarationVisibilityError;
}
else {
- ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]);
+ 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 === 231 || node.kind === 181) {
+ if (node.kind === 232 || node.kind === 182) {
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 === 151 || node.kind === 150 ||
- (node.kind === 148 && ts.hasModifier(node.parent, 8))) {
+ else if (node.kind === 152 || node.kind === 151 ||
+ (node.kind === 149 && ts.hasModifier(node.parent, 8))) {
if (ts.hasModifier(node, 32)) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
@@ -57375,7 +57702,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 === 234 || node.kind === 148) {
+ else if (node.parent.kind === 235 || node.kind === 149) {
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 :
@@ -57399,7 +57726,7 @@ var ts;
}
function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) {
var diagnosticMessage;
- if (node.kind === 156) {
+ if (node.kind === 157) {
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 :
@@ -57436,23 +57763,23 @@ var ts;
function getReturnTypeVisibilityError(symbolAccessibilityResult) {
var diagnosticMessage;
switch (node.kind) {
- case 158:
+ case 159:
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 157:
+ case 158:
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 159:
+ case 160:
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 154:
case 153:
- case 152:
if (ts.hasModifier(node, 32)) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
@@ -57460,7 +57787,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 === 234) {
+ else if (node.parent.kind === 235) {
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 :
@@ -57473,7 +57800,7 @@ var ts;
ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;
}
break;
- case 233:
+ case 234:
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 :
@@ -57481,7 +57808,7 @@ var ts;
ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0;
break;
default:
- ts.Debug.fail("This is unknown kind for signature: " + node.kind);
+ return ts.Debug.fail("This is unknown kind for signature: " + node.kind);
}
return {
diagnosticMessage: diagnosticMessage,
@@ -57498,27 +57825,27 @@ var ts;
}
function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
switch (node.parent.kind) {
- case 154:
+ case 155:
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 158:
- case 163:
+ case 159:
+ case 164:
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 157:
+ case 158:
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 159:
+ case 160:
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 154:
case 153:
- case 152:
if (ts.hasModifier(node.parent, 32)) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
@@ -57526,7 +57853,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 === 234) {
+ else if (node.parent.parent.kind === 235) {
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 :
@@ -57538,52 +57865,52 @@ 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 233:
- case 162:
+ case 234:
+ case 163:
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;
default:
- ts.Debug.fail("Unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]);
+ return ts.Debug.fail("Unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]);
}
}
function getTypeParameterConstraintVisibilityError() {
var diagnosticMessage;
switch (node.parent.kind) {
- case 234:
+ case 235:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;
break;
- case 235:
+ case 236:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;
break;
- case 158:
+ case 159:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
- case 157:
+ case 158:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
+ case 154:
case 153:
- case 152:
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 === 234) {
+ else if (node.parent.parent.kind === 235) {
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 233:
+ case 234:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
break;
- case 236:
+ case 237:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;
break;
default:
- ts.Debug.fail("This is unknown parent for type parameter: " + node.parent.kind);
+ return ts.Debug.fail("This is unknown parent for type parameter: " + node.parent.kind);
}
return {
diagnosticMessage: diagnosticMessage,
@@ -57593,7 +57920,7 @@ var ts;
}
function getHeritageClauseVisibilityError() {
var diagnosticMessage;
- if (node.parent.parent.kind === 234) {
+ if (node.parent.parent.kind === 235) {
diagnosticMessage = node.parent.token === 108 ?
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;
@@ -57733,16 +58060,16 @@ var ts;
}
}
function transformRoot(node) {
- if (node.kind === 273 && (node.isDeclarationFile || ts.isSourceFileJavaScript(node))) {
+ if (node.kind === 274 && (node.isDeclarationFile || ts.isSourceFileJavaScript(node))) {
return node;
}
- if (node.kind === 274) {
+ if (node.kind === 275) {
isBundledEmit = true;
var refs_1 = ts.createMap();
var hasNoDefaultLib_1 = false;
var bundle = ts.createBundle(ts.map(node.sourceFiles, function (sourceFile) {
if (sourceFile.isDeclarationFile || ts.isSourceFileJavaScript(sourceFile))
- return;
+ return undefined;
hasNoDefaultLib_1 = hasNoDefaultLib_1 || sourceFile.hasNoDefaultLib;
currentSourceFile = sourceFile;
enclosingDeclaration = sourceFile;
@@ -57764,7 +58091,7 @@ var ts;
var updated = ts.visitNodes(sourceFile.statements, visitDeclarationStatements);
return ts.updateSourceFileNode(sourceFile, transformAndReplaceLatePaintedStatements(updated), true, [], [], false);
}), ts.mapDefined(node.prepends, function (prepend) {
- if (prepend.kind === 276) {
+ if (prepend.kind === 277) {
return ts.createUnparsedSourceFile(prepend.declarationText);
}
}));
@@ -57859,7 +58186,7 @@ var ts;
return name;
}
else {
- if (name.kind === 180) {
+ if (name.kind === 181) {
return ts.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement));
}
else {
@@ -57867,7 +58194,7 @@ var ts;
}
}
function visitBindingElement(elem) {
- if (elem.kind === 205) {
+ if (elem.kind === 206) {
return elem;
}
return ts.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined);
@@ -57901,7 +58228,7 @@ var ts;
if (shouldPrintWithInitializer(node)) {
return;
}
- var shouldUseResolverType = node.kind === 148 &&
+ var shouldUseResolverType = node.kind === 149 &&
(resolver.isRequiredInitializedParameter(node) ||
resolver.isOptionalUninitializedParameterProperty(node));
if (type && !shouldUseResolverType) {
@@ -57910,7 +58237,7 @@ var ts;
if (!ts.getParseTreeNode(node)) {
return type ? ts.visitNode(type, visitDeclarationSubtree) : ts.createKeywordTypeNode(119);
}
- if (node.kind === 156) {
+ if (node.kind === 157) {
return ts.createKeywordTypeNode(119);
}
errorNameNode = node.name;
@@ -57919,12 +58246,12 @@ var ts;
oldDiag = getSymbolAccessibilityDiagnostic;
getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node);
}
- if (node.kind === 231 || node.kind === 181) {
+ if (node.kind === 232 || node.kind === 182) {
return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker));
}
- if (node.kind === 148
- || node.kind === 151
- || node.kind === 150) {
+ if (node.kind === 149
+ || node.kind === 152
+ || node.kind === 151) {
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));
@@ -57941,19 +58268,19 @@ var ts;
function isDeclarationAndNotVisible(node) {
node = ts.getParseTreeNode(node);
switch (node.kind) {
- case 233:
- case 238:
- case 235:
case 234:
+ case 239:
case 236:
+ case 235:
case 237:
+ case 238:
return !resolver.isDeclarationVisible(node);
- case 231:
+ case 232:
return !getBindingNameVisible(node);
- case 242:
case 243:
+ case 244:
+ case 250:
case 249:
- case 248:
return false;
}
return false;
@@ -57963,7 +58290,7 @@ var ts;
return false;
}
if (ts.isBindingPattern(elem.name)) {
- return ts.forEach(elem.name.elements, getBindingNameVisible);
+ return ts.some(elem.name.elements, getBindingNameVisible);
}
else {
return resolver.isDeclarationVisible(elem);
@@ -58005,8 +58332,8 @@ var ts;
}
function rewriteModuleSpecifier(parent, input) {
if (!input)
- return;
- resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 238 && parent.kind !== 178);
+ return undefined;
+ resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 239 && parent.kind !== 179);
if (input.kind === 9 && isBundledEmit) {
var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent);
if (newName) {
@@ -58018,7 +58345,7 @@ var ts;
function transformImportEqualsDeclaration(decl) {
if (!resolver.isDeclarationVisible(decl))
return;
- if (decl.moduleReference.kind === 253) {
+ if (decl.moduleReference.kind === 254) {
var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl);
return ts.updateImportEqualsDeclaration(decl, undefined, decl.modifiers, decl.name, ts.updateExternalModuleReference(decl.moduleReference, rewriteModuleSpecifier(decl, specifier)));
}
@@ -58038,7 +58365,7 @@ var ts;
if (!decl.importClause.namedBindings) {
return visibleDefaultBinding && ts.updateImportDeclaration(decl, undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier));
}
- if (decl.importClause.namedBindings.kind === 245) {
+ if (decl.importClause.namedBindings.kind === 246) {
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), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined;
}
@@ -58118,61 +58445,61 @@ var ts;
checkEntityNameVisibility(input.exprName, enclosingDeclaration);
}
var oldWithinObjectLiteralType = suppressNewDiagnosticContexts;
- var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 165 || input.kind === 176) && input.parent.kind !== 236);
+ var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 166 || input.kind === 177) && input.parent.kind !== 237);
if (shouldEnterSuppressNewDiagnosticsContextContext) {
suppressNewDiagnosticContexts = true;
}
if (isProcessedComponent(input)) {
switch (input.kind) {
- case 206: {
+ case 207: {
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 161: {
+ case 162: {
checkEntityNameVisibility(input.typeName, enclosingDeclaration);
var node = ts.visitEachChild(input, visitDeclarationSubtree, context);
return cleanup(ts.updateTypeReferenceNode(node, node.typeName, ts.parenthesizeTypeParameters(node.typeArguments)));
}
- case 158:
+ case 159:
return cleanup(ts.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)));
- case 154: {
+ case 155: {
var isPrivate = ts.hasModifier(input, 8);
- var ctor = ts.createSignatureDeclaration(154, isPrivate ? undefined : ensureTypeParams(input, input.typeParameters), isPrivate ? undefined : updateParamsList(input, input.parameters, 0), undefined);
+ var ctor = ts.createSignatureDeclaration(155, isPrivate ? undefined : ensureTypeParams(input, input.typeParameters), isPrivate ? undefined : updateParamsList(input, input.parameters, 0), undefined);
ctor.modifiers = ts.createNodeArray(ensureModifiers(input));
return cleanup(ctor);
}
- case 153: {
- var sig = ts.createSignatureDeclaration(152, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type));
+ case 154: {
+ var sig = ts.createSignatureDeclaration(153, 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 155: {
- var newNode = ensureAccessor(input);
- return cleanup(newNode);
- }
case 156: {
var newNode = ensureAccessor(input);
return cleanup(newNode);
}
- case 151:
+ case 157: {
+ var newNode = ensureAccessor(input);
+ return cleanup(newNode);
+ }
+ case 152:
return cleanup(ts.updateProperty(input, undefined, ensureModifiers(input), input.name, input.questionToken, !ts.hasModifier(input, 8) ? ensureType(input, input.type) : undefined, ensureNoInitializer(input)));
- case 150:
+ case 151:
return cleanup(ts.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, !ts.hasModifier(input, 8) ? ensureType(input, input.type) : undefined, ensureNoInitializer(input)));
- case 152: {
+ case 153: {
return cleanup(ts.updateMethodSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), input.name, input.questionToken));
}
- case 157: {
+ case 158: {
return cleanup(ts.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)));
}
- case 159: {
+ case 160: {
return cleanup(ts.updateIndexSignature(input, undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || ts.createKeywordTypeNode(119)));
}
- case 231: {
+ case 232: {
if (ts.isBindingPattern(input.name)) {
return recreateBindingPattern(input.name);
}
@@ -58180,13 +58507,13 @@ var ts;
suppressNewDiagnosticContexts = true;
return cleanup(ts.updateVariableDeclaration(input, input.name, ensureType(input, input.type), ensureNoInitializer(input)));
}
- case 147: {
+ case 148: {
if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) {
return cleanup(ts.updateTypeParameterDeclaration(input, input.name, undefined, undefined));
}
return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context));
}
- case 170: {
+ case 171: {
var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree);
var extendsType = ts.visitNode(input.extendsType, visitDeclarationSubtree);
var oldEnclosingDecl = enclosingDeclaration;
@@ -58196,13 +58523,13 @@ var ts;
var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree);
return cleanup(ts.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
}
- case 162: {
+ case 163: {
return cleanup(ts.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree)));
}
- case 163: {
+ case 164: {
return cleanup(ts.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree)));
}
- case 178: {
+ case 179: {
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));
@@ -58231,7 +58558,7 @@ var ts;
}
}
function isPrivateMethodTypeParameter(node) {
- return node.parent.kind === 153 && ts.hasModifier(node.parent, 8);
+ return node.parent.kind === 154 && ts.hasModifier(node.parent, 8);
}
function visitDeclarationStatements(input) {
if (!isPreservedDeclarationStatement(input)) {
@@ -58240,14 +58567,14 @@ var ts;
if (shouldStripInternal(input))
return;
switch (input.kind) {
- case 249: {
+ case 250: {
if (ts.isSourceFile(input.parent)) {
resultHasExternalModuleIndicator = true;
resultHasScopeMarker = true;
}
return ts.updateExportDeclaration(input, undefined, input.modifiers, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier));
}
- case 248: {
+ case 249: {
if (ts.isSourceFile(input.parent)) {
resultHasExternalModuleIndicator = true;
resultHasScopeMarker = true;
@@ -58275,10 +58602,10 @@ var ts;
if (shouldStripInternal(input))
return;
switch (input.kind) {
- case 242: {
+ case 243: {
return transformImportEqualsDeclaration(input);
}
- case 243: {
+ case 244: {
return transformImportDeclaration(input);
}
}
@@ -58298,18 +58625,18 @@ var ts;
}
var previousNeedsDeclare = needsDeclare;
switch (input.kind) {
- case 236:
+ case 237:
return cleanup(ts.updateTypeAliasDeclaration(input, undefined, ensureModifiers(input, isPrivate), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode)));
- case 235: {
+ case 236: {
return cleanup(ts.updateInterfaceDeclaration(input, undefined, ensureModifiers(input, isPrivate), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree)));
}
- case 233: {
+ case 234: {
return cleanup(ts.updateFunctionDeclaration(input, undefined, ensureModifiers(input, isPrivate), undefined, input.name, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), undefined));
}
- case 238: {
+ case 239: {
needsDeclare = false;
var inner = input.body;
- if (inner && inner.kind === 239) {
+ if (inner && inner.kind === 240) {
var statements = ts.visitNodes(inner.statements, visitDeclarationStatements);
var body = ts.updateModuleBlock(inner, transformAndReplaceLatePaintedStatements(statements));
needsDeclare = previousNeedsDeclare;
@@ -58327,7 +58654,7 @@ var ts;
return cleanup(ts.updateModuleDeclaration(input, undefined, mods, input.name, body));
}
}
- case 234: {
+ case 235: {
var modifiers = ts.createNodeArray(ensureModifiers(input, isPrivate));
var typeParameters = ensureTypeParams(input, input.typeParameters);
var ctor = ts.getFirstConstructorWithBody(input);
@@ -58389,10 +58716,10 @@ var ts;
return cleanup(ts.updateClassDeclaration(input, undefined, modifiers, input.name, typeParameters, heritageClauses, members));
}
}
- case 213: {
+ case 214: {
return cleanup(transformVariableStatement(input, isPrivate));
}
- case 237: {
+ case 238: {
return cleanup(ts.updateEnumDeclaration(input, undefined, ts.createNodeArray(ensureModifiers(input, isPrivate)), input.name, ts.createNodeArray(ts.mapDefined(input.members, function (m) {
if (shouldStripInternal(m))
return;
@@ -58409,7 +58736,7 @@ var ts;
if (canProdiceDiagnostic) {
getSymbolAccessibilityDiagnostic = oldDiag;
}
- if (input.kind === 238) {
+ if (input.kind === 239) {
needsDeclare = previousNeedsDeclare;
}
if (node === input) {
@@ -58430,7 +58757,7 @@ var ts;
return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); }));
}
function recreateBindingElement(e) {
- if (e.kind === 205) {
+ if (e.kind === 206) {
return;
}
if (e.name) {
@@ -58484,7 +58811,7 @@ var ts;
function ensureModifierFlags(node, privateDeclaration) {
var mask = 3071 ^ (4 | 256);
var additions = (needsDeclare && !isAlwaysType(node)) ? 2 : 0;
- var parentIsFile = node.parent.kind === 273;
+ var parentIsFile = node.parent.kind === 274;
if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) {
mask ^= ((privateDeclaration || (isBundledEmit && parentIsFile) ? 0 : 1) | 512 | 2);
additions = 0;
@@ -58531,7 +58858,7 @@ var ts;
}
ts.transformDeclarations = transformDeclarations;
function isAlwaysType(node) {
- if (node.kind === 235) {
+ if (node.kind === 236) {
return true;
}
return false;
@@ -58550,7 +58877,7 @@ var ts;
}
function getTypeAnnotationFromAccessor(accessor) {
if (accessor) {
- return accessor.kind === 155
+ return accessor.kind === 156
? accessor.type
: accessor.parameters.length > 0
? accessor.parameters[0].type
@@ -58559,51 +58886,51 @@ var ts;
}
function canHaveLiteralInitializer(node) {
switch (node.kind) {
- case 231:
+ case 232:
+ case 152:
case 151:
- case 150:
- case 148:
+ case 149:
return true;
}
return false;
}
function isPreservedDeclarationStatement(node) {
switch (node.kind) {
- case 233:
- case 238:
- case 242:
- case 235:
case 234:
- case 236:
- case 237:
- case 213:
+ case 239:
case 243:
+ case 236:
+ case 235:
+ case 237:
+ case 238:
+ case 214:
+ case 244:
+ case 250:
case 249:
- case 248:
return true;
}
return false;
}
function isProcessedComponent(node) {
switch (node.kind) {
- case 158:
- case 154:
- case 153:
- case 155:
- case 156:
- case 151:
- case 150:
- case 152:
- case 157:
case 159:
- case 231:
- case 147:
- case 206:
- case 161:
- case 170:
+ case 155:
+ case 154:
+ case 156:
+ case 157:
+ case 152:
+ case 151:
+ case 153:
+ case 158:
+ case 160:
+ case 232:
+ case 148:
+ case 207:
case 162:
+ case 171:
case 163:
- case 178:
+ case 164:
+ case 179:
return true;
}
return false;
@@ -58654,7 +58981,7 @@ var ts;
}
ts.getTransformers = getTransformers;
function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) {
- var enabledSyntaxKindFeatures = new Array(304);
+ var enabledSyntaxKindFeatures = new Array(305);
var lexicalEnvironmentVariableDeclarations;
var lexicalEnvironmentFunctionDeclarations;
var lexicalEnvironmentVariableDeclarationsStack = [];
@@ -58889,7 +59216,7 @@ var ts;
return currentSource.skipTrivia ? currentSource.skipTrivia(pos) : ts.skipTrivia(currentSourceText, pos);
}
function initialize(filePath, sourceMapFilePath, sourceFileOrBundle, outputSourceMapDataList) {
- if (disabled) {
+ if (disabled || ts.fileExtensionIs(filePath, ".json")) {
return;
}
if (sourceMapData) {
@@ -58920,7 +59247,7 @@ var ts;
}
if (compilerOptions.mapRoot) {
sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot);
- if (sourceFileOrBundle.kind === 273) {
+ if (sourceFileOrBundle.kind === 274) {
sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFileOrBundle, host, sourceMapDir));
}
if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) {
@@ -58980,7 +59307,7 @@ var ts;
sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan);
}
function emitPos(pos) {
- if (disabled || ts.positionIsSynthesized(pos)) {
+ if (disabled || ts.positionIsSynthesized(pos) || isJsonSourceMapSource(currentSource)) {
return;
}
if (extendedDiagnostics) {
@@ -59017,12 +59344,12 @@ var ts;
}
}
function emitNodeWithSourceMap(hint, node, emitCallback) {
- if (disabled) {
+ if (disabled || ts.isInJsonFile(node)) {
return emitCallback(hint, node);
}
if (node) {
var emitNode = node.emitNode;
- var emitFlags = emitNode && emitNode.flags;
+ var emitFlags = emitNode && emitNode.flags || 0;
var range = emitNode && emitNode.sourceMapRange;
var _a = range || node, pos = _a.pos, end = _a.end;
var source = range && range.source;
@@ -59031,7 +59358,7 @@ var ts;
source = undefined;
if (source)
setSourceFile(source);
- if (node.kind !== 299
+ if (node.kind !== 300
&& (emitFlags & 16) === 0
&& pos >= 0) {
emitPos(skipSourceTrivia(pos));
@@ -59048,7 +59375,7 @@ var ts;
}
if (source)
setSourceFile(source);
- if (node.kind !== 299
+ if (node.kind !== 300
&& (emitFlags & 32) === 0
&& end >= 0) {
emitPos(end);
@@ -59058,11 +59385,11 @@ var ts;
}
}
function emitTokenWithSourceMap(node, token, writer, tokenPos, emitCallback) {
- if (disabled) {
+ if (disabled || ts.isInJsonFile(node)) {
return emitCallback(token, writer, tokenPos);
}
var emitNode = node && node.emitNode;
- var emitFlags = emitNode && emitNode.flags;
+ var emitFlags = emitNode && emitNode.flags || 0;
var range = emitNode && emitNode.tokenSourceMapRanges && emitNode.tokenSourceMapRanges[token];
tokenPos = skipSourceTrivia(range ? range.pos : tokenPos);
if ((emitFlags & 128) === 0 && tokenPos >= 0) {
@@ -59076,12 +59403,18 @@ var ts;
}
return tokenPos;
}
+ function isJsonSourceMapSource(sourceFile) {
+ return ts.fileExtensionIs(sourceFile.fileName, ".json");
+ }
function setSourceFile(sourceFile) {
if (disabled) {
return;
}
currentSource = sourceFile;
currentSourceText = currentSource.text;
+ if (isJsonSourceMapSource(sourceFile)) {
+ return;
+ }
var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir;
var source = ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, currentSource.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, true);
sourceMapSourceIndex = sourceMapData.sourceMapSources.indexOf(source);
@@ -59095,8 +59428,8 @@ var ts;
}
}
function getText() {
- if (disabled) {
- return;
+ if (disabled || isJsonSourceMapSource(currentSource)) {
+ return undefined;
}
encodeLastRecordedSourceMapSpan();
return JSON.stringify({
@@ -59110,8 +59443,8 @@ var ts;
});
}
function getSourceMappingURL() {
- if (disabled) {
- return;
+ if (disabled || isJsonSourceMapSource(currentSource)) {
+ return undefined;
}
if (compilerOptions.inlineSourceMap) {
var base64SourceMapText = ts.base64encode(ts.sys, getText());
@@ -59163,7 +59496,7 @@ var ts;
var currentLineMap;
var detachedCommentsInfo;
var hasWrittenComment = false;
- var disabled = printerOptions.removeComments;
+ var disabled = !!printerOptions.removeComments;
return {
reset: reset,
setWriter: setWriter,
@@ -59181,7 +59514,7 @@ var ts;
if (node) {
hasWrittenComment = false;
var emitNode = node.emitNode;
- var emitFlags = emitNode && emitNode.flags;
+ var emitFlags = emitNode && emitNode.flags || 0;
var _a = emitNode && emitNode.commentRange || node, pos = _a.pos, end = _a.end;
if ((pos < 0 && end < 0) || (pos === end)) {
emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback);
@@ -59190,7 +59523,7 @@ var ts;
if (extendedDiagnostics) {
ts.performance.mark("preEmitNodeWithComment");
}
- var isEmittedNode = node.kind !== 299;
+ var isEmittedNode = node.kind !== 300;
var skipLeadingComments = pos < 0 || (emitFlags & 512) !== 0 || node.kind === 10;
var skipTrailingComments = end < 0 || (emitFlags & 1024) !== 0 || node.kind === 10;
if (!skipLeadingComments) {
@@ -59204,7 +59537,7 @@ var ts;
}
if (!skipTrailingComments) {
containerEnd = end;
- if (node.kind === 232) {
+ if (node.kind === 233) {
declarationListContainerEnd = end;
}
}
@@ -59445,10 +59778,10 @@ var ts;
detachedCommentsInfo = undefined;
}
function hasDetachedComments(pos) {
- return detachedCommentsInfo !== undefined && ts.lastOrUndefined(detachedCommentsInfo).nodePos === pos;
+ return detachedCommentsInfo !== undefined && ts.last(detachedCommentsInfo).nodePos === pos;
}
function forEachLeadingCommentWithoutDetachedComments(cb) {
- var pos = ts.lastOrUndefined(detachedCommentsInfo).detachedCommentEndPos;
+ var pos = ts.last(detachedCommentsInfo).detachedCommentEndPos;
if (detachedCommentsInfo.length - 1) {
detachedCommentsInfo.pop();
}
@@ -59488,6 +59821,7 @@ var ts;
var infoExtension = ".tsbundleinfo";
var brackets = createBracketsMap();
function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, emitOnlyDtsFiles) {
+ if (emitOnlyDtsFiles === void 0) { emitOnlyDtsFiles = false; }
var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile);
var options = host.getCompilerOptions();
if (options.outFile || options.out) {
@@ -59512,17 +59846,17 @@ var ts;
ts.forEachEmittedFile = forEachEmittedFile;
function getOutputPathsFor(sourceFile, host, forceDtsPaths) {
var options = host.getCompilerOptions();
- if (sourceFile.kind === 274) {
+ if (sourceFile.kind === 275) {
var jsFilePath = options.outFile || options.out;
var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options);
var declarationFilePath = (forceDtsPaths || options.declaration) ? ts.removeFileExtension(jsFilePath) + ".d.ts" : undefined;
var declarationMapPath = ts.getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : undefined;
- var bundleInfoPath = options.references && jsFilePath && (ts.removeFileExtension(jsFilePath) + infoExtension);
+ var bundleInfoPath = options.references && jsFilePath ? (ts.removeFileExtension(jsFilePath) + infoExtension) : undefined;
return { jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath, declarationMapPath: declarationMapPath, bundleInfoPath: bundleInfoPath };
}
else {
var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, getOutputExtension(sourceFile, options));
- var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options);
+ var sourceMapFilePath = ts.isJsonSourceFile(sourceFile) ? undefined : getSourceMapFilePath(jsFilePath, options);
var isJs = ts.isSourceFileJavaScript(sourceFile);
var declarationFilePath = ((forceDtsPaths || options.declaration) && !isJs) ? ts.getDeclarationEmitOutputFilePath(sourceFile, host) : undefined;
var declarationMapPath = ts.getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : undefined;
@@ -59579,7 +59913,7 @@ var ts;
emitSkipped: emitSkipped,
diagnostics: emitterDiagnostics.getDiagnostics(),
emittedFiles: emittedFilesList,
- sourceMaps: sourceMapDataList
+ sourceMaps: sourceMapDataList,
};
function emitSourceFileOrBundle(_a, sourceFileOrBundle) {
var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath, bundleInfoPath = _a.bundleInfoPath;
@@ -59654,8 +59988,8 @@ var ts;
declarationTransform.dispose();
}
function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, bundleInfoPath, printer, mapRecorder) {
- var bundle = sourceFileOrBundle.kind === 274 ? sourceFileOrBundle : undefined;
- var sourceFile = sourceFileOrBundle.kind === 273 ? sourceFileOrBundle : undefined;
+ var bundle = sourceFileOrBundle.kind === 275 ? sourceFileOrBundle : undefined;
+ var sourceFile = sourceFileOrBundle.kind === 274 ? sourceFileOrBundle : undefined;
var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile];
mapRecorder.initialize(jsFilePath, sourceMapFilePath || "", sourceFileOrBundle, sourceMapDataList);
if (bundle) {
@@ -59672,7 +60006,7 @@ var ts;
if (sourceMapFilePath) {
ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, mapRecorder.getText(), false, sourceFiles);
}
- ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), compilerOptions.emitBOM, sourceFiles);
+ ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), !!compilerOptions.emitBOM, sourceFiles);
if (bundleInfoPath) {
bundleInfo.totalLength = writer.getTextPos();
ts.writeFile(host, emitterDiagnostics, bundleInfoPath, JSON.stringify(bundleInfo, undefined, 2), false);
@@ -59742,9 +60076,9 @@ var ts;
break;
}
switch (node.kind) {
- case 273: return printFile(node);
- case 274: return printBundle(node);
- case 275: return printUnparsedSource(node);
+ case 274: return printFile(node);
+ case 275: return printBundle(node);
+ case 276: return printUnparsedSource(node);
}
writeNode(hint, node, sourceFile, beginPrint());
return endPrint();
@@ -59901,8 +60235,7 @@ var ts;
return getPipelinePhase(currentPhase + 1, hint);
}
function pipelineEmitWithNotification(hint, node) {
- ts.Debug.assertDefined(onEmitNode);
- onEmitNode(hint, node, getNextPipelinePhase(0, hint));
+ ts.Debug.assertDefined(onEmitNode)(hint, node, getNextPipelinePhase(0, hint));
}
function pipelineEmitWithComments(hint, node) {
ts.Debug.assertDefined(emitNodeWithComments);
@@ -59914,9 +60247,8 @@ var ts;
pipelinePhase(hint, trySubstituteNode(hint, node));
}
function pipelineEmitWithSourceMap(hint, node) {
- ts.Debug.assertDefined(onEmitSourceMapOfNode);
ts.Debug.assert(hint !== 0 && hint !== 2);
- onEmitSourceMapOfNode(hint, node, pipelineEmitWithHint);
+ ts.Debug.assertDefined(onEmitSourceMapOfNode)(hint, node, pipelineEmitWithHint);
}
function pipelineEmitWithHint(hint, node) {
if (hint === 0)
@@ -59933,220 +60265,220 @@ var ts;
case 15:
case 16:
return emitLiteral(node);
- case 275:
+ case 276:
return emitUnparsedSource(node);
case 71:
return emitIdentifier(node);
- case 145:
- return emitQualifiedName(node);
case 146:
- return emitComputedPropertyName(node);
+ return emitQualifiedName(node);
case 147:
- return emitTypeParameter(node);
+ return emitComputedPropertyName(node);
case 148:
- return emitParameter(node);
+ return emitTypeParameter(node);
case 149:
- return emitDecorator(node);
+ return emitParameter(node);
case 150:
- return emitPropertySignature(node);
+ return emitDecorator(node);
case 151:
- return emitPropertyDeclaration(node);
+ return emitPropertySignature(node);
case 152:
- return emitMethodSignature(node);
+ return emitPropertyDeclaration(node);
case 153:
- return emitMethodDeclaration(node);
+ return emitMethodSignature(node);
case 154:
- return emitConstructor(node);
+ return emitMethodDeclaration(node);
case 155:
+ return emitConstructor(node);
case 156:
- return emitAccessorDeclaration(node);
case 157:
- return emitCallSignature(node);
+ return emitAccessorDeclaration(node);
case 158:
- return emitConstructSignature(node);
+ return emitCallSignature(node);
case 159:
- return emitIndexSignature(node);
+ return emitConstructSignature(node);
case 160:
- return emitTypePredicate(node);
+ return emitIndexSignature(node);
case 161:
- return emitTypeReference(node);
+ return emitTypePredicate(node);
case 162:
- return emitFunctionType(node);
- case 283:
- return emitJSDocFunctionType(node);
+ return emitTypeReference(node);
case 163:
- return emitConstructorType(node);
+ return emitFunctionType(node);
+ case 284:
+ return emitJSDocFunctionType(node);
case 164:
- return emitTypeQuery(node);
+ return emitConstructorType(node);
case 165:
- return emitTypeLiteral(node);
+ return emitTypeQuery(node);
case 166:
- return emitArrayType(node);
+ return emitTypeLiteral(node);
case 167:
- return emitTupleType(node);
+ return emitArrayType(node);
case 168:
- return emitUnionType(node);
+ return emitTupleType(node);
case 169:
- return emitIntersectionType(node);
+ return emitUnionType(node);
case 170:
- return emitConditionalType(node);
+ return emitIntersectionType(node);
case 171:
- return emitInferType(node);
+ return emitConditionalType(node);
case 172:
- return emitParenthesizedType(node);
- case 206:
- return emitExpressionWithTypeArguments(node);
+ return emitInferType(node);
case 173:
- return emitThisType();
+ return emitParenthesizedType(node);
+ case 207:
+ return emitExpressionWithTypeArguments(node);
case 174:
- return emitTypeOperator(node);
+ return emitThisType();
case 175:
- return emitIndexedAccessType(node);
+ return emitTypeOperator(node);
case 176:
- return emitMappedType(node);
+ return emitIndexedAccessType(node);
case 177:
- return emitLiteralType(node);
+ return emitMappedType(node);
case 178:
+ return emitLiteralType(node);
+ case 179:
return emitImportTypeNode(node);
- case 278:
+ case 279:
write("*");
return;
- case 279:
+ case 280:
write("?");
return;
- case 280:
- return emitJSDocNullableType(node);
case 281:
- return emitJSDocNonNullableType(node);
+ return emitJSDocNullableType(node);
case 282:
+ return emitJSDocNonNullableType(node);
+ case 283:
return emitJSDocOptionalType(node);
- case 284:
+ case 285:
return emitJSDocVariadicType(node);
- case 179:
- return emitObjectBindingPattern(node);
case 180:
- return emitArrayBindingPattern(node);
+ return emitObjectBindingPattern(node);
case 181:
+ return emitArrayBindingPattern(node);
+ case 182:
return emitBindingElement(node);
- case 210:
- return emitTemplateSpan(node);
case 211:
- return emitSemicolonClassElement();
+ return emitTemplateSpan(node);
case 212:
- return emitBlock(node);
+ return emitSemicolonClassElement();
case 213:
- return emitVariableStatement(node);
+ return emitBlock(node);
case 214:
- return emitEmptyStatement();
+ return emitVariableStatement(node);
case 215:
- return emitExpressionStatement(node);
+ return emitEmptyStatement();
case 216:
- return emitIfStatement(node);
+ return emitExpressionStatement(node);
case 217:
- return emitDoStatement(node);
+ return emitIfStatement(node);
case 218:
- return emitWhileStatement(node);
+ return emitDoStatement(node);
case 219:
- return emitForStatement(node);
+ return emitWhileStatement(node);
case 220:
- return emitForInStatement(node);
+ return emitForStatement(node);
case 221:
- return emitForOfStatement(node);
+ return emitForInStatement(node);
case 222:
- return emitContinueStatement(node);
+ return emitForOfStatement(node);
case 223:
- return emitBreakStatement(node);
+ return emitContinueStatement(node);
case 224:
- return emitReturnStatement(node);
+ return emitBreakStatement(node);
case 225:
- return emitWithStatement(node);
+ return emitReturnStatement(node);
case 226:
- return emitSwitchStatement(node);
+ return emitWithStatement(node);
case 227:
- return emitLabeledStatement(node);
+ return emitSwitchStatement(node);
case 228:
- return emitThrowStatement(node);
+ return emitLabeledStatement(node);
case 229:
- return emitTryStatement(node);
+ return emitThrowStatement(node);
case 230:
- return emitDebuggerStatement(node);
+ return emitTryStatement(node);
case 231:
- return emitVariableDeclaration(node);
+ return emitDebuggerStatement(node);
case 232:
- return emitVariableDeclarationList(node);
+ return emitVariableDeclaration(node);
case 233:
- return emitFunctionDeclaration(node);
+ return emitVariableDeclarationList(node);
case 234:
- return emitClassDeclaration(node);
+ return emitFunctionDeclaration(node);
case 235:
- return emitInterfaceDeclaration(node);
+ return emitClassDeclaration(node);
case 236:
- return emitTypeAliasDeclaration(node);
+ return emitInterfaceDeclaration(node);
case 237:
- return emitEnumDeclaration(node);
+ return emitTypeAliasDeclaration(node);
case 238:
- return emitModuleDeclaration(node);
+ return emitEnumDeclaration(node);
case 239:
- return emitModuleBlock(node);
+ return emitModuleDeclaration(node);
case 240:
- return emitCaseBlock(node);
+ return emitModuleBlock(node);
case 241:
- return emitNamespaceExportDeclaration(node);
+ return emitCaseBlock(node);
case 242:
- return emitImportEqualsDeclaration(node);
+ return emitNamespaceExportDeclaration(node);
case 243:
- return emitImportDeclaration(node);
+ return emitImportEqualsDeclaration(node);
case 244:
- return emitImportClause(node);
+ return emitImportDeclaration(node);
case 245:
- return emitNamespaceImport(node);
+ return emitImportClause(node);
case 246:
- return emitNamedImports(node);
+ return emitNamespaceImport(node);
case 247:
- return emitImportSpecifier(node);
+ return emitNamedImports(node);
case 248:
- return emitExportAssignment(node);
+ return emitImportSpecifier(node);
case 249:
- return emitExportDeclaration(node);
+ return emitExportAssignment(node);
case 250:
- return emitNamedExports(node);
+ return emitExportDeclaration(node);
case 251:
- return emitExportSpecifier(node);
+ return emitNamedExports(node);
case 252:
- return;
+ return emitExportSpecifier(node);
case 253:
+ return;
+ case 254:
return emitExternalModuleReference(node);
case 10:
return emitJsxText(node);
- case 256:
- case 259:
- return emitJsxOpeningElementOrFragment(node);
case 257:
case 260:
- return emitJsxClosingElementOrFragment(node);
+ return emitJsxOpeningElementOrFragment(node);
+ case 258:
case 261:
- return emitJsxAttribute(node);
+ return emitJsxClosingElementOrFragment(node);
case 262:
- return emitJsxAttributes(node);
+ return emitJsxAttribute(node);
case 263:
- return emitJsxSpreadAttribute(node);
+ return emitJsxAttributes(node);
case 264:
- return emitJsxExpression(node);
+ return emitJsxSpreadAttribute(node);
case 265:
- return emitCaseClause(node);
+ return emitJsxExpression(node);
case 266:
- return emitDefaultClause(node);
+ return emitCaseClause(node);
case 267:
- return emitHeritageClause(node);
+ return emitDefaultClause(node);
case 268:
- return emitCatchClause(node);
+ return emitHeritageClause(node);
case 269:
- return emitPropertyAssignment(node);
+ return emitCatchClause(node);
case 270:
- return emitShorthandPropertyAssignment(node);
+ return emitPropertyAssignment(node);
case 271:
- return emitSpreadAssignment(node);
+ return emitShorthandPropertyAssignment(node);
case 272:
+ return emitSpreadAssignment(node);
+ case 273:
return emitEnumMember(node);
}
if (ts.isExpression(node)) {
@@ -60175,69 +60507,69 @@ var ts;
case 91:
writeTokenNode(node, writeKeyword);
return;
- case 182:
- return emitArrayLiteralExpression(node);
case 183:
- return emitObjectLiteralExpression(node);
+ return emitArrayLiteralExpression(node);
case 184:
- return emitPropertyAccessExpression(node);
+ return emitObjectLiteralExpression(node);
case 185:
- return emitElementAccessExpression(node);
+ return emitPropertyAccessExpression(node);
case 186:
- return emitCallExpression(node);
+ return emitElementAccessExpression(node);
case 187:
- return emitNewExpression(node);
+ return emitCallExpression(node);
case 188:
- return emitTaggedTemplateExpression(node);
+ return emitNewExpression(node);
case 189:
- return emitTypeAssertionExpression(node);
+ return emitTaggedTemplateExpression(node);
case 190:
- return emitParenthesizedExpression(node);
+ return emitTypeAssertionExpression(node);
case 191:
- return emitFunctionExpression(node);
+ return emitParenthesizedExpression(node);
case 192:
- return emitArrowFunction(node);
+ return emitFunctionExpression(node);
case 193:
- return emitDeleteExpression(node);
+ return emitArrowFunction(node);
case 194:
- return emitTypeOfExpression(node);
+ return emitDeleteExpression(node);
case 195:
- return emitVoidExpression(node);
+ return emitTypeOfExpression(node);
case 196:
- return emitAwaitExpression(node);
+ return emitVoidExpression(node);
case 197:
- return emitPrefixUnaryExpression(node);
+ return emitAwaitExpression(node);
case 198:
- return emitPostfixUnaryExpression(node);
+ return emitPrefixUnaryExpression(node);
case 199:
- return emitBinaryExpression(node);
+ return emitPostfixUnaryExpression(node);
case 200:
- return emitConditionalExpression(node);
+ return emitBinaryExpression(node);
case 201:
- return emitTemplateExpression(node);
+ return emitConditionalExpression(node);
case 202:
- return emitYieldExpression(node);
+ return emitTemplateExpression(node);
case 203:
- return emitSpreadExpression(node);
+ return emitYieldExpression(node);
case 204:
- return emitClassExpression(node);
+ return emitSpreadExpression(node);
case 205:
+ return emitClassExpression(node);
+ case 206:
return;
- case 207:
- return emitAsExpression(node);
case 208:
- return emitNonNullExpression(node);
+ return emitAsExpression(node);
case 209:
+ return emitNonNullExpression(node);
+ case 210:
return emitMetaProperty(node);
- case 254:
- return emitJsxElement(node);
case 255:
+ return emitJsxElement(node);
+ case 256:
return emitJsxSelfClosingElement(node);
- case 258:
+ case 259:
return emitJsxFragment(node);
- case 300:
- return emitPartiallyEmittedExpression(node);
case 301:
+ return emitPartiallyEmittedExpression(node);
+ case 302:
return emitCommaList(node);
}
}
@@ -60254,7 +60586,7 @@ var ts;
}
function emitHelpers(node) {
var helpersEmitted = false;
- var bundle = node.kind === 274 ? node : undefined;
+ var bundle = node.kind === 275 ? node : undefined;
if (bundle && moduleKind === ts.ModuleKind.None) {
return;
}
@@ -60353,7 +60685,7 @@ var ts;
emit(node.dotDotDotToken);
emitNodeWithWriter(node.name, writeParameter);
emit(node.questionToken);
- if (node.parent && node.parent.kind === 283 && !node.name) {
+ if (node.parent && node.parent.kind === 284 && !node.name) {
emit(node.type);
}
else {
@@ -60411,7 +60743,7 @@ var ts;
function emitAccessorDeclaration(node) {
emitDecorators(node, node.decorators);
emitModifiers(node, node.modifiers);
- writeKeyword(node.kind === 155 ? "get" : "set");
+ writeKeyword(node.kind === 156 ? "get" : "set");
writeSpace();
emit(node.name);
emitSignatureAndBody(node, emitSignatureHead);
@@ -60659,7 +60991,7 @@ var ts;
increaseIndent();
}
var preferNewLine = node.multiLine ? 32768 : 0;
- var allowTrailingComma = currentSourceFile.languageVersion >= 1 ? 32 : 0;
+ var allowTrailingComma = currentSourceFile.languageVersion >= 1 && !ts.isJsonSourceFile(currentSourceFile) ? 32 : 0;
emitList(node, node.properties, 263122 | allowTrailingComma | preferNewLine);
if (indentedFlag) {
decreaseIndent();
@@ -60782,7 +61114,7 @@ var ts;
}
function shouldEmitWhitespaceBeforeOperand(node) {
var operand = node.operand;
- return operand.kind === 197
+ return operand.kind === 198
&& ((node.operator === 37 && (operand.operator === 37 || operand.operator === 43))
|| (node.operator === 38 && (operand.operator === 38 || operand.operator === 44)));
}
@@ -60896,7 +61228,7 @@ var ts;
if (node.elseStatement) {
writeLineOrSpace(node);
emitTokenWithComment(82, node.thenStatement.end, writeKeyword, node);
- if (node.elseStatement.kind === 216) {
+ if (node.elseStatement.kind === 217) {
writeSpace();
emit(node.elseStatement);
}
@@ -60959,7 +61291,7 @@ var ts;
emitTokenWithComment(19, openParenPos, writePunctuation, node);
emitForBinding(node.initializer);
writeSpace();
- emitTokenWithComment(144, node.initializer.end, writeKeyword, node);
+ emitTokenWithComment(145, node.initializer.end, writeKeyword, node);
writeSpace();
emitExpression(node.expression);
emitTokenWithComment(20, node.expression.end, writePunctuation, node);
@@ -60967,7 +61299,7 @@ var ts;
}
function emitForBinding(node) {
if (node !== undefined) {
- if (node.kind === 232) {
+ if (node.kind === 233) {
emit(node);
}
else {
@@ -61252,7 +61584,7 @@ var ts;
var body = node.body;
if (!body)
return writeSemicolon();
- while (body.kind === 238) {
+ while (body.kind === 239) {
writePunctuation(".");
emit(body.name);
body = body.body;
@@ -61297,7 +61629,7 @@ var ts;
if (node.importClause) {
emit(node.importClause);
writeSpace();
- emitTokenWithComment(142, node.importClause.end, writeKeyword, node);
+ emitTokenWithComment(143, node.importClause.end, writeKeyword, node);
writeSpace();
}
emitExpression(node.moduleSpecifier);
@@ -61349,7 +61681,7 @@ var ts;
if (node.moduleSpecifier) {
writeSpace();
var fromPos = node.exportClause ? node.exportClause.end : nextPos;
- emitTokenWithComment(142, fromPos, writeKeyword, node);
+ emitTokenWithComment(143, fromPos, writeKeyword, node);
writeSpace();
emitExpression(node.moduleSpecifier);
}
@@ -61546,7 +61878,7 @@ var ts;
emitSourceFileWorker(node);
}
function emitSyntheticTripleSlashReferencesIfNeeded(node) {
- emitTripleSlashDirectives(node.hasNoDefaultLib, node.syntheticFileReferences || [], node.syntheticTypeReferences || []);
+ emitTripleSlashDirectives(!!node.hasNoDefaultLib, node.syntheticFileReferences || [], node.syntheticTypeReferences || []);
}
function emitTripleSlashDirectivesIfNeeded(node) {
if (node.isDeclarationFile)
@@ -61790,7 +62122,7 @@ var ts;
if (isUndefined && format & 8192) {
return;
}
- var isEmpty = isUndefined || start >= children.length || count === 0;
+ var isEmpty = children === undefined || start >= children.length || count === 0;
if (isEmpty && format & 16384) {
if (onBeforeEmitNodeArray) {
onBeforeEmitNodeArray(children);
@@ -61831,7 +62163,7 @@ var ts;
increaseIndent();
}
var previousSibling = void 0;
- var shouldDecreaseIndentAfterEmit = void 0;
+ var shouldDecreaseIndentAfterEmit = false;
for (var i = 0; i < count; i++) {
var child = children[start + i];
if (previousSibling) {
@@ -62107,7 +62439,7 @@ var ts;
&& ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile);
}
function skipSynthesizedParentheses(node) {
- while (node.kind === 190 && ts.nodeIsSynthesized(node)) {
+ while (node.kind === 191 && ts.nodeIsSynthesized(node)) {
node = node.expression;
}
return node;
@@ -62166,81 +62498,81 @@ var ts;
if (!node)
return;
switch (node.kind) {
- case 212:
+ case 213:
ts.forEach(node.statements, generateNames);
break;
- case 227:
- case 225:
- case 217:
+ case 228:
+ case 226:
case 218:
+ case 219:
generateNames(node.statement);
break;
- case 216:
+ case 217:
generateNames(node.thenStatement);
generateNames(node.elseStatement);
break;
- case 219:
- case 221:
case 220:
+ case 222:
+ case 221:
generateNames(node.initializer);
generateNames(node.statement);
break;
- case 226:
+ case 227:
generateNames(node.caseBlock);
break;
- case 240:
+ case 241:
ts.forEach(node.clauses, generateNames);
break;
- case 265:
case 266:
+ case 267:
ts.forEach(node.statements, generateNames);
break;
- case 229:
+ case 230:
generateNames(node.tryBlock);
generateNames(node.catchClause);
generateNames(node.finallyBlock);
break;
- case 268:
+ case 269:
generateNames(node.variableDeclaration);
generateNames(node.block);
break;
- case 213:
+ case 214:
generateNames(node.declarationList);
break;
- case 232:
+ case 233:
ts.forEach(node.declarations, generateNames);
break;
- case 231:
- case 148:
- case 181:
- case 234:
+ case 232:
+ case 149:
+ case 182:
+ case 235:
generateNameIfNeeded(node.name);
break;
- case 233:
+ case 234:
generateNameIfNeeded(node.name);
if (ts.getEmitFlags(node) & 524288) {
ts.forEach(node.parameters, generateNames);
generateNames(node.body);
}
break;
- case 179:
case 180:
+ case 181:
ts.forEach(node.elements, generateNames);
break;
- case 243:
- generateNames(node.importClause);
- break;
case 244:
- generateNameIfNeeded(node.name);
- generateNames(node.namedBindings);
+ generateNames(node.importClause);
break;
case 245:
generateNameIfNeeded(node.name);
+ generateNames(node.namedBindings);
break;
case 246:
- ts.forEach(node.elements, generateNames);
+ generateNameIfNeeded(node.name);
break;
case 247:
+ ts.forEach(node.elements, generateNames);
+ break;
+ case 248:
generateNameIfNeeded(node.propertyName || node.name);
break;
}
@@ -62249,12 +62581,12 @@ var ts;
if (!node)
return;
switch (node.kind) {
- case 269:
case 270:
- case 151:
- case 153:
- case 155:
+ case 271:
+ case 152:
+ case 154:
case 156:
+ case 157:
generateNameIfNeeded(node.name);
break;
}
@@ -62388,21 +62720,21 @@ var ts;
switch (node.kind) {
case 71:
return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16), !!(flags & 8));
+ case 239:
case 238:
- case 237:
return generateNameForModuleOrEnum(node);
- case 243:
- case 249:
+ case 244:
+ case 250:
return generateNameForImportOrExportDeclaration(node);
- case 233:
case 234:
- case 248:
+ case 235:
+ case 249:
return generateNameForExportDefault();
- case 204:
+ case 205:
return generateNameForClassExpression();
- case 153:
- case 155:
+ case 154:
case 156:
+ case 157:
return generateNameForMethodOrAccessor(node);
default:
return makeTempVariableName(0);
@@ -62417,7 +62749,7 @@ var ts;
case 3:
return makeUniqueName(ts.idText(name), (name.autoGenerateFlags & 32) ? isFileLevelUniqueName : isUniqueName, !!(name.autoGenerateFlags & 16), !!(name.autoGenerateFlags & 8));
}
- ts.Debug.fail("Unsupported GeneratedIdentifierKind.");
+ return ts.Debug.fail("Unsupported GeneratedIdentifierKind.");
}
function getNodeForGeneratedName(name) {
var autoGenerateId = name.autoGenerateId;
@@ -63078,8 +63410,7 @@ var ts;
}
ts.isProgramUptoDate = isProgramUptoDate;
function getConfigFileParsingDiagnostics(configFileParseResult) {
- return configFileParseResult.options.configFile ?
- configFileParseResult.options.configFile.parseDiagnostics.concat(configFileParseResult.errors) :
+ return configFileParseResult.options.configFile ? configFileParseResult.options.configFile.parseDiagnostics.concat(configFileParseResult.errors) :
configFileParseResult.errors;
}
ts.getConfigFileParsingDiagnostics = getConfigFileParsingDiagnostics;
@@ -63107,7 +63438,7 @@ var ts;
function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {
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 host = createProgramOptions.host, oldProgram = createProgramOptions.oldProgram;
+ var oldProgram = createProgramOptions.oldProgram;
var program;
var files = [];
var commonSourceDirectory;
@@ -63124,7 +63455,7 @@ var ts;
var modulesWithElidedImports = ts.createMap();
var sourceFilesFoundSearchingNodeModules = ts.createMap();
ts.performance.mark("beforeProgram");
- host = host || createCompilerHost(options);
+ var host = createProgramOptions.host || createCompilerHost(options);
var configParsingHost = parseConfigHostFromCompilerHost(host);
var skipDefaultLib = options.noLib;
var getDefaultLibraryFileName = ts.memoize(function () { return host.getDefaultLibFileName(options); });
@@ -63231,6 +63562,7 @@ var ts;
getOptionsDiagnostics: getOptionsDiagnostics,
getGlobalDiagnostics: getGlobalDiagnostics,
getSemanticDiagnostics: getSemanticDiagnostics,
+ getSuggestionDiagnostics: getSuggestionDiagnostics,
getDeclarationDiagnostics: getDeclarationDiagnostics,
getTypeChecker: getTypeChecker,
getClassifiableNames: getClassifiableNames,
@@ -63601,7 +63933,7 @@ var ts;
return nodes;
}
function isSourceFileFromExternalLibrary(file) {
- return sourceFilesFoundSearchingNodeModules.get(file.path);
+ return !!sourceFilesFoundSearchingNodeModules.get(file.path);
}
function isSourceFileDefaultLibrary(file) {
if (file.hasNoDefaultLib) {
@@ -63615,7 +63947,7 @@ var ts;
return equalityComparer(file.fileName, getDefaultLibraryFileName());
}
else {
- return ts.forEach(options.lib, function (libFileName) { return equalityComparer(file.fileName, ts.combinePaths(defaultLibraryPath, libFileName)); });
+ return ts.some(options.lib, function (libFileName) { return equalityComparer(file.fileName, ts.combinePaths(defaultLibraryPath, libFileName)); });
}
}
function getDiagnosticsProducingTypeChecker() {
@@ -63732,11 +64064,24 @@ var ts;
var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName);
var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName);
- var diagnostics = bindDiagnostics.concat(checkDiagnostics, fileProcessingDiagnosticsInFile, programDiagnosticsInFile);
- if (isCheckJs) {
- diagnostics = ts.concatenate(diagnostics, sourceFile.jsDocDiagnostics);
+ var diagnostics;
+ for (var _i = 0, _a = [bindDiagnostics, checkDiagnostics, fileProcessingDiagnosticsInFile, programDiagnosticsInFile, isCheckJs ? sourceFile.jsDocDiagnostics : undefined]; _i < _a.length; _i++) {
+ var diags = _a[_i];
+ if (diags) {
+ for (var _b = 0, diags_1 = diags; _b < diags_1.length; _b++) {
+ var diag = diags_1[_b];
+ if (shouldReportDiagnostic(diag)) {
+ diagnostics = ts.append(diagnostics, diag);
+ }
+ }
+ }
}
- return ts.filter(diagnostics, shouldReportDiagnostic);
+ return diagnostics;
+ });
+ }
+ function getSuggestionDiagnostics(sourceFile, cancellationToken) {
+ return runWithCancellationToken(function () {
+ return getDiagnosticsProducingTypeChecker().getSuggestionDiagnostics(sourceFile, cancellationToken);
});
}
function shouldReportDiagnostic(diagnostic) {
@@ -63766,62 +64111,62 @@ var ts;
return diagnostics;
function walk(node) {
switch (parent.kind) {
- case 148:
- case 151:
+ case 149:
+ case 152:
if (parent.questionToken === node) {
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?"));
return;
}
- case 153:
- case 152:
case 154:
+ case 153:
case 155:
case 156:
- case 191:
- case 233:
+ case 157:
case 192:
- case 231:
+ case 234:
+ case 193:
+ case 232:
if (parent.type === node) {
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.types_can_only_be_used_in_a_ts_file));
return;
}
}
switch (node.kind) {
- case 242:
+ case 243:
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file));
return;
- case 248:
+ case 249:
if (node.isExportEquals) {
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file));
return;
}
break;
- case 267:
+ case 268:
var heritageClause = node;
if (heritageClause.token === 108) {
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file));
return;
}
break;
- case 235:
+ case 236:
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file));
return;
- case 238:
+ case 239:
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file));
return;
- case 236:
+ case 237:
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file));
return;
- case 237:
+ case 238:
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file));
return;
- case 208:
+ case 209:
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.non_null_assertions_can_only_be_used_in_a_ts_file));
return;
- case 207:
+ case 208:
diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file));
return;
- case 189:
+ case 190:
ts.Debug.fail();
}
var prevParent = parent;
@@ -63834,25 +64179,25 @@ 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_to_remove_this_warning));
}
switch (parent.kind) {
- case 234:
- case 153:
- case 152:
+ case 235:
case 154:
+ case 153:
case 155:
case 156:
- case 191:
- case 233:
+ case 157:
case 192:
+ case 234:
+ case 193:
if (nodes === parent.typeParameters) {
diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file));
return;
}
- case 213:
+ case 214:
if (nodes === parent.modifiers) {
- return checkModifiers(nodes, parent.kind === 213);
+ return checkModifiers(nodes, parent.kind === 214);
}
break;
- case 151:
+ case 152:
if (nodes === parent.modifiers) {
for (var _i = 0, _a = nodes; _i < _a.length; _i++) {
var modifier = _a[_i];
@@ -63863,17 +64208,17 @@ var ts;
return;
}
break;
- case 148:
+ case 149:
if (nodes === parent.modifiers) {
diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file));
return;
}
break;
- case 186:
case 187:
- case 206:
- case 255:
+ case 188:
+ case 207:
case 256:
+ case 257:
if (nodes === parent.typeArguments) {
diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file));
return;
@@ -64624,9 +64969,9 @@ var ts;
if (ts.isObjectLiteralExpression(pathProp.initializer)) {
for (var _a = 0, _b = ts.getPropertyAssignment(pathProp.initializer, key); _a < _b.length; _a++) {
var keyProps = _b[_a];
- if (ts.isArrayLiteralExpression(keyProps.initializer) &&
- keyProps.initializer.elements.length > valueIndex) {
- programDiagnostics.add(ts.createDiagnosticForNodeInSourceFile(options.configFile, keyProps.initializer.elements[valueIndex], message, arg0, arg1, arg2));
+ var initializer = keyProps.initializer;
+ if (ts.isArrayLiteralExpression(initializer) && initializer.elements.length > valueIndex) {
+ programDiagnostics.add(ts.createDiagnosticForNodeInSourceFile(options.configFile, initializer.elements[valueIndex], message, arg0, arg1, arg2));
needCompilerDiagnostic = false;
}
}
@@ -64728,6 +65073,7 @@ var ts;
return false;
}
programDiagnostics.add(ts.createDiagnosticForNodeInSourceFile(options.configFile, arrayLiteral.elements[index], message, arg0, arg1, arg2));
+ return false;
}
function blockEmittingOfFile(emitFileName, diag) {
hasEmitBlockingDiagnostics.set(toPath(emitFileName), true);
@@ -64745,13 +65091,16 @@ var ts;
if (out) {
return isSameFile(filePath, out) || isSameFile(filePath, ts.removeFileExtension(out) + ".d.ts");
}
+ if (options.declarationDir && ts.containsPath(options.declarationDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames())) {
+ return true;
+ }
if (options.outDir) {
return ts.containsPath(options.outDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames());
}
if (ts.fileExtensionIsOneOf(filePath, ts.supportedJavascriptExtensions) || ts.fileExtensionIs(filePath, ".d.ts")) {
var filePathWithoutExtension = ts.removeFileExtension(filePath);
- return !!getSourceFileByPath(ts.combinePaths(filePathWithoutExtension, ".ts")) ||
- !!getSourceFileByPath(ts.combinePaths(filePathWithoutExtension, ".tsx"));
+ return !!getSourceFileByPath((filePathWithoutExtension + ".ts")) ||
+ !!getSourceFileByPath((filePathWithoutExtension + ".tsx"));
}
return false;
}
@@ -64879,7 +65228,7 @@ var ts;
for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) {
var sourceFile = _a[_i];
var version_1 = sourceFile.version;
- var oldInfo = useOldState && oldState.fileInfos.get(sourceFile.path);
+ var oldInfo = useOldState ? oldState.fileInfos.get(sourceFile.path) : undefined;
if (referencedMap) {
var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName);
if (newReferences) {
@@ -64926,7 +65275,8 @@ var ts;
return false;
}
var info = state.fileInfos.get(sourceFile.path);
- ts.Debug.assert(!!info);
+ if (!info)
+ return ts.Debug.fail();
var prevSignature = info.signature;
var latestSignature;
if (sourceFile.isDeclarationFile) {
@@ -65051,7 +65401,7 @@ var ts;
var ts;
(function (ts) {
function hasSameKeys(map1, map2) {
- return map1 === map2 || map1 && map2 && map1.size === map2.size && !ts.forEachKey(map1, function (key) { return !map2.has(key); });
+ return map1 === map2 || map1 !== undefined && map2 !== undefined && map1.size === map2.size && !ts.forEachKey(map1, function (key) { return !map2.has(key); });
}
function createBuilderProgramState(newProgram, getCanonicalFileName, oldState) {
var state = ts.BuilderState.create(newProgram, getCanonicalFileName, oldState);
@@ -65073,7 +65423,7 @@ var ts;
ts.copyEntries(oldState.changedFilesSet, state.changedFilesSet);
}
var referencedMap = state.referencedMap;
- var oldReferencedMap = useOldState && oldState.referencedMap;
+ var oldReferencedMap = useOldState ? oldState.referencedMap : undefined;
state.fileInfos.forEach(function (info, sourceFilePath) {
var oldInfo;
var newReferences;
@@ -65239,7 +65589,7 @@ var ts;
assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile);
if (!targetSourceFile) {
var sourceMaps = [];
- var emitSkipped = void 0;
+ var emitSkipped = false;
var diagnostics = void 0;
var emittedFiles = [];
var affectedEmitResult = void 0;
@@ -65350,7 +65700,7 @@ var ts;
var customFailedLookupPaths = ts.createMap();
var directoryWatchesOfFailedLookups = ts.createMap();
var rootDir = rootDirForResolution && ts.removeTrailingDirectorySeparator(ts.getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory()));
- var rootPath = rootDir && resolutionHost.toPath(rootDir);
+ var rootPath = (rootDir && resolutionHost.toPath(rootDir));
var typeRootsWatches = ts.createMap();
return {
startRecordingFilesWithChangedResolutions: startRecordingFilesWithChangedResolutions,
@@ -65402,7 +65752,7 @@ var ts;
return false;
}
var value = filesWithInvalidatedNonRelativeUnresolvedImports.get(path);
- return value && !!value.length;
+ return !!value && !!value.length;
}
function createHasInvalidatedResolution(forceAllFilesAsInvalidated) {
if (allFilesHaveInvalidatedResolution || forceAllFilesAsInvalidated) {
@@ -65411,7 +65761,7 @@ var ts;
}
var collected = filesWithInvalidatedResolutions;
filesWithInvalidatedResolutions = undefined;
- return function (path) { return (collected && collected.has(path)) ||
+ return function (path) { return (!!collected && collected.has(path)) ||
isFileWithInvalidatedNonRelativeUnresolvedImports(path); };
}
function clearPerDirectoryResolutions() {
@@ -65559,19 +65909,20 @@ var ts;
if (isNodeModulesDirectory(dirPath)) {
return filterFSRootDirectoriesToWatch({ dir: dir, dirPath: dirPath }, ts.getDirectoryPath(dirPath));
}
- var subDirectory;
+ var subDirectoryPath, subDirectory;
if (rootPath !== undefined) {
while (!isInDirectoryPath(dirPath, rootPath)) {
var parentPath = ts.getDirectoryPath(dirPath);
if (parentPath === dirPath) {
break;
}
- subDirectory = dirPath.slice(parentPath.length + ts.directorySeparator.length);
+ subDirectoryPath = dirPath;
+ subDirectory = dir;
dirPath = parentPath;
dir = ts.getDirectoryPath(dir);
}
}
- return filterFSRootDirectoriesToWatch({ dir: dir, dirPath: dirPath, subDirectory: subDirectory }, dirPath);
+ return filterFSRootDirectoriesToWatch({ dir: subDirectory || dir, dirPath: subDirectoryPath || dirPath }, dirPath);
}
function isPathWithDefaultFailedLookupExtension(path) {
return ts.fileExtensionIsOneOf(path, failedLookupDefaultExtensions);
@@ -65590,7 +65941,7 @@ var ts;
for (var _i = 0, failedLookupLocations_1 = failedLookupLocations; _i < failedLookupLocations_1.length; _i++) {
var failedLookupLocation = failedLookupLocations_1[_i];
var failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
- var _a = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dir = _a.dir, dirPath = _a.dirPath, ignore = _a.ignore, subDirectory = _a.subDirectory;
+ var _a = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dir = _a.dir, dirPath = _a.dirPath, ignore = _a.ignore;
if (!ignore) {
if (!isPathWithDefaultFailedLookupExtension(failedLookupLocationPath)) {
var refCount = customFailedLookupPaths.get(failedLookupLocationPath) || 0;
@@ -65600,7 +65951,7 @@ var ts;
setAtRoot = true;
}
else {
- setDirectoryWatcher(dir, dirPath, subDirectory);
+ setDirectoryWatcher(dir, dirPath);
}
}
}
@@ -65608,19 +65959,13 @@ var ts;
setDirectoryWatcher(rootDir, rootPath);
}
}
- function setDirectoryWatcher(dir, dirPath, subDirectory) {
+ function setDirectoryWatcher(dir, dirPath) {
var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
if (dirWatcher) {
dirWatcher.refCount++;
}
else {
- dirWatcher = { watcher: createDirectoryWatcher(dir, dirPath), refCount: 1 };
- directoryWatchesOfFailedLookups.set(dirPath, dirWatcher);
- }
- if (subDirectory) {
- var subDirectoryMap = dirWatcher.subDirectoryMap || (dirWatcher.subDirectoryMap = ts.createMap());
- var existing = subDirectoryMap.get(subDirectory) || 0;
- subDirectoryMap.set(subDirectory, existing + 1);
+ directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath), refCount: 1 });
}
}
function stopWatchFailedLookupLocationOfResolution(resolution) {
@@ -65636,7 +65981,7 @@ var ts;
for (var _i = 0, failedLookupLocations_2 = failedLookupLocations; _i < failedLookupLocations_2.length; _i++) {
var failedLookupLocation = failedLookupLocations_2[_i];
var failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
- var _a = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dirPath = _a.dirPath, ignore = _a.ignore, subDirectory = _a.subDirectory;
+ var _a = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dirPath = _a.dirPath, ignore = _a.ignore;
if (!ignore) {
var refCount = customFailedLookupPaths.get(failedLookupLocationPath);
if (refCount) {
@@ -65652,7 +65997,7 @@ var ts;
removeAtRoot = true;
}
else {
- removeDirectoryWatcher(dirPath, subDirectory);
+ removeDirectoryWatcher(dirPath);
}
}
}
@@ -65660,39 +66005,18 @@ var ts;
removeDirectoryWatcher(rootPath);
}
}
- function removeDirectoryWatcher(dirPath, subDirectory) {
+ function removeDirectoryWatcher(dirPath) {
var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
- if (subDirectory) {
- var existing = dirWatcher.subDirectoryMap.get(subDirectory);
- if (existing === 1) {
- dirWatcher.subDirectoryMap.delete(subDirectory);
- }
- else {
- dirWatcher.subDirectoryMap.set(subDirectory, existing - 1);
- }
- }
dirWatcher.refCount--;
}
- function inWatchedSubdirectory(dirPath, fileOrDirectoryPath) {
- var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
- if (!dirWatcher || !dirWatcher.subDirectoryMap)
- return false;
- return ts.forEachKey(dirWatcher.subDirectoryMap, function (subDirectory) {
- var fullSubDirectory = dirPath + "/" + subDirectory;
- return fullSubDirectory === fileOrDirectoryPath || isInDirectoryPath(fullSubDirectory, fileOrDirectoryPath);
- });
- }
function createDirectoryWatcher(directory, dirPath) {
return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, function (fileOrDirectory) {
var fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory);
if (cachedDirectoryStructureHost) {
cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
}
- if (!allFilesHaveInvalidatedResolution &&
- (dirPath === rootPath || isNodeModulesDirectory(dirPath) || ts.getDirectoryPath(fileOrDirectoryPath) === dirPath || inWatchedSubdirectory(dirPath, fileOrDirectoryPath))) {
- if (invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) {
- resolutionHost.onInvalidatedResolution();
- }
+ if (!allFilesHaveInvalidatedResolution && invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) {
+ resolutionHost.onInvalidatedResolution();
}
}, 1);
}
@@ -65744,7 +66068,7 @@ var ts;
removeResolutionsOfFile(filePath);
invalidateResolutions(function (resolution, getResolutionWithResolvedFileName) {
var result = getResolutionWithResolvedFileName(resolution);
- return result && resolutionHost.toPath(result.resolvedFileName) === filePath;
+ return !!result && resolutionHost.toPath(result.resolvedFileName) === filePath;
});
}
function setFilesWithInvalidatedNonRelativeUnresolvedImports(filesMap) {
@@ -65791,7 +66115,7 @@ var ts;
return rootPath;
}
var _a = getDirectoryToWatchFromFailedLookupLocationDirectory(typeRoot, typeRootPath), dirPath = _a.dirPath, ignore = _a.ignore;
- return !ignore && directoryWatchesOfFailedLookups.has(dirPath) && dirPath;
+ return !ignore && directoryWatchesOfFailedLookups.has(dirPath) ? dirPath : undefined;
}
function createTypeRootsWatch(typeRootPath, typeRoot) {
return resolutionHost.watchTypeRootsDirectory(typeRoot, function (fileOrDirectory) {
@@ -66013,9 +66337,9 @@ var ts;
system.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped);
}
function createWatchCompilerHostOfConfigFile(configFileName, optionsToExtend, system, createProgram, reportDiagnostic, reportWatchStatus) {
- reportDiagnostic = reportDiagnostic || createDiagnosticReporter(system);
- var host = createWatchCompilerHost(system, createProgram, reportDiagnostic, reportWatchStatus);
- host.onUnRecoverableConfigFileDiagnostic = function (diagnostic) { return reportUnrecoverableDiagnostic(system, reportDiagnostic, diagnostic); };
+ var diagnosticReporter = reportDiagnostic || createDiagnosticReporter(system);
+ var host = createWatchCompilerHost(system, createProgram, diagnosticReporter, reportWatchStatus);
+ host.onUnRecoverableConfigFileDiagnostic = function (diagnostic) { return reportUnrecoverableDiagnostic(system, diagnosticReporter, diagnostic); };
host.configFileName = configFileName;
host.optionsToExtend = optionsToExtend;
return host;
@@ -66059,7 +66383,7 @@ var ts;
var configFileSpecs;
var configFileParsingDiagnostics;
var hasChangedConfigFileParsingErrors = false;
- var cachedDirectoryStructureHost = configFileName && ts.createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames);
+ var cachedDirectoryStructureHost = configFileName === undefined ? undefined : ts.createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames);
if (cachedDirectoryStructureHost && host.onCachedDirectoryStructureHostCreate) {
host.onCachedDirectoryStructureHostCreate(cachedDirectoryStructureHost);
}
@@ -66109,7 +66433,7 @@ var ts;
readFile: readFile,
trace: trace,
directoryExists: directoryStructureHost.directoryExists && (function (path) { return directoryStructureHost.directoryExists(path); }),
- getDirectories: directoryStructureHost.getDirectories && (function (path) { return directoryStructureHost.getDirectories(path); }),
+ getDirectories: (directoryStructureHost.getDirectories && (function (path) { return directoryStructureHost.getDirectories(path); })),
realpath: host.realpath && (function (s) { return host.realpath(s); }),
getEnvironmentVariable: host.getEnvironmentVariable ? (function (name) { return host.getEnvironmentVariable(name); }) : (function () { return ""; }),
onReleaseOldSourceFile: onReleaseOldSourceFile,
@@ -66596,6 +66920,7 @@ var ts;
"es2018.promise": "lib.es2018.promise.d.ts",
"es2018.regexp": "lib.es2018.regexp.d.ts",
"esnext.array": "lib.esnext.array.d.ts",
+ "esnext.symbol": "lib.esnext.symbol.d.ts",
"esnext.asynciterable": "lib.esnext.asynciterable.d.ts",
}),
},
@@ -67219,7 +67544,7 @@ var ts;
case "string":
return ts.map(values, function (v) { return v || ""; });
default:
- return ts.filter(ts.map(values, function (v) { return parseCustomTypeOption(opt.element, v, errors); }), function (v) { return !!v; });
+ return ts.mapDefined(values, function (v) { return parseCustomTypeOption(opt.element, v, errors); });
}
}
ts.parseListTypeOption = parseListTypeOption;
@@ -67340,6 +67665,7 @@ var ts;
}
return optionNameMap.get(optionName);
}
+ ts.getOptionFromName = getOptionFromName;
function getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host) {
var configFileText;
try {
@@ -67474,7 +67800,7 @@ var ts;
var result = returnValue ? {} : undefined;
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var element = _a[_i];
- if (element.kind !== 269) {
+ if (element.kind !== 270) {
errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected));
continue;
}
@@ -67545,13 +67871,13 @@ var ts;
case 8:
reportInvalidOptionValue(option && option.type !== "number");
return Number(valueExpression.text);
- case 197:
+ case 198:
if (valueExpression.operator !== 38 || valueExpression.operand.kind !== 8) {
break;
}
reportInvalidOptionValue(option && option.type !== "number");
return -Number(valueExpression.operand.text);
- case 183:
+ case 184:
reportInvalidOptionValue(option && option.type !== "object");
var objectLiteralExpression = valueExpression;
if (option) {
@@ -67561,7 +67887,7 @@ var ts;
else {
return convertObjectLiteralExpressionToJson(objectLiteralExpression, undefined, undefined, undefined);
}
- case 182:
+ case 183:
reportInvalidOptionValue(option && option.type !== "list");
return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element);
}
@@ -67598,6 +67924,7 @@ var ts;
var expectedType = ts.isString(option.type) ? option.type : "string";
return typeof value === expectedType;
}
+ return false;
}
function generateTSConfig(options, fileNames, newLine) {
var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions);
@@ -68019,13 +68346,10 @@ var ts;
}
function convertCompileOnSaveOptionFromJson(jsonOption, basePath, errors) {
if (!ts.hasProperty(jsonOption, ts.compileOnSaveCommandLineOption.name)) {
- return undefined;
+ return false;
}
var result = convertJsonOption(ts.compileOnSaveCommandLineOption, jsonOption.compileOnSave, basePath, errors);
- if (typeof result === "boolean" && result) {
- return result;
- }
- return false;
+ return typeof result === "boolean" && result;
}
function convertCompilerOptionsFromJson(jsonOptions, basePath, configFileName) {
var errors = [];
@@ -68054,7 +68378,7 @@ var ts;
return options;
}
function getDefaultTypeAcquisition(configFileName) {
- return { enable: configFileName && ts.getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] };
+ return { enable: !!configFileName && ts.getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] };
}
function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) {
var options = getDefaultTypeAcquisition(configFileName);
@@ -68382,7 +68706,7 @@ var ts;
}
if (commandLine.options.help || commandLine.options.all) {
printVersion();
- printHelp(commandLine.options.all);
+ printHelp(!!commandLine.options.all);
return ts.sys.exit(ts.ExitStatus.Success);
}
if (commandLine.options.project) {
@@ -68412,7 +68736,7 @@ var ts;
}
if (commandLine.fileNames.length === 0 && !configFileName) {
printVersion();
- printHelp(commandLine.options.all);
+ printHelp(!!commandLine.options.all);
return ts.sys.exit(ts.ExitStatus.Success);
}
var commandLineOptions = commandLine.options;
@@ -68575,7 +68899,7 @@ var ts;
output.push(getDiagnosticText(ts.Diagnostics.Options_Colon) + ts.sys.newLine);
var optsList = showAllOptions ?
ts.sort(ts.optionDeclarations, function (a, b) { return ts.compareStringsCaseInsensitive(a.name, b.name); }) :
- ts.filter(ts.optionDeclarations.slice(), function (v) { return v.showInSimplifiedHelpView; });
+ ts.filter(ts.optionDeclarations.slice(), function (v) { return !!v.showInSimplifiedHelpView; });
marginLength = 0;
var usageColumn = [];
var descriptionColumn = [];
diff --git a/lib/tsserver.js b/lib/tsserver.js
index dc5875cc4b9..035ba5afaf9 100644
--- a/lib/tsserver.js
+++ b/lib/tsserver.js
@@ -188,169 +188,170 @@ var ts;
SyntaxKind[SyntaxKind["TypeKeyword"] = 139] = "TypeKeyword";
SyntaxKind[SyntaxKind["UndefinedKeyword"] = 140] = "UndefinedKeyword";
SyntaxKind[SyntaxKind["UniqueKeyword"] = 141] = "UniqueKeyword";
- SyntaxKind[SyntaxKind["FromKeyword"] = 142] = "FromKeyword";
- SyntaxKind[SyntaxKind["GlobalKeyword"] = 143] = "GlobalKeyword";
- SyntaxKind[SyntaxKind["OfKeyword"] = 144] = "OfKeyword";
- SyntaxKind[SyntaxKind["QualifiedName"] = 145] = "QualifiedName";
- SyntaxKind[SyntaxKind["ComputedPropertyName"] = 146] = "ComputedPropertyName";
- SyntaxKind[SyntaxKind["TypeParameter"] = 147] = "TypeParameter";
- SyntaxKind[SyntaxKind["Parameter"] = 148] = "Parameter";
- SyntaxKind[SyntaxKind["Decorator"] = 149] = "Decorator";
- SyntaxKind[SyntaxKind["PropertySignature"] = 150] = "PropertySignature";
- SyntaxKind[SyntaxKind["PropertyDeclaration"] = 151] = "PropertyDeclaration";
- SyntaxKind[SyntaxKind["MethodSignature"] = 152] = "MethodSignature";
- SyntaxKind[SyntaxKind["MethodDeclaration"] = 153] = "MethodDeclaration";
- SyntaxKind[SyntaxKind["Constructor"] = 154] = "Constructor";
- SyntaxKind[SyntaxKind["GetAccessor"] = 155] = "GetAccessor";
- SyntaxKind[SyntaxKind["SetAccessor"] = 156] = "SetAccessor";
- SyntaxKind[SyntaxKind["CallSignature"] = 157] = "CallSignature";
- SyntaxKind[SyntaxKind["ConstructSignature"] = 158] = "ConstructSignature";
- SyntaxKind[SyntaxKind["IndexSignature"] = 159] = "IndexSignature";
- SyntaxKind[SyntaxKind["TypePredicate"] = 160] = "TypePredicate";
- SyntaxKind[SyntaxKind["TypeReference"] = 161] = "TypeReference";
- SyntaxKind[SyntaxKind["FunctionType"] = 162] = "FunctionType";
- SyntaxKind[SyntaxKind["ConstructorType"] = 163] = "ConstructorType";
- SyntaxKind[SyntaxKind["TypeQuery"] = 164] = "TypeQuery";
- SyntaxKind[SyntaxKind["TypeLiteral"] = 165] = "TypeLiteral";
- SyntaxKind[SyntaxKind["ArrayType"] = 166] = "ArrayType";
- SyntaxKind[SyntaxKind["TupleType"] = 167] = "TupleType";
- SyntaxKind[SyntaxKind["UnionType"] = 168] = "UnionType";
- SyntaxKind[SyntaxKind["IntersectionType"] = 169] = "IntersectionType";
- SyntaxKind[SyntaxKind["ConditionalType"] = 170] = "ConditionalType";
- SyntaxKind[SyntaxKind["InferType"] = 171] = "InferType";
- SyntaxKind[SyntaxKind["ParenthesizedType"] = 172] = "ParenthesizedType";
- SyntaxKind[SyntaxKind["ThisType"] = 173] = "ThisType";
- SyntaxKind[SyntaxKind["TypeOperator"] = 174] = "TypeOperator";
- SyntaxKind[SyntaxKind["IndexedAccessType"] = 175] = "IndexedAccessType";
- SyntaxKind[SyntaxKind["MappedType"] = 176] = "MappedType";
- SyntaxKind[SyntaxKind["LiteralType"] = 177] = "LiteralType";
- SyntaxKind[SyntaxKind["ImportType"] = 178] = "ImportType";
- SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 179] = "ObjectBindingPattern";
- SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 180] = "ArrayBindingPattern";
- SyntaxKind[SyntaxKind["BindingElement"] = 181] = "BindingElement";
- SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 182] = "ArrayLiteralExpression";
- SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 183] = "ObjectLiteralExpression";
- SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 184] = "PropertyAccessExpression";
- SyntaxKind[SyntaxKind["ElementAccessExpression"] = 185] = "ElementAccessExpression";
- SyntaxKind[SyntaxKind["CallExpression"] = 186] = "CallExpression";
- SyntaxKind[SyntaxKind["NewExpression"] = 187] = "NewExpression";
- SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 188] = "TaggedTemplateExpression";
- SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 189] = "TypeAssertionExpression";
- SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 190] = "ParenthesizedExpression";
- SyntaxKind[SyntaxKind["FunctionExpression"] = 191] = "FunctionExpression";
- SyntaxKind[SyntaxKind["ArrowFunction"] = 192] = "ArrowFunction";
- SyntaxKind[SyntaxKind["DeleteExpression"] = 193] = "DeleteExpression";
- SyntaxKind[SyntaxKind["TypeOfExpression"] = 194] = "TypeOfExpression";
- SyntaxKind[SyntaxKind["VoidExpression"] = 195] = "VoidExpression";
- SyntaxKind[SyntaxKind["AwaitExpression"] = 196] = "AwaitExpression";
- SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 197] = "PrefixUnaryExpression";
- SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 198] = "PostfixUnaryExpression";
- SyntaxKind[SyntaxKind["BinaryExpression"] = 199] = "BinaryExpression";
- SyntaxKind[SyntaxKind["ConditionalExpression"] = 200] = "ConditionalExpression";
- SyntaxKind[SyntaxKind["TemplateExpression"] = 201] = "TemplateExpression";
- SyntaxKind[SyntaxKind["YieldExpression"] = 202] = "YieldExpression";
- SyntaxKind[SyntaxKind["SpreadElement"] = 203] = "SpreadElement";
- SyntaxKind[SyntaxKind["ClassExpression"] = 204] = "ClassExpression";
- SyntaxKind[SyntaxKind["OmittedExpression"] = 205] = "OmittedExpression";
- SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 206] = "ExpressionWithTypeArguments";
- SyntaxKind[SyntaxKind["AsExpression"] = 207] = "AsExpression";
- SyntaxKind[SyntaxKind["NonNullExpression"] = 208] = "NonNullExpression";
- SyntaxKind[SyntaxKind["MetaProperty"] = 209] = "MetaProperty";
- SyntaxKind[SyntaxKind["TemplateSpan"] = 210] = "TemplateSpan";
- SyntaxKind[SyntaxKind["SemicolonClassElement"] = 211] = "SemicolonClassElement";
- SyntaxKind[SyntaxKind["Block"] = 212] = "Block";
- SyntaxKind[SyntaxKind["VariableStatement"] = 213] = "VariableStatement";
- SyntaxKind[SyntaxKind["EmptyStatement"] = 214] = "EmptyStatement";
- SyntaxKind[SyntaxKind["ExpressionStatement"] = 215] = "ExpressionStatement";
- SyntaxKind[SyntaxKind["IfStatement"] = 216] = "IfStatement";
- SyntaxKind[SyntaxKind["DoStatement"] = 217] = "DoStatement";
- SyntaxKind[SyntaxKind["WhileStatement"] = 218] = "WhileStatement";
- SyntaxKind[SyntaxKind["ForStatement"] = 219] = "ForStatement";
- SyntaxKind[SyntaxKind["ForInStatement"] = 220] = "ForInStatement";
- SyntaxKind[SyntaxKind["ForOfStatement"] = 221] = "ForOfStatement";
- SyntaxKind[SyntaxKind["ContinueStatement"] = 222] = "ContinueStatement";
- SyntaxKind[SyntaxKind["BreakStatement"] = 223] = "BreakStatement";
- SyntaxKind[SyntaxKind["ReturnStatement"] = 224] = "ReturnStatement";
- SyntaxKind[SyntaxKind["WithStatement"] = 225] = "WithStatement";
- SyntaxKind[SyntaxKind["SwitchStatement"] = 226] = "SwitchStatement";
- SyntaxKind[SyntaxKind["LabeledStatement"] = 227] = "LabeledStatement";
- SyntaxKind[SyntaxKind["ThrowStatement"] = 228] = "ThrowStatement";
- SyntaxKind[SyntaxKind["TryStatement"] = 229] = "TryStatement";
- SyntaxKind[SyntaxKind["DebuggerStatement"] = 230] = "DebuggerStatement";
- SyntaxKind[SyntaxKind["VariableDeclaration"] = 231] = "VariableDeclaration";
- SyntaxKind[SyntaxKind["VariableDeclarationList"] = 232] = "VariableDeclarationList";
- SyntaxKind[SyntaxKind["FunctionDeclaration"] = 233] = "FunctionDeclaration";
- SyntaxKind[SyntaxKind["ClassDeclaration"] = 234] = "ClassDeclaration";
- SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 235] = "InterfaceDeclaration";
- SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 236] = "TypeAliasDeclaration";
- SyntaxKind[SyntaxKind["EnumDeclaration"] = 237] = "EnumDeclaration";
- SyntaxKind[SyntaxKind["ModuleDeclaration"] = 238] = "ModuleDeclaration";
- SyntaxKind[SyntaxKind["ModuleBlock"] = 239] = "ModuleBlock";
- SyntaxKind[SyntaxKind["CaseBlock"] = 240] = "CaseBlock";
- SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 241] = "NamespaceExportDeclaration";
- SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 242] = "ImportEqualsDeclaration";
- SyntaxKind[SyntaxKind["ImportDeclaration"] = 243] = "ImportDeclaration";
- SyntaxKind[SyntaxKind["ImportClause"] = 244] = "ImportClause";
- SyntaxKind[SyntaxKind["NamespaceImport"] = 245] = "NamespaceImport";
- SyntaxKind[SyntaxKind["NamedImports"] = 246] = "NamedImports";
- SyntaxKind[SyntaxKind["ImportSpecifier"] = 247] = "ImportSpecifier";
- SyntaxKind[SyntaxKind["ExportAssignment"] = 248] = "ExportAssignment";
- SyntaxKind[SyntaxKind["ExportDeclaration"] = 249] = "ExportDeclaration";
- SyntaxKind[SyntaxKind["NamedExports"] = 250] = "NamedExports";
- SyntaxKind[SyntaxKind["ExportSpecifier"] = 251] = "ExportSpecifier";
- SyntaxKind[SyntaxKind["MissingDeclaration"] = 252] = "MissingDeclaration";
- SyntaxKind[SyntaxKind["ExternalModuleReference"] = 253] = "ExternalModuleReference";
- SyntaxKind[SyntaxKind["JsxElement"] = 254] = "JsxElement";
- SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 255] = "JsxSelfClosingElement";
- SyntaxKind[SyntaxKind["JsxOpeningElement"] = 256] = "JsxOpeningElement";
- SyntaxKind[SyntaxKind["JsxClosingElement"] = 257] = "JsxClosingElement";
- SyntaxKind[SyntaxKind["JsxFragment"] = 258] = "JsxFragment";
- SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 259] = "JsxOpeningFragment";
- SyntaxKind[SyntaxKind["JsxClosingFragment"] = 260] = "JsxClosingFragment";
- SyntaxKind[SyntaxKind["JsxAttribute"] = 261] = "JsxAttribute";
- SyntaxKind[SyntaxKind["JsxAttributes"] = 262] = "JsxAttributes";
- SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 263] = "JsxSpreadAttribute";
- SyntaxKind[SyntaxKind["JsxExpression"] = 264] = "JsxExpression";
- SyntaxKind[SyntaxKind["CaseClause"] = 265] = "CaseClause";
- SyntaxKind[SyntaxKind["DefaultClause"] = 266] = "DefaultClause";
- SyntaxKind[SyntaxKind["HeritageClause"] = 267] = "HeritageClause";
- SyntaxKind[SyntaxKind["CatchClause"] = 268] = "CatchClause";
- SyntaxKind[SyntaxKind["PropertyAssignment"] = 269] = "PropertyAssignment";
- SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 270] = "ShorthandPropertyAssignment";
- SyntaxKind[SyntaxKind["SpreadAssignment"] = 271] = "SpreadAssignment";
- SyntaxKind[SyntaxKind["EnumMember"] = 272] = "EnumMember";
- SyntaxKind[SyntaxKind["SourceFile"] = 273] = "SourceFile";
- SyntaxKind[SyntaxKind["Bundle"] = 274] = "Bundle";
- SyntaxKind[SyntaxKind["UnparsedSource"] = 275] = "UnparsedSource";
- SyntaxKind[SyntaxKind["InputFiles"] = 276] = "InputFiles";
- SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 277] = "JSDocTypeExpression";
- SyntaxKind[SyntaxKind["JSDocAllType"] = 278] = "JSDocAllType";
- SyntaxKind[SyntaxKind["JSDocUnknownType"] = 279] = "JSDocUnknownType";
- SyntaxKind[SyntaxKind["JSDocNullableType"] = 280] = "JSDocNullableType";
- SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 281] = "JSDocNonNullableType";
- SyntaxKind[SyntaxKind["JSDocOptionalType"] = 282] = "JSDocOptionalType";
- SyntaxKind[SyntaxKind["JSDocFunctionType"] = 283] = "JSDocFunctionType";
- SyntaxKind[SyntaxKind["JSDocVariadicType"] = 284] = "JSDocVariadicType";
- SyntaxKind[SyntaxKind["JSDocComment"] = 285] = "JSDocComment";
- SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 286] = "JSDocTypeLiteral";
- SyntaxKind[SyntaxKind["JSDocSignature"] = 287] = "JSDocSignature";
- SyntaxKind[SyntaxKind["JSDocTag"] = 288] = "JSDocTag";
- SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 289] = "JSDocAugmentsTag";
- SyntaxKind[SyntaxKind["JSDocClassTag"] = 290] = "JSDocClassTag";
- SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 291] = "JSDocCallbackTag";
- SyntaxKind[SyntaxKind["JSDocParameterTag"] = 292] = "JSDocParameterTag";
- SyntaxKind[SyntaxKind["JSDocReturnTag"] = 293] = "JSDocReturnTag";
- SyntaxKind[SyntaxKind["JSDocTypeTag"] = 294] = "JSDocTypeTag";
- SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 295] = "JSDocTemplateTag";
- SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 296] = "JSDocTypedefTag";
- SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 297] = "JSDocPropertyTag";
- SyntaxKind[SyntaxKind["SyntaxList"] = 298] = "SyntaxList";
- SyntaxKind[SyntaxKind["NotEmittedStatement"] = 299] = "NotEmittedStatement";
- SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 300] = "PartiallyEmittedExpression";
- SyntaxKind[SyntaxKind["CommaListExpression"] = 301] = "CommaListExpression";
- SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 302] = "MergeDeclarationMarker";
- SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 303] = "EndOfDeclarationMarker";
- SyntaxKind[SyntaxKind["Count"] = 304] = "Count";
+ SyntaxKind[SyntaxKind["UnknownKeyword"] = 142] = "UnknownKeyword";
+ SyntaxKind[SyntaxKind["FromKeyword"] = 143] = "FromKeyword";
+ SyntaxKind[SyntaxKind["GlobalKeyword"] = 144] = "GlobalKeyword";
+ SyntaxKind[SyntaxKind["OfKeyword"] = 145] = "OfKeyword";
+ SyntaxKind[SyntaxKind["QualifiedName"] = 146] = "QualifiedName";
+ SyntaxKind[SyntaxKind["ComputedPropertyName"] = 147] = "ComputedPropertyName";
+ SyntaxKind[SyntaxKind["TypeParameter"] = 148] = "TypeParameter";
+ SyntaxKind[SyntaxKind["Parameter"] = 149] = "Parameter";
+ SyntaxKind[SyntaxKind["Decorator"] = 150] = "Decorator";
+ SyntaxKind[SyntaxKind["PropertySignature"] = 151] = "PropertySignature";
+ SyntaxKind[SyntaxKind["PropertyDeclaration"] = 152] = "PropertyDeclaration";
+ SyntaxKind[SyntaxKind["MethodSignature"] = 153] = "MethodSignature";
+ SyntaxKind[SyntaxKind["MethodDeclaration"] = 154] = "MethodDeclaration";
+ SyntaxKind[SyntaxKind["Constructor"] = 155] = "Constructor";
+ SyntaxKind[SyntaxKind["GetAccessor"] = 156] = "GetAccessor";
+ SyntaxKind[SyntaxKind["SetAccessor"] = 157] = "SetAccessor";
+ SyntaxKind[SyntaxKind["CallSignature"] = 158] = "CallSignature";
+ SyntaxKind[SyntaxKind["ConstructSignature"] = 159] = "ConstructSignature";
+ SyntaxKind[SyntaxKind["IndexSignature"] = 160] = "IndexSignature";
+ SyntaxKind[SyntaxKind["TypePredicate"] = 161] = "TypePredicate";
+ SyntaxKind[SyntaxKind["TypeReference"] = 162] = "TypeReference";
+ SyntaxKind[SyntaxKind["FunctionType"] = 163] = "FunctionType";
+ SyntaxKind[SyntaxKind["ConstructorType"] = 164] = "ConstructorType";
+ SyntaxKind[SyntaxKind["TypeQuery"] = 165] = "TypeQuery";
+ SyntaxKind[SyntaxKind["TypeLiteral"] = 166] = "TypeLiteral";
+ SyntaxKind[SyntaxKind["ArrayType"] = 167] = "ArrayType";
+ SyntaxKind[SyntaxKind["TupleType"] = 168] = "TupleType";
+ SyntaxKind[SyntaxKind["UnionType"] = 169] = "UnionType";
+ SyntaxKind[SyntaxKind["IntersectionType"] = 170] = "IntersectionType";
+ SyntaxKind[SyntaxKind["ConditionalType"] = 171] = "ConditionalType";
+ SyntaxKind[SyntaxKind["InferType"] = 172] = "InferType";
+ SyntaxKind[SyntaxKind["ParenthesizedType"] = 173] = "ParenthesizedType";
+ SyntaxKind[SyntaxKind["ThisType"] = 174] = "ThisType";
+ SyntaxKind[SyntaxKind["TypeOperator"] = 175] = "TypeOperator";
+ SyntaxKind[SyntaxKind["IndexedAccessType"] = 176] = "IndexedAccessType";
+ SyntaxKind[SyntaxKind["MappedType"] = 177] = "MappedType";
+ SyntaxKind[SyntaxKind["LiteralType"] = 178] = "LiteralType";
+ SyntaxKind[SyntaxKind["ImportType"] = 179] = "ImportType";
+ SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 180] = "ObjectBindingPattern";
+ SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 181] = "ArrayBindingPattern";
+ SyntaxKind[SyntaxKind["BindingElement"] = 182] = "BindingElement";
+ SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 183] = "ArrayLiteralExpression";
+ SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 184] = "ObjectLiteralExpression";
+ SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 185] = "PropertyAccessExpression";
+ SyntaxKind[SyntaxKind["ElementAccessExpression"] = 186] = "ElementAccessExpression";
+ SyntaxKind[SyntaxKind["CallExpression"] = 187] = "CallExpression";
+ SyntaxKind[SyntaxKind["NewExpression"] = 188] = "NewExpression";
+ SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 189] = "TaggedTemplateExpression";
+ SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 190] = "TypeAssertionExpression";
+ SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 191] = "ParenthesizedExpression";
+ SyntaxKind[SyntaxKind["FunctionExpression"] = 192] = "FunctionExpression";
+ SyntaxKind[SyntaxKind["ArrowFunction"] = 193] = "ArrowFunction";
+ SyntaxKind[SyntaxKind["DeleteExpression"] = 194] = "DeleteExpression";
+ SyntaxKind[SyntaxKind["TypeOfExpression"] = 195] = "TypeOfExpression";
+ SyntaxKind[SyntaxKind["VoidExpression"] = 196] = "VoidExpression";
+ SyntaxKind[SyntaxKind["AwaitExpression"] = 197] = "AwaitExpression";
+ SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 198] = "PrefixUnaryExpression";
+ SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 199] = "PostfixUnaryExpression";
+ SyntaxKind[SyntaxKind["BinaryExpression"] = 200] = "BinaryExpression";
+ SyntaxKind[SyntaxKind["ConditionalExpression"] = 201] = "ConditionalExpression";
+ SyntaxKind[SyntaxKind["TemplateExpression"] = 202] = "TemplateExpression";
+ SyntaxKind[SyntaxKind["YieldExpression"] = 203] = "YieldExpression";
+ SyntaxKind[SyntaxKind["SpreadElement"] = 204] = "SpreadElement";
+ SyntaxKind[SyntaxKind["ClassExpression"] = 205] = "ClassExpression";
+ SyntaxKind[SyntaxKind["OmittedExpression"] = 206] = "OmittedExpression";
+ SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 207] = "ExpressionWithTypeArguments";
+ SyntaxKind[SyntaxKind["AsExpression"] = 208] = "AsExpression";
+ SyntaxKind[SyntaxKind["NonNullExpression"] = 209] = "NonNullExpression";
+ SyntaxKind[SyntaxKind["MetaProperty"] = 210] = "MetaProperty";
+ SyntaxKind[SyntaxKind["TemplateSpan"] = 211] = "TemplateSpan";
+ SyntaxKind[SyntaxKind["SemicolonClassElement"] = 212] = "SemicolonClassElement";
+ SyntaxKind[SyntaxKind["Block"] = 213] = "Block";
+ SyntaxKind[SyntaxKind["VariableStatement"] = 214] = "VariableStatement";
+ SyntaxKind[SyntaxKind["EmptyStatement"] = 215] = "EmptyStatement";
+ SyntaxKind[SyntaxKind["ExpressionStatement"] = 216] = "ExpressionStatement";
+ SyntaxKind[SyntaxKind["IfStatement"] = 217] = "IfStatement";
+ SyntaxKind[SyntaxKind["DoStatement"] = 218] = "DoStatement";
+ SyntaxKind[SyntaxKind["WhileStatement"] = 219] = "WhileStatement";
+ SyntaxKind[SyntaxKind["ForStatement"] = 220] = "ForStatement";
+ SyntaxKind[SyntaxKind["ForInStatement"] = 221] = "ForInStatement";
+ SyntaxKind[SyntaxKind["ForOfStatement"] = 222] = "ForOfStatement";
+ SyntaxKind[SyntaxKind["ContinueStatement"] = 223] = "ContinueStatement";
+ SyntaxKind[SyntaxKind["BreakStatement"] = 224] = "BreakStatement";
+ SyntaxKind[SyntaxKind["ReturnStatement"] = 225] = "ReturnStatement";
+ SyntaxKind[SyntaxKind["WithStatement"] = 226] = "WithStatement";
+ SyntaxKind[SyntaxKind["SwitchStatement"] = 227] = "SwitchStatement";
+ SyntaxKind[SyntaxKind["LabeledStatement"] = 228] = "LabeledStatement";
+ SyntaxKind[SyntaxKind["ThrowStatement"] = 229] = "ThrowStatement";
+ SyntaxKind[SyntaxKind["TryStatement"] = 230] = "TryStatement";
+ SyntaxKind[SyntaxKind["DebuggerStatement"] = 231] = "DebuggerStatement";
+ SyntaxKind[SyntaxKind["VariableDeclaration"] = 232] = "VariableDeclaration";
+ SyntaxKind[SyntaxKind["VariableDeclarationList"] = 233] = "VariableDeclarationList";
+ SyntaxKind[SyntaxKind["FunctionDeclaration"] = 234] = "FunctionDeclaration";
+ SyntaxKind[SyntaxKind["ClassDeclaration"] = 235] = "ClassDeclaration";
+ SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 236] = "InterfaceDeclaration";
+ SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 237] = "TypeAliasDeclaration";
+ SyntaxKind[SyntaxKind["EnumDeclaration"] = 238] = "EnumDeclaration";
+ SyntaxKind[SyntaxKind["ModuleDeclaration"] = 239] = "ModuleDeclaration";
+ SyntaxKind[SyntaxKind["ModuleBlock"] = 240] = "ModuleBlock";
+ SyntaxKind[SyntaxKind["CaseBlock"] = 241] = "CaseBlock";
+ SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 242] = "NamespaceExportDeclaration";
+ SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 243] = "ImportEqualsDeclaration";
+ SyntaxKind[SyntaxKind["ImportDeclaration"] = 244] = "ImportDeclaration";
+ SyntaxKind[SyntaxKind["ImportClause"] = 245] = "ImportClause";
+ SyntaxKind[SyntaxKind["NamespaceImport"] = 246] = "NamespaceImport";
+ SyntaxKind[SyntaxKind["NamedImports"] = 247] = "NamedImports";
+ SyntaxKind[SyntaxKind["ImportSpecifier"] = 248] = "ImportSpecifier";
+ SyntaxKind[SyntaxKind["ExportAssignment"] = 249] = "ExportAssignment";
+ SyntaxKind[SyntaxKind["ExportDeclaration"] = 250] = "ExportDeclaration";
+ SyntaxKind[SyntaxKind["NamedExports"] = 251] = "NamedExports";
+ SyntaxKind[SyntaxKind["ExportSpecifier"] = 252] = "ExportSpecifier";
+ SyntaxKind[SyntaxKind["MissingDeclaration"] = 253] = "MissingDeclaration";
+ SyntaxKind[SyntaxKind["ExternalModuleReference"] = 254] = "ExternalModuleReference";
+ SyntaxKind[SyntaxKind["JsxElement"] = 255] = "JsxElement";
+ SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 256] = "JsxSelfClosingElement";
+ SyntaxKind[SyntaxKind["JsxOpeningElement"] = 257] = "JsxOpeningElement";
+ SyntaxKind[SyntaxKind["JsxClosingElement"] = 258] = "JsxClosingElement";
+ SyntaxKind[SyntaxKind["JsxFragment"] = 259] = "JsxFragment";
+ SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 260] = "JsxOpeningFragment";
+ SyntaxKind[SyntaxKind["JsxClosingFragment"] = 261] = "JsxClosingFragment";
+ SyntaxKind[SyntaxKind["JsxAttribute"] = 262] = "JsxAttribute";
+ SyntaxKind[SyntaxKind["JsxAttributes"] = 263] = "JsxAttributes";
+ SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 264] = "JsxSpreadAttribute";
+ SyntaxKind[SyntaxKind["JsxExpression"] = 265] = "JsxExpression";
+ SyntaxKind[SyntaxKind["CaseClause"] = 266] = "CaseClause";
+ SyntaxKind[SyntaxKind["DefaultClause"] = 267] = "DefaultClause";
+ SyntaxKind[SyntaxKind["HeritageClause"] = 268] = "HeritageClause";
+ SyntaxKind[SyntaxKind["CatchClause"] = 269] = "CatchClause";
+ SyntaxKind[SyntaxKind["PropertyAssignment"] = 270] = "PropertyAssignment";
+ SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 271] = "ShorthandPropertyAssignment";
+ SyntaxKind[SyntaxKind["SpreadAssignment"] = 272] = "SpreadAssignment";
+ SyntaxKind[SyntaxKind["EnumMember"] = 273] = "EnumMember";
+ SyntaxKind[SyntaxKind["SourceFile"] = 274] = "SourceFile";
+ SyntaxKind[SyntaxKind["Bundle"] = 275] = "Bundle";
+ SyntaxKind[SyntaxKind["UnparsedSource"] = 276] = "UnparsedSource";
+ SyntaxKind[SyntaxKind["InputFiles"] = 277] = "InputFiles";
+ SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 278] = "JSDocTypeExpression";
+ SyntaxKind[SyntaxKind["JSDocAllType"] = 279] = "JSDocAllType";
+ SyntaxKind[SyntaxKind["JSDocUnknownType"] = 280] = "JSDocUnknownType";
+ SyntaxKind[SyntaxKind["JSDocNullableType"] = 281] = "JSDocNullableType";
+ SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 282] = "JSDocNonNullableType";
+ SyntaxKind[SyntaxKind["JSDocOptionalType"] = 283] = "JSDocOptionalType";
+ SyntaxKind[SyntaxKind["JSDocFunctionType"] = 284] = "JSDocFunctionType";
+ SyntaxKind[SyntaxKind["JSDocVariadicType"] = 285] = "JSDocVariadicType";
+ SyntaxKind[SyntaxKind["JSDocComment"] = 286] = "JSDocComment";
+ SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 287] = "JSDocTypeLiteral";
+ SyntaxKind[SyntaxKind["JSDocSignature"] = 288] = "JSDocSignature";
+ SyntaxKind[SyntaxKind["JSDocTag"] = 289] = "JSDocTag";
+ SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 290] = "JSDocAugmentsTag";
+ SyntaxKind[SyntaxKind["JSDocClassTag"] = 291] = "JSDocClassTag";
+ SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 292] = "JSDocCallbackTag";
+ SyntaxKind[SyntaxKind["JSDocParameterTag"] = 293] = "JSDocParameterTag";
+ SyntaxKind[SyntaxKind["JSDocReturnTag"] = 294] = "JSDocReturnTag";
+ SyntaxKind[SyntaxKind["JSDocTypeTag"] = 295] = "JSDocTypeTag";
+ SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 296] = "JSDocTemplateTag";
+ SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 297] = "JSDocTypedefTag";
+ SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 298] = "JSDocPropertyTag";
+ SyntaxKind[SyntaxKind["SyntaxList"] = 299] = "SyntaxList";
+ SyntaxKind[SyntaxKind["NotEmittedStatement"] = 300] = "NotEmittedStatement";
+ SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 301] = "PartiallyEmittedExpression";
+ SyntaxKind[SyntaxKind["CommaListExpression"] = 302] = "CommaListExpression";
+ SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 303] = "MergeDeclarationMarker";
+ SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 304] = "EndOfDeclarationMarker";
+ SyntaxKind[SyntaxKind["Count"] = 305] = "Count";
SyntaxKind[SyntaxKind["FirstAssignment"] = 58] = "FirstAssignment";
SyntaxKind[SyntaxKind["LastAssignment"] = 70] = "LastAssignment";
SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 59] = "FirstCompoundAssignment";
@@ -358,15 +359,15 @@ var ts;
SyntaxKind[SyntaxKind["FirstReservedWord"] = 72] = "FirstReservedWord";
SyntaxKind[SyntaxKind["LastReservedWord"] = 107] = "LastReservedWord";
SyntaxKind[SyntaxKind["FirstKeyword"] = 72] = "FirstKeyword";
- SyntaxKind[SyntaxKind["LastKeyword"] = 144] = "LastKeyword";
+ SyntaxKind[SyntaxKind["LastKeyword"] = 145] = "LastKeyword";
SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 108] = "FirstFutureReservedWord";
SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 116] = "LastFutureReservedWord";
- SyntaxKind[SyntaxKind["FirstTypeNode"] = 160] = "FirstTypeNode";
- SyntaxKind[SyntaxKind["LastTypeNode"] = 178] = "LastTypeNode";
+ SyntaxKind[SyntaxKind["FirstTypeNode"] = 161] = "FirstTypeNode";
+ SyntaxKind[SyntaxKind["LastTypeNode"] = 179] = "LastTypeNode";
SyntaxKind[SyntaxKind["FirstPunctuation"] = 17] = "FirstPunctuation";
SyntaxKind[SyntaxKind["LastPunctuation"] = 70] = "LastPunctuation";
SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken";
- SyntaxKind[SyntaxKind["LastToken"] = 144] = "LastToken";
+ SyntaxKind[SyntaxKind["LastToken"] = 145] = "LastToken";
SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken";
SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken";
SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken";
@@ -375,13 +376,13 @@ var ts;
SyntaxKind[SyntaxKind["LastTemplateToken"] = 16] = "LastTemplateToken";
SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 27] = "FirstBinaryOperator";
SyntaxKind[SyntaxKind["LastBinaryOperator"] = 70] = "LastBinaryOperator";
- SyntaxKind[SyntaxKind["FirstNode"] = 145] = "FirstNode";
- SyntaxKind[SyntaxKind["FirstJSDocNode"] = 277] = "FirstJSDocNode";
- SyntaxKind[SyntaxKind["LastJSDocNode"] = 297] = "LastJSDocNode";
- SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 288] = "FirstJSDocTagNode";
- SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 297] = "LastJSDocTagNode";
+ SyntaxKind[SyntaxKind["FirstNode"] = 146] = "FirstNode";
+ SyntaxKind[SyntaxKind["FirstJSDocNode"] = 278] = "FirstJSDocNode";
+ SyntaxKind[SyntaxKind["LastJSDocNode"] = 298] = "LastJSDocNode";
+ SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 289] = "FirstJSDocTagNode";
+ SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 298] = "LastJSDocTagNode";
SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 117] = "FirstContextualKeyword";
- SyntaxKind[SyntaxKind["LastContextualKeyword"] = 144] = "LastContextualKeyword";
+ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 145] = "LastContextualKeyword";
})(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {}));
var NodeFlags;
(function (NodeFlags) {
@@ -749,67 +750,69 @@ var ts;
var TypeFlags;
(function (TypeFlags) {
TypeFlags[TypeFlags["Any"] = 1] = "Any";
- TypeFlags[TypeFlags["String"] = 2] = "String";
- TypeFlags[TypeFlags["Number"] = 4] = "Number";
- TypeFlags[TypeFlags["Boolean"] = 8] = "Boolean";
- TypeFlags[TypeFlags["Enum"] = 16] = "Enum";
- TypeFlags[TypeFlags["StringLiteral"] = 32] = "StringLiteral";
- TypeFlags[TypeFlags["NumberLiteral"] = 64] = "NumberLiteral";
- TypeFlags[TypeFlags["BooleanLiteral"] = 128] = "BooleanLiteral";
- TypeFlags[TypeFlags["EnumLiteral"] = 256] = "EnumLiteral";
- TypeFlags[TypeFlags["ESSymbol"] = 512] = "ESSymbol";
- TypeFlags[TypeFlags["UniqueESSymbol"] = 1024] = "UniqueESSymbol";
- TypeFlags[TypeFlags["Void"] = 2048] = "Void";
- TypeFlags[TypeFlags["Undefined"] = 4096] = "Undefined";
- TypeFlags[TypeFlags["Null"] = 8192] = "Null";
- TypeFlags[TypeFlags["Never"] = 16384] = "Never";
- TypeFlags[TypeFlags["TypeParameter"] = 32768] = "TypeParameter";
- TypeFlags[TypeFlags["Object"] = 65536] = "Object";
- TypeFlags[TypeFlags["Union"] = 131072] = "Union";
- TypeFlags[TypeFlags["Intersection"] = 262144] = "Intersection";
- TypeFlags[TypeFlags["Index"] = 524288] = "Index";
- TypeFlags[TypeFlags["IndexedAccess"] = 1048576] = "IndexedAccess";
- TypeFlags[TypeFlags["Conditional"] = 2097152] = "Conditional";
- TypeFlags[TypeFlags["Substitution"] = 4194304] = "Substitution";
- TypeFlags[TypeFlags["FreshLiteral"] = 8388608] = "FreshLiteral";
- TypeFlags[TypeFlags["ContainsWideningType"] = 16777216] = "ContainsWideningType";
- TypeFlags[TypeFlags["ContainsObjectLiteral"] = 33554432] = "ContainsObjectLiteral";
- TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 67108864] = "ContainsAnyFunctionType";
- TypeFlags[TypeFlags["NonPrimitive"] = 134217728] = "NonPrimitive";
- TypeFlags[TypeFlags["UnionOfUnitTypes"] = 268435456] = "UnionOfUnitTypes";
- TypeFlags[TypeFlags["GenericMappedType"] = 536870912] = "GenericMappedType";
- TypeFlags[TypeFlags["Nullable"] = 12288] = "Nullable";
- TypeFlags[TypeFlags["Literal"] = 224] = "Literal";
- TypeFlags[TypeFlags["Unit"] = 13536] = "Unit";
- TypeFlags[TypeFlags["StringOrNumberLiteral"] = 96] = "StringOrNumberLiteral";
- TypeFlags[TypeFlags["StringOrNumberLiteralOrUnique"] = 1120] = "StringOrNumberLiteralOrUnique";
- TypeFlags[TypeFlags["DefinitelyFalsy"] = 14560] = "DefinitelyFalsy";
- TypeFlags[TypeFlags["PossiblyFalsy"] = 14574] = "PossiblyFalsy";
- TypeFlags[TypeFlags["Intrinsic"] = 134249103] = "Intrinsic";
- TypeFlags[TypeFlags["Primitive"] = 16382] = "Primitive";
- TypeFlags[TypeFlags["StringLike"] = 34] = "StringLike";
- TypeFlags[TypeFlags["NumberLike"] = 84] = "NumberLike";
- TypeFlags[TypeFlags["BooleanLike"] = 136] = "BooleanLike";
- TypeFlags[TypeFlags["EnumLike"] = 272] = "EnumLike";
- TypeFlags[TypeFlags["ESSymbolLike"] = 1536] = "ESSymbolLike";
- TypeFlags[TypeFlags["VoidLike"] = 6144] = "VoidLike";
- TypeFlags[TypeFlags["DisjointDomains"] = 134233854] = "DisjointDomains";
- TypeFlags[TypeFlags["UnionOrIntersection"] = 393216] = "UnionOrIntersection";
- TypeFlags[TypeFlags["StructuredType"] = 458752] = "StructuredType";
- TypeFlags[TypeFlags["TypeVariable"] = 1081344] = "TypeVariable";
- TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 7372800] = "InstantiableNonPrimitive";
- TypeFlags[TypeFlags["InstantiablePrimitive"] = 524288] = "InstantiablePrimitive";
- TypeFlags[TypeFlags["Instantiable"] = 7897088] = "Instantiable";
- TypeFlags[TypeFlags["StructuredOrInstantiable"] = 8355840] = "StructuredOrInstantiable";
- TypeFlags[TypeFlags["Narrowable"] = 142575359] = "Narrowable";
- TypeFlags[TypeFlags["NotUnionOrUnit"] = 134283777] = "NotUnionOrUnit";
- TypeFlags[TypeFlags["NotUnit"] = 8374815] = "NotUnit";
- TypeFlags[TypeFlags["RequiresWidening"] = 50331648] = "RequiresWidening";
- TypeFlags[TypeFlags["PropagatingFlags"] = 117440512] = "PropagatingFlags";
- TypeFlags[TypeFlags["NonWideningType"] = 16777216] = "NonWideningType";
- TypeFlags[TypeFlags["Wildcard"] = 33554432] = "Wildcard";
- TypeFlags[TypeFlags["EmptyObject"] = 67108864] = "EmptyObject";
- TypeFlags[TypeFlags["ConstructionFlags"] = 117440512] = "ConstructionFlags";
+ TypeFlags[TypeFlags["Unknown"] = 2] = "Unknown";
+ TypeFlags[TypeFlags["String"] = 4] = "String";
+ TypeFlags[TypeFlags["Number"] = 8] = "Number";
+ TypeFlags[TypeFlags["Boolean"] = 16] = "Boolean";
+ TypeFlags[TypeFlags["Enum"] = 32] = "Enum";
+ TypeFlags[TypeFlags["StringLiteral"] = 64] = "StringLiteral";
+ TypeFlags[TypeFlags["NumberLiteral"] = 128] = "NumberLiteral";
+ TypeFlags[TypeFlags["BooleanLiteral"] = 256] = "BooleanLiteral";
+ TypeFlags[TypeFlags["EnumLiteral"] = 512] = "EnumLiteral";
+ TypeFlags[TypeFlags["ESSymbol"] = 1024] = "ESSymbol";
+ TypeFlags[TypeFlags["UniqueESSymbol"] = 2048] = "UniqueESSymbol";
+ TypeFlags[TypeFlags["Void"] = 4096] = "Void";
+ TypeFlags[TypeFlags["Undefined"] = 8192] = "Undefined";
+ TypeFlags[TypeFlags["Null"] = 16384] = "Null";
+ TypeFlags[TypeFlags["Never"] = 32768] = "Never";
+ TypeFlags[TypeFlags["TypeParameter"] = 65536] = "TypeParameter";
+ TypeFlags[TypeFlags["Object"] = 131072] = "Object";
+ TypeFlags[TypeFlags["Union"] = 262144] = "Union";
+ TypeFlags[TypeFlags["Intersection"] = 524288] = "Intersection";
+ TypeFlags[TypeFlags["Index"] = 1048576] = "Index";
+ TypeFlags[TypeFlags["IndexedAccess"] = 2097152] = "IndexedAccess";
+ TypeFlags[TypeFlags["Conditional"] = 4194304] = "Conditional";
+ TypeFlags[TypeFlags["Substitution"] = 8388608] = "Substitution";
+ TypeFlags[TypeFlags["NonPrimitive"] = 16777216] = "NonPrimitive";
+ TypeFlags[TypeFlags["FreshLiteral"] = 33554432] = "FreshLiteral";
+ TypeFlags[TypeFlags["UnionOfUnitTypes"] = 67108864] = "UnionOfUnitTypes";
+ TypeFlags[TypeFlags["ContainsWideningType"] = 134217728] = "ContainsWideningType";
+ TypeFlags[TypeFlags["ContainsObjectLiteral"] = 268435456] = "ContainsObjectLiteral";
+ TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 536870912] = "ContainsAnyFunctionType";
+ TypeFlags[TypeFlags["AnyOrUnknown"] = 3] = "AnyOrUnknown";
+ TypeFlags[TypeFlags["Nullable"] = 24576] = "Nullable";
+ TypeFlags[TypeFlags["Literal"] = 448] = "Literal";
+ TypeFlags[TypeFlags["Unit"] = 27072] = "Unit";
+ TypeFlags[TypeFlags["StringOrNumberLiteral"] = 192] = "StringOrNumberLiteral";
+ TypeFlags[TypeFlags["StringOrNumberLiteralOrUnique"] = 2240] = "StringOrNumberLiteralOrUnique";
+ TypeFlags[TypeFlags["DefinitelyFalsy"] = 29120] = "DefinitelyFalsy";
+ TypeFlags[TypeFlags["PossiblyFalsy"] = 29148] = "PossiblyFalsy";
+ TypeFlags[TypeFlags["Intrinsic"] = 16839967] = "Intrinsic";
+ TypeFlags[TypeFlags["Primitive"] = 32764] = "Primitive";
+ TypeFlags[TypeFlags["StringLike"] = 68] = "StringLike";
+ TypeFlags[TypeFlags["NumberLike"] = 168] = "NumberLike";
+ TypeFlags[TypeFlags["BooleanLike"] = 272] = "BooleanLike";
+ TypeFlags[TypeFlags["EnumLike"] = 544] = "EnumLike";
+ TypeFlags[TypeFlags["ESSymbolLike"] = 3072] = "ESSymbolLike";
+ TypeFlags[TypeFlags["VoidLike"] = 12288] = "VoidLike";
+ TypeFlags[TypeFlags["DisjointDomains"] = 16809468] = "DisjointDomains";
+ TypeFlags[TypeFlags["UnionOrIntersection"] = 786432] = "UnionOrIntersection";
+ TypeFlags[TypeFlags["StructuredType"] = 917504] = "StructuredType";
+ TypeFlags[TypeFlags["TypeVariable"] = 2162688] = "TypeVariable";
+ TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 14745600] = "InstantiableNonPrimitive";
+ TypeFlags[TypeFlags["InstantiablePrimitive"] = 1048576] = "InstantiablePrimitive";
+ TypeFlags[TypeFlags["Instantiable"] = 15794176] = "Instantiable";
+ TypeFlags[TypeFlags["StructuredOrInstantiable"] = 16711680] = "StructuredOrInstantiable";
+ TypeFlags[TypeFlags["Narrowable"] = 33492479] = "Narrowable";
+ TypeFlags[TypeFlags["NotUnionOrUnit"] = 16909315] = "NotUnionOrUnit";
+ TypeFlags[TypeFlags["NotUnit"] = 16749629] = "NotUnit";
+ TypeFlags[TypeFlags["RequiresWidening"] = 402653184] = "RequiresWidening";
+ TypeFlags[TypeFlags["PropagatingFlags"] = 939524096] = "PropagatingFlags";
+ TypeFlags[TypeFlags["NonWideningType"] = 134217728] = "NonWideningType";
+ TypeFlags[TypeFlags["Wildcard"] = 268435456] = "Wildcard";
+ TypeFlags[TypeFlags["EmptyObject"] = 536870912] = "EmptyObject";
+ TypeFlags[TypeFlags["ConstructionFlags"] = 939524096] = "ConstructionFlags";
+ TypeFlags[TypeFlags["GenericMappedType"] = 134217728] = "GenericMappedType";
})(TypeFlags = ts.TypeFlags || (ts.TypeFlags = {}));
var ObjectFlags;
(function (ObjectFlags) {
@@ -1154,6 +1157,7 @@ var ts;
})(TransformFlags = ts.TransformFlags || (ts.TransformFlags = {}));
var EmitFlags;
(function (EmitFlags) {
+ EmitFlags[EmitFlags["None"] = 0] = "None";
EmitFlags[EmitFlags["SingleLine"] = 1] = "SingleLine";
EmitFlags[EmitFlags["AdviseOnEmitNode"] = 2] = "AdviseOnEmitNode";
EmitFlags[EmitFlags["NoSubstitution"] = 4] = "NoSubstitution";
@@ -1386,7 +1390,7 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
- ts.versionMajorMinor = "2.9";
+ ts.versionMajorMinor = "3.0";
ts.version = ts.versionMajorMinor + ".0-dev";
})(ts || (ts = {}));
(function (ts) {
@@ -1517,6 +1521,10 @@ var ts;
return array ? array.length : 0;
}
ts.length = length;
+ function hasEntries(map) {
+ return !!map && !!map.size;
+ }
+ ts.hasEntries = hasEntries;
function forEach(array, callback) {
if (array) {
for (var i = 0; i < array.length; i++) {
@@ -1657,7 +1665,7 @@ var ts;
return result;
}
}
- Debug.fail();
+ return Debug.fail();
}
ts.findMap = findMap;
function contains(array, value, equalityComparer) {
@@ -2187,15 +2195,6 @@ var ts;
return to;
}
ts.addRange = addRange;
- function prependRange(to, from) {
- if (from === undefined || from.length === 0)
- return to;
- if (to === undefined)
- return from.slice();
- to.unshift.apply(to, from);
- return to;
- }
- ts.prependRange = prependRange;
function pushIfUnique(array, toAdd, equalityComparer) {
if (contains(array, toAdd, equalityComparer)) {
return false;
@@ -2588,10 +2587,10 @@ var ts;
if (value !== undefined && test(value))
return value;
if (value && typeof value.kind === "number") {
- Debug.fail("Invalid cast. The supplied " + Debug.showSyntaxKind(value) + " did not pass the test '" + Debug.getFunctionName(test) + "'.");
+ return Debug.fail("Invalid cast. The supplied " + Debug.showSyntaxKind(value) + " did not pass the test '" + Debug.getFunctionName(test) + "'.");
}
else {
- Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'.");
+ return Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'.");
}
}
ts.cast = cast;
@@ -2671,7 +2670,7 @@ var ts;
}
ts.compose = compose;
function formatStringFromArgs(text, args, baseIndex) {
- baseIndex = baseIndex || 0;
+ if (baseIndex === void 0) { baseIndex = 0; }
return text.replace(/{(\d+)}/g, function (_match, index) { return Debug.assertDefined(args[+index + baseIndex]); });
}
ts.formatStringFromArgs = formatStringFromArgs;
@@ -2908,7 +2907,9 @@ var ts;
return compareValues(a ? 1 : 0, b ? 1 : 0);
}
ts.compareBooleans = compareBooleans;
- function compareMessageText(text1, text2) {
+ function compareMessageText(t1, t2) {
+ var text1 = t1;
+ var text2 = t2;
while (text1 && text2) {
var string1 = isString(text1) ? text1 : text1.messageText;
var string2 = isString(text2) ? text2 : text2.messageText;
@@ -2942,6 +2943,14 @@ var ts;
return moduleResolution;
}
ts.getEmitModuleResolutionKind = getEmitModuleResolutionKind;
+ function unreachableCodeIsError(options) {
+ return options.allowUnreachableCode === false;
+ }
+ ts.unreachableCodeIsError = unreachableCodeIsError;
+ function unusedLabelIsError(options) {
+ return options.allowUnusedLabels === false;
+ }
+ ts.unusedLabelIsError = unusedLabelIsError;
function getAreDeclarationMapsEnabled(options) {
return !!(options.declaration && options.declarationMap);
}
@@ -2960,7 +2969,7 @@ var ts;
}
ts.getEmitDeclarations = getEmitDeclarations;
function getStrictOptionValue(compilerOptions, flag) {
- return compilerOptions[flag] === undefined ? compilerOptions.strict : compilerOptions[flag];
+ return compilerOptions[flag] === undefined ? !!compilerOptions.strict : !!compilerOptions[flag];
}
ts.getStrictOptionValue = getStrictOptionValue;
function hasZeroOrOneAsteriskCharacter(str) {
@@ -3338,6 +3347,23 @@ var ts;
return startsWith(str, prefix) ? str.substr(prefix.length) : str;
}
ts.removePrefix = removePrefix;
+ function tryRemovePrefix(str, prefix) {
+ return startsWith(str, prefix) ? str.substring(prefix.length) : undefined;
+ }
+ ts.tryRemovePrefix = tryRemovePrefix;
+ function tryRemoveDirectoryPrefix(path, dirPath) {
+ var a = tryRemovePrefix(path, dirPath);
+ if (a === undefined)
+ return undefined;
+ switch (a.charCodeAt(0)) {
+ case 47:
+ case 92:
+ return a.slice(1);
+ default:
+ return undefined;
+ }
+ }
+ ts.tryRemoveDirectoryPrefix = tryRemoveDirectoryPrefix;
function endsWith(str, suffix) {
var expectedPos = str.length - suffix.length;
return expectedPos >= 0 && str.indexOf(suffix, expectedPos) === expectedPos;
@@ -3347,6 +3373,10 @@ var ts;
return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : str;
}
ts.removeSuffix = removeSuffix;
+ function tryRemoveSuffix(str, suffix) {
+ return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : undefined;
+ }
+ ts.tryRemoveSuffix = tryRemoveSuffix;
function stringContains(str, substring) {
return str.indexOf(substring) !== -1;
}
@@ -3420,7 +3450,7 @@ var ts;
var subpattern = "";
var hasWrittenComponent = false;
var components = getNormalizedPathComponents(spec, basePath);
- var lastComponent = lastOrUndefined(components);
+ var lastComponent = last(components);
if (usage !== "exclude" && lastComponent === "**") {
return undefined;
}
@@ -3486,14 +3516,17 @@ var ts;
};
}
ts.getFileMatcherPatterns = getFileMatcherPatterns;
+ function getRegexFromPattern(pattern, useCaseSensitiveFileNames) {
+ return new RegExp(pattern, useCaseSensitiveFileNames ? "" : "i");
+ }
+ ts.getRegexFromPattern = getRegexFromPattern;
function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries) {
path = normalizePath(path);
currentDirectory = normalizePath(currentDirectory);
var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
- var regexFlag = useCaseSensitiveFileNames ? "" : "i";
- var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return new RegExp(pattern, regexFlag); });
- var includeDirectoryRegex = patterns.includeDirectoryPattern && new RegExp(patterns.includeDirectoryPattern, regexFlag);
- var excludeRegex = patterns.excludePattern && new RegExp(patterns.excludePattern, regexFlag);
+ var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return getRegexFromPattern(pattern, useCaseSensitiveFileNames); });
+ var includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames);
+ var excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames);
var results = includeFileRegexes ? includeFileRegexes.map(function () { return []; }) : [[]];
for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) {
var basePath = _a[_i];
@@ -3611,11 +3644,11 @@ var ts;
return scriptKind === 1 || scriptKind === 2;
}
function hasJavaScriptFileExtension(fileName) {
- return forEach(ts.supportedJavascriptExtensions, function (extension) { return fileExtensionIs(fileName, extension); });
+ return some(ts.supportedJavascriptExtensions, function (extension) { return fileExtensionIs(fileName, extension); });
}
ts.hasJavaScriptFileExtension = hasJavaScriptFileExtension;
function hasTypeScriptFileExtension(fileName) {
- return forEach(ts.supportedTypeScriptExtensions, function (extension) { return fileExtensionIs(fileName, extension); });
+ return some(ts.supportedTypeScriptExtensions, function (extension) { return fileExtensionIs(fileName, extension); });
}
ts.hasTypeScriptFileExtension = hasTypeScriptFileExtension;
function isSupportedSourceFileName(fileName, compilerOptions, extraFileExtensions) {
@@ -3803,7 +3836,8 @@ var ts;
}
Debug.fail = fail;
function assertDefined(value, message) {
- assert(value !== undefined && value !== null, message);
+ if (value === undefined || value === null)
+ return fail(message);
return value;
}
Debug.assertDefined = assertDefined;
@@ -3961,10 +3995,7 @@ var ts;
ts.resolutionExtensionIsTypeScriptOrJson = resolutionExtensionIsTypeScriptOrJson;
function extensionFromPath(path) {
var ext = tryGetExtensionFromPath(path);
- if (ext !== undefined) {
- return ext;
- }
- Debug.fail("File " + path + " has unknown extension.");
+ return ext !== undefined ? ext : Debug.fail("File " + path + " has unknown extension.");
}
ts.extensionFromPath = extensionFromPath;
function isAnySupportedFileExtension(path) {
@@ -4518,6 +4549,7 @@ var ts;
return watchDirectoryRecursively(directoryName, callback);
}
watchDirectory(directoryName, callback);
+ return undefined;
};
}
function createNonPollingWatchFile() {
@@ -4748,6 +4780,7 @@ var ts;
switch (entryKind) {
case 0: return stat.isFile();
case 1: return stat.isDirectory();
+ default: return false;
}
}
catch (e) {
@@ -4926,6 +4959,7 @@ var ts;
The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type: diag(1064, ts.DiagnosticCategory.Error, "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1064", "The return type of an async function or method must be the global Promise type."),
In_ambient_enum_declarations_member_initializer_must_be_constant_expression: diag(1066, ts.DiagnosticCategory.Error, "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066", "In ambient enum declarations member initializer must be constant expression."),
Unexpected_token_A_constructor_method_accessor_or_property_was_expected: diag(1068, ts.DiagnosticCategory.Error, "Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068", "Unexpected token. A constructor, method, accessor, or property was expected."),
+ Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces: diag(1069, ts.DiagnosticCategory.Error, "Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069", "Unexpected token. A type parameter name was expected without curly braces."),
_0_modifier_cannot_appear_on_a_type_member: diag(1070, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_a_type_member_1070", "'{0}' modifier cannot appear on a type member."),
_0_modifier_cannot_appear_on_an_index_signature: diag(1071, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_an_index_signature_1071", "'{0}' modifier cannot appear on an index signature."),
A_0_modifier_cannot_be_used_with_an_import_declaration: diag(1079, ts.DiagnosticCategory.Error, "A_0_modifier_cannot_be_used_with_an_import_declaration_1079", "A '{0}' modifier cannot be used with an import declaration."),
@@ -5377,6 +5411,7 @@ var ts;
Type_0_is_not_an_array_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators: diag(2568, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators_2568", "Type '{0}' is not an array type. Use compiler option '--downlevelIteration' to allow iterating of iterators."),
Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators: diag(2569, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569", "Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators."),
Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await: diag(2570, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await_2570", "Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?"),
+ Object_is_of_type_unknown: diag(2571, ts.DiagnosticCategory.Error, "Object_is_of_type_unknown_2571", "Object is of type 'unknown'."),
JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."),
The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."),
JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."),
@@ -5430,7 +5465,7 @@ var ts;
_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, ts.DiagnosticCategory.Error, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."),
_0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."),
Namespace_0_has_no_exported_member_1: diag(2694, ts.DiagnosticCategory.Error, "Namespace_0_has_no_exported_member_1_2694", "Namespace '{0}' has no exported member '{1}'."),
- Left_side_of_comma_operator_is_unused_and_has_no_side_effects: diag(2695, ts.DiagnosticCategory.Error, "Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695", "Left side of comma operator is unused and has no side effects."),
+ Left_side_of_comma_operator_is_unused_and_has_no_side_effects: diag(2695, ts.DiagnosticCategory.Error, "Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695", "Left side of comma operator is unused and has no side effects.", true),
The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead: diag(2696, ts.DiagnosticCategory.Error, "The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696", "The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?"),
An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: diag(2697, ts.DiagnosticCategory.Error, "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697", "An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your `--lib` option."),
Spread_types_may_only_be_created_from_object_types: diag(2698, ts.DiagnosticCategory.Error, "Spread_types_may_only_be_created_from_object_types_2698", "Spread types may only be created from object types."),
@@ -5460,6 +5495,7 @@ var ts;
Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."),
Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."),
Module_0_has_no_exported_member_1_Did_you_mean_2: diag(2724, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_Did_you_mean_2_2724", "Module '{0}' has no exported member '{1}'. Did you mean '{2}'?"),
+ Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, ts.DiagnosticCategory.Error, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."),
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}'."),
@@ -5758,6 +5794,7 @@ var ts;
_0_is_declared_but_never_used: diag(6196, ts.DiagnosticCategory.Error, "_0_is_declared_but_never_used_6196", "'{0}' is declared but never used.", true),
Include_modules_imported_with_json_extension: diag(6197, ts.DiagnosticCategory.Message, "Include_modules_imported_with_json_extension_6197", "Include modules imported with '.json' extension"),
All_destructured_elements_are_unused: diag(6198, ts.DiagnosticCategory.Error, "All_destructured_elements_are_unused_6198", "All destructured elements are unused.", true),
+ All_variables_are_unused: diag(6199, ts.DiagnosticCategory.Error, "All_variables_are_unused_6199", "All variables are unused.", true),
Projects_to_reference: diag(6300, ts.DiagnosticCategory.Message, "Projects_to_reference_6300", "Projects to reference"),
Enable_project_compilation: diag(6302, ts.DiagnosticCategory.Message, "Enable_project_compilation_6302", "Enable project compilation"),
Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: diag(6202, ts.DiagnosticCategory.Error, "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202", "Project references may not form a circular graph. Cycle detected: {0}"),
@@ -5785,7 +5822,7 @@ var ts;
Function_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: diag(7024, ts.DiagnosticCategory.Error, "Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024", "Function 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."),
Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type: diag(7025, ts.DiagnosticCategory.Error, "Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_typ_7025", "Generator implicitly has type '{0}' because it does not yield any values. Consider supplying a return type."),
JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: diag(7026, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists."),
- Unreachable_code_detected: diag(7027, ts.DiagnosticCategory.Error, "Unreachable_code_detected_7027", "Unreachable code detected."),
+ Unreachable_code_detected: diag(7027, ts.DiagnosticCategory.Error, "Unreachable_code_detected_7027", "Unreachable code detected.", true),
Unused_label: diag(7028, ts.DiagnosticCategory.Error, "Unused_label_7028", "Unused label.", true),
Fallthrough_case_in_switch: diag(7029, ts.DiagnosticCategory.Error, "Fallthrough_case_in_switch_7029", "Fallthrough case in switch."),
Not_all_code_paths_return_a_value: diag(7030, ts.DiagnosticCategory.Error, "Not_all_code_paths_return_a_value_7030", "Not all code paths return a value."),
@@ -5866,6 +5903,7 @@ var ts;
Implement_inherited_abstract_class: diag(90007, ts.DiagnosticCategory.Message, "Implement_inherited_abstract_class_90007", "Implement inherited abstract class"),
Add_0_to_unresolved_variable: diag(90008, ts.DiagnosticCategory.Message, "Add_0_to_unresolved_variable_90008", "Add '{0}.' to unresolved variable"),
Remove_destructuring: diag(90009, ts.DiagnosticCategory.Message, "Remove_destructuring_90009", "Remove destructuring"),
+ Remove_variable_statement: diag(90010, ts.DiagnosticCategory.Message, "Remove_variable_statement_90010", "Remove variable statement"),
Import_0_from_module_1: diag(90013, ts.DiagnosticCategory.Message, "Import_0_from_module_1_90013", "Import '{0}' from module \"{1}\""),
Change_0_to_1: diag(90014, ts.DiagnosticCategory.Message, "Change_0_to_1_90014", "Change '{0}' to '{1}'"),
Add_0_to_existing_import_declaration_from_1: diag(90015, ts.DiagnosticCategory.Message, "Add_0_to_existing_import_declaration_from_1_90015", "Add '{0}' to existing import declaration from \"{1}\""),
@@ -5935,6 +5973,9 @@ var ts;
Add_missing_typeof: diag(95052, ts.DiagnosticCategory.Message, "Add_missing_typeof_95052", "Add missing 'typeof'"),
Remove_unused_label: diag(95053, ts.DiagnosticCategory.Message, "Remove_unused_label_95053", "Remove unused label"),
Remove_all_unused_labels: diag(95054, ts.DiagnosticCategory.Message, "Remove_all_unused_labels_95054", "Remove all unused labels"),
+ Convert_0_to_mapped_object_type: diag(95055, ts.DiagnosticCategory.Message, "Convert_0_to_mapped_object_type_95055", "Convert '{0}' to mapped object type"),
+ Convert_namespace_import_to_named_imports: diag(95056, ts.DiagnosticCategory.Message, "Convert_namespace_import_to_named_imports_95056", "Convert namespace import to named imports"),
+ Convert_named_imports_to_namespace_import: diag(95057, ts.DiagnosticCategory.Message, "Convert_named_imports_to_namespace_import_95057", "Convert named imports to namespace import"),
};
})(ts || (ts = {}));
var ts;
@@ -5971,7 +6012,7 @@ var ts;
"false": 86,
"finally": 87,
"for": 88,
- "from": 142,
+ "from": 143,
"function": 89,
"get": 125,
"if": 90,
@@ -5997,7 +6038,7 @@ var ts;
"public": 114,
"readonly": 132,
"require": 133,
- "global": 143,
+ "global": 144,
"return": 96,
"set": 136,
"static": 115,
@@ -6013,6 +6054,7 @@ var ts;
"typeof": 103,
"undefined": 140,
"unique": 141,
+ "unknown": 142,
"var": 104,
"void": 105,
"while": 106,
@@ -6020,7 +6062,7 @@ var ts;
"yield": 116,
"async": 120,
"await": 121,
- "of": 144,
+ "of": 145,
"{": 17,
"}": 18,
"(": 19,
@@ -6526,8 +6568,9 @@ var ts;
return true;
}
ts.isIdentifierText = isIdentifierText;
- function createScanner(languageVersion, skipTrivia, languageVariant, text, onError, start, length) {
+ function createScanner(languageVersion, skipTrivia, languageVariant, textInitial, onError, start, length) {
if (languageVariant === void 0) { languageVariant = 0; }
+ var text = textInitial;
var pos;
var end;
var startPos;
@@ -7725,7 +7768,7 @@ var ts;
}
ts.moduleResolutionIsEqualTo = moduleResolutionIsEqualTo;
function packageIdIsEqual(a, b) {
- return a === b || a && b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
+ return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
}
function packageIdToString(_a) {
var name = _a.name, subModuleName = _a.subModuleName, version = _a.version;
@@ -7768,7 +7811,7 @@ var ts;
}
}
function getSourceFileOfNode(node) {
- while (node && node.kind !== 273) {
+ while (node && node.kind !== 274) {
node = node.parent;
}
return node;
@@ -7776,11 +7819,11 @@ var ts;
ts.getSourceFileOfNode = getSourceFileOfNode;
function isStatementWithLocals(node) {
switch (node.kind) {
- case 212:
- case 240:
- case 219:
+ case 213:
+ case 241:
case 220:
case 221:
+ case 222:
return true;
}
return false;
@@ -7816,9 +7859,8 @@ var ts;
}
}
ts.getEndLinePosition = getEndLinePosition;
- function isFileLevelUniqueName(currentSourceFile, name, hasGlobalName) {
- return !(hasGlobalName && hasGlobalName(name))
- && !currentSourceFile.identifiers.has(name);
+ function isFileLevelUniqueName(sourceFile, name, hasGlobalName) {
+ return !(hasGlobalName && hasGlobalName(name)) && !sourceFile.identifiers.has(name);
}
ts.isFileLevelUniqueName = isFileLevelUniqueName;
function nodeIsMissing(node) {
@@ -7832,6 +7874,19 @@ var ts;
return !nodeIsMissing(node);
}
ts.nodeIsPresent = nodeIsPresent;
+ function prependStatements(to, from) {
+ if (from === undefined || from.length === 0)
+ return to;
+ if (to === undefined)
+ return from.slice();
+ var prologue = to.length && isPrologueDirective(to[0]) && to.shift();
+ to.unshift.apply(to, from);
+ if (prologue) {
+ to.unshift(prologue);
+ }
+ return to;
+ }
+ ts.prependStatements = prependStatements;
function isRecognizedTripleSlashComment(text, commentPos, commentEnd) {
if (text.charCodeAt(commentPos + 1) === 47 &&
commentPos + 2 < commentEnd &&
@@ -7861,7 +7916,7 @@ var ts;
if (includeJsDoc && ts.hasJSDocNodes(node)) {
return getTokenPosOfNode(node.jsDoc[0]);
}
- if (node.kind === 298 && node._children.length > 0) {
+ if (node.kind === 299 && node._children.length > 0) {
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
}
return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos);
@@ -7901,7 +7956,7 @@ var ts;
ts.indexOfNode = indexOfNode;
function getEmitFlags(node) {
var emitNode = node.emitNode;
- return emitNode && emitNode.flags;
+ return emitNode && emitNode.flags || 0;
}
ts.getEmitFlags = getEmitFlags;
function getLiteralText(node, sourceFile) {
@@ -7929,7 +7984,7 @@ var ts;
case 12:
return node.text;
}
- ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for.");
+ return ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for.");
}
ts.getLiteralText = getLiteralText;
function getTextOfConstantValue(value) {
@@ -7955,7 +8010,7 @@ var ts;
ts.isBlockOrCatchScoped = isBlockOrCatchScoped;
function isCatchClauseVariableDeclarationOrBindingElement(declaration) {
var node = getRootDeclaration(declaration);
- return node.kind === 231 && node.parent.kind === 268;
+ return node.kind === 232 && node.parent.kind === 269;
}
ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement;
function isAmbientModule(node) {
@@ -7975,11 +8030,11 @@ var ts;
}
ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol;
function isShorthandAmbientModule(node) {
- return node && node.kind === 238 && (!node.body);
+ return node && node.kind === 239 && (!node.body);
}
function isBlockScopedContainerTopLevel(node) {
- return node.kind === 273 ||
- node.kind === 238 ||
+ return node.kind === 274 ||
+ node.kind === 239 ||
ts.isFunctionLike(node);
}
ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel;
@@ -7993,9 +8048,9 @@ var ts;
ts.isExternalModuleAugmentation = isExternalModuleAugmentation;
function isModuleAugmentationExternal(node) {
switch (node.parent.kind) {
- case 273:
+ case 274:
return ts.isExternalModule(node.parent);
- case 239:
+ case 240:
return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent);
}
return false;
@@ -8007,51 +8062,51 @@ var ts;
ts.isEffectiveExternalModule = isEffectiveExternalModule;
function isBlockScope(node, parentNode) {
switch (node.kind) {
- case 273:
- case 240:
- case 268:
- case 238:
- case 219:
+ case 274:
+ case 241:
+ case 269:
+ case 239:
case 220:
case 221:
- case 154:
- case 153:
+ case 222:
case 155:
+ case 154:
case 156:
- case 233:
- case 191:
+ case 157:
+ case 234:
case 192:
+ case 193:
return true;
- case 212:
- return parentNode && !ts.isFunctionLike(parentNode);
+ case 213:
+ return !ts.isFunctionLike(parentNode);
}
return false;
}
ts.isBlockScope = isBlockScope;
function isDeclarationWithTypeParameters(node) {
switch (node.kind) {
- case 157:
case 158:
- case 152:
case 159:
- case 162:
- case 163:
- case 283:
- case 234:
- case 204:
- case 235:
- case 236:
- case 295:
- case 233:
case 153:
+ case 160:
+ case 163:
+ case 164:
+ case 284:
+ case 235:
+ case 205:
+ case 236:
+ case 237:
+ case 296:
+ case 234:
case 154:
case 155:
case 156:
- case 191:
+ case 157:
case 192:
- case 291:
- case 296:
- case 287:
+ case 193:
+ case 292:
+ case 297:
+ case 288:
return true;
default:
ts.assertTypeIsNever(node);
@@ -8061,8 +8116,8 @@ var ts;
ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters;
function isAnyImportSyntax(node) {
switch (node.kind) {
+ case 244:
case 243:
- case 242:
return true;
default:
return false;
@@ -8071,15 +8126,15 @@ var ts;
ts.isAnyImportSyntax = isAnyImportSyntax;
function isLateVisibilityPaintedStatement(node) {
switch (node.kind) {
+ case 244:
case 243:
- case 242:
- case 213:
- case 234:
- case 233:
- case 238:
- case 236:
+ case 214:
case 235:
+ case 234:
+ case 239:
case 237:
+ case 236:
+ case 238:
return true;
default:
return false;
@@ -8109,7 +8164,7 @@ var ts;
case 9:
case 8:
return escapeLeadingUnderscores(name.text);
- case 146:
+ case 147:
return isStringOrNumericLiteral(name.expression) ? escapeLeadingUnderscores(name.expression.text) : undefined;
default:
ts.Debug.assertNever(name);
@@ -8120,10 +8175,12 @@ var ts;
switch (name.kind) {
case 71:
return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name);
- case 145:
+ case 146:
return entityNameToString(name.left) + "." + entityNameToString(name.right);
- case 184:
+ case 185:
return entityNameToString(name.expression) + "." + entityNameToString(name.name);
+ default:
+ throw ts.Debug.assertNever(name);
}
}
ts.entityNameToString = entityNameToString;
@@ -8142,11 +8199,6 @@ var ts;
return ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3);
}
ts.createDiagnosticForNodeInSourceFile = createDiagnosticForNodeInSourceFile;
- function createDiagnosticForNodeSpan(sourceFile, startNode, endNode, message, arg0, arg1, arg2, arg3) {
- var start = ts.skipTrivia(sourceFile.text, startNode.pos);
- return ts.createFileDiagnostic(sourceFile, start, endNode.end - start, message, arg0, arg1, arg2, arg3);
- }
- ts.createDiagnosticForNodeSpan = createDiagnosticForNodeSpan;
function createDiagnosticForNodeFromMessageChain(node, messageChain) {
var sourceFile = getSourceFileOfNode(node);
var span = getErrorSpanForNode(sourceFile, node);
@@ -8169,7 +8221,7 @@ var ts;
ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition;
function getErrorSpanForArrowFunction(sourceFile, node) {
var pos = ts.skipTrivia(sourceFile.text, node.pos);
- if (node.body && node.body.kind === 212) {
+ if (node.body && node.body.kind === 213) {
var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line;
var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line;
if (startLine < endLine) {
@@ -8181,31 +8233,31 @@ var ts;
function getErrorSpanForNode(sourceFile, node) {
var errorNode = node;
switch (node.kind) {
- case 273:
+ case 274:
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 231:
- case 181:
- case 234:
- case 204:
+ case 232:
+ case 182:
case 235:
- case 238:
- case 237:
- case 272:
- case 233:
- case 191:
- case 153:
- case 155:
- case 156:
+ case 205:
case 236:
+ case 239:
+ case 238:
+ case 273:
+ case 234:
+ case 192:
+ case 154:
+ case 156:
+ case 157:
+ case 237:
+ case 152:
case 151:
- case 150:
errorNode = node.name;
break;
- case 192:
+ case 193:
return getErrorSpanForArrowFunction(sourceFile, node);
}
if (errorNode === undefined) {
@@ -8235,7 +8287,7 @@ var ts;
}
ts.isJsonSourceFile = isJsonSourceFile;
function isConstEnumDeclaration(node) {
- return node.kind === 237 && isConst(node);
+ return node.kind === 238 && isConst(node);
}
ts.isConstEnumDeclaration = isConstEnumDeclaration;
function isConst(node) {
@@ -8248,21 +8300,21 @@ var ts;
}
ts.isLet = isLet;
function isSuperCall(n) {
- return n.kind === 186 && n.expression.kind === 97;
+ return n.kind === 187 && n.expression.kind === 97;
}
ts.isSuperCall = isSuperCall;
function isImportCall(n) {
- return n.kind === 186 && n.expression.kind === 91;
+ return n.kind === 187 && n.expression.kind === 91;
}
ts.isImportCall = isImportCall;
function isLiteralImportTypeNode(n) {
- return n.kind === 178 &&
- n.argument.kind === 177 &&
+ return n.kind === 179 &&
+ n.argument.kind === 178 &&
ts.isStringLiteral(n.argument.literal);
}
ts.isLiteralImportTypeNode = isLiteralImportTypeNode;
function isPrologueDirective(node) {
- return node.kind === 215
+ return node.kind === 216
&& node.expression.kind === 9;
}
ts.isPrologueDirective = isPrologueDirective;
@@ -8271,11 +8323,11 @@ var ts;
}
ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode;
function getJSDocCommentRanges(node, text) {
- var commentRanges = (node.kind === 148 ||
- node.kind === 147 ||
- node.kind === 191 ||
+ var commentRanges = (node.kind === 149 ||
+ node.kind === 148 ||
node.kind === 192 ||
- node.kind === 190) ?
+ node.kind === 193 ||
+ node.kind === 191) ?
ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) :
ts.getLeadingCommentRanges(text, node.pos);
return ts.filter(commentRanges, function (comment) {
@@ -8290,11 +8342,12 @@ var ts;
ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/;
var defaultLibReferenceRegEx = /^(\/\/\/\s*/;
function isPartOfTypeNode(node) {
- if (160 <= node.kind && node.kind <= 178) {
+ if (161 <= node.kind && node.kind <= 179) {
return true;
}
switch (node.kind) {
case 119:
+ case 142:
case 134:
case 137:
case 122:
@@ -8303,63 +8356,64 @@ var ts;
case 131:
return true;
case 105:
- return node.parent.kind !== 195;
- case 206:
+ return node.parent.kind !== 196;
+ case 207:
return !isExpressionWithTypeArgumentsInClassExtendsClause(node);
- case 147:
- return node.parent.kind === 176 || node.parent.kind === 171;
+ case 148:
+ return node.parent.kind === 177 || node.parent.kind === 172;
case 71:
- if (node.parent.kind === 145 && node.parent.right === node) {
+ if (node.parent.kind === 146 && node.parent.right === node) {
node = node.parent;
}
- else if (node.parent.kind === 184 && node.parent.name === node) {
+ else if (node.parent.kind === 185 && node.parent.name === node) {
node = node.parent;
}
- ts.Debug.assert(node.kind === 71 || node.kind === 145 || node.kind === 184, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
- case 145:
- case 184:
- case 99:
+ ts.Debug.assert(node.kind === 71 || node.kind === 146 || node.kind === 185, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
+ case 146:
+ case 185:
+ case 99: {
var parent = node.parent;
- if (parent.kind === 164) {
+ if (parent.kind === 165) {
return false;
}
- if (parent.kind === 178) {
+ if (parent.kind === 179) {
return !parent.isTypeOf;
}
- if (160 <= parent.kind && parent.kind <= 178) {
+ if (161 <= parent.kind && parent.kind <= 179) {
return true;
}
switch (parent.kind) {
- case 206:
+ case 207:
return !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
- case 147:
- return node === parent.constraint;
- case 151:
- case 150:
case 148:
- case 231:
+ return node === parent.constraint;
+ case 152:
+ case 151:
+ case 149:
+ case 232:
return node === parent.type;
- case 233:
- case 191:
+ case 234:
case 192:
+ case 193:
+ case 155:
case 154:
case 153:
- case 152:
- case 155:
case 156:
- return node === parent.type;
case 157:
+ return node === parent.type;
case 158:
case 159:
+ case 160:
return node === parent.type;
- case 189:
+ case 190:
return node === parent.type;
- case 186:
case 187:
- return ts.contains(parent.typeArguments, node);
case 188:
+ return ts.contains(parent.typeArguments, node);
+ case 189:
return false;
}
+ }
}
return false;
}
@@ -8378,23 +8432,23 @@ var ts;
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 224:
+ case 225:
return visitor(node);
- case 240:
- case 212:
- case 216:
+ case 241:
+ case 213:
case 217:
case 218:
case 219:
case 220:
case 221:
- case 225:
+ case 222:
case 226:
- case 265:
- case 266:
case 227:
- case 229:
- case 268:
+ case 266:
+ case 267:
+ case 228:
+ case 230:
+ case 269:
return ts.forEachChild(node, traverse);
}
}
@@ -8404,23 +8458,23 @@ var ts;
return traverse(body);
function traverse(node) {
switch (node.kind) {
- case 202:
+ case 203:
visitor(node);
var operand = node.expression;
if (operand) {
traverse(operand);
}
return;
- case 237:
- case 235:
case 238:
case 236:
- case 234:
- case 204:
+ case 239:
+ case 237:
+ case 235:
+ case 205:
return;
default:
if (ts.isFunctionLike(node)) {
- if (node.name && node.name.kind === 146) {
+ if (node.name && node.name.kind === 147) {
traverse(node.name.expression);
return;
}
@@ -8433,10 +8487,10 @@ var ts;
}
ts.forEachYieldExpression = forEachYieldExpression;
function getRestParameterElementType(node) {
- if (node && node.kind === 166) {
+ if (node && node.kind === 167) {
return node.elementType;
}
- else if (node && node.kind === 161) {
+ else if (node && node.kind === 162) {
return ts.singleOrUndefined(node.typeArguments);
}
else {
@@ -8446,12 +8500,12 @@ var ts;
ts.getRestParameterElementType = getRestParameterElementType;
function getMembersOfDeclaration(node) {
switch (node.kind) {
+ case 236:
case 235:
- case 234:
- case 204:
- case 165:
+ case 205:
+ case 166:
return node.members;
- case 183:
+ case 184:
return node.properties;
}
}
@@ -8459,14 +8513,14 @@ var ts;
function isVariableLike(node) {
if (node) {
switch (node.kind) {
- case 181:
- case 272:
- case 148:
- case 269:
- case 151:
- case 150:
+ case 182:
+ case 273:
+ case 149:
case 270:
- case 231:
+ case 152:
+ case 151:
+ case 271:
+ case 232:
return true;
}
}
@@ -8478,8 +8532,8 @@ var ts;
}
ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor;
function isVariableDeclarationInVariableStatement(node) {
- return node.parent.kind === 232
- && node.parent.parent.kind === 213;
+ return node.parent.kind === 233
+ && node.parent.parent.kind === 214;
}
ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement;
function isValidESSymbolDeclaration(node) {
@@ -8490,13 +8544,13 @@ var ts;
ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration;
function introducesArgumentsExoticObject(node) {
switch (node.kind) {
- case 153:
- case 152:
case 154:
+ case 153:
case 155:
case 156:
- case 233:
- case 191:
+ case 157:
+ case 234:
+ case 192:
return true;
}
return false;
@@ -8507,7 +8561,7 @@ var ts;
if (beforeUnwrapLabelCallback) {
beforeUnwrapLabelCallback(node);
}
- if (node.statement.kind !== 227) {
+ if (node.statement.kind !== 228) {
return node.statement;
}
node = node.statement;
@@ -8515,17 +8569,17 @@ var ts;
}
ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel;
function isFunctionBlock(node) {
- return node && node.kind === 212 && ts.isFunctionLike(node.parent);
+ return node && node.kind === 213 && ts.isFunctionLike(node.parent);
}
ts.isFunctionBlock = isFunctionBlock;
function isObjectLiteralMethod(node) {
- return node && node.kind === 153 && node.parent.kind === 183;
+ return node && node.kind === 154 && node.parent.kind === 184;
}
ts.isObjectLiteralMethod = isObjectLiteralMethod;
function isObjectLiteralOrClassExpressionMethod(node) {
- return node.kind === 153 &&
- (node.parent.kind === 183 ||
- node.parent.kind === 204);
+ return node.kind === 154 &&
+ (node.parent.kind === 184 ||
+ node.parent.kind === 205);
}
ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod;
function isIdentifierTypePredicate(predicate) {
@@ -8537,31 +8591,35 @@ var ts;
}
ts.isThisTypePredicate = isThisTypePredicate;
function getPropertyAssignment(objectLiteral, key, key2) {
- return ts.filter(objectLiteral.properties, function (property) {
- if (property.kind === 269) {
+ return objectLiteral.properties.filter(function (property) {
+ if (property.kind === 270) {
var propName = getTextOfPropertyName(property.name);
- return key === propName || (key2 && key2 === propName);
+ return key === propName || (!!key2 && key2 === propName);
}
+ return false;
});
}
ts.getPropertyAssignment = getPropertyAssignment;
function getTsConfigObjectLiteralExpression(tsConfigSourceFile) {
if (tsConfigSourceFile && tsConfigSourceFile.statements.length) {
var expression = tsConfigSourceFile.statements[0].expression;
- return ts.isObjectLiteralExpression(expression) && expression;
+ return ts.tryCast(expression, ts.isObjectLiteralExpression);
}
}
ts.getTsConfigObjectLiteralExpression = getTsConfigObjectLiteralExpression;
function getTsConfigPropArrayElementValue(tsConfigSourceFile, propKey, elementValue) {
- var jsonObjectLiteral = getTsConfigObjectLiteralExpression(tsConfigSourceFile);
- return jsonObjectLiteral &&
- ts.firstDefined(getPropertyAssignment(jsonObjectLiteral, propKey), function (property) {
- return ts.isArrayLiteralExpression(property.initializer) ?
- ts.find(property.initializer.elements, function (element) { return ts.isStringLiteral(element) && element.text === elementValue; }) :
- undefined;
- });
+ return ts.firstDefined(getTsConfigPropArray(tsConfigSourceFile, propKey), function (property) {
+ return ts.isArrayLiteralExpression(property.initializer) ?
+ ts.find(property.initializer.elements, function (element) { return ts.isStringLiteral(element) && element.text === elementValue; }) :
+ undefined;
+ });
}
ts.getTsConfigPropArrayElementValue = getTsConfigPropArrayElementValue;
+ function getTsConfigPropArray(tsConfigSourceFile, propKey) {
+ var jsonObjectLiteral = getTsConfigObjectLiteralExpression(tsConfigSourceFile);
+ return jsonObjectLiteral ? getPropertyAssignment(jsonObjectLiteral, propKey) : ts.emptyArray;
+ }
+ ts.getTsConfigPropArray = getTsConfigPropArray;
function getContainingFunction(node) {
return ts.findAncestor(node.parent, ts.isFunctionLike);
}
@@ -8571,45 +8629,46 @@ var ts;
}
ts.getContainingClass = getContainingClass;
function getThisContainer(node, includeArrowFunctions) {
+ ts.Debug.assert(node.kind !== 274);
while (true) {
node = node.parent;
if (!node) {
- return undefined;
+ return ts.Debug.fail();
}
switch (node.kind) {
- case 146:
+ case 147:
if (ts.isClassLike(node.parent.parent)) {
return node;
}
node = node.parent;
break;
- case 149:
- if (node.parent.kind === 148 && ts.isClassElement(node.parent.parent)) {
+ case 150:
+ if (node.parent.kind === 149 && ts.isClassElement(node.parent.parent)) {
node = node.parent.parent;
}
else if (ts.isClassElement(node.parent)) {
node = node.parent;
}
break;
- case 192:
+ case 193:
if (!includeArrowFunctions) {
continue;
}
- case 233:
- case 191:
- case 238:
- case 151:
- case 150:
- case 153:
+ case 234:
+ case 192:
+ case 239:
case 152:
+ case 151:
case 154:
+ case 153:
case 155:
case 156:
case 157:
case 158:
case 159:
- case 237:
- case 273:
+ case 160:
+ case 238:
+ case 274:
return node;
}
}
@@ -8619,9 +8678,9 @@ var ts;
var container = getThisContainer(node, false);
if (container) {
switch (container.kind) {
- case 154:
- case 233:
- case 191:
+ case 155:
+ case 234:
+ case 192:
return container;
}
}
@@ -8635,25 +8694,25 @@ var ts;
return node;
}
switch (node.kind) {
- case 146:
+ case 147:
node = node.parent;
break;
- case 233:
- case 191:
+ case 234:
case 192:
+ case 193:
if (!stopOnFunctions) {
continue;
}
- case 151:
- case 150:
- case 153:
case 152:
+ case 151:
case 154:
+ case 153:
case 155:
case 156:
+ case 157:
return node;
- case 149:
- if (node.parent.kind === 148 && ts.isClassElement(node.parent.parent)) {
+ case 150:
+ if (node.parent.kind === 149 && ts.isClassElement(node.parent.parent)) {
node = node.parent.parent;
}
else if (ts.isClassElement(node.parent)) {
@@ -8665,14 +8724,14 @@ var ts;
}
ts.getSuperContainer = getSuperContainer;
function getImmediatelyInvokedFunctionExpression(func) {
- if (func.kind === 191 || func.kind === 192) {
+ if (func.kind === 192 || func.kind === 193) {
var prev = func;
var parent = func.parent;
- while (parent.kind === 190) {
+ while (parent.kind === 191) {
prev = parent;
parent = parent.parent;
}
- if (parent.kind === 186 && parent.expression === prev) {
+ if (parent.kind === 187 && parent.expression === prev) {
return parent;
}
}
@@ -8680,26 +8739,26 @@ var ts;
ts.getImmediatelyInvokedFunctionExpression = getImmediatelyInvokedFunctionExpression;
function isSuperProperty(node) {
var kind = node.kind;
- return (kind === 184 || kind === 185)
+ return (kind === 185 || kind === 186)
&& node.expression.kind === 97;
}
ts.isSuperProperty = isSuperProperty;
function isThisProperty(node) {
var kind = node.kind;
- return (kind === 184 || kind === 185)
+ return (kind === 185 || kind === 186)
&& node.expression.kind === 99;
}
ts.isThisProperty = isThisProperty;
function getEntityNameFromTypeNode(node) {
switch (node.kind) {
- case 161:
+ case 162:
return node.typeName;
- case 206:
+ case 207:
return isEntityNameExpression(node.expression)
? node.expression
: undefined;
case 71:
- case 145:
+ case 146:
return node;
}
return undefined;
@@ -8707,10 +8766,10 @@ var ts;
ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode;
function getInvokedExpression(node) {
switch (node.kind) {
- case 188:
+ case 189:
return node.tag;
+ case 257:
case 256:
- case 255:
return node.tagName;
default:
return node.expression;
@@ -8719,21 +8778,21 @@ var ts;
ts.getInvokedExpression = getInvokedExpression;
function nodeCanBeDecorated(node, parent, grandparent) {
switch (node.kind) {
- case 234:
+ case 235:
return true;
- case 151:
- return parent.kind === 234;
- case 155:
+ case 152:
+ return parent.kind === 235;
case 156:
- case 153:
+ case 157:
+ case 154:
return node.body !== undefined
- && parent.kind === 234;
- case 148:
+ && parent.kind === 235;
+ case 149:
return parent.body !== undefined
- && (parent.kind === 154
- || parent.kind === 153
- || parent.kind === 156)
- && grandparent.kind === 234;
+ && (parent.kind === 155
+ || parent.kind === 154
+ || parent.kind === 157)
+ && grandparent.kind === 235;
}
return false;
}
@@ -8749,19 +8808,21 @@ var ts;
ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated;
function childIsDecorated(node, parent) {
switch (node.kind) {
- case 234:
- return ts.forEach(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); });
- case 153:
- case 156:
- return ts.forEach(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); });
+ case 235:
+ return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); });
+ case 154:
+ case 157:
+ return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); });
+ default:
+ return false;
}
}
ts.childIsDecorated = childIsDecorated;
function isJSXTagName(node) {
var parent = node.parent;
- if (parent.kind === 256 ||
- parent.kind === 255 ||
- parent.kind === 257) {
+ if (parent.kind === 257 ||
+ parent.kind === 256 ||
+ parent.kind === 258) {
return parent.tagName === node;
}
return false;
@@ -8774,45 +8835,45 @@ var ts;
case 101:
case 86:
case 12:
- case 182:
case 183:
case 184:
case 185:
case 186:
case 187:
case 188:
- case 207:
case 189:
case 208:
case 190:
+ case 209:
case 191:
- case 204:
case 192:
- case 195:
+ case 205:
case 193:
+ case 196:
case 194:
- case 197:
+ case 195:
case 198:
case 199:
case 200:
- case 203:
case 201:
- case 13:
- case 205:
- case 254:
- case 255:
- case 258:
+ case 204:
case 202:
- case 196:
- case 209:
+ case 13:
+ case 206:
+ case 255:
+ case 256:
+ case 259:
+ case 203:
+ case 197:
+ case 210:
return true;
- case 145:
- while (node.parent.kind === 145) {
+ case 146:
+ while (node.parent.kind === 146) {
node = node.parent;
}
- return node.parent.kind === 164 || isJSXTagName(node);
+ return node.parent.kind === 165 || isJSXTagName(node);
case 71:
- if (node.parent.kind === 164 || isJSXTagName(node)) {
+ if (node.parent.kind === 165 || isJSXTagName(node)) {
return true;
}
case 8:
@@ -8827,47 +8888,47 @@ var ts;
function isInExpressionContext(node) {
var parent = node.parent;
switch (parent.kind) {
- case 231:
- case 148:
+ case 232:
+ case 149:
+ case 152:
case 151:
- case 150:
- case 272:
- case 269:
- case 181:
+ case 273:
+ case 270:
+ case 182:
return parent.initializer === node;
- case 215:
case 216:
case 217:
case 218:
- case 224:
+ case 219:
case 225:
case 226:
- case 265:
- case 228:
+ case 227:
+ case 266:
+ case 229:
return parent.expression === node;
- case 219:
+ case 220:
var forStatement = parent;
- return (forStatement.initializer === node && forStatement.initializer.kind !== 232) ||
+ return (forStatement.initializer === node && forStatement.initializer.kind !== 233) ||
forStatement.condition === node ||
forStatement.incrementor === node;
- case 220:
case 221:
+ case 222:
var forInStatement = parent;
- return (forInStatement.initializer === node && forInStatement.initializer.kind !== 232) ||
+ return (forInStatement.initializer === node && forInStatement.initializer.kind !== 233) ||
forInStatement.expression === node;
- case 189:
- case 207:
+ case 190:
+ case 208:
return node === parent.expression;
- case 210:
+ case 211:
return node === parent.expression;
- case 146:
+ case 147:
return node === parent.expression;
- case 149:
+ case 150:
+ case 265:
case 264:
- case 263:
- case 271:
+ case 272:
return true;
- case 206:
+ case 207:
return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent);
default:
return isExpressionNode(parent);
@@ -8875,7 +8936,7 @@ var ts;
}
ts.isInExpressionContext = isInExpressionContext;
function isExternalModuleImportEqualsDeclaration(node) {
- return node.kind === 242 && node.moduleReference.kind === 253;
+ return node.kind === 243 && node.moduleReference.kind === 254;
}
ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration;
function getExternalModuleImportEqualsDeclarationExpression(node) {
@@ -8884,7 +8945,7 @@ var ts;
}
ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression;
function isInternalModuleImportEqualsDeclaration(node) {
- return node.kind === 242 && node.moduleReference.kind !== 253;
+ return node.kind === 243 && node.moduleReference.kind !== 254;
}
ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration;
function isSourceFileJavaScript(file) {
@@ -8896,15 +8957,15 @@ var ts;
}
ts.isSourceFileNotJavaScript = isSourceFileNotJavaScript;
function isInJavaScriptFile(node) {
- return node && !!(node.flags & 65536);
+ return !!node && !!(node.flags & 65536);
}
ts.isInJavaScriptFile = isInJavaScriptFile;
function isInJsonFile(node) {
- return node && !!(node.flags & 16777216);
+ return !!node && !!(node.flags & 16777216);
}
ts.isInJsonFile = isInJsonFile;
function isInJSDoc(node) {
- return node && !!(node.flags & 2097152);
+ return !!node && !!(node.flags & 2097152);
}
ts.isInJSDoc = isInJSDoc;
function isJSDocIndexSignature(node) {
@@ -8916,7 +8977,7 @@ var ts;
}
ts.isJSDocIndexSignature = isJSDocIndexSignature;
function isRequireCall(callExpression, checkArgumentIsStringLiteralLike) {
- if (callExpression.kind !== 186) {
+ if (callExpression.kind !== 187) {
return false;
}
var _a = callExpression, expression = _a.expression, args = _a.arguments;
@@ -8938,22 +8999,48 @@ var ts;
return getSourceTextOfNodeFromSourceFile(sourceFile, str).charCodeAt(0) === 34;
}
ts.isStringDoubleQuoted = isStringDoubleQuoted;
- function getJSInitializerSymbol(symbol) {
- if (!symbol || !symbol.valueDeclaration) {
- return symbol;
+ function getDeclarationOfJSInitializer(node) {
+ if (!isInJavaScriptFile(node) || !node.parent) {
+ return undefined;
}
- var declaration = symbol.valueDeclaration;
- var e = getDeclaredJavascriptInitializer(declaration) || getAssignedJavascriptInitializer(declaration);
- return e && e.symbol ? e.symbol : symbol;
- }
- ts.getJSInitializerSymbol = getJSInitializerSymbol;
- function getDeclaredJavascriptInitializer(node) {
- if (node && ts.isVariableDeclaration(node) && node.initializer) {
- return getJavascriptInitializer(node.initializer, false) ||
- ts.isIdentifier(node.name) && getDefaultedJavascriptInitializer(node.name, node.initializer, false);
+ var name;
+ var decl;
+ if (ts.isVariableDeclaration(node.parent) && node.parent.initializer === node) {
+ name = node.parent.name;
+ decl = node.parent;
}
+ else if (ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 58 && node.parent.right === node) {
+ name = node.parent.left;
+ decl = name;
+ }
+ else if (ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 54) {
+ if (ts.isVariableDeclaration(node.parent.parent) && node.parent.parent.initializer === node.parent) {
+ name = node.parent.parent.name;
+ decl = node.parent.parent;
+ }
+ else if (ts.isBinaryExpression(node.parent.parent) && node.parent.parent.operatorToken.kind === 58 && node.parent.parent.right === node.parent) {
+ name = node.parent.parent.left;
+ decl = name;
+ }
+ if (!name || !isEntityNameExpression(name) || !isSameEntityName(name, node.parent.left)) {
+ return undefined;
+ }
+ }
+ if (!name || !getJavascriptInitializer(node, isPrototypeAccess(name))) {
+ return undefined;
+ }
+ return decl;
}
- ts.getDeclaredJavascriptInitializer = getDeclaredJavascriptInitializer;
+ ts.getDeclarationOfJSInitializer = getDeclarationOfJSInitializer;
+ function getEffectiveInitializer(node) {
+ if (isInJavaScriptFile(node) && node.initializer &&
+ ts.isBinaryExpression(node.initializer) && node.initializer.operatorToken.kind === 54 &&
+ node.name && isEntityNameExpression(node.name) && isSameEntityName(node.name, node.initializer.left)) {
+ return node.initializer.right;
+ }
+ return node.initializer;
+ }
+ ts.getEffectiveInitializer = getEffectiveInitializer;
function getAssignedJavascriptInitializer(node) {
if (node && node.parent && ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 58) {
var isPrototypeAssignment = isPrototypeAccess(node.parent.left);
@@ -8965,11 +9052,11 @@ var ts;
function getJavascriptInitializer(initializer, isPrototypeAssignment) {
if (ts.isCallExpression(initializer)) {
var e = skipParentheses(initializer.expression);
- return e.kind === 191 || e.kind === 192 ? initializer : undefined;
+ return e.kind === 192 || e.kind === 193 ? initializer : undefined;
}
- if (initializer.kind === 191 ||
- initializer.kind === 204 ||
- initializer.kind === 192) {
+ if (initializer.kind === 192 ||
+ initializer.kind === 205 ||
+ initializer.kind === 193) {
return initializer;
}
if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) {
@@ -8983,6 +9070,13 @@ var ts;
return e;
}
}
+ function isDefaultedJavascriptInitializer(node) {
+ var name = ts.isVariableDeclaration(node.parent) ? node.parent.name :
+ ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 58 ? node.parent.left :
+ undefined;
+ return name && getJavascriptInitializer(node.right, isPrototypeAccess(name)) && isEntityNameExpression(name) && isSameEntityName(name, node.left);
+ }
+ ts.isDefaultedJavascriptInitializer = isDefaultedJavascriptInitializer;
function getOuterNameOfJsInitializer(node) {
if (ts.isBinaryExpression(node.parent)) {
var parent = (node.parent.operatorToken.kind === 54 && ts.isBinaryExpression(node.parent.parent)) ? node.parent.parent : node.parent;
@@ -9075,7 +9169,7 @@ var ts;
ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment;
function isSpecialPropertyDeclaration(expr) {
return isInJavaScriptFile(expr) &&
- expr.parent && expr.parent.kind === 215 &&
+ expr.parent && expr.parent.kind === 216 &&
!!ts.getJSDocTypeTag(expr.parent);
}
ts.isSpecialPropertyDeclaration = isSpecialPropertyDeclaration;
@@ -9085,14 +9179,14 @@ var ts;
ts.importFromModuleSpecifier = importFromModuleSpecifier;
function tryGetImportFromModuleSpecifier(node) {
switch (node.parent.kind) {
- case 243:
- case 249:
+ case 244:
+ case 250:
return node.parent;
- case 253:
+ case 254:
return node.parent.parent;
- case 186:
+ case 187:
return node.parent;
- case 177:
+ case 178:
ts.Debug.assert(ts.isStringLiteral(node));
return ts.tryCast(node.parent.parent, ts.isImportTypeNode);
default:
@@ -9102,12 +9196,12 @@ var ts;
ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier;
function getExternalModuleName(node) {
switch (node.kind) {
- case 243:
- case 249:
+ case 244:
+ case 250:
return node.moduleSpecifier;
- case 242:
- return node.moduleReference.kind === 253 ? node.moduleReference.expression : undefined;
- case 178:
+ case 243:
+ return node.moduleReference.kind === 254 ? node.moduleReference.expression : undefined;
+ case 179:
return isLiteralImportTypeNode(node) ? node.argument.literal : undefined;
default:
return ts.Debug.assertNever(node);
@@ -9116,11 +9210,11 @@ var ts;
ts.getExternalModuleName = getExternalModuleName;
function getNamespaceDeclarationNode(node) {
switch (node.kind) {
- case 243:
+ case 244:
return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport);
- case 242:
+ case 243:
return node;
- case 249:
+ case 250:
return undefined;
default:
return ts.Debug.assertNever(node);
@@ -9128,19 +9222,19 @@ var ts;
}
ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode;
function isDefaultImport(node) {
- return node.kind === 243 && node.importClause && !!node.importClause.name;
+ return node.kind === 244 && !!node.importClause && !!node.importClause.name;
}
ts.isDefaultImport = isDefaultImport;
function hasQuestionToken(node) {
if (node) {
switch (node.kind) {
- case 148:
+ case 149:
+ case 154:
case 153:
- case 152:
+ case 271:
case 270:
- case 269:
+ case 152:
case 151:
- case 150:
return node.questionToken !== undefined;
}
}
@@ -9148,14 +9242,14 @@ var ts;
}
ts.hasQuestionToken = hasQuestionToken;
function isJSDocConstructSignature(node) {
- return node.kind === 283 &&
+ return node.kind === 284 &&
node.parameters.length > 0 &&
node.parameters[0].name &&
node.parameters[0].name.escapedText === "new";
}
ts.isJSDocConstructSignature = isJSDocConstructSignature;
function isJSDocTypeAlias(node) {
- return node.kind === 296 || node.kind === 291;
+ return node.kind === 297 || node.kind === 292;
}
ts.isJSDocTypeAlias = isJSDocTypeAlias;
function isTypeAlias(node) {
@@ -9165,38 +9259,39 @@ var ts;
function getSourceOfAssignment(node) {
return ts.isExpressionStatement(node) &&
node.expression && ts.isBinaryExpression(node.expression) &&
- node.expression.operatorToken.kind === 58 &&
- node.expression.right;
+ node.expression.operatorToken.kind === 58
+ ? node.expression.right
+ : undefined;
}
function getSourceOfDefaultedAssignment(node) {
return ts.isExpressionStatement(node) &&
ts.isBinaryExpression(node.expression) &&
getSpecialPropertyAssignmentKind(node.expression) !== 0 &&
ts.isBinaryExpression(node.expression.right) &&
- node.expression.right.operatorToken.kind === 54 &&
- node.expression.right.right;
+ node.expression.right.operatorToken.kind === 54
+ ? node.expression.right.right
+ : undefined;
}
function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) {
switch (node.kind) {
- case 213:
+ case 214:
var v = getSingleVariableOfVariableStatement(node);
return v && v.initializer;
- case 151:
+ case 152:
return node.initializer;
- case 269:
+ case 270:
return node.initializer;
}
}
function getSingleVariableOfVariableStatement(node) {
- return ts.isVariableStatement(node) &&
- node.declarationList.declarations.length > 0 &&
- node.declarationList.declarations[0];
+ return ts.isVariableStatement(node) ? ts.firstOrUndefined(node.declarationList.declarations) : undefined;
}
function getNestedModuleDeclaration(node) {
- return node.kind === 238 &&
+ return ts.isModuleDeclaration(node) &&
node.body &&
- node.body.kind === 238 &&
- node.body;
+ node.body.kind === 239
+ ? node.body
+ : undefined;
}
function getJSDocCommentsAndTags(hostNode) {
var result;
@@ -9206,7 +9301,7 @@ var ts;
var parent = node.parent;
if (!parent)
return;
- if (parent.kind === 269 || parent.kind === 151 || getNestedModuleDeclaration(parent)) {
+ if (parent.kind === 270 || parent.kind === 152 || getNestedModuleDeclaration(parent)) {
getJSDocCommentsAndTagsWorker(parent);
}
if (parent.parent && (getSingleVariableOfVariableStatement(parent.parent) === node)) {
@@ -9220,10 +9315,10 @@ var ts;
}
if (ts.isBinaryExpression(node) && node.operatorToken.kind === 58 ||
ts.isBinaryExpression(parent) && parent.operatorToken.kind === 58 ||
- node.kind === 184 && node.parent && node.parent.kind === 215) {
+ node.kind === 185 && node.parent && node.parent.kind === 216) {
getJSDocCommentsAndTagsWorker(parent);
}
- if (node.kind === 148) {
+ if (node.kind === 149) {
result = ts.addRange(result, ts.getJSDocParameterTags(node));
}
if (isVariableLike(node) && ts.hasInitializer(node) && node.initializer !== hostNode && ts.hasJSDocNodes(node.initializer)) {
@@ -9277,12 +9372,12 @@ var ts;
ts.getTypeParameterFromJsDoc = getTypeParameterFromJsDoc;
function hasRestParameter(s) {
var last = ts.lastOrUndefined(s.parameters);
- return last && isRestParameter(last);
+ return !!last && isRestParameter(last);
}
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 === 284;
+ return node.dotDotDotToken !== undefined || !!type && type.kind === 285;
}
ts.isRestParameter = isRestParameter;
var AssignmentKind;
@@ -9295,31 +9390,31 @@ var ts;
var parent = node.parent;
while (true) {
switch (parent.kind) {
- case 199:
+ case 200:
var binaryOperator = parent.operatorToken.kind;
return isAssignmentOperator(binaryOperator) && parent.left === node ?
binaryOperator === 58 ? 1 : 2 :
0;
- case 197:
case 198:
+ case 199:
var unaryOperator = parent.operator;
return unaryOperator === 43 || unaryOperator === 44 ? 2 : 0;
- case 220:
case 221:
+ case 222:
return parent.initializer === node ? 1 : 0;
- case 190:
- case 182:
- case 203:
- case 208:
+ case 191:
+ case 183:
+ case 204:
+ case 209:
node = parent;
break;
- case 270:
+ case 271:
if (parent.name !== node) {
return 0;
}
node = parent.parent;
break;
- case 269:
+ case 270:
if (parent.name === node) {
return 0;
}
@@ -9338,22 +9433,22 @@ var ts;
ts.isAssignmentTarget = isAssignmentTarget;
function isNodeWithPossibleHoistedDeclaration(node) {
switch (node.kind) {
- case 212:
case 213:
- case 225:
- case 216:
+ case 214:
case 226:
- case 240:
- case 265:
- case 266:
+ case 217:
case 227:
- case 219:
+ case 241:
+ case 266:
+ case 267:
+ case 228:
case 220:
case 221:
- case 217:
+ case 222:
case 218:
- case 229:
- case 268:
+ case 219:
+ case 230:
+ case 269:
return true;
}
return false;
@@ -9370,26 +9465,26 @@ var ts;
return node;
}
function walkUpParenthesizedTypes(node) {
- return walkUp(node, 172);
+ return walkUp(node, 173);
}
ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes;
function walkUpParenthesizedExpressions(node) {
- return walkUp(node, 190);
+ return walkUp(node, 191);
}
ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions;
function skipParentheses(node) {
- while (node.kind === 190) {
+ while (node.kind === 191) {
node = node.expression;
}
return node;
}
ts.skipParentheses = skipParentheses;
function isDeleteTarget(node) {
- if (node.kind !== 184 && node.kind !== 185) {
+ if (node.kind !== 185 && node.kind !== 186) {
return false;
}
node = walkUpParenthesizedExpressions(node.parent);
- return node && node.kind === 193;
+ return node && node.kind === 194;
}
ts.isDeleteTarget = isDeleteTarget;
function isNodeDescendantOf(node, ancestor) {
@@ -9409,9 +9504,10 @@ var ts;
switch (name.kind) {
case 71:
case 9:
- case 8:
- if (ts.isDeclaration(name.parent)) {
- return name.parent.name === name;
+ case 8: {
+ var parent = name.parent;
+ if (ts.isDeclaration(parent)) {
+ return parent.name === name;
}
else if (ts.isQualifiedName(name.parent)) {
var tag = name.parent.parent;
@@ -9421,6 +9517,7 @@ var ts;
var binExp = name.parent.parent;
return ts.isBinaryExpression(binExp) && getSpecialPropertyAssignmentKind(binExp) !== 0 && ts.getNameOfDeclaration(binExp) === name;
}
+ }
default:
return false;
}
@@ -9428,49 +9525,49 @@ var ts;
ts.isAnyDeclarationName = isAnyDeclarationName;
function isLiteralComputedPropertyDeclarationName(node) {
return (node.kind === 9 || node.kind === 8) &&
- node.parent.kind === 146 &&
+ node.parent.kind === 147 &&
ts.isDeclaration(node.parent.parent);
}
ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName;
function isIdentifierName(node) {
var parent = node.parent;
switch (parent.kind) {
- case 151:
- case 150:
- case 153:
case 152:
- case 155:
+ case 151:
+ case 154:
+ case 153:
case 156:
- case 272:
- case 269:
- case 184:
+ case 157:
+ case 273:
+ case 270:
+ case 185:
return parent.name === node;
- case 145:
+ case 146:
if (parent.right === node) {
- while (parent.kind === 145) {
+ while (parent.kind === 146) {
parent = parent.parent;
}
- return parent.kind === 164 || parent.kind === 161;
+ return parent.kind === 165 || parent.kind === 162;
}
return false;
- case 181:
- case 247:
+ case 182:
+ case 248:
return parent.propertyName === node;
- case 251:
- case 261:
+ case 252:
+ case 262:
return true;
}
return false;
}
ts.isIdentifierName = isIdentifierName;
function isAliasSymbolDeclaration(node) {
- return node.kind === 242 ||
- node.kind === 241 ||
- node.kind === 244 && !!node.name ||
- node.kind === 245 ||
- node.kind === 247 ||
- node.kind === 251 ||
- node.kind === 248 && exportAssignmentIsAlias(node) ||
+ return node.kind === 243 ||
+ node.kind === 242 ||
+ node.kind === 245 && !!node.name ||
+ node.kind === 246 ||
+ node.kind === 248 ||
+ node.kind === 252 ||
+ node.kind === 249 && exportAssignmentIsAlias(node) ||
ts.isBinaryExpression(node) && getSpecialPropertyAssignmentKind(node) === 2;
}
ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration;
@@ -9530,11 +9627,11 @@ var ts;
}
ts.getAncestor = getAncestor;
function isKeyword(token) {
- return 72 <= token && token <= 144;
+ return 72 <= token && token <= 145;
}
ts.isKeyword = isKeyword;
function isContextualKeyword(token) {
- return 117 <= token && token <= 144;
+ return 117 <= token && token <= 145;
}
ts.isContextualKeyword = isContextualKeyword;
function isNonContextualKeyword(token) {
@@ -9564,13 +9661,13 @@ var ts;
}
var flags = 0;
switch (node.kind) {
- case 233:
- case 191:
- case 153:
+ case 234:
+ case 192:
+ case 154:
if (node.asteriskToken) {
flags |= 1;
}
- case 192:
+ case 193:
if (hasModifier(node, 256)) {
flags |= 2;
}
@@ -9584,10 +9681,10 @@ var ts;
ts.getFunctionFlags = getFunctionFlags;
function isAsyncFunction(node) {
switch (node.kind) {
- case 233:
- case 191:
+ case 234:
case 192:
- case 153:
+ case 193:
+ case 154:
return node.body !== undefined
&& node.asteriskToken === undefined
&& hasModifier(node, 256);
@@ -9603,11 +9700,11 @@ var ts;
ts.isStringOrNumericLiteral = isStringOrNumericLiteral;
function hasDynamicName(declaration) {
var name = ts.getNameOfDeclaration(declaration);
- return name && isDynamicName(name);
+ return !!name && isDynamicName(name);
}
ts.hasDynamicName = hasDynamicName;
function isDynamicName(name) {
- return name.kind === 146 &&
+ return name.kind === 147 &&
!isStringOrNumericLiteral(name.expression) &&
!isWellKnownSymbolSyntactically(name.expression);
}
@@ -9623,7 +9720,7 @@ var ts;
if (name.kind === 9 || name.kind === 8) {
return escapeLeadingUnderscores(name.text);
}
- if (name.kind === 146) {
+ if (name.kind === 147) {
var nameExpression = name.expression;
if (isWellKnownSymbolSyntactically(nameExpression)) {
return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name));
@@ -9673,11 +9770,11 @@ var ts;
ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier;
function isParameterDeclaration(node) {
var root = getRootDeclaration(node);
- return root.kind === 148;
+ return root.kind === 149;
}
ts.isParameterDeclaration = isParameterDeclaration;
function getRootDeclaration(node) {
- while (node.kind === 181) {
+ while (node.kind === 182) {
node = node.parent.parent;
}
return node;
@@ -9685,15 +9782,15 @@ var ts;
ts.getRootDeclaration = getRootDeclaration;
function nodeStartsNewLexicalEnvironment(node) {
var kind = node.kind;
- return kind === 154
- || kind === 191
- || kind === 233
+ return kind === 155
|| kind === 192
- || kind === 153
- || kind === 155
+ || kind === 234
+ || kind === 193
+ || kind === 154
|| kind === 156
- || kind === 238
- || kind === 273;
+ || kind === 157
+ || kind === 239
+ || kind === 274;
}
ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment;
function nodeIsSynthesized(range) {
@@ -9712,23 +9809,23 @@ var ts;
})(Associativity = ts.Associativity || (ts.Associativity = {}));
function getExpressionAssociativity(expression) {
var operator = getOperator(expression);
- var hasArguments = expression.kind === 187 && expression.arguments !== undefined;
+ var hasArguments = expression.kind === 188 && expression.arguments !== undefined;
return getOperatorAssociativity(expression.kind, operator, hasArguments);
}
ts.getExpressionAssociativity = getExpressionAssociativity;
function getOperatorAssociativity(kind, operator, hasArguments) {
switch (kind) {
- case 187:
+ case 188:
return hasArguments ? 0 : 1;
- case 197:
- case 194:
+ case 198:
case 195:
- case 193:
case 196:
- case 200:
- case 202:
+ case 194:
+ case 197:
+ case 201:
+ case 203:
return 1;
- case 199:
+ case 200:
switch (operator) {
case 40:
case 58:
@@ -9752,15 +9849,15 @@ var ts;
ts.getOperatorAssociativity = getOperatorAssociativity;
function getExpressionPrecedence(expression) {
var operator = getOperator(expression);
- var hasArguments = expression.kind === 187 && expression.arguments !== undefined;
+ var hasArguments = expression.kind === 188 && expression.arguments !== undefined;
return getOperatorPrecedence(expression.kind, operator, hasArguments);
}
ts.getExpressionPrecedence = getExpressionPrecedence;
function getOperator(expression) {
- if (expression.kind === 199) {
+ if (expression.kind === 200) {
return expression.operatorToken.kind;
}
- else if (expression.kind === 197 || expression.kind === 198) {
+ else if (expression.kind === 198 || expression.kind === 199) {
return expression.operator;
}
else {
@@ -9770,15 +9867,15 @@ var ts;
ts.getOperator = getOperator;
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
switch (nodeKind) {
- case 301:
+ case 302:
return 0;
- case 203:
+ case 204:
return 1;
- case 202:
+ case 203:
return 2;
- case 200:
+ case 201:
return 4;
- case 199:
+ case 200:
switch (operatorKind) {
case 26:
return 0;
@@ -9799,21 +9896,21 @@ var ts;
default:
return getBinaryOperatorPrecedence(operatorKind);
}
- case 197:
- case 194:
- case 195:
- case 193:
- case 196:
- return 16;
case 198:
+ case 195:
+ case 196:
+ case 194:
+ case 197:
+ return 16;
+ case 199:
return 17;
- case 186:
- return 18;
case 187:
- return hasArguments ? 19 : 18;
+ return 18;
case 188:
- case 184:
+ return hasArguments ? 19 : 18;
+ case 189:
case 185:
+ case 186:
return 19;
case 99:
case 97:
@@ -9823,19 +9920,19 @@ var ts;
case 86:
case 8:
case 9:
- case 182:
case 183:
- case 191:
+ case 184:
case 192:
- case 204:
- case 254:
+ case 193:
+ case 205:
case 255:
- case 258:
+ case 256:
+ case 259:
case 12:
case 13:
- case 201:
- case 190:
- case 205:
+ case 202:
+ case 191:
+ case 206:
return 20;
default:
return -1;
@@ -10035,7 +10132,7 @@ var ts;
var lineStartsOfS = ts.computeLineStarts(s);
if (lineStartsOfS.length > 1) {
lineCount = lineCount + lineStartsOfS.length - 1;
- linePos = output.length - s.length + ts.lastOrUndefined(lineStartsOfS);
+ linePos = output.length - s.length + ts.last(lineStartsOfS);
}
}
}
@@ -10194,7 +10291,7 @@ var ts;
}
ts.parameterIsThisKeyword = parameterIsThisKeyword;
function isThisIdentifier(node) {
- return node && node.kind === 71 && identifierIsThisKeyword(node);
+ return !!node && node.kind === 71 && identifierIsThisKeyword(node);
}
ts.isThisIdentifier = isThisIdentifier;
function identifierIsThisKeyword(id) {
@@ -10208,10 +10305,10 @@ var ts;
var setAccessor;
if (hasDynamicName(accessor)) {
firstAccessor = accessor;
- if (accessor.kind === 155) {
+ if (accessor.kind === 156) {
getAccessor = accessor;
}
- else if (accessor.kind === 156) {
+ else if (accessor.kind === 157) {
setAccessor = accessor;
}
else {
@@ -10220,7 +10317,7 @@ var ts;
}
else {
ts.forEach(declarations, function (member) {
- if ((member.kind === 155 || member.kind === 156)
+ if ((member.kind === 156 || member.kind === 157)
&& hasModifier(member, 32) === hasModifier(accessor, 32)) {
var memberName = getPropertyNameForPropertyNameNode(member.name);
var accessorName = getPropertyNameForPropertyNameNode(accessor.name);
@@ -10231,10 +10328,10 @@ var ts;
else if (!secondAccessor) {
secondAccessor = member;
}
- if (member.kind === 155 && !getAccessor) {
+ if (member.kind === 156 && !getAccessor) {
getAccessor = member;
}
- if (member.kind === 156 && !setAccessor) {
+ if (member.kind === 157 && !setAccessor) {
setAccessor = member;
}
}
@@ -10269,24 +10366,19 @@ var ts;
return ts.emptyArray;
}
if (isJSDocTypeAlias(node)) {
- ts.Debug.assert(node.parent.kind === 285);
- var templateTags = ts.flatMap(ts.filter(node.parent.tags, ts.isJSDocTemplateTag), function (tag) { return tag.typeParameters; });
- var templateTagNodes = templateTags;
- templateTagNodes.pos = templateTagNodes.length > 0 ? ts.first(templateTagNodes).pos : node.pos;
- templateTagNodes.end = templateTagNodes.length > 0 ? ts.last(templateTagNodes).end : node.end;
- templateTagNodes.hasTrailingComma = false;
- return templateTagNodes;
+ ts.Debug.assert(node.parent.kind === 286);
+ return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; });
}
return node.typeParameters || (isInJavaScriptFile(node) ? getJSDocTypeParameterDeclarations(node) : ts.emptyArray);
}
ts.getEffectiveTypeParameterDeclarations = getEffectiveTypeParameterDeclarations;
function getJSDocTypeParameterDeclarations(node) {
- var tag = ts.find(ts.getJSDocTags(node), function (tag) {
- return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 285 && tag.parent.tags.some(isJSDocTypeAlias));
- });
- return (tag && tag.typeParameters) || ts.emptyArray;
+ return ts.flatMap(ts.getJSDocTags(node), function (tag) { return isNonTypeAliasTemplate(tag) ? tag.typeParameters : undefined; });
}
ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations;
+ function isNonTypeAliasTemplate(tag) {
+ return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 286 && tag.parent.tags.some(isJSDocTypeAlias));
+ }
function getEffectiveSetAccessorTypeAnnotationNode(node) {
var parameter = getSetAccessorValueParameter(node);
return parameter && getEffectiveTypeAnnotationNode(parameter);
@@ -10363,12 +10455,12 @@ var ts;
lastComment = comment;
}
if (detachedComments.length) {
- var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, ts.lastOrUndefined(detachedComments).end);
+ var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, ts.last(detachedComments).end);
var nodeLine = getLineOfLocalPositionFromLineMap(lineMap, ts.skipTrivia(text, node.pos));
if (nodeLine >= lastCommentLine + 2) {
emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments);
emitComments(text, lineMap, writer, detachedComments, false, true, newLine, writeComment);
- currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: ts.lastOrUndefined(detachedComments).end };
+ currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: ts.last(detachedComments).end };
}
}
}
@@ -10511,7 +10603,7 @@ var ts;
}
ts.isAssignmentOperator = isAssignmentOperator;
function tryGetClassExtendingExpressionWithTypeArguments(node) {
- if (node.kind === 206 &&
+ if (ts.isExpressionWithTypeArguments(node) &&
node.parent.token === 85 &&
ts.isClassLike(node.parent.parent)) {
return node.parent.parent;
@@ -10529,8 +10621,8 @@ var ts;
function isDestructuringAssignment(node) {
if (isAssignmentExpression(node, true)) {
var kind = node.left.kind;
- return kind === 183
- || kind === 182;
+ return kind === 184
+ || kind === 183;
}
return false;
}
@@ -10540,7 +10632,7 @@ var ts;
}
ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause;
function isExpressionWithTypeArgumentsInClassImplementsClause(node) {
- return node.kind === 206
+ return node.kind === 207
&& isEntityNameExpression(node.expression)
&& node.parent
&& node.parent.token === 108
@@ -10561,17 +10653,17 @@ var ts;
}
ts.isPrototypeAccess = isPrototypeAccess;
function isRightSideOfQualifiedNameOrPropertyAccess(node) {
- return (node.parent.kind === 145 && node.parent.right === node) ||
- (node.parent.kind === 184 && node.parent.name === node);
+ return (node.parent.kind === 146 && node.parent.right === node) ||
+ (node.parent.kind === 185 && node.parent.name === node);
}
ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess;
function isEmptyObjectLiteral(expression) {
- return expression.kind === 183 &&
+ return expression.kind === 184 &&
expression.properties.length === 0;
}
ts.isEmptyObjectLiteral = isEmptyObjectLiteral;
function isEmptyArrayLiteral(expression) {
- return expression.kind === 182 &&
+ return expression.kind === 183 &&
expression.elements.length === 0;
}
ts.isEmptyArrayLiteral = isEmptyArrayLiteral;
@@ -10668,14 +10760,14 @@ var ts;
return output;
}
function base64encode(host, input) {
- if (host.base64encode) {
+ if (host && host.base64encode) {
return host.base64encode(input);
}
return convertToBase64(input);
}
ts.base64encode = base64encode;
function base64decode(host, input) {
- if (host.base64decode) {
+ if (host && host.base64decode) {
return host.base64decode(input);
}
var length = input.length;
@@ -10851,8 +10943,8 @@ var ts;
var parseNode = ts.getParseTreeNode(node);
if (parseNode) {
switch (parseNode.parent.kind) {
- case 237:
case 238:
+ case 239:
return parseNode === parseNode.parent.name;
}
}
@@ -10920,20 +11012,20 @@ var ts;
if (!parent)
return 0;
switch (parent.kind) {
+ case 199:
case 198:
- case 197:
var operator = parent.operator;
return operator === 43 || operator === 44 ? writeOrReadWrite() : 0;
- case 199:
+ case 200:
var _a = parent, left = _a.left, operatorToken = _a.operatorToken;
return left === node && isAssignmentOperator(operatorToken.kind) ? writeOrReadWrite() : 0;
- case 184:
+ case 185:
return parent.name !== node ? 0 : accessKind(parent);
default:
return 0;
}
function writeOrReadWrite() {
- return parent.parent && parent.parent.kind === 215 ? 1 : 2;
+ return parent.parent && parent.parent.kind === 216 ? 1 : 2;
}
}
function compareDataObjects(dst, src) {
@@ -11010,7 +11102,7 @@ var ts;
}
ts.getClassLikeDeclarationOfSymbol = getClassLikeDeclarationOfSymbol;
function getObjectFlags(type) {
- return type.flags & 65536 ? type.objectFlags : 0;
+ return type.flags & 131072 ? type.objectFlags : 0;
}
ts.getObjectFlags = getObjectFlags;
function typeHasCallOrConstructSignatures(type, checker) {
@@ -11189,9 +11281,9 @@ var ts;
}
ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions;
function getTypeParameterOwner(d) {
- if (d && d.kind === 147) {
+ if (d && d.kind === 148) {
for (var current = d; current; current = current.parent) {
- if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 235) {
+ if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 236) {
return current;
}
}
@@ -11199,7 +11291,7 @@ var ts;
}
ts.getTypeParameterOwner = getTypeParameterOwner;
function isParameterPropertyDeclaration(node) {
- return ts.hasModifier(node, 92) && node.parent.kind === 154;
+ return ts.hasModifier(node, 92) && node.parent.kind === 155;
}
ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration;
function isEmptyBindingPattern(node) {
@@ -11217,7 +11309,7 @@ var ts;
}
ts.isEmptyBindingElement = isEmptyBindingElement;
function walkUpBindingElementsAndPatterns(node) {
- while (node && (node.kind === 181 || ts.isBindingPattern(node))) {
+ while (node && (node.kind === 182 || ts.isBindingPattern(node))) {
node = node.parent;
}
return node;
@@ -11225,14 +11317,14 @@ var ts;
function getCombinedModifierFlags(node) {
node = walkUpBindingElementsAndPatterns(node);
var flags = ts.getModifierFlags(node);
- if (node.kind === 231) {
+ if (node.kind === 232) {
node = node.parent;
}
- if (node && node.kind === 232) {
+ if (node && node.kind === 233) {
flags |= ts.getModifierFlags(node);
node = node.parent;
}
- if (node && node.kind === 213) {
+ if (node && node.kind === 214) {
flags |= ts.getModifierFlags(node);
}
return flags;
@@ -11241,14 +11333,14 @@ var ts;
function getCombinedNodeFlags(node) {
node = walkUpBindingElementsAndPatterns(node);
var flags = node.flags;
- if (node.kind === 231) {
+ if (node.kind === 232) {
node = node.parent;
}
- if (node && node.kind === 232) {
+ if (node && node.kind === 233) {
flags |= node.flags;
node = node.parent;
}
- if (node && node.kind === 213) {
+ if (node && node.kind === 214) {
flags |= node.flags;
}
return flags;
@@ -11292,7 +11384,7 @@ var ts;
try {
ts.localizedDiagnosticMessages = JSON.parse(fileContents);
}
- catch (e) {
+ catch (_a) {
if (errors) {
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Corrupted_locale_file_0, filePath));
}
@@ -11352,17 +11444,17 @@ var ts;
return getDeclarationIdentifier(hostNode);
}
switch (hostNode.kind) {
- case 213:
+ case 214:
if (hostNode.declarationList && hostNode.declarationList.declarations[0]) {
return getDeclarationIdentifier(hostNode.declarationList.declarations[0]);
}
return undefined;
- case 215:
+ case 216:
var expr = hostNode.expression;
switch (expr.kind) {
- case 184:
- return expr.name;
case 185:
+ return expr.name;
+ case 186:
var arg = expr.argumentExpression;
if (ts.isIdentifier(arg)) {
return arg;
@@ -11371,10 +11463,10 @@ var ts;
return undefined;
case 1:
return undefined;
- case 190: {
+ case 191: {
return getDeclarationIdentifier(hostNode.expression);
}
- case 227: {
+ case 228: {
if (ts.isDeclaration(hostNode.statement) || ts.isExpression(hostNode.statement)) {
return getDeclarationIdentifier(hostNode.statement);
}
@@ -11401,23 +11493,23 @@ var ts;
return undefined;
}
switch (declaration.kind) {
- case 204:
- case 191:
+ case 205:
+ case 192:
if (!declaration.name) {
return getAssignedName(declaration);
}
break;
case 71:
return declaration;
- case 297:
- case 292: {
+ case 298:
+ case 293: {
var name = declaration.name;
- if (name.kind === 145) {
+ if (name.kind === 146) {
return name.right;
}
break;
}
- case 199: {
+ case 200: {
var expr = declaration;
switch (ts.getSpecialPropertyAssignmentKind(expr)) {
case 1:
@@ -11429,11 +11521,11 @@ var ts;
return undefined;
}
}
- case 291:
+ case 292:
return declaration.name;
- case 296:
+ case 297:
return getNameOfJSDocTypedef(declaration);
- case 248: {
+ case 249: {
var expression = declaration.expression;
return ts.isIdentifier(expression) ? expression : undefined;
}
@@ -11572,628 +11664,628 @@ var ts;
}
ts.isIdentifier = isIdentifier;
function isQualifiedName(node) {
- return node.kind === 145;
+ return node.kind === 146;
}
ts.isQualifiedName = isQualifiedName;
function isComputedPropertyName(node) {
- return node.kind === 146;
+ return node.kind === 147;
}
ts.isComputedPropertyName = isComputedPropertyName;
function isTypeParameterDeclaration(node) {
- return node.kind === 147;
+ return node.kind === 148;
}
ts.isTypeParameterDeclaration = isTypeParameterDeclaration;
function isParameter(node) {
- return node.kind === 148;
+ return node.kind === 149;
}
ts.isParameter = isParameter;
function isDecorator(node) {
- return node.kind === 149;
+ return node.kind === 150;
}
ts.isDecorator = isDecorator;
function isPropertySignature(node) {
- return node.kind === 150;
+ return node.kind === 151;
}
ts.isPropertySignature = isPropertySignature;
function isPropertyDeclaration(node) {
- return node.kind === 151;
+ return node.kind === 152;
}
ts.isPropertyDeclaration = isPropertyDeclaration;
function isMethodSignature(node) {
- return node.kind === 152;
+ return node.kind === 153;
}
ts.isMethodSignature = isMethodSignature;
function isMethodDeclaration(node) {
- return node.kind === 153;
+ return node.kind === 154;
}
ts.isMethodDeclaration = isMethodDeclaration;
function isConstructorDeclaration(node) {
- return node.kind === 154;
+ return node.kind === 155;
}
ts.isConstructorDeclaration = isConstructorDeclaration;
function isGetAccessorDeclaration(node) {
- return node.kind === 155;
+ return node.kind === 156;
}
ts.isGetAccessorDeclaration = isGetAccessorDeclaration;
function isSetAccessorDeclaration(node) {
- return node.kind === 156;
+ return node.kind === 157;
}
ts.isSetAccessorDeclaration = isSetAccessorDeclaration;
function isCallSignatureDeclaration(node) {
- return node.kind === 157;
+ return node.kind === 158;
}
ts.isCallSignatureDeclaration = isCallSignatureDeclaration;
function isConstructSignatureDeclaration(node) {
- return node.kind === 158;
+ return node.kind === 159;
}
ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration;
function isIndexSignatureDeclaration(node) {
- return node.kind === 159;
+ return node.kind === 160;
}
ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration;
function isGetOrSetAccessorDeclaration(node) {
- return node.kind === 156 || node.kind === 155;
+ return node.kind === 157 || node.kind === 156;
}
ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration;
function isTypePredicateNode(node) {
- return node.kind === 160;
+ return node.kind === 161;
}
ts.isTypePredicateNode = isTypePredicateNode;
function isTypeReferenceNode(node) {
- return node.kind === 161;
+ return node.kind === 162;
}
ts.isTypeReferenceNode = isTypeReferenceNode;
function isFunctionTypeNode(node) {
- return node.kind === 162;
+ return node.kind === 163;
}
ts.isFunctionTypeNode = isFunctionTypeNode;
function isConstructorTypeNode(node) {
- return node.kind === 163;
+ return node.kind === 164;
}
ts.isConstructorTypeNode = isConstructorTypeNode;
function isTypeQueryNode(node) {
- return node.kind === 164;
+ return node.kind === 165;
}
ts.isTypeQueryNode = isTypeQueryNode;
function isTypeLiteralNode(node) {
- return node.kind === 165;
+ return node.kind === 166;
}
ts.isTypeLiteralNode = isTypeLiteralNode;
function isArrayTypeNode(node) {
- return node.kind === 166;
+ return node.kind === 167;
}
ts.isArrayTypeNode = isArrayTypeNode;
function isTupleTypeNode(node) {
- return node.kind === 167;
+ return node.kind === 168;
}
ts.isTupleTypeNode = isTupleTypeNode;
function isUnionTypeNode(node) {
- return node.kind === 168;
+ return node.kind === 169;
}
ts.isUnionTypeNode = isUnionTypeNode;
function isIntersectionTypeNode(node) {
- return node.kind === 169;
+ return node.kind === 170;
}
ts.isIntersectionTypeNode = isIntersectionTypeNode;
function isConditionalTypeNode(node) {
- return node.kind === 170;
+ return node.kind === 171;
}
ts.isConditionalTypeNode = isConditionalTypeNode;
function isInferTypeNode(node) {
- return node.kind === 171;
+ return node.kind === 172;
}
ts.isInferTypeNode = isInferTypeNode;
function isParenthesizedTypeNode(node) {
- return node.kind === 172;
+ return node.kind === 173;
}
ts.isParenthesizedTypeNode = isParenthesizedTypeNode;
function isThisTypeNode(node) {
- return node.kind === 173;
+ return node.kind === 174;
}
ts.isThisTypeNode = isThisTypeNode;
function isTypeOperatorNode(node) {
- return node.kind === 174;
+ return node.kind === 175;
}
ts.isTypeOperatorNode = isTypeOperatorNode;
function isIndexedAccessTypeNode(node) {
- return node.kind === 175;
+ return node.kind === 176;
}
ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode;
function isMappedTypeNode(node) {
- return node.kind === 176;
+ return node.kind === 177;
}
ts.isMappedTypeNode = isMappedTypeNode;
function isLiteralTypeNode(node) {
- return node.kind === 177;
+ return node.kind === 178;
}
ts.isLiteralTypeNode = isLiteralTypeNode;
function isImportTypeNode(node) {
- return node.kind === 178;
+ return node.kind === 179;
}
ts.isImportTypeNode = isImportTypeNode;
function isObjectBindingPattern(node) {
- return node.kind === 179;
+ return node.kind === 180;
}
ts.isObjectBindingPattern = isObjectBindingPattern;
function isArrayBindingPattern(node) {
- return node.kind === 180;
+ return node.kind === 181;
}
ts.isArrayBindingPattern = isArrayBindingPattern;
function isBindingElement(node) {
- return node.kind === 181;
+ return node.kind === 182;
}
ts.isBindingElement = isBindingElement;
function isArrayLiteralExpression(node) {
- return node.kind === 182;
+ return node.kind === 183;
}
ts.isArrayLiteralExpression = isArrayLiteralExpression;
function isObjectLiteralExpression(node) {
- return node.kind === 183;
+ return node.kind === 184;
}
ts.isObjectLiteralExpression = isObjectLiteralExpression;
function isPropertyAccessExpression(node) {
- return node.kind === 184;
+ return node.kind === 185;
}
ts.isPropertyAccessExpression = isPropertyAccessExpression;
function isElementAccessExpression(node) {
- return node.kind === 185;
+ return node.kind === 186;
}
ts.isElementAccessExpression = isElementAccessExpression;
function isCallExpression(node) {
- return node.kind === 186;
+ return node.kind === 187;
}
ts.isCallExpression = isCallExpression;
function isNewExpression(node) {
- return node.kind === 187;
+ return node.kind === 188;
}
ts.isNewExpression = isNewExpression;
function isTaggedTemplateExpression(node) {
- return node.kind === 188;
+ return node.kind === 189;
}
ts.isTaggedTemplateExpression = isTaggedTemplateExpression;
function isTypeAssertion(node) {
- return node.kind === 189;
+ return node.kind === 190;
}
ts.isTypeAssertion = isTypeAssertion;
function isParenthesizedExpression(node) {
- return node.kind === 190;
+ return node.kind === 191;
}
ts.isParenthesizedExpression = isParenthesizedExpression;
function skipPartiallyEmittedExpressions(node) {
- while (node.kind === 300) {
+ while (node.kind === 301) {
node = node.expression;
}
return node;
}
ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions;
function isFunctionExpression(node) {
- return node.kind === 191;
+ return node.kind === 192;
}
ts.isFunctionExpression = isFunctionExpression;
function isArrowFunction(node) {
- return node.kind === 192;
+ return node.kind === 193;
}
ts.isArrowFunction = isArrowFunction;
function isDeleteExpression(node) {
- return node.kind === 193;
+ return node.kind === 194;
}
ts.isDeleteExpression = isDeleteExpression;
function isTypeOfExpression(node) {
- return node.kind === 194;
+ return node.kind === 195;
}
ts.isTypeOfExpression = isTypeOfExpression;
function isVoidExpression(node) {
- return node.kind === 195;
+ return node.kind === 196;
}
ts.isVoidExpression = isVoidExpression;
function isAwaitExpression(node) {
- return node.kind === 196;
+ return node.kind === 197;
}
ts.isAwaitExpression = isAwaitExpression;
function isPrefixUnaryExpression(node) {
- return node.kind === 197;
+ return node.kind === 198;
}
ts.isPrefixUnaryExpression = isPrefixUnaryExpression;
function isPostfixUnaryExpression(node) {
- return node.kind === 198;
+ return node.kind === 199;
}
ts.isPostfixUnaryExpression = isPostfixUnaryExpression;
function isBinaryExpression(node) {
- return node.kind === 199;
+ return node.kind === 200;
}
ts.isBinaryExpression = isBinaryExpression;
function isConditionalExpression(node) {
- return node.kind === 200;
+ return node.kind === 201;
}
ts.isConditionalExpression = isConditionalExpression;
function isTemplateExpression(node) {
- return node.kind === 201;
+ return node.kind === 202;
}
ts.isTemplateExpression = isTemplateExpression;
function isYieldExpression(node) {
- return node.kind === 202;
+ return node.kind === 203;
}
ts.isYieldExpression = isYieldExpression;
function isSpreadElement(node) {
- return node.kind === 203;
+ return node.kind === 204;
}
ts.isSpreadElement = isSpreadElement;
function isClassExpression(node) {
- return node.kind === 204;
+ return node.kind === 205;
}
ts.isClassExpression = isClassExpression;
function isOmittedExpression(node) {
- return node.kind === 205;
+ return node.kind === 206;
}
ts.isOmittedExpression = isOmittedExpression;
function isExpressionWithTypeArguments(node) {
- return node.kind === 206;
+ return node.kind === 207;
}
ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments;
function isAsExpression(node) {
- return node.kind === 207;
+ return node.kind === 208;
}
ts.isAsExpression = isAsExpression;
function isNonNullExpression(node) {
- return node.kind === 208;
+ return node.kind === 209;
}
ts.isNonNullExpression = isNonNullExpression;
function isMetaProperty(node) {
- return node.kind === 209;
+ return node.kind === 210;
}
ts.isMetaProperty = isMetaProperty;
function isTemplateSpan(node) {
- return node.kind === 210;
+ return node.kind === 211;
}
ts.isTemplateSpan = isTemplateSpan;
function isSemicolonClassElement(node) {
- return node.kind === 211;
+ return node.kind === 212;
}
ts.isSemicolonClassElement = isSemicolonClassElement;
function isBlock(node) {
- return node.kind === 212;
+ return node.kind === 213;
}
ts.isBlock = isBlock;
function isVariableStatement(node) {
- return node.kind === 213;
+ return node.kind === 214;
}
ts.isVariableStatement = isVariableStatement;
function isEmptyStatement(node) {
- return node.kind === 214;
+ return node.kind === 215;
}
ts.isEmptyStatement = isEmptyStatement;
function isExpressionStatement(node) {
- return node.kind === 215;
+ return node.kind === 216;
}
ts.isExpressionStatement = isExpressionStatement;
function isIfStatement(node) {
- return node.kind === 216;
+ return node.kind === 217;
}
ts.isIfStatement = isIfStatement;
function isDoStatement(node) {
- return node.kind === 217;
+ return node.kind === 218;
}
ts.isDoStatement = isDoStatement;
function isWhileStatement(node) {
- return node.kind === 218;
+ return node.kind === 219;
}
ts.isWhileStatement = isWhileStatement;
function isForStatement(node) {
- return node.kind === 219;
+ return node.kind === 220;
}
ts.isForStatement = isForStatement;
function isForInStatement(node) {
- return node.kind === 220;
+ return node.kind === 221;
}
ts.isForInStatement = isForInStatement;
function isForOfStatement(node) {
- return node.kind === 221;
+ return node.kind === 222;
}
ts.isForOfStatement = isForOfStatement;
function isContinueStatement(node) {
- return node.kind === 222;
+ return node.kind === 223;
}
ts.isContinueStatement = isContinueStatement;
function isBreakStatement(node) {
- return node.kind === 223;
+ return node.kind === 224;
}
ts.isBreakStatement = isBreakStatement;
function isBreakOrContinueStatement(node) {
- return node.kind === 223 || node.kind === 222;
+ return node.kind === 224 || node.kind === 223;
}
ts.isBreakOrContinueStatement = isBreakOrContinueStatement;
function isReturnStatement(node) {
- return node.kind === 224;
+ return node.kind === 225;
}
ts.isReturnStatement = isReturnStatement;
function isWithStatement(node) {
- return node.kind === 225;
+ return node.kind === 226;
}
ts.isWithStatement = isWithStatement;
function isSwitchStatement(node) {
- return node.kind === 226;
+ return node.kind === 227;
}
ts.isSwitchStatement = isSwitchStatement;
function isLabeledStatement(node) {
- return node.kind === 227;
+ return node.kind === 228;
}
ts.isLabeledStatement = isLabeledStatement;
function isThrowStatement(node) {
- return node.kind === 228;
+ return node.kind === 229;
}
ts.isThrowStatement = isThrowStatement;
function isTryStatement(node) {
- return node.kind === 229;
+ return node.kind === 230;
}
ts.isTryStatement = isTryStatement;
function isDebuggerStatement(node) {
- return node.kind === 230;
+ return node.kind === 231;
}
ts.isDebuggerStatement = isDebuggerStatement;
function isVariableDeclaration(node) {
- return node.kind === 231;
+ return node.kind === 232;
}
ts.isVariableDeclaration = isVariableDeclaration;
function isVariableDeclarationList(node) {
- return node.kind === 232;
+ return node.kind === 233;
}
ts.isVariableDeclarationList = isVariableDeclarationList;
function isFunctionDeclaration(node) {
- return node.kind === 233;
+ return node.kind === 234;
}
ts.isFunctionDeclaration = isFunctionDeclaration;
function isClassDeclaration(node) {
- return node.kind === 234;
+ return node.kind === 235;
}
ts.isClassDeclaration = isClassDeclaration;
function isInterfaceDeclaration(node) {
- return node.kind === 235;
+ return node.kind === 236;
}
ts.isInterfaceDeclaration = isInterfaceDeclaration;
function isTypeAliasDeclaration(node) {
- return node.kind === 236;
+ return node.kind === 237;
}
ts.isTypeAliasDeclaration = isTypeAliasDeclaration;
function isEnumDeclaration(node) {
- return node.kind === 237;
+ return node.kind === 238;
}
ts.isEnumDeclaration = isEnumDeclaration;
function isModuleDeclaration(node) {
- return node.kind === 238;
+ return node.kind === 239;
}
ts.isModuleDeclaration = isModuleDeclaration;
function isModuleBlock(node) {
- return node.kind === 239;
+ return node.kind === 240;
}
ts.isModuleBlock = isModuleBlock;
function isCaseBlock(node) {
- return node.kind === 240;
+ return node.kind === 241;
}
ts.isCaseBlock = isCaseBlock;
function isNamespaceExportDeclaration(node) {
- return node.kind === 241;
+ return node.kind === 242;
}
ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration;
function isImportEqualsDeclaration(node) {
- return node.kind === 242;
+ return node.kind === 243;
}
ts.isImportEqualsDeclaration = isImportEqualsDeclaration;
function isImportDeclaration(node) {
- return node.kind === 243;
+ return node.kind === 244;
}
ts.isImportDeclaration = isImportDeclaration;
function isImportClause(node) {
- return node.kind === 244;
+ return node.kind === 245;
}
ts.isImportClause = isImportClause;
function isNamespaceImport(node) {
- return node.kind === 245;
+ return node.kind === 246;
}
ts.isNamespaceImport = isNamespaceImport;
function isNamedImports(node) {
- return node.kind === 246;
+ return node.kind === 247;
}
ts.isNamedImports = isNamedImports;
function isImportSpecifier(node) {
- return node.kind === 247;
+ return node.kind === 248;
}
ts.isImportSpecifier = isImportSpecifier;
function isExportAssignment(node) {
- return node.kind === 248;
+ return node.kind === 249;
}
ts.isExportAssignment = isExportAssignment;
function isExportDeclaration(node) {
- return node.kind === 249;
+ return node.kind === 250;
}
ts.isExportDeclaration = isExportDeclaration;
function isNamedExports(node) {
- return node.kind === 250;
+ return node.kind === 251;
}
ts.isNamedExports = isNamedExports;
function isExportSpecifier(node) {
- return node.kind === 251;
+ return node.kind === 252;
}
ts.isExportSpecifier = isExportSpecifier;
function isMissingDeclaration(node) {
- return node.kind === 252;
+ return node.kind === 253;
}
ts.isMissingDeclaration = isMissingDeclaration;
function isExternalModuleReference(node) {
- return node.kind === 253;
+ return node.kind === 254;
}
ts.isExternalModuleReference = isExternalModuleReference;
function isJsxElement(node) {
- return node.kind === 254;
+ return node.kind === 255;
}
ts.isJsxElement = isJsxElement;
function isJsxSelfClosingElement(node) {
- return node.kind === 255;
+ return node.kind === 256;
}
ts.isJsxSelfClosingElement = isJsxSelfClosingElement;
function isJsxOpeningElement(node) {
- return node.kind === 256;
+ return node.kind === 257;
}
ts.isJsxOpeningElement = isJsxOpeningElement;
function isJsxClosingElement(node) {
- return node.kind === 257;
+ return node.kind === 258;
}
ts.isJsxClosingElement = isJsxClosingElement;
function isJsxFragment(node) {
- return node.kind === 258;
+ return node.kind === 259;
}
ts.isJsxFragment = isJsxFragment;
function isJsxOpeningFragment(node) {
- return node.kind === 259;
+ return node.kind === 260;
}
ts.isJsxOpeningFragment = isJsxOpeningFragment;
function isJsxClosingFragment(node) {
- return node.kind === 260;
+ return node.kind === 261;
}
ts.isJsxClosingFragment = isJsxClosingFragment;
function isJsxAttribute(node) {
- return node.kind === 261;
+ return node.kind === 262;
}
ts.isJsxAttribute = isJsxAttribute;
function isJsxAttributes(node) {
- return node.kind === 262;
+ return node.kind === 263;
}
ts.isJsxAttributes = isJsxAttributes;
function isJsxSpreadAttribute(node) {
- return node.kind === 263;
+ return node.kind === 264;
}
ts.isJsxSpreadAttribute = isJsxSpreadAttribute;
function isJsxExpression(node) {
- return node.kind === 264;
+ return node.kind === 265;
}
ts.isJsxExpression = isJsxExpression;
function isCaseClause(node) {
- return node.kind === 265;
+ return node.kind === 266;
}
ts.isCaseClause = isCaseClause;
function isDefaultClause(node) {
- return node.kind === 266;
+ return node.kind === 267;
}
ts.isDefaultClause = isDefaultClause;
function isHeritageClause(node) {
- return node.kind === 267;
+ return node.kind === 268;
}
ts.isHeritageClause = isHeritageClause;
function isCatchClause(node) {
- return node.kind === 268;
+ return node.kind === 269;
}
ts.isCatchClause = isCatchClause;
function isPropertyAssignment(node) {
- return node.kind === 269;
+ return node.kind === 270;
}
ts.isPropertyAssignment = isPropertyAssignment;
function isShorthandPropertyAssignment(node) {
- return node.kind === 270;
+ return node.kind === 271;
}
ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment;
function isSpreadAssignment(node) {
- return node.kind === 271;
+ return node.kind === 272;
}
ts.isSpreadAssignment = isSpreadAssignment;
function isEnumMember(node) {
- return node.kind === 272;
+ return node.kind === 273;
}
ts.isEnumMember = isEnumMember;
function isSourceFile(node) {
- return node.kind === 273;
+ return node.kind === 274;
}
ts.isSourceFile = isSourceFile;
function isBundle(node) {
- return node.kind === 274;
+ return node.kind === 275;
}
ts.isBundle = isBundle;
function isJSDocTypeExpression(node) {
- return node.kind === 277;
+ return node.kind === 278;
}
ts.isJSDocTypeExpression = isJSDocTypeExpression;
function isJSDocAllType(node) {
- return node.kind === 278;
+ return node.kind === 279;
}
ts.isJSDocAllType = isJSDocAllType;
function isJSDocUnknownType(node) {
- return node.kind === 279;
+ return node.kind === 280;
}
ts.isJSDocUnknownType = isJSDocUnknownType;
function isJSDocNullableType(node) {
- return node.kind === 280;
+ return node.kind === 281;
}
ts.isJSDocNullableType = isJSDocNullableType;
function isJSDocNonNullableType(node) {
- return node.kind === 281;
+ return node.kind === 282;
}
ts.isJSDocNonNullableType = isJSDocNonNullableType;
function isJSDocOptionalType(node) {
- return node.kind === 282;
+ return node.kind === 283;
}
ts.isJSDocOptionalType = isJSDocOptionalType;
function isJSDocFunctionType(node) {
- return node.kind === 283;
+ return node.kind === 284;
}
ts.isJSDocFunctionType = isJSDocFunctionType;
function isJSDocVariadicType(node) {
- return node.kind === 284;
+ return node.kind === 285;
}
ts.isJSDocVariadicType = isJSDocVariadicType;
function isJSDoc(node) {
- return node.kind === 285;
+ return node.kind === 286;
}
ts.isJSDoc = isJSDoc;
function isJSDocAugmentsTag(node) {
- return node.kind === 289;
+ return node.kind === 290;
}
ts.isJSDocAugmentsTag = isJSDocAugmentsTag;
function isJSDocClassTag(node) {
- return node.kind === 290;
+ return node.kind === 291;
}
ts.isJSDocClassTag = isJSDocClassTag;
function isJSDocParameterTag(node) {
- return node.kind === 292;
+ return node.kind === 293;
}
ts.isJSDocParameterTag = isJSDocParameterTag;
function isJSDocReturnTag(node) {
- return node.kind === 293;
+ return node.kind === 294;
}
ts.isJSDocReturnTag = isJSDocReturnTag;
function isJSDocTypeTag(node) {
- return node.kind === 294;
+ return node.kind === 295;
}
ts.isJSDocTypeTag = isJSDocTypeTag;
function isJSDocTemplateTag(node) {
- return node.kind === 295;
+ return node.kind === 296;
}
ts.isJSDocTemplateTag = isJSDocTemplateTag;
function isJSDocTypedefTag(node) {
- return node.kind === 296;
+ return node.kind === 297;
}
ts.isJSDocTypedefTag = isJSDocTypedefTag;
function isJSDocPropertyTag(node) {
- return node.kind === 297;
+ return node.kind === 298;
}
ts.isJSDocPropertyTag = isJSDocPropertyTag;
function isJSDocPropertyLikeTag(node) {
- return node.kind === 297 || node.kind === 292;
+ return node.kind === 298 || node.kind === 293;
}
ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag;
function isJSDocTypeLiteral(node) {
- return node.kind === 286;
+ return node.kind === 287;
}
ts.isJSDocTypeLiteral = isJSDocTypeLiteral;
function isJSDocCallbackTag(node) {
- return node.kind === 291;
+ return node.kind === 292;
}
ts.isJSDocCallbackTag = isJSDocCallbackTag;
function isJSDocSignature(node) {
- return node.kind === 287;
+ return node.kind === 288;
}
ts.isJSDocSignature = isJSDocSignature;
})(ts || (ts = {}));
(function (ts) {
function isSyntaxList(n) {
- return n.kind === 298;
+ return n.kind === 299;
}
ts.isSyntaxList = isSyntaxList;
function isNode(node) {
@@ -12201,11 +12293,11 @@ var ts;
}
ts.isNode = isNode;
function isNodeKind(kind) {
- return kind >= 145;
+ return kind >= 146;
}
ts.isNodeKind = isNodeKind;
function isToken(n) {
- return n.kind >= 0 && n.kind <= 144;
+ return n.kind >= 0 && n.kind <= 145;
}
ts.isToken = isToken;
function isNodeArray(array) {
@@ -12224,6 +12316,10 @@ var ts;
return 13 <= kind && kind <= 16;
}
ts.isTemplateLiteralKind = isTemplateLiteralKind;
+ function isTemplateLiteralToken(node) {
+ return isTemplateLiteralKind(node.kind);
+ }
+ ts.isTemplateLiteralToken = isTemplateLiteralToken;
function isTemplateMiddleOrTemplateTail(node) {
var kind = node.kind;
return kind === 15
@@ -12270,7 +12366,7 @@ var ts;
ts.isModifier = isModifier;
function isEntityName(node) {
var kind = node.kind;
- return kind === 145
+ return kind === 146
|| kind === 71;
}
ts.isEntityName = isEntityName;
@@ -12279,14 +12375,14 @@ var ts;
return kind === 71
|| kind === 9
|| kind === 8
- || kind === 146;
+ || kind === 147;
}
ts.isPropertyName = isPropertyName;
function isBindingName(node) {
var kind = node.kind;
return kind === 71
- || kind === 179
- || kind === 180;
+ || kind === 180
+ || kind === 181;
}
ts.isBindingName = isBindingName;
function isFunctionLike(node) {
@@ -12299,13 +12395,13 @@ var ts;
ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration;
function isFunctionLikeDeclarationKind(kind) {
switch (kind) {
- case 233:
- case 153:
+ case 234:
case 154:
case 155:
case 156:
- case 191:
+ case 157:
case 192:
+ case 193:
return true;
default:
return false;
@@ -12313,14 +12409,14 @@ var ts;
}
function isFunctionLikeKind(kind) {
switch (kind) {
- case 152:
- case 157:
- case 287:
+ case 153:
case 158:
+ case 288:
case 159:
- case 162:
- case 283:
+ case 160:
case 163:
+ case 284:
+ case 164:
return true;
default:
return isFunctionLikeDeclarationKind(kind);
@@ -12333,28 +12429,28 @@ var ts;
ts.isFunctionOrModuleBlock = isFunctionOrModuleBlock;
function isClassElement(node) {
var kind = node.kind;
- return kind === 154
- || kind === 151
- || kind === 153
- || kind === 155
+ return kind === 155
+ || kind === 152
+ || kind === 154
|| kind === 156
- || kind === 159
- || kind === 211;
+ || kind === 157
+ || kind === 160
+ || kind === 212;
}
ts.isClassElement = isClassElement;
function isClassLike(node) {
- return node && (node.kind === 234 || node.kind === 204);
+ return node && (node.kind === 235 || node.kind === 205);
}
ts.isClassLike = isClassLike;
function isAccessor(node) {
- return node && (node.kind === 155 || node.kind === 156);
+ return node && (node.kind === 156 || node.kind === 157);
}
ts.isAccessor = isAccessor;
function isMethodOrAccessor(node) {
switch (node.kind) {
- case 153:
- case 155:
+ case 154:
case 156:
+ case 157:
return true;
default:
return false;
@@ -12363,11 +12459,11 @@ var ts;
ts.isMethodOrAccessor = isMethodOrAccessor;
function isTypeElement(node) {
var kind = node.kind;
- return kind === 158
- || kind === 157
- || kind === 150
- || kind === 152
- || kind === 159;
+ return kind === 159
+ || kind === 158
+ || kind === 151
+ || kind === 153
+ || kind === 160;
}
ts.isTypeElement = isTypeElement;
function isClassOrTypeElement(node) {
@@ -12376,17 +12472,18 @@ var ts;
ts.isClassOrTypeElement = isClassOrTypeElement;
function isObjectLiteralElementLike(node) {
var kind = node.kind;
- return kind === 269
- || kind === 270
+ return kind === 270
|| kind === 271
- || kind === 153
- || kind === 155
- || kind === 156;
+ || kind === 272
+ || kind === 154
+ || kind === 156
+ || kind === 157;
}
ts.isObjectLiteralElementLike = isObjectLiteralElementLike;
function isTypeNodeKind(kind) {
- return (kind >= 160 && kind <= 178)
+ return (kind >= 161 && kind <= 179)
|| kind === 119
+ || kind === 142
|| kind === 134
|| kind === 135
|| kind === 122
@@ -12397,14 +12494,14 @@ var ts;
|| kind === 140
|| kind === 95
|| kind === 131
- || kind === 206
- || kind === 278
+ || kind === 207
|| kind === 279
|| kind === 280
|| kind === 281
|| kind === 282
|| kind === 283
- || kind === 284;
+ || kind === 284
+ || kind === 285;
}
function isTypeNode(node) {
return isTypeNodeKind(node.kind);
@@ -12412,8 +12509,8 @@ var ts;
ts.isTypeNode = isTypeNode;
function isFunctionOrConstructorTypeNode(node) {
switch (node.kind) {
- case 162:
case 163:
+ case 164:
return true;
}
return false;
@@ -12422,29 +12519,29 @@ var ts;
function isBindingPattern(node) {
if (node) {
var kind = node.kind;
- return kind === 180
- || kind === 179;
+ return kind === 181
+ || kind === 180;
}
return false;
}
ts.isBindingPattern = isBindingPattern;
function isAssignmentPattern(node) {
var kind = node.kind;
- return kind === 182
- || kind === 183;
+ return kind === 183
+ || kind === 184;
}
ts.isAssignmentPattern = isAssignmentPattern;
function isArrayBindingElement(node) {
var kind = node.kind;
- return kind === 181
- || kind === 205;
+ return kind === 182
+ || kind === 206;
}
ts.isArrayBindingElement = isArrayBindingElement;
function isDeclarationBindingElement(bindingElement) {
switch (bindingElement.kind) {
- case 231:
- case 148:
- case 181:
+ case 232:
+ case 149:
+ case 182:
return true;
}
return false;
@@ -12457,8 +12554,8 @@ var ts;
ts.isBindingOrAssignmentPattern = isBindingOrAssignmentPattern;
function isObjectBindingOrAssignmentPattern(node) {
switch (node.kind) {
- case 179:
- case 183:
+ case 180:
+ case 184:
return true;
}
return false;
@@ -12466,8 +12563,8 @@ var ts;
ts.isObjectBindingOrAssignmentPattern = isObjectBindingOrAssignmentPattern;
function isArrayBindingOrAssignmentPattern(node) {
switch (node.kind) {
- case 180:
- case 182:
+ case 181:
+ case 183:
return true;
}
return false;
@@ -12475,25 +12572,25 @@ var ts;
ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern;
function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) {
var kind = node.kind;
- return kind === 184
- || kind === 145
- || kind === 178;
+ return kind === 185
+ || kind === 146
+ || kind === 179;
}
ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode;
function isPropertyAccessOrQualifiedName(node) {
var kind = node.kind;
- return kind === 184
- || kind === 145;
+ return kind === 185
+ || kind === 146;
}
ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName;
function isCallLikeExpression(node) {
switch (node.kind) {
+ case 257:
case 256:
- case 255:
- case 186:
case 187:
case 188:
- case 149:
+ case 189:
+ case 150:
return true;
default:
return false;
@@ -12501,12 +12598,12 @@ var ts;
}
ts.isCallLikeExpression = isCallLikeExpression;
function isCallOrNewExpression(node) {
- return node.kind === 186 || node.kind === 187;
+ return node.kind === 187 || node.kind === 188;
}
ts.isCallOrNewExpression = isCallOrNewExpression;
function isTemplateLiteral(node) {
var kind = node.kind;
- return kind === 201
+ return kind === 202
|| kind === 13;
}
ts.isTemplateLiteral = isTemplateLiteral;
@@ -12516,32 +12613,32 @@ var ts;
ts.isLeftHandSideExpression = isLeftHandSideExpression;
function isLeftHandSideExpressionKind(kind) {
switch (kind) {
- case 184:
case 185:
- case 187:
case 186:
- case 254:
- case 255:
- case 258:
case 188:
- case 182:
- case 190:
+ case 187:
+ case 255:
+ case 256:
+ case 259:
+ case 189:
case 183:
- case 204:
case 191:
+ case 184:
+ case 205:
+ case 192:
case 71:
case 12:
case 8:
case 9:
case 13:
- case 201:
+ case 202:
case 86:
case 95:
case 99:
case 101:
case 97:
- case 208:
case 209:
+ case 210:
case 91:
return true;
default:
@@ -12554,13 +12651,13 @@ var ts;
ts.isUnaryExpression = isUnaryExpression;
function isUnaryExpressionKind(kind) {
switch (kind) {
- case 197:
case 198:
- case 193:
+ case 199:
case 194:
case 195:
case 196:
- case 189:
+ case 197:
+ case 190:
return true;
default:
return isLeftHandSideExpressionKind(kind);
@@ -12568,9 +12665,9 @@ var ts;
}
function isUnaryExpressionWithWrite(expr) {
switch (expr.kind) {
- case 198:
+ case 199:
return true;
- case 197:
+ case 198:
return expr.operator === 43 ||
expr.operator === 44;
default:
@@ -12584,15 +12681,15 @@ var ts;
ts.isExpression = isExpression;
function isExpressionKind(kind) {
switch (kind) {
- case 200:
- case 202:
- case 192:
- case 199:
+ case 201:
case 203:
- case 207:
- case 205:
+ case 193:
+ case 200:
+ case 204:
+ case 208:
+ case 206:
+ case 302:
case 301:
- case 300:
return true;
default:
return isUnaryExpressionKind(kind);
@@ -12600,16 +12697,16 @@ var ts;
}
function isAssertionExpression(node) {
var kind = node.kind;
- return kind === 189
- || kind === 207;
+ return kind === 190
+ || kind === 208;
}
ts.isAssertionExpression = isAssertionExpression;
function isPartiallyEmittedExpression(node) {
- return node.kind === 300;
+ return node.kind === 301;
}
ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression;
function isNotEmittedStatement(node) {
- return node.kind === 299;
+ return node.kind === 300;
}
ts.isNotEmittedStatement = isNotEmittedStatement;
function isNotEmittedOrPartiallyEmittedNode(node) {
@@ -12619,20 +12716,20 @@ var ts;
ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode;
function isIterationStatement(node, lookInLabeledStatements) {
switch (node.kind) {
- case 219:
case 220:
case 221:
- case 217:
+ case 222:
case 218:
+ case 219:
return true;
- case 227:
+ case 228:
return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements);
}
return false;
}
ts.isIterationStatement = isIterationStatement;
function isForInOrOfStatement(node) {
- return node.kind === 220 || node.kind === 221;
+ return node.kind === 221 || node.kind === 222;
}
ts.isForInOrOfStatement = isForInOrOfStatement;
function isConciseBody(node) {
@@ -12651,108 +12748,108 @@ var ts;
ts.isForInitializer = isForInitializer;
function isModuleBody(node) {
var kind = node.kind;
- return kind === 239
- || kind === 238
+ return kind === 240
+ || kind === 239
|| kind === 71;
}
ts.isModuleBody = isModuleBody;
function isNamespaceBody(node) {
var kind = node.kind;
- return kind === 239
- || kind === 238;
+ return kind === 240
+ || kind === 239;
}
ts.isNamespaceBody = isNamespaceBody;
function isJSDocNamespaceBody(node) {
var kind = node.kind;
return kind === 71
- || kind === 238;
+ || kind === 239;
}
ts.isJSDocNamespaceBody = isJSDocNamespaceBody;
function isNamedImportBindings(node) {
var kind = node.kind;
- return kind === 246
- || kind === 245;
+ return kind === 247
+ || kind === 246;
}
ts.isNamedImportBindings = isNamedImportBindings;
function isModuleOrEnumDeclaration(node) {
- return node.kind === 238 || node.kind === 237;
+ return node.kind === 239 || node.kind === 238;
}
ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration;
function isDeclarationKind(kind) {
- return kind === 192
- || kind === 181
- || kind === 234
- || kind === 204
- || kind === 154
- || kind === 237
- || kind === 272
- || kind === 251
- || kind === 233
- || kind === 191
- || kind === 155
- || kind === 244
- || kind === 242
- || kind === 247
+ return kind === 193
+ || kind === 182
|| kind === 235
- || kind === 261
- || kind === 153
- || kind === 152
+ || kind === 205
+ || kind === 155
|| kind === 238
- || kind === 241
- || kind === 245
- || kind === 148
- || kind === 269
- || kind === 151
- || kind === 150
- || kind === 156
- || kind === 270
- || kind === 236
- || kind === 147
- || kind === 231
- || kind === 296
- || kind === 291
- || kind === 297;
- }
- function isDeclarationStatementKind(kind) {
- return kind === 233
+ || kind === 273
|| kind === 252
|| kind === 234
+ || kind === 192
+ || kind === 156
+ || kind === 245
+ || kind === 243
+ || kind === 248
+ || kind === 236
+ || kind === 262
+ || kind === 154
+ || kind === 153
+ || kind === 239
+ || kind === 242
+ || kind === 246
+ || kind === 149
+ || kind === 270
+ || kind === 152
+ || kind === 151
+ || kind === 157
+ || kind === 271
+ || kind === 237
+ || kind === 148
+ || kind === 232
+ || kind === 297
+ || kind === 292
+ || kind === 298;
+ }
+ function isDeclarationStatementKind(kind) {
+ return kind === 234
+ || kind === 253
|| kind === 235
|| kind === 236
|| kind === 237
|| kind === 238
+ || kind === 239
+ || kind === 244
|| kind === 243
- || kind === 242
+ || kind === 250
|| kind === 249
- || kind === 248
- || kind === 241;
+ || kind === 242;
}
function isStatementKindButNotDeclarationKind(kind) {
- return kind === 223
- || kind === 222
- || kind === 230
- || kind === 217
- || kind === 215
- || kind === 214
- || kind === 220
- || kind === 221
- || kind === 219
- || kind === 216
- || kind === 227
- || kind === 224
- || kind === 226
- || kind === 228
- || kind === 229
- || kind === 213
+ return kind === 224
+ || kind === 223
+ || kind === 231
|| kind === 218
+ || kind === 216
+ || kind === 215
+ || kind === 221
+ || kind === 222
+ || kind === 220
+ || kind === 217
+ || kind === 228
|| kind === 225
- || kind === 299
- || kind === 303
- || kind === 302;
+ || kind === 227
+ || kind === 229
+ || kind === 230
+ || kind === 214
+ || kind === 219
+ || kind === 226
+ || kind === 300
+ || kind === 304
+ || kind === 303;
}
function isDeclaration(node) {
- if (node.kind === 147) {
- return node.parent.kind !== 295 || ts.isInJavaScriptFile(node);
+ if (node.kind === 148) {
+ return node.parent.kind !== 296 || ts.isInJavaScriptFile(node);
}
return isDeclarationKind(node.kind);
}
@@ -12773,10 +12870,10 @@ var ts;
}
ts.isStatement = isStatement;
function isBlockStatement(node) {
- if (node.kind !== 212)
+ if (node.kind !== 213)
return false;
if (node.parent !== undefined) {
- if (node.parent.kind === 229 || node.parent.kind === 268) {
+ if (node.parent.kind === 230 || node.parent.kind === 269) {
return false;
}
}
@@ -12784,8 +12881,8 @@ var ts;
}
function isModuleReference(node) {
var kind = node.kind;
- return kind === 253
- || kind === 145
+ return kind === 254
+ || kind === 146
|| kind === 71;
}
ts.isModuleReference = isModuleReference;
@@ -12793,64 +12890,65 @@ var ts;
var kind = node.kind;
return kind === 99
|| kind === 71
- || kind === 184;
+ || kind === 185;
}
ts.isJsxTagNameExpression = isJsxTagNameExpression;
function isJsxChild(node) {
var kind = node.kind;
- return kind === 254
- || kind === 264
- || kind === 255
+ return kind === 255
+ || kind === 265
+ || kind === 256
|| kind === 10
- || kind === 258;
+ || kind === 259;
}
ts.isJsxChild = isJsxChild;
function isJsxAttributeLike(node) {
var kind = node.kind;
- return kind === 261
- || kind === 263;
+ return kind === 262
+ || kind === 264;
}
ts.isJsxAttributeLike = isJsxAttributeLike;
function isStringLiteralOrJsxExpression(node) {
var kind = node.kind;
return kind === 9
- || kind === 264;
+ || kind === 265;
}
ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression;
function isJsxOpeningLikeElement(node) {
var kind = node.kind;
- return kind === 256
- || kind === 255;
+ return kind === 257
+ || kind === 256;
}
ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement;
function isCaseOrDefaultClause(node) {
var kind = node.kind;
- return kind === 265
- || kind === 266;
+ return kind === 266
+ || kind === 267;
}
ts.isCaseOrDefaultClause = isCaseOrDefaultClause;
function isJSDocNode(node) {
- return node.kind >= 277 && node.kind <= 297;
+ return node.kind >= 278 && node.kind <= 298;
}
ts.isJSDocNode = isJSDocNode;
function isJSDocCommentContainingNode(node) {
- return node.kind === 285 || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node);
+ return node.kind === 286 || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node);
}
ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode;
function isJSDocTag(node) {
- return node.kind >= 288 && node.kind <= 297;
+ return node.kind >= 289 && node.kind <= 298;
}
ts.isJSDocTag = isJSDocTag;
function isSetAccessor(node) {
- return node.kind === 156;
+ return node.kind === 157;
}
ts.isSetAccessor = isSetAccessor;
function isGetAccessor(node) {
- return node.kind === 155;
+ return node.kind === 156;
}
ts.isGetAccessor = isGetAccessor;
function hasJSDocNodes(node) {
- return !!node.jsDoc && node.jsDoc.length > 0;
+ var jsDoc = node.jsDoc;
+ return !!jsDoc && jsDoc.length > 0;
}
ts.hasJSDocNodes = hasJSDocNodes;
function hasType(node) {
@@ -12859,8 +12957,7 @@ var ts;
ts.hasType = hasType;
function couldHaveType(node) {
switch (node.kind) {
- case 148:
- case 150:
+ case 149:
case 151:
case 152:
case 153:
@@ -12871,24 +12968,25 @@ var ts;
case 158:
case 159:
case 160:
- case 162:
+ case 161:
case 163:
- case 172:
- case 174:
- case 176:
- case 189:
- case 191:
+ case 164:
+ case 173:
+ case 175:
+ case 177:
+ case 190:
case 192:
- case 207:
- case 231:
- case 233:
- case 236:
- case 277:
- case 280:
+ case 193:
+ case 208:
+ case 232:
+ case 234:
+ case 237:
+ case 278:
case 281:
case 282:
case 283:
case 284:
+ case 285:
return true;
}
return false;
@@ -12904,13 +13002,13 @@ var ts;
ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer;
function isObjectLiteralElement(node) {
switch (node.kind) {
- case 261:
- case 263:
- case 269:
+ case 262:
+ case 264:
case 270:
- case 153:
- case 155:
+ case 271:
+ case 154:
case 156:
+ case 157:
return true;
default:
return false;
@@ -12918,7 +13016,7 @@ var ts;
}
ts.isObjectLiteralElement = isObjectLiteralElement;
function isTypeReferenceType(node) {
- return node.kind === 161 || node.kind === 206;
+ return node.kind === 162 || node.kind === 207;
}
ts.isTypeReferenceType = isTypeReferenceType;
var MAX_SMI_X86 = 1073741823;
@@ -12950,7 +13048,7 @@ var ts;
}
ts.isStringLiteralLike = isStringLiteralLike;
function isNamedImportsOrExports(node) {
- return node.kind === 246 || node.kind === 250;
+ return node.kind === 247 || node.kind === 251;
}
ts.isNamedImportsOrExports = isNamedImportsOrExports;
})(ts || (ts = {}));
@@ -12971,7 +13069,7 @@ var ts;
var IdentifierConstructor;
var SourceFileConstructor;
function createNode(kind, pos, end) {
- if (kind === 273) {
+ if (kind === 274) {
return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end);
}
else if (kind === 71) {
@@ -13009,28 +13107,28 @@ var ts;
}
ts.isJSDocLikeText = isJSDocLikeText;
function forEachChild(node, cbNode, cbNodes) {
- if (!node || node.kind <= 144) {
+ if (!node || node.kind <= 145) {
return;
}
switch (node.kind) {
- case 145:
+ case 146:
return visitNode(cbNode, node.left) ||
visitNode(cbNode, node.right);
- case 147:
+ case 148:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.constraint) ||
visitNode(cbNode, node.default) ||
visitNode(cbNode, node.expression);
- case 270:
+ case 271:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.equalsToken) ||
visitNode(cbNode, node.objectAssignmentInitializer);
- case 271:
+ case 272:
return visitNode(cbNode, node.expression);
- case 148:
+ case 149:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.dotDotDotToken) ||
@@ -13038,59 +13136,59 @@ var ts;
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.initializer);
+ case 152:
+ return visitNodes(cbNode, cbNodes, node.decorators) ||
+ visitNodes(cbNode, cbNodes, node.modifiers) ||
+ visitNode(cbNode, node.name) ||
+ visitNode(cbNode, node.questionToken) ||
+ visitNode(cbNode, node.exclamationToken) ||
+ visitNode(cbNode, node.type) ||
+ visitNode(cbNode, node.initializer);
case 151:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.questionToken) ||
- visitNode(cbNode, node.exclamationToken) ||
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.initializer);
- case 150:
- 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 269:
+ case 270:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.initializer);
- case 231:
+ case 232:
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 181:
+ case 182:
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 162:
case 163:
- case 157:
+ case 164:
case 158:
case 159:
+ case 160:
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 153:
- case 152:
case 154:
+ case 153:
case 155:
case 156:
- case 191:
- case 233:
+ case 157:
case 192:
+ case 234:
+ case 193:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.asteriskToken) ||
@@ -13101,187 +13199,180 @@ var ts;
visitNode(cbNode, node.type) ||
visitNode(cbNode, node.equalsGreaterThanToken) ||
visitNode(cbNode, node.body);
- case 161:
+ case 162:
return visitNode(cbNode, node.typeName) ||
visitNodes(cbNode, cbNodes, node.typeArguments);
- case 160:
+ case 161:
return visitNode(cbNode, node.parameterName) ||
visitNode(cbNode, node.type);
- case 164:
- return visitNode(cbNode, node.exprName);
case 165:
- return visitNodes(cbNode, cbNodes, node.members);
+ return visitNode(cbNode, node.exprName);
case 166:
- return visitNode(cbNode, node.elementType);
+ return visitNodes(cbNode, cbNodes, node.members);
case 167:
- return visitNodes(cbNode, cbNodes, node.elementTypes);
+ return visitNode(cbNode, node.elementType);
case 168:
+ return visitNodes(cbNode, cbNodes, node.elementTypes);
case 169:
- return visitNodes(cbNode, cbNodes, node.types);
case 170:
+ return visitNodes(cbNode, cbNodes, node.types);
+ case 171:
return visitNode(cbNode, node.checkType) ||
visitNode(cbNode, node.extendsType) ||
visitNode(cbNode, node.trueType) ||
visitNode(cbNode, node.falseType);
- case 171:
+ case 172:
return visitNode(cbNode, node.typeParameter);
- case 178:
+ case 179:
return visitNode(cbNode, node.argument) ||
visitNode(cbNode, node.qualifier) ||
visitNodes(cbNode, cbNodes, node.typeArguments);
- case 172:
- case 174:
- return visitNode(cbNode, node.type);
+ case 173:
case 175:
+ return visitNode(cbNode, node.type);
+ case 176:
return visitNode(cbNode, node.objectType) ||
visitNode(cbNode, node.indexType);
- case 176:
+ case 177:
return visitNode(cbNode, node.readonlyToken) ||
visitNode(cbNode, node.typeParameter) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.type);
- case 177:
+ case 178:
return visitNode(cbNode, node.literal);
- case 179:
case 180:
- return visitNodes(cbNode, cbNodes, node.elements);
- case 182:
+ case 181:
return visitNodes(cbNode, cbNodes, node.elements);
case 183:
- return visitNodes(cbNode, cbNodes, node.properties);
+ return visitNodes(cbNode, cbNodes, node.elements);
case 184:
- return visitNode(cbNode, node.expression) ||
- visitNode(cbNode, node.name);
+ return visitNodes(cbNode, cbNodes, node.properties);
case 185:
return visitNode(cbNode, node.expression) ||
- visitNode(cbNode, node.argumentExpression);
+ visitNode(cbNode, node.name);
case 186:
+ return visitNode(cbNode, node.expression) ||
+ visitNode(cbNode, node.argumentExpression);
case 187:
+ case 188:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNode, cbNodes, node.typeArguments) ||
visitNodes(cbNode, cbNodes, node.arguments);
- case 188:
+ case 189:
return visitNode(cbNode, node.tag) ||
visitNodes(cbNode, cbNodes, node.typeArguments) ||
visitNode(cbNode, node.template);
- case 189:
+ case 190:
return visitNode(cbNode, node.type) ||
visitNode(cbNode, node.expression);
- case 190:
- return visitNode(cbNode, node.expression);
- case 193:
+ case 191:
return visitNode(cbNode, node.expression);
case 194:
return visitNode(cbNode, node.expression);
case 195:
return visitNode(cbNode, node.expression);
- case 197:
- return visitNode(cbNode, node.operand);
- case 202:
- return visitNode(cbNode, node.asteriskToken) ||
- visitNode(cbNode, node.expression);
case 196:
return visitNode(cbNode, node.expression);
case 198:
return visitNode(cbNode, node.operand);
+ case 203:
+ return visitNode(cbNode, node.asteriskToken) ||
+ visitNode(cbNode, node.expression);
+ case 197:
+ return visitNode(cbNode, node.expression);
case 199:
+ return visitNode(cbNode, node.operand);
+ case 200:
return visitNode(cbNode, node.left) ||
visitNode(cbNode, node.operatorToken) ||
visitNode(cbNode, node.right);
- case 207:
+ case 208:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.type);
- case 208:
- return visitNode(cbNode, node.expression);
case 209:
+ return visitNode(cbNode, node.expression);
+ case 210:
return visitNode(cbNode, node.name);
- case 200:
+ case 201:
return visitNode(cbNode, node.condition) ||
visitNode(cbNode, node.questionToken) ||
visitNode(cbNode, node.whenTrue) ||
visitNode(cbNode, node.colonToken) ||
visitNode(cbNode, node.whenFalse);
- case 203:
+ case 204:
return visitNode(cbNode, node.expression);
- case 212:
- case 239:
+ case 213:
+ case 240:
return visitNodes(cbNode, cbNodes, node.statements);
- case 273:
+ case 274:
return visitNodes(cbNode, cbNodes, node.statements) ||
visitNode(cbNode, node.endOfFileToken);
- case 213:
+ case 214:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.declarationList);
- case 232:
+ case 233:
return visitNodes(cbNode, cbNodes, node.declarations);
- case 215:
- return visitNode(cbNode, node.expression);
case 216:
+ return visitNode(cbNode, node.expression);
+ case 217:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.thenStatement) ||
visitNode(cbNode, node.elseStatement);
- case 217:
+ case 218:
return visitNode(cbNode, node.statement) ||
visitNode(cbNode, node.expression);
- case 218:
+ case 219:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
- case 219:
+ case 220:
return visitNode(cbNode, node.initializer) ||
visitNode(cbNode, node.condition) ||
visitNode(cbNode, node.incrementor) ||
visitNode(cbNode, node.statement);
- case 220:
+ case 221:
return visitNode(cbNode, node.initializer) ||
visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
- case 221:
+ case 222:
return visitNode(cbNode, node.awaitModifier) ||
visitNode(cbNode, node.initializer) ||
visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.statement);
- case 222:
case 223:
- return visitNode(cbNode, node.label);
case 224:
- return visitNode(cbNode, node.expression);
+ return visitNode(cbNode, node.label);
case 225:
- return visitNode(cbNode, node.expression) ||
- visitNode(cbNode, node.statement);
+ return visitNode(cbNode, node.expression);
case 226:
+ return visitNode(cbNode, node.expression) ||
+ visitNode(cbNode, node.statement);
+ case 227:
return visitNode(cbNode, node.expression) ||
visitNode(cbNode, node.caseBlock);
- case 240:
+ case 241:
return visitNodes(cbNode, cbNodes, node.clauses);
- case 265:
+ case 266:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNode, cbNodes, node.statements);
- case 266:
+ case 267:
return visitNodes(cbNode, cbNodes, node.statements);
- case 227:
+ case 228:
return visitNode(cbNode, node.label) ||
visitNode(cbNode, node.statement);
- case 228:
- return visitNode(cbNode, node.expression);
case 229:
+ return visitNode(cbNode, node.expression);
+ case 230:
return visitNode(cbNode, node.tryBlock) ||
visitNode(cbNode, node.catchClause) ||
visitNode(cbNode, node.finallyBlock);
- case 268:
+ case 269:
return visitNode(cbNode, node.variableDeclaration) ||
visitNode(cbNode, node.block);
- case 149:
+ case 150:
return visitNode(cbNode, node.expression);
- case 234:
- case 204:
- 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 235:
+ case 205:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
@@ -13293,112 +13384,119 @@ var ts;
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNodes(cbNode, cbNodes, node.typeParameters) ||
- visitNode(cbNode, node.type);
+ visitNodes(cbNode, cbNodes, node.heritageClauses) ||
+ visitNodes(cbNode, cbNodes, node.members);
case 237:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
- visitNodes(cbNode, cbNodes, node.members);
- case 272:
- return visitNode(cbNode, node.name) ||
- visitNode(cbNode, node.initializer);
+ visitNodes(cbNode, cbNodes, node.typeParameters) ||
+ visitNode(cbNode, node.type);
case 238:
+ return visitNodes(cbNode, cbNodes, node.decorators) ||
+ visitNodes(cbNode, cbNodes, node.modifiers) ||
+ visitNode(cbNode, node.name) ||
+ visitNodes(cbNode, cbNodes, node.members);
+ case 273:
+ return visitNode(cbNode, node.name) ||
+ visitNode(cbNode, node.initializer);
+ case 239:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.body);
- case 242:
+ case 243:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.name) ||
visitNode(cbNode, node.moduleReference);
- case 243:
+ case 244:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.importClause) ||
visitNode(cbNode, node.moduleSpecifier);
- case 244:
+ case 245:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.namedBindings);
- case 241:
- return visitNode(cbNode, node.name);
- case 245:
+ case 242:
return visitNode(cbNode, node.name);
case 246:
- case 250:
+ return visitNode(cbNode, node.name);
+ case 247:
+ case 251:
return visitNodes(cbNode, cbNodes, node.elements);
- case 249:
+ case 250:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.exportClause) ||
visitNode(cbNode, node.moduleSpecifier);
- case 247:
- case 251:
+ case 248:
+ case 252:
return visitNode(cbNode, node.propertyName) ||
visitNode(cbNode, node.name);
- case 248:
+ case 249:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, node.expression);
- case 201:
+ case 202:
return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans);
- case 210:
+ case 211:
return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal);
- case 146:
+ case 147:
return visitNode(cbNode, node.expression);
- case 267:
+ case 268:
return visitNodes(cbNode, cbNodes, node.types);
- case 206:
+ case 207:
return visitNode(cbNode, node.expression) ||
visitNodes(cbNode, cbNodes, node.typeArguments);
- case 253:
- return visitNode(cbNode, node.expression);
- case 252:
- return visitNodes(cbNode, cbNodes, node.decorators);
- case 301:
- return visitNodes(cbNode, cbNodes, node.elements);
case 254:
+ return visitNode(cbNode, node.expression);
+ case 253:
+ return visitNodes(cbNode, cbNodes, node.decorators);
+ case 302:
+ return visitNodes(cbNode, cbNodes, node.elements);
+ case 255:
return visitNode(cbNode, node.openingElement) ||
visitNodes(cbNode, cbNodes, node.children) ||
visitNode(cbNode, node.closingElement);
- case 258:
+ case 259:
return visitNode(cbNode, node.openingFragment) ||
visitNodes(cbNode, cbNodes, node.children) ||
visitNode(cbNode, node.closingFragment);
- case 255:
case 256:
+ case 257:
return visitNode(cbNode, node.tagName) ||
visitNodes(cbNode, cbNodes, node.typeArguments) ||
visitNode(cbNode, node.attributes);
- case 262:
+ case 263:
return visitNodes(cbNode, cbNodes, node.properties);
- case 261:
+ case 262:
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.initializer);
- case 263:
- return visitNode(cbNode, node.expression);
case 264:
+ return visitNode(cbNode, node.expression);
+ case 265:
return visitNode(cbNode, node.dotDotDotToken) ||
visitNode(cbNode, node.expression);
- case 257:
+ case 258:
return visitNode(cbNode, node.tagName);
- case 277:
- return visitNode(cbNode, node.type);
- case 281:
- return visitNode(cbNode, node.type);
- case 280:
+ case 278:
return visitNode(cbNode, node.type);
case 282:
return visitNode(cbNode, node.type);
+ case 281:
+ return visitNode(cbNode, node.type);
case 283:
+ return visitNode(cbNode, node.type);
+ case 284:
return visitNodes(cbNode, cbNodes, node.parameters) ||
visitNode(cbNode, node.type);
- case 284:
- return visitNode(cbNode, node.type);
case 285:
+ return visitNode(cbNode, node.type);
+ case 286:
return visitNodes(cbNode, cbNodes, node.tags);
- case 292:
- case 297:
+ case 293:
+ case 298:
if (node.isNameFirst) {
return visitNode(cbNode, node.name) ||
visitNode(cbNode, node.typeExpression);
@@ -13407,17 +13505,17 @@ var ts;
return visitNode(cbNode, node.typeExpression) ||
visitNode(cbNode, node.name);
}
- case 293:
- return visitNode(cbNode, node.typeExpression);
case 294:
return visitNode(cbNode, node.typeExpression);
- case 289:
- return visitNode(cbNode, node.class);
case 295:
- return visitNodes(cbNode, cbNodes, node.typeParameters);
+ return visitNode(cbNode, node.typeExpression);
+ case 290:
+ return visitNode(cbNode, node.class);
case 296:
+ return visitNodes(cbNode, cbNodes, node.typeParameters);
+ case 297:
if (node.typeExpression &&
- node.typeExpression.kind === 277) {
+ node.typeExpression.kind === 278) {
return visitNode(cbNode, node.typeExpression) ||
visitNode(cbNode, node.fullName);
}
@@ -13425,16 +13523,16 @@ var ts;
return visitNode(cbNode, node.fullName) ||
visitNode(cbNode, node.typeExpression);
}
- case 291:
+ case 292:
return visitNode(cbNode, node.fullName) ||
visitNode(cbNode, node.typeExpression);
- case 287:
+ case 288:
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 286:
+ case 287:
if (node.jsDocPropertyTags) {
for (var _i = 0, _a = node.jsDocPropertyTags; _i < _a.length; _i++) {
var tag = _a[_i];
@@ -13442,7 +13540,7 @@ var ts;
}
}
return;
- case 300:
+ case 301:
return visitNode(cbNode, node.expression);
}
}
@@ -13475,6 +13573,7 @@ var ts;
}
ts.isExternalModule = isExternalModule;
function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) {
+ if (aggressiveChecks === void 0) { aggressiveChecks = false; }
var newSourceFile = IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
newSourceFile.flags |= (sourceFile.flags & 1572864);
return newSourceFile;
@@ -13512,6 +13611,7 @@ var ts;
var contextFlags;
var parseErrorBeforeNextFinishedNode = false;
function parseSourceFile(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes, scriptKind) {
+ if (setParentNodes === void 0) { setParentNodes = false; }
scriptKind = ts.ensureScriptKind(fileName, scriptKind);
if (scriptKind === 6) {
var result_1 = parseJsonText(fileName, sourceText, languageVersion, syntaxCursor, setParentNodes);
@@ -13539,6 +13639,7 @@ var ts;
if (languageVersion === void 0) { languageVersion = 2; }
initializeState(sourceText, languageVersion, syntaxCursor, 6);
sourceFile = createSourceFile(fileName, 2, 6, false);
+ sourceFile.flags = contextFlags;
nextToken();
var pos = getNodePos();
if (token() === 1) {
@@ -13546,7 +13647,7 @@ var ts;
sourceFile.endOfFileToken = parseTokenNode();
}
else {
- var statement = createNode(215);
+ var statement = createNode(216);
switch (token()) {
case 21:
statement.expression = parseArrayLiteralExpression();
@@ -13689,10 +13790,11 @@ var ts;
}
Parser.fixupParentReferences = fixupParentReferences;
function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) {
- var sourceFile = new SourceFileConstructor(273, 0, sourceText.length);
+ var sourceFile = new SourceFileConstructor(274, 0, sourceText.length);
nodeCount++;
sourceFile.text = sourceText;
sourceFile.bindDiagnostics = [];
+ sourceFile.bindSuggestionDiagnostics = undefined;
sourceFile.languageVersion = languageVersion;
sourceFile.fileName = ts.normalizePath(fileName);
sourceFile.languageVariant = getLanguageVariant(scriptKind);
@@ -14006,7 +14108,7 @@ var ts;
return parsePropertyNameWorker(true);
}
function parseComputedPropertyName() {
- var node = createNode(146);
+ var node = createNode(147);
parseExpected(21);
node.expression = allowInAnd(parseExpression);
parseExpected(22);
@@ -14120,7 +14222,7 @@ var ts;
case 14:
return true;
}
- ts.Debug.fail("Non-exhaustive case in 'isListElement'.");
+ return ts.Debug.fail("Non-exhaustive case in 'isListElement'.");
}
function isValidHeritageClauseObjectLiteral() {
ts.Debug.assert(token() === 17);
@@ -14196,6 +14298,8 @@ var ts;
return token() === 29 || token() === 41;
case 14:
return token() === 27 && lookAhead(nextTokenIsSlash);
+ default:
+ return false;
}
}
function isVariableDeclaratorListTerminator() {
@@ -14314,14 +14418,14 @@ var ts;
function isReusableClassMember(node) {
if (node) {
switch (node.kind) {
- case 154:
- case 159:
case 155:
+ case 160:
case 156:
- case 151:
- case 211:
+ case 157:
+ case 152:
+ case 212:
return true;
- case 153:
+ case 154:
var methodDeclaration = node;
var nameIsConstructor = methodDeclaration.name.kind === 71 &&
methodDeclaration.name.originalKeywordKind === 123;
@@ -14333,8 +14437,8 @@ var ts;
function isReusableSwitchClause(node) {
if (node) {
switch (node.kind) {
- case 265:
case 266:
+ case 267:
return true;
}
}
@@ -14343,65 +14447,65 @@ var ts;
function isReusableStatement(node) {
if (node) {
switch (node.kind) {
- case 233:
+ case 234:
+ case 214:
case 213:
- case 212:
+ case 217:
case 216:
- case 215:
- case 228:
+ case 229:
+ case 225:
+ case 227:
case 224:
- case 226:
case 223:
+ case 221:
case 222:
case 220:
- case 221:
case 219:
- case 218:
- case 225:
- case 214:
- case 229:
- case 227:
- case 217:
+ case 226:
+ case 215:
case 230:
+ case 228:
+ case 218:
+ case 231:
+ case 244:
case 243:
- case 242:
+ case 250:
case 249:
- case 248:
- case 238:
- case 234:
+ case 239:
case 235:
- case 237:
case 236:
+ case 238:
+ case 237:
return true;
}
}
return false;
}
function isReusableEnumMember(node) {
- return node.kind === 272;
+ return node.kind === 273;
}
function isReusableTypeMember(node) {
if (node) {
switch (node.kind) {
- case 158:
- case 152:
case 159:
- case 150:
- case 157:
+ case 153:
+ case 160:
+ case 151:
+ case 158:
return true;
}
}
return false;
}
function isReusableVariableDeclaration(node) {
- if (node.kind !== 231) {
+ if (node.kind !== 232) {
return false;
}
var variableDeclarator = node;
return variableDeclarator.initializer === undefined;
}
function isReusableParameter(node) {
- if (node.kind !== 148) {
+ if (node.kind !== 149) {
return false;
}
var parameter = node;
@@ -14440,6 +14544,7 @@ var ts;
case 22: return ts.Diagnostics.Identifier_expected;
case 13: return ts.Diagnostics.Identifier_expected;
case 14: return ts.Diagnostics.Identifier_expected;
+ default: return undefined;
}
}
function parseDelimitedList(kind, parseElement, considerSemicolonAsDelimiter) {
@@ -14508,7 +14613,7 @@ var ts;
return entity;
}
function createQualifiedName(entity, name) {
- var node = createNode(145, entity.pos);
+ var node = createNode(146, entity.pos);
node.left = entity;
node.right = name;
return finishNode(node);
@@ -14523,19 +14628,19 @@ var ts;
return allowIdentifierNames ? parseIdentifierName() : parseIdentifier();
}
function parseTemplateExpression() {
- var template = createNode(201);
+ var template = createNode(202);
template.head = parseTemplateHead();
ts.Debug.assert(template.head.kind === 14, "Template head has wrong token kind");
var list = [];
var listPos = getNodePos();
do {
list.push(parseTemplateSpan());
- } while (ts.lastOrUndefined(list).literal.kind === 15);
+ } while (ts.last(list).literal.kind === 15);
template.templateSpans = createNodeArray(list, listPos);
return finishNode(template);
}
function parseTemplateSpan() {
- var span = createNode(210);
+ var span = createNode(211);
span.expression = allowInAnd(parseExpression);
var literal;
if (token() === 18) {
@@ -14579,7 +14684,7 @@ var ts;
return node;
}
function parseTypeReference() {
- var node = createNode(161);
+ var node = createNode(162);
node.typeName = parseEntityName(true, ts.Diagnostics.Type_expected);
if (!scanner.hasPrecedingLineBreak() && token() === 27) {
node.typeArguments = parseBracketedList(19, parseType, 27, 29);
@@ -14588,20 +14693,20 @@ var ts;
}
function parseThisTypePredicate(lhs) {
nextToken();
- var node = createNode(160, lhs.pos);
+ var node = createNode(161, lhs.pos);
node.parameterName = lhs;
node.type = parseType();
return finishNode(node);
}
function parseThisTypeNode() {
- var node = createNode(173);
+ var node = createNode(174);
nextToken();
return finishNode(node);
}
function parseJSDocAllType(postFixEquals) {
- var result = createNode(278);
+ var result = createNode(279);
if (postFixEquals) {
- return createJSDocPostfixType(282, result);
+ return createJSDocPostfixType(283, result);
}
else {
nextToken();
@@ -14609,7 +14714,7 @@ var ts;
return finishNode(result);
}
function parseJSDocNonNullableType() {
- var result = createNode(281);
+ var result = createNode(282);
nextToken();
result.type = parseNonArrayType();
return finishNode(result);
@@ -14623,28 +14728,28 @@ var ts;
token() === 29 ||
token() === 58 ||
token() === 49) {
- var result = createNode(279, pos);
+ var result = createNode(280, pos);
return finishNode(result);
}
else {
- var result = createNode(280, pos);
+ var result = createNode(281, pos);
result.type = parseType();
return finishNode(result);
}
}
function parseJSDocFunctionType() {
if (lookAhead(nextTokenIsOpenParen)) {
- var result = createNodeWithJSDoc(283);
+ var result = createNodeWithJSDoc(284);
nextToken();
fillSignature(56, 4 | 32, result);
return finishNode(result);
}
- var node = createNode(161);
+ var node = createNode(162);
node.typeName = parseIdentifierName();
return finishNode(node);
}
function parseJSDocParameter() {
- var parameter = createNode(148);
+ var parameter = createNode(149);
if (token() === 99 || token() === 94) {
parameter.name = parseIdentifierName();
parseExpected(56);
@@ -14656,23 +14761,23 @@ var ts;
var dotdotdot = parseOptionalToken(24);
var type = parseType();
if (dotdotdot) {
- var variadic = createNode(284, dotdotdot.pos);
+ var variadic = createNode(285, dotdotdot.pos);
variadic.type = type;
type = finishNode(variadic);
}
if (token() === 58) {
- return createJSDocPostfixType(282, type);
+ return createJSDocPostfixType(283, type);
}
return type;
}
function parseTypeQuery() {
- var node = createNode(164);
+ var node = createNode(165);
parseExpected(103);
node.exprName = parseEntityName(true);
return finishNode(node);
}
function parseTypeParameter() {
- var node = createNode(147);
+ var node = createNode(148);
node.name = parseIdentifier();
if (parseOptional(85)) {
if (isStartOfType() || !isStartOfExpression()) {
@@ -14706,7 +14811,7 @@ var ts;
isStartOfType(true);
}
function parseParameter() {
- var node = createNodeWithJSDoc(148);
+ var node = createNodeWithJSDoc(149);
if (token() === 99) {
node.name = createIdentifier(true);
node.type = parseParameterType();
@@ -14774,7 +14879,7 @@ var ts;
}
function parseSignatureMember(kind) {
var node = createNodeWithJSDoc(kind);
- if (kind === 158) {
+ if (kind === 159) {
parseExpected(94);
}
fillSignature(56, 4, node);
@@ -14811,7 +14916,7 @@ var ts;
return token() === 56 || token() === 26 || token() === 22;
}
function parseIndexSignatureDeclaration(node) {
- node.kind = 159;
+ node.kind = 160;
node.parameters = parseBracketedList(16, parseParameter, 21, 22);
node.type = parseTypeAnnotation();
parseTypeMemberSemicolon();
@@ -14821,11 +14926,11 @@ var ts;
node.name = parsePropertyName();
node.questionToken = parseOptionalToken(55);
if (token() === 19 || token() === 27) {
- node.kind = 152;
+ node.kind = 153;
fillSignature(56, 4, node);
}
else {
- node.kind = 150;
+ node.kind = 151;
node.type = parseTypeAnnotation();
if (token() === 58) {
node.initializer = parseInitializer();
@@ -14838,7 +14943,7 @@ var ts;
if (token() === 19 || token() === 27) {
return true;
}
- var idToken;
+ var idToken = false;
while (ts.isModifierKind(token())) {
idToken = true;
nextToken();
@@ -14862,10 +14967,10 @@ var ts;
}
function parseTypeMember() {
if (token() === 19 || token() === 27) {
- return parseSignatureMember(157);
+ return parseSignatureMember(158);
}
if (token() === 94 && lookAhead(nextTokenIsOpenParenOrLessThan)) {
- return parseSignatureMember(158);
+ return parseSignatureMember(159);
}
var node = createNodeWithJSDoc(0);
node.modifiers = parseModifiers();
@@ -14891,7 +14996,7 @@ var ts;
return false;
}
function parseTypeLiteral() {
- var node = createNode(165);
+ var node = createNode(166);
node.members = parseObjectTypeMembers();
return finishNode(node);
}
@@ -14917,14 +15022,14 @@ var ts;
return token() === 21 && nextTokenIsIdentifier() && nextToken() === 92;
}
function parseMappedTypeParameter() {
- var node = createNode(147);
+ var node = createNode(148);
node.name = parseIdentifier();
parseExpected(92);
node.constraint = parseType();
return finishNode(node);
}
function parseMappedType() {
- var node = createNode(176);
+ var node = createNode(177);
parseExpected(17);
if (token() === 132 || token() === 37 || token() === 38) {
node.readonlyToken = parseTokenNode();
@@ -14947,12 +15052,12 @@ var ts;
return finishNode(node);
}
function parseTupleType() {
- var node = createNode(167);
+ var node = createNode(168);
node.elementTypes = parseBracketedList(20, parseType, 21, 22);
return finishNode(node);
}
function parseParenthesizedType() {
- var node = createNode(172);
+ var node = createNode(173);
parseExpected(19);
node.type = parseType();
if (!node.type) {
@@ -14963,7 +15068,7 @@ var ts;
}
function parseFunctionOrConstructorType(kind) {
var node = createNodeWithJSDoc(kind);
- if (kind === 163) {
+ if (kind === 164) {
parseExpected(94);
}
if (!fillSignature(36, 4 | (sourceFile.languageVariant === 1 ? 8 : 0), node)) {
@@ -14979,10 +15084,10 @@ var ts;
return token() === 23 ? undefined : node;
}
function parseLiteralTypeNode(negative) {
- var node = createNode(177);
+ var node = createNode(178);
var unaryMinusExpression;
if (negative) {
- unaryMinusExpression = createNode(197);
+ unaryMinusExpression = createNode(198);
unaryMinusExpression.operator = 38;
nextToken();
}
@@ -15003,7 +15108,7 @@ var ts;
}
function parseImportType() {
sourceFile.flags |= 524288;
- var node = createNode(178);
+ var node = createNode(179);
if (parseOptional(103)) {
node.isTypeOf = true;
}
@@ -15023,6 +15128,7 @@ var ts;
function parseNonArrayType() {
switch (token()) {
case 119:
+ case 142:
case 137:
case 134:
case 138:
@@ -15078,6 +15184,7 @@ var ts;
function isStartOfType(inStartOfParameter) {
switch (token()) {
case 119:
+ case 142:
case 137:
case 134:
case 122:
@@ -15124,25 +15231,25 @@ var ts;
while (!scanner.hasPrecedingLineBreak()) {
switch (token()) {
case 51:
- type = createJSDocPostfixType(281, type);
+ type = createJSDocPostfixType(282, type);
break;
case 55:
if (!(contextFlags & 2097152) && lookAhead(nextTokenIsStartOfType)) {
return type;
}
- type = createJSDocPostfixType(280, type);
+ type = createJSDocPostfixType(281, type);
break;
case 21:
parseExpected(21);
if (isStartOfType()) {
- var node = createNode(175, type.pos);
+ var node = createNode(176, type.pos);
node.objectType = type;
node.indexType = parseType();
parseExpected(22);
type = finishNode(node);
}
else {
- var node = createNode(166, type.pos);
+ var node = createNode(167, type.pos);
node.elementType = type;
parseExpected(22);
type = finishNode(node);
@@ -15161,16 +15268,16 @@ var ts;
return finishNode(postfix);
}
function parseTypeOperator(operator) {
- var node = createNode(174);
+ var node = createNode(175);
parseExpected(operator);
node.operator = operator;
node.type = parseTypeOperatorOrHigher();
return finishNode(node);
}
function parseInferType() {
- var node = createNode(171);
+ var node = createNode(172);
parseExpected(126);
- var typeParameter = createNode(147);
+ var typeParameter = createNode(148);
typeParameter.name = parseIdentifier();
node.typeParameter = finishNode(typeParameter);
return finishNode(node);
@@ -15201,10 +15308,10 @@ var ts;
return type;
}
function parseIntersectionTypeOrHigher() {
- return parseUnionOrIntersectionType(169, parseTypeOperatorOrHigher, 48);
+ return parseUnionOrIntersectionType(170, parseTypeOperatorOrHigher, 48);
}
function parseUnionTypeOrHigher() {
- return parseUnionOrIntersectionType(168, parseIntersectionTypeOrHigher, 49);
+ return parseUnionOrIntersectionType(169, parseIntersectionTypeOrHigher, 49);
}
function isStartOfFunctionType() {
if (token() === 27) {
@@ -15250,7 +15357,7 @@ var ts;
var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix);
var type = parseType();
if (typePredicateVariable) {
- var node = createNode(160, typePredicateVariable.pos);
+ var node = createNode(161, typePredicateVariable.pos);
node.parameterName = typePredicateVariable;
node.type = type;
return finishNode(node);
@@ -15271,14 +15378,14 @@ var ts;
}
function parseTypeWorker(noConditionalTypes) {
if (isStartOfFunctionType()) {
- return parseFunctionOrConstructorType(162);
+ return parseFunctionOrConstructorType(163);
}
if (token() === 94) {
- return parseFunctionOrConstructorType(163);
+ return parseFunctionOrConstructorType(164);
}
var type = parseUnionTypeOrHigher();
if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(85)) {
- var node = createNode(170, type.pos);
+ var node = createNode(171, type.pos);
node.checkType = type;
node.extendsType = parseTypeWorker(true);
parseExpected(55);
@@ -15400,7 +15507,7 @@ var ts;
return !scanner.hasPrecedingLineBreak() && isIdentifier();
}
function parseYieldExpression() {
- var node = createNode(202);
+ var node = createNode(203);
nextToken();
if (!scanner.hasPrecedingLineBreak() &&
(token() === 39 || isStartOfExpression())) {
@@ -15416,13 +15523,13 @@ var ts;
ts.Debug.assert(token() === 36, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
var node;
if (asyncModifier) {
- node = createNode(192, asyncModifier.pos);
+ node = createNode(193, asyncModifier.pos);
node.modifiers = asyncModifier;
}
else {
- node = createNode(192, identifier.pos);
+ node = createNode(193, identifier.pos);
}
- var parameter = createNode(148, identifier.pos);
+ var parameter = createNode(149, identifier.pos);
parameter.name = identifier;
finishNode(parameter);
node.parameters = createNodeArray([parameter], parameter.pos, parameter.end);
@@ -15568,7 +15675,7 @@ var ts;
return 0;
}
function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) {
- var node = createNodeWithJSDoc(192);
+ var node = createNodeWithJSDoc(193);
node.modifiers = parseModifiersForArrowFunction();
var isAsync = ts.hasModifier(node, 256) ? 2 : 0;
if (!fillSignature(56, isAsync | (allowAmbiguity ? 0 : 8), node)) {
@@ -15602,7 +15709,7 @@ var ts;
if (!questionToken) {
return leftOperand;
}
- var node = createNode(200, leftOperand.pos);
+ var node = createNode(201, leftOperand.pos);
node.condition = leftOperand;
node.questionToken = questionToken;
node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher);
@@ -15617,7 +15724,7 @@ var ts;
return parseBinaryExpressionRest(precedence, leftOperand);
}
function isInOrOfKeyword(t) {
- return t === 92 || t === 144;
+ return t === 92 || t === 145;
}
function parseBinaryExpressionRest(precedence, leftOperand) {
while (true) {
@@ -15654,43 +15761,43 @@ var ts;
return ts.getBinaryOperatorPrecedence(token()) > 0;
}
function makeBinaryExpression(left, operatorToken, right) {
- var node = createNode(199, left.pos);
+ var node = createNode(200, left.pos);
node.left = left;
node.operatorToken = operatorToken;
node.right = right;
return finishNode(node);
}
function makeAsExpression(left, right) {
- var node = createNode(207, left.pos);
+ var node = createNode(208, left.pos);
node.expression = left;
node.type = right;
return finishNode(node);
}
function parsePrefixUnaryExpression() {
- var node = createNode(197);
+ var node = createNode(198);
node.operator = token();
nextToken();
node.operand = parseSimpleUnaryExpression();
return finishNode(node);
}
function parseDeleteExpression() {
- var node = createNode(193);
- nextToken();
- node.expression = parseSimpleUnaryExpression();
- return finishNode(node);
- }
- function parseTypeOfExpression() {
var node = createNode(194);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
- function parseVoidExpression() {
+ function parseTypeOfExpression() {
var node = createNode(195);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
}
+ function parseVoidExpression() {
+ var node = createNode(196);
+ nextToken();
+ node.expression = parseSimpleUnaryExpression();
+ return finishNode(node);
+ }
function isAwaitExpression() {
if (token() === 121) {
if (inAwaitContext()) {
@@ -15701,7 +15808,7 @@ var ts;
return false;
}
function parseAwaitExpression() {
- var node = createNode(196);
+ var node = createNode(197);
nextToken();
node.expression = parseSimpleUnaryExpression();
return finishNode(node);
@@ -15718,7 +15825,7 @@ var ts;
if (token() === 40) {
var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos);
var end = simpleUnaryExpression.end;
- if (simpleUnaryExpression.kind === 189) {
+ if (simpleUnaryExpression.kind === 190) {
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 {
@@ -15771,7 +15878,7 @@ var ts;
}
function parseUpdateExpression() {
if (token() === 43 || token() === 44) {
- var node = createNode(197);
+ var node = createNode(198);
node.operator = token();
nextToken();
node.operand = parseLeftHandSideExpressionOrHigher();
@@ -15783,7 +15890,7 @@ var ts;
var expression = parseLeftHandSideExpressionOrHigher();
ts.Debug.assert(ts.isLeftHandSideExpression(expression));
if ((token() === 43 || token() === 44) && !scanner.hasPrecedingLineBreak()) {
- var node = createNode(198, expression.pos);
+ var node = createNode(199, expression.pos);
node.operand = expression;
node.operator = token();
nextToken();
@@ -15802,7 +15909,7 @@ var ts;
var fullStart = scanner.getStartPos();
nextToken();
nextToken();
- var node = createNode(209, fullStart);
+ var node = createNode(210, fullStart);
node.keywordToken = 91;
node.name = parseIdentifierName();
expression = finishNode(node);
@@ -15826,30 +15933,17 @@ var ts;
if (token() === 19 || token() === 23 || token() === 21) {
return expression;
}
- var node = createNode(184, expression.pos);
+ var node = createNode(185, expression.pos);
node.expression = expression;
parseExpectedToken(23, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access);
node.name = parseRightSideOfDot(true);
return finishNode(node);
}
- function tagNamesAreEquivalent(lhs, rhs) {
- if (lhs.kind !== rhs.kind) {
- return false;
- }
- if (lhs.kind === 71) {
- return lhs.escapedText === rhs.escapedText;
- }
- if (lhs.kind === 99) {
- return true;
- }
- return lhs.name.escapedText === rhs.name.escapedText &&
- tagNamesAreEquivalent(lhs.expression, rhs.expression);
- }
function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) {
var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext);
var result;
- if (opening.kind === 256) {
- var node = createNode(254, opening.pos);
+ if (opening.kind === 257) {
+ var node = createNode(255, opening.pos);
node.openingElement = opening;
node.children = parseJsxChildren(node.openingElement);
node.closingElement = parseJsxClosingElement(inExpressionContext);
@@ -15858,22 +15952,22 @@ var ts;
}
result = finishNode(node);
}
- else if (opening.kind === 259) {
- var node = createNode(258, opening.pos);
+ else if (opening.kind === 260) {
+ var node = createNode(259, opening.pos);
node.openingFragment = opening;
node.children = parseJsxChildren(node.openingFragment);
node.closingFragment = parseJsxClosingFragment(inExpressionContext);
result = finishNode(node);
}
else {
- ts.Debug.assert(opening.kind === 255);
+ ts.Debug.assert(opening.kind === 256);
result = opening;
}
if (inExpressionContext && token() === 27) {
var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(true); });
if (invalidElement) {
parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element);
- var badNode = createNode(199, result.pos);
+ var badNode = createNode(200, result.pos);
badNode.end = invalidElement.end;
badNode.left = result;
badNode.right = invalidElement;
@@ -15929,7 +16023,7 @@ var ts;
return createNodeArray(list, listPos);
}
function parseJsxAttributes() {
- var jsxAttributes = createNode(262);
+ var jsxAttributes = createNode(263);
jsxAttributes.properties = parseList(13, parseJsxAttribute);
return finishNode(jsxAttributes);
}
@@ -15937,7 +16031,7 @@ var ts;
var fullStart = scanner.getStartPos();
parseExpected(27);
if (token() === 29) {
- var node_1 = createNode(259, fullStart);
+ var node_1 = createNode(260, fullStart);
scanJsxText();
return finishNode(node_1);
}
@@ -15946,7 +16040,7 @@ var ts;
var attributes = parseJsxAttributes();
var node;
if (token() === 29) {
- node = createNode(256, fullStart);
+ node = createNode(257, fullStart);
scanJsxText();
}
else {
@@ -15958,7 +16052,7 @@ var ts;
parseExpected(29, undefined, false);
scanJsxText();
}
- node = createNode(255, fullStart);
+ node = createNode(256, fullStart);
}
node.tagName = tagName;
node.typeArguments = typeArguments;
@@ -15970,7 +16064,7 @@ var ts;
var expression = token() === 99 ?
parseTokenNode() : parseIdentifierName();
while (parseOptional(23)) {
- var propertyAccess = createNode(184, expression.pos);
+ var propertyAccess = createNode(185, expression.pos);
propertyAccess.expression = expression;
propertyAccess.name = parseRightSideOfDot(true);
expression = finishNode(propertyAccess);
@@ -15978,7 +16072,7 @@ var ts;
return expression;
}
function parseJsxExpression(inExpressionContext) {
- var node = createNode(264);
+ var node = createNode(265);
if (!parseExpected(17)) {
return undefined;
}
@@ -16000,7 +16094,7 @@ var ts;
return parseJsxSpreadAttribute();
}
scanJsxIdentifier();
- var node = createNode(261);
+ var node = createNode(262);
node.name = parseIdentifierName();
if (token() === 58) {
switch (scanJsxAttributeValue()) {
@@ -16015,7 +16109,7 @@ var ts;
return finishNode(node);
}
function parseJsxSpreadAttribute() {
- var node = createNode(263);
+ var node = createNode(264);
parseExpected(17);
parseExpected(24);
node.expression = parseExpression();
@@ -16023,7 +16117,7 @@ var ts;
return finishNode(node);
}
function parseJsxClosingElement(inExpressionContext) {
- var node = createNode(257);
+ var node = createNode(258);
parseExpected(28);
node.tagName = parseJsxElementName();
if (inExpressionContext) {
@@ -16036,7 +16130,7 @@ var ts;
return finishNode(node);
}
function parseJsxClosingFragment(inExpressionContext) {
- var node = createNode(260);
+ var node = createNode(261);
parseExpected(28);
if (ts.tokenIsIdentifierOrKeyword(token())) {
parseErrorAtRange(parseJsxElementName(), ts.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment);
@@ -16051,7 +16145,7 @@ var ts;
return finishNode(node);
}
function parseTypeAssertion() {
- var node = createNode(189);
+ var node = createNode(190);
parseExpected(27);
node.type = parseType();
parseExpected(29);
@@ -16062,7 +16156,7 @@ var ts;
while (true) {
var dotToken = parseOptionalToken(23);
if (dotToken) {
- var propertyAccess = createNode(184, expression.pos);
+ var propertyAccess = createNode(185, expression.pos);
propertyAccess.expression = expression;
propertyAccess.name = parseRightSideOfDot(true);
expression = finishNode(propertyAccess);
@@ -16070,13 +16164,13 @@ var ts;
}
if (token() === 51 && !scanner.hasPrecedingLineBreak()) {
nextToken();
- var nonNullExpression = createNode(208, expression.pos);
+ var nonNullExpression = createNode(209, expression.pos);
nonNullExpression.expression = expression;
expression = finishNode(nonNullExpression);
continue;
}
if (!inDecoratorContext() && parseOptional(21)) {
- var indexedAccess = createNode(185, expression.pos);
+ var indexedAccess = createNode(186, expression.pos);
indexedAccess.expression = expression;
if (token() === 22) {
indexedAccess.argumentExpression = createMissingNode(71, true, ts.Diagnostics.An_element_access_expression_should_take_an_argument);
@@ -16103,7 +16197,7 @@ var ts;
return token() === 13 || token() === 14;
}
function parseTaggedTemplateRest(tag, typeArguments) {
- var tagExpression = createNode(188, tag.pos);
+ var tagExpression = createNode(189, tag.pos);
tagExpression.tag = tag;
tagExpression.typeArguments = typeArguments;
tagExpression.template = token() === 13
@@ -16123,7 +16217,7 @@ var ts;
expression = parseTaggedTemplateRest(expression, typeArguments);
continue;
}
- var callExpr = createNode(186, expression.pos);
+ var callExpr = createNode(187, expression.pos);
callExpr.expression = expression;
callExpr.typeArguments = typeArguments;
callExpr.arguments = parseArgumentList();
@@ -16131,7 +16225,7 @@ var ts;
continue;
}
else if (token() === 19) {
- var callExpr = createNode(186, expression.pos);
+ var callExpr = createNode(187, expression.pos);
callExpr.expression = expression;
callExpr.arguments = parseArgumentList();
expression = finishNode(callExpr);
@@ -16228,28 +16322,28 @@ var ts;
return parseIdentifier(ts.Diagnostics.Expression_expected);
}
function parseParenthesizedExpression() {
- var node = createNodeWithJSDoc(190);
+ var node = createNodeWithJSDoc(191);
parseExpected(19);
node.expression = allowInAnd(parseExpression);
parseExpected(20);
return finishNode(node);
}
function parseSpreadElement() {
- var node = createNode(203);
+ var node = createNode(204);
parseExpected(24);
node.expression = parseAssignmentExpressionOrHigher();
return finishNode(node);
}
function parseArgumentOrArrayLiteralElement() {
return token() === 24 ? parseSpreadElement() :
- token() === 26 ? createNode(205) :
+ token() === 26 ? createNode(206) :
parseAssignmentExpressionOrHigher();
}
function parseArgumentExpression() {
return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement);
}
function parseArrayLiteralExpression() {
- var node = createNode(182);
+ var node = createNode(183);
parseExpected(21);
if (scanner.hasPrecedingLineBreak()) {
node.multiLine = true;
@@ -16261,17 +16355,17 @@ var ts;
function parseObjectLiteralElement() {
var node = createNodeWithJSDoc(0);
if (parseOptionalToken(24)) {
- node.kind = 271;
+ node.kind = 272;
node.expression = parseAssignmentExpressionOrHigher();
return finishNode(node);
}
node.decorators = parseDecorators();
node.modifiers = parseModifiers();
if (parseContextualModifier(125)) {
- return parseAccessorDeclaration(node, 155);
+ return parseAccessorDeclaration(node, 156);
}
if (parseContextualModifier(136)) {
- return parseAccessorDeclaration(node, 156);
+ return parseAccessorDeclaration(node, 157);
}
var asteriskToken = parseOptionalToken(39);
var tokenIsIdentifier = isIdentifier();
@@ -16282,7 +16376,7 @@ var ts;
}
var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 26 || token() === 18 || token() === 58);
if (isShorthandPropertyAssignment) {
- node.kind = 270;
+ node.kind = 271;
var equalsToken = parseOptionalToken(58);
if (equalsToken) {
node.equalsToken = equalsToken;
@@ -16290,14 +16384,14 @@ var ts;
}
}
else {
- node.kind = 269;
+ node.kind = 270;
parseExpected(56);
node.initializer = allowInAnd(parseAssignmentExpressionOrHigher);
}
return finishNode(node);
}
function parseObjectLiteralExpression() {
- var node = createNode(183);
+ var node = createNode(184);
parseExpected(17);
if (scanner.hasPrecedingLineBreak()) {
node.multiLine = true;
@@ -16311,7 +16405,7 @@ var ts;
if (saveDecoratorContext) {
setDecoratorContext(false);
}
- var node = createNodeWithJSDoc(191);
+ var node = createNodeWithJSDoc(192);
node.modifiers = parseModifiers();
parseExpected(89);
node.asteriskToken = parseOptionalToken(39);
@@ -16336,7 +16430,7 @@ var ts;
var fullStart = scanner.getStartPos();
parseExpected(94);
if (parseOptional(23)) {
- var node_2 = createNode(209, fullStart);
+ var node_2 = createNode(210, fullStart);
node_2.keywordToken = 94;
node_2.name = parseIdentifierName();
return finishNode(node_2);
@@ -16353,7 +16447,7 @@ var ts;
}
break;
}
- var node = createNode(187, fullStart);
+ var node = createNode(188, fullStart);
node.expression = expression;
node.typeArguments = typeArguments;
if (node.typeArguments || token() === 19) {
@@ -16362,7 +16456,7 @@ var ts;
return finishNode(node);
}
function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) {
- var node = createNode(212);
+ var node = createNode(213);
if (parseExpected(17, diagnosticMessage) || ignoreMissingOpenBrace) {
if (scanner.hasPrecedingLineBreak()) {
node.multiLine = true;
@@ -16393,12 +16487,12 @@ var ts;
return block;
}
function parseEmptyStatement() {
- var node = createNode(214);
+ var node = createNode(215);
parseExpected(25);
return finishNode(node);
}
function parseIfStatement() {
- var node = createNode(216);
+ var node = createNode(217);
parseExpected(90);
parseExpected(19);
node.expression = allowInAnd(parseExpression);
@@ -16408,7 +16502,7 @@ var ts;
return finishNode(node);
}
function parseDoStatement() {
- var node = createNode(217);
+ var node = createNode(218);
parseExpected(81);
node.statement = parseStatement();
parseExpected(106);
@@ -16419,7 +16513,7 @@ var ts;
return finishNode(node);
}
function parseWhileStatement() {
- var node = createNode(218);
+ var node = createNode(219);
parseExpected(106);
parseExpected(19);
node.expression = allowInAnd(parseExpression);
@@ -16442,8 +16536,8 @@ var ts;
}
}
var forOrForInOrForOfStatement;
- if (awaitToken ? parseExpected(144) : parseOptional(144)) {
- var forOfStatement = createNode(221, pos);
+ if (awaitToken ? parseExpected(145) : parseOptional(145)) {
+ var forOfStatement = createNode(222, pos);
forOfStatement.awaitModifier = awaitToken;
forOfStatement.initializer = initializer;
forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher);
@@ -16451,14 +16545,14 @@ var ts;
forOrForInOrForOfStatement = forOfStatement;
}
else if (parseOptional(92)) {
- var forInStatement = createNode(220, pos);
+ var forInStatement = createNode(221, pos);
forInStatement.initializer = initializer;
forInStatement.expression = allowInAnd(parseExpression);
parseExpected(20);
forOrForInOrForOfStatement = forInStatement;
}
else {
- var forStatement = createNode(219, pos);
+ var forStatement = createNode(220, pos);
forStatement.initializer = initializer;
parseExpected(25);
if (token() !== 25 && token() !== 20) {
@@ -16476,7 +16570,7 @@ var ts;
}
function parseBreakOrContinueStatement(kind) {
var node = createNode(kind);
- parseExpected(kind === 223 ? 72 : 77);
+ parseExpected(kind === 224 ? 72 : 77);
if (!canParseSemicolon()) {
node.label = parseIdentifier();
}
@@ -16484,7 +16578,7 @@ var ts;
return finishNode(node);
}
function parseReturnStatement() {
- var node = createNode(224);
+ var node = createNode(225);
parseExpected(96);
if (!canParseSemicolon()) {
node.expression = allowInAnd(parseExpression);
@@ -16493,7 +16587,7 @@ var ts;
return finishNode(node);
}
function parseWithStatement() {
- var node = createNode(225);
+ var node = createNode(226);
parseExpected(107);
parseExpected(19);
node.expression = allowInAnd(parseExpression);
@@ -16502,7 +16596,7 @@ var ts;
return finishNode(node);
}
function parseCaseClause() {
- var node = createNode(265);
+ var node = createNode(266);
parseExpected(73);
node.expression = allowInAnd(parseExpression);
parseExpected(56);
@@ -16510,7 +16604,7 @@ var ts;
return finishNode(node);
}
function parseDefaultClause() {
- var node = createNode(266);
+ var node = createNode(267);
parseExpected(79);
parseExpected(56);
node.statements = parseList(3, parseStatement);
@@ -16520,12 +16614,12 @@ var ts;
return token() === 73 ? parseCaseClause() : parseDefaultClause();
}
function parseSwitchStatement() {
- var node = createNode(226);
+ var node = createNode(227);
parseExpected(98);
parseExpected(19);
node.expression = allowInAnd(parseExpression);
parseExpected(20);
- var caseBlock = createNode(240);
+ var caseBlock = createNode(241);
parseExpected(17);
caseBlock.clauses = parseList(2, parseCaseOrDefaultClause);
parseExpected(18);
@@ -16533,14 +16627,14 @@ var ts;
return finishNode(node);
}
function parseThrowStatement() {
- var node = createNode(228);
+ var node = createNode(229);
parseExpected(100);
node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression);
parseSemicolon();
return finishNode(node);
}
function parseTryStatement() {
- var node = createNode(229);
+ var node = createNode(230);
parseExpected(102);
node.tryBlock = parseBlock(false);
node.catchClause = token() === 74 ? parseCatchClause() : undefined;
@@ -16551,7 +16645,7 @@ var ts;
return finishNode(node);
}
function parseCatchClause() {
- var result = createNode(268);
+ var result = createNode(269);
parseExpected(74);
if (parseOptional(19)) {
result.variableDeclaration = parseVariableDeclaration();
@@ -16564,7 +16658,7 @@ var ts;
return finishNode(result);
}
function parseDebuggerStatement() {
- var node = createNode(230);
+ var node = createNode(231);
parseExpected(78);
parseSemicolon();
return finishNode(node);
@@ -16573,12 +16667,12 @@ var ts;
var node = createNodeWithJSDoc(0);
var expression = allowInAnd(parseExpression);
if (expression.kind === 71 && parseOptional(56)) {
- node.kind = 227;
+ node.kind = 228;
node.label = expression;
node.statement = parseStatement();
}
else {
- node.kind = 215;
+ node.kind = 216;
node.expression = expression;
parseSemicolon();
}
@@ -16628,7 +16722,7 @@ var ts;
return false;
}
continue;
- case 143:
+ case 144:
nextToken();
return token() === 17 || token() === 71 || token() === 84;
case 91:
@@ -16690,7 +16784,7 @@ var ts;
case 129:
case 130:
case 139:
- case 143:
+ case 144:
return true;
case 114:
case 112:
@@ -16716,16 +16810,16 @@ var ts;
case 17:
return parseBlock(false);
case 104:
- return parseVariableStatement(createNodeWithJSDoc(231));
+ return parseVariableStatement(createNodeWithJSDoc(232));
case 110:
if (isLetDeclaration()) {
- return parseVariableStatement(createNodeWithJSDoc(231));
+ return parseVariableStatement(createNodeWithJSDoc(232));
}
break;
case 89:
- return parseFunctionDeclaration(createNodeWithJSDoc(233));
+ return parseFunctionDeclaration(createNodeWithJSDoc(234));
case 75:
- return parseClassDeclaration(createNodeWithJSDoc(234));
+ return parseClassDeclaration(createNodeWithJSDoc(235));
case 90:
return parseIfStatement();
case 81:
@@ -16735,9 +16829,9 @@ var ts;
case 88:
return parseForOrForInOrForOfStatement();
case 77:
- return parseBreakOrContinueStatement(222);
- case 72:
return parseBreakOrContinueStatement(223);
+ case 72:
+ return parseBreakOrContinueStatement(224);
case 96:
return parseReturnStatement();
case 107:
@@ -16770,7 +16864,7 @@ var ts;
case 117:
case 115:
case 132:
- case 143:
+ case 144:
if (isStartOfDeclaration()) {
return parseDeclaration();
}
@@ -16812,7 +16906,7 @@ var ts;
return parseTypeAliasDeclaration(node);
case 83:
return parseEnumDeclaration(node);
- case 143:
+ case 144:
case 129:
case 130:
return parseModuleDeclaration(node);
@@ -16831,12 +16925,13 @@ var ts;
}
default:
if (node.decorators || node.modifiers) {
- var missing = createMissingNode(252, true, ts.Diagnostics.Declaration_expected);
+ var missing = createMissingNode(253, true, ts.Diagnostics.Declaration_expected);
missing.pos = node.pos;
missing.decorators = node.decorators;
missing.modifiers = node.modifiers;
return finishNode(missing);
}
+ return undefined;
}
}
function nextTokenIsIdentifierOrStringLiteralOnSameLine() {
@@ -16852,16 +16947,16 @@ var ts;
}
function parseArrayBindingElement() {
if (token() === 26) {
- return createNode(205);
+ return createNode(206);
}
- var node = createNode(181);
+ var node = createNode(182);
node.dotDotDotToken = parseOptionalToken(24);
node.name = parseIdentifierOrPattern();
node.initializer = parseInitializer();
return finishNode(node);
}
function parseObjectBindingElement() {
- var node = createNode(181);
+ var node = createNode(182);
node.dotDotDotToken = parseOptionalToken(24);
var tokenIsIdentifier = isIdentifier();
var propertyName = parsePropertyName();
@@ -16877,14 +16972,14 @@ var ts;
return finishNode(node);
}
function parseObjectBindingPattern() {
- var node = createNode(179);
+ var node = createNode(180);
parseExpected(17);
node.elements = parseDelimitedList(9, parseObjectBindingElement);
parseExpected(18);
return finishNode(node);
}
function parseArrayBindingPattern() {
- var node = createNode(180);
+ var node = createNode(181);
parseExpected(21);
node.elements = parseDelimitedList(10, parseArrayBindingElement);
parseExpected(22);
@@ -16906,7 +17001,7 @@ var ts;
return parseVariableDeclaration(true);
}
function parseVariableDeclaration(allowExclamation) {
- var node = createNode(231);
+ var node = createNode(232);
node.name = parseIdentifierOrPattern();
if (allowExclamation && node.name.kind === 71 &&
token() === 51 && !scanner.hasPrecedingLineBreak()) {
@@ -16919,7 +17014,7 @@ var ts;
return finishNode(node);
}
function parseVariableDeclarationList(inForStatementInitializer) {
- var node = createNode(232);
+ var node = createNode(233);
switch (token()) {
case 104:
break;
@@ -16933,7 +17028,7 @@ var ts;
ts.Debug.fail();
}
nextToken();
- if (token() === 144 && lookAhead(canFollowContextualOfKeyword)) {
+ if (token() === 145 && lookAhead(canFollowContextualOfKeyword)) {
node.declarations = createMissingList();
}
else {
@@ -16948,13 +17043,13 @@ var ts;
return nextTokenIsIdentifier() && nextToken() === 20;
}
function parseVariableStatement(node) {
- node.kind = 213;
+ node.kind = 214;
node.declarationList = parseVariableDeclarationList(false);
parseSemicolon();
return finishNode(node);
}
function parseFunctionDeclaration(node) {
- node.kind = 233;
+ node.kind = 234;
parseExpected(89);
node.asteriskToken = parseOptionalToken(39);
node.name = ts.hasModifier(node, 512) ? parseOptionalIdentifier() : parseIdentifier();
@@ -16965,14 +17060,14 @@ var ts;
return finishNode(node);
}
function parseConstructorDeclaration(node) {
- node.kind = 154;
+ node.kind = 155;
parseExpected(123);
fillSignature(56, 0, node);
node.body = parseFunctionBlockOrSemicolon(0, ts.Diagnostics.or_expected);
return finishNode(node);
}
function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) {
- node.kind = 153;
+ node.kind = 154;
node.asteriskToken = asteriskToken;
var isGenerator = asteriskToken ? 1 : 0;
var isAsync = ts.hasModifier(node, 256) ? 2 : 0;
@@ -16981,7 +17076,7 @@ var ts;
return finishNode(node);
}
function parsePropertyDeclaration(node) {
- node.kind = 151;
+ node.kind = 152;
if (!node.questionToken && token() === 51 && !scanner.hasPrecedingLineBreak()) {
node.exclamationToken = parseTokenNode();
}
@@ -17056,7 +17151,7 @@ var ts;
if (!parseOptional(57)) {
break;
}
- var decorator = createNode(149, decoratorStart);
+ var decorator = createNode(150, decoratorStart);
decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher);
finishNode(decorator);
(list || (list = [])).push(decorator);
@@ -17097,7 +17192,7 @@ var ts;
}
function parseClassElement() {
if (token() === 25) {
- var result = createNode(211);
+ var result = createNode(212);
nextToken();
return finishNode(result);
}
@@ -17105,10 +17200,10 @@ var ts;
node.decorators = parseDecorators();
node.modifiers = parseModifiers(true);
if (parseContextualModifier(125)) {
- return parseAccessorDeclaration(node, 155);
+ return parseAccessorDeclaration(node, 156);
}
if (parseContextualModifier(136)) {
- return parseAccessorDeclaration(node, 156);
+ return parseAccessorDeclaration(node, 157);
}
if (token() === 123) {
return parseConstructorDeclaration(node);
@@ -17127,13 +17222,13 @@ var ts;
node.name = createMissingNode(71, true, ts.Diagnostics.Declaration_expected);
return parsePropertyDeclaration(node);
}
- ts.Debug.fail("Should not have attempted to parse class member declaration.");
+ return ts.Debug.fail("Should not have attempted to parse class member declaration.");
}
function parseClassExpression() {
- return parseClassDeclarationOrExpression(createNodeWithJSDoc(0), 204);
+ return parseClassDeclarationOrExpression(createNodeWithJSDoc(0), 205);
}
function parseClassDeclaration(node) {
- return parseClassDeclarationOrExpression(node, 234);
+ return parseClassDeclarationOrExpression(node, 235);
}
function parseClassDeclarationOrExpression(node, kind) {
node.kind = kind;
@@ -17166,17 +17261,15 @@ var ts;
}
function parseHeritageClause() {
var tok = token();
- if (tok === 85 || tok === 108) {
- var node = createNode(267);
- node.token = tok;
- nextToken();
- node.types = parseDelimitedList(7, parseExpressionWithTypeArguments);
- return finishNode(node);
- }
- return undefined;
+ ts.Debug.assert(tok === 85 || tok === 108);
+ var node = createNode(268);
+ node.token = tok;
+ nextToken();
+ node.types = parseDelimitedList(7, parseExpressionWithTypeArguments);
+ return finishNode(node);
}
function parseExpressionWithTypeArguments() {
- var node = createNode(206);
+ var node = createNode(207);
node.expression = parseLeftHandSideExpressionOrHigher();
node.typeArguments = tryParseTypeArguments();
return finishNode(node);
@@ -17193,7 +17286,7 @@ var ts;
return parseList(5, parseClassElement);
}
function parseInterfaceDeclaration(node) {
- node.kind = 235;
+ node.kind = 236;
parseExpected(109);
node.name = parseIdentifier();
node.typeParameters = parseTypeParameters();
@@ -17202,7 +17295,7 @@ var ts;
return finishNode(node);
}
function parseTypeAliasDeclaration(node) {
- node.kind = 236;
+ node.kind = 237;
parseExpected(139);
node.name = parseIdentifier();
node.typeParameters = parseTypeParameters();
@@ -17212,13 +17305,13 @@ var ts;
return finishNode(node);
}
function parseEnumMember() {
- var node = createNodeWithJSDoc(272);
+ var node = createNodeWithJSDoc(273);
node.name = parsePropertyName();
node.initializer = allowInAnd(parseInitializer);
return finishNode(node);
}
function parseEnumDeclaration(node) {
- node.kind = 237;
+ node.kind = 238;
parseExpected(83);
node.name = parseIdentifier();
if (parseExpected(17)) {
@@ -17231,7 +17324,7 @@ var ts;
return finishNode(node);
}
function parseModuleBlock() {
- var node = createNode(239);
+ var node = createNode(240);
if (parseExpected(17)) {
node.statements = parseList(1, parseStatement);
parseExpected(18);
@@ -17242,7 +17335,7 @@ var ts;
return finishNode(node);
}
function parseModuleOrNamespaceDeclaration(node, flags) {
- node.kind = 238;
+ node.kind = 239;
var namespaceFlag = flags & 16;
node.flags |= flags;
node.name = parseIdentifier();
@@ -17252,8 +17345,8 @@ var ts;
return finishNode(node);
}
function parseAmbientExternalModuleDeclaration(node) {
- node.kind = 238;
- if (token() === 143) {
+ node.kind = 239;
+ if (token() === 144) {
node.name = parseIdentifier();
node.flags |= 512;
}
@@ -17271,7 +17364,7 @@ var ts;
}
function parseModuleDeclaration(node) {
var flags = 0;
- if (token() === 143) {
+ if (token() === 144) {
return parseAmbientExternalModuleDeclaration(node);
}
else if (parseOptional(130)) {
@@ -17296,7 +17389,7 @@ var ts;
return nextToken() === 41;
}
function parseNamespaceExportDeclaration(node) {
- node.kind = 241;
+ node.kind = 242;
parseExpected(118);
parseExpected(130);
node.name = parseIdentifier();
@@ -17309,23 +17402,23 @@ var ts;
var identifier;
if (isIdentifier()) {
identifier = parseIdentifier();
- if (token() !== 26 && token() !== 142) {
+ if (token() !== 26 && token() !== 143) {
return parseImportEqualsDeclaration(node, identifier);
}
}
- node.kind = 243;
+ node.kind = 244;
if (identifier ||
token() === 39 ||
token() === 17) {
node.importClause = parseImportClause(identifier, afterImportPos);
- parseExpected(142);
+ parseExpected(143);
}
node.moduleSpecifier = parseModuleSpecifier();
parseSemicolon();
return finishNode(node);
}
function parseImportEqualsDeclaration(node, identifier) {
- node.kind = 242;
+ node.kind = 243;
node.name = identifier;
parseExpected(58);
node.moduleReference = parseModuleReference();
@@ -17333,13 +17426,13 @@ var ts;
return finishNode(node);
}
function parseImportClause(identifier, fullStart) {
- var importClause = createNode(244, fullStart);
+ var importClause = createNode(245, fullStart);
if (identifier) {
importClause.name = identifier;
}
if (!importClause.name ||
parseOptional(26)) {
- importClause.namedBindings = token() === 39 ? parseNamespaceImport() : parseNamedImportsOrExports(246);
+ importClause.namedBindings = token() === 39 ? parseNamespaceImport() : parseNamedImportsOrExports(247);
}
return finishNode(importClause);
}
@@ -17349,7 +17442,7 @@ var ts;
: parseEntityName(false);
}
function parseExternalModuleReference() {
- var node = createNode(253);
+ var node = createNode(254);
parseExpected(133);
parseExpected(19);
node.expression = parseModuleSpecifier();
@@ -17367,7 +17460,7 @@ var ts;
}
}
function parseNamespaceImport() {
- var namespaceImport = createNode(245);
+ var namespaceImport = createNode(246);
parseExpected(39);
parseExpected(118);
namespaceImport.name = parseIdentifier();
@@ -17375,14 +17468,14 @@ var ts;
}
function parseNamedImportsOrExports(kind) {
var node = createNode(kind);
- node.elements = parseBracketedList(22, kind === 246 ? parseImportSpecifier : parseExportSpecifier, 17, 18);
+ node.elements = parseBracketedList(22, kind === 247 ? parseImportSpecifier : parseExportSpecifier, 17, 18);
return finishNode(node);
}
function parseExportSpecifier() {
- return parseImportOrExportSpecifier(251);
+ return parseImportOrExportSpecifier(252);
}
function parseImportSpecifier() {
- return parseImportOrExportSpecifier(247);
+ return parseImportOrExportSpecifier(248);
}
function parseImportOrExportSpecifier(kind) {
var node = createNode(kind);
@@ -17401,21 +17494,21 @@ var ts;
else {
node.name = identifierName;
}
- if (kind === 247 && checkIdentifierIsKeyword) {
+ if (kind === 248 && checkIdentifierIsKeyword) {
parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected);
}
return finishNode(node);
}
function parseExportDeclaration(node) {
- node.kind = 249;
+ node.kind = 250;
if (parseOptional(39)) {
- parseExpected(142);
+ parseExpected(143);
node.moduleSpecifier = parseModuleSpecifier();
}
else {
- node.exportClause = parseNamedImportsOrExports(250);
- if (token() === 142 || (token() === 9 && !scanner.hasPrecedingLineBreak())) {
- parseExpected(142);
+ node.exportClause = parseNamedImportsOrExports(251);
+ if (token() === 143 || (token() === 9 && !scanner.hasPrecedingLineBreak())) {
+ parseExpected(143);
node.moduleSpecifier = parseModuleSpecifier();
}
}
@@ -17423,7 +17516,7 @@ var ts;
return finishNode(node);
}
function parseExportAssignment(node) {
- node.kind = 248;
+ node.kind = 249;
if (parseOptional(58)) {
node.isExportEquals = true;
}
@@ -17441,10 +17534,10 @@ var ts;
}
function isAnExternalModuleIndicatorNode(node) {
return ts.hasModifier(node, 1)
- || node.kind === 242 && node.moduleReference.kind === 253
- || node.kind === 243
- || node.kind === 248
+ || node.kind === 243 && node.moduleReference.kind === 254
+ || node.kind === 244
|| node.kind === 249
+ || node.kind === 250
? node
: undefined;
}
@@ -17506,7 +17599,7 @@ var ts;
}
JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests;
function parseJSDocTypeExpression(mayOmitBraces) {
- var result = createNode(277, scanner.getTokenPos());
+ var result = createNode(278, scanner.getTokenPos());
var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(17);
result.type = doInsideOfContext(2097152, parseJSDocType);
if (!mayOmitBraces || hasBrace) {
@@ -17559,8 +17652,8 @@ var ts;
PropertyLikeParse[PropertyLikeParse["CallbackParameter"] = 4] = "CallbackParameter";
})(PropertyLikeParse || (PropertyLikeParse = {}));
function parseJSDocCommentWorker(start, length) {
+ if (start === void 0) { start = 0; }
var content = sourceText;
- start = start || 0;
var end = length === undefined ? content.length : start + length;
length = end - start;
ts.Debug.assert(start >= 0);
@@ -17585,17 +17678,15 @@ var ts;
comments.push(text);
indent += text.length;
}
- var t = nextJSDocToken();
- while (t === 5) {
- t = nextJSDocToken();
- }
- if (t === 4) {
+ nextJSDocToken();
+ while (parseOptionalJsdoc(5))
+ ;
+ if (parseOptionalJsdoc(4)) {
state = 0;
indent = 0;
- t = nextJSDocToken();
}
loop: while (true) {
- switch (t) {
+ switch (token()) {
case 57:
if (state === 0 || state === 1) {
removeTrailingNewlines(comments);
@@ -17645,7 +17736,7 @@ var ts;
pushComment(scanner.getTokenText());
break;
}
- t = nextJSDocToken();
+ nextJSDocToken();
}
removeLeadingNewlines(comments);
removeTrailingNewlines(comments);
@@ -17663,7 +17754,7 @@ var ts;
}
}
function createJSDocComment() {
- var result = createNode(285, start);
+ var result = createNode(286, start);
result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd);
result.comment = comments.length ? comments.join("") : undefined;
return finishNode(result, end);
@@ -17801,7 +17892,7 @@ var ts;
return comments.length === 0 ? undefined : comments.join("");
}
function parseUnknownTag(atToken, tagName) {
- var result = createNode(288, atToken.pos);
+ var result = createNode(289, atToken.pos);
result.atToken = atToken;
result.tagName = tagName;
return finishNode(result);
@@ -17842,7 +17933,7 @@ var ts;
switch (node.kind) {
case 135:
return true;
- case 166:
+ case 167:
return isObjectOrObjectArrayTypeReference(node.elementType);
default:
return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object";
@@ -17858,12 +17949,12 @@ var ts;
typeExpression = tryParseTypeExpression();
}
var result = target === 1 ?
- createNode(297, atToken.pos) :
- createNode(292, atToken.pos);
+ createNode(298, atToken.pos) :
+ createNode(293, atToken.pos);
var comment;
if (indent !== undefined)
comment = parseTagComments(indent + scanner.getStartPos() - atToken.pos);
- var nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name, target);
+ var nestedTypeLiteral = target !== 4 && parseNestedTypeLiteral(typeExpression, name, target);
if (nestedTypeLiteral) {
typeExpression = nestedTypeLiteral;
isNameFirst = true;
@@ -17879,20 +17970,20 @@ var ts;
}
function parseNestedTypeLiteral(typeExpression, name, target) {
if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) {
- var typeLiteralExpression = createNode(277, scanner.getTokenPos());
+ var typeLiteralExpression = createNode(278, scanner.getTokenPos());
var child = void 0;
var jsdocTypeLiteral = void 0;
var start_2 = scanner.getStartPos();
var children = void 0;
while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, name); })) {
- if (child.kind === 292 || child.kind === 297) {
+ if (child.kind === 293 || child.kind === 298) {
children = ts.append(children, child);
}
}
if (children) {
- jsdocTypeLiteral = createNode(286, start_2);
+ jsdocTypeLiteral = createNode(287, start_2);
jsdocTypeLiteral.jsDocPropertyTags = children;
- if (typeExpression.type.kind === 166) {
+ if (typeExpression.type.kind === 167) {
jsdocTypeLiteral.isArrayType = true;
}
typeLiteralExpression.type = finishNode(jsdocTypeLiteral);
@@ -17901,27 +17992,27 @@ var ts;
}
}
function parseReturnTag(atToken, tagName) {
- if (ts.forEach(tags, function (t) { return t.kind === 293; })) {
- parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText);
- }
- var result = createNode(293, atToken.pos);
- result.atToken = atToken;
- result.tagName = tagName;
- result.typeExpression = tryParseTypeExpression();
- return finishNode(result);
- }
- function parseTypeTag(atToken, tagName) {
if (ts.forEach(tags, function (t) { return t.kind === 294; })) {
parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText);
}
var result = createNode(294, atToken.pos);
result.atToken = atToken;
result.tagName = tagName;
+ result.typeExpression = tryParseTypeExpression();
+ return finishNode(result);
+ }
+ function parseTypeTag(atToken, tagName) {
+ if (ts.forEach(tags, function (t) { return t.kind === 295; })) {
+ parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText);
+ }
+ var result = createNode(295, atToken.pos);
+ result.atToken = atToken;
+ result.tagName = tagName;
result.typeExpression = parseJSDocTypeExpression(true);
return finishNode(result);
}
function parseAugmentsTag(atToken, tagName) {
- var result = createNode(289, atToken.pos);
+ var result = createNode(290, atToken.pos);
result.atToken = atToken;
result.tagName = tagName;
result.class = parseExpressionWithTypeArgumentsForAugments();
@@ -17929,7 +18020,7 @@ var ts;
}
function parseExpressionWithTypeArgumentsForAugments() {
var usedBrace = parseOptional(17);
- var node = createNode(206);
+ var node = createNode(207);
node.expression = parsePropertyAccessEntityNameExpression();
node.typeArguments = tryParseTypeArguments();
var res = finishNode(node);
@@ -17941,7 +18032,7 @@ var ts;
function parsePropertyAccessEntityNameExpression() {
var node = parseJSDocIdentifierName(true);
while (parseOptional(23)) {
- var prop = createNode(184, node.pos);
+ var prop = createNode(185, node.pos);
prop.expression = node;
prop.name = parseJSDocIdentifierName();
node = finishNode(prop);
@@ -17949,7 +18040,7 @@ var ts;
return node;
}
function parseClassTag(atToken, tagName) {
- var tag = createNode(290, atToken.pos);
+ var tag = createNode(291, atToken.pos);
tag.atToken = atToken;
tag.tagName = tagName;
return finishNode(tag);
@@ -17957,7 +18048,7 @@ var ts;
function parseTypedefTag(atToken, tagName, indent) {
var typeExpression = tryParseTypeExpression();
skipWhitespace();
- var typedefTag = createNode(296, atToken.pos);
+ var typedefTag = createNode(297, atToken.pos);
typedefTag.atToken = atToken;
typedefTag.tagName = tagName;
typedefTag.fullName = parseJSDocTypeNameWithNamespace();
@@ -17973,9 +18064,9 @@ var ts;
var start_3 = scanner.getStartPos();
while (child = tryParse(function () { return parseChildPropertyTag(); })) {
if (!jsdocTypeLiteral) {
- jsdocTypeLiteral = createNode(286, start_3);
+ jsdocTypeLiteral = createNode(287, start_3);
}
- if (child.kind === 294) {
+ if (child.kind === 295) {
if (childTypeTag) {
break;
}
@@ -17988,7 +18079,7 @@ var ts;
}
}
if (jsdocTypeLiteral) {
- if (typeExpression && typeExpression.type.kind === 166) {
+ if (typeExpression && typeExpression.type.kind === 167) {
jsdocTypeLiteral.isArrayType = true;
}
typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ?
@@ -18003,7 +18094,7 @@ var ts;
var pos = scanner.getTokenPos();
var typeNameOrNamespaceName = parseJSDocIdentifierName();
if (typeNameOrNamespaceName && parseOptional(23)) {
- var jsDocNamespaceNode = createNode(238, pos);
+ var jsDocNamespaceNode = createNode(239, pos);
if (nested) {
jsDocNamespaceNode.flags |= 4;
}
@@ -18017,7 +18108,7 @@ var ts;
return typeNameOrNamespaceName;
}
function parseCallbackTag(atToken, tagName, indent) {
- var callbackTag = createNode(291, atToken.pos);
+ var callbackTag = createNode(292, atToken.pos);
callbackTag.atToken = atToken;
callbackTag.tagName = tagName;
callbackTag.fullName = parseJSDocTypeNameWithNamespace();
@@ -18026,16 +18117,15 @@ var ts;
callbackTag.comment = parseTagComments(indent);
var child;
var start = scanner.getStartPos();
- var jsdocSignature = createNode(287, start);
+ var jsdocSignature = createNode(288, start);
jsdocSignature.parameters = [];
while (child = tryParse(function () { return parseChildParameterOrPropertyTag(4); })) {
jsdocSignature.parameters = ts.append(jsdocSignature.parameters, child);
}
var returnTag = tryParse(function () {
- if (token() === 57) {
- nextJSDocToken();
+ if (parseOptionalJsdoc(57)) {
var tag = parseTag(indent);
- if (tag && tag.kind === 293) {
+ if (tag && tag.kind === 294) {
return tag;
}
}
@@ -18080,7 +18170,7 @@ var ts;
case 57:
if (canParseTag) {
var child = tryParseChildTag(target);
- if (child && child.kind === 292 &&
+ if (child && child.kind === 293 &&
target !== 4 &&
(ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
return false;
@@ -18141,48 +18231,44 @@ var ts;
return tag;
}
function parseTemplateTag(atToken, tagName) {
- if (ts.some(tags, ts.isJSDocTemplateTag)) {
- parseErrorAt(tagName.pos, scanner.getTokenPos(), ts.Diagnostics._0_tag_already_specified, tagName.escapedText);
+ var constraint;
+ if (token() === 17) {
+ constraint = parseJSDocTypeExpression();
}
var typeParameters = [];
var typeParametersPos = getNodePos();
- while (true) {
- var typeParameter = createNode(147);
- var name = parseJSDocIdentifierNameWithOptionalBraces();
+ do {
skipWhitespace();
- if (!name) {
- parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected);
+ var typeParameter = createNode(148);
+ if (!ts.tokenIsIdentifierOrKeyword(token())) {
+ parseErrorAtCurrentToken(ts.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);
return undefined;
}
- typeParameter.name = name;
+ typeParameter.name = parseJSDocIdentifierName();
+ skipWhitespace();
finishNode(typeParameter);
typeParameters.push(typeParameter);
- if (token() === 26) {
- nextJSDocToken();
- skipWhitespace();
- }
- else {
- break;
- }
+ } while (parseOptionalJsdoc(26));
+ if (constraint) {
+ ts.first(typeParameters).constraint = constraint.type;
}
- var result = createNode(295, atToken.pos);
+ var result = createNode(296, atToken.pos);
result.atToken = atToken;
result.tagName = tagName;
result.typeParameters = createNodeArray(typeParameters, typeParametersPos);
finishNode(result);
return result;
}
- function parseJSDocIdentifierNameWithOptionalBraces() {
- var parsedBrace = parseOptional(17);
- var res = parseJSDocIdentifierName();
- if (parsedBrace) {
- parseExpected(18);
- }
- return res;
- }
function nextJSDocToken() {
return currentToken = scanner.scanJSDocToken();
}
+ function parseOptionalJsdoc(t) {
+ if (token() === t) {
+ nextJSDocToken();
+ return true;
+ }
+ return false;
+ }
function parseJSDocEntityName() {
var entity = parseJSDocIdentifierName(true);
if (parseOptional(21)) {
@@ -18576,10 +18662,7 @@ var ts;
break;
}
case "amd-dependency": {
- context.amdDependencies = ts.map(ts.toArray(entryOrList), function (_a) {
- var _b = _a.arguments, name = _b.name, path = _b.path;
- return ({ name: name, path: path });
- });
+ context.amdDependencies = ts.map(ts.toArray(entryOrList), function (x) { return ({ name: x.arguments.name, path: x.arguments.path }); });
break;
}
case "amd-module": {
@@ -18711,6 +18794,20 @@ var ts;
}
return argMap;
}
+ function tagNamesAreEquivalent(lhs, rhs) {
+ if (lhs.kind !== rhs.kind) {
+ return false;
+ }
+ if (lhs.kind === 71) {
+ return lhs.escapedText === rhs.escapedText;
+ }
+ if (lhs.kind === 99) {
+ return true;
+ }
+ return lhs.name.escapedText === rhs.name.escapedText &&
+ tagNamesAreEquivalent(lhs.expression, rhs.expression);
+ }
+ ts.tagNamesAreEquivalent = tagNamesAreEquivalent;
})(ts || (ts = {}));
var ts;
(function (ts) {
@@ -18726,21 +18823,21 @@ var ts;
ts.getModuleInstanceState = getModuleInstanceState;
function getModuleInstanceStateWorker(node) {
switch (node.kind) {
- case 235:
case 236:
- return 0;
case 237:
+ return 0;
+ case 238:
if (ts.isConst(node)) {
return 2;
}
break;
+ case 244:
case 243:
- case 242:
if (!(ts.hasModifier(node, 1))) {
return 0;
}
break;
- case 239: {
+ case 240: {
var state_1 = 0;
ts.forEachChild(node, function (n) {
var childState = getModuleInstanceStateWorker(n);
@@ -18759,7 +18856,7 @@ var ts;
});
return state_1;
}
- case 238:
+ case 239:
return getModuleInstanceState(node);
case 71:
if (node.isInJSDocNamespace) {
@@ -18882,13 +18979,13 @@ var ts;
if (symbolFlags & 67216319) {
var valueDeclaration = symbol.valueDeclaration;
if (!valueDeclaration ||
- (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 238)) {
+ (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 239)) {
symbol.valueDeclaration = node;
}
}
}
function getDeclarationName(node) {
- if (node.kind === 248) {
+ if (node.kind === 249) {
return node.isExportEquals ? "export=" : "default";
}
var name = ts.getNameOfDeclaration(node);
@@ -18897,7 +18994,7 @@ var ts;
var moduleName = ts.getTextOfIdentifierOrLiteral(name);
return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\"");
}
- if (name.kind === 146) {
+ if (name.kind === 147) {
var nameExpression = name.expression;
if (ts.isStringOrNumericLiteral(nameExpression)) {
return ts.escapeLeadingUnderscores(nameExpression.text);
@@ -18908,31 +19005,31 @@ var ts;
return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined;
}
switch (node.kind) {
- case 154:
+ case 155:
return "__constructor";
- case 162:
- case 157:
- case 287:
- return "__call";
case 163:
case 158:
- return "__new";
+ case 288:
+ return "__call";
+ case 164:
case 159:
+ return "__new";
+ case 160:
return "__index";
- case 249:
+ case 250:
return "__export";
- case 273:
+ case 274:
return "export=";
- case 199:
+ case 200:
if (ts.getSpecialPropertyAssignmentKind(node) === 2) {
return "export=";
}
ts.Debug.fail("Unknown binary declaration kind");
break;
- case 283:
+ case 284:
return (ts.isJSDocConstructSignature(node) ? "__new" : "__call");
- case 148:
- ts.Debug.assert(node.parent.kind === 283, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; });
+ case 149:
+ ts.Debug.assert(node.parent.kind === 284, "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;
@@ -18982,7 +19079,7 @@ var ts;
}
else {
if (symbol.declarations && symbol.declarations.length &&
- (node.kind === 248 && !node.isExportEquals)) {
+ (node.kind === 249 && !node.isExportEquals)) {
message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports;
}
}
@@ -19007,7 +19104,7 @@ var ts;
function declareModuleMember(node, symbolFlags, symbolExcludes) {
var hasExportModifier = ts.getCombinedModifierFlags(node) & 1;
if (symbolFlags & 2097152) {
- if (node.kind === 251 || (node.kind === 242 && hasExportModifier)) {
+ if (node.kind === 252 || (node.kind === 243 && hasExportModifier)) {
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
}
else {
@@ -19037,7 +19134,7 @@ var ts;
var saveThisParentContainer = thisParentContainer;
var savedBlockScopeContainer = blockScopeContainer;
if (containerFlags & 1) {
- if (node.kind !== 192) {
+ if (node.kind !== 193) {
thisParentContainer = container;
}
container = blockScopeContainer = node;
@@ -19065,7 +19162,7 @@ var ts;
currentFlow.container = node;
}
}
- currentReturnTarget = isIIFE || node.kind === 154 ? createBranchLabel() : undefined;
+ currentReturnTarget = isIIFE || node.kind === 155 ? createBranchLabel() : undefined;
currentBreakTarget = undefined;
currentContinueTarget = undefined;
activeLabels = undefined;
@@ -19077,13 +19174,13 @@ var ts;
if (hasExplicitReturn)
node.flags |= 256;
}
- if (node.kind === 273) {
+ if (node.kind === 274) {
node.flags |= emitFlags;
}
if (currentReturnTarget) {
addAntecedent(currentReturnTarget, currentFlow);
currentFlow = finishFlowLabel(currentReturnTarget);
- if (node.kind === 154) {
+ if (node.kind === 155) {
node.returnFlowNode = currentFlow;
}
}
@@ -19126,8 +19223,8 @@ var ts;
}
}
function bindEachFunctionsFirst(nodes) {
- bindEach(nodes, function (n) { return n.kind === 233 ? bind(n) : undefined; });
- bindEach(nodes, function (n) { return n.kind !== 233 ? bind(n) : undefined; });
+ bindEach(nodes, function (n) { return n.kind === 234 ? bind(n) : undefined; });
+ bindEach(nodes, function (n) { return n.kind !== 234 ? bind(n) : undefined; });
}
function bindEach(nodes, bindFunction) {
if (bindFunction === void 0) { bindFunction = bind; }
@@ -19159,76 +19256,76 @@ var ts;
return;
}
switch (node.kind) {
- case 218:
+ case 219:
bindWhileStatement(node);
break;
- case 217:
+ case 218:
bindDoStatement(node);
break;
- case 219:
+ case 220:
bindForStatement(node);
break;
- case 220:
case 221:
+ case 222:
bindForInOrForOfStatement(node);
break;
- case 216:
+ case 217:
bindIfStatement(node);
break;
- case 224:
- case 228:
+ case 225:
+ case 229:
bindReturnOrThrow(node);
break;
+ case 224:
case 223:
- case 222:
bindBreakOrContinueStatement(node);
break;
- case 229:
+ case 230:
bindTryStatement(node);
break;
- case 226:
+ case 227:
bindSwitchStatement(node);
break;
- case 240:
+ case 241:
bindCaseBlock(node);
break;
- case 265:
+ case 266:
bindCaseClause(node);
break;
- case 227:
+ case 228:
bindLabeledStatement(node);
break;
- case 197:
+ case 198:
bindPrefixUnaryExpressionFlow(node);
break;
- case 198:
+ case 199:
bindPostfixUnaryExpressionFlow(node);
break;
- case 199:
+ case 200:
bindBinaryExpressionFlow(node);
break;
- case 193:
+ case 194:
bindDeleteExpressionFlow(node);
break;
- case 200:
+ case 201:
bindConditionalExpressionFlow(node);
break;
- case 231:
+ case 232:
bindVariableDeclarationFlow(node);
break;
- case 186:
+ case 187:
bindCallExpressionFlow(node);
break;
- case 296:
- case 291:
+ case 297:
+ case 292:
bindJSDocTypeAlias(node);
break;
- case 273:
+ case 274:
bindEachFunctionsFirst(node.statements);
bind(node.endOfFileToken);
break;
- case 212:
- case 239:
+ case 213:
+ case 240:
bindEachFunctionsFirst(node.statements);
break;
default:
@@ -19241,15 +19338,15 @@ var ts;
switch (expr.kind) {
case 71:
case 99:
- case 184:
+ case 185:
return isNarrowableReference(expr);
- case 186:
+ case 187:
return hasNarrowableArgument(expr);
- case 190:
+ case 191:
return isNarrowingExpression(expr.expression);
- case 199:
+ case 200:
return isNarrowingBinaryExpression(expr);
- case 197:
+ case 198:
return expr.operator === 51 && isNarrowingExpression(expr.operand);
}
return false;
@@ -19258,7 +19355,7 @@ var ts;
return expr.kind === 71 ||
expr.kind === 99 ||
expr.kind === 97 ||
- expr.kind === 184 && isNarrowableReference(expr.expression);
+ expr.kind === 185 && isNarrowableReference(expr.expression);
}
function hasNarrowableArgument(expr) {
if (expr.arguments) {
@@ -19269,7 +19366,7 @@ var ts;
}
}
}
- if (expr.expression.kind === 184 &&
+ if (expr.expression.kind === 185 &&
isNarrowableReference(expr.expression.expression)) {
return true;
}
@@ -19302,9 +19399,9 @@ var ts;
}
function isNarrowableOperand(expr) {
switch (expr.kind) {
- case 190:
+ case 191:
return isNarrowableOperand(expr.expression);
- case 199:
+ case 200:
switch (expr.operatorToken.kind) {
case 58:
return isNarrowableOperand(expr.left);
@@ -19381,33 +19478,33 @@ var ts;
function isStatementCondition(node) {
var parent = node.parent;
switch (parent.kind) {
- case 216:
- case 218:
case 217:
- return parent.expression === node;
case 219:
- case 200:
+ case 218:
+ return parent.expression === node;
+ case 220:
+ case 201:
return parent.condition === node;
}
return false;
}
function isLogicalExpression(node) {
while (true) {
- if (node.kind === 190) {
+ if (node.kind === 191) {
node = node.expression;
}
- else if (node.kind === 197 && node.operator === 51) {
+ else if (node.kind === 198 && node.operator === 51) {
node = node.operand;
}
else {
- return node.kind === 199 && (node.operatorToken.kind === 53 ||
+ return node.kind === 200 && (node.operatorToken.kind === 53 ||
node.operatorToken.kind === 54);
}
}
}
function isTopLevelLogicalExpression(node) {
- while (node.parent.kind === 190 ||
- node.parent.kind === 197 &&
+ while (node.parent.kind === 191 ||
+ node.parent.kind === 198 &&
node.parent.operator === 51) {
node = node.parent;
}
@@ -19449,7 +19546,7 @@ var ts;
}
function bindDoStatement(node) {
var preDoLabel = createLoopLabel();
- var enclosingLabeledStatement = node.parent.kind === 227
+ var enclosingLabeledStatement = node.parent.kind === 228
? ts.lastOrUndefined(activeLabels)
: undefined;
var preConditionLabel = enclosingLabeledStatement ? enclosingLabeledStatement.continueTarget : createBranchLabel();
@@ -19481,13 +19578,13 @@ var ts;
var postLoopLabel = createBranchLabel();
addAntecedent(preLoopLabel, currentFlow);
currentFlow = preLoopLabel;
- if (node.kind === 221) {
+ if (node.kind === 222) {
bind(node.awaitModifier);
}
bind(node.expression);
addAntecedent(postLoopLabel, currentFlow);
bind(node.initializer);
- if (node.initializer.kind !== 232) {
+ if (node.initializer.kind !== 233) {
bindAssignmentTargetFlow(node.initializer);
}
bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
@@ -19509,7 +19606,7 @@ var ts;
}
function bindReturnOrThrow(node) {
bind(node.expression);
- if (node.kind === 224) {
+ if (node.kind === 225) {
hasExplicitReturn = true;
if (currentReturnTarget) {
addAntecedent(currentReturnTarget, currentFlow);
@@ -19529,7 +19626,7 @@ var ts;
return undefined;
}
function bindBreakOrContinueFlow(node, breakTarget, continueTarget) {
- var flowLabel = node.kind === 223 ? breakTarget : continueTarget;
+ var flowLabel = node.kind === 224 ? breakTarget : continueTarget;
if (flowLabel) {
addAntecedent(flowLabel, currentFlow);
currentFlow = unreachableFlow;
@@ -19592,7 +19689,7 @@ var ts;
preSwitchCaseFlow = currentFlow;
bind(node.caseBlock);
addAntecedent(postSwitchLabel, currentFlow);
- var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 266; });
+ var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 267; });
node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents;
if (!hasDefault) {
addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0));
@@ -19614,6 +19711,7 @@ var ts;
}
var preCaseLabel = createBranchLabel();
addAntecedent(preCaseLabel, createFlowSwitchClause(preSwitchCaseFlow, node.parent, clauseStart, i + 1));
+ addAntecedent(preCaseLabel, createFlowSwitchClause(preSwitchCaseFlow, node.parent, clauseStart, i + 1));
addAntecedent(preCaseLabel, fallthroughFlow);
currentFlow = finishFlowLabel(preCaseLabel);
var clause = clauses[i];
@@ -19655,15 +19753,15 @@ var ts;
bind(node.statement);
popActiveLabel();
if (!activeLabel.referenced && !options.allowUnusedLabels) {
- file.bindDiagnostics.push(createDiagnosticForNode(node.label, ts.Diagnostics.Unused_label));
+ errorOrSuggestionOnFirstToken(ts.unusedLabelIsError(options), node, ts.Diagnostics.Unused_label);
}
- if (!node.statement || node.statement.kind !== 217) {
+ if (!node.statement || node.statement.kind !== 218) {
addAntecedent(postStatementLabel, currentFlow);
currentFlow = finishFlowLabel(postStatementLabel);
}
}
function bindDestructuringTargetFlow(node) {
- if (node.kind === 199 && node.operatorToken.kind === 58) {
+ if (node.kind === 200 && node.operatorToken.kind === 58) {
bindAssignmentTargetFlow(node.left);
}
else {
@@ -19674,10 +19772,10 @@ var ts;
if (isNarrowableReference(node)) {
currentFlow = createFlowAssignment(currentFlow, node);
}
- else if (node.kind === 182) {
+ else if (node.kind === 183) {
for (var _i = 0, _a = node.elements; _i < _a.length; _i++) {
var e = _a[_i];
- if (e.kind === 203) {
+ if (e.kind === 204) {
bindAssignmentTargetFlow(e.expression);
}
else {
@@ -19685,16 +19783,16 @@ var ts;
}
}
}
- else if (node.kind === 183) {
+ else if (node.kind === 184) {
for (var _b = 0, _c = node.properties; _b < _c.length; _b++) {
var p = _c[_b];
- if (p.kind === 269) {
+ if (p.kind === 270) {
bindDestructuringTargetFlow(p.initializer);
}
- else if (p.kind === 270) {
+ else if (p.kind === 271) {
bindAssignmentTargetFlow(p.name);
}
- else if (p.kind === 271) {
+ else if (p.kind === 272) {
bindAssignmentTargetFlow(p.expression);
}
}
@@ -19750,7 +19848,7 @@ var ts;
bindEachChild(node);
if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) {
bindAssignmentTargetFlow(node.left);
- if (operator === 58 && node.left.kind === 185) {
+ if (operator === 58 && node.left.kind === 186) {
var elementAccess = node.left;
if (isNarrowableOperand(elementAccess.expression)) {
currentFlow = createFlowArrayMutation(currentFlow, node);
@@ -19761,7 +19859,7 @@ var ts;
}
function bindDeleteExpressionFlow(node) {
bindEachChild(node);
- if (node.expression.kind === 184) {
+ if (node.expression.kind === 185) {
bindAssignmentTargetFlow(node.expression);
}
}
@@ -19805,10 +19903,10 @@ var ts;
}
function bindCallExpressionFlow(node) {
var expr = node.expression;
- while (expr.kind === 190) {
+ while (expr.kind === 191) {
expr = expr.expression;
}
- if (expr.kind === 191 || expr.kind === 192) {
+ if (expr.kind === 192 || expr.kind === 193) {
bindEach(node.typeArguments);
bindEach(node.arguments);
bind(node.expression);
@@ -19816,7 +19914,7 @@ var ts;
else {
bindEachChild(node);
}
- if (node.expression.kind === 184) {
+ if (node.expression.kind === 185) {
var propertyAccess = node.expression;
if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) {
currentFlow = createFlowArrayMutation(currentFlow, node);
@@ -19825,53 +19923,53 @@ var ts;
}
function getContainerFlags(node) {
switch (node.kind) {
- case 204:
- case 234:
- case 237:
- case 183:
- case 165:
- case 286:
- case 262:
- return 1;
+ case 205:
case 235:
- return 1 | 64;
case 238:
+ case 184:
+ case 166:
+ case 287:
+ case 263:
+ return 1;
case 236:
- case 176:
+ return 1 | 64;
+ case 239:
+ case 237:
+ case 177:
return 1 | 32;
- case 273:
+ case 274:
return 1 | 4 | 32;
- case 153:
+ case 154:
if (ts.isObjectLiteralOrClassExpressionMethod(node)) {
return 1 | 4 | 32 | 8 | 128;
}
- case 154:
- case 233:
- case 152:
case 155:
+ case 234:
+ case 153:
case 156:
case 157:
- case 287:
- case 283:
- case 162:
case 158:
- case 159:
+ case 288:
+ case 284:
case 163:
+ case 159:
+ case 160:
+ case 164:
return 1 | 4 | 32 | 8;
- case 191:
case 192:
+ case 193:
return 1 | 4 | 32 | 8 | 16;
- case 239:
+ case 240:
return 4;
- case 151:
+ case 152:
return node.initializer ? 4 : 0;
- case 268:
- case 219:
+ case 269:
case 220:
case 221:
- case 240:
+ case 222:
+ case 241:
return 2;
- case 212:
+ case 213:
return ts.isFunctionLike(node.parent) ? 0 : 2;
}
return 0;
@@ -19884,40 +19982,40 @@ var ts;
}
function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) {
switch (container.kind) {
- case 238:
+ case 239:
return declareModuleMember(node, symbolFlags, symbolExcludes);
- case 273:
+ case 274:
return declareSourceFileMember(node, symbolFlags, symbolExcludes);
- case 204:
- case 234:
- return declareClassMember(node, symbolFlags, symbolExcludes);
- case 237:
- return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
- case 165:
- case 286:
- case 183:
+ case 205:
case 235:
- case 262:
- return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes);
- case 162:
- case 163:
- case 157:
- case 158:
+ return declareClassMember(node, symbolFlags, symbolExcludes);
+ case 238:
+ return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
+ case 166:
case 287:
+ case 184:
+ case 236:
+ case 263:
+ return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes);
+ case 163:
+ case 164:
+ case 158:
case 159:
- case 153:
- case 152:
+ case 288:
+ case 160:
case 154:
+ case 153:
case 155:
case 156:
- case 233:
- case 191:
+ case 157:
+ case 234:
case 192:
- case 283:
- case 296:
- case 291:
- case 236:
- case 176:
+ case 193:
+ case 284:
+ case 297:
+ case 292:
+ case 237:
+ case 177:
return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes);
}
}
@@ -19932,11 +20030,11 @@ var ts;
: declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes);
}
function hasExportDeclarations(node) {
- var body = node.kind === 273 ? node : node.body;
- if (body && (body.kind === 273 || body.kind === 239)) {
+ var body = node.kind === 274 ? node : node.body;
+ if (body && (body.kind === 274 || body.kind === 240)) {
for (var _i = 0, _a = body.statements; _i < _a.length; _i++) {
var stat = _a[_i];
- if (stat.kind === 249 || stat.kind === 248) {
+ if (stat.kind === 250 || stat.kind === 249) {
return true;
}
}
@@ -20009,11 +20107,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 === 271 || prop.name.kind !== 71) {
+ if (prop.kind === 272 || prop.name.kind !== 71) {
continue;
}
var identifier = prop.name;
- var currentKind = prop.kind === 269 || prop.kind === 270 || prop.kind === 153
+ var currentKind = prop.kind === 270 || prop.kind === 271 || prop.kind === 154
? 1
: 2;
var existingKind = seen.get(identifier.escapedText);
@@ -20041,13 +20139,14 @@ var ts;
symbol.parent = container.symbol;
}
addDeclarationToSymbol(symbol, node, symbolFlags);
+ return symbol;
}
function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) {
switch (blockScopeContainer.kind) {
- case 238:
+ case 239:
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
- case 273:
+ case 274:
if (ts.isExternalOrCommonJsModule(container)) {
declareModuleMember(node, symbolFlags, symbolExcludes);
break;
@@ -20167,8 +20266,8 @@ var ts;
}
function checkStrictModeFunctionDeclaration(node) {
if (languageVersion < 2) {
- if (blockScopeContainer.kind !== 273 &&
- blockScopeContainer.kind !== 238 &&
+ if (blockScopeContainer.kind !== 274 &&
+ blockScopeContainer.kind !== 239 &&
!ts.isFunctionLike(blockScopeContainer)) {
var errorSpan = ts.getErrorSpanForNode(file, node);
file.bindDiagnostics.push(ts.createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node)));
@@ -20201,6 +20300,16 @@ var ts;
var span = ts.getSpanOfTokenAtPosition(file, node.pos);
file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, message, arg0, arg1, arg2));
}
+ function errorOrSuggestionOnFirstToken(isError, node, message, arg0, arg1, arg2) {
+ var span = ts.getSpanOfTokenAtPosition(file, node.pos);
+ var diag = ts.createFileDiagnostic(file, span.start, span.length, message, arg0, arg1, arg2);
+ if (isError) {
+ file.bindDiagnostics.push(diag);
+ }
+ else {
+ file.bindSuggestionDiagnostics = ts.append(file.bindSuggestionDiagnostics, __assign({}, diag, { category: ts.DiagnosticCategory.Suggestion }));
+ }
+ }
function bind(node) {
if (!node) {
return;
@@ -20208,7 +20317,7 @@ var ts;
node.parent = parent;
var saveInStrictMode = inStrictMode;
bindWorker(node);
- if (node.kind > 144) {
+ if (node.kind > 145) {
var saveParent = parent;
parent = node;
var containerFlags = getContainerFlags(node);
@@ -20272,11 +20381,11 @@ var ts;
break;
}
case 99:
- if (currentFlow && (ts.isExpression(node) || parent.kind === 270)) {
+ if (currentFlow && (ts.isExpression(node) || parent.kind === 271)) {
node.flowNode = currentFlow;
}
return checkStrictModeIdentifier(node);
- case 184:
+ case 185:
if (currentFlow && isNarrowableReference(node)) {
node.flowNode = currentFlow;
}
@@ -20284,7 +20393,7 @@ var ts;
bindSpecialPropertyDeclaration(node);
}
break;
- case 199:
+ case 200:
var specialKind = ts.getSpecialPropertyAssignmentKind(node);
switch (specialKind) {
case 1:
@@ -20311,127 +20420,127 @@ var ts;
ts.Debug.fail("Unknown special property assignment kind");
}
return checkStrictModeBinaryExpression(node);
- case 268:
+ case 269:
return checkStrictModeCatchClause(node);
- case 193:
+ case 194:
return checkStrictModeDeleteExpression(node);
case 8:
return checkStrictModeNumericLiteral(node);
- case 198:
+ case 199:
return checkStrictModePostfixUnaryExpression(node);
- case 197:
+ case 198:
return checkStrictModePrefixUnaryExpression(node);
- case 225:
+ case 226:
return checkStrictModeWithStatement(node);
- case 173:
+ case 174:
seenThisKeyword = true;
return;
- case 160:
+ case 161:
break;
- case 147:
- return bindTypeParameter(node);
case 148:
+ return bindTypeParameter(node);
+ case 149:
return bindParameter(node);
- case 231:
+ case 232:
return bindVariableDeclarationOrBindingElement(node);
- case 181:
+ case 182:
node.flowNode = currentFlow;
return bindVariableDeclarationOrBindingElement(node);
+ case 152:
case 151:
- case 150:
return bindPropertyWorker(node);
- case 269:
case 270:
+ case 271:
return bindPropertyOrMethodOrAccessor(node, 4, 0);
- case 272:
+ case 273:
return bindPropertyOrMethodOrAccessor(node, 8, 68008959);
- case 157:
case 158:
case 159:
+ case 160:
return declareSymbolAndAddToSymbolTable(node, 131072, 0);
- case 153:
- case 152:
- return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 16777216 : 0), ts.isObjectLiteralMethod(node) ? 0 : 67208127);
- case 233:
- return bindFunctionDeclaration(node);
case 154:
- return declareSymbolAndAddToSymbolTable(node, 16384, 0);
+ case 153:
+ return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 16777216 : 0), ts.isObjectLiteralMethod(node) ? 0 : 67208127);
+ case 234:
+ return bindFunctionDeclaration(node);
case 155:
- return bindPropertyOrMethodOrAccessor(node, 32768, 67150783);
+ return declareSymbolAndAddToSymbolTable(node, 16384, 0);
case 156:
+ return bindPropertyOrMethodOrAccessor(node, 32768, 67150783);
+ case 157:
return bindPropertyOrMethodOrAccessor(node, 65536, 67183551);
- case 162:
- case 283:
- case 287:
case 163:
+ case 284:
+ case 288:
+ case 164:
return bindFunctionOrConstructorType(node);
- case 165:
- case 286:
- case 176:
+ case 166:
+ case 287:
+ case 177:
return bindAnonymousTypeWorker(node);
- case 183:
+ case 184:
return bindObjectLiteralExpression(node);
- case 191:
case 192:
+ case 193:
return bindFunctionExpression(node);
- case 186:
+ case 187:
if (ts.isInJavaScriptFile(node)) {
bindCallExpression(node);
}
break;
- case 204:
- case 234:
+ case 205:
+ case 235:
inStrictMode = true;
return bindClassLikeDeclaration(node);
- case 235:
- return bindBlockScopedDeclaration(node, 64, 67901832);
case 236:
- return bindBlockScopedDeclaration(node, 524288, 67901928);
+ return bindBlockScopedDeclaration(node, 64, 67901832);
case 237:
- return bindEnumDeclaration(node);
+ return bindBlockScopedDeclaration(node, 524288, 67901928);
case 238:
+ return bindEnumDeclaration(node);
+ case 239:
return bindModuleDeclaration(node);
- case 262:
+ case 263:
return bindJsxAttributes(node);
- case 261:
+ case 262:
return bindJsxAttribute(node, 4, 0);
- case 242:
- case 245:
- case 247:
- case 251:
- return declareSymbolAndAddToSymbolTable(node, 2097152, 2097152);
- case 241:
- return bindNamespaceExportDeclaration(node);
- case 244:
- return bindImportClause(node);
- case 249:
- return bindExportDeclaration(node);
+ case 243:
+ case 246:
case 248:
+ case 252:
+ return declareSymbolAndAddToSymbolTable(node, 2097152, 2097152);
+ case 242:
+ return bindNamespaceExportDeclaration(node);
+ case 245:
+ return bindImportClause(node);
+ case 250:
+ return bindExportDeclaration(node);
+ case 249:
return bindExportAssignment(node);
- case 273:
+ case 274:
updateStrictModeStatementList(node.statements);
return bindSourceFileIfExternalModule();
- case 212:
+ case 213:
if (!ts.isFunctionLike(node.parent)) {
return;
}
- case 239:
+ case 240:
return updateStrictModeStatementList(node.statements);
- case 292:
- if (node.parent.kind === 287) {
+ case 293:
+ if (node.parent.kind === 288) {
return bindParameter(node);
}
- if (node.parent.kind !== 286) {
+ if (node.parent.kind !== 287) {
break;
}
- case 297:
+ case 298:
var propTag = node;
- var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 282 ?
+ var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 283 ?
4 | 16777216 :
4;
return declareSymbolAndAddToSymbolTable(propTag, flags, 0);
- case 296:
- case 291:
+ case 297:
+ case 292:
return (delayedTypeAliases || (delayedTypeAliases = [])).push(node);
}
}
@@ -20461,7 +20570,7 @@ var ts;
bindAnonymousDeclaration(node, 2097152, getDeclarationName(node));
}
else {
- var flags = node.kind === 248 && ts.exportAssignmentIsAlias(node)
+ var flags = node.kind === 249 && ts.exportAssignmentIsAlias(node)
? 2097152
: 4;
declareSymbol(container.symbol.exports, container.symbol, node, flags, 67108863);
@@ -20471,7 +20580,7 @@ var ts;
if (node.modifiers && node.modifiers.length) {
file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Modifiers_cannot_appear_here));
}
- if (node.parent.kind !== 273) {
+ if (node.parent.kind !== 274) {
file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_at_top_level));
return;
}
@@ -20513,13 +20622,11 @@ var ts;
function bindExportsPropertyAssignment(node) {
setCommonJsModuleIndicator(node);
var lhs = node.left;
- var symbol = forEachIdentifierInEntityName(lhs.expression, function (id, original) {
- if (!original) {
- return undefined;
+ var symbol = forEachIdentifierInEntityName(lhs.expression, undefined, function (id, symbol) {
+ if (symbol) {
+ addDeclarationToSymbol(symbol, id, 1536 | 67108864);
}
- var s = ts.getJSInitializerSymbol(original);
- addDeclarationToSymbol(s, id, 1536 | 67108864);
- return s;
+ return symbol;
});
if (symbol) {
var flags = ts.isClassExpression(node.right) ?
@@ -20544,13 +20651,13 @@ var ts;
ts.Debug.assert(ts.isInJavaScriptFile(node));
var thisContainer = ts.getThisContainer(node, false);
switch (thisContainer.kind) {
- case 233:
- case 191:
+ case 234:
+ case 192:
var constructorSymbol = thisContainer.symbol;
if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 58) {
var l = thisContainer.parent.left;
if (ts.isPropertyAccessEntityNameExpression(l) && ts.isPrototypeAccess(l.expression)) {
- constructorSymbol = getJSInitializerSymbolFromName(l.expression.expression, thisParentContainer);
+ constructorSymbol = lookupSymbolForPropertyAccess(l.expression.expression, thisParentContainer);
}
}
if (constructorSymbol) {
@@ -20558,16 +20665,16 @@ var ts;
declareSymbol(constructorSymbol.members, constructorSymbol, node, 4, 0 & ~4);
}
break;
- case 154:
- case 151:
- case 153:
case 155:
+ case 152:
+ case 154:
case 156:
+ case 157:
var containingClass = thisContainer.parent;
var symbolTable = ts.hasModifier(thisContainer, 32) ? containingClass.symbol.exports : containingClass.symbol.members;
declareSymbol(symbolTable, containingClass.symbol, node, 4, 0, true);
break;
- case 273:
+ case 274:
break;
default:
ts.Debug.fail(ts.Debug.showSyntaxKind(thisContainer));
@@ -20577,7 +20684,7 @@ var ts;
if (node.expression.kind === 99) {
bindThisPropertyAssignment(node);
}
- else if (ts.isPropertyAccessEntityNameExpression(node) && node.parent.parent.kind === 273) {
+ else if (ts.isPropertyAccessEntityNameExpression(node) && node.parent.parent.kind === 274) {
if (ts.isPrototypeAccess(node.expression)) {
bindPrototypePropertyAssignment(node, node.parent);
}
@@ -20615,39 +20722,52 @@ var ts;
node.expression.parent = node;
bindPropertyAssignment(node.expression, node, false);
}
- function getJSInitializerSymbolFromName(name, lookupContainer) {
- return ts.getJSInitializerSymbol(lookupSymbolForPropertyAccess(name, lookupContainer));
- }
function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty) {
- var symbol = getJSInitializerSymbolFromName(name);
+ var namespaceSymbol = lookupSymbolForPropertyAccess(name);
var isToplevelNamespaceableInitializer = ts.isBinaryExpression(propertyAccess.parent)
- ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 273 &&
+ ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 274 &&
!!ts.getJavascriptInitializer(ts.getInitializerOfBinaryExpression(propertyAccess.parent), ts.isPrototypeAccess(propertyAccess.parent.left))
- : propertyAccess.parent.parent.kind === 273;
- if (!isPrototypeProperty && (!symbol || !(symbol.flags & 1920)) && isToplevelNamespaceableInitializer) {
+ : propertyAccess.parent.parent.kind === 274;
+ if (!isPrototypeProperty && (!namespaceSymbol || !(namespaceSymbol.flags & 1920)) && isToplevelNamespaceableInitializer) {
var flags_1 = 1536 | 67108864;
var excludeFlags_1 = 67215503 & ~67108864;
- forEachIdentifierInEntityName(propertyAccess.expression, function (id, original) {
- if (original) {
- addDeclarationToSymbol(original, id, flags_1);
- return original;
+ namespaceSymbol = forEachIdentifierInEntityName(propertyAccess.expression, namespaceSymbol, function (id, symbol, parent) {
+ if (symbol) {
+ addDeclarationToSymbol(symbol, id, flags_1);
+ return symbol;
}
else {
- return symbol = declareSymbol(symbol ? symbol.exports : container.locals, symbol, id, flags_1, excludeFlags_1);
+ return declareSymbol(parent ? parent.exports : container.locals, parent, id, flags_1, excludeFlags_1);
}
});
}
- if (!symbol || !(symbol.flags & (16 | 32 | 1024 | 4096))) {
+ if (!namespaceSymbol || !isJavascriptContainer(namespaceSymbol)) {
return;
}
var symbolTable = isPrototypeProperty ?
- (symbol.members || (symbol.members = ts.createSymbolTable())) :
- (symbol.exports || (symbol.exports = ts.createSymbolTable()));
+ (namespaceSymbol.members || (namespaceSymbol.members = ts.createSymbolTable())) :
+ (namespaceSymbol.exports || (namespaceSymbol.exports = ts.createSymbolTable()));
var jsContainerFlag = isToplevelNamespaceableInitializer ? 67108864 : 0;
var isMethod = ts.isFunctionLikeDeclaration(ts.getAssignedJavascriptInitializer(propertyAccess));
var symbolFlags = (isMethod ? 8192 : 4) | jsContainerFlag;
var symbolExcludes = (isMethod ? 67208127 : 0) & ~jsContainerFlag;
- declareSymbol(symbolTable, symbol, propertyAccess, symbolFlags, symbolExcludes);
+ declareSymbol(symbolTable, namespaceSymbol, propertyAccess, symbolFlags, symbolExcludes);
+ }
+ function isJavascriptContainer(symbol) {
+ if (symbol.flags & (16 | 32 | 1024)) {
+ return true;
+ }
+ var node = symbol.valueDeclaration;
+ var init = !node ? undefined :
+ ts.isVariableDeclaration(node) ? node.initializer :
+ ts.isBinaryExpression(node) ? node.right :
+ ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) ? node.parent.right :
+ undefined;
+ if (init) {
+ var isPrototypeAssignment = ts.isPrototypeAccess(ts.isVariableDeclaration(node) ? node.name : ts.isBinaryExpression(node) ? node.left : node);
+ return !!ts.getJavascriptInitializer(ts.isBinaryExpression(init) && init.operatorToken.kind === 54 ? init.right : init, isPrototypeAssignment);
+ }
+ return false;
}
function getParentOfBinaryExpression(expr) {
while (ts.isBinaryExpression(expr.parent)) {
@@ -20661,21 +20781,22 @@ var ts;
return lookupSymbolForNameWorker(lookupContainer, node.escapedText);
}
else {
- var symbol = ts.getJSInitializerSymbol(lookupSymbolForPropertyAccess(node.expression));
+ var symbol = lookupSymbolForPropertyAccess(node.expression);
return symbol && symbol.exports && symbol.exports.get(node.name.escapedText);
}
}
- function forEachIdentifierInEntityName(e, action) {
+ function forEachIdentifierInEntityName(e, parent, action) {
if (isExportsOrModuleExportsOrAlias(file, e)) {
return file.symbol;
}
else if (ts.isIdentifier(e)) {
- return action(e, lookupSymbolForPropertyAccess(e));
+ return action(e, lookupSymbolForPropertyAccess(e), parent);
}
else {
- var s = ts.getJSInitializerSymbol(forEachIdentifierInEntityName(e.expression, action));
- ts.Debug.assert(!!s && !!s.exports);
- return action(e.name, s.exports.get(e.name.escapedText));
+ var s = forEachIdentifierInEntityName(e.expression, parent, action);
+ if (!s || !s.exports)
+ return ts.Debug.fail();
+ return action(e.name, s.exports.get(e.name.escapedText), s);
}
}
function bindCallExpression(node) {
@@ -20684,7 +20805,7 @@ var ts;
}
}
function bindClassLikeDeclaration(node) {
- if (node.kind === 234) {
+ if (node.kind === 235) {
bindBlockScopedDeclaration(node, 32, 68008383);
}
else {
@@ -20728,7 +20849,7 @@ var ts;
}
}
function bindParameter(node) {
- if (node.kind === 292 && container.kind !== 287) {
+ if (node.kind === 293 && container.kind !== 288) {
return;
}
if (inStrictMode && !(node.flags & 4194304)) {
@@ -20801,7 +20922,7 @@ var ts;
declareSymbolAndAddToSymbolTable(node, 262144, 67639784);
}
}
- else if (node.parent.kind === 171) {
+ else if (node.parent.kind === 172) {
var container_2 = getInferTypeContainer(node.parent);
if (container_2) {
if (!container_2.locals) {
@@ -20819,26 +20940,26 @@ var ts;
}
function shouldReportErrorOnModuleDeclaration(node) {
var instanceState = getModuleInstanceState(node);
- return instanceState === 1 || (instanceState === 2 && options.preserveConstEnums);
+ return instanceState === 1 || (instanceState === 2 && !!options.preserveConstEnums);
}
function checkUnreachable(node) {
if (!(currentFlow.flags & 1)) {
return false;
}
if (currentFlow === unreachableFlow) {
- var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 214) ||
- node.kind === 234 ||
- (node.kind === 238 && shouldReportErrorOnModuleDeclaration(node)) ||
- (node.kind === 237 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums));
+ var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 215) ||
+ node.kind === 235 ||
+ (node.kind === 239 && shouldReportErrorOnModuleDeclaration(node)) ||
+ (node.kind === 238 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums));
if (reportError) {
currentFlow = reportedUnreachableFlow;
- var reportUnreachableCode = !options.allowUnreachableCode &&
- !(node.flags & 4194304) &&
- (node.kind !== 213 ||
- ts.getCombinedNodeFlags(node.declarationList) & 3 ||
- ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; }));
- if (reportUnreachableCode) {
- errorOnFirstToken(node, ts.Diagnostics.Unreachable_code_detected);
+ if (!options.allowUnreachableCode) {
+ var isError = ts.unreachableCodeIsError(options) &&
+ !(node.flags & 4194304) &&
+ (!ts.isVariableStatement(node) ||
+ !!(ts.getCombinedNodeFlags(node.declarationList) & 3) ||
+ node.declarationList.declarations.some(function (d) { return !!d.initializer; }));
+ errorOrSuggestionOnFirstToken(isError, node, ts.Diagnostics.Unreachable_code_detected);
}
}
}
@@ -20853,8 +20974,8 @@ var ts;
ts.isExportsOrModuleExportsOrAlias = isExportsOrModuleExportsOrAlias;
function isNameOfExportsOrModuleExportsAliasDeclaration(sourceFile, node) {
var symbol = lookupSymbolForNameWorker(sourceFile, node.escapedText);
- return symbol && symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) &&
- symbol.valueDeclaration.initializer && isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, symbol.valueDeclaration.initializer);
+ return !!symbol && !!symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) &&
+ !!symbol.valueDeclaration.initializer && isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, symbol.valueDeclaration.initializer);
}
function isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node) {
return isExportsOrModuleExportsOrAlias(sourceFile, node) ||
@@ -20870,58 +20991,58 @@ var ts;
function computeTransformFlagsForNode(node, subtreeFlags) {
var kind = node.kind;
switch (kind) {
- case 186:
- return computeCallExpression(node, subtreeFlags);
case 187:
+ return computeCallExpression(node, subtreeFlags);
+ case 188:
return computeNewExpression(node, subtreeFlags);
- case 238:
+ case 239:
return computeModuleDeclaration(node, subtreeFlags);
- case 190:
- return computeParenthesizedExpression(node, subtreeFlags);
- case 199:
- return computeBinaryExpression(node, subtreeFlags);
- case 215:
- return computeExpressionStatement(node, subtreeFlags);
- case 148:
- return computeParameter(node, subtreeFlags);
- case 192:
- return computeArrowFunction(node, subtreeFlags);
case 191:
+ return computeParenthesizedExpression(node, subtreeFlags);
+ case 200:
+ return computeBinaryExpression(node, subtreeFlags);
+ case 216:
+ return computeExpressionStatement(node, subtreeFlags);
+ case 149:
+ return computeParameter(node, subtreeFlags);
+ case 193:
+ return computeArrowFunction(node, subtreeFlags);
+ case 192:
return computeFunctionExpression(node, subtreeFlags);
- case 233:
- return computeFunctionDeclaration(node, subtreeFlags);
- case 231:
- return computeVariableDeclaration(node, subtreeFlags);
- case 232:
- return computeVariableDeclarationList(node, subtreeFlags);
- case 213:
- return computeVariableStatement(node, subtreeFlags);
- case 227:
- return computeLabeledStatement(node, subtreeFlags);
case 234:
+ return computeFunctionDeclaration(node, subtreeFlags);
+ case 232:
+ return computeVariableDeclaration(node, subtreeFlags);
+ case 233:
+ return computeVariableDeclarationList(node, subtreeFlags);
+ case 214:
+ return computeVariableStatement(node, subtreeFlags);
+ case 228:
+ return computeLabeledStatement(node, subtreeFlags);
+ case 235:
return computeClassDeclaration(node, subtreeFlags);
- case 204:
+ case 205:
return computeClassExpression(node, subtreeFlags);
- case 267:
- return computeHeritageClause(node, subtreeFlags);
case 268:
+ return computeHeritageClause(node, subtreeFlags);
+ case 269:
return computeCatchClause(node, subtreeFlags);
- case 206:
+ case 207:
return computeExpressionWithTypeArguments(node, subtreeFlags);
- case 154:
- return computeConstructor(node, subtreeFlags);
- case 151:
- return computePropertyDeclaration(node, subtreeFlags);
- case 153:
- return computeMethod(node, subtreeFlags);
case 155:
+ return computeConstructor(node, subtreeFlags);
+ case 152:
+ return computePropertyDeclaration(node, subtreeFlags);
+ case 154:
+ return computeMethod(node, subtreeFlags);
case 156:
+ case 157:
return computeAccessor(node, subtreeFlags);
- case 242:
+ case 243:
return computeImportEquals(node, subtreeFlags);
- case 184:
- return computePropertyAccess(node, subtreeFlags);
case 185:
+ return computePropertyAccess(node, subtreeFlags);
+ case 186:
return computeElementAccess(node, subtreeFlags);
default:
return computeOther(node, kind, subtreeFlags);
@@ -20965,10 +21086,10 @@ var ts;
var transformFlags = subtreeFlags;
var operatorTokenKind = node.operatorToken.kind;
var leftKind = node.left.kind;
- if (operatorTokenKind === 58 && leftKind === 183) {
+ if (operatorTokenKind === 58 && leftKind === 184) {
transformFlags |= 8 | 192 | 3072;
}
- else if (operatorTokenKind === 58 && leftKind === 182) {
+ else if (operatorTokenKind === 58 && leftKind === 183) {
transformFlags |= 192 | 3072;
}
else if (operatorTokenKind === 40
@@ -21006,8 +21127,8 @@ var ts;
var expression = node.expression;
var expressionKind = expression.kind;
var expressionTransformFlags = expression.transformFlags;
- if (expressionKind === 207
- || expressionKind === 189) {
+ if (expressionKind === 208
+ || expressionKind === 190) {
transformFlags |= 3;
}
if (expressionTransformFlags & 1024) {
@@ -21306,12 +21427,12 @@ var ts;
var excludeFlags = 939525441;
switch (kind) {
case 120:
- case 196:
+ case 197:
transformFlags |= 8 | 16;
break;
- case 189:
- case 207:
- case 300:
+ case 190:
+ case 208:
+ case 301:
transformFlags |= 3;
excludeFlags = 536872257;
break;
@@ -21321,17 +21442,16 @@ var ts;
case 117:
case 124:
case 76:
- case 237:
- case 272:
- case 208:
+ case 238:
+ case 273:
+ case 209:
case 132:
transformFlags |= 3;
break;
- case 254:
case 255:
case 256:
- case 10:
case 257:
+ case 10:
case 258:
case 259:
case 260:
@@ -21339,17 +21459,18 @@ var ts;
case 262:
case 263:
case 264:
+ case 265:
transformFlags |= 4;
break;
case 13:
case 14:
case 15:
case 16:
- case 201:
- case 188:
- case 270:
+ case 202:
+ case 189:
+ case 271:
case 115:
- case 209:
+ case 210:
transformFlags |= 192;
break;
case 9:
@@ -21362,13 +21483,13 @@ var ts;
transformFlags |= 192;
}
break;
- case 221:
+ case 222:
if (node.awaitModifier) {
transformFlags |= 8;
}
transformFlags |= 192;
break;
- case 202:
+ case 203:
transformFlags |= 8 | 192 | 16777216;
break;
case 119:
@@ -21379,10 +21500,9 @@ var ts;
case 122:
case 138:
case 105:
- case 147:
- case 150:
- case 152:
- case 157:
+ case 148:
+ case 151:
+ case 153:
case 158:
case 159:
case 160:
@@ -21398,27 +21518,28 @@ var ts;
case 170:
case 171:
case 172:
- case 235:
- case 236:
case 173:
+ case 236:
+ case 237:
case 174:
case 175:
case 176:
case 177:
- case 241:
+ case 178:
+ case 242:
transformFlags = 3;
excludeFlags = -3;
break;
- case 146:
+ case 147:
transformFlags |= 2097152;
if (subtreeFlags & 16384) {
transformFlags |= 65536;
}
break;
- case 203:
+ case 204:
transformFlags |= 192 | 524288;
break;
- case 271:
+ case 272:
transformFlags |= 8 | 1048576;
break;
case 97:
@@ -21428,27 +21549,27 @@ var ts;
case 99:
transformFlags |= 16384;
break;
- case 179:
+ case 180:
transformFlags |= 192 | 8388608;
if (subtreeFlags & 524288) {
transformFlags |= 8 | 1048576;
}
excludeFlags = 940049729;
break;
- case 180:
+ case 181:
transformFlags |= 192 | 8388608;
excludeFlags = 940049729;
break;
- case 181:
+ case 182:
transformFlags |= 192;
if (node.dotDotDotToken) {
transformFlags |= 524288;
}
break;
- case 149:
+ case 150:
transformFlags |= 3 | 4096;
break;
- case 183:
+ case 184:
excludeFlags = 942740801;
if (subtreeFlags & 2097152) {
transformFlags |= 192;
@@ -21460,29 +21581,31 @@ var ts;
transformFlags |= 8;
}
break;
- case 182:
- case 187:
+ case 183:
+ case 188:
excludeFlags = 940049729;
if (subtreeFlags & 524288) {
transformFlags |= 192;
}
break;
- case 217:
case 218:
case 219:
case 220:
+ case 221:
if (subtreeFlags & 4194304) {
transformFlags |= 192;
}
break;
- case 273:
+ case 274:
if (subtreeFlags & 32768) {
transformFlags |= 192;
}
break;
- case 224:
- case 222:
+ case 225:
+ transformFlags |= 33554432 | 8;
+ break;
case 223:
+ case 224:
transformFlags |= 33554432;
break;
}
@@ -21490,33 +21613,33 @@ var ts;
return transformFlags & ~excludeFlags;
}
function getTransformFlagsSubtreeExclusions(kind) {
- if (kind >= 160 && kind <= 178) {
+ if (kind >= 161 && kind <= 179) {
return -3;
}
switch (kind) {
- case 186:
case 187:
- case 182:
+ case 188:
+ case 183:
return 940049729;
- case 238:
+ case 239:
return 977327425;
- case 148:
+ case 149:
return 939525441;
- case 192:
+ case 193:
return 1003902273;
- case 191:
- case 233:
- return 1003935041;
- case 232:
- return 948962625;
+ case 192:
case 234:
- case 204:
+ return 1003935041;
+ case 233:
+ return 948962625;
+ case 235:
+ case 205:
return 942011713;
- case 154:
- return 1003668801;
- case 153:
case 155:
+ return 1003668801;
+ case 154:
case 156:
+ case 157:
return 1003668801;
case 119:
case 134:
@@ -21526,30 +21649,30 @@ var ts;
case 122:
case 138:
case 105:
- case 147:
- case 150:
- case 152:
- case 157:
+ case 148:
+ case 151:
+ case 153:
case 158:
case 159:
- case 235:
+ case 160:
case 236:
+ case 237:
return -3;
- case 183:
+ case 184:
return 942740801;
- case 268:
+ case 269:
return 940574017;
- case 179:
case 180:
+ case 181:
return 940049729;
- case 189:
- case 207:
- case 300:
case 190:
+ case 208:
+ case 301:
+ case 191:
case 97:
return 536872257;
- case 184:
case 185:
+ case 186:
return 671089985;
default:
return 939525441;
@@ -21602,7 +21725,7 @@ var ts;
var shouldBail = visitSymbol(type.symbol);
if (shouldBail)
return;
- if (type.flags & 65536) {
+ if (type.flags & 131072) {
var objectType = type;
var objectFlags = objectType.objectFlags;
if (objectFlags & 4) {
@@ -21618,16 +21741,16 @@ var ts;
visitObjectType(objectType);
}
}
- if (type.flags & 32768) {
+ if (type.flags & 65536) {
visitTypeParameter(type);
}
- if (type.flags & 393216) {
+ if (type.flags & 786432) {
visitUnionOrIntersectionType(type);
}
- if (type.flags & 524288) {
+ if (type.flags & 1048576) {
visitIndexType(type);
}
- if (type.flags & 1048576) {
+ if (type.flags & 2097152) {
visitIndexedAccessType(type);
}
}
@@ -21695,11 +21818,11 @@ var ts;
}
function visitSymbol(symbol) {
if (!symbol) {
- return;
+ return false;
}
var symbolId = ts.getSymbolId(symbol);
if (visitedSymbols[symbolId]) {
- return;
+ return false;
}
visitedSymbols[symbolId] = symbol;
if (!accept(symbol)) {
@@ -21711,12 +21834,13 @@ var ts;
symbol.exports.forEach(visitSymbol);
}
ts.forEach(symbol.declarations, function (d) {
- if (d.type && d.type.kind === 164) {
+ if (d.type && d.type.kind === 165) {
var query = d.type;
var entity = getResolvedSymbol(getFirstIdentifier(query.exprName));
visitSymbol(entity);
}
});
+ return false;
}
}
}
@@ -21729,7 +21853,7 @@ var ts;
}
ts.trace = trace;
function isTraceEnabled(compilerOptions, host) {
- return compilerOptions.traceResolution && host.trace !== undefined;
+ return !!compilerOptions.traceResolution && host.trace !== undefined;
}
ts.isTraceEnabled = isTraceEnabled;
function withPackageId(packageId, r) {
@@ -21890,14 +22014,13 @@ var ts;
}
}
function secondaryLookup() {
- var resolvedFile;
var initialLocationForSecondaryLookup = containingFile && ts.getDirectoryPath(containingFile);
if (initialLocationForSecondaryLookup !== undefined) {
if (traceEnabled) {
trace(host, ts.Diagnostics.Looking_up_in_node_modules_folder_initial_location_0, initialLocationForSecondaryLookup);
}
var result = loadModuleFromNodeModules(Extensions.DtsOnly, typeReferenceDirectiveName, initialLocationForSecondaryLookup, failedLookupLocations, moduleResolutionState, undefined);
- resolvedFile = resolvedTypeScriptOnly(result && result.value);
+ var resolvedFile = resolvedTypeScriptOnly(result && result.value);
if (!resolvedFile && traceEnabled) {
trace(host, ts.Diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName);
}
@@ -22049,7 +22172,7 @@ var ts;
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache);
break;
default:
- ts.Debug.fail("Unexpected moduleResolution: " + moduleResolution);
+ return ts.Debug.fail("Unexpected moduleResolution: " + moduleResolution);
}
if (perFolderCache) {
perFolderCache.set(moduleName, result);
@@ -22227,7 +22350,7 @@ var ts;
var originalPath = void 0;
if (!compilerOptions.preserveSymlinks && resolvedValue) {
originalPath = resolvedValue.path;
- var path = realPath(resolved_1.value.path, host, traceEnabled);
+ var path = realPath(resolvedValue.path, host, traceEnabled);
if (path === originalPath) {
originalPath = undefined;
}
@@ -22327,7 +22450,7 @@ var ts;
function loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state) {
if (extensions === Extensions.Json) {
var extensionLess = ts.tryRemoveExtension(candidate, ".json");
- return extensionLess && tryAddingExtensions(extensionLess, extensions, failedLookupLocations, onlyRecordFailures, state);
+ return extensionLess === undefined ? undefined : tryAddingExtensions(extensionLess, extensions, failedLookupLocations, onlyRecordFailures, state);
}
var resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, failedLookupLocations, onlyRecordFailures, state);
if (resolvedByAddingExtension) {
@@ -22361,7 +22484,7 @@ var ts;
}
function tryExtension(ext) {
var path = tryFile(candidate + ext, failedLookupLocations, onlyRecordFailures, state);
- return path && { path: path, ext: ext };
+ return path === undefined ? undefined : { path: path, ext: ext };
}
}
function tryFile(fileName, failedLookupLocations, onlyRecordFailures, state) {
@@ -22732,11 +22855,12 @@ var ts;
getGlobalDiagnostics: getGlobalDiagnostics,
getTypeOfSymbolAtLocation: function (symbol, location) {
location = ts.getParseTreeNode(location);
- return location ? getTypeOfSymbolAtLocation(symbol, location) : unknownType;
+ return location ? getTypeOfSymbolAtLocation(symbol, location) : errorType;
},
- getSymbolsOfParameterPropertyDeclaration: function (parameter, parameterName) {
- parameter = ts.getParseTreeNode(parameter, ts.isParameter);
- ts.Debug.assert(parameter !== undefined, "Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node.");
+ getSymbolsOfParameterPropertyDeclaration: function (parameterIn, parameterName) {
+ var parameter = ts.getParseTreeNode(parameterIn, ts.isParameter);
+ if (parameter === undefined)
+ return ts.Debug.fail("Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node.");
return getSymbolsOfParameterPropertyDeclaration(parameter, ts.escapeLeadingUnderscores(parameterName));
},
getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol,
@@ -22748,9 +22872,9 @@ var ts;
getBaseTypes: getBaseTypes,
getBaseTypeOfLiteralType: getBaseTypeOfLiteralType,
getWidenedType: getWidenedType,
- getTypeFromTypeNode: function (node) {
- node = ts.getParseTreeNode(node, ts.isTypeNode);
- return node ? getTypeFromTypeNode(node) : unknownType;
+ getTypeFromTypeNode: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isTypeNode);
+ return node ? getTypeFromTypeNode(node) : errorType;
},
getParameterType: getTypeAtPosition,
getReturnTypeOfSignature: getReturnTypeOfSignature,
@@ -22776,8 +22900,8 @@ var ts;
node = ts.getParseTreeNode(node);
return node ? getShorthandAssignmentValueSymbol(node) : undefined;
},
- getExportSpecifierLocalTargetSymbol: function (node) {
- node = ts.getParseTreeNode(node, ts.isExportSpecifier);
+ getExportSpecifierLocalTargetSymbol: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isExportSpecifier);
return node ? getExportSpecifierLocalTargetSymbol(node) : undefined;
},
getExportSymbolOfSymbol: function (symbol) {
@@ -22785,10 +22909,10 @@ var ts;
},
getTypeAtLocation: function (node) {
node = ts.getParseTreeNode(node);
- return node ? getTypeOfNode(node) : unknownType;
+ return node ? getTypeOfNode(node) : errorType;
},
- getPropertySymbolOfDestructuringAssignment: function (location) {
- location = ts.getParseTreeNode(location, ts.isIdentifier);
+ getPropertySymbolOfDestructuringAssignment: function (locationIn) {
+ var location = ts.getParseTreeNode(locationIn, ts.isIdentifier);
return location ? getPropertySymbolOfDestructuringAssignment(location) : undefined;
},
signatureToString: function (signature, enclosingDeclaration, flags, kind) {
@@ -22818,41 +22942,41 @@ var ts;
getSymbolDisplayBuilder: getSymbolDisplayBuilder,
getAugmentedPropertiesOfType: getAugmentedPropertiesOfType,
getRootSymbols: getRootSymbols,
- getContextualType: function (node) {
- node = ts.getParseTreeNode(node, ts.isExpression);
+ getContextualType: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isExpression);
return node ? getContextualType(node) : undefined;
},
- getContextualTypeForArgumentAtIndex: function (node, argIndex) {
- node = ts.getParseTreeNode(node, ts.isCallLikeExpression);
+ getContextualTypeForArgumentAtIndex: function (nodeIn, argIndex) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isCallLikeExpression);
return node && getContextualTypeForArgumentAtIndex(node, argIndex);
},
- getContextualTypeForJsxAttribute: function (node) {
- node = ts.getParseTreeNode(node, ts.isJsxAttributeLike);
+ getContextualTypeForJsxAttribute: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isJsxAttributeLike);
return node && getContextualTypeForJsxAttribute(node);
},
isContextSensitive: isContextSensitive,
getFullyQualifiedName: getFullyQualifiedName,
- getResolvedSignature: function (node, candidatesOutArray, theArgumentCount) {
- node = ts.getParseTreeNode(node, ts.isCallLikeExpression);
+ getResolvedSignature: function (nodeIn, candidatesOutArray, theArgumentCount) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isCallLikeExpression);
apparentArgumentCount = theArgumentCount;
var res = node ? getResolvedSignature(node, candidatesOutArray) : undefined;
apparentArgumentCount = undefined;
return res;
},
- getConstantValue: function (node) {
- node = ts.getParseTreeNode(node, canHaveConstantValue);
+ getConstantValue: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, canHaveConstantValue);
return node ? getConstantValue(node) : undefined;
},
- isValidPropertyAccess: function (node, propertyName) {
- node = ts.getParseTreeNode(node, ts.isPropertyAccessOrQualifiedNameOrImportTypeNode);
+ isValidPropertyAccess: function (nodeIn, propertyName) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isPropertyAccessOrQualifiedNameOrImportTypeNode);
return !!node && isValidPropertyAccess(node, ts.escapeLeadingUnderscores(propertyName));
},
- isValidPropertyAccessForCompletions: function (node, type, property) {
- node = ts.getParseTreeNode(node, ts.isPropertyAccessExpression);
+ isValidPropertyAccessForCompletions: function (nodeIn, type, property) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isPropertyAccessExpression);
return !!node && isValidPropertyAccessForCompletions(node, type, property);
},
- getSignatureFromDeclaration: function (declaration) {
- declaration = ts.getParseTreeNode(declaration, ts.isFunctionLike);
+ getSignatureFromDeclaration: function (declarationIn) {
+ var declaration = ts.getParseTreeNode(declarationIn, ts.isFunctionLike);
return declaration ? getSignatureFromDeclaration(declaration) : undefined;
},
isImplementationOfOverload: function (node) {
@@ -22864,7 +22988,8 @@ var ts;
var links = getSymbolLinks(symbol);
if (!links.immediateTarget) {
var node = getDeclarationOfAliasSymbol(symbol);
- ts.Debug.assert(!!node);
+ if (!node)
+ return ts.Debug.fail();
links.immediateTarget = getTargetOfAliasDeclaration(node, true);
}
return links.immediateTarget;
@@ -22875,13 +23000,13 @@ var ts;
getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule,
getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier),
getAmbientModules: getAmbientModules,
- getAllAttributesTypeFromJsxOpeningLikeElement: function (node) {
- node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement);
+ getAllAttributesTypeFromJsxOpeningLikeElement: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isJsxOpeningLikeElement);
return node ? getAllAttributesTypeFromJsxOpeningLikeElement(node) : undefined;
},
getJsxIntrinsicTagNamesAt: getJsxIntrinsicTagNamesAt,
- isOptionalParameter: function (node) {
- node = ts.getParseTreeNode(node, ts.isParameter);
+ isOptionalParameter: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isParameter);
return node ? isOptionalParameter(node) : false;
},
tryGetMemberInModuleExports: function (name, symbol) { return tryGetMemberInModuleExports(ts.escapeLeadingUnderscores(name), symbol); },
@@ -22913,7 +23038,7 @@ var ts;
getSuggestionForNonexistentSymbol: function (location, name, meaning) { return getSuggestionForNonexistentSymbol(location, ts.escapeLeadingUnderscores(name), meaning); },
getSuggestionForNonexistentModule: function (node, target) { return getSuggestionForNonexistentModule(node, target); },
getBaseConstraintOfType: getBaseConstraintOfType,
- getDefaultFromTypeParameter: function (type) { return type && type.flags & 32768 ? getDefaultFromTypeParameter(type) : undefined; },
+ getDefaultFromTypeParameter: function (type) { return type && type.flags & 65536 ? getDefaultFromTypeParameter(type) : undefined; },
resolveName: function (name, location, meaning, excludeGlobals) {
return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, undefined, undefined, false, excludeGlobals);
},
@@ -22925,24 +23050,31 @@ var ts;
node = ts.getParseTreeNode(node);
return node && tryGetThisTypeAt(node);
},
- getTypeArgumentConstraint: function (node) {
- node = ts.getParseTreeNode(node, ts.isTypeNode);
+ getTypeArgumentConstraint: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isTypeNode);
return node && getTypeArgumentConstraint(node);
},
- getSuggestionDiagnostics: function (file) {
- return (suggestionDiagnostics.get(file.fileName) || ts.emptyArray).concat(getUnusedDiagnostics());
- function getUnusedDiagnostics() {
- if (file.isDeclarationFile)
- return ts.emptyArray;
+ getSuggestionDiagnostics: function (file, ct) {
+ var diagnostics;
+ try {
+ cancellationToken = ct;
checkSourceFile(file);
- var diagnostics = [];
ts.Debug.assert(!!(getNodeLinks(file).flags & 1));
+ diagnostics = ts.addRange(diagnostics, suggestionDiagnostics.get(file.fileName));
+ if (!file.isDeclarationFile && (!unusedIsError(0) || !unusedIsError(1))) {
+ addUnusedDiagnostics();
+ }
+ return diagnostics || ts.emptyArray;
+ }
+ finally {
+ cancellationToken = undefined;
+ }
+ function addUnusedDiagnostics() {
checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(file), function (kind, diag) {
if (!unusedIsError(kind)) {
- diagnostics.push(__assign({}, diag, { category: ts.DiagnosticCategory.Suggestion }));
+ (diagnostics || (diagnostics = [])).push(__assign({}, diag, { category: ts.DiagnosticCategory.Suggestion }));
}
});
- return diagnostics;
}
},
runWithCancellationToken: function (token, callback) {
@@ -22967,22 +23099,23 @@ var ts;
var anyType = createIntrinsicType(1, "any");
var autoType = createIntrinsicType(1, "any");
var wildcardType = createIntrinsicType(1, "any");
- var unknownType = createIntrinsicType(1, "unknown");
- var undefinedType = createIntrinsicType(4096, "undefined");
- var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(4096 | 16777216, "undefined");
- var nullType = createIntrinsicType(8192, "null");
- var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(8192 | 16777216, "null");
- var stringType = createIntrinsicType(2, "string");
- var numberType = createIntrinsicType(4, "number");
- var trueType = createIntrinsicType(128, "true");
- var falseType = createIntrinsicType(128, "false");
+ var errorType = createIntrinsicType(1, "error");
+ var unknownType = createIntrinsicType(2, "unknown");
+ var undefinedType = createIntrinsicType(8192, "undefined");
+ var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(8192 | 134217728, "undefined");
+ var nullType = createIntrinsicType(16384, "null");
+ var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(16384 | 134217728, "null");
+ var stringType = createIntrinsicType(4, "string");
+ var numberType = createIntrinsicType(8, "number");
+ var trueType = createIntrinsicType(256, "true");
+ var falseType = createIntrinsicType(256, "false");
var booleanType = createBooleanType([trueType, falseType]);
- var esSymbolType = createIntrinsicType(512, "symbol");
- var voidType = createIntrinsicType(2048, "void");
- var neverType = createIntrinsicType(16384, "never");
- var silentNeverType = createIntrinsicType(16384, "never");
- var implicitNeverType = createIntrinsicType(16384, "never");
- var nonPrimitiveType = createIntrinsicType(134217728, "object");
+ var esSymbolType = createIntrinsicType(1024, "symbol");
+ var voidType = createIntrinsicType(4096, "void");
+ var neverType = createIntrinsicType(32768, "never");
+ var silentNeverType = createIntrinsicType(32768, "never");
+ var implicitNeverType = createIntrinsicType(32768, "never");
+ var nonPrimitiveType = createIntrinsicType(16777216, "object");
var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]);
var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType;
var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
@@ -22992,17 +23125,17 @@ var ts;
var emptyGenericType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
emptyGenericType.instantiations = ts.createMap();
var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
- anyFunctionType.flags |= 67108864;
+ anyFunctionType.flags |= 536870912;
var noConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
var circularConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
var resolvingDefaultType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined);
- var markerSuperType = createType(32768);
- var markerSubType = createType(32768);
+ var markerSuperType = createType(65536);
+ var markerSubType = createType(65536);
markerSubType.constraint = markerSuperType;
- var markerOtherType = createType(32768);
+ var markerOtherType = createType(65536);
var noTypePredicate = createIdentifierTypePredicate("<>", 0, anyType);
var anySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, undefined, 0, false, false);
- var unknownSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, unknownType, undefined, 0, false, false);
+ var unknownSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, errorType, undefined, 0, false, false);
var resolvingSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, undefined, 0, false, false);
var silentNeverSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, silentNeverType, undefined, 0, false, false);
var resolvingSignaturesArray = [resolvingSignature];
@@ -23216,6 +23349,7 @@ var ts;
typeToString(type, enclosingDeclaration, flags, emitTextWriterWrapper(writer));
},
buildSymbolDisplay: function (symbol, writer, enclosingDeclaration, meaning, flags) {
+ if (flags === void 0) { flags = 0; }
symbolToString(symbol, enclosingDeclaration, meaning, flags | 4, emitTextWriterWrapper(writer));
},
buildSignatureDisplay: function (signature, writer, enclosing, flags, kind) {
@@ -23465,15 +23599,17 @@ var ts;
function mergeSymbol(target, source) {
if (!(target.flags & getExcludedSymbolFlags(source.flags)) ||
(source.flags | target.flags) & 67108864) {
- var targetValueDeclaration = target.valueDeclaration;
- ts.Debug.assert(!!(target.flags & 33554432));
+ ts.Debug.assert(source !== target);
+ if (!(target.flags & 33554432)) {
+ target = cloneSymbol(target);
+ }
if (source.flags & 512 && target.flags & 512 && target.constEnumOnlyModule && !source.constEnumOnlyModule) {
target.constEnumOnlyModule = false;
}
target.flags |= source.flags;
if (source.valueDeclaration &&
(!target.valueDeclaration ||
- (target.valueDeclaration.kind === 238 && source.valueDeclaration.kind !== 238))) {
+ (target.valueDeclaration.kind === 239 && source.valueDeclaration.kind !== 239))) {
target.valueDeclaration = source.valueDeclaration;
}
ts.addRange(target.declarations, source.declarations);
@@ -23487,18 +23623,6 @@ var ts;
target.exports = ts.createSymbolTable();
mergeSymbolTable(target.exports, source.exports);
}
- if ((source.flags | target.flags) & 67108864) {
- var sourceInitializer = ts.getJSInitializerSymbol(source);
- var init = ts.getDeclaredJavascriptInitializer(targetValueDeclaration) || ts.getAssignedJavascriptInitializer(targetValueDeclaration);
- var targetInitializer = init && init.symbol ? init.symbol : target;
- if (!(targetInitializer.flags & 33554432)) {
- var mergedInitializer = getMergedSymbol(targetInitializer);
- targetInitializer = mergedInitializer === targetInitializer ? cloneSymbol(targetInitializer) : mergedInitializer;
- }
- if (sourceInitializer !== source || targetInitializer !== target) {
- mergeSymbol(targetInitializer, sourceInitializer);
- }
- }
recordMergedSymbol(target, source);
}
else if (target.flags & 1024) {
@@ -23519,11 +23643,12 @@ var ts;
error(errorNode, message_2, symbolToString(source));
});
}
+ return target;
}
function combineSymbolTables(first, second) {
- if (!first || first.size === 0)
+ if (!ts.hasEntries(first))
return second;
- if (!second || second.size === 0)
+ if (!ts.hasEntries(second))
return first;
var combined = ts.createSymbolTable();
mergeSymbolTable(combined, first);
@@ -23532,17 +23657,7 @@ var ts;
}
function mergeSymbolTable(target, source) {
source.forEach(function (sourceSymbol, id) {
- var targetSymbol = target.get(id);
- if (!targetSymbol) {
- target.set(id, sourceSymbol);
- }
- else {
- if (!(targetSymbol.flags & 33554432)) {
- targetSymbol = cloneSymbol(targetSymbol);
- target.set(id, targetSymbol);
- }
- mergeSymbol(targetSymbol, sourceSymbol);
- }
+ target.set(id, target.has(id) ? mergeSymbol(target.get(id), sourceSymbol) : sourceSymbol);
});
}
function mergeModuleAugmentation(moduleName) {
@@ -23564,8 +23679,7 @@ var ts;
}
mainModule = resolveExternalModuleSymbol(mainModule);
if (mainModule.flags & 1920) {
- mainModule = mainModule.flags & 33554432 ? mainModule : cloneSymbol(mainModule);
- mergeSymbol(mainModule, moduleAugmentation.symbol);
+ mainModule = mergeSymbol(mainModule, moduleAugmentation.symbol);
}
else {
error(moduleName, ts.Diagnostics.Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity, moduleName.text);
@@ -23597,7 +23711,7 @@ var ts;
return nodeLinks[nodeId] || (nodeLinks[nodeId] = { flags: 0 });
}
function isGlobalSourceFile(node) {
- return node.kind === 273 && !ts.isExternalOrCommonJsModule(node);
+ return node.kind === 274 && !ts.isExternalOrCommonJsModule(node);
}
function getSymbol(symbols, name, meaning) {
if (meaning) {
@@ -23624,7 +23738,7 @@ var ts;
if (parameterSymbol && propertySymbol) {
return [parameterSymbol, propertySymbol];
}
- ts.Debug.fail("There should exist two symbols, one as property declaration and one as parameter declaration");
+ return ts.Debug.fail("There should exist two symbols, one as property declaration and one as parameter declaration");
}
function isBlockScopedNameDeclaredBeforeUse(declaration, usage) {
var declarationFile = ts.getSourceFileOfNode(declaration);
@@ -23643,15 +23757,15 @@ var ts;
return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile);
}
if (declaration.pos <= usage.pos) {
- if (declaration.kind === 181) {
- var errorBindingElement = ts.getAncestor(usage, 181);
+ if (declaration.kind === 182) {
+ var errorBindingElement = ts.getAncestor(usage, 182);
if (errorBindingElement) {
return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) ||
declaration.pos < errorBindingElement.pos;
}
- return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 231), usage);
+ return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 232), usage);
}
- else if (declaration.kind === 231) {
+ else if (declaration.kind === 232) {
return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage);
}
else if (ts.isClassDeclaration(declaration)) {
@@ -23659,10 +23773,10 @@ var ts;
}
return true;
}
- if (usage.parent.kind === 251 || (usage.parent.kind === 248 && usage.parent.isExportEquals)) {
+ if (usage.parent.kind === 252 || (usage.parent.kind === 249 && usage.parent.isExportEquals)) {
return true;
}
- if (usage.kind === 248 && usage.isExportEquals) {
+ if (usage.kind === 249 && usage.isExportEquals) {
return true;
}
var container = ts.getEnclosingBlockScopeContainer(declaration);
@@ -23670,15 +23784,16 @@ var ts;
function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) {
var container = ts.getEnclosingBlockScopeContainer(declaration);
switch (declaration.parent.parent.kind) {
- case 213:
- case 219:
- case 221:
+ case 214:
+ case 220:
+ case 222:
if (isSameScopeDescendentOf(usage, declaration, container)) {
return true;
}
break;
}
- return ts.isForInOrOfStatement(declaration.parent.parent) && isSameScopeDescendentOf(usage, declaration.parent.parent.expression, container);
+ var grandparent = declaration.parent.parent;
+ return ts.isForInOrOfStatement(grandparent) && isSameScopeDescendentOf(usage, grandparent.expression, container);
}
function isUsedInFunctionOrInstanceProperty(usage, declaration, container) {
return !!ts.findAncestor(usage, function (current) {
@@ -23689,21 +23804,22 @@ var ts;
return true;
}
var initializerOfProperty = current.parent &&
- current.parent.kind === 151 &&
+ current.parent.kind === 152 &&
current.parent.initializer === current;
if (initializerOfProperty) {
if (ts.hasModifier(current.parent, 32)) {
- if (declaration.kind === 153) {
+ if (declaration.kind === 154) {
return true;
}
}
else {
- var isDeclarationInstanceProperty = declaration.kind === 151 && !ts.hasModifier(declaration, 32);
+ var isDeclarationInstanceProperty = declaration.kind === 152 && !ts.hasModifier(declaration, 32);
if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) {
return true;
}
}
}
+ return false;
});
}
}
@@ -23725,21 +23841,21 @@ var ts;
if (result = lookup(location.locals, name, meaning)) {
var useResult = true;
if (ts.isFunctionLike(location) && lastLocation && lastLocation !== location.body) {
- if (meaning & result.flags & 67901928 && lastLocation.kind !== 285) {
+ if (meaning & result.flags & 67901928 && lastLocation.kind !== 286) {
useResult = result.flags & 262144
? lastLocation === location.type ||
- lastLocation.kind === 148 ||
- lastLocation.kind === 147
+ lastLocation.kind === 149 ||
+ lastLocation.kind === 148
: false;
}
if (meaning & 67216319 && result.flags & 1) {
useResult =
- lastLocation.kind === 148 ||
+ lastLocation.kind === 149 ||
(lastLocation === location.type &&
!!ts.findAncestor(result.valueDeclaration, ts.isParameter));
}
}
- else if (location.kind === 170) {
+ else if (location.kind === 171) {
useResult = lastLocation === location.trueType;
}
if (useResult) {
@@ -23751,13 +23867,13 @@ var ts;
}
}
switch (location.kind) {
- case 273:
+ case 274:
if (!ts.isExternalOrCommonJsModule(location))
break;
isInExternalModule = true;
- case 238:
+ case 239:
var moduleExports = getSymbolOfNode(location).exports;
- if (location.kind === 273 || ts.isAmbientModule(location)) {
+ if (location.kind === 274 || ts.isAmbientModule(location)) {
if (result = moduleExports.get("default")) {
var localSymbol = ts.getLocalSymbolForExportDefault(result);
if (localSymbol && (result.flags & meaning) && localSymbol.escapedName === name) {
@@ -23768,21 +23884,26 @@ var ts;
var moduleExport = moduleExports.get(name);
if (moduleExport &&
moduleExport.flags === 2097152 &&
- ts.getDeclarationOfKind(moduleExport, 251)) {
+ ts.getDeclarationOfKind(moduleExport, 252)) {
break;
}
}
if (name !== "default" && (result = lookup(moduleExports, name, meaning & 2623475))) {
- break loop;
+ if (ts.isSourceFile(location) && location.commonJsModuleIndicator && !result.declarations.some(ts.isJSDocTypeAlias)) {
+ result = undefined;
+ }
+ else {
+ break loop;
+ }
}
break;
- case 237:
+ case 238:
if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8)) {
break loop;
}
break;
+ case 152:
case 151:
- case 150:
if (ts.isClassLike(location.parent) && !ts.hasModifier(location, 32)) {
var ctor = findConstructorDeclaration(location.parent);
if (ctor && ctor.locals) {
@@ -23792,9 +23913,9 @@ var ts;
}
}
break;
- case 234:
- case 204:
case 235:
+ case 205:
+ case 236:
if (result = lookup(getMembersOfSymbol(getSymbolOfNode(location)), name, meaning & 67901928)) {
if (!isTypeParameterSymbolDeclaredInContainer(result, location)) {
result = undefined;
@@ -23806,7 +23927,7 @@ var ts;
}
break loop;
}
- if (location.kind === 204 && meaning & 32) {
+ if (location.kind === 205 && meaning & 32) {
var className = location.name;
if (className && name === className.escapedText) {
result = location.symbol;
@@ -23814,7 +23935,7 @@ var ts;
}
}
break;
- case 206:
+ case 207:
if (lastLocation === location.expression && location.parent.token === 85) {
var container = location.parent.parent;
if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 67901928))) {
@@ -23825,28 +23946,28 @@ var ts;
}
}
break;
- case 146:
+ case 147:
grandparent = location.parent.parent;
- if (ts.isClassLike(grandparent) || grandparent.kind === 235) {
+ if (ts.isClassLike(grandparent) || grandparent.kind === 236) {
if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 67901928)) {
error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);
return undefined;
}
}
break;
- case 153:
- case 152:
case 154:
+ case 153:
case 155:
case 156:
- case 233:
- case 192:
+ case 157:
+ case 234:
+ case 193:
if (meaning & 3 && name === "arguments") {
result = argumentsSymbol;
break loop;
}
break;
- case 191:
+ case 192:
if (meaning & 3 && name === "arguments") {
result = argumentsSymbol;
break loop;
@@ -23859,19 +23980,18 @@ var ts;
}
}
break;
- case 149:
- if (location.parent && location.parent.kind === 148) {
+ case 150:
+ if (location.parent && location.parent.kind === 149) {
location = location.parent;
}
if (location.parent && ts.isClassElement(location.parent)) {
location = location.parent;
}
break;
- case 296:
- case 291:
- lastLocation = location;
- location = ts.getJSDocHost(location).parent;
- continue;
+ case 297:
+ case 292:
+ location = ts.getJSDocHost(location);
+ break;
}
if (isSelfReferenceLocation(location)) {
lastSelfReferenceLocation = location;
@@ -23884,7 +24004,7 @@ var ts;
}
if (!result) {
if (lastLocation) {
- ts.Debug.assert(lastLocation.kind === 273);
+ ts.Debug.assert(lastLocation.kind === 274);
if (lastLocation.commonJsModuleIndicator && name === "exports") {
return lastLocation.symbol;
}
@@ -23943,7 +24063,7 @@ var ts;
}
if (result && isInExternalModule && (meaning & 67216319) === 67216319 && !(originalLocation.flags & 2097152)) {
var decls = result.declarations;
- if (decls && decls.length === 1 && decls[0].kind === 241) {
+ if (decls && decls.length === 1 && decls[0].kind === 242) {
error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, ts.unescapeLeadingUnderscores(name));
}
}
@@ -23952,12 +24072,12 @@ var ts;
}
function isSelfReferenceLocation(node) {
switch (node.kind) {
- case 233:
case 234:
case 235:
- case 237:
case 236:
case 238:
+ case 237:
+ case 239:
return true;
default:
return false;
@@ -23969,7 +24089,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 === 147) {
+ if (decl.kind === 148) {
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));
@@ -24009,18 +24129,18 @@ var ts;
}
function checkAndReportErrorForExtendingInterface(errorLocation) {
var expression = getEntityNameForExtendingInterface(errorLocation);
- var isError = !!(expression && resolveEntityName(expression, 64, true));
- if (isError) {
+ if (expression && resolveEntityName(expression, 64, true)) {
error(errorLocation, ts.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements, ts.getTextOfNode(expression));
+ return true;
}
- return isError;
+ return false;
}
function getEntityNameForExtendingInterface(node) {
switch (node.kind) {
case 71:
- case 184:
+ case 185:
return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined;
- case 206:
+ case 207:
if (ts.isEntityNameExpression(node.expression)) {
return node.expression;
}
@@ -24082,8 +24202,9 @@ var ts;
}
function checkResolvedBlockScopedVariable(result, errorLocation) {
ts.Debug.assert(!!(result.flags & 2 || result.flags & 32 || result.flags & 384));
- var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 237) ? d : undefined; });
- ts.Debug.assert(declaration !== undefined, "Declaration to checkResolvedBlockScopedVariable is undefined");
+ var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 238) ? d : undefined; });
+ if (declaration === undefined)
+ return ts.Debug.fail("Declaration to checkResolvedBlockScopedVariable is undefined");
if (!(declaration.flags & 4194304) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) {
if (result.flags & 2) {
error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)));
@@ -24097,17 +24218,17 @@ var ts;
}
}
function isSameScopeDescendentOf(initial, parent, stopAt) {
- return parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; });
+ return !!parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; });
}
function getAnyImportSyntax(node) {
switch (node.kind) {
- case 242:
+ case 243:
return node;
- case 244:
- return node.parent;
case 245:
+ return node.parent;
+ case 246:
return node.parent.parent;
- case 247:
+ case 248:
return node.parent.parent.parent;
default:
return undefined;
@@ -24117,7 +24238,7 @@ var ts;
return ts.find(symbol.declarations, ts.isAliasSymbolDeclaration);
}
function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) {
- if (node.moduleReference.kind === 253) {
+ if (node.moduleReference.kind === 254) {
return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)));
}
return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias);
@@ -24129,7 +24250,7 @@ var ts;
: resolveSymbol(moduleSymbol.exports.get(name), dontResolveAlias);
}
function isSyntacticDefault(node) {
- return ((ts.isExportAssignment(node) && !node.isExportEquals) || ts.hasModifier(node, 512));
+ return ((ts.isExportAssignment(node) && !node.isExportEquals) || ts.hasModifier(node, 512) || ts.isExportSpecifier(node));
}
function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias) {
if (!allowSyntheticDefaultImports) {
@@ -24207,6 +24328,7 @@ var ts;
}
}
function getExternalModuleMember(node, specifier, dontResolveAlias) {
+ if (dontResolveAlias === void 0) { dontResolveAlias = false; }
var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier);
var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier, dontResolveAlias);
if (targetSymbol) {
@@ -24269,33 +24391,35 @@ var ts;
return getNodeLinks(expression).resolvedSymbol;
}
function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) {
+ if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; }
switch (node.kind) {
- case 242:
+ case 243:
return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve);
- case 244:
- return getTargetOfImportClause(node, dontRecursivelyResolve);
case 245:
+ return getTargetOfImportClause(node, dontRecursivelyResolve);
+ case 246:
return getTargetOfNamespaceImport(node, dontRecursivelyResolve);
- case 247:
- return getTargetOfImportSpecifier(node, dontRecursivelyResolve);
- case 251:
- return getTargetOfExportSpecifier(node, 67216319 | 67901928 | 1920, dontRecursivelyResolve);
case 248:
- case 199:
+ return getTargetOfImportSpecifier(node, dontRecursivelyResolve);
+ case 252:
+ return getTargetOfExportSpecifier(node, 67216319 | 67901928 | 1920, dontRecursivelyResolve);
+ case 249:
+ case 200:
return getTargetOfExportAssignment(node, dontRecursivelyResolve);
- case 241:
+ case 242:
return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve);
+ default:
+ return ts.Debug.fail();
}
}
function isNonLocalAlias(symbol, excludes) {
if (excludes === void 0) { excludes = 67216319 | 67901928 | 1920; }
if (!symbol)
return false;
- return (symbol.flags & (2097152 | excludes)) === 2097152 || (symbol.flags & 2097152 && symbol.flags & 67108864);
+ return (symbol.flags & (2097152 | excludes)) === 2097152 || !!(symbol.flags & 2097152 && symbol.flags & 67108864);
}
function resolveSymbol(symbol, dontResolveAlias) {
- var shouldResolve = !dontResolveAlias && isNonLocalAlias(symbol);
- return shouldResolve ? resolveAlias(symbol) : symbol;
+ return !dontResolveAlias && isNonLocalAlias(symbol) ? resolveAlias(symbol) : symbol;
}
function resolveAlias(symbol) {
ts.Debug.assert((symbol.flags & 2097152) !== 0, "Should only get Alias here.");
@@ -24303,7 +24427,8 @@ var ts;
if (!links.target) {
links.target = resolvingSymbol;
var node = getDeclarationOfAliasSymbol(symbol);
- ts.Debug.assert(!!node);
+ if (!node)
+ return ts.Debug.fail();
var target = getTargetOfAliasDeclaration(node);
if (links.target === resolvingSymbol) {
links.target = target || unknownSymbol;
@@ -24333,11 +24458,12 @@ var ts;
if (!links.referenced) {
links.referenced = true;
var node = getDeclarationOfAliasSymbol(symbol);
- ts.Debug.assert(!!node);
- if (node.kind === 248) {
+ if (!node)
+ return ts.Debug.fail();
+ if (node.kind === 249) {
checkExpressionCached(node.expression);
}
- else if (node.kind === 251) {
+ else if (node.kind === 252) {
checkExpressionCached(node.propertyName || node.name);
}
else if (ts.isInternalModuleImportEqualsDeclaration(node)) {
@@ -24349,11 +24475,11 @@ var ts;
if (entityName.kind === 71 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
entityName = entityName.parent;
}
- if (entityName.kind === 71 || entityName.parent.kind === 145) {
+ if (entityName.kind === 71 || entityName.parent.kind === 146) {
return resolveEntityName(entityName, 1920, false, dontResolveAlias);
}
else {
- ts.Debug.assert(entityName.parent.kind === 242);
+ ts.Debug.assert(entityName.parent.kind === 243);
return resolveEntityName(entityName, 67216319 | 67901928 | 1920, false, dontResolveAlias);
}
}
@@ -24374,9 +24500,9 @@ var ts;
return symbolFromJSPrototype;
}
}
- else if (name.kind === 145 || name.kind === 184) {
- var left = name.kind === 145 ? name.left : name.expression;
- var right = name.kind === 145 ? name.right : name.name;
+ else if (name.kind === 146 || name.kind === 185) {
+ var left = name.kind === 146 ? name.left : name.expression;
+ var right = name.kind === 146 ? name.right : name.name;
var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, false, location);
if (!namespace || ts.nodeIsMissing(right)) {
return undefined;
@@ -24385,13 +24511,6 @@ var ts;
return namespace;
}
if (ts.isInJavaScriptFile(name)) {
- var initializer = ts.getDeclaredJavascriptInitializer(namespace.valueDeclaration) || ts.getAssignedJavascriptInitializer(namespace.valueDeclaration);
- if (initializer) {
- namespace = getSymbolOfNode(initializer);
- }
- if (!namespace) {
- return undefined;
- }
if (namespace.valueDeclaration &&
ts.isVariableDeclaration(namespace.valueDeclaration) &&
namespace.valueDeclaration.initializer &&
@@ -24415,7 +24534,7 @@ var ts;
}
}
else {
- ts.Debug.assertNever(name, "Unknown entity name kind.");
+ throw ts.Debug.assertNever(name, "Unknown entity name kind.");
}
ts.Debug.assert((ts.getCheckFlags(symbol) & 1) === 0, "Should never get an instantiated symbol here.");
return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol);
@@ -24553,14 +24672,7 @@ var ts;
moduleSymbol.exports.forEach(function (s, name) {
if (name === "export=")
return;
- if (!merged.exports.has(name)) {
- merged.exports.set(name, s);
- }
- else {
- var ms = cloneSymbol(merged.exports.get(name));
- mergeSymbol(ms, s);
- merged.exports.set(name, ms);
- }
+ merged.exports.set(name, merged.exports.has(name) ? mergeSymbol(merged.exports.get(name), s) : s);
});
return merged;
}
@@ -24634,7 +24746,7 @@ var ts;
return undefined;
}
var type = getTypeOfSymbol(exportEquals);
- return type.flags & 16382 ? undefined : getPropertyOfType(type, memberName);
+ return type.flags & 32764 ? undefined : getPropertyOfType(type, memberName);
}
function getExportsOfSymbol(symbol) {
return symbol.flags & 32 ? getResolvedMembersOrExportsOfSymbol(symbol, "resolvedExports") :
@@ -24715,6 +24827,38 @@ var ts;
function getParentOfSymbol(symbol) {
return getMergedSymbol(symbol.parent && getLateBoundSymbol(symbol.parent));
}
+ function getContainerOfSymbol(symbol) {
+ var container = getParentOfSymbol(symbol);
+ if (container) {
+ return container;
+ }
+ var candidate = ts.forEach(symbol.declarations, function (d) { return !ts.isAmbientModule(d) && d.parent && hasNonGlobalAugmentationExternalModuleSymbol(d.parent) ? getSymbolOfNode(d.parent) : undefined; });
+ if (!candidate) {
+ return undefined;
+ }
+ var alias = getAliasForSymbolInContainer(candidate, symbol);
+ return alias ? candidate : undefined;
+ }
+ function getAliasForSymbolInContainer(container, symbol) {
+ if (container === getParentOfSymbol(symbol)) {
+ return symbol;
+ }
+ var exports = getExportsOfSymbol(container);
+ var quick = exports.get(symbol.escapedName);
+ if (quick && symbolRefersToTarget(quick)) {
+ return quick;
+ }
+ return ts.forEachEntry(exports, function (exported) {
+ if (symbolRefersToTarget(exported)) {
+ return exported;
+ }
+ });
+ function symbolRefersToTarget(s) {
+ if (s === symbol || resolveSymbol(s) === symbol || resolveSymbol(s) === resolveSymbol(symbol)) {
+ return s;
+ }
+ }
+ }
function getExportSymbolOfValueSymbolIfExported(symbol) {
return symbol && (symbol.flags & 1048576) !== 0
? getMergedSymbol(symbol.exportSymbol)
@@ -24727,7 +24871,7 @@ var ts;
var members = node.members;
for (var _i = 0, members_2 = members; _i < members_2.length; _i++) {
var member = members_2[_i];
- if (member.kind === 154 && ts.nodeIsPresent(member.body)) {
+ if (member.kind === 155 && ts.nodeIsPresent(member.body)) {
return member;
}
}
@@ -24745,12 +24889,12 @@ var ts;
}
function createBooleanType(trueFalseTypes) {
var type = getUnionType(trueFalseTypes);
- type.flags |= 8;
+ type.flags |= 16;
type.intrinsicName = "boolean";
return type;
}
function createObjectType(objectFlags, symbol) {
- var type = createType(65536);
+ var type = createType(131072);
type.objectFlags = objectFlags;
type.symbol = symbol;
return type;
@@ -24800,11 +24944,11 @@ var ts;
}
}
switch (location.kind) {
- case 273:
+ case 274:
if (!ts.isExternalOrCommonJsModule(location)) {
break;
}
- case 238:
+ case 239:
if (result = callback(getSymbolOfNode(location).exports)) {
return result;
}
@@ -24841,7 +24985,7 @@ var ts;
}
function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol, ignoreQualification) {
return symbol === (resolvedAliasSymbol || symbolFromSymbolTable) &&
- !ts.some(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) &&
+ !ts.some(symbolFromSymbolTable.declarations, hasNonGlobalAugmentationExternalModuleSymbol) &&
(ignoreQualification || canQualifySymbol(symbolFromSymbolTable, meaning));
}
function trySymbolTable(symbols, ignoreQualification) {
@@ -24864,20 +25008,25 @@ var ts;
return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports);
}
}
+ if (symbolFromSymbolTable.escapedName === symbol.escapedName && symbolFromSymbolTable.exportSymbol) {
+ if (isAccessible(getMergedSymbol(symbolFromSymbolTable.exportSymbol), undefined, ignoreQualification)) {
+ return [symbol];
+ }
+ }
});
}
}
function needsQualification(symbol, enclosingDeclaration, meaning) {
var qualify = false;
forEachSymbolTableInScope(enclosingDeclaration, function (symbolTable) {
- var symbolFromSymbolTable = symbolTable.get(symbol.escapedName);
+ var symbolFromSymbolTable = getMergedSymbol(symbolTable.get(symbol.escapedName));
if (!symbolFromSymbolTable) {
return false;
}
if (symbolFromSymbolTable === symbol) {
return true;
}
- symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 251)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
+ symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 252)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
if (symbolFromSymbolTable.flags & meaning) {
qualify = true;
return true;
@@ -24891,10 +25040,10 @@ var ts;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
switch (declaration.kind) {
- case 151:
- case 153:
- case 155:
+ case 152:
+ case 154:
case 156:
+ case 157:
continue;
default:
return false;
@@ -24930,14 +25079,14 @@ var ts;
return hasAccessibleDeclarations;
}
else {
- if (ts.some(symbol.declarations, hasExternalModuleSymbol)) {
+ if (ts.some(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
return {
accessibility: 0
};
}
}
meaningToLook = getQualifiedLeftMeaning(meaning);
- symbol = getParentOfSymbol(symbol);
+ symbol = getContainerOfSymbol(symbol);
}
var symbolExternalModule = ts.forEach(initialSymbol.declarations, getExternalModuleContainer);
if (symbolExternalModule) {
@@ -24962,7 +25111,10 @@ var ts;
}
}
function hasExternalModuleSymbol(declaration) {
- return ts.isAmbientModule(declaration) || (declaration.kind === 273 && ts.isExternalOrCommonJsModule(declaration));
+ return ts.isAmbientModule(declaration) || (declaration.kind === 274 && ts.isExternalOrCommonJsModule(declaration));
+ }
+ function hasNonGlobalAugmentationExternalModuleSymbol(declaration) {
+ return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 274 && ts.isExternalOrCommonJsModule(declaration));
}
function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) {
var aliasesToMakeVisible;
@@ -25002,13 +25154,13 @@ var ts;
}
function isEntityNameVisible(entityName, enclosingDeclaration) {
var meaning;
- if (entityName.parent.kind === 164 ||
+ if (entityName.parent.kind === 165 ||
ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) ||
- entityName.parent.kind === 146) {
+ entityName.parent.kind === 147) {
meaning = 67216319 | 1048576;
}
- else if (entityName.kind === 145 || entityName.kind === 184 ||
- entityName.parent.kind === 242) {
+ else if (entityName.kind === 146 || entityName.kind === 185 ||
+ entityName.parent.kind === 243) {
meaning = 1920;
}
else {
@@ -25045,14 +25197,15 @@ var ts;
}
}
function signatureToString(signature, enclosingDeclaration, flags, kind, writer) {
+ if (flags === void 0) { flags = 0; }
return writer ? signatureToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(signatureToStringWorker);
function signatureToStringWorker(writer) {
var sigOutput;
if (flags & 262144) {
- sigOutput = kind === 1 ? 163 : 162;
+ sigOutput = kind === 1 ? 164 : 163;
}
else {
- sigOutput = kind === 1 ? 158 : 157;
+ sigOutput = kind === 1 ? 159 : 158;
}
var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 | 512);
var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true });
@@ -25062,10 +25215,11 @@ var ts;
}
}
function typeToString(type, enclosingDeclaration, flags, writer) {
- if (flags === void 0) { flags = 1048576; }
+ if (flags === void 0) { flags = 1048576 | 16384; }
if (writer === void 0) { writer = ts.createTextWriter(""); }
var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960, writer);
- ts.Debug.assert(typeNode !== undefined, "should always get typenode");
+ if (typeNode === undefined)
+ return ts.Debug.fail("should always get typenode");
var options = { removeComments: true };
var printer = ts.createPrinter(options);
var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration);
@@ -25078,6 +25232,7 @@ var ts;
return result;
}
function toNodeBuilderFlags(flags) {
+ if (flags === void 0) { flags = 0; }
return flags & 9469291;
}
function createNodeBuilder() {
@@ -25142,7 +25297,7 @@ var ts;
function createNodeBuilderContext(enclosingDeclaration, flags, tracker) {
return {
enclosingDeclaration: enclosingDeclaration,
- flags: flags,
+ flags: flags || 0,
tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop },
encounteredError: false,
visitedSymbols: undefined,
@@ -25163,34 +25318,37 @@ var ts;
return ts.createKeywordTypeNode(119);
}
if (type.flags & 2) {
- return ts.createKeywordTypeNode(137);
+ return ts.createKeywordTypeNode(142);
}
if (type.flags & 4) {
- return ts.createKeywordTypeNode(134);
+ return ts.createKeywordTypeNode(137);
}
if (type.flags & 8) {
+ return ts.createKeywordTypeNode(134);
+ }
+ if (type.flags & 16) {
return ts.createKeywordTypeNode(122);
}
- if (type.flags & 256 && !(type.flags & 131072)) {
+ if (type.flags & 512 && !(type.flags & 262144)) {
var parentSymbol = getParentOfSymbol(type.symbol);
var parentName = symbolToName(parentSymbol, context, 67901928, false);
var enumLiteralName = getDeclaredTypeOfSymbol(parentSymbol) === type ? parentName : ts.createQualifiedName(parentName, ts.symbolName(type.symbol));
return ts.createTypeReferenceNode(enumLiteralName, undefined);
}
- if (type.flags & 272) {
+ if (type.flags & 544) {
var name = symbolToName(type.symbol, context, 67901928, false);
return ts.createTypeReferenceNode(name, undefined);
}
- if (type.flags & (32)) {
+ if (type.flags & (64)) {
return ts.createLiteralTypeNode(ts.setEmitFlags(ts.createLiteral(type.value), 16777216));
}
- if (type.flags & (64)) {
+ if (type.flags & (128)) {
return ts.createLiteralTypeNode((ts.createLiteral(type.value)));
}
- if (type.flags & 128) {
+ if (type.flags & 256) {
return type.intrinsicName === "true" ? ts.createTrue() : ts.createFalse();
}
- if (type.flags & 1024) {
+ if (type.flags & 2048) {
if (!(context.flags & 1048576)) {
if (isValueSymbolAccessible(type.symbol, context.enclosingDeclaration)) {
return symbolToTypeNode(type.symbol, context, 67216319);
@@ -25201,25 +25359,25 @@ var ts;
}
return ts.createTypeOperatorNode(141, ts.createKeywordTypeNode(138));
}
- if (type.flags & 2048) {
+ if (type.flags & 4096) {
return ts.createKeywordTypeNode(105);
}
- if (type.flags & 4096) {
+ if (type.flags & 8192) {
return ts.createKeywordTypeNode(140);
}
- if (type.flags & 8192) {
+ if (type.flags & 16384) {
return ts.createKeywordTypeNode(95);
}
- if (type.flags & 16384) {
+ if (type.flags & 32768) {
return ts.createKeywordTypeNode(131);
}
- if (type.flags & 512) {
+ if (type.flags & 1024) {
return ts.createKeywordTypeNode(138);
}
- if (type.flags & 134217728) {
+ if (type.flags & 16777216) {
return ts.createKeywordTypeNode(135);
}
- if (type.flags & 32768 && type.isThisType) {
+ if (type.flags & 65536 && type.isThisType) {
if (context.flags & 4194304) {
if (!context.encounteredError && !(context.flags & 32768)) {
context.encounteredError = true;
@@ -25232,23 +25390,24 @@ var ts;
}
var objectFlags = ts.getObjectFlags(type);
if (objectFlags & 4) {
- ts.Debug.assert(!!(type.flags & 65536));
+ ts.Debug.assert(!!(type.flags & 131072));
return typeReferenceToTypeNode(type);
}
- if (type.flags & 32768 || objectFlags & 3) {
- if (type.flags & 32768 && ts.contains(context.inferTypeParameters, type)) {
+ if (type.flags & 65536 || objectFlags & 3) {
+ if (type.flags & 65536 && ts.contains(context.inferTypeParameters, type)) {
return ts.createInferTypeNode(typeParameterToDeclarationWithConstraint(type, context, undefined));
}
if (context.flags & 4 &&
- type.flags & 32768 &&
+ type.flags & 65536 &&
ts.length(type.symbol.declarations) &&
ts.isTypeParameterDeclaration(type.symbol.declarations[0]) &&
typeParameterShadowsNameInScope(type, context) &&
!isTypeSymbolAccessible(type.symbol, context.enclosingDeclaration)) {
return ts.createTypeReferenceNode(ts.getGeneratedNameForNode(type.symbol.declarations[0].name, 16 | 8), undefined);
}
- var name = type.symbol ? symbolToName(type.symbol, context, 67901928, false) : ts.createIdentifier("?");
- return ts.createTypeReferenceNode(name, undefined);
+ return type.symbol
+ ? symbolToTypeNode(type.symbol, context, 67901928)
+ : ts.createTypeReferenceNode(ts.createIdentifier("?"), undefined);
}
if (!inTypeAlias && type.aliasSymbol && (context.flags & 16384 || isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration))) {
var typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context);
@@ -25256,11 +25415,11 @@ var ts;
return ts.createTypeReferenceNode(ts.createIdentifier(""), typeArgumentNodes);
return symbolToTypeNode(type.aliasSymbol, context, 67901928, typeArgumentNodes);
}
- if (type.flags & (131072 | 262144)) {
- var types = type.flags & 131072 ? formatUnionTypes(type.types) : type.types;
+ if (type.flags & (262144 | 524288)) {
+ var types = type.flags & 262144 ? formatUnionTypes(type.types) : type.types;
var typeNodes = mapToTypeNodes(types, context);
if (typeNodes && typeNodes.length > 0) {
- var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 131072 ? 168 : 169, typeNodes);
+ var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 262144 ? 169 : 170, typeNodes);
return unionOrIntersectionTypeNode;
}
else {
@@ -25271,20 +25430,20 @@ var ts;
}
}
if (objectFlags & (16 | 32)) {
- ts.Debug.assert(!!(type.flags & 65536));
+ ts.Debug.assert(!!(type.flags & 131072));
return createAnonymousTypeNode(type);
}
- if (type.flags & 524288) {
+ if (type.flags & 1048576) {
var indexedType = type.type;
var indexTypeNode = typeToTypeNodeHelper(indexedType, context);
return ts.createTypeOperatorNode(indexTypeNode);
}
- if (type.flags & 1048576) {
+ if (type.flags & 2097152) {
var objectTypeNode = typeToTypeNodeHelper(type.objectType, context);
var indexTypeNode = typeToTypeNodeHelper(type.indexType, context);
return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode);
}
- if (type.flags & 2097152) {
+ if (type.flags & 4194304) {
var checkTypeNode = typeToTypeNodeHelper(type.checkType, context);
var saveInferTypeParameters = context.inferTypeParameters;
context.inferTypeParameters = type.root.inferTypeParameters;
@@ -25294,12 +25453,12 @@ var ts;
var falseTypeNode = typeToTypeNodeHelper(getFalseTypeFromConditionalType(type), context);
return ts.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode);
}
- if (type.flags & 4194304) {
+ if (type.flags & 8388608) {
return typeToTypeNodeHelper(type.typeVariable, context);
}
- ts.Debug.fail("Should be unreachable.");
+ return ts.Debug.fail("Should be unreachable.");
function createMappedTypeNodeFromType(type) {
- ts.Debug.assert(!!(type.flags & 65536));
+ ts.Debug.assert(!!(type.flags & 131072));
var readonlyToken = type.declaration.readonlyToken ? ts.createToken(type.declaration.readonlyToken.kind) : undefined;
var questionToken = type.declaration.questionToken ? ts.createToken(type.declaration.questionToken.kind) : undefined;
var appropriateConstraintTypeNode;
@@ -25324,7 +25483,7 @@ var ts;
var isInstanceType = type === getInferredClassType(symbol) ? 67901928 : 67216319;
return symbolToTypeNode(symbol, context, isInstanceType);
}
- else if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 204 && context.flags & 2048) ||
+ else if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 205 && context.flags & 2048) ||
symbol.flags & (384 | 512) ||
shouldWriteTypeOfFunctionSymbol()) {
return symbolToTypeNode(symbol, context, 67216319);
@@ -25357,7 +25516,7 @@ var ts;
var isNonLocalFunctionSymbol = !!(symbol.flags & 16) &&
(symbol.parent ||
ts.forEach(symbol.declarations, function (declaration) {
- return declaration.parent.kind === 273 || declaration.parent.kind === 239;
+ return declaration.parent.kind === 274 || declaration.parent.kind === 240;
}));
if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
return (!!(context.flags & 4096) || (context.visitedSymbols && context.visitedSymbols.has(id))) &&
@@ -25376,12 +25535,12 @@ var ts;
}
if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) {
var signature = resolved.callSignatures[0];
- var signatureNode = signatureToSignatureDeclarationHelper(signature, 162, context);
+ var signatureNode = signatureToSignatureDeclarationHelper(signature, 163, context);
return signatureNode;
}
if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) {
var signature = resolved.constructSignatures[0];
- var signatureNode = signatureToSignatureDeclarationHelper(signature, 163, context);
+ var signatureNode = signatureToSignatureDeclarationHelper(signature, 164, context);
return signatureNode;
}
}
@@ -25495,11 +25654,11 @@ var ts;
var typeElements = [];
for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) {
var signature = _a[_i];
- typeElements.push(signatureToSignatureDeclarationHelper(signature, 157, context));
+ typeElements.push(signatureToSignatureDeclarationHelper(signature, 158, context));
}
for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) {
var signature = _c[_b];
- typeElements.push(signatureToSignatureDeclarationHelper(signature, 158, context));
+ typeElements.push(signatureToSignatureDeclarationHelper(signature, 159, context));
}
if (resolvedType.stringIndexInfo) {
var indexInfo = resolvedType.objectFlags & 2048 ?
@@ -25529,7 +25688,7 @@ var ts;
var saveEnclosingDeclaration = context.enclosingDeclaration;
context.enclosingDeclaration = undefined;
if (ts.getCheckFlags(propertySymbol) & 1024) {
- var decl = ts.firstOrUndefined(propertySymbol.declarations);
+ var decl = ts.first(propertySymbol.declarations);
var name = hasLateBindableName(decl) && resolveEntityName(decl.name.expression, 67216319);
if (name && context.tracker.trackSymbol) {
context.tracker.trackSymbol(name, saveEnclosingDeclaration, 67216319);
@@ -25542,7 +25701,7 @@ var ts;
var signatures = getSignaturesOfType(propertyType, 0);
for (var _e = 0, signatures_1 = signatures; _e < signatures_1.length; _e++) {
var signature = signatures_1[_e];
- var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 152, context);
+ var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 153, context);
methodDeclaration.name = propertyName;
methodDeclaration.questionToken = optionalToken;
if (propertySymbol.valueDeclaration) {
@@ -25584,7 +25743,7 @@ var ts;
var name = ts.getNameFromIndexInfo(indexInfo) || "x";
var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 ? 137 : 134);
var indexingParameter = ts.createParameter(undefined, undefined, undefined, name, undefined, indexerTypeNode, undefined);
- var typeNode = indexInfo.type ? typeToTypeNodeHelper(indexInfo.type, context) : typeToTypeNodeHelper(anyType, context);
+ var typeNode = typeToTypeNodeHelper(indexInfo.type || anyType, context);
if (!indexInfo.type && !(context.flags & 2097152)) {
context.encounteredError = true;
}
@@ -25599,7 +25758,7 @@ var ts;
else {
typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); });
}
- var parameters = signature.parameters.map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 154); });
+ var parameters = signature.parameters.map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 155); });
if (signature.thisParameter) {
var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context);
parameters.unshift(thisParameter);
@@ -25651,22 +25810,22 @@ var ts;
return typeParameterToDeclarationWithConstraint(type, context, constraintNode);
}
function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags) {
- var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 148);
+ var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 149);
if (!parameterDeclaration && !isTransientSymbol(parameterSymbol)) {
- parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 292);
+ parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 293);
}
var parameterType = getTypeOfSymbol(parameterSymbol);
if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) {
parameterType = getOptionalType(parameterType);
}
var parameterTypeNode = typeToTypeNodeHelper(parameterType, context);
- var modifiers = !(context.flags & 8192) && preserveModifierFlags && parameterDeclaration && parameterDeclaration.modifiers && parameterDeclaration.modifiers.map(ts.getSynthesizedClone);
+ var modifiers = !(context.flags & 8192) && preserveModifierFlags && parameterDeclaration && parameterDeclaration.modifiers ? parameterDeclaration.modifiers.map(ts.getSynthesizedClone) : undefined;
var isRest = parameterDeclaration ? ts.isRestParameter(parameterDeclaration) : parameterSymbol.isRestParameter;
var dotDotDotToken = isRest ? ts.createToken(24) : undefined;
var name = parameterDeclaration
? parameterDeclaration.name ?
parameterDeclaration.name.kind === 71 ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name), 16777216) :
- parameterDeclaration.name.kind === 145 ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216) :
+ parameterDeclaration.name.kind === 146 ? ts.setEmitFlags(ts.getSynthesizedClone(parameterDeclaration.name.right), 16777216) :
cloneBindingName(parameterDeclaration.name) :
ts.symbolName(parameterSymbol)
: ts.symbolName(parameterSymbol);
@@ -25678,7 +25837,7 @@ var ts;
function elideInitializerAndSetEmitFlags(node) {
var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, undefined, elideInitializerAndSetEmitFlags);
var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited);
- if (clone.kind === 181) {
+ if (clone.kind === 182) {
clone.initializer = undefined;
}
return ts.setEmitFlags(clone, 1 | 16777216);
@@ -25690,7 +25849,7 @@ var ts;
var chain;
var isTypeParameter = symbol.flags & 262144;
if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64)) {
- chain = getSymbolChain(symbol, meaning, true);
+ chain = ts.Debug.assertDefined(getSymbolChain(symbol, meaning, true));
ts.Debug.assert(chain && chain.length > 0);
}
else {
@@ -25702,12 +25861,12 @@ var ts;
var parentSymbol;
if (!accessibleSymbolChain ||
needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) {
- var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol);
+ var parent = getContainerOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol);
if (parent) {
var parentChain = getSymbolChain(parent, getQualifiedLeftMeaning(meaning), false);
if (parentChain) {
parentSymbol = parent;
- accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [symbol]);
+ accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [getAliasForSymbolInContainer(parent, symbol) || symbol]);
}
}
}
@@ -25715,7 +25874,7 @@ var ts;
return accessibleSymbolChain;
}
if (endOfChain ||
- (yieldModuleSymbol || !(!parentSymbol && ts.forEach(symbol.declarations, hasExternalModuleSymbol))) &&
+ (yieldModuleSymbol || !(!parentSymbol && ts.forEach(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol))) &&
!(symbol.flags & (2048 | 4096))) {
return [symbol];
}
@@ -25886,6 +26045,7 @@ var ts;
}
}
function typePredicateToString(typePredicate, enclosingDeclaration, flags, writer) {
+ if (flags === void 0) { flags = 16384; }
return writer ? typePredicateToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(typePredicateToStringWorker);
function typePredicateToStringWorker(writer) {
var predicate = ts.createTypePredicateNode(typePredicate.kind === 1 ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(), nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 | 512));
@@ -25901,10 +26061,10 @@ var ts;
for (var i = 0; i < types.length; i++) {
var t = types[i];
flags |= t.flags;
- if (!(t.flags & 12288)) {
- if (t.flags & (128 | 256)) {
- var baseType = t.flags & 128 ? booleanType : getBaseTypeOfEnumLiteralType(t);
- if (baseType.flags & 131072) {
+ if (!(t.flags & 24576)) {
+ if (t.flags & (256 | 512)) {
+ var baseType = t.flags & 256 ? booleanType : getBaseTypeOfEnumLiteralType(t);
+ if (baseType.flags & 262144) {
var count = baseType.types.length;
if (i + count <= types.length && types[i + count - 1] === baseType.types[count - 1]) {
result.push(baseType);
@@ -25916,9 +26076,9 @@ var ts;
result.push(t);
}
}
- if (flags & 8192)
+ if (flags & 16384)
result.push(nullType);
- if (flags & 4096)
+ if (flags & 8192)
result.push(undefinedType);
return result || types;
}
@@ -25933,8 +26093,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 !== 172; });
- if (node.kind === 236) {
+ var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 173; });
+ if (node.kind === 237) {
return getSymbolOfNode(node);
}
}
@@ -25942,11 +26102,11 @@ var ts;
}
function isTopLevelInExternalModuleAugmentation(node) {
return node && node.parent &&
- node.parent.kind === 239 &&
+ node.parent.kind === 240 &&
ts.isExternalModuleAugmentation(node.parent.parent);
}
function isDefaultBindingContext(location) {
- return location.kind === 273 || ts.isAmbientModule(location);
+ return location.kind === 274 || ts.isAmbientModule(location);
}
function getNameOfSymbolAsWritten(symbol, context) {
if (context && symbol.escapedName === "default" && !(context.flags & 16384) &&
@@ -25957,7 +26117,7 @@ var ts;
}
if (symbol.declarations && symbol.declarations.length) {
if (ts.some(symbol.declarations, hasExternalModuleSymbol) && context.enclosingDeclaration) {
- var file = ts.getDeclarationOfKind(symbol, 273);
+ var file = ts.getDeclarationOfKind(symbol, 274);
if (!file || !context.tracker.moduleResolverHost) {
if (context.tracker.trackReferencedAmbientModule) {
var ambientDecls = ts.filter(symbol.declarations, ts.isAmbientModule);
@@ -25978,26 +26138,26 @@ var ts;
if (name) {
return ts.declarationNameToString(name);
}
- if (declaration.parent && declaration.parent.kind === 231) {
+ if (declaration.parent && declaration.parent.kind === 232) {
return ts.declarationNameToString(declaration.parent.name);
}
if (context && !context.encounteredError && !(context.flags & 131072)) {
context.encounteredError = true;
}
switch (declaration.kind) {
- case 204:
+ case 205:
return "(Anonymous class)";
- case 191:
case 192:
+ case 193:
return "(Anonymous function)";
}
}
var nameType = symbol.nameType;
if (nameType) {
- if (nameType.flags & 32 && !ts.isIdentifierText(nameType.value, compilerOptions.target)) {
+ if (nameType.flags & 64 && !ts.isIdentifierText(nameType.value, compilerOptions.target)) {
return "\"" + ts.escapeString(nameType.value, 34) + "\"";
}
- if (nameType && nameType.flags & 1024) {
+ if (nameType && nameType.flags & 2048) {
return "[" + getNameOfSymbolAsWritten(nameType.symbol, context) + "]";
}
}
@@ -26014,67 +26174,67 @@ var ts;
return false;
function determineIfDeclarationIsVisible() {
switch (node.kind) {
- case 291:
- case 296:
+ case 292:
+ case 297:
return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent));
- case 181:
+ case 182:
return isDeclarationVisible(node.parent.parent);
- case 231:
+ case 232:
if (ts.isBindingPattern(node.name) &&
!node.name.elements.length) {
return false;
}
- case 238:
- case 234:
+ case 239:
case 235:
case 236:
- case 233:
case 237:
- case 242:
+ case 234:
+ case 238:
+ case 243:
if (ts.isExternalModuleAugmentation(node)) {
return true;
}
var parent = getDeclarationContainer(node);
if (!(ts.getCombinedModifierFlags(node) & 1) &&
- !(node.kind !== 242 && parent.kind !== 273 && parent.flags & 4194304)) {
+ !(node.kind !== 243 && parent.kind !== 274 && parent.flags & 4194304)) {
return isGlobalSourceFile(parent);
}
return isDeclarationVisible(parent);
- case 151:
- case 150:
- case 155:
- case 156:
- case 153:
case 152:
+ case 151:
+ case 156:
+ case 157:
+ case 154:
+ case 153:
if (ts.hasModifier(node, 8 | 16)) {
return false;
}
- case 154:
- case 158:
- case 157:
+ case 155:
case 159:
- case 148:
- case 239:
- case 162:
+ case 158:
+ case 160:
+ case 149:
+ case 240:
case 163:
- case 165:
- case 161:
+ case 164:
case 166:
+ case 162:
case 167:
case 168:
case 169:
- case 172:
+ case 170:
+ case 173:
return isDeclarationVisible(node.parent);
- case 244:
case 245:
- case 247:
- return false;
- case 147:
- case 273:
- case 241:
- return true;
+ case 246:
case 248:
return false;
+ case 148:
+ case 274:
+ case 242:
+ return true;
+ case 249:
+ return false;
default:
return false;
}
@@ -26082,10 +26242,10 @@ var ts;
}
function collectLinkedAliases(node, setVisibility) {
var exportSymbol;
- if (node.parent && node.parent.kind === 248) {
+ if (node.parent && node.parent.kind === 249) {
exportSymbol = resolveName(node, node.escapedText, 67216319 | 67901928 | 1920 | 2097152, undefined, node, false);
}
- else if (node.parent.kind === 251) {
+ else if (node.parent.kind === 252) {
exportSymbol = getTargetOfExportSpecifier(node.parent, 67216319 | 67901928 | 1920 | 2097152);
}
var result;
@@ -26141,22 +26301,22 @@ var ts;
}
function hasType(target, propertyName) {
if (propertyName === 0) {
- return getSymbolLinks(target).type;
+ return !!getSymbolLinks(target).type;
}
if (propertyName === 2) {
- return getSymbolLinks(target).declaredType;
+ return !!getSymbolLinks(target).declaredType;
}
if (propertyName === 1) {
- return target.resolvedBaseConstructorType;
+ return !!target.resolvedBaseConstructorType;
}
if (propertyName === 3) {
- return target.resolvedReturnType;
+ return !!target.resolvedReturnType;
}
if (propertyName === 4) {
var bc = target.resolvedBaseConstraint;
- return bc && bc !== circularConstraintType;
+ return !!bc && bc !== circularConstraintType;
}
- ts.Debug.fail("Unhandled TypeSystemPropertyName " + propertyName);
+ return ts.Debug.fail("Unhandled TypeSystemPropertyName " + propertyName);
}
function popTypeResolution() {
resolutionTargets.pop();
@@ -26164,20 +26324,19 @@ var ts;
return resolutionResults.pop();
}
function getDeclarationContainer(node) {
- node = ts.findAncestor(ts.getRootDeclaration(node), function (node) {
+ return ts.findAncestor(ts.getRootDeclaration(node), function (node) {
switch (node.kind) {
- case 231:
case 232:
+ case 233:
+ case 248:
case 247:
case 246:
case 245:
- case 244:
return false;
default:
return true;
}
- });
- return node && node.parent;
+ }).parent;
}
function getTypeOfPrototypeProperty(prototype) {
var classType = getDeclaredTypeOfSymbol(getParentOfSymbol(prototype));
@@ -26195,14 +26354,14 @@ var ts;
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, false);
}
function isComputedNonLiteralName(name) {
- return name.kind === 146 && !ts.isStringOrNumericLiteral(name.expression);
+ return name.kind === 147 && !ts.isStringOrNumericLiteral(name.expression);
}
function getRestType(source, properties, symbol) {
- source = filterType(source, function (t) { return !(t.flags & 12288); });
- if (source.flags & 16384) {
+ source = filterType(source, function (t) { return !(t.flags & 24576); });
+ if (source.flags & 32768) {
return emptyObjectType;
}
- if (source.flags & 131072) {
+ if (source.flags & 262144) {
return mapType(source, function (t) { return getRestType(t, properties, symbol); });
}
var members = ts.createSymbolTable();
@@ -26227,8 +26386,8 @@ var ts;
function getTypeForBindingElement(declaration) {
var pattern = declaration.parent;
var parentType = getTypeForBindingElementParent(pattern.parent);
- if (parentType === unknownType) {
- return unknownType;
+ if (parentType === errorType) {
+ return errorType;
}
if (!parentType) {
return declaration.initializer ? checkDeclarationInitializer(declaration) : parentType;
@@ -26237,11 +26396,11 @@ var ts;
return parentType;
}
var type;
- if (pattern.kind === 179) {
+ if (pattern.kind === 180) {
if (declaration.dotDotDotToken) {
- if (!isValidSpreadType(parentType)) {
+ if (parentType.flags & 2 || !isValidSpreadType(parentType)) {
error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types);
- return unknownType;
+ return errorType;
}
var literalMembers = [];
for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {
@@ -26258,13 +26417,13 @@ var ts;
var isWellKnown = ts.isComputedPropertyName(name) && ts.isWellKnownSymbolSyntactically(name.expression);
if (!isLate && !isWellKnown && isComputedNonLiteralName(name)) {
var exprType = checkExpression(name.expression);
- if (isTypeAssignableToKind(exprType, 1536)) {
+ if (isTypeAssignableToKind(exprType, 3072)) {
if (noImplicitAny) {
error(declaration, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(exprType), typeToString(parentType));
}
return anyType;
}
- var indexerType = isTypeAssignableToKind(exprType, 84) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0);
+ var indexerType = isTypeAssignableToKind(exprType, 168) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0);
if (!indexerType && noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) {
if (getIndexTypeOfType(parentType, 1)) {
error(declaration, ts.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number);
@@ -26275,14 +26434,14 @@ var ts;
}
return indexerType || anyType;
}
- var nameType = isLate && checkComputedPropertyName(name);
+ var nameType = isLate ? checkComputedPropertyName(name) : undefined;
var text = isLate ? getLateBoundNameFromType(nameType) :
isWellKnown ? ts.getPropertyNameForKnownSymbolName(ts.idText(name.expression.name)) :
ts.getTextOfPropertyName(name);
if (strictNullChecks && declaration.flags & 4194304 && ts.isParameterDeclaration(declaration)) {
parentType = getNonNullableType(parentType);
}
- if (isLate && nameType && !getPropertyOfType(parentType, text) && isTypeAssignableToKind(nameType, 1536)) {
+ if (isLate && nameType && !getPropertyOfType(parentType, text) && isTypeAssignableToKind(nameType, 3072)) {
if (noImplicitAny) {
error(declaration, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(nameType), typeToString(parentType));
}
@@ -26294,7 +26453,7 @@ var ts;
getIndexTypeOfType(parentType, 0);
if (!type) {
error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name));
- return unknownType;
+ return errorType;
}
}
}
@@ -26315,11 +26474,11 @@ var ts;
else {
error(declaration, ts.Diagnostics.Type_0_has_no_property_1, typeToString(parentType), propName);
}
- return unknownType;
+ return errorType;
}
}
}
- if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkExpressionCached(declaration.initializer)) & 4096)) {
+ if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkExpressionCached(declaration.initializer)) & 8192)) {
type = getTypeWithFacts(type, 131072);
}
return declaration.initializer ?
@@ -26339,18 +26498,18 @@ var ts;
}
function isEmptyArrayLiteral(node) {
var expr = ts.skipParentheses(node);
- return expr.kind === 182 && expr.elements.length === 0;
+ return expr.kind === 183 && 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 === 220) {
- var indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression));
- return indexType.flags & (32768 | 524288) ? getExtractStringType(indexType) : stringType;
- }
if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 221) {
+ var indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression));
+ return indexType.flags & (65536 | 1048576) ? getExtractStringType(indexType) : stringType;
+ }
+ if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 222) {
var forOfStatement = declaration.parent.parent;
return checkRightHandSideOfForOf(forOfStatement.expression, forOfStatement.awaitModifier) || anyType;
}
@@ -26364,7 +26523,7 @@ var ts;
return addOptionality(declaredType, isOptional);
}
if ((noImplicitAny || ts.isInJavaScriptFile(declaration)) &&
- declaration.kind === 231 && !ts.isBindingPattern(declaration.name) &&
+ declaration.kind === 232 && !ts.isBindingPattern(declaration.name) &&
!(ts.getCombinedModifierFlags(declaration) & 1) && !(declaration.flags & 4194304)) {
if (!(ts.getCombinedNodeFlags(declaration) & 2) && (!declaration.initializer || isNullOrUndefined(declaration.initializer))) {
return autoType;
@@ -26373,10 +26532,10 @@ var ts;
return autoArrayType;
}
}
- if (declaration.kind === 148) {
+ if (declaration.kind === 149) {
var func = declaration.parent;
- if (func.kind === 156 && !hasNonBindableDynamicName(func)) {
- var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 155);
+ if (func.kind === 157 && !hasNonBindableDynamicName(func)) {
+ var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 156);
if (getter) {
var getterSignature = getSignatureFromDeclaration(getter);
var thisParameter = getAccessorThisParameter(func);
@@ -26422,18 +26581,18 @@ var ts;
var jsDocType;
var _loop_3 = function (declaration) {
var declarationInConstructor = false;
- var expression = declaration.kind === 199 ? declaration :
- declaration.kind === 184 ? ts.cast(declaration.parent, ts.isBinaryExpression) :
+ var expression = declaration.kind === 200 ? declaration :
+ declaration.kind === 185 ? ts.cast(declaration.parent, ts.isBinaryExpression) :
undefined;
if (!expression) {
- return { value: unknownType };
+ return { value: errorType };
}
var special = ts.getSpecialPropertyAssignmentKind(expression);
if (special === 4) {
var thisContainer = ts.getThisContainer(expression, false);
- declarationInConstructor = thisContainer.kind === 154 ||
- thisContainer.kind === 233 ||
- (thisContainer.kind === 191 && !ts.isPrototypePropertyAssignment(thisContainer.parent));
+ declarationInConstructor = thisContainer.kind === 155 ||
+ thisContainer.kind === 234 ||
+ (thisContainer.kind === 192 && !ts.isPrototypePropertyAssignment(thisContainer.parent));
if (declarationInConstructor) {
definedInConstructor = true;
}
@@ -26447,7 +26606,7 @@ var ts;
if (!jsDocType) {
jsDocType = declarationType;
}
- else if (jsDocType !== unknownType && declarationType !== unknownType &&
+ else if (jsDocType !== errorType && declarationType !== errorType &&
!isTypeIdenticalTo(jsDocType, declarationType) &&
!(symbol.flags & 67108864)) {
errorNextVariableOrPropertyDeclarationMustHaveSameType(jsDocType, declaration, declarationType);
@@ -26502,11 +26661,11 @@ var ts;
definedInConstructor = true;
}
}
- var sourceTypes = ts.some(constructorTypes, function (t) { return !!(t.flags & ~(12288 | 16777216)); }) ? constructorTypes : types;
+ var sourceTypes = ts.some(constructorTypes, function (t) { return !!(t.flags & ~(24576 | 134217728)); }) ? constructorTypes : types;
type = getUnionType(sourceTypes, 2);
}
var widened = getWidenedType(addOptionality(type, definedInMethod && !definedInConstructor));
- if (filterType(widened, function (t) { return !!(t.flags & ~12288); }) === neverType) {
+ if (filterType(widened, function (t) { return !!(t.flags & ~24576); }) === neverType) {
if (noImplicitAny) {
reportImplicitAnyError(symbol.valueDeclaration, anyType);
}
@@ -26561,7 +26720,7 @@ var ts;
members.set(symbol.escapedName, symbol);
});
var result = createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, undefined);
- result.flags |= 33554432;
+ result.flags |= 268435456;
result.objectFlags |= objectFlags;
if (includePatternInType) {
result.pattern = pattern;
@@ -26571,7 +26730,7 @@ var ts;
function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) {
var elements = pattern.elements;
var lastElement = ts.lastOrUndefined(elements);
- if (elements.length === 0 || (!ts.isOmittedExpression(lastElement) && lastElement.dotDotDotToken)) {
+ if (!lastElement || (!ts.isOmittedExpression(lastElement) && lastElement.dotDotDotToken)) {
return languageVersion >= 2 ? createIterableType(anyType) : anyArrayType;
}
var elementTypes = ts.map(elements, function (e) { return ts.isOmittedExpression(e) ? anyType : getTypeFromBindingElement(e, includePatternInType, reportErrors); });
@@ -26583,7 +26742,9 @@ var ts;
return result;
}
function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) {
- return pattern.kind === 179
+ if (includePatternInType === void 0) { includePatternInType = false; }
+ if (reportErrors === void 0) { reportErrors = false; }
+ return pattern.kind === 180
? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors)
: getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors);
}
@@ -26593,7 +26754,7 @@ var ts;
if (reportErrors) {
reportErrorsFromWidening(declaration, type);
}
- if (type.flags & 1024 && (ts.isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfNode(declaration)) {
+ if (type.flags & 2048 && (ts.isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfNode(declaration)) {
type = esSymbolType;
}
return getWidenedType(type);
@@ -26608,7 +26769,7 @@ var ts;
}
function declarationBelongsToPrivateAmbientMember(declaration) {
var root = ts.getRootDeclaration(declaration);
- var memberDeclaration = root.kind === 148 ? root.parent : root;
+ var memberDeclaration = root.kind === 149 ? root.parent : root;
return isPrivateWithinAmbient(memberDeclaration);
}
function tryGetTypeFromEffectiveTypeNode(declaration) {
@@ -26634,23 +26795,25 @@ var ts;
var jsonSourceFile = ts.cast(declaration, ts.isJsonSourceFile);
return links.type = jsonSourceFile.statements.length ? checkExpression(jsonSourceFile.statements[0].expression) : emptyObjectType;
}
- if (declaration.kind === 248) {
+ if (declaration.kind === 249) {
return links.type = checkExpression(declaration.expression);
}
if (ts.isInJavaScriptFile(declaration) && ts.isJSDocPropertyLikeTag(declaration) && declaration.typeExpression) {
return links.type = getTypeFromTypeNode(declaration.typeExpression.type);
}
if (!pushTypeResolution(symbol, 0)) {
- return unknownType;
+ return errorType;
}
var type = void 0;
- if (declaration.kind === 199 ||
- declaration.kind === 184 && declaration.parent.kind === 199) {
+ if (declaration.kind === 200 ||
+ declaration.kind === 185 && declaration.parent.kind === 200) {
type = getWidenedTypeFromJSSpecialPropertyDeclarations(symbol);
}
else if (ts.isJSDocPropertyLikeTag(declaration)
|| ts.isPropertyAccessExpression(declaration)
|| ts.isIdentifier(declaration)
+ || ts.isClassDeclaration(declaration)
+ || ts.isFunctionDeclaration(declaration)
|| (ts.isMethodDeclaration(declaration) && !ts.isObjectLiteralMethod(declaration))
|| ts.isMethodSignature(declaration)) {
if (symbol.flags & (16 | 8192 | 32 | 384 | 512)) {
@@ -26678,7 +26841,7 @@ var ts;
type = getWidenedTypeForVariableLikeDeclaration(declaration, true);
}
else {
- ts.Debug.fail("Unhandled declaration kind! " + ts.Debug.showSyntaxKind(declaration));
+ return ts.Debug.fail("Unhandled declaration kind! " + ts.Debug.showSyntaxKind(declaration) + " for " + ts.Debug.showSymbol(symbol));
}
if (!popTypeResolution()) {
type = reportCircularityError(symbol);
@@ -26689,7 +26852,7 @@ var ts;
}
function getAnnotatedAccessorType(accessor) {
if (accessor) {
- if (accessor.kind === 155) {
+ if (accessor.kind === 156) {
var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor);
return getterTypeAnnotation && getTypeFromTypeNode(getterTypeAnnotation);
}
@@ -26710,8 +26873,8 @@ var ts;
function getTypeOfAccessors(symbol) {
var links = getSymbolLinks(symbol);
if (!links.type) {
- var getter = ts.getDeclarationOfKind(symbol, 155);
- var setter = ts.getDeclarationOfKind(symbol, 156);
+ var getter = ts.getDeclarationOfKind(symbol, 156);
+ var setter = ts.getDeclarationOfKind(symbol, 157);
if (getter && ts.isInJavaScriptFile(getter)) {
var jsDocType = getTypeForDeclarationFromJSDocComment(getter);
if (jsDocType) {
@@ -26719,7 +26882,7 @@ var ts;
}
}
if (!pushTypeResolution(symbol, 0)) {
- return unknownType;
+ return errorType;
}
var type = void 0;
var getterReturnType = getAnnotatedAccessorType(getter);
@@ -26752,7 +26915,7 @@ var ts;
if (!popTypeResolution()) {
type = anyType;
if (noImplicitAny) {
- var getter_1 = ts.getDeclarationOfKind(symbol, 155);
+ var getter_1 = ts.getDeclarationOfKind(symbol, 156);
error(getter_1, 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));
}
}
@@ -26762,16 +26925,32 @@ var ts;
}
function getBaseTypeVariableOfClass(symbol) {
var baseConstructorType = getBaseConstructorTypeOfClass(getDeclaredTypeOfClassOrInterface(symbol));
- return baseConstructorType.flags & 1081344 ? baseConstructorType : undefined;
+ return baseConstructorType.flags & 2162688 ? baseConstructorType : undefined;
}
function getTypeOfFuncClassEnumModule(symbol) {
var links = getSymbolLinks(symbol);
if (!links.type) {
+ var jsDeclaration = ts.getDeclarationOfJSInitializer(symbol.valueDeclaration);
+ if (jsDeclaration) {
+ var jsSymbol = getSymbolOfNode(jsDeclaration);
+ if (jsSymbol && (ts.hasEntries(jsSymbol.exports) || ts.hasEntries(jsSymbol.members))) {
+ symbol = cloneSymbol(symbol);
+ links = symbol;
+ if (ts.hasEntries(jsSymbol.exports)) {
+ symbol.exports = symbol.exports || ts.createSymbolTable();
+ mergeSymbolTable(symbol.exports, jsSymbol.exports);
+ }
+ if (ts.hasEntries(jsSymbol.members)) {
+ symbol.members = symbol.members || ts.createSymbolTable();
+ mergeSymbolTable(symbol.members, jsSymbol.members);
+ }
+ }
+ }
if (symbol.flags & 1536 && ts.isShorthandAmbientModuleSymbol(symbol)) {
links.type = anyType;
}
- else if (symbol.valueDeclaration.kind === 199 ||
- symbol.valueDeclaration.kind === 184 && symbol.valueDeclaration.parent.kind === 199) {
+ else if (symbol.valueDeclaration.kind === 200 ||
+ symbol.valueDeclaration.kind === 185 && symbol.valueDeclaration.parent.kind === 200) {
links.type = getWidenedTypeFromJSSpecialPropertyDeclarations(symbol);
}
else {
@@ -26800,7 +26979,7 @@ var ts;
var targetSymbol = resolveAlias(symbol);
links.type = targetSymbol.flags & 67216319
? getTypeOfSymbol(targetSymbol)
- : unknownType;
+ : errorType;
}
return links.type;
}
@@ -26809,11 +26988,11 @@ var ts;
if (!links.type) {
if (symbolInstantiationDepth === 100) {
error(symbol.valueDeclaration, ts.Diagnostics.Generic_type_instantiation_is_excessively_deep_and_possibly_infinite);
- links.type = unknownType;
+ links.type = errorType;
}
else {
if (!pushTypeResolution(symbol, 0)) {
- return unknownType;
+ return errorType;
}
symbolInstantiationDepth++;
var type = instantiateType(getTypeOfSymbol(links.target), links.mapper);
@@ -26829,7 +27008,7 @@ var ts;
function reportCircularityError(symbol) {
if (ts.getEffectiveTypeAnnotationNode(symbol.valueDeclaration)) {
error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol));
- return unknownType;
+ return errorType;
}
if (noImplicitAny) {
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));
@@ -26858,7 +27037,7 @@ var ts;
if (symbol.flags & 2097152) {
return getTypeOfAlias(symbol);
}
- return unknownType;
+ return errorType;
}
function isReferenceToType(type, target) {
return type !== undefined
@@ -26874,11 +27053,12 @@ var ts;
function check(type) {
if (ts.getObjectFlags(type) & (3 | 4)) {
var target = getTargetType(type);
- return target === checkBase || ts.forEach(getBaseTypes(target), check);
+ return target === checkBase || ts.some(getBaseTypes(target), check);
}
- else if (type.flags & 262144) {
- return ts.forEach(type.types, check);
+ else if (type.flags & 524288) {
+ return ts.some(type.types, check);
}
+ return false;
}
}
function appendTypeParameters(typeParameters, declarations) {
@@ -26895,51 +27075,51 @@ var ts;
return undefined;
}
switch (node.kind) {
- case 234:
- case 204:
case 235:
- case 157:
- case 158:
- case 152:
- case 162:
- case 163:
- case 283:
- case 233:
- case 153:
- case 191:
- case 192:
+ case 205:
case 236:
- case 295:
+ case 158:
+ case 159:
+ case 153:
+ case 163:
+ case 164:
+ case 284:
+ case 234:
+ case 154:
+ case 192:
+ case 193:
+ case 237:
case 296:
- case 291:
- case 176:
- case 170:
+ case 297:
+ case 292:
+ case 177:
+ case 171:
var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
- if (node.kind === 176) {
+ if (node.kind === 177) {
return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)));
}
- else if (node.kind === 170) {
+ else if (node.kind === 171) {
return ts.concatenate(outerTypeParameters, getInferTypeParameters(node));
}
var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node));
var thisType = includeThisTypes &&
- (node.kind === 234 || node.kind === 204 || node.kind === 235) &&
+ (node.kind === 235 || node.kind === 205 || node.kind === 236) &&
getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType;
return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters;
}
}
}
function getOuterTypeParametersOfClassOrInterface(symbol) {
- var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 235);
+ var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 236);
return getOuterTypeParameters(declaration);
}
function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) {
var result;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var node = _a[_i];
- if (node.kind === 235 ||
- node.kind === 234 ||
- node.kind === 204 ||
+ if (node.kind === 236 ||
+ node.kind === 235 ||
+ node.kind === 205 ||
ts.isTypeAlias(node)) {
var declaration = node;
result = appendTypeParameters(result, ts.getEffectiveTypeParameterDeclarations(declaration));
@@ -26962,9 +27142,9 @@ var ts;
if (isValidBaseType(type) && getSignaturesOfType(type, 1).length > 0) {
return true;
}
- if (type.flags & 1081344) {
+ if (type.flags & 2162688) {
var constraint = getBaseConstraintOfType(type);
- return constraint && isValidBaseType(constraint) && isMixinConstructorType(constraint);
+ return !!constraint && isValidBaseType(constraint) && isMixinConstructorType(constraint);
}
return false;
}
@@ -26997,23 +27177,23 @@ var ts;
return type.resolvedBaseConstructorType = undefinedType;
}
if (!pushTypeResolution(type, 1)) {
- return unknownType;
+ return errorType;
}
var baseConstructorType = checkExpression(baseTypeNode.expression);
if (extended && baseTypeNode !== extended) {
ts.Debug.assert(!extended.typeArguments);
checkExpression(extended.expression);
}
- if (baseConstructorType.flags & (65536 | 262144)) {
+ if (baseConstructorType.flags & (131072 | 524288)) {
resolveStructuredTypeMembers(baseConstructorType);
}
if (!popTypeResolution()) {
error(type.symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression, symbolToString(type.symbol));
- return type.resolvedBaseConstructorType = unknownType;
+ return type.resolvedBaseConstructorType = errorType;
}
if (!(baseConstructorType.flags & 1) && baseConstructorType !== nullWideningType && !isConstructorType(baseConstructorType)) {
error(baseTypeNode.expression, ts.Diagnostics.Type_0_is_not_a_constructor_function_type, typeToString(baseConstructorType));
- return type.resolvedBaseConstructorType = unknownType;
+ return type.resolvedBaseConstructorType = errorType;
}
type.resolvedBaseConstructorType = baseConstructorType;
}
@@ -27041,7 +27221,7 @@ var ts;
function resolveBaseTypesOfClass(type) {
type.resolvedBaseTypes = ts.resolvingEmptyArray;
var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type));
- if (!(baseConstructorType.flags & (65536 | 262144 | 1))) {
+ if (!(baseConstructorType.flags & (131072 | 524288 | 1))) {
return type.resolvedBaseTypes = ts.emptyArray;
}
var baseTypeNode = getBaseTypeNodeOfClass(type);
@@ -27063,7 +27243,7 @@ var ts;
}
baseType = getReturnTypeOfSignature(constructors[0]);
}
- if (baseType === unknownType) {
+ if (baseType === errorType) {
return type.resolvedBaseTypes = ts.emptyArray;
}
if (!isValidBaseType(baseType)) {
@@ -27089,18 +27269,18 @@ var ts;
return true;
}
function isValidBaseType(type) {
- return type.flags & (65536 | 134217728 | 1) && !isGenericMappedType(type) ||
- type.flags & 262144 && !ts.forEach(type.types, function (t) { return !isValidBaseType(t); });
+ return !!(type.flags & (131072 | 16777216 | 1)) && !isGenericMappedType(type) ||
+ !!(type.flags & 524288) && !ts.some(type.types, function (t) { return !isValidBaseType(t); });
}
function resolveBaseTypesOfInterface(type) {
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 === 235 && ts.getInterfaceBaseTypeNodes(declaration)) {
+ if (declaration.kind === 236 && ts.getInterfaceBaseTypeNodes(declaration)) {
for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) {
var node = _c[_b];
var baseType = getTypeFromTypeNode(node);
- if (baseType !== unknownType) {
+ if (baseType !== errorType) {
if (isValidBaseType(baseType)) {
if (type !== baseType && !hasBaseType(baseType, type)) {
if (type.resolvedBaseTypes === ts.emptyArray) {
@@ -27125,7 +27305,7 @@ var ts;
function isThislessInterface(symbol) {
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 235) {
+ if (declaration.kind === 236) {
if (declaration.flags & 64) {
return false;
}
@@ -27161,7 +27341,7 @@ var ts;
type.instantiations.set(getTypeListId(type.typeParameters), type);
type.target = type;
type.typeArguments = type.typeParameters;
- type.thisType = createType(32768);
+ type.thisType = createType(65536);
type.thisType.isThisType = true;
type.thisType.symbol = symbol;
type.thisType.constraint = type;
@@ -27173,13 +27353,13 @@ var ts;
var links = getSymbolLinks(symbol);
if (!links.declaredType) {
if (!pushTypeResolution(symbol, 2)) {
- return unknownType;
+ return errorType;
}
var declaration = ts.find(symbol.declarations, function (d) {
- return ts.isJSDocTypeAlias(d) || d.kind === 236;
+ return ts.isJSDocTypeAlias(d) || d.kind === 237;
});
var typeNode = ts.isJSDocTypeAlias(declaration) ? declaration.typeExpression : declaration.type;
- var type = typeNode ? getTypeFromTypeNode(typeNode) : unknownType;
+ var type = typeNode ? getTypeFromTypeNode(typeNode) : errorType;
if (popTypeResolution()) {
var typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol);
if (typeParameters) {
@@ -27189,7 +27369,7 @@ var ts;
}
}
else {
- type = unknownType;
+ type = errorType;
error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol));
}
links.declaredType = type;
@@ -27200,7 +27380,7 @@ var ts;
if (expr.kind === 9) {
return true;
}
- else if (expr.kind === 199) {
+ else if (expr.kind === 200) {
return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right);
}
return false;
@@ -27214,12 +27394,12 @@ var ts;
case 9:
case 8:
return true;
- case 197:
+ case 198:
return expr.operator === 38 &&
expr.operand.kind === 8;
case 71:
return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText);
- case 199:
+ case 200:
return isStringConcatExpression(expr);
default:
return false;
@@ -27233,7 +27413,7 @@ var ts;
var hasNonLiteralMember = false;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 237) {
+ if (declaration.kind === 238) {
for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) {
var member = _c[_b];
if (member.initializer && member.initializer.kind === 9) {
@@ -27248,7 +27428,7 @@ var ts;
return links.enumKind = hasNonLiteralMember ? 0 : 1;
}
function getBaseTypeOfEnumLiteralType(type) {
- return type.flags & 256 && !(type.flags & 131072) ? getDeclaredTypeOfSymbol(getParentOfSymbol(type.symbol)) : type;
+ return type.flags & 512 && !(type.flags & 262144) ? getDeclaredTypeOfSymbol(getParentOfSymbol(type.symbol)) : type;
}
function getDeclaredTypeOfEnum(symbol) {
var links = getSymbolLinks(symbol);
@@ -27260,7 +27440,7 @@ var ts;
var memberTypeList = [];
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (declaration.kind === 237) {
+ if (declaration.kind === 238) {
for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) {
var member = _c[_b];
var memberType = getLiteralType(getEnumMemberValue(member), enumCount, getSymbolOfNode(member));
@@ -27271,14 +27451,14 @@ var ts;
}
if (memberTypeList.length) {
var enumType_1 = getUnionType(memberTypeList, 1, symbol, undefined);
- if (enumType_1.flags & 131072) {
- enumType_1.flags |= 256;
+ if (enumType_1.flags & 262144) {
+ enumType_1.flags |= 512;
enumType_1.symbol = symbol;
}
return links.declaredType = enumType_1;
}
}
- var enumType = createType(16);
+ var enumType = createType(32);
enumType.symbol = symbol;
return links.declaredType = enumType;
}
@@ -27295,7 +27475,7 @@ var ts;
function getDeclaredTypeOfTypeParameter(symbol) {
var links = getSymbolLinks(symbol);
if (!links.declaredType) {
- var type = createType(32768);
+ var type = createType(65536);
type.symbol = symbol;
links.declaredType = type;
}
@@ -27309,7 +27489,7 @@ var ts;
return links.declaredType;
}
function getDeclaredTypeOfSymbol(symbol) {
- return tryGetDeclaredTypeOfSymbol(symbol) || unknownType;
+ return tryGetDeclaredTypeOfSymbol(symbol) || errorType;
}
function tryGetDeclaredTypeOfSymbol(symbol) {
if (symbol.flags & (32 | 64)) {
@@ -27335,6 +27515,7 @@ var ts;
function isThislessType(node) {
switch (node.kind) {
case 119:
+ case 142:
case 137:
case 134:
case 122:
@@ -27344,11 +27525,11 @@ var ts;
case 140:
case 95:
case 131:
- case 177:
+ case 178:
return true;
- case 166:
+ case 167:
return isThislessType(node.elementType);
- case 161:
+ case 162:
return !node.typeArguments || node.typeArguments.every(isThislessType);
}
return false;
@@ -27363,7 +27544,7 @@ var ts;
function isThislessFunctionLikeDeclaration(node) {
var returnType = ts.getEffectiveReturnTypeNode(node);
var typeParameters = ts.getEffectiveTypeParameterDeclarations(node);
- return (node.kind === 154 || (returnType && isThislessType(returnType))) &&
+ return (node.kind === 155 || (!!returnType && isThislessType(returnType))) &&
node.parameters.every(isThislessVariableLikeDeclaration) &&
typeParameters.every(isThislessTypeParameter);
}
@@ -27372,12 +27553,12 @@ var ts;
var declaration = symbol.declarations[0];
if (declaration) {
switch (declaration.kind) {
- case 151:
- case 150:
- return isThislessVariableLikeDeclaration(declaration);
- case 153:
case 152:
+ case 151:
+ return isThislessVariableLikeDeclaration(declaration);
case 154:
+ case 153:
+ case 155:
return isThislessFunctionLikeDeclaration(declaration);
}
}
@@ -27415,7 +27596,7 @@ var ts;
return type;
}
function isTypeUsableAsLateBoundName(type) {
- return !!(type.flags & 1120);
+ return !!(type.flags & 2240);
}
function isLateBindableName(node) {
return ts.isComputedPropertyName(node)
@@ -27424,7 +27605,7 @@ var ts;
}
function hasLateBindableName(node) {
var name = ts.getNameOfDeclaration(node);
- return name && isLateBindableName(name);
+ return !!name && isLateBindableName(name);
}
function hasNonBindableDynamicName(node) {
return ts.hasDynamicName(node) && !hasLateBindableName(node);
@@ -27433,12 +27614,13 @@ var ts;
return ts.isDynamicName(node) && !isLateBindableName(node);
}
function getLateBoundNameFromType(type) {
- if (type.flags & 1024) {
+ if (type.flags & 2048) {
return "__@" + type.symbol.escapedName + "@" + getSymbolId(type.symbol);
}
- if (type.flags & 96) {
+ if (type.flags & 192) {
return ts.escapeLeadingUnderscores("" + type.value);
}
+ return ts.Debug.fail();
}
function addDeclarationToLateBoundSymbol(symbol, member, symbolFlags) {
ts.Debug.assert(!!(ts.getCheckFlags(symbol) & 1024), "Expected a late-bound symbol.");
@@ -27451,8 +27633,7 @@ var ts;
symbol.declarations.push(member);
}
if (symbolFlags & 67216319) {
- var valueDeclaration = symbol.valueDeclaration;
- if (!valueDeclaration || valueDeclaration.kind !== member.kind) {
+ if (!symbol.valueDeclaration || symbol.valueDeclaration.kind !== member.kind) {
symbol.valueDeclaration = member;
}
}
@@ -27544,7 +27725,7 @@ var ts;
return needApparentType ? getApparentType(ref) : ref;
}
}
- else if (type.flags & 262144) {
+ else if (type.flags & 524288) {
return getIntersectionType(ts.map(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument, needApparentType); }));
}
return needApparentType ? getApparentType(type) : type;
@@ -27803,7 +27984,7 @@ var ts;
if (symbol.flags & 32) {
var classType = getDeclaredTypeOfClassOrInterface(symbol);
var baseConstructorType = getBaseConstructorTypeOfClass(classType);
- if (baseConstructorType.flags & (65536 | 262144 | 1081344)) {
+ if (baseConstructorType.flags & (131072 | 524288 | 2162688)) {
members = ts.createSymbolTable(getNamedMembers(members));
addInheritedMembers(members, getPropertiesOfType(baseConstructorType));
}
@@ -27855,7 +28036,7 @@ var ts;
var templateType = getTemplateTypeFromMappedType(type.target || type);
var modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
var templateModifiers = getMappedTypeModifiers(type);
- var include = keyofStringsOnly ? 32 : 1120;
+ var include = keyofStringsOnly ? 64 : 2240;
if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
for (var _i = 0, _a = getPropertiesOfType(modifiersType); _i < _a.length; _i++) {
var prop = _a[_i];
@@ -27869,15 +28050,15 @@ var ts;
}
}
else {
- var keyType = constraintType.flags & 7372800 ? getApparentType(constraintType) : constraintType;
- var iterationType = keyType.flags & 524288 ? getIndexType(getApparentType(keyType.type)) : keyType;
+ var keyType = constraintType.flags & 14745600 ? getApparentType(constraintType) : constraintType;
+ var iterationType = keyType.flags & 1048576 ? getIndexType(getApparentType(keyType.type)) : keyType;
forEachType(iterationType, addMemberForKeyType);
}
setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo);
function addMemberForKeyType(t, _index, origin) {
var templateMapper = combineTypeMappers(type.mapper, createTypeMapper([typeParameter], [t]));
var propType = instantiateType(templateType, templateMapper);
- if (t.flags & 1120) {
+ if (t.flags & 2240) {
var propName = getLateBoundNameFromType(t);
var modifiersProp = getPropertyOfType(modifiersType, propName);
var isOptional = !!(templateModifiers & 4 ||
@@ -27895,10 +28076,10 @@ var ts;
prop.nameType = t;
members.set(propName, prop);
}
- else if (t.flags & (1 | 2)) {
+ else if (t.flags & (1 | 4)) {
stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1));
}
- else if (t.flags & 4) {
+ else if (t.flags & 8) {
numberIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1));
}
}
@@ -27909,20 +28090,20 @@ var ts;
}
function getConstraintTypeFromMappedType(type) {
return type.constraintType ||
- (type.constraintType = instantiateType(getConstraintOfTypeParameter(getTypeParameterFromMappedType(type)), type.mapper || identityMapper) || unknownType);
+ (type.constraintType = instantiateType(getConstraintOfTypeParameter(getTypeParameterFromMappedType(type)), type.mapper || identityMapper) || errorType);
}
function getTemplateTypeFromMappedType(type) {
return type.templateType ||
(type.templateType = type.declaration.type ?
instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4)), type.mapper || identityMapper) :
- unknownType);
+ errorType);
}
function getConstraintDeclarationForMappedType(type) {
return type.declaration.typeParameter.constraint;
}
function isMappedTypeWithKeyofConstraintDeclaration(type) {
var constraintDeclaration = getConstraintDeclarationForMappedType(type);
- return constraintDeclaration.kind === 174 &&
+ return constraintDeclaration.kind === 175 &&
constraintDeclaration.operator === 128;
}
function getModifiersTypeFromMappedType(type) {
@@ -27933,8 +28114,8 @@ var ts;
else {
var declaredType = getTypeFromMappedTypeNode(type.declaration);
var constraint = getConstraintTypeFromMappedType(declaredType);
- var extendedConstraint = constraint && constraint.flags & 32768 ? getConstraintOfTypeParameter(constraint) : constraint;
- type.modifiersType = extendedConstraint && extendedConstraint.flags & 524288 ? instantiateType(extendedConstraint.type, type.mapper || identityMapper) : emptyObjectType;
+ var extendedConstraint = constraint && constraint.flags & 65536 ? getConstraintOfTypeParameter(constraint) : constraint;
+ type.modifiersType = extendedConstraint && extendedConstraint.flags & 1048576 ? instantiateType(extendedConstraint.type, type.mapper || identityMapper) : emptyObjectType;
}
}
return type.modifiersType;
@@ -27957,11 +28138,11 @@ var ts;
return !!(ts.getObjectFlags(type) & 32 && getMappedTypeModifiers(type) & 4);
}
function isGenericMappedType(type) {
- return ts.getObjectFlags(type) & 32 && isGenericIndexType(getConstraintTypeFromMappedType(type));
+ return !!(ts.getObjectFlags(type) & 32) && isGenericIndexType(getConstraintTypeFromMappedType(type));
}
function resolveStructuredTypeMembers(type) {
if (!type.members) {
- if (type.flags & 65536) {
+ if (type.flags & 131072) {
if (type.objectFlags & 4) {
resolveTypeReferenceMembers(type);
}
@@ -27978,23 +28159,23 @@ var ts;
resolveMappedTypeMembers(type);
}
}
- else if (type.flags & 131072) {
+ else if (type.flags & 262144) {
resolveUnionTypeMembers(type);
}
- else if (type.flags & 262144) {
+ else if (type.flags & 524288) {
resolveIntersectionTypeMembers(type);
}
}
return type;
}
function getPropertiesOfObjectType(type) {
- if (type.flags & 65536) {
+ if (type.flags & 131072) {
return resolveStructuredTypeMembers(type).properties;
}
return ts.emptyArray;
}
function getPropertyOfObjectType(type, name) {
- if (type.flags & 65536) {
+ if (type.flags & 131072) {
var resolved = resolveStructuredTypeMembers(type);
var symbol = resolved.members.get(name);
if (symbol && symbolIsValue(symbol)) {
@@ -28016,7 +28197,7 @@ var ts;
}
}
}
- if (type.flags & 131072) {
+ if (type.flags & 262144) {
break;
}
}
@@ -28026,13 +28207,13 @@ var ts;
}
function getPropertiesOfType(type) {
type = getApparentType(type);
- return type.flags & 393216 ?
+ return type.flags & 786432 ?
getPropertiesOfUnionOrIntersectionType(type) :
getPropertiesOfObjectType(type);
}
function getAllPossiblePropertiesOfTypes(types) {
var unionType = getUnionType(types);
- if (!(unionType.flags & 131072)) {
+ if (!(unionType.flags & 262144)) {
return getAugmentedPropertiesOfType(unionType);
}
var props = ts.createSymbolTable();
@@ -28050,9 +28231,9 @@ var ts;
return ts.arrayFrom(props.values());
}
function getConstraintOfType(type) {
- return type.flags & 32768 ? getConstraintOfTypeParameter(type) :
- type.flags & 1048576 ? getConstraintOfIndexedAccess(type) :
- type.flags & 2097152 ? getConstraintOfConditionalType(type) :
+ return type.flags & 65536 ? getConstraintOfTypeParameter(type) :
+ type.flags & 2097152 ? getConstraintOfIndexedAccess(type) :
+ type.flags & 4194304 ? getConstraintOfConditionalType(type) :
getBaseConstraintOfType(type);
}
function getConstraintOfTypeParameter(typeParameter) {
@@ -28062,12 +28243,12 @@ var ts;
var objectType = getBaseConstraintOfType(type.objectType) || type.objectType;
var indexType = getBaseConstraintOfType(type.indexType) || type.indexType;
var constraint = !isGenericObjectType(objectType) && !isGenericIndexType(indexType) ? getIndexedAccessType(objectType, indexType) : undefined;
- return constraint && constraint !== unknownType ? constraint : undefined;
+ return constraint && constraint !== errorType ? constraint : undefined;
}
function getDefaultConstraintOfConditionalType(type) {
if (!type.resolvedDefaultConstraint) {
var rootTrueType = type.root.trueType;
- var rootTrueConstraint = rootTrueType.flags & 4194304 ? rootTrueType.substitute : rootTrueType;
+ var rootTrueConstraint = rootTrueType.flags & 8388608 ? rootTrueType.substitute : rootTrueType;
type.resolvedDefaultConstraint = getUnionType([instantiateType(rootTrueConstraint, type.combinedMapper || type.mapper), getFalseTypeFromConditionalType(type)]);
}
return type.resolvedDefaultConstraint;
@@ -28078,7 +28259,7 @@ var ts;
if (constraint) {
var mapper = makeUnaryTypeMapper(type.root.checkType, constraint);
var instantiated = getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper));
- if (!(instantiated.flags & 16384)) {
+ if (!(instantiated.flags & 32768)) {
return instantiated;
}
}
@@ -28093,19 +28274,19 @@ var ts;
var hasDisjointDomainType = false;
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
var t = _a[_i];
- if (t.flags & 7897088) {
+ if (t.flags & 15794176) {
var constraint = getConstraintOfType(t);
- while (constraint && constraint.flags & (32768 | 524288 | 2097152)) {
+ while (constraint && constraint.flags & (65536 | 1048576 | 4194304)) {
constraint = getConstraintOfType(constraint);
}
if (constraint) {
- if (!(constraint.flags & 131072)) {
+ if (!(constraint.flags & 262144)) {
return undefined;
}
constraints = ts.append(constraints, constraint);
}
}
- else if (t.flags & 134233854) {
+ else if (t.flags & 16809468) {
hasDisjointDomainType = true;
}
}
@@ -28113,7 +28294,7 @@ var ts;
if (hasDisjointDomainType) {
for (var _b = 0, _c = type.types; _b < _c.length; _b++) {
var t = _c[_b];
- if (t.flags & 134233854) {
+ if (t.flags & 16809468) {
constraints = ts.append(constraints, t);
}
}
@@ -28123,7 +28304,7 @@ var ts;
return undefined;
}
function getBaseConstraintOfInstantiableNonPrimitiveUnionOrIntersection(type) {
- if (type.flags & (7372800 | 393216)) {
+ if (type.flags & (14745600 | 786432)) {
var constraint = getResolvedBaseConstraint(type);
if (constraint !== noConstraintType && constraint !== circularConstraintType) {
return constraint;
@@ -28132,7 +28313,7 @@ var ts;
}
function getBaseConstraintOfType(type) {
var constraint = getBaseConstraintOfInstantiableNonPrimitiveUnionOrIntersection(type);
- if (!constraint && type.flags & 524288) {
+ if (!constraint && type.flags & 1048576) {
return keyofConstraintType;
}
return constraint;
@@ -28163,13 +28344,13 @@ var ts;
return result;
}
function computeBaseConstraint(t) {
- if (t.flags & 32768) {
+ if (t.flags & 65536) {
var constraint = getConstraintFromTypeParameter(t);
return t.isThisType || !constraint ?
constraint :
getBaseConstraint(constraint);
}
- if (t.flags & 393216) {
+ if (t.flags & 786432) {
var types = t.types;
var baseTypes = [];
for (var _i = 0, types_4 = types; _i < types_4.length; _i++) {
@@ -28179,24 +28360,24 @@ var ts;
baseTypes.push(baseType);
}
}
- return t.flags & 131072 && baseTypes.length === types.length ? getUnionType(baseTypes) :
- t.flags & 262144 && baseTypes.length ? getIntersectionType(baseTypes) :
+ return t.flags & 262144 && baseTypes.length === types.length ? getUnionType(baseTypes) :
+ t.flags & 524288 && baseTypes.length ? getIntersectionType(baseTypes) :
undefined;
}
- if (t.flags & 524288) {
+ if (t.flags & 1048576) {
return keyofConstraintType;
}
- if (t.flags & 1048576) {
+ if (t.flags & 2097152) {
var baseObjectType = getBaseConstraint(t.objectType);
var baseIndexType = getBaseConstraint(t.indexType);
var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined;
- return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined;
+ return baseIndexedAccess && baseIndexedAccess !== errorType ? getBaseConstraint(baseIndexedAccess) : undefined;
}
- if (t.flags & 2097152) {
+ if (t.flags & 4194304) {
var constraint = getConstraintOfConditionalType(t);
return constraint && getBaseConstraint(constraint);
}
- if (t.flags & 4194304) {
+ if (t.flags & 8388608) {
return getBaseConstraint(t.substitute);
}
if (isGenericMappedType(t)) {
@@ -28239,19 +28420,19 @@ var ts;
return !!(typeParameter.symbol && ts.forEach(typeParameter.symbol.declarations, function (decl) { return ts.isTypeParameterDeclaration(decl) && decl.default; }));
}
function getApparentType(type) {
- var t = type.flags & 7897088 ? getBaseConstraintOfType(type) || emptyObjectType : type;
- return t.flags & 262144 ? getApparentTypeOfIntersectionType(t) :
- t.flags & 34 ? globalStringType :
- t.flags & 84 ? globalNumberType :
- t.flags & 136 ? globalBooleanType :
- t.flags & 1536 ? getGlobalESSymbolType(languageVersion >= 2) :
- t.flags & 134217728 ? emptyObjectType :
- t.flags & 524288 ? keyofConstraintType :
+ var t = type.flags & 15794176 ? getBaseConstraintOfType(type) || emptyObjectType : type;
+ return t.flags & 524288 ? getApparentTypeOfIntersectionType(t) :
+ t.flags & 68 ? globalStringType :
+ t.flags & 168 ? globalNumberType :
+ t.flags & 272 ? globalBooleanType :
+ t.flags & 3072 ? getGlobalESSymbolType(languageVersion >= 2) :
+ t.flags & 16777216 ? emptyObjectType :
+ t.flags & 1048576 ? keyofConstraintType :
t;
}
function createUnionOrIntersectionProperty(containingType, name) {
var props;
- var isUnion = containingType.flags & 131072;
+ var isUnion = containingType.flags & 262144;
var excludeModifiers = isUnion ? 24 : 0;
var commonFlags = isUnion ? 0 : 16777216;
var syntheticFlag = 4;
@@ -28259,7 +28440,7 @@ var ts;
for (var _i = 0, _a = containingType.types; _i < _a.length; _i++) {
var current = _a[_i];
var type = getApparentType(current);
- if (type !== unknownType) {
+ if (type !== errorType) {
var prop = getPropertyOfType(type, name);
var modifiers = prop ? ts.getDeclarationModifierFlagsFromSymbol(prop) : 0;
if (prop && !(modifiers & excludeModifiers)) {
@@ -28341,7 +28522,7 @@ var ts;
}
function getPropertyOfType(type, name) {
type = getApparentType(type);
- if (type.flags & 65536) {
+ if (type.flags & 131072) {
var resolved = resolveStructuredTypeMembers(type);
var symbol = resolved.members.get(name);
if (symbol && symbolIsValue(symbol)) {
@@ -28355,13 +28536,13 @@ var ts;
}
return getPropertyOfObjectType(globalObjectType, name);
}
- if (type.flags & 393216) {
+ if (type.flags & 786432) {
return getPropertyOfUnionOrIntersectionType(type, name);
}
return undefined;
}
function getSignaturesOfStructuredType(type, kind) {
- if (type.flags & 458752) {
+ if (type.flags & 917504) {
var resolved = resolveStructuredTypeMembers(type);
return kind === 0 ? resolved.callSignatures : resolved.constructSignatures;
}
@@ -28371,7 +28552,7 @@ var ts;
return getSignaturesOfStructuredType(getApparentType(type), kind);
}
function getIndexInfoOfStructuredType(type, kind) {
- if (type.flags & 458752) {
+ if (type.flags & 917504) {
var resolved = resolveStructuredTypeMembers(type);
return kind === 0 ? resolved.stringIndexInfo : resolved.numberIndexInfo;
}
@@ -28419,10 +28600,10 @@ var ts;
return result;
}
function isJSDocOptionalParameter(node) {
- return ts.isInJavaScriptFile(node) && (node.type && node.type.kind === 282
+ return ts.isInJavaScriptFile(node) && (node.type && node.type.kind === 283
|| ts.getJSDocParameterTags(node).some(function (_a) {
var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression;
- return isBracketed || !!typeExpression && typeExpression.type.kind === 282;
+ return isBracketed || !!typeExpression && typeExpression.type.kind === 283;
}));
}
function tryFindAmbientModule(moduleName, withAugmentations) {
@@ -28455,7 +28636,7 @@ var ts;
return false;
}
var isBracketed = node.isBracketed, typeExpression = node.typeExpression;
- return isBracketed || !!typeExpression && typeExpression.type.kind === 282;
+ return isBracketed || !!typeExpression && typeExpression.type.kind === 283;
}
function createTypePredicateFromTypePredicateNode(node) {
var parameterName = node.parameterName;
@@ -28515,7 +28696,7 @@ var ts;
var hasLiteralTypes = false;
var minArgumentCount = 0;
var thisParameter = void 0;
- var hasThisParameter = void 0;
+ var hasThisParameter = false;
var iife = ts.getImmediatelyInvokedFunctionExpression(declaration);
var isJSConstructSignature = ts.isJSDocConstructSignature(declaration);
var isUntypedSignatureInJSFile = !iife &&
@@ -28538,7 +28719,7 @@ var ts;
else {
parameters.push(paramSymbol);
}
- if (type && type.kind === 177) {
+ if (type && type.kind === 178) {
hasLiteralTypes = true;
}
var isOptionalParameter_1 = isOptionalJSDocParameterTag(param) ||
@@ -28550,16 +28731,16 @@ var ts;
minArgumentCount = parameters.length;
}
}
- if ((declaration.kind === 155 || declaration.kind === 156) &&
+ if ((declaration.kind === 156 || declaration.kind === 157) &&
!hasNonBindableDynamicName(declaration) &&
(!hasThisParameter || !thisParameter)) {
- var otherKind = declaration.kind === 155 ? 156 : 155;
+ var otherKind = declaration.kind === 156 ? 157 : 156;
var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind);
if (other) {
thisParameter = getAnnotatedAccessorThisParameter(other);
}
}
- var classType = declaration.kind === 154 ?
+ var classType = declaration.kind === 155 ?
getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol))
: undefined;
var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration);
@@ -28598,8 +28779,8 @@ var ts;
if (typeNode) {
return getTypeFromTypeNode(typeNode);
}
- if (declaration.kind === 155 && !hasNonBindableDynamicName(declaration)) {
- var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 156);
+ if (declaration.kind === 156 && !hasNonBindableDynamicName(declaration)) {
+ var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 157);
return getAnnotatedAccessorType(setter);
}
if (ts.nodeIsMissing(declaration.body)) {
@@ -28623,14 +28804,14 @@ var ts;
switch (node.kind) {
case 71:
return node.escapedText === "arguments" && ts.isExpressionNode(node);
- case 151:
- case 153:
- case 155:
+ case 152:
+ case 154:
case 156:
- return node.name.kind === 146
+ case 157:
+ return node.name.kind === 147
&& traverse(node.name);
default:
- return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && ts.forEachChild(node, traverse);
+ return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse);
}
}
}
@@ -28640,16 +28821,15 @@ var ts;
var result = [];
for (var i = 0; i < symbol.declarations.length; i++) {
var decl = symbol.declarations[i];
- var node = ts.isPropertyAccessExpression(decl) ? ts.getAssignedJavascriptInitializer(decl) : decl;
- if (!ts.isFunctionLike(node))
+ if (!ts.isFunctionLike(decl))
continue;
- if (i > 0 && node.body) {
+ if (i > 0 && decl.body) {
var previous = symbol.declarations[i - 1];
- if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) {
+ if (decl.parent === previous.parent && decl.kind === previous.kind && decl.pos === previous.end) {
continue;
}
}
- result.push(getSignatureFromDeclaration(node));
+ result.push(getSignatureFromDeclaration(decl));
}
return result;
}
@@ -28682,7 +28862,7 @@ var ts;
}
else {
var declaration = signature.declaration;
- signature.resolvedTypePredicate = declaration && declaration.type && declaration.type.kind === 160 ?
+ signature.resolvedTypePredicate = declaration && declaration.type && declaration.type.kind === 161 ?
createTypePredicateFromTypePredicateNode(declaration.type) :
noTypePredicate;
}
@@ -28693,7 +28873,7 @@ var ts;
function getReturnTypeOfSignature(signature) {
if (!signature.resolvedReturnType) {
if (!pushTypeResolution(signature, 3)) {
- return unknownType;
+ return errorType;
}
var type = void 0;
if (signature.target) {
@@ -28727,7 +28907,7 @@ var ts;
}
function getRestTypeOfSignature(signature) {
if (signature.hasRestParameter) {
- var type = getTypeOfSymbol(ts.lastOrUndefined(signature.parameters));
+ var type = getTypeOfSymbol(ts.last(signature.parameters));
if (ts.getObjectFlags(type) & 4 && type.target === globalArrayType) {
return type.typeArguments[0];
}
@@ -28777,7 +28957,7 @@ var ts;
}
function getOrCreateTypeFromSignature(signature) {
if (!signature.isolatedSignatureType) {
- var isConstructor = signature.declaration.kind === 154 || signature.declaration.kind === 158;
+ var isConstructor = signature.declaration.kind === 155 || signature.declaration.kind === 159;
var type = createObjectType(16);
type.members = emptySymbols;
type.properties = ts.emptyArray;
@@ -28818,7 +28998,7 @@ var ts;
return undefined;
}
function getConstraintDeclaration(type) {
- var decl = type.symbol && ts.getDeclarationOfKind(type.symbol, 147);
+ var decl = type.symbol && ts.getDeclarationOfKind(type.symbol, 148);
return decl && decl.constraint;
}
function getInferredTypeParameterConstraint(typeParameter) {
@@ -28826,7 +29006,7 @@ 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 === 171 && declaration.parent.parent.kind === 161) {
+ if (declaration.parent.kind === 172 && declaration.parent.parent.kind === 162) {
var typeReference = declaration.parent.parent;
var typeParameters = getTypeParametersForTypeReference(typeReference);
if (typeParameters) {
@@ -28862,7 +29042,7 @@ var ts;
return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint;
}
function getParentSymbolOfTypeParameter(typeParameter) {
- return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 147).parent);
+ return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 148).parent);
}
function getTypeListId(types) {
var result = "";
@@ -28895,7 +29075,7 @@ var ts;
result |= type.flags;
}
}
- return result & 117440512;
+ return result & 939524096;
}
function createTypeReference(target, typeArguments) {
var id = getTypeListId(typeArguments);
@@ -28929,7 +29109,7 @@ var ts;
var isJs = ts.isInJavaScriptFile(node);
var isJsImplicitAny = !noImplicitAny && isJs;
if (!isJsImplicitAny && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) {
- var missingAugmentsTag = isJs && node.parent.kind !== 289;
+ var missingAugmentsTag = isJs && node.parent.kind !== 290;
var diag = minTypeArgumentCount === typeParameters.length
? missingAugmentsTag
? ts.Diagnostics.Expected_0_type_arguments_provide_these_with_an_extends_tag
@@ -28940,13 +29120,13 @@ var ts;
var typeStr = typeToString(type, undefined, 2);
error(node, diag, typeStr, minTypeArgumentCount, typeParameters.length);
if (!isJs) {
- return unknownType;
+ return errorType;
}
}
var typeArguments = ts.concatenate(type.outerTypeParameters, fillMissingTypeArguments(typeArgs, typeParameters, minTypeArgumentCount, isJs));
return createTypeReference(type, typeArguments);
}
- return checkNoTypeArguments(node, symbol) ? type : unknownType;
+ return checkNoTypeArguments(node, symbol) ? type : errorType;
}
function getTypeAliasInstantiation(symbol, typeArguments) {
var type = getDeclaredTypeOfSymbol(symbol);
@@ -28969,17 +29149,17 @@ var ts;
error(node, minTypeArgumentCount === typeParameters.length
? ts.Diagnostics.Generic_type_0_requires_1_type_argument_s
: ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, symbolToString(symbol), minTypeArgumentCount, typeParameters.length);
- return unknownType;
+ return errorType;
}
return getTypeAliasInstantiation(symbol, typeArguments);
}
- return checkNoTypeArguments(node, symbol) ? type : unknownType;
+ return checkNoTypeArguments(node, symbol) ? type : errorType;
}
function getTypeReferenceName(node) {
switch (node.kind) {
- case 161:
+ case 162:
return node.typeName;
- case 206:
+ case 207:
var expr = node.expression;
if (ts.isEntityNameExpression(expr)) {
return expr;
@@ -28996,7 +29176,7 @@ var ts;
function getTypeReferenceType(node, symbol) {
var typeArguments = typeArgumentsFromTypeReferenceNode(node);
if (symbol === unknownSymbol) {
- return unknownType;
+ return errorType;
}
var type = getTypeReferenceTypeWorker(node, symbol, typeArguments);
if (type) {
@@ -29005,11 +29185,11 @@ var ts;
var res = tryGetDeclaredTypeOfSymbol(symbol);
if (res) {
return checkNoTypeArguments(node, symbol) ?
- res.flags & 32768 ? getConstrainedTypeVariable(res, node) : res :
- unknownType;
+ res.flags & 65536 ? getConstrainedTypeVariable(res, node) : res :
+ errorType;
}
if (!(symbol.flags & 67216319 && isJSDocTypeReference(node))) {
- return unknownType;
+ return errorType;
}
var jsdocType = getJSDocTypeReference(node, symbol, typeArguments);
if (jsdocType) {
@@ -29023,7 +29203,7 @@ var ts;
var valueType = getTypeOfSymbol(symbol);
var referenceType = valueType.symbol && valueType.symbol !== symbol && !isInferredClassType(valueType) && getTypeReferenceTypeWorker(node, valueType.symbol, typeArguments);
if (referenceType || assignedType) {
- return referenceType && assignedType ? getIntersectionType([assignedType, referenceType]) : referenceType || assignedType;
+ return (referenceType && assignedType ? getIntersectionType([assignedType, referenceType]) : referenceType || assignedType);
}
}
function getTypeReferenceTypeWorker(node, symbol, typeArguments) {
@@ -29046,13 +29226,13 @@ var ts;
}
}
function getSubstitutionType(typeVariable, substitute) {
- var result = createType(4194304);
+ var result = createType(8388608);
result.typeVariable = typeVariable;
result.substitute = substitute;
return result;
}
function isUnaryTupleTypeNode(node) {
- return node.kind === 167 && node.elementTypes.length === 1;
+ return node.kind === 168 && node.elementTypes.length === 1;
}
function getImpliedConstraint(typeVariable, checkNode, extendsNode) {
return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(typeVariable, checkNode.elementTypes[0], extendsNode.elementTypes[0]) :
@@ -29061,9 +29241,9 @@ var ts;
}
function getConstrainedTypeVariable(typeVariable, node) {
var constraints;
- while (node && !ts.isStatement(node) && node.kind !== 285) {
+ while (node && !ts.isStatement(node) && node.kind !== 286) {
var parent = node.parent;
- if (parent.kind === 170 && node === parent.trueType) {
+ if (parent.kind === 171 && node === parent.trueType) {
var constraint = getImpliedConstraint(typeVariable, parent.checkType, parent.extendsType);
if (constraint) {
constraints = ts.append(constraints, constraint);
@@ -29074,7 +29254,7 @@ var ts;
return constraints ? getSubstitutionType(typeVariable, getIntersectionType(ts.append(constraints, typeVariable))) : typeVariable;
}
function isJSDocTypeReference(node) {
- return node.flags & 2097152 && node.kind === 161;
+ return !!(node.flags & 2097152) && node.kind === 162;
}
function checkNoTypeArguments(node, symbol) {
if (node.typeArguments) {
@@ -29121,7 +29301,7 @@ var ts;
var indexed = getTypeFromTypeNode(typeArgs[0]);
var target = getTypeFromTypeNode(typeArgs[1]);
var index = createIndexInfo(target, false);
- return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType && index, indexed === numberType && index);
+ return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType ? index : undefined, indexed === numberType ? index : undefined);
}
return anyType;
}
@@ -29132,7 +29312,7 @@ var ts;
}
function getTypeFromJSDocNullableTypeNode(node) {
var type = getTypeFromTypeNode(node.type);
- return strictNullChecks ? getNullableType(type, 8192) : type;
+ return strictNullChecks ? getNullableType(type, 16384) : type;
}
function getTypeFromTypeReference(node) {
var links = getNodeLinks(node);
@@ -29169,9 +29349,9 @@ var ts;
for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) {
var declaration = declarations_3[_i];
switch (declaration.kind) {
- case 234:
case 235:
- case 237:
+ case 236:
+ case 238:
return declaration;
}
}
@@ -29180,7 +29360,7 @@ var ts;
return arity ? emptyGenericType : emptyObjectType;
}
var type = getDeclaredTypeOfSymbol(symbol);
- if (!(type.flags & 65536)) {
+ if (!(type.flags & 131072)) {
error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, ts.symbolName(symbol));
return arity ? emptyGenericType : emptyObjectType;
}
@@ -29285,7 +29465,7 @@ var ts;
var typeParameters = [];
var properties = [];
for (var i = 0; i < arity; i++) {
- var typeParameter = createType(32768);
+ var typeParameter = createType(65536);
typeParameters.push(typeParameter);
var property = createSymbol(4, "" + i);
property.type = typeParameter;
@@ -29302,7 +29482,7 @@ var ts;
type.instantiations.set(getTypeListId(type.typeParameters), type);
type.target = type;
type.typeArguments = type.typeParameters;
- type.thisType = createType(32768);
+ type.thisType = createType(65536);
type.thisType.isThisType = true;
type.thisType.constraint = type;
type.declaredProperties = properties;
@@ -29335,16 +29515,16 @@ var ts;
var combined = 0;
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
var t = _a[_i];
- if (t.flags & 13536 && combined & 13536) {
+ if (t.flags & 27072 && combined & 27072) {
return true;
}
combined |= t.flags;
- if (combined & 12288 && combined & (65536 | 134217728) ||
- combined & 134217728 && combined & (134233854 & ~134217728) ||
- combined & 34 && combined & (134233854 & ~34) ||
- combined & 84 && combined & (134233854 & ~84) ||
- combined & 1536 && combined & (134233854 & ~1536) ||
- combined & 6144 && combined & (134233854 & ~6144)) {
+ if (combined & 24576 && combined & (131072 | 16777216) ||
+ combined & 16777216 && combined & (16809468 & ~16777216) ||
+ combined & 68 && combined & (16809468 & ~68) ||
+ combined & 168 && combined & (16809468 & ~168) ||
+ combined & 3072 && combined & (16809468 & ~3072) ||
+ combined & 12288 && combined & (16809468 & ~12288)) {
return true;
}
}
@@ -29352,24 +29532,24 @@ var ts;
}
function addTypeToUnion(typeSet, includes, type) {
var flags = type.flags;
- if (flags & 131072) {
+ if (flags & 262144) {
return addTypesToUnion(typeSet, includes, type.types);
}
- if (!(flags & 16384 || flags & 262144 && isEmptyIntersectionType(type))) {
- includes |= flags & ~117440512;
- if (flags & 1) {
+ if (!(flags & 32768 || flags & 524288 && isEmptyIntersectionType(type))) {
+ includes |= flags & ~939524096;
+ if (flags & 3) {
if (type === wildcardType)
- includes |= 33554432;
+ includes |= 268435456;
}
- else if (!strictNullChecks && flags & 12288) {
- if (!(flags & 16777216))
- includes |= 16777216;
+ else if (!strictNullChecks && flags & 24576) {
+ if (!(flags & 134217728))
+ includes |= 134217728;
}
else {
var len = typeSet.length;
var index = len && type.id > typeSet[len - 1].id ? ~len : ts.binarySearch(typeSet, type, getTypeId, ts.compareValues);
if (index < 0) {
- if (!(flags & 65536 && type.objectFlags & 16 &&
+ if (!(flags & 131072 && type.objectFlags & 16 &&
type.symbol && type.symbol.flags & (16 | 8192) && containsIdenticalType(typeSet, type))) {
typeSet.splice(~index, 0, type);
}
@@ -29407,11 +29587,11 @@ var ts;
}
function isSetOfLiteralsFromSameEnum(types) {
var first = types[0];
- if (first.flags & 256) {
+ if (first.flags & 512) {
var firstEnum = getParentOfSymbol(first.symbol);
for (var i = 1; i < types.length; i++) {
var other = types[i];
- if (!(other.flags & 256) || (firstEnum !== getParentOfSymbol(other.symbol))) {
+ if (!(other.flags & 512) || (firstEnum !== getParentOfSymbol(other.symbol))) {
return false;
}
}
@@ -29436,10 +29616,10 @@ var ts;
while (i > 0) {
i--;
var t = types[i];
- var remove = t.flags & 32 && includes & 2 ||
- t.flags & 64 && includes & 4 ||
- t.flags & 1024 && includes & 512 ||
- t.flags & 96 && t.flags & 8388608 && containsType(types, t.regularType);
+ var remove = t.flags & 64 && includes & 4 ||
+ t.flags & 128 && includes & 8 ||
+ t.flags & 2048 && includes & 1024 ||
+ t.flags & 192 && t.flags & 33554432 && containsType(types, t.regularType);
if (remove) {
ts.orderedRemoveItemAt(types, i);
}
@@ -29455,12 +29635,12 @@ var ts;
}
var typeSet = [];
var includes = addTypesToUnion(typeSet, 0, types);
- if (includes & 1) {
- return includes & 33554432 ? wildcardType : anyType;
+ if (includes & 3) {
+ return includes & 1 ? includes & 268435456 ? wildcardType : anyType : unknownType;
}
switch (unionReduction) {
case 1:
- if (includes & 1120) {
+ if (includes & 2240) {
removeRedundantLiteralTypes(typeSet, includes);
}
break;
@@ -29469,11 +29649,11 @@ var ts;
break;
}
if (typeSet.length === 0) {
- return includes & 8192 ? includes & 16777216 ? nullType : nullWideningType :
- includes & 4096 ? includes & 16777216 ? undefinedType : undefinedWideningType :
+ return includes & 16384 ? includes & 134217728 ? nullType : nullWideningType :
+ includes & 8192 ? includes & 134217728 ? undefinedType : undefinedWideningType :
neverType;
}
- return getUnionTypeFromSortedList(typeSet, includes & 8374815 ? 0 : 268435456, aliasSymbol, aliasTypeArguments);
+ return getUnionTypeFromSortedList(typeSet, includes & 16749629 ? 0 : 67108864, aliasSymbol, aliasTypeArguments);
}
function getUnionTypePredicate(signatures) {
var first;
@@ -29517,8 +29697,8 @@ var ts;
var id = getTypeListId(types);
var type = unionTypes.get(id);
if (!type) {
- var propagatedFlags = getPropagatingFlagsOfTypes(types, 12288);
- type = createType(131072 | propagatedFlags | unionOfUnitTypes);
+ var propagatedFlags = getPropagatingFlagsOfTypes(types, 24576);
+ type = createType(262144 | propagatedFlags | unionOfUnitTypes);
unionTypes.set(id, type);
type.types = types;
type.aliasSymbol = aliasSymbol;
@@ -29536,20 +29716,20 @@ var ts;
}
function addTypeToIntersection(typeSet, includes, type) {
var flags = type.flags;
- if (flags & 262144) {
+ if (flags & 524288) {
return addTypesToIntersection(typeSet, includes, type.types);
}
if (ts.getObjectFlags(type) & 16 && isEmptyObjectType(type)) {
- includes |= 67108864;
+ includes |= 536870912;
}
else {
- includes |= flags & ~117440512;
- if (flags & 1) {
+ includes |= flags & ~939524096;
+ if (flags & 3) {
if (type === wildcardType)
- includes |= 33554432;
+ includes |= 268435456;
}
- else if ((strictNullChecks || !(flags & 12288)) && !ts.contains(typeSet, type) &&
- !(flags & 65536 && type.objectFlags & 16 &&
+ else if ((strictNullChecks || !(flags & 24576)) && !ts.contains(typeSet, type) &&
+ !(flags & 131072 && type.objectFlags & 16 &&
type.symbol && type.symbol.flags & (16 | 8192) &&
containsIdenticalType(typeSet, type))) {
typeSet.push(type);
@@ -29569,22 +29749,22 @@ var ts;
while (i > 0) {
i--;
var t = types[i];
- var remove = t.flags & 2 && includes & 32 ||
- t.flags & 4 && includes & 64 ||
- t.flags & 512 && includes & 1024;
+ var remove = t.flags & 4 && includes & 64 ||
+ t.flags & 8 && includes & 128 ||
+ t.flags & 1024 && includes & 2048;
if (remove) {
ts.orderedRemoveItemAt(types, i);
}
}
}
function intersectUnionsOfUnitTypes(types) {
- var unionIndex = ts.findIndex(types, function (t) { return (t.flags & 268435456) !== 0; });
+ var unionIndex = ts.findIndex(types, function (t) { return (t.flags & 67108864) !== 0; });
var unionType = types[unionIndex];
var intersection = unionType.types;
var i = types.length - 1;
var _loop_5 = function () {
var t = types[i];
- if (t.flags & 268435456) {
+ if (t.flags & 67108864) {
intersection = ts.filter(intersection, function (u) { return containsType(t.types, u); });
ts.orderedRemoveItemAt(types, i);
}
@@ -29596,45 +29776,48 @@ var ts;
if (intersection === unionType.types) {
return false;
}
- types[unionIndex] = getUnionTypeFromSortedList(intersection, unionType.flags & 268435456);
+ types[unionIndex] = getUnionTypeFromSortedList(intersection, unionType.flags & 67108864);
return true;
}
function getIntersectionType(types, aliasSymbol, aliasTypeArguments) {
- if (types.length === 0) {
- return emptyObjectType;
- }
var typeSet = [];
var includes = addTypesToIntersection(typeSet, 0, types);
- if (includes & 16384) {
+ if (includes & 32768) {
return neverType;
}
if (includes & 1) {
- return includes & 33554432 ? wildcardType : anyType;
+ return includes & 268435456 ? wildcardType : anyType;
}
- if (includes & 2 && includes & 32 ||
- includes & 4 && includes & 64 ||
- includes & 512 && includes & 1024) {
+ if (!strictNullChecks && includes & 24576) {
+ return includes & 8192 ? undefinedType : nullType;
+ }
+ if (includes & 4 && includes & 64 ||
+ includes & 8 && includes & 128 ||
+ includes & 1024 && includes & 2048) {
removeRedundantPrimitiveTypes(typeSet, includes);
}
- if (includes & 67108864 && !(includes & 65536)) {
+ if (includes & 536870912 && !(includes & 131072)) {
typeSet.push(emptyObjectType);
}
+ if (typeSet.length === 0) {
+ return unknownType;
+ }
if (typeSet.length === 1) {
return typeSet[0];
}
- if (includes & 131072) {
- if (includes & 268435456 && intersectUnionsOfUnitTypes(typeSet)) {
+ if (includes & 262144) {
+ if (includes & 67108864 && intersectUnionsOfUnitTypes(typeSet)) {
return getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
}
- var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 131072) !== 0; });
+ var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 262144) !== 0; });
var unionType = typeSet[unionIndex_1];
return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex_1, t)); }), 1, aliasSymbol, aliasTypeArguments);
}
var id = getTypeListId(typeSet);
var type = intersectionTypes.get(id);
if (!type) {
- var propagatedFlags = getPropagatingFlagsOfTypes(typeSet, 12288);
- type = createType(262144 | propagatedFlags);
+ var propagatedFlags = getPropagatingFlagsOfTypes(typeSet, 24576);
+ type = createType(524288 | propagatedFlags);
intersectionTypes.set(id, type);
type.types = typeSet;
type.aliasSymbol = aliasSymbol;
@@ -29651,7 +29834,7 @@ var ts;
return links.resolvedType;
}
function createIndexType(type, stringsOnly) {
- var result = createType(524288);
+ var result = createType(1048576);
result.type = type;
result.stringsOnly = stringsOnly;
return result;
@@ -29667,7 +29850,7 @@ var ts;
if (!type && !ts.isKnownSymbol(prop)) {
var name = ts.getNameOfDeclaration(prop.valueDeclaration);
type = name && ts.isNumericLiteral(name) ? getLiteralType(+name.text) :
- name && name.kind === 146 && ts.isNumericLiteral(name.expression) ? getLiteralType(+name.expression.text) :
+ name && name.kind === 147 && ts.isNumericLiteral(name.expression) ? getLiteralType(+name.expression.text) :
getLiteralType(ts.symbolName(prop));
}
if (type && type.flags & include) {
@@ -29685,16 +29868,16 @@ var ts;
}
function getIndexType(type, stringsOnly) {
if (stringsOnly === void 0) { stringsOnly = keyofStringsOnly; }
- return type.flags & 131072 ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly); })) :
- type.flags & 262144 ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly); })) :
- maybeTypeOfKind(type, 7372800) ? getIndexTypeForGenericType(type, stringsOnly) :
+ return type.flags & 262144 ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly); })) :
+ type.flags & 524288 ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly); })) :
+ maybeTypeOfKind(type, 14745600) ? getIndexTypeForGenericType(type, stringsOnly) :
ts.getObjectFlags(type) & 32 ? getConstraintTypeFromMappedType(type) :
type === wildcardType ? wildcardType :
type.flags & 1 ? keyofConstraintType :
- stringsOnly ? getIndexInfoOfType(type, 0) ? stringType : getLiteralTypeFromPropertyNames(type, 32) :
- getIndexInfoOfType(type, 0) ? getUnionType([stringType, numberType, getLiteralTypeFromPropertyNames(type, 1024)]) :
- getNonEnumNumberIndexInfo(type) ? getUnionType([numberType, getLiteralTypeFromPropertyNames(type, 32 | 1024)]) :
- getLiteralTypeFromPropertyNames(type, 1120);
+ stringsOnly ? getIndexInfoOfType(type, 0) ? stringType : getLiteralTypeFromPropertyNames(type, 64) :
+ getIndexInfoOfType(type, 0) ? getUnionType([stringType, numberType, getLiteralTypeFromPropertyNames(type, 2048)]) :
+ getNonEnumNumberIndexInfo(type) ? getUnionType([numberType, getLiteralTypeFromPropertyNames(type, 64 | 2048)]) :
+ getLiteralTypeFromPropertyNames(type, 2240);
}
function getExtractStringType(type) {
if (keyofStringsOnly) {
@@ -29705,7 +29888,7 @@ var ts;
}
function getIndexTypeOrString(type) {
var indexType = getExtractStringType(getIndexType(type));
- return indexType.flags & 16384 ? stringType : indexType;
+ return indexType.flags & 32768 ? stringType : indexType;
}
function getTypeFromTypeOperatorNode(node) {
var links = getNodeLinks(node);
@@ -29717,20 +29900,20 @@ var ts;
case 141:
links.resolvedType = node.type.kind === 138
? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent))
- : unknownType;
+ : errorType;
break;
}
}
return links.resolvedType;
}
function createIndexedAccessType(objectType, indexType) {
- var type = createType(1048576);
+ var type = createType(2097152);
type.objectType = objectType;
type.indexType = indexType;
return type;
}
function getPropertyTypeForIndexType(objectType, indexType, accessNode, cacheSymbol) {
- var accessExpression = accessNode && accessNode.kind === 185 ? accessNode : undefined;
+ var accessExpression = accessNode && accessNode.kind === 186 ? accessNode : undefined;
var propName = isTypeUsableAsLateBoundName(indexType) ? getLateBoundNameFromType(indexType) :
accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, false) ?
ts.getPropertyNameForKnownSymbolName(ts.idText(accessExpression.argumentExpression.name)) :
@@ -29742,7 +29925,7 @@ var ts;
markPropertyAsReferenced(prop, accessExpression, accessExpression.expression.kind === 99);
if (ts.isAssignmentTarget(accessExpression) && (isReferenceToReadonlyEntity(accessExpression, prop) || isReferenceThroughNamespaceImport(accessExpression))) {
error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(prop));
- return unknownType;
+ return errorType;
}
if (cacheSymbol) {
getNodeLinks(accessNode).resolvedSymbol = prop;
@@ -29751,16 +29934,16 @@ var ts;
return getTypeOfSymbol(prop);
}
}
- if (!(indexType.flags & 12288) && isTypeAssignableToKind(indexType, 34 | 84 | 1536)) {
+ if (!(indexType.flags & 24576) && isTypeAssignableToKind(indexType, 68 | 168 | 3072)) {
if (isTypeAny(objectType)) {
return objectType;
}
- var indexInfo = isTypeAssignableToKind(indexType, 84) && getIndexInfoOfType(objectType, 1) ||
+ var indexInfo = isTypeAssignableToKind(indexType, 168) && getIndexInfoOfType(objectType, 1) ||
getIndexInfoOfType(objectType, 0) ||
undefined;
if (indexInfo) {
- if (accessNode && !isTypeAssignableToKind(indexType, 2 | 4)) {
- var indexNode = accessNode.kind === 185 ? accessNode.argumentExpression : accessNode.indexType;
+ if (accessNode && !isTypeAssignableToKind(indexType, 4 | 8)) {
+ var indexNode = accessNode.kind === 186 ? accessNode.argumentExpression : accessNode.indexType;
error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType));
}
else if (accessExpression && indexInfo.isReadonly && (ts.isAssignmentTarget(accessExpression) || ts.isDeleteTarget(accessExpression))) {
@@ -29768,7 +29951,7 @@ var ts;
}
return indexInfo.type;
}
- if (indexType.flags & 16384) {
+ if (indexType.flags & 32768) {
return neverType;
}
if (accessExpression && !isConstEnumObjectType(objectType)) {
@@ -29784,47 +29967,47 @@ var ts;
}
}
if (accessNode) {
- var indexNode = accessNode.kind === 185 ? accessNode.argumentExpression : accessNode.indexType;
- if (indexType.flags & (32 | 64)) {
+ var indexNode = accessNode.kind === 186 ? accessNode.argumentExpression : accessNode.indexType;
+ if (indexType.flags & (64 | 128)) {
error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, "" + indexType.value, typeToString(objectType));
}
- else if (indexType.flags & (2 | 4)) {
+ else if (indexType.flags & (4 | 8)) {
error(indexNode, ts.Diagnostics.Type_0_has_no_matching_index_signature_for_type_1, typeToString(objectType), typeToString(indexType));
}
else {
error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType));
}
}
- return unknownType;
+ return errorType;
}
function isGenericObjectType(type) {
- return maybeTypeOfKind(type, 7372800 | 536870912);
+ return maybeTypeOfKind(type, 14745600 | 134217728);
}
function isGenericIndexType(type) {
- return maybeTypeOfKind(type, 7372800 | 524288);
+ return maybeTypeOfKind(type, 14745600 | 1048576);
}
function isStringIndexOnlyType(type) {
- if (type.flags & 65536 && !isGenericMappedType(type)) {
+ if (type.flags & 131072 && !isGenericMappedType(type)) {
var t = resolveStructuredTypeMembers(type);
return t.properties.length === 0 &&
t.callSignatures.length === 0 && t.constructSignatures.length === 0 &&
- t.stringIndexInfo && !t.numberIndexInfo;
+ !!t.stringIndexInfo && !t.numberIndexInfo;
}
return false;
}
function isMappedTypeToNever(type) {
- return ts.getObjectFlags(type) & 32 && getTemplateTypeFromMappedType(type) === neverType;
+ return !!(ts.getObjectFlags(type) & 32) && getTemplateTypeFromMappedType(type) === neverType;
}
function getSimplifiedType(type) {
- return type.flags & 1048576 ? getSimplifiedIndexedAccessType(type) : type;
+ return type.flags & 2097152 ? getSimplifiedIndexedAccessType(type) : type;
}
function getSimplifiedIndexedAccessType(type) {
if (type.simplified) {
return type.simplified === circularConstraintType ? type : type.simplified;
}
type.simplified = circularConstraintType;
- var objectType = type.objectType;
- if (objectType.flags & 262144 && isGenericObjectType(objectType)) {
+ var objectType = getSimplifiedType(type.objectType);
+ if (objectType.flags & 524288 && isGenericObjectType(objectType)) {
if (ts.some(objectType.types, isStringIndexOnlyType)) {
var regularTypes = [];
var stringIndexTypes = [];
@@ -29850,7 +30033,7 @@ var ts;
if (isGenericMappedType(objectType)) {
return type.simplified = substituteIndexedMappedType(objectType, type);
}
- if (objectType.flags & 32768) {
+ if (objectType.flags & 65536) {
var constraint = getConstraintFromTypeParameter(objectType);
if (constraint && isGenericMappedType(constraint)) {
return type.simplified = substituteIndexedMappedType(constraint, type);
@@ -29867,8 +30050,8 @@ var ts;
if (objectType === wildcardType || indexType === wildcardType) {
return wildcardType;
}
- if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 185) && isGenericObjectType(objectType)) {
- if (objectType.flags & 1) {
+ if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 186) && isGenericObjectType(objectType)) {
+ if (objectType.flags & 3) {
return objectType;
}
var id = objectType.id + "," + indexType.id;
@@ -29879,13 +30062,13 @@ var ts;
return type;
}
var apparentObjectType = getApparentType(objectType);
- if (indexType.flags & 131072 && !(indexType.flags & 8)) {
+ if (indexType.flags & 262144 && !(indexType.flags & 16)) {
var propTypes = [];
for (var _i = 0, _a = indexType.types; _i < _a.length; _i++) {
var t = _a[_i];
var propType = getPropertyTypeForIndexType(apparentObjectType, t, accessNode, false);
- if (propType === unknownType) {
- return unknownType;
+ if (propType === errorType) {
+ return errorType;
}
propTypes.push(propType);
}
@@ -29899,7 +30082,7 @@ var ts;
var objectType = getTypeFromTypeNode(node.objectType);
var indexType = getTypeFromTypeNode(node.indexType);
var resolved = getIndexedAccessType(objectType, indexType, node);
- links.resolvedType = resolved.flags & 1048576 &&
+ links.resolvedType = resolved.flags & 2097152 &&
resolved.objectType === objectType &&
resolved.indexType === indexType ?
getConstrainedTypeVariable(resolved, node) : resolved;
@@ -29919,7 +30102,7 @@ var ts;
return links.resolvedType;
}
function getActualTypeVariable(type) {
- return type.flags & 4194304 ? type.typeVariable : type;
+ return type.flags & 8388608 ? type.typeVariable : type;
}
function getConditionalType(root, mapper) {
var checkType = instantiateType(root.checkType, mapper);
@@ -29927,7 +30110,7 @@ var ts;
if (checkType === wildcardType || extendsType === wildcardType) {
return wildcardType;
}
- var isDeferred = root.isDistributive && maybeTypeOfKind(checkType, 7897088);
+ var isDeferred = root.isDistributive && maybeTypeOfKind(checkType, 15794176);
var combinedMapper;
if (root.inferTypeParameters) {
var context = createInferenceContext(root.inferTypeParameters, undefined, 0);
@@ -29937,6 +30120,9 @@ var ts;
combinedMapper = combineTypeMappers(mapper, context);
}
if (!isDeferred) {
+ if (extendsType.flags & 3) {
+ return instantiateType(root.trueType, mapper);
+ }
if (checkType.flags & 1) {
return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), instantiateType(root.falseType, mapper)]);
}
@@ -29949,7 +30135,7 @@ var ts;
}
}
var erasedCheckType = getActualTypeVariable(checkType);
- var result = createType(2097152);
+ var result = createType(4194304);
result.root = root;
result.checkType = erasedCheckType;
result.extendsType = extendsType;
@@ -29981,7 +30167,7 @@ var ts;
return true;
}
while (node) {
- if (node.kind === 170) {
+ if (node.kind === 171) {
if (isTypeParameterPossiblyReferenced(tp, node.extendsType)) {
return true;
}
@@ -30004,7 +30190,7 @@ var ts;
extendsType: getTypeFromTypeNode(node.extendsType),
trueType: getTypeFromTypeNode(node.trueType),
falseType: getTypeFromTypeNode(node.falseType),
- isDistributive: !!(checkType.flags & 32768),
+ isDistributive: !!(checkType.flags & 65536),
inferTypeParameters: getInferTypeParameters(node),
outerTypeParameters: outerTypeParameters,
instantiations: undefined,
@@ -30040,12 +30226,12 @@ var ts;
if (node.isTypeOf && node.typeArguments) {
error(node, ts.Diagnostics.Type_arguments_cannot_be_used_here);
links.resolvedSymbol = unknownSymbol;
- return links.resolvedType = unknownType;
+ return links.resolvedType = errorType;
}
if (!ts.isLiteralImportTypeNode(node)) {
error(node.argument, ts.Diagnostics.String_literal_expected);
links.resolvedSymbol = unknownSymbol;
- return links.resolvedType = unknownType;
+ return links.resolvedType = errorType;
}
var argumentType = getTypeFromTypeNode(node.argument);
var targetMeaning = node.isTypeOf ? 67216319 : 67901928;
@@ -30053,7 +30239,7 @@ var ts;
var innerModuleSymbol = resolveExternalModule(node, moduleName, ts.Diagnostics.Cannot_find_module_0, node, false);
if (!innerModuleSymbol) {
links.resolvedSymbol = unknownSymbol;
- return links.resolvedType = unknownType;
+ return links.resolvedType = errorType;
}
var moduleSymbol_1 = resolveExternalModuleSymbol(innerModuleSymbol, false);
if (!ts.nodeIsMissing(node.qualifier)) {
@@ -30065,7 +30251,7 @@ var ts;
var next = getSymbol(getExportsOfSymbol(getMergedSymbol(resolveSymbol(currentNamespace))), current.escapedText, meaning);
if (!next) {
error(current, ts.Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(currentNamespace), ts.declarationNameToString(current));
- return links.resolvedType = unknownType;
+ return links.resolvedType = errorType;
}
getNodeLinks(current).resolvedSymbol = next;
getNodeLinks(current.parent).resolvedSymbol = next;
@@ -30080,7 +30266,7 @@ var ts;
else {
error(node, targetMeaning === 67216319 ? ts.Diagnostics.Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here : ts.Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here, moduleName);
links.resolvedSymbol = unknownSymbol;
- links.resolvedType = unknownType;
+ links.resolvedType = errorType;
}
}
}
@@ -30124,19 +30310,22 @@ var ts;
if (left.flags & 1 || right.flags & 1) {
return anyType;
}
- if (left.flags & 16384) {
+ if (left.flags & 2 || right.flags & 2) {
+ return unknownType;
+ }
+ if (left.flags & 32768) {
return right;
}
- if (right.flags & 16384) {
+ if (right.flags & 32768) {
return left;
}
- if (left.flags & 131072) {
+ if (left.flags & 262144) {
return mapType(left, function (t) { return getSpreadType(t, right, symbol, typeFlags, objectFlags); });
}
- if (right.flags & 131072) {
+ if (right.flags & 262144) {
return mapType(right, function (t) { return getSpreadType(left, t, symbol, typeFlags, objectFlags); });
}
- if (right.flags & (136 | 84 | 34 | 272 | 134217728 | 524288)) {
+ if (right.flags & (272 | 168 | 68 | 544 | 16777216 | 1048576)) {
return left;
}
var members = ts.createSymbolTable();
@@ -30188,7 +30377,7 @@ var ts;
}
}
var spread = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getNonReadonlyIndexSignature(stringIndexInfo), getNonReadonlyIndexSignature(numberIndexInfo));
- spread.flags |= typeFlags | 33554432;
+ spread.flags |= typeFlags | 268435456;
spread.objectFlags |= objectFlags | (128 | 1024);
return spread;
}
@@ -30220,9 +30409,9 @@ var ts;
return type;
}
function getFreshTypeOfLiteralType(type) {
- if (type.flags & 96 && !(type.flags & 8388608)) {
+ if (type.flags & 192 && !(type.flags & 33554432)) {
if (!type.freshType) {
- var freshType = createLiteralType(type.flags | 8388608, type.value, type.symbol);
+ var freshType = createLiteralType(type.flags | 33554432, type.value, type.symbol);
freshType.regularType = type;
type.freshType = freshType;
}
@@ -30231,14 +30420,16 @@ var ts;
return type;
}
function getRegularTypeOfLiteralType(type) {
- return type.flags & 96 && type.flags & 8388608 ? type.regularType : type;
+ return type.flags & 192 && type.flags & 33554432 ? type.regularType :
+ type.flags & 262144 ? getUnionType(ts.sameMap(type.types, getRegularTypeOfLiteralType)) :
+ type;
}
function getLiteralType(value, enumId, symbol) {
var qualifier = typeof value === "number" ? "#" : "@";
var key = enumId ? enumId + qualifier + value : qualifier + value;
var type = literalTypes.get(key);
if (!type) {
- var flags = (typeof value === "number" ? 64 : 32) | (enumId ? 256 : 0);
+ var flags = (typeof value === "number" ? 128 : 64) | (enumId ? 512 : 0);
literalTypes.set(key, type = createLiteralType(flags, value, symbol));
}
return type;
@@ -30251,7 +30442,7 @@ var ts;
return links.resolvedType;
}
function createUniqueESSymbolType(symbol) {
- var type = createType(1024);
+ var type = createType(2048);
type.symbol = symbol;
return type;
}
@@ -30266,14 +30457,14 @@ var ts;
function getThisType(node) {
var container = ts.getThisContainer(node, false);
var parent = container && container.parent;
- if (parent && (ts.isClassLike(parent) || parent.kind === 235)) {
+ if (parent && (ts.isClassLike(parent) || parent.kind === 236)) {
if (!ts.hasModifier(container, 32) &&
- (container.kind !== 154 || ts.isNodeDescendantOf(node, container.body))) {
+ (container.kind !== 155 || ts.isNodeDescendantOf(node, container.body))) {
return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType;
}
}
error(node, ts.Diagnostics.A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface);
- return unknownType;
+ return errorType;
}
function getTypeFromThisTypeNode(node) {
var links = getNodeLinks(node);
@@ -30285,9 +30476,11 @@ var ts;
function getTypeFromTypeNode(node) {
switch (node.kind) {
case 119:
- case 278:
case 279:
+ case 280:
return anyType;
+ case 142:
+ return unknownType;
case 137:
return stringType;
case 134:
@@ -30306,62 +30499,62 @@ var ts;
return neverType;
case 135:
return node.flags & 65536 ? anyType : nonPrimitiveType;
- case 173:
+ case 174:
case 99:
return getTypeFromThisTypeNode(node);
- case 177:
- return getTypeFromLiteralTypeNode(node);
- case 161:
- return getTypeFromTypeReference(node);
- case 160:
- return booleanType;
- case 206:
- return getTypeFromTypeReference(node);
- case 164:
- return getTypeFromTypeQueryNode(node);
- case 166:
- return getTypeFromArrayTypeNode(node);
- case 167:
- return getTypeFromTupleTypeNode(node);
- case 168:
- return getTypeFromUnionTypeNode(node);
- case 169:
- return getTypeFromIntersectionTypeNode(node);
- case 280:
- return getTypeFromJSDocNullableTypeNode(node);
- case 282:
- return addOptionality(getTypeFromTypeNode(node.type));
- case 172:
- case 281:
- case 277:
- return getTypeFromTypeNode(node.type);
- case 284:
- return getTypeFromJSDocVariadicType(node);
- case 162:
- case 163:
- case 165:
- case 286:
- case 283:
- case 287:
- return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
- case 174:
- return getTypeFromTypeOperatorNode(node);
- case 175:
- return getTypeFromIndexedAccessTypeNode(node);
- case 176:
- return getTypeFromMappedTypeNode(node);
- case 170:
- return getTypeFromConditionalTypeNode(node);
- case 171:
- return getTypeFromInferTypeNode(node);
case 178:
+ return getTypeFromLiteralTypeNode(node);
+ case 162:
+ return getTypeFromTypeReference(node);
+ case 161:
+ return booleanType;
+ case 207:
+ return getTypeFromTypeReference(node);
+ case 165:
+ return getTypeFromTypeQueryNode(node);
+ case 167:
+ return getTypeFromArrayTypeNode(node);
+ case 168:
+ return getTypeFromTupleTypeNode(node);
+ case 169:
+ return getTypeFromUnionTypeNode(node);
+ case 170:
+ return getTypeFromIntersectionTypeNode(node);
+ case 281:
+ return getTypeFromJSDocNullableTypeNode(node);
+ case 283:
+ return addOptionality(getTypeFromTypeNode(node.type));
+ case 173:
+ case 282:
+ case 278:
+ return getTypeFromTypeNode(node.type);
+ case 285:
+ return getTypeFromJSDocVariadicType(node);
+ case 163:
+ case 164:
+ case 166:
+ case 287:
+ case 284:
+ case 288:
+ return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
+ case 175:
+ return getTypeFromTypeOperatorNode(node);
+ case 176:
+ return getTypeFromIndexedAccessTypeNode(node);
+ case 177:
+ return getTypeFromMappedTypeNode(node);
+ case 171:
+ return getTypeFromConditionalTypeNode(node);
+ case 172:
+ return getTypeFromInferTypeNode(node);
+ case 179:
return getTypeFromImportTypeNode(node);
case 71:
- case 145:
+ case 146:
var symbol = getSymbolAtLocation(node);
- return symbol && getDeclaredTypeOfSymbol(symbol);
+ return (symbol && getDeclaredTypeOfSymbol(symbol));
default:
- return unknownType;
+ return errorType;
}
}
function instantiateList(items, mapper, instantiator) {
@@ -30434,10 +30627,10 @@ var ts;
return function (t) { return t === source ? target : baseMapper(t); };
}
function wildcardMapper(type) {
- return type.flags & 32768 ? wildcardType : type;
+ return type.flags & 65536 ? wildcardType : type;
}
function cloneTypeParameter(typeParameter) {
- var result = createType(32768);
+ var result = createType(65536);
result.symbol = typeParameter.symbol;
result.target = typeParameter;
return result;
@@ -30475,7 +30668,7 @@ var ts;
}
function instantiateSymbol(symbol, mapper) {
var links = getSymbolLinks(symbol);
- if (links.type && !maybeTypeOfKind(links.type, 65536 | 7897088)) {
+ if (links.type && !maybeTypeOfKind(links.type, 131072 | 15794176)) {
return symbol;
}
if (ts.getCheckFlags(symbol) & 1) {
@@ -30546,35 +30739,35 @@ var ts;
return type;
}
function maybeTypeParameterReference(node) {
- return !(node.kind === 145 ||
- node.parent.kind === 161 && node.parent.typeArguments && node === node.parent.typeName);
+ return !(node.kind === 146 ||
+ node.parent.kind === 162 && node.parent.typeArguments && node === node.parent.typeName);
}
function isTypeParameterPossiblyReferenced(tp, node) {
if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) {
var container_3 = tp.symbol.declarations[0].parent;
- if (ts.findAncestor(node, function (n) { return n.kind === 212 ? "quit" : n === container_3; })) {
- return ts.forEachChild(node, containsReference);
+ if (ts.findAncestor(node, function (n) { return n.kind === 213 ? "quit" : n === container_3; })) {
+ return !!ts.forEachChild(node, containsReference);
}
}
return true;
function containsReference(node) {
switch (node.kind) {
- case 173:
- return tp.isThisType;
+ case 174:
+ return !!tp.isThisType;
case 71:
return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) &&
getTypeFromTypeNode(node) === tp;
- case 164:
+ case 165:
return true;
}
- return ts.forEachChild(node, containsReference);
+ return !!ts.forEachChild(node, containsReference);
}
}
function instantiateMappedType(type, mapper) {
var constraintType = getConstraintTypeFromMappedType(type);
- if (constraintType.flags & 524288) {
+ if (constraintType.flags & 1048576) {
var typeVariable_1 = constraintType.type;
- if (typeVariable_1.flags & 32768) {
+ if (typeVariable_1.flags & 65536) {
var mappedTypeVariable = instantiateType(typeVariable_1, mapper);
if (typeVariable_1 !== mappedTypeVariable) {
return mapType(mappedTypeVariable, function (t) {
@@ -30589,7 +30782,7 @@ var ts;
return instantiateAnonymousType(type, mapper);
}
function isMappableType(type) {
- return type.flags & (1 | 7372800 | 65536 | 262144);
+ return type.flags & (3 | 14745600 | 131072 | 524288);
}
function instantiateAnonymousType(type, mapper) {
var result = createObjectType(type.objectFlags | 64, type.symbol);
@@ -30621,7 +30814,7 @@ var ts;
if (root.isDistributive) {
var checkType_1 = root.checkType;
var instantiatedType = mapper(checkType_1);
- if (checkType_1 !== instantiatedType && instantiatedType.flags & (131072 | 16384)) {
+ if (checkType_1 !== instantiatedType && instantiatedType.flags & (262144 | 32768)) {
return mapType(instantiatedType, function (t) { return getConditionalType(root, createReplacementMapper(checkType_1, t, mapper)); });
}
}
@@ -30629,10 +30822,10 @@ var ts;
}
function instantiateType(type, mapper) {
if (type && mapper && mapper !== identityMapper) {
- if (type.flags & 32768) {
+ if (type.flags & 65536) {
return mapper(type);
}
- if (type.flags & 65536) {
+ if (type.flags & 131072) {
if (type.objectFlags & 16) {
return type.symbol && type.symbol.flags & (16 | 8192 | 32 | 2048 | 4096) && type.symbol.declarations ?
getAnonymousTypeInstantiation(type, mapper) : type;
@@ -30646,65 +30839,69 @@ var ts;
return newTypeArguments !== typeArguments ? createTypeReference(type.target, newTypeArguments) : type;
}
}
- if (type.flags & 131072 && !(type.flags & 16382)) {
+ if (type.flags & 262144 && !(type.flags & 32764)) {
var types = type.types;
var newTypes = instantiateTypes(types, mapper);
return newTypes !== types ? getUnionType(newTypes, 1, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type;
}
- if (type.flags & 262144) {
+ if (type.flags & 524288) {
var types = type.types;
var newTypes = instantiateTypes(types, mapper);
return newTypes !== types ? getIntersectionType(newTypes, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type;
}
- if (type.flags & 524288) {
+ if (type.flags & 1048576) {
return getIndexType(instantiateType(type.type, mapper));
}
- if (type.flags & 1048576) {
+ if (type.flags & 2097152) {
return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper));
}
- if (type.flags & 2097152) {
+ if (type.flags & 4194304) {
return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper));
}
- if (type.flags & 4194304) {
+ if (type.flags & 8388608) {
return instantiateType(type.typeVariable, mapper);
}
}
return type;
}
function getWildcardInstantiation(type) {
- return type.flags & (16382 | 1 | 16384) ? type :
+ return type.flags & (32764 | 3 | 32768) ? type :
type.wildcardInstantiation || (type.wildcardInstantiation = instantiateType(type, wildcardMapper));
}
function instantiateIndexInfo(info, mapper) {
return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration);
}
function isContextSensitive(node) {
- ts.Debug.assert(node.kind !== 153 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 154 || ts.isObjectLiteralMethod(node));
switch (node.kind) {
- case 191:
case 192:
- case 153:
+ case 193:
+ case 154:
return isContextSensitiveFunctionLikeDeclaration(node);
+ case 184:
+ return ts.some(node.properties, isContextSensitive);
case 183:
- return ts.forEach(node.properties, isContextSensitive);
- case 182:
- return ts.forEach(node.elements, isContextSensitive);
- case 200:
+ return ts.some(node.elements, isContextSensitive);
+ case 201:
return isContextSensitive(node.whenTrue) ||
isContextSensitive(node.whenFalse);
- case 199:
+ case 200:
return node.operatorToken.kind === 54 &&
(isContextSensitive(node.left) || isContextSensitive(node.right));
- case 269:
+ case 270:
return isContextSensitive(node.initializer);
- case 190:
+ case 191:
return isContextSensitive(node.expression);
- case 262:
- return ts.forEach(node.properties, isContextSensitive);
- case 261:
- return node.initializer && isContextSensitive(node.initializer);
- case 264:
- return node.expression && isContextSensitive(node.expression);
+ case 263:
+ return ts.some(node.properties, isContextSensitive);
+ case 262: {
+ var initializer = node.initializer;
+ return !!initializer && isContextSensitive(initializer);
+ }
+ case 265: {
+ var expression = node.expression;
+ return !!expression && isContextSensitive(expression);
+ }
}
return false;
}
@@ -30712,23 +30909,24 @@ var ts;
if (node.typeParameters) {
return false;
}
- if (ts.forEach(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) {
+ if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) {
return true;
}
- if (node.kind !== 192) {
+ if (node.kind !== 193) {
var parameter = ts.firstOrUndefined(node.parameters);
if (!(parameter && ts.parameterIsThisKeyword(parameter))) {
return true;
}
}
- return node.body.kind === 212 ? false : isContextSensitive(node.body);
+ var body = node.body;
+ return body.kind === 213 ? false : isContextSensitive(body);
}
function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
return (ts.isInJavaScriptFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) &&
isContextSensitiveFunctionLikeDeclaration(func);
}
function getTypeWithoutSignatures(type) {
- if (type.flags & 65536) {
+ if (type.flags & 131072) {
var resolved = resolveStructuredTypeMembers(type);
if (resolved.constructSignatures.length) {
var result = createObjectType(16, type.symbol);
@@ -30739,7 +30937,7 @@ var ts;
return result;
}
}
- else if (type.flags & 262144) {
+ else if (type.flags & 524288) {
return getIntersectionType(ts.map(type.types, getTypeWithoutSignatures));
}
return type;
@@ -30760,9 +30958,9 @@ var ts;
return isTypeRelatedTo(source, target, assignableRelation);
}
function isTypeDerivedFrom(source, target) {
- return source.flags & 131072 ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) :
- target.flags & 131072 ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) :
- source.flags & 7372800 ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) :
+ return source.flags & 262144 ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) :
+ target.flags & 262144 ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) :
+ source.flags & 14745600 ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) :
target === globalObjectType || target === globalFunctionType ? isTypeSubtypeOf(source, target) :
hasBaseType(source, getTargetType(target));
}
@@ -30793,8 +30991,8 @@ var ts;
source = instantiateSignatureInContextOf(source, target, undefined, compareTypes);
}
var kind = target.declaration ? target.declaration.kind : 0;
- var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 153 &&
- kind !== 152 && kind !== 154;
+ var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 154 &&
+ kind !== 153 && kind !== 155;
var result = -1;
var sourceThisType = getThisTypeOfSignature(source);
if (sourceThisType && sourceThisType !== voidType) {
@@ -30822,7 +31020,7 @@ var ts;
var sourceSig = callbackCheck ? undefined : getSingleCallSignature(getNonNullableType(sourceType));
var targetSig = callbackCheck ? undefined : getSingleCallSignature(getNonNullableType(targetType));
var callbacks = sourceSig && targetSig && !signatureHasTypePredicate(sourceSig) && !signatureHasTypePredicate(targetSig) &&
- (getFalsyFlags(sourceType) & 12288) === (getFalsyFlags(targetType) & 12288);
+ (getFalsyFlags(sourceType) & 24576) === (getFalsyFlags(targetType) & 24576);
var related = callbacks ?
compareSignaturesRelated(targetSig, sourceSig, strictVariance ? 2 : 1, false, reportErrors, errorReporter, compareTypes) :
!callbackCheck && !strictVariance && compareTypes(sourceType, targetType, false) || compareTypes(targetType, sourceType, reportErrors);
@@ -30927,10 +31125,10 @@ var ts;
!t.numberIndexInfo;
}
function isEmptyObjectType(type) {
- return type.flags & 65536 ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) :
- type.flags & 134217728 ? true :
- type.flags & 131072 ? ts.forEach(type.types, isEmptyObjectType) :
- type.flags & 262144 ? !ts.forEach(type.types, function (t) { return !isEmptyObjectType(t); }) :
+ return type.flags & 131072 ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) :
+ type.flags & 16777216 ? true :
+ type.flags & 262144 ? ts.some(type.types, isEmptyObjectType) :
+ type.flags & 524288 ? !ts.some(type.types, function (t) { return !isEmptyObjectType(t); }) :
false;
}
function isEnumTypeRelatedTo(sourceSymbol, targetSymbol, errorReporter) {
@@ -30966,71 +31164,71 @@ var ts;
function isSimpleTypeRelatedTo(source, target, relation, errorReporter) {
var s = source.flags;
var t = target.flags;
- if (t & 1 || s & 16384 || source === wildcardType)
+ if (t & 3 || s & 32768 || source === wildcardType)
return true;
- if (t & 16384)
+ if (t & 32768)
return false;
- if (s & 34 && t & 2)
+ if (s & 68 && t & 4)
return true;
- if (s & 32 && s & 256 &&
- t & 32 && !(t & 256) &&
+ if (s & 64 && s & 512 &&
+ t & 64 && !(t & 512) &&
source.value === target.value)
return true;
- if (s & 84 && t & 4)
+ if (s & 168 && t & 8)
return true;
- if (s & 64 && s & 256 &&
- t & 64 && !(t & 256) &&
+ if (s & 128 && s & 512 &&
+ t & 128 && !(t & 512) &&
source.value === target.value)
return true;
- if (s & 136 && t & 8)
+ if (s & 272 && t & 16)
return true;
- if (s & 1536 && t & 512)
+ if (s & 3072 && t & 1024)
return true;
- if (s & 16 && t & 16 && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter))
+ if (s & 32 && t & 32 && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter))
return true;
- if (s & 256 && t & 256) {
- if (s & 131072 && t & 131072 && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter))
+ if (s & 512 && t & 512) {
+ if (s & 262144 && t & 262144 && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter))
return true;
- if (s & 224 && t & 224 &&
+ if (s & 448 && t & 448 &&
source.value === target.value &&
isEnumTypeRelatedTo(getParentOfSymbol(source.symbol), getParentOfSymbol(target.symbol), errorReporter))
return true;
}
- if (s & 4096 && (!strictNullChecks || t & (4096 | 2048)))
+ if (s & 8192 && (!strictNullChecks || t & (8192 | 4096)))
return true;
- if (s & 8192 && (!strictNullChecks || t & 8192))
+ if (s & 16384 && (!strictNullChecks || t & 16384))
return true;
- if (s & 65536 && t & 134217728)
+ if (s & 131072 && t & 16777216)
return true;
- if (s & 1024 || t & 1024)
+ if (s & 2048 || t & 2048)
return false;
if (relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) {
if (s & 1)
return true;
- if (s & (4 | 64) && !(s & 256) && (t & 16 || t & 64 && t & 256))
+ if (s & (8 | 128) && !(s & 512) && (t & 32 || t & 128 && t & 512))
return true;
}
return false;
}
function isTypeRelatedTo(source, target, relation) {
- if (source.flags & 96 && source.flags & 8388608) {
+ if (source.flags & 192 && source.flags & 33554432) {
source = source.regularType;
}
- if (target.flags & 96 && target.flags & 8388608) {
+ if (target.flags & 192 && target.flags & 33554432) {
target = target.regularType;
}
if (source === target ||
- relation === comparableRelation && !(target.flags & 16384) && isSimpleTypeRelatedTo(target, source, relation) ||
+ relation === comparableRelation && !(target.flags & 32768) && isSimpleTypeRelatedTo(target, source, relation) ||
relation !== identityRelation && isSimpleTypeRelatedTo(source, target, relation)) {
return true;
}
- if (source.flags & 65536 && target.flags & 65536) {
+ if (source.flags & 131072 && target.flags & 131072) {
var related = relation.get(getRelationKey(source, target, relation));
if (related !== undefined) {
return related === 1;
}
}
- if (source.flags & 8355840 || target.flags & 8355840) {
+ if (source.flags & 16711680 || target.flags & 16711680) {
return checkTypeRelatedTo(source, target, relation, undefined);
}
return false;
@@ -31107,13 +31305,13 @@ var ts;
}
}
function isUnionOrIntersectionTypeWithoutNullableConstituents(type) {
- if (!(type.flags & 393216)) {
+ if (!(type.flags & 786432)) {
return false;
}
var seenNonNullable = false;
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
var t = _a[_i];
- if (t.flags & 12288) {
+ if (t.flags & 24576) {
continue;
}
if (seenNonNullable) {
@@ -31124,22 +31322,23 @@ var ts;
return false;
}
function isRelatedTo(source, target, reportErrors, headMessage) {
- if (source.flags & 96 && source.flags & 8388608) {
+ if (reportErrors === void 0) { reportErrors = false; }
+ if (source.flags & 192 && source.flags & 33554432) {
source = source.regularType;
}
- if (target.flags & 96 && target.flags & 8388608) {
+ if (target.flags & 192 && target.flags & 33554432) {
target = target.regularType;
}
- if (source.flags & 4194304) {
+ if (source.flags & 8388608) {
source = relation === definitelyAssignableRelation ? source.typeVariable : source.substitute;
}
- if (target.flags & 4194304) {
+ if (target.flags & 8388608) {
target = target.typeVariable;
}
- if (source.flags & 1048576) {
+ if (source.flags & 2097152) {
source = getSimplifiedType(source);
}
- if (target.flags & 1048576) {
+ if (target.flags & 2097152) {
target = getSimplifiedType(target);
}
if (source === target)
@@ -31147,11 +31346,11 @@ var ts;
if (relation === identityRelation) {
return isIdenticalTo(source, target);
}
- if (relation === comparableRelation && !(target.flags & 16384) && isSimpleTypeRelatedTo(target, source, relation) ||
+ if (relation === comparableRelation && !(target.flags & 32768) && isSimpleTypeRelatedTo(target, source, relation) ||
isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined))
return -1;
- if (isObjectLiteralType(source) && source.flags & 8388608) {
- var discriminantType = target.flags & 131072 ? findMatchingDiscriminantType(source, target) : undefined;
+ if (isObjectLiteralType(source) && source.flags & 33554432) {
+ var discriminantType = target.flags & 262144 ? findMatchingDiscriminantType(source, target) : undefined;
if (hasExcessProperties(source, target, discriminantType, reportErrors)) {
if (reportErrors) {
reportRelationError(headMessage, source, target);
@@ -31163,8 +31362,8 @@ var ts;
}
}
if (relation !== comparableRelation &&
- !(source.flags & 393216) &&
- !(target.flags & 131072) &&
+ !(source.flags & 786432) &&
+ !(target.flags & 262144) &&
!isIntersectionConstituent &&
source !== globalObjectType &&
(getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source)) &&
@@ -31187,30 +31386,30 @@ var ts;
var saveErrorInfo = errorInfo;
var saveIsIntersectionConstituent = isIntersectionConstituent;
isIntersectionConstituent = false;
- if (source.flags & 131072) {
+ if (source.flags & 262144) {
result = relation === comparableRelation ?
- someTypeRelatedToType(source, target, reportErrors && !(source.flags & 16382)) :
- eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 16382));
+ someTypeRelatedToType(source, target, reportErrors && !(source.flags & 32764)) :
+ eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 32764));
}
else {
- if (target.flags & 131072) {
- result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & 16382) && !(target.flags & 16382));
+ if (target.flags & 262144) {
+ result = typeRelatedToSomeType(source, target, reportErrors && !(source.flags & 32764) && !(target.flags & 32764));
}
- else if (target.flags & 262144) {
+ else if (target.flags & 524288) {
isIntersectionConstituent = true;
result = typeRelatedToEachType(source, target, reportErrors);
}
- else if (source.flags & 262144) {
+ else if (source.flags & 524288) {
result = someTypeRelatedToType(source, target, false);
}
- if (!result && (source.flags & 8355840 || target.flags & 8355840)) {
+ if (!result && (source.flags & 16711680 || target.flags & 16711680)) {
if (result = recursiveTypeRelatedTo(source, target, reportErrors)) {
errorInfo = saveErrorInfo;
}
}
}
- if (!result && source.flags & 262144) {
- var constraint = getUnionConstraintOfIntersection(source, !!(target.flags & 131072));
+ if (!result && source.flags & 524288) {
+ var constraint = getUnionConstraintOfIntersection(source, !!(target.flags & 262144));
if (constraint) {
if (result = isRelatedTo(constraint, target, reportErrors)) {
errorInfo = saveErrorInfo;
@@ -31219,12 +31418,21 @@ var ts;
}
isIntersectionConstituent = saveIsIntersectionConstituent;
if (!result && reportErrors) {
- if (source.flags & 65536 && target.flags & 16382) {
+ if (source.flags & 131072 && target.flags & 32764) {
tryElaborateErrorsForPrimitivesAndObjects(source, target);
}
- else if (source.symbol && source.flags & 65536 && globalObjectType === source) {
+ else if (source.symbol && source.flags & 131072 && globalObjectType === source) {
reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
}
+ else if (ts.getObjectFlags(source) & 4096 && target.flags & 524288) {
+ var targetTypes = target.types;
+ var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
+ var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
+ if (intrinsicAttributes !== errorType && intrinsicClassAttributes !== errorType &&
+ (ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
+ return result;
+ }
+ }
reportRelationError(headMessage, source, target);
}
return result;
@@ -31232,27 +31440,27 @@ var ts;
function isIdenticalTo(source, target) {
var result;
var flags = source.flags & target.flags;
- if (flags & 65536) {
+ if (flags & 131072) {
return recursiveTypeRelatedTo(source, target, false);
}
- if (flags & (131072 | 262144)) {
+ if (flags & (262144 | 524288)) {
if (result = eachTypeRelatedToSomeType(source, target)) {
if (result &= eachTypeRelatedToSomeType(target, source)) {
return result;
}
}
}
- if (flags & 524288) {
+ if (flags & 1048576) {
return isRelatedTo(source.type, target.type, false);
}
- if (flags & 1048576) {
+ if (flags & 2097152) {
if (result = isRelatedTo(source.objectType, target.objectType, false)) {
if (result &= isRelatedTo(source.indexType, target.indexType, false)) {
return result;
}
}
}
- if (flags & 2097152) {
+ if (flags & 4194304) {
if (source.root.isDistributive === target.root.isDistributive) {
if (result = isRelatedTo(source.checkType, target.checkType, false)) {
if (result &= isRelatedTo(source.extendsType, target.extendsType, false)) {
@@ -31265,13 +31473,13 @@ var ts;
}
}
}
- if (flags & 4194304) {
+ if (flags & 8388608) {
return isRelatedTo(source.substitute, target.substitute, false);
}
return 0;
}
function hasExcessProperties(source, target, discriminant, reportErrors) {
- if (maybeTypeOfKind(target, 65536) && !(ts.getObjectFlags(target) & 512)) {
+ if (maybeTypeOfKind(target, 131072) && !(ts.getObjectFlags(target) & 512)) {
var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096);
if ((relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) &&
(isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) {
@@ -31283,7 +31491,8 @@ var ts;
var _loop_6 = function (prop) {
if (!isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) {
if (reportErrors) {
- ts.Debug.assert(!!errorNode);
+ if (!errorNode)
+ return { value: ts.Debug.fail() };
if (ts.isJsxAttributes(errorNode) || ts.isJsxOpeningLikeElement(errorNode)) {
reportError(ts.Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target));
}
@@ -31294,8 +31503,9 @@ var ts;
var propDeclaration = prop.valueDeclaration;
ts.Debug.assertNode(propDeclaration, ts.isObjectLiteralElementLike);
errorNode = propDeclaration;
- if (ts.isIdentifier(propDeclaration.name)) {
- suggestion = getSuggestionForNonexistentProperty(propDeclaration.name, target);
+ var name = propDeclaration.name;
+ if (ts.isIdentifier(name)) {
+ suggestion = getSuggestionForNonexistentProperty(name, target);
}
}
if (suggestion !== undefined) {
@@ -31333,7 +31543,7 @@ var ts;
}
function typeRelatedToSomeType(source, target, reportErrors) {
var targetTypes = target.types;
- if (target.flags & 131072 && containsType(targetTypes, source)) {
+ if (target.flags & 262144 && containsType(targetTypes, source)) {
return -1;
}
for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) {
@@ -31390,7 +31600,7 @@ var ts;
}
function someTypeRelatedToType(source, target, reportErrors) {
var sourceTypes = source.types;
- if (source.flags & 131072 && containsType(sourceTypes, target)) {
+ if (source.flags & 262144 && containsType(sourceTypes, target)) {
return -1;
}
var len = sourceTypes.length;
@@ -31520,7 +31730,7 @@ var ts;
var result;
var originalErrorInfo;
var saveErrorInfo = errorInfo;
- if (target.flags & 32768) {
+ if (target.flags & 65536) {
if (ts.getObjectFlags(source) & 32 && getConstraintTypeFromMappedType(source) === getIndexType(target)) {
if (!(getMappedTypeModifiers(source) & 4)) {
var templateType = getTemplateTypeFromMappedType(source);
@@ -31531,8 +31741,8 @@ var ts;
}
}
}
- else if (target.flags & 524288) {
- if (source.flags & 524288) {
+ else if (target.flags & 1048576) {
+ if (source.flags & 1048576) {
if (result = isRelatedTo(target.type, source.type, false)) {
return result;
}
@@ -31547,7 +31757,7 @@ var ts;
}
}
}
- else if (target.flags & 1048576) {
+ else if (target.flags & 2097152) {
var constraint = getConstraintForRelation(target);
if (constraint) {
if (result = isRelatedTo(source, constraint, reportErrors)) {
@@ -31560,7 +31770,7 @@ var ts;
var template = getTemplateTypeFromMappedType(target);
var modifiers = getMappedTypeModifiers(target);
if (!(modifiers & 8)) {
- if (template.flags & 1048576 && template.objectType === source &&
+ if (template.flags & 2097152 && template.objectType === source &&
template.indexType === getTypeParameterFromMappedType(target)) {
return -1;
}
@@ -31574,8 +31784,8 @@ var ts;
}
}
}
- if (source.flags & 1081344) {
- if (source.flags & 1048576 && target.flags & 1048576) {
+ if (source.flags & 2162688) {
+ if (source.flags & 2097152 && target.flags & 2097152) {
if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) {
result &= isRelatedTo(source.indexType, target.indexType, reportErrors);
}
@@ -31585,8 +31795,8 @@ var ts;
}
}
var constraint = getConstraintForRelation(source);
- if (!constraint || (source.flags & 32768 && constraint.flags & 1)) {
- if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~134217728))) {
+ if (!constraint || (source.flags & 65536 && constraint.flags & 3)) {
+ if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~16777216))) {
errorInfo = saveErrorInfo;
return result;
}
@@ -31599,14 +31809,14 @@ var ts;
}
}
}
- else if (source.flags & 524288) {
+ else if (source.flags & 1048576) {
if (result = isRelatedTo(keyofConstraintType, target, reportErrors)) {
errorInfo = saveErrorInfo;
return result;
}
}
- else if (source.flags & 2097152) {
- if (target.flags & 2097152) {
+ else if (source.flags & 4194304) {
+ if (target.flags & 4194304) {
if (isTypeIdenticalTo(source.extendsType, target.extendsType) &&
(isRelatedTo(source.checkType, target.checkType) || isRelatedTo(target.checkType, source.checkType))) {
if (result = isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), reportErrors)) {
@@ -31650,11 +31860,11 @@ var ts;
errorInfo = saveErrorInfo;
}
}
- var sourceIsPrimitive = !!(source.flags & 16382);
+ var sourceIsPrimitive = !!(source.flags & 32764);
if (relation !== identityRelation) {
source = getApparentType(source);
}
- if (source.flags & (65536 | 262144) && target.flags & 65536) {
+ if (source.flags & (131072 | 524288) && target.flags & 131072) {
var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !sourceIsPrimitive;
if (isPartialMappedType(target) && !isGenericMappedType(source) && isEmptyObjectType(source)) {
result = -1;
@@ -31792,14 +32002,14 @@ var ts;
return result;
}
function isWeakType(type) {
- if (type.flags & 65536) {
+ if (type.flags & 131072) {
var resolved = resolveStructuredTypeMembers(type);
return resolved.callSignatures.length === 0 && resolved.constructSignatures.length === 0 &&
!resolved.stringIndexInfo && !resolved.numberIndexInfo &&
resolved.properties.length > 0 &&
ts.every(resolved.properties, function (p) { return !!(p.flags & 16777216); });
}
- if (type.flags & 262144) {
+ if (type.flags & 524288) {
return ts.every(type.types, isWeakType);
}
return false;
@@ -31815,7 +32025,7 @@ var ts;
return false;
}
function propertiesIdenticalTo(source, target) {
- if (!(source.flags & 65536 && target.flags & 65536)) {
+ if (!(source.flags & 131072 && target.flags & 131072)) {
return 0;
}
var sourceProperties = getPropertiesOfObjectType(source);
@@ -31870,7 +32080,7 @@ var ts;
}
}
else if (sourceSignatures.length === 1 && targetSignatures.length === 1) {
- var eraseGenerics = relation === comparableRelation || compilerOptions.noStrictGenericChecks;
+ var eraseGenerics = relation === comparableRelation || !!compilerOptions.noStrictGenericChecks;
result = signatureRelatedTo(sourceSignatures[0], targetSignatures[0], eraseGenerics, reportErrors);
}
else {
@@ -31921,7 +32131,7 @@ var ts;
if (isIgnoredJsxProperty(source, prop, undefined)) {
continue;
}
- if (prop.nameType && prop.nameType.flags & 1024) {
+ if (prop.nameType && prop.nameType.flags & 2048) {
continue;
}
if (kind === 0 || isNumericLiteralName(prop.escapedName)) {
@@ -31949,7 +32159,7 @@ var ts;
return indexTypesIdenticalTo(source, target, kind);
}
var targetInfo = getIndexInfoOfType(target, kind);
- if (!targetInfo || targetInfo.type.flags & 1 && !sourceIsPrimitive) {
+ if (!targetInfo || targetInfo.type.flags & 3 && !sourceIsPrimitive) {
return -1;
}
var sourceInfo = getIndexInfoOfType(source, kind) ||
@@ -31958,7 +32168,7 @@ var ts;
return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors);
}
if (isGenericMappedType(source)) {
- return kind === 0 && isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, reportErrors);
+ return (kind === 0 && isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, reportErrors));
}
if (isObjectTypeWithInferableIndex(source)) {
var related = -1;
@@ -32046,17 +32256,17 @@ var ts;
}
function hasCovariantVoidArgument(type, variances) {
for (var i = 0; i < variances.length; i++) {
- if (variances[i] === 1 && type.typeArguments[i].flags & 2048) {
+ if (variances[i] === 1 && type.typeArguments[i].flags & 4096) {
return true;
}
}
return false;
}
function isUnconstrainedTypeParameter(type) {
- return type.flags & 32768 && !getConstraintFromTypeParameter(type);
+ return type.flags & 65536 && !getConstraintFromTypeParameter(type);
}
function isTypeReferenceWithGenericArguments(type) {
- return ts.getObjectFlags(type) & 4 && ts.some(type.typeArguments, function (t) { return isUnconstrainedTypeParameter(t) || isTypeReferenceWithGenericArguments(t); });
+ return !!(ts.getObjectFlags(type) & 4) && ts.some(type.typeArguments, function (t) { return isUnconstrainedTypeParameter(t) || isTypeReferenceWithGenericArguments(t); });
}
function getTypeReferenceId(type, typeParameters, depth) {
if (depth === void 0) { depth = 0; }
@@ -32124,13 +32334,13 @@ var ts;
!hasBaseType(checkClass, getDeclaringClass(p)) : false; }) ? undefined : checkClass;
}
function isDeeplyNestedType(type, stack, depth) {
- if (depth >= 5 && type.flags & 65536) {
+ if (depth >= 5 && type.flags & 131072) {
var symbol = type.symbol;
if (symbol) {
var count = 0;
for (var i = 0; i < depth; i++) {
var t = stack[i];
- if (t.flags & 65536 && t.symbol === symbol) {
+ if (t.flags & 131072 && t.symbol === symbol) {
count++;
if (count >= 5)
return true;
@@ -32255,20 +32465,20 @@ var ts;
if (!strictNullChecks) {
return getSupertypeOrUnion(types);
}
- var primaryTypes = ts.filter(types, function (t) { return !(t.flags & 12288); });
+ var primaryTypes = ts.filter(types, function (t) { return !(t.flags & 24576); });
return primaryTypes.length ?
- getNullableType(getSupertypeOrUnion(primaryTypes), getFalsyFlagsOfTypes(types) & 12288) :
+ getNullableType(getSupertypeOrUnion(primaryTypes), getFalsyFlagsOfTypes(types) & 24576) :
getUnionType(types, 2);
}
function getCommonSubtype(types) {
return ts.reduceLeft(types, function (s, t) { return isTypeSubtypeOf(t, s) ? t : s; });
}
function isArrayType(type) {
- return ts.getObjectFlags(type) & 4 && type.target === globalArrayType;
+ return !!(ts.getObjectFlags(type) & 4) && type.target === globalArrayType;
}
function isArrayLikeType(type) {
return ts.getObjectFlags(type) & 4 && (type.target === globalArrayType || type.target === globalReadonlyArrayType) ||
- !(type.flags & 12288) && isTypeAssignableTo(type, anyReadonlyArrayType);
+ !(type.flags & 24576) && isTypeAssignableTo(type, anyReadonlyArrayType);
}
function isEmptyArrayLiteralType(type) {
var elementType = isArrayType(type) ? type.typeArguments[0] : undefined;
@@ -32278,35 +32488,35 @@ var ts;
return !!getPropertyOfType(type, "0");
}
function isNeitherUnitTypeNorNever(type) {
- return !(type.flags & (13536 | 16384));
+ return !(type.flags & (27072 | 32768));
}
function isUnitType(type) {
- return !!(type.flags & 13536);
+ return !!(type.flags & 27072);
}
function isLiteralType(type) {
- return type.flags & 8 ? true :
- type.flags & 131072 ? type.flags & 256 ? true : !ts.forEach(type.types, function (t) { return !isUnitType(t); }) :
+ return type.flags & 16 ? true :
+ type.flags & 262144 ? type.flags & 512 ? true : !ts.forEach(type.types, function (t) { return !isUnitType(t); }) :
isUnitType(type);
}
function getBaseTypeOfLiteralType(type) {
- return type.flags & 256 ? getBaseTypeOfEnumLiteralType(type) :
- type.flags & 32 ? stringType :
- type.flags & 64 ? numberType :
- type.flags & 128 ? booleanType :
- type.flags & 131072 ? getUnionType(ts.sameMap(type.types, getBaseTypeOfLiteralType)) :
+ return type.flags & 512 ? getBaseTypeOfEnumLiteralType(type) :
+ type.flags & 64 ? stringType :
+ type.flags & 128 ? numberType :
+ type.flags & 256 ? booleanType :
+ type.flags & 262144 ? getUnionType(ts.sameMap(type.types, getBaseTypeOfLiteralType)) :
type;
}
function getWidenedLiteralType(type) {
- return type.flags & 256 ? getBaseTypeOfEnumLiteralType(type) :
- type.flags & 32 && type.flags & 8388608 ? stringType :
- type.flags & 64 && type.flags & 8388608 ? numberType :
- type.flags & 128 ? booleanType :
- type.flags & 131072 ? getUnionType(ts.sameMap(type.types, getWidenedLiteralType)) :
+ return type.flags & 512 ? getBaseTypeOfEnumLiteralType(type) :
+ type.flags & 64 && type.flags & 33554432 ? stringType :
+ type.flags & 128 && type.flags & 33554432 ? numberType :
+ type.flags & 256 ? booleanType :
+ type.flags & 262144 ? getUnionType(ts.sameMap(type.types, getWidenedLiteralType)) :
type;
}
function getWidenedUniqueESSymbolType(type) {
- return type.flags & 1024 ? esSymbolType :
- type.flags & 131072 ? getUnionType(ts.sameMap(type.types, getWidenedUniqueESSymbolType)) :
+ return type.flags & 2048 ? esSymbolType :
+ type.flags & 262144 ? getUnionType(ts.sameMap(type.types, getWidenedUniqueESSymbolType)) :
type;
}
function getWidenedLiteralLikeTypeForContextualType(type, contextualType) {
@@ -32327,39 +32537,39 @@ var ts;
return result;
}
function getFalsyFlags(type) {
- return type.flags & 131072 ? getFalsyFlagsOfTypes(type.types) :
- type.flags & 32 ? type.value === "" ? 32 : 0 :
- type.flags & 64 ? type.value === 0 ? 64 : 0 :
- type.flags & 128 ? type === falseType ? 128 : 0 :
- type.flags & 14574;
+ return type.flags & 262144 ? getFalsyFlagsOfTypes(type.types) :
+ type.flags & 64 ? type.value === "" ? 64 : 0 :
+ type.flags & 128 ? type.value === 0 ? 128 : 0 :
+ type.flags & 256 ? type === falseType ? 256 : 0 :
+ type.flags & 29148;
}
function removeDefinitelyFalsyTypes(type) {
- return getFalsyFlags(type) & 14560 ?
- filterType(type, function (t) { return !(getFalsyFlags(t) & 14560); }) :
+ return getFalsyFlags(type) & 29120 ?
+ filterType(type, function (t) { return !(getFalsyFlags(t) & 29120); }) :
type;
}
function extractDefinitelyFalsyTypes(type) {
return mapType(type, getDefinitelyFalsyPartOfType);
}
function getDefinitelyFalsyPartOfType(type) {
- return type.flags & 2 ? emptyStringType :
- type.flags & 4 ? zeroType :
- type.flags & 8 || type === falseType ? falseType :
- type.flags & (2048 | 4096 | 8192) ||
- type.flags & 32 && type.value === "" ||
- type.flags & 64 && type.value === 0 ? type :
+ return type.flags & 4 ? emptyStringType :
+ type.flags & 8 ? zeroType :
+ type.flags & 16 || type === falseType ? falseType :
+ type.flags & (4096 | 8192 | 16384) ||
+ type.flags & 64 && type.value === "" ||
+ type.flags & 128 && type.value === 0 ? type :
neverType;
}
function getNullableType(type, flags) {
- var missing = (flags & ~type.flags) & (4096 | 8192);
+ var missing = (flags & ~type.flags) & (8192 | 16384);
return missing === 0 ? type :
- missing === 4096 ? getUnionType([type, undefinedType]) :
- missing === 8192 ? getUnionType([type, nullType]) :
+ missing === 8192 ? getUnionType([type, undefinedType]) :
+ missing === 16384 ? getUnionType([type, nullType]) :
getUnionType([type, undefinedType, nullType]);
}
function getOptionalType(type) {
ts.Debug.assert(strictNullChecks);
- return type.flags & 4096 ? type : getUnionType([type, undefinedType]);
+ return type.flags & 8192 ? type : getUnionType([type, undefinedType]);
}
function getGlobalNonNullableTypeInstantiation(type) {
if (!deferredGlobalNonNullableTypeAlias) {
@@ -32402,7 +32612,7 @@ var ts;
return members;
}
function getRegularTypeOfObjectLiteral(type) {
- if (!(isObjectLiteralType(type) && type.flags & 8388608)) {
+ if (!(isObjectLiteralType(type) && type.flags & 33554432)) {
return type;
}
var regularType = type.regularType;
@@ -32412,7 +32622,7 @@ var ts;
var resolved = type;
var members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral);
var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.stringIndexInfo, resolved.numberIndexInfo);
- regularNew.flags = resolved.flags & ~8388608;
+ regularNew.flags = resolved.flags & ~33554432;
regularNew.objectFlags |= 128;
type.regularType = regularNew;
return regularNew;
@@ -32492,16 +32702,16 @@ var ts;
return getWidenedTypeWithContext(type, undefined);
}
function getWidenedTypeWithContext(type, context) {
- if (type.flags & 50331648) {
- if (type.flags & 12288) {
+ if (type.flags & 402653184) {
+ if (type.flags & 24576) {
return anyType;
}
if (isObjectLiteralType(type)) {
return getWidenedTypeOfObjectLiteral(type, context);
}
- if (type.flags & 131072) {
+ if (type.flags & 262144) {
var unionContext_1 = context || createWideningContext(undefined, undefined, type.types);
- var widenedTypes = ts.sameMap(type.types, function (t) { return t.flags & 12288 ? t : getWidenedTypeWithContext(t, unionContext_1); });
+ var widenedTypes = ts.sameMap(type.types, function (t) { return t.flags & 24576 ? t : getWidenedTypeWithContext(t, unionContext_1); });
return getUnionType(widenedTypes, ts.some(widenedTypes, isEmptyObjectType) ? 2 : 1);
}
if (isArrayType(type) || isTupleType(type)) {
@@ -32512,8 +32722,8 @@ var ts;
}
function reportWideningErrorsInType(type) {
var errorReported = false;
- if (type.flags & 16777216) {
- if (type.flags & 131072) {
+ if (type.flags & 134217728) {
+ if (type.flags & 262144) {
if (ts.some(type.types, isEmptyObjectType)) {
errorReported = true;
}
@@ -32538,7 +32748,7 @@ var ts;
for (var _d = 0, _e = getPropertiesOfObjectType(type); _d < _e.length; _d++) {
var p = _e[_d];
var t = getTypeOfSymbol(p);
- if (t.flags & 16777216) {
+ if (t.flags & 134217728) {
if (!reportWideningErrorsInType(t)) {
error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t)));
}
@@ -32553,33 +32763,33 @@ var ts;
var typeAsString = typeToString(getWidenedType(type));
var diagnostic;
switch (declaration.kind) {
- case 199:
+ case 200:
+ case 152:
case 151:
- case 150:
diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type;
break;
- case 148:
+ case 149:
diagnostic = declaration.dotDotDotToken ?
ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type :
ts.Diagnostics.Parameter_0_implicitly_has_an_1_type;
break;
- case 181:
+ case 182:
diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type;
break;
- case 233:
+ case 234:
+ case 154:
case 153:
- case 152:
- case 155:
case 156:
- case 191:
+ case 157:
case 192:
+ case 193:
if (!declaration.name) {
error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
return;
}
diagnostic = ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type;
break;
- case 176:
+ case 177:
error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type);
return;
default:
@@ -32588,7 +32798,7 @@ var ts;
error(declaration, diagnostic, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)), typeAsString);
}
function reportErrorsFromWidening(declaration, type) {
- if (produceDiagnostics && noImplicitAny && type.flags & 16777216) {
+ if (produceDiagnostics && noImplicitAny && type.flags & 134217728) {
if (!reportWideningErrorsInType(type)) {
reportImplicitAnyError(declaration, type);
}
@@ -32657,25 +32867,25 @@ var ts;
}
function couldContainTypeVariables(type) {
var objectFlags = ts.getObjectFlags(type);
- return !!(type.flags & 7897088 ||
+ return !!(type.flags & 15794176 ||
objectFlags & 4 && ts.forEach(type.typeArguments, couldContainTypeVariables) ||
objectFlags & 16 && type.symbol && type.symbol.flags & (16 | 8192 | 2048 | 32) ||
objectFlags & 32 ||
- type.flags & 393216 && couldUnionOrIntersectionContainTypeVariables(type));
+ type.flags & 786432 && couldUnionOrIntersectionContainTypeVariables(type));
}
function couldUnionOrIntersectionContainTypeVariables(type) {
if (type.couldContainTypeVariables === undefined) {
- type.couldContainTypeVariables = ts.forEach(type.types, couldContainTypeVariables);
+ type.couldContainTypeVariables = ts.some(type.types, couldContainTypeVariables);
}
return type.couldContainTypeVariables;
}
function isTypeParameterAtTopLevel(type, typeParameter) {
- return type === typeParameter || type.flags & 393216 && ts.forEach(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); });
+ return type === typeParameter || !!(type.flags & 786432) && ts.some(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); });
}
function createEmptyObjectTypeFromStringLiteral(type) {
var members = ts.createSymbolTable();
forEachType(type, function (t) {
- if (!(t.flags & 32)) {
+ if (!(t.flags & 64)) {
return;
}
var name = ts.escapeLeadingUnderscores(t.value);
@@ -32687,7 +32897,7 @@ var ts;
}
members.set(name, literalProp);
});
- var indexInfo = type.flags & 2 ? createIndexInfo(emptyObjectType, false) : undefined;
+ var indexInfo = type.flags & 4 ? createIndexInfo(emptyObjectType, false) : undefined;
return createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, indexInfo, undefined);
}
function inferTypeForHomomorphicMappedType(source, target) {
@@ -32707,7 +32917,7 @@ var ts;
}
for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) {
var prop = properties_4[_i];
- if (getTypeOfSymbol(prop).flags & 67108864) {
+ if (getTypeOfSymbol(prop).flags & 536870912) {
return undefined;
}
}
@@ -32727,7 +32937,7 @@ var ts;
return getTypeFromInference(inference);
}
function getUnmatchedProperty(source, target, requireOptionalProperties) {
- var properties = target.flags & 262144 ? getPropertiesOfUnionOrIntersectionType(target) : getPropertiesOfObjectType(target);
+ var properties = target.flags & 524288 ? getPropertiesOfUnionOrIntersectionType(target) : getPropertiesOfObjectType(target);
for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) {
var targetProp = properties_5[_i];
if (requireOptionalProperties || !(targetProp.flags & 16777216)) {
@@ -32774,8 +32984,8 @@ var ts;
}
return;
}
- if (source.flags & 131072 && target.flags & 131072 && !(source.flags & 256 && target.flags & 256) ||
- source.flags & 262144 && target.flags & 262144) {
+ if (source.flags & 262144 && target.flags & 262144 && !(source.flags & 512 && target.flags & 512) ||
+ source.flags & 524288 && target.flags & 524288) {
if (source === target) {
for (var _i = 0, _a = source.types; _i < _a.length; _i++) {
var t = _a[_i];
@@ -32790,7 +33000,7 @@ var ts;
(matchingTypes || (matchingTypes = [])).push(t);
inferFromTypes(t, t);
}
- else if (t.flags & (64 | 32)) {
+ else if (t.flags & (128 | 64)) {
var b = getBaseTypeOfLiteralType(t);
if (typeIdenticalToSomeType(b, target.types)) {
(matchingTypes || (matchingTypes = [])).push(t, b);
@@ -32802,8 +33012,8 @@ var ts;
target = removeTypesFromUnionOrIntersection(target, matchingTypes);
}
}
- if (target.flags & 1081344) {
- if (source.flags & 67108864 || source === silentNeverType) {
+ if (target.flags & 2162688) {
+ if (source.flags & 536870912 || source === silentNeverType) {
return;
}
var inference = getInferenceInfoForType(target);
@@ -32823,7 +33033,7 @@ var ts;
inference.candidates = ts.append(inference.candidates, candidate);
}
}
- if (!(priority & 8) && target.flags & 32768 && !isTypeParameterAtTopLevel(originalTarget, target)) {
+ if (!(priority & 8) && target.flags & 65536 && !isTypeParameterAtTopLevel(originalTarget, target)) {
inference.topLevel = false;
}
}
@@ -32844,12 +33054,12 @@ var ts;
}
}
}
- else if (source.flags & 524288 && target.flags & 524288) {
+ else if (source.flags & 1048576 && target.flags & 1048576) {
contravariant = !contravariant;
inferFromTypes(source.type, target.type);
contravariant = !contravariant;
}
- else if ((isLiteralType(source) || source.flags & 2) && target.flags & 524288) {
+ else if ((isLiteralType(source) || source.flags & 4) && target.flags & 1048576) {
var empty = createEmptyObjectTypeFromStringLiteral(source);
contravariant = !contravariant;
var savePriority = priority;
@@ -32858,17 +33068,17 @@ var ts;
priority = savePriority;
contravariant = !contravariant;
}
- else if (source.flags & 1048576 && target.flags & 1048576) {
+ else if (source.flags & 2097152 && target.flags & 2097152) {
inferFromTypes(source.objectType, target.objectType);
inferFromTypes(source.indexType, target.indexType);
}
- else if (source.flags & 2097152 && target.flags & 2097152) {
+ else if (source.flags & 4194304 && target.flags & 4194304) {
inferFromTypes(source.checkType, target.checkType);
inferFromTypes(source.extendsType, target.extendsType);
inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target));
inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target));
}
- else if (target.flags & 393216) {
+ else if (target.flags & 786432) {
var targetTypes = target.types;
var typeVariableCount = 0;
var typeVariable = void 0;
@@ -32889,7 +33099,7 @@ var ts;
priority = savePriority;
}
}
- else if (source.flags & 131072) {
+ else if (source.flags & 262144) {
var sourceTypes = source.types;
for (var _e = 0, sourceTypes_3 = sourceTypes; _e < sourceTypes_3.length; _e++) {
var sourceType = sourceTypes_3[_e];
@@ -32897,16 +33107,16 @@ var ts;
}
}
else {
- if (!(priority & 32 && source.flags & (262144 | 7897088))) {
+ if (!(priority & 32 && source.flags & (524288 | 15794176))) {
source = getApparentType(source);
}
- if (source.flags & (65536 | 262144)) {
+ if (source.flags & (131072 | 524288)) {
var key = source.id + "," + target.id;
if (visited && visited.get(key)) {
return;
}
(visited || (visited = ts.createMap())).set(key, true);
- var isNonConstructorObject = target.flags & 65536 &&
+ var isNonConstructorObject = target.flags & 131072 &&
!(ts.getObjectFlags(target) & 16 && target.symbol && target.symbol.flags & 32);
var symbol = isNonConstructorObject ? target.symbol : undefined;
if (symbol) {
@@ -32934,7 +33144,7 @@ var ts;
}
}
function getInferenceInfoForType(type) {
- if (type.flags & 1081344) {
+ if (type.flags & 2162688) {
for (var _i = 0, inferences_1 = inferences; _i < inferences_1.length; _i++) {
var inference = inferences_1[_i];
if (type === inference.typeParameter) {
@@ -32951,7 +33161,7 @@ var ts;
}
if (ts.getObjectFlags(target) & 32) {
var constraintType = getConstraintTypeFromMappedType(target);
- if (constraintType.flags & 524288) {
+ if (constraintType.flags & 1048576) {
var inference = getInferenceInfoForType(constraintType.type);
if (inference && !inference.isFixed) {
var inferredType = inferTypeForHomomorphicMappedType(source, target);
@@ -32964,7 +33174,7 @@ var ts;
}
return;
}
- if (constraintType.flags & 32768) {
+ if (constraintType.flags & 65536) {
var savePriority = priority;
priority |= 4;
inferFromTypes(getIndexType(source), constraintType);
@@ -33048,11 +33258,11 @@ var ts;
reducedTypes.push(t);
}
}
- return type.flags & 131072 ? getUnionType(reducedTypes) : getIntersectionType(reducedTypes);
+ return type.flags & 262144 ? getUnionType(reducedTypes) : getIntersectionType(reducedTypes);
}
function hasPrimitiveConstraint(type) {
var constraint = getConstraintOfTypeParameter(type);
- return constraint && maybeTypeOfKind(constraint, 16382 | 524288);
+ return !!constraint && maybeTypeOfKind(constraint, 32764 | 1048576);
}
function isObjectLiteralType(type) {
return !!(ts.getObjectFlags(type) & 128);
@@ -33072,10 +33282,12 @@ var ts;
}
function getCovariantInference(inference, context, signature) {
var candidates = widenObjectLiteralCandidates(inference.candidates);
- var widenLiteralTypes = inference.topLevel &&
- !hasPrimitiveConstraint(inference.typeParameter) &&
+ var primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter);
+ var widenLiteralTypes = !primitiveConstraint && inference.topLevel &&
(inference.isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), inference.typeParameter));
- var baseCandidates = widenLiteralTypes ? ts.sameMap(candidates, getWidenedLiteralType) : candidates;
+ var baseCandidates = primitiveConstraint ? ts.sameMap(candidates, getRegularTypeOfLiteralType) :
+ widenLiteralTypes ? ts.sameMap(candidates, getWidenedLiteralType) :
+ candidates;
var unwidenedType = context.flags & 1 || inference.priority & 28 ?
getUnionType(baseCandidates, 2) :
getCommonSupertype(baseCandidates);
@@ -33089,7 +33301,7 @@ var ts;
if (signature) {
if (inference.candidates) {
inferredType = getCovariantInference(inference, context, signature);
- if (inferredType.flags & 16384 && inference.contraCandidates) {
+ if (inferredType.flags & 32768 && inference.contraCandidates) {
inferredType = getContravariantInference(inference);
}
}
@@ -33142,7 +33354,7 @@ var ts;
return links.resolvedSymbol;
}
function isInTypeQuery(node) {
- return !!ts.findAncestor(node, function (n) { return n.kind === 164 ? true : n.kind === 71 || n.kind === 145 ? false : "quit"; });
+ return !!ts.findAncestor(node, function (n) { return n.kind === 165 ? true : n.kind === 71 || n.kind === 146 ? false : "quit"; });
}
function getFlowCacheKey(node) {
if (node.kind === 71) {
@@ -33152,13 +33364,13 @@ var ts;
if (node.kind === 99) {
return "0";
}
- if (node.kind === 184) {
+ if (node.kind === 185) {
var key = getFlowCacheKey(node.expression);
return key && key + "." + ts.idText(node.name);
}
- if (node.kind === 181) {
+ if (node.kind === 182) {
var container = node.parent.parent;
- var key = container.kind === 181 ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer));
+ var key = container.kind === 182 ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer));
var text = getBindingElementNameText(node);
var result = key && text && (key + "." + text);
return result;
@@ -33166,12 +33378,13 @@ var ts;
return undefined;
}
function getBindingElementNameText(element) {
- if (element.parent.kind === 179) {
+ var parent = element.parent;
+ if (parent.kind === 180) {
var name = element.propertyName || element.name;
switch (name.kind) {
case 71:
return ts.idText(name);
- case 146:
+ case 147:
return ts.isStringOrNumericLiteral(name.expression) ? name.expression.text : undefined;
case 9:
case 8:
@@ -33181,41 +33394,41 @@ var ts;
}
}
else {
- return "" + element.parent.elements.indexOf(element);
+ return "" + parent.elements.indexOf(element);
}
}
function isMatchingReference(source, target) {
switch (source.kind) {
case 71:
return target.kind === 71 && getResolvedSymbol(source) === getResolvedSymbol(target) ||
- (target.kind === 231 || target.kind === 181) &&
+ (target.kind === 232 || target.kind === 182) &&
getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target);
case 99:
return target.kind === 99;
case 97:
return target.kind === 97;
- case 184:
- return target.kind === 184 &&
+ case 185:
+ return target.kind === 185 &&
source.name.escapedText === target.name.escapedText &&
isMatchingReference(source.expression, target.expression);
- case 181:
- if (target.kind !== 184)
+ case 182:
+ if (target.kind !== 185)
return false;
var t = target;
if (t.name.escapedText !== getBindingElementNameText(source))
return false;
- if (source.parent.parent.kind === 181 && isMatchingReference(source.parent.parent, t.expression)) {
+ if (source.parent.parent.kind === 182 && isMatchingReference(source.parent.parent, t.expression)) {
return true;
}
- if (source.parent.parent.kind === 231) {
+ if (source.parent.parent.kind === 232) {
var maybeId = source.parent.parent.initializer;
- return maybeId && isMatchingReference(maybeId, t.expression);
+ return !!maybeId && isMatchingReference(maybeId, t.expression);
}
}
return false;
}
function containsMatchingReference(source, target) {
- while (source.kind === 184) {
+ while (source.kind === 185) {
source = source.expression;
if (isMatchingReference(source, target)) {
return true;
@@ -33224,7 +33437,7 @@ var ts;
return false;
}
function containsMatchingReferenceDiscriminant(source, target) {
- return target.kind === 184 &&
+ return target.kind === 185 &&
containsMatchingReference(source, target.expression) &&
isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.escapedText);
}
@@ -33232,18 +33445,18 @@ var ts;
if (expr.kind === 71) {
return getTypeOfSymbol(getResolvedSymbol(expr));
}
- if (expr.kind === 184) {
+ if (expr.kind === 185) {
var type = getDeclaredTypeOfReference(expr.expression);
return type && getTypeOfPropertyOfType(type, expr.name.escapedText);
}
return undefined;
}
function isDiscriminantProperty(type, name) {
- if (type && type.flags & 131072) {
+ if (type && type.flags & 262144) {
var prop = getUnionOrIntersectionProperty(type, name);
if (prop && ts.getCheckFlags(prop) & 2) {
if (prop.isDiscriminantProperty === undefined) {
- prop.isDiscriminantProperty = prop.checkFlags & 32 && isLiteralType(getTypeOfSymbol(prop));
+ prop.isDiscriminantProperty = !!(prop.checkFlags & 32) && isLiteralType(getTypeOfSymbol(prop));
}
return prop.isDiscriminantProperty;
}
@@ -33276,7 +33489,7 @@ var ts;
}
}
}
- if (callExpression.expression.kind === 184 &&
+ if (callExpression.expression.kind === 185 &&
isOrContainsMatchingReference(reference, callExpression.expression.expression)) {
return true;
}
@@ -33290,7 +33503,7 @@ var ts;
return flow.id;
}
function typeMaybeAssignableTo(source, target) {
- if (!(source.flags & 131072)) {
+ if (!(source.flags & 262144)) {
return isTypeAssignableTo(source, target);
}
for (var _i = 0, _a = source.types; _i < _a.length; _i++) {
@@ -33303,11 +33516,11 @@ var ts;
}
function getAssignmentReducedType(declaredType, assignedType) {
if (declaredType !== assignedType) {
- if (assignedType.flags & 16384) {
+ if (assignedType.flags & 32768) {
return assignedType;
}
var reducedType = filterType(declaredType, function (t) { return typeMaybeAssignableTo(assignedType, t); });
- if (!(reducedType.flags & 16384)) {
+ if (!(reducedType.flags & 32768)) {
return reducedType;
}
}
@@ -33328,53 +33541,53 @@ var ts;
}
function getTypeFacts(type) {
var flags = type.flags;
- if (flags & 2) {
+ if (flags & 4) {
return strictNullChecks ? 4079361 : 4194049;
}
- if (flags & 32) {
+ if (flags & 64) {
var isEmpty = type.value === "";
return strictNullChecks ?
isEmpty ? 3030785 : 1982209 :
isEmpty ? 3145473 : 4194049;
}
- if (flags & (4 | 16)) {
+ if (flags & (8 | 32)) {
return strictNullChecks ? 4079234 : 4193922;
}
- if (flags & 64) {
+ if (flags & 128) {
var isZero = type.value === 0;
return strictNullChecks ?
isZero ? 3030658 : 1982082 :
isZero ? 3145346 : 4193922;
}
- if (flags & 8) {
+ if (flags & 16) {
return strictNullChecks ? 4078980 : 4193668;
}
- if (flags & 136) {
+ if (flags & 272) {
return strictNullChecks ?
type === falseType ? 3030404 : 1981828 :
type === falseType ? 3145092 : 4193668;
}
- if (flags & 65536) {
+ if (flags & 131072) {
return isFunctionObjectType(type) ?
strictNullChecks ? 1970144 : 4181984 :
strictNullChecks ? 1972176 : 4184016;
}
- if (flags & (2048 | 4096)) {
+ if (flags & (4096 | 8192)) {
return 2457472;
}
- if (flags & 8192) {
+ if (flags & 16384) {
return 2340752;
}
- if (flags & 1536) {
+ if (flags & 3072) {
return strictNullChecks ? 1981320 : 4193160;
}
- if (flags & 134217728) {
+ if (flags & 16777216) {
return strictNullChecks ? 1972176 : 4184016;
}
- if (flags & 7897088) {
+ if (flags & 15794176) {
return getTypeFacts(getBaseConstraintOfType(type) || emptyObjectType);
}
- if (flags & 393216) {
+ if (flags & 786432) {
return getTypeFactsOfTypes(type.types);
}
return 4194303;
@@ -33394,26 +33607,26 @@ var ts;
return getConstraintForLocation(getTypeOfPropertyOfType(type, text), name) ||
isNumericLiteralName(text) && getIndexTypeOfType(type, 1) ||
getIndexTypeOfType(type, 0) ||
- unknownType;
+ errorType;
}
function getTypeOfDestructuredArrayElement(type, index) {
return isTupleLikeType(type) && getTypeOfPropertyOfType(type, "" + index) ||
checkIteratedTypeOrElementType(type, undefined, false, false) ||
- unknownType;
+ errorType;
}
function getTypeOfDestructuredSpreadExpression(type) {
- return createArrayType(checkIteratedTypeOrElementType(type, undefined, false, false) || unknownType);
+ return createArrayType(checkIteratedTypeOrElementType(type, undefined, false, false) || errorType);
}
function getAssignedTypeOfBinaryExpression(node) {
- var isDestructuringDefaultAssignment = node.parent.kind === 182 && isDestructuringAssignmentTarget(node.parent) ||
- node.parent.kind === 269 && isDestructuringAssignmentTarget(node.parent.parent);
+ var isDestructuringDefaultAssignment = node.parent.kind === 183 && isDestructuringAssignmentTarget(node.parent) ||
+ node.parent.kind === 270 && isDestructuringAssignmentTarget(node.parent.parent);
return isDestructuringDefaultAssignment ?
getTypeWithDefault(getAssignedType(node), node.right) :
getTypeOfExpression(node.right);
}
function isDestructuringAssignmentTarget(parent) {
- return parent.parent.kind === 199 && parent.parent.left === parent ||
- parent.parent.kind === 221 && parent.parent.initializer === parent;
+ return parent.parent.kind === 200 && parent.parent.left === parent ||
+ parent.parent.kind === 222 && parent.parent.initializer === parent;
}
function getAssignedTypeOfArrayLiteralElement(node, element) {
return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element));
@@ -33430,29 +33643,29 @@ var ts;
function getAssignedType(node) {
var parent = node.parent;
switch (parent.kind) {
- case 220:
- return stringType;
case 221:
- return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || unknownType;
- case 199:
+ return stringType;
+ case 222:
+ return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || errorType;
+ case 200:
return getAssignedTypeOfBinaryExpression(parent);
- case 193:
+ case 194:
return undefinedType;
- case 182:
+ case 183:
return getAssignedTypeOfArrayLiteralElement(parent, node);
- case 203:
+ case 204:
return getAssignedTypeOfSpreadExpression(parent);
- case 269:
- return getAssignedTypeOfPropertyAssignment(parent);
case 270:
+ return getAssignedTypeOfPropertyAssignment(parent);
+ case 271:
return getAssignedTypeOfShorthandPropertyAssignment(parent);
}
- return unknownType;
+ return errorType;
}
function getInitialTypeOfBindingElement(node) {
var pattern = node.parent;
var parentType = getInitialType(pattern.parent);
- var type = pattern.kind === 179 ?
+ var type = pattern.kind === 180 ?
getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) :
!node.dotDotDotToken ?
getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) :
@@ -33467,35 +33680,35 @@ var ts;
if (node.initializer) {
return getTypeOfInitializer(node.initializer);
}
- if (node.parent.parent.kind === 220) {
+ if (node.parent.parent.kind === 221) {
return stringType;
}
- if (node.parent.parent.kind === 221) {
- return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || unknownType;
+ if (node.parent.parent.kind === 222) {
+ return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || errorType;
}
- return unknownType;
+ return errorType;
}
function getInitialType(node) {
- return node.kind === 231 ?
+ return node.kind === 232 ?
getInitialTypeOfVariableDeclaration(node) :
getInitialTypeOfBindingElement(node);
}
function getInitialOrAssignedType(node) {
- return node.kind === 231 || node.kind === 181 ?
+ return node.kind === 232 || node.kind === 182 ?
getInitialType(node) :
getAssignedType(node);
}
function isEmptyArrayAssignment(node) {
- return node.kind === 231 && node.initializer &&
+ return node.kind === 232 && node.initializer &&
isEmptyArrayLiteral(node.initializer) ||
- node.kind !== 181 && node.parent.kind === 199 &&
+ node.kind !== 182 && node.parent.kind === 200 &&
isEmptyArrayLiteral(node.parent.right);
}
function getReferenceCandidate(node) {
switch (node.kind) {
- case 190:
+ case 191:
return getReferenceCandidate(node.expression);
- case 199:
+ case 200:
switch (node.operatorToken.kind) {
case 58:
return getReferenceCandidate(node.left);
@@ -33507,13 +33720,13 @@ var ts;
}
function getReferenceRoot(node) {
var parent = node.parent;
- return parent.kind === 190 ||
- parent.kind === 199 && parent.operatorToken.kind === 58 && parent.left === node ||
- parent.kind === 199 && parent.operatorToken.kind === 26 && parent.right === node ?
+ return parent.kind === 191 ||
+ parent.kind === 200 && parent.operatorToken.kind === 58 && parent.left === node ||
+ parent.kind === 200 && parent.operatorToken.kind === 26 && parent.right === node ?
getReferenceRoot(parent) : node;
}
function getTypeOfSwitchClause(clause) {
- if (clause.kind === 265) {
+ if (clause.kind === 266) {
return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression));
}
return neverType;
@@ -33530,13 +33743,13 @@ var ts;
return links.switchTypes;
}
function eachTypeContainedIn(source, types) {
- return source.flags & 131072 ? !ts.forEach(source.types, function (t) { return !ts.contains(types, t); }) : ts.contains(types, source);
+ return source.flags & 262144 ? !ts.forEach(source.types, function (t) { return !ts.contains(types, t); }) : ts.contains(types, source);
}
function isTypeSubsetOf(source, target) {
- return source === target || target.flags & 131072 && isTypeSubsetOfUnion(source, target);
+ return source === target || target.flags & 262144 && isTypeSubsetOfUnion(source, target);
}
function isTypeSubsetOfUnion(source, target) {
- if (source.flags & 131072) {
+ if (source.flags & 262144) {
for (var _i = 0, _a = source.types; _i < _a.length; _i++) {
var t = _a[_i];
if (!containsType(target.types, t)) {
@@ -33545,27 +33758,27 @@ var ts;
}
return true;
}
- if (source.flags & 256 && getBaseTypeOfEnumLiteralType(source) === target) {
+ if (source.flags & 512 && getBaseTypeOfEnumLiteralType(source) === target) {
return true;
}
return containsType(target.types, source);
}
function forEachType(type, f) {
- return type.flags & 131072 ? ts.forEach(type.types, f) : f(type);
+ return type.flags & 262144 ? ts.forEach(type.types, f) : f(type);
}
function filterType(type, f) {
- if (type.flags & 131072) {
+ if (type.flags & 262144) {
var types = type.types;
var filtered = ts.filter(types, f);
- return filtered === types ? type : getUnionTypeFromSortedList(filtered, type.flags & 268435456);
+ return filtered === types ? type : getUnionTypeFromSortedList(filtered, type.flags & 67108864);
}
return f(type) ? type : neverType;
}
function mapType(type, mapper, noReductions) {
- if (type.flags & 16384) {
+ if (type.flags & 32768) {
return type;
}
- if (!(type.flags & 131072)) {
+ if (!(type.flags & 262144)) {
return mapper(type);
}
var types = type.types;
@@ -33592,11 +33805,11 @@ var ts;
return filterType(type, function (t) { return (t.flags & kind) !== 0; });
}
function replacePrimitivesWithLiterals(typeWithPrimitives, typeWithLiterals) {
- if (isTypeSubsetOf(stringType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 32) ||
- isTypeSubsetOf(numberType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 64)) {
+ if (isTypeSubsetOf(stringType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 64) ||
+ isTypeSubsetOf(numberType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 128)) {
return mapType(typeWithPrimitives, function (t) {
- return t.flags & 2 ? extractTypesOfKind(typeWithLiterals, 2 | 32) :
- t.flags & 4 ? extractTypesOfKind(typeWithLiterals, 4 | 64) :
+ return t.flags & 4 ? extractTypesOfKind(typeWithLiterals, 4 | 64) :
+ t.flags & 8 ? extractTypesOfKind(typeWithLiterals, 8 | 128) :
t;
});
}
@@ -33624,9 +33837,9 @@ var ts;
return isTypeSubsetOf(elementType, evolvingArrayType.elementType) ? evolvingArrayType : getEvolvingArrayType(getUnionType([evolvingArrayType.elementType, elementType]));
}
function createFinalArrayType(elementType) {
- return elementType.flags & 16384 ?
+ return elementType.flags & 32768 ?
autoArrayType :
- createArrayType(elementType.flags & 131072 ?
+ createArrayType(elementType.flags & 262144 ?
getUnionType(elementType.types, 2) :
elementType);
}
@@ -33643,7 +33856,7 @@ var ts;
var hasEvolvingArrayType = false;
for (var _i = 0, types_14 = types; _i < types_14.length; _i++) {
var t = types_14[_i];
- if (!(t.flags & 16384)) {
+ if (!(t.flags & 32768)) {
if (!(ts.getObjectFlags(t) & 256)) {
return false;
}
@@ -33660,15 +33873,15 @@ var ts;
function isEvolvingArrayOperationTarget(node) {
var root = getReferenceRoot(node);
var parent = root.parent;
- var isLengthPushOrUnshift = parent.kind === 184 && (parent.name.escapedText === "length" ||
- parent.parent.kind === 186 && ts.isPushOrUnshiftIdentifier(parent.name));
- var isElementAssignment = parent.kind === 185 &&
+ var isLengthPushOrUnshift = parent.kind === 185 && (parent.name.escapedText === "length" ||
+ parent.parent.kind === 187 && ts.isPushOrUnshiftIdentifier(parent.name));
+ var isElementAssignment = parent.kind === 186 &&
parent.expression === root &&
- parent.parent.kind === 199 &&
+ parent.parent.kind === 200 &&
parent.parent.operatorToken.kind === 58 &&
parent.parent.left === parent &&
!ts.isAssignmentTarget(parent.parent) &&
- isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 84);
+ isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 168);
return isLengthPushOrUnshift || isElementAssignment;
}
function maybeTypePredicateCall(node) {
@@ -33683,7 +33896,7 @@ var ts;
var funcType = checkNonNullExpression(node.expression);
if (funcType !== silentNeverType) {
var apparentType = getApparentType(funcType);
- return apparentType !== unknownType && ts.some(getSignaturesOfType(apparentType, 0), signatureHasTypePredicate);
+ return apparentType !== errorType && ts.some(getSignaturesOfType(apparentType, 0), signatureHasTypePredicate);
}
}
return false;
@@ -33699,16 +33912,16 @@ var ts;
var key;
var flowDepth = 0;
if (flowAnalysisDisabled) {
- return unknownType;
+ return errorType;
}
- if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 142575359)) {
+ if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 33492479)) {
return declaredType;
}
var sharedFlowStart = sharedFlowCount;
var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode));
sharedFlowCount = sharedFlowStart;
var resultType = ts.getObjectFlags(evolvedType) & 256 && isEvolvingArrayOperationTarget(reference) ? anyArrayType : finalizeEvolvingArrayType(evolvedType);
- if (reference.parent && reference.parent.kind === 208 && getTypeWithFacts(resultType, 524288).flags & 16384) {
+ if (reference.parent && reference.parent.kind === 209 && getTypeWithFacts(resultType, 524288).flags & 32768) {
return declaredType;
}
return resultType;
@@ -33716,7 +33929,7 @@ var ts;
if (flowDepth === 2500) {
flowAnalysisDisabled = true;
reportFlowControlError(reference);
- return unknownType;
+ return errorType;
}
flowDepth++;
while (true) {
@@ -33770,7 +33983,7 @@ var ts;
}
else if (flags & 2) {
var container = flow.container;
- if (container && container !== flowContainer && reference.kind !== 184 && reference.kind !== 99) {
+ if (container && container !== flowContainer && reference.kind !== 185 && reference.kind !== 99) {
flow = container.flowNode;
continue;
}
@@ -33802,7 +34015,7 @@ var ts;
var assignedType = getBaseTypeOfLiteralType(getInitialOrAssignedType(node));
return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType;
}
- if (declaredType.flags & 131072) {
+ if (declaredType.flags & 262144) {
return getAssignmentReducedType(declaredType, getInitialOrAssignedType(node));
}
return declaredType;
@@ -33815,7 +34028,7 @@ var ts;
function getTypeAtFlowArrayMutation(flow) {
if (declaredType === autoType || declaredType === autoArrayType) {
var node = flow.node;
- var expr = node.kind === 186 ?
+ var expr = node.kind === 187 ?
node.expression.expression :
node.left.expression;
if (isMatchingReference(reference, getReferenceCandidate(expr))) {
@@ -33823,7 +34036,7 @@ var ts;
var type = getTypeFromFlowType(flowType);
if (ts.getObjectFlags(type) & 256) {
var evolvedType_1 = type;
- if (node.kind === 186) {
+ if (node.kind === 187) {
for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) {
var arg = _a[_i];
evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg);
@@ -33831,7 +34044,7 @@ var ts;
}
else {
var indexType = getTypeOfExpression(node.left.argumentExpression);
- if (isTypeAssignableToKind(indexType, 84)) {
+ if (isTypeAssignableToKind(indexType, 168)) {
evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, node.right);
}
}
@@ -33845,7 +34058,7 @@ var ts;
function getTypeAtFlowCondition(flow) {
var flowType = getTypeAtFlowNode(flow.antecedent);
var type = getTypeFromFlowType(flowType);
- if (type.flags & 16384) {
+ if (type.flags & 32768) {
return flowType;
}
var assumeTrue = (flow.flags & 32) !== 0;
@@ -33855,7 +34068,7 @@ var ts;
return flowType;
}
var incomplete = isIncomplete(flowType);
- var resultType = incomplete && narrowedType.flags & 16384 ? silentNeverType : narrowedType;
+ var resultType = incomplete && narrowedType.flags & 32768 ? silentNeverType : narrowedType;
return createFlowType(resultType, incomplete);
}
function getTypeAtSwitchClause(flow) {
@@ -33947,8 +34160,8 @@ var ts;
return result;
}
function isMatchingReferenceDiscriminant(expr, computedType) {
- return expr.kind === 184 &&
- computedType.flags & 131072 &&
+ return expr.kind === 185 &&
+ computedType.flags & 262144 &&
isMatchingReference(reference, expr.expression) &&
isDiscriminantProperty(computedType, expr.name.escapedText);
}
@@ -33981,7 +34194,7 @@ var ts;
return !assumeTrue;
}
function narrowByInKeyword(type, literal, assumeTrue) {
- if ((type.flags & (131072 | 65536)) || (type.flags & 32768 && type.isThisType)) {
+ if ((type.flags & (262144 | 131072)) || (type.flags & 65536 && type.isThisType)) {
var propName_1 = ts.escapeLeadingUnderscores(literal.text);
return filterType(type, function (t) { return isTypePresencePossible(t, propName_1, assumeTrue); });
}
@@ -33998,10 +34211,10 @@ var ts;
var operator_1 = expr.operatorToken.kind;
var left_1 = getReferenceCandidate(expr.left);
var right_1 = getReferenceCandidate(expr.right);
- if (left_1.kind === 194 && ts.isStringLiteralLike(right_1)) {
+ if (left_1.kind === 195 && ts.isStringLiteralLike(right_1)) {
return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue);
}
- if (right_1.kind === 194 && ts.isStringLiteralLike(left_1)) {
+ if (right_1.kind === 195 && ts.isStringLiteralLike(left_1)) {
return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue);
}
if (isMatchingReference(reference, left_1)) {
@@ -34041,24 +34254,24 @@ var ts;
assumeTrue = !assumeTrue;
}
var valueType = getTypeOfExpression(value);
- if (valueType.flags & 12288) {
+ if (valueType.flags & 24576) {
if (!strictNullChecks) {
return type;
}
var doubleEquals = operator === 32 || operator === 33;
var facts = doubleEquals ?
assumeTrue ? 65536 : 524288 :
- valueType.flags & 8192 ?
+ valueType.flags & 16384 ?
assumeTrue ? 32768 : 262144 :
assumeTrue ? 16384 : 131072;
return getTypeWithFacts(type, facts);
}
- if (type.flags & 134283777) {
+ if (type.flags & 16909315) {
return type;
}
if (assumeTrue) {
var narrowedType = filterType(type, function (t) { return areTypesComparable(t, valueType); });
- return narrowedType.flags & 16384 ? type : replacePrimitivesWithLiterals(narrowedType, valueType);
+ return narrowedType.flags & 32768 ? type : replacePrimitivesWithLiterals(narrowedType, valueType);
}
if (isUnitType(valueType)) {
var regularType_1 = getRegularTypeOfLiteralType(valueType);
@@ -34077,13 +34290,16 @@ var ts;
if (operator === 33 || operator === 35) {
assumeTrue = !assumeTrue;
}
- if (assumeTrue && !(type.flags & 131072)) {
- var targetType = typeofTypesByName.get(literal.text);
+ if (type.flags & 1 && literal.text === "function") {
+ return type;
+ }
+ if (assumeTrue && !(type.flags & 262144)) {
+ var targetType = literal.text === "function" ? globalFunctionType : typeofTypesByName.get(literal.text);
if (targetType) {
if (isTypeSubtypeOf(targetType, type)) {
return targetType;
}
- if (type.flags & 7897088) {
+ if (type.flags & 15794176) {
var constraint = getBaseConstraintOfType(type) || anyType;
if (isTypeSubtypeOf(targetType, constraint)) {
return getIntersectionType([type, targetType]);
@@ -34104,13 +34320,13 @@ var ts;
var clauseTypes = switchTypes.slice(clauseStart, clauseEnd);
var hasDefaultClause = clauseStart === clauseEnd || ts.contains(clauseTypes, neverType);
var discriminantType = getUnionType(clauseTypes);
- var caseType = discriminantType.flags & 16384 ? neverType :
+ var caseType = discriminantType.flags & 32768 ? neverType :
replacePrimitivesWithLiterals(filterType(type, function (t) { return areTypesComparable(discriminantType, t); }), discriminantType);
if (!hasDefaultClause) {
return caseType;
}
var defaultType = filterType(type, function (t) { return !(isUnitType(t) && ts.contains(switchTypes, getRegularTypeOfLiteralType(t))); });
- return caseType.flags & 16384 ? defaultType : getUnionType([caseType, defaultType]);
+ return caseType.flags & 32768 ? defaultType : getUnionType([caseType, defaultType]);
}
function narrowTypeByInstanceof(type, expr, assumeTrue) {
var left = getReferenceCandidate(expr.left);
@@ -34156,9 +34372,9 @@ var ts;
if (!assumeTrue) {
return filterType(type, function (t) { return !isRelated(t, candidate); });
}
- if (type.flags & 131072) {
+ if (type.flags & 262144) {
var assignableType = filterType(type, function (t) { return isRelated(t, candidate); });
- if (!(assignableType.flags & 16384)) {
+ if (!(assignableType.flags & 32768)) {
return assignableType;
}
}
@@ -34192,7 +34408,7 @@ var ts;
}
else {
var invokedExpression = ts.skipParentheses(callExpression.expression);
- if (invokedExpression.kind === 185 || invokedExpression.kind === 184) {
+ if (invokedExpression.kind === 186 || invokedExpression.kind === 185) {
var accessExpression = invokedExpression;
var possibleReference = ts.skipParentheses(accessExpression.expression);
if (isMatchingReference(reference, possibleReference)) {
@@ -34210,15 +34426,15 @@ var ts;
case 71:
case 99:
case 97:
- case 184:
+ case 185:
return narrowTypeByTruthiness(type, expr, assumeTrue);
- case 186:
+ case 187:
return narrowTypeByTypePredicate(type, expr, assumeTrue);
- case 190:
+ case 191:
return narrowType(type, expr.expression, assumeTrue);
- case 199:
+ case 200:
return narrowTypeByBinaryExpression(type, expr, assumeTrue);
- case 197:
+ case 198:
if (expr.operator === 51) {
return narrowType(type, expr.operand, !assumeTrue);
}
@@ -34245,9 +34461,9 @@ var ts;
function getControlFlowContainer(node) {
return ts.findAncestor(node.parent, function (node) {
return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) ||
- node.kind === 239 ||
- node.kind === 273 ||
- node.kind === 151;
+ node.kind === 240 ||
+ node.kind === 274 ||
+ node.kind === 152;
});
}
function isParameterAssigned(symbol) {
@@ -34268,7 +34484,7 @@ var ts;
if (node.kind === 71) {
if (ts.isAssignmentTarget(node)) {
var symbol = getResolvedSymbol(node);
- if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 148) {
+ if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 149) {
symbol.isAssigned = true;
}
}
@@ -34282,21 +34498,21 @@ var ts;
}
function removeOptionalityFromDeclaredType(declaredType, declaration) {
var annotationIncludesUndefined = strictNullChecks &&
- declaration.kind === 148 &&
+ declaration.kind === 149 &&
declaration.initializer &&
- getFalsyFlags(declaredType) & 4096 &&
- !(getFalsyFlags(checkExpression(declaration.initializer)) & 4096);
+ getFalsyFlags(declaredType) & 8192 &&
+ !(getFalsyFlags(checkExpression(declaration.initializer)) & 8192);
return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 131072) : declaredType;
}
function isConstraintPosition(node) {
var parent = node.parent;
- return parent.kind === 184 ||
+ return parent.kind === 185 ||
+ parent.kind === 187 && parent.expression === node ||
parent.kind === 186 && parent.expression === node ||
- parent.kind === 185 && parent.expression === node ||
- parent.kind === 181 && parent.name === node && !!parent.initializer;
+ parent.kind === 182 && parent.name === node && !!parent.initializer;
}
function typeHasNullableConstraint(type) {
- return type.flags & 7372800 && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 12288);
+ return type.flags & 14745600 && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 24576);
}
function getConstraintForLocation(type, node) {
if (type && isConstraintPosition(node) && forEachType(type, typeHasNullableConstraint)) {
@@ -34312,12 +34528,12 @@ var ts;
function checkIdentifier(node) {
var symbol = getResolvedSymbol(node);
if (symbol === unknownSymbol) {
- return unknownType;
+ return errorType;
}
if (symbol === argumentsSymbol) {
var container = ts.getContainingFunction(node);
if (languageVersion < 2) {
- if (container.kind === 192) {
+ if (container.kind === 193) {
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)) {
@@ -34333,7 +34549,7 @@ var ts;
var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
var declaration = localOrExportSymbol.valueDeclaration;
if (localOrExportSymbol.flags & 32) {
- if (declaration.kind === 234
+ if (declaration.kind === 235
&& ts.nodeIsDecorated(declaration)) {
var container = ts.getContainingClass(node);
while (container !== undefined) {
@@ -34345,11 +34561,11 @@ var ts;
container = ts.getContainingClass(container);
}
}
- else if (declaration.kind === 204) {
+ else if (declaration.kind === 205) {
var container = ts.getThisContainer(node, false);
- while (container !== undefined) {
+ while (container.kind !== 274) {
if (container.parent === declaration) {
- if (container.kind === 151 && ts.hasModifier(container, 32)) {
+ if (container.kind === 152 && ts.hasModifier(container, 32)) {
getNodeLinks(declaration).flags |= 8388608;
getNodeLinks(node).flags |= 16777216;
}
@@ -34366,11 +34582,11 @@ var ts;
if (!(localOrExportSymbol.flags & 3) &&
!(ts.isInJavaScriptFile(node) && localOrExportSymbol.flags & 512)) {
error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_not_a_variable, symbolToString(symbol));
- return unknownType;
+ return errorType;
}
if (isReadonlySymbol(localOrExportSymbol)) {
error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(symbol));
- return unknownType;
+ return errorType;
}
}
var isAlias = localOrExportSymbol.flags & 2097152;
@@ -34388,21 +34604,21 @@ var ts;
if (!declaration) {
return type;
}
- var isParameter = ts.getRootDeclaration(declaration).kind === 148;
+ var isParameter = ts.getRootDeclaration(declaration).kind === 149;
var declarationContainer = getControlFlowContainer(declaration);
var flowContainer = getControlFlowContainer(node);
var isOuterVariable = flowContainer !== declarationContainer;
var isSpreadDestructuringAsignmentTarget = node.parent && node.parent.parent && ts.isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent);
- while (flowContainer !== declarationContainer && (flowContainer.kind === 191 ||
- flowContainer.kind === 192 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) &&
+ while (flowContainer !== declarationContainer && (flowContainer.kind === 192 ||
+ flowContainer.kind === 193 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) &&
(isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) {
flowContainer = getControlFlowContainer(flowContainer);
}
var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAsignmentTarget ||
- type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1) !== 0 ||
- isInTypeQuery(node) || node.parent.kind === 251) ||
- node.parent.kind === 208 ||
- declaration.kind === 231 && declaration.exclamationToken ||
+ type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 3) !== 0 ||
+ isInTypeQuery(node) || node.parent.kind === 252) ||
+ node.parent.kind === 209 ||
+ declaration.kind === 232 && declaration.exclamationToken ||
declaration.flags & 4194304;
var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) :
type === autoType || type === autoArrayType ? undefinedType :
@@ -34417,7 +34633,7 @@ var ts;
return convertAutoToAny(flowType);
}
}
- else if (!assumeInitialized && !(getFalsyFlags(type) & 4096) && getFalsyFlags(flowType) & 4096) {
+ else if (!assumeInitialized && !(getFalsyFlags(type) & 8192) && getFalsyFlags(flowType) & 8192) {
error(node, ts.Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString(symbol));
return type;
}
@@ -34429,7 +34645,7 @@ var ts;
function checkNestedBlockScopedBinding(node, symbol) {
if (languageVersion >= 2 ||
(symbol.flags & (2 | 32)) === 0 ||
- symbol.valueDeclaration.parent.kind === 268) {
+ symbol.valueDeclaration.parent.kind === 269) {
return;
}
var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration);
@@ -34447,8 +34663,8 @@ var ts;
if (usedInFunction) {
getNodeLinks(current).flags |= 65536;
}
- if (container.kind === 219 &&
- ts.getAncestor(symbol.valueDeclaration, 232).parent === container &&
+ if (container.kind === 220 &&
+ ts.getAncestor(symbol.valueDeclaration, 233).parent === container &&
isAssignedInBodyOfForStatement(node, container)) {
getNodeLinks(symbol.valueDeclaration).flags |= 2097152;
}
@@ -34460,14 +34676,14 @@ var ts;
}
function isAssignedInBodyOfForStatement(node, container) {
var current = node;
- while (current.parent.kind === 190) {
+ while (current.parent.kind === 191) {
current = current.parent;
}
var isAssigned = false;
if (ts.isAssignmentTarget(current)) {
isAssigned = true;
}
- else if ((current.parent.kind === 197 || current.parent.kind === 198)) {
+ else if ((current.parent.kind === 198 || current.parent.kind === 199)) {
var expr = current.parent;
isAssigned = expr.operator === 43 || expr.operator === 44;
}
@@ -34478,7 +34694,7 @@ var ts;
}
function captureLexicalThis(node, container) {
getNodeLinks(node).flags |= 2;
- if (container.kind === 151 || container.kind === 154) {
+ if (container.kind === 152 || container.kind === 155) {
var classNode = container.parent;
getNodeLinks(classNode).flags |= 4;
}
@@ -34522,32 +34738,32 @@ var ts;
function checkThisExpression(node) {
var container = ts.getThisContainer(node, true);
var needToCaptureLexicalThis = false;
- if (container.kind === 154) {
+ if (container.kind === 155) {
checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class);
}
- if (container.kind === 192) {
+ if (container.kind === 193) {
container = ts.getThisContainer(container, false);
needToCaptureLexicalThis = (languageVersion < 2);
}
switch (container.kind) {
- case 238:
+ case 239:
error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body);
break;
- case 237:
+ case 238:
error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location);
break;
- case 154:
+ case 155:
if (isInConstructorArgumentInitializer(node, container)) {
error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments);
}
break;
+ case 152:
case 151:
- case 150:
if (ts.hasModifier(container, 32)) {
error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer);
}
break;
- case 146:
+ case 147:
error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name);
break;
}
@@ -34564,8 +34780,8 @@ var ts;
if (container === void 0) { container = ts.getThisContainer(node, false); }
if (ts.isFunctionLike(container) &&
(!isInParameterInitializerBeforeContainingFunction(node) || ts.getThisParameter(container))) {
- if (container.kind === 191 &&
- container.parent.kind === 199 &&
+ if (container.kind === 192 &&
+ container.parent.kind === 200 &&
ts.getSpecialPropertyAssignmentKind(container.parent) === 3) {
var className = container.parent
.left
@@ -34588,14 +34804,14 @@ var ts;
}
if (ts.isInJavaScriptFile(node)) {
var type = getTypeForThisExpressionFromJSDoc(container);
- if (type && type !== unknownType) {
+ if (type && type !== errorType) {
return getFlowTypeOfReference(node, type);
}
}
}
function getTypeForThisExpressionFromJSDoc(node) {
var jsdocType = ts.getJSDocType(node);
- if (jsdocType && jsdocType.kind === 283) {
+ if (jsdocType && jsdocType.kind === 284) {
var jsDocFunctionType = jsdocType;
if (jsDocFunctionType.parameters.length > 0 &&
jsDocFunctionType.parameters[0].name &&
@@ -34605,14 +34821,14 @@ var ts;
}
}
function isInConstructorArgumentInitializer(node, constructorDecl) {
- return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 148; });
+ return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 149; });
}
function checkSuperExpression(node) {
- var isCallExpression = node.parent.kind === 186 && node.parent.expression === node;
+ var isCallExpression = node.parent.kind === 187 && node.parent.expression === node;
var container = ts.getSuperContainer(node, true);
var needToCaptureLexicalThis = false;
if (!isCallExpression) {
- while (container && container.kind === 192) {
+ while (container && container.kind === 193) {
container = ts.getSuperContainer(container, true);
needToCaptureLexicalThis = languageVersion < 2;
}
@@ -34620,22 +34836,22 @@ var ts;
var canUseSuperExpression = isLegalUsageOfSuperExpression(container);
var nodeCheckFlag = 0;
if (!canUseSuperExpression) {
- var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 146; });
- if (current && current.kind === 146) {
+ var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 147; });
+ if (current && current.kind === 147) {
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 === 183)) {
+ else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 184)) {
error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions);
}
else {
error(node, ts.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class);
}
- return unknownType;
+ return errorType;
}
- if (!isCallExpression && container.kind === 154) {
+ if (!isCallExpression && container.kind === 155) {
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) {
@@ -34645,7 +34861,7 @@ var ts;
nodeCheckFlag = 256;
}
getNodeLinks(node).flags |= nodeCheckFlag;
- if (container.kind === 153 && ts.hasModifier(container, 256)) {
+ if (container.kind === 154 && ts.hasModifier(container, 256)) {
if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) {
getNodeLinks(container).flags |= 4096;
}
@@ -34656,10 +34872,10 @@ var ts;
if (needToCaptureLexicalThis) {
captureLexicalThis(node.parent, container);
}
- if (container.parent.kind === 183) {
+ if (container.parent.kind === 184) {
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 unknownType;
+ return errorType;
}
else {
return anyType;
@@ -34668,16 +34884,16 @@ var ts;
var classLikeDeclaration = container.parent;
if (!ts.getClassExtendsHeritageClauseElement(classLikeDeclaration)) {
error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class);
- return unknownType;
+ return errorType;
}
var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(classLikeDeclaration));
var baseClassType = classType && getBaseTypes(classType)[0];
if (!baseClassType) {
- return unknownType;
+ return errorType;
}
- if (container.kind === 154 && isInConstructorArgumentInitializer(node, container)) {
+ if (container.kind === 155 && isInConstructorArgumentInitializer(node, container)) {
error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments);
- return unknownType;
+ return errorType;
}
return nodeCheckFlag === 512
? getBaseConstructorTypeOfClass(classType)
@@ -34687,24 +34903,24 @@ var ts;
return false;
}
if (isCallExpression) {
- return container.kind === 154;
+ return container.kind === 155;
}
else {
- if (ts.isClassLike(container.parent) || container.parent.kind === 183) {
+ if (ts.isClassLike(container.parent) || container.parent.kind === 184) {
if (ts.hasModifier(container, 32)) {
- return container.kind === 153 ||
- container.kind === 152 ||
- container.kind === 155 ||
- container.kind === 156;
+ return container.kind === 154 ||
+ container.kind === 153 ||
+ container.kind === 156 ||
+ container.kind === 157;
}
else {
- return container.kind === 153 ||
- container.kind === 152 ||
- container.kind === 155 ||
+ return container.kind === 154 ||
+ container.kind === 153 ||
container.kind === 156 ||
+ container.kind === 157 ||
+ container.kind === 152 ||
container.kind === 151 ||
- container.kind === 150 ||
- container.kind === 154;
+ container.kind === 155;
}
}
}
@@ -34712,10 +34928,10 @@ var ts;
}
}
function getContainingObjectLiteral(func) {
- return (func.kind === 153 ||
- func.kind === 155 ||
- func.kind === 156) && func.parent.kind === 183 ? func.parent :
- func.kind === 191 && func.parent.kind === 269 ? func.parent.parent :
+ return (func.kind === 154 ||
+ func.kind === 156 ||
+ func.kind === 157) && func.parent.kind === 184 ? func.parent :
+ func.kind === 192 && func.parent.kind === 270 ? func.parent.parent :
undefined;
}
function getThisTypeArgument(type) {
@@ -34723,11 +34939,11 @@ var ts;
}
function getThisTypeFromContextualType(type) {
return mapType(type, function (t) {
- return t.flags & 262144 ? ts.forEach(t.types, getThisTypeArgument) : getThisTypeArgument(t);
+ return t.flags & 524288 ? ts.forEach(t.types, getThisTypeArgument) : getThisTypeArgument(t);
});
}
function getContextualThisParameterType(func) {
- if (func.kind === 192) {
+ if (func.kind === 193) {
return undefined;
}
if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
@@ -34751,7 +34967,7 @@ var ts;
if (thisType) {
return instantiateType(thisType, getContextualMapper(containingLiteral));
}
- if (literal.parent.kind !== 269) {
+ if (literal.parent.kind !== 270) {
break;
}
literal = literal.parent.parent;
@@ -34760,9 +34976,9 @@ var ts;
return contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral);
}
var parent = func.parent;
- if (parent.kind === 199 && parent.operatorToken.kind === 58) {
+ if (parent.kind === 200 && parent.operatorToken.kind === 58) {
var target = parent.left;
- if (target.kind === 184 || target.kind === 185) {
+ if (target.kind === 185 || target.kind === 186) {
var expression = target.expression;
if (inJs && ts.isIdentifier(expression)) {
var sourceFile = ts.getSourceFileOfNode(parent);
@@ -34815,7 +35031,7 @@ var ts;
if (funcHasRestParameters &&
indexOfParameter === (func.parameters.length - 1) &&
isRestParameterIndex(contextualSignature, func.parameters.length - 1)) {
- return getTypeOfSymbol(ts.lastOrUndefined(contextualSignature.parameters));
+ return getTypeOfSymbol(ts.last(contextualSignature.parameters));
}
}
}
@@ -34826,7 +35042,7 @@ var ts;
if (typeNode) {
return getTypeFromTypeNode(typeNode);
}
- if (declaration.kind === 148) {
+ if (declaration.kind === 149) {
var type = getContextuallyTypedParameterType(declaration);
if (type) {
return type;
@@ -34838,7 +35054,7 @@ var ts;
if (ts.isBindingPattern(declaration.parent)) {
var parentDeclaration = declaration.parent.parent;
var name = declaration.propertyName || declaration.name;
- if (parentDeclaration.kind !== 181) {
+ if (parentDeclaration.kind !== 182) {
var parentTypeNode = ts.getEffectiveTypeAnnotationNode(parentDeclaration);
if (parentTypeNode && !ts.isBindingPattern(name)) {
var text = ts.getTextOfPropertyName(name);
@@ -34892,7 +35108,7 @@ var ts;
return false;
}
function getContextualReturnType(functionDecl) {
- if (functionDecl.kind === 154 ||
+ if (functionDecl.kind === 155 ||
ts.getEffectiveReturnTypeNode(functionDecl) ||
isGetAccessorWithAnnotatedSetAccessor(functionDecl)) {
return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl));
@@ -34913,7 +35129,7 @@ var ts;
return getTypeAtPosition(signature, argIndex);
}
function getContextualTypeForSubstitutionExpression(template, substitutionExpression) {
- if (template.parent.kind === 188) {
+ if (template.parent.kind === 189) {
return getContextualTypeForArgument(template.parent, substitutionExpression);
}
return undefined;
@@ -34926,7 +35142,7 @@ var ts;
return node === right && isContextSensitiveAssignment(binaryExpression) ? getTypeOfExpression(left) : undefined;
case 54:
var type = getContextualType(binaryExpression);
- return !type && node === right && !ts.getDeclaredJavascriptInitializer(binaryExpression.parent) && !ts.getAssignedJavascriptInitializer(binaryExpression) ?
+ return !type && node === right && !ts.isDefaultedJavascriptInitializer(binaryExpression) ?
getTypeOfExpression(left) : type;
case 53:
case 26:
@@ -34949,12 +35165,12 @@ var ts;
case 6:
return false;
default:
- ts.Debug.assertNever(kind);
+ return ts.Debug.assertNever(kind);
}
}
function getTypeOfPropertyOfContextualType(type, name) {
return mapType(type, function (t) {
- var prop = t.flags & 458752 ? getPropertyOfType(t, name) : undefined;
+ var prop = t.flags & 917504 ? getPropertyOfType(t, name) : undefined;
return prop ? getTypeOfSymbol(prop) : undefined;
}, true);
}
@@ -34962,7 +35178,7 @@ var ts;
return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }, true);
}
function contextualTypeIsTupleLikeType(type) {
- return !!(type.flags & 131072 ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type));
+ return !!(type.flags & 262144 ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type));
}
function getContextualTypeForObjectLiteralMethod(node) {
ts.Debug.assert(ts.isObjectLiteralMethod(node));
@@ -35021,10 +35237,26 @@ var ts;
return getContextualType(attribute.parent);
}
}
+ function isPossiblyDiscriminantValue(node) {
+ switch (node.kind) {
+ case 9:
+ case 8:
+ case 13:
+ case 101:
+ case 86:
+ case 95:
+ case 71:
+ return true;
+ case 185:
+ case 191:
+ return isPossiblyDiscriminantValue(node.expression);
+ }
+ return false;
+ }
function getApparentTypeOfContextualType(node) {
var contextualType = getContextualType(node);
contextualType = contextualType && mapType(contextualType, getApparentType);
- if (!(contextualType && contextualType.flags & 131072 && ts.isObjectLiteralExpression(node))) {
+ if (!(contextualType && contextualType.flags & 262144 && ts.isObjectLiteralExpression(node))) {
return contextualType;
}
var match;
@@ -35032,10 +35264,10 @@ var ts;
var prop = _a[_i];
if (!prop.symbol)
continue;
- if (prop.kind !== 269)
+ if (prop.kind !== 270)
continue;
- if (isDiscriminantProperty(contextualType, prop.symbol.escapedName)) {
- var discriminatingType = getTypeOfNode(prop.initializer);
+ if (isPossiblyDiscriminantValue(prop.initializer) && isDiscriminantProperty(contextualType, prop.symbol.escapedName)) {
+ var discriminatingType = checkExpression(prop.initializer);
for (var _b = 0, _c = contextualType.types; _b < _c.length; _b++) {
var type = _c[_b];
var targetType = getTypeOfPropertyOfType(type, prop.symbol.escapedName);
@@ -35062,58 +35294,58 @@ var ts;
}
var parent = node.parent;
switch (parent.kind) {
- case 231:
- case 148:
+ case 232:
+ case 149:
+ case 152:
case 151:
- case 150:
- case 181:
+ case 182:
return getContextualTypeForInitializerExpression(node);
- case 192:
- case 224:
+ case 193:
+ case 225:
return getContextualTypeForReturnExpression(node);
- case 202:
+ case 203:
return getContextualTypeForYieldOperand(parent);
- case 186:
case 187:
+ case 188:
return getContextualTypeForArgument(parent, node);
- case 189:
- case 207:
+ case 190:
+ case 208:
return getTypeFromTypeNode(parent.type);
- case 199:
+ case 200:
return getContextualTypeForBinaryOperand(node);
- case 269:
case 270:
- return getContextualTypeForObjectLiteralElement(parent);
case 271:
+ return getContextualTypeForObjectLiteralElement(parent);
+ case 272:
return getApparentTypeOfContextualType(parent.parent);
- case 182: {
+ case 183: {
var arrayLiteral = parent;
var type = getApparentTypeOfContextualType(arrayLiteral);
return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node));
}
- case 200:
+ case 201:
return getContextualTypeForConditionalOperand(node);
- case 210:
- ts.Debug.assert(parent.parent.kind === 201);
+ case 211:
+ ts.Debug.assert(parent.parent.kind === 202);
return getContextualTypeForSubstitutionExpression(parent.parent, node);
- case 190: {
+ case 191: {
var tag = ts.isInJavaScriptFile(parent) ? ts.getJSDocTypeTag(parent) : undefined;
return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent);
}
- case 264:
+ case 265:
return getContextualTypeForJsxExpression(parent);
- case 261:
- case 263:
+ case 262:
+ case 264:
return getContextualTypeForJsxAttribute(parent);
+ case 257:
case 256:
- case 255:
return getContextualJsxElementAttributesType(parent);
}
return undefined;
}
function getContextualMapper(node) {
- node = ts.findAncestor(node, function (n) { return !!n.contextualMapper; });
- return node ? node.contextualMapper : identityMapper;
+ var ancestor = ts.findAncestor(node, function (n) { return !!n.contextualMapper; });
+ return ancestor ? ancestor.contextualMapper : identityMapper;
}
function getContextualJsxElementAttributesType(node) {
if (isJsxIntrinsicIdentifier(node.tagName)) {
@@ -35127,12 +35359,12 @@ var ts;
return mapType(valueType, function (t) { return getJsxSignaturesParameterTypes(t, isJs, node); });
}
function getJsxSignaturesParameterTypes(valueType, isJs, context) {
- if (valueType.flags & 2) {
+ if (valueType.flags & 4) {
return anyType;
}
- else if (valueType.flags & 32) {
+ else if (valueType.flags & 64) {
var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, context);
- if (intrinsicElementsType !== unknownType) {
+ if (intrinsicElementsType !== errorType) {
var stringLiteralTypeName = valueType.value;
var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName));
if (intrinsicProp) {
@@ -35151,7 +35383,7 @@ var ts;
signatures = getSignaturesOfType(valueType, 0);
ctor = false;
if (signatures.length === 0) {
- return unknownType;
+ return errorType;
}
}
var links = getNodeLinks(context);
@@ -35172,7 +35404,7 @@ var ts;
function getJsxPropsTypeFromCallSignature(sig, context) {
var propsType = getTypeOfFirstParameterOfSignatureWithFallback(sig, emptyObjectType);
var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context);
- if (intrinsicAttribs !== unknownType) {
+ if (intrinsicAttribs !== errorType) {
propsType = intersectTypes(intrinsicAttribs, propsType);
}
return propsType;
@@ -35200,7 +35432,7 @@ var ts;
else {
var apparentAttributesType = attributesType;
var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes, context);
- if (intrinsicClassAttribs !== unknownType) {
+ if (intrinsicClassAttribs !== errorType) {
var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol);
var hostClassType = getReturnTypeOfSignature(sig);
apparentAttributesType = intersectTypes(typeParams
@@ -35208,7 +35440,7 @@ var ts;
: intrinsicClassAttribs, apparentAttributesType);
}
var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context);
- if (intrinsicAttribs !== unknownType) {
+ if (intrinsicAttribs !== errorType) {
apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType);
}
return apparentAttributesType;
@@ -35238,7 +35470,7 @@ var ts;
return sourceLength < targetParameterCount;
}
function isFunctionExpressionOrArrowFunction(node) {
- return node.kind === 191 || node.kind === 192;
+ return node.kind === 192 || node.kind === 193;
}
function getContextualSignatureForFunctionLikeDeclaration(node) {
return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node)
@@ -35251,7 +35483,7 @@ var ts;
getApparentTypeOfContextualType(node);
}
function getContextualSignature(node) {
- ts.Debug.assert(node.kind !== 153 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 154 || ts.isObjectLiteralMethod(node));
var type;
if (ts.isInJavaScriptFile(node)) {
var jsdoc = ts.getJSDocType(node);
@@ -35265,7 +35497,7 @@ var ts;
if (!type) {
return undefined;
}
- if (!(type.flags & 131072)) {
+ if (!(type.flags & 262144)) {
return getContextualCallSignature(type, node);
}
var signatureList;
@@ -35300,8 +35532,8 @@ var ts;
return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false, false);
}
function hasDefaultValue(node) {
- return (node.kind === 181 && !!node.initializer) ||
- (node.kind === 199 && node.operatorToken.kind === 58);
+ return (node.kind === 182 && !!node.initializer) ||
+ (node.kind === 200 && node.operatorToken.kind === 58);
}
function checkArrayLiteral(node, checkMode) {
var elements = node.elements;
@@ -35311,7 +35543,7 @@ var ts;
var contextualType = getApparentTypeOfContextualType(node);
for (var index = 0; index < elements.length; index++) {
var e = elements[index];
- if (inDestructuringPattern && e.kind === 203) {
+ if (inDestructuringPattern && e.kind === 204) {
var restArrayType = checkExpression(e.expression, checkMode);
var restElementType = getIndexTypeOfType(restArrayType, 1) ||
getIteratedTypeOrElementType(restArrayType, undefined, false, false, false);
@@ -35324,7 +35556,7 @@ var ts;
var type = checkExpressionForMutableLocation(e, checkMode, elementContextualType);
elementTypes.push(type);
}
- hasSpreadElement = hasSpreadElement || e.kind === 203;
+ hasSpreadElement = hasSpreadElement || e.kind === 204;
}
if (!hasSpreadElement) {
if (inDestructuringPattern && elementTypes.length) {
@@ -35334,7 +35566,7 @@ var ts;
}
if (contextualType && contextualTypeIsTupleLikeType(contextualType)) {
var pattern = contextualType.pattern;
- if (pattern && (pattern.kind === 180 || pattern.kind === 182)) {
+ if (pattern && (pattern.kind === 181 || pattern.kind === 183)) {
var patternElements = pattern.elements;
for (var i = elementTypes.length; i < patternElements.length; i++) {
var patternElement = patternElements[i];
@@ -35342,7 +35574,7 @@ var ts;
elementTypes.push(contextualType.typeArguments[i]);
}
else {
- if (patternElement.kind !== 205) {
+ if (patternElement.kind !== 206) {
error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value);
}
elementTypes.push(strictNullChecks ? implicitNeverType : undefinedWideningType);
@@ -35360,7 +35592,7 @@ var ts;
}
function isNumericName(name) {
switch (name.kind) {
- case 146:
+ case 147:
return isNumericComputedName(name);
case 71:
return isNumericLiteralName(name.escapedText);
@@ -35372,7 +35604,7 @@ var ts;
}
}
function isNumericComputedName(name) {
- return isTypeAssignableToKind(checkComputedPropertyName(name), 84);
+ return isTypeAssignableToKind(checkComputedPropertyName(name), 168);
}
function isInfinityOrNaNString(name) {
return name === "Infinity" || name === "-Infinity" || name === "NaN";
@@ -35384,8 +35616,8 @@ var ts;
var links = getNodeLinks(node.expression);
if (!links.resolvedType) {
links.resolvedType = checkExpression(node.expression);
- if (links.resolvedType.flags & 12288 ||
- !isTypeAssignableToKind(links.resolvedType, 34 | 84 | 1536) &&
+ if (links.resolvedType.flags & 24576 ||
+ !isTypeAssignableToKind(links.resolvedType, 68 | 168 | 3072) &&
!isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) {
error(node, ts.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any);
}
@@ -35411,22 +35643,25 @@ var ts;
var propertiesTable;
var propertiesArray = [];
var spread = emptyObjectType;
- var propagatedFlags = 8388608;
+ var propagatedFlags = 33554432;
var contextualType = getApparentTypeOfContextualType(node);
var contextualTypeHasPattern = contextualType && contextualType.pattern &&
- (contextualType.pattern.kind === 179 || contextualType.pattern.kind === 183);
+ (contextualType.pattern.kind === 180 || contextualType.pattern.kind === 184);
var isInJSFile = ts.isInJavaScriptFile(node) && !ts.isInJsonFile(node);
var isJSObjectLiteral = !contextualType && isInJSFile;
var typeFlags = 0;
var patternWithComputedProperties = false;
var hasComputedStringProperty = false;
var hasComputedNumberProperty = false;
- if (isInJSFile && node.properties.length === 0) {
- var symbol = getSymbolOfNode(node);
- if (symbol.exports) {
- propertiesTable = symbol.exports;
- symbol.exports.forEach(function (symbol) { return propertiesArray.push(getMergedSymbol(symbol)); });
- return createObjectLiteralType();
+ if (isInJSFile) {
+ var decl = ts.getDeclarationOfJSInitializer(node);
+ if (decl) {
+ var symbol = getMergedSymbol(decl.symbol);
+ if (symbol && ts.hasEntries(symbol.exports)) {
+ propertiesTable = symbol.exports;
+ symbol.exports.forEach(function (symbol) { return propertiesArray.push(getMergedSymbol(symbol)); });
+ return createObjectLiteralType();
+ }
}
}
propertiesTable = ts.createSymbolTable();
@@ -35434,13 +35669,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 === 146 && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ?
+ var computedNameType = memberDecl.name && memberDecl.name.kind === 147 && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ?
checkComputedPropertyName(memberDecl.name) : undefined;
- if (memberDecl.kind === 269 ||
- memberDecl.kind === 270 ||
+ if (memberDecl.kind === 270 ||
+ memberDecl.kind === 271 ||
ts.isObjectLiteralMethod(memberDecl)) {
- var type = memberDecl.kind === 269 ? checkPropertyAssignment(memberDecl, checkMode) :
- memberDecl.kind === 270 ? checkExpressionForMutableLocation(memberDecl.name, checkMode) :
+ var type = memberDecl.kind === 270 ? checkPropertyAssignment(memberDecl, checkMode) :
+ memberDecl.kind === 271 ? checkExpressionForMutableLocation(memberDecl.name, checkMode) :
checkObjectLiteralMethod(memberDecl, checkMode);
if (isInJSFile) {
var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl);
@@ -35450,7 +35685,7 @@ var ts;
}
}
typeFlags |= type.flags;
- var nameType = computedNameType && computedNameType.flags & 1120 ?
+ var nameType = computedNameType && computedNameType.flags & 2240 ?
computedNameType : undefined;
var prop = nameType ?
createSymbol(4 | member.flags, getLateBoundNameFromType(nameType), 1024) :
@@ -35459,8 +35694,8 @@ var ts;
prop.nameType = nameType;
}
if (inDestructuringPattern) {
- var isOptional = (memberDecl.kind === 269 && hasDefaultValue(memberDecl.initializer)) ||
- (memberDecl.kind === 270 && memberDecl.objectAssignmentInitializer);
+ var isOptional = (memberDecl.kind === 270 && hasDefaultValue(memberDecl.initializer)) ||
+ (memberDecl.kind === 271 && memberDecl.objectAssignmentInitializer);
if (isOptional) {
prop.flags |= 16777216;
}
@@ -35483,7 +35718,7 @@ var ts;
prop.target = member;
member = prop;
}
- else if (memberDecl.kind === 271) {
+ else if (memberDecl.kind === 272) {
if (languageVersion < 2) {
checkExternalEmitHelpers(memberDecl, 2);
}
@@ -35498,17 +35733,17 @@ var ts;
var type = checkExpression(memberDecl.expression);
if (!isValidSpreadType(type)) {
error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types);
- return unknownType;
+ return errorType;
}
spread = getSpreadType(spread, type, node.symbol, propagatedFlags, 0);
offset = i + 1;
continue;
}
else {
- ts.Debug.assert(memberDecl.kind === 155 || memberDecl.kind === 156);
+ ts.Debug.assert(memberDecl.kind === 156 || memberDecl.kind === 157);
checkNodeDeferred(memberDecl);
}
- if (computedNameType && !(computedNameType.flags & 1120)) {
+ if (computedNameType && !(computedNameType.flags & 2240)) {
if (isTypeAssignableTo(computedNameType, stringNumberSymbolType)) {
if (isTypeAssignableTo(computedNameType, numberType)) {
hasComputedNumberProperty = true;
@@ -35549,8 +35784,8 @@ var ts;
var stringIndexInfo = isJSObjectLiteral ? jsObjectLiteralIndexInfo : hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0) : undefined;
var numberIndexInfo = hasComputedNumberProperty && !isJSObjectLiteral ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1) : undefined;
var result = createAnonymousType(node.symbol, propertiesTable, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo);
- var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8388608;
- result.flags |= 33554432 | freshObjectLiteralFlag | (typeFlags & 117440512);
+ var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 33554432;
+ result.flags |= 268435456 | freshObjectLiteralFlag | (typeFlags & 939524096);
result.objectFlags |= 128;
if (patternWithComputedProperties) {
result.objectFlags |= 512;
@@ -35558,17 +35793,17 @@ var ts;
if (inDestructuringPattern) {
result.pattern = node;
}
- if (!(result.flags & 12288)) {
- propagatedFlags |= (result.flags & 117440512);
+ if (!(result.flags & 24576)) {
+ propagatedFlags |= (result.flags & 939524096);
}
return result;
}
}
function isValidSpreadType(type) {
- return !!(type.flags & (1 | 134217728) ||
- getFalsyFlags(type) & 14560 && isValidSpreadType(removeDefinitelyFalsyTypes(type)) ||
- type.flags & 65536 && !isGenericMappedType(type) ||
- type.flags & 393216 && !ts.forEach(type.types, function (t) { return !isValidSpreadType(t); }));
+ return !!(type.flags & (3 | 16777216) ||
+ getFalsyFlags(type) & 29120 && isValidSpreadType(removeDefinitelyFalsyTypes(type)) ||
+ type.flags & 131072 && !isGenericMappedType(type) ||
+ type.flags & 786432 && !ts.forEach(type.types, function (t) { return !isValidSpreadType(t); }));
}
function checkJsxSelfClosingElement(node, checkMode) {
checkJsxOpeningLikeElementOrOpeningFragment(node, checkMode);
@@ -35598,13 +35833,13 @@ var ts;
}
function isJsxIntrinsicIdentifier(tagName) {
switch (tagName.kind) {
- case 184:
+ case 185:
case 99:
return false;
case 71:
return ts.isIntrinsicJsxName(tagName.escapedText);
default:
- ts.Debug.fail();
+ return ts.Debug.fail();
}
}
function checkJsxAttribute(node, checkMode) {
@@ -35639,7 +35874,7 @@ var ts;
}
}
else {
- ts.Debug.assert(attributeDecl.kind === 263);
+ ts.Debug.assert(attributeDecl.kind === 264);
if (attributesTable.size > 0) {
spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, 0, 4096);
attributesTable = ts.createSymbolTable();
@@ -35661,7 +35896,7 @@ var ts;
spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, 0, 4096);
}
}
- var parent = openingLikeElement.parent.kind === 254 ? openingLikeElement.parent : undefined;
+ var parent = openingLikeElement.parent.kind === 255 ? openingLikeElement.parent : undefined;
if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) {
var childrenTypes = checkJsxChildren(parent, checkMode);
if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") {
@@ -35686,7 +35921,7 @@ var ts;
return typeToIntersect || (spread === emptyObjectType ? createJsxAttributesType() : spread);
function createJsxAttributesType() {
var result = createAnonymousType(attributes.symbol, attributesTable, ts.emptyArray, ts.emptyArray, undefined, undefined);
- result.flags |= 33554432;
+ result.flags |= 268435456;
result.objectFlags |= 128 | 4096;
return result;
}
@@ -35713,13 +35948,13 @@ var ts;
var namespace = getJsxNamespaceAt(location);
var exports = namespace && getExportsOfSymbol(namespace);
var typeSymbol = exports && getSymbol(exports, name, 67901928);
- return typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : unknownType;
+ return typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : errorType;
}
function getIntrinsicTagSymbol(node) {
var links = getNodeLinks(node);
if (!links.resolvedSymbol) {
var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, node);
- if (intrinsicElementsType !== unknownType) {
+ if (intrinsicElementsType !== errorType) {
if (!ts.isIdentifier(node.tagName))
return ts.Debug.fail();
var intrinsicProp = getPropertyOfType(intrinsicElementsType, node.tagName.escapedText);
@@ -35781,6 +36016,7 @@ var ts;
return instantiatedSignatures;
}
function getJsxSignatureTypeArgumentInstantiation(signature, node, isJavascript, reportErrors) {
+ if (reportErrors === void 0) { reportErrors = false; }
if (!node.typeArguments) {
return;
}
@@ -35831,7 +36067,7 @@ var ts;
if (!propsType) {
return undefined;
}
- if (propsType.flags & 262144) {
+ if (propsType.flags & 524288) {
var propsApparentType = [];
for (var _i = 0, _a = propsType.types; _i < _a.length; _i++) {
var t = _a[_i];
@@ -35842,7 +36078,7 @@ var ts;
return getApparentType(propsType);
}
function defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) {
- ts.Debug.assert(!(elementType.flags & 131072));
+ ts.Debug.assert(!(elementType.flags & 262144));
if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) {
var jsxStatelessElementType = getJsxStatelessElementTypeAt(openingLikeElement);
if (jsxStatelessElementType) {
@@ -35853,7 +36089,7 @@ var ts;
paramType = getApparentTypeOfJsxPropsType(paramType);
if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) {
var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, openingLikeElement);
- if (intrinsicAttributes !== unknownType) {
+ if (intrinsicAttributes !== errorType) {
paramType = intersectTypes(intrinsicAttributes, paramType);
}
return paramType;
@@ -35864,7 +36100,7 @@ var ts;
return undefined;
}
function tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) {
- ts.Debug.assert(!(elementType.flags & 131072));
+ ts.Debug.assert(!(elementType.flags & 262144));
if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) {
var jsxStatelessElementType = getJsxStatelessElementTypeAt(openingLikeElement);
if (jsxStatelessElementType) {
@@ -35898,7 +36134,7 @@ var ts;
result = allMatchingAttributesType;
}
var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, openingLikeElement);
- if (intrinsicAttributes !== unknownType) {
+ if (intrinsicAttributes !== errorType) {
result = intersectTypes(intrinsicAttributes, result);
}
return result;
@@ -35934,7 +36170,7 @@ var ts;
return results;
}
function resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, elementType, elementClassType) {
- if (elementType.flags & 131072) {
+ if (elementType.flags & 262144) {
var types = elementType.types;
return getUnionType(types.map(function (type) {
return resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, type, elementClassType);
@@ -35943,12 +36179,12 @@ var ts;
if (isTypeAny(elementType)) {
return elementType;
}
- else if (elementType.flags & 2) {
+ else if (elementType.flags & 4) {
return anyType;
}
- else if (elementType.flags & 32) {
+ else if (elementType.flags & 64) {
var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, openingLikeElement);
- if (intrinsicElementsType !== unknownType) {
+ if (intrinsicElementsType !== errorType) {
var stringLiteralTypeName = elementType.value;
var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName));
if (intrinsicProp) {
@@ -35964,9 +36200,9 @@ var ts;
}
var instantiatedSignatures = getInstantiatedJsxSignatures(openingLikeElement, elementType, true);
if (!ts.length(instantiatedSignatures)) {
- return unknownType;
+ return errorType;
}
- var elemInstanceType = getUnionType(ts.map(instantiatedSignatures, getReturnTypeOfSignature), 2);
+ var elemInstanceType = getUnionType(instantiatedSignatures.map(getReturnTypeOfSignature), 2);
var statelessAttributesType = shouldIncludeAllStatelessAttributesType ?
tryGetAllJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) :
defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType);
@@ -35977,7 +36213,7 @@ var ts;
checkTypeRelatedTo(elemInstanceType, elementClassType, assignableRelation, openingLikeElement, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements);
}
var isJs = ts.isInJavaScriptFile(openingLikeElement);
- return getUnionType(ts.map(instantiatedSignatures, function (sig) { return getJsxPropsTypeFromClassType(sig, isJs, openingLikeElement, true); }));
+ return getUnionType(instantiatedSignatures.map(function (sig) { return getJsxPropsTypeFromClassType(sig, isJs, openingLikeElement, true); }));
}
function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) {
ts.Debug.assert(isJsxIntrinsicIdentifier(node.tagName));
@@ -35991,7 +36227,7 @@ var ts;
return links.resolvedJsxElementAttributesType = getIndexInfoOfSymbol(symbol, 0).type;
}
else {
- return links.resolvedJsxElementAttributesType = unknownType;
+ return links.resolvedJsxElementAttributesType = errorType;
}
}
return links.resolvedJsxElementAttributesType;
@@ -36022,7 +36258,7 @@ var ts;
}
function getJsxElementClassTypeAt(location) {
var type = getJsxType(JsxNames.ElementClass, location);
- if (type === unknownType)
+ if (type === errorType)
return undefined;
return type;
}
@@ -36073,7 +36309,7 @@ var ts;
}
}
function isKnownProperty(targetType, name, isComparingJsxAttributes) {
- if (targetType.flags & 65536) {
+ if (targetType.flags & 131072) {
var resolved = resolveStructuredTypeMembers(targetType);
if (resolved.stringIndexInfo ||
resolved.numberIndexInfo && isNumericLiteralName(name) ||
@@ -36082,7 +36318,7 @@ var ts;
return true;
}
}
- else if (targetType.flags & 393216) {
+ else if (targetType.flags & 786432) {
for (var _i = 0, _a = targetType.types; _i < _a.length; _i++) {
var t = _a[_i];
if (isKnownProperty(t, name, isComparingJsxAttributes)) {
@@ -36146,11 +36382,11 @@ var ts;
return type;
}
else {
- return unknownType;
+ return errorType;
}
}
function getDeclarationKindFromSymbol(s) {
- return s.valueDeclaration ? s.valueDeclaration.kind : 151;
+ return s.valueDeclaration ? s.valueDeclaration.kind : 152;
}
function getDeclarationNodeFlagsFromSymbol(s) {
return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : 0;
@@ -36167,9 +36403,9 @@ var ts;
}
function checkPropertyAccessibility(node, left, type, prop) {
var flags = ts.getDeclarationModifierFlagsFromSymbol(prop);
- var errorNode = node.kind === 184 || node.kind === 231 ?
+ var errorNode = node.kind === 185 || node.kind === 232 ?
node.name :
- node.kind === 178 ?
+ node.kind === 179 ?
node :
node.right;
if (ts.getCheckFlags(prop) & 256) {
@@ -36220,7 +36456,7 @@ var ts;
if (flags & 32) {
return true;
}
- if (type.flags & 32768) {
+ if (type.flags & 65536) {
type = type.isThisType ? getConstraintOfTypeParameter(type) : getBaseConstraintOfType(type);
}
if (!type || !hasBaseType(type, enclosingClass)) {
@@ -36232,21 +36468,25 @@ var ts;
function symbolHasNonMethodDeclaration(symbol) {
return forEachProperty(symbol, function (prop) {
var propKind = getDeclarationKindFromSymbol(prop);
- return propKind !== 153 && propKind !== 152;
+ return propKind !== 154 && propKind !== 153;
});
}
function checkNonNullExpression(node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic) {
return checkNonNullType(checkExpression(node), node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic);
}
function checkNonNullType(type, node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic) {
- var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 12288;
+ if (type.flags & 2) {
+ error(node, ts.Diagnostics.Object_is_of_type_unknown);
+ return errorType;
+ }
+ var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 24576;
if (kind) {
- error(node, kind & 4096 ? kind & 8192 ?
+ error(node, kind & 8192 ? kind & 16384 ?
(nullOrUndefinedDiagnostic || ts.Diagnostics.Object_is_possibly_null_or_undefined) :
(undefinedDiagnostic || ts.Diagnostics.Object_is_possibly_undefined) :
(nullDiagnostic || ts.Diagnostics.Object_is_possibly_null));
var t = getNonNullableType(type);
- return t.flags & (12288 | 16384) ? unknownType : t;
+ return t.flags & (24576 | 32768) ? errorType : t;
}
return type;
}
@@ -36276,9 +36516,9 @@ var ts;
var indexInfo = getIndexInfoOfType(apparentType, 0);
if (!(indexInfo && indexInfo.type)) {
if (right.escapedText && !checkAndReportErrorForExtendingInterface(node)) {
- reportNonexistentProperty(right, leftType.flags & 32768 && leftType.isThisType ? apparentType : leftType);
+ reportNonexistentProperty(right, leftType.flags & 65536 && leftType.isThisType ? apparentType : leftType);
}
- return unknownType;
+ return errorType;
}
if (indexInfo.isReadonly && (ts.isAssignmentTarget(node) || ts.isDeleteTarget(node))) {
error(node, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType));
@@ -36293,14 +36533,14 @@ var ts;
if (assignmentKind) {
if (isReferenceToReadonlyEntity(node, prop) || isReferenceThroughNamespaceImport(node)) {
error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, ts.idText(right));
- return unknownType;
+ return errorType;
}
}
propType = getConstraintForLocation(getTypeOfSymbol(prop), node);
}
- if (node.kind !== 184 ||
+ if (node.kind !== 185 ||
assignmentKind === 1 ||
- prop && !(prop.flags & (3 | 4 | 98304)) && !(prop.flags & 8192 && propType.flags & 131072)) {
+ prop && !(prop.flags & (3 | 4 | 98304)) && !(prop.flags & 8192 && propType.flags & 262144)) {
return propType;
}
var assumeUninitialized = false;
@@ -36308,13 +36548,13 @@ var ts;
var declaration = prop && prop.valueDeclaration;
if (declaration && isInstancePropertyWithoutInitializer(declaration)) {
var flowContainer = getControlFlowContainer(node);
- if (flowContainer.kind === 154 && flowContainer.parent === declaration.parent) {
+ if (flowContainer.kind === 155 && flowContainer.parent === declaration.parent) {
assumeUninitialized = true;
}
}
}
var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);
- if (assumeUninitialized && !(getFalsyFlags(propType) & 4096) && getFalsyFlags(flowType) & 4096) {
+ if (assumeUninitialized && !(getFalsyFlags(propType) & 8192) && getFalsyFlags(flowType) & 8192) {
error(right, ts.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop));
return propType;
}
@@ -36330,8 +36570,8 @@ var ts;
&& !isPropertyDeclaredInAncestorClass(prop)) {
error(right, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.idText(right));
}
- else if (valueDeclaration.kind === 234 &&
- node.parent.kind !== 161 &&
+ else if (valueDeclaration.kind === 235 &&
+ node.parent.kind !== 162 &&
!(valueDeclaration.flags & 4194304) &&
!isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
error(right, ts.Diagnostics.Class_0_used_before_its_declaration, ts.idText(right));
@@ -36340,9 +36580,9 @@ var ts;
function isInPropertyInitializer(node) {
return !!ts.findAncestor(node, function (node) {
switch (node.kind) {
- case 151:
+ case 152:
return true;
- case 269:
+ case 270:
return false;
default:
return ts.isExpressionNode(node) ? false : "quit";
@@ -36374,7 +36614,7 @@ var ts;
}
function reportNonexistentProperty(propNode, containingType) {
var errorInfo;
- if (containingType.flags & 131072 && !(containingType.flags & 16382)) {
+ if (containingType.flags & 262144 && !(containingType.flags & 32764)) {
for (var _i = 0, _a = containingType.types; _i < _a.length; _i++) {
var subtype = _a[_i];
if (!getPropertyOfType(subtype, propNode.escapedText)) {
@@ -36507,20 +36747,20 @@ var ts;
}
function isValidPropertyAccess(node, propertyName) {
switch (node.kind) {
- case 184:
+ case 185:
return isValidPropertyAccessWithType(node, node.expression, propertyName, getWidenedType(checkExpression(node.expression)));
- case 145:
+ case 146:
return isValidPropertyAccessWithType(node, node.left, propertyName, getWidenedType(checkExpression(node.left)));
- case 178:
+ case 179:
return isValidPropertyAccessWithType(node, node, propertyName, getTypeFromTypeNode(node));
}
}
function isValidPropertyAccessForCompletions(node, type, property) {
- return isValidPropertyAccessWithType(node, node.kind === 178 ? node : node.expression, property.escapedName, type)
+ return isValidPropertyAccessWithType(node, node.kind === 179 ? node : node.expression, property.escapedName, type)
&& (!(property.flags & 8192) || isValidMethodAccess(property, type));
}
function isValidMethodAccess(method, actualThisType) {
- var propType = getTypeOfFuncClassEnumModule(method);
+ var propType = getTypeOfPropertyOfType(actualThisType, method.escapedName);
var signatures = getSignaturesOfType(getNonNullableType(propType), 0);
ts.Debug.assert(signatures.length !== 0);
return signatures.some(function (sig) {
@@ -36537,16 +36777,16 @@ var ts;
return instantiateType(signatureThisType, createSignatureTypeMapper(sig, getInferredTypes(context)));
}
function isValidPropertyAccessWithType(node, left, propertyName, type) {
- if (type === unknownType || isTypeAny(type)) {
+ if (type === errorType || isTypeAny(type)) {
return true;
}
var prop = getPropertyOfType(type, propertyName);
return prop ? checkPropertyAccessibility(node, left, type, prop)
- : ts.isInJavaScriptFile(node) && (type.flags & 131072) && type.types.some(function (elementType) { return isValidPropertyAccessWithType(node, left, propertyName, elementType); });
+ : ts.isInJavaScriptFile(node) && (type.flags & 262144) !== 0 && type.types.some(function (elementType) { return isValidPropertyAccessWithType(node, left, propertyName, elementType); });
}
function getForInVariableSymbol(node) {
var initializer = node.initializer;
- if (initializer.kind === 232) {
+ if (initializer.kind === 233) {
var variable = initializer.declarations[0];
if (variable && !ts.isBindingPattern(variable.name)) {
return getSymbolOfNode(variable);
@@ -36568,7 +36808,7 @@ var ts;
var child = expr;
var node = expr.parent;
while (node) {
- if (node.kind === 220 &&
+ if (node.kind === 221 &&
child === node.statement &&
getForInVariableSymbol(node) === symbol &&
hasNumericPropertyNames(getTypeOfExpression(node.expression))) {
@@ -36586,7 +36826,7 @@ var ts;
var indexExpression = node.argumentExpression;
if (!indexExpression) {
var sourceFile = ts.getSourceFileOfNode(node);
- if (node.parent.kind === 187 && node.parent.expression === node) {
+ if (node.parent.kind === 188 && node.parent.expression === node) {
var start = ts.skipTrivia(sourceFile.text, node.expression.end);
var end = node.end;
grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead);
@@ -36596,26 +36836,26 @@ var ts;
var end = node.end;
grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Expression_expected);
}
- return unknownType;
+ return errorType;
}
var indexType = isForInVariableForNumericPropertyNames(indexExpression) ? numberType : checkExpression(indexExpression);
- if (objectType === unknownType || objectType === silentNeverType) {
+ if (objectType === errorType || objectType === silentNeverType) {
return objectType;
}
if (isConstEnumObjectType(objectType) && indexExpression.kind !== 9) {
error(indexExpression, ts.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal);
- return unknownType;
+ return errorType;
}
return checkIndexedAccessIndexType(getIndexedAccessType(objectType, indexType, node), node);
}
function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) {
- if (expressionType === unknownType) {
+ if (expressionType === errorType) {
return false;
}
if (!ts.isWellKnownSymbolSyntactically(expression)) {
return false;
}
- if ((expressionType.flags & 1536) === 0) {
+ if ((expressionType.flags & 3072) === 0) {
if (reportError) {
error(expression, ts.Diagnostics.A_computed_property_name_of_the_form_0_must_be_of_type_symbol, ts.getTextOfNode(expression));
}
@@ -36645,10 +36885,10 @@ var ts;
if (callLikeExpressionMayHaveTypeArguments(node)) {
ts.forEach(node.typeArguments, checkSourceElement);
}
- if (node.kind === 188) {
+ if (node.kind === 189) {
checkExpression(node.template);
}
- else if (node.kind !== 149) {
+ else if (node.kind !== 150) {
ts.forEach(node.arguments, function (argument) {
checkExpression(argument);
});
@@ -36673,7 +36913,7 @@ var ts;
var parent = signature.declaration && signature.declaration.parent;
if (!lastSymbol || symbol === lastSymbol) {
if (lastParent && parent === lastParent) {
- index++;
+ index = index + 1;
}
else {
lastParent = parent;
@@ -36699,7 +36939,7 @@ var ts;
function getSpreadArgumentIndex(args) {
for (var i = 0; i < args.length; i++) {
var arg = args[i];
- if (arg && arg.kind === 203) {
+ if (arg && arg.kind === 204) {
return i;
}
}
@@ -36709,17 +36949,16 @@ var ts;
if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; }
var argCount;
var typeArguments;
- var callIsIncomplete;
+ var callIsIncomplete = false;
var spreadArgIndex = -1;
if (ts.isJsxOpeningLikeElement(node)) {
return true;
}
- if (node.kind === 188) {
+ if (node.kind === 189) {
argCount = args.length;
- typeArguments = undefined;
- if (node.template.kind === 201) {
- var lastSpan = ts.lastOrUndefined(node.template.templateSpans);
- ts.Debug.assert(lastSpan !== undefined);
+ typeArguments = node.typeArguments;
+ if (node.template.kind === 202) {
+ var lastSpan = ts.last(node.template.templateSpans);
callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated;
}
else {
@@ -36728,13 +36967,13 @@ var ts;
callIsIncomplete = !!templateLiteral.isUnterminated;
}
}
- else if (node.kind === 149) {
+ else if (node.kind === 150) {
typeArguments = undefined;
argCount = getEffectiveArgumentCount(node, undefined, signature);
}
else {
if (!node.arguments) {
- ts.Debug.assert(node.kind === 187);
+ ts.Debug.assert(node.kind === 188);
return signature.minArgumentCount === 0;
}
argCount = signatureHelpTrailingComma ? args.length + 1 : args.length;
@@ -36762,7 +37001,7 @@ var ts;
(typeArguments.length >= minTypeArgumentCount && typeArguments.length <= numTypeParameters);
}
function getSingleCallSignature(type) {
- if (type.flags & 65536) {
+ if (type.flags & 131072) {
var resolved = resolveStructuredTypeMembers(type);
if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 &&
resolved.properties.length === 0 && !resolved.stringIndexInfo && !resolved.numberIndexInfo) {
@@ -36797,7 +37036,7 @@ var ts;
inference.inferredType = undefined;
}
}
- if (node.kind !== 149) {
+ if (node.kind !== 150) {
var contextualType = getContextualType(node);
if (contextualType) {
var instantiatedType = instantiateType(contextualType, cloneTypeMapper(getContextualMapper(node)));
@@ -36818,7 +37057,7 @@ var ts;
var argCount = getEffectiveArgumentCount(node, args, signature);
for (var i = 0; i < argCount; i++) {
var arg = getEffectiveArgument(node, args, i);
- if (arg === undefined || arg.kind !== 205) {
+ if (arg === undefined || arg.kind !== 206) {
var paramType = getTypeAtPosition(signature, i);
var argType = getEffectiveArgumentType(node, i);
if (argType === undefined) {
@@ -36849,7 +37088,7 @@ var ts;
var constraint = getConstraintOfTypeParameter(typeParameters[i]);
if (!constraint)
continue;
- var errorInfo = reportErrors && headMessage && (function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); });
+ var errorInfo = reportErrors && headMessage ? (function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); }) : undefined;
var typeArgumentHeadMessage = headMessage || ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1;
if (!mapper) {
mapper = createTypeMapper(typeParameters, typeArgumentTypes);
@@ -36883,12 +37122,12 @@ var ts;
return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation);
}
var thisType = getThisTypeOfSignature(signature);
- if (thisType && thisType !== voidType && node.kind !== 187) {
+ if (thisType && thisType !== voidType && node.kind !== 188) {
var thisArgumentNode = getThisArgumentOfCall(node);
var thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType;
var errorNode = reportErrors ? (thisArgumentNode || node) : undefined;
var headMessage_1 = ts.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1;
- if (!checkTypeRelatedTo(thisArgumentType, getThisTypeOfSignature(signature), relation, errorNode, headMessage_1)) {
+ if (!checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage_1)) {
return false;
}
}
@@ -36896,7 +37135,7 @@ var ts;
var argCount = getEffectiveArgumentCount(node, args, signature);
for (var i = 0; i < argCount; i++) {
var arg = getEffectiveArgument(node, args, i);
- if (arg === undefined || arg.kind !== 205) {
+ if (arg === undefined || arg.kind !== 206) {
var paramType = getTypeAtPosition(signature, i);
var argType = getEffectiveArgumentType(node, i) ||
checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined);
@@ -36910,25 +37149,25 @@ var ts;
return true;
}
function getThisArgumentOfCall(node) {
- if (node.kind === 186) {
+ if (node.kind === 187) {
var callee = ts.skipOuterExpressions(node.expression);
- if (callee.kind === 184 || callee.kind === 185) {
+ if (callee.kind === 185 || callee.kind === 186) {
return callee.expression;
}
}
}
function getEffectiveCallArguments(node) {
- if (node.kind === 188) {
+ if (node.kind === 189) {
var template = node.template;
var args_4 = [undefined];
- if (template.kind === 201) {
+ if (template.kind === 202) {
ts.forEach(template.templateSpans, function (span) {
args_4.push(span.expression);
});
}
return args_4;
}
- else if (node.kind === 149) {
+ else if (node.kind === 150) {
return undefined;
}
else if (ts.isJsxOpeningLikeElement(node)) {
@@ -36939,22 +37178,24 @@ var ts;
}
}
function getEffectiveArgumentCount(node, args, signature) {
- if (node.kind === 149) {
+ if (node.kind === 150) {
switch (node.parent.kind) {
- case 234:
- case 204:
+ case 235:
+ case 205:
return 1;
- case 151:
+ case 152:
return 2;
- case 153:
- case 155:
+ case 154:
case 156:
+ case 157:
if (languageVersion === 0) {
return 2;
}
return signature.parameters.length >= 3 ? 3 : 2;
- case 148:
+ case 149:
return 3;
+ default:
+ return ts.Debug.fail();
}
}
else {
@@ -36962,51 +37203,52 @@ var ts;
}
}
function getEffectiveDecoratorFirstArgumentType(node) {
- if (node.kind === 234) {
+ if (node.kind === 235) {
var classSymbol = getSymbolOfNode(node);
return getTypeOfSymbol(classSymbol);
}
- if (node.kind === 148) {
+ if (node.kind === 149) {
node = node.parent;
- if (node.kind === 154) {
+ if (node.kind === 155) {
var classSymbol = getSymbolOfNode(node);
return getTypeOfSymbol(classSymbol);
}
}
- if (node.kind === 151 ||
- node.kind === 153 ||
- node.kind === 155 ||
- node.kind === 156) {
+ if (node.kind === 152 ||
+ node.kind === 154 ||
+ node.kind === 156 ||
+ node.kind === 157) {
return getParentTypeOfClassElement(node);
}
ts.Debug.fail("Unsupported decorator target.");
- return unknownType;
+ return errorType;
}
function getEffectiveDecoratorSecondArgumentType(node) {
- if (node.kind === 234) {
+ if (node.kind === 235) {
ts.Debug.fail("Class decorators should not have a second synthetic argument.");
- return unknownType;
+ return errorType;
}
- if (node.kind === 148) {
+ if (node.kind === 149) {
node = node.parent;
- if (node.kind === 154) {
+ if (node.kind === 155) {
return anyType;
}
}
- if (node.kind === 151 ||
- node.kind === 153 ||
- node.kind === 155 ||
- node.kind === 156) {
+ if (node.kind === 152 ||
+ node.kind === 154 ||
+ node.kind === 156 ||
+ node.kind === 157) {
var element = node;
- switch (element.name.kind) {
+ var name = element.name;
+ switch (name.kind) {
case 71:
- return getLiteralType(ts.idText(element.name));
+ return getLiteralType(ts.idText(name));
case 8:
case 9:
- return getLiteralType(element.name.text);
- case 146:
- var nameType = checkComputedPropertyName(element.name);
- if (isTypeAssignableToKind(nameType, 1536)) {
+ return getLiteralType(name.text);
+ case 147:
+ var nameType = checkComputedPropertyName(name);
+ if (isTypeAssignableToKind(nameType, 3072)) {
return nameType;
}
else {
@@ -37014,32 +37256,32 @@ var ts;
}
default:
ts.Debug.fail("Unsupported property name.");
- return unknownType;
+ return errorType;
}
}
ts.Debug.fail("Unsupported decorator target.");
- return unknownType;
+ return errorType;
}
function getEffectiveDecoratorThirdArgumentType(node) {
- if (node.kind === 234) {
+ if (node.kind === 235) {
ts.Debug.fail("Class decorators should not have a third synthetic argument.");
- return unknownType;
+ return errorType;
}
- if (node.kind === 148) {
+ if (node.kind === 149) {
return numberType;
}
- if (node.kind === 151) {
+ if (node.kind === 152) {
ts.Debug.fail("Property decorators should not have a third synthetic argument.");
- return unknownType;
+ return errorType;
}
- if (node.kind === 153 ||
- node.kind === 155 ||
- node.kind === 156) {
+ if (node.kind === 154 ||
+ node.kind === 156 ||
+ node.kind === 157) {
var propertyType = getTypeOfNode(node);
return createTypedPropertyDescriptorType(propertyType);
}
ts.Debug.fail("Unsupported decorator target.");
- return unknownType;
+ return errorType;
}
function getEffectiveDecoratorArgumentType(node, argIndex) {
if (argIndex === 0) {
@@ -37052,29 +37294,29 @@ var ts;
return getEffectiveDecoratorThirdArgumentType(node.parent);
}
ts.Debug.fail("Decorators should not have a fourth synthetic argument.");
- return unknownType;
+ return errorType;
}
function getEffectiveArgumentType(node, argIndex) {
- if (node.kind === 149) {
+ if (node.kind === 150) {
return getEffectiveDecoratorArgumentType(node, argIndex);
}
- else if (argIndex === 0 && node.kind === 188) {
+ else if (argIndex === 0 && node.kind === 189) {
return getGlobalTemplateStringsArrayType();
}
return undefined;
}
function getEffectiveArgument(node, args, argIndex) {
- if (node.kind === 149 ||
- (argIndex === 0 && node.kind === 188)) {
+ if (node.kind === 150 ||
+ (argIndex === 0 && node.kind === 189)) {
return undefined;
}
return args[argIndex];
}
function getEffectiveArgumentErrorNode(node, argIndex, arg) {
- if (node.kind === 149) {
+ if (node.kind === 150) {
return node.expression;
}
- else if (argIndex === 0 && node.kind === 188) {
+ else if (argIndex === 0 && node.kind === 189) {
return node.template;
}
else {
@@ -37093,8 +37335,8 @@ var ts;
return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length);
}
function resolveCall(node, signatures, candidatesOutArray, fallbackError) {
- var isTaggedTemplate = node.kind === 188;
- var isDecorator = node.kind === 149;
+ var isTaggedTemplate = node.kind === 189;
+ var isDecorator = node.kind === 150;
var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node);
var typeArguments;
if (!isDecorator) {
@@ -37127,7 +37369,7 @@ var ts;
var candidateForArgumentError;
var candidateForTypeArgumentError;
var result;
- var signatureHelpTrailingComma = candidatesOutArray && node.kind === 186 && node.arguments.hasTrailingComma;
+ var signatureHelpTrailingComma = candidatesOutArray && node.kind === 187 && node.arguments.hasTrailingComma;
if (candidates.length > 1) {
result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma);
}
@@ -37278,9 +37520,10 @@ var ts;
if (node.expression.kind === 97) {
var superType = checkSuperExpression(node.expression);
if (isTypeAny(superType)) {
+ ts.forEach(node.arguments, checkExpression);
return anySignature;
}
- if (superType !== unknownType) {
+ if (superType !== errorType) {
var baseTypeNode = ts.getClassExtendsHeritageClauseElement(ts.getContainingClass(node));
if (baseTypeNode) {
var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode);
@@ -37294,13 +37537,13 @@ var ts;
return silentNeverSignature;
}
var apparentType = getApparentType(funcType);
- if (apparentType === unknownType) {
+ if (apparentType === errorType) {
return resolveErrorCall(node);
}
var callSignatures = getSignaturesOfType(apparentType, 0);
var constructSignatures = getSignaturesOfType(apparentType, 1);
if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, constructSignatures.length)) {
- if (funcType !== unknownType && node.typeArguments) {
+ if (funcType !== errorType && node.typeArguments) {
error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments);
}
return resolveUntypedCall(node);
@@ -37317,8 +37560,8 @@ var ts;
return resolveCall(node, callSignatures, candidatesOutArray);
}
function isUntypedFunctionCall(funcType, apparentFuncType, numCallSignatures, numConstructSignatures) {
- return isTypeAny(funcType) || isTypeAny(apparentFuncType) && funcType.flags & 32768 ||
- !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & (131072 | 16384)) && isTypeAssignableTo(funcType, globalFunctionType);
+ return isTypeAny(funcType) || isTypeAny(apparentFuncType) && funcType.flags & 65536 ||
+ !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & (262144 | 32768)) && isTypeAssignableTo(funcType, globalFunctionType);
}
function resolveNewExpression(node, candidatesOutArray) {
if (node.arguments && languageVersion < 1) {
@@ -37332,7 +37575,7 @@ var ts;
return silentNeverSignature;
}
expressionType = getApparentType(expressionType);
- if (expressionType === unknownType) {
+ if (expressionType === errorType) {
return resolveErrorCall(node);
}
if (isTypeAny(expressionType)) {
@@ -37423,7 +37666,7 @@ var ts;
function resolveTaggedTemplateExpression(node, candidatesOutArray) {
var tagType = checkExpression(node.tag);
var apparentType = getApparentType(tagType);
- if (apparentType === unknownType) {
+ if (apparentType === errorType) {
return resolveErrorCall(node);
}
var callSignatures = getSignaturesOfType(apparentType, 0);
@@ -37439,23 +37682,25 @@ var ts;
}
function getDiagnosticHeadMessageForDecoratorResolution(node) {
switch (node.parent.kind) {
- case 234:
- case 204:
+ case 235:
+ case 205:
return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression;
- case 148:
+ case 149:
return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression;
- case 151:
+ case 152:
return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;
- case 153:
- case 155:
+ case 154:
case 156:
+ case 157:
return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression;
+ default:
+ return ts.Debug.fail();
}
}
function resolveDecorator(node, candidatesOutArray) {
var funcType = checkExpression(node.expression);
var apparentType = getApparentType(funcType);
- if (apparentType === unknownType) {
+ if (apparentType === errorType) {
return resolveErrorCall(node);
}
var callSignatures = getSignaturesOfType(apparentType, 0);
@@ -37470,8 +37715,7 @@ var ts;
}
var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
if (!callSignatures.length) {
- var errorInfo = void 0;
- errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType));
+ var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType));
errorInfo = ts.chainDiagnosticMessages(errorInfo, headMessage);
diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(node, errorInfo));
invocationErrorRecovery(apparentType, 0);
@@ -37487,7 +37731,7 @@ var ts;
});
}
function getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, candidatesOutArray) {
- ts.Debug.assert(!(elementType.flags & 131072));
+ ts.Debug.assert(!(elementType.flags & 262144));
var callSignatures = elementType && getSignaturesOfType(elementType, 0);
if (callSignatures && callSignatures.length > 0) {
return resolveCall(openingLikeElement, callSignatures, candidatesOutArray);
@@ -37496,16 +37740,16 @@ var ts;
}
function resolveSignature(node, candidatesOutArray) {
switch (node.kind) {
- case 186:
- return resolveCallExpression(node, candidatesOutArray);
case 187:
- return resolveNewExpression(node, candidatesOutArray);
+ return resolveCallExpression(node, candidatesOutArray);
case 188:
+ return resolveNewExpression(node, candidatesOutArray);
+ case 189:
return resolveTaggedTemplateExpression(node, candidatesOutArray);
- case 149:
+ case 150:
return resolveDecorator(node, candidatesOutArray);
+ case 257:
case 256:
- case 255:
var exprTypes = checkExpression(node.tagName);
return forEachType(exprTypes, function (exprType) {
var sfcResult = getResolvedJsxStatelessFunctionSignature(node, exprType, candidatesOutArray);
@@ -37519,7 +37763,7 @@ var ts;
return ts.length(sigs) ? sigs[0] : unknownSignature;
}) || unknownSignature;
}
- ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable.");
+ throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable.");
}
function getResolvedSignature(node, candidatesOutArray) {
var links = getNodeLinks(node);
@@ -37539,15 +37783,11 @@ var ts;
var symbol = ts.isFunctionDeclaration(node) || ts.isFunctionExpression(node) ? getSymbolOfNode(node) :
ts.isVariableDeclaration(node) && node.initializer && ts.isFunctionExpression(node.initializer) ? getSymbolOfNode(node.initializer) :
undefined;
- return symbol && symbol.members !== undefined;
+ return !!symbol && symbol.members !== undefined;
}
return false;
}
function getJavaScriptClassType(symbol) {
- var initializer = ts.getDeclaredJavascriptInitializer(symbol.valueDeclaration);
- if (initializer) {
- symbol = getSymbolOfNode(initializer);
- }
var inferred;
if (isJavaScriptConstructor(symbol.valueDeclaration)) {
inferred = getInferredClassType(symbol);
@@ -37578,7 +37818,7 @@ var ts;
return false;
}
var parent = node.parent;
- while (parent && parent.kind === 184) {
+ while (parent && parent.kind === 185) {
parent = parent.parent;
}
if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 58) {
@@ -37605,12 +37845,12 @@ var ts;
if (node.expression.kind === 97) {
return voidType;
}
- if (node.kind === 187) {
+ if (node.kind === 188) {
var declaration = signature.declaration;
if (declaration &&
- declaration.kind !== 154 &&
- declaration.kind !== 158 &&
- declaration.kind !== 163 &&
+ declaration.kind !== 155 &&
+ declaration.kind !== 159 &&
+ declaration.kind !== 164 &&
!ts.isJSDocConstructSignature(declaration)) {
var funcSymbol = checkExpression(node.expression).symbol;
if (!funcSymbol && node.expression.kind === 71) {
@@ -37630,10 +37870,20 @@ var ts;
return resolveExternalModuleTypeByLiteral(node.arguments[0]);
}
var returnType = getReturnTypeOfSignature(signature);
- if (returnType.flags & 1536 && isSymbolOrSymbolForCall(node)) {
+ if (returnType.flags & 3072 && isSymbolOrSymbolForCall(node)) {
return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent));
}
- return returnType;
+ var jsAssignmentType;
+ if (ts.isInJavaScriptFile(node)) {
+ var decl = ts.getDeclarationOfJSInitializer(node);
+ if (decl) {
+ var jsSymbol = getSymbolOfNode(decl);
+ if (jsSymbol && ts.hasEntries(jsSymbol.exports)) {
+ jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts.emptyArray, ts.emptyArray, jsObjectLiteralIndexInfo, undefined);
+ }
+ }
+ }
+ return jsAssignmentType ? getIntersectionType([returnType, jsAssignmentType]) : returnType;
}
function isSymbolOrSymbolForCall(node) {
if (!ts.isCallExpression(node))
@@ -37662,7 +37912,7 @@ var ts;
for (var i = 1; i < node.arguments.length; ++i) {
checkExpressionCached(node.arguments[i]);
}
- if (specifierType.flags & 4096 || specifierType.flags & 8192 || !isTypeAssignableTo(specifierType, stringType)) {
+ if (specifierType.flags & 8192 || specifierType.flags & 16384 || !isTypeAssignableTo(specifierType, stringType)) {
error(specifier, ts.Diagnostics.Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0, typeToString(specifierType));
}
var moduleSymbol = resolveExternalModuleName(node, specifier);
@@ -37675,7 +37925,7 @@ var ts;
return createPromiseReturnType(node, anyType);
}
function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol) {
- if (allowSyntheticDefaultImports && type && type !== unknownType) {
+ if (allowSyntheticDefaultImports && type && type !== errorType) {
var synthType = type;
if (!synthType.syntheticType) {
var file = ts.find(originalSymbol.declarations, ts.isSourceFile);
@@ -37712,9 +37962,9 @@ var ts;
return false;
}
var targetDeclarationKind = resolvedRequire.flags & 16
- ? 233
+ ? 234
: resolvedRequire.flags & 3
- ? 231
+ ? 232
: 0;
if (targetDeclarationKind !== 0) {
var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind);
@@ -37736,7 +37986,7 @@ var ts;
var exprType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(checkExpression(expression, checkMode)));
checkSourceElement(type);
var targetType = getTypeFromTypeNode(type);
- if (produceDiagnostics && targetType !== unknownType) {
+ if (produceDiagnostics && targetType !== errorType) {
var widenedType = getWidenedType(exprType);
if (!isTypeComparableTo(targetType, widenedType)) {
checkTypeComparableTo(exprType, targetType, errNode, ts.Diagnostics.Type_0_cannot_be_converted_to_type_1);
@@ -37755,14 +38005,15 @@ var ts;
if (node.keywordToken === 91) {
return checkImportMetaProperty(node);
}
+ return ts.Debug.assertNever(node.keywordToken);
}
function checkNewTargetMetaProperty(node) {
var container = ts.getNewTargetContainer(node);
if (!container) {
error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target");
- return unknownType;
+ return errorType;
}
- else if (container.kind === 154) {
+ else if (container.kind === 155) {
var symbol = getSymbolOfNode(container.parent);
return getTypeOfSymbol(symbol);
}
@@ -37778,7 +38029,7 @@ var ts;
var file = ts.getSourceFileOfNode(node);
ts.Debug.assert(!!(file.flags & 1048576), "Containing file is missing import meta node flag.");
ts.Debug.assert(!!file.externalModuleIndicator, "Containing file should be a module.");
- return node.name.escapedText === "meta" ? getGlobalImportMetaType() : unknownType;
+ return node.name.escapedText === "meta" ? getGlobalImportMetaType() : errorType;
}
function getTypeOfParameter(symbol) {
var type = getTypeOfSymbol(symbol);
@@ -37833,9 +38084,9 @@ var ts;
}
}
if (signature.hasRestParameter && isRestParameterIndex(context, signature.parameters.length - 1)) {
- var parameter = ts.lastOrUndefined(signature.parameters);
+ var parameter = ts.last(signature.parameters);
if (isTransientSymbol(parameter) || !ts.getEffectiveTypeAnnotationNode(parameter.valueDeclaration)) {
- var contextualParameterType = getTypeOfSymbol(ts.lastOrUndefined(context.parameters));
+ var contextualParameterType = getTypeOfSymbol(ts.last(context.parameters));
assignTypeToParameterAndFixTypeParameters(parameter, contextualParameterType);
}
}
@@ -37880,7 +38131,7 @@ var ts;
error(func, ts.isImportCall(func) ?
ts.Diagnostics.A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option :
ts.Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option);
- return unknownType;
+ return errorType;
}
else if (!getGlobalPromiseConstructorSymbol(true)) {
error(func, ts.isImportCall(func) ?
@@ -37891,11 +38142,11 @@ var ts;
}
function getReturnTypeFromBody(func, checkMode) {
if (!func.body) {
- return unknownType;
+ return errorType;
}
var functionFlags = ts.getFunctionFlags(func);
var type;
- if (func.body.kind !== 212) {
+ if (func.body.kind !== 213) {
type = checkExpressionCached(func.body, checkMode);
if (functionFlags & 2) {
type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
@@ -37998,7 +38249,7 @@ var ts;
if (!(func.flags & 128)) {
return false;
}
- if (ts.some(func.body.statements, function (statement) { return statement.kind === 226 && isExhaustiveSwitchStatement(statement); })) {
+ if (ts.some(func.body.statements, function (statement) { return statement.kind === 227 && isExhaustiveSwitchStatement(statement); })) {
return false;
}
return true;
@@ -38015,7 +38266,7 @@ var ts;
if (functionFlags & 2) {
type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
}
- if (type.flags & 16384) {
+ if (type.flags & 32768) {
hasReturnOfTypeNever = true;
}
ts.pushIfUnique(aggregatedTypes, type);
@@ -38035,11 +38286,11 @@ var ts;
}
function mayReturnNever(func) {
switch (func.kind) {
- case 191:
case 192:
+ case 193:
return true;
- case 153:
- return func.parent.kind === 183;
+ case 154:
+ return func.parent.kind === 184;
default:
return false;
}
@@ -38048,14 +38299,14 @@ var ts;
if (!produceDiagnostics) {
return;
}
- if (returnType && maybeTypeOfKind(returnType, 1 | 2048)) {
+ if (returnType && maybeTypeOfKind(returnType, 3 | 4096)) {
return;
}
- if (func.kind === 152 || ts.nodeIsMissing(func.body) || func.body.kind !== 212 || !functionHasImplicitReturn(func)) {
+ if (func.kind === 153 || ts.nodeIsMissing(func.body) || func.body.kind !== 213 || !functionHasImplicitReturn(func)) {
return;
}
var hasExplicitReturn = func.flags & 256;
- if (returnType && returnType.flags & 16384) {
+ if (returnType && returnType.flags & 32768) {
error(ts.getEffectiveReturnTypeNode(func), ts.Diagnostics.A_function_returning_never_cannot_have_a_reachable_end_point);
}
else if (returnType && !hasExplicitReturn) {
@@ -38078,12 +38329,12 @@ var ts;
}
}
function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) {
- ts.Debug.assert(node.kind !== 153 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 154 || ts.isObjectLiteralMethod(node));
if (checkMode === 1 && isContextSensitive(node)) {
return anyFunctionType;
}
var hasGrammarError = checkGrammarFunctionLikeDeclaration(node);
- if (!hasGrammarError && node.kind === 191) {
+ if (!hasGrammarError && node.kind === 192) {
checkGrammarForGenerator(node);
}
var links = getNodeLinks(node);
@@ -38120,7 +38371,7 @@ var ts;
return type;
}
function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) {
- ts.Debug.assert(node.kind !== 153 || ts.isObjectLiteralMethod(node));
+ ts.Debug.assert(node.kind !== 154 || ts.isObjectLiteralMethod(node));
var functionFlags = ts.getFunctionFlags(node);
var returnTypeNode = ts.getEffectiveReturnTypeNode(node);
var returnOrPromisedType = returnTypeNode &&
@@ -38134,7 +38385,7 @@ var ts;
if (!returnTypeNode) {
getReturnTypeOfSignature(getSignatureFromDeclaration(node));
}
- if (node.body.kind === 212) {
+ if (node.body.kind === 213) {
checkSourceElement(node.body);
}
else {
@@ -38152,7 +38403,7 @@ var ts;
}
}
function checkArithmeticOperandType(operand, type, diagnostic) {
- if (!isTypeAssignableToKind(type, 84)) {
+ if (!isTypeAssignableToKind(type, 168)) {
error(operand, diagnostic);
return false;
}
@@ -38168,10 +38419,10 @@ var ts;
function isReferenceToReadonlyEntity(expr, symbol) {
if (isReadonlySymbol(symbol)) {
if (symbol.flags & 4 &&
- (expr.kind === 184 || expr.kind === 185) &&
+ (expr.kind === 185 || expr.kind === 186) &&
expr.expression.kind === 99) {
var func = ts.getContainingFunction(expr);
- if (!(func && func.kind === 154)) {
+ if (!(func && func.kind === 155)) {
return true;
}
return !(func.parent === symbol.valueDeclaration.parent || func === symbol.valueDeclaration.parent);
@@ -38181,13 +38432,13 @@ var ts;
return false;
}
function isReferenceThroughNamespaceImport(expr) {
- if (expr.kind === 184 || expr.kind === 185) {
+ if (expr.kind === 185 || expr.kind === 186) {
var node = ts.skipParentheses(expr.expression);
if (node.kind === 71) {
var symbol = getNodeLinks(node).resolvedSymbol;
if (symbol.flags & 2097152) {
var declaration = getDeclarationOfAliasSymbol(symbol);
- return declaration && declaration.kind === 245;
+ return !!declaration && declaration.kind === 246;
}
}
}
@@ -38195,7 +38446,7 @@ var ts;
}
function checkReferenceExpression(expr, invalidReferenceMessage) {
var node = ts.skipOuterExpressions(expr, 2 | 1);
- if (node.kind !== 71 && node.kind !== 184 && node.kind !== 185) {
+ if (node.kind !== 71 && node.kind !== 185 && node.kind !== 186) {
error(expr, invalidReferenceMessage);
return false;
}
@@ -38204,7 +38455,7 @@ var ts;
function checkDeleteExpression(node) {
checkExpression(node.expression);
var expr = ts.skipParentheses(node.expression);
- if (expr.kind !== 184 && expr.kind !== 185) {
+ if (expr.kind !== 185 && expr.kind !== 186) {
error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference);
return booleanType;
}
@@ -38253,7 +38504,7 @@ var ts;
case 38:
case 52:
checkNonNullType(operandType, node.operand);
- if (maybeTypeOfKind(operandType, 1536)) {
+ if (maybeTypeOfKind(operandType, 3072)) {
error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator));
}
return numberType;
@@ -38270,7 +38521,7 @@ var ts;
}
return numberType;
}
- return unknownType;
+ return errorType;
}
function checkPostfixUnaryExpression(node) {
var operandType = checkExpression(node.operand);
@@ -38284,10 +38535,10 @@ var ts;
return numberType;
}
function maybeTypeOfKind(type, kind) {
- if (type.flags & kind || kind & 536870912 && isGenericMappedType(type)) {
+ if (type.flags & kind & ~134217728 || kind & 134217728 && isGenericMappedType(type)) {
return true;
}
- if (type.flags & 393216) {
+ if (type.flags & 786432) {
var types = type.types;
for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
var t = types_16[_i];
@@ -38302,26 +38553,26 @@ var ts;
if (source.flags & kind) {
return true;
}
- if (strict && source.flags & (1 | 2048 | 4096 | 8192)) {
+ if (strict && source.flags & (3 | 4096 | 8192 | 16384)) {
return false;
}
- return (kind & 84 && isTypeAssignableTo(source, numberType)) ||
- (kind & 34 && isTypeAssignableTo(source, stringType)) ||
- (kind & 136 && isTypeAssignableTo(source, booleanType)) ||
- (kind & 2048 && isTypeAssignableTo(source, voidType)) ||
- (kind & 16384 && isTypeAssignableTo(source, neverType)) ||
- (kind & 8192 && isTypeAssignableTo(source, nullType)) ||
- (kind & 4096 && isTypeAssignableTo(source, undefinedType)) ||
- (kind & 512 && isTypeAssignableTo(source, esSymbolType)) ||
- (kind & 134217728 && isTypeAssignableTo(source, nonPrimitiveType));
+ return !!(kind & 168) && isTypeAssignableTo(source, numberType) ||
+ !!(kind & 68) && isTypeAssignableTo(source, stringType) ||
+ !!(kind & 272) && isTypeAssignableTo(source, booleanType) ||
+ !!(kind & 4096) && isTypeAssignableTo(source, voidType) ||
+ !!(kind & 32768) && isTypeAssignableTo(source, neverType) ||
+ !!(kind & 16384) && isTypeAssignableTo(source, nullType) ||
+ !!(kind & 8192) && isTypeAssignableTo(source, undefinedType) ||
+ !!(kind & 1024) && isTypeAssignableTo(source, esSymbolType) ||
+ !!(kind & 16777216) && isTypeAssignableTo(source, nonPrimitiveType);
}
function allTypesAssignableToKind(source, kind, strict) {
- return source.flags & 131072 ?
+ return source.flags & 262144 ?
ts.every(source.types, function (subType) { return allTypesAssignableToKind(subType, kind, strict); }) :
isTypeAssignableToKind(source, kind, strict);
}
function isConstEnumObjectType(type) {
- return ts.getObjectFlags(type) & 16 && type.symbol && isConstEnumSymbol(type.symbol);
+ return !!(ts.getObjectFlags(type) & 16) && !!type.symbol && isConstEnumSymbol(type.symbol);
}
function isConstEnumSymbol(symbol) {
return (symbol.flags & 128) !== 0;
@@ -38331,7 +38582,7 @@ var ts;
return silentNeverType;
}
if (!isTypeAny(leftType) &&
- allTypesAssignableToKind(leftType, 16382)) {
+ allTypesAssignableToKind(leftType, 32764)) {
error(left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter);
}
if (!(isTypeAny(rightType) || typeHasCallOrConstructSignatures(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) {
@@ -38345,10 +38596,10 @@ var ts;
}
leftType = checkNonNullType(leftType, left);
rightType = checkNonNullType(rightType, right);
- if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 84 | 1536))) {
+ if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 168 | 3072))) {
error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol);
}
- if (!isTypeAssignableToKind(rightType, 134217728 | 7372800)) {
+ if (!isTypeAssignableToKind(rightType, 16777216 | 14745600)) {
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;
@@ -38366,9 +38617,9 @@ var ts;
return sourceType;
}
function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, allProperties) {
- if (property.kind === 269 || property.kind === 270) {
+ if (property.kind === 270 || property.kind === 271) {
var name = property.name;
- if (name.kind === 146) {
+ if (name.kind === 147) {
checkComputedPropertyName(name);
}
if (isComputedNonLiteralName(name)) {
@@ -38381,7 +38632,7 @@ var ts;
isNumericLiteralName(text) && getIndexTypeOfType(objectLiteralType, 1) ||
getIndexTypeOfType(objectLiteralType, 0);
if (type) {
- if (property.kind === 270) {
+ if (property.kind === 271) {
return checkDestructuringAssignment(property, type);
}
else {
@@ -38392,7 +38643,7 @@ var ts;
error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name));
}
}
- else if (property.kind === 271) {
+ else if (property.kind === 272) {
if (languageVersion < 6) {
checkExternalEmitHelpers(property, 4);
}
@@ -38415,7 +38666,7 @@ var ts;
if (languageVersion < 2 && compilerOptions.downlevelIteration) {
checkExternalEmitHelpers(node, 512);
}
- var elementType = checkIteratedTypeOrElementType(sourceType, node, false, false) || unknownType;
+ var elementType = checkIteratedTypeOrElementType(sourceType, node, false, false) || errorType;
for (var i = 0; i < elements.length; i++) {
checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, checkMode);
}
@@ -38424,8 +38675,8 @@ var ts;
function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) {
var elements = node.elements;
var element = elements[elementIndex];
- if (element.kind !== 205) {
- if (element.kind !== 203) {
+ if (element.kind !== 206) {
+ if (element.kind !== 204) {
var propName = "" + elementIndex;
var type = isTypeAny(sourceType)
? sourceType
@@ -38451,7 +38702,7 @@ var ts;
}
else {
var restExpression = element.expression;
- if (restExpression.kind === 199 && restExpression.operatorToken.kind === 58) {
+ if (restExpression.kind === 200 && restExpression.operatorToken.kind === 58) {
error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer);
}
else {
@@ -38464,11 +38715,11 @@ var ts;
}
function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode) {
var target;
- if (exprOrAssignment.kind === 270) {
+ if (exprOrAssignment.kind === 271) {
var prop = exprOrAssignment;
if (prop.objectAssignmentInitializer) {
if (strictNullChecks &&
- !(getFalsyFlags(checkExpression(prop.objectAssignmentInitializer)) & 4096)) {
+ !(getFalsyFlags(checkExpression(prop.objectAssignmentInitializer)) & 8192)) {
sourceType = getTypeWithFacts(sourceType, 131072);
}
checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode);
@@ -38478,21 +38729,21 @@ var ts;
else {
target = exprOrAssignment;
}
- if (target.kind === 199 && target.operatorToken.kind === 58) {
+ if (target.kind === 200 && target.operatorToken.kind === 58) {
checkBinaryExpression(target, checkMode);
target = target.left;
}
- if (target.kind === 183) {
+ if (target.kind === 184) {
return checkObjectLiteralAssignment(target, sourceType);
}
- if (target.kind === 182) {
+ if (target.kind === 183) {
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 === 271 ?
+ var error = target.parent.kind === 272 ?
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;
if (checkReferenceExpression(target, error)) {
@@ -38506,35 +38757,35 @@ var ts;
case 71:
case 9:
case 12:
- case 188:
- case 201:
+ case 189:
+ case 202:
case 13:
case 8:
case 101:
case 86:
case 95:
case 140:
- case 191:
- case 204:
case 192:
- case 182:
+ case 205:
+ case 193:
case 183:
- case 194:
- case 208:
+ case 184:
+ case 195:
+ case 209:
+ case 256:
case 255:
- case 254:
return true;
- case 200:
+ case 201:
return isSideEffectFree(node.whenTrue) &&
isSideEffectFree(node.whenFalse);
- case 199:
+ case 200:
if (ts.isAssignmentOperator(node.operatorToken.kind)) {
return false;
}
return isSideEffectFree(node.left) &&
isSideEffectFree(node.right);
- case 197:
case 198:
+ case 199:
switch (node.operator) {
case 51:
case 37:
@@ -38543,15 +38794,15 @@ var ts;
return true;
}
return false;
- case 195:
- case 189:
- case 207:
+ case 196:
+ case 190:
+ case 208:
default:
return false;
}
}
function isTypeEqualityComparableTo(source, target) {
- return (target.flags & 12288) !== 0 || isTypeComparableTo(source, target);
+ return (target.flags & 24576) !== 0 || isTypeComparableTo(source, target);
}
function checkBinaryExpression(node, checkMode) {
if (ts.isInJavaScriptFile(node) && ts.getAssignedJavascriptInitializer(node)) {
@@ -38561,7 +38812,7 @@ var ts;
}
function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) {
var operator = operatorToken.kind;
- if (operator === 58 && (left.kind === 183 || left.kind === 182)) {
+ if (operator === 58 && (left.kind === 184 || left.kind === 183)) {
return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode);
}
var leftType = checkExpression(left, checkMode);
@@ -38595,8 +38846,8 @@ var ts;
leftType = checkNonNullType(leftType, left);
rightType = checkNonNullType(rightType, right);
var suggestedOperator = void 0;
- if ((leftType.flags & 136) &&
- (rightType.flags & 136) &&
+ if ((leftType.flags & 272) &&
+ (rightType.flags & 272) &&
(suggestedOperator = getSuggestedBooleanOperator(operatorToken.kind)) !== undefined) {
error(errorNode || operatorToken, ts.Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, ts.tokenToString(operatorToken.kind), ts.tokenToString(suggestedOperator));
}
@@ -38613,19 +38864,19 @@ var ts;
if (leftType === silentNeverType || rightType === silentNeverType) {
return silentNeverType;
}
- if (!isTypeAssignableToKind(leftType, 34) && !isTypeAssignableToKind(rightType, 34)) {
+ if (!isTypeAssignableToKind(leftType, 68) && !isTypeAssignableToKind(rightType, 68)) {
leftType = checkNonNullType(leftType, left);
rightType = checkNonNullType(rightType, right);
}
var resultType = void 0;
- if (isTypeAssignableToKind(leftType, 84, true) && isTypeAssignableToKind(rightType, 84, true)) {
+ if (isTypeAssignableToKind(leftType, 168, true) && isTypeAssignableToKind(rightType, 168, true)) {
resultType = numberType;
}
- else if (isTypeAssignableToKind(leftType, 34, true) || isTypeAssignableToKind(rightType, 34, true)) {
+ else if (isTypeAssignableToKind(leftType, 68, true) || isTypeAssignableToKind(rightType, 68, true)) {
resultType = stringType;
}
else if (isTypeAny(leftType) || isTypeAny(rightType)) {
- resultType = leftType === unknownType || rightType === unknownType ? unknownType : anyType;
+ resultType = leftType === errorType || rightType === errorType ? errorType : anyType;
}
if (resultType && !checkForDisallowedESSymbolOperand(operator)) {
return resultType;
@@ -38685,6 +38936,8 @@ var ts;
error(left, ts.Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects);
}
return rightType;
+ default:
+ return ts.Debug.fail();
}
function checkSpecialAssignment(left, right) {
var special = ts.getSpecialPropertyAssignmentKind(left.parent);
@@ -38696,7 +38949,7 @@ var ts;
if (propType.symbol && propType.symbol.flags & 32) {
var name = prop.escapedName;
var symbol = resolveName(prop.valueDeclaration, name, 67901928, undefined, name, false);
- if (symbol) {
+ if (symbol && symbol.declarations.some(function (d) { return d.kind === 297; })) {
grammarErrorOnNode(symbol.declarations[0], ts.Diagnostics.Duplicate_identifier_0, ts.unescapeLeadingUnderscores(name));
return grammarErrorOnNode(prop.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0, ts.unescapeLeadingUnderscores(name));
}
@@ -38708,8 +38961,8 @@ var ts;
return node.kind === 71 && node.escapedText === "eval";
}
function checkForDisallowedESSymbolOperand(operator) {
- var offendingSymbolOperand = maybeTypeOfKind(leftType, 1536) ? left :
- maybeTypeOfKind(rightType, 1536) ? right :
+ var offendingSymbolOperand = maybeTypeOfKind(leftType, 3072) ? left :
+ maybeTypeOfKind(rightType, 3072) ? right :
undefined;
if (offendingSymbolOperand) {
error(offendingSymbolOperand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(operator));
@@ -38769,7 +39022,9 @@ var ts;
}
}
var func = ts.getContainingFunction(node);
- var functionFlags = func ? ts.getFunctionFlags(func) : 0;
+ if (!func)
+ return anyType;
+ var functionFlags = ts.getFunctionFlags(func);
if (!(functionFlags & 1)) {
return anyType;
}
@@ -38800,14 +39055,14 @@ var ts;
}
function checkTemplateExpression(node) {
ts.forEach(node.templateSpans, function (templateSpan) {
- if (maybeTypeOfKind(checkExpression(templateSpan.expression), 1536)) {
+ if (maybeTypeOfKind(checkExpression(templateSpan.expression), 3072)) {
error(templateSpan.expression, ts.Diagnostics.Type_0_cannot_be_converted_to_type_1, typeToString(esSymbolType), typeToString(stringType));
}
});
return stringType;
}
function getContextNode(node) {
- if (node.kind === 262) {
+ if (node.kind === 263) {
return node.parent.parent;
}
return node;
@@ -38840,17 +39095,16 @@ var ts;
}
function isTypeAssertion(node) {
node = ts.skipParentheses(node);
- return node.kind === 189 || node.kind === 207;
+ return node.kind === 190 || node.kind === 208;
}
function checkDeclarationInitializer(declaration) {
- var inJs = ts.isInJavaScriptFile(declaration);
- var initializer = inJs && ts.getDeclaredJavascriptInitializer(declaration) || declaration.initializer;
+ var initializer = ts.getEffectiveInitializer(declaration);
var type = getTypeOfExpression(initializer, true);
var widened = ts.getCombinedNodeFlags(declaration) & 2 ||
(ts.getCombinedModifierFlags(declaration) & 64 && !ts.isParameterPropertyDeclaration(declaration)) ||
isTypeAssertion(initializer) ? type : getWidenedLiteralType(type);
- if (inJs) {
- if (widened.flags & 12288) {
+ if (ts.isInJavaScriptFile(declaration)) {
+ if (widened.flags & 24576) {
if (noImplicitAny) {
reportImplicitAnyError(declaration, anyType);
}
@@ -38865,33 +39119,23 @@ var ts;
}
return widened;
}
- function isTypeParameterWithKeyofConstraint(type) {
- if (type.flags & 32768) {
- var constraintDeclaration = getConstraintDeclaration(type);
- return constraintDeclaration && constraintDeclaration.kind === 174 &&
- constraintDeclaration.operator === 128;
- }
- return false;
- }
function isLiteralOfContextualType(candidateType, contextualType) {
if (contextualType) {
- if (contextualType.flags & 393216) {
+ if (contextualType.flags & 786432) {
var types = contextualType.types;
return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); });
}
- if (contextualType.flags & 7372800) {
+ if (contextualType.flags & 14745600) {
var constraint = getBaseConstraintOfType(contextualType) || emptyObjectType;
- return isTypeParameterWithKeyofConstraint(contextualType) && maybeTypeOfKind(candidateType, 32 | 64 | 1024) ||
- constraint.flags & 2 && maybeTypeOfKind(candidateType, 32) ||
- constraint.flags & 4 && maybeTypeOfKind(candidateType, 64) ||
- constraint.flags & 8 && maybeTypeOfKind(candidateType, 128) ||
- constraint.flags & 512 && maybeTypeOfKind(candidateType, 1024) ||
+ return maybeTypeOfKind(constraint, 4) && maybeTypeOfKind(candidateType, 64) ||
+ maybeTypeOfKind(constraint, 8) && maybeTypeOfKind(candidateType, 128) ||
+ maybeTypeOfKind(constraint, 1024) && maybeTypeOfKind(candidateType, 2048) ||
isLiteralOfContextualType(candidateType, constraint);
}
- return contextualType.flags & (32 | 524288) && maybeTypeOfKind(candidateType, 32) ||
- contextualType.flags & 64 && maybeTypeOfKind(candidateType, 64) ||
+ return !!(contextualType.flags & (64 | 1048576) && maybeTypeOfKind(candidateType, 64) ||
contextualType.flags & 128 && maybeTypeOfKind(candidateType, 128) ||
- contextualType.flags & 1024 && maybeTypeOfKind(candidateType, 1024);
+ contextualType.flags & 256 && maybeTypeOfKind(candidateType, 256) ||
+ contextualType.flags & 2048 && maybeTypeOfKind(candidateType, 2048));
}
return false;
}
@@ -38904,14 +39148,14 @@ var ts;
getWidenedLiteralLikeTypeForContextualType(type, contextualType);
}
function checkPropertyAssignment(node, checkMode) {
- if (node.name.kind === 146) {
+ if (node.name.kind === 147) {
checkComputedPropertyName(node.name);
}
return checkExpressionForMutableLocation(node.initializer, checkMode);
}
function checkObjectLiteralMethod(node, checkMode) {
checkGrammarMethod(node);
- if (node.name.kind === 146) {
+ if (node.name.kind === 147) {
checkComputedPropertyName(node.name);
}
var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);
@@ -38933,7 +39177,7 @@ var ts;
return type;
}
function getTypeOfExpression(node, cache) {
- if (node.kind === 186 && node.expression.kind !== 97 && !ts.isRequireCall(node, true) && !isSymbolOrSymbolForCall(node)) {
+ if (node.kind === 187 && node.expression.kind !== 97 && !ts.isRequireCall(node, true) && !isSymbolOrSymbolForCall(node)) {
var funcType = checkNonNullExpression(node.expression);
var signature = getSingleCallSignature(funcType);
if (signature && !signature.typeParameters) {
@@ -38951,7 +39195,7 @@ var ts;
}
function checkExpression(node, checkMode) {
var type;
- if (node.kind === 145) {
+ if (node.kind === 146) {
type = checkQualifiedName(node);
}
else {
@@ -38959,10 +39203,10 @@ var ts;
type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode);
}
if (isConstEnumObjectType(type)) {
- var ok = (node.parent.kind === 184 && node.parent.expression === node) ||
- (node.parent.kind === 185 && node.parent.expression === node) ||
- ((node.kind === 71 || node.kind === 145) && isInRightSideOfImportOrExportAssignment(node) ||
- (node.parent.kind === 164 && node.parent.exprName === node));
+ var ok = (node.parent.kind === 185 && node.parent.expression === node) ||
+ (node.parent.kind === 186 && node.parent.expression === node) ||
+ ((node.kind === 71 || node.kind === 146) && isInRightSideOfImportOrExportAssignment(node) ||
+ (node.parent.kind === 165 && node.parent.exprName === node));
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);
}
@@ -38996,76 +39240,76 @@ var ts;
return trueType;
case 86:
return falseType;
- case 201:
+ case 202:
return checkTemplateExpression(node);
case 12:
return globalRegExpType;
- case 182:
- return checkArrayLiteral(node, checkMode);
case 183:
- return checkObjectLiteral(node, checkMode);
+ return checkArrayLiteral(node, checkMode);
case 184:
- return checkPropertyAccessExpression(node);
+ return checkObjectLiteral(node, checkMode);
case 185:
- return checkIndexedAccess(node);
+ return checkPropertyAccessExpression(node);
case 186:
+ return checkIndexedAccess(node);
+ case 187:
if (node.expression.kind === 91) {
return checkImportCallExpression(node);
}
- case 187:
- return checkCallExpression(node);
case 188:
- return checkTaggedTemplateExpression(node);
- case 190:
- return checkParenthesizedExpression(node, checkMode);
- case 204:
- return checkClassExpression(node);
- case 191:
- case 192:
- return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);
- case 194:
- return checkTypeOfExpression(node);
+ return checkCallExpression(node);
case 189:
- case 207:
- return checkAssertion(node);
- case 208:
- return checkNonNullAssertion(node);
- case 209:
- return checkMetaProperty(node);
- case 193:
- return checkDeleteExpression(node);
- case 195:
- return checkVoidExpression(node);
- case 196:
- return checkAwaitExpression(node);
- case 197:
- return checkPrefixUnaryExpression(node);
- case 198:
- return checkPostfixUnaryExpression(node);
- case 199:
- return checkBinaryExpression(node, checkMode);
- case 200:
- return checkConditionalExpression(node, checkMode);
- case 203:
- return checkSpreadExpression(node, checkMode);
+ return checkTaggedTemplateExpression(node);
+ case 191:
+ return checkParenthesizedExpression(node, checkMode);
case 205:
+ return checkClassExpression(node);
+ case 192:
+ case 193:
+ return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode);
+ case 195:
+ return checkTypeOfExpression(node);
+ case 190:
+ case 208:
+ return checkAssertion(node);
+ case 209:
+ return checkNonNullAssertion(node);
+ case 210:
+ return checkMetaProperty(node);
+ case 194:
+ return checkDeleteExpression(node);
+ case 196:
+ return checkVoidExpression(node);
+ case 197:
+ return checkAwaitExpression(node);
+ case 198:
+ return checkPrefixUnaryExpression(node);
+ case 199:
+ return checkPostfixUnaryExpression(node);
+ case 200:
+ return checkBinaryExpression(node, checkMode);
+ case 201:
+ return checkConditionalExpression(node, checkMode);
+ case 204:
+ return checkSpreadExpression(node, checkMode);
+ case 206:
return undefinedWideningType;
- case 202:
+ case 203:
return checkYieldExpression(node);
- case 264:
+ case 265:
return checkJsxExpression(node, checkMode);
- case 254:
- return checkJsxElement(node, checkMode);
case 255:
- return checkJsxSelfClosingElement(node, checkMode);
- case 258:
- return checkJsxFragment(node, checkMode);
- case 262:
- return checkJsxAttributes(node, checkMode);
+ return checkJsxElement(node, checkMode);
case 256:
+ return checkJsxSelfClosingElement(node, checkMode);
+ case 259:
+ return checkJsxFragment(node, checkMode);
+ case 263:
+ return checkJsxAttributes(node, checkMode);
+ case 257:
ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement");
}
- return unknownType;
+ return errorType;
}
function checkTypeParameter(node) {
if (node.expression) {
@@ -39094,7 +39338,7 @@ var ts;
checkVariableLikeDeclaration(node);
var func = ts.getContainingFunction(node);
if (ts.hasModifier(node, 92)) {
- if (!(func.kind === 154 && ts.nodeIsPresent(func.body))) {
+ if (!(func.kind === 155 && ts.nodeIsPresent(func.body))) {
error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
}
}
@@ -39105,7 +39349,7 @@ 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 === 154 || func.kind === 158 || func.kind === 163) {
+ if (func.kind === 155 || func.kind === 159 || func.kind === 164) {
error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter);
}
}
@@ -39167,13 +39411,13 @@ var ts;
}
function getTypePredicateParent(node) {
switch (node.parent.kind) {
+ case 193:
+ case 158:
+ case 234:
case 192:
- case 157:
- case 233:
- case 191:
- case 162:
+ case 163:
+ case 154:
case 153:
- case 152:
var parent = node.parent;
if (node === parent.type) {
return parent;
@@ -39191,7 +39435,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 === 180 || name.kind === 179) {
+ else if (name.kind === 181 || name.kind === 180) {
if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) {
return true;
}
@@ -39199,12 +39443,12 @@ var ts;
}
}
function checkSignatureDeclaration(node) {
- if (node.kind === 159) {
+ if (node.kind === 160) {
checkGrammarIndexSignature(node);
}
- else if (node.kind === 162 || node.kind === 233 || node.kind === 163 ||
- node.kind === 157 || node.kind === 154 ||
- node.kind === 158) {
+ else if (node.kind === 163 || node.kind === 234 || node.kind === 164 ||
+ node.kind === 158 || node.kind === 155 ||
+ node.kind === 159) {
checkGrammarFunctionLikeDeclaration(node);
}
var functionFlags = ts.getFunctionFlags(node);
@@ -39229,10 +39473,10 @@ var ts;
var returnTypeNode = ts.getEffectiveReturnTypeNode(node);
if (noImplicitAny && !returnTypeNode) {
switch (node.kind) {
- case 158:
+ case 159:
error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
- case 157:
+ case 158:
error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);
break;
}
@@ -39256,7 +39500,7 @@ var ts;
checkAsyncFunctionReturnType(node);
}
}
- if (node.kind !== 159 && node.kind !== 283) {
+ if (node.kind !== 160 && node.kind !== 284) {
registerForUnusedIdentifiersCheck(node);
}
}
@@ -39273,7 +39517,7 @@ var ts;
var staticNames = ts.createUnderscoreEscapedMap();
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
- if (member.kind === 154) {
+ if (member.kind === 155) {
for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) {
var param = _c[_b];
if (ts.isParameterPropertyDeclaration(param) && !ts.isBindingPattern(param.name)) {
@@ -39284,20 +39528,21 @@ var ts;
else {
var isStatic = ts.hasModifier(member, 32);
var names = isStatic ? staticNames : instanceNames;
- var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name);
- if (memberName) {
+ var name = member.name;
+ var memberName = name && ts.getPropertyNameForPropertyNameNode(name);
+ if (name && memberName) {
switch (member.kind) {
- case 155:
- addName(names, member.name, memberName, 1);
- break;
case 156:
- addName(names, member.name, memberName, 2);
+ addName(names, name, memberName, 1);
break;
- case 151:
- addName(names, member.name, memberName, 3);
+ case 157:
+ addName(names, name, memberName, 2);
break;
- case 153:
- addName(names, member.name, memberName, 4);
+ case 152:
+ addName(names, name, memberName, 3);
+ break;
+ case 154:
+ addName(names, name, memberName, 4);
break;
}
}
@@ -39348,15 +39593,16 @@ var ts;
var names = ts.createMap();
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
- if (member.kind === 150) {
+ if (member.kind === 151) {
var memberName = void 0;
- switch (member.name.kind) {
+ var name = member.name;
+ switch (name.kind) {
case 9:
case 8:
- memberName = member.name.text;
+ memberName = name.text;
break;
case 71:
- memberName = ts.idText(member.name);
+ memberName = ts.idText(name);
break;
default:
continue;
@@ -39372,7 +39618,7 @@ var ts;
}
}
function checkTypeForDuplicateIndexSignatures(node) {
- if (node.kind === 235) {
+ if (node.kind === 236) {
var nodeSymbol = getSymbolOfNode(node);
if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) {
return;
@@ -39417,7 +39663,7 @@ var ts;
if (!checkGrammarMethod(node))
checkGrammarComputedPropertyName(node.name);
checkFunctionOrMethodDeclaration(node);
- if (ts.hasModifier(node, 128) && node.kind === 153 && node.body) {
+ if (ts.hasModifier(node, 128) && node.kind === 154 && node.body) {
error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name));
}
}
@@ -39438,7 +39684,7 @@ var ts;
return;
}
function isInstancePropertyWithInitializer(n) {
- return n.kind === 151 &&
+ return n.kind === 152 &&
!ts.hasModifier(n, 32) &&
!!n.initializer;
}
@@ -39458,7 +39704,7 @@ var ts;
var superCallStatement = void 0;
for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) {
var statement = statements_2[_i];
- if (statement.kind === 215 && ts.isSuperCall(statement.expression)) {
+ if (statement.kind === 216 && ts.isSuperCall(statement.expression)) {
superCallStatement = statement;
break;
}
@@ -39482,18 +39728,18 @@ var ts;
checkGrammarComputedPropertyName(node.name);
checkDecorators(node);
checkSignatureDeclaration(node);
- if (node.kind === 155) {
+ if (node.kind === 156) {
if (!(node.flags & 4194304) && ts.nodeIsPresent(node.body) && (node.flags & 128)) {
if (!(node.flags & 256)) {
error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value);
}
}
}
- if (node.name.kind === 146) {
+ if (node.name.kind === 147) {
checkComputedPropertyName(node.name);
}
if (!hasNonBindableDynamicName(node)) {
- var otherKind = node.kind === 155 ? 156 : 155;
+ var otherKind = node.kind === 156 ? 157 : 156;
var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind);
if (otherAccessor) {
var nodeFlags = ts.getModifierFlags(node);
@@ -39509,7 +39755,7 @@ var ts;
}
}
var returnType = getTypeOfAccessors(getSymbolOfNode(node));
- if (node.kind === 155) {
+ if (node.kind === 156) {
checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType);
}
}
@@ -39546,7 +39792,7 @@ var ts;
}
function getTypeParametersForTypeReference(node) {
var type = getTypeFromTypeReference(node);
- if (type !== unknownType) {
+ if (type !== errorType) {
var symbol = getNodeLinks(node).resolvedSymbol;
if (symbol) {
return symbol.flags & 524288 && getSymbolLinks(symbol).typeParameters ||
@@ -39557,11 +39803,11 @@ var ts;
}
function checkTypeReferenceNode(node) {
checkGrammarTypeArguments(node, node.typeArguments);
- if (node.kind === 161 && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) {
+ if (node.kind === 162 && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) {
grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);
}
var type = getTypeFromTypeReference(node);
- if (type !== unknownType) {
+ if (type !== errorType) {
if (node.typeArguments) {
ts.forEach(node.typeArguments, checkSourceElement);
if (produceDiagnostics) {
@@ -39571,7 +39817,7 @@ var ts;
}
}
}
- if (type.flags & 16 && getNodeLinks(node).resolvedSymbol.flags & 8) {
+ if (type.flags & 32 && getNodeLinks(node).resolvedSymbol.flags & 8) {
error(node, ts.Diagnostics.Enum_type_0_has_members_with_initializers_that_are_not_literals, typeToString(type));
}
}
@@ -39610,19 +39856,19 @@ var ts;
ts.forEach(node.types, checkSourceElement);
}
function checkIndexedAccessIndexType(type, accessNode) {
- if (!(type.flags & 1048576)) {
+ if (!(type.flags & 2097152)) {
return type;
}
var objectType = type.objectType;
var indexType = type.indexType;
if (isTypeAssignableTo(indexType, getIndexType(objectType, false))) {
- if (accessNode.kind === 185 && ts.isAssignmentTarget(accessNode) &&
+ if (accessNode.kind === 186 && ts.isAssignmentTarget(accessNode) &&
ts.getObjectFlags(objectType) & 32 && getMappedTypeModifiers(objectType) & 1) {
error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
}
return type;
}
- if (getIndexInfoOfType(getApparentType(objectType), 1) && isTypeAssignableToKind(indexType, 84)) {
+ if (getIndexInfoOfType(getApparentType(objectType), 1) && isTypeAssignableToKind(indexType, 168)) {
return type;
}
error(accessNode, ts.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType));
@@ -39651,7 +39897,7 @@ var ts;
ts.forEachChild(node, checkSourceElement);
}
function checkInferType(node) {
- if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 170 && n.parent.extendsType === n; })) {
+ if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 171 && n.parent.extendsType === n; })) {
grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type);
}
checkSourceElement(node.typeParameter);
@@ -39665,9 +39911,9 @@ var ts;
}
function getEffectiveDeclarationFlags(n, flagsToCheck) {
var flags = ts.getCombinedModifierFlags(n);
- if (n.parent.kind !== 235 &&
- n.parent.kind !== 234 &&
- n.parent.kind !== 204 &&
+ if (n.parent.kind !== 236 &&
+ n.parent.kind !== 235 &&
+ n.parent.kind !== 205 &&
n.flags & 4194304) {
if (!(flags & 2) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) {
flags |= 1;
@@ -39747,7 +39993,7 @@ var ts;
if (node.name && subsequentName &&
(ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) ||
!ts.isComputedPropertyName(node.name) && !ts.isComputedPropertyName(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) {
- var reportError = (node.kind === 153 || node.kind === 152) &&
+ var reportError = (node.kind === 154 || node.kind === 153) &&
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;
@@ -39780,11 +40026,11 @@ var ts;
var current = declarations_4[_i];
var node = current;
var inAmbientContext = node.flags & 4194304;
- var inAmbientContextOrInterface = node.parent.kind === 235 || node.parent.kind === 165 || inAmbientContext;
+ var inAmbientContextOrInterface = node.parent.kind === 236 || node.parent.kind === 166 || inAmbientContext;
if (inAmbientContextOrInterface) {
previousDeclaration = undefined;
}
- if (node.kind === 233 || node.kind === 153 || node.kind === 152 || node.kind === 154) {
+ if (node.kind === 234 || node.kind === 154 || node.kind === 153 || node.kind === 155) {
var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck);
someNodeFlags |= currentNodeFlags;
allNodeFlags &= currentNodeFlags;
@@ -39904,39 +40150,39 @@ var ts;
function getDeclarationSpaces(decl) {
var d = decl;
switch (d.kind) {
- case 235:
case 236:
- case 296:
- case 291:
+ case 237:
+ case 297:
+ case 292:
return 2;
- case 238:
+ case 239:
return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0
? 4 | 1
: 4;
- case 234:
- case 237:
+ case 235:
+ case 238:
return 2 | 1;
- case 273:
+ case 274:
return 2 | 1 | 4;
- case 248:
+ case 249:
if (!ts.isEntityNameExpression(d.expression)) {
return 1;
}
d = d.expression;
- case 242:
+ case 243:
+ case 246:
case 245:
- case 244:
var result_3 = 0;
var target = resolveAlias(getSymbolOfNode(d));
ts.forEach(target.declarations, function (d) { result_3 |= getDeclarationSpaces(d); });
return result_3;
- case 231:
- case 181:
- case 233:
- case 247:
+ case 232:
+ case 182:
+ case 234:
+ case 248:
return 1;
default:
- ts.Debug.fail(ts.Debug.showSyntaxKind(d));
+ return ts.Debug.fail(ts.Debug.showSyntaxKind(d));
}
}
}
@@ -39980,7 +40226,7 @@ var ts;
return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), 2);
}
function checkAwaitedType(type, errorNode, diagnosticMessage) {
- return getAwaitedType(type, errorNode, diagnosticMessage) || unknownType;
+ return getAwaitedType(type, errorNode, diagnosticMessage) || errorType;
}
function getAwaitedType(type, errorNode, diagnosticMessage) {
var typeAsAwaitable = type;
@@ -39990,7 +40236,7 @@ var ts;
if (isTypeAny(type)) {
return typeAsAwaitable.awaitedTypeOfType = type;
}
- if (type.flags & 131072) {
+ if (type.flags & 262144) {
var types = void 0;
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
var constituentType = _a[_i];
@@ -40020,7 +40266,8 @@ var ts;
var thenFunction = getTypeOfPropertyOfType(type, "then");
if (thenFunction && getSignaturesOfType(thenFunction, 0).length > 0) {
if (errorNode) {
- ts.Debug.assert(!!diagnosticMessage);
+ if (!diagnosticMessage)
+ return ts.Debug.fail();
error(errorNode, diagnosticMessage);
}
return undefined;
@@ -40031,49 +40278,49 @@ var ts;
var returnTypeNode = ts.getEffectiveReturnTypeNode(node);
var returnType = getTypeFromTypeNode(returnTypeNode);
if (languageVersion >= 2) {
- if (returnType === unknownType) {
- return unknownType;
+ if (returnType === errorType) {
+ return errorType;
}
var globalPromiseType = getGlobalPromiseType(true);
if (globalPromiseType !== emptyGenericType && !isReferenceToType(returnType, globalPromiseType)) {
error(returnTypeNode, ts.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type);
- return unknownType;
+ return errorType;
}
}
else {
markTypeNodeAsReferenced(returnTypeNode);
- if (returnType === unknownType) {
- return unknownType;
+ if (returnType === errorType) {
+ return errorType;
}
var promiseConstructorName = ts.getEntityNameFromTypeNode(returnTypeNode);
if (promiseConstructorName === undefined) {
error(returnTypeNode, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, typeToString(returnType));
- return unknownType;
+ return errorType;
}
var promiseConstructorSymbol = resolveEntityName(promiseConstructorName, 67216319, true);
- var promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : unknownType;
- if (promiseConstructorType === unknownType) {
+ var promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : errorType;
+ if (promiseConstructorType === errorType) {
if (promiseConstructorName.kind === 71 && promiseConstructorName.escapedText === "Promise" && getTargetType(returnType) === getGlobalPromiseType(false)) {
error(returnTypeNode, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option);
}
else {
error(returnTypeNode, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts.entityNameToString(promiseConstructorName));
}
- return unknownType;
+ return errorType;
}
var globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType(true);
if (globalPromiseConstructorLikeType === emptyObjectType) {
error(returnTypeNode, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts.entityNameToString(promiseConstructorName));
- return unknownType;
+ return errorType;
}
if (!checkTypeAssignableTo(promiseConstructorType, globalPromiseConstructorLikeType, returnTypeNode, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value)) {
- return unknownType;
+ return errorType;
}
var rootName = promiseConstructorName && getFirstIdentifier(promiseConstructorName);
var collidingSymbol = getSymbol(node.locals, rootName.escapedText, 67216319);
if (collidingSymbol) {
error(collidingSymbol.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, ts.idText(rootName), ts.entityNameToString(promiseConstructorName));
- return unknownType;
+ return errorType;
}
}
return checkAwaitedType(returnType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
@@ -40088,26 +40335,28 @@ var ts;
var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
var errorInfo;
switch (node.parent.kind) {
- case 234:
+ case 235:
var classSymbol = getSymbolOfNode(node.parent);
var classConstructorType = getTypeOfSymbol(classSymbol);
expectedReturnType = getUnionType([classConstructorType, voidType]);
break;
- case 148:
+ case 149:
expectedReturnType = voidType;
- errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
+ errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
break;
- case 151:
+ case 152:
expectedReturnType = voidType;
- errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
+ errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
break;
- case 153:
- case 155:
+ case 154:
case 156:
+ case 157:
var methodType = getTypeOfNode(node.parent);
var descriptorType = createTypedPropertyDescriptorType(methodType);
expectedReturnType = getUnionType([descriptorType, voidType]);
break;
+ default:
+ return ts.Debug.fail();
}
checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, function () { return errorInfo; });
}
@@ -40136,12 +40385,12 @@ var ts;
function getEntityNameForDecoratorMetadata(node) {
if (node) {
switch (node.kind) {
+ case 170:
case 169:
- case 168:
var commonEntityName = void 0;
for (var _i = 0, _a = node.types; _i < _a.length; _i++) {
var typeNode = _a[_i];
- while (typeNode.kind === 172) {
+ while (typeNode.kind === 173) {
typeNode = typeNode.type;
}
if (typeNode.kind === 131) {
@@ -40166,9 +40415,9 @@ var ts;
}
}
return commonEntityName;
- case 172:
+ case 173:
return getEntityNameForDecoratorMetadata(node.type);
- case 161:
+ case 162:
return node.typeName;
}
}
@@ -40189,13 +40438,13 @@ var ts;
}
var firstDecorator = node.decorators[0];
checkExternalEmitHelpers(firstDecorator, 8);
- if (node.kind === 148) {
+ if (node.kind === 149) {
checkExternalEmitHelpers(firstDecorator, 32);
}
if (compilerOptions.emitDecoratorMetadata) {
checkExternalEmitHelpers(firstDecorator, 16);
switch (node.kind) {
- case 234:
+ case 235:
var constructor = ts.getFirstConstructorWithBody(node);
if (constructor) {
for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) {
@@ -40204,19 +40453,19 @@ var ts;
}
}
break;
- case 153:
- case 155:
+ case 154:
case 156:
+ case 157:
for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) {
var parameter = _c[_b];
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
}
markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node));
break;
- case 151:
+ case 152:
markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node));
break;
- case 148:
+ case 149:
markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node));
var containingSignature = node.parent;
for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) {
@@ -40255,12 +40504,12 @@ var ts;
return;
}
if (!containsArgumentsReference(decl)) {
- error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 145 ? node.name.right : node.name));
+ error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 146 ? node.name.right : node.name));
}
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 === 145 ? 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 === 146 ? node.name.right : node.name));
}
}
}
@@ -40289,7 +40538,7 @@ var ts;
switch (node.kind) {
case 71:
return node;
- case 184:
+ case 185:
return node.name;
default:
return undefined;
@@ -40299,7 +40548,7 @@ var ts;
checkDecorators(node);
checkSignatureDeclaration(node);
var functionFlags = ts.getFunctionFlags(node);
- if (node.name && node.name.kind === 146) {
+ if (node.name && node.name.kind === 147) {
checkComputedPropertyName(node.name);
}
if (!hasNonBindableDynamicName(node)) {
@@ -40315,7 +40564,7 @@ var ts;
}
}
}
- var body = node.kind === 152 ? undefined : node.body;
+ var body = node.kind === 153 ? undefined : node.body;
checkSourceElement(body);
var returnTypeNode = ts.getEffectiveReturnTypeNode(node);
if ((functionFlags & 1) === 0) {
@@ -40348,41 +40597,41 @@ var ts;
for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) {
var node = potentiallyUnusedIdentifiers_1[_i];
switch (node.kind) {
- case 234:
- case 204:
+ case 235:
+ case 205:
checkUnusedClassMembers(node, addDiagnostic);
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 235:
+ case 236:
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 273:
- case 238:
- case 212:
- case 240:
- case 219:
+ case 274:
+ case 239:
+ case 213:
+ case 241:
case 220:
case 221:
+ case 222:
checkUnusedLocalsAndParameters(node, addDiagnostic);
break;
- case 154:
- case 191:
- case 233:
- case 192:
- case 153:
case 155:
+ case 192:
+ case 234:
+ case 193:
+ case 154:
case 156:
+ case 157:
if (node.body) {
checkUnusedLocalsAndParameters(node, addDiagnostic);
}
checkUnusedTypeParameters(node, addDiagnostic);
break;
- case 152:
- case 157:
+ case 153:
case 158:
- case 162:
+ case 159:
case 163:
- case 236:
+ case 164:
+ case 237:
checkUnusedTypeParameters(node, addDiagnostic);
break;
default:
@@ -40392,15 +40641,8 @@ var ts;
}
function errorUnusedLocal(declaration, name, addDiagnostic) {
var node = ts.getNameOfDeclaration(declaration) || declaration;
- if (isIdentifierThatStartsWithUnderScore(node)) {
- var declaration_2 = ts.getRootDeclaration(node.parent);
- if ((declaration_2.kind === 231 && ts.isForInOrOfStatement(declaration_2.parent.parent)) ||
- declaration_2.kind === 147) {
- return;
- }
- }
var message = isTypeDeclaration(declaration) ? ts.Diagnostics._0_is_declared_but_never_used : ts.Diagnostics._0_is_declared_but_its_value_is_never_read;
- addDiagnostic(0, ts.createDiagnosticForNodeSpan(ts.getSourceFileOfNode(declaration), declaration, node, message, name));
+ addDiagnostic(0, ts.createDiagnosticForNode(node, message, name));
}
function parameterNameStartsWithUnderscore(parameterName) {
return parameterName && isIdentifierThatStartsWithUnderScore(parameterName);
@@ -40413,11 +40655,11 @@ var ts;
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
switch (member.kind) {
- case 153:
- case 151:
- case 155:
+ case 154:
+ case 152:
case 156:
- if (member.kind === 156 && member.symbol.flags & 32768) {
+ case 157:
+ if (member.kind === 157 && member.symbol.flags & 32768) {
break;
}
var symbol = getSymbolOfNode(member);
@@ -40425,7 +40667,7 @@ var ts;
addDiagnostic(0, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)));
}
break;
- case 154:
+ case 155:
for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) {
var parameter = _c[_b];
if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8)) {
@@ -40433,8 +40675,8 @@ var ts;
}
}
break;
- case 159:
- case 211:
+ case 160:
+ case 212:
break;
default:
ts.Debug.fail();
@@ -40471,6 +40713,7 @@ var ts;
return;
var unusedImports = ts.createMap();
var unusedDestructures = ts.createMap();
+ var unusedVariables = ts.createMap();
nodeWithLocals.locals.forEach(function (local) {
if (local.flags & 262144 ? !(local.flags & 3 && !(local.isReferenced & 3)) : local.isReferenced || local.exportSymbol) {
return;
@@ -40488,6 +40731,11 @@ var ts;
addToGroup(unusedDestructures, declaration.parent, declaration, getNodeId);
}
}
+ else if (ts.isVariableDeclaration(declaration)) {
+ if (!isIdentifierThatStartsWithUnderScore(declaration.name) || !ts.isForInOrOfStatement(declaration.parent.parent)) {
+ addToGroup(unusedVariables, declaration.parent, declaration, getNodeId);
+ }
+ }
else {
var parameter = local.valueDeclaration && tryGetRootParameterDeclaration(local.valueDeclaration);
if (parameter) {
@@ -40505,49 +40753,76 @@ var ts;
unusedImports.forEach(function (_a) {
var importClause = _a[0], unuseds = _a[1];
var importDecl = importClause.parent;
- if (forEachImportedDeclaration(importClause, function (d) { return !ts.contains(unuseds, d); })) {
+ var nDeclarations = (importClause.name ? 1 : 0) +
+ (importClause.namedBindings ?
+ (importClause.namedBindings.kind === 246 ? 1 : importClause.namedBindings.elements.length)
+ : 0);
+ if (nDeclarations === unuseds.length) {
+ addDiagnostic(0, unuseds.length === 1
+ ? ts.createDiagnosticForNode(importDecl, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(ts.first(unuseds).name))
+ : ts.createDiagnosticForNode(importDecl, ts.Diagnostics.All_imports_in_import_declaration_are_unused));
+ }
+ else {
for (var _i = 0, unuseds_1 = unuseds; _i < unuseds_1.length; _i++) {
var unused = unuseds_1[_i];
errorUnusedLocal(unused, ts.idText(unused.name), addDiagnostic);
}
}
- else if (unuseds.length === 1) {
- addDiagnostic(0, ts.createDiagnosticForNode(importDecl, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(ts.first(unuseds).name)));
- }
- else {
- addDiagnostic(0, ts.createDiagnosticForNode(importDecl, ts.Diagnostics.All_imports_in_import_declaration_are_unused));
- }
});
unusedDestructures.forEach(function (_a) {
var bindingPattern = _a[0], bindingElements = _a[1];
var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 : 0;
- if (!bindingPattern.elements.every(function (e) { return ts.contains(bindingElements, e); })) {
+ if (bindingPattern.elements.length === bindingElements.length) {
+ if (bindingElements.length === 1 && bindingPattern.parent.kind === 232 && bindingPattern.parent.parent.kind === 233) {
+ addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId);
+ }
+ else {
+ addDiagnostic(kind, bindingElements.length === 1
+ ? ts.createDiagnosticForNode(bindingPattern, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(ts.cast(ts.first(bindingElements).name, ts.isIdentifier)))
+ : ts.createDiagnosticForNode(bindingPattern, ts.Diagnostics.All_destructured_elements_are_unused));
+ }
+ }
+ else {
for (var _i = 0, bindingElements_1 = bindingElements; _i < bindingElements_1.length; _i++) {
var e = bindingElements_1[_i];
addDiagnostic(kind, ts.createDiagnosticForNode(e, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(ts.cast(e.name, ts.isIdentifier))));
}
}
- else if (bindingElements.length === 1) {
- addDiagnostic(kind, ts.createDiagnosticForNode(bindingPattern, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(ts.cast(ts.first(bindingElements).name, ts.isIdentifier))));
+ });
+ unusedVariables.forEach(function (_a) {
+ var declarationList = _a[0], declarations = _a[1];
+ if (declarationList.declarations.length === declarations.length) {
+ addDiagnostic(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 === 214 ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused));
}
else {
- addDiagnostic(kind, ts.createDiagnosticForNode(bindingPattern, ts.Diagnostics.All_destructured_elements_are_unused));
+ for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) {
+ var decl = declarations_5[_i];
+ addDiagnostic(0, ts.createDiagnosticForNode(decl, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(ts.cast(decl.name, ts.isIdentifier))));
+ }
}
});
}
+ function bindingNameText(name) {
+ switch (name.kind) {
+ case 71:
+ return ts.idText(name);
+ case 181:
+ case 180:
+ return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name);
+ default:
+ return ts.Debug.assertNever(name);
+ }
+ }
function isImportedDeclaration(node) {
- return node.kind === 244 || node.kind === 247 || node.kind === 245;
+ return node.kind === 245 || node.kind === 248 || node.kind === 246;
}
function importClauseFromImported(decl) {
- return decl.kind === 244 ? decl : decl.kind === 245 ? decl.parent : decl.parent.parent;
- }
- function forEachImportedDeclaration(importClause, cb) {
- var defaultName = importClause.name, namedBindings = importClause.namedBindings;
- return (defaultName && cb(importClause)) ||
- namedBindings && (namedBindings.kind === 245 ? cb(namedBindings) : ts.forEach(namedBindings.elements, cb));
+ return decl.kind === 245 ? decl : decl.kind === 246 ? decl.parent : decl.parent.parent;
}
function checkBlock(node) {
- if (node.kind === 212) {
+ if (node.kind === 213) {
checkGrammarStatementInAmbientContext(node);
}
if (ts.isFunctionOrModuleBlock(node)) {
@@ -40576,19 +40851,19 @@ var ts;
if (!(identifier && identifier.escapedText === name)) {
return false;
}
- if (node.kind === 151 ||
- node.kind === 150 ||
+ if (node.kind === 152 ||
+ node.kind === 151 ||
+ node.kind === 154 ||
node.kind === 153 ||
- node.kind === 152 ||
- node.kind === 155 ||
- node.kind === 156) {
+ node.kind === 156 ||
+ node.kind === 157) {
return false;
}
if (node.flags & 4194304) {
return false;
}
var root = ts.getRootDeclaration(node);
- if (root.kind === 148 && ts.nodeIsMissing(root.parent.body)) {
+ if (root.kind === 149 && ts.nodeIsMissing(root.parent.body)) {
return false;
}
return true;
@@ -40605,6 +40880,7 @@ var ts;
}
return true;
}
+ return false;
});
}
function checkIfNewTargetIsCapturedInEnclosingScope(node) {
@@ -40619,6 +40895,7 @@ var ts;
}
return true;
}
+ return false;
});
}
function checkCollisionWithRequireExportsInGeneratedCode(node, name) {
@@ -40632,7 +40909,7 @@ var ts;
return;
}
var parent = getDeclarationContainer(node);
- if (parent.kind === 273 && ts.isExternalOrCommonJsModule(parent)) {
+ if (parent.kind === 274 && 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));
}
}
@@ -40644,7 +40921,7 @@ var ts;
return;
}
var parent = getDeclarationContainer(node);
- if (parent.kind === 273 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024) {
+ if (parent.kind === 274 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024) {
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));
}
}
@@ -40652,7 +40929,7 @@ var ts;
if ((ts.getCombinedNodeFlags(node) & 3) !== 0 || ts.isParameterDeclaration(node)) {
return;
}
- if (node.kind === 231 && !node.initializer) {
+ if (node.kind === 232 && !node.initializer) {
return;
}
var symbol = getSymbolOfNode(node);
@@ -40664,15 +40941,15 @@ var ts;
localDeclarationSymbol !== symbol &&
localDeclarationSymbol.flags & 2) {
if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3) {
- var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 232);
- var container = varDeclList.parent.kind === 213 && varDeclList.parent.parent
+ var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 233);
+ var container = varDeclList.parent.kind === 214 && varDeclList.parent.parent
? varDeclList.parent.parent
: undefined;
var namesShareScope = container &&
- (container.kind === 212 && ts.isFunctionLike(container.parent) ||
+ (container.kind === 213 && ts.isFunctionLike(container.parent) ||
+ container.kind === 240 ||
container.kind === 239 ||
- container.kind === 238 ||
- container.kind === 273);
+ container.kind === 274);
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);
@@ -40682,7 +40959,7 @@ var ts;
}
}
function checkParameterInitializer(node) {
- if (ts.getRootDeclaration(node).kind !== 148) {
+ if (ts.getRootDeclaration(node).kind !== 149) {
return;
}
var func = ts.getContainingFunction(node);
@@ -40691,7 +40968,7 @@ var ts;
if (ts.isTypeNode(n) || ts.isDeclarationName(n)) {
return;
}
- if (n.kind === 184) {
+ if (n.kind === 185) {
return visit(n.expression);
}
else if (n.kind === 71) {
@@ -40705,8 +40982,8 @@ var ts;
}
var enclosingContainer = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration);
if (enclosingContainer === func) {
- if (symbol.valueDeclaration.kind === 148 ||
- symbol.valueDeclaration.kind === 181) {
+ if (symbol.valueDeclaration.kind === 149 ||
+ symbol.valueDeclaration.kind === 182) {
if (symbol.valueDeclaration.pos < node.pos) {
return;
}
@@ -40715,7 +40992,7 @@ var ts;
return "quit";
}
return ts.isFunctionLike(current.parent) ||
- (current.parent.kind === 151 &&
+ (current.parent.kind === 152 &&
!(ts.hasModifier(current.parent, 32)) &&
ts.isClassLike(current.parent.parent));
})) {
@@ -40741,17 +41018,17 @@ var ts;
if (!node.name) {
return;
}
- if (node.name.kind === 146) {
+ if (node.name.kind === 147) {
checkComputedPropertyName(node.name);
if (node.initializer) {
checkExpressionCached(node.initializer);
}
}
- if (node.kind === 181) {
- if (node.parent.kind === 179 && languageVersion < 6) {
+ if (node.kind === 182) {
+ if (node.parent.kind === 180 && languageVersion < 6) {
checkExternalEmitHelpers(node, 4);
}
- if (node.propertyName && node.propertyName.kind === 146) {
+ if (node.propertyName && node.propertyName.kind === 147) {
checkComputedPropertyName(node.propertyName);
}
var parent = node.parent.parent;
@@ -40766,17 +41043,17 @@ var ts;
}
}
if (ts.isBindingPattern(node.name)) {
- if (node.name.kind === 180 && languageVersion < 2 && compilerOptions.downlevelIteration) {
+ if (node.name.kind === 181 && languageVersion < 2 && compilerOptions.downlevelIteration) {
checkExternalEmitHelpers(node, 512);
}
ts.forEach(node.name.elements, checkSourceElement);
}
- if (node.initializer && ts.getRootDeclaration(node).kind === 148 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) {
+ if (node.initializer && ts.getRootDeclaration(node).kind === 149 && 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)) {
- if (node.initializer && node.parent.parent.kind !== 220) {
+ if (node.initializer && node.parent.parent.kind !== 221) {
var initializerType = checkExpressionCached(node.initializer);
if (strictNullChecks && node.name.elements.length === 0) {
checkNonNullType(initializerType, node);
@@ -40791,15 +41068,15 @@ var ts;
var symbol = getSymbolOfNode(node);
var type = convertAutoToAny(getTypeOfSymbol(symbol));
if (node === symbol.valueDeclaration) {
- if (node.initializer && node.parent.parent.kind !== 220) {
- var initializer = ts.isInJavaScriptFile(node) && ts.getDeclaredJavascriptInitializer(node) || node.initializer;
+ var initializer = ts.getEffectiveInitializer(node);
+ if (initializer && node.parent.parent.kind !== 221) {
checkTypeAssignableTo(checkExpressionCached(initializer), type, node, undefined);
checkParameterInitializer(node);
}
}
else {
var declarationType = convertAutoToAny(getWidenedTypeForVariableLikeDeclaration(node));
- if (type !== unknownType && declarationType !== unknownType &&
+ if (type !== errorType && declarationType !== errorType &&
!isTypeIdenticalTo(type, declarationType) &&
!(symbol.flags & 67108864)) {
errorNextVariableOrPropertyDeclarationMustHaveSameType(type, node, declarationType);
@@ -40812,9 +41089,9 @@ var ts;
error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name));
}
}
- if (node.kind !== 151 && node.kind !== 150) {
+ if (node.kind !== 152 && node.kind !== 151) {
checkExportsOnMergedDeclarations(node);
- if (node.kind === 231 || node.kind === 181) {
+ if (node.kind === 232 || node.kind === 182) {
checkVarDeclaredNamesNotShadowed(node);
}
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
@@ -40823,14 +41100,14 @@ var ts;
}
function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstType, nextDeclaration, nextType) {
var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration);
- var message = nextDeclaration.kind === 151 || nextDeclaration.kind === 150
+ var message = nextDeclaration.kind === 152 || nextDeclaration.kind === 151
? 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;
error(nextDeclarationName, message, ts.declarationNameToString(nextDeclarationName), typeToString(firstType), typeToString(nextType));
}
function areDeclarationFlagsIdentical(left, right) {
- if ((left.kind === 148 && right.kind === 231) ||
- (left.kind === 231 && right.kind === 148)) {
+ if ((left.kind === 149 && right.kind === 232) ||
+ (left.kind === 232 && right.kind === 149)) {
return true;
}
if (ts.hasQuestionToken(left) !== ts.hasQuestionToken(right)) {
@@ -40865,7 +41142,7 @@ var ts;
checkGrammarStatementInAmbientContext(node);
checkExpression(node.expression);
checkSourceElement(node.thenStatement);
- if (node.thenStatement.kind === 214) {
+ if (node.thenStatement.kind === 215) {
error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement);
}
checkSourceElement(node.elseStatement);
@@ -40882,12 +41159,12 @@ var ts;
}
function checkForStatement(node) {
if (!checkGrammarStatementInAmbientContext(node)) {
- if (node.initializer && node.initializer.kind === 232) {
+ if (node.initializer && node.initializer.kind === 233) {
checkGrammarVariableDeclarationList(node.initializer);
}
}
if (node.initializer) {
- if (node.initializer.kind === 232) {
+ if (node.initializer.kind === 233) {
ts.forEach(node.initializer.declarations, checkVariableDeclaration);
}
else {
@@ -40914,14 +41191,14 @@ var ts;
else if (compilerOptions.downlevelIteration && languageVersion < 2) {
checkExternalEmitHelpers(node, 256);
}
- if (node.initializer.kind === 232) {
+ if (node.initializer.kind === 233) {
checkForInOrForOfVariableDeclaration(node);
}
else {
var varExpr = node.initializer;
var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier);
- if (varExpr.kind === 182 || varExpr.kind === 183) {
- checkDestructuringAssignment(varExpr, iteratedType || unknownType);
+ if (varExpr.kind === 183 || varExpr.kind === 184) {
+ checkDestructuringAssignment(varExpr, iteratedType || errorType);
}
else {
var leftType = checkExpression(varExpr);
@@ -40939,7 +41216,7 @@ var ts;
function checkForInStatement(node) {
checkGrammarForInOrForOfStatement(node);
var rightType = checkNonNullExpression(node.expression);
- if (node.initializer.kind === 232) {
+ if (node.initializer.kind === 233) {
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);
@@ -40949,7 +41226,7 @@ var ts;
else {
var varExpr = node.initializer;
var leftType = checkExpression(varExpr);
- if (varExpr.kind === 182 || varExpr.kind === 183) {
+ if (varExpr.kind === 183 || varExpr.kind === 184) {
error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern);
}
else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) {
@@ -40959,7 +41236,7 @@ var ts;
checkReferenceExpression(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access);
}
}
- if (rightType === neverType || !isTypeAssignableToKind(rightType, 134217728 | 7372800)) {
+ if (rightType === neverType || !isTypeAssignableToKind(rightType, 16777216 | 14745600)) {
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);
@@ -41001,14 +41278,14 @@ var ts;
var reportedError = false;
var hasStringConstituent = false;
if (allowStringInput) {
- if (arrayType.flags & 131072) {
+ if (arrayType.flags & 262144) {
var arrayTypes = inputType.types;
- var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 34); });
+ var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 68); });
if (filteredTypes !== arrayTypes) {
arrayType = getUnionType(filteredTypes, 2);
}
}
- else if (arrayType.flags & 34) {
+ else if (arrayType.flags & 68) {
arrayType = neverType;
}
hasStringConstituent = arrayType !== inputType;
@@ -41019,7 +41296,7 @@ var ts;
reportedError = true;
}
}
- if (arrayType.flags & 16384) {
+ if (arrayType.flags & 32768) {
return stringType;
}
}
@@ -41044,7 +41321,7 @@ var ts;
}
var arrayElementType = getIndexTypeOfType(arrayType, 1);
if (hasStringConstituent && arrayElementType) {
- if (arrayElementType.flags & 34) {
+ if (arrayElementType.flags & 68) {
return stringType;
}
return getUnionType([arrayElementType, stringType], 2);
@@ -41077,11 +41354,11 @@ var ts;
}
}
var asyncMethodType = allowAsyncIterables && getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("asyncIterator"));
- var methodType = asyncMethodType || (allowSyncIterables && getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("iterator")));
+ var methodType = asyncMethodType || (allowSyncIterables ? getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("iterator")) : undefined);
if (isTypeAny(methodType)) {
return undefined;
}
- var signatures = methodType && getSignaturesOfType(methodType, 0);
+ var signatures = methodType ? getSignaturesOfType(methodType, 0) : undefined;
if (!ts.some(signatures)) {
if (errorNode) {
reportTypeNotIterableError(errorNode, type, allowAsyncIterables);
@@ -41168,14 +41445,14 @@ var ts;
checkGrammarBreakOrContinueStatement(node);
}
function isGetAccessorWithAnnotatedSetAccessor(node) {
- return node.kind === 155
- && ts.getEffectiveSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 156)) !== undefined;
+ return node.kind === 156
+ && ts.getEffectiveSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 157)) !== undefined;
}
function isUnwrappedReturnTypeVoidOrAny(func, returnType) {
var unwrappedReturnType = (ts.getFunctionFlags(func) & 3) === 2
? getPromisedTypeOfPromise(returnType)
: returnType;
- return unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, 2048 | 1);
+ return !!unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, 4096 | 3);
}
function checkReturnStatement(node) {
if (checkGrammarStatementInAmbientContext(node)) {
@@ -41190,17 +41467,17 @@ var ts;
var returnType = getReturnTypeOfSignature(signature);
var functionFlags = ts.getFunctionFlags(func);
var isGenerator = functionFlags & 1;
- if (strictNullChecks || node.expression || returnType.flags & 16384) {
+ if (strictNullChecks || node.expression || returnType.flags & 32768) {
var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType;
if (isGenerator) {
return;
}
- else if (func.kind === 156) {
+ else if (func.kind === 157) {
if (node.expression) {
error(node, ts.Diagnostics.Setters_cannot_return_a_value);
}
}
- else if (func.kind === 154) {
+ else if (func.kind === 155) {
if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) {
error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);
}
@@ -41218,7 +41495,7 @@ var ts;
}
}
}
- else if (func.kind !== 154 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType) && !isGenerator) {
+ else if (func.kind !== 155 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType) && !isGenerator) {
error(node, ts.Diagnostics.Not_all_code_paths_return_a_value);
}
}
@@ -41243,7 +41520,7 @@ var ts;
var expressionType = checkExpression(node.expression);
var expressionIsLiteral = isLiteralType(expressionType);
ts.forEach(node.caseBlock.clauses, function (clause) {
- if (clause.kind === 266 && !hasDuplicateDefaultClause) {
+ if (clause.kind === 267 && !hasDuplicateDefaultClause) {
if (firstDefaultClause === undefined) {
firstDefaultClause = clause;
}
@@ -41255,7 +41532,7 @@ var ts;
hasDuplicateDefaultClause = true;
}
}
- if (produceDiagnostics && clause.kind === 265) {
+ if (produceDiagnostics && clause.kind === 266) {
var caseType = checkExpression(clause.expression);
var caseIsLiteral = isLiteralType(caseType);
var comparedExpressionType = expressionType;
@@ -41279,10 +41556,11 @@ var ts;
if (ts.isFunctionLike(current)) {
return "quit";
}
- if (current.kind === 227 && current.label.escapedText === node.label.escapedText) {
+ if (current.kind === 228 && current.label.escapedText === node.label.escapedText) {
grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label));
return true;
}
+ return false;
});
}
checkSourceElement(node.statement);
@@ -41338,8 +41616,8 @@ var ts;
checkIndexConstraintForProperty(prop, propType, type, declaredStringIndexer, stringIndexType, 0);
checkIndexConstraintForProperty(prop, propType, type, declaredNumberIndexer, numberIndexType, 1);
});
- if (ts.getObjectFlags(type) & 1 && ts.isClassLike(type.symbol.valueDeclaration)) {
- var classDeclaration = type.symbol.valueDeclaration;
+ var classDeclaration = type.symbol.valueDeclaration;
+ if (ts.getObjectFlags(type) & 1 && ts.isClassLike(classDeclaration)) {
for (var _i = 0, _a = classDeclaration.members; _i < _a.length; _i++) {
var member = _a[_i];
if (!ts.hasModifier(member, 32) && hasNonBindableDynamicName(member)) {
@@ -41372,8 +41650,8 @@ var ts;
}
var errorNode;
if (propDeclaration &&
- (propDeclaration.kind === 199 ||
- ts.getNameOfDeclaration(propDeclaration).kind === 146 ||
+ (propDeclaration.kind === 200 ||
+ ts.getNameOfDeclaration(propDeclaration).kind === 147 ||
prop.parent === containingType.symbol)) {
errorNode = propDeclaration;
}
@@ -41395,6 +41673,7 @@ var ts;
function checkTypeNameIsReserved(name, message) {
switch (name.escapedText) {
case "any":
+ case "unknown":
case "number":
case "boolean":
case "string":
@@ -41404,6 +41683,12 @@ var ts;
error(name, message, name.escapedText);
}
}
+ function checkClassNameCollisionWithObject(name) {
+ if (languageVersion === 1 && name.escapedText === "Object"
+ && moduleKind !== ts.ModuleKind.ES2015 && moduleKind !== ts.ModuleKind.ESNext) {
+ error(name, ts.Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ts.ModuleKind[moduleKind]);
+ }
+ }
function checkTypeParameters(typeParameterDeclarations) {
if (typeParameterDeclarations) {
var seenDefault = false;
@@ -41440,8 +41725,8 @@ var ts;
var type = getDeclaredTypeOfSymbol(symbol);
if (!areTypeParametersIdentical(declarations, type.localTypeParameters)) {
var name = symbolToString(symbol);
- for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) {
- var declaration = declarations_5[_i];
+ for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) {
+ var declaration = declarations_6[_i];
error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name);
}
}
@@ -41450,8 +41735,8 @@ var ts;
function areTypeParametersIdentical(declarations, targetParameters) {
var maxTypeArgumentCount = ts.length(targetParameters);
var minTypeArgumentCount = getMinTypeArgumentCount(targetParameters);
- for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) {
- var declaration = declarations_6[_i];
+ for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) {
+ var declaration = declarations_7[_i];
var sourceParameters = ts.getEffectiveTypeParameterDeclarations(declaration);
var numTypeParameters = sourceParameters.length;
if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) {
@@ -41503,6 +41788,9 @@ var ts;
checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0);
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
+ if (!(node.flags & 4194304)) {
+ checkClassNameCollisionWithObject(node.name);
+ }
}
checkTypeParameters(ts.getEffectiveTypeParameterDeclarations(node));
checkExportsOnMergedDeclarations(node);
@@ -41541,10 +41829,10 @@ var ts;
issueMemberSpecificError(node, typeWithThis, baseWithThis, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1);
}
checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1);
- if (baseConstructorType.flags & 1081344 && !isMixinConstructorType(staticType)) {
+ if (baseConstructorType.flags & 2162688 && !isMixinConstructorType(staticType)) {
error(node.name || node, ts.Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any);
}
- if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32) && !(baseConstructorType.flags & 1081344)) {
+ if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32) && !(baseConstructorType.flags & 2162688)) {
var constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode);
if (ts.forEach(constructors, function (sig) { return getReturnTypeOfSignature(sig) !== baseType_1; })) {
error(baseTypeNode.expression, ts.Diagnostics.Base_constructors_must_all_have_the_same_return_type);
@@ -41563,7 +41851,7 @@ var ts;
checkTypeReferenceNode(typeRefNode);
if (produceDiagnostics) {
var t = getTypeFromTypeNode(typeRefNode);
- if (t !== unknownType) {
+ if (t !== errorType) {
if (isValidBaseType(t)) {
var genericDiag = t.symbol && t.symbol.flags & 32 ?
ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass :
@@ -41629,7 +41917,7 @@ var ts;
}
function getClassOrInterfaceDeclarationsOfSymbol(symbol) {
return ts.filter(symbol.declarations, function (d) {
- return d.kind === 234 || d.kind === 235;
+ return d.kind === 235 || d.kind === 236;
});
}
function checkKindsOfPropertyMemberOverrides(type, baseType) {
@@ -41647,7 +41935,7 @@ var ts;
if (derived === base) {
var derivedClassDecl = ts.getClassLikeDeclarationOfSymbol(type.symbol);
if (baseDeclarationFlags & 128 && (!derivedClassDecl || !ts.hasModifier(derivedClassDecl, 128))) {
- if (derivedClassDecl.kind === 204) {
+ if (derivedClassDecl.kind === 205) {
error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType));
}
else {
@@ -41660,7 +41948,7 @@ var ts;
if (baseDeclarationFlags & 8 || derivedDeclarationFlags & 8) {
continue;
}
- if (isPrototypeProperty(base) && isPrototypeProperty(derived) || base.flags & 98308 && derived.flags & 98308) {
+ if (isPrototypeProperty(base) || base.flags & 98308 && derived.flags & 98308) {
continue;
}
var errorMessage = void 0;
@@ -41726,7 +42014,7 @@ var ts;
var propName = member.name;
if (ts.isIdentifier(propName)) {
var type = getTypeOfSymbol(getSymbolOfNode(member));
- if (!(type.flags & 1 || getFalsyFlags(type) & 4096)) {
+ if (!(type.flags & 3 || getFalsyFlags(type) & 8192)) {
if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
error(member.name, ts.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor, ts.declarationNameToString(propName));
}
@@ -41736,7 +42024,7 @@ var ts;
}
}
function isInstancePropertyWithoutInitializer(node) {
- return node.kind === 151 &&
+ return node.kind === 152 &&
!ts.hasModifier(node, 32 | 128) &&
!node.exclamationToken &&
!node.initializer;
@@ -41745,7 +42033,7 @@ var ts;
var reference = ts.createPropertyAccess(ts.createThis(), propName);
reference.flowNode = constructor.returnFlowNode;
var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType));
- return !(getFalsyFlags(flowType) & 4096);
+ return !(getFalsyFlags(flowType) & 8192);
}
function checkInterfaceDeclaration(node) {
if (!checkGrammarDecoratorsAndModifiers(node))
@@ -41756,7 +42044,7 @@ var ts;
checkExportsOnMergedDeclarations(node);
var symbol = getSymbolOfNode(node);
checkTypeParameterListsIdentical(symbol);
- var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 235);
+ var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 236);
if (node === firstInterfaceDecl) {
var type = getDeclaredTypeOfSymbol(symbol);
var typeWithThis = getTypeWithThisArgument(type);
@@ -41852,7 +42140,7 @@ var ts;
return value;
function evaluate(expr) {
switch (expr.kind) {
- case 197:
+ case 198:
var value_2 = evaluate(expr.operand);
if (typeof value_2 === "number") {
switch (expr.operator) {
@@ -41862,7 +42150,7 @@ var ts;
}
}
break;
- case 199:
+ case 200:
var left = evaluate(expr.left);
var right = evaluate(expr.right);
if (typeof left === "number" && typeof right === "number") {
@@ -41890,18 +42178,22 @@ var ts;
case 8:
checkGrammarNumericLiteral(expr);
return +expr.text;
- case 190:
+ case 191:
return evaluate(expr.expression);
case 71:
- return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), expr.escapedText);
+ var identifier = expr;
+ if (isInfinityOrNaNString(identifier.escapedText)) {
+ return +(identifier.escapedText);
+ }
+ return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
+ case 186:
case 185:
- case 184:
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 === 184) {
+ if (ex.kind === 185) {
name = ex.name.escapedText;
}
else {
@@ -41933,8 +42225,8 @@ var ts;
}
function isConstantMemberAccess(node) {
return node.kind === 71 ||
- node.kind === 184 && isConstantMemberAccess(node.expression) ||
- node.kind === 185 && isConstantMemberAccess(node.expression) &&
+ node.kind === 185 && isConstantMemberAccess(node.expression) ||
+ node.kind === 186 && isConstantMemberAccess(node.expression) &&
node.argumentExpression.kind === 9;
}
function checkEnumDeclaration(node) {
@@ -41963,7 +42255,7 @@ var ts;
}
var seenEnumMissingInitialInitializer_1 = false;
ts.forEach(enumSymbol.declarations, function (declaration) {
- if (declaration.kind !== 237) {
+ if (declaration.kind !== 238) {
return false;
}
var enumDeclaration = declaration;
@@ -41984,10 +42276,10 @@ var ts;
}
function getFirstNonAmbientClassOrFunctionDeclaration(symbol) {
var declarations = symbol.declarations;
- for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) {
- var declaration = declarations_7[_i];
- if ((declaration.kind === 234 ||
- (declaration.kind === 233 && ts.nodeIsPresent(declaration.body))) &&
+ for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) {
+ var declaration = declarations_8[_i];
+ if ((declaration.kind === 235 ||
+ (declaration.kind === 234 && ts.nodeIsPresent(declaration.body))) &&
!(declaration.flags & 4194304)) {
return declaration;
}
@@ -42035,7 +42327,7 @@ var ts;
if (symbol.flags & 512
&& symbol.declarations.length > 1
&& !inAmbientContext
- && isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules)) {
+ && isInstantiatedModule(node, !!compilerOptions.preserveConstEnums || !!compilerOptions.isolatedModules)) {
var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol);
if (firstNonAmbientClassOrFunc) {
if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(firstNonAmbientClassOrFunc)) {
@@ -42045,7 +42337,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, 234);
+ var mergedClass = ts.getDeclarationOfKind(symbol, 235);
if (mergedClass &&
inSameLexicalScope(node, mergedClass)) {
getNodeLinks(node).flags |= 32768;
@@ -42088,22 +42380,22 @@ var ts;
}
function checkModuleAugmentationElement(node, isGlobalAugmentation) {
switch (node.kind) {
- case 213:
+ case 214:
for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {
var decl = _a[_i];
checkModuleAugmentationElement(decl, isGlobalAugmentation);
}
break;
- case 248:
case 249:
+ case 250:
grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);
break;
- case 242:
case 243:
+ case 244:
grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);
break;
- case 181:
- case 231:
+ case 182:
+ case 232:
var name = node.name;
if (ts.isBindingPattern(name)) {
for (var _b = 0, _c = name.elements; _b < _c.length; _b++) {
@@ -42112,12 +42404,12 @@ var ts;
}
break;
}
- case 234:
- case 237:
- case 233:
case 235:
case 238:
+ case 234:
case 236:
+ case 239:
+ case 237:
if (isGlobalAugmentation) {
return;
}
@@ -42135,12 +42427,12 @@ var ts;
switch (node.kind) {
case 71:
return node;
- case 145:
+ case 146:
do {
node = node.left;
} while (node.kind !== 71);
return node;
- case 184:
+ case 185:
do {
node = node.expression;
} while (node.kind !== 71);
@@ -42149,16 +42441,16 @@ var ts;
}
function checkExternalImportOrExportDeclaration(node) {
var moduleName = ts.getExternalModuleName(node);
- if (ts.nodeIsMissing(moduleName)) {
+ if (!moduleName || ts.nodeIsMissing(moduleName)) {
return false;
}
if (!ts.isStringLiteral(moduleName)) {
error(moduleName, ts.Diagnostics.String_literal_expected);
return false;
}
- var inAmbientExternalModule = node.parent.kind === 239 && ts.isAmbientModule(node.parent.parent);
- if (node.parent.kind !== 273 && !inAmbientExternalModule) {
- error(moduleName, node.kind === 249 ?
+ var inAmbientExternalModule = node.parent.kind === 240 && ts.isAmbientModule(node.parent.parent);
+ if (node.parent.kind !== 274 && !inAmbientExternalModule) {
+ error(moduleName, node.kind === 250 ?
ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace :
ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module);
return false;
@@ -42179,13 +42471,13 @@ var ts;
(symbol.flags & 67901928 ? 67901928 : 0) |
(symbol.flags & 1920 ? 1920 : 0);
if (target.flags & excludedMeanings) {
- var message = node.kind === 251 ?
+ var message = node.kind === 252 ?
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 === 251
+ && node.kind === 252
&& !(target.flags & 67216319)
&& !(node.flags & 4194304)) {
error(node, ts.Diagnostics.Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided);
@@ -42211,7 +42503,7 @@ var ts;
checkImportBinding(importClause);
}
if (importClause.namedBindings) {
- if (importClause.namedBindings.kind === 245) {
+ if (importClause.namedBindings.kind === 246) {
checkImportBinding(importClause.namedBindings);
}
else {
@@ -42234,7 +42526,7 @@ var ts;
if (ts.hasModifier(node, 1)) {
markExportAsReferenced(node);
}
- if (node.moduleReference.kind !== 253) {
+ if (node.moduleReference.kind !== 254) {
var target = resolveAlias(getSymbolOfNode(node));
if (target !== unknownSymbol) {
if (target.flags & 67216319) {
@@ -42265,10 +42557,10 @@ var ts;
if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) {
if (node.exportClause) {
ts.forEach(node.exportClause.elements, checkExportSpecifier);
- var inAmbientExternalModule = node.parent.kind === 239 && ts.isAmbientModule(node.parent.parent);
- var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 239 &&
+ var inAmbientExternalModule = node.parent.kind === 240 && ts.isAmbientModule(node.parent.parent);
+ var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 240 &&
!node.moduleSpecifier && node.flags & 4194304;
- if (node.parent.kind !== 273 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
+ if (node.parent.kind !== 274 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) {
error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);
}
}
@@ -42284,7 +42576,7 @@ var ts;
}
}
function checkGrammarModuleElementContext(node, errorMessage) {
- var isInAppropriateContext = node.parent.kind === 273 || node.parent.kind === 239 || node.parent.kind === 238;
+ var isInAppropriateContext = node.parent.kind === 274 || node.parent.kind === 240 || node.parent.kind === 239;
if (!isInAppropriateContext) {
grammarErrorOnFirstToken(node, errorMessage);
}
@@ -42310,8 +42602,8 @@ var ts;
if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) {
return;
}
- var container = node.parent.kind === 273 ? node.parent : node.parent.parent;
- if (container.kind === 238 && !ts.isAmbientModule(container)) {
+ var container = node.parent.kind === 274 ? node.parent : node.parent.parent;
+ if (container.kind === 239 && !ts.isAmbientModule(container)) {
if (node.isExportEquals) {
error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace);
}
@@ -42374,8 +42666,8 @@ var ts;
return;
}
if (exportedDeclarationsCount > 1) {
- for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) {
- var declaration = declarations_8[_i];
+ for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) {
+ var declaration = declarations_9[_i];
if (isNotOverload(declaration)) {
diagnostics.add(ts.createDiagnosticForNode(declaration, ts.Diagnostics.Cannot_redeclare_exported_variable_0, ts.unescapeLeadingUnderscores(id)));
}
@@ -42390,165 +42682,165 @@ var ts;
return !ts.isAccessor(declaration);
}
function isNotOverload(declaration) {
- return (declaration.kind !== 233 && declaration.kind !== 153) ||
+ return (declaration.kind !== 234 && declaration.kind !== 154) ||
!!declaration.body;
}
function checkSourceElement(node) {
if (!node) {
return;
}
- if (ts.isInJavaScriptFile(node) && node.jsDoc) {
- for (var _i = 0, _a = node.jsDoc; _i < _a.length; _i++) {
- var tags = _a[_i].tags;
- ts.forEach(tags, checkSourceElement);
- }
+ if (ts.isInJavaScriptFile(node)) {
+ ts.forEach(node.jsDoc, function (_a) {
+ var tags = _a.tags;
+ return ts.forEach(tags, checkSourceElement);
+ });
}
var kind = node.kind;
if (cancellationToken) {
switch (kind) {
- case 238:
- case 234:
+ case 239:
case 235:
- case 233:
+ case 236:
+ case 234:
cancellationToken.throwIfCancellationRequested();
}
}
switch (kind) {
- case 147:
- return checkTypeParameter(node);
case 148:
+ return checkTypeParameter(node);
+ case 149:
return checkParameter(node);
+ case 152:
case 151:
- case 150:
return checkPropertyDeclaration(node);
- case 162:
case 163:
- case 157:
+ case 164:
case 158:
case 159:
- return checkSignatureDeclaration(node);
- case 153:
- case 152:
- return checkMethodDeclaration(node);
- case 154:
- return checkConstructorDeclaration(node);
- case 155:
- case 156:
- return checkAccessorDeclaration(node);
- case 161:
- return checkTypeReferenceNode(node);
case 160:
+ return checkSignatureDeclaration(node);
+ case 154:
+ case 153:
+ return checkMethodDeclaration(node);
+ case 155:
+ return checkConstructorDeclaration(node);
+ case 156:
+ case 157:
+ return checkAccessorDeclaration(node);
+ case 162:
+ return checkTypeReferenceNode(node);
+ case 161:
return checkTypePredicate(node);
- case 164:
- return checkTypeQuery(node);
case 165:
- return checkTypeLiteral(node);
+ return checkTypeQuery(node);
case 166:
- return checkArrayType(node);
+ return checkTypeLiteral(node);
case 167:
- return checkTupleType(node);
+ return checkArrayType(node);
case 168:
+ return checkTupleType(node);
case 169:
- return checkUnionOrIntersectionType(node);
- case 172:
- return checkSourceElement(node.type);
- case 174:
- return checkTypeOperator(node);
case 170:
- return checkConditionalType(node);
+ return checkUnionOrIntersectionType(node);
+ case 173:
+ return checkSourceElement(node.type);
+ case 175:
+ return checkTypeOperator(node);
case 171:
+ return checkConditionalType(node);
+ case 172:
return checkInferType(node);
- case 178:
+ case 179:
return checkImportType(node);
- case 289:
+ case 290:
return checkJSDocAugmentsTag(node);
- case 296:
- case 291:
- return checkJSDocTypeAliasTag(node);
+ case 297:
case 292:
+ return checkJSDocTypeAliasTag(node);
+ case 293:
return checkJSDocParameterTag(node);
- case 283:
+ case 284:
checkSignatureDeclaration(node);
+ case 282:
case 281:
- case 280:
- case 278:
case 279:
- case 286:
+ case 280:
+ case 287:
checkJSDocTypeIsInJsFile(node);
ts.forEachChild(node, checkSourceElement);
return;
- case 284:
+ case 285:
checkJSDocVariadicType(node);
return;
- case 277:
+ case 278:
return checkSourceElement(node.type);
- case 175:
- return checkIndexedAccessType(node);
case 176:
+ return checkIndexedAccessType(node);
+ case 177:
return checkMappedType(node);
- case 233:
- return checkFunctionDeclaration(node);
- case 212:
- case 239:
- return checkBlock(node);
- case 213:
- return checkVariableStatement(node);
- case 215:
- return checkExpressionStatement(node);
- case 216:
- return checkIfStatement(node);
- case 217:
- return checkDoStatement(node);
- case 218:
- return checkWhileStatement(node);
- case 219:
- return checkForStatement(node);
- case 220:
- return checkForInStatement(node);
- case 221:
- return checkForOfStatement(node);
- case 222:
- case 223:
- return checkBreakOrContinueStatement(node);
- case 224:
- return checkReturnStatement(node);
- case 225:
- return checkWithStatement(node);
- case 226:
- return checkSwitchStatement(node);
- case 227:
- return checkLabeledStatement(node);
- case 228:
- return checkThrowStatement(node);
- case 229:
- return checkTryStatement(node);
- case 231:
- return checkVariableDeclaration(node);
- case 181:
- return checkBindingElement(node);
case 234:
- return checkClassDeclaration(node);
- case 235:
- return checkInterfaceDeclaration(node);
- case 236:
- return checkTypeAliasDeclaration(node);
- case 237:
- return checkEnumDeclaration(node);
- case 238:
- return checkModuleDeclaration(node);
- case 243:
- return checkImportDeclaration(node);
- case 242:
- return checkImportEqualsDeclaration(node);
- case 249:
- return checkExportDeclaration(node);
- case 248:
- return checkExportAssignment(node);
+ return checkFunctionDeclaration(node);
+ case 213:
+ case 240:
+ return checkBlock(node);
case 214:
+ return checkVariableStatement(node);
+ case 216:
+ return checkExpressionStatement(node);
+ case 217:
+ return checkIfStatement(node);
+ case 218:
+ return checkDoStatement(node);
+ case 219:
+ return checkWhileStatement(node);
+ case 220:
+ return checkForStatement(node);
+ case 221:
+ return checkForInStatement(node);
+ case 222:
+ return checkForOfStatement(node);
+ case 223:
+ case 224:
+ return checkBreakOrContinueStatement(node);
+ case 225:
+ return checkReturnStatement(node);
+ case 226:
+ return checkWithStatement(node);
+ case 227:
+ return checkSwitchStatement(node);
+ case 228:
+ return checkLabeledStatement(node);
+ case 229:
+ return checkThrowStatement(node);
case 230:
+ return checkTryStatement(node);
+ case 232:
+ return checkVariableDeclaration(node);
+ case 182:
+ return checkBindingElement(node);
+ case 235:
+ return checkClassDeclaration(node);
+ case 236:
+ return checkInterfaceDeclaration(node);
+ case 237:
+ return checkTypeAliasDeclaration(node);
+ case 238:
+ return checkEnumDeclaration(node);
+ case 239:
+ return checkModuleDeclaration(node);
+ case 244:
+ return checkImportDeclaration(node);
+ case 243:
+ return checkImportEqualsDeclaration(node);
+ case 250:
+ return checkExportDeclaration(node);
+ case 249:
+ return checkExportAssignment(node);
+ case 215:
+ case 231:
checkGrammarStatementInAmbientContext(node);
return;
- case 252:
+ case 253:
return checkMissingDeclaration(node);
}
}
@@ -42570,7 +42862,7 @@ var ts;
if (!ts.isJSDocTypeExpression(parent)) {
error(node, ts.Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature);
}
- var paramTag = parent.parent;
+ var paramTag = node.parent.parent;
if (!ts.isJSDocParameterTag(paramTag)) {
error(node, ts.Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature);
return;
@@ -42587,8 +42879,8 @@ var ts;
function getTypeFromJSDocVariadicType(node) {
var type = getTypeFromTypeNode(node.type);
var parent = node.parent;
- var paramTag = parent.parent;
- if (ts.isJSDocTypeExpression(parent) && ts.isJSDocParameterTag(paramTag)) {
+ var paramTag = node.parent.parent;
+ if (ts.isJSDocTypeExpression(node.parent) && ts.isJSDocParameterTag(paramTag)) {
var host_1 = ts.getHostSignatureFromJSDoc(paramTag);
if (host_1) {
var lastParamDeclaration = ts.lastOrUndefined(host_1.parameters);
@@ -42610,20 +42902,20 @@ var ts;
}
}
function checkDeferredNodes() {
- for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) {
- var node = deferredNodes_1[_i];
+ for (var _i = 0, _a = deferredNodes; _i < _a.length; _i++) {
+ var node = _a[_i];
switch (node.kind) {
- case 191:
case 192:
+ case 193:
+ case 154:
case 153:
- case 152:
checkFunctionExpressionOrObjectLiteralMethodDeferred(node);
break;
- case 155:
case 156:
+ case 157:
checkAccessorDeclaration(node);
break;
- case 204:
+ case 205:
checkClassExpressionDeferred(node);
break;
}
@@ -42638,9 +42930,9 @@ var ts;
function unusedIsError(kind) {
switch (kind) {
case 0:
- return compilerOptions.noUnusedLocals;
+ return !!compilerOptions.noUnusedLocals;
case 1:
- return compilerOptions.noUnusedParameters;
+ return !!compilerOptions.noUnusedParameters;
default:
return ts.Debug.assertNever(kind);
}
@@ -42737,24 +43029,24 @@ var ts;
copySymbols(location.locals, meaning);
}
switch (location.kind) {
- case 238:
+ case 239:
copySymbols(getSymbolOfNode(location).exports, meaning & 2623475);
break;
- case 237:
+ case 238:
copySymbols(getSymbolOfNode(location).exports, meaning & 8);
break;
- case 204:
+ case 205:
var className = location.name;
if (className) {
copySymbol(location.symbol, meaning);
}
- case 234:
case 235:
+ case 236:
if (!isStatic) {
copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 67901928);
}
break;
- case 191:
+ case 192:
var funcName = location.name;
if (funcName) {
copySymbol(location.symbol, meaning);
@@ -42792,27 +43084,27 @@ var ts;
}
function isTypeDeclaration(node) {
switch (node.kind) {
- case 147:
- case 234:
+ case 148:
case 235:
case 236:
case 237:
+ case 238:
return true;
+ default:
+ return false;
}
}
- function isTypeReferenceIdentifier(entityName) {
- var node = entityName;
- while (node.parent && node.parent.kind === 145) {
+ function isTypeReferenceIdentifier(node) {
+ while (node.parent.kind === 146) {
node = node.parent;
}
- return node.parent && node.parent.kind === 161;
+ return node.parent.kind === 162;
}
- function isHeritageClauseElementIdentifier(entityName) {
- var node = entityName;
- while (node.parent && node.parent.kind === 184) {
+ function isHeritageClauseElementIdentifier(node) {
+ while (node.parent.kind === 185) {
node = node.parent;
}
- return node.parent && node.parent.kind === 206;
+ return node.parent.kind === 207;
}
function forEachEnclosingClass(node, callback) {
var result;
@@ -42840,14 +43132,14 @@ var ts;
return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; });
}
function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) {
- while (nodeOnRightSide.parent.kind === 145) {
+ while (nodeOnRightSide.parent.kind === 146) {
nodeOnRightSide = nodeOnRightSide.parent;
}
- if (nodeOnRightSide.parent.kind === 242) {
- return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent;
+ if (nodeOnRightSide.parent.kind === 243) {
+ return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined;
}
- if (nodeOnRightSide.parent.kind === 248) {
- return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent;
+ if (nodeOnRightSide.parent.kind === 249) {
+ return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined;
}
return undefined;
}
@@ -42872,7 +43164,7 @@ var ts;
node = parent;
parent = parent.parent;
}
- if (parent && parent.kind === 178 && parent.qualifier === node) {
+ if (parent && parent.kind === 179 && parent.qualifier === node) {
return parent;
}
return undefined;
@@ -42882,21 +43174,21 @@ var ts;
return getSymbolOfNode(entityName.parent);
}
if (ts.isInJavaScriptFile(entityName) &&
- entityName.parent.kind === 184 &&
+ entityName.parent.kind === 185 &&
entityName.parent === entityName.parent.parent.left) {
var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(entityName);
if (specialPropertyAssignmentSymbol) {
return specialPropertyAssignmentSymbol;
}
}
- if (entityName.parent.kind === 248 && ts.isEntityNameExpression(entityName)) {
+ if (entityName.parent.kind === 249 && ts.isEntityNameExpression(entityName)) {
var success = resolveEntityName(entityName, 67216319 | 67901928 | 1920 | 2097152, true);
if (success && success !== unknownSymbol) {
return success;
}
}
else if (!ts.isPropertyAccessExpression(entityName) && isInRightSideOfImportOrExportAssignment(entityName)) {
- var importEqualsDeclaration = ts.getAncestor(entityName, 242);
+ var importEqualsDeclaration = ts.getAncestor(entityName, 243);
ts.Debug.assert(importEqualsDeclaration !== undefined);
return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, true);
}
@@ -42913,7 +43205,7 @@ var ts;
}
if (isHeritageClauseElementIdentifier(entityName)) {
var meaning = 0;
- if (entityName.parent.kind === 206) {
+ if (entityName.parent.kind === 207) {
meaning = 67901928;
if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) {
meaning |= 67216319;
@@ -42928,10 +43220,10 @@ var ts;
return entityNameSymbol;
}
}
- if (entityName.parent.kind === 292) {
+ if (entityName.parent.kind === 293) {
return ts.getParameterSymbolFromJSDoc(entityName.parent);
}
- if (entityName.parent.kind === 147 && entityName.parent.parent.kind === 295) {
+ if (entityName.parent.kind === 148 && entityName.parent.parent.kind === 296) {
ts.Debug.assert(!ts.isInJavaScriptFile(entityName));
var typeParameter = ts.getTypeParameterFromJsDoc(entityName.parent);
return typeParameter && typeParameter.symbol;
@@ -42947,12 +43239,12 @@ var ts;
}
return resolveEntityName(entityName, 67216319, false, true);
}
- else if (entityName.kind === 184 || entityName.kind === 145) {
+ else if (entityName.kind === 185 || entityName.kind === 146) {
var links = getNodeLinks(entityName);
if (links.resolvedSymbol) {
return links.resolvedSymbol;
}
- if (entityName.kind === 184) {
+ if (entityName.kind === 185) {
checkPropertyAccessExpression(entityName);
}
else {
@@ -42962,38 +43254,40 @@ var ts;
}
}
else if (isTypeReferenceIdentifier(entityName)) {
- var meaning = entityName.parent.kind === 161 ? 67901928 : 1920;
+ var meaning = entityName.parent.kind === 162 ? 67901928 : 1920;
return resolveEntityName(entityName, meaning, false, true);
}
- else if (entityName.parent.kind === 261) {
+ else if (entityName.parent.kind === 262) {
return getJsxAttributePropertySymbol(entityName.parent);
}
- if (entityName.parent.kind === 160) {
+ if (entityName.parent.kind === 161) {
return resolveEntityName(entityName, 1);
}
return undefined;
}
function getSymbolAtLocation(node) {
- if (node.kind === 273) {
+ if (node.kind === 274) {
return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined;
}
+ var parent = node.parent;
+ var grandParent = parent.parent;
if (node.flags & 8388608) {
return undefined;
}
if (isDeclarationNameOrImportPropertyName(node)) {
- return getSymbolOfNode(node.parent);
+ return getSymbolOfNode(parent);
}
else if (ts.isLiteralComputedPropertyDeclarationName(node)) {
- return getSymbolOfNode(node.parent.parent);
+ return getSymbolOfNode(parent.parent);
}
if (node.kind === 71) {
if (isInRightSideOfImportOrExportAssignment(node)) {
return getSymbolOfEntityNameOrPropertyAccessExpression(node);
}
- else if (node.parent.kind === 181 &&
- node.parent.parent.kind === 179 &&
- node === node.parent.propertyName) {
- var typeOfPattern = getTypeOfNode(node.parent.parent);
+ else if (parent.kind === 182 &&
+ grandParent.kind === 180 &&
+ node === parent.propertyName) {
+ var typeOfPattern = getTypeOfNode(grandParent);
var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.escapedText);
if (propertyDeclaration) {
return propertyDeclaration;
@@ -43002,8 +43296,8 @@ var ts;
}
switch (node.kind) {
case 71:
- case 184:
- case 145:
+ case 185:
+ case 146:
return getSymbolOfEntityNameOrPropertyAccessExpression(node);
case 99:
var container = ts.getThisContainer(node, false);
@@ -43016,43 +43310,43 @@ var ts;
if (ts.isInExpressionContext(node)) {
return checkExpression(node).symbol;
}
- case 173:
+ case 174:
return getTypeFromThisTypeNode(node).symbol;
case 97:
return checkExpression(node).symbol;
case 123:
var constructorDeclaration = node.parent;
- if (constructorDeclaration && constructorDeclaration.kind === 154) {
+ if (constructorDeclaration && constructorDeclaration.kind === 155) {
return constructorDeclaration.parent.symbol;
}
return undefined;
case 9:
case 13:
if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) ||
- ((node.parent.kind === 243 || node.parent.kind === 249) && node.parent.moduleSpecifier === node) ||
+ ((node.parent.kind === 244 || node.parent.kind === 250) && node.parent.moduleSpecifier === node) ||
((ts.isInJavaScriptFile(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);
}
case 8:
- var objectType = ts.isElementAccessExpression(node.parent)
- ? node.parent.argumentExpression === node ? getTypeOfExpression(node.parent.expression) : undefined
- : ts.isLiteralTypeNode(node.parent) && ts.isIndexedAccessTypeNode(node.parent.parent)
- ? getTypeFromTypeNode(node.parent.parent.objectType)
+ var objectType = ts.isElementAccessExpression(parent)
+ ? parent.argumentExpression === node ? getTypeOfExpression(parent.expression) : undefined
+ : ts.isLiteralTypeNode(parent) && ts.isIndexedAccessTypeNode(grandParent)
+ ? getTypeFromTypeNode(grandParent.objectType)
: undefined;
return objectType && getPropertyOfType(objectType, ts.escapeLeadingUnderscores(node.text));
case 79:
case 89:
case 36:
return getSymbolOfNode(node.parent);
- case 178:
+ case 179:
return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal) : undefined;
default:
return undefined;
}
}
function getShorthandAssignmentValueSymbol(location) {
- if (location && location.kind === 270) {
+ if (location && location.kind === 271) {
return resolveEntityName(location.name, 67216319 | 2097152);
}
return undefined;
@@ -43064,7 +43358,7 @@ var ts;
}
function getTypeOfNode(node) {
if (node.flags & 8388608) {
- return unknownType;
+ return errorType;
}
if (ts.isPartOfTypeNode(node)) {
var typeFromTypeNode = getTypeFromTypeNode(node);
@@ -43107,29 +43401,29 @@ var ts;
var symbol = getSymbolAtLocation(node);
if (symbol) {
var declaredType = getDeclaredTypeOfSymbol(symbol);
- return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol);
+ return declaredType !== errorType ? declaredType : getTypeOfSymbol(symbol);
}
}
- return unknownType;
+ return errorType;
}
function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) {
- ts.Debug.assert(expr.kind === 183 || expr.kind === 182);
- if (expr.parent.kind === 221) {
+ ts.Debug.assert(expr.kind === 184 || expr.kind === 183);
+ if (expr.parent.kind === 222) {
var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier);
- return checkDestructuringAssignment(expr, iteratedType || unknownType);
+ return checkDestructuringAssignment(expr, iteratedType || errorType);
}
- if (expr.parent.kind === 199) {
+ if (expr.parent.kind === 200) {
var iteratedType = getTypeOfExpression(expr.parent.right);
- return checkDestructuringAssignment(expr, iteratedType || unknownType);
+ return checkDestructuringAssignment(expr, iteratedType || errorType);
}
- if (expr.parent.kind === 269) {
+ if (expr.parent.kind === 270) {
var typeOfParentObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent.parent);
- return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || unknownType, expr.parent);
+ return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || errorType, expr.parent);
}
- ts.Debug.assert(expr.parent.kind === 182);
+ ts.Debug.assert(expr.parent.kind === 183);
var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent);
- var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, false, false) || unknownType;
- return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, expr.parent.elements.indexOf(expr), elementType || unknownType);
+ var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || errorType, expr.parent, false, false) || errorType;
+ return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, expr.parent.elements.indexOf(expr), elementType || errorType);
}
function getPropertySymbolOfDestructuringAssignment(location) {
var typeOfObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(location.parent.parent);
@@ -43186,11 +43480,11 @@ var ts;
}
return target;
}
- function isArgumentsLocalBinding(node) {
- if (!ts.isGeneratedIdentifier(node)) {
- node = ts.getParseTreeNode(node, ts.isIdentifier);
+ function isArgumentsLocalBinding(nodeIn) {
+ if (!ts.isGeneratedIdentifier(nodeIn)) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);
if (node) {
- var isPropertyName_1 = node.parent.kind === 184 && node.parent.name === node;
+ var isPropertyName_1 = node.parent.kind === 185 && node.parent.name === node;
return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol;
}
}
@@ -43216,11 +43510,10 @@ var ts;
}
}
function isNameOfModuleOrEnumDeclaration(node) {
- var parent = node.parent;
- return parent && ts.isModuleOrEnumDeclaration(parent) && node === parent.name;
+ return ts.isModuleOrEnumDeclaration(node.parent) && node === node.parent.name;
}
- function getReferencedExportContainer(node, prefixLocals) {
- node = ts.getParseTreeNode(node, ts.isIdentifier);
+ function getReferencedExportContainer(nodeIn, prefixLocals) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);
if (node) {
var symbol = getReferencedValueSymbol(node, isNameOfModuleOrEnumDeclaration(node));
if (symbol) {
@@ -43233,7 +43526,7 @@ var ts;
}
var parentSymbol_1 = getParentOfSymbol(symbol);
if (parentSymbol_1) {
- if (parentSymbol_1.flags & 512 && parentSymbol_1.valueDeclaration.kind === 273) {
+ if (parentSymbol_1.flags & 512 && parentSymbol_1.valueDeclaration.kind === 274) {
var symbolFile = parentSymbol_1.valueDeclaration;
var referenceFile = ts.getSourceFileOfNode(node);
var symbolIsUmdExport = symbolFile !== referenceFile;
@@ -43244,8 +43537,8 @@ var ts;
}
}
}
- function getReferencedImportDeclaration(node) {
- node = ts.getParseTreeNode(node, ts.isIdentifier);
+ function getReferencedImportDeclaration(nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);
if (node) {
var symbol = getReferencedValueSymbol(node);
if (isNonLocalAlias(symbol, 67216319)) {
@@ -43267,7 +43560,7 @@ var ts;
else if (nodeLinks_1.flags & 131072) {
var isDeclaredInLoop = nodeLinks_1.flags & 262144;
var inLoopInitializer = ts.isIterationStatement(container, false);
- var inLoopBodyBlock = container.kind === 212 && ts.isIterationStatement(container.parent, false);
+ var inLoopBodyBlock = container.kind === 213 && ts.isIterationStatement(container.parent, false);
links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock));
}
else {
@@ -43279,9 +43572,9 @@ var ts;
}
return false;
}
- function getReferencedDeclarationWithCollidingName(node) {
- if (!ts.isGeneratedIdentifier(node)) {
- node = ts.getParseTreeNode(node, ts.isIdentifier);
+ function getReferencedDeclarationWithCollidingName(nodeIn) {
+ if (!ts.isGeneratedIdentifier(nodeIn)) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);
if (node) {
var symbol = getReferencedValueSymbol(node);
if (symbol && isSymbolOfDeclarationWithCollidingName(symbol)) {
@@ -43291,8 +43584,8 @@ var ts;
}
return undefined;
}
- function isDeclarationWithCollidingName(node) {
- node = ts.getParseTreeNode(node, ts.isDeclaration);
+ function isDeclarationWithCollidingName(nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isDeclaration);
if (node) {
var symbol = getSymbolOfNode(node);
if (symbol) {
@@ -43303,16 +43596,16 @@ var ts;
}
function isValueAliasDeclaration(node) {
switch (node.kind) {
- case 242:
- case 244:
+ case 243:
case 245:
- case 247:
- case 251:
- return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol);
- case 249:
- var exportClause = node.exportClause;
- return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration);
+ case 246:
case 248:
+ case 252:
+ return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol);
+ case 250:
+ var exportClause = node.exportClause;
+ return !!exportClause && ts.some(exportClause.elements, isValueAliasDeclaration);
+ case 249:
return node.expression
&& node.expression.kind === 71
? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol)
@@ -43320,9 +43613,9 @@ var ts;
}
return false;
}
- function isTopLevelValueImportEqualsWithEntityName(node) {
- node = ts.getParseTreeNode(node, ts.isImportEqualsDeclaration);
- if (node === undefined || node.parent.kind !== 273 || !ts.isInternalModuleImportEqualsDeclaration(node)) {
+ function isTopLevelValueImportEqualsWithEntityName(nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration);
+ if (node === undefined || node.parent.kind !== 274 || !ts.isInternalModuleImportEqualsDeclaration(node)) {
return false;
}
var isValue = isAliasResolvedToValue(getSymbolOfNode(node));
@@ -43333,11 +43626,11 @@ var ts;
if (target === unknownSymbol) {
return true;
}
- return target.flags & 67216319 &&
+ return !!(target.flags & 67216319) &&
(compilerOptions.preserveConstEnums || !isConstEnumOrConstEnumOnlyModule(target));
}
function isConstEnumOrConstEnumOnlyModule(s) {
- return isConstEnumSymbol(s) || s.constEnumOnlyModule;
+ return isConstEnumSymbol(s) || !!s.constEnumOnlyModule;
}
function isReferencedAliasDeclaration(node, checkChildren) {
if (ts.isAliasSymbolDeclaration(node)) {
@@ -43351,7 +43644,7 @@ var ts;
}
}
if (checkChildren) {
- return ts.forEachChild(node, function (node) { return isReferencedAliasDeclaration(node, checkChildren); });
+ return !!ts.forEachChild(node, function (node) { return isReferencedAliasDeclaration(node, checkChildren); });
}
return false;
}
@@ -43367,10 +43660,10 @@ var ts;
return false;
}
function isRequiredInitializedParameter(parameter) {
- return strictNullChecks &&
+ return !!strictNullChecks &&
!isOptionalParameter(parameter) &&
!ts.isJSDocParameterTag(parameter) &&
- parameter.initializer &&
+ !!parameter.initializer &&
!ts.hasModifier(parameter, 92);
}
function isOptionalUninitializedParameterProperty(parameter) {
@@ -43380,7 +43673,7 @@ var ts;
ts.hasModifier(parameter, 92);
}
function getNodeCheckFlags(node) {
- return getNodeLinks(node).flags;
+ return getNodeLinks(node).flags || 0;
}
function getEnumMemberValue(node) {
computeEnumMemberValues(node.parent);
@@ -43388,15 +43681,15 @@ var ts;
}
function canHaveConstantValue(node) {
switch (node.kind) {
- case 272:
- case 184:
+ case 273:
case 185:
+ case 186:
return true;
}
return false;
}
function getConstantValue(node) {
- if (node.kind === 272) {
+ if (node.kind === 273) {
return getEnumMemberValue(node);
}
var symbol = getNodeLinks(node).resolvedSymbol;
@@ -43408,10 +43701,10 @@ var ts;
return undefined;
}
function isFunctionType(type) {
- return type.flags & 65536 && getSignaturesOfType(type, 0).length > 0;
+ return !!(type.flags & 131072) && getSignaturesOfType(type, 0).length > 0;
}
- function getTypeReferenceSerializationKind(typeName, location) {
- typeName = ts.getParseTreeNode(typeName, ts.isEntityName);
+ function getTypeReferenceSerializationKind(typeNameIn, location) {
+ var typeName = ts.getParseTreeNode(typeNameIn, ts.isEntityName);
if (!typeName)
return ts.TypeReferenceSerializationKind.Unknown;
if (location) {
@@ -43432,31 +43725,31 @@ var ts;
}
}
if (!typeSymbol) {
- return ts.TypeReferenceSerializationKind.ObjectType;
- }
- var type = getDeclaredTypeOfSymbol(typeSymbol);
- if (type === unknownType) {
return ts.TypeReferenceSerializationKind.Unknown;
}
- else if (type.flags & 1) {
+ var type = getDeclaredTypeOfSymbol(typeSymbol);
+ if (type === errorType) {
+ return ts.TypeReferenceSerializationKind.Unknown;
+ }
+ else if (type.flags & 3) {
return ts.TypeReferenceSerializationKind.ObjectType;
}
- else if (isTypeAssignableToKind(type, 2048 | 12288 | 16384)) {
+ else if (isTypeAssignableToKind(type, 4096 | 24576 | 32768)) {
return ts.TypeReferenceSerializationKind.VoidNullableOrNeverType;
}
- else if (isTypeAssignableToKind(type, 136)) {
+ else if (isTypeAssignableToKind(type, 272)) {
return ts.TypeReferenceSerializationKind.BooleanType;
}
- else if (isTypeAssignableToKind(type, 84)) {
+ else if (isTypeAssignableToKind(type, 168)) {
return ts.TypeReferenceSerializationKind.NumberLikeType;
}
- else if (isTypeAssignableToKind(type, 34)) {
+ else if (isTypeAssignableToKind(type, 68)) {
return ts.TypeReferenceSerializationKind.StringLikeType;
}
else if (isTupleType(type)) {
return ts.TypeReferenceSerializationKind.ArrayLikeType;
}
- else if (isTypeAssignableToKind(type, 1536)) {
+ else if (isTypeAssignableToKind(type, 3072)) {
return ts.TypeReferenceSerializationKind.ESSymbolType;
}
else if (isFunctionType(type)) {
@@ -43469,16 +43762,16 @@ var ts;
return ts.TypeReferenceSerializationKind.ObjectType;
}
}
- function createTypeOfDeclaration(declaration, enclosingDeclaration, flags, tracker, addUndefined) {
- declaration = ts.getParseTreeNode(declaration, ts.isVariableLikeOrAccessor);
+ function createTypeOfDeclaration(declarationIn, enclosingDeclaration, flags, tracker, addUndefined) {
+ var declaration = ts.getParseTreeNode(declarationIn, ts.isVariableLikeOrAccessor);
if (!declaration) {
return ts.createToken(119);
}
var symbol = getSymbolOfNode(declaration);
var type = symbol && !(symbol.flags & (2048 | 131072))
? getWidenedLiteralType(getTypeOfSymbol(symbol))
- : unknownType;
- if (type.flags & 1024 &&
+ : errorType;
+ if (type.flags & 2048 &&
type.symbol === symbol) {
flags |= 1048576;
}
@@ -43487,16 +43780,16 @@ var ts;
}
return nodeBuilder.typeToTypeNode(type, enclosingDeclaration, flags | 1024, tracker);
}
- function createReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, tracker) {
- signatureDeclaration = ts.getParseTreeNode(signatureDeclaration, ts.isFunctionLike);
+ function createReturnTypeOfSignatureDeclaration(signatureDeclarationIn, enclosingDeclaration, flags, tracker) {
+ var signatureDeclaration = ts.getParseTreeNode(signatureDeclarationIn, ts.isFunctionLike);
if (!signatureDeclaration) {
return ts.createToken(119);
}
var signature = getSignatureFromDeclaration(signatureDeclaration);
return nodeBuilder.typeToTypeNode(getReturnTypeOfSignature(signature), enclosingDeclaration, flags | 1024, tracker);
}
- function createTypeOfExpression(expr, enclosingDeclaration, flags, tracker) {
- expr = ts.getParseTreeNode(expr, ts.isExpression);
+ function createTypeOfExpression(exprIn, enclosingDeclaration, flags, tracker) {
+ var expr = ts.getParseTreeNode(exprIn, ts.isExpression);
if (!expr) {
return ts.createToken(119);
}
@@ -43520,9 +43813,9 @@ var ts;
}
return resolveName(location, reference.escapedText, 67216319 | 1048576 | 2097152, undefined, undefined, true);
}
- function getReferencedValueDeclaration(reference) {
- if (!ts.isGeneratedIdentifier(reference)) {
- reference = ts.getParseTreeNode(reference, ts.isIdentifier);
+ function getReferencedValueDeclaration(referenceIn) {
+ if (!ts.isGeneratedIdentifier(referenceIn)) {
+ var reference = ts.getParseTreeNode(referenceIn, ts.isIdentifier);
if (reference) {
var symbol = getReferencedValueSymbol(reference);
if (symbol) {
@@ -43535,7 +43828,7 @@ var ts;
function isLiteralConstDeclaration(node) {
if (ts.isConst(node)) {
var type = getTypeOfSymbol(getSymbolOfNode(node));
- return !!(type.flags & 96 && type.flags & 8388608);
+ return !!(type.flags & 192 && type.flags & 33554432);
}
return false;
}
@@ -43575,7 +43868,7 @@ var ts;
},
getNodeCheckFlags: function (node) {
node = ts.getParseTreeNode(node);
- return node ? getNodeCheckFlags(node) : undefined;
+ return node ? getNodeCheckFlags(node) : 0;
},
isTopLevelValueImportEqualsWithEntityName: isTopLevelValueImportEqualsWithEntityName,
isDeclarationVisible: isDeclarationVisible,
@@ -43588,8 +43881,8 @@ var ts;
createLiteralConstValue: createLiteralConstValue,
isSymbolAccessible: isSymbolAccessible,
isEntityNameVisible: isEntityNameVisible,
- getConstantValue: function (node) {
- node = ts.getParseTreeNode(node, canHaveConstantValue);
+ getConstantValue: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, canHaveConstantValue);
return node ? getConstantValue(node) : undefined;
},
collectLinkedAliases: collectLinkedAliases,
@@ -43602,20 +43895,20 @@ var ts;
getTypeReferenceDirectivesForEntityName: getTypeReferenceDirectivesForEntityName,
getTypeReferenceDirectivesForSymbol: getTypeReferenceDirectivesForSymbol,
isLiteralConstDeclaration: isLiteralConstDeclaration,
- isLateBound: function (node) {
- node = ts.getParseTreeNode(node, ts.isDeclaration);
+ isLateBound: function (nodeIn) {
+ var node = ts.getParseTreeNode(nodeIn, ts.isDeclaration);
var symbol = node && getSymbolOfNode(node);
return !!(symbol && ts.getCheckFlags(symbol) & 1024);
},
getJsxFactoryEntity: function (location) { return location ? (getJsxNamespace(location), (ts.getSourceFileOfNode(location).localJsxFactory || _jsxFactoryEntity)) : _jsxFactoryEntity; },
getAllAccessorDeclarations: function (accessor) {
accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration);
- var otherKind = accessor.kind === 156 ? 155 : 156;
+ var otherKind = accessor.kind === 157 ? 156 : 157;
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 === 156 ? accessor : otherAccessor;
- var getAccessor = accessor.kind === 155 ? accessor : otherAccessor;
+ var setAccessor = accessor.kind === 157 ? accessor : otherAccessor;
+ var getAccessor = accessor.kind === 156 ? accessor : otherAccessor;
return {
firstAccessor: firstAccessor,
secondAccessor: secondAccessor,
@@ -43625,14 +43918,14 @@ var ts;
}
};
function isInHeritageClause(node) {
- return node.parent && node.parent.kind === 206 && node.parent.parent && node.parent.parent.kind === 267;
+ return node.parent && node.parent.kind === 207 && node.parent.parent && node.parent.parent.kind === 268;
}
function getTypeReferenceDirectivesForEntityName(node) {
if (!fileToDirective) {
return undefined;
}
var meaning = 67901928 | 1920;
- if ((node.kind === 71 && isInTypeQuery(node)) || (node.kind === 184 && !isInHeritageClause(node))) {
+ if ((node.kind === 71 && isInTypeQuery(node)) || (node.kind === 185 && !isInHeritageClause(node))) {
meaning = 67216319 | 1048576;
}
var symbol = resolveEntityName(node, meaning, true);
@@ -43675,7 +43968,7 @@ var ts;
break;
}
}
- if (current.valueDeclaration && current.valueDeclaration.kind === 273 && current.flags & 512) {
+ if (current.valueDeclaration && current.valueDeclaration.kind === 274 && current.flags & 512) {
return false;
}
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
@@ -43689,12 +43982,12 @@ var ts;
}
}
function getExternalModuleFileFromDeclaration(declaration) {
- var specifier = declaration.kind === 238 ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration);
+ var specifier = declaration.kind === 239 ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration);
var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, undefined);
if (!moduleSymbol) {
return undefined;
}
- return ts.getDeclarationOfKind(moduleSymbol, 273);
+ return ts.getDeclarationOfKind(moduleSymbol, 274);
}
function initializeTypeChecker() {
for (var _i = 0, _a = host.getSourceFiles(); _i < _a.length; _i++) {
@@ -43736,7 +44029,7 @@ var ts;
addToSymbolTable(globals, builtinGlobals, ts.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0);
getSymbolLinks(undefinedSymbol).type = undefinedWideningType;
getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments", 0, true);
- getSymbolLinks(unknownSymbol).type = unknownType;
+ getSymbolLinks(unknownSymbol).type = errorType;
globalArrayType = getGlobalType("Array", 1, true);
globalObjectType = getGlobalType("Object", 0, true);
globalFunctionType = getGlobalType("Function", 0, true);
@@ -43804,7 +44097,7 @@ var ts;
case 16384: return "__asyncValues";
case 32768: return "__exportStar";
case 65536: return "__makeTemplateObject";
- default: ts.Debug.fail("Unrecognized helper");
+ default: return ts.Debug.fail("Unrecognized helper");
}
}
function resolveHelpersModule(node, errorNode) {
@@ -43821,14 +44114,14 @@ var ts;
return false;
}
if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) {
- if (node.kind === 153 && !ts.nodeIsPresent(node.body)) {
+ if (node.kind === 154 && !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 === 155 || node.kind === 156) {
+ else if (node.kind === 156 || node.kind === 157) {
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);
@@ -43846,16 +44139,16 @@ var ts;
for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) {
var modifier = _a[_i];
if (modifier.kind !== 132) {
- if (node.kind === 150 || node.kind === 152) {
+ if (node.kind === 151 || node.kind === 153) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind));
}
- if (node.kind === 159) {
+ if (node.kind === 160) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind));
}
}
switch (modifier.kind) {
case 76:
- if (node.kind !== 237 && node.parent.kind === 234) {
+ if (node.kind !== 238 && node.parent.kind === 235) {
return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(76));
}
break;
@@ -43875,7 +44168,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 === 239 || node.parent.kind === 273) {
+ else if (node.parent.kind === 240 || node.parent.kind === 274) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text);
}
else if (flags & 128) {
@@ -43898,10 +44191,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 === 239 || node.parent.kind === 273) {
+ else if (node.parent.kind === 240 || node.parent.kind === 274) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static");
}
- else if (node.kind === 148) {
+ else if (node.kind === 149) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static");
}
else if (flags & 128) {
@@ -43914,7 +44207,7 @@ var ts;
if (flags & 64) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly");
}
- else if (node.kind !== 151 && node.kind !== 150 && node.kind !== 159 && node.kind !== 148) {
+ else if (node.kind !== 152 && node.kind !== 151 && node.kind !== 160 && node.kind !== 149) {
return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);
}
flags |= 64;
@@ -43933,17 +44226,17 @@ var ts;
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async");
}
- else if (node.parent.kind === 234) {
+ else if (node.parent.kind === 235) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export");
}
- else if (node.kind === 148) {
+ else if (node.kind === 149) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export");
}
flags |= 1;
break;
case 79:
- var container = node.parent.kind === 273 ? node.parent : node.parent.parent;
- if (container.kind === 238 && !ts.isAmbientModule(container)) {
+ var container = node.parent.kind === 274 ? node.parent : node.parent.parent;
+ if (container.kind === 239 && !ts.isAmbientModule(container)) {
return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);
}
flags |= 512;
@@ -43955,13 +44248,13 @@ var ts;
else if (flags & 256) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
}
- else if (node.parent.kind === 234) {
+ else if (node.parent.kind === 235) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare");
}
- else if (node.kind === 148) {
+ else if (node.kind === 149) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare");
}
- else if ((node.parent.flags & 4194304) && node.parent.kind === 239) {
+ else if ((node.parent.flags & 4194304) && node.parent.kind === 240) {
return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);
}
flags |= 2;
@@ -43971,14 +44264,14 @@ var ts;
if (flags & 128) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract");
}
- if (node.kind !== 234) {
- if (node.kind !== 153 &&
- node.kind !== 151 &&
- node.kind !== 155 &&
- node.kind !== 156) {
+ if (node.kind !== 235) {
+ if (node.kind !== 154 &&
+ node.kind !== 152 &&
+ node.kind !== 156 &&
+ node.kind !== 157) {
return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
}
- if (!(node.parent.kind === 234 && ts.hasModifier(node.parent, 128))) {
+ if (!(node.parent.kind === 235 && ts.hasModifier(node.parent, 128))) {
return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class);
}
if (flags & 32) {
@@ -43997,7 +44290,7 @@ var ts;
else if (flags & 2 || node.parent.flags & 4194304) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async");
}
- else if (node.kind === 148) {
+ else if (node.kind === 149) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async");
}
flags |= 256;
@@ -44005,7 +44298,7 @@ var ts;
break;
}
}
- if (node.kind === 154) {
+ if (node.kind === 155) {
if (flags & 32) {
return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static");
}
@@ -44018,20 +44311,21 @@ var ts;
else if (flags & 64) {
return grammarErrorOnNode(lastReadonly, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "readonly");
}
- return;
+ return false;
}
- else if ((node.kind === 243 || node.kind === 242) && flags & 2) {
+ else if ((node.kind === 244 || node.kind === 243) && flags & 2) {
return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare");
}
- else if (node.kind === 148 && (flags & 92) && ts.isBindingPattern(node.name)) {
+ else if (node.kind === 149 && (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 === 148 && (flags & 92) && node.dotDotDotToken) {
+ else if (node.kind === 149 && (flags & 92) && node.dotDotDotToken) {
return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter);
}
if (flags & 256) {
return checkGrammarAsyncModifier(node, lastAsync);
}
+ return false;
}
function reportObviousModifierErrors(node) {
return !node.modifiers
@@ -44042,37 +44336,37 @@ var ts;
}
function shouldReportBadModifier(node) {
switch (node.kind) {
- case 155:
case 156:
- case 154:
- case 151:
- case 150:
- case 153:
+ case 157:
+ case 155:
case 152:
- case 159:
- case 238:
+ case 151:
+ case 154:
+ case 153:
+ case 160:
+ case 239:
+ case 244:
case 243:
- case 242:
+ case 250:
case 249:
- case 248:
- case 191:
case 192:
- case 148:
+ case 193:
+ case 149:
return false;
default:
- if (node.parent.kind === 239 || node.parent.kind === 273) {
+ if (node.parent.kind === 240 || node.parent.kind === 274) {
return false;
}
switch (node.kind) {
- case 233:
- return nodeHasAnyModifiersExcept(node, 120);
case 234:
- return nodeHasAnyModifiersExcept(node, 117);
+ return nodeHasAnyModifiersExcept(node, 120);
case 235:
- case 213:
+ return nodeHasAnyModifiersExcept(node, 117);
case 236:
- return true;
+ case 214:
case 237:
+ return true;
+ case 238:
return nodeHasAnyModifiersExcept(node, 76);
default:
ts.Debug.fail();
@@ -44085,10 +44379,10 @@ var ts;
}
function checkGrammarAsyncModifier(node, asyncModifier) {
switch (node.kind) {
- case 153:
- case 233:
- case 191:
+ case 154:
+ case 234:
case 192:
+ case 193:
return false;
}
return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async");
@@ -44098,6 +44392,7 @@ var ts;
if (list && list.hasTrailingComma) {
return grammarErrorAtPos(list[0], list.end - ",".length, ",".length, diag);
}
+ return false;
}
function checkGrammarTypeParameterList(typeParameters, file) {
if (typeParameters && typeParameters.length === 0) {
@@ -44105,6 +44400,7 @@ var ts;
var end = ts.skipTrivia(file.text, typeParameters.end) + ">".length;
return grammarErrorAtPos(file, start, end - start, ts.Diagnostics.Type_parameter_list_cannot_be_empty);
}
+ return false;
}
function checkGrammarParameterList(parameters) {
var seenOptionalParameter = false;
@@ -44184,10 +44480,10 @@ var ts;
}
if (parameter.type.kind !== 137 && parameter.type.kind !== 134) {
var type = getTypeFromTypeNode(parameter.type);
- if (type.flags & 2 || type.flags & 4) {
+ 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(getTypeFromTypeNode(node.type)));
}
- if (type.flags & 131072 && allTypesAssignableToKind(type, 32, true)) {
+ if (type.flags & 262144 && allTypesAssignableToKind(type, 64, true)) {
return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead);
}
return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number);
@@ -44195,6 +44491,7 @@ var ts;
if (!node.type) {
return grammarErrorOnNode(node, ts.Diagnostics.An_index_signature_must_have_a_type_annotation);
}
+ return false;
}
function checkGrammarIndexSignature(node) {
return checkGrammarDecoratorsAndModifiers(node) || checkGrammarIndexSignatureParameters(node);
@@ -44206,6 +44503,7 @@ var ts;
var end = ts.skipTrivia(sourceFile.text, typeArguments.end) + ">".length;
return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Type_argument_list_cannot_be_empty);
}
+ return false;
}
function checkGrammarTypeArguments(node, typeArguments) {
return checkGrammarForDisallowedTrailingComma(typeArguments) ||
@@ -44215,11 +44513,12 @@ var ts;
if (args) {
for (var _i = 0, args_5 = args; _i < args_5.length; _i++) {
var arg = args_5[_i];
- if (arg.kind === 205) {
+ if (arg.kind === 206) {
return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
}
}
}
+ return false;
}
function checkGrammarArguments(args) {
return checkGrammarForOmittedArgument(args);
@@ -44233,7 +44532,7 @@ var ts;
var listType = ts.tokenToString(node.token);
return grammarErrorAtPos(node, types.pos, 0, ts.Diagnostics._0_list_cannot_be_empty, listType);
}
- return ts.forEach(types, checkGrammarExpressionWithTypeArguments);
+ return ts.some(types, checkGrammarExpressionWithTypeArguments);
}
function checkGrammarExpressionWithTypeArguments(node) {
return checkGrammarTypeArguments(node, node.typeArguments);
@@ -44288,19 +44587,20 @@ var ts;
return false;
}
function checkGrammarComputedPropertyName(node) {
- if (node.kind !== 146) {
+ if (node.kind !== 147) {
return false;
}
var computedPropertyName = node;
- if (computedPropertyName.expression.kind === 199 && computedPropertyName.expression.operatorToken.kind === 26) {
+ if (computedPropertyName.expression.kind === 200 && computedPropertyName.expression.operatorToken.kind === 26) {
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 === 233 ||
- node.kind === 191 ||
- node.kind === 153);
+ ts.Debug.assert(node.kind === 234 ||
+ node.kind === 192 ||
+ node.kind === 154);
if (node.flags & 4194304) {
return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context);
}
@@ -44310,9 +44610,7 @@ var ts;
}
}
function checkGrammarForInvalidQuestionMark(questionToken, message) {
- if (questionToken) {
- return grammarErrorOnNode(questionToken, message);
- }
+ return !!questionToken && grammarErrorOnNode(questionToken, message);
}
function checkGrammarObjectLiteralExpression(node, inDestructuring) {
var Flags;
@@ -44325,43 +44623,43 @@ var ts;
var seen = ts.createUnderscoreEscapedMap();
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var prop = _a[_i];
- if (prop.kind === 271) {
+ if (prop.kind === 272) {
continue;
}
var name = prop.name;
- if (name.kind === 146) {
+ if (name.kind === 147) {
checkGrammarComputedPropertyName(name);
}
- if (prop.kind === 270 && !inDestructuring && prop.objectAssignmentInitializer) {
+ if (prop.kind === 271 && !inDestructuring && prop.objectAssignmentInitializer) {
return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment);
}
if (prop.modifiers) {
for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) {
var mod = _c[_b];
- if (mod.kind !== 120 || prop.kind !== 153) {
+ if (mod.kind !== 120 || prop.kind !== 154) {
grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod));
}
}
}
var currentKind = void 0;
switch (prop.kind) {
- case 269:
case 270:
+ case 271:
checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional);
if (name.kind === 8) {
checkGrammarNumericLiteral(name);
}
- case 153:
+ case 154:
currentKind = 1;
break;
- case 155:
+ case 156:
currentKind = 2;
break;
- case 156:
+ case 157:
currentKind = 4;
break;
default:
- ts.Debug.assertNever(prop, "Unexpected syntax kind:" + prop.kind);
+ throw ts.Debug.assertNever(prop, "Unexpected syntax kind:" + prop.kind);
}
var effectiveName = ts.getPropertyNameForPropertyNameNode(name);
if (effectiveName === undefined) {
@@ -44394,7 +44692,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 === 263) {
+ if (attr.kind === 264) {
continue;
}
var name = attr.name, initializer = attr.initializer;
@@ -44404,7 +44702,7 @@ var ts;
else {
return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name);
}
- if (initializer && initializer.kind === 264 && !initializer.expression) {
+ if (initializer && initializer.kind === 265 && !initializer.expression) {
return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression);
}
}
@@ -44413,12 +44711,12 @@ var ts;
if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) {
return true;
}
- if (forInOrOfStatement.kind === 221 && forInOrOfStatement.awaitModifier) {
+ if (forInOrOfStatement.kind === 222 && forInOrOfStatement.awaitModifier) {
if ((forInOrOfStatement.flags & 16384) === 0) {
return grammarErrorOnNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator);
}
}
- if (forInOrOfStatement.initializer.kind === 232) {
+ if (forInOrOfStatement.initializer.kind === 233) {
var variableList = forInOrOfStatement.initializer;
if (!checkGrammarVariableDeclarationList(variableList)) {
var declarations = variableList.declarations;
@@ -44426,20 +44724,20 @@ var ts;
return false;
}
if (declarations.length > 1) {
- var diagnostic = forInOrOfStatement.kind === 220
+ var diagnostic = forInOrOfStatement.kind === 221
? 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 === 220
+ var diagnostic = forInOrOfStatement.kind === 221
? 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 === 220
+ var diagnostic = forInOrOfStatement.kind === 221
? 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);
@@ -44466,11 +44764,11 @@ var ts;
return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters);
}
else if (!doesAccessorHaveCorrectParameterCount(accessor)) {
- return grammarErrorOnNode(accessor.name, kind === 155 ?
+ return grammarErrorOnNode(accessor.name, kind === 156 ?
ts.Diagnostics.A_get_accessor_cannot_have_parameters :
ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter);
}
- else if (kind === 156) {
+ else if (kind === 157) {
if (accessor.type) {
return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation);
}
@@ -44487,12 +44785,13 @@ var ts;
}
}
}
+ return false;
}
function doesAccessorHaveCorrectParameterCount(accessor) {
- return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 155 ? 0 : 1);
+ return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 156 ? 0 : 1);
}
function getAccessorThisParameter(accessor) {
- if (accessor.parameters.length === (accessor.kind === 155 ? 1 : 2)) {
+ if (accessor.parameters.length === (accessor.kind === 156 ? 1 : 2)) {
return ts.getThisParameter(accessor);
}
}
@@ -44503,7 +44802,7 @@ var ts;
}
var parent = ts.walkUpParenthesizedTypes(node.parent);
switch (parent.kind) {
- case 231:
+ case 232:
var decl = parent;
if (decl.name.kind !== 71) {
return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name);
@@ -44515,13 +44814,13 @@ var ts;
return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const);
}
break;
- case 151:
+ case 152:
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 150:
+ case 151:
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);
}
@@ -44540,8 +44839,8 @@ var ts;
if (checkGrammarFunctionLikeDeclaration(node)) {
return true;
}
- if (node.kind === 153) {
- if (node.parent.kind === 183) {
+ if (node.kind === 154) {
+ if (node.parent.kind === 184) {
if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 120)) {
return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here);
}
@@ -44560,14 +44859,14 @@ var ts;
if (node.flags & 4194304) {
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 === 153 && !node.body) {
+ else if (node.kind === 154 && !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 === 235) {
+ else if (node.parent.kind === 236) {
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 === 165) {
+ else if (node.parent.kind === 166) {
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);
}
}
@@ -44578,9 +44877,9 @@ var ts;
return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary);
}
switch (current.kind) {
- case 227:
+ case 228:
if (node.label && current.label.escapedText === node.label.escapedText) {
- var isMisplacedContinueLabel = node.kind === 222
+ var isMisplacedContinueLabel = node.kind === 223
&& !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);
@@ -44588,8 +44887,8 @@ var ts;
return false;
}
break;
- case 226:
- if (node.kind === 223 && !node.label) {
+ case 227:
+ if (node.kind === 224 && !node.label) {
return false;
}
break;
@@ -44602,13 +44901,13 @@ var ts;
current = current.parent;
}
if (node.label) {
- var message = node.kind === 223
+ var message = node.kind === 224
? 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 === 223
+ var message = node.kind === 224
? 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);
@@ -44621,7 +44920,7 @@ var ts;
return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);
}
checkGrammarForDisallowedTrailingComma(elements, ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma);
- if (node.name.kind === 180 || node.name.kind === 179) {
+ if (node.name.kind === 181 || node.name.kind === 180) {
return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern);
}
if (node.propertyName) {
@@ -44634,11 +44933,11 @@ var ts;
}
function isStringOrNumberLiteralExpression(expr) {
return expr.kind === 9 || expr.kind === 8 ||
- expr.kind === 197 && expr.operator === 38 &&
+ expr.kind === 198 && expr.operator === 38 &&
expr.operand.kind === 8;
}
function checkGrammarVariableDeclaration(node) {
- if (node.parent.parent.kind !== 220 && node.parent.parent.kind !== 221) {
+ if (node.parent.parent.kind !== 221 && node.parent.parent.kind !== 222) {
if (node.flags & 4194304) {
if (node.initializer) {
if (ts.isConst(node) && !node.type) {
@@ -44665,7 +44964,7 @@ var ts;
}
}
}
- if (node.exclamationToken && (node.parent.parent.kind !== 213 || !node.type || node.initializer || node.flags & 4194304)) {
+ if (node.exclamationToken && (node.parent.parent.kind !== 214 || !node.type || node.initializer || node.flags & 4194304)) {
return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context);
}
if (compilerOptions.module !== ts.ModuleKind.ES2015 && compilerOptions.module !== ts.ModuleKind.ESNext && compilerOptions.module !== ts.ModuleKind.System && !compilerOptions.noEmit &&
@@ -44690,6 +44989,7 @@ var ts;
}
}
}
+ return false;
}
function checkGrammarNameInLetOrConstDeclarations(name) {
if (name.kind === 71) {
@@ -44706,6 +45006,7 @@ var ts;
}
}
}
+ return false;
}
function checkGrammarVariableDeclarationList(declarationList) {
var declarations = declarationList.declarations;
@@ -44715,18 +45016,19 @@ var ts;
if (!declarationList.declarations.length) {
return grammarErrorAtPos(declarationList, declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.Variable_declaration_list_cannot_be_empty);
}
+ return false;
}
function allowLetAndConstDeclarations(parent) {
switch (parent.kind) {
- case 216:
case 217:
case 218:
- case 225:
case 219:
+ case 226:
case 220:
case 221:
+ case 222:
return false;
- case 227:
+ case 228:
return allowLetAndConstDeclarations(parent.parent);
}
return true;
@@ -44766,6 +45068,7 @@ var ts;
diagnostics.add(ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2));
return true;
}
+ return false;
}
function grammarErrorAtPos(nodeForSourceFile, start, length, message, arg0, arg1, arg2) {
var sourceFile = ts.getSourceFileOfNode(nodeForSourceFile);
@@ -44773,6 +45076,7 @@ var ts;
diagnostics.add(ts.createFileDiagnostic(sourceFile, start, length, message, arg0, arg1, arg2));
return true;
}
+ return false;
}
function grammarErrorOnNode(node, message, arg0, arg1, arg2) {
var sourceFile = ts.getSourceFileOfNode(node);
@@ -44780,11 +45084,12 @@ var ts;
diagnostics.add(ts.createDiagnosticForNode(node, message, arg0, arg1, arg2));
return true;
}
+ return false;
}
function checkGrammarConstructorTypeParameters(node) {
- var typeParameters = ts.getEffectiveTypeParameterDeclarations(node);
- if (ts.isNodeArray(typeParameters)) {
- var pos = typeParameters.pos, end = typeParameters.end;
+ var jsdocTypeParameters = ts.isInJavaScriptFile(node) && ts.getJSDocTypeParameterDeclarations(node);
+ if (node.typeParameters || jsdocTypeParameters && jsdocTypeParameters.length) {
+ var _a = node.typeParameters || jsdocTypeParameters && jsdocTypeParameters[0] || node, pos = _a.pos, end = _a.end;
return grammarErrorAtPos(node, pos, end - pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration);
}
}
@@ -44800,7 +45105,7 @@ var ts;
return true;
}
}
- else if (node.parent.kind === 235) {
+ else if (node.parent.kind === 236) {
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;
}
@@ -44808,7 +45113,7 @@ var ts;
return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer);
}
}
- else if (node.parent.kind === 165) {
+ else if (node.parent.kind === 166) {
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;
}
@@ -44825,13 +45130,13 @@ var ts;
}
}
function checkGrammarTopLevelElementForRequiredDeclareModifier(node) {
- if (node.kind === 235 ||
- node.kind === 236 ||
+ if (node.kind === 236 ||
+ node.kind === 237 ||
+ node.kind === 244 ||
node.kind === 243 ||
- node.kind === 242 ||
+ node.kind === 250 ||
node.kind === 249 ||
- node.kind === 248 ||
- node.kind === 241 ||
+ node.kind === 242 ||
ts.hasModifier(node, 2 | 1 | 512)) {
return false;
}
@@ -44840,12 +45145,13 @@ 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 === 213) {
+ if (ts.isDeclaration(decl) || decl.kind === 214) {
if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) {
return true;
}
}
}
+ return false;
}
function checkGrammarSourceFile(node) {
return !!(node.flags & 4194304) && checkGrammarTopLevelElementsForRequiredDeclareModifier(node);
@@ -44859,7 +45165,7 @@ var ts;
if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) {
return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);
}
- if (node.parent.kind === 212 || node.parent.kind === 239 || node.parent.kind === 273) {
+ if (node.parent.kind === 213 || node.parent.kind === 240 || node.parent.kind === 274) {
var links_1 = getNodeLinks(node.parent);
if (!links_1.hasReportedStatementInAmbientContext) {
return links_1.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts);
@@ -44868,6 +45174,7 @@ var ts;
else {
}
}
+ return false;
}
function checkGrammarNumericLiteral(node) {
if (node.numericLiteralFlags & 32) {
@@ -44875,10 +45182,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, 177)) {
+ else if (ts.isChildOfNodeWithKind(node, 178)) {
diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0;
}
- else if (ts.isChildOfNodeWithKind(node, 272)) {
+ else if (ts.isChildOfNodeWithKind(node, 273)) {
diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0;
}
if (diagnosticMessage) {
@@ -44887,6 +45194,7 @@ var ts;
return grammarErrorOnNode(withMinus ? node.parent : node, diagnosticMessage, literal);
}
}
+ return false;
}
function grammarErrorAfterFirstToken(node, message, arg0, arg1, arg2) {
var sourceFile = ts.getSourceFileOfNode(node);
@@ -44895,6 +45203,7 @@ var ts;
diagnostics.add(ts.createFileDiagnostic(sourceFile, ts.textSpanEnd(span), 0, message, arg0, arg1, arg2));
return true;
}
+ return false;
}
function getAmbientModules() {
if (!ambientModulesCache) {
@@ -44921,13 +45230,14 @@ var ts;
if (ts.isSpreadElement(nodeArguments[0])) {
return grammarErrorOnNode(nodeArguments[0], ts.Diagnostics.Specifier_of_dynamic_import_cannot_be_spread_element);
}
+ return false;
}
}
ts.createTypeChecker = createTypeChecker;
function isDeclarationNameOrImportPropertyName(name) {
switch (name.parent.kind) {
- case 247:
- case 251:
+ case 248:
+ case 252:
return ts.isIdentifier(name);
default:
return ts.isDeclarationName(name);
@@ -44935,13 +45245,13 @@ var ts;
}
function isSomeImportDeclaration(decl) {
switch (decl.kind) {
- case 244:
- case 242:
case 245:
- case 247:
+ case 243:
+ case 246:
+ case 248:
return true;
case 71:
- return decl.parent.kind === 247;
+ return decl.parent.kind === 248;
default:
return false;
}
@@ -44990,7 +45300,7 @@ var ts;
ts.createNodeArray = createNodeArray;
function getSynthesizedClone(node) {
if (node === undefined) {
- return undefined;
+ return node;
}
var clone = createSynthesizedNode(node.kind);
clone.flags |= node.flags;
@@ -45183,7 +45493,7 @@ var ts;
}
ts.createModifiersFromModifierFlags = createModifiersFromModifierFlags;
function createQualifiedName(left, right) {
- var node = createSynthesizedNode(145);
+ var node = createSynthesizedNode(146);
node.left = left;
node.right = asName(right);
return node;
@@ -45198,12 +45508,12 @@ var ts;
ts.updateQualifiedName = updateQualifiedName;
function parenthesizeForComputedName(expression) {
return (ts.isBinaryExpression(expression) && expression.operatorToken.kind === 26) ||
- expression.kind === 301 ?
+ expression.kind === 302 ?
createParen(expression) :
expression;
}
function createComputedPropertyName(expression) {
- var node = createSynthesizedNode(146);
+ var node = createSynthesizedNode(147);
node.expression = parenthesizeForComputedName(expression);
return node;
}
@@ -45215,7 +45525,7 @@ var ts;
}
ts.updateComputedPropertyName = updateComputedPropertyName;
function createTypeParameterDeclaration(name, constraint, defaultType) {
- var node = createSynthesizedNode(147);
+ var node = createSynthesizedNode(148);
node.name = asName(name);
node.constraint = constraint;
node.default = defaultType;
@@ -45231,7 +45541,7 @@ var ts;
}
ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration;
function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) {
- var node = createSynthesizedNode(148);
+ var node = createSynthesizedNode(149);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.dotDotDotToken = dotDotDotToken;
@@ -45255,7 +45565,7 @@ var ts;
}
ts.updateParameter = updateParameter;
function createDecorator(expression) {
- var node = createSynthesizedNode(149);
+ var node = createSynthesizedNode(150);
node.expression = ts.parenthesizeForAccess(expression);
return node;
}
@@ -45267,7 +45577,7 @@ var ts;
}
ts.updateDecorator = updateDecorator;
function createPropertySignature(modifiers, name, questionToken, type, initializer) {
- var node = createSynthesizedNode(150);
+ var node = createSynthesizedNode(151);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
node.questionToken = questionToken;
@@ -45287,7 +45597,7 @@ var ts;
}
ts.updatePropertySignature = updatePropertySignature;
function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) {
- var node = createSynthesizedNode(151);
+ var node = createSynthesizedNode(152);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -45311,7 +45621,7 @@ var ts;
}
ts.updateProperty = updateProperty;
function createMethodSignature(typeParameters, parameters, type, name, questionToken) {
- var node = createSignatureDeclaration(152, typeParameters, parameters, type);
+ var node = createSignatureDeclaration(153, typeParameters, parameters, type);
node.name = asName(name);
node.questionToken = questionToken;
return node;
@@ -45328,7 +45638,7 @@ var ts;
}
ts.updateMethodSignature = updateMethodSignature;
function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) {
- var node = createSynthesizedNode(153);
+ var node = createSynthesizedNode(154);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.asteriskToken = asteriskToken;
@@ -45356,7 +45666,7 @@ var ts;
}
ts.updateMethod = updateMethod;
function createConstructor(decorators, modifiers, parameters, body) {
- var node = createSynthesizedNode(154);
+ var node = createSynthesizedNode(155);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.typeParameters = undefined;
@@ -45376,7 +45686,7 @@ var ts;
}
ts.updateConstructor = updateConstructor;
function createGetAccessor(decorators, modifiers, name, parameters, type, body) {
- var node = createSynthesizedNode(155);
+ var node = createSynthesizedNode(156);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -45399,7 +45709,7 @@ var ts;
}
ts.updateGetAccessor = updateGetAccessor;
function createSetAccessor(decorators, modifiers, name, parameters, body) {
- var node = createSynthesizedNode(156);
+ var node = createSynthesizedNode(157);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -45420,7 +45730,7 @@ var ts;
}
ts.updateSetAccessor = updateSetAccessor;
function createCallSignature(typeParameters, parameters, type) {
- return createSignatureDeclaration(157, typeParameters, parameters, type);
+ return createSignatureDeclaration(158, typeParameters, parameters, type);
}
ts.createCallSignature = createCallSignature;
function updateCallSignature(node, typeParameters, parameters, type) {
@@ -45428,7 +45738,7 @@ var ts;
}
ts.updateCallSignature = updateCallSignature;
function createConstructSignature(typeParameters, parameters, type) {
- return createSignatureDeclaration(158, typeParameters, parameters, type);
+ return createSignatureDeclaration(159, typeParameters, parameters, type);
}
ts.createConstructSignature = createConstructSignature;
function updateConstructSignature(node, typeParameters, parameters, type) {
@@ -45436,7 +45746,7 @@ var ts;
}
ts.updateConstructSignature = updateConstructSignature;
function createIndexSignature(decorators, modifiers, parameters, type) {
- var node = createSynthesizedNode(159);
+ var node = createSynthesizedNode(160);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.parameters = createNodeArray(parameters);
@@ -45474,7 +45784,7 @@ var ts;
}
ts.createKeywordTypeNode = createKeywordTypeNode;
function createTypePredicateNode(parameterName, type) {
- var node = createSynthesizedNode(160);
+ var node = createSynthesizedNode(161);
node.parameterName = asName(parameterName);
node.type = type;
return node;
@@ -45488,7 +45798,7 @@ var ts;
}
ts.updateTypePredicateNode = updateTypePredicateNode;
function createTypeReferenceNode(typeName, typeArguments) {
- var node = createSynthesizedNode(161);
+ var node = createSynthesizedNode(162);
node.typeName = asName(typeName);
node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments);
return node;
@@ -45502,7 +45812,7 @@ var ts;
}
ts.updateTypeReferenceNode = updateTypeReferenceNode;
function createFunctionTypeNode(typeParameters, parameters, type) {
- return createSignatureDeclaration(162, typeParameters, parameters, type);
+ return createSignatureDeclaration(163, typeParameters, parameters, type);
}
ts.createFunctionTypeNode = createFunctionTypeNode;
function updateFunctionTypeNode(node, typeParameters, parameters, type) {
@@ -45510,7 +45820,7 @@ var ts;
}
ts.updateFunctionTypeNode = updateFunctionTypeNode;
function createConstructorTypeNode(typeParameters, parameters, type) {
- return createSignatureDeclaration(163, typeParameters, parameters, type);
+ return createSignatureDeclaration(164, typeParameters, parameters, type);
}
ts.createConstructorTypeNode = createConstructorTypeNode;
function updateConstructorTypeNode(node, typeParameters, parameters, type) {
@@ -45518,7 +45828,7 @@ var ts;
}
ts.updateConstructorTypeNode = updateConstructorTypeNode;
function createTypeQueryNode(exprName) {
- var node = createSynthesizedNode(164);
+ var node = createSynthesizedNode(165);
node.exprName = exprName;
return node;
}
@@ -45530,7 +45840,7 @@ var ts;
}
ts.updateTypeQueryNode = updateTypeQueryNode;
function createTypeLiteralNode(members) {
- var node = createSynthesizedNode(165);
+ var node = createSynthesizedNode(166);
node.members = createNodeArray(members);
return node;
}
@@ -45542,7 +45852,7 @@ var ts;
}
ts.updateTypeLiteralNode = updateTypeLiteralNode;
function createArrayTypeNode(elementType) {
- var node = createSynthesizedNode(166);
+ var node = createSynthesizedNode(167);
node.elementType = ts.parenthesizeArrayTypeMember(elementType);
return node;
}
@@ -45554,7 +45864,7 @@ var ts;
}
ts.updateArrayTypeNode = updateArrayTypeNode;
function createTupleTypeNode(elementTypes) {
- var node = createSynthesizedNode(167);
+ var node = createSynthesizedNode(168);
node.elementTypes = createNodeArray(elementTypes);
return node;
}
@@ -45566,7 +45876,7 @@ var ts;
}
ts.updateTypleTypeNode = updateTypleTypeNode;
function createUnionTypeNode(types) {
- return createUnionOrIntersectionTypeNode(168, types);
+ return createUnionOrIntersectionTypeNode(169, types);
}
ts.createUnionTypeNode = createUnionTypeNode;
function updateUnionTypeNode(node, types) {
@@ -45574,7 +45884,7 @@ var ts;
}
ts.updateUnionTypeNode = updateUnionTypeNode;
function createIntersectionTypeNode(types) {
- return createUnionOrIntersectionTypeNode(169, types);
+ return createUnionOrIntersectionTypeNode(170, types);
}
ts.createIntersectionTypeNode = createIntersectionTypeNode;
function updateIntersectionTypeNode(node, types) {
@@ -45593,7 +45903,7 @@ var ts;
: node;
}
function createConditionalTypeNode(checkType, extendsType, trueType, falseType) {
- var node = createSynthesizedNode(170);
+ var node = createSynthesizedNode(171);
node.checkType = ts.parenthesizeConditionalTypeMember(checkType);
node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType);
node.trueType = trueType;
@@ -45611,7 +45921,7 @@ var ts;
}
ts.updateConditionalTypeNode = updateConditionalTypeNode;
function createInferTypeNode(typeParameter) {
- var node = createSynthesizedNode(171);
+ var node = createSynthesizedNode(172);
node.typeParameter = typeParameter;
return node;
}
@@ -45623,7 +45933,7 @@ var ts;
}
ts.updateInferTypeNode = updateInferTypeNode;
function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) {
- var node = createSynthesizedNode(178);
+ var node = createSynthesizedNode(179);
node.argument = argument;
node.qualifier = qualifier;
node.typeArguments = asNodeArray(typeArguments);
@@ -45641,7 +45951,7 @@ var ts;
}
ts.updateImportTypeNode = updateImportTypeNode;
function createParenthesizedType(type) {
- var node = createSynthesizedNode(172);
+ var node = createSynthesizedNode(173);
node.type = type;
return node;
}
@@ -45653,11 +45963,11 @@ var ts;
}
ts.updateParenthesizedType = updateParenthesizedType;
function createThisTypeNode() {
- return createSynthesizedNode(173);
+ return createSynthesizedNode(174);
}
ts.createThisTypeNode = createThisTypeNode;
function createTypeOperatorNode(operatorOrType, type) {
- var node = createSynthesizedNode(174);
+ var node = createSynthesizedNode(175);
node.operator = typeof operatorOrType === "number" ? operatorOrType : 128;
node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType);
return node;
@@ -45668,7 +45978,7 @@ var ts;
}
ts.updateTypeOperatorNode = updateTypeOperatorNode;
function createIndexedAccessTypeNode(objectType, indexType) {
- var node = createSynthesizedNode(175);
+ var node = createSynthesizedNode(176);
node.objectType = ts.parenthesizeElementTypeMember(objectType);
node.indexType = indexType;
return node;
@@ -45682,7 +45992,7 @@ var ts;
}
ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode;
function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) {
- var node = createSynthesizedNode(176);
+ var node = createSynthesizedNode(177);
node.readonlyToken = readonlyToken;
node.typeParameter = typeParameter;
node.questionToken = questionToken;
@@ -45700,7 +46010,7 @@ var ts;
}
ts.updateMappedTypeNode = updateMappedTypeNode;
function createLiteralTypeNode(literal) {
- var node = createSynthesizedNode(177);
+ var node = createSynthesizedNode(178);
node.literal = literal;
return node;
}
@@ -45712,7 +46022,7 @@ var ts;
}
ts.updateLiteralTypeNode = updateLiteralTypeNode;
function createObjectBindingPattern(elements) {
- var node = createSynthesizedNode(179);
+ var node = createSynthesizedNode(180);
node.elements = createNodeArray(elements);
return node;
}
@@ -45724,7 +46034,7 @@ var ts;
}
ts.updateObjectBindingPattern = updateObjectBindingPattern;
function createArrayBindingPattern(elements) {
- var node = createSynthesizedNode(180);
+ var node = createSynthesizedNode(181);
node.elements = createNodeArray(elements);
return node;
}
@@ -45736,7 +46046,7 @@ var ts;
}
ts.updateArrayBindingPattern = updateArrayBindingPattern;
function createBindingElement(dotDotDotToken, propertyName, name, initializer) {
- var node = createSynthesizedNode(181);
+ var node = createSynthesizedNode(182);
node.dotDotDotToken = dotDotDotToken;
node.propertyName = asName(propertyName);
node.name = asName(name);
@@ -45754,7 +46064,7 @@ var ts;
}
ts.updateBindingElement = updateBindingElement;
function createArrayLiteral(elements, multiLine) {
- var node = createSynthesizedNode(182);
+ var node = createSynthesizedNode(183);
node.elements = ts.parenthesizeListElements(createNodeArray(elements));
if (multiLine)
node.multiLine = true;
@@ -45768,7 +46078,7 @@ var ts;
}
ts.updateArrayLiteral = updateArrayLiteral;
function createObjectLiteral(properties, multiLine) {
- var node = createSynthesizedNode(183);
+ var node = createSynthesizedNode(184);
node.properties = createNodeArray(properties);
if (multiLine)
node.multiLine = true;
@@ -45782,7 +46092,7 @@ var ts;
}
ts.updateObjectLiteral = updateObjectLiteral;
function createPropertyAccess(expression, name) {
- var node = createSynthesizedNode(184);
+ var node = createSynthesizedNode(185);
node.expression = ts.parenthesizeForAccess(expression);
node.name = asName(name);
setEmitFlags(node, 131072);
@@ -45797,7 +46107,7 @@ var ts;
}
ts.updatePropertyAccess = updatePropertyAccess;
function createElementAccess(expression, index) {
- var node = createSynthesizedNode(185);
+ var node = createSynthesizedNode(186);
node.expression = ts.parenthesizeForAccess(expression);
node.argumentExpression = asExpression(index);
return node;
@@ -45811,7 +46121,7 @@ var ts;
}
ts.updateElementAccess = updateElementAccess;
function createCall(expression, typeArguments, argumentsArray) {
- var node = createSynthesizedNode(186);
+ var node = createSynthesizedNode(187);
node.expression = ts.parenthesizeForAccess(expression);
node.typeArguments = asNodeArray(typeArguments);
node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray));
@@ -45827,7 +46137,7 @@ var ts;
}
ts.updateCall = updateCall;
function createNew(expression, typeArguments, argumentsArray) {
- var node = createSynthesizedNode(187);
+ var node = createSynthesizedNode(188);
node.expression = ts.parenthesizeForNew(expression);
node.typeArguments = asNodeArray(typeArguments);
node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined;
@@ -45843,7 +46153,7 @@ var ts;
}
ts.updateNew = updateNew;
function createTaggedTemplate(tag, typeArgumentsOrTemplate, template) {
- var node = createSynthesizedNode(188);
+ var node = createSynthesizedNode(189);
node.tag = ts.parenthesizeForAccess(tag);
if (template) {
node.typeArguments = asNodeArray(typeArgumentsOrTemplate);
@@ -45866,7 +46176,7 @@ var ts;
}
ts.updateTaggedTemplate = updateTaggedTemplate;
function createTypeAssertion(type, expression) {
- var node = createSynthesizedNode(189);
+ var node = createSynthesizedNode(190);
node.type = type;
node.expression = ts.parenthesizePrefixOperand(expression);
return node;
@@ -45880,7 +46190,7 @@ var ts;
}
ts.updateTypeAssertion = updateTypeAssertion;
function createParen(expression) {
- var node = createSynthesizedNode(190);
+ var node = createSynthesizedNode(191);
node.expression = expression;
return node;
}
@@ -45892,7 +46202,7 @@ var ts;
}
ts.updateParen = updateParen;
function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
- var node = createSynthesizedNode(191);
+ var node = createSynthesizedNode(192);
node.modifiers = asNodeArray(modifiers);
node.asteriskToken = asteriskToken;
node.name = asName(name);
@@ -45916,7 +46226,7 @@ var ts;
}
ts.updateFunctionExpression = updateFunctionExpression;
function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) {
- var node = createSynthesizedNode(192);
+ var node = createSynthesizedNode(193);
node.modifiers = asNodeArray(modifiers);
node.typeParameters = asNodeArray(typeParameters);
node.parameters = createNodeArray(parameters);
@@ -45950,7 +46260,7 @@ var ts;
}
ts.updateArrowFunction = updateArrowFunction;
function createDelete(expression) {
- var node = createSynthesizedNode(193);
+ var node = createSynthesizedNode(194);
node.expression = ts.parenthesizePrefixOperand(expression);
return node;
}
@@ -45962,7 +46272,7 @@ var ts;
}
ts.updateDelete = updateDelete;
function createTypeOf(expression) {
- var node = createSynthesizedNode(194);
+ var node = createSynthesizedNode(195);
node.expression = ts.parenthesizePrefixOperand(expression);
return node;
}
@@ -45974,7 +46284,7 @@ var ts;
}
ts.updateTypeOf = updateTypeOf;
function createVoid(expression) {
- var node = createSynthesizedNode(195);
+ var node = createSynthesizedNode(196);
node.expression = ts.parenthesizePrefixOperand(expression);
return node;
}
@@ -45986,7 +46296,7 @@ var ts;
}
ts.updateVoid = updateVoid;
function createAwait(expression) {
- var node = createSynthesizedNode(196);
+ var node = createSynthesizedNode(197);
node.expression = ts.parenthesizePrefixOperand(expression);
return node;
}
@@ -45998,7 +46308,7 @@ var ts;
}
ts.updateAwait = updateAwait;
function createPrefix(operator, operand) {
- var node = createSynthesizedNode(197);
+ var node = createSynthesizedNode(198);
node.operator = operator;
node.operand = ts.parenthesizePrefixOperand(operand);
return node;
@@ -46011,7 +46321,7 @@ var ts;
}
ts.updatePrefix = updatePrefix;
function createPostfix(operand, operator) {
- var node = createSynthesizedNode(198);
+ var node = createSynthesizedNode(199);
node.operand = ts.parenthesizePostfixOperand(operand);
node.operator = operator;
return node;
@@ -46024,7 +46334,7 @@ var ts;
}
ts.updatePostfix = updatePostfix;
function createBinary(left, operator, right) {
- var node = createSynthesizedNode(199);
+ var node = createSynthesizedNode(200);
var operatorToken = asToken(operator);
var operatorKind = operatorToken.kind;
node.left = ts.parenthesizeBinaryOperand(operatorKind, left, true, undefined);
@@ -46041,7 +46351,7 @@ var ts;
}
ts.updateBinary = updateBinary;
function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) {
- var node = createSynthesizedNode(200);
+ var node = createSynthesizedNode(201);
node.condition = ts.parenthesizeForConditionalHead(condition);
node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(55);
node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue);
@@ -46071,7 +46381,7 @@ var ts;
}
ts.updateConditional = updateConditional;
function createTemplateExpression(head, templateSpans) {
- var node = createSynthesizedNode(201);
+ var node = createSynthesizedNode(202);
node.head = head;
node.templateSpans = createNodeArray(templateSpans);
return node;
@@ -46109,7 +46419,7 @@ var ts;
}
ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral;
function createYield(asteriskTokenOrExpression, expression) {
- var node = createSynthesizedNode(202);
+ var node = createSynthesizedNode(203);
node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 39 ? asteriskTokenOrExpression : undefined;
node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 39 ? asteriskTokenOrExpression : expression;
return node;
@@ -46123,7 +46433,7 @@ var ts;
}
ts.updateYield = updateYield;
function createSpread(expression) {
- var node = createSynthesizedNode(203);
+ var node = createSynthesizedNode(204);
node.expression = ts.parenthesizeExpressionForList(expression);
return node;
}
@@ -46135,7 +46445,7 @@ var ts;
}
ts.updateSpread = updateSpread;
function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) {
- var node = createSynthesizedNode(204);
+ var node = createSynthesizedNode(205);
node.decorators = undefined;
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -46156,11 +46466,11 @@ var ts;
}
ts.updateClassExpression = updateClassExpression;
function createOmittedExpression() {
- return createSynthesizedNode(205);
+ return createSynthesizedNode(206);
}
ts.createOmittedExpression = createOmittedExpression;
function createExpressionWithTypeArguments(typeArguments, expression) {
- var node = createSynthesizedNode(206);
+ var node = createSynthesizedNode(207);
node.expression = ts.parenthesizeForAccess(expression);
node.typeArguments = asNodeArray(typeArguments);
return node;
@@ -46174,7 +46484,7 @@ var ts;
}
ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments;
function createAsExpression(expression, type) {
- var node = createSynthesizedNode(207);
+ var node = createSynthesizedNode(208);
node.expression = expression;
node.type = type;
return node;
@@ -46188,7 +46498,7 @@ var ts;
}
ts.updateAsExpression = updateAsExpression;
function createNonNullExpression(expression) {
- var node = createSynthesizedNode(208);
+ var node = createSynthesizedNode(209);
node.expression = ts.parenthesizeForAccess(expression);
return node;
}
@@ -46200,7 +46510,7 @@ var ts;
}
ts.updateNonNullExpression = updateNonNullExpression;
function createMetaProperty(keywordToken, name) {
- var node = createSynthesizedNode(209);
+ var node = createSynthesizedNode(210);
node.keywordToken = keywordToken;
node.name = name;
return node;
@@ -46213,7 +46523,7 @@ var ts;
}
ts.updateMetaProperty = updateMetaProperty;
function createTemplateSpan(expression, literal) {
- var node = createSynthesizedNode(210);
+ var node = createSynthesizedNode(211);
node.expression = expression;
node.literal = literal;
return node;
@@ -46227,11 +46537,11 @@ var ts;
}
ts.updateTemplateSpan = updateTemplateSpan;
function createSemicolonClassElement() {
- return createSynthesizedNode(211);
+ return createSynthesizedNode(212);
}
ts.createSemicolonClassElement = createSemicolonClassElement;
function createBlock(statements, multiLine) {
- var block = createSynthesizedNode(212);
+ var block = createSynthesizedNode(213);
block.statements = createNodeArray(statements);
if (multiLine)
block.multiLine = multiLine;
@@ -46239,7 +46549,7 @@ var ts;
}
ts.createBlock = createBlock;
function createExpressionStatement(expression) {
- var node = createSynthesizedNode(215);
+ var node = createSynthesizedNode(216);
node.expression = expression;
return node;
}
@@ -46251,7 +46561,7 @@ var ts;
}
ts.updateBlock = updateBlock;
function createVariableStatement(modifiers, declarationList) {
- var node = createSynthesizedNode(213);
+ var node = createSynthesizedNode(214);
node.decorators = undefined;
node.modifiers = asNodeArray(modifiers);
node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList;
@@ -46266,7 +46576,7 @@ var ts;
}
ts.updateVariableStatement = updateVariableStatement;
function createEmptyStatement() {
- return createSynthesizedNode(214);
+ return createSynthesizedNode(215);
}
ts.createEmptyStatement = createEmptyStatement;
function createStatement(expression) {
@@ -46280,7 +46590,7 @@ var ts;
}
ts.updateStatement = updateStatement;
function createIf(expression, thenStatement, elseStatement) {
- var node = createSynthesizedNode(216);
+ var node = createSynthesizedNode(217);
node.expression = expression;
node.thenStatement = thenStatement;
node.elseStatement = elseStatement;
@@ -46296,7 +46606,7 @@ var ts;
}
ts.updateIf = updateIf;
function createDo(statement, expression) {
- var node = createSynthesizedNode(217);
+ var node = createSynthesizedNode(218);
node.statement = statement;
node.expression = expression;
return node;
@@ -46310,7 +46620,7 @@ var ts;
}
ts.updateDo = updateDo;
function createWhile(expression, statement) {
- var node = createSynthesizedNode(218);
+ var node = createSynthesizedNode(219);
node.expression = expression;
node.statement = statement;
return node;
@@ -46324,7 +46634,7 @@ var ts;
}
ts.updateWhile = updateWhile;
function createFor(initializer, condition, incrementor, statement) {
- var node = createSynthesizedNode(219);
+ var node = createSynthesizedNode(220);
node.initializer = initializer;
node.condition = condition;
node.incrementor = incrementor;
@@ -46342,7 +46652,7 @@ var ts;
}
ts.updateFor = updateFor;
function createForIn(initializer, expression, statement) {
- var node = createSynthesizedNode(220);
+ var node = createSynthesizedNode(221);
node.initializer = initializer;
node.expression = expression;
node.statement = statement;
@@ -46358,7 +46668,7 @@ var ts;
}
ts.updateForIn = updateForIn;
function createForOf(awaitModifier, initializer, expression, statement) {
- var node = createSynthesizedNode(221);
+ var node = createSynthesizedNode(222);
node.awaitModifier = awaitModifier;
node.initializer = initializer;
node.expression = expression;
@@ -46376,7 +46686,7 @@ var ts;
}
ts.updateForOf = updateForOf;
function createContinue(label) {
- var node = createSynthesizedNode(222);
+ var node = createSynthesizedNode(223);
node.label = asName(label);
return node;
}
@@ -46388,7 +46698,7 @@ var ts;
}
ts.updateContinue = updateContinue;
function createBreak(label) {
- var node = createSynthesizedNode(223);
+ var node = createSynthesizedNode(224);
node.label = asName(label);
return node;
}
@@ -46400,7 +46710,7 @@ var ts;
}
ts.updateBreak = updateBreak;
function createReturn(expression) {
- var node = createSynthesizedNode(224);
+ var node = createSynthesizedNode(225);
node.expression = expression;
return node;
}
@@ -46412,7 +46722,7 @@ var ts;
}
ts.updateReturn = updateReturn;
function createWith(expression, statement) {
- var node = createSynthesizedNode(225);
+ var node = createSynthesizedNode(226);
node.expression = expression;
node.statement = statement;
return node;
@@ -46426,7 +46736,7 @@ var ts;
}
ts.updateWith = updateWith;
function createSwitch(expression, caseBlock) {
- var node = createSynthesizedNode(226);
+ var node = createSynthesizedNode(227);
node.expression = ts.parenthesizeExpressionForList(expression);
node.caseBlock = caseBlock;
return node;
@@ -46440,7 +46750,7 @@ var ts;
}
ts.updateSwitch = updateSwitch;
function createLabel(label, statement) {
- var node = createSynthesizedNode(227);
+ var node = createSynthesizedNode(228);
node.label = asName(label);
node.statement = statement;
return node;
@@ -46454,7 +46764,7 @@ var ts;
}
ts.updateLabel = updateLabel;
function createThrow(expression) {
- var node = createSynthesizedNode(228);
+ var node = createSynthesizedNode(229);
node.expression = expression;
return node;
}
@@ -46466,7 +46776,7 @@ var ts;
}
ts.updateThrow = updateThrow;
function createTry(tryBlock, catchClause, finallyBlock) {
- var node = createSynthesizedNode(229);
+ var node = createSynthesizedNode(230);
node.tryBlock = tryBlock;
node.catchClause = catchClause;
node.finallyBlock = finallyBlock;
@@ -46482,11 +46792,11 @@ var ts;
}
ts.updateTry = updateTry;
function createDebuggerStatement() {
- return createSynthesizedNode(230);
+ return createSynthesizedNode(231);
}
ts.createDebuggerStatement = createDebuggerStatement;
function createVariableDeclaration(name, type, initializer) {
- var node = createSynthesizedNode(231);
+ var node = createSynthesizedNode(232);
node.name = asName(name);
node.type = type;
node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined;
@@ -46502,7 +46812,8 @@ var ts;
}
ts.updateVariableDeclaration = updateVariableDeclaration;
function createVariableDeclarationList(declarations, flags) {
- var node = createSynthesizedNode(232);
+ if (flags === void 0) { flags = 0; }
+ var node = createSynthesizedNode(233);
node.flags |= flags & 3;
node.declarations = createNodeArray(declarations);
return node;
@@ -46515,7 +46826,7 @@ var ts;
}
ts.updateVariableDeclarationList = updateVariableDeclarationList;
function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
- var node = createSynthesizedNode(233);
+ var node = createSynthesizedNode(234);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.asteriskToken = asteriskToken;
@@ -46541,7 +46852,7 @@ var ts;
}
ts.updateFunctionDeclaration = updateFunctionDeclaration;
function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) {
- var node = createSynthesizedNode(234);
+ var node = createSynthesizedNode(235);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -46563,7 +46874,7 @@ var ts;
}
ts.updateClassDeclaration = updateClassDeclaration;
function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) {
- var node = createSynthesizedNode(235);
+ var node = createSynthesizedNode(236);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -46585,7 +46896,7 @@ var ts;
}
ts.updateInterfaceDeclaration = updateInterfaceDeclaration;
function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) {
- var node = createSynthesizedNode(236);
+ var node = createSynthesizedNode(237);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -46605,7 +46916,7 @@ var ts;
}
ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration;
function createEnumDeclaration(decorators, modifiers, name, members) {
- var node = createSynthesizedNode(237);
+ var node = createSynthesizedNode(238);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -46623,7 +46934,8 @@ var ts;
}
ts.updateEnumDeclaration = updateEnumDeclaration;
function createModuleDeclaration(decorators, modifiers, name, body, flags) {
- var node = createSynthesizedNode(238);
+ if (flags === void 0) { flags = 0; }
+ var node = createSynthesizedNode(239);
node.flags |= flags & (16 | 4 | 512);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
@@ -46642,7 +46954,7 @@ var ts;
}
ts.updateModuleDeclaration = updateModuleDeclaration;
function createModuleBlock(statements) {
- var node = createSynthesizedNode(239);
+ var node = createSynthesizedNode(240);
node.statements = createNodeArray(statements);
return node;
}
@@ -46654,7 +46966,7 @@ var ts;
}
ts.updateModuleBlock = updateModuleBlock;
function createCaseBlock(clauses) {
- var node = createSynthesizedNode(240);
+ var node = createSynthesizedNode(241);
node.clauses = createNodeArray(clauses);
return node;
}
@@ -46666,7 +46978,7 @@ var ts;
}
ts.updateCaseBlock = updateCaseBlock;
function createNamespaceExportDeclaration(name) {
- var node = createSynthesizedNode(241);
+ var node = createSynthesizedNode(242);
node.name = asName(name);
return node;
}
@@ -46678,7 +46990,7 @@ var ts;
}
ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration;
function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) {
- var node = createSynthesizedNode(242);
+ var node = createSynthesizedNode(243);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.name = asName(name);
@@ -46696,7 +47008,7 @@ var ts;
}
ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration;
function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) {
- var node = createSynthesizedNode(243);
+ var node = createSynthesizedNode(244);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.importClause = importClause;
@@ -46714,7 +47026,7 @@ var ts;
}
ts.updateImportDeclaration = updateImportDeclaration;
function createImportClause(name, namedBindings) {
- var node = createSynthesizedNode(244);
+ var node = createSynthesizedNode(245);
node.name = name;
node.namedBindings = namedBindings;
return node;
@@ -46728,7 +47040,7 @@ var ts;
}
ts.updateImportClause = updateImportClause;
function createNamespaceImport(name) {
- var node = createSynthesizedNode(245);
+ var node = createSynthesizedNode(246);
node.name = name;
return node;
}
@@ -46740,7 +47052,7 @@ var ts;
}
ts.updateNamespaceImport = updateNamespaceImport;
function createNamedImports(elements) {
- var node = createSynthesizedNode(246);
+ var node = createSynthesizedNode(247);
node.elements = createNodeArray(elements);
return node;
}
@@ -46752,7 +47064,7 @@ var ts;
}
ts.updateNamedImports = updateNamedImports;
function createImportSpecifier(propertyName, name) {
- var node = createSynthesizedNode(247);
+ var node = createSynthesizedNode(248);
node.propertyName = propertyName;
node.name = name;
return node;
@@ -46766,7 +47078,7 @@ var ts;
}
ts.updateImportSpecifier = updateImportSpecifier;
function createExportAssignment(decorators, modifiers, isExportEquals, expression) {
- var node = createSynthesizedNode(248);
+ var node = createSynthesizedNode(249);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.isExportEquals = isExportEquals;
@@ -46783,7 +47095,7 @@ var ts;
}
ts.updateExportAssignment = updateExportAssignment;
function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier) {
- var node = createSynthesizedNode(249);
+ var node = createSynthesizedNode(250);
node.decorators = asNodeArray(decorators);
node.modifiers = asNodeArray(modifiers);
node.exportClause = exportClause;
@@ -46801,7 +47113,7 @@ var ts;
}
ts.updateExportDeclaration = updateExportDeclaration;
function createNamedExports(elements) {
- var node = createSynthesizedNode(250);
+ var node = createSynthesizedNode(251);
node.elements = createNodeArray(elements);
return node;
}
@@ -46813,7 +47125,7 @@ var ts;
}
ts.updateNamedExports = updateNamedExports;
function createExportSpecifier(propertyName, name) {
- var node = createSynthesizedNode(251);
+ var node = createSynthesizedNode(252);
node.propertyName = asName(propertyName);
node.name = asName(name);
return node;
@@ -46827,7 +47139,7 @@ var ts;
}
ts.updateExportSpecifier = updateExportSpecifier;
function createExternalModuleReference(expression) {
- var node = createSynthesizedNode(253);
+ var node = createSynthesizedNode(254);
node.expression = expression;
return node;
}
@@ -46839,7 +47151,7 @@ var ts;
}
ts.updateExternalModuleReference = updateExternalModuleReference;
function createJsxElement(openingElement, children, closingElement) {
- var node = createSynthesizedNode(254);
+ var node = createSynthesizedNode(255);
node.openingElement = openingElement;
node.children = createNodeArray(children);
node.closingElement = closingElement;
@@ -46855,7 +47167,7 @@ var ts;
}
ts.updateJsxElement = updateJsxElement;
function createJsxSelfClosingElement(tagName, typeArguments, attributes) {
- var node = createSynthesizedNode(255);
+ var node = createSynthesizedNode(256);
node.tagName = tagName;
node.typeArguments = typeArguments && createNodeArray(typeArguments);
node.attributes = attributes;
@@ -46871,7 +47183,7 @@ var ts;
}
ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement;
function createJsxOpeningElement(tagName, typeArguments, attributes) {
- var node = createSynthesizedNode(256);
+ var node = createSynthesizedNode(257);
node.tagName = tagName;
node.typeArguments = typeArguments && createNodeArray(typeArguments);
node.attributes = attributes;
@@ -46887,7 +47199,7 @@ var ts;
}
ts.updateJsxOpeningElement = updateJsxOpeningElement;
function createJsxClosingElement(tagName) {
- var node = createSynthesizedNode(257);
+ var node = createSynthesizedNode(258);
node.tagName = tagName;
return node;
}
@@ -46899,7 +47211,7 @@ var ts;
}
ts.updateJsxClosingElement = updateJsxClosingElement;
function createJsxFragment(openingFragment, children, closingFragment) {
- var node = createSynthesizedNode(258);
+ var node = createSynthesizedNode(259);
node.openingFragment = openingFragment;
node.children = createNodeArray(children);
node.closingFragment = closingFragment;
@@ -46915,7 +47227,7 @@ var ts;
}
ts.updateJsxFragment = updateJsxFragment;
function createJsxAttribute(name, initializer) {
- var node = createSynthesizedNode(261);
+ var node = createSynthesizedNode(262);
node.name = name;
node.initializer = initializer;
return node;
@@ -46929,7 +47241,7 @@ var ts;
}
ts.updateJsxAttribute = updateJsxAttribute;
function createJsxAttributes(properties) {
- var node = createSynthesizedNode(262);
+ var node = createSynthesizedNode(263);
node.properties = createNodeArray(properties);
return node;
}
@@ -46941,7 +47253,7 @@ var ts;
}
ts.updateJsxAttributes = updateJsxAttributes;
function createJsxSpreadAttribute(expression) {
- var node = createSynthesizedNode(263);
+ var node = createSynthesizedNode(264);
node.expression = expression;
return node;
}
@@ -46953,7 +47265,7 @@ var ts;
}
ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute;
function createJsxExpression(dotDotDotToken, expression) {
- var node = createSynthesizedNode(264);
+ var node = createSynthesizedNode(265);
node.dotDotDotToken = dotDotDotToken;
node.expression = expression;
return node;
@@ -46966,7 +47278,7 @@ var ts;
}
ts.updateJsxExpression = updateJsxExpression;
function createCaseClause(expression, statements) {
- var node = createSynthesizedNode(265);
+ var node = createSynthesizedNode(266);
node.expression = ts.parenthesizeExpressionForList(expression);
node.statements = createNodeArray(statements);
return node;
@@ -46980,7 +47292,7 @@ var ts;
}
ts.updateCaseClause = updateCaseClause;
function createDefaultClause(statements) {
- var node = createSynthesizedNode(266);
+ var node = createSynthesizedNode(267);
node.statements = createNodeArray(statements);
return node;
}
@@ -46992,7 +47304,7 @@ var ts;
}
ts.updateDefaultClause = updateDefaultClause;
function createHeritageClause(token, types) {
- var node = createSynthesizedNode(267);
+ var node = createSynthesizedNode(268);
node.token = token;
node.types = createNodeArray(types);
return node;
@@ -47005,7 +47317,7 @@ var ts;
}
ts.updateHeritageClause = updateHeritageClause;
function createCatchClause(variableDeclaration, block) {
- var node = createSynthesizedNode(268);
+ var node = createSynthesizedNode(269);
node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration;
node.block = block;
return node;
@@ -47019,7 +47331,7 @@ var ts;
}
ts.updateCatchClause = updateCatchClause;
function createPropertyAssignment(name, initializer) {
- var node = createSynthesizedNode(269);
+ var node = createSynthesizedNode(270);
node.name = asName(name);
node.questionToken = undefined;
node.initializer = ts.parenthesizeExpressionForList(initializer);
@@ -47034,7 +47346,7 @@ var ts;
}
ts.updatePropertyAssignment = updatePropertyAssignment;
function createShorthandPropertyAssignment(name, objectAssignmentInitializer) {
- var node = createSynthesizedNode(270);
+ var node = createSynthesizedNode(271);
node.name = asName(name);
node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined;
return node;
@@ -47048,7 +47360,7 @@ var ts;
}
ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment;
function createSpreadAssignment(expression) {
- var node = createSynthesizedNode(271);
+ var node = createSynthesizedNode(272);
node.expression = expression !== undefined ? ts.parenthesizeExpressionForList(expression) : undefined;
return node;
}
@@ -47060,7 +47372,7 @@ var ts;
}
ts.updateSpreadAssignment = updateSpreadAssignment;
function createEnumMember(name, initializer) {
- var node = createSynthesizedNode(272);
+ var node = createSynthesizedNode(273);
node.name = asName(name);
node.initializer = initializer && ts.parenthesizeExpressionForList(initializer);
return node;
@@ -47079,7 +47391,7 @@ var ts;
(referencedFiles !== undefined && node.referencedFiles !== referencedFiles) ||
(typeReferences !== undefined && node.typeReferenceDirectives !== typeReferences) ||
(hasNoDefaultLib !== undefined && node.hasNoDefaultLib !== hasNoDefaultLib)) {
- var updated = createSynthesizedNode(273);
+ var updated = createSynthesizedNode(274);
updated.flags |= node.flags;
updated.statements = createNodeArray(statements);
updated.endOfFileToken = node.endOfFileToken;
@@ -47118,6 +47430,8 @@ var ts;
updated.parseDiagnostics = node.parseDiagnostics;
if (node.bindDiagnostics !== undefined)
updated.bindDiagnostics = node.bindDiagnostics;
+ if (node.bindSuggestionDiagnostics !== undefined)
+ updated.bindSuggestionDiagnostics = node.bindSuggestionDiagnostics;
if (node.lineMap !== undefined)
updated.lineMap = node.lineMap;
if (node.classifiableNames !== undefined)
@@ -47150,28 +47464,28 @@ var ts;
}
ts.getMutableClone = getMutableClone;
function createNotEmittedStatement(original) {
- var node = createSynthesizedNode(299);
+ var node = createSynthesizedNode(300);
node.original = original;
setTextRange(node, original);
return node;
}
ts.createNotEmittedStatement = createNotEmittedStatement;
function createEndOfDeclarationMarker(original) {
- var node = createSynthesizedNode(303);
+ var node = createSynthesizedNode(304);
node.emitNode = {};
node.original = original;
return node;
}
ts.createEndOfDeclarationMarker = createEndOfDeclarationMarker;
function createMergeDeclarationMarker(original) {
- var node = createSynthesizedNode(302);
+ var node = createSynthesizedNode(303);
node.emitNode = {};
node.original = original;
return node;
}
ts.createMergeDeclarationMarker = createMergeDeclarationMarker;
function createPartiallyEmittedExpression(expression, original) {
- var node = createSynthesizedNode(300);
+ var node = createSynthesizedNode(301);
node.expression = expression;
node.original = original;
setTextRange(node, original);
@@ -47187,7 +47501,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 === 301) {
+ if (node.kind === 302) {
return node.elements;
}
if (ts.isBinaryExpression(node) && node.operatorToken.kind === 26) {
@@ -47197,7 +47511,7 @@ var ts;
return node;
}
function createCommaList(elements) {
- var node = createSynthesizedNode(301);
+ var node = createSynthesizedNode(302);
node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements));
return node;
}
@@ -47210,20 +47524,20 @@ var ts;
ts.updateCommaList = updateCommaList;
function createBundle(sourceFiles, prepends) {
if (prepends === void 0) { prepends = ts.emptyArray; }
- var node = ts.createNode(274);
+ var node = ts.createNode(275);
node.prepends = prepends;
node.sourceFiles = sourceFiles;
return node;
}
ts.createBundle = createBundle;
function createUnparsedSourceFile(text) {
- var node = ts.createNode(275);
+ var node = ts.createNode(276);
node.text = text;
return node;
}
ts.createUnparsedSourceFile = createUnparsedSourceFile;
function createInputFiles(javascript, declaration) {
- var node = ts.createNode(276);
+ var node = ts.createNode(277);
node.javascriptText = javascript;
node.declarationText = declaration;
return node;
@@ -47328,7 +47642,7 @@ var ts;
function getOrCreateEmitNode(node) {
if (!node.emitNode) {
if (ts.isParseTreeNode(node)) {
- if (node.kind === 273) {
+ if (node.kind === 274) {
return node.emitNode = { annotatedNodes: [node] };
}
var sourceFile = ts.getSourceFileOfNode(node);
@@ -47736,7 +48050,7 @@ var ts;
ts.createSpreadHelper = createSpreadHelper;
function createForOfBindingStatement(node, boundValue) {
if (ts.isVariableDeclarationList(node)) {
- var firstDeclaration = ts.firstOrUndefined(node.declarations);
+ var firstDeclaration = ts.first(node.declarations);
var updatedDeclaration = ts.updateVariableDeclaration(firstDeclaration, firstDeclaration.name, undefined, boundValue);
return ts.setTextRange(ts.createVariableStatement(undefined, ts.updateVariableDeclarationList(node, [updatedDeclaration])), node);
}
@@ -47759,7 +48073,7 @@ var ts;
if (!outermostLabeledStatement) {
return node;
}
- var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 227
+ var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 228
? restoreEnclosingLabel(node, outermostLabeledStatement.statement)
: node);
if (afterRestoreLabelCallback) {
@@ -47777,19 +48091,20 @@ var ts;
case 8:
case 9:
return false;
- case 182:
+ case 183:
var elements = target.elements;
if (elements.length === 0) {
return false;
}
return true;
- case 183:
+ case 184:
return target.properties.length > 0;
default:
return true;
}
}
function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers) {
+ if (cacheIdentifiers === void 0) { cacheIdentifiers = false; }
var callee = skipOuterExpressions(expression, 7);
var thisArg;
var target;
@@ -47809,7 +48124,7 @@ var ts;
}
else {
switch (callee.kind) {
- case 184: {
+ case 185: {
if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) {
thisArg = ts.createTempVariable(recordTempVariable);
target = ts.createPropertyAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.name);
@@ -47821,7 +48136,7 @@ var ts;
}
break;
}
- case 185: {
+ case 186: {
if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) {
thisArg = ts.createTempVariable(recordTempVariable);
target = ts.createElementAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.argumentExpression);
@@ -47874,14 +48189,14 @@ var ts;
ts.createExpressionForPropertyName = createExpressionForPropertyName;
function createExpressionForObjectLiteralElementLike(node, property, receiver) {
switch (property.kind) {
- case 155:
case 156:
- return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine);
- case 269:
- return createExpressionForPropertyAssignment(property, receiver);
+ case 157:
+ return createExpressionForAccessorDeclaration(node.properties, property, receiver, !!node.multiLine);
case 270:
+ return createExpressionForPropertyAssignment(property, receiver);
+ case 271:
return createExpressionForShorthandPropertyAssignment(property, receiver);
- case 153:
+ case 154:
return createExpressionForMethodDeclaration(property, receiver);
}
}
@@ -47953,6 +48268,7 @@ var ts;
}
ts.getDeclarationName = getDeclarationName;
function getName(node, allowComments, allowSourceMaps, emitFlags) {
+ if (emitFlags === void 0) { emitFlags = 0; }
var nodeName = ts.getNameOfDeclaration(node);
if (nodeName && ts.isIdentifier(nodeName) && !ts.isGeneratedIdentifier(nodeName)) {
var name = ts.getMutableClone(nodeName);
@@ -47977,7 +48293,7 @@ var ts;
function getNamespaceMemberName(ns, name, allowComments, allowSourceMaps) {
var qualifiedName = ts.createPropertyAccess(ns, ts.nodeIsSynthesized(name) ? name : ts.getSynthesizedClone(name));
ts.setTextRange(qualifiedName, name);
- var emitFlags;
+ var emitFlags = 0;
if (!allowSourceMaps)
emitFlags |= 48;
if (!allowComments)
@@ -47992,7 +48308,8 @@ var ts;
}
ts.convertToFunctionBody = convertToFunctionBody;
function convertFunctionDeclarationToExpression(node) {
- ts.Debug.assert(!!node.body);
+ if (!node.body)
+ return ts.Debug.fail();
var updated = ts.createFunctionExpression(node.modifiers, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body);
ts.setOriginalNode(updated, node);
ts.setTextRange(updated, node);
@@ -48037,7 +48354,7 @@ var ts;
ts.addStandardPrologue = addStandardPrologue;
function addCustomPrologue(target, source, statementOffset, visitor) {
var numStatements = source.length;
- while (statementOffset < numStatements) {
+ while (statementOffset !== undefined && statementOffset < numStatements) {
var statement = source[statementOffset];
if (ts.getEmitFlags(statement) & 1048576) {
ts.append(target, visitor ? ts.visitNode(statement, visitor, ts.isStatement) : statement);
@@ -48081,7 +48398,7 @@ var ts;
ts.ensureUseStrict = ensureUseStrict;
function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
var skipped = ts.skipPartiallyEmittedExpressions(operand);
- if (skipped.kind === 190) {
+ if (skipped.kind === 191) {
return operand;
}
return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand)
@@ -48090,15 +48407,15 @@ var ts;
}
ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand;
function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) {
- var binaryOperatorPrecedence = ts.getOperatorPrecedence(199, binaryOperator);
- var binaryOperatorAssociativity = ts.getOperatorAssociativity(199, binaryOperator);
+ var binaryOperatorPrecedence = ts.getOperatorPrecedence(200, binaryOperator);
+ var binaryOperatorAssociativity = ts.getOperatorAssociativity(200, binaryOperator);
var emittedOperand = ts.skipPartiallyEmittedExpressions(operand);
var operandPrecedence = ts.getExpressionPrecedence(emittedOperand);
switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) {
case -1:
if (!isLeftSideOfBinary
&& binaryOperatorAssociativity === 1
- && operand.kind === 202) {
+ && operand.kind === 203) {
return false;
}
return true;
@@ -48137,7 +48454,7 @@ var ts;
if (ts.isLiteralKind(node.kind)) {
return node.kind;
}
- if (node.kind === 199 && node.operatorToken.kind === 37) {
+ if (node.kind === 200 && node.operatorToken.kind === 37) {
if (node.cachedLiteralKind !== undefined) {
return node.cachedLiteralKind;
}
@@ -48152,7 +48469,7 @@ var ts;
return 0;
}
function parenthesizeForConditionalHead(condition) {
- var conditionalPrecedence = ts.getOperatorPrecedence(200, 55);
+ var conditionalPrecedence = ts.getOperatorPrecedence(201, 55);
var emittedCondition = ts.skipPartiallyEmittedExpressions(condition);
var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition);
if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1) {
@@ -48163,17 +48480,17 @@ var ts;
ts.parenthesizeForConditionalHead = parenthesizeForConditionalHead;
function parenthesizeSubexpressionOfConditionalExpression(e) {
var emittedExpression = ts.skipPartiallyEmittedExpressions(e);
- return emittedExpression.kind === 199 && emittedExpression.operatorToken.kind === 26 ||
- emittedExpression.kind === 301
+ return emittedExpression.kind === 200 && emittedExpression.operatorToken.kind === 26 ||
+ emittedExpression.kind === 302
? ts.createParen(e)
: e;
}
ts.parenthesizeSubexpressionOfConditionalExpression = parenthesizeSubexpressionOfConditionalExpression;
function parenthesizeDefaultExpression(e) {
var check = ts.skipPartiallyEmittedExpressions(e);
- return (check.kind === 204 ||
- check.kind === 191 ||
- check.kind === 301 ||
+ return (check.kind === 205 ||
+ check.kind === 192 ||
+ check.kind === 302 ||
ts.isBinaryExpression(check) && check.operatorToken.kind === 26)
? ts.createParen(e)
: e;
@@ -48182,9 +48499,9 @@ var ts;
function parenthesizeForNew(expression) {
var leftmostExpr = getLeftmostExpression(expression, true);
switch (leftmostExpr.kind) {
- case 186:
- return ts.createParen(expression);
case 187:
+ return ts.createParen(expression);
+ case 188:
return !leftmostExpr.arguments
? ts.createParen(expression)
: expression;
@@ -48195,7 +48512,7 @@ var ts;
function parenthesizeForAccess(expression) {
var emittedExpression = ts.skipPartiallyEmittedExpressions(expression);
if (ts.isLeftHandSideExpression(emittedExpression)
- && (emittedExpression.kind !== 187 || emittedExpression.arguments)) {
+ && (emittedExpression.kind !== 188 || emittedExpression.arguments)) {
return expression;
}
return ts.setTextRange(ts.createParen(expression), expression);
@@ -48233,7 +48550,7 @@ var ts;
function parenthesizeExpressionForList(expression) {
var emittedExpression = ts.skipPartiallyEmittedExpressions(expression);
var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression);
- var commaPrecedence = ts.getOperatorPrecedence(199, 26);
+ var commaPrecedence = ts.getOperatorPrecedence(200, 26);
return expressionPrecedence > commaPrecedence
? expression
: ts.setTextRange(ts.createParen(expression), expression);
@@ -48244,29 +48561,29 @@ var ts;
if (ts.isCallExpression(emittedExpression)) {
var callee = emittedExpression.expression;
var kind = ts.skipPartiallyEmittedExpressions(callee).kind;
- if (kind === 191 || kind === 192) {
+ if (kind === 192 || kind === 193) {
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 === 183 || leftmostExpressionKind === 191) {
+ if (leftmostExpressionKind === 184 || leftmostExpressionKind === 192) {
return ts.setTextRange(ts.createParen(expression), expression);
}
return expression;
}
ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement;
function parenthesizeConditionalTypeMember(member) {
- return member.kind === 170 ? ts.createParenthesizedType(member) : member;
+ return member.kind === 171 ? ts.createParenthesizedType(member) : member;
}
ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember;
function parenthesizeElementTypeMember(member) {
switch (member.kind) {
- case 168:
case 169:
- case 162:
+ case 170:
case 163:
+ case 164:
return ts.createParenthesizedType(member);
}
return parenthesizeConditionalTypeMember(member);
@@ -48274,9 +48591,9 @@ var ts;
ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember;
function parenthesizeArrayTypeMember(member) {
switch (member.kind) {
- case 164:
- case 174:
- case 171:
+ case 165:
+ case 175:
+ case 172:
return ts.createParenthesizedType(member);
}
return parenthesizeElementTypeMember(member);
@@ -48302,24 +48619,24 @@ var ts;
function getLeftmostExpression(node, stopAtCallExpressions) {
while (true) {
switch (node.kind) {
- case 198:
+ case 199:
node = node.operand;
continue;
- case 199:
+ case 200:
node = node.left;
continue;
- case 200:
+ case 201:
node = node.condition;
continue;
- case 186:
+ case 187:
if (stopAtCallExpressions) {
return node;
}
+ case 186:
case 185:
- case 184:
node = node.expression;
continue;
- case 300:
+ case 301:
node = node.expression;
continue;
}
@@ -48327,7 +48644,7 @@ var ts;
}
}
function parenthesizeConciseBody(body) {
- if (!ts.isBlock(body) && getLeftmostExpression(body, false).kind === 183) {
+ if (!ts.isBlock(body) && getLeftmostExpression(body, false).kind === 184) {
return ts.setTextRange(ts.createParen(body), body);
}
return body;
@@ -48343,13 +48660,13 @@ var ts;
function isOuterExpression(node, kinds) {
if (kinds === void 0) { kinds = 7; }
switch (node.kind) {
- case 190:
+ case 191:
return (kinds & 1) !== 0;
- case 189:
- case 207:
+ case 190:
case 208:
+ case 209:
return (kinds & 2) !== 0;
- case 300:
+ case 301:
return (kinds & 4) !== 0;
}
return false;
@@ -48374,7 +48691,7 @@ var ts;
}
ts.skipOuterExpressions = skipOuterExpressions;
function skipAssertions(node) {
- while (ts.isAssertionExpression(node) || node.kind === 208) {
+ while (ts.isAssertionExpression(node) || node.kind === 209) {
node = node.expression;
}
return node;
@@ -48382,15 +48699,15 @@ var ts;
ts.skipAssertions = skipAssertions;
function updateOuterExpression(outerExpression, expression) {
switch (outerExpression.kind) {
- case 190: return ts.updateParen(outerExpression, expression);
- case 189: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression);
- case 207: return ts.updateAsExpression(outerExpression, expression, outerExpression.type);
- case 208: return ts.updateNonNullExpression(outerExpression, expression);
- case 300: return ts.updatePartiallyEmittedExpression(outerExpression, expression);
+ case 191: return ts.updateParen(outerExpression, expression);
+ case 190: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression);
+ case 208: return ts.updateAsExpression(outerExpression, expression, outerExpression.type);
+ case 209: return ts.updateNonNullExpression(outerExpression, expression);
+ case 301: return ts.updatePartiallyEmittedExpression(outerExpression, expression);
}
}
function isIgnorableParen(node) {
- return node.kind === 190
+ return node.kind === 191
&& ts.nodeIsSynthesized(node)
&& ts.nodeIsSynthesized(ts.getSourceMapRange(node))
&& ts.nodeIsSynthesized(ts.getCommentRange(node))
@@ -48452,10 +48769,10 @@ var ts;
var name = namespaceDeclaration.name;
return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name));
}
- if (node.kind === 243 && node.importClause) {
+ if (node.kind === 244 && node.importClause) {
return ts.getGeneratedNameForNode(node);
}
- if (node.kind === 249 && node.moduleSpecifier) {
+ if (node.kind === 250 && node.moduleSpecifier) {
return ts.getGeneratedNameForNode(node);
}
return undefined;
@@ -48496,8 +48813,9 @@ var ts;
return bindingElement.initializer;
}
if (ts.isPropertyAssignment(bindingElement)) {
- return ts.isAssignmentExpression(bindingElement.initializer, true)
- ? bindingElement.initializer.right
+ var initializer = bindingElement.initializer;
+ return ts.isAssignmentExpression(initializer, true)
+ ? initializer.right
: undefined;
}
if (ts.isShorthandPropertyAssignment(bindingElement)) {
@@ -48517,11 +48835,11 @@ var ts;
}
if (ts.isObjectLiteralElementLike(bindingElement)) {
switch (bindingElement.kind) {
- case 269:
- return getTargetOfBindingOrAssignmentElement(bindingElement.initializer);
case 270:
- return bindingElement.name;
+ return getTargetOfBindingOrAssignmentElement(bindingElement.initializer);
case 271:
+ return bindingElement.name;
+ case 272:
return getTargetOfBindingOrAssignmentElement(bindingElement.expression);
}
return undefined;
@@ -48537,11 +48855,11 @@ var ts;
ts.getTargetOfBindingOrAssignmentElement = getTargetOfBindingOrAssignmentElement;
function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) {
switch (bindingElement.kind) {
- case 148:
- case 181:
+ case 149:
+ case 182:
return bindingElement.dotDotDotToken;
- case 203:
- case 271:
+ case 204:
+ case 272:
return bindingElement;
}
return undefined;
@@ -48549,7 +48867,7 @@ var ts;
ts.getRestIndicatorOfBindingOrAssignmentElement = getRestIndicatorOfBindingOrAssignmentElement;
function getPropertyNameOfBindingOrAssignmentElement(bindingElement) {
switch (bindingElement.kind) {
- case 181:
+ case 182:
if (bindingElement.propertyName) {
var propertyName = bindingElement.propertyName;
return ts.isComputedPropertyName(propertyName) && ts.isStringOrNumericLiteral(propertyName.expression)
@@ -48557,7 +48875,7 @@ var ts;
: propertyName;
}
break;
- case 269:
+ case 270:
if (bindingElement.name) {
var propertyName = bindingElement.name;
return ts.isComputedPropertyName(propertyName) && ts.isStringOrNumericLiteral(propertyName.expression)
@@ -48565,7 +48883,7 @@ var ts;
: propertyName;
}
break;
- case 271:
+ case 272:
return bindingElement.name;
}
var target = getTargetOfBindingOrAssignmentElement(bindingElement);
@@ -48579,11 +48897,11 @@ var ts;
ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement;
function getElementsOfBindingOrAssignmentPattern(name) {
switch (name.kind) {
- case 179:
case 180:
- case 182:
- return name.elements;
+ case 181:
case 183:
+ return name.elements;
+ case 184:
return name.properties;
}
}
@@ -48622,11 +48940,11 @@ var ts;
ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement;
function convertToAssignmentPattern(node) {
switch (node.kind) {
- case 180:
- case 182:
- return convertToArrayAssignmentPattern(node);
- case 179:
+ case 181:
case 183:
+ return convertToArrayAssignmentPattern(node);
+ case 180:
+ case 184:
return convertToObjectAssignmentPattern(node);
}
}
@@ -48763,257 +49081,257 @@ var ts;
return undefined;
}
var kind = node.kind;
- if ((kind > 0 && kind <= 144) || kind === 173) {
+ if ((kind > 0 && kind <= 145) || kind === 174) {
return node;
}
switch (kind) {
case 71:
return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration));
- case 145:
- return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier));
case 146:
- 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 147:
- 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 148:
- 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 149:
- 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 150:
- 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 151:
- 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, 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 152:
- 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, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression));
case 153:
- 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 154:
- 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 155:
- 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 156:
- 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 157:
- 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 158:
- 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 159:
- 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 160:
- return ts.updateTypePredicateNode(node, 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 161:
- return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode));
+ return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode));
case 162:
- 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 163:
- 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 164:
- 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 165:
- return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement));
+ return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName));
case 166:
- return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode));
+ return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement));
case 167:
- return ts.updateTypleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode));
+ return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode));
case 168:
- return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode));
+ return ts.updateTypleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode));
case 169:
- return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode));
+ return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode));
case 170:
- 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 171:
- return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration));
- case 178:
- return ts.updateImportTypeNode(node, visitNode(node.argument, visitor, ts.isTypeNode), visitNode(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf);
+ 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 172:
- return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode));
- case 174:
- return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode));
- case 175:
- return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode));
- case 176:
- 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 177:
- return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression));
+ return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration));
case 179:
- return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement));
+ 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 173:
+ return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode));
+ case 175:
+ return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode));
+ case 176:
+ return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode));
+ case 177:
+ 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 178:
+ return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression));
case 180:
- return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement));
+ return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement));
case 181:
- 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 182:
- 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 183:
- return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike));
+ return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression));
case 184:
- return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike));
case 185:
- return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression));
+ return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier));
case 186:
- return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression));
+ return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression));
case 187:
- return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), 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 188:
- 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 189:
- 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 190:
- 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 191:
- 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 192:
- 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 193:
- 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, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context));
case 194:
- return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression));
case 195:
- return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression));
case 196:
- return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression));
case 197:
- return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression));
+ return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression));
case 198:
- return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression));
+ return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression));
case 199:
- 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 200:
- 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, visitor, ts.isToken));
case 201:
- 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, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression));
case 202:
- 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 203:
- 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 204:
+ return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 205:
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 206:
- return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression));
case 207:
- 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 208:
- 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 209:
- return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression));
case 210:
+ return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier));
+ case 211:
return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail));
- case 212:
- return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement));
case 213:
+ return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement));
+ case 214:
return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList));
- case 215:
- return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression));
case 216:
- 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.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression));
case 217:
- 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 218:
- 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 219:
- 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 220:
- 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 221:
- 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 222:
- return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier));
+ 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 223:
- return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier));
+ return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier));
case 224:
- return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier));
case 225:
- 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 226:
- 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 227:
- 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 228:
- 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 229:
+ return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 230:
return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock));
- case 231:
- return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression));
case 232:
- return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration));
+ return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression));
case 233:
- 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 234:
- 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 235:
- 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 236:
- 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 237:
- 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 238:
- 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 239:
- 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 240:
- return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause));
+ return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement));
case 241:
- return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause));
case 242:
- 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 243:
- 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 244:
- return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings));
+ 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 245:
- return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier));
+ return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings));
case 246:
- return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier));
+ return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier));
case 247:
- 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 248:
- 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 249:
- return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression));
+ return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression));
case 250:
- return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier));
+ return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression));
case 251:
+ return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier));
+ case 252:
return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier));
- case 253:
- return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression));
case 254:
- 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 255:
- 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 256:
- 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 257:
- 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 258:
+ return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression));
+ case 259:
return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment));
- case 261:
- return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression));
case 262:
- 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 263:
- return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike));
case 264:
- return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression));
+ return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression));
case 265:
- 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 266:
- 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 267:
- return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments));
+ return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement));
case 268:
- 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 269:
- 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 270:
- 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 271:
- 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 272:
- return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression));
+ return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression));
case 273:
+ return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression));
+ case 274:
return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context));
- case 300:
- return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression));
case 301:
+ return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression));
+ case 302:
return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression));
default:
return node;
@@ -49039,52 +49357,52 @@ var ts;
var reduceNodes = cbNodeArray ? reduceNodeArray : ts.reduceLeft;
var cbNodes = cbNodeArray || cbNode;
var kind = node.kind;
- if ((kind > 0 && kind <= 144)) {
+ if ((kind > 0 && kind <= 145)) {
return initial;
}
- if ((kind >= 160 && kind <= 177)) {
+ if ((kind >= 161 && kind <= 178)) {
return initial;
}
var result = initial;
switch (node.kind) {
- case 211:
- case 214:
- case 205:
- case 230:
- case 299:
+ case 212:
+ case 215:
+ case 206:
+ case 231:
+ case 300:
break;
- case 145:
+ case 146:
result = reduceNode(node.left, cbNode, result);
result = reduceNode(node.right, cbNode, result);
break;
- case 146:
+ case 147:
result = reduceNode(node.expression, cbNode, result);
break;
- case 148:
+ case 149:
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 149:
+ case 150:
result = reduceNode(node.expression, cbNode, result);
break;
- case 150:
+ case 151:
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 151:
+ case 152:
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 153:
+ case 154:
result = reduceNodes(node.decorators, cbNodes, result);
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.name, cbNode, result);
@@ -49093,53 +49411,48 @@ var ts;
result = reduceNode(node.type, cbNode, result);
result = reduceNode(node.body, cbNode, result);
break;
- case 154:
- result = reduceNodes(node.modifiers, cbNodes, result);
- result = reduceNodes(node.parameters, cbNodes, result);
- result = reduceNode(node.body, cbNode, result);
- break;
case 155:
- 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.type, cbNode, result);
result = reduceNode(node.body, cbNode, result);
break;
case 156:
+ 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.type, cbNode, result);
+ result = reduceNode(node.body, cbNode, result);
+ break;
+ case 157:
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 179:
case 180:
+ case 181:
result = reduceNodes(node.elements, cbNodes, result);
break;
- case 181:
+ case 182:
result = reduceNode(node.propertyName, cbNode, result);
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.initializer, cbNode, result);
break;
- case 182:
+ case 183:
result = reduceNodes(node.elements, cbNodes, result);
break;
- case 183:
- result = reduceNodes(node.properties, cbNodes, result);
- break;
case 184:
- result = reduceNode(node.expression, cbNode, result);
- result = reduceNode(node.name, cbNode, result);
+ result = reduceNodes(node.properties, cbNodes, result);
break;
case 185:
result = reduceNode(node.expression, cbNode, result);
- result = reduceNode(node.argumentExpression, cbNode, result);
+ result = reduceNode(node.name, cbNode, result);
break;
case 186:
result = reduceNode(node.expression, cbNode, result);
- result = reduceNodes(node.typeArguments, cbNodes, result);
- result = reduceNodes(node.arguments, cbNodes, result);
+ result = reduceNode(node.argumentExpression, cbNode, result);
break;
case 187:
result = reduceNode(node.expression, cbNode, result);
@@ -49147,14 +49460,19 @@ var ts;
result = reduceNodes(node.arguments, cbNodes, result);
break;
case 188:
+ result = reduceNode(node.expression, cbNode, result);
+ result = reduceNodes(node.typeArguments, cbNodes, result);
+ result = reduceNodes(node.arguments, cbNodes, result);
+ break;
+ case 189:
result = reduceNode(node.tag, cbNode, result);
result = reduceNode(node.template, cbNode, result);
break;
- case 189:
+ case 190:
result = reduceNode(node.type, cbNode, result);
result = reduceNode(node.expression, cbNode, result);
break;
- case 191:
+ case 192:
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.name, cbNode, result);
result = reduceNodes(node.typeParameters, cbNodes, result);
@@ -49162,262 +49480,262 @@ var ts;
result = reduceNode(node.type, cbNode, result);
result = reduceNode(node.body, cbNode, result);
break;
- case 192:
+ case 193:
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 190:
- case 193:
+ case 191:
case 194:
case 195:
case 196:
- case 202:
+ case 197:
case 203:
- case 208:
+ case 204:
+ case 209:
result = reduceNode(node.expression, cbNode, result);
break;
- case 197:
case 198:
+ case 199:
result = reduceNode(node.operand, cbNode, result);
break;
- case 199:
+ case 200:
result = reduceNode(node.left, cbNode, result);
result = reduceNode(node.right, cbNode, result);
break;
- case 200:
+ case 201:
result = reduceNode(node.condition, cbNode, result);
result = reduceNode(node.whenTrue, cbNode, result);
result = reduceNode(node.whenFalse, cbNode, result);
break;
- case 201:
+ case 202:
result = reduceNode(node.head, cbNode, result);
result = reduceNodes(node.templateSpans, cbNodes, result);
break;
- case 204:
+ case 205:
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 206:
+ case 207:
result = reduceNode(node.expression, cbNode, result);
result = reduceNodes(node.typeArguments, cbNodes, result);
break;
- case 207:
+ case 208:
result = reduceNode(node.expression, cbNode, result);
result = reduceNode(node.type, cbNode, result);
break;
- case 210:
+ case 211:
result = reduceNode(node.expression, cbNode, result);
result = reduceNode(node.literal, cbNode, result);
break;
- case 212:
+ case 213:
result = reduceNodes(node.statements, cbNodes, result);
break;
- case 213:
+ case 214:
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.declarationList, cbNode, result);
break;
- case 215:
+ case 216:
result = reduceNode(node.expression, cbNode, result);
break;
- case 216:
+ case 217:
result = reduceNode(node.expression, cbNode, result);
result = reduceNode(node.thenStatement, cbNode, result);
result = reduceNode(node.elseStatement, cbNode, result);
break;
- case 217:
- result = reduceNode(node.statement, cbNode, result);
- result = reduceNode(node.expression, cbNode, result);
- break;
case 218:
- case 225:
- result = reduceNode(node.expression, cbNode, result);
result = reduceNode(node.statement, cbNode, result);
+ result = reduceNode(node.expression, cbNode, result);
break;
case 219:
+ case 226:
+ result = reduceNode(node.expression, cbNode, result);
+ result = reduceNode(node.statement, cbNode, result);
+ break;
+ case 220:
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 220:
case 221:
+ case 222:
result = reduceNode(node.initializer, cbNode, result);
result = reduceNode(node.expression, cbNode, result);
result = reduceNode(node.statement, cbNode, result);
break;
- case 224:
- case 228:
+ case 225:
+ case 229:
result = reduceNode(node.expression, cbNode, result);
break;
- case 226:
+ case 227:
result = reduceNode(node.expression, cbNode, result);
result = reduceNode(node.caseBlock, cbNode, result);
break;
- case 227:
+ case 228:
result = reduceNode(node.label, cbNode, result);
result = reduceNode(node.statement, cbNode, result);
break;
- case 229:
+ case 230:
result = reduceNode(node.tryBlock, cbNode, result);
result = reduceNode(node.catchClause, cbNode, result);
result = reduceNode(node.finallyBlock, cbNode, result);
break;
- case 231:
+ case 232:
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.type, cbNode, result);
result = reduceNode(node.initializer, cbNode, result);
break;
- case 232:
- result = reduceNodes(node.declarations, cbNodes, result);
- break;
case 233:
- result = reduceNodes(node.decorators, cbNodes, result);
- result = reduceNodes(node.modifiers, cbNodes, result);
- result = reduceNode(node.name, cbNode, 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);
+ result = reduceNodes(node.declarations, cbNodes, result);
break;
case 234:
result = reduceNodes(node.decorators, cbNodes, result);
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);
+ result = reduceNodes(node.parameters, cbNodes, result);
+ result = reduceNode(node.type, cbNode, result);
+ result = reduceNode(node.body, cbNode, result);
break;
- case 237:
+ case 235:
result = reduceNodes(node.decorators, cbNodes, result);
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 238:
result = reduceNodes(node.decorators, cbNodes, result);
result = reduceNodes(node.modifiers, cbNodes, result);
result = reduceNode(node.name, cbNode, result);
- result = reduceNode(node.body, cbNode, result);
+ result = reduceNodes(node.members, cbNodes, result);
break;
case 239:
- result = reduceNodes(node.statements, cbNodes, result);
+ 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 240:
+ result = reduceNodes(node.statements, cbNodes, result);
+ break;
+ case 241:
result = reduceNodes(node.clauses, cbNodes, result);
break;
- case 242:
+ case 243:
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 243:
+ case 244:
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 244:
+ case 245:
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.namedBindings, cbNode, result);
break;
- case 245:
- result = reduceNode(node.name, cbNode, result);
- break;
case 246:
- case 250:
- result = reduceNodes(node.elements, cbNodes, result);
+ result = reduceNode(node.name, cbNode, result);
break;
case 247:
case 251:
+ result = reduceNodes(node.elements, cbNodes, result);
+ break;
+ case 248:
+ case 252:
result = reduceNode(node.propertyName, cbNode, result);
result = reduceNode(node.name, cbNode, result);
break;
- case 248:
+ case 249:
result = ts.reduceLeft(node.decorators, cbNode, result);
result = ts.reduceLeft(node.modifiers, cbNode, result);
result = reduceNode(node.expression, cbNode, result);
break;
- case 249:
+ case 250:
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 253:
+ case 254:
result = reduceNode(node.expression, cbNode, result);
break;
- case 254:
+ case 255:
result = reduceNode(node.openingElement, cbNode, result);
result = ts.reduceLeft(node.children, cbNode, result);
result = reduceNode(node.closingElement, cbNode, result);
break;
- case 258:
+ case 259:
result = reduceNode(node.openingFragment, cbNode, result);
result = ts.reduceLeft(node.children, cbNode, result);
result = reduceNode(node.closingFragment, cbNode, result);
break;
- case 255:
case 256:
+ case 257:
result = reduceNode(node.tagName, cbNode, result);
result = reduceNode(node.attributes, cbNode, result);
break;
- case 262:
+ case 263:
result = reduceNodes(node.properties, cbNodes, result);
break;
- case 257:
+ case 258:
result = reduceNode(node.tagName, cbNode, result);
break;
- case 261:
+ case 262:
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.initializer, cbNode, result);
break;
- case 263:
- result = reduceNode(node.expression, cbNode, result);
- break;
case 264:
result = reduceNode(node.expression, cbNode, result);
break;
case 265:
result = reduceNode(node.expression, cbNode, result);
+ break;
case 266:
+ result = reduceNode(node.expression, cbNode, result);
+ case 267:
result = reduceNodes(node.statements, cbNodes, result);
break;
- case 267:
+ case 268:
result = reduceNodes(node.types, cbNodes, result);
break;
- case 268:
+ case 269:
result = reduceNode(node.variableDeclaration, cbNode, result);
result = reduceNode(node.block, cbNode, result);
break;
- case 269:
+ case 270:
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.initializer, cbNode, result);
break;
- case 270:
+ case 271:
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.objectAssignmentInitializer, cbNode, result);
break;
- case 271:
+ case 272:
result = reduceNode(node.expression, cbNode, result);
break;
- case 272:
+ case 273:
result = reduceNode(node.name, cbNode, result);
result = reduceNode(node.initializer, cbNode, result);
break;
- case 273:
+ case 274:
result = reduceNodes(node.statements, cbNodes, result);
break;
- case 300:
+ case 301:
result = reduceNode(node.expression, cbNode, result);
break;
- case 301:
+ case 302:
result = reduceNodes(node.elements, cbNodes, result);
break;
default:
@@ -49431,8 +49749,8 @@ var ts;
return statements;
}
return ts.isNodeArray(statements)
- ? ts.setTextRange(ts.createNodeArray(ts.concatenate(declarations, statements)), statements)
- : ts.prependRange(statements, declarations);
+ ? ts.setTextRange(ts.createNodeArray(ts.prependStatements(statements.slice(), declarations)), statements)
+ : ts.prependStatements(statements, declarations);
}
ts.mergeLexicalEnvironment = mergeLexicalEnvironment;
function liftToBlock(nodes) {
@@ -49470,7 +49788,7 @@ var ts;
return subtreeFlags;
}
function aggregateTransformFlagsForSubtree(node) {
- if (ts.hasModifier(node, 2) || (ts.isTypeNode(node) && node.kind !== 206)) {
+ if (ts.hasModifier(node, 2) || (ts.isTypeNode(node) && node.kind !== 207)) {
return 0;
}
return reduceEachChild(node, 0, aggregateTransformFlagsForChildNode, aggregateTransformFlagsForChildNodes);
@@ -49511,7 +49829,7 @@ var ts;
});
Object.defineProperties(ts.objectAllocator.getTypeConstructor().prototype, {
__debugFlags: { get: function () { return ts.formatTypeFlags(this.flags); } },
- __debugObjectFlags: { get: function () { return this.flags & 65536 ? ts.formatObjectFlags(this.objectFlags) : ""; } },
+ __debugObjectFlags: { get: function () { return this.flags & 131072 ? ts.formatObjectFlags(this.objectFlags) : ""; } },
__debugTypeToString: { value: function () { return this.checker.typeToString(this); } },
});
var nodeConstructors = [
@@ -49560,12 +49878,12 @@ var ts;
return ts.some(node.elements, isNamedDefaultReference);
}
function isNamedDefaultReference(e) {
- return e.propertyName && e.propertyName.escapedText === "default";
+ return e.propertyName !== undefined && e.propertyName.escapedText === "default";
}
function chainBundle(transformSourceFile) {
return transformSourceFileOrBundle;
function transformSourceFileOrBundle(node) {
- return node.kind === 273 ? transformSourceFile(node) : transformBundle(node);
+ return node.kind === 274 ? transformSourceFile(node) : transformBundle(node);
}
function transformBundle(node) {
return ts.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends);
@@ -49593,7 +49911,7 @@ var ts;
}
ts.getImportNeedsImportStarHelper = getImportNeedsImportStarHelper;
function getImportNeedsImportDefaultHelper(node) {
- return !getImportNeedsImportStarHelper(node) && (ts.isDefaultImport(node) || (node.importClause && ts.isNamedImports(node.importClause.namedBindings) && containsDefaultReference(node.importClause.namedBindings)));
+ return !getImportNeedsImportStarHelper(node) && (ts.isDefaultImport(node) || (!!node.importClause && ts.isNamedImports(node.importClause.namedBindings) && containsDefaultReference(node.importClause.namedBindings)));
}
ts.getImportNeedsImportDefaultHelper = getImportNeedsImportDefaultHelper;
function collectExternalModuleInfo(sourceFile, resolver, compilerOptions) {
@@ -49609,16 +49927,16 @@ var ts;
for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {
var node = _a[_i];
switch (node.kind) {
- case 243:
+ case 244:
externalImports.push(node);
hasImportStarOrImportDefault = hasImportStarOrImportDefault || getImportNeedsImportStarHelper(node) || getImportNeedsImportDefaultHelper(node);
break;
- case 242:
- if (node.moduleReference.kind === 253) {
+ case 243:
+ if (node.moduleReference.kind === 254) {
externalImports.push(node);
}
break;
- case 249:
+ case 250:
if (node.moduleSpecifier) {
if (!node.exportClause) {
externalImports.push(node);
@@ -49645,12 +49963,12 @@ var ts;
}
}
break;
- case 248:
+ case 249:
if (node.isExportEquals && !exportEquals) {
exportEquals = node;
}
break;
- case 213:
+ case 214:
if (ts.hasModifier(node, 1)) {
for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) {
var decl = _e[_d];
@@ -49658,7 +49976,7 @@ var ts;
}
}
break;
- case 233:
+ case 234:
if (ts.hasModifier(node, 1)) {
if (ts.hasModifier(node, 512)) {
if (!hasExportDefault) {
@@ -49676,7 +49994,7 @@ var ts;
}
}
break;
- case 234:
+ case 235:
if (ts.hasModifier(node, 1)) {
if (ts.hasModifier(node, 512)) {
if (!hasExportDefault) {
@@ -49783,7 +50101,7 @@ var ts;
var flattenContext = {
context: context,
level: level,
- downlevelIteration: context.getCompilerOptions().downlevelIteration,
+ downlevelIteration: !!context.getCompilerOptions().downlevelIteration,
hoistTempVariables: true,
emitExpression: emitExpression,
emitBindingOrAssignment: emitBindingOrAssignment,
@@ -49848,13 +50166,14 @@ var ts;
return false;
}
function flattenDestructuringBinding(node, visitor, context, level, rval, hoistTempVariables, skipInitializer) {
+ if (hoistTempVariables === void 0) { hoistTempVariables = false; }
var pendingExpressions;
var pendingDeclarations = [];
var declarations = [];
var flattenContext = {
context: context,
level: level,
- downlevelIteration: context.getCompilerOptions().downlevelIteration,
+ downlevelIteration: !!context.getCompilerOptions().downlevelIteration,
hoistTempVariables: hoistTempVariables,
emitExpression: emitExpression,
emitBindingOrAssignment: emitBindingOrAssignment,
@@ -49880,7 +50199,7 @@ var ts;
}
else {
context.hoistVariableDeclaration(temp);
- var pendingDeclaration = ts.lastOrUndefined(pendingDeclarations);
+ var pendingDeclaration = ts.last(pendingDeclarations);
pendingDeclaration.pendingExpressions = ts.append(pendingDeclaration.pendingExpressions, ts.createAssignment(temp, pendingDeclaration.value));
ts.addRange(pendingDeclaration.pendingExpressions, pendingExpressions);
pendingDeclaration.value = temp;
@@ -50147,8 +50466,8 @@ var ts;
var previousOnSubstituteNode = context.onSubstituteNode;
context.onEmitNode = onEmitNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableSubstitution(184);
context.enableSubstitution(185);
+ context.enableSubstitution(186);
var currentSourceFile;
var currentNamespace;
var currentNamespaceContainerName;
@@ -50160,14 +50479,14 @@ var ts;
var pendingExpressions;
return transformSourceFileOrBundle;
function transformSourceFileOrBundle(node) {
- if (node.kind === 274) {
+ if (node.kind === 275) {
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 === 276) {
+ if (prepend.kind === 277) {
return ts.createUnparsedSourceFile(prepend.javascriptText);
}
return prepend;
@@ -50196,15 +50515,15 @@ var ts;
}
function onBeforeVisitNode(node) {
switch (node.kind) {
- case 273:
+ case 274:
+ case 241:
case 240:
- case 239:
- case 212:
+ case 213:
currentScope = node;
currentScopeFirstDeclarationsOfName = undefined;
break;
+ case 235:
case 234:
- case 233:
if (ts.hasModifier(node, 2)) {
break;
}
@@ -50212,7 +50531,7 @@ var ts;
recordEmittedDeclarationInScope(node);
}
else {
- ts.Debug.assert(node.kind === 234 || ts.hasModifier(node, 512));
+ ts.Debug.assert(node.kind === 235 || ts.hasModifier(node, 512));
}
break;
}
@@ -50234,10 +50553,10 @@ var ts;
}
function sourceElementVisitorWorker(node) {
switch (node.kind) {
+ case 244:
case 243:
- case 242:
- case 248:
case 249:
+ case 250:
return visitEllidableStatement(node);
default:
return visitorWorker(node);
@@ -50252,13 +50571,13 @@ var ts;
return node;
}
switch (node.kind) {
- case 243:
+ case 244:
return visitImportDeclaration(node);
- case 242:
+ case 243:
return visitImportEqualsDeclaration(node);
- case 248:
- return visitExportAssignment(node);
case 249:
+ return visitExportAssignment(node);
+ case 250:
return visitExportDeclaration(node);
default:
ts.Debug.fail("Unhandled ellided statement");
@@ -50268,11 +50587,11 @@ var ts;
return saveStateAndInvoke(node, namespaceElementVisitorWorker);
}
function namespaceElementVisitorWorker(node) {
- if (node.kind === 249 ||
- node.kind === 243 ||
+ if (node.kind === 250 ||
node.kind === 244 ||
- (node.kind === 242 &&
- node.moduleReference.kind === 253)) {
+ node.kind === 245 ||
+ (node.kind === 243 &&
+ node.moduleReference.kind === 254)) {
return undefined;
}
else if (node.transformFlags & 1 || ts.hasModifier(node, 1)) {
@@ -50288,15 +50607,15 @@ var ts;
}
function classElementVisitorWorker(node) {
switch (node.kind) {
- case 154:
- return undefined;
- case 151:
- case 159:
case 155:
+ return undefined;
+ case 152:
+ case 160:
case 156:
- case 153:
+ case 157:
+ case 154:
return visitorWorker(node);
- case 211:
+ case 212:
return node;
default:
return ts.Debug.failBadSyntaxKind(node);
@@ -50326,87 +50645,88 @@ var ts;
case 76:
case 124:
case 132:
- case 166:
case 167:
- case 165:
- case 160:
- case 147:
+ case 168:
+ case 166:
+ case 161:
+ case 148:
case 119:
+ case 142:
case 122:
case 137:
case 134:
case 131:
case 105:
case 138:
- case 163:
- case 162:
case 164:
- case 161:
- case 168:
+ case 163:
+ case 165:
+ case 162:
case 169:
case 170:
- case 172:
+ case 171:
case 173:
case 174:
case 175:
case 176:
case 177:
- case 159:
- case 149:
- case 236:
- return undefined;
- case 151:
- return visitPropertyDeclaration(node);
- case 241:
- return undefined;
- case 154:
- return visitConstructor(node);
- case 235:
- return ts.createNotEmittedStatement(node);
- case 234:
- return visitClassDeclaration(node);
- case 204:
- return visitClassExpression(node);
- case 267:
- return visitHeritageClause(node);
- case 206:
- return visitExpressionWithTypeArguments(node);
- case 153:
- return visitMethodDeclaration(node);
- case 155:
- return visitGetAccessor(node);
- case 156:
- return visitSetAccessor(node);
- case 233:
- return visitFunctionDeclaration(node);
- case 191:
- return visitFunctionExpression(node);
- case 192:
- return visitArrowFunction(node);
- case 148:
- return visitParameter(node);
- case 190:
- return visitParenthesizedExpression(node);
- case 189:
- case 207:
- return visitAssertionExpression(node);
- case 186:
- return visitCallExpression(node);
- case 187:
- return visitNewExpression(node);
- case 188:
- return visitTaggedTemplateExpression(node);
- case 208:
- return visitNonNullExpression(node);
+ case 178:
+ case 160:
+ case 150:
case 237:
- return visitEnumDeclaration(node);
- case 213:
- return visitVariableStatement(node);
- case 231:
- return visitVariableDeclaration(node);
- case 238:
- return visitModuleDeclaration(node);
+ return undefined;
+ case 152:
+ return visitPropertyDeclaration(node);
case 242:
+ return undefined;
+ case 155:
+ return visitConstructor(node);
+ case 236:
+ return ts.createNotEmittedStatement(node);
+ case 235:
+ return visitClassDeclaration(node);
+ case 205:
+ return visitClassExpression(node);
+ case 268:
+ return visitHeritageClause(node);
+ case 207:
+ return visitExpressionWithTypeArguments(node);
+ case 154:
+ return visitMethodDeclaration(node);
+ case 156:
+ return visitGetAccessor(node);
+ case 157:
+ return visitSetAccessor(node);
+ case 234:
+ return visitFunctionDeclaration(node);
+ case 192:
+ return visitFunctionExpression(node);
+ case 193:
+ return visitArrowFunction(node);
+ case 149:
+ return visitParameter(node);
+ case 191:
+ return visitParenthesizedExpression(node);
+ case 190:
+ case 208:
+ return visitAssertionExpression(node);
+ case 187:
+ return visitCallExpression(node);
+ case 188:
+ return visitNewExpression(node);
+ case 189:
+ return visitTaggedTemplateExpression(node);
+ case 209:
+ return visitNonNullExpression(node);
+ case 238:
+ return visitEnumDeclaration(node);
+ case 214:
+ return visitVariableStatement(node);
+ case 232:
+ return visitVariableDeclaration(node);
+ case 239:
+ return visitModuleDeclaration(node);
+ case 243:
return visitImportEqualsDeclaration(node);
default:
return ts.Debug.failBadSyntaxKind(node);
@@ -50414,7 +50734,8 @@ var ts;
}
function visitSourceFile(node) {
var alwaysStrict = ts.getStrictOptionValue(compilerOptions, "alwaysStrict") &&
- !(ts.isExternalModule(node) && moduleKind >= ts.ModuleKind.ES2015);
+ !(ts.isExternalModule(node) && moduleKind >= ts.ModuleKind.ES2015) &&
+ !ts.isJsonSourceFile(node);
return ts.updateSourceFileNode(node, ts.visitLexicalEnvironment(node.statements, sourceElementVisitor, context, 0, alwaysStrict));
}
function shouldEmitDecorateCallForClass(node) {
@@ -50484,7 +50805,7 @@ var ts;
statement.pos = closingBraceLocation.pos;
ts.setEmitFlags(statement, 1536 | 384);
statements.push(statement);
- ts.prependRange(statements, context.endLexicalEnvironment());
+ ts.prependStatements(statements, context.endLexicalEnvironment());
var iife = ts.createImmediatelyInvokedArrowFunction(statements);
ts.setEmitFlags(iife, 33554432);
var varStatement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([
@@ -50626,7 +50947,7 @@ var ts;
return index;
}
var statement = statements[index];
- if (statement.kind === 215 && ts.isSuperCall(statement.expression)) {
+ if (statement.kind === 216 && ts.isSuperCall(statement.expression)) {
result.push(ts.visitNode(statement, visitor, ts.isStatement));
return index + 1;
}
@@ -50660,7 +50981,7 @@ var ts;
return isInitializedProperty(member, false);
}
function isInitializedProperty(member, isStatic) {
- return member.kind === 151
+ return member.kind === 152
&& isStatic === ts.hasModifier(member, 32)
&& member.initializer !== undefined;
}
@@ -50735,12 +51056,12 @@ var ts;
}
function getAllDecoratorsOfClassElement(node, member) {
switch (member.kind) {
- case 155:
case 156:
+ case 157:
return getAllDecoratorsOfAccessors(node, member);
- case 153:
+ case 154:
return getAllDecoratorsOfMethod(member);
- case 151:
+ case 152:
return getAllDecoratorsOfProperty(member);
default:
return undefined;
@@ -50819,7 +51140,7 @@ var ts;
var prefix = getClassMemberPrefix(node, member);
var memberName = getExpressionForPropertyName(member, true);
var descriptor = languageVersion > 0
- ? member.kind === 151
+ ? member.kind === 152
? ts.createVoidZero()
: ts.createNull()
: undefined;
@@ -50903,37 +51224,37 @@ var ts;
}
function shouldAddTypeMetadata(node) {
var kind = node.kind;
- return kind === 153
- || kind === 155
+ return kind === 154
|| kind === 156
- || kind === 151;
+ || kind === 157
+ || kind === 152;
}
function shouldAddReturnTypeMetadata(node) {
- return node.kind === 153;
+ return node.kind === 154;
}
function shouldAddParamTypesMetadata(node) {
switch (node.kind) {
- case 234:
- case 204:
+ case 235:
+ case 205:
return ts.getFirstConstructorWithBody(node) !== undefined;
- case 153:
- case 155:
+ case 154:
case 156:
+ case 157:
return true;
}
return false;
}
function serializeTypeOfNode(node) {
switch (node.kind) {
- case 151:
- case 148:
- case 155:
- return serializeTypeNode(node.type);
+ case 152:
+ case 149:
case 156:
+ return serializeTypeNode(node.type);
+ case 157:
return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node));
- case 234:
- case 204:
- case 153:
+ case 235:
+ case 205:
+ case 154:
return ts.createIdentifier("Function");
default:
return ts.createVoidZero();
@@ -50965,7 +51286,7 @@ var ts;
return ts.createArrayLiteral(expressions);
}
function getParametersOfDecoratedDeclaration(node, container) {
- if (container && node.kind === 155) {
+ if (container && node.kind === 156) {
var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor;
if (setAccessor) {
return setAccessor.parameters;
@@ -50992,22 +51313,22 @@ var ts;
case 95:
case 131:
return ts.createVoidZero();
- case 172:
+ case 173:
return serializeTypeNode(node.type);
- case 162:
case 163:
+ case 164:
return ts.createIdentifier("Function");
- case 166:
case 167:
+ case 168:
return ts.createIdentifier("Array");
- case 160:
+ case 161:
case 122:
return ts.createIdentifier("Boolean");
case 137:
return ts.createIdentifier("String");
case 135:
return ts.createIdentifier("Object");
- case 177:
+ case 178:
switch (node.literal.kind) {
case 9:
return ts.createIdentifier("String");
@@ -51025,18 +51346,19 @@ var ts;
return languageVersion < 2
? getGlobalSymbolNameWithFallback()
: ts.createIdentifier("Symbol");
- case 161:
+ case 162:
return serializeTypeReferenceNode(node);
+ case 170:
case 169:
- case 168:
return serializeUnionOrIntersectionType(node);
- case 164:
- case 174:
+ case 165:
case 175:
case 176:
- case 165:
+ case 177:
+ case 166:
case 119:
- case 173:
+ case 142:
+ case 174:
break;
default:
return ts.Debug.failBadSyntaxKind(node);
@@ -51047,7 +51369,7 @@ var ts;
var serializedUnion;
for (var _i = 0, _a = node.types; _i < _a.length; _i++) {
var typeNode = _a[_i];
- while (typeNode.kind === 172) {
+ while (typeNode.kind === 173) {
typeNode = typeNode.type;
}
if (typeNode.kind === 131) {
@@ -51074,7 +51396,8 @@ var ts;
return serializedUnion || ts.createVoidZero();
}
function serializeTypeReferenceNode(node) {
- switch (resolver.getTypeReferenceSerializationKind(node.typeName, currentScope)) {
+ var kind = resolver.getTypeReferenceSerializationKind(node.typeName, currentScope);
+ switch (kind) {
case ts.TypeReferenceSerializationKind.Unknown:
var serialized = serializeEntityNameAsExpression(node.typeName, true);
var temp = ts.createTempVariable(hoistVariableDeclaration);
@@ -51100,8 +51423,9 @@ var ts;
case ts.TypeReferenceSerializationKind.Promise:
return ts.createIdentifier("Promise");
case ts.TypeReferenceSerializationKind.ObjectType:
- default:
return ts.createIdentifier("Object");
+ default:
+ return ts.Debug.assertNever(kind);
}
}
function serializeEntityNameAsExpression(node, useFallback) {
@@ -51115,7 +51439,7 @@ var ts;
return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name), ts.createLiteral("undefined")), name);
}
return name;
- case 145:
+ case 146:
return serializeQualifiedNameAsExpression(node, useFallback);
}
}
@@ -51370,7 +51694,7 @@ var ts;
var statements = [];
startLexicalEnvironment();
var members = ts.map(node.members, transformEnumMember);
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
ts.addRange(statements, members);
currentNamespaceContainerName = savedCurrentNamespaceLocalName;
return ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), node.members), true);
@@ -51400,7 +51724,7 @@ var ts;
}
}
function shouldEmitModuleDeclaration(node) {
- return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules);
+ return ts.isInstantiatedModule(node, !!compilerOptions.preserveConstEnums || !!compilerOptions.isolatedModules);
}
function hasNamespaceQualifiedExportName(node) {
return isExportOfNamespace(node)
@@ -51432,11 +51756,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))
- ], currentScope.kind === 273 ? 0 : 1));
+ ], currentScope.kind === 274 ? 0 : 1));
ts.setOriginalNode(statement, node);
recordEmittedDeclarationInScope(node);
if (isFirstEmittedDeclarationInScope(node)) {
- if (node.kind === 237) {
+ if (node.kind === 238) {
ts.setSourceMapRange(statement.declarationList, node);
}
else {
@@ -51497,7 +51821,7 @@ var ts;
var statementsLocation;
var blockLocation;
var body = node.body;
- if (body.kind === 239) {
+ if (body.kind === 240) {
saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); });
statementsLocation = body.statements;
blockLocation = body;
@@ -51515,19 +51839,19 @@ var ts;
var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body;
statementsLocation = ts.moveRangePos(moduleBlock.statements, -1);
}
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
currentNamespaceContainerName = savedCurrentNamespaceContainerName;
currentNamespace = savedCurrentNamespace;
currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName;
var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), true);
ts.setTextRange(block, blockLocation);
- if (body.kind !== 239) {
+ if (body.kind !== 240) {
ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536);
}
return block;
}
function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) {
- if (moduleDeclaration.body.kind === 238) {
+ if (moduleDeclaration.body.kind === 239) {
var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body);
return recursiveInnerModule || moduleDeclaration.body;
}
@@ -51547,7 +51871,7 @@ var ts;
return (name || namedBindings) ? ts.updateImportClause(node, name, namedBindings) : undefined;
}
function visitNamedImportBindings(node) {
- if (node.kind === 245) {
+ if (node.kind === 246) {
return resolver.isReferencedAliasDeclaration(node) ? node : undefined;
}
else {
@@ -51682,15 +52006,15 @@ var ts;
if ((enabledSubstitutions & 2) === 0) {
enabledSubstitutions |= 2;
context.enableSubstitution(71);
- context.enableSubstitution(270);
- context.enableEmitNotification(238);
+ context.enableSubstitution(271);
+ context.enableEmitNotification(239);
}
}
function isTransformedModuleDeclaration(node) {
- return ts.getOriginalNode(node).kind === 238;
+ return ts.getOriginalNode(node).kind === 239;
}
function isTransformedEnumDeclaration(node) {
- return ts.getOriginalNode(node).kind === 237;
+ return ts.getOriginalNode(node).kind === 238;
}
function onEmitNode(hint, node, emitCallback) {
var savedApplicableSubstitutions = applicableSubstitutions;
@@ -51736,9 +52060,9 @@ var ts;
switch (node.kind) {
case 71:
return substituteExpressionIdentifier(node);
- case 184:
- return substitutePropertyAccessExpression(node);
case 185:
+ return substitutePropertyAccessExpression(node);
+ case 186:
return substituteElementAccessExpression(node);
}
return node;
@@ -51768,9 +52092,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 !== 273) {
- var substitute = (applicableSubstitutions & 2 && container.kind === 238) ||
- (applicableSubstitutions & 8 && container.kind === 237);
+ if (container && container.kind !== 274) {
+ var substitute = (applicableSubstitutions & 2 && container.kind === 239) ||
+ (applicableSubstitutions & 8 && container.kind === 238);
if (substitute) {
return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), node);
}
@@ -51887,15 +52211,15 @@ var ts;
switch (node.kind) {
case 120:
return undefined;
- case 196:
+ case 197:
return visitAwaitExpression(node);
- case 153:
+ case 154:
return visitMethodDeclaration(node);
- case 233:
+ case 234:
return visitFunctionDeclaration(node);
- case 191:
- return visitFunctionExpression(node);
case 192:
+ return visitFunctionExpression(node);
+ case 193:
return visitArrowFunction(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -51904,27 +52228,27 @@ var ts;
function asyncBodyVisitor(node) {
if (ts.isNodeWithPossibleHoistedDeclaration(node)) {
switch (node.kind) {
- case 213:
+ case 214:
return visitVariableStatementInAsyncBody(node);
- case 219:
- return visitForStatementInAsyncBody(node);
case 220:
- return visitForInStatementInAsyncBody(node);
+ return visitForStatementInAsyncBody(node);
case 221:
+ return visitForInStatementInAsyncBody(node);
+ case 222:
return visitForOfStatementInAsyncBody(node);
- case 268:
+ case 269:
return visitCatchClauseInAsyncBody(node);
- case 212:
- case 226:
- case 240:
- case 265:
- case 266:
- case 229:
- case 217:
- case 218:
- case 216:
- case 225:
+ case 213:
case 227:
+ case 241:
+ case 266:
+ case 267:
+ case 230:
+ case 218:
+ case 219:
+ case 217:
+ case 226:
+ case 228:
return ts.visitEachChild(node, asyncBodyVisitor, context);
default:
return ts.Debug.assertNever(node, "Unhandled node.");
@@ -51973,8 +52297,9 @@ var ts;
: ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, ts.liftToBlock));
}
function visitForStatementInAsyncBody(node) {
- return ts.updateFor(node, isVariableDeclarationListWithCollidingName(node.initializer)
- ? visitVariableDeclarationListWithCollidingNames(node.initializer, false)
+ var initializer = node.initializer;
+ return ts.updateFor(node, isVariableDeclarationListWithCollidingName(initializer)
+ ? visitVariableDeclarationListWithCollidingNames(initializer, false)
: ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, ts.liftToBlock));
}
function visitAwaitExpression(node) {
@@ -52015,10 +52340,10 @@ var ts;
}
}
function isVariableDeclarationListWithCollidingName(node) {
- return node
+ return !!node
&& ts.isVariableDeclarationList(node)
&& !(node.flags & 3)
- && ts.forEach(node.declarations, collidesWithParameterName);
+ && node.declarations.some(collidesWithParameterName);
}
function visitVariableDeclarationListWithCollidingNames(node, hasReceiver) {
hoistVariableDeclarationList(node);
@@ -52072,7 +52397,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 === 192;
+ var isArrowFunction = node.kind === 193;
var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0;
var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames;
enclosingFunctionParameterNames = ts.createUnderscoreEscapedMap();
@@ -52085,7 +52410,7 @@ var ts;
var statements = [];
var statementOffset = ts.addPrologue(statements, node.body.statements, false, visitor);
statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformAsyncFunctionBodyWorker(node.body, statementOffset))));
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
var block = ts.createBlock(statements, true);
ts.setTextRange(block, node.body);
if (languageVersion >= 2) {
@@ -52136,14 +52461,14 @@ var ts;
function enableSubstitutionForAsyncMethodsWithSuper() {
if ((enabledSubstitutions & 1) === 0) {
enabledSubstitutions |= 1;
- context.enableSubstitution(186);
- context.enableSubstitution(184);
+ context.enableSubstitution(187);
context.enableSubstitution(185);
- context.enableEmitNotification(234);
- context.enableEmitNotification(153);
- context.enableEmitNotification(155);
- context.enableEmitNotification(156);
+ context.enableSubstitution(186);
+ context.enableEmitNotification(235);
context.enableEmitNotification(154);
+ context.enableEmitNotification(156);
+ context.enableEmitNotification(157);
+ context.enableEmitNotification(155);
}
}
function onEmitNode(hint, node, emitCallback) {
@@ -52168,11 +52493,11 @@ var ts;
}
function substituteExpression(node) {
switch (node.kind) {
- case 184:
- return substitutePropertyAccessExpression(node);
case 185:
- return substituteElementAccessExpression(node);
+ return substitutePropertyAccessExpression(node);
case 186:
+ return substituteElementAccessExpression(node);
+ case 187:
return substituteCallExpression(node);
}
return node;
@@ -52203,11 +52528,11 @@ var ts;
}
function isSuperContainer(node) {
var kind = node.kind;
- return kind === 234
- || kind === 154
- || kind === 153
+ return kind === 235
|| kind === 155
- || kind === 156;
+ || kind === 154
+ || kind === 156
+ || kind === 157;
}
function createSuperAccessInAsyncMethod(argumentExpression, location) {
if (enclosingSuperContainerFlags & 4096) {
@@ -52291,45 +52616,47 @@ var ts;
return node;
}
switch (node.kind) {
- case 196:
+ case 197:
return visitAwaitExpression(node);
- case 202:
+ case 203:
return visitYieldExpression(node);
- case 227:
+ case 225:
+ return visitReturnStatement(node);
+ case 228:
return visitLabeledStatement(node);
- case 183:
+ case 184:
return visitObjectLiteralExpression(node);
- case 199:
+ case 200:
return visitBinaryExpression(node, noDestructuringValue);
- case 231:
+ case 232:
return visitVariableDeclaration(node);
- case 221:
+ case 222:
return visitForOfStatement(node, undefined);
- case 219:
+ case 220:
return visitForStatement(node);
- case 195:
+ case 196:
return visitVoidExpression(node);
- case 154:
- return visitConstructorDeclaration(node);
- case 153:
- return visitMethodDeclaration(node);
case 155:
- return visitGetAccessorDeclaration(node);
+ return visitConstructorDeclaration(node);
+ case 154:
+ return visitMethodDeclaration(node);
case 156:
+ return visitGetAccessorDeclaration(node);
+ case 157:
return visitSetAccessorDeclaration(node);
- case 233:
+ case 234:
return visitFunctionDeclaration(node);
- case 191:
- return visitFunctionExpression(node);
case 192:
+ return visitFunctionExpression(node);
+ case 193:
return visitArrowFunction(node);
- case 148:
+ case 149:
return visitParameter(node);
- case 215:
+ case 216:
return visitExpressionStatement(node);
- case 190:
+ case 191:
return visitParenthesizedExpression(node, noDestructuringValue);
- case 268:
+ case 269:
return visitCatchClause(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -52353,10 +52680,16 @@ var ts;
}
return ts.visitEachChild(node, visitor, context);
}
+ function visitReturnStatement(node) {
+ if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) {
+ return ts.updateReturn(node, createDownlevelAwait(node.expression ? ts.visitNode(node.expression, visitor, ts.isExpression) : ts.createVoidZero()));
+ }
+ return ts.visitEachChild(node, visitor, context);
+ }
function visitLabeledStatement(node) {
if (enclosingFunctionFlags & 2) {
var statement = ts.unwrapInnermostStatementOfLabel(node);
- if (statement.kind === 221 && statement.awaitModifier) {
+ if (statement.kind === 222 && statement.awaitModifier) {
return visitForOfStatement(statement, node);
}
return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node);
@@ -52368,7 +52701,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 === 271) {
+ if (e.kind === 272) {
if (chunkObject) {
objects.push(ts.createObjectLiteral(chunkObject));
chunkObject = undefined;
@@ -52377,7 +52710,7 @@ var ts;
objects.push(ts.visitNode(target, visitor, ts.isExpression));
}
else {
- chunkObject = ts.append(chunkObject, e.kind === 269
+ chunkObject = ts.append(chunkObject, e.kind === 270
? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression))
: ts.visitNode(e, visitor, ts.isObjectLiteralElementLike));
}
@@ -52390,7 +52723,7 @@ var ts;
function visitObjectLiteralExpression(node) {
if (node.transformFlags & 1048576) {
var objects = chunkObjectLiteralElements(node.properties);
- if (objects.length && objects[0].kind !== 183) {
+ if (objects.length && objects[0].kind !== 184) {
objects.unshift(ts.createObjectLiteral());
}
return createAssignHelper(context, objects);
@@ -52502,7 +52835,7 @@ var ts;
var forStatement = ts.setEmitFlags(ts.setTextRange(ts.createFor(ts.setEmitFlags(ts.setTextRange(ts.createVariableDeclarationList([
ts.setTextRange(ts.createVariableDeclaration(iterator, undefined, callValues), node.expression),
ts.createVariableDeclaration(result)
- ]), node.expression), 2097152), ts.createComma(ts.createAssignment(result, createDownlevelAwait(callNext)), ts.createLogicalNot(getDone)), undefined, convertForOfStatementHead(node, createDownlevelAwait(getValue))), node), 256);
+ ]), node.expression), 2097152), ts.createComma(ts.createAssignment(result, createDownlevelAwait(callNext)), ts.createLogicalNot(getDone)), undefined, convertForOfStatementHead(node, getValue)), node), 256);
return ts.createTry(ts.createBlock([
ts.restoreEnclosingLabel(forStatement, outermostLabeledStatement)
]), ts.createCatchClause(ts.createVariableDeclaration(catchVariable), ts.setEmitFlags(ts.createBlock([
@@ -52596,7 +52929,7 @@ var ts;
var statementOffset = ts.addPrologue(statements, node.body.statements, false, visitor);
appendObjectRestAssignmentsIfNeeded(statements, node);
statements.push(ts.createReturn(createAsyncGeneratorHelper(context, ts.createFunctionExpression(undefined, ts.createToken(39), node.name && ts.getGeneratedNameForNode(node.name), undefined, [], undefined, ts.updateBlock(node.body, ts.visitLexicalEnvironment(node.body.statements, visitor, context, statementOffset))))));
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
var block = ts.updateBlock(node.body, statements);
if (languageVersion >= 2) {
if (resolver.getNodeCheckFlags(node) & 4096) {
@@ -52622,7 +52955,7 @@ var ts;
var leadingStatements = endLexicalEnvironment();
if (statementOffset > 0 || ts.some(statements) || ts.some(leadingStatements)) {
var block = ts.convertToFunctionBody(body, true);
- ts.prependRange(statements, leadingStatements);
+ ts.prependStatements(statements, leadingStatements);
ts.addRange(statements, block.statements.slice(statementOffset));
return ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(statements), block.statements));
}
@@ -52646,14 +52979,14 @@ var ts;
function enableSubstitutionForAsyncMethodsWithSuper() {
if ((enabledSubstitutions & 1) === 0) {
enabledSubstitutions |= 1;
- context.enableSubstitution(186);
- context.enableSubstitution(184);
+ context.enableSubstitution(187);
context.enableSubstitution(185);
- context.enableEmitNotification(234);
- context.enableEmitNotification(153);
- context.enableEmitNotification(155);
- context.enableEmitNotification(156);
+ context.enableSubstitution(186);
+ context.enableEmitNotification(235);
context.enableEmitNotification(154);
+ context.enableEmitNotification(156);
+ context.enableEmitNotification(157);
+ context.enableEmitNotification(155);
}
}
function onEmitNode(hint, node, emitCallback) {
@@ -52678,11 +53011,11 @@ var ts;
}
function substituteExpression(node) {
switch (node.kind) {
- case 184:
- return substitutePropertyAccessExpression(node);
case 185:
- return substituteElementAccessExpression(node);
+ return substitutePropertyAccessExpression(node);
case 186:
+ return substituteElementAccessExpression(node);
+ case 187:
return substituteCallExpression(node);
}
return node;
@@ -52713,11 +53046,11 @@ var ts;
}
function isSuperContainer(node) {
var kind = node.kind;
- return kind === 234
- || kind === 154
- || kind === 153
+ return kind === 235
|| kind === 155
- || kind === 156;
+ || kind === 154
+ || kind === 156
+ || kind === 157;
}
function createSuperAccessInAsyncMethod(argumentExpression, location) {
if (enclosingSuperContainerFlags & 4096) {
@@ -52812,13 +53145,13 @@ var ts;
}
function visitorWorker(node) {
switch (node.kind) {
- case 254:
- return visitJsxElement(node, false);
case 255:
+ return visitJsxElement(node, false);
+ case 256:
return visitJsxSelfClosingElement(node, false);
- case 258:
+ case 259:
return visitJsxFragment(node, false);
- case 264:
+ case 265:
return visitJsxExpression(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -52828,13 +53161,13 @@ var ts;
switch (node.kind) {
case 10:
return visitJsxText(node);
- case 264:
+ case 265:
return visitJsxExpression(node);
- case 254:
- return visitJsxElement(node, true);
case 255:
+ return visitJsxElement(node, true);
+ case 256:
return visitJsxSelfClosingElement(node, true);
- case 258:
+ case 259:
return visitJsxFragment(node, true);
default:
return ts.Debug.failBadSyntaxKind(node);
@@ -52898,7 +53231,7 @@ var ts;
literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile);
return ts.setTextRange(literal, node);
}
- else if (node.kind === 264) {
+ else if (node.kind === 265) {
if (node.expression === undefined) {
return ts.createTrue();
}
@@ -52958,7 +53291,7 @@ var ts;
return decoded === text ? undefined : decoded;
}
function getTagName(node) {
- if (node.kind === 254) {
+ if (node.kind === 255) {
return getTagName(node.openingElement);
}
else {
@@ -53258,7 +53591,7 @@ var ts;
return node;
}
switch (node.kind) {
- case 199:
+ case 200:
return visitBinaryExpression(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -53416,14 +53749,14 @@ var ts;
hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -16384 | ancestorFacts;
}
function isReturnVoidStatementInConstructorWithCapturedSuper(node) {
- return hierarchyFacts & 4096
- && node.kind === 224
+ return (hierarchyFacts & 4096) !== 0
+ && node.kind === 225
&& !node.expression;
}
function shouldVisitNode(node) {
return (node.transformFlags & 128) !== 0
|| convertedLoopState !== undefined
- || (hierarchyFacts & 4096 && (ts.isStatement(node) || (node.kind === 212)))
+ || (hierarchyFacts & 4096 && (ts.isStatement(node) || (node.kind === 213)))
|| (ts.isIterationStatement(node, false) && shouldConvertIterationStatementBody(node))
|| (ts.getEmitFlags(node) & 33554432) !== 0;
}
@@ -53451,63 +53784,63 @@ var ts;
switch (node.kind) {
case 115:
return undefined;
- case 234:
+ case 235:
return visitClassDeclaration(node);
- case 204:
+ case 205:
return visitClassExpression(node);
- case 148:
+ case 149:
return visitParameter(node);
- case 233:
+ case 234:
return visitFunctionDeclaration(node);
- case 192:
+ case 193:
return visitArrowFunction(node);
- case 191:
+ case 192:
return visitFunctionExpression(node);
- case 231:
+ case 232:
return visitVariableDeclaration(node);
case 71:
return visitIdentifier(node);
- case 232:
+ case 233:
return visitVariableDeclarationList(node);
- case 226:
- return visitSwitchStatement(node);
- case 240:
- return visitCaseBlock(node);
- case 212:
- return visitBlock(node, false);
- case 223:
- case 222:
- return visitBreakOrContinueStatement(node);
case 227:
+ return visitSwitchStatement(node);
+ case 241:
+ return visitCaseBlock(node);
+ case 213:
+ return visitBlock(node, false);
+ case 224:
+ case 223:
+ return visitBreakOrContinueStatement(node);
+ case 228:
return visitLabeledStatement(node);
- case 217:
case 218:
- return visitDoOrWhileStatement(node, undefined);
case 219:
- return visitForStatement(node, undefined);
+ return visitDoOrWhileStatement(node, undefined);
case 220:
- return visitForInStatement(node, undefined);
+ return visitForStatement(node, undefined);
case 221:
+ return visitForInStatement(node, undefined);
+ case 222:
return visitForOfStatement(node, undefined);
- case 215:
+ case 216:
return visitExpressionStatement(node);
- case 183:
+ case 184:
return visitObjectLiteralExpression(node);
- case 268:
+ case 269:
return visitCatchClause(node);
- case 270:
+ case 271:
return visitShorthandPropertyAssignment(node);
- case 146:
+ case 147:
return visitComputedPropertyName(node);
- case 182:
+ case 183:
return visitArrayLiteralExpression(node);
- case 186:
- return visitCallExpression(node);
case 187:
+ return visitCallExpression(node);
+ case 188:
return visitNewExpression(node);
- case 190:
+ case 191:
return visitParenthesizedExpression(node, true);
- case 199:
+ case 200:
return visitBinaryExpression(node, true);
case 13:
case 14:
@@ -53518,28 +53851,28 @@ var ts;
return visitStringLiteral(node);
case 8:
return visitNumericLiteral(node);
- case 188:
+ case 189:
return visitTaggedTemplateExpression(node);
- case 201:
- return visitTemplateExpression(node);
case 202:
- return visitYieldExpression(node);
+ return visitTemplateExpression(node);
case 203:
+ return visitYieldExpression(node);
+ case 204:
return visitSpreadElement(node);
case 97:
return visitSuperKeyword(false);
case 99:
return visitThisKeyword(node);
- case 209:
+ case 210:
return visitMetaProperty(node);
- case 153:
+ case 154:
return visitMethodDeclaration(node);
- case 155:
case 156:
+ case 157:
return visitAccessorDeclaration(node);
- case 213:
+ case 214:
return visitVariableStatement(node);
- case 224:
+ case 225:
return visitReturnStatement(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -53556,7 +53889,7 @@ var ts;
if (taggedTemplateStringDeclarations) {
statements.push(ts.createVariableStatement(undefined, ts.createVariableDeclarationList(taggedTemplateStringDeclarations)));
}
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
exitSubtree(ancestorFacts, 0, 0);
return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements));
}
@@ -53620,13 +53953,14 @@ var ts;
}
function visitBreakOrContinueStatement(node) {
if (convertedLoopState) {
- var jump = node.kind === 223 ? 2 : 4;
+ var jump = node.kind === 224 ? 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;
- if (!node.label) {
- if (node.kind === 223) {
+ var label = node.label;
+ if (!label) {
+ if (node.kind === 224) {
convertedLoopState.nonLocalJumps |= 2;
labelMarker = "break";
}
@@ -53636,13 +53970,13 @@ var ts;
}
}
else {
- if (node.kind === 223) {
- labelMarker = "break-" + node.label.escapedText;
- setLabeledJump(convertedLoopState, true, ts.idText(node.label), labelMarker);
+ if (node.kind === 224) {
+ labelMarker = "break-" + label.escapedText;
+ setLabeledJump(convertedLoopState, true, ts.idText(label), labelMarker);
}
else {
- labelMarker = "continue-" + node.label.escapedText;
- setLabeledJump(convertedLoopState, false, ts.idText(node.label), labelMarker);
+ labelMarker = "continue-" + label.escapedText;
+ setLabeledJump(convertedLoopState, false, ts.idText(label), labelMarker);
}
}
var returnExpression = ts.createLiteral(labelMarker);
@@ -53725,7 +54059,7 @@ var ts;
statement.pos = closingBraceLocation.pos;
ts.setEmitFlags(statement, 1536 | 384);
statements.push(statement);
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), node.members), true);
ts.setEmitFlags(block, 1536);
return block;
@@ -53751,7 +54085,7 @@ var ts;
convertedLoopState = savedConvertedLoopState;
}
function transformConstructorParameters(constructor, hasSynthesizedSuper) {
- return ts.visitParameterList(constructor && !hasSynthesizedSuper && constructor.parameters, visitor, context)
+ return ts.visitParameterList(constructor && !hasSynthesizedSuper ? constructor.parameters : undefined, visitor, context)
|| [];
}
function transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper) {
@@ -53772,7 +54106,7 @@ var ts;
}
ts.Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!");
}
- var isDerivedClass = extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 95;
+ var isDerivedClass = !!extendsClauseElement && ts.skipOuterExpressions(extendsClauseElement.expression).kind !== 95;
var superCaptureStatus = declareOrCaptureOrReturnThisForConstructorIfNeeded(statements, constructor, isDerivedClass, hasSynthesizedSuper, statementOffset);
if (superCaptureStatus === 1 || superCaptureStatus === 2) {
statementOffset++;
@@ -53788,7 +54122,7 @@ var ts;
&& !(constructor && isSufficientlyCoveredByReturnStatements(constructor.body))) {
statements.push(ts.createReturn(ts.createFileLevelUniqueName("_this")));
}
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
if (constructor) {
prependCaptureNewTargetIfNeeded(statements, constructor, false);
}
@@ -53800,17 +54134,17 @@ var ts;
return block;
}
function isSufficientlyCoveredByReturnStatements(statement) {
- if (statement.kind === 224) {
+ if (statement.kind === 225) {
return true;
}
- else if (statement.kind === 216) {
+ else if (statement.kind === 217) {
var ifStatement = statement;
if (ifStatement.elseStatement) {
return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) &&
isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement);
}
}
- else if (statement.kind === 212) {
+ else if (statement.kind === 213) {
var lastStatement = ts.lastOrUndefined(statement.statements);
if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) {
return true;
@@ -53839,7 +54173,7 @@ var ts;
var ctorStatements = ctor.body.statements;
if (statementOffset < ctorStatements.length) {
firstStatement = ctorStatements[statementOffset];
- if (firstStatement.kind === 215 && ts.isSuperCall(firstStatement.expression)) {
+ if (firstStatement.kind === 216 && ts.isSuperCall(firstStatement.expression)) {
superCallExpression = visitImmediateSuperCallInBody(firstStatement.expression);
}
}
@@ -53847,8 +54181,8 @@ var ts;
&& statementOffset === ctorStatements.length - 1
&& !(ctor.transformFlags & (16384 | 32768))) {
var returnStatement = ts.createReturn(superCallExpression);
- if (superCallExpression.kind !== 199
- || superCallExpression.left.kind !== 186) {
+ if (superCallExpression.kind !== 200
+ || superCallExpression.left.kind !== 187) {
ts.Debug.fail("Assumed generated super call would have form 'super.call(...) || this'.");
}
ts.setCommentRange(returnStatement, ts.getCommentRange(ts.setEmitFlags(superCallExpression.left, 1536)));
@@ -53949,7 +54283,7 @@ var ts;
statements.push(forStatement);
}
function addCaptureThisForNodeIfNeeded(statements, node) {
- if (node.transformFlags & 32768 && node.kind !== 192) {
+ if (node.transformFlags & 32768 && node.kind !== 193) {
captureThisForNode(statements, node, ts.createThis());
}
}
@@ -53967,18 +54301,18 @@ var ts;
if (hierarchyFacts & 16384) {
var newTarget = void 0;
switch (node.kind) {
- case 192:
+ case 193:
return statements;
- case 153:
- case 155:
+ case 154:
case 156:
+ case 157:
newTarget = ts.createVoidZero();
break;
- case 154:
+ case 155:
newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor");
break;
- case 233:
- case 191:
+ case 234:
+ case 192:
newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4), 93, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor"), ts.createVoidZero());
break;
default:
@@ -53998,20 +54332,20 @@ var ts;
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
var member = _a[_i];
switch (member.kind) {
- case 211:
+ case 212:
statements.push(transformSemicolonClassElementToStatement(member));
break;
- case 153:
+ case 154:
statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node));
break;
- case 155:
case 156:
+ case 157:
var accessors = ts.getAllAccessorDeclarations(node.members, member);
if (member === accessors.firstAccessor) {
statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node));
}
break;
- case 154:
+ case 155:
break;
default:
ts.Debug.failBadSyntaxKind(node);
@@ -54136,7 +54470,7 @@ var ts;
: enterSubtree(16286, 65);
var parameters = ts.visitParameterList(node.parameters, visitor, context);
var body = transformFunctionBody(node);
- if (hierarchyFacts & 16384 && !name && (node.kind === 233 || node.kind === 191)) {
+ if (hierarchyFacts & 16384 && !name && (node.kind === 234 || node.kind === 192)) {
name = ts.getGeneratedNameForNode(node);
}
exitSubtree(ancestorFacts, 49152, 0);
@@ -54170,7 +54504,7 @@ var ts;
}
}
else {
- ts.Debug.assert(node.kind === 192);
+ ts.Debug.assert(node.kind === 193);
statementsLocation = ts.moveRangeEnd(body, -1);
var equalsGreaterThanToken = node.equalsGreaterThanToken;
if (!ts.nodeIsSynthesized(equalsGreaterThanToken) && !ts.nodeIsSynthesized(body)) {
@@ -54190,7 +54524,7 @@ var ts;
closeBraceLocation = body;
}
var lexicalEnvironment = context.endLexicalEnvironment();
- ts.prependRange(statements, lexicalEnvironment);
+ ts.prependStatements(statements, lexicalEnvironment);
prependCaptureNewTargetIfNeeded(statements, node, false);
if (!multiLine && lexicalEnvironment && lexicalEnvironment.length) {
multiLine = true;
@@ -54223,9 +54557,9 @@ var ts;
}
function visitExpressionStatement(node) {
switch (node.expression.kind) {
- case 190:
+ case 191:
return ts.updateStatement(node, visitParenthesizedExpression(node.expression, false));
- case 199:
+ case 200:
return ts.updateStatement(node, visitBinaryExpression(node.expression, false));
}
return ts.visitEachChild(node, visitor, context);
@@ -54233,9 +54567,9 @@ var ts;
function visitParenthesizedExpression(node, needsDestructuringValue) {
if (!needsDestructuringValue) {
switch (node.expression.kind) {
- case 190:
+ case 191:
return ts.updateParen(node, visitParenthesizedExpression(node.expression, false));
- case 199:
+ case 200:
return ts.updateParen(node, visitBinaryExpression(node.expression, false));
}
}
@@ -54293,11 +54627,10 @@ var ts;
ts.setTextRange(declarationList, node);
ts.setCommentRange(declarationList, node);
if (node.transformFlags & 8388608
- && (ts.isBindingPattern(node.declarations[0].name) || ts.isBindingPattern(ts.lastOrUndefined(node.declarations).name))) {
+ && (ts.isBindingPattern(node.declarations[0].name) || ts.isBindingPattern(ts.last(node.declarations).name))) {
var firstDeclaration = ts.firstOrUndefined(declarations);
if (firstDeclaration) {
- var lastDeclaration = ts.lastOrUndefined(declarations);
- ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end));
+ ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, ts.last(declarations).end));
}
}
return declarationList;
@@ -54361,14 +54694,14 @@ var ts;
}
function visitIterationStatement(node, outermostLabeledStatement) {
switch (node.kind) {
- case 217:
case 218:
- return visitDoOrWhileStatement(node, outermostLabeledStatement);
case 219:
- return visitForStatement(node, outermostLabeledStatement);
+ return visitDoOrWhileStatement(node, outermostLabeledStatement);
case 220:
- return visitForInStatement(node, outermostLabeledStatement);
+ return visitForStatement(node, outermostLabeledStatement);
case 221:
+ return visitForInStatement(node, outermostLabeledStatement);
+ case 222:
return visitForOfStatement(node, outermostLabeledStatement);
}
}
@@ -54392,35 +54725,34 @@ var ts;
}
function convertForOfStatementHead(node, boundValue, convertedLoopBodyStatements) {
var statements = [];
- if (ts.isVariableDeclarationList(node.initializer)) {
+ var initializer = node.initializer;
+ if (ts.isVariableDeclarationList(initializer)) {
if (node.initializer.flags & 3) {
enableSubstitutionsForBlockScopedBindings();
}
- var firstOriginalDeclaration = ts.firstOrUndefined(node.initializer.declarations);
+ var firstOriginalDeclaration = ts.firstOrUndefined(initializer.declarations);
if (firstOriginalDeclaration && ts.isBindingPattern(firstOriginalDeclaration.name)) {
var declarations = ts.flattenDestructuringBinding(firstOriginalDeclaration, visitor, context, 0, boundValue);
var declarationList = ts.setTextRange(ts.createVariableDeclarationList(declarations), node.initializer);
ts.setOriginalNode(declarationList, node.initializer);
- var firstDeclaration = declarations[0];
- var lastDeclaration = ts.lastOrUndefined(declarations);
- ts.setSourceMapRange(declarationList, ts.createRange(firstDeclaration.pos, lastDeclaration.end));
+ ts.setSourceMapRange(declarationList, ts.createRange(declarations[0].pos, ts.last(declarations).end));
statements.push(ts.createVariableStatement(undefined, declarationList));
}
else {
statements.push(ts.setTextRange(ts.createVariableStatement(undefined, ts.setOriginalNode(ts.setTextRange(ts.createVariableDeclarationList([
ts.createVariableDeclaration(firstOriginalDeclaration ? firstOriginalDeclaration.name : ts.createTempVariable(undefined), undefined, boundValue)
- ]), ts.moveRangePos(node.initializer, -1)), node.initializer)), ts.moveRangeEnd(node.initializer, -1)));
+ ]), ts.moveRangePos(initializer, -1)), initializer)), ts.moveRangeEnd(initializer, -1)));
}
}
else {
- var assignment = ts.createAssignment(node.initializer, boundValue);
+ var assignment = ts.createAssignment(initializer, boundValue);
if (ts.isDestructuringAssignment(assignment)) {
ts.aggregateTransformFlags(assignment);
statements.push(ts.createStatement(visitBinaryExpression(assignment, false)));
}
else {
- assignment.end = node.initializer.end;
- statements.push(ts.setTextRange(ts.createStatement(ts.visitNode(assignment, visitor, ts.isExpression)), ts.moveRangeEnd(node.initializer, -1)));
+ assignment.end = initializer.end;
+ statements.push(ts.setTextRange(ts.createStatement(ts.visitNode(assignment, visitor, ts.isExpression)), ts.moveRangeEnd(initializer, -1)));
}
}
if (convertedLoopBodyStatements) {
@@ -54493,7 +54825,7 @@ var ts;
&& i < numInitialPropertiesWithoutYield) {
numInitialPropertiesWithoutYield = i;
}
- if (property.name.kind === 146) {
+ if (property.name.kind === 147) {
numInitialProperties = i;
break;
}
@@ -54555,11 +54887,11 @@ var ts;
var functionName = ts.createUniqueName("_loop");
var loopInitializer;
switch (node.kind) {
- case 219:
case 220:
case 221:
+ case 222:
var initializer = node.initializer;
- if (initializer && initializer.kind === 232) {
+ if (initializer && initializer.kind === 233) {
loopInitializer = initializer;
}
break;
@@ -54595,7 +54927,7 @@ var ts;
if (loopOutParameters.length) {
copyOutParameters(loopOutParameters, 1, statements_4);
}
- ts.prependRange(statements_4, lexicalEnvironment);
+ ts.prependStatements(statements_4, lexicalEnvironment);
loopBody = ts.createBlock(statements_4, true);
}
if (ts.isBlock(loopBody)) {
@@ -54785,20 +55117,20 @@ var ts;
for (var i = start; i < numProperties; i++) {
var property = properties[i];
switch (property.kind) {
- case 155:
case 156:
+ case 157:
var accessors = ts.getAllAccessorDeclarations(node.properties, property);
if (property === accessors.firstAccessor) {
- expressions.push(transformAccessorsToExpression(receiver, accessors, node, node.multiLine));
+ expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine));
}
break;
- case 153:
+ case 154:
expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine));
break;
- case 269:
+ case 270:
expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine));
break;
- case 270:
+ case 271:
expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine));
break;
default:
@@ -54873,7 +55205,7 @@ var ts;
var body = node.transformFlags & (32768 | 128)
? transformFunctionBody(node)
: visitFunctionBodyDownLevel(node);
- if (node.kind === 155) {
+ if (node.kind === 156) {
updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body);
}
else {
@@ -54897,7 +55229,7 @@ var ts;
}
function visitArrayLiteralExpression(node) {
if (node.transformFlags & 64) {
- return transformAndSpreadElements(node.elements, true, node.multiLine, node.elements.hasTrailingComma);
+ return transformAndSpreadElements(node.elements, true, !!node.multiLine, !!node.elements.hasTrailingComma);
}
return ts.visitEachChild(node, visitor, context);
}
@@ -54912,11 +55244,11 @@ var ts;
}
function visitTypeScriptClassWrapper(node) {
var body = ts.cast(ts.cast(ts.skipOuterExpressions(node.expression), ts.isArrowFunction).body, ts.isBlock);
- var isVariableStatementWithInitializer = function (stmt) { return ts.isVariableStatement(stmt) && !!ts.firstOrUndefined(stmt.declarationList.declarations).initializer; };
+ var isVariableStatementWithInitializer = function (stmt) { return ts.isVariableStatement(stmt) && !!ts.first(stmt.declarationList.declarations).initializer; };
var bodyStatements = ts.visitNodes(body.statements, visitor, ts.isStatement);
var classStatements = ts.filter(bodyStatements, isVariableStatementWithInitializer);
var remainingStatements = ts.filter(bodyStatements, function (stmt) { return !isVariableStatementWithInitializer(stmt); });
- var varStatement = ts.cast(ts.firstOrUndefined(classStatements), ts.isVariableStatement);
+ var varStatement = ts.cast(ts.first(classStatements), ts.isVariableStatement);
var variable = varStatement.declarationList.declarations[0];
var initializer = ts.skipOuterExpressions(variable.initializer);
var aliasAssignment = ts.tryCast(initializer, ts.isAssignmentExpression);
@@ -55004,7 +55336,7 @@ var ts;
else {
if (segments.length === 1) {
var firstElement = elements[0];
- return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 182
+ return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 183
? ts.createArraySlice(segments[0])
: segments[0];
}
@@ -55150,13 +55482,13 @@ var ts;
if ((enabledSubstitutions & 1) === 0) {
enabledSubstitutions |= 1;
context.enableSubstitution(99);
- context.enableEmitNotification(154);
- context.enableEmitNotification(153);
context.enableEmitNotification(155);
+ context.enableEmitNotification(154);
context.enableEmitNotification(156);
+ context.enableEmitNotification(157);
+ context.enableEmitNotification(193);
context.enableEmitNotification(192);
- context.enableEmitNotification(191);
- context.enableEmitNotification(233);
+ context.enableEmitNotification(234);
}
}
function onSubstituteNode(hint, node) {
@@ -55179,14 +55511,13 @@ var ts;
return node;
}
function isNameOfDeclarationWithCollidingName(node) {
- var parent = node.parent;
- switch (parent.kind) {
- case 181:
- case 234:
- case 237:
- case 231:
- return parent.name === node
- && resolver.isDeclarationWithCollidingName(parent);
+ switch (node.parent.kind) {
+ case 182:
+ case 235:
+ case 238:
+ case 232:
+ return node.parent.name === node
+ && resolver.isDeclarationWithCollidingName(node.parent);
}
return false;
}
@@ -55245,11 +55576,11 @@ var ts;
return false;
}
var statement = ts.firstOrUndefined(constructor.body.statements);
- if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 215) {
+ if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 216) {
return false;
}
var statementExpression = statement.expression;
- if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 186) {
+ if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 187) {
return false;
}
var callTarget = statementExpression.expression;
@@ -55257,7 +55588,7 @@ var ts;
return false;
}
var callArgument = ts.singleOrUndefined(statementExpression.arguments);
- if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 203) {
+ if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 204) {
return false;
}
var expression = callArgument.expression;
@@ -55301,24 +55632,24 @@ var ts;
if (compilerOptions.jsx === 1 || compilerOptions.jsx === 3) {
previousOnEmitNode = context.onEmitNode;
context.onEmitNode = onEmitNode;
- context.enableEmitNotification(256);
context.enableEmitNotification(257);
- context.enableEmitNotification(255);
+ context.enableEmitNotification(258);
+ context.enableEmitNotification(256);
noSubstitution = [];
}
var previousOnSubstituteNode = context.onSubstituteNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableSubstitution(184);
- context.enableSubstitution(269);
+ context.enableSubstitution(185);
+ context.enableSubstitution(270);
return ts.chainBundle(transformSourceFile);
function transformSourceFile(node) {
return node;
}
function onEmitNode(hint, node, emitCallback) {
switch (node.kind) {
- case 256:
case 257:
- case 255:
+ case 258:
+ case 256:
var tagName = node.tagName;
noSubstitution[ts.getOriginalNodeId(tagName)] = true;
break;
@@ -55354,7 +55685,7 @@ var ts;
}
function trySubstituteReservedName(name) {
var token = name.originalKeywordKind || (ts.nodeIsSynthesized(name) ? ts.stringToToken(ts.idText(name)) : undefined);
- if (token >= 72 && token <= 107) {
+ if (token !== undefined && token >= 72 && token <= 107) {
return ts.setTextRange(ts.createLiteral(name), name);
}
return undefined;
@@ -55416,6 +55747,7 @@ var ts;
case 4: return "yield";
case 5: return "yield*";
case 7: return "endfinally";
+ default: return undefined;
}
}
function transformGenerators(context) {
@@ -55479,13 +55811,13 @@ var ts;
}
function visitJavaScriptInStatementContainingYield(node) {
switch (node.kind) {
- case 217:
- return visitDoStatement(node);
case 218:
+ return visitDoStatement(node);
+ case 219:
return visitWhileStatement(node);
- case 226:
- return visitSwitchStatement(node);
case 227:
+ return visitSwitchStatement(node);
+ case 228:
return visitLabeledStatement(node);
default:
return visitJavaScriptInGeneratorFunctionBody(node);
@@ -55493,24 +55825,24 @@ var ts;
}
function visitJavaScriptInGeneratorFunctionBody(node) {
switch (node.kind) {
- case 233:
+ case 234:
return visitFunctionDeclaration(node);
- case 191:
+ case 192:
return visitFunctionExpression(node);
- case 155:
case 156:
+ case 157:
return visitAccessorDeclaration(node);
- case 213:
+ case 214:
return visitVariableStatement(node);
- case 219:
- return visitForStatement(node);
case 220:
+ return visitForStatement(node);
+ case 221:
return visitForInStatement(node);
- case 223:
- return visitBreakStatement(node);
- case 222:
- return visitContinueStatement(node);
case 224:
+ return visitBreakStatement(node);
+ case 223:
+ return visitContinueStatement(node);
+ case 225:
return visitReturnStatement(node);
default:
if (node.transformFlags & 16777216) {
@@ -55526,21 +55858,21 @@ var ts;
}
function visitJavaScriptContainingYield(node) {
switch (node.kind) {
- case 199:
- return visitBinaryExpression(node);
case 200:
+ return visitBinaryExpression(node);
+ case 201:
return visitConditionalExpression(node);
- case 202:
+ case 203:
return visitYieldExpression(node);
- case 182:
- return visitArrayLiteralExpression(node);
case 183:
+ return visitArrayLiteralExpression(node);
+ case 184:
return visitObjectLiteralExpression(node);
- case 185:
- return visitElementAccessExpression(node);
case 186:
- return visitCallExpression(node);
+ return visitElementAccessExpression(node);
case 187:
+ return visitCallExpression(node);
+ case 188:
return visitNewExpression(node);
default:
return ts.visitEachChild(node, visitor, context);
@@ -55548,9 +55880,9 @@ var ts;
}
function visitGenerator(node) {
switch (node.kind) {
- case 233:
+ case 234:
return visitFunctionDeclaration(node);
- case 191:
+ case 192:
return visitFunctionExpression(node);
default:
return ts.Debug.failBadSyntaxKind(node);
@@ -55634,7 +55966,7 @@ var ts;
var statementOffset = ts.addPrologue(statements, body.statements, false, visitor);
transformAndEmitStatements(body.statements, statementOffset);
var buildResult = build();
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
statements.push(ts.createReturn(buildResult));
inGeneratorFunctionBody = savedInGeneratorFunctionBody;
inStatementContainingYield = savedInStatementContainingYield;
@@ -55672,13 +56004,14 @@ var ts;
}
}
function visitBinaryExpression(node) {
- switch (ts.getExpressionAssociativity(node)) {
+ var assoc = ts.getExpressionAssociativity(node);
+ switch (assoc) {
case 0:
return visitLeftAssociativeBinaryExpression(node);
case 1:
return visitRightAssociativeBinaryExpression(node);
default:
- ts.Debug.fail("Unknown associativity.");
+ return ts.Debug.assertNever(assoc);
}
}
function isCompoundAssignment(kind) {
@@ -55706,10 +56039,10 @@ var ts;
if (containsYield(right)) {
var target = void 0;
switch (left.kind) {
- case 184:
+ case 185:
target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name);
break;
- case 185:
+ case 186:
target = ts.updateElementAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), cacheExpression(ts.visitNode(left.argumentExpression, visitor, ts.isExpression)));
break;
default:
@@ -55910,35 +56243,35 @@ var ts;
}
function transformAndEmitStatementWorker(node) {
switch (node.kind) {
- case 212:
+ case 213:
return transformAndEmitBlock(node);
- case 215:
- return transformAndEmitExpressionStatement(node);
case 216:
- return transformAndEmitIfStatement(node);
+ return transformAndEmitExpressionStatement(node);
case 217:
- return transformAndEmitDoStatement(node);
+ return transformAndEmitIfStatement(node);
case 218:
- return transformAndEmitWhileStatement(node);
+ return transformAndEmitDoStatement(node);
case 219:
- return transformAndEmitForStatement(node);
+ return transformAndEmitWhileStatement(node);
case 220:
+ return transformAndEmitForStatement(node);
+ case 221:
return transformAndEmitForInStatement(node);
- case 222:
- return transformAndEmitContinueStatement(node);
case 223:
- return transformAndEmitBreakStatement(node);
+ return transformAndEmitContinueStatement(node);
case 224:
- return transformAndEmitReturnStatement(node);
+ return transformAndEmitBreakStatement(node);
case 225:
- return transformAndEmitWithStatement(node);
+ return transformAndEmitReturnStatement(node);
case 226:
- return transformAndEmitSwitchStatement(node);
+ return transformAndEmitWithStatement(node);
case 227:
- return transformAndEmitLabeledStatement(node);
+ return transformAndEmitSwitchStatement(node);
case 228:
- return transformAndEmitThrowStatement(node);
+ return transformAndEmitLabeledStatement(node);
case 229:
+ return transformAndEmitThrowStatement(node);
+ case 230:
return transformAndEmitTryStatement(node);
default:
return emitStatement(ts.visitNode(node, visitor, ts.isStatement));
@@ -56232,7 +56565,7 @@ var ts;
for (var i = 0; i < numClauses; i++) {
var clause = caseBlock.clauses[i];
clauseLabels.push(defineLabel());
- if (clause.kind === 266 && defaultClauseIndex === -1) {
+ if (clause.kind === 267 && defaultClauseIndex === -1) {
defaultClauseIndex = i;
}
}
@@ -56242,7 +56575,7 @@ var ts;
var defaultClausesSkipped = 0;
for (var i = clausesWritten; i < numClauses; i++) {
var clause = caseBlock.clauses[i];
- if (clause.kind === 265) {
+ if (clause.kind === 266) {
if (containsYield(clause.expression) && pendingClauses.length > 0) {
break;
}
@@ -56332,7 +56665,7 @@ var ts;
}
}
function containsYield(node) {
- return node && (node.transformFlags & 16777216) !== 0;
+ return !!node && (node.transformFlags & 16777216) !== 0;
}
function countInitialNodesWithoutYield(nodes) {
var numNodes = nodes.length;
@@ -56419,7 +56752,8 @@ var ts;
}
function endBlock() {
var block = peekBlock();
- ts.Debug.assert(block !== undefined, "beginBlock was never called.");
+ if (block === undefined)
+ return ts.Debug.fail("beginBlock was never called.");
var index = blockActions.length;
blockActions[index] = 1;
blockOffsets[index] = operations ? operations.length : 0;
@@ -56662,7 +56996,7 @@ var ts;
return 0;
}
function createLabel(label) {
- if (label > 0) {
+ if (label !== undefined && label > 0) {
if (labelExpressions === undefined) {
labelExpressions = [];
}
@@ -57033,7 +57367,7 @@ var ts;
name: "typescript:generator",
scoped: false,
priority: 6,
- text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };"
+ text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n 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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };"
};
})(ts || (ts = {}));
var ts;
@@ -57057,11 +57391,11 @@ var ts;
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
context.enableSubstitution(71);
- context.enableSubstitution(199);
- context.enableSubstitution(197);
+ context.enableSubstitution(200);
context.enableSubstitution(198);
- context.enableSubstitution(270);
- context.enableEmitNotification(273);
+ context.enableSubstitution(199);
+ context.enableSubstitution(271);
+ context.enableEmitNotification(274);
var moduleInfoMap = [];
var deferredExports = [];
var currentSourceFile;
@@ -57100,7 +57434,7 @@ var ts;
ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement));
ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset));
addExportEqualsIfNeeded(statements, false);
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements));
if (currentModuleInfo.hasExportStarsToExportValues && !compilerOptions.importHelpers) {
ts.addEmitHelper(updated, exportStarHelper);
@@ -57215,7 +57549,7 @@ var ts;
}
ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset));
addExportEqualsIfNeeded(statements, true);
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
var body = ts.createBlock(statements, true);
if (currentModuleInfo.hasExportStarsToExportValues && !compilerOptions.importHelpers) {
ts.addEmitHelper(body, exportStarHelper);
@@ -57246,23 +57580,23 @@ var ts;
}
function sourceElementVisitor(node) {
switch (node.kind) {
- case 243:
+ case 244:
return visitImportDeclaration(node);
- case 242:
+ case 243:
return visitImportEqualsDeclaration(node);
- case 249:
+ case 250:
return visitExportDeclaration(node);
- case 248:
+ case 249:
return visitExportAssignment(node);
- case 213:
+ case 214:
return visitVariableStatement(node);
- case 233:
- return visitFunctionDeclaration(node);
case 234:
+ return visitFunctionDeclaration(node);
+ case 235:
return visitClassDeclaration(node);
- case 302:
- return visitMergeDeclarationMarker(node);
case 303:
+ return visitMergeDeclarationMarker(node);
+ case 304:
return visitEndOfDeclarationMarker(node);
default:
return ts.visitEachChild(node, moduleExpressionElementVisitor, context);
@@ -57287,24 +57621,24 @@ var ts;
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var elem = _a[_i];
switch (elem.kind) {
- case 269:
+ case 270:
if (destructuringNeedsFlattening(elem.initializer)) {
return true;
}
break;
- case 270:
+ case 271:
if (destructuringNeedsFlattening(elem.name)) {
return true;
}
break;
- case 271:
+ case 272:
if (destructuringNeedsFlattening(elem.expression)) {
return true;
}
break;
- case 153:
- case 155:
+ case 154:
case 156:
+ case 157:
return false;
default: ts.Debug.assertNever(elem, "Unhandled object member kind");
}
@@ -57619,7 +57953,7 @@ var ts;
}
}
function visitMergeDeclarationMarker(node) {
- if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 213) {
+ if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 214) {
var id = ts.getOriginalNodeId(node);
deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original);
}
@@ -57651,10 +57985,10 @@ var ts;
var namedBindings = importClause.namedBindings;
if (namedBindings) {
switch (namedBindings.kind) {
- case 245:
+ case 246:
statements = appendExportsOfDeclaration(statements, namedBindings);
break;
- case 246:
+ case 247:
for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) {
var importBinding = _a[_i];
statements = appendExportsOfDeclaration(statements, importBinding);
@@ -57762,7 +58096,7 @@ var ts;
return node;
}
function onEmitNode(hint, node, emitCallback) {
- if (node.kind === 273) {
+ if (node.kind === 274) {
currentSourceFile = node;
currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)];
noSubstitution = [];
@@ -57804,10 +58138,10 @@ var ts;
switch (node.kind) {
case 71:
return substituteExpressionIdentifier(node);
- case 199:
+ case 200:
return substituteBinaryExpression(node);
+ case 199:
case 198:
- case 197:
return substituteUnaryExpression(node);
}
return node;
@@ -57822,7 +58156,7 @@ var ts;
}
if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) {
var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node));
- if (exportContainer && exportContainer.kind === 273) {
+ if (exportContainer && exportContainer.kind === 274) {
return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), node);
}
var importDeclaration = resolver.getReferencedImportDeclaration(node);
@@ -57865,7 +58199,7 @@ var ts;
&& !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) {
var exportedNames = getExports(node.operand);
if (exportedNames) {
- var expression = node.kind === 198
+ var expression = node.kind === 199
? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 43 ? 59 : 60), ts.createLiteral(1)), node)
: node;
for (var _i = 0, exportedNames_3 = exportedNames; _i < exportedNames_3.length; _i++) {
@@ -57929,11 +58263,11 @@ var ts;
context.onSubstituteNode = onSubstituteNode;
context.onEmitNode = onEmitNode;
context.enableSubstitution(71);
- context.enableSubstitution(270);
- context.enableSubstitution(199);
- context.enableSubstitution(197);
+ context.enableSubstitution(271);
+ context.enableSubstitution(200);
context.enableSubstitution(198);
- context.enableEmitNotification(273);
+ context.enableSubstitution(199);
+ context.enableEmitNotification(274);
var moduleInfoMap = [];
var deferredExports = [];
var exportFunctionsMap = [];
@@ -58019,7 +58353,7 @@ var ts;
ts.visitNode(moduleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement);
var executeStatements = ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset);
ts.addRange(statements, hoistedStatements);
- ts.prependRange(statements, endLexicalEnvironment());
+ ts.prependStatements(statements, endLexicalEnvironment());
var exportStarFunction = addExportStarIfNeeded(statements);
var moduleObject = ts.createObjectLiteral([
ts.createPropertyAssignment("setters", createSettersArray(exportStarFunction, dependencyGroups)),
@@ -58037,7 +58371,7 @@ var ts;
var hasExportDeclarationWithExportClause = false;
for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) {
var externalImport = _a[_i];
- if (externalImport.kind === 249 && externalImport.exportClause) {
+ if (externalImport.kind === 250 && externalImport.exportClause) {
hasExportDeclarationWithExportClause = true;
break;
}
@@ -58060,7 +58394,7 @@ var ts;
}
for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) {
var externalImport = _e[_d];
- if (externalImport.kind !== 249) {
+ if (externalImport.kind !== 250) {
continue;
}
if (!externalImport.exportClause) {
@@ -58111,15 +58445,15 @@ var ts;
var entry = _b[_a];
var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile);
switch (entry.kind) {
- case 243:
+ case 244:
if (!entry.importClause) {
break;
}
- case 242:
+ case 243:
ts.Debug.assert(importVariableName !== undefined);
statements.push(ts.createStatement(ts.createAssignment(importVariableName, parameterName)));
break;
- case 249:
+ case 250:
ts.Debug.assert(importVariableName !== undefined);
if (entry.exportClause) {
var properties = [];
@@ -58141,13 +58475,13 @@ var ts;
}
function sourceElementVisitor(node) {
switch (node.kind) {
- case 243:
+ case 244:
return visitImportDeclaration(node);
- case 242:
+ case 243:
return visitImportEqualsDeclaration(node);
- case 249:
+ case 250:
return undefined;
- case 248:
+ case 249:
return visitExportAssignment(node);
default:
return nestedElementVisitor(node);
@@ -58268,7 +58602,7 @@ var ts;
}
function shouldHoistVariableDeclarationList(node) {
return (ts.getEmitFlags(node) & 2097152) === 0
- && (enclosingBlockScopedContainer.kind === 273
+ && (enclosingBlockScopedContainer.kind === 274
|| (ts.getOriginalNode(node).flags & 3) === 0);
}
function transformInitializedVariable(node, isExportedDeclaration) {
@@ -58290,7 +58624,7 @@ var ts;
: preventSubstitution(ts.setTextRange(ts.createAssignment(name, value), location));
}
function visitMergeDeclarationMarker(node) {
- if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 213) {
+ if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 214) {
var id = ts.getOriginalNodeId(node);
var isExportedDeclaration = ts.hasModifier(node.original, 1);
deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration);
@@ -58329,10 +58663,10 @@ var ts;
var namedBindings = importClause.namedBindings;
if (namedBindings) {
switch (namedBindings.kind) {
- case 245:
+ case 246:
statements = appendExportsOfDeclaration(statements, namedBindings);
break;
- case 246:
+ case 247:
for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) {
var importBinding = _a[_i];
statements = appendExportsOfDeclaration(statements, importBinding);
@@ -58432,43 +58766,43 @@ var ts;
}
function nestedElementVisitor(node) {
switch (node.kind) {
- case 213:
+ case 214:
return visitVariableStatement(node);
- case 233:
- return visitFunctionDeclaration(node);
case 234:
+ return visitFunctionDeclaration(node);
+ case 235:
return visitClassDeclaration(node);
- case 219:
- return visitForStatement(node);
case 220:
- return visitForInStatement(node);
+ return visitForStatement(node);
case 221:
+ return visitForInStatement(node);
+ case 222:
return visitForOfStatement(node);
- case 217:
- return visitDoStatement(node);
case 218:
+ return visitDoStatement(node);
+ case 219:
return visitWhileStatement(node);
- case 227:
+ case 228:
return visitLabeledStatement(node);
- case 225:
- return visitWithStatement(node);
case 226:
+ return visitWithStatement(node);
+ case 227:
return visitSwitchStatement(node);
- case 240:
+ case 241:
return visitCaseBlock(node);
- case 265:
- return visitCaseClause(node);
case 266:
+ return visitCaseClause(node);
+ case 267:
return visitDefaultClause(node);
- case 229:
+ case 230:
return visitTryStatement(node);
- case 268:
+ case 269:
return visitCatchClause(node);
- case 212:
+ case 213:
return visitBlock(node);
- case 302:
- return visitMergeDeclarationMarker(node);
case 303:
+ return visitMergeDeclarationMarker(node);
+ case 304:
return visitEndOfDeclarationMarker(node);
default:
return destructuringAndImportCallVisitor(node);
@@ -58477,7 +58811,7 @@ var ts;
function visitForStatement(node) {
var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer;
enclosingBlockScopedContainer = node;
- node = ts.updateFor(node, visitForInitializer(node.initializer), ts.visitNode(node.condition, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.incrementor, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement));
+ node = ts.updateFor(node, node.initializer && visitForInitializer(node.initializer), ts.visitNode(node.condition, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.incrementor, destructuringAndImportCallVisitor, ts.isExpression), ts.visitNode(node.statement, nestedElementVisitor, ts.isStatement));
enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer;
return node;
}
@@ -58500,9 +58834,6 @@ var ts;
&& shouldHoistVariableDeclarationList(node);
}
function visitForInitializer(node) {
- if (!node) {
- return node;
- }
if (shouldHoistForInitializer(node)) {
var expressions = void 0;
for (var _i = 0, _a = node.declarations; _i < _a.length; _i++) {
@@ -58565,7 +58896,7 @@ var ts;
}
function destructuringAndImportCallVisitor(node) {
if (node.transformFlags & 1024
- && node.kind === 199) {
+ && node.kind === 200) {
return visitDestructuringAssignment(node);
}
else if (ts.isImportCall(node)) {
@@ -58608,7 +58939,7 @@ var ts;
}
else if (ts.isIdentifier(node)) {
var container = resolver.getReferencedExportContainer(node);
- return container !== undefined && container.kind === 273;
+ return container !== undefined && container.kind === 274;
}
else {
return false;
@@ -58623,7 +58954,7 @@ var ts;
return node;
}
function onEmitNode(hint, node, emitCallback) {
- if (node.kind === 273) {
+ if (node.kind === 274) {
var id = ts.getOriginalNodeId(node);
currentSourceFile = node;
moduleInfo = moduleInfoMap[id];
@@ -58657,7 +58988,7 @@ var ts;
}
function substituteUnspecified(node) {
switch (node.kind) {
- case 270:
+ case 271:
return substituteShorthandPropertyAssignment(node);
}
return node;
@@ -58681,10 +59012,10 @@ var ts;
switch (node.kind) {
case 71:
return substituteExpressionIdentifier(node);
- case 199:
+ case 200:
return substituteBinaryExpression(node);
- case 197:
case 198:
+ case 199:
return substituteUnaryExpression(node);
}
return node;
@@ -58736,14 +59067,14 @@ var ts;
&& !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) {
var exportedNames = getExports(node.operand);
if (exportedNames) {
- var expression = node.kind === 198
+ var expression = node.kind === 199
? 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 === 198) {
+ if (node.kind === 199) {
expression = node.operator === 43
? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1))
: ts.createAdd(preventSubstitution(expression), ts.createLiteral(1));
@@ -58760,7 +59091,7 @@ var ts;
|| resolver.getReferencedValueDeclaration(name);
if (valueDeclaration) {
var exportContainer = resolver.getReferencedExportContainer(name, false);
- if (exportContainer && exportContainer.kind === 273) {
+ if (exportContainer && exportContainer.kind === 274) {
exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration));
}
exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]);
@@ -58788,7 +59119,7 @@ var ts;
var previousOnSubstituteNode = context.onSubstituteNode;
context.onEmitNode = onEmitNode;
context.onSubstituteNode = onSubstituteNode;
- context.enableEmitNotification(273);
+ context.enableEmitNotification(274);
context.enableSubstitution(71);
var currentSourceFile;
return ts.chainBundle(transformSourceFile);
@@ -58815,9 +59146,9 @@ var ts;
}
function visitor(node) {
switch (node.kind) {
- case 242:
+ case 243:
return undefined;
- case 248:
+ case 249:
return visitExportAssignment(node);
}
return node;
@@ -58903,7 +59234,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 === 234) {
+ else if (node.parent.kind === 235) {
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 :
@@ -58932,7 +59263,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 === 234) {
+ else if (node.parent.kind === 235) {
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 :
@@ -58976,18 +59307,18 @@ var ts;
return getTypeAliasDeclarationVisibilityError;
}
else {
- ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]);
+ 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 === 231 || node.kind === 181) {
+ if (node.kind === 232 || node.kind === 182) {
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 === 151 || node.kind === 150 ||
- (node.kind === 148 && ts.hasModifier(node.parent, 8))) {
+ else if (node.kind === 152 || node.kind === 151 ||
+ (node.kind === 149 && ts.hasModifier(node.parent, 8))) {
if (ts.hasModifier(node, 32)) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
@@ -58995,7 +59326,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 === 234 || node.kind === 148) {
+ else if (node.parent.kind === 235 || node.kind === 149) {
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 :
@@ -59019,7 +59350,7 @@ var ts;
}
function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) {
var diagnosticMessage;
- if (node.kind === 156) {
+ if (node.kind === 157) {
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 :
@@ -59056,23 +59387,23 @@ var ts;
function getReturnTypeVisibilityError(symbolAccessibilityResult) {
var diagnosticMessage;
switch (node.kind) {
- case 158:
+ case 159:
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 157:
+ case 158:
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 159:
+ case 160:
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 154:
case 153:
- case 152:
if (ts.hasModifier(node, 32)) {
diagnosticMessage = symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
@@ -59080,7 +59411,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 === 234) {
+ else if (node.parent.kind === 235) {
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 :
@@ -59093,7 +59424,7 @@ var ts;
ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;
}
break;
- case 233:
+ case 234:
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 :
@@ -59101,7 +59432,7 @@ var ts;
ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0;
break;
default:
- ts.Debug.fail("This is unknown kind for signature: " + node.kind);
+ return ts.Debug.fail("This is unknown kind for signature: " + node.kind);
}
return {
diagnosticMessage: diagnosticMessage,
@@ -59118,27 +59449,27 @@ var ts;
}
function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
switch (node.parent.kind) {
- case 154:
+ case 155:
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 158:
- case 163:
+ case 159:
+ case 164:
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 157:
+ case 158:
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 159:
+ case 160:
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 154:
case 153:
- case 152:
if (ts.hasModifier(node.parent, 32)) {
return symbolAccessibilityResult.errorModuleName ?
symbolAccessibilityResult.accessibility === 2 ?
@@ -59146,7 +59477,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 === 234) {
+ else if (node.parent.parent.kind === 235) {
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 :
@@ -59158,52 +59489,52 @@ 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 233:
- case 162:
+ case 234:
+ case 163:
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;
default:
- ts.Debug.fail("Unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]);
+ return ts.Debug.fail("Unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]);
}
}
function getTypeParameterConstraintVisibilityError() {
var diagnosticMessage;
switch (node.parent.kind) {
- case 234:
+ case 235:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;
break;
- case 235:
+ case 236:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;
break;
- case 158:
+ case 159:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
- case 157:
+ case 158:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;
break;
+ case 154:
case 153:
- case 152:
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 === 234) {
+ else if (node.parent.parent.kind === 235) {
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 233:
+ case 234:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
break;
- case 236:
+ case 237:
diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;
break;
default:
- ts.Debug.fail("This is unknown parent for type parameter: " + node.parent.kind);
+ return ts.Debug.fail("This is unknown parent for type parameter: " + node.parent.kind);
}
return {
diagnosticMessage: diagnosticMessage,
@@ -59213,7 +59544,7 @@ var ts;
}
function getHeritageClauseVisibilityError() {
var diagnosticMessage;
- if (node.parent.parent.kind === 234) {
+ if (node.parent.parent.kind === 235) {
diagnosticMessage = node.parent.token === 108 ?
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;
@@ -59353,16 +59684,16 @@ var ts;
}
}
function transformRoot(node) {
- if (node.kind === 273 && (node.isDeclarationFile || ts.isSourceFileJavaScript(node))) {
+ if (node.kind === 274 && (node.isDeclarationFile || ts.isSourceFileJavaScript(node))) {
return node;
}
- if (node.kind === 274) {
+ if (node.kind === 275) {
isBundledEmit = true;
var refs_1 = ts.createMap();
var hasNoDefaultLib_1 = false;
var bundle = ts.createBundle(ts.map(node.sourceFiles, function (sourceFile) {
if (sourceFile.isDeclarationFile || ts.isSourceFileJavaScript(sourceFile))
- return;
+ return undefined;
hasNoDefaultLib_1 = hasNoDefaultLib_1 || sourceFile.hasNoDefaultLib;
currentSourceFile = sourceFile;
enclosingDeclaration = sourceFile;
@@ -59384,7 +59715,7 @@ var ts;
var updated = ts.visitNodes(sourceFile.statements, visitDeclarationStatements);
return ts.updateSourceFileNode(sourceFile, transformAndReplaceLatePaintedStatements(updated), true, [], [], false);
}), ts.mapDefined(node.prepends, function (prepend) {
- if (prepend.kind === 276) {
+ if (prepend.kind === 277) {
return ts.createUnparsedSourceFile(prepend.declarationText);
}
}));
@@ -59479,7 +59810,7 @@ var ts;
return name;
}
else {
- if (name.kind === 180) {
+ if (name.kind === 181) {
return ts.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement));
}
else {
@@ -59487,7 +59818,7 @@ var ts;
}
}
function visitBindingElement(elem) {
- if (elem.kind === 205) {
+ if (elem.kind === 206) {
return elem;
}
return ts.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined);
@@ -59521,7 +59852,7 @@ var ts;
if (shouldPrintWithInitializer(node)) {
return;
}
- var shouldUseResolverType = node.kind === 148 &&
+ var shouldUseResolverType = node.kind === 149 &&
(resolver.isRequiredInitializedParameter(node) ||
resolver.isOptionalUninitializedParameterProperty(node));
if (type && !shouldUseResolverType) {
@@ -59530,7 +59861,7 @@ var ts;
if (!ts.getParseTreeNode(node)) {
return type ? ts.visitNode(type, visitDeclarationSubtree) : ts.createKeywordTypeNode(119);
}
- if (node.kind === 156) {
+ if (node.kind === 157) {
return ts.createKeywordTypeNode(119);
}
errorNameNode = node.name;
@@ -59539,12 +59870,12 @@ var ts;
oldDiag = getSymbolAccessibilityDiagnostic;
getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node);
}
- if (node.kind === 231 || node.kind === 181) {
+ if (node.kind === 232 || node.kind === 182) {
return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker));
}
- if (node.kind === 148
- || node.kind === 151
- || node.kind === 150) {
+ if (node.kind === 149
+ || node.kind === 152
+ || node.kind === 151) {
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));
@@ -59561,19 +59892,19 @@ var ts;
function isDeclarationAndNotVisible(node) {
node = ts.getParseTreeNode(node);
switch (node.kind) {
- case 233:
- case 238:
- case 235:
case 234:
+ case 239:
case 236:
+ case 235:
case 237:
+ case 238:
return !resolver.isDeclarationVisible(node);
- case 231:
+ case 232:
return !getBindingNameVisible(node);
- case 242:
case 243:
+ case 244:
+ case 250:
case 249:
- case 248:
return false;
}
return false;
@@ -59583,7 +59914,7 @@ var ts;
return false;
}
if (ts.isBindingPattern(elem.name)) {
- return ts.forEach(elem.name.elements, getBindingNameVisible);
+ return ts.some(elem.name.elements, getBindingNameVisible);
}
else {
return resolver.isDeclarationVisible(elem);
@@ -59625,8 +59956,8 @@ var ts;
}
function rewriteModuleSpecifier(parent, input) {
if (!input)
- return;
- resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 238 && parent.kind !== 178);
+ return undefined;
+ resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 239 && parent.kind !== 179);
if (input.kind === 9 && isBundledEmit) {
var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent);
if (newName) {
@@ -59638,7 +59969,7 @@ var ts;
function transformImportEqualsDeclaration(decl) {
if (!resolver.isDeclarationVisible(decl))
return;
- if (decl.moduleReference.kind === 253) {
+ if (decl.moduleReference.kind === 254) {
var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl);
return ts.updateImportEqualsDeclaration(decl, undefined, decl.modifiers, decl.name, ts.updateExternalModuleReference(decl.moduleReference, rewriteModuleSpecifier(decl, specifier)));
}
@@ -59658,7 +59989,7 @@ var ts;
if (!decl.importClause.namedBindings) {
return visibleDefaultBinding && ts.updateImportDeclaration(decl, undefined, decl.modifiers, ts.updateImportClause(decl.importClause, visibleDefaultBinding, undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier));
}
- if (decl.importClause.namedBindings.kind === 245) {
+ if (decl.importClause.namedBindings.kind === 246) {
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), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined;
}
@@ -59738,61 +60069,61 @@ var ts;
checkEntityNameVisibility(input.exprName, enclosingDeclaration);
}
var oldWithinObjectLiteralType = suppressNewDiagnosticContexts;
- var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 165 || input.kind === 176) && input.parent.kind !== 236);
+ var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 166 || input.kind === 177) && input.parent.kind !== 237);
if (shouldEnterSuppressNewDiagnosticsContextContext) {
suppressNewDiagnosticContexts = true;
}
if (isProcessedComponent(input)) {
switch (input.kind) {
- case 206: {
+ case 207: {
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 161: {
+ case 162: {
checkEntityNameVisibility(input.typeName, enclosingDeclaration);
var node = ts.visitEachChild(input, visitDeclarationSubtree, context);
return cleanup(ts.updateTypeReferenceNode(node, node.typeName, ts.parenthesizeTypeParameters(node.typeArguments)));
}
- case 158:
+ case 159:
return cleanup(ts.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)));
- case 154: {
+ case 155: {
var isPrivate = ts.hasModifier(input, 8);
- var ctor = ts.createSignatureDeclaration(154, isPrivate ? undefined : ensureTypeParams(input, input.typeParameters), isPrivate ? undefined : updateParamsList(input, input.parameters, 0), undefined);
+ var ctor = ts.createSignatureDeclaration(155, isPrivate ? undefined : ensureTypeParams(input, input.typeParameters), isPrivate ? undefined : updateParamsList(input, input.parameters, 0), undefined);
ctor.modifiers = ts.createNodeArray(ensureModifiers(input));
return cleanup(ctor);
}
- case 153: {
- var sig = ts.createSignatureDeclaration(152, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type));
+ case 154: {
+ var sig = ts.createSignatureDeclaration(153, 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 155: {
- var newNode = ensureAccessor(input);
- return cleanup(newNode);
- }
case 156: {
var newNode = ensureAccessor(input);
return cleanup(newNode);
}
- case 151:
+ case 157: {
+ var newNode = ensureAccessor(input);
+ return cleanup(newNode);
+ }
+ case 152:
return cleanup(ts.updateProperty(input, undefined, ensureModifiers(input), input.name, input.questionToken, !ts.hasModifier(input, 8) ? ensureType(input, input.type) : undefined, ensureNoInitializer(input)));
- case 150:
+ case 151:
return cleanup(ts.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, !ts.hasModifier(input, 8) ? ensureType(input, input.type) : undefined, ensureNoInitializer(input)));
- case 152: {
+ case 153: {
return cleanup(ts.updateMethodSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), input.name, input.questionToken));
}
- case 157: {
+ case 158: {
return cleanup(ts.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type)));
}
- case 159: {
+ case 160: {
return cleanup(ts.updateIndexSignature(input, undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || ts.createKeywordTypeNode(119)));
}
- case 231: {
+ case 232: {
if (ts.isBindingPattern(input.name)) {
return recreateBindingPattern(input.name);
}
@@ -59800,13 +60131,13 @@ var ts;
suppressNewDiagnosticContexts = true;
return cleanup(ts.updateVariableDeclaration(input, input.name, ensureType(input, input.type), ensureNoInitializer(input)));
}
- case 147: {
+ case 148: {
if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) {
return cleanup(ts.updateTypeParameterDeclaration(input, input.name, undefined, undefined));
}
return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context));
}
- case 170: {
+ case 171: {
var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree);
var extendsType = ts.visitNode(input.extendsType, visitDeclarationSubtree);
var oldEnclosingDecl = enclosingDeclaration;
@@ -59816,13 +60147,13 @@ var ts;
var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree);
return cleanup(ts.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
}
- case 162: {
+ case 163: {
return cleanup(ts.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree)));
}
- case 163: {
+ case 164: {
return cleanup(ts.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree)));
}
- case 178: {
+ case 179: {
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));
@@ -59851,7 +60182,7 @@ var ts;
}
}
function isPrivateMethodTypeParameter(node) {
- return node.parent.kind === 153 && ts.hasModifier(node.parent, 8);
+ return node.parent.kind === 154 && ts.hasModifier(node.parent, 8);
}
function visitDeclarationStatements(input) {
if (!isPreservedDeclarationStatement(input)) {
@@ -59860,14 +60191,14 @@ var ts;
if (shouldStripInternal(input))
return;
switch (input.kind) {
- case 249: {
+ case 250: {
if (ts.isSourceFile(input.parent)) {
resultHasExternalModuleIndicator = true;
resultHasScopeMarker = true;
}
return ts.updateExportDeclaration(input, undefined, input.modifiers, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier));
}
- case 248: {
+ case 249: {
if (ts.isSourceFile(input.parent)) {
resultHasExternalModuleIndicator = true;
resultHasScopeMarker = true;
@@ -59895,10 +60226,10 @@ var ts;
if (shouldStripInternal(input))
return;
switch (input.kind) {
- case 242: {
+ case 243: {
return transformImportEqualsDeclaration(input);
}
- case 243: {
+ case 244: {
return transformImportDeclaration(input);
}
}
@@ -59918,18 +60249,18 @@ var ts;
}
var previousNeedsDeclare = needsDeclare;
switch (input.kind) {
- case 236:
+ case 237:
return cleanup(ts.updateTypeAliasDeclaration(input, undefined, ensureModifiers(input, isPrivate), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode)));
- case 235: {
+ case 236: {
return cleanup(ts.updateInterfaceDeclaration(input, undefined, ensureModifiers(input, isPrivate), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree)));
}
- case 233: {
+ case 234: {
return cleanup(ts.updateFunctionDeclaration(input, undefined, ensureModifiers(input, isPrivate), undefined, input.name, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), undefined));
}
- case 238: {
+ case 239: {
needsDeclare = false;
var inner = input.body;
- if (inner && inner.kind === 239) {
+ if (inner && inner.kind === 240) {
var statements = ts.visitNodes(inner.statements, visitDeclarationStatements);
var body = ts.updateModuleBlock(inner, transformAndReplaceLatePaintedStatements(statements));
needsDeclare = previousNeedsDeclare;
@@ -59947,7 +60278,7 @@ var ts;
return cleanup(ts.updateModuleDeclaration(input, undefined, mods, input.name, body));
}
}
- case 234: {
+ case 235: {
var modifiers = ts.createNodeArray(ensureModifiers(input, isPrivate));
var typeParameters = ensureTypeParams(input, input.typeParameters);
var ctor = ts.getFirstConstructorWithBody(input);
@@ -60009,10 +60340,10 @@ var ts;
return cleanup(ts.updateClassDeclaration(input, undefined, modifiers, input.name, typeParameters, heritageClauses, members));
}
}
- case 213: {
+ case 214: {
return cleanup(transformVariableStatement(input, isPrivate));
}
- case 237: {
+ case 238: {
return cleanup(ts.updateEnumDeclaration(input, undefined, ts.createNodeArray(ensureModifiers(input, isPrivate)), input.name, ts.createNodeArray(ts.mapDefined(input.members, function (m) {
if (shouldStripInternal(m))
return;
@@ -60029,7 +60360,7 @@ var ts;
if (canProdiceDiagnostic) {
getSymbolAccessibilityDiagnostic = oldDiag;
}
- if (input.kind === 238) {
+ if (input.kind === 239) {
needsDeclare = previousNeedsDeclare;
}
if (node === input) {
@@ -60050,7 +60381,7 @@ var ts;
return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); }));
}
function recreateBindingElement(e) {
- if (e.kind === 205) {
+ if (e.kind === 206) {
return;
}
if (e.name) {
@@ -60104,7 +60435,7 @@ var ts;
function ensureModifierFlags(node, privateDeclaration) {
var mask = 3071 ^ (4 | 256);
var additions = (needsDeclare && !isAlwaysType(node)) ? 2 : 0;
- var parentIsFile = node.parent.kind === 273;
+ var parentIsFile = node.parent.kind === 274;
if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) {
mask ^= ((privateDeclaration || (isBundledEmit && parentIsFile) ? 0 : 1) | 512 | 2);
additions = 0;
@@ -60151,7 +60482,7 @@ var ts;
}
ts.transformDeclarations = transformDeclarations;
function isAlwaysType(node) {
- if (node.kind === 235) {
+ if (node.kind === 236) {
return true;
}
return false;
@@ -60170,7 +60501,7 @@ var ts;
}
function getTypeAnnotationFromAccessor(accessor) {
if (accessor) {
- return accessor.kind === 155
+ return accessor.kind === 156
? accessor.type
: accessor.parameters.length > 0
? accessor.parameters[0].type
@@ -60179,51 +60510,51 @@ var ts;
}
function canHaveLiteralInitializer(node) {
switch (node.kind) {
- case 231:
+ case 232:
+ case 152:
case 151:
- case 150:
- case 148:
+ case 149:
return true;
}
return false;
}
function isPreservedDeclarationStatement(node) {
switch (node.kind) {
- case 233:
- case 238:
- case 242:
- case 235:
case 234:
- case 236:
- case 237:
- case 213:
+ case 239:
case 243:
+ case 236:
+ case 235:
+ case 237:
+ case 238:
+ case 214:
+ case 244:
+ case 250:
case 249:
- case 248:
return true;
}
return false;
}
function isProcessedComponent(node) {
switch (node.kind) {
- case 158:
- case 154:
- case 153:
- case 155:
- case 156:
- case 151:
- case 150:
- case 152:
- case 157:
case 159:
- case 231:
- case 147:
- case 206:
- case 161:
- case 170:
+ case 155:
+ case 154:
+ case 156:
+ case 157:
+ case 152:
+ case 151:
+ case 153:
+ case 158:
+ case 160:
+ case 232:
+ case 148:
+ case 207:
case 162:
+ case 171:
case 163:
- case 178:
+ case 164:
+ case 179:
return true;
}
return false;
@@ -60286,7 +60617,7 @@ var ts;
}
ts.getTransformers = getTransformers;
function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) {
- var enabledSyntaxKindFeatures = new Array(304);
+ var enabledSyntaxKindFeatures = new Array(305);
var lexicalEnvironmentVariableDeclarations;
var lexicalEnvironmentFunctionDeclarations;
var lexicalEnvironmentVariableDeclarationsStack = [];
@@ -60521,7 +60852,7 @@ var ts;
return currentSource.skipTrivia ? currentSource.skipTrivia(pos) : ts.skipTrivia(currentSourceText, pos);
}
function initialize(filePath, sourceMapFilePath, sourceFileOrBundle, outputSourceMapDataList) {
- if (disabled) {
+ if (disabled || ts.fileExtensionIs(filePath, ".json")) {
return;
}
if (sourceMapData) {
@@ -60552,7 +60883,7 @@ var ts;
}
if (compilerOptions.mapRoot) {
sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot);
- if (sourceFileOrBundle.kind === 273) {
+ if (sourceFileOrBundle.kind === 274) {
sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFileOrBundle, host, sourceMapDir));
}
if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) {
@@ -60612,7 +60943,7 @@ var ts;
sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan);
}
function emitPos(pos) {
- if (disabled || ts.positionIsSynthesized(pos)) {
+ if (disabled || ts.positionIsSynthesized(pos) || isJsonSourceMapSource(currentSource)) {
return;
}
if (extendedDiagnostics) {
@@ -60649,12 +60980,12 @@ var ts;
}
}
function emitNodeWithSourceMap(hint, node, emitCallback) {
- if (disabled) {
+ if (disabled || ts.isInJsonFile(node)) {
return emitCallback(hint, node);
}
if (node) {
var emitNode = node.emitNode;
- var emitFlags = emitNode && emitNode.flags;
+ var emitFlags = emitNode && emitNode.flags || 0;
var range = emitNode && emitNode.sourceMapRange;
var _a = range || node, pos = _a.pos, end = _a.end;
var source = range && range.source;
@@ -60663,7 +60994,7 @@ var ts;
source = undefined;
if (source)
setSourceFile(source);
- if (node.kind !== 299
+ if (node.kind !== 300
&& (emitFlags & 16) === 0
&& pos >= 0) {
emitPos(skipSourceTrivia(pos));
@@ -60680,7 +61011,7 @@ var ts;
}
if (source)
setSourceFile(source);
- if (node.kind !== 299
+ if (node.kind !== 300
&& (emitFlags & 32) === 0
&& end >= 0) {
emitPos(end);
@@ -60690,11 +61021,11 @@ var ts;
}
}
function emitTokenWithSourceMap(node, token, writer, tokenPos, emitCallback) {
- if (disabled) {
+ if (disabled || ts.isInJsonFile(node)) {
return emitCallback(token, writer, tokenPos);
}
var emitNode = node && node.emitNode;
- var emitFlags = emitNode && emitNode.flags;
+ var emitFlags = emitNode && emitNode.flags || 0;
var range = emitNode && emitNode.tokenSourceMapRanges && emitNode.tokenSourceMapRanges[token];
tokenPos = skipSourceTrivia(range ? range.pos : tokenPos);
if ((emitFlags & 128) === 0 && tokenPos >= 0) {
@@ -60708,12 +61039,18 @@ var ts;
}
return tokenPos;
}
+ function isJsonSourceMapSource(sourceFile) {
+ return ts.fileExtensionIs(sourceFile.fileName, ".json");
+ }
function setSourceFile(sourceFile) {
if (disabled) {
return;
}
currentSource = sourceFile;
currentSourceText = currentSource.text;
+ if (isJsonSourceMapSource(sourceFile)) {
+ return;
+ }
var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir;
var source = ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, currentSource.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, true);
sourceMapSourceIndex = sourceMapData.sourceMapSources.indexOf(source);
@@ -60727,8 +61064,8 @@ var ts;
}
}
function getText() {
- if (disabled) {
- return;
+ if (disabled || isJsonSourceMapSource(currentSource)) {
+ return undefined;
}
encodeLastRecordedSourceMapSpan();
return JSON.stringify({
@@ -60742,8 +61079,8 @@ var ts;
});
}
function getSourceMappingURL() {
- if (disabled) {
- return;
+ if (disabled || isJsonSourceMapSource(currentSource)) {
+ return undefined;
}
if (compilerOptions.inlineSourceMap) {
var base64SourceMapText = ts.base64encode(ts.sys, getText());
@@ -60795,7 +61132,7 @@ var ts;
var currentLineMap;
var detachedCommentsInfo;
var hasWrittenComment = false;
- var disabled = printerOptions.removeComments;
+ var disabled = !!printerOptions.removeComments;
return {
reset: reset,
setWriter: setWriter,
@@ -60813,7 +61150,7 @@ var ts;
if (node) {
hasWrittenComment = false;
var emitNode = node.emitNode;
- var emitFlags = emitNode && emitNode.flags;
+ var emitFlags = emitNode && emitNode.flags || 0;
var _a = emitNode && emitNode.commentRange || node, pos = _a.pos, end = _a.end;
if ((pos < 0 && end < 0) || (pos === end)) {
emitNodeWithSynthesizedComments(hint, node, emitNode, emitFlags, emitCallback);
@@ -60822,7 +61159,7 @@ var ts;
if (extendedDiagnostics) {
ts.performance.mark("preEmitNodeWithComment");
}
- var isEmittedNode = node.kind !== 299;
+ var isEmittedNode = node.kind !== 300;
var skipLeadingComments = pos < 0 || (emitFlags & 512) !== 0 || node.kind === 10;
var skipTrailingComments = end < 0 || (emitFlags & 1024) !== 0 || node.kind === 10;
if (!skipLeadingComments) {
@@ -60836,7 +61173,7 @@ var ts;
}
if (!skipTrailingComments) {
containerEnd = end;
- if (node.kind === 232) {
+ if (node.kind === 233) {
declarationListContainerEnd = end;
}
}
@@ -61077,10 +61414,10 @@ var ts;
detachedCommentsInfo = undefined;
}
function hasDetachedComments(pos) {
- return detachedCommentsInfo !== undefined && ts.lastOrUndefined(detachedCommentsInfo).nodePos === pos;
+ return detachedCommentsInfo !== undefined && ts.last(detachedCommentsInfo).nodePos === pos;
}
function forEachLeadingCommentWithoutDetachedComments(cb) {
- var pos = ts.lastOrUndefined(detachedCommentsInfo).detachedCommentEndPos;
+ var pos = ts.last(detachedCommentsInfo).detachedCommentEndPos;
if (detachedCommentsInfo.length - 1) {
detachedCommentsInfo.pop();
}
@@ -61120,6 +61457,7 @@ var ts;
var infoExtension = ".tsbundleinfo";
var brackets = createBracketsMap();
function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, emitOnlyDtsFiles) {
+ if (emitOnlyDtsFiles === void 0) { emitOnlyDtsFiles = false; }
var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile);
var options = host.getCompilerOptions();
if (options.outFile || options.out) {
@@ -61144,17 +61482,17 @@ var ts;
ts.forEachEmittedFile = forEachEmittedFile;
function getOutputPathsFor(sourceFile, host, forceDtsPaths) {
var options = host.getCompilerOptions();
- if (sourceFile.kind === 274) {
+ if (sourceFile.kind === 275) {
var jsFilePath = options.outFile || options.out;
var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options);
var declarationFilePath = (forceDtsPaths || options.declaration) ? ts.removeFileExtension(jsFilePath) + ".d.ts" : undefined;
var declarationMapPath = ts.getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : undefined;
- var bundleInfoPath = options.references && jsFilePath && (ts.removeFileExtension(jsFilePath) + infoExtension);
+ var bundleInfoPath = options.references && jsFilePath ? (ts.removeFileExtension(jsFilePath) + infoExtension) : undefined;
return { jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath, declarationMapPath: declarationMapPath, bundleInfoPath: bundleInfoPath };
}
else {
var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, getOutputExtension(sourceFile, options));
- var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options);
+ var sourceMapFilePath = ts.isJsonSourceFile(sourceFile) ? undefined : getSourceMapFilePath(jsFilePath, options);
var isJs = ts.isSourceFileJavaScript(sourceFile);
var declarationFilePath = ((forceDtsPaths || options.declaration) && !isJs) ? ts.getDeclarationEmitOutputFilePath(sourceFile, host) : undefined;
var declarationMapPath = ts.getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : undefined;
@@ -61211,7 +61549,7 @@ var ts;
emitSkipped: emitSkipped,
diagnostics: emitterDiagnostics.getDiagnostics(),
emittedFiles: emittedFilesList,
- sourceMaps: sourceMapDataList
+ sourceMaps: sourceMapDataList,
};
function emitSourceFileOrBundle(_a, sourceFileOrBundle) {
var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath, bundleInfoPath = _a.bundleInfoPath;
@@ -61286,8 +61624,8 @@ var ts;
declarationTransform.dispose();
}
function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, bundleInfoPath, printer, mapRecorder) {
- var bundle = sourceFileOrBundle.kind === 274 ? sourceFileOrBundle : undefined;
- var sourceFile = sourceFileOrBundle.kind === 273 ? sourceFileOrBundle : undefined;
+ var bundle = sourceFileOrBundle.kind === 275 ? sourceFileOrBundle : undefined;
+ var sourceFile = sourceFileOrBundle.kind === 274 ? sourceFileOrBundle : undefined;
var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile];
mapRecorder.initialize(jsFilePath, sourceMapFilePath || "", sourceFileOrBundle, sourceMapDataList);
if (bundle) {
@@ -61304,7 +61642,7 @@ var ts;
if (sourceMapFilePath) {
ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, mapRecorder.getText(), false, sourceFiles);
}
- ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), compilerOptions.emitBOM, sourceFiles);
+ ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), !!compilerOptions.emitBOM, sourceFiles);
if (bundleInfoPath) {
bundleInfo.totalLength = writer.getTextPos();
ts.writeFile(host, emitterDiagnostics, bundleInfoPath, JSON.stringify(bundleInfo, undefined, 2), false);
@@ -61381,9 +61719,9 @@ var ts;
break;
}
switch (node.kind) {
- case 273: return printFile(node);
- case 274: return printBundle(node);
- case 275: return printUnparsedSource(node);
+ case 274: return printFile(node);
+ case 275: return printBundle(node);
+ case 276: return printUnparsedSource(node);
}
writeNode(hint, node, sourceFile, beginPrint());
return endPrint();
@@ -61540,8 +61878,7 @@ var ts;
return getPipelinePhase(currentPhase + 1, hint);
}
function pipelineEmitWithNotification(hint, node) {
- ts.Debug.assertDefined(onEmitNode);
- onEmitNode(hint, node, getNextPipelinePhase(0, hint));
+ ts.Debug.assertDefined(onEmitNode)(hint, node, getNextPipelinePhase(0, hint));
}
function pipelineEmitWithComments(hint, node) {
ts.Debug.assertDefined(emitNodeWithComments);
@@ -61553,9 +61890,8 @@ var ts;
pipelinePhase(hint, trySubstituteNode(hint, node));
}
function pipelineEmitWithSourceMap(hint, node) {
- ts.Debug.assertDefined(onEmitSourceMapOfNode);
ts.Debug.assert(hint !== 0 && hint !== 2);
- onEmitSourceMapOfNode(hint, node, pipelineEmitWithHint);
+ ts.Debug.assertDefined(onEmitSourceMapOfNode)(hint, node, pipelineEmitWithHint);
}
function pipelineEmitWithHint(hint, node) {
if (hint === 0)
@@ -61572,220 +61908,220 @@ var ts;
case 15:
case 16:
return emitLiteral(node);
- case 275:
+ case 276:
return emitUnparsedSource(node);
case 71:
return emitIdentifier(node);
- case 145:
- return emitQualifiedName(node);
case 146:
- return emitComputedPropertyName(node);
+ return emitQualifiedName(node);
case 147:
- return emitTypeParameter(node);
+ return emitComputedPropertyName(node);
case 148:
- return emitParameter(node);
+ return emitTypeParameter(node);
case 149:
- return emitDecorator(node);
+ return emitParameter(node);
case 150:
- return emitPropertySignature(node);
+ return emitDecorator(node);
case 151:
- return emitPropertyDeclaration(node);
+ return emitPropertySignature(node);
case 152:
- return emitMethodSignature(node);
+ return emitPropertyDeclaration(node);
case 153:
- return emitMethodDeclaration(node);
+ return emitMethodSignature(node);
case 154:
- return emitConstructor(node);
+ return emitMethodDeclaration(node);
case 155:
+ return emitConstructor(node);
case 156:
- return emitAccessorDeclaration(node);
case 157:
- return emitCallSignature(node);
+ return emitAccessorDeclaration(node);
case 158:
- return emitConstructSignature(node);
+ return emitCallSignature(node);
case 159:
- return emitIndexSignature(node);
+ return emitConstructSignature(node);
case 160:
- return emitTypePredicate(node);
+ return emitIndexSignature(node);
case 161:
- return emitTypeReference(node);
+ return emitTypePredicate(node);
case 162:
- return emitFunctionType(node);
- case 283:
- return emitJSDocFunctionType(node);
+ return emitTypeReference(node);
case 163:
- return emitConstructorType(node);
+ return emitFunctionType(node);
+ case 284:
+ return emitJSDocFunctionType(node);
case 164:
- return emitTypeQuery(node);
+ return emitConstructorType(node);
case 165:
- return emitTypeLiteral(node);
+ return emitTypeQuery(node);
case 166:
- return emitArrayType(node);
+ return emitTypeLiteral(node);
case 167:
- return emitTupleType(node);
+ return emitArrayType(node);
case 168:
- return emitUnionType(node);
+ return emitTupleType(node);
case 169:
- return emitIntersectionType(node);
+ return emitUnionType(node);
case 170:
- return emitConditionalType(node);
+ return emitIntersectionType(node);
case 171:
- return emitInferType(node);
+ return emitConditionalType(node);
case 172:
- return emitParenthesizedType(node);
- case 206:
- return emitExpressionWithTypeArguments(node);
+ return emitInferType(node);
case 173:
- return emitThisType();
+ return emitParenthesizedType(node);
+ case 207:
+ return emitExpressionWithTypeArguments(node);
case 174:
- return emitTypeOperator(node);
+ return emitThisType();
case 175:
- return emitIndexedAccessType(node);
+ return emitTypeOperator(node);
case 176:
- return emitMappedType(node);
+ return emitIndexedAccessType(node);
case 177:
- return emitLiteralType(node);
+ return emitMappedType(node);
case 178:
+ return emitLiteralType(node);
+ case 179:
return emitImportTypeNode(node);
- case 278:
+ case 279:
write("*");
return;
- case 279:
+ case 280:
write("?");
return;
- case 280:
- return emitJSDocNullableType(node);
case 281:
- return emitJSDocNonNullableType(node);
+ return emitJSDocNullableType(node);
case 282:
+ return emitJSDocNonNullableType(node);
+ case 283:
return emitJSDocOptionalType(node);
- case 284:
+ case 285:
return emitJSDocVariadicType(node);
- case 179:
- return emitObjectBindingPattern(node);
case 180:
- return emitArrayBindingPattern(node);
+ return emitObjectBindingPattern(node);
case 181:
+ return emitArrayBindingPattern(node);
+ case 182:
return emitBindingElement(node);
- case 210:
- return emitTemplateSpan(node);
case 211:
- return emitSemicolonClassElement();
+ return emitTemplateSpan(node);
case 212:
- return emitBlock(node);
+ return emitSemicolonClassElement();
case 213:
- return emitVariableStatement(node);
+ return emitBlock(node);
case 214:
- return emitEmptyStatement();
+ return emitVariableStatement(node);
case 215:
- return emitExpressionStatement(node);
+ return emitEmptyStatement();
case 216:
- return emitIfStatement(node);
+ return emitExpressionStatement(node);
case 217:
- return emitDoStatement(node);
+ return emitIfStatement(node);
case 218:
- return emitWhileStatement(node);
+ return emitDoStatement(node);
case 219:
- return emitForStatement(node);
+ return emitWhileStatement(node);
case 220:
- return emitForInStatement(node);
+ return emitForStatement(node);
case 221:
- return emitForOfStatement(node);
+ return emitForInStatement(node);
case 222:
- return emitContinueStatement(node);
+ return emitForOfStatement(node);
case 223:
- return emitBreakStatement(node);
+ return emitContinueStatement(node);
case 224:
- return emitReturnStatement(node);
+ return emitBreakStatement(node);
case 225:
- return emitWithStatement(node);
+ return emitReturnStatement(node);
case 226:
- return emitSwitchStatement(node);
+ return emitWithStatement(node);
case 227:
- return emitLabeledStatement(node);
+ return emitSwitchStatement(node);
case 228:
- return emitThrowStatement(node);
+ return emitLabeledStatement(node);
case 229:
- return emitTryStatement(node);
+ return emitThrowStatement(node);
case 230:
- return emitDebuggerStatement(node);
+ return emitTryStatement(node);
case 231:
- return emitVariableDeclaration(node);
+ return emitDebuggerStatement(node);
case 232:
- return emitVariableDeclarationList(node);
+ return emitVariableDeclaration(node);
case 233:
- return emitFunctionDeclaration(node);
+ return emitVariableDeclarationList(node);
case 234:
- return emitClassDeclaration(node);
+ return emitFunctionDeclaration(node);
case 235:
- return emitInterfaceDeclaration(node);
+ return emitClassDeclaration(node);
case 236:
- return emitTypeAliasDeclaration(node);
+ return emitInterfaceDeclaration(node);
case 237:
- return emitEnumDeclaration(node);
+ return emitTypeAliasDeclaration(node);
case 238:
- return emitModuleDeclaration(node);
+ return emitEnumDeclaration(node);
case 239:
- return emitModuleBlock(node);
+ return emitModuleDeclaration(node);
case 240:
- return emitCaseBlock(node);
+ return emitModuleBlock(node);
case 241:
- return emitNamespaceExportDeclaration(node);
+ return emitCaseBlock(node);
case 242:
- return emitImportEqualsDeclaration(node);
+ return emitNamespaceExportDeclaration(node);
case 243:
- return emitImportDeclaration(node);
+ return emitImportEqualsDeclaration(node);
case 244:
- return emitImportClause(node);
+ return emitImportDeclaration(node);
case 245:
- return emitNamespaceImport(node);
+ return emitImportClause(node);
case 246:
- return emitNamedImports(node);
+ return emitNamespaceImport(node);
case 247:
- return emitImportSpecifier(node);
+ return emitNamedImports(node);
case 248:
- return emitExportAssignment(node);
+ return emitImportSpecifier(node);
case 249:
- return emitExportDeclaration(node);
+ return emitExportAssignment(node);
case 250:
- return emitNamedExports(node);
+ return emitExportDeclaration(node);
case 251:
- return emitExportSpecifier(node);
+ return emitNamedExports(node);
case 252:
- return;
+ return emitExportSpecifier(node);
case 253:
+ return;
+ case 254:
return emitExternalModuleReference(node);
case 10:
return emitJsxText(node);
- case 256:
- case 259:
- return emitJsxOpeningElementOrFragment(node);
case 257:
case 260:
- return emitJsxClosingElementOrFragment(node);
+ return emitJsxOpeningElementOrFragment(node);
+ case 258:
case 261:
- return emitJsxAttribute(node);
+ return emitJsxClosingElementOrFragment(node);
case 262:
- return emitJsxAttributes(node);
+ return emitJsxAttribute(node);
case 263:
- return emitJsxSpreadAttribute(node);
+ return emitJsxAttributes(node);
case 264:
- return emitJsxExpression(node);
+ return emitJsxSpreadAttribute(node);
case 265:
- return emitCaseClause(node);
+ return emitJsxExpression(node);
case 266:
- return emitDefaultClause(node);
+ return emitCaseClause(node);
case 267:
- return emitHeritageClause(node);
+ return emitDefaultClause(node);
case 268:
- return emitCatchClause(node);
+ return emitHeritageClause(node);
case 269:
- return emitPropertyAssignment(node);
+ return emitCatchClause(node);
case 270:
- return emitShorthandPropertyAssignment(node);
+ return emitPropertyAssignment(node);
case 271:
- return emitSpreadAssignment(node);
+ return emitShorthandPropertyAssignment(node);
case 272:
+ return emitSpreadAssignment(node);
+ case 273:
return emitEnumMember(node);
}
if (ts.isExpression(node)) {
@@ -61814,69 +62150,69 @@ var ts;
case 91:
writeTokenNode(node, writeKeyword);
return;
- case 182:
- return emitArrayLiteralExpression(node);
case 183:
- return emitObjectLiteralExpression(node);
+ return emitArrayLiteralExpression(node);
case 184:
- return emitPropertyAccessExpression(node);
+ return emitObjectLiteralExpression(node);
case 185:
- return emitElementAccessExpression(node);
+ return emitPropertyAccessExpression(node);
case 186:
- return emitCallExpression(node);
+ return emitElementAccessExpression(node);
case 187:
- return emitNewExpression(node);
+ return emitCallExpression(node);
case 188:
- return emitTaggedTemplateExpression(node);
+ return emitNewExpression(node);
case 189:
- return emitTypeAssertionExpression(node);
+ return emitTaggedTemplateExpression(node);
case 190:
- return emitParenthesizedExpression(node);
+ return emitTypeAssertionExpression(node);
case 191:
- return emitFunctionExpression(node);
+ return emitParenthesizedExpression(node);
case 192:
- return emitArrowFunction(node);
+ return emitFunctionExpression(node);
case 193:
- return emitDeleteExpression(node);
+ return emitArrowFunction(node);
case 194:
- return emitTypeOfExpression(node);
+ return emitDeleteExpression(node);
case 195:
- return emitVoidExpression(node);
+ return emitTypeOfExpression(node);
case 196:
- return emitAwaitExpression(node);
+ return emitVoidExpression(node);
case 197:
- return emitPrefixUnaryExpression(node);
+ return emitAwaitExpression(node);
case 198:
- return emitPostfixUnaryExpression(node);
+ return emitPrefixUnaryExpression(node);
case 199:
- return emitBinaryExpression(node);
+ return emitPostfixUnaryExpression(node);
case 200:
- return emitConditionalExpression(node);
+ return emitBinaryExpression(node);
case 201:
- return emitTemplateExpression(node);
+ return emitConditionalExpression(node);
case 202:
- return emitYieldExpression(node);
+ return emitTemplateExpression(node);
case 203:
- return emitSpreadExpression(node);
+ return emitYieldExpression(node);
case 204:
- return emitClassExpression(node);
+ return emitSpreadExpression(node);
case 205:
+ return emitClassExpression(node);
+ case 206:
return;
- case 207:
- return emitAsExpression(node);
case 208:
- return emitNonNullExpression(node);
+ return emitAsExpression(node);
case 209:
+ return emitNonNullExpression(node);
+ case 210:
return emitMetaProperty(node);
- case 254:
- return emitJsxElement(node);
case 255:
+ return emitJsxElement(node);
+ case 256:
return emitJsxSelfClosingElement(node);
- case 258:
+ case 259:
return emitJsxFragment(node);
- case 300:
- return emitPartiallyEmittedExpression(node);
case 301:
+ return emitPartiallyEmittedExpression(node);
+ case 302:
return emitCommaList(node);
}
}
@@ -61893,7 +62229,7 @@ var ts;
}
function emitHelpers(node) {
var helpersEmitted = false;
- var bundle = node.kind === 274 ? node : undefined;
+ var bundle = node.kind === 275 ? node : undefined;
if (bundle && moduleKind === ts.ModuleKind.None) {
return;
}
@@ -61992,7 +62328,7 @@ var ts;
emit(node.dotDotDotToken);
emitNodeWithWriter(node.name, writeParameter);
emit(node.questionToken);
- if (node.parent && node.parent.kind === 283 && !node.name) {
+ if (node.parent && node.parent.kind === 284 && !node.name) {
emit(node.type);
}
else {
@@ -62050,7 +62386,7 @@ var ts;
function emitAccessorDeclaration(node) {
emitDecorators(node, node.decorators);
emitModifiers(node, node.modifiers);
- writeKeyword(node.kind === 155 ? "get" : "set");
+ writeKeyword(node.kind === 156 ? "get" : "set");
writeSpace();
emit(node.name);
emitSignatureAndBody(node, emitSignatureHead);
@@ -62298,7 +62634,7 @@ var ts;
increaseIndent();
}
var preferNewLine = node.multiLine ? 32768 : 0;
- var allowTrailingComma = currentSourceFile.languageVersion >= 1 ? 32 : 0;
+ var allowTrailingComma = currentSourceFile.languageVersion >= 1 && !ts.isJsonSourceFile(currentSourceFile) ? 32 : 0;
emitList(node, node.properties, 263122 | allowTrailingComma | preferNewLine);
if (indentedFlag) {
decreaseIndent();
@@ -62421,7 +62757,7 @@ var ts;
}
function shouldEmitWhitespaceBeforeOperand(node) {
var operand = node.operand;
- return operand.kind === 197
+ return operand.kind === 198
&& ((node.operator === 37 && (operand.operator === 37 || operand.operator === 43))
|| (node.operator === 38 && (operand.operator === 38 || operand.operator === 44)));
}
@@ -62535,7 +62871,7 @@ var ts;
if (node.elseStatement) {
writeLineOrSpace(node);
emitTokenWithComment(82, node.thenStatement.end, writeKeyword, node);
- if (node.elseStatement.kind === 216) {
+ if (node.elseStatement.kind === 217) {
writeSpace();
emit(node.elseStatement);
}
@@ -62598,7 +62934,7 @@ var ts;
emitTokenWithComment(19, openParenPos, writePunctuation, node);
emitForBinding(node.initializer);
writeSpace();
- emitTokenWithComment(144, node.initializer.end, writeKeyword, node);
+ emitTokenWithComment(145, node.initializer.end, writeKeyword, node);
writeSpace();
emitExpression(node.expression);
emitTokenWithComment(20, node.expression.end, writePunctuation, node);
@@ -62606,7 +62942,7 @@ var ts;
}
function emitForBinding(node) {
if (node !== undefined) {
- if (node.kind === 232) {
+ if (node.kind === 233) {
emit(node);
}
else {
@@ -62891,7 +63227,7 @@ var ts;
var body = node.body;
if (!body)
return writeSemicolon();
- while (body.kind === 238) {
+ while (body.kind === 239) {
writePunctuation(".");
emit(body.name);
body = body.body;
@@ -62936,7 +63272,7 @@ var ts;
if (node.importClause) {
emit(node.importClause);
writeSpace();
- emitTokenWithComment(142, node.importClause.end, writeKeyword, node);
+ emitTokenWithComment(143, node.importClause.end, writeKeyword, node);
writeSpace();
}
emitExpression(node.moduleSpecifier);
@@ -62988,7 +63324,7 @@ var ts;
if (node.moduleSpecifier) {
writeSpace();
var fromPos = node.exportClause ? node.exportClause.end : nextPos;
- emitTokenWithComment(142, fromPos, writeKeyword, node);
+ emitTokenWithComment(143, fromPos, writeKeyword, node);
writeSpace();
emitExpression(node.moduleSpecifier);
}
@@ -63185,7 +63521,7 @@ var ts;
emitSourceFileWorker(node);
}
function emitSyntheticTripleSlashReferencesIfNeeded(node) {
- emitTripleSlashDirectives(node.hasNoDefaultLib, node.syntheticFileReferences || [], node.syntheticTypeReferences || []);
+ emitTripleSlashDirectives(!!node.hasNoDefaultLib, node.syntheticFileReferences || [], node.syntheticTypeReferences || []);
}
function emitTripleSlashDirectivesIfNeeded(node) {
if (node.isDeclarationFile)
@@ -63429,7 +63765,7 @@ var ts;
if (isUndefined && format & 8192) {
return;
}
- var isEmpty = isUndefined || start >= children.length || count === 0;
+ var isEmpty = children === undefined || start >= children.length || count === 0;
if (isEmpty && format & 16384) {
if (onBeforeEmitNodeArray) {
onBeforeEmitNodeArray(children);
@@ -63470,7 +63806,7 @@ var ts;
increaseIndent();
}
var previousSibling = void 0;
- var shouldDecreaseIndentAfterEmit = void 0;
+ var shouldDecreaseIndentAfterEmit = false;
for (var i = 0; i < count; i++) {
var child = children[start + i];
if (previousSibling) {
@@ -63746,7 +64082,7 @@ var ts;
&& ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile);
}
function skipSynthesizedParentheses(node) {
- while (node.kind === 190 && ts.nodeIsSynthesized(node)) {
+ while (node.kind === 191 && ts.nodeIsSynthesized(node)) {
node = node.expression;
}
return node;
@@ -63805,81 +64141,81 @@ var ts;
if (!node)
return;
switch (node.kind) {
- case 212:
+ case 213:
ts.forEach(node.statements, generateNames);
break;
- case 227:
- case 225:
- case 217:
+ case 228:
+ case 226:
case 218:
+ case 219:
generateNames(node.statement);
break;
- case 216:
+ case 217:
generateNames(node.thenStatement);
generateNames(node.elseStatement);
break;
- case 219:
- case 221:
case 220:
+ case 222:
+ case 221:
generateNames(node.initializer);
generateNames(node.statement);
break;
- case 226:
+ case 227:
generateNames(node.caseBlock);
break;
- case 240:
+ case 241:
ts.forEach(node.clauses, generateNames);
break;
- case 265:
case 266:
+ case 267:
ts.forEach(node.statements, generateNames);
break;
- case 229:
+ case 230:
generateNames(node.tryBlock);
generateNames(node.catchClause);
generateNames(node.finallyBlock);
break;
- case 268:
+ case 269:
generateNames(node.variableDeclaration);
generateNames(node.block);
break;
- case 213:
+ case 214:
generateNames(node.declarationList);
break;
- case 232:
+ case 233:
ts.forEach(node.declarations, generateNames);
break;
- case 231:
- case 148:
- case 181:
- case 234:
+ case 232:
+ case 149:
+ case 182:
+ case 235:
generateNameIfNeeded(node.name);
break;
- case 233:
+ case 234:
generateNameIfNeeded(node.name);
if (ts.getEmitFlags(node) & 524288) {
ts.forEach(node.parameters, generateNames);
generateNames(node.body);
}
break;
- case 179:
case 180:
+ case 181:
ts.forEach(node.elements, generateNames);
break;
- case 243:
- generateNames(node.importClause);
- break;
case 244:
- generateNameIfNeeded(node.name);
- generateNames(node.namedBindings);
+ generateNames(node.importClause);
break;
case 245:
generateNameIfNeeded(node.name);
+ generateNames(node.namedBindings);
break;
case 246:
- ts.forEach(node.elements, generateNames);
+ generateNameIfNeeded(node.name);
break;
case 247:
+ ts.forEach(node.elements, generateNames);
+ break;
+ case 248:
generateNameIfNeeded(node.propertyName || node.name);
break;
}
@@ -63888,12 +64224,12 @@ var ts;
if (!node)
return;
switch (node.kind) {
- case 269:
case 270:
- case 151:
- case 153:
- case 155:
+ case 271:
+ case 152:
+ case 154:
case 156:
+ case 157:
generateNameIfNeeded(node.name);
break;
}
@@ -64027,21 +64363,21 @@ var ts;
switch (node.kind) {
case 71:
return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16), !!(flags & 8));
+ case 239:
case 238:
- case 237:
return generateNameForModuleOrEnum(node);
- case 243:
- case 249:
+ case 244:
+ case 250:
return generateNameForImportOrExportDeclaration(node);
- case 233:
case 234:
- case 248:
+ case 235:
+ case 249:
return generateNameForExportDefault();
- case 204:
+ case 205:
return generateNameForClassExpression();
- case 153:
- case 155:
+ case 154:
case 156:
+ case 157:
return generateNameForMethodOrAccessor(node);
default:
return makeTempVariableName(0);
@@ -64056,7 +64392,7 @@ var ts;
case 3:
return makeUniqueName(ts.idText(name), (name.autoGenerateFlags & 32) ? isFileLevelUniqueName : isUniqueName, !!(name.autoGenerateFlags & 16), !!(name.autoGenerateFlags & 8));
}
- ts.Debug.fail("Unsupported GeneratedIdentifierKind.");
+ return ts.Debug.fail("Unsupported GeneratedIdentifierKind.");
}
function getNodeForGeneratedName(name) {
var autoGenerateId = name.autoGenerateId;
@@ -64723,8 +65059,7 @@ var ts;
}
ts.isProgramUptoDate = isProgramUptoDate;
function getConfigFileParsingDiagnostics(configFileParseResult) {
- return configFileParseResult.options.configFile ?
- configFileParseResult.options.configFile.parseDiagnostics.concat(configFileParseResult.errors) :
+ return configFileParseResult.options.configFile ? configFileParseResult.options.configFile.parseDiagnostics.concat(configFileParseResult.errors) :
configFileParseResult.errors;
}
ts.getConfigFileParsingDiagnostics = getConfigFileParsingDiagnostics;
@@ -64752,7 +65087,7 @@ var ts;
function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {
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 host = createProgramOptions.host, oldProgram = createProgramOptions.oldProgram;
+ var oldProgram = createProgramOptions.oldProgram;
var program;
var files = [];
var commonSourceDirectory;
@@ -64769,7 +65104,7 @@ var ts;
var modulesWithElidedImports = ts.createMap();
var sourceFilesFoundSearchingNodeModules = ts.createMap();
ts.performance.mark("beforeProgram");
- host = host || createCompilerHost(options);
+ var host = createProgramOptions.host || createCompilerHost(options);
var configParsingHost = parseConfigHostFromCompilerHost(host);
var skipDefaultLib = options.noLib;
var getDefaultLibraryFileName = ts.memoize(function () { return host.getDefaultLibFileName(options); });
@@ -64876,6 +65211,7 @@ var ts;
getOptionsDiagnostics: getOptionsDiagnostics,
getGlobalDiagnostics: getGlobalDiagnostics,
getSemanticDiagnostics: getSemanticDiagnostics,
+ getSuggestionDiagnostics: getSuggestionDiagnostics,
getDeclarationDiagnostics: getDeclarationDiagnostics,
getTypeChecker: getTypeChecker,
getClassifiableNames: getClassifiableNames,
@@ -65251,7 +65587,7 @@ var ts;
return nodes;
}
function isSourceFileFromExternalLibrary(file) {
- return sourceFilesFoundSearchingNodeModules.get(file.path);
+ return !!sourceFilesFoundSearchingNodeModules.get(file.path);
}
function isSourceFileDefaultLibrary(file) {
if (file.hasNoDefaultLib) {
@@ -65265,7 +65601,7 @@ var ts;
return equalityComparer(file.fileName, getDefaultLibraryFileName());
}
else {
- return ts.forEach(options.lib, function (libFileName) { return equalityComparer(file.fileName, ts.combinePaths(defaultLibraryPath, libFileName)); });
+ return ts.some(options.lib, function (libFileName) { return equalityComparer(file.fileName, ts.combinePaths(defaultLibraryPath, libFileName)); });
}
}
function getDiagnosticsProducingTypeChecker() {
@@ -65382,11 +65718,24 @@ var ts;
var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName);
var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName);
- var diagnostics = bindDiagnostics.concat(checkDiagnostics, fileProcessingDiagnosticsInFile, programDiagnosticsInFile);
- if (isCheckJs) {
- diagnostics = ts.concatenate(diagnostics, sourceFile.jsDocDiagnostics);
+ var diagnostics;
+ for (var _i = 0, _a = [bindDiagnostics, checkDiagnostics, fileProcessingDiagnosticsInFile, programDiagnosticsInFile, isCheckJs ? sourceFile.jsDocDiagnostics : undefined]; _i < _a.length; _i++) {
+ var diags = _a[_i];
+ if (diags) {
+ for (var _b = 0, diags_1 = diags; _b < diags_1.length; _b++) {
+ var diag = diags_1[_b];
+ if (shouldReportDiagnostic(diag)) {
+ diagnostics = ts.append(diagnostics, diag);
+ }
+ }
+ }
}
- return ts.filter(diagnostics, shouldReportDiagnostic);
+ return diagnostics;
+ });
+ }
+ function getSuggestionDiagnostics(sourceFile, cancellationToken) {
+ return runWithCancellationToken(function () {
+ return getDiagnosticsProducingTypeChecker().getSuggestionDiagnostics(sourceFile, cancellationToken);
});
}
function shouldReportDiagnostic(diagnostic) {
@@ -65416,62 +65765,62 @@ var ts;
return diagnostics;
function walk(node) {
switch (parent.kind) {
- case 148:
- case 151:
+ case 149:
+ case 152:
if (parent.questionToken === node) {
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?"));
return;
}
- case 153:
- case 152:
case 154:
+ case 153:
case 155:
case 156:
- case 191:
- case 233:
+ case 157:
case 192:
- case 231:
+ case 234:
+ case 193:
+ case 232:
if (parent.type === node) {
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.types_can_only_be_used_in_a_ts_file));
return;
}
}
switch (node.kind) {
- case 242:
+ case 243:
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file));
return;
- case 248:
+ case 249:
if (node.isExportEquals) {
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file));
return;
}
break;
- case 267:
+ case 268:
var heritageClause = node;
if (heritageClause.token === 108) {
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file));
return;
}
break;
- case 235:
+ case 236:
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file));
return;
- case 238:
+ case 239:
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file));
return;
- case 236:
+ case 237:
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file));
return;
- case 237:
+ case 238:
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file));
return;
- case 208:
+ case 209:
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.non_null_assertions_can_only_be_used_in_a_ts_file));
return;
- case 207:
+ case 208:
diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file));
return;
- case 189:
+ case 190:
ts.Debug.fail();
}
var prevParent = parent;
@@ -65484,25 +65833,25 @@ 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_to_remove_this_warning));
}
switch (parent.kind) {
- case 234:
- case 153:
- case 152:
+ case 235:
case 154:
+ case 153:
case 155:
case 156:
- case 191:
- case 233:
+ case 157:
case 192:
+ case 234:
+ case 193:
if (nodes === parent.typeParameters) {
diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file));
return;
}
- case 213:
+ case 214:
if (nodes === parent.modifiers) {
- return checkModifiers(nodes, parent.kind === 213);
+ return checkModifiers(nodes, parent.kind === 214);
}
break;
- case 151:
+ case 152:
if (nodes === parent.modifiers) {
for (var _i = 0, _a = nodes; _i < _a.length; _i++) {
var modifier = _a[_i];
@@ -65513,17 +65862,17 @@ var ts;
return;
}
break;
- case 148:
+ case 149:
if (nodes === parent.modifiers) {
diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file));
return;
}
break;
- case 186:
case 187:
- case 206:
- case 255:
+ case 188:
+ case 207:
case 256:
+ case 257:
if (nodes === parent.typeArguments) {
diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file));
return;
@@ -66274,9 +66623,9 @@ var ts;
if (ts.isObjectLiteralExpression(pathProp.initializer)) {
for (var _a = 0, _b = ts.getPropertyAssignment(pathProp.initializer, key); _a < _b.length; _a++) {
var keyProps = _b[_a];
- if (ts.isArrayLiteralExpression(keyProps.initializer) &&
- keyProps.initializer.elements.length > valueIndex) {
- programDiagnostics.add(ts.createDiagnosticForNodeInSourceFile(options.configFile, keyProps.initializer.elements[valueIndex], message, arg0, arg1, arg2));
+ var initializer = keyProps.initializer;
+ if (ts.isArrayLiteralExpression(initializer) && initializer.elements.length > valueIndex) {
+ programDiagnostics.add(ts.createDiagnosticForNodeInSourceFile(options.configFile, initializer.elements[valueIndex], message, arg0, arg1, arg2));
needCompilerDiagnostic = false;
}
}
@@ -66378,6 +66727,7 @@ var ts;
return false;
}
programDiagnostics.add(ts.createDiagnosticForNodeInSourceFile(options.configFile, arrayLiteral.elements[index], message, arg0, arg1, arg2));
+ return false;
}
function blockEmittingOfFile(emitFileName, diag) {
hasEmitBlockingDiagnostics.set(toPath(emitFileName), true);
@@ -66395,13 +66745,16 @@ var ts;
if (out) {
return isSameFile(filePath, out) || isSameFile(filePath, ts.removeFileExtension(out) + ".d.ts");
}
+ if (options.declarationDir && ts.containsPath(options.declarationDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames())) {
+ return true;
+ }
if (options.outDir) {
return ts.containsPath(options.outDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames());
}
if (ts.fileExtensionIsOneOf(filePath, ts.supportedJavascriptExtensions) || ts.fileExtensionIs(filePath, ".d.ts")) {
var filePathWithoutExtension = ts.removeFileExtension(filePath);
- return !!getSourceFileByPath(ts.combinePaths(filePathWithoutExtension, ".ts")) ||
- !!getSourceFileByPath(ts.combinePaths(filePathWithoutExtension, ".tsx"));
+ return !!getSourceFileByPath((filePathWithoutExtension + ".ts")) ||
+ !!getSourceFileByPath((filePathWithoutExtension + ".tsx"));
}
return false;
}
@@ -66529,7 +66882,7 @@ var ts;
for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) {
var sourceFile = _a[_i];
var version_1 = sourceFile.version;
- var oldInfo = useOldState && oldState.fileInfos.get(sourceFile.path);
+ var oldInfo = useOldState ? oldState.fileInfos.get(sourceFile.path) : undefined;
if (referencedMap) {
var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName);
if (newReferences) {
@@ -66576,7 +66929,8 @@ var ts;
return false;
}
var info = state.fileInfos.get(sourceFile.path);
- ts.Debug.assert(!!info);
+ if (!info)
+ return ts.Debug.fail();
var prevSignature = info.signature;
var latestSignature;
if (sourceFile.isDeclarationFile) {
@@ -66701,7 +67055,7 @@ var ts;
var ts;
(function (ts) {
function hasSameKeys(map1, map2) {
- return map1 === map2 || map1 && map2 && map1.size === map2.size && !ts.forEachKey(map1, function (key) { return !map2.has(key); });
+ return map1 === map2 || map1 !== undefined && map2 !== undefined && map1.size === map2.size && !ts.forEachKey(map1, function (key) { return !map2.has(key); });
}
function createBuilderProgramState(newProgram, getCanonicalFileName, oldState) {
var state = ts.BuilderState.create(newProgram, getCanonicalFileName, oldState);
@@ -66723,7 +67077,7 @@ var ts;
ts.copyEntries(oldState.changedFilesSet, state.changedFilesSet);
}
var referencedMap = state.referencedMap;
- var oldReferencedMap = useOldState && oldState.referencedMap;
+ var oldReferencedMap = useOldState ? oldState.referencedMap : undefined;
state.fileInfos.forEach(function (info, sourceFilePath) {
var oldInfo;
var newReferences;
@@ -66889,7 +67243,7 @@ var ts;
assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile);
if (!targetSourceFile) {
var sourceMaps = [];
- var emitSkipped = void 0;
+ var emitSkipped = false;
var diagnostics = void 0;
var emittedFiles = [];
var affectedEmitResult = void 0;
@@ -67000,7 +67354,7 @@ var ts;
var customFailedLookupPaths = ts.createMap();
var directoryWatchesOfFailedLookups = ts.createMap();
var rootDir = rootDirForResolution && ts.removeTrailingDirectorySeparator(ts.getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory()));
- var rootPath = rootDir && resolutionHost.toPath(rootDir);
+ var rootPath = (rootDir && resolutionHost.toPath(rootDir));
var typeRootsWatches = ts.createMap();
return {
startRecordingFilesWithChangedResolutions: startRecordingFilesWithChangedResolutions,
@@ -67052,7 +67406,7 @@ var ts;
return false;
}
var value = filesWithInvalidatedNonRelativeUnresolvedImports.get(path);
- return value && !!value.length;
+ return !!value && !!value.length;
}
function createHasInvalidatedResolution(forceAllFilesAsInvalidated) {
if (allFilesHaveInvalidatedResolution || forceAllFilesAsInvalidated) {
@@ -67061,7 +67415,7 @@ var ts;
}
var collected = filesWithInvalidatedResolutions;
filesWithInvalidatedResolutions = undefined;
- return function (path) { return (collected && collected.has(path)) ||
+ return function (path) { return (!!collected && collected.has(path)) ||
isFileWithInvalidatedNonRelativeUnresolvedImports(path); };
}
function clearPerDirectoryResolutions() {
@@ -67209,19 +67563,20 @@ var ts;
if (isNodeModulesDirectory(dirPath)) {
return filterFSRootDirectoriesToWatch({ dir: dir, dirPath: dirPath }, ts.getDirectoryPath(dirPath));
}
- var subDirectory;
+ var subDirectoryPath, subDirectory;
if (rootPath !== undefined) {
while (!isInDirectoryPath(dirPath, rootPath)) {
var parentPath = ts.getDirectoryPath(dirPath);
if (parentPath === dirPath) {
break;
}
- subDirectory = dirPath.slice(parentPath.length + ts.directorySeparator.length);
+ subDirectoryPath = dirPath;
+ subDirectory = dir;
dirPath = parentPath;
dir = ts.getDirectoryPath(dir);
}
}
- return filterFSRootDirectoriesToWatch({ dir: dir, dirPath: dirPath, subDirectory: subDirectory }, dirPath);
+ return filterFSRootDirectoriesToWatch({ dir: subDirectory || dir, dirPath: subDirectoryPath || dirPath }, dirPath);
}
function isPathWithDefaultFailedLookupExtension(path) {
return ts.fileExtensionIsOneOf(path, failedLookupDefaultExtensions);
@@ -67240,7 +67595,7 @@ var ts;
for (var _i = 0, failedLookupLocations_1 = failedLookupLocations; _i < failedLookupLocations_1.length; _i++) {
var failedLookupLocation = failedLookupLocations_1[_i];
var failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
- var _a = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dir = _a.dir, dirPath = _a.dirPath, ignore = _a.ignore, subDirectory = _a.subDirectory;
+ var _a = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dir = _a.dir, dirPath = _a.dirPath, ignore = _a.ignore;
if (!ignore) {
if (!isPathWithDefaultFailedLookupExtension(failedLookupLocationPath)) {
var refCount = customFailedLookupPaths.get(failedLookupLocationPath) || 0;
@@ -67250,7 +67605,7 @@ var ts;
setAtRoot = true;
}
else {
- setDirectoryWatcher(dir, dirPath, subDirectory);
+ setDirectoryWatcher(dir, dirPath);
}
}
}
@@ -67258,19 +67613,13 @@ var ts;
setDirectoryWatcher(rootDir, rootPath);
}
}
- function setDirectoryWatcher(dir, dirPath, subDirectory) {
+ function setDirectoryWatcher(dir, dirPath) {
var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
if (dirWatcher) {
dirWatcher.refCount++;
}
else {
- dirWatcher = { watcher: createDirectoryWatcher(dir, dirPath), refCount: 1 };
- directoryWatchesOfFailedLookups.set(dirPath, dirWatcher);
- }
- if (subDirectory) {
- var subDirectoryMap = dirWatcher.subDirectoryMap || (dirWatcher.subDirectoryMap = ts.createMap());
- var existing = subDirectoryMap.get(subDirectory) || 0;
- subDirectoryMap.set(subDirectory, existing + 1);
+ directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath), refCount: 1 });
}
}
function stopWatchFailedLookupLocationOfResolution(resolution) {
@@ -67286,7 +67635,7 @@ var ts;
for (var _i = 0, failedLookupLocations_2 = failedLookupLocations; _i < failedLookupLocations_2.length; _i++) {
var failedLookupLocation = failedLookupLocations_2[_i];
var failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
- var _a = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dirPath = _a.dirPath, ignore = _a.ignore, subDirectory = _a.subDirectory;
+ var _a = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dirPath = _a.dirPath, ignore = _a.ignore;
if (!ignore) {
var refCount = customFailedLookupPaths.get(failedLookupLocationPath);
if (refCount) {
@@ -67302,7 +67651,7 @@ var ts;
removeAtRoot = true;
}
else {
- removeDirectoryWatcher(dirPath, subDirectory);
+ removeDirectoryWatcher(dirPath);
}
}
}
@@ -67310,39 +67659,18 @@ var ts;
removeDirectoryWatcher(rootPath);
}
}
- function removeDirectoryWatcher(dirPath, subDirectory) {
+ function removeDirectoryWatcher(dirPath) {
var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
- if (subDirectory) {
- var existing = dirWatcher.subDirectoryMap.get(subDirectory);
- if (existing === 1) {
- dirWatcher.subDirectoryMap.delete(subDirectory);
- }
- else {
- dirWatcher.subDirectoryMap.set(subDirectory, existing - 1);
- }
- }
dirWatcher.refCount--;
}
- function inWatchedSubdirectory(dirPath, fileOrDirectoryPath) {
- var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
- if (!dirWatcher || !dirWatcher.subDirectoryMap)
- return false;
- return ts.forEachKey(dirWatcher.subDirectoryMap, function (subDirectory) {
- var fullSubDirectory = dirPath + "/" + subDirectory;
- return fullSubDirectory === fileOrDirectoryPath || isInDirectoryPath(fullSubDirectory, fileOrDirectoryPath);
- });
- }
function createDirectoryWatcher(directory, dirPath) {
return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, function (fileOrDirectory) {
var fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory);
if (cachedDirectoryStructureHost) {
cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
}
- if (!allFilesHaveInvalidatedResolution &&
- (dirPath === rootPath || isNodeModulesDirectory(dirPath) || ts.getDirectoryPath(fileOrDirectoryPath) === dirPath || inWatchedSubdirectory(dirPath, fileOrDirectoryPath))) {
- if (invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) {
- resolutionHost.onInvalidatedResolution();
- }
+ if (!allFilesHaveInvalidatedResolution && invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) {
+ resolutionHost.onInvalidatedResolution();
}
}, 1);
}
@@ -67394,7 +67722,7 @@ var ts;
removeResolutionsOfFile(filePath);
invalidateResolutions(function (resolution, getResolutionWithResolvedFileName) {
var result = getResolutionWithResolvedFileName(resolution);
- return result && resolutionHost.toPath(result.resolvedFileName) === filePath;
+ return !!result && resolutionHost.toPath(result.resolvedFileName) === filePath;
});
}
function setFilesWithInvalidatedNonRelativeUnresolvedImports(filesMap) {
@@ -67441,7 +67769,7 @@ var ts;
return rootPath;
}
var _a = getDirectoryToWatchFromFailedLookupLocationDirectory(typeRoot, typeRootPath), dirPath = _a.dirPath, ignore = _a.ignore;
- return !ignore && directoryWatchesOfFailedLookups.has(dirPath) && dirPath;
+ return !ignore && directoryWatchesOfFailedLookups.has(dirPath) ? dirPath : undefined;
}
function createTypeRootsWatch(typeRootPath, typeRoot) {
return resolutionHost.watchTypeRootsDirectory(typeRoot, function (fileOrDirectory) {
@@ -67663,9 +67991,9 @@ var ts;
system.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped);
}
function createWatchCompilerHostOfConfigFile(configFileName, optionsToExtend, system, createProgram, reportDiagnostic, reportWatchStatus) {
- reportDiagnostic = reportDiagnostic || createDiagnosticReporter(system);
- var host = createWatchCompilerHost(system, createProgram, reportDiagnostic, reportWatchStatus);
- host.onUnRecoverableConfigFileDiagnostic = function (diagnostic) { return reportUnrecoverableDiagnostic(system, reportDiagnostic, diagnostic); };
+ var diagnosticReporter = reportDiagnostic || createDiagnosticReporter(system);
+ var host = createWatchCompilerHost(system, createProgram, diagnosticReporter, reportWatchStatus);
+ host.onUnRecoverableConfigFileDiagnostic = function (diagnostic) { return reportUnrecoverableDiagnostic(system, diagnosticReporter, diagnostic); };
host.configFileName = configFileName;
host.optionsToExtend = optionsToExtend;
return host;
@@ -67709,7 +68037,7 @@ var ts;
var configFileSpecs;
var configFileParsingDiagnostics;
var hasChangedConfigFileParsingErrors = false;
- var cachedDirectoryStructureHost = configFileName && ts.createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames);
+ var cachedDirectoryStructureHost = configFileName === undefined ? undefined : ts.createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames);
if (cachedDirectoryStructureHost && host.onCachedDirectoryStructureHostCreate) {
host.onCachedDirectoryStructureHostCreate(cachedDirectoryStructureHost);
}
@@ -67759,7 +68087,7 @@ var ts;
readFile: readFile,
trace: trace,
directoryExists: directoryStructureHost.directoryExists && (function (path) { return directoryStructureHost.directoryExists(path); }),
- getDirectories: directoryStructureHost.getDirectories && (function (path) { return directoryStructureHost.getDirectories(path); }),
+ getDirectories: (directoryStructureHost.getDirectories && (function (path) { return directoryStructureHost.getDirectories(path); })),
realpath: host.realpath && (function (s) { return host.realpath(s); }),
getEnvironmentVariable: host.getEnvironmentVariable ? (function (name) { return host.getEnvironmentVariable(name); }) : (function () { return ""; }),
onReleaseOldSourceFile: onReleaseOldSourceFile,
@@ -68246,6 +68574,7 @@ var ts;
"es2018.promise": "lib.es2018.promise.d.ts",
"es2018.regexp": "lib.es2018.regexp.d.ts",
"esnext.array": "lib.esnext.array.d.ts",
+ "esnext.symbol": "lib.esnext.symbol.d.ts",
"esnext.asynciterable": "lib.esnext.asynciterable.d.ts",
}),
},
@@ -68869,7 +69198,7 @@ var ts;
case "string":
return ts.map(values, function (v) { return v || ""; });
default:
- return ts.filter(ts.map(values, function (v) { return parseCustomTypeOption(opt.element, v, errors); }), function (v) { return !!v; });
+ return ts.mapDefined(values, function (v) { return parseCustomTypeOption(opt.element, v, errors); });
}
}
ts.parseListTypeOption = parseListTypeOption;
@@ -68990,6 +69319,7 @@ var ts;
}
return optionNameMap.get(optionName);
}
+ ts.getOptionFromName = getOptionFromName;
function getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host) {
var configFileText;
try {
@@ -69124,7 +69454,7 @@ var ts;
var result = returnValue ? {} : undefined;
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var element = _a[_i];
- if (element.kind !== 269) {
+ if (element.kind !== 270) {
errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected));
continue;
}
@@ -69195,13 +69525,13 @@ var ts;
case 8:
reportInvalidOptionValue(option && option.type !== "number");
return Number(valueExpression.text);
- case 197:
+ case 198:
if (valueExpression.operator !== 38 || valueExpression.operand.kind !== 8) {
break;
}
reportInvalidOptionValue(option && option.type !== "number");
return -Number(valueExpression.operand.text);
- case 183:
+ case 184:
reportInvalidOptionValue(option && option.type !== "object");
var objectLiteralExpression = valueExpression;
if (option) {
@@ -69211,7 +69541,7 @@ var ts;
else {
return convertObjectLiteralExpressionToJson(objectLiteralExpression, undefined, undefined, undefined);
}
- case 182:
+ case 183:
reportInvalidOptionValue(option && option.type !== "list");
return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element);
}
@@ -69248,6 +69578,7 @@ var ts;
var expectedType = ts.isString(option.type) ? option.type : "string";
return typeof value === expectedType;
}
+ return false;
}
function generateTSConfig(options, fileNames, newLine) {
var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions);
@@ -69669,13 +70000,10 @@ var ts;
}
function convertCompileOnSaveOptionFromJson(jsonOption, basePath, errors) {
if (!ts.hasProperty(jsonOption, ts.compileOnSaveCommandLineOption.name)) {
- return undefined;
+ return false;
}
var result = convertJsonOption(ts.compileOnSaveCommandLineOption, jsonOption.compileOnSave, basePath, errors);
- if (typeof result === "boolean" && result) {
- return result;
- }
- return false;
+ return typeof result === "boolean" && result;
}
function convertCompilerOptionsFromJson(jsonOptions, basePath, configFileName) {
var errors = [];
@@ -69704,7 +70032,7 @@ var ts;
return options;
}
function getDefaultTypeAcquisition(configFileName) {
- return { enable: configFileName && ts.getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] };
+ return { enable: !!configFileName && ts.getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] };
}
function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) {
var options = getDefaultTypeAcquisition(configFileName);
@@ -70193,35 +70521,35 @@ var ts;
})(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {}));
function getMeaningFromDeclaration(node) {
switch (node.kind) {
- case 148:
- case 231:
- case 181:
- case 151:
- case 150:
- case 269:
- case 270:
- case 153:
+ case 149:
+ case 232:
+ case 182:
case 152:
+ case 151:
+ case 270:
+ case 271:
case 154:
+ case 153:
case 155:
case 156:
- case 233:
- case 191:
- case 192:
- case 268:
- case 261:
- return 1;
- case 147:
- case 235:
- case 236:
- case 165:
- return 2;
- case 296:
- return node.name === undefined ? 1 | 2 : 2;
- case 272:
+ case 157:
case 234:
+ case 192:
+ case 193:
+ case 269:
+ case 262:
+ return 1;
+ case 148:
+ case 236:
+ case 237:
+ case 166:
+ return 2;
+ case 297:
+ return node.name === undefined ? 1 | 2 : 2;
+ case 273:
+ case 235:
return 1 | 2;
- case 238:
+ case 239:
if (ts.isAmbientModule(node)) {
return 4 | 1;
}
@@ -70231,25 +70559,25 @@ var ts;
else {
return 4;
}
- case 237:
- case 246:
+ case 238:
case 247:
- case 242:
- case 243:
case 248:
+ case 243:
+ case 244:
case 249:
+ case 250:
return 7;
- case 273:
+ case 274:
return 4 | 1;
}
return 7;
}
ts.getMeaningFromDeclaration = getMeaningFromDeclaration;
function getMeaningFromLocation(node) {
- if (node.kind === 273) {
+ if (node.kind === 274) {
return 1;
}
- else if (node.parent.kind === 248) {
+ else if (node.parent.kind === 249) {
return 7;
}
else if (isInRightSideOfInternalImportEqualsDeclaration(node)) {
@@ -70277,11 +70605,11 @@ var ts;
}
ts.getMeaningFromLocation = getMeaningFromLocation;
function getMeaningFromRightHandSideOfImportEquals(node) {
- var name = node.kind === 145 ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined;
- return name && name.parent.kind === 242 ? 7 : 4;
+ var name = node.kind === 146 ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined;
+ return name && name.parent.kind === 243 ? 7 : 4;
}
function isInRightSideOfInternalImportEqualsDeclaration(node) {
- while (node.parent.kind === 145) {
+ while (node.parent.kind === 146) {
node = node.parent;
}
return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node;
@@ -70293,27 +70621,27 @@ var ts;
function isQualifiedNameNamespaceReference(node) {
var root = node;
var isLastClause = true;
- if (root.parent.kind === 145) {
- while (root.parent && root.parent.kind === 145) {
+ if (root.parent.kind === 146) {
+ while (root.parent && root.parent.kind === 146) {
root = root.parent;
}
isLastClause = root.right === node;
}
- return root.parent.kind === 161 && !isLastClause;
+ return root.parent.kind === 162 && !isLastClause;
}
function isPropertyAccessNamespaceReference(node) {
var root = node;
var isLastClause = true;
- if (root.parent.kind === 184) {
- while (root.parent && root.parent.kind === 184) {
+ if (root.parent.kind === 185) {
+ while (root.parent && root.parent.kind === 185) {
root = root.parent;
}
isLastClause = root.name === node;
}
- if (!isLastClause && root.parent.kind === 206 && root.parent.parent.kind === 267) {
+ if (!isLastClause && root.parent.kind === 207 && root.parent.parent.kind === 268) {
var decl = root.parent.parent.parent;
- return (decl.kind === 234 && root.parent.parent.token === 108) ||
- (decl.kind === 235 && root.parent.parent.token === 85);
+ return (decl.kind === 235 && root.parent.parent.token === 108) ||
+ (decl.kind === 236 && root.parent.parent.token === 85);
}
return false;
}
@@ -70324,30 +70652,30 @@ var ts;
switch (node.kind) {
case 99:
return !ts.isExpressionNode(node);
- case 173:
+ case 174:
return true;
}
switch (node.parent.kind) {
- case 161:
+ case 162:
return true;
- case 178:
+ case 179:
return !node.parent.isTypeOf;
- case 206:
+ case 207:
return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent);
}
return false;
}
function isCallExpressionTarget(node) {
- return isCallOrNewExpressionTarget(node, 186);
+ return isCallOrNewExpressionTarget(node, 187);
}
ts.isCallExpressionTarget = isCallExpressionTarget;
function isNewExpressionTarget(node) {
- return isCallOrNewExpressionTarget(node, 187);
+ return isCallOrNewExpressionTarget(node, 188);
}
ts.isNewExpressionTarget = isNewExpressionTarget;
function isCallOrNewExpressionTarget(node, kind) {
var target = climbPastPropertyAccess(node);
- return target && target.parent && target.parent.kind === kind && target.parent.expression === target;
+ return !!target && !!target.parent && target.parent.kind === kind && target.parent.expression === target;
}
function climbPastPropertyAccess(node) {
return isRightSideOfPropertyAccess(node) ? node.parent : node;
@@ -70355,7 +70683,7 @@ var ts;
ts.climbPastPropertyAccess = climbPastPropertyAccess;
function getTargetLabel(referenceNode, labelName) {
while (referenceNode) {
- if (referenceNode.kind === 227 && referenceNode.label.escapedText === labelName) {
+ if (referenceNode.kind === 228 && referenceNode.label.escapedText === labelName) {
return referenceNode.label;
}
referenceNode = referenceNode.parent;
@@ -70376,15 +70704,15 @@ var ts;
}
ts.isLabelName = isLabelName;
function isRightSideOfQualifiedName(node) {
- return node.parent.kind === 145 && node.parent.right === node;
+ return node.parent.kind === 146 && node.parent.right === node;
}
ts.isRightSideOfQualifiedName = isRightSideOfQualifiedName;
function isRightSideOfPropertyAccess(node) {
- return node && node.parent && node.parent.kind === 184 && node.parent.name === node;
+ return node && node.parent && node.parent.kind === 185 && node.parent.name === node;
}
ts.isRightSideOfPropertyAccess = isRightSideOfPropertyAccess;
function isNameOfModuleDeclaration(node) {
- return node.parent.kind === 238 && node.parent.name === node;
+ return node.parent.kind === 239 && node.parent.name === node;
}
ts.isNameOfModuleDeclaration = isNameOfModuleDeclaration;
function isNameOfFunctionDeclaration(node) {
@@ -70394,22 +70722,24 @@ var ts;
ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration;
function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) {
switch (node.parent.kind) {
- case 151:
- case 150:
- case 269:
- case 272:
- case 153:
case 152:
- case 155:
+ case 151:
+ case 270:
+ case 273:
+ case 154:
+ case 153:
case 156:
- case 238:
+ case 157:
+ case 239:
return ts.getNameOfDeclaration(node.parent) === node;
- case 185:
+ case 186:
return node.parent.argumentExpression === node;
- case 146:
+ case 147:
return true;
- case 177:
- return node.parent.parent.kind === 175;
+ case 178:
+ return node.parent.parent.kind === 176;
+ default:
+ return false;
}
}
ts.isLiteralNameOfPropertyDeclarationOrIndexAccess = isLiteralNameOfPropertyDeclarationOrIndexAccess;
@@ -70428,17 +70758,17 @@ var ts;
return undefined;
}
switch (node.kind) {
- case 273:
+ case 274:
+ case 154:
case 153:
- case 152:
- case 233:
- case 191:
- case 155:
- case 156:
case 234:
+ case 192:
+ case 156:
+ case 157:
case 235:
- case 237:
+ case 236:
case 238:
+ case 239:
return node;
}
}
@@ -70446,49 +70776,49 @@ var ts;
ts.getContainerNode = getContainerNode;
function getNodeKind(node) {
switch (node.kind) {
- case 273:
+ case 274:
return ts.isExternalModule(node) ? "module" : "script";
- case 238:
+ case 239:
return "module";
- case 234:
- case 204:
+ case 235:
+ case 205:
return "class";
- case 235: return "interface";
- case 236:
- case 291:
- case 296:
+ case 236: return "interface";
+ case 237:
+ case 292:
+ case 297:
return "type";
- case 237: return "enum";
- case 231:
+ case 238: return "enum";
+ case 232:
return getKindOfVariableDeclaration(node);
- case 181:
+ case 182:
return getKindOfVariableDeclaration(ts.getRootDeclaration(node));
+ case 193:
+ case 234:
case 192:
- case 233:
- case 191:
return "function";
- case 155: return "getter";
- case 156: return "setter";
+ case 156: return "getter";
+ case 157: return "setter";
+ case 154:
case 153:
- case 152:
return "method";
+ case 152:
case 151:
- case 150:
return "property";
- case 159: return "index";
- case 158: return "construct";
- case 157: return "call";
- case 154: return "constructor";
- case 147: return "type parameter";
- case 272: return "enum member";
- case 148: return ts.hasModifier(node, 92) ? "property" : "parameter";
- case 242:
- case 247:
- case 244:
- case 251:
+ case 160: return "index";
+ case 159: return "construct";
+ case 158: return "call";
+ case 155: return "constructor";
+ case 148: return "type parameter";
+ case 273: return "enum member";
+ case 149: return ts.hasModifier(node, 92) ? "property" : "parameter";
+ case 243:
+ case 248:
case 245:
+ case 252:
+ case 246:
return "alias";
- case 199:
+ case 200:
var kind = ts.getSpecialPropertyAssignmentKind(node);
var right = node.right;
switch (kind) {
@@ -70528,7 +70858,7 @@ var ts;
case 99:
return true;
case 71:
- return ts.identifierIsThisKeyword(node) && node.parent.kind === 148;
+ return ts.identifierIsThisKeyword(node) && node.parent.kind === 149;
default:
return false;
}
@@ -70549,6 +70879,10 @@ var ts;
return r.pos <= pos && pos <= r.end;
}
ts.rangeContainsPosition = rangeContainsPosition;
+ function rangeContainsPositionExclusive(r, pos) {
+ return r.pos < pos && pos < r.end;
+ }
+ ts.rangeContainsPositionExclusive = rangeContainsPositionExclusive;
function startEndContainsRange(start, end, range) {
return start <= range.pos && end >= range.end;
}
@@ -70573,45 +70907,45 @@ var ts;
}
ts.positionBelongsToNode = positionBelongsToNode;
function isCompletedNode(n, sourceFile) {
- if (ts.nodeIsMissing(n)) {
+ if (n === undefined || ts.nodeIsMissing(n)) {
return false;
}
switch (n.kind) {
- case 234:
case 235:
- case 237:
- case 183:
- case 179:
- case 165:
- case 212:
- case 239:
+ case 236:
+ case 238:
+ case 184:
+ case 180:
+ case 166:
+ case 213:
case 240:
- case 246:
- case 250:
+ case 241:
+ case 247:
+ case 251:
return nodeEndsWith(n, 18, sourceFile);
- case 268:
+ case 269:
return isCompletedNode(n.block, sourceFile);
- case 187:
+ case 188:
if (!n.arguments) {
return true;
}
- case 186:
- case 190:
- case 172:
+ case 187:
+ case 191:
+ case 173:
return nodeEndsWith(n, 20, sourceFile);
- case 162:
case 163:
+ case 164:
return isCompletedNode(n.type, sourceFile);
- case 154:
case 155:
case 156:
- case 233:
- case 191:
- case 153:
- case 152:
- case 158:
case 157:
+ case 234:
case 192:
+ case 154:
+ case 153:
+ case 159:
+ case 158:
+ case 193:
if (n.body) {
return isCompletedNode(n.body, sourceFile);
}
@@ -70619,63 +70953,63 @@ var ts;
return isCompletedNode(n.type, sourceFile);
}
return hasChildOfKind(n, 20, sourceFile);
- case 238:
- return n.body && isCompletedNode(n.body, sourceFile);
- case 216:
+ case 239:
+ return !!n.body && isCompletedNode(n.body, sourceFile);
+ case 217:
if (n.elseStatement) {
return isCompletedNode(n.elseStatement, sourceFile);
}
return isCompletedNode(n.thenStatement, sourceFile);
- case 215:
+ case 216:
return isCompletedNode(n.expression, sourceFile) ||
hasChildOfKind(n, 25, sourceFile);
- case 182:
- case 180:
- case 185:
- case 146:
- case 167:
+ case 183:
+ case 181:
+ case 186:
+ case 147:
+ case 168:
return nodeEndsWith(n, 22, sourceFile);
- case 159:
+ case 160:
if (n.type) {
return isCompletedNode(n.type, sourceFile);
}
return hasChildOfKind(n, 22, sourceFile);
- case 265:
case 266:
+ case 267:
return false;
- case 219:
case 220:
case 221:
- case 218:
+ case 222:
+ case 219:
return isCompletedNode(n.statement, sourceFile);
- case 217:
+ case 218:
return hasChildOfKind(n, 106, sourceFile)
? nodeEndsWith(n, 20, sourceFile)
: isCompletedNode(n.statement, sourceFile);
- case 164:
+ case 165:
return isCompletedNode(n.exprName, sourceFile);
- case 194:
- case 193:
case 195:
- case 202:
+ case 194:
+ case 196:
case 203:
+ case 204:
var unaryWordExpression = n;
return isCompletedNode(unaryWordExpression.expression, sourceFile);
- case 188:
+ case 189:
return isCompletedNode(n.template, sourceFile);
- case 201:
+ case 202:
var lastSpan = ts.lastOrUndefined(n.templateSpans);
return isCompletedNode(lastSpan, sourceFile);
- case 210:
+ case 211:
return ts.nodeIsPresent(n.literal);
- case 249:
- case 243:
+ case 250:
+ case 244:
return ts.nodeIsPresent(n.moduleSpecifier);
- case 197:
+ case 198:
return isCompletedNode(n.operand, sourceFile);
- case 199:
- return isCompletedNode(n.right, sourceFile);
case 200:
+ return isCompletedNode(n.right, sourceFile);
+ case 201:
return isCompletedNode(n.whenFalse, sourceFile);
default:
return true;
@@ -70684,11 +71018,11 @@ var ts;
function nodeEndsWith(n, expectedLastToken, sourceFile) {
var children = n.getChildren(sourceFile);
if (children.length) {
- var last_2 = ts.lastOrUndefined(children);
- if (last_2.kind === expectedLastToken) {
+ var lastChild = ts.last(children);
+ if (lastChild.kind === expectedLastToken) {
return true;
}
- else if (last_2.kind === 25 && children.length !== 1) {
+ else if (lastChild.kind === 25 && children.length !== 1) {
return children[children.length - 2].kind === expectedLastToken;
}
}
@@ -70730,6 +71064,7 @@ var ts;
}
ts.getTouchingToken = getTouchingToken;
function getTokenAtPosition(sourceFile, position, includeJsDocComment, includeEndPosition) {
+ if (includeEndPosition === void 0) { includeEndPosition = false; }
return getTokenAtPositionWorker(sourceFile, position, true, undefined, includeEndPosition, includeJsDocComment);
}
ts.getTokenAtPosition = getTokenAtPosition;
@@ -70815,7 +71150,7 @@ var ts;
}
}
}
- ts.Debug.assert(startNode !== undefined || n.kind === 273 || ts.isJSDocCommentContainingNode(n));
+ ts.Debug.assert(startNode !== undefined || n.kind === 274 || ts.isJSDocCommentContainingNode(n));
if (children.length) {
var candidate = findRightmostChildNodeWithTokens(children, children.length, sourceFile);
return candidate && findRightmostToken(candidate, sourceFile);
@@ -70848,7 +71183,7 @@ var ts;
function isInString(sourceFile, position, previousToken) {
if (previousToken === void 0) { previousToken = findPrecedingToken(position, sourceFile); }
if (previousToken && ts.isStringTextContainingNode(previousToken)) {
- var start = previousToken.getStart();
+ var start = previousToken.getStart(sourceFile);
var end = previousToken.getEnd();
if (start < position && position < end) {
return true;
@@ -70871,13 +71206,13 @@ var ts;
if (token.kind === 27 && token.parent.kind === 10) {
return true;
}
- if (token.kind === 27 && token.parent.kind === 264) {
+ if (token.kind === 27 && token.parent.kind === 265) {
return true;
}
- if (token && token.kind === 18 && token.parent.kind === 264) {
+ if (token && token.kind === 18 && token.parent.kind === 265) {
return true;
}
- if (token.kind === 27 && token.parent.kind === 257) {
+ if (token.kind === 27 && token.parent.kind === 258) {
return true;
}
return false;
@@ -70895,10 +71230,11 @@ var ts;
var tokenKind = token.kind;
var remainingMatchingTokens = 0;
while (true) {
- token = findPrecedingToken(token.getFullStart(), sourceFile);
- if (!token) {
+ var preceding = findPrecedingToken(token.getFullStart(), sourceFile);
+ if (!preceding) {
return undefined;
}
+ token = preceding;
if (token.kind === matchingTokenKind) {
if (remainingMatchingTokens === 0) {
return token;
@@ -70911,15 +71247,18 @@ var ts;
}
}
ts.findPrecedingMatchingToken = findPrecedingMatchingToken;
- function isPossiblyTypeArgumentPosition(token, sourceFile) {
+ function isPossiblyTypeArgumentPosition(tokenIn, sourceFile) {
+ var token = tokenIn;
var remainingLessThanTokens = 0;
+ var nTypeArguments = 0;
while (token) {
switch (token.kind) {
case 27:
token = findPrecedingToken(token.getFullStart(), sourceFile);
- var tokenIsIdentifier = token && ts.isIdentifier(token);
- if (!remainingLessThanTokens || !tokenIsIdentifier) {
- return tokenIsIdentifier;
+ if (!token || !ts.isIdentifier(token))
+ return undefined;
+ if (!remainingLessThanTokens) {
+ return { called: token, nTypeArguments: nTypeArguments };
}
remainingLessThanTokens--;
break;
@@ -70935,19 +71274,21 @@ var ts;
case 18:
token = findPrecedingMatchingToken(token, 17, sourceFile);
if (!token)
- return false;
+ return undefined;
break;
case 20:
token = findPrecedingMatchingToken(token, 19, sourceFile);
if (!token)
- return false;
+ return undefined;
break;
case 22:
token = findPrecedingMatchingToken(token, 21, sourceFile);
if (!token)
- return false;
+ return undefined;
break;
case 26:
+ nTypeArguments++;
+ break;
case 36:
case 71:
case 9:
@@ -70966,11 +71307,11 @@ var ts;
if (ts.isTypeNode(token)) {
break;
}
- return false;
+ return undefined;
}
token = findPrecedingToken(token.getFullStart(), sourceFile);
}
- return false;
+ return undefined;
}
ts.isPossiblyTypeArgumentPosition = isPossiblyTypeArgumentPosition;
function isInComment(sourceFile, position, tokenAtPosition, predicate) {
@@ -71011,10 +71352,10 @@ var ts;
}
ts.getNodeModifiers = getNodeModifiers;
function getTypeArgumentOrTypeParameterList(node) {
- if (node.kind === 161 || node.kind === 186) {
+ if (node.kind === 162 || node.kind === 187) {
return node.typeArguments;
}
- if (ts.isFunctionLike(node) || node.kind === 234 || node.kind === 235) {
+ if (ts.isFunctionLike(node) || node.kind === 235 || node.kind === 236) {
return node.typeParameters;
}
return undefined;
@@ -71037,9 +71378,9 @@ var ts;
return 17 <= kind && kind <= 70;
}
ts.isPunctuation = isPunctuation;
- function isInsideTemplateLiteral(node, position) {
+ function isInsideTemplateLiteral(node, position, sourceFile) {
return ts.isTemplateLiteralKind(node.kind)
- && (node.getStart() < position && position < node.getEnd()) || (!!node.isUnterminated && position === node.getEnd());
+ && (node.getStart(sourceFile) < position && position < node.end) || (!!node.isUnterminated && position === node.end);
}
ts.isInsideTemplateLiteral = isInsideTemplateLiteral;
function isAccessibilityModifier(kind) {
@@ -71059,18 +71400,18 @@ var ts;
}
ts.cloneCompilerOptions = cloneCompilerOptions;
function isArrayLiteralOrObjectLiteralDestructuringPattern(node) {
- if (node.kind === 182 ||
- node.kind === 183) {
- if (node.parent.kind === 199 &&
+ if (node.kind === 183 ||
+ node.kind === 184) {
+ if (node.parent.kind === 200 &&
node.parent.left === node &&
node.parent.operatorToken.kind === 58) {
return true;
}
- if (node.parent.kind === 221 &&
+ if (node.parent.kind === 222 &&
node.parent.initializer === node) {
return true;
}
- if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 269 ? node.parent.parent : node.parent)) {
+ if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 270 ? node.parent.parent : node.parent)) {
return true;
}
}
@@ -71124,6 +71465,7 @@ var ts;
105,
140,
141,
+ 142,
];
function isTypeKeyword(kind) {
return ts.contains(ts.typeKeywords, kind);
@@ -71159,7 +71501,7 @@ var ts;
}
ts.skipConstraint = skipConstraint;
function getNameFromPropertyName(name) {
- return name.kind === 146
+ return name.kind === 147
? ts.isStringOrNumericLiteral(name.expression) ? name.expression.text : undefined
: ts.getTextOfIdentifierOrLiteral(name);
}
@@ -71180,14 +71522,14 @@ var ts;
return ts.createGetCanonicalFileName(hostUsesCaseSensitiveFileNames(host));
}
ts.hostGetCanonicalFileName = hostGetCanonicalFileName;
- function makeImportIfNecessary(defaultImport, namedImports, moduleSpecifier) {
- return defaultImport || namedImports && namedImports.length ? makeImport(defaultImport, namedImports, moduleSpecifier) : undefined;
+ function makeImportIfNecessary(defaultImport, namedImports, moduleSpecifier, preferences) {
+ return defaultImport || namedImports && namedImports.length ? makeImport(defaultImport, namedImports, moduleSpecifier, preferences) : undefined;
}
ts.makeImportIfNecessary = makeImportIfNecessary;
- function makeImport(defaultImport, namedImports, moduleSpecifier) {
+ function makeImport(defaultImport, namedImports, moduleSpecifier, preferences) {
return ts.createImportDeclaration(undefined, undefined, defaultImport || namedImports
? ts.createImportClause(defaultImport, namedImports && namedImports.length ? ts.createNamedImports(namedImports) : undefined)
- : undefined, typeof moduleSpecifier === "string" ? ts.createLiteral(moduleSpecifier) : moduleSpecifier);
+ : undefined, typeof moduleSpecifier === "string" ? ts.createLiteral(moduleSpecifier, preferences.quotePreference === "single") : moduleSpecifier);
}
ts.makeImport = makeImport;
function symbolNameNoDefault(symbol) {
@@ -71215,6 +71557,24 @@ var ts;
return propSymbol;
}
ts.getPropertySymbolFromBindingElement = getPropertySymbolFromBindingElement;
+ function getPropertySymbolsFromBaseTypes(symbol, propertyName, checker, cb) {
+ var seen = ts.createMap();
+ return recur(symbol);
+ function recur(symbol) {
+ if (!(symbol.flags & (32 | 64)) || !ts.addToSeen(seen, ts.getSymbolId(symbol)))
+ return;
+ return ts.firstDefined(symbol.declarations, function (declaration) { return ts.firstDefined(ts.getAllSuperTypeNodes(declaration), function (typeReference) {
+ var type = checker.getTypeAtLocation(typeReference);
+ var propertySymbol = type && type.symbol && checker.getPropertyOfType(type, propertyName);
+ return type && propertySymbol && (ts.firstDefined(checker.getRootSymbols(propertySymbol), cb) || recur(type.symbol));
+ }); });
+ }
+ }
+ ts.getPropertySymbolsFromBaseTypes = getPropertySymbolsFromBaseTypes;
+ function isMemberSymbolInBaseType(memberSymbol, checker) {
+ return getPropertySymbolsFromBaseTypes(memberSymbol.parent, memberSymbol.name, checker, function (_) { return true; }) || false;
+ }
+ ts.isMemberSymbolInBaseType = isMemberSymbolInBaseType;
var NodeSet = (function () {
function NodeSet() {
this.map = ts.createMap();
@@ -71234,10 +71594,25 @@ var ts;
return NodeSet;
}());
ts.NodeSet = NodeSet;
+ function getParentNodeInSpan(node, file, span) {
+ if (!node)
+ return undefined;
+ while (node.parent) {
+ if (ts.isSourceFile(node.parent) || !spanContainsNode(span, node.parent, file)) {
+ return node;
+ }
+ node = node.parent;
+ }
+ }
+ ts.getParentNodeInSpan = getParentNodeInSpan;
+ function spanContainsNode(span, node, file) {
+ return ts.textSpanContainsPosition(span, node.getStart(file)) &&
+ node.getEnd() <= ts.textSpanEnd(span);
+ }
})(ts || (ts = {}));
(function (ts) {
function isFirstDeclarationOfSymbolParameter(symbol) {
- return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 148;
+ return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 149;
}
ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter;
var displayPartWriter = getDisplayPartWriter();
@@ -71406,18 +71781,21 @@ var ts;
}
ts.mapToDisplayParts = mapToDisplayParts;
function typeToDisplayParts(typechecker, type, enclosingDeclaration, flags) {
+ if (flags === void 0) { flags = 0; }
return mapToDisplayParts(function (writer) {
- typechecker.writeType(type, enclosingDeclaration, flags | 1024, writer);
+ typechecker.writeType(type, enclosingDeclaration, flags | 1024 | 16384, writer);
});
}
ts.typeToDisplayParts = typeToDisplayParts;
function symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration, meaning, flags) {
+ if (flags === void 0) { flags = 0; }
return mapToDisplayParts(function (writer) {
typeChecker.writeSymbol(symbol, enclosingDeclaration, meaning, flags | 8, writer);
});
}
ts.symbolToDisplayParts = symbolToDisplayParts;
function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags) {
+ if (flags === void 0) { flags = 0; }
flags |= 16384 | 1024 | 32 | 8192;
return mapToDisplayParts(function (writer) {
typechecker.writeSignature(signature, enclosingDeclaration, flags, undefined, writer);
@@ -71425,8 +71803,8 @@ var ts;
}
ts.signatureToDisplayParts = signatureToDisplayParts;
function isImportOrExportSpecifierName(location) {
- return location.parent &&
- (location.parent.kind === 247 || location.parent.kind === 251) &&
+ return !!location.parent &&
+ (location.parent.kind === 248 || location.parent.kind === 252) &&
location.parent.propertyName === location;
}
ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName;
@@ -71448,7 +71826,7 @@ var ts;
scriptKinds[_i - 2] = arguments[_i];
}
var scriptKind = getScriptKind(fileName, host);
- return ts.forEach(scriptKinds, function (k) { return k === scriptKind; });
+ return ts.some(scriptKinds, function (k) { return k === scriptKind; });
}
ts.scriptKindIs = scriptKindIs;
function getScriptKind(fileName, host) {
@@ -71516,9 +71894,9 @@ var ts;
function getFirstChild(node) {
return node.forEachChild(function (child) { return child; });
}
- function getUniqueName(baseName, fileText) {
+ function getUniqueName(baseName, sourceFile) {
var nameText = baseName;
- for (var i = 1; ts.stringContains(fileText, nameText); i++) {
+ for (var i = 1; !ts.isFileLevelUniqueName(sourceFile, nameText); i++) {
nameText = baseName + "_" + i;
}
return nameText;
@@ -71533,7 +71911,7 @@ var ts;
for (var _b = 0, textChanges_1 = textChanges_2; _b < textChanges_1.length; _b++) {
var change = textChanges_1[_b];
var span = change.span, newText = change.newText;
- var index = newText.indexOf(name);
+ var index = indexInTextChange(newText, name);
if (index !== -1) {
lastPos = span.start + delta + index;
if (!preferLastLocation) {
@@ -71548,6 +71926,16 @@ var ts;
return lastPos;
}
ts.getRenameLocation = getRenameLocation;
+ function indexInTextChange(change, name) {
+ if (ts.startsWith(change, name))
+ return 0;
+ var idx = change.indexOf(" " + name);
+ if (idx === -1)
+ idx = change.indexOf("." + name);
+ if (idx === -1)
+ idx = change.indexOf('"' + name);
+ return idx === -1 ? -1 : idx + 1;
+ }
})(ts || (ts = {}));
var ts;
(function (ts) {
@@ -71757,6 +72145,8 @@ var ts;
case 9:
case 17:
return ts.TokenClass.Identifier;
+ default:
+ return undefined;
}
}
function canFollow(keyword1, keyword2) {
@@ -71888,10 +72278,10 @@ var ts;
ts.getSemanticClassifications = getSemanticClassifications;
function checkForClassificationCancellation(cancellationToken, kind) {
switch (kind) {
- case 238:
- case 234:
+ case 239:
case 235:
- case 233:
+ case 236:
+ case 234:
cancellationToken.throwIfCancellationRequested();
}
}
@@ -71976,6 +72366,7 @@ var ts;
case 22: return "jsx attribute";
case 23: return "jsx text";
case 24: return "jsx attribute string literal value";
+ default: return undefined;
}
}
function convertClassificationsToSpans(classifications) {
@@ -72072,18 +72463,18 @@ var ts;
pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18);
pos = tag.tagName.end;
switch (tag.kind) {
- case 292:
+ case 293:
processJSDocParameterTag(tag);
break;
- case 295:
+ case 296:
processJSDocTemplateTag(tag);
pos = tag.end;
break;
- case 294:
+ case 295:
processElement(tag.typeExpression);
pos = tag.end;
break;
- case 293:
+ case 294:
processElement(tag.typeExpression);
pos = tag.end;
break;
@@ -72164,22 +72555,22 @@ var ts;
}
function tryClassifyJsxElementName(token) {
switch (token.parent && token.parent.kind) {
- case 256:
+ case 257:
if (token.parent.tagName === token) {
return 19;
}
break;
- case 257:
+ case 258:
if (token.parent.tagName === token) {
return 20;
}
break;
- case 255:
+ case 256:
if (token.parent.tagName === token) {
return 21;
}
break;
- case 261:
+ case 262:
if (token.parent.name === token) {
return 22;
}
@@ -72198,18 +72589,19 @@ var ts;
}
if (ts.isPunctuation(tokenKind)) {
if (token) {
+ var parent = token.parent;
if (tokenKind === 58) {
- if (token.parent.kind === 231 ||
- token.parent.kind === 151 ||
- token.parent.kind === 148 ||
- token.parent.kind === 261) {
+ if (parent.kind === 232 ||
+ parent.kind === 152 ||
+ parent.kind === 149 ||
+ parent.kind === 262) {
return 5;
}
}
- if (token.parent.kind === 199 ||
- token.parent.kind === 197 ||
- token.parent.kind === 198 ||
- token.parent.kind === 200) {
+ if (parent.kind === 200 ||
+ parent.kind === 198 ||
+ parent.kind === 199 ||
+ parent.kind === 201) {
return 5;
}
}
@@ -72219,7 +72611,7 @@ var ts;
return 4;
}
else if (tokenKind === 9) {
- return token.parent.kind === 261 ? 24 : 6;
+ return token.parent.kind === 262 ? 24 : 6;
}
else if (tokenKind === 12) {
return 6;
@@ -72233,32 +72625,32 @@ var ts;
else if (tokenKind === 71) {
if (token) {
switch (token.parent.kind) {
- case 234:
+ case 235:
if (token.parent.name === token) {
return 11;
}
return;
- case 147:
+ case 148:
if (token.parent.name === token) {
return 15;
}
return;
- case 235:
+ case 236:
if (token.parent.name === token) {
return 13;
}
return;
- case 237:
+ case 238:
if (token.parent.name === token) {
return 12;
}
return;
- case 238:
+ case 239:
if (token.parent.name === token) {
return 14;
}
return;
- case 148:
+ case 149:
if (token.parent.name === token) {
return ts.isThisIdentifier(token) ? 3 : 17;
}
@@ -72496,8 +72888,8 @@ var ts;
var ambientModules = checker.getAmbientModules().map(function (sym) { return ts.stripQuotes(sym.name); });
var nonRelativeModuleNames = ambientModules.filter(function (moduleName) { return ts.startsWith(moduleName, fragment); });
if (fragmentDirectory !== undefined) {
- var moduleNameWithSeperator_1 = ts.ensureTrailingDirectorySeparator(fragmentDirectory);
- return nonRelativeModuleNames.map(function (nonRelativeModuleName) { return ts.removePrefix(nonRelativeModuleName, moduleNameWithSeperator_1); });
+ var moduleNameWithSeparator_1 = ts.ensureTrailingDirectorySeparator(fragmentDirectory);
+ return nonRelativeModuleNames.map(function (nonRelativeModuleName) { return ts.removePrefix(nonRelativeModuleName, moduleNameWithSeparator_1); });
}
return nonRelativeModuleNames;
}
@@ -72634,7 +73026,7 @@ var ts;
return ts.directoryProbablyExists(path, host);
}
catch (_a) { }
- return undefined;
+ return false;
}
function tryIOAndConsumeErrors(host, toApply) {
var args = [];
@@ -72691,7 +73083,7 @@ var ts;
&& (contextToken.kind === 72 || contextToken.kind === 77 || contextToken.kind === 71)) {
return getLabelCompletionAtPosition(contextToken.parent);
}
- var completionData = getCompletionData(program, log, sourceFile, position, preferences, undefined);
+ var completionData = getCompletionData(program, log, sourceFile, isUncheckedFile(sourceFile, compilerOptions), position, preferences, undefined);
if (!completionData) {
return undefined;
}
@@ -72754,7 +73146,7 @@ var ts;
}] };
}
var entries = [];
- if (ts.isSourceFileJavaScript(sourceFile)) {
+ if (isUncheckedFile(sourceFile, compilerOptions)) {
var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, sourceFile, typeChecker, compilerOptions.target, log, completionKind, preferences, propertyAccessToConvert, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap);
getJavaScriptCompletionEntries(sourceFile, location.pos, uniqueNames, compilerOptions.target, entries);
}
@@ -72770,6 +73162,9 @@ var ts;
}
return { isGlobalCompletion: isInSnippetScope, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries };
}
+ function isUncheckedFile(sourceFile, compilerOptions) {
+ return ts.isSourceFileJavaScript(sourceFile) && !ts.isCheckJsEnabledForFile(sourceFile, compilerOptions);
+ }
function isMemberCompletionKind(kind) {
switch (kind) {
case 0:
@@ -72918,38 +73313,38 @@ var ts;
})(StringLiteralCompletionKind || (StringLiteralCompletionKind = {}));
function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) {
switch (node.parent.kind) {
- case 177:
+ case 178:
switch (node.parent.parent.kind) {
- case 161:
+ case 162:
return { kind: 2, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(node.parent), typeChecker), isNewIdentifier: false };
- case 175:
+ case 176:
return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(node.parent.parent.objectType));
- case 178:
+ case 179:
return { kind: 0, paths: Completions.PathCompletions.getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) };
default:
return undefined;
}
- case 269:
+ case 270:
if (ts.isObjectLiteralExpression(node.parent.parent) && node.parent.name === node) {
return stringLiteralCompletionsFromProperties(typeChecker.getContextualType(node.parent.parent));
}
return fromContextualType();
- case 185: {
+ case 186: {
var _a = node.parent, expression = _a.expression, argumentExpression = _a.argumentExpression;
if (node === argumentExpression) {
return stringLiteralCompletionsFromProperties(typeChecker.getTypeAtLocation(expression));
}
return undefined;
}
- case 186:
case 187:
+ case 188:
if (!ts.isRequireCall(node.parent, false) && !ts.isImportCall(node.parent)) {
- var argumentInfo = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(node, position, sourceFile);
+ var argumentInfo = ts.SignatureHelp.getArgumentInfoForCompletions(node, position, sourceFile);
return argumentInfo ? getStringLiteralCompletionsFromSignature(argumentInfo, typeChecker) : fromContextualType();
}
- case 243:
- case 249:
- case 253:
+ case 244:
+ case 250:
+ case 254:
return { kind: 0, paths: Completions.PathCompletions.getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) };
default:
return fromContextualType();
@@ -72967,7 +73362,7 @@ var ts;
if (!candidate.hasRestParameter && argumentInfo.argumentCount > candidate.parameters.length)
return;
var type = checker.getParameterType(candidate, argumentInfo.argumentIndex);
- isNewIdentifier = isNewIdentifier || !!(type.flags & 2);
+ isNewIdentifier = isNewIdentifier || !!(type.flags & 4);
return getStringLiteralTypes(type, checker, uniques);
});
return { kind: 2, types: types, isNewIdentifier: isNewIdentifier };
@@ -72982,12 +73377,13 @@ var ts;
type = ts.skipConstraint(type);
return type.isUnion()
? ts.flatMap(type.types, function (t) { return getStringLiteralTypes(t, typeChecker, uniques); })
- : type.isStringLiteral() && !(type.flags & 256) && ts.addToSeen(uniques, type.value)
+ : type.isStringLiteral() && !(type.flags & 512) && ts.addToSeen(uniques, type.value)
? [type]
: ts.emptyArray;
}
function getSymbolCompletionFromEntryId(program, log, sourceFile, position, entryId) {
- var completionData = getCompletionData(program, log, sourceFile, position, { includeCompletionsForModuleExports: true, includeCompletionsWithInsertText: true }, entryId);
+ var compilerOptions = program.getCompilerOptions();
+ var completionData = getCompletionData(program, log, sourceFile, isUncheckedFile(sourceFile, compilerOptions), position, { includeCompletionsForModuleExports: true, includeCompletionsWithInsertText: true }, entryId);
if (!completionData) {
return { type: "none" };
}
@@ -72997,7 +73393,7 @@ var ts;
var symbols = completionData.symbols, location = completionData.location, completionKind = completionData.completionKind, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, previousToken = completionData.previousToken, isJsxInitializer = completionData.isJsxInitializer;
return ts.firstDefined(symbols, function (symbol) {
var origin = symbolToOriginInfoMap[ts.getSymbolId(symbol)];
- var info = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, origin, completionKind);
+ var info = getCompletionEntryDisplayNameForSymbol(symbol, compilerOptions.target, origin, completionKind);
return info && info.name === entryId.name && getSourceFromOrigin(origin) === entryId.source
? { type: "symbol", symbol: symbol, location: location, symbolToOriginInfoMap: symbolToOriginInfoMap, previousToken: previousToken, isJsxInitializer: isJsxInitializer }
: undefined;
@@ -73076,7 +73472,7 @@ var ts;
return { codeActions: undefined, sourceDisplay: undefined };
}
var moduleSymbol = symbolOriginInfo.moduleSymbol;
- var exportedSymbol = ts.skipAlias(symbol.exportSymbol || symbol, checker);
+ var exportedSymbol = checker.getMergedSymbol(ts.skipAlias(symbol.exportSymbol || symbol, checker));
var _a = ts.codefix.getImportCompletionAction(exportedSymbol, moduleSymbol, sourceFile, getSymbolName(symbol, symbolOriginInfo, compilerOptions.target), host, program, checker, compilerOptions, allSourceFiles, formatContext, getCanonicalFileName, previousToken, preferences), moduleSpecifier = _a.moduleSpecifier, codeAction = _a.codeAction;
return { sourceDisplay: [ts.textPart(moduleSpecifier)], codeActions: [codeAction] };
}
@@ -73102,11 +73498,13 @@ var ts;
CompletionKind[CompletionKind["None"] = 5] = "None";
})(CompletionKind || (CompletionKind = {}));
function getRecommendedCompletion(currentToken, position, sourceFile, checker) {
- var ty = getContextualType(currentToken, position, sourceFile, checker);
- var symbol = ty && ty.symbol;
- return symbol && (symbol.flags & 384 || symbol.flags & 32 && !ts.isAbstractConstructorSymbol(symbol))
- ? getFirstSymbolInChain(symbol, currentToken, checker)
- : undefined;
+ var contextualType = getContextualType(currentToken, position, sourceFile, checker);
+ return ts.firstDefined(contextualType && (contextualType.isUnion() ? contextualType.types : [contextualType]), function (type) {
+ var symbol = type && type.symbol;
+ return symbol && (symbol.flags & (8 | 384 | 32) && !ts.isAbstractConstructorSymbol(symbol))
+ ? getFirstSymbolInChain(symbol, currentToken, checker)
+ : undefined;
+ });
}
function getContextualType(currentToken, position, sourceFile, checker) {
var parent = currentToken.parent;
@@ -73115,11 +73513,11 @@ var ts;
return getContextualTypeFromParent(currentToken, checker);
case 58:
switch (parent.kind) {
- case 231:
+ case 232:
return checker.getContextualType(parent.initializer);
- case 199:
+ case 200:
return checker.getTypeAtLocation(parent.left);
- case 261:
+ case 262:
return checker.getContextualTypeForJsxAttribute(parent);
default:
return undefined;
@@ -73129,9 +73527,9 @@ var ts;
case 73:
return getSwitchedType(ts.cast(parent, ts.isCaseClause), checker);
case 17:
- return ts.isJsxExpression(parent) && parent.parent.kind !== 254 ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined;
+ return ts.isJsxExpression(parent) && parent.parent.kind !== 255 ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined;
default:
- var argInfo = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(currentToken, position, sourceFile);
+ var argInfo = ts.SignatureHelp.getArgumentInfoForCompletions(currentToken, position, sourceFile);
return argInfo
? checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex + (currentToken.kind === 26 ? 1 : 0))
: isEqualityOperatorKind(currentToken.kind) && ts.isBinaryExpression(parent) && isEqualityOperatorKind(parent.operatorToken.kind)
@@ -73142,15 +73540,15 @@ var ts;
function getContextualTypeFromParent(node, checker) {
var parent = node.parent;
switch (parent.kind) {
- case 187:
+ case 188:
return checker.getContextualType(parent);
- case 199: {
+ case 200: {
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 265:
+ case 266:
return parent.expression === node ? getSwitchedType(parent, checker) : undefined;
default:
return checker.getContextualType(node);
@@ -73166,9 +73564,9 @@ 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 === 273; });
+ return symbol.declarations.some(function (d) { return d.kind === 274; });
}
- function getCompletionData(program, log, sourceFile, position, preferences, detailsEntryId) {
+ function getCompletionData(program, log, sourceFile, isUncheckedFile, position, preferences, detailsEntryId) {
var typeChecker = program.getTypeChecker();
var start = ts.timestamp();
var currentToken = ts.getTokenAtPosition(sourceFile, position, false);
@@ -73195,11 +73593,11 @@ var ts;
if (tag.tagName.pos <= position && position <= tag.tagName.end) {
return { kind: 1 };
}
- if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 277) {
+ if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 278) {
currentToken = ts.getTokenAtPosition(sourceFile, position, true);
if (!currentToken ||
(!ts.isDeclarationName(currentToken) &&
- (currentToken.parent.kind !== 297 ||
+ (currentToken.parent.kind !== 298 ||
currentToken.parent.name !== currentToken))) {
insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression);
}
@@ -73238,14 +73636,15 @@ var ts;
if (contextToken.kind === 23) {
isRightOfDot = true;
switch (parent.kind) {
- case 184:
+ case 185:
propertyAccessToConvert = parent;
node = propertyAccessToConvert.expression;
break;
- case 145:
+ case 146:
node = parent.left;
break;
- case 178:
+ case 179:
+ case 210:
node = parent;
break;
default:
@@ -73253,44 +73652,44 @@ var ts;
}
}
else if (sourceFile.languageVariant === 1) {
- if (parent && parent.kind === 184) {
+ if (parent && parent.kind === 185) {
contextToken = parent;
parent = parent.parent;
}
if (currentToken.parent === location) {
switch (currentToken.kind) {
case 29:
- if (currentToken.parent.kind === 254 || currentToken.parent.kind === 256) {
+ if (currentToken.parent.kind === 255 || currentToken.parent.kind === 257) {
location = currentToken;
}
break;
case 41:
- if (currentToken.parent.kind === 255) {
+ if (currentToken.parent.kind === 256) {
location = currentToken;
}
break;
}
}
switch (parent.kind) {
- case 257:
+ case 258:
if (contextToken.kind === 41) {
isStartingCloseTag = true;
location = contextToken;
}
break;
- case 199:
+ case 200:
if (!(parent.left.flags & 32768)) {
break;
}
- case 255:
- case 254:
case 256:
+ case 255:
+ case 257:
if (contextToken.kind === 27) {
isRightOfOpenTag = true;
location = contextToken;
}
break;
- case 261:
+ case 262:
switch (previousToken.kind) {
case 58:
isJsxInitializer = true;
@@ -73337,12 +73736,14 @@ var ts;
return { kind: 0, symbols: symbols, completionKind: completionKind, isInSnippetScope: isInSnippetScope, propertyAccessToConvert: propertyAccessToConvert, isNewIdentifierLocation: isNewIdentifierLocation, location: location, keywordFilters: keywordFilters, symbolToOriginInfoMap: symbolToOriginInfoMap, recommendedCompletion: recommendedCompletion, previousToken: previousToken, isJsxInitializer: isJsxInitializer };
function isTagWithTypeExpression(tag) {
switch (tag.kind) {
- case 292:
- case 297:
case 293:
+ case 298:
case 294:
- case 296:
+ case 295:
+ case 297:
return true;
+ default:
+ return false;
}
}
function getTypeScriptMemberSymbols() {
@@ -73368,26 +73769,31 @@ var ts;
symbols.push(symbol_2);
}
}
- if (!isTypeLocation && symbol.declarations.some(function (d) { return d.kind !== 273 && d.kind !== 238 && d.kind !== 237; })) {
+ if (!isTypeLocation && symbol.declarations.some(function (d) { return d.kind !== 274 && d.kind !== 239 && d.kind !== 238; })) {
addTypeProperties(typeChecker.getTypeOfSymbolAtLocation(symbol, node));
}
return;
}
}
}
+ if (ts.isMetaProperty(node) && (node.keywordToken === 94 || node.keywordToken === 91)) {
+ var completion = (node.keywordToken === 94) ? "target" : "meta";
+ symbols.push(typeChecker.createSymbol(4, ts.escapeLeadingUnderscores(completion)));
+ return;
+ }
if (!isTypeLocation) {
addTypeProperties(typeChecker.getTypeAtLocation(node));
}
}
function addTypeProperties(type) {
isNewIdentifierLocation = hasIndexSignature(type);
- if (ts.isSourceFileJavaScript(sourceFile)) {
+ if (isUncheckedFile) {
symbols.push.apply(symbols, getPropertiesForCompletion(type, typeChecker, true));
}
else {
for (var _i = 0, _a = type.getApparentProperties(); _i < _a.length; _i++) {
var symbol = _a[_i];
- if (typeChecker.isValidPropertyAccessForCompletions(node.kind === 178 ? node : node.parent, type, symbol)) {
+ if (typeChecker.isValidPropertyAccessForCompletions(node.kind === 179 ? node : node.parent, type, symbol)) {
addPropertySymbol(symbol);
}
}
@@ -73396,7 +73802,7 @@ var ts;
function addPropertySymbol(symbol) {
var symbolSymbol = ts.firstDefined(symbol.declarations, function (decl) {
var name = ts.getNameOfDeclaration(decl);
- var leftName = name.kind === 146 ? getLeftMostName(name.expression) : undefined;
+ var leftName = name.kind === 147 ? getLeftMostName(name.expression) : undefined;
return leftName && typeChecker.getSymbolAtLocation(leftName);
});
if (symbolSymbol) {
@@ -73453,7 +73859,7 @@ var ts;
isInSnippetScope = isSnippetScope(scopeNode);
var symbolMeanings = 67901928 | 67216319 | 1920 | 2097152;
symbols = ts.Debug.assertEachDefined(typeChecker.getSymbolsInScope(scopeNode, symbolMeanings), "getSymbolsInScope() should all be defined");
- if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 273) {
+ if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 274) {
var thisType = typeChecker.tryGetThisTypeAt(scopeNode);
if (thisType) {
for (var _i = 0, _a = getPropertiesForCompletion(thisType, typeChecker, true); _i < _a.length; _i++) {
@@ -73477,16 +73883,16 @@ var ts;
return false;
if (ts.programContainsEs6Modules(program))
return true;
- if (ts.isSourceFileJavaScript(sourceFile))
+ if (isUncheckedFile)
return false;
return ts.compilerOptionsIndicateEs6Modules(program.getCompilerOptions());
}
function isSnippetScope(scopeNode) {
switch (scopeNode.kind) {
- case 273:
- case 201:
- case 264:
- case 212:
+ case 274:
+ case 202:
+ case 265:
+ case 213:
return true;
default:
return ts.isStatement(scopeNode);
@@ -73519,22 +73925,22 @@ var ts;
function isContextTokenValueLocation(contextToken) {
return contextToken &&
contextToken.kind === 103 &&
- (contextToken.parent.kind === 164 || ts.isTypeOfExpression(contextToken.parent));
+ (contextToken.parent.kind === 165 || ts.isTypeOfExpression(contextToken.parent));
}
function isContextTokenTypeLocation(contextToken) {
if (contextToken) {
var parentKind = contextToken.parent.kind;
switch (contextToken.kind) {
case 56:
- return parentKind === 151 ||
- parentKind === 150 ||
- parentKind === 148 ||
- parentKind === 231 ||
+ return parentKind === 152 ||
+ parentKind === 151 ||
+ parentKind === 149 ||
+ parentKind === 232 ||
ts.isFunctionLikeKind(parentKind);
case 58:
- return parentKind === 236;
+ return parentKind === 237;
case 118:
- return parentKind === 207;
+ return parentKind === 208;
}
}
return false;
@@ -73549,16 +73955,22 @@ var ts;
var exportedSymbols = typeChecker.getExportsOfModule(symbol);
return exportedSymbols.some(symbolCanBeReferencedAtTypeLocation);
}
+ return false;
}
function getSymbolsFromOtherSourceFileExports(symbols, tokenText, target) {
var tokenTextLowerCase = tokenText.toLowerCase();
+ var seenResolvedModules = ts.createMap();
ts.codefix.forEachExternalModuleToImportFrom(typeChecker, sourceFile, program.getSourceFiles(), function (moduleSymbol) {
if (detailsEntryId && detailsEntryId.source && ts.stripQuotes(moduleSymbol.name) !== detailsEntryId.source) {
return;
}
+ var resolvedModuleSymbol = typeChecker.resolveExternalModuleSymbol(moduleSymbol);
+ if (!ts.addToSeen(seenResolvedModules, ts.getSymbolId(resolvedModuleSymbol))) {
+ return;
+ }
for (var _i = 0, _a = typeChecker.getExportsOfModule(moduleSymbol); _i < _a.length; _i++) {
var symbol = _a[_i];
- if (typeChecker.getMergedSymbol(symbol.parent) !== typeChecker.resolveExternalModuleSymbol(moduleSymbol)
+ if (typeChecker.getMergedSymbol(symbol.parent) !== resolvedModuleSymbol
|| ts.some(symbol.declarations, function (d) { return ts.isExportSpecifier(d) && !!d.parent.parent.moduleSpecifier; })) {
continue;
}
@@ -73610,11 +74022,11 @@ var ts;
return true;
}
if (contextToken.kind === 29 && contextToken.parent) {
- if (contextToken.parent.kind === 256) {
+ if (contextToken.parent.kind === 257) {
return true;
}
- if (contextToken.parent.kind === 257 || contextToken.parent.kind === 255) {
- return contextToken.parent.parent && contextToken.parent.parent.kind === 254;
+ if (contextToken.parent.kind === 258 || contextToken.parent.kind === 256) {
+ return !!contextToken.parent.parent && contextToken.parent.parent.kind === 255;
}
}
return false;
@@ -73624,40 +74036,40 @@ var ts;
var containingNodeKind = previousToken.parent.kind;
switch (previousToken.kind) {
case 26:
- return containingNodeKind === 186
- || containingNodeKind === 154
- || containingNodeKind === 187
- || containingNodeKind === 182
- || containingNodeKind === 199
- || containingNodeKind === 162;
+ return containingNodeKind === 187
+ || containingNodeKind === 155
+ || containingNodeKind === 188
+ || containingNodeKind === 183
+ || containingNodeKind === 200
+ || containingNodeKind === 163;
case 19:
- return containingNodeKind === 186
- || containingNodeKind === 154
- || containingNodeKind === 187
- || containingNodeKind === 190
- || containingNodeKind === 172;
+ return containingNodeKind === 187
+ || containingNodeKind === 155
+ || containingNodeKind === 188
+ || containingNodeKind === 191
+ || containingNodeKind === 173;
case 21:
- return containingNodeKind === 182
- || containingNodeKind === 159
- || containingNodeKind === 146;
+ return containingNodeKind === 183
+ || containingNodeKind === 160
+ || containingNodeKind === 147;
case 129:
case 130:
return true;
case 23:
- return containingNodeKind === 238;
+ return containingNodeKind === 239;
case 17:
- return containingNodeKind === 234;
+ return containingNodeKind === 235;
case 58:
- return containingNodeKind === 231
- || containingNodeKind === 199;
+ return containingNodeKind === 232
+ || containingNodeKind === 200;
case 14:
- return containingNodeKind === 201;
+ return containingNodeKind === 202;
case 15:
- return containingNodeKind === 210;
+ return containingNodeKind === 211;
case 114:
case 112:
case 113:
- return containingNodeKind === 151;
+ return containingNodeKind === 152;
}
switch (keywordForNode(previousToken)) {
case 114:
@@ -73669,20 +74081,8 @@ var ts;
return false;
}
function isInStringOrRegularExpressionOrTemplateLiteral(contextToken) {
- if (contextToken.kind === 9
- || contextToken.kind === 12
- || ts.isTemplateLiteralKind(contextToken.kind)) {
- var start_5 = contextToken.getStart();
- var end = contextToken.getEnd();
- if (start_5 < position && position < end) {
- return true;
- }
- if (position === end) {
- return !!contextToken.isUnterminated
- || contextToken.kind === 12;
- }
- }
- return false;
+ return (ts.isRegularExpressionLiteral(contextToken) || ts.isStringTextContainingNode(contextToken)) && (ts.rangeContainsPositionExclusive(ts.createTextRangeFromSpan(ts.createTextSpanFromNode(contextToken)), position) ||
+ position === contextToken.end && (!!contextToken.isUnterminated || ts.isRegularExpressionLiteral(contextToken)));
}
function tryGetObjectLikeCompletionSymbols() {
var objectLikeContainer = tryGetObjectLikeCompletionContainer(contextToken);
@@ -73691,7 +74091,7 @@ var ts;
completionKind = 0;
var typeMembers;
var existingMembers;
- if (objectLikeContainer.kind === 183) {
+ if (objectLikeContainer.kind === 184) {
var typeForObject = typeChecker.getContextualType(objectLikeContainer);
if (!typeForObject)
return 2;
@@ -73700,17 +74100,17 @@ var ts;
existingMembers = objectLikeContainer.properties;
}
else {
- ts.Debug.assert(objectLikeContainer.kind === 179);
+ ts.Debug.assert(objectLikeContainer.kind === 180);
isNewIdentifierLocation = false;
var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent);
if (!ts.isVariableLike(rootDeclaration))
return ts.Debug.fail("Root declaration is not variable-like.");
- var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 221;
- if (!canGetType && rootDeclaration.kind === 148) {
+ var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 222;
+ if (!canGetType && rootDeclaration.kind === 149) {
if (ts.isExpression(rootDeclaration.parent)) {
canGetType = !!typeChecker.getContextualType(rootDeclaration.parent);
}
- else if (rootDeclaration.parent.kind === 153 || rootDeclaration.parent.kind === 156) {
+ else if (rootDeclaration.parent.kind === 154 || rootDeclaration.parent.kind === 157) {
canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent);
}
}
@@ -73732,7 +74132,7 @@ var ts;
? ts.tryCast(contextToken.parent, ts.isNamedImportsOrExports) : undefined;
if (!namedImportsOrExports)
return 0;
- var moduleSpecifier = (namedImportsOrExports.kind === 246 ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier;
+ var moduleSpecifier = (namedImportsOrExports.kind === 247 ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier;
var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier);
if (!moduleSpecifierSymbol)
return 2;
@@ -73753,7 +74153,7 @@ var ts;
if (!ts.isClassLike(decl))
return 1;
var classElement = contextToken.parent;
- var classElementModifierFlags = ts.isClassElement(classElement) && ts.getModifierFlags(classElement);
+ var classElementModifierFlags = ts.isClassElement(classElement) ? ts.getModifierFlags(classElement) : 0;
if (contextToken.kind === 71 && !isCurrentlyEditingNode(contextToken)) {
switch (contextToken.getText()) {
case "private":
@@ -73793,13 +74193,14 @@ var ts;
}
function tryGetConstructorLikeCompletionContainer(contextToken) {
if (contextToken) {
+ var parent = contextToken.parent;
switch (contextToken.kind) {
case 19:
case 26:
- return ts.isConstructorDeclaration(contextToken.parent) && contextToken.parent;
+ return ts.isConstructorDeclaration(contextToken.parent) ? contextToken.parent : undefined;
default:
if (isConstructorParameterCompletion(contextToken)) {
- return contextToken.parent.parent;
+ return parent.parent;
}
}
}
@@ -73816,6 +74217,7 @@ var ts;
return true;
}
prev_1 = node;
+ return false;
});
return container && container;
}
@@ -73827,29 +74229,29 @@ var ts;
case 28:
case 41:
case 71:
- case 184:
- case 262:
- case 261:
+ case 185:
case 263:
- if (parent && (parent.kind === 255 || parent.kind === 256)) {
+ case 262:
+ case 264:
+ if (parent && (parent.kind === 256 || parent.kind === 257)) {
return parent;
}
- else if (parent.kind === 261) {
+ else if (parent.kind === 262) {
return parent.parent.parent;
}
break;
case 9:
- if (parent && ((parent.kind === 261) || (parent.kind === 263))) {
+ if (parent && ((parent.kind === 262) || (parent.kind === 264))) {
return parent.parent.parent;
}
break;
case 18:
if (parent &&
- parent.kind === 264 &&
- parent.parent && parent.parent.kind === 261) {
+ parent.kind === 265 &&
+ parent.parent && parent.parent.kind === 262) {
return parent.parent.parent.parent;
}
- if (parent && parent.kind === 263) {
+ if (parent && parent.kind === 264) {
return parent.parent.parent;
}
break;
@@ -73858,51 +74260,51 @@ var ts;
return undefined;
}
function isSolelyIdentifierDefinitionLocation(contextToken) {
- var containingNodeKind = contextToken.parent.kind;
+ var parent = contextToken.parent;
+ var containingNodeKind = parent.kind;
switch (contextToken.kind) {
case 26:
- return containingNodeKind === 231 ||
- containingNodeKind === 232 ||
- containingNodeKind === 213 ||
- containingNodeKind === 237 ||
+ return containingNodeKind === 232 ||
+ containingNodeKind === 233 ||
+ containingNodeKind === 214 ||
+ containingNodeKind === 238 ||
isFunctionLikeButNotConstructor(containingNodeKind) ||
- containingNodeKind === 235 ||
- containingNodeKind === 180 ||
containingNodeKind === 236 ||
- (ts.isClassLike(contextToken.parent) &&
- contextToken.parent.typeParameters &&
- contextToken.parent.typeParameters.end >= contextToken.pos);
+ containingNodeKind === 181 ||
+ containingNodeKind === 237 ||
+ (ts.isClassLike(parent) &&
+ !!parent.typeParameters &&
+ parent.typeParameters.end >= contextToken.pos);
case 23:
- return containingNodeKind === 180;
- case 56:
return containingNodeKind === 181;
+ case 56:
+ return containingNodeKind === 182;
case 21:
- return containingNodeKind === 180;
+ return containingNodeKind === 181;
case 19:
- return containingNodeKind === 268 ||
+ return containingNodeKind === 269 ||
isFunctionLikeButNotConstructor(containingNodeKind);
case 17:
- return containingNodeKind === 237;
+ return containingNodeKind === 238;
case 27:
- return containingNodeKind === 234 ||
- containingNodeKind === 204 ||
- containingNodeKind === 235 ||
+ return containingNodeKind === 235 ||
+ containingNodeKind === 205 ||
containingNodeKind === 236 ||
+ containingNodeKind === 237 ||
ts.isFunctionLikeKind(containingNodeKind);
case 115:
- return containingNodeKind === 151 && !ts.isClassLike(contextToken.parent.parent);
+ return containingNodeKind === 152 && !ts.isClassLike(parent.parent);
case 24:
- return containingNodeKind === 148 ||
- (contextToken.parent && contextToken.parent.parent &&
- contextToken.parent.parent.kind === 180);
+ return containingNodeKind === 149 ||
+ (!!parent.parent && parent.parent.kind === 181);
case 114:
case 112:
case 113:
- return containingNodeKind === 148 && !ts.isConstructorDeclaration(contextToken.parent.parent);
+ return containingNodeKind === 149 && !ts.isConstructorDeclaration(parent.parent);
case 118:
- return containingNodeKind === 247 ||
- containingNodeKind === 251 ||
- containingNodeKind === 245;
+ return containingNodeKind === 248 ||
+ containingNodeKind === 252 ||
+ containingNodeKind === 246;
case 125:
case 136:
if (isFromObjectTypeDeclaration(contextToken)) {
@@ -73953,7 +74355,7 @@ var ts;
&& !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end));
}
function isFunctionLikeButNotConstructor(kind) {
- return ts.isFunctionLikeKind(kind) && kind !== 154;
+ return ts.isFunctionLikeKind(kind) && kind !== 155;
}
function isDotOfNumericLiteral(contextToken) {
if (contextToken.kind === 8) {
@@ -73969,19 +74371,19 @@ var ts;
var existingMemberNames = ts.createUnderscoreEscapedMap();
for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) {
var m = existingMembers_1[_i];
- if (m.kind !== 269 &&
- m.kind !== 270 &&
- m.kind !== 181 &&
- m.kind !== 153 &&
- m.kind !== 155 &&
- m.kind !== 156) {
+ if (m.kind !== 270 &&
+ m.kind !== 271 &&
+ m.kind !== 182 &&
+ m.kind !== 154 &&
+ m.kind !== 156 &&
+ m.kind !== 157) {
continue;
}
if (isCurrentlyEditingNode(m)) {
continue;
}
var existingName = void 0;
- if (m.kind === 181 && m.propertyName) {
+ if (ts.isBindingElement(m) && m.propertyName) {
if (m.propertyName.kind === 71) {
existingName = m.propertyName.escapedText;
}
@@ -73998,10 +74400,10 @@ var ts;
var existingMemberNames = ts.createUnderscoreEscapedMap();
for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) {
var m = existingMembers_2[_i];
- if (m.kind !== 151 &&
- m.kind !== 153 &&
- m.kind !== 155 &&
- m.kind !== 156) {
+ if (m.kind !== 152 &&
+ m.kind !== 154 &&
+ m.kind !== 156 &&
+ m.kind !== 157) {
continue;
}
if (isCurrentlyEditingNode(m)) {
@@ -74031,7 +74433,7 @@ var ts;
if (isCurrentlyEditingNode(attr)) {
continue;
}
- if (attr.kind === 261) {
+ if (attr.kind === 262) {
seenNames.set(attr.name.escapedText, true);
}
}
@@ -74069,7 +74471,7 @@ var ts;
var _keywordCompletions = [];
var allKeywordsCompletions = ts.memoize(function () {
var res = [];
- for (var i = 72; i <= 144; i++) {
+ for (var i = 72; i <= 145; i++) {
res.push({
name: ts.tokenToString(i),
kind: "keyword",
@@ -74162,13 +74564,13 @@ var ts;
return ts.Debug.assertEachDefined(type.getApparentProperties(), "getApparentProperties() should all be defined");
}
var filteredTypes = isForAccess ? type.types : type.types.filter(function (memberType) {
- return !(memberType.flags & 16382 || checker.isArrayLikeType(memberType) || ts.typeHasCallOrConstructSignatures(memberType, checker));
+ return !(memberType.flags & 32764 || checker.isArrayLikeType(memberType) || ts.typeHasCallOrConstructSignatures(memberType, checker));
});
return ts.Debug.assertEachDefined(checker.getAllPossiblePropertiesOfTypes(filteredTypes), "getAllPossiblePropertiesOfTypes() should all be defined");
}
function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location) {
switch (location.kind) {
- case 298:
+ case 299:
return ts.tryCast(location.parent, ts.isObjectTypeDeclaration);
case 1:
var cls = ts.tryCast(ts.lastOrUndefined(ts.cast(location.parent, ts.isSourceFile).statements), ts.isObjectTypeDeclaration);
@@ -74211,7 +74613,7 @@ var ts;
case "`":
return isStringLiteralOrTemplate(contextToken) && position === contextToken.getStart(sourceFile) + 1;
case "<":
- return contextToken.kind === 27 && contextToken.parent.kind !== 199;
+ return contextToken.kind === 27 && contextToken.parent.kind !== 200;
case "/":
return ts.isStringLiteralLike(contextToken)
? !!ts.tryGetImportFromModuleSpecifier(contextToken)
@@ -74224,8 +74626,8 @@ var ts;
switch (node.kind) {
case 9:
case 13:
- case 201:
- case 188:
+ case 202:
+ case 189:
return true;
default:
return false;
@@ -74268,7 +74670,7 @@ var ts;
if (!sourceFilesSet.has(fileName)) {
ts.Debug.assert(program.redirectTargetsSet.has(fileName));
var redirectTarget_1 = program.getSourceFile(fileName);
- var redirect = ts.find(sourceFilesToSearch, function (f) { return f.redirectInfo && f.redirectInfo.redirectTarget === redirectTarget_1; });
+ var redirect = ts.find(sourceFilesToSearch, function (f) { return !!f.redirectInfo && f.redirectInfo.redirectTarget === redirectTarget_1; });
fileName = redirect.fileName;
ts.Debug.assert(sourceFilesSet.has(fileName));
}
@@ -74314,6 +74716,8 @@ var ts;
return useParent(node.parent, ts.isAwaitExpression, getAsyncAndAwaitOccurrences);
case 120:
return highlightSpans(getAsyncAndAwaitOccurrences(node));
+ case 116:
+ return highlightSpans(getYieldOccurrences(node));
default:
return ts.isModifierKind(node.kind) && (ts.isDeclaration(node.parent) || ts.isVariableStatement(node.parent))
? highlightSpans(getModifierOccurrences(node.kind, node.parent))
@@ -74336,7 +74740,7 @@ var ts;
return [node];
}
else if (ts.isTryStatement(node)) {
- return ts.concatenate(node.catchClause ? aggregateOwnedThrowStatements(node.catchClause) : node.tryBlock && aggregateOwnedThrowStatements(node.tryBlock), aggregateOwnedThrowStatements(node.finallyBlock));
+ return ts.concatenate(node.catchClause ? aggregateOwnedThrowStatements(node.catchClause) : node.tryBlock && aggregateOwnedThrowStatements(node.tryBlock), node.finallyBlock && aggregateOwnedThrowStatements(node.finallyBlock));
}
return ts.isFunctionLike(node) ? undefined : flatMapChildren(node, aggregateOwnedThrowStatements);
}
@@ -74344,7 +74748,7 @@ var ts;
var child = throwStatement;
while (child.parent) {
var parent = child.parent;
- if (ts.isFunctionBlock(parent) || parent.kind === 273) {
+ if (ts.isFunctionBlock(parent) || parent.kind === 274) {
return parent;
}
if (ts.isTryStatement(parent) && parent.tryBlock === child && parent.catchClause) {
@@ -74369,23 +74773,23 @@ var ts;
}
function ownsBreakOrContinueStatement(owner, statement) {
var actualOwner = getBreakOrContinueOwner(statement);
- return actualOwner && actualOwner === owner;
+ return !!actualOwner && actualOwner === owner;
}
function getBreakOrContinueOwner(statement) {
return ts.findAncestor(statement, function (node) {
switch (node.kind) {
- case 226:
- if (statement.kind === 222) {
+ case 227:
+ if (statement.kind === 223) {
return false;
}
- case 219:
case 220:
case 221:
+ case 222:
+ case 219:
case 218:
- case 217:
return !statement.label || isLabeledBy(node, statement.label.escapedText);
default:
- return (ts.isFunctionLike(node) && "quit");
+ return ts.isFunctionLike(node) && "quit";
}
});
}
@@ -74402,24 +74806,23 @@ var ts;
function getNodesToSearchForModifier(declaration, modifierFlag) {
var container = declaration.parent;
switch (container.kind) {
- case 239:
- case 273:
- case 212:
- case 265:
+ case 240:
+ case 274:
+ case 213:
case 266:
+ case 267:
if (modifierFlag & 128 && ts.isClassDeclaration(declaration)) {
return declaration.members.concat([declaration]);
}
else {
return container.statements;
}
+ case 155:
case 154:
- case 153:
- case 233: {
- return container.parameters.concat((ts.isClassLike(container.parent) ? container.parent.members : []));
- }
case 234:
- case 204:
+ return container.parameters.concat((ts.isClassLike(container.parent) ? container.parent.members : []));
+ case 235:
+ case 205:
var nodes = container.members;
if (modifierFlag & 28) {
var constructor = ts.find(container.members, ts.isConstructorDeclaration);
@@ -74449,7 +74852,7 @@ var ts;
function getLoopBreakContinueOccurrences(loopNode) {
var keywords = [];
if (pushKeywordIf(keywords, loopNode.getFirstToken(), 88, 106, 81)) {
- if (loopNode.kind === 217) {
+ if (loopNode.kind === 218) {
var loopTokens = loopNode.getChildren();
for (var i = loopTokens.length - 1; i >= 0; i--) {
if (pushKeywordIf(keywords, loopTokens[i], 106)) {
@@ -74469,13 +74872,13 @@ var ts;
var owner = getBreakOrContinueOwner(breakOrContinueStatement);
if (owner) {
switch (owner.kind) {
- case 219:
case 220:
case 221:
- case 217:
+ case 222:
case 218:
+ case 219:
return getLoopBreakContinueOccurrences(owner);
- case 226:
+ case 227:
return getSwitchCaseDefaultOccurrences(owner);
}
}
@@ -74547,15 +74950,34 @@ var ts;
pushKeywordIf(keywords, modifier, 120);
});
}
- ts.forEachChild(func, aggregate);
+ ts.forEachChild(func, function (child) {
+ traverseWithoutCrossingFunction(child, function (node) {
+ if (ts.isAwaitExpression(node)) {
+ pushKeywordIf(keywords, node.getFirstToken(), 121);
+ }
+ });
+ });
return keywords;
- function aggregate(node) {
- if (ts.isAwaitExpression(node)) {
- pushKeywordIf(keywords, node.getFirstToken(), 121);
- }
- if (!ts.isFunctionLike(node) && !ts.isClassLike(node) && !ts.isInterfaceDeclaration(node) && !ts.isModuleDeclaration(node) && !ts.isTypeAliasDeclaration(node) && !ts.isTypeNode(node)) {
- ts.forEachChild(node, aggregate);
- }
+ }
+ function getYieldOccurrences(node) {
+ var func = ts.getContainingFunction(node);
+ if (!func) {
+ return undefined;
+ }
+ var keywords = [];
+ ts.forEachChild(func, function (child) {
+ traverseWithoutCrossingFunction(child, function (node) {
+ if (ts.isYieldExpression(node)) {
+ pushKeywordIf(keywords, node.getFirstToken(), 116);
+ }
+ });
+ });
+ return keywords;
+ }
+ function traverseWithoutCrossingFunction(node, cb) {
+ cb(node);
+ if (!ts.isFunctionLike(node) && !ts.isClassLike(node) && !ts.isInterfaceDeclaration(node) && !ts.isModuleDeclaration(node) && !ts.isTypeAliasDeclaration(node) && !ts.isTypeNode(node)) {
+ ts.forEachChild(node, function (child) { return traverseWithoutCrossingFunction(child, cb); });
}
}
function getIfElseOccurrences(ifStatement, sourceFile) {
@@ -74614,6 +75036,10 @@ var ts;
var ts;
(function (ts) {
function createDocumentRegistry(useCaseSensitiveFileNames, currentDirectory) {
+ return createDocumentRegistryInternal(useCaseSensitiveFileNames, currentDirectory);
+ }
+ ts.createDocumentRegistry = createDocumentRegistry;
+ function createDocumentRegistryInternal(useCaseSensitiveFileNames, currentDirectory, externalCache) {
if (currentDirectory === void 0) { currentDirectory = ""; }
var buckets = ts.createMap();
var getCanonicalFileName = ts.createGetCanonicalFileName(!!useCaseSensitiveFileNames);
@@ -74634,8 +75060,7 @@ var ts;
entries.forEach(function (entry, name) {
sourceFiles.push({
name: name,
- refCount: entry.languageServiceRefCount,
- references: entry.owners.slice(0)
+ refCount: entry.languageServiceRefCount
});
});
sourceFiles.sort(function (x, y) { return y.refCount - x.refCount; });
@@ -74666,23 +75091,40 @@ var ts;
var bucket = getBucketForCompilationSettings(key, true);
var entry = bucket.get(path);
var scriptTarget = scriptKind === 6 ? 100 : compilationSettings.target;
+ if (!entry && externalCache) {
+ var sourceFile = externalCache.getDocument(key, path);
+ if (sourceFile) {
+ ts.Debug.assert(acquiring);
+ entry = {
+ sourceFile: sourceFile,
+ languageServiceRefCount: 0
+ };
+ bucket.set(path, entry);
+ }
+ }
if (!entry) {
var sourceFile = ts.createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget, version, false, scriptKind);
+ if (externalCache) {
+ externalCache.setDocument(key, path, sourceFile);
+ }
entry = {
sourceFile: sourceFile,
languageServiceRefCount: 1,
- owners: []
};
bucket.set(path, entry);
}
else {
if (entry.sourceFile.version !== version) {
entry.sourceFile = ts.updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version, scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot));
+ if (externalCache) {
+ externalCache.setDocument(key, path, entry.sourceFile);
+ }
}
if (acquiring) {
entry.languageServiceRefCount++;
}
}
+ ts.Debug.assert(entry.languageServiceRefCount !== 0);
return entry.sourceFile;
}
function releaseDocument(fileName, compilationSettings) {
@@ -74700,6 +75142,13 @@ var ts;
bucket.delete(path);
}
}
+ function getLanguageServiceRefCounts(path) {
+ return ts.arrayFrom(buckets.entries(), function (_a) {
+ var key = _a[0], bucket = _a[1];
+ var entry = bucket.get(path);
+ return [key, entry && entry.languageServiceRefCount];
+ });
+ }
return {
acquireDocument: acquireDocument,
acquireDocumentWithKey: acquireDocumentWithKey,
@@ -74707,11 +75156,12 @@ var ts;
updateDocumentWithKey: updateDocumentWithKey,
releaseDocument: releaseDocument,
releaseDocumentWithKey: releaseDocumentWithKey,
+ getLanguageServiceRefCounts: getLanguageServiceRefCounts,
reportStats: reportStats,
getKeyForCompilationSettings: getKeyForCompilationSettings
};
}
- ts.createDocumentRegistry = createDocumentRegistry;
+ ts.createDocumentRegistryInternal = createDocumentRegistryInternal;
})(ts || (ts = {}));
var ts;
(function (ts) {
@@ -74767,10 +75217,10 @@ var ts;
}
cancellationToken.throwIfCancellationRequested();
switch (direct.kind) {
- case 186:
+ case 187:
if (!isAvailableThroughGlobal) {
var parent = direct.parent;
- if (exportKind === 2 && parent.kind === 231) {
+ if (exportKind === 2 && parent.kind === 232) {
var name = parent.name;
if (name.kind === 71) {
directImports.push(name);
@@ -74782,12 +75232,12 @@ var ts;
break;
case 71:
break;
- case 242:
+ case 243:
handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1));
break;
- case 243:
+ case 244:
var namedBindings = direct.importClause && direct.importClause.namedBindings;
- if (namedBindings && namedBindings.kind === 245) {
+ if (namedBindings && namedBindings.kind === 246) {
handleNamespaceImport(direct, namedBindings.name);
}
else if (ts.isDefaultImport(direct)) {
@@ -74801,7 +75251,7 @@ var ts;
directImports.push(direct);
}
break;
- case 249:
+ case 250:
if (!direct.exportClause) {
handleDirectImports(getContainingModuleSymbol(direct, checker));
}
@@ -74809,7 +75259,7 @@ var ts;
directImports.push(direct);
}
break;
- case 178:
+ case 179:
directImports.push(direct);
break;
default:
@@ -74824,7 +75274,7 @@ var ts;
}
else if (!isAvailableThroughGlobal) {
var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration);
- ts.Debug.assert(sourceFileLike.kind === 273 || sourceFileLike.kind === 238);
+ ts.Debug.assert(sourceFileLike.kind === 274 || sourceFileLike.kind === 239);
if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) {
addIndirectUsers(sourceFileLike);
}
@@ -74873,7 +75323,7 @@ var ts;
}
return { importSearches: importSearches, singleReferences: singleReferences };
function handleImport(decl) {
- if (decl.kind === 242) {
+ if (decl.kind === 243) {
if (isExternalModuleImportEquals(decl)) {
handleNamespaceImportLike(decl.name);
}
@@ -74883,7 +75333,7 @@ var ts;
handleNamespaceImportLike(decl);
return;
}
- if (decl.kind === 178) {
+ if (decl.kind === 179) {
if (decl.qualifier) {
if (ts.isIdentifier(decl.qualifier) && decl.qualifier.escapedText === ts.symbolName(exportSymbol)) {
singleReferences.push(decl.qualifier);
@@ -74897,7 +75347,7 @@ var ts;
if (decl.moduleSpecifier.kind !== 9) {
return;
}
- if (decl.kind === 249) {
+ if (decl.kind === 250) {
searchForNamedImport(decl.exportClause);
return;
}
@@ -74906,7 +75356,7 @@ var ts;
return;
}
var namedBindings = importClause.namedBindings;
- if (namedBindings && namedBindings.kind === 245) {
+ if (namedBindings && namedBindings.kind === 246) {
handleNamespaceImportLike(namedBindings.name);
return;
}
@@ -74946,7 +75396,7 @@ var ts;
}
}
else {
- var localSymbol = element.kind === 251 && element.propertyName
+ var localSymbol = element.kind === 252 && element.propertyName
? checker.getExportSpecifierLocalTargetSymbol(element)
: checker.getSymbolAtLocation(name);
addSearch(name, localSymbol);
@@ -74959,7 +75409,7 @@ var ts;
}
function findNamespaceReExports(sourceFileLike, name, checker) {
var namespaceImportSymbol = checker.getSymbolAtLocation(name);
- return forEachPossibleImportOrExportStatement(sourceFileLike, function (statement) {
+ return !!forEachPossibleImportOrExportStatement(sourceFileLike, function (statement) {
if (!ts.isExportDeclaration(statement))
return;
var exportClause = statement.exportClause, moduleSpecifier = statement.moduleSpecifier;
@@ -74973,7 +75423,7 @@ var ts;
for (var _i = 0, sourceFiles_5 = sourceFiles; _i < sourceFiles_5.length; _i++) {
var referencingFile = sourceFiles_5[_i];
var searchSourceFile = searchModuleSymbol.valueDeclaration;
- if (searchSourceFile.kind === 273) {
+ if (searchSourceFile.kind === 274) {
for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) {
var ref = _b[_a];
if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) {
@@ -75018,7 +75468,7 @@ var ts;
return map;
}
function forEachPossibleImportOrExportStatement(sourceFileLike, action) {
- return ts.forEach(sourceFileLike.kind === 273 ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) {
+ return ts.forEach(sourceFileLike.kind === 274 ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) {
return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action));
});
}
@@ -75032,15 +75482,15 @@ var ts;
else {
forEachPossibleImportOrExportStatement(sourceFile, function (statement) {
switch (statement.kind) {
- case 249:
- case 243: {
+ case 250:
+ case 244: {
var decl = statement;
if (decl.moduleSpecifier && ts.isStringLiteral(decl.moduleSpecifier)) {
action(decl, decl.moduleSpecifier);
}
break;
}
- case 242: {
+ case 243: {
var decl = statement;
if (isExternalModuleImportEquals(decl)) {
action(decl, decl.moduleReference.expression);
@@ -75055,10 +75505,11 @@ var ts;
return comingFromExport ? getExport() : getExport() || getImport();
function getExport() {
var parent = node.parent;
+ var grandParent = parent.parent;
if (symbol.exportSymbol) {
- if (parent.kind === 184) {
- return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(parent.parent)
- ? getSpecialPropertyExport(parent.parent, false)
+ if (parent.kind === 185) {
+ return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(grandParent)
+ ? getSpecialPropertyExport(grandParent, false)
: undefined;
}
else {
@@ -75082,14 +75533,14 @@ var ts;
else if (ts.isExportAssignment(parent)) {
return getExportAssignmentExport(parent);
}
- else if (ts.isExportAssignment(parent.parent)) {
- return getExportAssignmentExport(parent.parent);
+ else if (ts.isExportAssignment(grandParent)) {
+ return getExportAssignmentExport(grandParent);
}
else if (ts.isBinaryExpression(parent)) {
return getSpecialPropertyExport(parent, true);
}
- else if (ts.isBinaryExpression(parent.parent)) {
- return getSpecialPropertyExport(parent.parent, true);
+ else if (ts.isBinaryExpression(grandParent)) {
+ return getSpecialPropertyExport(grandParent, true);
}
else if (ts.isJSDocTypedefTag(parent)) {
return exportInfo(symbol, 0);
@@ -75155,13 +75606,16 @@ var ts;
else if (ts.isBinaryExpression(decl)) {
return ts.Debug.assertDefined(decl.right.symbol);
}
+ else if (ts.isSourceFile(decl)) {
+ return ts.Debug.assertDefined(decl.symbol);
+ }
return ts.Debug.fail();
}
function getExportNode(parent, node) {
- if (parent.kind === 231) {
+ if (parent.kind === 232) {
var p = parent;
return p.name !== node ? undefined :
- p.parent.kind === 268 ? undefined : p.parent.parent.kind === 213 ? p.parent.parent : undefined;
+ p.parent.kind === 269 ? undefined : p.parent.parent.kind === 214 ? p.parent.parent : undefined;
}
else {
return parent;
@@ -75170,14 +75624,14 @@ var ts;
function isNodeImport(node) {
var parent = node.parent;
switch (parent.kind) {
- case 242:
+ case 243:
return parent.name === node && isExternalModuleImportEquals(parent)
? { isNamedImport: false }
: undefined;
- case 247:
+ case 248:
return parent.propertyName ? undefined : { isNamedImport: true };
- case 244:
case 245:
+ case 246:
ts.Debug.assert(parent.name === node);
return { isNamedImport: false };
default:
@@ -75207,21 +75661,21 @@ var ts;
return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol);
}
function getSourceFileLikeForImportDeclaration(node) {
- if (node.kind === 186) {
+ if (node.kind === 187) {
return node.getSourceFile();
}
var parent = node.parent;
- if (parent.kind === 273) {
+ if (parent.kind === 274) {
return parent;
}
- ts.Debug.assert(parent.kind === 239);
+ ts.Debug.assert(parent.kind === 240);
return ts.cast(parent.parent, isAmbientModuleDeclaration);
}
function isAmbientModuleDeclaration(node) {
- return node.kind === 238 && node.name.kind === 9;
+ return node.kind === 239 && node.name.kind === 9;
}
function isExternalModuleImportEquals(eq) {
- return eq.moduleReference.kind === 253 && eq.moduleReference.expression.kind === 9;
+ return eq.moduleReference.kind === 254 && eq.moduleReference.expression.kind === 9;
}
})(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {}));
})(ts || (ts = {}));
@@ -75230,7 +75684,7 @@ var ts;
var FindAllReferences;
(function (FindAllReferences) {
function nodeEntry(node, isInString) {
- return { type: "node", node: node, isInString: isInString };
+ return { type: "node", node: node.name || node, isInString: isInString };
}
FindAllReferences.nodeEntry = nodeEntry;
function findReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position) {
@@ -75254,11 +75708,11 @@ var ts;
}
FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition;
function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) {
- if (node.kind === 273) {
+ if (node.kind === 274) {
return undefined;
}
var checker = program.getTypeChecker();
- if (node.parent.kind === 270) {
+ if (node.parent.kind === 271) {
var result_5 = [];
FindAllReferences.Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_5.push(nodeEntry(node)); });
return result_5;
@@ -75359,13 +75813,13 @@ var ts;
if (symbol) {
return getDefinitionKindAndDisplayParts(symbol, checker, node);
}
- else if (node.kind === 183) {
+ else if (node.kind === 184) {
return {
kind: "interface",
displayParts: [ts.punctuationPart(19), ts.textPart("object literal"), ts.punctuationPart(20)]
};
}
- else if (node.kind === 204) {
+ else if (node.kind === 205) {
return {
kind: "local class",
displayParts: [ts.punctuationPart(19), ts.textPart("anonymous local class"), ts.punctuationPart(20)]
@@ -75430,19 +75884,20 @@ var ts;
}
var moduleReferences = ts.emptyArray;
var moduleSourceFile = isModuleSymbol(symbol);
+ var referencedNode = node;
if (moduleSourceFile) {
var exportEquals = symbol.exports.get("export=");
moduleReferences = getReferencedSymbolsForModule(program, symbol, !!exportEquals, sourceFiles, sourceFilesSet);
if (!exportEquals || !sourceFilesSet.has(moduleSourceFile.fileName))
return moduleReferences;
symbol = ts.skipAlias(exportEquals, checker);
- node = undefined;
+ referencedNode = undefined;
}
- return ts.concatenate(moduleReferences, getReferencedSymbolsForSymbol(symbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options));
+ return ts.concatenate(moduleReferences, getReferencedSymbolsForSymbol(symbol, referencedNode, sourceFiles, sourceFilesSet, checker, cancellationToken, options));
}
Core.getReferencedSymbolsForNode = getReferencedSymbolsForNode;
function isModuleSymbol(symbol) {
- return symbol.flags & 1536 && ts.find(symbol.declarations, ts.isSourceFile);
+ return symbol.flags & 1536 ? ts.find(symbol.declarations, ts.isSourceFile) : undefined;
}
function getReferencedSymbolsForModule(program, symbol, excludeImportTypeOfExportEquals, sourceFiles, sourceFilesSet) {
ts.Debug.assert(!!symbol.valueDeclaration);
@@ -75468,9 +75923,9 @@ var ts;
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var decl = _a[_i];
switch (decl.kind) {
- case 273:
+ case 274:
break;
- case 238:
+ case 239:
if (sourceFilesSet.has(decl.getSourceFile().fileName)) {
references.push({ type: "node", node: decl.name });
}
@@ -75510,7 +75965,7 @@ var ts;
searchForImportsOfExport(node, symbol, { exportingModuleSymbol: ts.Debug.assertDefined(symbol.parent, "Expected export symbol to have a parent"), exportKind: 1 }, state);
}
else {
- var search = state.createSearch(node, symbol, undefined, { allSearchSymbols: node ? populateSearchSymbolSet(symbol, node, checker, options.implementations) : [symbol] });
+ var search = state.createSearch(node, symbol, undefined, { allSearchSymbols: node ? populateSearchSymbolSet(symbol, node, checker, !!options.implementations) : [symbol] });
var scope = getSymbolScope(symbol);
if (scope) {
getReferencesInContainer(scope, scope.getSourceFile(), search, state, !(ts.isSourceFile(scope) && !ts.contains(sourceFiles, scope)));
@@ -75583,13 +76038,13 @@ var ts;
State.prototype.getImportSearches = function (exportSymbol, exportInfo) {
if (!this.importTracker)
this.importTracker = FindAllReferences.createImportTracker(this.sourceFiles, this.sourceFilesSet, this.checker, this.cancellationToken);
- return this.importTracker(exportSymbol, exportInfo, this.options.isForRename);
+ return this.importTracker(exportSymbol, exportInfo, !!this.options.isForRename);
};
State.prototype.createSearch = function (location, symbol, comingFrom, searchOptions) {
if (searchOptions === void 0) { searchOptions = {}; }
var _a = searchOptions.text, text = _a === void 0 ? ts.stripQuotes(ts.unescapeLeadingUnderscores((ts.getLocalSymbolForExportDefault(symbol) || symbol).escapedName)) : _a, _b = searchOptions.allSearchSymbols, allSearchSymbols = _b === void 0 ? [symbol] : _b;
var escapedText = ts.escapeLeadingUnderscores(text);
- var parents = this.options.implementations && location && getParentSymbolsOfPropertyAccess(location, symbol, this.checker);
+ var parents = this.options.implementations && location ? getParentSymbolsOfPropertyAccess(location, symbol, this.checker) : undefined;
return { symbol: symbol, comingFrom: comingFrom, text: text, escapedText: escapedText, parents: parents, allSearchSymbols: allSearchSymbols, includes: function (sym) { return ts.contains(allSearchSymbols, sym); } };
};
State.prototype.referenceAdder = function (searchSymbol) {
@@ -75675,13 +76130,14 @@ var ts;
}
}
function getPropertySymbolOfDestructuringAssignment(location, checker) {
- return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(location.parent.parent) &&
- checker.getPropertySymbolOfDestructuringAssignment(location);
+ return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(location.parent.parent)
+ ? checker.getPropertySymbolOfDestructuringAssignment(location)
+ : undefined;
}
function getObjectBindingElementWithoutPropertyName(symbol) {
- var bindingElement = ts.getDeclarationOfKind(symbol, 181);
+ var bindingElement = ts.getDeclarationOfKind(symbol, 182);
if (bindingElement &&
- bindingElement.parent.kind === 179 &&
+ bindingElement.parent.kind === 180 &&
ts.isIdentifier(bindingElement.name) &&
!bindingElement.propertyName) {
return bindingElement;
@@ -75693,7 +76149,7 @@ var ts;
}
function getSymbolScope(symbol) {
var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration;
- if (valueDeclaration && (valueDeclaration.kind === 191 || valueDeclaration.kind === 204)) {
+ if (valueDeclaration && (valueDeclaration.kind === 192 || valueDeclaration.kind === 205)) {
return valueDeclaration;
}
if (!declarations) {
@@ -75702,7 +76158,7 @@ var ts;
if (flags & (4 | 8192)) {
var privateDeclaration = ts.find(declarations, function (d) { return ts.hasModifier(d, 8); });
if (privateDeclaration) {
- return ts.getAncestor(privateDeclaration, 234);
+ return ts.getAncestor(privateDeclaration, 235);
}
return undefined;
}
@@ -75714,13 +76170,13 @@ var ts;
return undefined;
}
var scope;
- for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) {
- var declaration = declarations_9[_i];
+ for (var _i = 0, declarations_10 = declarations; _i < declarations_10.length; _i++) {
+ var declaration = declarations_10[_i];
var container = ts.getContainerNode(declaration);
if (scope && scope !== container) {
return undefined;
}
- if (!container || container.kind === 273 && !ts.isExternalOrCommonJsModule(container)) {
+ if (!container || container.kind === 274 && !ts.isExternalOrCommonJsModule(container)) {
return undefined;
}
scope = container;
@@ -75728,19 +76184,28 @@ var ts;
return exposedByParent ? scope.getSourceFile() : scope;
}
function isSymbolReferencedInFile(definition, checker, sourceFile) {
- var symbol = checker.getSymbolAtLocation(definition);
- if (!symbol)
- return true;
- return getPossibleSymbolReferenceNodes(sourceFile, symbol.name).some(function (token) {
- if (!ts.isIdentifier(token) || token === definition || token.escapedText !== definition.escapedText)
- return false;
- var referenceSymbol = checker.getSymbolAtLocation(token);
- return referenceSymbol === symbol
- || checker.getShorthandAssignmentValueSymbol(token.parent) === symbol
- || ts.isExportSpecifier(token.parent) && getLocalSymbolForExportSpecifier(token, referenceSymbol, token.parent, checker) === symbol;
- });
+ return eachSymbolReferenceInFile(definition, checker, sourceFile, function () { return true; }) || false;
}
Core.isSymbolReferencedInFile = isSymbolReferencedInFile;
+ function eachSymbolReferenceInFile(definition, checker, sourceFile, cb) {
+ var symbol = checker.getSymbolAtLocation(definition);
+ if (!symbol)
+ return undefined;
+ for (var _i = 0, _a = getPossibleSymbolReferenceNodes(sourceFile, symbol.name); _i < _a.length; _i++) {
+ var token = _a[_i];
+ if (!ts.isIdentifier(token) || token === definition || token.escapedText !== definition.escapedText)
+ continue;
+ var referenceSymbol = checker.getSymbolAtLocation(token);
+ if (referenceSymbol === symbol
+ || checker.getShorthandAssignmentValueSymbol(token.parent) === symbol
+ || ts.isExportSpecifier(token.parent) && getLocalSymbolForExportSpecifier(token, referenceSymbol, token.parent, checker) === symbol) {
+ var res = cb(token);
+ if (res)
+ return res;
+ }
+ }
+ }
+ Core.eachSymbolReferenceInFile = eachSymbolReferenceInFile;
function getPossibleSymbolReferenceNodes(sourceFile, symbolName, container) {
if (container === void 0) { container = sourceFile; }
return getPossibleSymbolReferencePositions(sourceFile, symbolName, container).map(function (pos) { return ts.getTouchingPropertyName(sourceFile, pos, true); });
@@ -75890,7 +76355,8 @@ var ts;
if (!(referenceLocation === propertyName && state.options.isForRename)) {
var exportKind = referenceLocation.originalKeywordKind === 79 ? 1 : 0;
var exportInfo = FindAllReferences.getExportInfo(referenceSymbol, exportKind, state.checker);
- ts.Debug.assert(!!exportInfo);
+ if (!exportInfo)
+ return ts.Debug.fail();
searchForImportsOfExport(referenceLocation, referenceSymbol, exportInfo, state);
}
if (search.comingFrom !== 1 && exportDeclaration.moduleSpecifier && !propertyName) {
@@ -75988,12 +76454,12 @@ var ts;
for (var _i = 0, _a = classSymbol.members.get("__constructor").declarations; _i < _a.length; _i++) {
var decl = _a[_i];
var ctrKeyword = ts.findChildOfKind(decl, 123, sourceFile);
- ts.Debug.assert(decl.kind === 154 && !!ctrKeyword);
+ ts.Debug.assert(decl.kind === 155 && !!ctrKeyword);
addNode(ctrKeyword);
}
classSymbol.exports.forEach(function (member) {
var decl = member.valueDeclaration;
- if (decl && decl.kind === 153) {
+ if (decl && decl.kind === 154) {
var body = decl.body;
if (body) {
forEachDescendantOfKind(body, 99, function (thisKeyword) {
@@ -76006,14 +76472,13 @@ var ts;
});
}
function findSuperConstructorAccesses(cls, addNode) {
- var symbol = cls.symbol;
- var ctr = symbol.members.get("__constructor");
+ var ctr = cls.symbol.members.get("__constructor");
if (!ctr) {
return;
}
for (var _i = 0, _a = ctr.declarations; _i < _a.length; _i++) {
var decl = _a[_i];
- ts.Debug.assert(decl.kind === 154);
+ ts.Debug.assert(decl.kind === 155);
var body = decl.body;
if (body) {
forEachDescendantOfKind(body, 97, function (node) {
@@ -76026,13 +76491,13 @@ var ts;
}
function addImplementationReferences(refNode, addReference, state) {
if (ts.isDeclarationName(refNode) && isImplementation(refNode.parent)) {
- addReference(refNode.parent);
+ addReference(refNode);
return;
}
if (refNode.kind !== 71) {
return;
}
- if (refNode.parent.kind === 270) {
+ if (refNode.parent.kind === 271) {
getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference);
}
var containingClass = getContainingClassIfInHeritageClause(refNode);
@@ -76048,7 +76513,7 @@ var ts;
}
else if (ts.isFunctionLike(typeHavingNode) && typeHavingNode.body) {
var body = typeHavingNode.body;
- if (body.kind === 212) {
+ if (body.kind === 213) {
ts.forEachReturnStatement(body, function (returnStatement) {
if (returnStatement.expression)
addIfImplementation(returnStatement.expression);
@@ -76073,13 +76538,13 @@ var ts;
}
function isImplementationExpression(node) {
switch (node.kind) {
- case 190:
- return isImplementationExpression(node.expression);
- case 192:
case 191:
+ return isImplementationExpression(node.expression);
+ case 193:
+ case 192:
+ case 184:
+ case 205:
case 183:
- case 204:
- case 182:
return true;
default:
return false;
@@ -76111,13 +76576,13 @@ var ts;
}
var staticFlag = 32;
switch (searchSpaceNode.kind) {
- case 151:
- case 150:
- case 153:
case 152:
+ case 151:
case 154:
+ case 153:
case 155:
case 156:
+ case 157:
staticFlag &= ts.getModifierFlags(searchSpaceNode);
searchSpaceNode = searchSpaceNode.parent;
break;
@@ -76138,30 +76603,30 @@ var ts;
var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false);
var staticFlag = 32;
switch (searchSpaceNode.kind) {
+ case 154:
case 153:
- case 152:
if (ts.isObjectLiteralMethod(searchSpaceNode)) {
break;
}
+ case 152:
case 151:
- case 150:
- case 154:
case 155:
case 156:
+ case 157:
staticFlag &= ts.getModifierFlags(searchSpaceNode);
searchSpaceNode = searchSpaceNode.parent;
break;
- case 273:
+ case 274:
if (ts.isExternalModule(searchSpaceNode)) {
return undefined;
}
- case 233:
- case 191:
+ case 234:
+ case 192:
break;
default:
return undefined;
}
- var references = ts.flatMap(searchSpaceNode.kind === 273 ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) {
+ var references = ts.flatMap(searchSpaceNode.kind === 274 ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) {
cancellationToken.throwIfCancellationRequested();
return getPossibleSymbolReferenceNodes(sourceFile, "this", ts.isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter(function (node) {
if (!ts.isThis(node)) {
@@ -76169,17 +76634,17 @@ var ts;
}
var container = ts.getThisContainer(node, false);
switch (searchSpaceNode.kind) {
- case 191:
- case 233:
- return searchSpaceNode.symbol === container.symbol;
- case 153:
- case 152:
- return ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol;
- case 204:
+ case 192:
case 234:
+ return searchSpaceNode.symbol === container.symbol;
+ case 154:
+ case 153:
+ return ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol;
+ case 205:
+ case 235:
return container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32) === staticFlag;
- case 273:
- return container.kind === 273 && !ts.isExternalModule(container);
+ case 274:
+ return container.kind === 274 && !ts.isExternalModule(container);
}
});
}).map(function (n) { return FindAllReferences.nodeEntry(n); });
@@ -76234,24 +76699,11 @@ var ts;
return ts.firstDefined(checker.getRootSymbols(sym), function (rootSymbol) {
return cbSymbol(sym, rootSymbol)
|| (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64) && allowBaseTypes(rootSymbol)
- ? getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, checker, function (base) { return cbSymbol(sym, rootSymbol, base); })
+ ? ts.getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, checker, function (base) { return cbSymbol(sym, rootSymbol, base); })
: undefined);
});
}
}
- function getPropertySymbolsFromBaseTypes(symbol, propertyName, checker, cb) {
- var seen = ts.createMap();
- return recur(symbol);
- function recur(symbol) {
- if (!(symbol.flags & (32 | 64)) || !ts.addToSeen(seen, ts.getSymbolId(symbol)))
- return;
- return ts.firstDefined(symbol.declarations, function (declaration) { return ts.firstDefined(ts.getAllSuperTypeNodes(declaration), function (typeReference) {
- var type = checker.getTypeAtLocation(typeReference);
- var propertySymbol = type && type.symbol && checker.getPropertyOfType(type, propertyName);
- return propertySymbol && (ts.firstDefined(checker.getRootSymbols(propertySymbol), cb) || recur(type.symbol));
- }); });
- }
- }
function getRelatedSymbol(search, referenceSymbol, referenceLocation, state) {
var checker = state.checker;
return forEachRelatedSymbol(referenceSymbol, referenceLocation, checker, function (sym, rootSymbol, baseSymbol) { return search.includes(baseSymbol || rootSymbol || sym)
@@ -76274,8 +76726,8 @@ var ts;
var lastIterationMeaning = void 0;
do {
lastIterationMeaning = meaning;
- for (var _i = 0, declarations_10 = declarations; _i < declarations_10.length; _i++) {
- var declaration = declarations_10[_i];
+ for (var _i = 0, declarations_11 = declarations; _i < declarations_11.length; _i++) {
+ var declaration = declarations_11[_i];
var declarationMeaning = ts.getMeaningFromDeclaration(declaration);
if (declarationMeaning & meaning) {
meaning |= declarationMeaning;
@@ -76328,6 +76780,179 @@ var ts;
})(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {}));
})(ts || (ts = {}));
var ts;
+(function (ts) {
+ function getEditsForFileRename(program, oldFileOrDirPath, newFileOrDirPath, host, formatContext, preferences) {
+ var useCaseSensitiveFileNames = ts.hostUsesCaseSensitiveFileNames(host);
+ var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
+ var oldToNew = getPathUpdater(oldFileOrDirPath, newFileOrDirPath, getCanonicalFileName);
+ var newToOld = getPathUpdater(newFileOrDirPath, oldFileOrDirPath, getCanonicalFileName);
+ return ts.textChanges.ChangeTracker.with({ host: host, formatContext: formatContext }, function (changeTracker) {
+ updateTsconfigFiles(program, changeTracker, oldToNew, newFileOrDirPath, host.getCurrentDirectory(), useCaseSensitiveFileNames);
+ updateImports(program, changeTracker, oldToNew, newToOld, host, getCanonicalFileName, preferences);
+ });
+ }
+ ts.getEditsForFileRename = getEditsForFileRename;
+ function getPathUpdater(oldFileOrDirPath, newFileOrDirPath, getCanonicalFileName) {
+ var canonicalOldPath = getCanonicalFileName(oldFileOrDirPath);
+ return function (path) {
+ var canonicalPath = getCanonicalFileName(path);
+ if (canonicalPath === canonicalOldPath)
+ return newFileOrDirPath;
+ var suffix = ts.tryRemoveDirectoryPrefix(canonicalPath, canonicalOldPath);
+ return suffix === undefined ? undefined : newFileOrDirPath + "/" + suffix;
+ };
+ }
+ function updateTsconfigFiles(program, changeTracker, oldToNew, newFileOrDirPath, currentDirectory, useCaseSensitiveFileNames) {
+ var configFile = program.getCompilerOptions().configFile;
+ if (!configFile)
+ return;
+ var configDir = ts.getDirectoryPath(configFile.fileName);
+ var jsonObjectLiteral = ts.getTsConfigObjectLiteralExpression(configFile);
+ if (!jsonObjectLiteral)
+ return;
+ forEachProperty(jsonObjectLiteral, function (property, propertyName) {
+ switch (propertyName) {
+ case "files":
+ case "include":
+ case "exclude": {
+ var foundExactMatch = updatePaths(property);
+ if (!foundExactMatch && propertyName === "include" && ts.isArrayLiteralExpression(property.initializer)) {
+ var includes = ts.mapDefined(property.initializer.elements, function (e) { return ts.isStringLiteral(e) ? e.text : undefined; });
+ var matchers = ts.getFileMatcherPatterns(configDir, [], includes, useCaseSensitiveFileNames, currentDirectory);
+ if (!ts.getRegexFromPattern(ts.Debug.assertDefined(matchers.includeFilePattern), useCaseSensitiveFileNames).test(newFileOrDirPath)) {
+ changeTracker.insertNodeAfter(configFile, ts.last(property.initializer.elements), ts.createStringLiteral(relativePath(newFileOrDirPath)));
+ }
+ }
+ break;
+ }
+ case "compilerOptions":
+ forEachProperty(property.initializer, function (property, propertyName) {
+ var option = ts.getOptionFromName(propertyName);
+ if (option && (option.isFilePath || option.type === "list" && option.element.isFilePath)) {
+ updatePaths(property);
+ }
+ else if (propertyName === "paths") {
+ forEachProperty(property.initializer, function (pathsProperty) {
+ if (!ts.isArrayLiteralExpression(pathsProperty.initializer))
+ return;
+ for (var _i = 0, _a = pathsProperty.initializer.elements; _i < _a.length; _i++) {
+ var e = _a[_i];
+ tryUpdateString(e);
+ }
+ });
+ }
+ });
+ break;
+ }
+ });
+ function updatePaths(property) {
+ var elements = ts.isArrayLiteralExpression(property.initializer) ? property.initializer.elements : [property.initializer];
+ var foundExactMatch = false;
+ for (var _i = 0, elements_5 = elements; _i < elements_5.length; _i++) {
+ var element = elements_5[_i];
+ foundExactMatch = tryUpdateString(element) || foundExactMatch;
+ }
+ return foundExactMatch;
+ }
+ function tryUpdateString(element) {
+ if (!ts.isStringLiteral(element))
+ return false;
+ var elementFileName = combinePathsSafe(configDir, element.text);
+ var updated = oldToNew(elementFileName);
+ if (updated !== undefined) {
+ changeTracker.replaceRangeWithText(configFile, createStringRange(element, configFile), relativePath(updated));
+ return true;
+ }
+ return false;
+ }
+ function relativePath(path) {
+ return ts.getRelativePathFromDirectory(configDir, path, !useCaseSensitiveFileNames);
+ }
+ }
+ function updateImports(program, changeTracker, oldToNew, newToOld, host, getCanonicalFileName, preferences) {
+ var _loop_14 = function (sourceFile) {
+ var newImportFromPath = oldToNew(sourceFile.fileName) || sourceFile.fileName;
+ var newImportFromDirectory = ts.getDirectoryPath(newImportFromPath);
+ var oldFromNew = newToOld(sourceFile.fileName);
+ var oldImportFromPath = oldFromNew || sourceFile.fileName;
+ var oldImportFromDirectory = ts.getDirectoryPath(oldImportFromPath);
+ updateImportsWorker(sourceFile, changeTracker, function (referenceText) {
+ if (!ts.pathIsRelative(referenceText))
+ return undefined;
+ var oldAbsolute = combinePathsSafe(oldImportFromDirectory, referenceText);
+ var newAbsolute = oldToNew(oldAbsolute);
+ return newAbsolute === undefined ? undefined : ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(newImportFromDirectory, newAbsolute, getCanonicalFileName));
+ }, function (importLiteral) {
+ var toImport = oldFromNew !== undefined
+ ? getSourceFileToImportFromResolved(ts.resolveModuleName(importLiteral.text, oldImportFromPath, program.getCompilerOptions(), host), oldToNew, program)
+ : getSourceFileToImport(importLiteral, sourceFile, program, host, oldToNew);
+ return toImport === undefined ? undefined : ts.moduleSpecifiers.getModuleSpecifier(program, sourceFile, newImportFromPath, toImport, host, preferences);
+ });
+ };
+ for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) {
+ var sourceFile = _a[_i];
+ _loop_14(sourceFile);
+ }
+ }
+ function combineNormal(pathA, pathB) {
+ return ts.normalizePath(ts.combinePaths(pathA, pathB));
+ }
+ function combinePathsSafe(pathA, pathB) {
+ return ts.ensurePathIsNonModuleName(combineNormal(pathA, pathB));
+ }
+ function getSourceFileToImport(importLiteral, importingSourceFile, program, host, oldToNew) {
+ var symbol = program.getTypeChecker().getSymbolAtLocation(importLiteral);
+ if (symbol) {
+ if (symbol.declarations.some(function (d) { return ts.isAmbientModule(d); }))
+ return undefined;
+ var oldFileName = ts.find(symbol.declarations, ts.isSourceFile).fileName;
+ return oldToNew(oldFileName) || oldFileName;
+ }
+ else {
+ var resolved = host.resolveModuleNames
+ ? host.getResolvedModuleWithFailedLookupLocationsFromCache && host.getResolvedModuleWithFailedLookupLocationsFromCache(importLiteral.text, importingSourceFile.fileName)
+ : program.getResolvedModuleWithFailedLookupLocationsFromCache(importLiteral.text, importingSourceFile.fileName);
+ return getSourceFileToImportFromResolved(resolved, oldToNew, program);
+ }
+ }
+ function getSourceFileToImportFromResolved(resolved, oldToNew, program) {
+ return resolved && ((resolved.resolvedModule && getIfInProgram(resolved.resolvedModule.resolvedFileName)) || ts.firstDefined(resolved.failedLookupLocations, getIfInProgram));
+ function getIfInProgram(oldLocation) {
+ var newLocation = oldToNew(oldLocation);
+ return program.getSourceFile(oldLocation) || newLocation !== undefined && program.getSourceFile(newLocation)
+ ? newLocation || oldLocation
+ : undefined;
+ }
+ }
+ function updateImportsWorker(sourceFile, changeTracker, updateRef, updateImport) {
+ for (var _i = 0, _a = sourceFile.referencedFiles; _i < _a.length; _i++) {
+ var ref = _a[_i];
+ var updated = updateRef(ref.fileName);
+ if (updated !== undefined && updated !== sourceFile.text.slice(ref.pos, ref.end))
+ changeTracker.replaceRangeWithText(sourceFile, ref, updated);
+ }
+ for (var _b = 0, _c = sourceFile.imports; _b < _c.length; _b++) {
+ var importStringLiteral = _c[_b];
+ var updated = updateImport(importStringLiteral);
+ if (updated !== undefined && updated !== importStringLiteral.text)
+ changeTracker.replaceRangeWithText(sourceFile, createStringRange(importStringLiteral, sourceFile), updated);
+ }
+ }
+ function createStringRange(node, sourceFile) {
+ return ts.createTextRange(node.getStart(sourceFile) + 1, node.end - 1);
+ }
+ function forEachProperty(objectLiteral, cb) {
+ if (!ts.isObjectLiteralExpression(objectLiteral))
+ return;
+ for (var _i = 0, _a = objectLiteral.properties; _i < _a.length; _i++) {
+ var property = _a[_i];
+ if (ts.isPropertyAssignment(property) && ts.isStringLiteral(property.name)) {
+ cb(property, property.name.text);
+ }
+ }
+ }
+})(ts || (ts = {}));
+var ts;
(function (ts) {
var GoToDefinition;
(function (GoToDefinition) {
@@ -76340,6 +76965,7 @@ var ts;
if (node === sourceFile) {
return undefined;
}
+ var parent = node.parent;
if (ts.isJumpStatementTarget(node)) {
var label = ts.getTargetLabel(node.parent, node.text);
return label ? [createDefinitionInfoFromName(label, "label", node.text, undefined)] : undefined;
@@ -76353,17 +76979,17 @@ var ts;
if (calledDeclaration) {
var sigInfo = createDefinitionFromSignatureDeclaration(typeChecker, calledDeclaration);
return typeChecker.getRootSymbols(symbol).some(function (s) { return calledDeclaration.symbol === s || calledDeclaration.symbol.parent === s; }) ||
- symbol.declarations.some(function (d) { return ts.isVariableDeclaration(d) && d.initializer && ts.isRequireCall(d.initializer, false); })
+ symbol.declarations.some(function (d) { return ts.isVariableDeclaration(d) && !!d.initializer && ts.isRequireCall(d.initializer, false); })
? [sigInfo]
: [sigInfo].concat(getDefinitionFromSymbol(typeChecker, symbol, node));
}
- if (node.parent.kind === 270) {
+ if (node.parent.kind === 271) {
var shorthandSymbol_1 = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration);
return shorthandSymbol_1 ? shorthandSymbol_1.declarations.map(function (decl) { return createDefinitionInfo(decl, typeChecker, shorthandSymbol_1, node); }) : [];
}
- if (ts.isPropertyName(node) && ts.isBindingElement(node.parent) && ts.isObjectBindingPattern(node.parent.parent) &&
- (node === (node.parent.propertyName || node.parent.name))) {
- var type = typeChecker.getTypeAtLocation(node.parent.parent);
+ if (ts.isPropertyName(node) && ts.isBindingElement(parent) && ts.isObjectBindingPattern(parent.parent) &&
+ (node === (parent.propertyName || parent.name))) {
+ var type = typeChecker.getTypeAtLocation(parent.parent);
if (type) {
var propSymbols = ts.getPropertySymbolsFromType(type, node);
if (propSymbols) {
@@ -76405,7 +77031,7 @@ var ts;
if (!type) {
return undefined;
}
- if (type.isUnion() && !(type.flags & 16)) {
+ if (type.isUnion() && !(type.flags & 32)) {
return ts.flatMap(type.types, function (t) { return t.symbol && getDefinitionFromSymbol(typeChecker, t.symbol, node); });
}
return type.symbol && getDefinitionFromSymbol(typeChecker, type.symbol, node);
@@ -76452,11 +77078,11 @@ var ts;
return true;
}
switch (declaration.kind) {
- case 244:
- case 242:
+ case 245:
+ case 243:
return true;
- case 247:
- return declaration.parent.kind === 246;
+ case 248:
+ return declaration.parent.kind === 247;
default:
return false;
}
@@ -76516,13 +77142,13 @@ var ts;
kind: "script",
name: name,
containerName: undefined,
- containerKind: undefined
+ containerKind: undefined,
};
}
function getAncestorCallLikeExpression(node) {
var target = climbPastManyPropertyAccesses(node);
var callLike = target.parent;
- return callLike && ts.isCallLikeExpression(callLike) && ts.getInvokedExpression(callLike) === target && callLike;
+ return callLike && ts.isCallLikeExpression(callLike) && ts.getInvokedExpression(callLike) === target ? callLike : undefined;
}
function climbPastManyPropertyAccesses(node) {
return ts.isRightSideOfPropertyAccess(node) ? climbPastManyPropertyAccesses(node.parent) : node;
@@ -76602,11 +77228,11 @@ var ts;
JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations;
function getCommentHavingNodes(declaration) {
switch (declaration.kind) {
+ case 293:
+ case 298:
+ return [declaration];
case 292:
case 297:
- return [declaration];
- case 291:
- case 296:
return [declaration, declaration.parent];
default:
return ts.getJSDocCommentsAndTags(declaration);
@@ -76626,16 +77252,16 @@ var ts;
function getCommentText(tag) {
var comment = tag.comment;
switch (tag.kind) {
- case 289:
+ case 290:
return withNode(tag.class);
- case 295:
- return withList(tag.typeParameters);
- case 294:
- return withNode(tag.typeExpression);
case 296:
- case 291:
+ return withList(tag.typeParameters);
+ case 295:
+ return withNode(tag.typeExpression);
case 297:
case 292:
+ case 298:
+ case 293:
var name = tag.name;
return name ? withNode(name) : comment;
default:
@@ -76737,7 +77363,7 @@ var ts;
return undefined;
}
var tokenAtPos = ts.getTokenAtPosition(sourceFile, position, false);
- var tokenStart = tokenAtPos.getStart();
+ var tokenStart = tokenAtPos.getStart(sourceFile);
if (!tokenAtPos || tokenStart < position) {
return undefined;
}
@@ -76746,7 +77372,7 @@ var ts;
return undefined;
}
var commentOwner = commentOwnerInfo.commentOwner, parameters = commentOwnerInfo.parameters;
- if (commentOwner.getStart() < position) {
+ if (commentOwner.getStart(sourceFile) < position) {
return undefined;
}
if (!parameters || parameters.length === 0) {
@@ -76756,44 +77382,40 @@ var ts;
var posLineAndChar = sourceFile.getLineAndCharacterOfPosition(position);
var lineStart = sourceFile.getLineStarts()[posLineAndChar.line];
var indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character).replace(/\S/i, function () { return " "; });
- var isJavaScriptFile = ts.hasJavaScriptFileExtension(sourceFile.fileName);
- var docParams = "";
- for (var i = 0; i < parameters.length; i++) {
- var currentName = parameters[i].name;
- var paramName = currentName.kind === 71 ? currentName.escapedText : "param" + i;
- if (isJavaScriptFile) {
- docParams += indentationStr + " * @param {any} " + paramName + newLine;
- }
- else {
- docParams += indentationStr + " * @param " + paramName + newLine;
- }
- }
var preamble = "/**" + newLine +
indentationStr + " * ";
var result = preamble + newLine +
- docParams +
+ parameterDocComments(parameters, ts.hasJavaScriptFileExtension(sourceFile.fileName), indentationStr, newLine) +
indentationStr + " */" +
(tokenStart === position ? newLine + indentationStr : "");
return { newText: result, caretOffset: preamble.length };
}
JsDoc.getDocCommentTemplateAtPosition = getDocCommentTemplateAtPosition;
+ function parameterDocComments(parameters, isJavaScriptFile, indentationStr, newLine) {
+ return parameters.map(function (_a, i) {
+ var name = _a.name, dotDotDotToken = _a.dotDotDotToken;
+ var paramName = name.kind === 71 ? name.text : "param" + i;
+ var type = isJavaScriptFile ? (dotDotDotToken ? "{...any} " : "{any} ") : "";
+ return indentationStr + " * @param " + type + paramName + newLine;
+ }).join("");
+ }
function getCommentOwnerInfo(tokenAtPos) {
for (var commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) {
switch (commentOwner.kind) {
- case 233:
- case 153:
+ case 234:
case 154:
- case 152:
+ case 155:
+ case 153:
var parameters = commentOwner.parameters;
return { commentOwner: commentOwner, parameters: parameters };
- case 234:
case 235:
- case 150:
- case 237:
- case 272:
case 236:
+ case 151:
+ case 238:
+ case 273:
+ case 237:
return { commentOwner: commentOwner };
- case 213: {
+ case 214: {
var varStatement = commentOwner;
var varDeclarations = varStatement.declarationList.declarations;
var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer
@@ -76801,11 +77423,11 @@ var ts;
: undefined;
return { commentOwner: commentOwner, parameters: parameters_1 };
}
- case 273:
+ case 274:
return undefined;
- case 238:
- return commentOwner.parent.kind === 238 ? undefined : { commentOwner: commentOwner };
- case 199: {
+ case 239:
+ return commentOwner.parent.kind === 239 ? undefined : { commentOwner: commentOwner };
+ case 200: {
var be = commentOwner;
if (ts.getSpecialPropertyAssignmentKind(be) === 0) {
return undefined;
@@ -76817,16 +77439,16 @@ var ts;
}
}
function getParametersFromRightHandSideOfAssignment(rightHandSide) {
- while (rightHandSide.kind === 190) {
+ while (rightHandSide.kind === 191) {
rightHandSide = rightHandSide.expression;
}
switch (rightHandSide.kind) {
- case 191:
case 192:
+ case 193:
return rightHandSide.parameters;
- case 204: {
+ case 205: {
var ctr = ts.find(rightHandSide.members, ts.isConstructorDeclaration);
- return ctr && ctr.parameters;
+ return ctr ? ctr.parameters : ts.emptyArray;
}
}
return ts.emptyArray;
@@ -76983,7 +77605,8 @@ var ts;
addInferredTypings(module_1, "Inferred typings from unresolved imports");
}
packageNameToTypingLocation.forEach(function (typing, name) {
- if (inferredTypings.has(name) && inferredTypings.get(name) === undefined && isTypingUpToDate(typing, typesRegistry.get(name))) {
+ var registryEntry = typesRegistry.get(name);
+ if (inferredTypings.has(name) && inferredTypings.get(name) === undefined && registryEntry !== undefined && isTypingUpToDate(typing, registryEntry)) {
inferredTypings.set(name, typing.typingLocation);
}
});
@@ -77134,7 +77757,7 @@ var ts;
case 0:
return ts.Debug.fail();
default:
- ts.Debug.assertNever(result);
+ throw ts.Debug.assertNever(result);
}
}
JsTyping.renderPackageNameValidationFailure = renderPackageNameValidationFailure;
@@ -77149,7 +77772,7 @@ var ts;
if (!patternMatcher)
return ts.emptyArray;
var rawItems = [];
- var _loop_14 = function (sourceFile) {
+ var _loop_15 = function (sourceFile) {
cancellationToken.throwIfCancellationRequested();
if (excludeDtsFiles && ts.fileExtensionIs(sourceFile.fileName, ".d.ts")) {
return "continue";
@@ -77160,7 +77783,7 @@ var ts;
};
for (var _i = 0, sourceFiles_7 = sourceFiles; _i < sourceFiles_7.length; _i++) {
var sourceFile = sourceFiles_7[_i];
- _loop_14(sourceFile);
+ _loop_15(sourceFile);
}
rawItems.sort(compareNavigateToItems);
if (maxResultCount !== undefined) {
@@ -77174,8 +77797,8 @@ var ts;
if (!match) {
return;
}
- for (var _i = 0, declarations_11 = declarations; _i < declarations_11.length; _i++) {
- var declaration = declarations_11[_i];
+ for (var _i = 0, declarations_12 = declarations; _i < declarations_12.length; _i++) {
+ var declaration = declarations_12[_i];
if (!shouldKeepItem(declaration, checker))
continue;
if (patternMatcher.patternContainsDots) {
@@ -77191,9 +77814,9 @@ var ts;
}
function shouldKeepItem(declaration, checker) {
switch (declaration.kind) {
- case 244:
- case 247:
- case 242:
+ case 245:
+ case 248:
+ case 243:
var importer = checker.getSymbolAtLocation(declaration.name);
var imported = checker.getAliasedSymbol(importer);
return importer.escapedName !== imported.escapedName;
@@ -77207,7 +77830,7 @@ var ts;
containers.unshift(ts.getTextOfIdentifierOrLiteral(name));
return true;
}
- else if (name && name.kind === 146) {
+ else if (name && name.kind === 147) {
return tryAddComputedPropertyName(name.expression, containers, true);
}
else {
@@ -77233,15 +77856,15 @@ var ts;
function getContainers(declaration) {
var containers = [];
var name = ts.getNameOfDeclaration(declaration);
- if (name.kind === 146 && !tryAddComputedPropertyName(name.expression, containers, false)) {
+ if (name.kind === 147 && !tryAddComputedPropertyName(name.expression, containers, false)) {
return undefined;
}
- declaration = ts.getContainerNode(declaration);
- while (declaration) {
- if (!tryAddSingleDeclarationName(declaration, containers)) {
+ var container = ts.getContainerNode(declaration);
+ while (container) {
+ if (!tryAddSingleDeclarationName(container, containers)) {
return undefined;
}
- declaration = ts.getContainerNode(declaration);
+ container = ts.getContainerNode(container);
}
return containers;
}
@@ -77368,7 +77991,7 @@ var ts;
return;
}
switch (node.kind) {
- case 154:
+ case 155:
var ctr = node;
addNodeWithRecursiveChild(ctr, ctr.body);
for (var _i = 0, _a = ctr.parameters; _i < _a.length; _i++) {
@@ -77378,28 +78001,28 @@ var ts;
}
}
break;
- case 153:
- case 155:
+ case 154:
case 156:
- case 152:
+ case 157:
+ case 153:
if (!ts.hasDynamicName(node)) {
addNodeWithRecursiveChild(node, node.body);
}
break;
+ case 152:
case 151:
- case 150:
if (!ts.hasDynamicName(node)) {
addLeafNode(node);
}
break;
- case 244:
+ case 245:
var importClause = node;
if (importClause.name) {
addLeafNode(importClause);
}
var namedBindings = importClause.namedBindings;
if (namedBindings) {
- if (namedBindings.kind === 245) {
+ if (namedBindings.kind === 246) {
addLeafNode(namedBindings);
}
else {
@@ -77410,8 +78033,8 @@ var ts;
}
}
break;
- case 181:
- case 231:
+ case 182:
+ case 232:
var _d = node, name = _d.name, initializer = _d.initializer;
if (ts.isBindingPattern(name)) {
addChildrenRecursively(name);
@@ -77430,12 +78053,12 @@ var ts;
addNodeWithRecursiveChild(node, initializer);
}
break;
+ case 193:
+ case 234:
case 192:
- case 233:
- case 191:
addNodeWithRecursiveChild(node, node.body);
break;
- case 237:
+ case 238:
startNode(node);
for (var _e = 0, _f = node.members; _e < _f.length; _e++) {
var member = _f[_e];
@@ -77445,9 +78068,9 @@ var ts;
}
endNode();
break;
- case 234:
- case 204:
case 235:
+ case 205:
+ case 236:
startNode(node);
for (var _g = 0, _h = node.members; _g < _h.length; _g++) {
var member = _h[_g];
@@ -77455,18 +78078,18 @@ var ts;
}
endNode();
break;
- case 238:
+ case 239:
addNodeWithRecursiveChild(node, getInteriorModule(node).body);
break;
- case 251:
- case 242:
- case 159:
- case 157:
+ case 252:
+ case 243:
+ case 160:
case 158:
- case 236:
+ case 159:
+ case 237:
addLeafNode(node);
break;
- case 199: {
+ case 200: {
var special = ts.getSpecialPropertyAssignmentKind(node);
switch (special) {
case 1:
@@ -77541,19 +78164,19 @@ var ts;
return false;
}
switch (a.kind) {
- case 151:
- case 153:
- case 155:
+ case 152:
+ case 154:
case 156:
+ case 157:
return ts.hasModifier(a, 32) === ts.hasModifier(b, 32);
- case 238:
+ case 239:
return areSameModule(a, b);
default:
return true;
}
}
function areSameModule(a, b) {
- return a.body.kind === b.body.kind && (a.body.kind !== 238 || areSameModule(a.body, b.body));
+ return a.body.kind === b.body.kind && (a.body.kind !== 239 || areSameModule(a.body, b.body));
}
function merge(target, source) {
var _a;
@@ -77576,7 +78199,7 @@ var ts;
|| ts.compareValues(navigationBarNodeKind(child1), navigationBarNodeKind(child2));
}
function tryGetName(node) {
- if (node.kind === 238) {
+ if (node.kind === 239) {
return getModuleName(node);
}
var declName = ts.getNameOfDeclaration(node);
@@ -77584,16 +78207,16 @@ var ts;
return ts.unescapeLeadingUnderscores(ts.getPropertyNameForPropertyNameNode(declName));
}
switch (node.kind) {
- case 191:
case 192:
- case 204:
+ case 193:
+ case 205:
return getFunctionOrClassName(node);
default:
return undefined;
}
}
function getItemName(node) {
- if (node.kind === 238) {
+ if (node.kind === 239) {
return getModuleName(node);
}
var name = ts.getNameOfDeclaration(node);
@@ -77604,27 +78227,27 @@ var ts;
}
}
switch (node.kind) {
- case 273:
+ case 274:
var sourceFile = node;
return ts.isExternalModule(sourceFile)
? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\""
: "";
- case 192:
- case 233:
- case 191:
+ case 193:
case 234:
- case 204:
+ case 192:
+ case 235:
+ case 205:
if (ts.getModifierFlags(node) & 512) {
return "default";
}
return getFunctionOrClassName(node);
- case 154:
+ case 155:
return "constructor";
- case 158:
- return "new()";
- case 157:
- return "()";
case 159:
+ return "new()";
+ case 158:
+ return "()";
+ case 160:
return "[]";
default:
return "";
@@ -77647,25 +78270,25 @@ var ts;
return topLevel;
function isTopLevel(item) {
switch (navigationBarNodeKind(item)) {
- case 234:
- case 204:
- case 237:
case 235:
+ case 205:
case 238:
- case 273:
case 236:
- case 296:
- case 291:
+ case 239:
+ case 274:
+ case 237:
+ case 297:
+ case 292:
return true;
- case 154:
- case 153:
case 155:
+ case 154:
case 156:
- case 231:
+ case 157:
+ case 232:
return hasSomeImportantChild(item);
+ case 193:
+ case 234:
case 192:
- case 233:
- case 191:
return isTopLevelFunctionDeclaration(item);
default:
return false;
@@ -77675,19 +78298,19 @@ var ts;
return false;
}
switch (navigationBarNodeKind(item.parent)) {
- case 239:
- case 273:
- case 153:
+ case 240:
+ case 274:
case 154:
+ case 155:
return true;
default:
return hasSomeImportantChild(item);
}
}
function hasSomeImportantChild(item) {
- return ts.forEach(item.children, function (child) {
+ return ts.some(item.children, function (child) {
var childKind = navigationBarNodeKind(child);
- return childKind !== 231 && childKind !== 181;
+ return childKind !== 232 && childKind !== 182;
});
}
}
@@ -77741,23 +78364,23 @@ var ts;
}
var result = [];
result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name));
- while (moduleDeclaration.body && moduleDeclaration.body.kind === 238) {
+ while (moduleDeclaration.body && moduleDeclaration.body.kind === 239) {
moduleDeclaration = moduleDeclaration.body;
result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name));
}
return result.join(".");
}
function getInteriorModule(decl) {
- return decl.body.kind === 238 ? getInteriorModule(decl.body) : decl;
+ return decl.body.kind === 239 ? getInteriorModule(decl.body) : decl;
}
function isComputedProperty(member) {
- return !member.name || member.name.kind === 146;
+ return !member.name || member.name.kind === 147;
}
function getNodeSpan(node) {
- return node.kind === 273 ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile);
+ return node.kind === 274 ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile);
}
function getModifiers(node) {
- if (node.parent && node.parent.kind === 231) {
+ if (node.parent && node.parent.kind === 232) {
node = node.parent;
}
return ts.getNodeModifiers(node);
@@ -77766,14 +78389,14 @@ var ts;
if (node.name && ts.getFullWidth(node.name) > 0) {
return ts.declarationNameToString(node.name);
}
- else if (node.parent.kind === 231) {
+ else if (node.parent.kind === 232) {
return ts.declarationNameToString(node.parent.name);
}
- else if (node.parent.kind === 199 &&
+ else if (node.parent.kind === 200 &&
node.parent.operatorToken.kind === 58) {
return nodeText(node.parent.left).replace(whiteSpaceRegex, "");
}
- else if (node.parent.kind === 269 && node.parent.name) {
+ else if (node.parent.kind === 270 && node.parent.name) {
return nodeText(node.parent.name);
}
else if (ts.getModifierFlags(node) & 512) {
@@ -77785,9 +78408,9 @@ var ts;
}
function isFunctionOrClassExpression(node) {
switch (node.kind) {
+ case 193:
case 192:
- case 191:
- case 204:
+ case 205:
return true;
default:
return false;
@@ -77848,12 +78471,12 @@ var ts;
OrganizeImports.organizeImports = organizeImports;
function getModuleBlock(moduleDecl) {
var body = moduleDecl.body;
- return body && !ts.isIdentifier(body) && (ts.isModuleBlock(body) ? body : getModuleBlock(body));
+ return body && !ts.isIdentifier(body) ? (ts.isModuleBlock(body) ? body : getModuleBlock(body)) : undefined;
}
function removeUnusedImports(oldImports, sourceFile, program) {
var typeChecker = program.getTypeChecker();
var jsxNamespace = typeChecker.getJsxNamespace();
- var jsxContext = sourceFile.languageVariant === 1 && program.getCompilerOptions().jsx;
+ var jsxElementsPresent = !!(sourceFile.transformFlags & 4);
var usedImports = [];
for (var _i = 0, oldImports_1 = oldImports; _i < oldImports_1.length; _i++) {
var importDecl = oldImports_1[_i];
@@ -77887,7 +78510,7 @@ var ts;
}
return usedImports;
function isDeclarationUsed(identifier) {
- return jsxContext && (identifier.text === jsxNamespace) || ts.FindAllReferences.Core.isSymbolReferencedInFile(identifier, typeChecker, sourceFile);
+ return jsxElementsPresent && (identifier.text === jsxNamespace) || ts.FindAllReferences.Core.isSymbolReferencedInFile(identifier, typeChecker, sourceFile);
}
}
function getExternalModuleName(specifier) {
@@ -78037,70 +78660,6 @@ var ts;
})(OrganizeImports = ts.OrganizeImports || (ts.OrganizeImports = {}));
})(ts || (ts = {}));
var ts;
-(function (ts) {
- function getEditsForFileRename(program, oldFilePath, newFilePath, host, formatContext) {
- var pathUpdater = getPathUpdater(oldFilePath, newFilePath, host);
- return ts.textChanges.ChangeTracker.with({ host: host, formatContext: formatContext }, function (changeTracker) {
- updateTsconfigFiles(program, changeTracker, oldFilePath, newFilePath);
- for (var _i = 0, _a = getImportsToUpdate(program, oldFilePath, host); _i < _a.length; _i++) {
- var _b = _a[_i], sourceFile = _b.sourceFile, toUpdate = _b.toUpdate;
- var newPath = pathUpdater(isRef(toUpdate) ? toUpdate.fileName : toUpdate.text);
- if (newPath !== undefined) {
- var range = isRef(toUpdate) ? toUpdate : createStringRange(toUpdate, sourceFile);
- changeTracker.replaceRangeWithText(sourceFile, range, isRef(toUpdate) ? newPath : ts.removeFileExtension(newPath));
- }
- }
- });
- }
- ts.getEditsForFileRename = getEditsForFileRename;
- function updateTsconfigFiles(program, changeTracker, oldFilePath, newFilePath) {
- var configFile = program.getCompilerOptions().configFile;
- var oldFile = ts.getTsConfigPropArrayElementValue(configFile, "files", oldFilePath);
- if (oldFile) {
- changeTracker.replaceRangeWithText(configFile, createStringRange(oldFile, configFile), newFilePath);
- }
- }
- function isRef(toUpdate) {
- return "fileName" in toUpdate;
- }
- function getImportsToUpdate(program, oldFilePath, host) {
- var checker = program.getTypeChecker();
- var result = [];
- for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) {
- var sourceFile = _a[_i];
- for (var _b = 0, _c = sourceFile.referencedFiles; _b < _c.length; _b++) {
- var ref = _c[_b];
- if (!program.getSourceFileFromReference(sourceFile, ref) && ts.resolveTripleslashReference(ref.fileName, sourceFile.fileName) === oldFilePath) {
- result.push({ sourceFile: sourceFile, toUpdate: ref });
- }
- }
- for (var _d = 0, _e = sourceFile.imports; _d < _e.length; _d++) {
- var importStringLiteral = _e[_d];
- if (checker.getSymbolAtLocation(importStringLiteral))
- continue;
- var resolved = host.resolveModuleNames
- ? host.getResolvedModuleWithFailedLookupLocationsFromCache && host.getResolvedModuleWithFailedLookupLocationsFromCache(importStringLiteral.text, sourceFile.fileName)
- : program.getResolvedModuleWithFailedLookupLocationsFromCache(importStringLiteral.text, sourceFile.fileName);
- if (resolved && ts.contains(resolved.failedLookupLocations, oldFilePath)) {
- result.push({ sourceFile: sourceFile, toUpdate: importStringLiteral });
- }
- }
- }
- return result;
- }
- function getPathUpdater(oldFilePath, newFilePath, host) {
- var rel = ts.getRelativePathFromFile(oldFilePath, newFilePath, ts.createGetCanonicalFileName(ts.hostUsesCaseSensitiveFileNames(host)));
- return function (oldPath) {
- if (!ts.pathIsRelative(oldPath))
- return;
- return ts.ensurePathIsNonModuleName(ts.normalizePath(ts.combinePaths(ts.getDirectoryPath(oldPath), rel)));
- };
- }
- function createStringRange(node, sourceFile) {
- return ts.createTextRange(node.getStart(sourceFile) + 1, node.end - 1);
- }
-})(ts || (ts = {}));
-var ts;
(function (ts) {
var OutliningElementsCollector;
(function (OutliningElementsCollector) {
@@ -78221,21 +78780,21 @@ var ts;
}
function getOutliningSpanForNode(n, sourceFile) {
switch (n.kind) {
- case 212:
+ case 213:
if (ts.isFunctionBlock(n)) {
- return spanForNode(n.parent, n.parent.kind !== 192);
+ return spanForNode(n.parent, n.parent.kind !== 193);
}
switch (n.parent.kind) {
- case 217:
- case 220:
- case 221:
- case 219:
- case 216:
case 218:
- case 225:
- case 268:
+ case 221:
+ case 222:
+ case 220:
+ case 217:
+ case 219:
+ case 226:
+ case 269:
return spanForNode(n.parent);
- case 229:
+ case 230:
var tryStatement = n.parent;
if (tryStatement.tryBlock === n) {
return spanForNode(n.parent);
@@ -78246,16 +78805,16 @@ var ts;
default:
return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile), "code");
}
- case 239:
- return spanForNode(n.parent);
- case 234:
- case 235:
- case 237:
case 240:
+ return spanForNode(n.parent);
+ case 235:
+ case 236:
+ case 238:
+ case 241:
return spanForNode(n);
- case 183:
+ case 184:
return spanForObjectOrArrayLiteral(n);
- case 182:
+ case 183:
return spanForObjectOrArrayLiteral(n, 21);
}
function spanForObjectOrArrayLiteral(node, open) {
@@ -78312,7 +78871,7 @@ var ts;
}
ts.createPatternMatcher = createPatternMatcher;
function getFullMatch(candidateContainers, candidate, dotSeparatedSegments, stringToWordSpans) {
- var candidateMatch = matchSegment(candidate, ts.lastOrUndefined(dotSeparatedSegments), stringToWordSpans);
+ var candidateMatch = matchSegment(candidate, ts.last(dotSeparatedSegments), stringToWordSpans);
if (!candidateMatch) {
return undefined;
}
@@ -78460,13 +79019,13 @@ var ts;
}
function indexOfIgnoringCase(str, value) {
var n = str.length - value.length;
- var _loop_15 = function (start) {
+ var _loop_16 = function (start) {
if (every(value, function (valueChar, i) { return toLowerCase(str.charCodeAt(i + start)) === valueChar; })) {
return { value: start };
}
};
for (var start = 0; start <= n; start++) {
- var state_4 = _loop_15(start);
+ var state_4 = _loop_16(start);
if (typeof state_4 === "object")
return state_4.value;
}
@@ -78697,7 +79256,7 @@ var ts;
else {
if (token === 71 || ts.isKeyword(token)) {
token = nextToken();
- if (token === 142) {
+ if (token === 143) {
token = nextToken();
if (token === 9) {
recordModuleName();
@@ -78723,7 +79282,7 @@ var ts;
}
if (token === 18) {
token = nextToken();
- if (token === 142) {
+ if (token === 143) {
token = nextToken();
if (token === 9) {
recordModuleName();
@@ -78737,7 +79296,7 @@ var ts;
token = nextToken();
if (token === 71 || ts.isKeyword(token)) {
token = nextToken();
- if (token === 142) {
+ if (token === 143) {
token = nextToken();
if (token === 9) {
recordModuleName();
@@ -78763,7 +79322,7 @@ var ts;
}
if (token === 18) {
token = nextToken();
- if (token === 142) {
+ if (token === 143) {
token = nextToken();
if (token === 9) {
recordModuleName();
@@ -78773,7 +79332,7 @@ var ts;
}
else if (token === 39) {
token = nextToken();
- if (token === 142) {
+ if (token === 143) {
token = nextToken();
if (token === 9) {
recordModuleName();
@@ -78871,7 +79430,7 @@ var ts;
importedFiles.push(decl.ref);
}
}
- return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, importedFiles: importedFiles, isLibFile: pragmaContext.hasNoDefaultLib, ambientExternalModules: undefined };
+ return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, importedFiles: importedFiles, isLibFile: !!pragmaContext.hasNoDefaultLib, ambientExternalModules: undefined };
}
else {
var ambientModuleNames = void 0;
@@ -78889,7 +79448,7 @@ var ts;
}
}
}
- return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, importedFiles: importedFiles, isLibFile: pragmaContext.hasNoDefaultLib, ambientExternalModules: ambientModuleNames };
+ return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, importedFiles: importedFiles, isLibFile: !!pragmaContext.hasNoDefaultLib, ambientExternalModules: ambientModuleNames };
}
}
ts.preProcessFile = preProcessFile;
@@ -78917,32 +79476,26 @@ var ts;
Rename.getRenameInfo = getRenameInfo;
function getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile) {
var symbol = typeChecker.getSymbolAtLocation(node);
- if (symbol) {
- var declarations = symbol.declarations;
- if (declarations && declarations.length > 0) {
- if (declarations.some(isDefinedInLibraryFile)) {
- return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library);
- }
- if (ts.isIdentifier(node) && node.originalKeywordKind === 79 && symbol.parent.flags & 1536) {
- return undefined;
- }
- if (ts.isStringLiteralLike(node) && ts.tryGetImportFromModuleSpecifier(node))
- return undefined;
- var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node);
- var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteral(node) && node.parent.kind === 146)
- ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node))
- : undefined;
- var displayName = specifierName || typeChecker.symbolToString(symbol);
- var fullDisplayName = specifierName || typeChecker.getFullyQualifiedName(symbol);
- return getRenameInfoSuccess(displayName, fullDisplayName, kind, ts.SymbolDisplay.getSymbolModifiers(symbol), node, sourceFile);
- }
+ if (!symbol)
+ return;
+ var declarations = symbol.declarations;
+ if (!declarations || declarations.length === 0)
+ return;
+ if (declarations.some(isDefinedInLibraryFile)) {
+ return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library);
}
- else if (ts.isStringLiteral(node)) {
- if (isDefinedInLibraryFile(node)) {
- return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library);
- }
- return getRenameInfoSuccess(node.text, node.text, "var", "", node, sourceFile);
+ if (ts.isIdentifier(node) && node.originalKeywordKind === 79 && symbol.parent.flags & 1536) {
+ return undefined;
}
+ if (ts.isStringLiteralLike(node) && ts.tryGetImportFromModuleSpecifier(node))
+ return undefined;
+ var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node);
+ var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteral(node) && node.parent.kind === 147)
+ ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node))
+ : undefined;
+ var displayName = specifierName || typeChecker.symbolToString(symbol);
+ var fullDisplayName = specifierName || typeChecker.getFullyQualifiedName(symbol);
+ return getRenameInfoSuccess(displayName, fullDisplayName, kind, ts.SymbolDisplay.getSymbolModifiers(symbol), node, sourceFile);
}
function getRenameInfoSuccess(displayName, fullDisplayName, kind, kindModifiers, node, sourceFile) {
return {
@@ -78999,7 +79552,12 @@ var ts;
ArgumentListKind[ArgumentListKind["CallArguments"] = 1] = "CallArguments";
ArgumentListKind[ArgumentListKind["TaggedTemplateArguments"] = 2] = "TaggedTemplateArguments";
ArgumentListKind[ArgumentListKind["JSXAttributesArguments"] = 3] = "JSXAttributesArguments";
- })(ArgumentListKind = SignatureHelp.ArgumentListKind || (SignatureHelp.ArgumentListKind = {}));
+ })(ArgumentListKind || (ArgumentListKind = {}));
+ var InvocationKind;
+ (function (InvocationKind) {
+ InvocationKind[InvocationKind["Call"] = 0] = "Call";
+ InvocationKind[InvocationKind["TypeArgs"] = 1] = "TypeArgs";
+ })(InvocationKind || (InvocationKind = {}));
function getSignatureHelpItems(program, sourceFile, position, cancellationToken) {
var typeChecker = program.getTypeChecker();
var startingToken = ts.findTokenOnLeftOfPosition(sourceFile, position);
@@ -79010,63 +79568,83 @@ var ts;
if (!argumentInfo)
return undefined;
cancellationToken.throwIfCancellationRequested();
- var call = argumentInfo.invocation;
- var candidates = [];
- var resolvedSignature = typeChecker.getResolvedSignature(call, candidates, argumentInfo.argumentCount);
+ var candidateInfo = getCandidateInfo(argumentInfo, typeChecker);
cancellationToken.throwIfCancellationRequested();
- if (!candidates.length) {
+ if (!candidateInfo) {
if (ts.isSourceFileJavaScript(sourceFile)) {
return createJavaScriptSignatureHelpItems(argumentInfo, program, cancellationToken);
}
return undefined;
}
- return typeChecker.runWithCancellationToken(cancellationToken, function (typeChecker) { return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo, typeChecker); });
+ return typeChecker.runWithCancellationToken(cancellationToken, function (typeChecker) { return createSignatureHelpItems(candidateInfo.candidates, candidateInfo.resolvedSignature, argumentInfo, sourceFile, typeChecker); });
}
SignatureHelp.getSignatureHelpItems = getSignatureHelpItems;
- function createJavaScriptSignatureHelpItems(argumentInfo, program, cancellationToken) {
- if (argumentInfo.invocation.kind !== 186) {
- return undefined;
+ function getCandidateInfo(argumentInfo, checker) {
+ var invocation = argumentInfo.invocation;
+ if (invocation.kind === 0) {
+ var candidates = [];
+ var resolvedSignature = checker.getResolvedSignature(invocation.node, candidates, argumentInfo.argumentCount);
+ return candidates.length === 0 ? undefined : { candidates: candidates, resolvedSignature: resolvedSignature };
}
- var callExpression = argumentInfo.invocation;
- var expression = callExpression.expression;
+ else {
+ var type = checker.getTypeAtLocation(invocation.called);
+ var signatures = ts.isNewExpression(invocation.called.parent) ? type.getConstructSignatures() : type.getCallSignatures();
+ var candidates = signatures.filter(function (candidate) { return !!candidate.typeParameters && candidate.typeParameters.length >= argumentInfo.argumentCount; });
+ return candidates.length === 0 ? undefined : { candidates: candidates, resolvedSignature: ts.first(candidates) };
+ }
+ }
+ function createJavaScriptSignatureHelpItems(argumentInfo, program, cancellationToken) {
+ var expression = getExpressionFromInvocation(argumentInfo.invocation);
var name = ts.isIdentifier(expression) ? expression : ts.isPropertyAccessExpression(expression) ? expression.name : undefined;
if (!name || !name.escapedText) {
return undefined;
}
var typeChecker = program.getTypeChecker();
- for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) {
- var sourceFile = _a[_i];
+ var _loop_17 = function (sourceFile) {
var nameToDeclarations = sourceFile.getNamedDeclarations();
var declarations = nameToDeclarations.get(name.text);
if (declarations) {
- var _loop_16 = function (declaration) {
+ var _loop_18 = function (declaration) {
var symbol = declaration.symbol;
if (symbol) {
var type = typeChecker.getTypeOfSymbolAtLocation(symbol, declaration);
if (type) {
var callSignatures_1 = type.getCallSignatures();
if (callSignatures_1 && callSignatures_1.length) {
- return { value: typeChecker.runWithCancellationToken(cancellationToken, function (typeChecker) { return createSignatureHelpItems(callSignatures_1, callSignatures_1[0], argumentInfo, typeChecker); }) };
+ return { value: typeChecker.runWithCancellationToken(cancellationToken, function (typeChecker) { return createSignatureHelpItems(callSignatures_1, callSignatures_1[0], argumentInfo, sourceFile, typeChecker); }) };
}
}
}
};
- for (var _b = 0, declarations_12 = declarations; _b < declarations_12.length; _b++) {
- var declaration = declarations_12[_b];
- var state_5 = _loop_16(declaration);
- if (typeof state_5 === "object")
- return state_5.value;
+ for (var _i = 0, declarations_13 = declarations; _i < declarations_13.length; _i++) {
+ var declaration = declarations_13[_i];
+ var state_6 = _loop_18(declaration);
+ if (typeof state_6 === "object")
+ return state_6;
}
}
+ };
+ for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) {
+ var sourceFile = _a[_i];
+ var state_5 = _loop_17(sourceFile);
+ if (typeof state_5 === "object")
+ return state_5.value;
}
}
+ function getArgumentInfoForCompletions(node, position, sourceFile) {
+ var info = getImmediatelyContainingArgumentInfo(node, position, sourceFile);
+ return !info || info.kind === 0 || info.invocation.kind === 1 ? undefined
+ : { invocation: info.invocation.node, argumentCount: info.argumentCount, argumentIndex: info.argumentIndex };
+ }
+ SignatureHelp.getArgumentInfoForCompletions = getArgumentInfoForCompletions;
function getImmediatelyContainingArgumentInfo(node, position, sourceFile) {
- if (ts.isCallOrNewExpression(node.parent)) {
- var invocation = node.parent;
+ var parent = node.parent;
+ if (ts.isCallOrNewExpression(parent)) {
+ var invocation = parent;
var list = void 0;
var argumentIndex = void 0;
if (node.kind === 27 || node.kind === 19) {
- list = getChildListThatStartsWithOpenerToken(invocation, node, sourceFile);
+ list = getChildListThatStartsWithOpenerToken(parent, node, sourceFile);
ts.Debug.assert(list !== undefined);
argumentIndex = 0;
}
@@ -79076,52 +79654,58 @@ var ts;
return undefined;
argumentIndex = getArgumentIndex(list, node);
}
- var kind = invocation.typeArguments && invocation.typeArguments.pos === list.pos ? 0 : 1;
+ var kind = parent.typeArguments && parent.typeArguments.pos === list.pos ? 0 : 1;
var argumentCount = getArgumentCount(list);
if (argumentIndex !== 0) {
ts.Debug.assertLessThan(argumentIndex, argumentCount);
}
var argumentsSpan = getApplicableSpanForArguments(list, sourceFile);
- return { kind: kind, invocation: invocation, argumentsSpan: argumentsSpan, argumentIndex: argumentIndex, argumentCount: argumentCount };
+ return { kind: kind, invocation: { kind: 0, node: invocation }, argumentsSpan: argumentsSpan, argumentIndex: argumentIndex, argumentCount: argumentCount };
}
- else if (node.kind === 13 && node.parent.kind === 188) {
- if (ts.isInsideTemplateLiteral(node, position)) {
- return getArgumentListInfoForTemplate(node.parent, 0, sourceFile);
+ else if (ts.isNoSubstitutionTemplateLiteral(node) && ts.isTaggedTemplateExpression(parent)) {
+ if (ts.isInsideTemplateLiteral(node, position, sourceFile)) {
+ return getArgumentListInfoForTemplate(parent, 0, sourceFile);
}
}
- else if (node.kind === 14 && node.parent.parent.kind === 188) {
- var templateExpression = node.parent;
+ else if (ts.isTemplateHead(node) && parent.parent.kind === 189) {
+ var templateExpression = parent;
var tagExpression = templateExpression.parent;
- ts.Debug.assert(templateExpression.kind === 201);
- var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1;
+ ts.Debug.assert(templateExpression.kind === 202);
+ var argumentIndex = ts.isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1;
return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile);
}
- else if (node.parent.kind === 210 && node.parent.parent.parent.kind === 188) {
- var templateSpan = node.parent;
- var templateExpression = templateSpan.parent;
- var tagExpression = templateExpression.parent;
- ts.Debug.assert(templateExpression.kind === 201);
- if (node.kind === 16 && !ts.isInsideTemplateLiteral(node, position)) {
+ else if (ts.isTemplateSpan(parent) && ts.isTaggedTemplateExpression(parent.parent.parent)) {
+ var templateSpan = parent;
+ var tagExpression = parent.parent.parent;
+ if (ts.isTemplateTail(node) && !ts.isInsideTemplateLiteral(node, position, sourceFile)) {
return undefined;
}
- var spanIndex = templateExpression.templateSpans.indexOf(templateSpan);
- var argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node, position);
+ var spanIndex = templateSpan.parent.templateSpans.indexOf(templateSpan);
+ var argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node, position, sourceFile);
return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile);
}
- else if (node.parent && ts.isJsxOpeningLikeElement(node.parent)) {
- var attributeSpanStart = node.parent.attributes.getFullStart();
- var attributeSpanEnd = ts.skipTrivia(sourceFile.text, node.parent.attributes.getEnd(), false);
+ else if (ts.isJsxOpeningLikeElement(parent)) {
+ var attributeSpanStart = parent.attributes.pos;
+ var attributeSpanEnd = ts.skipTrivia(sourceFile.text, parent.attributes.end, false);
return {
kind: 3,
- invocation: node.parent,
+ invocation: { kind: 0, node: parent },
argumentsSpan: ts.createTextSpan(attributeSpanStart, attributeSpanEnd - attributeSpanStart),
argumentIndex: 0,
argumentCount: 1
};
}
+ else {
+ var typeArgInfo = ts.isPossiblyTypeArgumentPosition(node, sourceFile);
+ if (typeArgInfo) {
+ var called = typeArgInfo.called, nTypeArguments = typeArgInfo.nTypeArguments;
+ var invocation = { kind: 1, called: called };
+ var argumentsSpan = ts.createTextSpanFromBounds(called.getStart(sourceFile), node.end);
+ return { kind: 0, invocation: invocation, argumentsSpan: argumentsSpan, argumentIndex: nTypeArguments, argumentCount: nTypeArguments + 1 };
+ }
+ }
return undefined;
}
- SignatureHelp.getImmediatelyContainingArgumentInfo = getImmediatelyContainingArgumentInfo;
function getArgumentIndex(argumentsList, node) {
var argumentIndex = 0;
for (var _i = 0, _a = argumentsList.getChildren(); _i < _a.length; _i++) {
@@ -79138,15 +79722,15 @@ var ts;
function getArgumentCount(argumentsList) {
var listChildren = argumentsList.getChildren();
var argumentCount = ts.countWhere(listChildren, function (arg) { return arg.kind !== 26; });
- if (listChildren.length > 0 && ts.lastOrUndefined(listChildren).kind === 26) {
+ if (listChildren.length > 0 && ts.last(listChildren).kind === 26) {
argumentCount++;
}
return argumentCount;
}
- function getArgumentIndexForTemplatePiece(spanIndex, node, position) {
+ function getArgumentIndexForTemplatePiece(spanIndex, node, position, sourceFile) {
ts.Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node.");
- if (ts.isTemplateLiteralKind(node.kind)) {
- if (ts.isInsideTemplateLiteral(node, position)) {
+ if (ts.isTemplateLiteralToken(node)) {
+ if (ts.isInsideTemplateLiteral(node, position, sourceFile)) {
return 0;
}
return spanIndex + 2;
@@ -79160,7 +79744,7 @@ var ts;
}
return {
kind: 2,
- invocation: tagExpression,
+ invocation: { kind: 0, node: tagExpression },
argumentsSpan: getApplicableSpanForTaggedTemplate(tagExpression, sourceFile),
argumentIndex: argumentIndex,
argumentCount: argumentCount
@@ -79175,8 +79759,8 @@ var ts;
var template = taggedTemplate.template;
var applicableSpanStart = template.getStart();
var applicableSpanEnd = template.getEnd();
- if (template.kind === 201) {
- var lastSpan = ts.lastOrUndefined(template.templateSpans);
+ if (template.kind === 202) {
+ var lastSpan = ts.last(template.templateSpans);
if (lastSpan.literal.getFullWidth() === 0) {
applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, false);
}
@@ -79184,36 +79768,38 @@ var ts;
return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart);
}
function getContainingArgumentInfo(node, position, sourceFile) {
- for (var n = node; n.kind !== 273; n = n.parent) {
- if (ts.isFunctionBlock(n)) {
- return undefined;
- }
- if (n.pos < n.parent.pos || n.end > n.parent.end) {
- ts.Debug.fail("Node of kind " + n.kind + " is not a subspan of its parent of kind " + n.parent.kind);
- }
+ var _loop_19 = function (n) {
+ ts.Debug.assert(ts.rangeContainsRange(n.parent, n), "Not a subspan", function () { return "Child: " + ts.Debug.showSyntaxKind(n) + ", parent: " + ts.Debug.showSyntaxKind(n.parent); });
var argumentInfo = getImmediatelyContainingArgumentInfo(n, position, sourceFile);
if (argumentInfo) {
- return argumentInfo;
+ return { value: argumentInfo };
}
+ };
+ for (var n = node; !ts.isBlock(n) && !ts.isSourceFile(n); n = n.parent) {
+ var state_7 = _loop_19(n);
+ if (typeof state_7 === "object")
+ return state_7.value;
}
return undefined;
}
- SignatureHelp.getContainingArgumentInfo = getContainingArgumentInfo;
function getChildListThatStartsWithOpenerToken(parent, openerToken, sourceFile) {
var children = parent.getChildren(sourceFile);
var indexOfOpenerToken = children.indexOf(openerToken);
ts.Debug.assert(indexOfOpenerToken >= 0 && children.length > indexOfOpenerToken + 1);
return children[indexOfOpenerToken + 1];
}
+ function getExpressionFromInvocation(invocation) {
+ return invocation.kind === 0 ? ts.getInvokedExpression(invocation.node) : invocation.called;
+ }
var signatureHelpNodeBuilderFlags = 8192 | 3112960;
- function createSignatureHelpItems(candidates, resolvedSignature, argumentListInfo, typeChecker) {
+ function createSignatureHelpItems(candidates, resolvedSignature, argumentListInfo, sourceFile, typeChecker) {
var argumentCount = argumentListInfo.argumentCount, applicableSpan = argumentListInfo.argumentsSpan, invocation = argumentListInfo.invocation, argumentIndex = argumentListInfo.argumentIndex;
var isTypeParameterList = argumentListInfo.kind === 0;
- var callTarget = ts.getInvokedExpression(invocation);
- var callTargetSymbol = typeChecker.getSymbolAtLocation(callTarget);
+ var enclosingDeclaration = invocation.kind === 0 ? invocation.node : invocation.called;
+ var callTargetSymbol = typeChecker.getSymbolAtLocation(getExpressionFromInvocation(invocation));
var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeChecker, callTargetSymbol, undefined, undefined);
var printer = ts.createPrinter({ removeComments: true });
- var items = ts.map(candidates, function (candidateSignature) {
+ var items = candidates.map(function (candidateSignature) {
var signatureHelpParameters;
var prefixDisplayParts = [];
var suffixDisplayParts = [];
@@ -79228,9 +79814,9 @@ var ts;
signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : ts.emptyArray;
suffixDisplayParts.push(ts.punctuationPart(29));
var parameterParts = ts.mapToDisplayParts(function (writer) {
- var thisParameter = candidateSignature.thisParameter ? [typeChecker.symbolToParameterDeclaration(candidateSignature.thisParameter, invocation, signatureHelpNodeBuilderFlags)] : [];
- var params = ts.createNodeArray(thisParameter.concat(ts.map(candidateSignature.parameters, function (param) { return typeChecker.symbolToParameterDeclaration(param, invocation, signatureHelpNodeBuilderFlags); })));
- printer.writeList(1296, params, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer);
+ var thisParameter = candidateSignature.thisParameter ? [typeChecker.symbolToParameterDeclaration(candidateSignature.thisParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags)] : [];
+ var params = ts.createNodeArray(thisParameter.concat(candidateSignature.parameters.map(function (param) { return typeChecker.symbolToParameterDeclaration(param, enclosingDeclaration, signatureHelpNodeBuilderFlags); })));
+ printer.writeList(1296, params, sourceFile, writer);
});
ts.addRange(suffixDisplayParts, parameterParts);
}
@@ -79238,8 +79824,8 @@ var ts;
isVariadic = candidateSignature.hasRestParameter;
var typeParameterParts = ts.mapToDisplayParts(function (writer) {
if (candidateSignature.typeParameters && candidateSignature.typeParameters.length) {
- var args = ts.createNodeArray(ts.map(candidateSignature.typeParameters, function (p) { return typeChecker.typeParameterToDeclaration(p, invocation); }));
- printer.writeList(26896, args, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer);
+ var args = ts.createNodeArray(candidateSignature.typeParameters.map(function (p) { return typeChecker.typeParameterToDeclaration(p, enclosingDeclaration); }));
+ printer.writeList(26896, args, sourceFile, writer);
}
});
ts.addRange(prefixDisplayParts, typeParameterParts);
@@ -79252,10 +79838,10 @@ var ts;
writer.writeSpace(" ");
var predicate = typeChecker.getTypePredicateOfSignature(candidateSignature);
if (predicate) {
- typeChecker.writeTypePredicate(predicate, invocation, undefined, writer);
+ typeChecker.writeTypePredicate(predicate, enclosingDeclaration, undefined, writer);
}
else {
- typeChecker.writeType(typeChecker.getReturnTypeOfSignature(candidateSignature), invocation, undefined, writer);
+ typeChecker.writeType(typeChecker.getReturnTypeOfSignature(candidateSignature), enclosingDeclaration, undefined, writer);
}
});
ts.addRange(suffixDisplayParts, returnTypeParts);
@@ -79277,8 +79863,8 @@ var ts;
return { items: items, applicableSpan: applicableSpan, selectedItemIndex: selectedItemIndex, argumentIndex: argumentIndex, argumentCount: argumentCount };
function createSignatureHelpParameterForParameter(parameter) {
var displayParts = ts.mapToDisplayParts(function (writer) {
- var param = typeChecker.symbolToParameterDeclaration(parameter, invocation, signatureHelpNodeBuilderFlags);
- printer.writeNode(4, param, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer);
+ var param = typeChecker.symbolToParameterDeclaration(parameter, enclosingDeclaration, signatureHelpNodeBuilderFlags);
+ printer.writeNode(4, param, sourceFile, writer);
});
return {
name: parameter.name,
@@ -79289,8 +79875,8 @@ var ts;
}
function createSignatureHelpParameterForTypeParameter(typeParameter) {
var displayParts = ts.mapToDisplayParts(function (writer) {
- var param = typeChecker.typeParameterToDeclaration(typeParameter, invocation);
- printer.writeNode(4, param, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer);
+ var param = typeChecker.typeParameterToDeclaration(typeParameter, enclosingDeclaration);
+ printer.writeNode(4, param, sourceFile, writer);
});
return {
name: typeParameter.symbol.name,
@@ -79304,9 +79890,8 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
- function computeSuggestionDiagnostics(sourceFile, program) {
- program.getSemanticDiagnostics(sourceFile);
- var checker = program.getDiagnosticsProducingTypeChecker();
+ function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) {
+ program.getSemanticDiagnostics(sourceFile, cancellationToken);
var diags = [];
if (sourceFile.commonJsModuleIndicator &&
(ts.programContainsEs6Modules(program) || ts.compilerOptionsIndicateEs6Modules(program.getCompilerOptions())) &&
@@ -79314,40 +79899,10 @@ var ts;
diags.push(ts.createDiagnosticForNode(getErrorNodeFromCommonJsIndicator(sourceFile.commonJsModuleIndicator), ts.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module));
}
var isJsFile = ts.isSourceFileJavaScript(sourceFile);
- function check(node) {
- switch (node.kind) {
- case 233:
- case 191:
- if (isJsFile) {
- var symbol = node.symbol;
- if (symbol.members && (symbol.members.size > 0)) {
- diags.push(ts.createDiagnosticForNode(ts.isVariableDeclaration(node.parent) ? node.parent.name : node, ts.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration));
- }
- }
- break;
- }
- if (!isJsFile && ts.codefix.parameterShouldGetTypeFromJSDoc(node)) {
- diags.push(ts.createDiagnosticForNode(node.name || node, ts.Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types));
- }
- node.forEachChild(check);
- }
check(sourceFile);
- if (!isJsFile) {
- for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {
- var statement = _a[_i];
- if (ts.isVariableStatement(statement) &&
- statement.declarationList.flags & 2 &&
- statement.declarationList.declarations.length === 1) {
- var init = statement.declarationList.declarations[0].initializer;
- if (init && ts.isRequireCall(init, true)) {
- diags.push(ts.createDiagnosticForNode(init, ts.Diagnostics.require_call_may_be_converted_to_an_import));
- }
- }
- }
- }
if (ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())) {
- for (var _b = 0, _c = sourceFile.imports; _b < _c.length; _b++) {
- var moduleSpecifier = _c[_b];
+ for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) {
+ var moduleSpecifier = _a[_i];
var importNode = ts.importFromModuleSpecifier(moduleSpecifier);
var name = importNameForConvertToDefaultImport(importNode);
if (!name)
@@ -79359,17 +79914,55 @@ var ts;
}
}
}
- return diags.concat(checker.getSuggestionDiagnostics(sourceFile)).sort(function (d1, d2) { return d1.start - d2.start; });
+ ts.addRange(diags, sourceFile.bindSuggestionDiagnostics);
+ ts.addRange(diags, program.getSuggestionDiagnostics(sourceFile, cancellationToken));
+ return diags.sort(function (d1, d2) { return d1.start - d2.start; });
+ function check(node) {
+ if (isJsFile) {
+ switch (node.kind) {
+ case 192:
+ var decl = ts.getDeclarationOfJSInitializer(node);
+ if (decl) {
+ var symbol_3 = decl.symbol;
+ if (symbol_3 && (symbol_3.exports && symbol_3.exports.size || symbol_3.members && symbol_3.members.size)) {
+ diags.push(ts.createDiagnosticForNode(ts.isVariableDeclaration(node.parent) ? node.parent.name : node, ts.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration));
+ break;
+ }
+ }
+ case 234:
+ var symbol = node.symbol;
+ if (symbol.members && (symbol.members.size > 0)) {
+ diags.push(ts.createDiagnosticForNode(ts.isVariableDeclaration(node.parent) ? node.parent.name : node, ts.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration));
+ }
+ break;
+ }
+ }
+ else {
+ if (ts.isVariableStatement(node) &&
+ node.parent === sourceFile &&
+ node.declarationList.flags & 2 &&
+ node.declarationList.declarations.length === 1) {
+ var init = node.declarationList.declarations[0].initializer;
+ if (init && ts.isRequireCall(init, true)) {
+ diags.push(ts.createDiagnosticForNode(init, ts.Diagnostics.require_call_may_be_converted_to_an_import));
+ }
+ }
+ if (ts.codefix.parameterShouldGetTypeFromJSDoc(node)) {
+ diags.push(ts.createDiagnosticForNode(node.name || node, ts.Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types));
+ }
+ }
+ node.forEachChild(check);
+ }
}
ts.computeSuggestionDiagnostics = computeSuggestionDiagnostics;
function containsTopLevelCommonjs(sourceFile) {
return sourceFile.statements.some(function (statement) {
switch (statement.kind) {
- case 213:
+ case 214:
return statement.declarationList.declarations.some(function (decl) {
return ts.isRequireCall(propertyAccessLeftHandSide(decl.initializer), true);
});
- case 215: {
+ case 216: {
var expression = statement.expression;
if (!ts.isBinaryExpression(expression))
return ts.isRequireCall(expression, true);
@@ -79386,12 +79979,12 @@ var ts;
}
function importNameForConvertToDefaultImport(node) {
switch (node.kind) {
- case 243:
+ case 244:
var importClause = node.importClause, moduleSpecifier = node.moduleSpecifier;
- return importClause && !importClause.name && importClause.namedBindings.kind === 245 && ts.isStringLiteral(moduleSpecifier)
+ return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 246 && ts.isStringLiteral(moduleSpecifier)
? importClause.namedBindings.name
: undefined;
- case 242:
+ case 243:
return node.name;
default:
return undefined;
@@ -79412,7 +80005,7 @@ var ts;
}
var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol);
if (flags & 32) {
- return ts.getDeclarationOfKind(symbol, 204) ?
+ return ts.getDeclarationOfKind(symbol, 205) ?
"local class" : "class";
}
if (flags & 384)
@@ -79492,11 +80085,11 @@ var ts;
return unionPropertyKind;
}
switch (location.parent && location.parent.kind) {
- case 256:
- case 254:
+ case 257:
case 255:
+ case 256:
return location.kind === 71 ? "property" : "JSX attribute";
- case 261:
+ case 262:
return "JSX attribute";
default:
return "property";
@@ -79521,7 +80114,7 @@ var ts;
var tags;
var symbolFlags = ts.getCombinedLocalAndExportSymbolFlags(symbol);
var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location);
- var hasAddedSymbolInfo;
+ var hasAddedSymbolInfo = false;
var isThisExpression = location.kind === 99 && ts.isExpression(location);
var type;
var printer;
@@ -79533,7 +80126,7 @@ var ts;
}
var signature = void 0;
type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location);
- if (location.parent && location.parent.kind === 184) {
+ if (location.parent && location.parent.kind === 185) {
var right = location.parent.name;
if (right === location || (right && right.getFullWidth() === 0)) {
location = location.parent;
@@ -79552,7 +80145,7 @@ var ts;
if (callExpressionLike) {
var candidateSignatures = [];
signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures);
- var useConstructSignatures = callExpressionLike.kind === 187 || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97);
+ var useConstructSignatures = callExpressionLike.kind === 188 || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97);
var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures();
if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) {
signature = allSignatures.length ? allSignatures[0] : undefined;
@@ -79602,25 +80195,25 @@ var ts;
}
}
else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304)) ||
- (location.kind === 123 && location.parent.kind === 154)) {
+ (location.kind === 123 && location.parent.kind === 155)) {
var functionDeclaration_1 = location.parent;
var locationIsSymbolDeclaration = ts.find(symbol.declarations, function (declaration) {
return declaration === (location.kind === 123 ? functionDeclaration_1.parent : functionDeclaration_1);
});
if (locationIsSymbolDeclaration) {
- var allSignatures = functionDeclaration_1.kind === 154 ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures();
+ var allSignatures = functionDeclaration_1.kind === 155 ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures();
if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) {
signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1);
}
else {
signature = allSignatures[0];
}
- if (functionDeclaration_1.kind === 154) {
+ if (functionDeclaration_1.kind === 155) {
symbolKind = "constructor";
addPrefixForAnyFunctionOrVar(type.symbol, symbolKind);
}
else {
- addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 157 &&
+ addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 158 &&
!(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind);
}
addSignatureDisplayParts(signature, allSignatures);
@@ -79630,7 +80223,7 @@ var ts;
}
if (symbolFlags & 32 && !hasAddedSymbolInfo && !isThisExpression) {
addAliasPrefixIfNecessary();
- if (ts.getDeclarationOfKind(symbol, 204)) {
+ if (ts.getDeclarationOfKind(symbol, 205)) {
pushSymbolKind("local class");
}
else {
@@ -79670,7 +80263,7 @@ var ts;
}
if (symbolFlags & 1536) {
prefixNextMeaning();
- var declaration = ts.getDeclarationOfKind(symbol, 238);
+ var declaration = ts.getDeclarationOfKind(symbol, 239);
var isNamespace = declaration && declaration.name && declaration.name.kind === 71;
displayParts.push(ts.keywordPart(isNamespace ? 130 : 129));
displayParts.push(ts.spacePart());
@@ -79689,23 +80282,24 @@ var ts;
writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration);
}
else {
- var decl = ts.getDeclarationOfKind(symbol, 147);
- ts.Debug.assert(decl !== undefined);
+ var decl = ts.getDeclarationOfKind(symbol, 148);
+ if (decl === undefined)
+ return ts.Debug.fail();
var declaration = decl.parent;
if (declaration) {
if (ts.isFunctionLikeKind(declaration.kind)) {
addInPrefix();
var signature = typeChecker.getSignatureFromDeclaration(declaration);
- if (declaration.kind === 158) {
+ if (declaration.kind === 159) {
displayParts.push(ts.keywordPart(94));
displayParts.push(ts.spacePart());
}
- else if (declaration.kind !== 157 && declaration.name) {
+ else if (declaration.kind !== 158 && declaration.name) {
addFullSymbolName(declaration.symbol);
}
ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32));
}
- else if (declaration.kind === 236) {
+ else if (declaration.kind === 237) {
addInPrefix();
displayParts.push(ts.keywordPart(139));
displayParts.push(ts.spacePart());
@@ -79719,7 +80313,7 @@ var ts;
symbolKind = "enum member";
addPrefixForAnyFunctionOrVar(symbol, "enum member");
var declaration = symbol.declarations[0];
- if (declaration.kind === 272) {
+ if (declaration.kind === 273) {
var constantValue = typeChecker.getConstantValue(declaration);
if (constantValue !== undefined) {
displayParts.push(ts.spacePart());
@@ -79749,17 +80343,17 @@ var ts;
}
}
switch (symbol.declarations[0].kind) {
- case 241:
+ case 242:
displayParts.push(ts.keywordPart(84));
displayParts.push(ts.spacePart());
displayParts.push(ts.keywordPart(130));
break;
- case 248:
+ case 249:
displayParts.push(ts.keywordPart(84));
displayParts.push(ts.spacePart());
displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 58 : 79));
break;
- case 251:
+ case 252:
displayParts.push(ts.keywordPart(84));
break;
default:
@@ -79768,7 +80362,7 @@ var ts;
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
ts.forEach(symbol.declarations, function (declaration) {
- if (declaration.kind === 242) {
+ if (declaration.kind === 243) {
var importEqualsDeclaration = declaration;
if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) {
displayParts.push(ts.spacePart());
@@ -79841,10 +80435,10 @@ var ts;
documentation = symbol.getDocumentationComment(typeChecker);
tags = symbol.getJsDocTags();
if (documentation.length === 0 && symbolFlags & 4) {
- if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 273; })) {
+ if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 274; })) {
for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
- if (!declaration.parent || declaration.parent.kind !== 199) {
+ if (!declaration.parent || declaration.parent.kind !== 200) {
continue;
}
var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right);
@@ -79927,6 +80521,7 @@ var ts;
}
}
function addSignatureDisplayParts(signature, allSignatures, flags) {
+ if (flags === void 0) { flags = 0; }
ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32));
if (allSignatures.length > 1) {
displayParts.push(ts.spacePart());
@@ -79954,14 +80549,14 @@ var ts;
return false;
}
return ts.forEach(symbol.declarations, function (declaration) {
- if (declaration.kind === 191) {
+ if (declaration.kind === 192) {
return true;
}
- if (declaration.kind !== 231 && declaration.kind !== 233) {
+ if (declaration.kind !== 232 && declaration.kind !== 234) {
return false;
}
for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) {
- if (parent.kind === 273 || parent.kind === 239) {
+ if (parent.kind === 274 || parent.kind === 240) {
return false;
}
}
@@ -80029,7 +80624,8 @@ var ts;
ts.addRange(diagnostics, program.getOptionsDiagnostics());
}
program.emit(undefined, undefined, undefined, undefined, transpileOptions.transformers);
- ts.Debug.assert(outputText !== undefined, "Output generation failed");
+ if (outputText === undefined)
+ return ts.Debug.fail("Output generation failed");
return { outputText: outputText, diagnostics: diagnostics, sourceMapText: sourceMapText };
}
ts.transpileModule = transpileModule;
@@ -80045,7 +80641,7 @@ var ts;
return typeof o.type === "object" && !ts.forEachEntry(o.type, function (v) { return typeof v !== "number"; });
});
options = ts.cloneCompilerOptions(options);
- var _loop_17 = function (opt) {
+ var _loop_20 = function (opt) {
if (!ts.hasProperty(options, opt.name)) {
return "continue";
}
@@ -80061,7 +80657,7 @@ var ts;
};
for (var _i = 0, commandLineOptionsStringToEnum_1 = commandLineOptionsStringToEnum; _i < commandLineOptionsStringToEnum_1.length; _i++) {
var opt = commandLineOptionsStringToEnum_1[_i];
- _loop_17(opt);
+ _loop_20(opt);
}
return options;
}
@@ -80195,7 +80791,7 @@ var ts;
lastTokenInfo = undefined;
var isStarted = scanner.getStartPos() !== startPos;
if (isStarted) {
- wasNewLine = trailingTrivia && ts.lastOrUndefined(trailingTrivia).kind === 4;
+ wasNewLine = !!trailingTrivia && ts.last(trailingTrivia).kind === 4;
}
else {
scanner.scan();
@@ -80233,10 +80829,10 @@ var ts;
function shouldRescanJsxIdentifier(node) {
if (node.parent) {
switch (node.parent.kind) {
- case 261:
- case 256:
+ case 262:
case 257:
- case 255:
+ case 258:
+ case 256:
return ts.isKeyword(node.kind) || node.kind === 71;
}
}
@@ -80395,7 +80991,7 @@ var ts;
(function (formatting) {
function getAllRules() {
var allTokens = [];
- for (var token = 0; token <= 144; token++) {
+ for (var token = 0; token <= 145; token++) {
allTokens.push(token);
}
function anyTokenExcept() {
@@ -80407,9 +81003,9 @@ var ts;
}
var anyToken = { tokens: allTokens, isSpecific: false };
var anyTokenIncludingMultilineComments = tokenRangeFrom(allTokens.concat([3]));
- var keywords = tokenRangeFromRange(72, 144);
+ var keywords = tokenRangeFromRange(72, 145);
var binaryOperators = tokenRangeFromRange(27, 70);
- var binaryKeywordOperators = [92, 93, 144, 118, 127];
+ var binaryKeywordOperators = [92, 93, 145, 118, 127];
var unaryPrefixOperators = [43, 44, 52, 51];
var unaryPrefixExpressions = [
8, 71, 19, 21,
@@ -80497,11 +81093,11 @@ var ts;
136,
115,
139,
- 142,
+ 143,
128,
126,
], anyToken, [isNonJsxSameLineTokenContext], 2),
- rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [85, 108, 142], [isNonJsxSameLineTokenContext], 2),
+ rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [85, 108, 143], [isNonJsxSameLineTokenContext], 2),
rule("SpaceAfterModuleName", 9, 17, [isModuleDeclContext], 2),
rule("SpaceBeforeArrow", anyToken, 36, [isNonJsxSameLineTokenContext], 2),
rule("SpaceAfterArrow", 36, anyToken, [isNonJsxSameLineTokenContext], 2),
@@ -80634,37 +81230,37 @@ var ts;
return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; };
}
function isForContext(context) {
- return context.contextNode.kind === 219;
+ return context.contextNode.kind === 220;
}
function isNotForContext(context) {
return !isForContext(context);
}
function isBinaryOpContext(context) {
switch (context.contextNode.kind) {
- case 199:
case 200:
- case 170:
- case 207:
- case 251:
- case 247:
- case 160:
- case 168:
+ case 201:
+ case 171:
+ case 208:
+ case 252:
+ case 248:
+ case 161:
case 169:
+ case 170:
return true;
- case 181:
- case 236:
- case 242:
- case 231:
- case 148:
- case 272:
+ case 182:
+ case 237:
+ case 243:
+ case 232:
+ case 149:
+ case 273:
+ case 152:
case 151:
- case 150:
return context.currentTokenSpan.kind === 58 || context.nextTokenSpan.kind === 58;
- case 220:
- case 147:
- return context.currentTokenSpan.kind === 92 || context.nextTokenSpan.kind === 92;
case 221:
- return context.currentTokenSpan.kind === 144 || context.nextTokenSpan.kind === 144;
+ case 148:
+ return context.currentTokenSpan.kind === 92 || context.nextTokenSpan.kind === 92;
+ case 222:
+ return context.currentTokenSpan.kind === 145 || context.nextTokenSpan.kind === 145;
}
return false;
}
@@ -80676,22 +81272,22 @@ var ts;
}
function isTypeAnnotationContext(context) {
var contextKind = context.contextNode.kind;
- return contextKind === 151 ||
- contextKind === 150 ||
- contextKind === 148 ||
- contextKind === 231 ||
+ return contextKind === 152 ||
+ contextKind === 151 ||
+ contextKind === 149 ||
+ contextKind === 232 ||
ts.isFunctionLikeKind(contextKind);
}
function isConditionalOperatorContext(context) {
- return context.contextNode.kind === 200 ||
- context.contextNode.kind === 170;
+ return context.contextNode.kind === 201 ||
+ context.contextNode.kind === 171;
}
function isSameLineTokenOrBeforeBlockContext(context) {
return context.TokensAreOnSameLine() || isBeforeBlockContext(context);
}
function isBraceWrappedContext(context) {
- return context.contextNode.kind === 179 ||
- context.contextNode.kind === 176 ||
+ return context.contextNode.kind === 180 ||
+ context.contextNode.kind === 177 ||
isSingleLineBlockContext(context);
}
function isBeforeMultilineBlockContext(context) {
@@ -80714,26 +81310,26 @@ var ts;
return true;
}
switch (node.kind) {
- case 212:
+ case 213:
+ case 241:
+ case 184:
case 240:
- case 183:
- case 239:
return true;
}
return false;
}
function isFunctionDeclContext(context) {
switch (context.contextNode.kind) {
- case 233:
+ case 234:
+ case 154:
case 153:
- case 152:
- case 155:
case 156:
case 157:
- case 191:
- case 154:
+ case 158:
case 192:
- case 235:
+ case 155:
+ case 193:
+ case 236:
return true;
}
return false;
@@ -80742,39 +81338,39 @@ var ts;
return !isFunctionDeclContext(context);
}
function isFunctionDeclarationOrFunctionExpressionContext(context) {
- return context.contextNode.kind === 233 || context.contextNode.kind === 191;
+ return context.contextNode.kind === 234 || context.contextNode.kind === 192;
}
function isTypeScriptDeclWithBlockContext(context) {
return nodeIsTypeScriptDeclWithBlockContext(context.contextNode);
}
function nodeIsTypeScriptDeclWithBlockContext(node) {
switch (node.kind) {
- case 234:
- case 204:
case 235:
- case 237:
- case 165:
+ case 205:
+ case 236:
case 238:
- case 249:
+ case 166:
+ case 239:
case 250:
- case 243:
- case 246:
+ case 251:
+ case 244:
+ case 247:
return true;
}
return false;
}
function isAfterCodeBlockContext(context) {
switch (context.currentTokenParent.kind) {
- case 234:
- case 238:
- case 237:
- case 268:
+ case 235:
case 239:
- case 226:
+ case 238:
+ case 269:
+ case 240:
+ case 227:
return true;
- case 212: {
+ case 213: {
var blockParent = context.currentTokenParent.parent;
- if (!blockParent || blockParent.kind !== 192 && blockParent.kind !== 191) {
+ if (!blockParent || blockParent.kind !== 193 && blockParent.kind !== 192) {
return true;
}
}
@@ -80783,29 +81379,29 @@ var ts;
}
function isControlDeclContext(context) {
switch (context.contextNode.kind) {
- case 216:
- case 226:
- case 219:
+ case 217:
+ case 227:
case 220:
case 221:
+ case 222:
+ case 219:
+ case 230:
case 218:
- case 229:
- case 217:
- case 225:
- case 268:
+ case 226:
+ case 269:
return true;
default:
return false;
}
}
function isObjectContext(context) {
- return context.contextNode.kind === 183;
+ return context.contextNode.kind === 184;
}
function isFunctionCallContext(context) {
- return context.contextNode.kind === 186;
+ return context.contextNode.kind === 187;
}
function isNewContext(context) {
- return context.contextNode.kind === 187;
+ return context.contextNode.kind === 188;
}
function isFunctionCallOrNewContext(context) {
return isFunctionCallContext(context) || isNewContext(context);
@@ -80817,35 +81413,35 @@ var ts;
return context.nextTokenSpan.kind !== 22;
}
function isArrowFunctionContext(context) {
- return context.contextNode.kind === 192;
+ return context.contextNode.kind === 193;
}
function isImportTypeContext(context) {
- return context.contextNode.kind === 178;
+ return context.contextNode.kind === 179;
}
function isNonJsxSameLineTokenContext(context) {
return context.TokensAreOnSameLine() && context.contextNode.kind !== 10;
}
function isNonJsxElementOrFragmentContext(context) {
- return context.contextNode.kind !== 254 && context.contextNode.kind !== 258;
+ return context.contextNode.kind !== 255 && context.contextNode.kind !== 259;
}
function isJsxExpressionContext(context) {
- return context.contextNode.kind === 264 || context.contextNode.kind === 263;
+ return context.contextNode.kind === 265 || context.contextNode.kind === 264;
}
function isNextTokenParentJsxAttribute(context) {
- return context.nextTokenParent.kind === 261;
+ return context.nextTokenParent.kind === 262;
}
function isJsxAttributeContext(context) {
- return context.contextNode.kind === 261;
+ return context.contextNode.kind === 262;
}
function isJsxSelfClosingElementContext(context) {
- return context.contextNode.kind === 255;
+ return context.contextNode.kind === 256;
}
function isNotBeforeBlockInFunctionDeclarationContext(context) {
return !isFunctionDeclContext(context) && !isBeforeBlockContext(context);
}
function isEndOfDecoratorContextOnSameLine(context) {
return context.TokensAreOnSameLine() &&
- context.contextNode.decorators &&
+ !!context.contextNode.decorators &&
nodeIsInDecoratorContext(context.currentTokenParent) &&
!nodeIsInDecoratorContext(context.nextTokenParent);
}
@@ -80853,45 +81449,45 @@ var ts;
while (ts.isExpressionNode(node)) {
node = node.parent;
}
- return node.kind === 149;
+ return node.kind === 150;
}
function isStartOfVariableDeclarationList(context) {
- return context.currentTokenParent.kind === 232 &&
+ return context.currentTokenParent.kind === 233 &&
context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos;
}
function isNotFormatOnEnter(context) {
return context.formattingRequestKind !== 2;
}
function isModuleDeclContext(context) {
- return context.contextNode.kind === 238;
+ return context.contextNode.kind === 239;
}
function isObjectTypeContext(context) {
- return context.contextNode.kind === 165;
+ return context.contextNode.kind === 166;
}
function isConstructorSignatureContext(context) {
- return context.contextNode.kind === 158;
+ return context.contextNode.kind === 159;
}
function isTypeArgumentOrParameterOrAssertion(token, parent) {
if (token.kind !== 27 && token.kind !== 29) {
return false;
}
switch (parent.kind) {
- case 161:
- case 189:
+ case 162:
+ case 190:
+ case 237:
+ case 235:
+ case 205:
case 236:
case 234:
- case 204:
- case 235:
- case 233:
- case 191:
case 192:
+ case 193:
+ case 154:
case 153:
- case 152:
- case 157:
case 158:
- case 186:
+ case 159:
case 187:
- case 206:
+ case 188:
+ case 207:
return true;
default:
return false;
@@ -80902,16 +81498,16 @@ var ts;
isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent);
}
function isTypeAssertionContext(context) {
- return context.contextNode.kind === 189;
+ return context.contextNode.kind === 190;
}
function isVoidOpContext(context) {
- return context.currentTokenSpan.kind === 105 && context.currentTokenParent.kind === 195;
+ return context.currentTokenSpan.kind === 105 && context.currentTokenParent.kind === 196;
}
function isYieldOrYieldStarWithOperand(context) {
- return context.contextNode.kind === 202 && context.contextNode.expression !== undefined;
+ return context.contextNode.kind === 203 && context.contextNode.expression !== undefined;
}
function isNonNullAssertionContext(context) {
- return context.contextNode.kind === 208;
+ return context.contextNode.kind === 209;
}
})(formatting = ts.formatting || (ts.formatting = {}));
})(ts || (ts = {}));
@@ -80959,12 +81555,12 @@ var ts;
return map;
}
function getRuleBucketIndex(row, column) {
- ts.Debug.assert(row <= 144 && column <= 144, "Must compute formatting context from tokens");
+ ts.Debug.assert(row <= 145 && column <= 145, "Must compute formatting context from tokens");
return (row * mapRowLength) + column;
}
var maskBitSize = 5;
var mask = 31;
- var mapRowLength = 144 + 1;
+ var mapRowLength = 145 + 1;
var RulesPosition;
(function (RulesPosition) {
RulesPosition[RulesPosition["IgnoreRulesSpecific"] = 0] = "IgnoreRulesSpecific";
@@ -81084,17 +81680,17 @@ var ts;
}
function isListElement(parent, node) {
switch (parent.kind) {
- case 234:
case 235:
+ case 236:
return ts.rangeContainsRange(parent.members, node);
- case 238:
- var body = parent.body;
- return body && body.kind === 239 && ts.rangeContainsRange(body.statements, node);
- case 273:
- case 212:
case 239:
+ var body = parent.body;
+ return !!body && body.kind === 240 && ts.rangeContainsRange(body.statements, node);
+ case 274:
+ case 213:
+ case 240:
return ts.rangeContainsRange(parent.statements, node);
- case 268:
+ case 269:
return ts.rangeContainsRange(parent.block.statements, node);
}
return false;
@@ -81264,18 +81860,18 @@ var ts;
return node.modifiers[0].kind;
}
switch (node.kind) {
- case 234: return 75;
- case 235: return 109;
- case 233: return 89;
- case 237: return 237;
- case 155: return 125;
- case 156: return 136;
- case 153:
+ case 235: return 75;
+ case 236: return 109;
+ case 234: return 89;
+ case 238: return 238;
+ case 156: return 125;
+ case 157: return 136;
+ case 154:
if (node.asteriskToken) {
return 39;
}
- case 151:
- case 148:
+ case 152:
+ case 149:
return ts.getNameOfDeclaration(node).kind;
}
}
@@ -81315,15 +81911,15 @@ var ts;
case 41:
case 29:
switch (container.kind) {
- case 256:
case 257:
- case 255:
+ case 258:
+ case 256:
return false;
}
break;
case 21:
case 22:
- if (container.kind !== 176) {
+ if (container.kind !== 177) {
return false;
}
break;
@@ -81392,7 +81988,7 @@ var ts;
consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child);
return inheritedIndentation;
}
- var effectiveParentStartLine = child.kind === 149 ? childStartLine : undecoratedParentStartLine;
+ var effectiveParentStartLine = child.kind === 150 ? childStartLine : undecoratedParentStartLine;
var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine);
processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta);
if (child.kind === 10) {
@@ -81400,7 +81996,7 @@ var ts;
indentMultilineCommentOrJsxText(range, childIndentation.indentation, true, false);
}
childContextNode = node;
- if (isFirstListItem && parent.kind === 182 && inheritedIndentation === -1) {
+ if (isFirstListItem && parent.kind === 183 && inheritedIndentation === -1) {
inheritedIndentation = childIndentation.indentation;
}
return inheritedIndentation;
@@ -81751,12 +82347,12 @@ var ts;
formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment;
function getOpenTokenForList(node, list) {
switch (node.kind) {
- case 154:
- case 233:
- case 191:
- case 153:
- case 152:
+ case 155:
+ case 234:
case 192:
+ case 154:
+ case 153:
+ case 193:
if (node.typeParameters === list) {
return 27;
}
@@ -81764,8 +82360,8 @@ var ts;
return 19;
}
break;
- case 186:
case 187:
+ case 188:
if (node.typeArguments === list) {
return 27;
}
@@ -81773,7 +82369,7 @@ var ts;
return 19;
}
break;
- case 161:
+ case 162:
if (node.typeArguments === list) {
return 27;
}
@@ -81867,7 +82463,7 @@ var ts;
if (options.indentStyle === ts.IndentStyle.Block) {
return getBlockIndent(sourceFile, position, options);
}
- if (precedingToken.kind === 26 && precedingToken.parent.kind !== 199) {
+ if (precedingToken.kind === 26 && precedingToken.parent.kind !== 200) {
var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options);
if (actualIndentation !== -1) {
return actualIndentation;
@@ -81990,7 +82586,7 @@ var ts;
}
function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) {
var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) &&
- (parent.kind === 273 || !parentAndChildShareLine);
+ (parent.kind === 274 || !parentAndChildShareLine);
if (!useActualIndentation) {
return -1;
}
@@ -82029,7 +82625,7 @@ var ts;
}
SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled;
function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) {
- if (parent.kind === 216 && parent.elseStatement === child) {
+ if (parent.kind === 217 && parent.elseStatement === child) {
var elseKeyword = ts.findChildOfKind(parent, 82, sourceFile);
ts.Debug.assert(elseKeyword !== undefined);
var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line;
@@ -82045,40 +82641,40 @@ var ts;
if (node.parent) {
var end = node.end;
switch (node.parent.kind) {
- case 161:
+ case 162:
return getListIfStartEndIsInListRange(node.parent.typeArguments, node.getStart(sourceFile), end);
- case 183:
+ case 184:
return node.parent.properties;
- case 182:
+ case 183:
return node.parent.elements;
- case 233:
- case 191:
+ case 234:
case 192:
- case 153:
- case 152:
- case 157:
+ case 193:
case 154:
- case 163:
- case 158: {
+ case 153:
+ case 158:
+ case 155:
+ case 164:
+ case 159: {
var start = node.getStart(sourceFile);
return getListIfStartEndIsInListRange(node.parent.typeParameters, start, end) ||
getListIfStartEndIsInListRange(node.parent.parameters, start, end);
}
- case 234:
+ case 235:
return getListIfStartEndIsInListRange(node.parent.typeParameters, node.getStart(sourceFile), end);
- case 187:
- case 186: {
+ case 188:
+ case 187: {
var start = node.getStart(sourceFile);
return getListIfStartEndIsInListRange(node.parent.typeArguments, start, end) ||
getListIfStartEndIsInListRange(node.parent.arguments, start, end);
}
- case 232:
+ case 233:
return getListIfStartEndIsInListRange(node.parent.declarations, node.getStart(sourceFile), end);
- case 246:
- case 250:
+ case 247:
+ case 251:
return getListIfStartEndIsInListRange(node.parent.elements, node.getStart(sourceFile), end);
- case 179:
case 180:
+ case 181:
return getListIfStartEndIsInListRange(node.parent.elements, node.getStart(sourceFile), end);
}
}
@@ -82116,10 +82712,10 @@ var ts;
function getStartingExpression(node) {
while (true) {
switch (node.kind) {
- case 186:
case 187:
- case 184:
+ case 188:
case 185:
+ case 186:
node = node.expression;
break;
default:
@@ -82171,107 +82767,104 @@ var ts;
return findFirstNonWhitespaceCharacterAndColumn(startPos, endPos, sourceFile, options).column;
}
SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn;
- function nodeContentIsAlwaysIndented(kind) {
- switch (kind) {
- case 215:
- case 234:
- case 204:
- case 235:
- case 237:
- case 236:
- case 182:
- case 212:
- case 239:
- case 183:
- case 165:
- case 176:
- case 167:
- case 240:
- case 266:
- case 265:
- case 190:
- case 184:
- case 186:
- case 187:
- case 213:
- case 231:
- case 248:
- case 224:
- case 200:
- case 180:
- case 179:
- case 256:
- case 259:
- case 255:
- case 264:
- case 152:
- case 157:
- case 158:
- case 148:
- case 162:
- case 163:
- case 172:
- case 188:
- case 196:
- case 250:
- case 246:
- case 251:
- case 247:
- case 269:
- case 151:
- return true;
- }
- return false;
- }
function nodeWillIndentChild(settings, parent, child, sourceFile, indentByDefault) {
var childKind = child ? child.kind : 0;
switch (parent.kind) {
- case 231:
- case 269:
+ case 216:
+ case 235:
+ case 205:
+ case 236:
+ case 238:
+ case 237:
case 183:
- if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 183) {
+ case 213:
+ case 240:
+ case 184:
+ case 166:
+ case 177:
+ case 168:
+ case 241:
+ case 267:
+ case 266:
+ case 191:
+ case 185:
+ case 187:
+ case 188:
+ case 214:
+ case 249:
+ case 225:
+ case 201:
+ case 181:
+ case 180:
+ case 257:
+ case 260:
+ case 256:
+ case 265:
+ case 153:
+ case 158:
+ case 159:
+ case 149:
+ case 163:
+ case 164:
+ case 173:
+ case 189:
+ case 197:
+ case 251:
+ case 247:
+ case 252:
+ case 248:
+ case 152:
+ return true;
+ case 232:
+ case 270:
+ if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 184) {
return rangeIsOnOneLine(sourceFile, child);
}
- break;
- case 217:
+ return true;
case 218:
- case 220:
- case 221:
case 219:
- case 216:
- case 233:
- case 191:
- case 153:
+ case 221:
+ case 222:
+ case 220:
+ case 217:
+ case 234:
case 192:
case 154:
+ case 193:
case 155:
case 156:
- return childKind !== 212;
- case 249:
- return childKind !== 250;
- case 243:
- return childKind !== 244 ||
- (!!child.namedBindings && child.namedBindings.kind !== 246);
- case 254:
- return childKind !== 257;
- case 258:
- return childKind !== 260;
+ case 157:
+ return childKind !== 213;
+ case 250:
+ return childKind !== 251;
+ case 244:
+ return childKind !== 245 ||
+ (!!child.namedBindings && child.namedBindings.kind !== 247);
+ case 255:
+ return childKind !== 258;
+ case 259:
+ return childKind !== 261;
+ case 170:
+ case 169:
+ if (childKind === 166) {
+ return false;
+ }
}
return indentByDefault;
}
SmartIndenter.nodeWillIndentChild = nodeWillIndentChild;
function isControlFlowEndingStatement(kind, parent) {
switch (kind) {
- case 224:
- case 228: {
- if (parent.kind !== 212) {
+ case 225:
+ case 229: {
+ if (parent.kind !== 213) {
return true;
}
var grandParent = parent.parent;
- return !(grandParent && grandParent.kind === 191 || grandParent.kind === 233);
+ return !(grandParent && grandParent.kind === 192 || grandParent.kind === 234);
}
- case 222:
case 223:
+ case 224:
return true;
default:
return false;
@@ -82279,7 +82872,7 @@ var ts;
}
function shouldIndentChildNode(settings, parent, child, sourceFile, isNextChild) {
if (isNextChild === void 0) { isNextChild = false; }
- return (nodeContentIsAlwaysIndented(parent.kind) || nodeWillIndentChild(settings, parent, child, sourceFile, false))
+ return nodeWillIndentChild(settings, parent, child, sourceFile, false)
&& !(isNextChild && child && isControlFlowEndingStatement(child.kind, parent));
}
SmartIndenter.shouldIndentChildNode = shouldIndentChildNode;
@@ -82378,7 +82971,7 @@ var ts;
: end;
}
function isSeparator(node, candidate) {
- return candidate && node.parent && (candidate.kind === 26 || (candidate.kind === 25 && node.parent.kind === 183));
+ return !!candidate && !!node.parent && (candidate.kind === 26 || (candidate.kind === 25 && node.parent.kind === 184));
}
function spaces(count) {
var s = "";
@@ -82422,6 +83015,12 @@ var ts;
this.deleteRange(sourceFile, { pos: startPosition, end: endPosition });
return this;
};
+ ChangeTracker.prototype.deleteNodeRangeExcludingEnd = function (sourceFile, startNode, afterEndNode, options) {
+ if (options === void 0) { options = {}; }
+ var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart);
+ var endPosition = afterEndNode === undefined ? sourceFile.text.length : getAdjustedStartPosition(sourceFile, afterEndNode, options, Position.FullStart);
+ this.deleteRange(sourceFile, { pos: startPosition, end: endPosition });
+ };
ChangeTracker.prototype.deleteNodeInList = function (sourceFile, node) {
var containingList = ts.formatting.SmartIndenter.getContainingList(node, sourceFile);
if (!containingList) {
@@ -82527,7 +83126,7 @@ var ts;
}
}
else {
- endNode = node.kind !== 231 && node.questionToken ? node.questionToken : node.name;
+ endNode = node.kind !== 232 && node.questionToken ? node.questionToken : node.name;
}
this.insertNodeAt(sourceFile, endNode.end, type, { prefix: ": " });
};
@@ -82627,7 +83226,7 @@ var ts;
else if (ts.isStatement(node) || ts.isClassOrTypeElement(node)) {
return { suffix: this.newLineCharacter };
}
- else if (ts.isVariableDeclaration(node)) {
+ else if (ts.isVariableDeclaration(node) || ts.isStringLiteral(node)) {
return { prefix: ", " };
}
else if (ts.isPropertyAssignment(node)) {
@@ -82640,7 +83239,7 @@ var ts;
};
ChangeTracker.prototype.insertName = function (sourceFile, node, name) {
ts.Debug.assert(!node.name);
- if (node.kind === 192) {
+ if (node.kind === 193) {
var arrow = ts.findChildOfKind(node, 36, sourceFile);
var lparen = ts.findChildOfKind(node, 19, sourceFile);
if (lparen) {
@@ -82651,13 +83250,13 @@ var ts;
this.insertText(sourceFile, ts.first(node.parameters).getStart(sourceFile), "function " + name + "(");
this.replaceRange(sourceFile, arrow, ts.createToken(20));
}
- if (node.body.kind !== 212) {
+ if (node.body.kind !== 213) {
this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [ts.createToken(17), ts.createToken(96)], { joiner: " ", suffix: " " });
this.insertNodesAt(sourceFile, node.body.end, [ts.createToken(25), ts.createToken(18)], { joiner: " " });
}
}
else {
- var pos = ts.findChildOfKind(node, node.kind === 191 ? 89 : 75, sourceFile).end;
+ var pos = ts.findChildOfKind(node, node.kind === 192 ? 89 : 75, sourceFile).end;
this.insertNodeAt(sourceFile, pos, ts.createIdentifier(name), { prefix: " " });
}
};
@@ -82754,7 +83353,7 @@ var ts;
var changes = changesToText.getTextChangesFromChanges(this.changes, this.newLineCharacter, this.formatContext, validate);
for (var _i = 0, _a = this.newFiles; _i < _a.length; _i++) {
var _b = _a[_i], oldFile = _b.oldFile, fileName = _b.fileName, statements = _b.statements;
- changes.push(changesToText.newFileChanges(oldFile, fileName, statements, this.newLineCharacter));
+ changes.push(changesToText.newFileChanges(oldFile, fileName, statements, this.newLineCharacter, this.formatContext));
}
return changes;
};
@@ -82776,13 +83375,13 @@ var ts;
return ts.group(changes, function (c) { return c.sourceFile.path; }).map(function (changesInFile) {
var sourceFile = changesInFile[0].sourceFile;
var normalized = ts.stableSort(changesInFile, function (a, b) { return (a.range.pos - b.range.pos) || (a.range.end - b.range.end); });
- var _loop_18 = function (i) {
+ var _loop_21 = function (i) {
ts.Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos, "Changes overlap", function () {
return JSON.stringify(normalized[i].range) + " and " + JSON.stringify(normalized[i + 1].range);
});
};
for (var i = 0; i < normalized.length - 1; i++) {
- _loop_18(i);
+ _loop_21(i);
}
var textChanges = normalized.map(function (c) {
return ts.createTextChange(ts.createTextSpanFromRange(c.range), computeNewText(c, sourceFile, newLineCharacter, formatContext, validate));
@@ -82791,8 +83390,11 @@ var ts;
});
}
changesToText.getTextChangesFromChanges = getTextChangesFromChanges;
- function newFileChanges(oldFile, fileName, statements, newLineCharacter) {
- var text = statements.map(function (s) { return getNonformattedText(s, oldFile, newLineCharacter).text; }).join(newLineCharacter);
+ function newFileChanges(oldFile, fileName, statements, newLineCharacter, formatContext) {
+ var nonFormattedText = statements.map(function (s) { return getNonformattedText(s, oldFile, newLineCharacter).text; }).join(newLineCharacter);
+ var sourceFile = ts.createSourceFile(fileName, nonFormattedText, 6);
+ var changes = ts.formatting.formatDocument(sourceFile, formatContext);
+ var text = applyChanges(nonFormattedText, changes);
return { fileName: fileName, textChanges: [ts.createTextChange(ts.createTextSpan(0, 0), text)], isNewFile: true };
}
changesToText.newFileChanges = newFileChanges;
@@ -83030,7 +83632,7 @@ var ts;
}
textChanges_3.isValidLocationToAddComment = isValidLocationToAddComment;
function needSemicolonBetween(a, b) {
- return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 146
+ return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 147
|| ts.isStatementButNotDeclaration(a) && ts.isStatementButNotDeclaration(b);
}
})(textChanges = ts.textChanges || (ts.textChanges = {}));
@@ -83099,8 +83701,8 @@ var ts;
}
codefix.codeFixAll = codeFixAll;
function eachDiagnostic(_a, errorCodes, cb) {
- var program = _a.program, sourceFile = _a.sourceFile;
- for (var _i = 0, _b = program.getSemanticDiagnostics(sourceFile).concat(ts.computeSuggestionDiagnostics(sourceFile, program)); _i < _b.length; _i++) {
+ var program = _a.program, sourceFile = _a.sourceFile, cancellationToken = _a.cancellationToken;
+ for (var _i = 0, _b = program.getSemanticDiagnostics(sourceFile, cancellationToken).concat(ts.computeSuggestionDiagnostics(sourceFile, program, cancellationToken)); _i < _b.length; _i++) {
var diag = _b[_i];
if (ts.contains(errorCodes, diag.code)) {
cb(diag);
@@ -83229,26 +83831,26 @@ var ts;
}
function isDeclarationWithType(node) {
return ts.isFunctionLikeDeclaration(node) ||
- node.kind === 231 ||
- node.kind === 150 ||
- node.kind === 151;
+ node.kind === 232 ||
+ node.kind === 151 ||
+ node.kind === 152;
}
function transformJSDocType(node) {
switch (node.kind) {
- case 278:
case 279:
- return ts.createTypeReferenceNode("any", ts.emptyArray);
- case 282:
- return transformJSDocOptionalType(node);
- case 281:
- return transformJSDocType(node.type);
case 280:
- return transformJSDocNullableType(node);
- case 284:
- return transformJSDocVariadicType(node);
+ return ts.createTypeReferenceNode("any", ts.emptyArray);
case 283:
+ return transformJSDocOptionalType(node);
+ case 282:
+ return transformJSDocType(node.type);
+ case 281:
+ return transformJSDocNullableType(node);
+ case 285:
+ return transformJSDocVariadicType(node);
+ case 284:
return transformJSDocFunctionType(node);
- case 161:
+ case 162:
return transformJSDocTypeReference(node);
default:
var visited = ts.visitEachChild(node, transformJSDocType, undefined);
@@ -83270,7 +83872,7 @@ var ts;
}
function transformJSDocParameter(node) {
var index = node.parent.parameters.indexOf(node);
- var isRest = node.type.kind === 284 && index === node.parent.parameters.length - 1;
+ var isRest = node.type.kind === 285 && index === node.parent.parameters.length - 1;
var name = node.name || (isRest ? "rest" : "arg" + index);
var dotdotdot = isRest ? ts.createToken(24) : node.dotDotDotToken;
return ts.createParameter(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer);
@@ -83339,12 +83941,12 @@ var ts;
var precedingNode;
var newClassDeclaration;
switch (ctorDeclaration.kind) {
- case 233:
+ case 234:
precedingNode = ctorDeclaration;
deleteNode(ctorDeclaration);
newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration);
break;
- case 231:
+ case 232:
precedingNode = ctorDeclaration.parent.parent;
newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration);
if (ctorDeclaration.parent.declarations.length === 1) {
@@ -83407,25 +84009,25 @@ var ts;
if (!shouldConvertDeclaration(memberDeclaration, assignmentBinaryExpression.right)) {
return;
}
- var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 215
+ var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 216
? assignmentBinaryExpression.parent : assignmentBinaryExpression;
deleteNode(nodeToDelete);
if (!assignmentBinaryExpression.right) {
return ts.createProperty([], modifiers, symbol.name, undefined, undefined, undefined);
}
switch (assignmentBinaryExpression.right.kind) {
- case 191: {
+ case 192: {
var functionExpression = assignmentBinaryExpression.right;
var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 120));
var method = ts.createMethod(undefined, fullModifiers, undefined, memberDeclaration.name, undefined, undefined, functionExpression.parameters, undefined, functionExpression.body);
copyComments(assignmentBinaryExpression, method, sourceFile);
return method;
}
- case 192: {
+ case 193: {
var arrowFunction = assignmentBinaryExpression.right;
var arrowFunctionBody = arrowFunction.body;
var bodyBlock = void 0;
- if (arrowFunctionBody.kind === 212) {
+ if (arrowFunctionBody.kind === 213) {
bodyBlock = arrowFunctionBody;
}
else {
@@ -83449,13 +84051,13 @@ var ts;
}
function createClassFromVariableDeclaration(node) {
var initializer = node.initializer;
- if (!initializer || initializer.kind !== 191) {
+ if (!initializer || initializer.kind !== 192) {
return undefined;
}
if (node.name.kind !== 71) {
return undefined;
}
- var memberElements = createClassElementsFromSymbol(initializer.symbol);
+ var memberElements = createClassElementsFromSymbol(node.symbol);
if (initializer.body) {
memberElements.unshift(ts.createConstructor(undefined, undefined, initializer.parameters, initializer.body));
}
@@ -83497,20 +84099,20 @@ var ts;
codefix.registerCodeFix({
errorCodes: [ts.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module.code],
getCodeActions: function (context) {
- var sourceFile = context.sourceFile, program = context.program;
+ var sourceFile = context.sourceFile, program = context.program, preferences = context.preferences;
var changes = ts.textChanges.ChangeTracker.with(context, function (changes) {
- var moduleExportsChangedToDefault = convertFileToEs6Module(sourceFile, program.getTypeChecker(), changes, program.getCompilerOptions().target);
+ var moduleExportsChangedToDefault = convertFileToEs6Module(sourceFile, program.getTypeChecker(), changes, program.getCompilerOptions().target, preferences);
if (moduleExportsChangedToDefault) {
for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) {
var importingFile = _a[_i];
- fixImportOfModuleExports(importingFile, sourceFile, changes);
+ fixImportOfModuleExports(importingFile, sourceFile, changes, preferences);
}
}
});
return [codefix.createCodeFixActionNoFixId("convertToEs6Module", changes, ts.Diagnostics.Convert_to_ES6_module)];
},
});
- function fixImportOfModuleExports(importingFile, exportingFile, changes) {
+ function fixImportOfModuleExports(importingFile, exportingFile, changes, preferences) {
for (var _i = 0, _a = importingFile.imports; _i < _a.length; _i++) {
var moduleSpecifier = _a[_i];
var imported = ts.getResolvedModule(importingFile, moduleSpecifier.text);
@@ -83519,10 +84121,10 @@ var ts;
}
var importNode = ts.importFromModuleSpecifier(moduleSpecifier);
switch (importNode.kind) {
- case 242:
- changes.replaceNode(importingFile, importNode, ts.makeImport(importNode.name, undefined, moduleSpecifier));
+ case 243:
+ changes.replaceNode(importingFile, importNode, ts.makeImport(importNode.name, undefined, moduleSpecifier, preferences));
break;
- case 186:
+ case 187:
if (ts.isRequireCall(importNode, false)) {
changes.replaceNode(importingFile, importNode, ts.createPropertyAccess(ts.getSynthesizedDeepClone(importNode), "default"));
}
@@ -83530,14 +84132,14 @@ var ts;
}
}
}
- function convertFileToEs6Module(sourceFile, checker, changes, target) {
+ function convertFileToEs6Module(sourceFile, checker, changes, target, preferences) {
var identifiers = { original: collectFreeIdentifiers(sourceFile), additional: ts.createMap() };
var exports = collectExportRenames(sourceFile, checker, identifiers);
convertExportsAccesses(sourceFile, exports, changes);
var moduleExportsChangedToDefault = false;
for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {
var statement = _a[_i];
- var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports);
+ var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, preferences);
moduleExportsChangedToDefault = moduleExportsChangedToDefault || moduleExportsChanged;
}
return moduleExportsChangedToDefault;
@@ -83571,21 +84173,21 @@ var ts;
node.forEachChild(recur);
});
}
- function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports) {
+ function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, preferences) {
switch (statement.kind) {
- case 213:
- convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target);
+ case 214:
+ convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, preferences);
return false;
- case 215: {
+ case 216: {
var expression = statement.expression;
switch (expression.kind) {
- case 186: {
+ case 187: {
if (ts.isRequireCall(expression, true)) {
- changes.replaceNode(sourceFile, statement, ts.makeImport(undefined, undefined, expression.arguments[0]));
+ changes.replaceNode(sourceFile, statement, ts.makeImport(undefined, undefined, expression.arguments[0], preferences));
}
return false;
}
- case 199: {
+ case 200: {
var operatorToken = expression.operatorToken;
return operatorToken.kind === 58 && convertAssignment(sourceFile, checker, expression, changes, exports);
}
@@ -83595,7 +84197,7 @@ var ts;
return false;
}
}
- function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target) {
+ function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, preferences) {
var declarationList = statement.declarationList;
var foundImport = false;
var newNodes = ts.flatMap(declarationList.declarations, function (decl) {
@@ -83607,11 +84209,11 @@ var ts;
}
else if (ts.isRequireCall(initializer, true)) {
foundImport = true;
- return convertSingleImport(sourceFile, name, initializer.arguments[0], changes, checker, identifiers, target);
+ return convertSingleImport(sourceFile, name, initializer.arguments[0], changes, checker, identifiers, target, preferences);
}
else if (ts.isPropertyAccessExpression(initializer) && ts.isRequireCall(initializer.expression, true)) {
foundImport = true;
- return convertPropertyAccessImport(name, initializer.name.text, initializer.expression.arguments[0], identifiers);
+ return convertPropertyAccessImport(name, initializer.name.text, initializer.expression.arguments[0], identifiers, preferences);
}
}
return ts.createVariableStatement(undefined, ts.createVariableDeclarationList([decl], declarationList.flags));
@@ -83620,20 +84222,20 @@ var ts;
changes.replaceNodeWithNodes(sourceFile, statement, newNodes);
}
}
- function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers) {
+ function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, preferences) {
switch (name.kind) {
- case 179:
- case 180: {
+ case 180:
+ case 181: {
var tmp = makeUniqueName(propertyName, identifiers);
return [
- makeSingleImport(tmp, propertyName, moduleSpecifier),
+ makeSingleImport(tmp, propertyName, moduleSpecifier, preferences),
makeConst(undefined, name, ts.createIdentifier(tmp)),
];
}
case 71:
- return [makeSingleImport(name.text, propertyName, moduleSpecifier)];
+ return [makeSingleImport(name.text, propertyName, moduleSpecifier, preferences)];
default:
- ts.Debug.assertNever(name);
+ return ts.Debug.assertNever(name);
}
}
function convertAssignment(sourceFile, checker, assignment, changes, exports) {
@@ -83667,14 +84269,14 @@ var ts;
function tryChangeModuleExportsObject(object) {
var statements = ts.mapAllOrFail(object.properties, function (prop) {
switch (prop.kind) {
- case 155:
case 156:
- case 270:
+ case 157:
case 271:
+ case 272:
return undefined;
- case 269:
+ case 270:
return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer);
- case 153:
+ case 154:
return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.createToken(84)], prop);
default:
ts.Debug.assertNever(prop);
@@ -83730,15 +84332,15 @@ var ts;
function convertExportsDotXEquals_replaceNode(name, exported) {
var modifiers = [ts.createToken(84)];
switch (exported.kind) {
- case 191: {
+ case 192: {
var expressionName = exported.name;
if (expressionName && expressionName.text !== name) {
return exportConst();
}
}
- case 192:
+ case 193:
return functionExpressionToDeclaration(name, modifiers, exported);
- case 204:
+ case 205:
return classExpressionToDeclaration(name, modifiers, exported);
default:
return exportConst();
@@ -83747,32 +84349,32 @@ var ts;
return makeConst(modifiers, ts.createIdentifier(name), exported);
}
}
- function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target) {
+ function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target, preferences) {
switch (name.kind) {
- case 179: {
+ case 180: {
var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) {
return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name)
? undefined
: makeImportSpecifier(e.propertyName && e.propertyName.text, e.name.text);
});
if (importSpecifiers) {
- return [ts.makeImport(undefined, importSpecifiers, moduleSpecifier)];
+ return [ts.makeImport(undefined, importSpecifiers, moduleSpecifier, preferences)];
}
}
- case 180: {
+ case 181: {
var tmp = makeUniqueName(codefix.moduleSpecifierToValidIdentifier(moduleSpecifier.text, target), identifiers);
return [
- ts.makeImport(ts.createIdentifier(tmp), undefined, moduleSpecifier),
+ ts.makeImport(ts.createIdentifier(tmp), undefined, moduleSpecifier, preferences),
makeConst(undefined, ts.getSynthesizedDeepClone(name), ts.createIdentifier(tmp)),
];
}
case 71:
- return convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers);
+ return convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers, preferences);
default:
- ts.Debug.assertNever(name);
+ return ts.Debug.assertNever(name);
}
}
- function convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers) {
+ function convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers, preferences) {
var nameSymbol = checker.getSymbolAtLocation(name);
var namedBindingsNames = ts.createMap();
var needDefaultImport = false;
@@ -83803,7 +84405,7 @@ var ts;
if (!namedBindings) {
needDefaultImport = true;
}
- return [ts.makeImport(needDefaultImport ? ts.getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier)];
+ return [ts.makeImport(needDefaultImport ? ts.getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier, preferences)];
}
function makeUniqueName(name, identifiers) {
while (identifiers.original.has(name) || identifiers.additional.has(name)) {
@@ -83814,20 +84416,22 @@ var ts;
}
function collectFreeIdentifiers(file) {
var map = ts.createMultiMap();
- file.forEachChild(function recur(node) {
- if (ts.isIdentifier(node) && isFreeIdentifier(node)) {
- map.add(node.text, node);
- }
- node.forEachChild(recur);
- });
+ forEachFreeIdentifier(file, function (id) { return map.add(id.text, id); });
return map;
}
+ function forEachFreeIdentifier(node, cb) {
+ if (ts.isIdentifier(node) && isFreeIdentifier(node))
+ cb(node);
+ node.forEachChild(function (child) { return forEachFreeIdentifier(child, cb); });
+ }
function isFreeIdentifier(node) {
var parent = node.parent;
switch (parent.kind) {
- case 184:
+ case 185:
return parent.name !== node;
- case 181:
+ case 182:
+ return parent.propertyName !== node;
+ case 248:
return parent.propertyName !== node;
default:
return true;
@@ -83839,10 +84443,10 @@ var ts;
function classExpressionToDeclaration(name, additionalModifiers, cls) {
return ts.createClassDeclaration(ts.getSynthesizedDeepClones(cls.decorators), ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(cls.modifiers)), name, ts.getSynthesizedDeepClones(cls.typeParameters), ts.getSynthesizedDeepClones(cls.heritageClauses), ts.getSynthesizedDeepClones(cls.members));
}
- function makeSingleImport(localName, propertyName, moduleSpecifier) {
+ function makeSingleImport(localName, propertyName, moduleSpecifier, preferences) {
return propertyName === "default"
- ? ts.makeImport(ts.createIdentifier(localName), undefined, moduleSpecifier)
- : ts.makeImport(undefined, [makeImportSpecifier(propertyName, localName)], moduleSpecifier);
+ ? ts.makeImport(ts.createIdentifier(localName), undefined, moduleSpecifier, preferences)
+ : ts.makeImport(undefined, [makeImportSpecifier(propertyName, localName)], moduleSpecifier, preferences);
}
function makeImportSpecifier(propertyName, name) {
return ts.createImportSpecifier(propertyName !== undefined && propertyName !== name ? ts.createIdentifier(propertyName) : undefined, ts.createIdentifier(name));
@@ -83926,10 +84530,14 @@ var ts;
function getClass(sourceFile, pos) {
return ts.Debug.assertDefined(ts.getContainingClass(ts.getTokenAtPosition(sourceFile, pos, false)));
}
+ function symbolPointsToNonPrivateMember(symbol) {
+ return !(ts.getModifierFlags(symbol.valueDeclaration) & 8);
+ }
function addMissingDeclarations(checker, implementedTypeNode, sourceFile, classDeclaration, changeTracker, preferences) {
+ var maybeHeritageClauseSymbol = getHeritageClauseSymbolTable(classDeclaration, checker);
var implementedType = checker.getTypeAtLocation(implementedTypeNode);
var implementedTypeSymbols = checker.getPropertiesOfType(implementedType);
- var nonPrivateMembers = implementedTypeSymbols.filter(function (symbol) { return !(ts.getModifierFlags(symbol.valueDeclaration) & 8); });
+ var nonPrivateAndNotExistedInHeritageClauseMembers = implementedTypeSymbols.filter(ts.and(symbolPointsToNonPrivateMember, function (symbol) { return !maybeHeritageClauseSymbol.has(symbol.escapedName); }));
var classType = checker.getTypeAtLocation(classDeclaration);
if (!classType.getNumberIndexType()) {
createMissingIndexSignatureDeclaration(implementedType, 1);
@@ -83937,7 +84545,7 @@ var ts;
if (!classType.getStringIndexType()) {
createMissingIndexSignatureDeclaration(implementedType, 0);
}
- codefix.createMissingMemberNodes(classDeclaration, nonPrivateMembers, checker, preferences, function (member) { return changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member); });
+ codefix.createMissingMemberNodes(classDeclaration, nonPrivateAndNotExistedInHeritageClauseMembers, checker, preferences, function (member) { return changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member); });
function createMissingIndexSignatureDeclaration(type, kind) {
var indexInfoOfKind = checker.getIndexInfoOfType(type, kind);
if (indexInfoOfKind) {
@@ -83945,6 +84553,14 @@ var ts;
}
}
}
+ function getHeritageClauseSymbolTable(classDeclaration, checker) {
+ var heritageClauseNode = ts.getClassExtendsHeritageClauseElement(classDeclaration);
+ if (!heritageClauseNode)
+ return ts.createSymbolTable();
+ var heritageClauseType = checker.getTypeAtLocation(heritageClauseNode);
+ var heritageClauseTypeSymbols = checker.getPropertiesOfType(heritageClauseType);
+ return ts.createSymbolTable(heritageClauseTypeSymbols.filter(symbolPointsToNonPrivateMember));
+ }
})(codefix = ts.codefix || (ts.codefix = {}));
})(ts || (ts = {}));
var ts;
@@ -83960,7 +84576,9 @@ var ts;
ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code,
ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here.code,
],
- getCodeActions: getImportCodeActions,
+ getCodeActions: function (context) { return context.errorCode === ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code
+ ? getActionsForUMDImport(context)
+ : getActionsForNonUMDImport(context); },
fixIds: [],
getAllCodeActions: ts.notImplemented,
});
@@ -83977,7 +84595,6 @@ var ts;
program: program,
checker: checker,
compilerOptions: program.getCompilerOptions(),
- cachedImportDeclarations: [],
getCanonicalFileName: ts.createGetCanonicalFileName(ts.hostUsesCaseSensitiveFileNames(context.host)),
symbolName: symbolName,
symbolToken: symbolToken,
@@ -84021,46 +84638,57 @@ var ts;
return result;
}
function getCodeActionsForImport_separateExistingAndNew(exportInfos, context, useExisting, addNew) {
- var existingImports = ts.flatMap(exportInfos, function (info) {
- return getImportDeclarations(info, context.checker, context.sourceFile, context.cachedImportDeclarations);
- });
- if (context.symbolToken && ts.isIdentifier(context.symbolToken)) {
- for (var _i = 0, existingImports_1 = existingImports; _i < existingImports_1.length; _i++) {
- var declaration = existingImports_1[_i].declaration;
- var namespace = getNamespaceImportName(declaration);
- if (namespace) {
- var moduleSymbol = context.checker.getAliasedSymbol(context.checker.getSymbolAtLocation(namespace));
- if (moduleSymbol && moduleSymbol.exports.has(ts.escapeLeadingUnderscores(context.symbolName))) {
- useExisting.push(getCodeActionForUseExistingNamespaceImport(namespace.text, context, context.symbolToken));
- }
+ var existingImports = ts.flatMap(exportInfos, function (info) { return getExistingImportDeclarations(info, context.checker, context.sourceFile); });
+ ts.append(useExisting, tryUseExistingNamespaceImport(existingImports, context, context.symbolToken, context.checker));
+ var addToExisting = tryAddToExistingImport(existingImports, context);
+ if (addToExisting) {
+ useExisting.push(addToExisting);
+ }
+ else {
+ getCodeActionsForAddImport(exportInfos, context, existingImports, addNew);
+ }
+ }
+ function tryUseExistingNamespaceImport(existingImports, context, symbolToken, checker) {
+ return !symbolToken || !ts.isIdentifier(symbolToken) ? undefined : ts.firstDefined(existingImports, function (_a) {
+ var declaration = _a.declaration;
+ var namespace = getNamespaceImportName(declaration);
+ if (namespace) {
+ var moduleSymbol = namespace && checker.getAliasedSymbol(checker.getSymbolAtLocation(namespace));
+ if (moduleSymbol && moduleSymbol.exports.has(ts.escapeLeadingUnderscores(context.symbolName))) {
+ return getCodeActionForUseExistingNamespaceImport(namespace.text, context, symbolToken);
}
}
- }
- getCodeActionsForAddImport(exportInfos, context, existingImports, useExisting, addNew);
+ });
+ }
+ function tryAddToExistingImport(existingImports, context) {
+ return ts.firstDefined(existingImports, function (_a) {
+ var declaration = _a.declaration, importKind = _a.importKind;
+ if (declaration.kind === 244 && declaration.importClause) {
+ var changes = tryUpdateExistingImport(context, declaration.importClause, importKind);
+ if (changes) {
+ var moduleSpecifierWithoutQuotes = ts.stripQuotes(declaration.moduleSpecifier.getText());
+ return createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [context.symbolName, moduleSpecifierWithoutQuotes], changes);
+ }
+ }
+ });
}
function getNamespaceImportName(declaration) {
- if (declaration.kind === 243) {
+ if (declaration.kind === 244) {
var namedBindings = declaration.importClause && ts.isImportClause(declaration.importClause) && declaration.importClause.namedBindings;
- return namedBindings && namedBindings.kind === 245 ? namedBindings.name : undefined;
+ return namedBindings && namedBindings.kind === 246 ? namedBindings.name : undefined;
}
else {
return declaration.name;
}
}
- function getImportDeclarations(_a, checker, _b, cachedImportDeclarations) {
+ function getExistingImportDeclarations(_a, checker, _b) {
var moduleSymbol = _a.moduleSymbol, importKind = _a.importKind;
var imports = _b.imports;
- if (cachedImportDeclarations === void 0) { cachedImportDeclarations = []; }
- var moduleSymbolId = ts.getUniqueSymbolId(moduleSymbol, checker);
- var cached = cachedImportDeclarations[moduleSymbolId];
- if (!cached) {
- cached = cachedImportDeclarations[moduleSymbolId] = ts.mapDefined(imports, function (moduleSpecifier) {
- var i = ts.importFromModuleSpecifier(moduleSpecifier);
- return (i.kind === 243 || i.kind === 242)
- && checker.getSymbolAtLocation(moduleSpecifier) === moduleSymbol ? { declaration: i, importKind: importKind } : undefined;
- });
- }
- return cached;
+ return ts.mapDefined(imports, function (moduleSpecifier) {
+ var i = ts.importFromModuleSpecifier(moduleSpecifier);
+ return (i.kind === 244 || i.kind === 243)
+ && checker.getSymbolAtLocation(moduleSpecifier) === moduleSymbol ? { declaration: i, importKind: importKind } : undefined;
+ });
}
function getCodeActionForNewImport(context, _a) {
var moduleSpecifier = _a.moduleSpecifier, importKind = _a.importKind;
@@ -84111,21 +84739,7 @@ var ts;
});
return ts.flatten(choicesForEachExportingModule.sort(function (a, b) { return ts.first(a).moduleSpecifier.length - ts.first(b).moduleSpecifier.length; }));
}
- function getCodeActionsForAddImport(exportInfos, ctx, existingImports, useExisting, addNew) {
- var fromExistingImport = ts.firstDefined(existingImports, function (_a) {
- var declaration = _a.declaration, importKind = _a.importKind;
- if (declaration.kind === 243 && declaration.importClause) {
- var changes = tryUpdateExistingImport(ctx, ts.isImportClause(declaration.importClause) && declaration.importClause || undefined, importKind);
- if (changes) {
- var moduleSpecifierWithoutQuotes = ts.stripQuotes(declaration.moduleSpecifier.getText());
- return createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [ctx.symbolName, moduleSpecifierWithoutQuotes], changes);
- }
- }
- });
- if (fromExistingImport) {
- useExisting.push(fromExistingImport);
- return;
- }
+ function getCodeActionsForAddImport(exportInfos, ctx, existingImports, addNew) {
var existingDeclaration = ts.firstDefined(existingImports, newImportInfoFromExistingSpecifier);
var newImportInfos = existingDeclaration
? [existingDeclaration]
@@ -84137,9 +84751,9 @@ var ts;
}
function newImportInfoFromExistingSpecifier(_a) {
var declaration = _a.declaration, importKind = _a.importKind;
- var expression = declaration.kind === 243
+ var expression = declaration.kind === 244
? declaration.moduleSpecifier
- : declaration.moduleReference.kind === 253
+ : declaration.moduleReference.kind === 254
? declaration.moduleReference.expression
: undefined;
return expression && ts.isStringLiteral(expression) ? { moduleSpecifier: expression.text, importKind: importKind } : undefined;
@@ -84147,7 +84761,7 @@ var ts;
function tryUpdateExistingImport(context, importClause, importKind) {
var symbolName = context.symbolName, sourceFile = context.sourceFile;
var name = importClause.name;
- var namedBindings = (importClause.kind !== 242 && importClause).namedBindings;
+ var namedBindings = (importClause.kind !== 243 && importClause).namedBindings;
switch (importKind) {
case 1:
return name ? undefined : ChangeTracker.with(context, function (t) {
@@ -84155,10 +84769,10 @@ var ts;
});
case 0: {
var newImportSpecifier_1 = ts.createImportSpecifier(undefined, ts.createIdentifier(symbolName));
- if (namedBindings && namedBindings.kind === 246 && namedBindings.elements.length !== 0) {
+ if (namedBindings && namedBindings.kind === 247 && namedBindings.elements.length !== 0) {
return ChangeTracker.with(context, function (t) { return t.insertNodeInListAfter(sourceFile, namedBindings.elements[namedBindings.elements.length - 1], newImportSpecifier_1); });
}
- if (!namedBindings || namedBindings.kind === 246 && namedBindings.elements.length === 0) {
+ if (!namedBindings || namedBindings.kind === 247 && namedBindings.elements.length === 0) {
return ChangeTracker.with(context, function (t) {
return t.replaceNode(sourceFile, importClause, ts.createImportClause(name, ts.createNamedImports([newImportSpecifier_1])));
});
@@ -84182,11 +84796,6 @@ var ts;
});
return createCodeAction(ts.Diagnostics.Change_0_to_1, [symbolName, namespacePrefix + "." + symbolName], changes);
}
- function getImportCodeActions(context) {
- return context.errorCode === ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code
- ? getActionsForUMDImport(context)
- : getActionsForNonUMDImport(context);
- }
function getActionsForUMDImport(context) {
var token = ts.getTokenAtPosition(context.sourceFile, context.span.start, false);
var checker = context.program.getTypeChecker();
@@ -84197,7 +84806,7 @@ var ts;
if (!ts.isUMDExportSymbol(umdSymbol)) {
var parent = token.parent;
var isNodeOpeningLikeElement = ts.isJsxOpeningLikeElement(parent);
- if ((ts.isJsxOpeningLikeElement && parent.tagName === token) || parent.kind === 259) {
+ if ((ts.isJsxOpeningLikeElement && parent.tagName === token) || parent.kind === 260) {
umdSymbol = checker.resolveName(checker.getJsxNamespace(parent), isNodeOpeningLikeElement ? parent.tagName : parent, 67216319, false);
}
}
@@ -84240,7 +84849,14 @@ var ts;
if (!symbolName)
return undefined;
ts.Debug.assert(symbolName !== "default");
- var currentTokenMeaning = ts.getMeaningFromLocation(symbolToken);
+ var addToExistingDeclaration = [];
+ var addNewDeclaration = [];
+ getExportInfos(symbolName, ts.getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, checker, program).forEach(function (exportInfos) {
+ getCodeActionsForImport_separateExistingAndNew(exportInfos, convertToImportCodeFixContext(context, symbolToken, symbolName), addToExistingDeclaration, addNewDeclaration);
+ });
+ return addToExistingDeclaration.concat(addNewDeclaration);
+ }
+ function getExportInfos(symbolName, currentTokenMeaning, cancellationToken, sourceFile, checker, program) {
var originalSymbolToExportInfos = ts.createMultiMap();
function addSymbol(moduleSymbol, exportedSymbol, importKind) {
originalSymbolToExportInfos.add(ts.getUniqueSymbolId(exportedSymbol, checker).toString(), { moduleSymbol: moduleSymbol, importKind: importKind });
@@ -84261,7 +84877,7 @@ var ts;
addSymbol(moduleSymbol, exportSymbolWithIdenticalName, 0);
}
function getEscapedNameForExportDefault(symbol) {
- return ts.firstDefined(symbol.declarations, function (declaration) {
+ return symbol.declarations && ts.firstDefined(symbol.declarations, function (declaration) {
if (ts.isExportAssignment(declaration)) {
if (ts.isIdentifier(declaration.expression)) {
return declaration.expression.escapedText;
@@ -84269,19 +84885,12 @@ var ts;
}
else if (ts.isExportSpecifier(declaration)) {
ts.Debug.assert(declaration.name.escapedText === "default");
- if (declaration.propertyName) {
- return declaration.propertyName.escapedText;
- }
+ return declaration.propertyName && declaration.propertyName.escapedText;
}
});
}
});
- var addToExistingDeclaration = [];
- var addNewDeclaration = [];
- originalSymbolToExportInfos.forEach(function (exportInfos) {
- getCodeActionsForImport_separateExistingAndNew(exportInfos, convertToImportCodeFixContext(context, symbolToken, symbolName), addToExistingDeclaration, addNewDeclaration);
- });
- return addToExistingDeclaration.concat(addNewDeclaration);
+ return originalSymbolToExportInfos;
}
function checkSymbolHasMeaning(_a, meaning) {
var declarations = _a.declarations;
@@ -84303,7 +84912,7 @@ var ts;
for (var _b = 0, allSourceFiles_1 = allSourceFiles; _b < allSourceFiles_1.length; _b++) {
var sourceFile = allSourceFiles_1[_b];
if (ts.isExternalOrCommonJsModule(sourceFile)) {
- cb(sourceFile.symbol, sourceFile);
+ cb(checker.getMergedSymbol(sourceFile.symbol), sourceFile);
}
}
}
@@ -84505,7 +85114,7 @@ var ts;
}
function addMissingMemberInJs(changeTracker, classDeclarationSourceFile, classDeclaration, tokenName, makeStatic) {
if (makeStatic) {
- if (classDeclaration.kind === 204) {
+ if (classDeclaration.kind === 205) {
return;
}
var className = classDeclaration.name.getText();
@@ -84531,7 +85140,7 @@ var ts;
}
function getTypeNode(checker, classDeclaration, token) {
var typeNode;
- if (token.parent.parent.kind === 199) {
+ if (token.parent.parent.kind === 200) {
var binaryExpression = token.parent.parent;
var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left;
var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression)));
@@ -84576,7 +85185,13 @@ var ts;
}
function addMethodDeclaration(changeTracker, classDeclarationSourceFile, classDeclaration, token, callExpression, makeStatic, inJs, preferences) {
var methodDeclaration = codefix.createMethodFromCallExpression(callExpression, token.text, inJs, makeStatic, preferences);
- changeTracker.insertNodeAtClassStart(classDeclarationSourceFile, classDeclaration, methodDeclaration);
+ var containingMethodDeclaration = ts.getAncestor(callExpression, 154);
+ if (containingMethodDeclaration && containingMethodDeclaration.parent === classDeclaration) {
+ changeTracker.insertNodeAfter(classDeclarationSourceFile, containingMethodDeclaration, methodDeclaration);
+ }
+ else {
+ changeTracker.insertNodeAtClassStart(classDeclarationSourceFile, classDeclaration, methodDeclaration);
+ }
}
})(codefix = ts.codefix || (ts.codefix = {}));
})(ts || (ts = {}));
@@ -84817,7 +85432,9 @@ var ts;
},
fixIds: [fixId],
getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {
- doChange(changes, context.sourceFile, getInfo(diag.file, diag.start, diag.code));
+ var info = getInfo(diag.file, diag.start, diag.code);
+ if (info)
+ doChange(changes, context.sourceFile, info);
}); },
});
function getInfo(sourceFile, pos, diagCode) {
@@ -84846,23 +85463,30 @@ var ts;
ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code,
ts.Diagnostics.All_imports_in_import_declaration_are_unused.code,
ts.Diagnostics.All_destructured_elements_are_unused.code,
+ ts.Diagnostics.All_variables_are_unused.code,
];
codefix.registerCodeFix({
errorCodes: errorCodes,
getCodeActions: function (context) {
- var errorCode = context.errorCode, sourceFile = context.sourceFile;
- var importDecl = tryGetFullImport(sourceFile, context.span.start);
+ var errorCode = context.errorCode, sourceFile = context.sourceFile, program = context.program;
+ var checker = program.getTypeChecker();
+ var startToken = ts.getTokenAtPosition(sourceFile, context.span.start, false);
+ var importDecl = tryGetFullImport(startToken);
if (importDecl) {
var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return t.deleteNode(sourceFile, importDecl); });
return [codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Remove_import_from_0, ts.showModuleSpecifier(importDecl)], fixIdDelete, ts.Diagnostics.Delete_all_unused_declarations)];
}
- var delDestructure = ts.textChanges.ChangeTracker.with(context, function (t) { return tryDeleteFullDestructure(t, sourceFile, context.span.start, undefined); });
+ var delDestructure = ts.textChanges.ChangeTracker.with(context, function (t) { return tryDeleteFullDestructure(t, sourceFile, startToken, undefined, checker, false); });
if (delDestructure.length) {
return [codefix.createCodeFixAction(fixName, delDestructure, ts.Diagnostics.Remove_destructuring, fixIdDelete, ts.Diagnostics.Delete_all_unused_declarations)];
}
+ var delVar = ts.textChanges.ChangeTracker.with(context, function (t) { return tryDeleteFullVariableStatement(t, sourceFile, startToken, undefined); });
+ if (delVar.length) {
+ return [codefix.createCodeFixAction(fixName, delVar, ts.Diagnostics.Remove_variable_statement, fixIdDelete, ts.Diagnostics.Delete_all_unused_declarations)];
+ }
var token = getToken(sourceFile, ts.textSpanEnd(context.span));
var result = [];
- var deletion = ts.textChanges.ChangeTracker.with(context, function (t) { return tryDeleteDeclaration(t, sourceFile, token, undefined); });
+ var deletion = ts.textChanges.ChangeTracker.with(context, function (t) { return tryDeleteDeclaration(t, sourceFile, token, undefined, checker, false); });
if (deletion.length) {
result.push(codefix.createCodeFixAction(fixName, deletion, [ts.Diagnostics.Remove_declaration_for_Colon_0, token.getText(sourceFile)], fixIdDelete, ts.Diagnostics.Delete_all_unused_declarations));
}
@@ -84874,9 +85498,11 @@ var ts;
},
fixIds: [fixIdPrefix, fixIdDelete],
getAllCodeActions: function (context) {
- var deleted = new NodeSet();
+ var deleted = new ts.NodeSet();
+ var sourceFile = context.sourceFile, program = context.program;
+ var checker = program.getTypeChecker();
return codefix.codeFixAll(context, errorCodes, function (changes, diag) {
- var sourceFile = context.sourceFile;
+ var startToken = ts.getTokenAtPosition(sourceFile, diag.start, false);
var token = ts.findPrecedingToken(ts.textSpanEnd(diag), diag.file);
switch (context.fixId) {
case fixIdPrefix:
@@ -84887,14 +85513,13 @@ var ts;
case fixIdDelete:
if (deleted.some(function (d) { return ts.rangeContainsPosition(d, diag.start); }))
break;
- var importDecl = tryGetFullImport(diag.file, diag.start);
+ var importDecl = tryGetFullImport(startToken);
if (importDecl) {
changes.deleteNode(sourceFile, importDecl);
}
- else {
- if (!tryDeleteFullDestructure(changes, sourceFile, diag.start, deleted)) {
- tryDeleteDeclaration(changes, sourceFile, token, deleted);
- }
+ else if (!tryDeleteFullDestructure(changes, sourceFile, startToken, deleted, checker, true) &&
+ !tryDeleteFullVariableStatement(changes, sourceFile, startToken, deleted)) {
+ tryDeleteDeclaration(changes, sourceFile, token, deleted, checker, true);
}
break;
default:
@@ -84903,25 +85528,25 @@ var ts;
});
},
});
- function tryGetFullImport(sourceFile, pos) {
- var startToken = ts.getTokenAtPosition(sourceFile, pos, false);
+ function tryGetFullImport(startToken) {
return startToken.kind === 91 ? ts.tryCast(startToken.parent, ts.isImportDeclaration) : undefined;
}
- function tryDeleteFullDestructure(changes, sourceFile, pos, deletedAncestors) {
- var startToken = ts.getTokenAtPosition(sourceFile, pos, false);
+ function tryDeleteFullDestructure(changes, sourceFile, startToken, deletedAncestors, checker, isFixAll) {
if (startToken.kind !== 17 || !ts.isObjectBindingPattern(startToken.parent))
return false;
- var decl = startToken.parent.parent;
+ var decl = ts.cast(startToken.parent, ts.isObjectBindingPattern).parent;
switch (decl.kind) {
- case 231:
+ case 232:
tryDeleteVariableDeclaration(changes, sourceFile, decl, deletedAncestors);
break;
- case 148:
+ case 149:
+ if (!mayDeleteParameter(decl, checker, isFixAll))
+ break;
if (deletedAncestors)
deletedAncestors.add(decl);
changes.deleteNodeInList(sourceFile, decl);
break;
- case 181:
+ case 182:
if (deletedAncestors)
deletedAncestors.add(decl);
changes.deleteNode(sourceFile, decl);
@@ -84931,6 +85556,16 @@ var ts;
}
return true;
}
+ function tryDeleteFullVariableStatement(changes, sourceFile, startToken, deletedAncestors) {
+ var declarationList = ts.tryCast(startToken.parent, ts.isVariableDeclarationList);
+ if (declarationList && declarationList.getChildren(sourceFile)[0] === startToken) {
+ if (deletedAncestors)
+ deletedAncestors.add(declarationList);
+ changes.deleteNode(sourceFile, declarationList.parent.kind === 214 ? declarationList.parent : declarationList);
+ return true;
+ }
+ return false;
+ }
function getToken(sourceFile, pos) {
var token = ts.findPrecedingToken(pos, sourceFile, undefined, true);
return token.kind === 22 ? ts.findPrecedingToken(pos - 1, sourceFile) : token;
@@ -84942,26 +85577,26 @@ var ts;
}
function canPrefix(token) {
switch (token.parent.kind) {
- case 148:
+ case 149:
return true;
- case 231: {
+ case 232: {
var varDecl = token.parent;
switch (varDecl.parent.parent.kind) {
+ case 222:
case 221:
- case 220:
return true;
}
}
}
return false;
}
- function tryDeleteDeclaration(changes, sourceFile, token, deletedAncestors) {
+ function tryDeleteDeclaration(changes, sourceFile, token, deletedAncestors, checker, isFixAll) {
switch (token.kind) {
case 71:
- tryDeleteIdentifier(changes, sourceFile, token, deletedAncestors);
+ tryDeleteIdentifier(changes, sourceFile, token, deletedAncestors, checker, isFixAll);
break;
- case 151:
- case 245:
+ case 152:
+ case 246:
if (deletedAncestors)
deletedAncestors.add(token.parent);
changes.deleteNode(sourceFile, token.parent);
@@ -84982,13 +85617,13 @@ var ts;
changes.deleteNode(sourceFile, token.parent.parent);
}
}
- function tryDeleteIdentifier(changes, sourceFile, identifier, deletedAncestors) {
+ function tryDeleteIdentifier(changes, sourceFile, identifier, deletedAncestors, checker, isFixAll) {
var parent = identifier.parent;
switch (parent.kind) {
- case 231:
+ case 232:
tryDeleteVariableDeclaration(changes, sourceFile, parent, deletedAncestors);
break;
- case 147:
+ case 148:
var typeParameters = ts.getEffectiveTypeParameterDeclarations(parent.parent);
if (typeParameters.length === 1) {
var _a = ts.cast(typeParameters, ts.isNodeArray), pos = _a.pos, end = _a.end;
@@ -85002,11 +85637,10 @@ var ts;
changes.deleteNodeInList(sourceFile, parent);
}
break;
- case 148:
- var oldFunction = parent.parent;
- if (ts.isSetAccessor(oldFunction)) {
+ case 149:
+ if (!mayDeleteParameter(parent, checker, isFixAll))
break;
- }
+ var oldFunction = parent.parent;
if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1) {
var newFunction = ts.updateArrowFunction(oldFunction, oldFunction.modifiers, oldFunction.typeParameters, undefined, oldFunction.type, oldFunction.equalsGreaterThanToken, oldFunction.body);
ts.suppressLeadingAndTrailingTrivia(newFunction);
@@ -85016,13 +85650,13 @@ var ts;
changes.deleteNodeInList(sourceFile, parent);
}
break;
- case 181: {
+ case 182: {
var pattern = parent.parent;
switch (pattern.kind) {
- case 180:
+ case 181:
changes.deleteNode(sourceFile, parent);
break;
- case 179:
+ case 180:
changes.deleteNodeInList(sourceFile, parent);
break;
default:
@@ -85030,11 +85664,11 @@ var ts;
}
break;
}
- case 242:
- var importEquals = ts.getAncestor(identifier, 242);
+ case 243:
+ var importEquals = ts.getAncestor(identifier, 243);
changes.deleteNode(sourceFile, importEquals);
break;
- case 247:
+ case 248:
var namedImports = parent.parent;
if (namedImports.elements.length === 1) {
tryDeleteNamedImportBinding(changes, sourceFile, namedImports);
@@ -85043,10 +85677,10 @@ var ts;
changes.deleteNodeInList(sourceFile, parent);
}
break;
- case 244:
+ case 245:
var importClause = parent;
if (!importClause.namedBindings) {
- changes.deleteNode(sourceFile, ts.getAncestor(importClause, 243));
+ changes.deleteNode(sourceFile, ts.getAncestor(importClause, 244));
}
else {
var start = importClause.name.getStart(sourceFile);
@@ -85060,7 +85694,7 @@ var ts;
}
}
break;
- case 245:
+ case 246:
tryDeleteNamedImportBinding(changes, sourceFile, parent);
break;
default:
@@ -85076,13 +85710,13 @@ var ts;
}
}
else {
- var importDecl = ts.getAncestor(namedBindings, 243);
+ var importDecl = ts.getAncestor(namedBindings, 244);
changes.deleteNode(sourceFile, importDecl);
}
}
function tryDeleteVariableDeclaration(changes, sourceFile, varDecl, deletedAncestors) {
switch (varDecl.parent.parent.kind) {
- case 219: {
+ case 220: {
var forStatement = varDecl.parent.parent;
var forInitializer = forStatement.initializer;
if (forInitializer.declarations.length === 1) {
@@ -85097,16 +85731,16 @@ var ts;
}
break;
}
- case 221:
+ case 222:
var forOfStatement = varDecl.parent.parent;
- ts.Debug.assert(forOfStatement.initializer.kind === 232);
+ ts.Debug.assert(forOfStatement.initializer.kind === 233);
var forOfInitializer = forOfStatement.initializer;
if (deletedAncestors)
deletedAncestors.add(forOfInitializer.declarations[0]);
changes.replaceNode(sourceFile, forOfInitializer.declarations[0], ts.createObjectLiteral());
break;
- case 220:
- case 229:
+ case 221:
+ case 230:
break;
default:
var variableStatement = varDecl.parent.parent;
@@ -85122,18 +85756,30 @@ var ts;
}
}
}
- var NodeSet = (function () {
- function NodeSet() {
- this.map = ts.createMap();
+ function mayDeleteParameter(p, checker, isFixAll) {
+ var parent = p.parent;
+ switch (parent.kind) {
+ case 154:
+ var symbol = checker.getSymbolAtLocation(parent.name);
+ if (ts.isMemberSymbolInBaseType(symbol, checker))
+ return false;
+ case 155:
+ case 234:
+ case 192:
+ case 193: {
+ var parameters = parent.parameters;
+ var index = parameters.indexOf(p);
+ ts.Debug.assert(index !== -1);
+ return isFixAll
+ ? parameters.slice(index + 1).every(function (p) { return p.name.kind === 71 && !p.symbol.isReferenced; })
+ : index === parameters.length - 1;
+ }
+ case 157:
+ return false;
+ default:
+ return ts.Debug.failBadSyntaxKind(parent);
}
- NodeSet.prototype.add = function (node) {
- this.map.set(String(ts.getNodeId(node)), node);
- };
- NodeSet.prototype.some = function (pred) {
- return ts.forEachEntry(this.map, pred) || false;
- };
- return NodeSet;
- }());
+ }
})(codefix = ts.codefix || (ts.codefix = {}));
})(ts || (ts = {}));
var ts;
@@ -85157,7 +85803,7 @@ var ts;
ts.Debug.assert(statement.getStart(sourceFile) === token.getStart(sourceFile));
var container = (ts.isBlock(statement.parent) ? statement.parent : statement).parent;
switch (container.kind) {
- case 216:
+ case 217:
if (container.elseStatement) {
if (ts.isBlock(statement.parent)) {
changes.deleteNodeRange(sourceFile, ts.first(statement.parent.statements), ts.last(statement.parent.statements));
@@ -85167,8 +85813,8 @@ var ts;
}
break;
}
- case 218:
case 219:
+ case 220:
changes.deleteNode(sourceFile, container);
break;
default:
@@ -85186,13 +85832,15 @@ var ts;
}
function isPurelyTypeDeclaration(s) {
switch (s.kind) {
- case 235:
case 236:
- return true;
- case 238:
- return ts.getModuleInstanceState(s) !== 1;
case 237:
+ return true;
+ case 239:
+ return ts.getModuleInstanceState(s) !== 1;
+ case 238:
return ts.hasModifier(s, 2048);
+ default:
+ return false;
}
}
function sliceAfter(arr, value) {
@@ -85249,8 +85897,8 @@ 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 === 280) {
- actions.push(fix(checker.getNullableType(type, 4096), fixIdNullable, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types));
+ if (typeNode.kind === 281) {
+ actions.push(fix(checker.getNullableType(type, 8192), fixIdNullable, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types));
}
return actions;
function fix(type, fixId, fixAllDescription) {
@@ -85267,7 +85915,7 @@ var ts;
if (!info)
return;
var typeNode = info.typeNode, type = info.type;
- var fixedType = typeNode.kind === 280 && fixId === fixIdNullable ? checker.getNullableType(type, 4096) : type;
+ var fixedType = typeNode.kind === 281 && fixId === fixIdNullable ? checker.getNullableType(type, 8192) : type;
doChange(changes, sourceFile, typeNode, fixedType, checker);
});
}
@@ -85282,22 +85930,22 @@ var ts;
}
function isTypeContainer(node) {
switch (node.kind) {
- case 207:
- case 157:
+ case 208:
case 158:
- case 233:
- case 155:
case 159:
- case 176:
- case 153:
- case 152:
- case 148:
- case 151:
- case 150:
+ case 234:
case 156:
- case 236:
- case 189:
- case 231:
+ case 160:
+ case 177:
+ case 154:
+ case 153:
+ case 149:
+ case 152:
+ case 151:
+ case 157:
+ case 237:
+ case 190:
+ case 232:
return true;
default:
return false;
@@ -85350,20 +85998,20 @@ var ts;
}
var insertBefore;
switch (containingFunction.kind) {
- case 153:
+ case 154:
insertBefore = containingFunction.name;
break;
- case 233:
- case 191:
+ case 234:
+ case 192:
insertBefore = ts.findChildOfKind(containingFunction, 89, sourceFile);
break;
- case 192:
+ case 193:
insertBefore = ts.findChildOfKind(containingFunction, 19, sourceFile) || ts.first(containingFunction.parameters);
break;
default:
return;
}
- return {
+ return insertBefore && {
insertBefore: insertBefore,
returnType: getReturnType(containingFunction)
};
@@ -85453,15 +86101,15 @@ var ts;
var type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration));
var optional = !!(symbol.flags & 16777216);
switch (declaration.kind) {
- case 155:
case 156:
- case 150:
+ case 157:
case 151:
+ case 152:
var typeNode = checker.typeToTypeNode(type, enclosingDeclaration);
out(ts.createProperty(undefined, modifiers, name, optional ? ts.createToken(55) : undefined, typeNode, undefined));
break;
- case 152:
case 153:
+ case 154:
var signatures = checker.getSignaturesOfType(type, 0);
if (!ts.some(signatures)) {
break;
@@ -85493,7 +86141,7 @@ var ts;
}
}
function signatureToMethodDeclaration(checker, signature, enclosingDeclaration, modifiers, name, optional, body) {
- var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 153, enclosingDeclaration, 256);
+ var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 154, enclosingDeclaration, 256);
if (!signatureDeclaration) {
return undefined;
}
@@ -85670,11 +86318,11 @@ var ts;
}
function isApplicableFunctionForInference(declaration) {
switch (declaration.kind) {
- case 233:
- case 153:
+ case 234:
case 154:
+ case 155:
return true;
- case 191:
+ case 192:
return !!declaration.name;
}
return false;
@@ -85730,11 +86378,11 @@ var ts;
}
function inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken) {
switch (containingFunction.kind) {
+ case 155:
+ case 192:
+ case 234:
case 154:
- case 191:
- case 233:
- case 153:
- var isConstructor = containingFunction.kind === 154;
+ var isConstructor = containingFunction.kind === 155;
var searchToken = isConstructor ?
ts.findChildOfKind(containingFunction, 123, sourceFile) :
containingFunction.name;
@@ -85768,7 +86416,7 @@ var ts;
cancellationToken.throwIfCancellationRequested();
inferTypeFromContext(reference, checker, usageContext);
}
- var isConstructor = declaration.kind === 154;
+ var isConstructor = declaration.kind === 155;
var callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts;
return callContexts && declaration.parameters.map(function (parameter, parameterIndex) {
var types = [];
@@ -85800,21 +86448,21 @@ var ts;
node = node.parent;
}
switch (node.parent.kind) {
- case 198:
+ case 199:
usageContext.isNumber = true;
break;
- case 197:
+ case 198:
inferTypeFromPrefixUnaryExpressionContext(node.parent, usageContext);
break;
- case 199:
+ case 200:
inferTypeFromBinaryExpressionContext(node, node.parent, checker, usageContext);
break;
- case 265:
case 266:
+ case 267:
inferTypeFromSwitchStatementLabelContext(node.parent, checker, usageContext);
break;
- case 186:
case 187:
+ case 188:
if (node.parent.expression === node) {
inferTypeFromCallExpressionContext(node.parent, checker, usageContext);
}
@@ -85822,13 +86470,13 @@ var ts;
inferTypeFromContextualType(node, checker, usageContext);
}
break;
- case 184:
+ case 185:
inferTypeFromPropertyAccessExpressionContext(node.parent, checker, usageContext);
break;
- case 185:
+ case 186:
inferTypeFromPropertyElementExpressionContext(node.parent, node, checker, usageContext);
break;
- case 231: {
+ case 232: {
var _a = node.parent, name = _a.name, initializer = _a.initializer;
if (node === name) {
if (initializer) {
@@ -85888,7 +86536,7 @@ var ts;
case 29:
case 31:
var operandType = checker.getTypeAtLocation(parent.left === node ? parent.right : parent.left);
- if (operandType.flags & 272) {
+ if (operandType.flags & 544) {
addCandidateType(usageContext, operandType);
}
else {
@@ -85898,13 +86546,13 @@ var ts;
case 59:
case 37:
var otherOperandType = checker.getTypeAtLocation(parent.left === node ? parent.right : parent.left);
- if (otherOperandType.flags & 272) {
+ if (otherOperandType.flags & 544) {
addCandidateType(usageContext, otherOperandType);
}
- else if (otherOperandType.flags & 84) {
+ else if (otherOperandType.flags & 168) {
usageContext.isNumber = true;
}
- else if (otherOperandType.flags & 34) {
+ else if (otherOperandType.flags & 68) {
usageContext.isString = true;
}
else {
@@ -85925,7 +86573,7 @@ var ts;
break;
case 54:
if (node === parent.left &&
- (node.parent.parent.kind === 231 || ts.isAssignmentExpression(node.parent.parent, true))) {
+ (node.parent.parent.kind === 232 || ts.isAssignmentExpression(node.parent.parent, true))) {
addCandidateType(usageContext, checker.getTypeAtLocation(parent.right));
}
break;
@@ -85950,7 +86598,7 @@ var ts;
}
}
inferTypeFromContext(parent, checker, callContext.returnType);
- if (parent.kind === 186) {
+ if (parent.kind === 187) {
(usageContext.callContexts || (usageContext.callContexts = [])).push(callContext);
}
else {
@@ -85975,7 +86623,7 @@ var ts;
var indexType = checker.getTypeAtLocation(parent);
var indexUsageContext = {};
inferTypeFromContext(parent, checker, indexUsageContext);
- if (indexType.flags & 84) {
+ if (indexType.flags & 168) {
usageContext.numberIndexContext = indexUsageContext;
}
else {
@@ -86073,12 +86721,12 @@ var ts;
return checker.createSignature(undefined, undefined, undefined, parameters, returnType, undefined, callContext.argumentTypes.length, false, false);
}
function addCandidateType(context, type) {
- if (type && !(type.flags & 1) && !(type.flags & 16384)) {
+ if (type && !(type.flags & 1) && !(type.flags & 32768)) {
(context.candidateTypes || (context.candidateTypes = [])).push(type);
}
}
function hasCallContext(usageContext) {
- return usageContext && usageContext.callContexts;
+ return !!usageContext && !!usageContext.callContexts;
}
})(InferFromReference || (InferFromReference = {}));
})(codefix = ts.codefix || (ts.codefix = {}));
@@ -86105,7 +86753,7 @@ var ts;
var namespace = ts.getNamespaceDeclarationNode(node);
var opts = context.program.getCompilerOptions();
var variations = [];
- variations.push(createAction(context, sourceFile, node, ts.makeImport(namespace.name, undefined, node.moduleSpecifier)));
+ variations.push(createAction(context, sourceFile, node, ts.makeImport(namespace.name, undefined, node.moduleSpecifier, context.preferences)));
if (ts.getEmitModuleKind(opts) === ts.ModuleKind.CommonJS) {
variations.push(createAction(context, sourceFile, node, ts.createImportEqualsDeclaration(undefined, undefined, namespace.name, ts.createExternalModuleReference(node.moduleSpecifier))));
}
@@ -86124,7 +86772,7 @@ var ts;
});
function getActionsForUsageOfInvalidImport(context) {
var sourceFile = context.sourceFile;
- var targetKind = ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures.code === context.errorCode ? 186 : 187;
+ var targetKind = ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures.code === context.errorCode ? 187 : 188;
var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start, false), function (a) { return a.kind === targetKind && a.getStart() === context.span.start && a.getEnd() === (context.span.start + context.span.length); });
if (!node) {
return [];
@@ -86211,8 +86859,9 @@ var ts;
}
function addUndefinedType(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) {
var undefinedTypeNode = ts.createKeywordTypeNode(140);
- var types = ts.isUnionTypeNode(propertyDeclaration.type) ? propertyDeclaration.type.types.concat(undefinedTypeNode) : [propertyDeclaration.type, undefinedTypeNode];
- changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration.type, ts.createUnionTypeNode(types));
+ var type = propertyDeclaration.type;
+ var types = ts.isUnionTypeNode(type) ? type.types.concat(undefinedTypeNode) : [type, undefinedTypeNode];
+ changeTracker.replaceNode(propertyDeclarationSourceFile, type, ts.createUnionTypeNode(types));
}
function getActionForAddMissingInitializer(context, propertyDeclaration) {
var checker = context.program.getTypeChecker();
@@ -86230,13 +86879,13 @@ var ts;
return getDefaultValueFromType(checker, checker.getTypeFromTypeNode(propertyDeclaration.type));
}
function getDefaultValueFromType(checker, type) {
- if (type.flags & 2) {
+ if (type.flags & 4) {
return ts.createLiteral("");
}
- else if (type.flags & 4) {
+ else if (type.flags & 8) {
return ts.createNumericLiteral("0");
}
- else if (type.flags & 8) {
+ else if (type.flags & 16) {
return ts.createFalse();
}
else if (type.isLiteral()) {
@@ -86262,50 +86911,69 @@ var ts;
(function (ts) {
var moduleSpecifiers;
(function (moduleSpecifiers) {
- function getModuleSpecifiers(moduleSymbol, program, importingSourceFile, host, preferences) {
+ function getModuleSpecifier(program, fromSourceFile, fromSourceFileName, toFileName, host, preferences) {
+ var info = getInfo(program.getCompilerOptions(), fromSourceFile, fromSourceFileName, host);
var compilerOptions = program.getCompilerOptions();
- var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths, rootDirs = compilerOptions.rootDirs;
- var moduleResolutionKind = ts.getEmitModuleResolutionKind(compilerOptions);
- var addJsExtension = usesJsExtensionOnImports(importingSourceFile);
- var getCanonicalFileName = ts.hostGetCanonicalFileName(host);
- var sourceDirectory = ts.getDirectoryPath(importingSourceFile.fileName);
- return getAllModulePaths(program, moduleSymbol.valueDeclaration.getSourceFile()).map(function (moduleFileName) {
- var global = tryGetModuleNameFromAmbientModule(moduleSymbol)
- || tryGetModuleNameFromTypeRoots(compilerOptions, host, getCanonicalFileName, moduleFileName, addJsExtension)
- || tryGetModuleNameAsNodeModule(compilerOptions, moduleFileName, host, getCanonicalFileName, sourceDirectory)
- || rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName);
- if (global) {
- return [global];
- }
- var relativePath = removeExtensionAndIndexPostFix(ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), moduleResolutionKind, addJsExtension);
- if (!baseUrl || preferences.importModuleSpecifierPreference === "relative") {
- return [relativePath];
- }
- var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseUrl, getCanonicalFileName);
- if (!relativeToBaseUrl) {
- return [relativePath];
- }
- var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, moduleResolutionKind, addJsExtension);
- if (paths) {
- var fromPaths = tryGetModuleNameFromPaths(ts.removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths);
- if (fromPaths) {
- return [fromPaths];
- }
- }
- if (preferences.importModuleSpecifierPreference === "non-relative") {
- return [importRelativeToBaseUrl];
- }
- if (preferences.importModuleSpecifierPreference !== undefined)
- ts.Debug.assertNever(preferences.importModuleSpecifierPreference);
- if (isPathRelativeToParent(relativeToBaseUrl)) {
- return [relativePath];
- }
- var pathFromSourceToBaseUrl = ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourceDirectory, baseUrl, getCanonicalFileName));
- var relativeFirst = getRelativePathNParents(relativePath) < getRelativePathNParents(pathFromSourceToBaseUrl);
- return relativeFirst ? [relativePath, importRelativeToBaseUrl] : [importRelativeToBaseUrl, relativePath];
+ return getGlobalModuleSpecifier(toFileName, info, host, compilerOptions) ||
+ ts.first(getLocalModuleSpecifiers(toFileName, info, compilerOptions, preferences));
+ }
+ moduleSpecifiers.getModuleSpecifier = getModuleSpecifier;
+ function getModuleSpecifiers(moduleSymbol, program, importingSourceFile, host, preferences) {
+ var ambient = tryGetModuleNameFromAmbientModule(moduleSymbol);
+ if (ambient)
+ return [[ambient]];
+ var compilerOptions = program.getCompilerOptions();
+ var info = getInfo(compilerOptions, importingSourceFile, importingSourceFile.fileName, host);
+ var modulePaths = getAllModulePaths(program, moduleSymbol.valueDeclaration.getSourceFile());
+ var global = ts.mapDefined(modulePaths, function (moduleFileName) { return getGlobalModuleSpecifier(moduleFileName, info, host, compilerOptions); });
+ return global.length ? global.map(function (g) { return [g]; }) : modulePaths.map(function (moduleFileName) {
+ return getLocalModuleSpecifiers(moduleFileName, info, compilerOptions, preferences);
});
}
moduleSpecifiers.getModuleSpecifiers = getModuleSpecifiers;
+ function getInfo(compilerOptions, importingSourceFile, importingSourceFileName, host) {
+ var moduleResolutionKind = ts.getEmitModuleResolutionKind(compilerOptions);
+ var addJsExtension = usesJsExtensionOnImports(importingSourceFile);
+ var getCanonicalFileName = ts.hostGetCanonicalFileName(host);
+ var sourceDirectory = ts.getDirectoryPath(importingSourceFileName);
+ return { moduleResolutionKind: moduleResolutionKind, addJsExtension: addJsExtension, getCanonicalFileName: getCanonicalFileName, sourceDirectory: sourceDirectory };
+ }
+ function getGlobalModuleSpecifier(moduleFileName, _a, host, compilerOptions) {
+ var addJsExtension = _a.addJsExtension, getCanonicalFileName = _a.getCanonicalFileName, sourceDirectory = _a.sourceDirectory;
+ return tryGetModuleNameFromTypeRoots(compilerOptions, host, getCanonicalFileName, moduleFileName, addJsExtension)
+ || tryGetModuleNameAsNodeModule(compilerOptions, moduleFileName, host, getCanonicalFileName, sourceDirectory)
+ || compilerOptions.rootDirs && tryGetModuleNameFromRootDirs(compilerOptions.rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName);
+ }
+ function getLocalModuleSpecifiers(moduleFileName, _a, compilerOptions, preferences) {
+ var moduleResolutionKind = _a.moduleResolutionKind, addJsExtension = _a.addJsExtension, getCanonicalFileName = _a.getCanonicalFileName, sourceDirectory = _a.sourceDirectory;
+ var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths;
+ var relativePath = removeExtensionAndIndexPostFix(ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), moduleResolutionKind, addJsExtension);
+ if (!baseUrl || preferences.importModuleSpecifierPreference === "relative") {
+ return [relativePath];
+ }
+ var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseUrl, getCanonicalFileName);
+ if (!relativeToBaseUrl) {
+ return [relativePath];
+ }
+ var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, moduleResolutionKind, addJsExtension);
+ if (paths) {
+ var fromPaths = tryGetModuleNameFromPaths(ts.removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths);
+ if (fromPaths) {
+ return [fromPaths];
+ }
+ }
+ if (preferences.importModuleSpecifierPreference === "non-relative") {
+ return [importRelativeToBaseUrl];
+ }
+ if (preferences.importModuleSpecifierPreference !== undefined)
+ ts.Debug.assertNever(preferences.importModuleSpecifierPreference);
+ if (isPathRelativeToParent(relativeToBaseUrl)) {
+ return [relativePath];
+ }
+ var pathFromSourceToBaseUrl = ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourceDirectory, baseUrl, getCanonicalFileName));
+ var relativeFirst = getRelativePathNParents(relativePath) < getRelativePathNParents(pathFromSourceToBaseUrl);
+ return relativeFirst ? [relativePath, importRelativeToBaseUrl] : [importRelativeToBaseUrl, relativePath];
+ }
function usesJsExtensionOnImports(_a) {
var imports = _a.imports;
return ts.firstDefined(imports, function (_a) {
@@ -86390,8 +87058,9 @@ var ts;
return undefined;
}
var moduleSpecifier = getDirectoryOrExtensionlessFileName(moduleFileName);
- moduleSpecifier = getNodeResolvablePath(moduleSpecifier);
- return ts.getPackageNameFromAtTypesDirectory(moduleSpecifier);
+ if (!ts.startsWith(sourceDirectory, moduleSpecifier.substring(0, parts.topLevelNodeModulesIndex)))
+ return undefined;
+ return ts.getPackageNameFromAtTypesDirectory(moduleSpecifier.substring(parts.topLevelPackageNameIndex + 1));
function getDirectoryOrExtensionlessFileName(path) {
var packageRootPath = path.substring(0, parts.packageRootIndex);
var packageJsonPath = ts.combinePaths(packageRootPath, "package.json");
@@ -86413,15 +87082,6 @@ var ts;
}
return fullModulePathWithoutExtension;
}
- function getNodeResolvablePath(path) {
- var basePath = path.substring(0, parts.topLevelNodeModulesIndex);
- if (sourceDirectory.indexOf(basePath) === 0) {
- return path.substring(parts.topLevelPackageNameIndex + 1);
- }
- else {
- return ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourceDirectory, path, getCanonicalFileName));
- }
- }
}
function getNodeModulePathParts(fullPath) {
var topLevelNodeModulesIndex = 0;
@@ -86538,14 +87198,14 @@ var ts;
var info = getInfo(sourceFile, start);
if (!info)
return undefined;
- var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, info); });
+ var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, info, context.preferences); });
return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Convert_to_default_import, fixId, ts.Diagnostics.Convert_all_to_default_imports)];
},
fixIds: [fixId],
getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {
var info = getInfo(diag.file, diag.start);
if (info)
- doChange(changes, diag.file, info);
+ doChange(changes, diag.file, info, context.preferences);
}); },
});
function getInfo(sourceFile, pos) {
@@ -86561,8 +87221,8 @@ var ts;
return { importNode: importNode, name: name, moduleSpecifier: importNode.moduleSpecifier };
}
}
- function doChange(changes, sourceFile, info) {
- changes.replaceNode(sourceFile, info.importNode, ts.makeImport(info.name, undefined, info.moduleSpecifier));
+ function doChange(changes, sourceFile, info, preferences) {
+ changes.replaceNode(sourceFile, info.importNode, ts.makeImport(info.name, undefined, info.moduleSpecifier, preferences));
}
})(codefix = ts.codefix || (ts.codefix = {}));
})(ts || (ts = {}));
@@ -86589,7 +87249,7 @@ var ts;
function getImportTypeNode(sourceFile, pos) {
var token = ts.getTokenAtPosition(sourceFile, pos, false);
ts.Debug.assert(token.kind === 91);
- ts.Debug.assert(token.parent.kind === 178);
+ ts.Debug.assert(token.parent.kind === 179);
return token.parent;
}
function doChange(changes, sourceFile, importType) {
@@ -86599,6 +87259,182 @@ var ts;
})(codefix = ts.codefix || (ts.codefix = {}));
})(ts || (ts = {}));
var ts;
+(function (ts) {
+ var codefix;
+ (function (codefix) {
+ var fixIdAddMissingTypeof = "fixConvertToMappedObjectType";
+ var fixId = fixIdAddMissingTypeof;
+ var errorCodes = [ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead.code];
+ codefix.registerCodeFix({
+ errorCodes: errorCodes,
+ getCodeActions: function (context) {
+ var sourceFile = context.sourceFile, span = context.span;
+ var info = getInfo(sourceFile, span.start);
+ if (!info)
+ return undefined;
+ var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, info); });
+ var name = ts.idText(info.container.name);
+ return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Convert_0_to_mapped_object_type, name], fixId, [ts.Diagnostics.Convert_0_to_mapped_object_type, name])];
+ },
+ fixIds: [fixId],
+ getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) {
+ var info = getInfo(diag.file, diag.start);
+ if (info)
+ doChange(changes, diag.file, info);
+ }); }
+ });
+ function getInfo(sourceFile, pos) {
+ var token = ts.getTokenAtPosition(sourceFile, pos, false);
+ var indexSignature = ts.cast(token.parent.parent, ts.isIndexSignatureDeclaration);
+ if (ts.isClassDeclaration(indexSignature.parent))
+ return undefined;
+ var container = ts.isInterfaceDeclaration(indexSignature.parent) ? indexSignature.parent : ts.cast(indexSignature.parent.parent, ts.isTypeAliasDeclaration);
+ return { indexSignature: indexSignature, container: container };
+ }
+ function createTypeAliasFromInterface(declaration, type) {
+ return ts.createTypeAliasDeclaration(declaration.decorators, declaration.modifiers, declaration.name, declaration.typeParameters, type);
+ }
+ function doChange(changes, sourceFile, _a) {
+ var indexSignature = _a.indexSignature, container = _a.container;
+ var members = ts.isInterfaceDeclaration(container) ? container.members : container.type.members;
+ 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(132) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type);
+ var intersectionType = ts.createIntersectionTypeNode(ts.getAllSuperTypeNodes(container).concat([
+ mappedIntersectionType
+ ], (otherMembers.length ? [ts.createTypeLiteralNode(otherMembers)] : ts.emptyArray)));
+ changes.replaceNode(sourceFile, container, createTypeAliasFromInterface(container, intersectionType));
+ }
+ })(codefix = ts.codefix || (ts.codefix = {}));
+})(ts || (ts = {}));
+var ts;
+(function (ts) {
+ var refactor;
+ (function (refactor) {
+ var generateGetAccessorAndSetAccessor;
+ (function (generateGetAccessorAndSetAccessor) {
+ var refactorName = "Convert import";
+ var actionNameNamespaceToNamed = "Convert namespace import to named imports";
+ var actionNameNamedToNamespace = "Convert named imports to namespace import";
+ refactor.registerRefactor(refactorName, {
+ getAvailableActions: function (context) {
+ var i = getImportToConvert(context);
+ if (!i)
+ return undefined;
+ var description = i.kind === 246 ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message;
+ var actionName = i.kind === 246 ? actionNameNamespaceToNamed : actionNameNamedToNamespace;
+ return [{ name: refactorName, description: description, actions: [{ name: actionName, description: description }] }];
+ },
+ getEditsForAction: function (context, actionName) {
+ ts.Debug.assert(actionName === actionNameNamespaceToNamed || actionName === actionNameNamedToNamespace);
+ var edits = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(context.file, context.program, t, ts.Debug.assertDefined(getImportToConvert(context))); });
+ return { edits: edits, renameFilename: undefined, renameLocation: undefined };
+ }
+ });
+ function getImportToConvert(context) {
+ var file = context.file;
+ var span = ts.getRefactorContextSpan(context);
+ var token = ts.getTokenAtPosition(file, span.start, false);
+ var importDecl = ts.getParentNodeInSpan(token, file, span);
+ if (!importDecl || !ts.isImportDeclaration(importDecl))
+ return undefined;
+ var importClause = importDecl.importClause;
+ return importClause && importClause.namedBindings;
+ }
+ function doChange(sourceFile, program, changes, toConvert) {
+ var checker = program.getTypeChecker();
+ if (toConvert.kind === 246) {
+ doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, ts.getAllowSyntheticDefaultImports(program.getCompilerOptions()));
+ }
+ else {
+ doChangeNamedToNamespace(sourceFile, checker, changes, toConvert);
+ }
+ }
+ function doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, allowSyntheticDefaultImports) {
+ var usedAsNamespaceOrDefault = false;
+ var nodesToReplace = [];
+ var conflictingNames = ts.createMap();
+ ts.FindAllReferences.Core.eachSymbolReferenceInFile(toConvert.name, checker, sourceFile, function (id) {
+ if (!ts.isPropertyAccessExpression(id.parent)) {
+ usedAsNamespaceOrDefault = true;
+ }
+ else {
+ var parent = ts.cast(id.parent, ts.isPropertyAccessExpression);
+ var exportName = parent.name.text;
+ if (checker.resolveName(exportName, id, 67108863, true)) {
+ conflictingNames.set(exportName, true);
+ }
+ ts.Debug.assert(parent.expression === id);
+ nodesToReplace.push(parent);
+ }
+ });
+ var exportNameToImportName = ts.createMap();
+ for (var _i = 0, nodesToReplace_1 = nodesToReplace; _i < nodesToReplace_1.length; _i++) {
+ var propertyAccess = nodesToReplace_1[_i];
+ var exportName = propertyAccess.name.text;
+ var importName = exportNameToImportName.get(exportName);
+ if (importName === undefined) {
+ exportNameToImportName.set(exportName, importName = conflictingNames.has(exportName) ? ts.getUniqueName(exportName, sourceFile) : exportName);
+ }
+ changes.replaceNode(sourceFile, propertyAccess, ts.createIdentifier(importName));
+ }
+ var importSpecifiers = [];
+ exportNameToImportName.forEach(function (name, propertyName) {
+ importSpecifiers.push(ts.createImportSpecifier(name === propertyName ? undefined : ts.createIdentifier(propertyName), ts.createIdentifier(name)));
+ });
+ var importDecl = toConvert.parent.parent;
+ if (usedAsNamespaceOrDefault && !allowSyntheticDefaultImports) {
+ changes.insertNodeAfter(sourceFile, importDecl, updateImport(importDecl, undefined, importSpecifiers));
+ }
+ else {
+ changes.replaceNode(sourceFile, importDecl, updateImport(importDecl, usedAsNamespaceOrDefault ? ts.createIdentifier(toConvert.name.text) : undefined, importSpecifiers));
+ }
+ }
+ function doChangeNamedToNamespace(sourceFile, checker, changes, toConvert) {
+ var importDecl = toConvert.parent.parent;
+ var moduleSpecifier = importDecl.moduleSpecifier;
+ var preferredName = moduleSpecifier && ts.isStringLiteral(moduleSpecifier) ? ts.codefix.moduleSpecifierToValidIdentifier(moduleSpecifier.text, 6) : "module";
+ var namespaceNameConflicts = toConvert.elements.some(function (element) {
+ return ts.FindAllReferences.Core.eachSymbolReferenceInFile(element.name, checker, sourceFile, function (id) {
+ return !!checker.resolveName(preferredName, id, 67108863, true);
+ }) || false;
+ });
+ var namespaceImportName = namespaceNameConflicts ? ts.getUniqueName(preferredName, sourceFile) : preferredName;
+ var neededNamedImports = [];
+ var _loop_22 = function (element) {
+ var propertyName = (element.propertyName || element.name).text;
+ ts.FindAllReferences.Core.eachSymbolReferenceInFile(element.name, checker, sourceFile, function (id) {
+ var access = ts.createPropertyAccess(ts.createIdentifier(namespaceImportName), propertyName);
+ if (ts.isShorthandPropertyAssignment(id.parent)) {
+ changes.replaceNode(sourceFile, id.parent, ts.createPropertyAssignment(id.text, access));
+ }
+ else if (ts.isExportSpecifier(id.parent) && !id.parent.propertyName) {
+ if (!neededNamedImports.some(function (n) { return n.name === element.name; })) {
+ neededNamedImports.push(ts.createImportSpecifier(element.propertyName && ts.createIdentifier(element.propertyName.text), ts.createIdentifier(element.name.text)));
+ }
+ }
+ else {
+ changes.replaceNode(sourceFile, id, access);
+ }
+ });
+ };
+ for (var _i = 0, _a = toConvert.elements; _i < _a.length; _i++) {
+ var element = _a[_i];
+ _loop_22(element);
+ }
+ changes.replaceNode(sourceFile, toConvert, ts.createNamespaceImport(ts.createIdentifier(namespaceImportName)));
+ if (neededNamedImports.length) {
+ changes.insertNodeAfter(sourceFile, toConvert.parent.parent, updateImport(importDecl, undefined, neededNamedImports));
+ }
+ }
+ function updateImport(old, defaultImportName, elements) {
+ return ts.createImportDeclaration(undefined, undefined, ts.createImportClause(defaultImportName, elements && elements.length ? ts.createNamedImports(elements) : undefined), old.moduleSpecifier);
+ }
+ })(generateGetAccessorAndSetAccessor = refactor.generateGetAccessorAndSetAccessor || (refactor.generateGetAccessorAndSetAccessor = {}));
+ })(refactor = ts.refactor || (ts.refactor = {}));
+})(ts || (ts = {}));
+var ts;
(function (ts) {
var refactor;
(function (refactor) {
@@ -86723,8 +87559,8 @@ var ts;
if (length === 0) {
return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractEmpty)] };
}
- var start = getParentNodeInSpan(ts.getTokenAtPosition(sourceFile, span.start, false), sourceFile, span);
- var end = getParentNodeInSpan(ts.findTokenOnLeftOfPosition(sourceFile, ts.textSpanEnd(span)), sourceFile, span);
+ var start = ts.getParentNodeInSpan(ts.getTokenAtPosition(sourceFile, span.start, false), sourceFile, span);
+ var end = ts.getParentNodeInSpan(ts.findTokenOnLeftOfPosition(sourceFile, ts.textSpanEnd(span)), sourceFile, span);
var declarations = [];
var rangeFacts = RangeFacts.None;
if (!start || !end) {
@@ -86738,7 +87574,8 @@ var ts;
return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractRange)] };
}
var statements = [];
- for (var _i = 0, _a = start.parent.statements; _i < _a.length; _i++) {
+ var start2 = start;
+ for (var _i = 0, _a = start2.parent.statements; _i < _a.length; _i++) {
var statement = _a[_i];
if (statement === start || statements.length) {
var errors_1 = checkNode(statement);
@@ -86801,20 +87638,20 @@ var ts;
function checkForStaticContext(nodeToCheck, containingClass) {
var current = nodeToCheck;
while (current !== containingClass) {
- if (current.kind === 151) {
+ if (current.kind === 152) {
if (ts.hasModifier(current, 32)) {
rangeFacts |= RangeFacts.InStaticRegion;
}
break;
}
- else if (current.kind === 148) {
+ else if (current.kind === 149) {
var ctorOrMethod = ts.getContainingFunction(current);
- if (ctorOrMethod.kind === 154) {
+ if (ctorOrMethod.kind === 155) {
rangeFacts |= RangeFacts.InStaticRegion;
}
break;
}
- else if (current.kind === 153) {
+ else if (current.kind === 154) {
if (ts.hasModifier(current, 32)) {
rangeFacts |= RangeFacts.InStaticRegion;
}
@@ -86852,7 +87689,7 @@ var ts;
return true;
}
if (ts.isDeclaration(node)) {
- var declaringNode = (node.kind === 231) ? node.parent.parent : node;
+ var declaringNode = (node.kind === 232) ? node.parent.parent : node;
if (ts.hasModifier(declaringNode, 1)) {
(errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractExportedEntity));
return true;
@@ -86860,11 +87697,11 @@ var ts;
declarations.push(node.symbol);
}
switch (node.kind) {
- case 243:
+ case 244:
(errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport));
return true;
case 97:
- if (node.parent.kind === 186) {
+ if (node.parent.kind === 187) {
var containingClass_1 = ts.getContainingClass(node);
if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) {
(errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractSuper));
@@ -86876,10 +87713,10 @@ var ts;
}
break;
}
- if (!node || ts.isFunctionLikeDeclaration(node) || ts.isClassLike(node)) {
+ if (ts.isFunctionLikeDeclaration(node) || ts.isClassLike(node)) {
switch (node.kind) {
- case 233:
case 234:
+ case 235:
if (ts.isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) {
(errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope));
}
@@ -86889,18 +87726,18 @@ var ts;
}
var savedPermittedJumps = permittedJumps;
switch (node.kind) {
- case 216:
+ case 217:
permittedJumps = 0;
break;
- case 229:
+ case 230:
permittedJumps = 0;
break;
- case 212:
- if (node.parent && node.parent.kind === 229 && node.parent.finallyBlock === node) {
+ case 213:
+ if (node.parent && node.parent.kind === 230 && node.parent.finallyBlock === node) {
permittedJumps = 4;
}
break;
- case 265:
+ case 266:
permittedJumps |= 1;
break;
default:
@@ -86910,11 +87747,11 @@ var ts;
break;
}
switch (node.kind) {
- case 173:
+ case 174:
case 99:
rangeFacts |= RangeFacts.UsesThis;
break;
- case 227:
+ case 228:
{
var label = node.label;
(seenLabels || (seenLabels = [])).push(label.escapedText);
@@ -86922,8 +87759,8 @@ var ts;
seenLabels.pop();
break;
}
+ case 224:
case 223:
- case 222:
{
var label = node.label;
if (label) {
@@ -86932,19 +87769,19 @@ var ts;
}
}
else {
- if (!(permittedJumps & (node.kind === 223 ? 1 : 2))) {
+ if (!(permittedJumps & (node.kind === 224 ? 1 : 2))) {
(errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements));
}
}
break;
}
- case 196:
+ case 197:
rangeFacts |= RangeFacts.IsAsyncFunction;
break;
- case 202:
+ case 203:
rangeFacts |= RangeFacts.IsGenerator;
break;
- case 224:
+ case 225:
if (permittedJumps & 4) {
rangeFacts |= RangeFacts.HasReturn;
}
@@ -86987,12 +87824,12 @@ var ts;
var scopes = [];
while (true) {
current = current.parent;
- if (current.kind === 148) {
+ if (current.kind === 149) {
current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent;
}
if (isScope(current)) {
scopes.push(current);
- if (current.kind === 273) {
+ if (current.kind === 274) {
return scopes;
}
}
@@ -87075,32 +87912,32 @@ var ts;
}
function getDescriptionForFunctionLikeDeclaration(scope) {
switch (scope.kind) {
- case 154:
+ case 155:
return "constructor";
- case 191:
- case 233:
+ case 192:
+ case 234:
return scope.name
? "function '" + scope.name.text + "'"
: "anonymous function";
- case 192:
+ case 193:
return "arrow function";
- case 153:
+ case 154:
return "method '" + scope.name.getText();
- case 155:
- return "'get " + scope.name.getText() + "'";
case 156:
+ return "'get " + scope.name.getText() + "'";
+ case 157:
return "'set " + scope.name.getText() + "'";
default:
- ts.Debug.assertNever(scope);
+ throw ts.Debug.assertNever(scope);
}
}
function getDescriptionForClassLikeDeclaration(scope) {
- return scope.kind === 234
+ return scope.kind === 235
? 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 === 239
+ return scope.kind === 240
? "namespace '" + scope.parent.name.getText() + "'"
: scope.externalModuleIndicator ? 0 : 1;
}
@@ -87113,7 +87950,7 @@ var ts;
var usagesInScope = _a.usages, typeParameterUsages = _a.typeParameterUsages, substitutions = _a.substitutions;
var checker = context.program.getTypeChecker();
var file = scope.getSourceFile();
- var functionNameText = ts.getUniqueName(ts.isClassLike(scope) ? "newMethod" : "newFunction", file.text);
+ var functionNameText = ts.getUniqueName(ts.isClassLike(scope) ? "newMethod" : "newFunction", file);
var isJS = ts.isInJavaScriptFile(scope);
var functionName = ts.createIdentifier(functionNameText);
var returnType;
@@ -87279,7 +88116,7 @@ var ts;
var substitutions = _a.substitutions;
var checker = context.program.getTypeChecker();
var file = scope.getSourceFile();
- var localNameText = ts.getUniqueName(ts.isClassLike(scope) ? "newProperty" : "newLocal", file.text);
+ var localNameText = ts.getUniqueName(ts.isClassLike(scope) ? "newProperty" : "newLocal", file);
var isJS = ts.isInJavaScriptFile(scope);
var variableType = isJS || !checker.isContextSensitive(node)
? undefined
@@ -87312,7 +88149,7 @@ var ts;
var localReference = ts.createIdentifier(localNameText);
changeTracker.replaceNode(context.file, node, localReference);
}
- else if (node.parent.kind === 215 && scope === ts.findAncestor(node, isScope)) {
+ else if (node.parent.kind === 216 && scope === ts.findAncestor(node, isScope)) {
var newVariableStatement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([newVariableDeclaration], 2));
changeTracker.replaceNode(context.file, node.parent, newVariableStatement);
}
@@ -87325,7 +88162,7 @@ var ts;
else {
changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, false);
}
- if (node.parent.kind === 215) {
+ if (node.parent.kind === 216) {
changeTracker.deleteNode(context.file, node.parent, ts.textChanges.useNonAdjustedPositions);
}
else {
@@ -87407,7 +88244,7 @@ var ts;
return { body: ts.createBlock(statements, true), returnValueProperty: undefined };
}
function visitor(node) {
- if (!ignoreReturns && node.kind === 224 && hasWritesOrVariableDeclarations) {
+ if (!ignoreReturns && node.kind === 225 && hasWritesOrVariableDeclarations) {
var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes);
if (node.expression) {
if (!returnValueProperty) {
@@ -87482,7 +88319,8 @@ var ts;
}
prevMember = member;
}
- ts.Debug.assert(prevMember !== undefined);
+ if (prevMember === undefined)
+ return ts.Debug.fail();
return prevMember;
}
function getNodeToInsertConstantBefore(node, scope) {
@@ -87507,13 +88345,9 @@ var ts;
ts.Debug.assert(ts.isSwitchStatement(curr.parent.parent));
return curr.parent.parent;
}
- ts.Debug.assert(prevStatement !== undefined);
- return prevStatement;
- }
- if (curr === scope) {
- ts.Debug.fail("Didn't encounter a block-like before encountering scope");
- break;
+ return ts.Debug.assertDefined(prevStatement);
}
+ ts.Debug.assert(curr !== scope, "Didn't encounter a block-like before encountering scope");
}
}
function getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes) {
@@ -87560,14 +88394,14 @@ var ts;
var end = ts.last(statements).end;
expressionDiagnostic = ts.createFileDiagnostic(sourceFile, start, end - start, Messages.expressionExpected);
}
- else if (checker.getTypeAtLocation(expression).flags & (2048 | 16384)) {
+ else if (checker.getTypeAtLocation(expression).flags & (4096 | 32768)) {
expressionDiagnostic = ts.createDiagnosticForNode(expression, Messages.uselessConstantType);
}
for (var _i = 0, scopes_1 = scopes; _i < scopes_1.length; _i++) {
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 !== 233
+ functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 234
? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)]
: []);
var constantErrors = [];
@@ -87619,7 +88453,7 @@ var ts;
: ts.getEnclosingBlockScopeContainer(scopes[0]);
ts.forEachChild(containingLexicalScopeOfExtraction, checkForUsedDeclarations);
}
- var _loop_19 = function (i) {
+ var _loop_23 = function (i) {
var scopeUsages = usagesPerScope[i];
if (i > 0 && (scopeUsages.usages.size > 0 || scopeUsages.typeParameterUsages.size > 0)) {
var errorNode = isReadonlyArray(targetRange.range) ? targetRange.range[0] : targetRange.range;
@@ -87655,7 +88489,7 @@ var ts;
}
};
for (var i = 0; i < scopes.length; i++) {
- _loop_19(i);
+ _loop_23(i);
}
return { target: target, usagesPerScope: usagesPerScope, functionErrorsPerScope: functionErrorsPerScope, constantErrorsPerScope: constantErrorsPerScope, exposedVariableDeclarations: exposedVariableDeclarations };
function isInGenericContext(node) {
@@ -87828,46 +88662,33 @@ var ts;
: ts.createPropertyAccess(prefix, symbol.name);
}
}
- function getParentNodeInSpan(node, file, span) {
- if (!node)
- return undefined;
- while (node.parent) {
- if (ts.isSourceFile(node.parent) || !spanContainsNode(span, node.parent, file)) {
- return node;
- }
- node = node.parent;
- }
- }
- function spanContainsNode(span, node, file) {
- return ts.textSpanContainsPosition(span, node.getStart(file)) &&
- node.getEnd() <= ts.textSpanEnd(span);
- }
function isExtractableExpression(node) {
- switch (node.parent.kind) {
- case 272:
+ var parent = node.parent;
+ switch (parent.kind) {
+ case 273:
return false;
}
switch (node.kind) {
case 9:
- return node.parent.kind !== 243 &&
- node.parent.kind !== 247;
- case 203:
- case 179:
- case 181:
+ return parent.kind !== 244 &&
+ parent.kind !== 248;
+ case 204:
+ case 180:
+ case 182:
return false;
case 71:
- return node.parent.kind !== 181 &&
- node.parent.kind !== 247 &&
- node.parent.kind !== 251;
+ return parent.kind !== 182 &&
+ parent.kind !== 248 &&
+ parent.kind !== 252;
}
return true;
}
function isBlockLike(node) {
switch (node.kind) {
- case 212:
- case 273:
- case 239:
- case 265:
+ case 213:
+ case 274:
+ case 240:
+ case 266:
return true;
default:
return false;
@@ -87941,7 +88762,7 @@ var ts;
var renameLocation = renameLocationOffset + ts.getRenameLocation(edits, renameFilename, nameNeedRename.text, ts.isParameter(declaration));
return { renameFilename: renameFilename, renameLocation: renameLocation, edits: edits };
}
- function isConvertableName(name) {
+ function isConvertibleName(name) {
return ts.isIdentifier(name) || ts.isStringLiteral(name);
}
function isAcceptedDeclaration(node) {
@@ -87967,17 +88788,17 @@ var ts;
var declaration = ts.findAncestor(node.parent, isAcceptedDeclaration);
var meaning = 28 | 32 | 64;
if (!declaration || !ts.rangeOverlapsWithStartEnd(declaration.name, startPosition, endPosition)
- || !isConvertableName(declaration.name) || (ts.getModifierFlags(declaration) | meaning) !== meaning)
+ || !isConvertibleName(declaration.name) || (ts.getModifierFlags(declaration) | meaning) !== meaning)
return undefined;
var name = declaration.name.text;
var startWithUnderscore = startsWithUnderscore(name);
- var fieldName = createPropertyName(startWithUnderscore ? name : ts.getUniqueName("_" + name, file.text), declaration.name);
- var accessorName = createPropertyName(startWithUnderscore ? ts.getUniqueName(name.substring(1), file.text) : name, declaration.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 === 148 ? declaration.parent.parent : declaration.parent,
+ container: declaration.kind === 149 ? declaration.parent.parent : declaration.parent,
originalName: declaration.name,
declaration: declaration,
fieldName: fieldName,
@@ -88025,7 +88846,9 @@ var ts;
if (!constructor.body)
return;
var file = context.file, program = context.program, cancellationToken = context.cancellationToken;
- var referenceEntries = ts.mapDefined(ts.FindAllReferences.getReferenceEntriesForNode(originalName.parent.pos, originalName, program, [file], cancellationToken), function (entry) { return ((entry.type === "node" && ts.rangeContainsRange(constructor, entry.node) && ts.isIdentifier(entry.node) && ts.isWriteAccess(entry.node)) ? entry.node : undefined); });
+ var referenceEntries = ts.mapDefined(ts.FindAllReferences.getReferenceEntriesForNode(originalName.parent.pos, originalName, program, [file], cancellationToken), function (entry) {
+ return (entry.type === "node" && ts.rangeContainsRange(constructor, entry.node) && ts.isIdentifier(entry.node) && ts.isWriteAccess(entry.node)) ? entry.node : undefined;
+ });
ts.forEach(referenceEntries, function (entry) {
var parent = entry.parent;
var accessorName = ts.createIdentifier(fieldName.text);
@@ -88047,7 +88870,7 @@ var ts;
var refactorName = "Move to a new file";
refactor.registerRefactor(refactorName, {
getAvailableActions: function (context) {
- if (!context.preferences.allowTextChangesInNewFiles || getFirstAndLastStatementToMove(context) === undefined)
+ if (!context.preferences.allowTextChangesInNewFiles || getStatementsToMove(context) === undefined)
return undefined;
var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Move_to_a_new_file);
return [{ name: refactorName, description: description, actions: [{ name: refactorName, description: description }] }];
@@ -88055,55 +88878,63 @@ var ts;
getEditsForAction: function (context, actionName) {
ts.Debug.assert(actionName === refactorName);
var statements = ts.Debug.assertDefined(getStatementsToMove(context));
- var edits = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(context.file, context.program, statements, t, context.host); });
+ var edits = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(context.file, context.program, statements, t, context.host, context.preferences); });
return { edits: edits, renameFilename: undefined, renameLocation: undefined };
}
});
- function getFirstAndLastStatementToMove(context) {
+ function getRangeToMove(context) {
var file = context.file;
var range = ts.createTextRangeFromSpan(ts.getRefactorContextSpan(context));
var statements = file.statements;
var startNodeIndex = ts.findIndex(statements, function (s) { return s.end > range.pos; });
if (startNodeIndex === -1)
return undefined;
- if (range.pos > statements[startNodeIndex].getStart(file))
+ var startStatement = statements[startNodeIndex];
+ if (ts.isNamedDeclaration(startStatement) && startStatement.name && ts.rangeContainsRange(startStatement.name, range)) {
+ return { toMove: [statements[startNodeIndex]], afterLast: statements[startNodeIndex + 1] };
+ }
+ if (range.pos > startStatement.getStart(file))
return undefined;
var afterEndNodeIndex = ts.findIndex(statements, function (s) { return s.end > range.end; }, startNodeIndex);
if (afterEndNodeIndex !== -1 && (afterEndNodeIndex === 0 || statements[afterEndNodeIndex].getStart(file) < range.end))
return undefined;
- return { first: startNodeIndex, afterLast: afterEndNodeIndex === -1 ? statements.length : afterEndNodeIndex };
+ return {
+ toMove: statements.slice(startNodeIndex, afterEndNodeIndex === -1 ? statements.length : afterEndNodeIndex),
+ afterLast: afterEndNodeIndex === -1 ? undefined : statements[afterEndNodeIndex],
+ };
}
- function doChange(oldFile, program, toMove, changes, host) {
+ function doChange(oldFile, program, toMove, changes, host, preferences) {
var checker = program.getTypeChecker();
var usage = getUsageInfo(oldFile, toMove.all, checker);
var currentDirectory = ts.getDirectoryPath(oldFile.fileName);
var extension = ts.extensionFromPath(oldFile.fileName);
var newModuleName = makeUniqueModuleName(getNewModuleName(usage.movedSymbols), extension, currentDirectory, host);
var newFileNameWithExtension = newModuleName + extension;
- changes.createNewFile(oldFile, ts.combinePaths(currentDirectory, newFileNameWithExtension), getNewStatements(oldFile, usage, changes, toMove, program, newModuleName));
+ changes.createNewFile(oldFile, ts.combinePaths(currentDirectory, newFileNameWithExtension), getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, newModuleName, preferences));
addNewFileToTsconfig(program, changes, oldFile.fileName, newFileNameWithExtension, ts.hostGetCanonicalFileName(host));
}
function getStatementsToMove(context) {
- var statements = context.file.statements;
- var _a = getFirstAndLastStatementToMove(context), first = _a.first, afterLast = _a.afterLast;
+ var rangeToMove = getRangeToMove(context);
+ if (rangeToMove === undefined)
+ return undefined;
var all = [];
var ranges = [];
- var rangeToMove = statements.slice(first, afterLast);
- ts.getRangesWhere(rangeToMove, function (s) { return !isPureImport(s); }, function (start, afterEnd) {
- for (var i = start; i < afterEnd; i++)
- all.push(rangeToMove[i]);
- ranges.push({ first: rangeToMove[start], last: rangeToMove[afterEnd - 1] });
+ var toMove = rangeToMove.toMove, afterLast = rangeToMove.afterLast;
+ ts.getRangesWhere(toMove, function (s) { return !isPureImport(s); }, function (start, afterEndIndex) {
+ for (var i = start; i < afterEndIndex; i++)
+ all.push(toMove[i]);
+ ranges.push({ first: toMove[start], afterLast: afterLast });
});
- return { all: all, ranges: ranges };
+ return all.length === 0 ? undefined : { all: all, ranges: ranges };
}
function isPureImport(node) {
switch (node.kind) {
- case 243:
+ case 244:
return true;
- case 242:
+ case 243:
return !ts.hasModifier(node, 1);
- case 213:
- return node.declarationList.declarations.every(function (d) { return d.initializer && ts.isRequireCall(d.initializer, true); });
+ case 214:
+ return node.declarationList.declarations.every(function (d) { return !!d.initializer && ts.isRequireCall(d.initializer, true); });
default:
return false;
}
@@ -88122,26 +88953,26 @@ var ts;
changes.insertNodeInListAfter(cfg, ts.last(filesProp.initializer.elements), ts.createLiteral(newFilePath), filesProp.initializer.elements);
}
}
- function getNewStatements(oldFile, usage, changes, toMove, program, newModuleName) {
+ function getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, newModuleName, preferences) {
var checker = program.getTypeChecker();
if (!oldFile.externalModuleIndicator && !oldFile.commonJsModuleIndicator) {
deleteMovedStatements(oldFile, toMove.ranges, changes);
return toMove.all;
}
var useEs6ModuleSyntax = !!oldFile.externalModuleIndicator;
- var importsFromNewFile = createOldFileImportsFromNewFile(usage.oldFileImportsFromNewFile, newModuleName, useEs6ModuleSyntax);
+ var importsFromNewFile = createOldFileImportsFromNewFile(usage.oldFileImportsFromNewFile, newModuleName, useEs6ModuleSyntax, preferences);
if (importsFromNewFile) {
changes.insertNodeBefore(oldFile, oldFile.statements[0], importsFromNewFile, true);
}
deleteUnusedOldImports(oldFile, toMove.all, changes, usage.unusedImportsFromOldFile, checker);
deleteMovedStatements(oldFile, toMove.ranges, changes);
updateImportsInOtherFiles(changes, program, oldFile, usage.movedSymbols, newModuleName);
- return getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, useEs6ModuleSyntax).concat(addExports(oldFile, toMove.all, usage.oldFileImportsFromNewFile, useEs6ModuleSyntax));
+ return getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, useEs6ModuleSyntax, preferences).concat(addExports(oldFile, toMove.all, usage.oldFileImportsFromNewFile, useEs6ModuleSyntax));
}
function deleteMovedStatements(sourceFile, moved, changes) {
for (var _i = 0, moved_1 = moved; _i < moved_1.length; _i++) {
- var _a = moved_1[_i], first_1 = _a.first, last_3 = _a.last;
- changes.deleteNodeRange(sourceFile, first_1, last_3);
+ var _a = moved_1[_i], first_1 = _a.first, afterLast = _a.afterLast;
+ changes.deleteNodeRangeExcludingEnd(sourceFile, first_1, afterLast);
}
}
function deleteUnusedOldImports(oldFile, toMove, changes, toDelete, checker) {
@@ -88154,11 +88985,13 @@ var ts;
}
function updateImportsInOtherFiles(changes, program, oldFile, movedSymbols, newModuleName) {
var checker = program.getTypeChecker();
- var _loop_20 = function (sourceFile) {
+ var _loop_24 = function (sourceFile) {
if (sourceFile === oldFile)
return "continue";
- var _loop_21 = function (statement) {
+ var _loop_25 = function (statement) {
forEachImportInStatement(statement, function (importNode) {
+ if (checker.getSymbolAtLocation(moduleSpecifierFromImport(importNode)) !== oldFile.symbol)
+ return;
var shouldMove = function (name) {
var symbol = ts.isBindingElement(name.parent)
? ts.getPropertySymbolFromBindingElement(checker, name.parent)
@@ -88170,21 +89003,72 @@ var ts;
var newImportDeclaration = filterImport(importNode, ts.createLiteral(newModuleSpecifier), shouldMove);
if (newImportDeclaration)
changes.insertNodeAfter(sourceFile, statement, newImportDeclaration);
+ var ns = getNamespaceLikeImport(importNode);
+ if (ns)
+ updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleName, newModuleSpecifier, ns, importNode);
});
};
for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {
var statement = _a[_i];
- _loop_21(statement);
+ _loop_25(statement);
}
};
for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) {
var sourceFile = _a[_i];
- _loop_20(sourceFile);
+ _loop_24(sourceFile);
+ }
+ }
+ function getNamespaceLikeImport(node) {
+ switch (node.kind) {
+ case 244:
+ return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 246 ?
+ node.importClause.namedBindings.name : undefined;
+ case 243:
+ return node.name;
+ case 232:
+ return ts.tryCast(node.name, ts.isIdentifier);
+ default:
+ return ts.Debug.assertNever(node);
+ }
+ }
+ function updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleName, newModuleSpecifier, oldImportId, oldImportNode) {
+ var preferredNewNamespaceName = ts.codefix.moduleSpecifierToValidIdentifier(newModuleName, 6);
+ var needUniqueName = false;
+ var toChange = [];
+ ts.FindAllReferences.Core.eachSymbolReferenceInFile(oldImportId, checker, sourceFile, function (ref) {
+ if (!ts.isPropertyAccessExpression(ref.parent))
+ return;
+ needUniqueName = needUniqueName || !!checker.resolveName(preferredNewNamespaceName, ref, 67108863, true);
+ if (movedSymbols.has(checker.getSymbolAtLocation(ref.parent.name))) {
+ toChange.push(ref);
+ }
+ });
+ if (toChange.length) {
+ var newNamespaceName = needUniqueName ? ts.getUniqueName(preferredNewNamespaceName, sourceFile) : preferredNewNamespaceName;
+ for (var _i = 0, toChange_1 = toChange; _i < toChange_1.length; _i++) {
+ var ref = toChange_1[_i];
+ changes.replaceNode(sourceFile, ref, ts.createIdentifier(newNamespaceName));
+ }
+ changes.insertNodeAfter(sourceFile, oldImportNode, updateNamespaceLikeImportNode(oldImportNode, newModuleName, newModuleSpecifier));
+ }
+ }
+ function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifier) {
+ var newNamespaceId = ts.createIdentifier(newNamespaceName);
+ var newModuleString = ts.createLiteral(newModuleSpecifier);
+ switch (node.kind) {
+ case 244:
+ return ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamespaceImport(newNamespaceId)), newModuleString);
+ case 243:
+ return ts.createImportEqualsDeclaration(undefined, undefined, newNamespaceId, ts.createExternalModuleReference(newModuleString));
+ case 232:
+ return ts.createVariableDeclaration(newNamespaceId, undefined, createRequireCall(newModuleString));
+ default:
+ return ts.Debug.assertNever(node);
}
}
function moduleSpecifierFromImport(i) {
- return (i.kind === 243 ? i.moduleSpecifier
- : i.kind === 242 ? i.moduleReference.expression
+ return (i.kind === 244 ? i.moduleSpecifier
+ : i.kind === 243 ? i.moduleReference.expression
: i.initializer.arguments[0]);
}
function forEachImportInStatement(statement, cb) {
@@ -88206,7 +89090,7 @@ var ts;
}
}
}
- function createOldFileImportsFromNewFile(newFileNeedExport, newFileNameWithExtension, useEs6Imports) {
+ function createOldFileImportsFromNewFile(newFileNeedExport, newFileNameWithExtension, useEs6Imports, preferences) {
var defaultImport;
var imports = [];
newFileNeedExport.forEach(function (symbol) {
@@ -88217,13 +89101,13 @@ var ts;
imports.push(symbol.name);
}
});
- return makeImportOrRequire(defaultImport, imports, newFileNameWithExtension, useEs6Imports);
+ return makeImportOrRequire(defaultImport, imports, newFileNameWithExtension, useEs6Imports, preferences);
}
- function makeImportOrRequire(defaultImport, imports, path, useEs6Imports) {
+ function makeImportOrRequire(defaultImport, imports, path, useEs6Imports, preferences) {
path = ts.ensurePathIsNonModuleName(path);
if (useEs6Imports) {
var specifiers = imports.map(function (i) { return ts.createImportSpecifier(undefined, ts.createIdentifier(i)); });
- return ts.makeImportIfNecessary(defaultImport, specifiers, path);
+ return ts.makeImportIfNecessary(defaultImport, specifiers, path, preferences);
}
else {
ts.Debug.assert(!defaultImport);
@@ -88254,15 +89138,15 @@ var ts;
}
function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) {
switch (importDecl.kind) {
- case 243:
+ case 244:
deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused);
break;
- case 242:
+ case 243:
if (isUnused(importDecl.name)) {
changes.deleteNode(sourceFile, importDecl);
}
break;
- case 231:
+ case 232:
deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused);
break;
default:
@@ -88275,7 +89159,7 @@ var ts;
var _a = importDecl.importClause, name = _a.name, namedBindings = _a.namedBindings;
var defaultUnused = !name || isUnused(name);
var namedBindingsUnused = !namedBindings ||
- (namedBindings.kind === 245 ? isUnused(namedBindings.name) : namedBindings.elements.every(function (e) { return isUnused(e.name); }));
+ (namedBindings.kind === 246 ? isUnused(namedBindings.name) : namedBindings.elements.every(function (e) { return isUnused(e.name); }));
if (defaultUnused && namedBindingsUnused) {
changes.deleteNode(sourceFile, importDecl);
}
@@ -88287,7 +89171,7 @@ var ts;
if (namedBindingsUnused) {
changes.deleteNode(sourceFile, namedBindings);
}
- else if (namedBindings.kind === 246) {
+ else if (namedBindings.kind === 247) {
for (var _i = 0, _b = namedBindings.elements; _i < _b.length; _i++) {
var element = _b[_i];
if (isUnused(element.name))
@@ -88305,9 +89189,9 @@ var ts;
changes.deleteNode(sourceFile, name);
}
break;
- case 180:
+ case 181:
break;
- case 179:
+ case 180:
if (name.elements.every(function (e) { return ts.isIdentifier(e.name) && isUnused(e.name); })) {
changes.deleteNode(sourceFile, ts.isVariableDeclarationList(varDecl.parent) && varDecl.parent.declarations.length === 1 ? varDecl.parent.parent : varDecl);
}
@@ -88322,7 +89206,7 @@ var ts;
break;
}
}
- function getNewFileImportsAndAddExportInOldFile(oldFile, importsToCopy, newFileImportsFromOldFile, changes, checker, useEs6ModuleSyntax) {
+ function getNewFileImportsAndAddExportInOldFile(oldFile, importsToCopy, newFileImportsFromOldFile, changes, checker, useEs6ModuleSyntax, preferences) {
var copiedOldImports = [];
for (var _i = 0, _a = oldFile.statements; _i < _a.length; _i++) {
var oldStatement = _a[_i];
@@ -88353,7 +89237,7 @@ var ts;
}
}
});
- ts.append(copiedOldImports, makeImportOrRequire(oldFileDefault, oldFileNamedImports, ts.removeFileExtension(ts.getBaseFileName(oldFile.fileName)), useEs6ModuleSyntax));
+ ts.append(copiedOldImports, makeImportOrRequire(oldFileDefault, oldFileNamedImports, ts.removeFileExtension(ts.getBaseFileName(oldFile.fileName)), useEs6ModuleSyntax, preferences));
return copiedOldImports;
}
function makeUniqueModuleName(moduleName, extension, inDirectory, host) {
@@ -88388,7 +89272,7 @@ var ts;
if (isInImport(decl)) {
oldImportsNeededByNewFile.add(symbol);
}
- else if (isTopLevelDeclaration(decl) && !movedSymbols.has(symbol)) {
+ else if (isTopLevelDeclaration(decl) && sourceFileOfTopLevelDeclaration(decl) === oldFile && !movedSymbols.has(symbol)) {
newFileImportsFromOldFile.add(symbol);
}
}
@@ -88410,13 +89294,13 @@ var ts;
}
function isInImport(decl) {
switch (decl.kind) {
- case 242:
- case 247:
- case 244:
+ case 243:
+ case 248:
+ case 245:
return true;
- case 231:
+ case 232:
return isVariableDeclarationInImport(decl);
- case 181:
+ case 182:
return ts.isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent);
default:
return false;
@@ -88428,7 +89312,7 @@ var ts;
}
function filterImport(i, moduleSpecifier, keep) {
switch (i.kind) {
- case 243: {
+ case 244: {
var clause = i.importClause;
if (!clause)
return undefined;
@@ -88438,9 +89322,9 @@ var ts;
? ts.createImportDeclaration(undefined, undefined, ts.createImportClause(defaultImport, namedBindings), moduleSpecifier)
: undefined;
}
- case 242:
+ case 243:
return keep(i.name) ? i : undefined;
- case 231: {
+ case 232: {
var name = filterBindingName(i.name, keep);
return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined;
}
@@ -88449,7 +89333,7 @@ var ts;
}
}
function filterNamedBindings(namedBindings, keep) {
- if (namedBindings.kind === 245) {
+ if (namedBindings.kind === 246) {
return keep(namedBindings.name) ? namedBindings : undefined;
}
else {
@@ -88461,9 +89345,9 @@ var ts;
switch (name.kind) {
case 71:
return keep(name) ? name : undefined;
- case 180:
+ case 181:
return name;
- case 179: {
+ case 180: {
var newElements = name.elements.filter(function (prop) { return prop.propertyName || !ts.isIdentifier(prop.name) || keep(prop.name); });
return newElements.length ? ts.createObjectBindingPattern(newElements) : undefined;
}
@@ -88508,7 +89392,10 @@ var ts;
return SymbolSet;
}());
function isTopLevelDeclaration(node) {
- return isNonVariableTopLevelDeclaration(node) || ts.isVariableDeclaration(node) && ts.isSourceFile(node.parent.parent.parent);
+ return isNonVariableTopLevelDeclaration(node) && ts.isSourceFile(node.parent) || ts.isVariableDeclaration(node) && ts.isSourceFile(node.parent.parent.parent);
+ }
+ function sourceFileOfTopLevelDeclaration(node) {
+ return ts.isVariableDeclaration(node) ? node.parent.parent.parent : node.parent;
}
function isTopLevelDeclarationStatement(node) {
ts.Debug.assert(ts.isSourceFile(node.parent));
@@ -88516,13 +89403,13 @@ var ts;
}
function isNonVariableTopLevelDeclaration(node) {
switch (node.kind) {
- case 233:
case 234:
+ case 235:
+ case 239:
case 238:
case 237:
case 236:
- case 235:
- case 242:
+ case 243:
return true;
default:
return false;
@@ -88530,17 +89417,17 @@ var ts;
}
function forEachTopLevelDeclaration(statement, cb) {
switch (statement.kind) {
- case 233:
case 234:
+ case 235:
+ case 239:
case 238:
case 237:
case 236:
- case 235:
- case 242:
+ case 243:
return cb(statement);
- case 213:
+ case 214:
return ts.forEach(statement.declarationList.declarations, cb);
- case 215: {
+ case 216: {
var expression = statement.expression;
return ts.isBinaryExpression(expression) && ts.getSpecialPropertyAssignmentKind(expression) === 1
? cb(statement)
@@ -88549,7 +89436,7 @@ var ts;
}
}
function nameOfTopLevelDeclaration(d) {
- return d.kind === 215 ? d.expression.left.name : ts.tryCast(d.name, ts.isIdentifier);
+ return d.kind === 216 ? d.expression.left.name : ts.tryCast(d.name, ts.isIdentifier);
}
function getTopLevelDeclarationStatement(d) {
return ts.isVariableDeclaration(d) ? d.parent.parent : d;
@@ -88581,23 +89468,23 @@ var ts;
function addEs6Export(d) {
var modifiers = ts.concatenate([ts.createModifier(84)], d.modifiers);
switch (d.kind) {
- case 233:
- return ts.updateFunctionDeclaration(d, d.decorators, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body);
case 234:
- return ts.updateClassDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members);
- case 213:
- return ts.updateVariableStatement(d, modifiers, d.declarationList);
- case 238:
- return ts.updateModuleDeclaration(d, d.decorators, modifiers, d.name, d.body);
- case 237:
- return ts.updateEnumDeclaration(d, d.decorators, modifiers, d.name, d.members);
- case 236:
- return ts.updateTypeAliasDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.type);
+ return ts.updateFunctionDeclaration(d, d.decorators, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body);
case 235:
+ return ts.updateClassDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members);
+ case 214:
+ return ts.updateVariableStatement(d, modifiers, d.declarationList);
+ case 239:
+ return ts.updateModuleDeclaration(d, d.decorators, modifiers, d.name, d.body);
+ case 238:
+ return ts.updateEnumDeclaration(d, d.decorators, modifiers, d.name, d.members);
+ case 237:
+ return ts.updateTypeAliasDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.type);
+ case 236:
return ts.updateInterfaceDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members);
- case 242:
+ case 243:
return ts.updateImportEqualsDeclaration(d, d.decorators, modifiers, d.name, d.moduleReference);
- case 215:
+ case 216:
return ts.Debug.fail();
default:
return ts.Debug.assertNever(d);
@@ -88608,21 +89495,21 @@ var ts;
}
function getNamesToExportInCommonJS(decl) {
switch (decl.kind) {
- case 233:
case 234:
+ case 235:
return [decl.name.text];
- case 213:
+ case 214:
return ts.mapDefined(decl.declarationList.declarations, function (d) { return ts.isIdentifier(d.name) ? d.name.text : undefined; });
+ case 239:
case 238:
case 237:
case 236:
- case 235:
- case 242:
- return undefined;
- case 215:
+ case 243:
+ return ts.emptyArray;
+ case 216:
return ts.Debug.fail();
default:
- ts.Debug.assertNever(decl);
+ return ts.Debug.assertNever(decl);
}
}
function createExportAssignment(name) {
@@ -88813,7 +89700,7 @@ var ts;
var value = 0;
for (; moreDigits; state.decodingIndex++) {
if (createErrorIfCondition(state.decodingIndex >= state.encodedText.length, "Error in decoding base64VLQFormatDecode, past the mapping string")) {
- return;
+ return undefined;
}
var currentByte = base64FormatDecode(state.encodedText.charAt(state.decodingIndex));
moreDigits = (currentByte & 32) !== 0;
@@ -88917,8 +89804,8 @@ var ts;
if (!children.length) {
return undefined;
}
- var child = ts.find(children, function (kid) { return kid.kind < 277 || kid.kind > 297; });
- return child.kind < 145 ?
+ var child = ts.find(children, function (kid) { return kid.kind < 278 || kid.kind > 298; });
+ return child.kind < 146 ?
child :
child.getFirstToken(sourceFile);
};
@@ -88929,7 +89816,7 @@ var ts;
if (!child) {
return undefined;
}
- return child.kind < 145 ? child : child.getLastToken(sourceFile);
+ return child.kind < 146 ? child : child.getLastToken(sourceFile);
};
NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) {
return ts.forEachChild(this, cbNode, cbNodeArray);
@@ -88982,7 +89869,7 @@ var ts;
}
}
function createSyntaxList(nodes, parent) {
- var list = createNode(298, nodes.pos, nodes.end, parent);
+ var list = createNode(299, nodes.pos, nodes.end, parent);
list._children = [];
var pos = nodes.pos;
for (var _i = 0, nodes_7 = nodes; _i < nodes_7.length; _i++) {
@@ -89159,25 +90046,25 @@ var ts;
return this.checker.getDefaultFromTypeParameter(this);
};
TypeObject.prototype.isUnion = function () {
- return !!(this.flags & 131072);
- };
- TypeObject.prototype.isIntersection = function () {
return !!(this.flags & 262144);
};
+ TypeObject.prototype.isIntersection = function () {
+ return !!(this.flags & 524288);
+ };
TypeObject.prototype.isUnionOrIntersection = function () {
- return !!(this.flags & 393216);
+ return !!(this.flags & 786432);
};
TypeObject.prototype.isLiteral = function () {
- return !!(this.flags & 224);
+ return !!(this.flags & 448);
};
TypeObject.prototype.isStringLiteral = function () {
- return !!(this.flags & 32);
- };
- TypeObject.prototype.isNumberLiteral = function () {
return !!(this.flags & 64);
};
+ TypeObject.prototype.isNumberLiteral = function () {
+ return !!(this.flags & 128);
+ };
TypeObject.prototype.isTypeParameter = function () {
- return !!(this.flags & 32768);
+ return !!(this.flags & 65536);
};
TypeObject.prototype.isClassOrInterface = function () {
return !!(ts.getObjectFlags(this) & 3);
@@ -89222,8 +90109,8 @@ var ts;
return ts.emptyArray;
var doc = ts.JsDoc.getJsDocCommentsFromDeclarations(declarations);
if (doc.length === 0 || declarations.some(hasJSDocInheritDocTag)) {
- for (var _i = 0, declarations_13 = declarations; _i < declarations_13.length; _i++) {
- var declaration = declarations_13[_i];
+ for (var _i = 0, declarations_14 = declarations; _i < declarations_14.length; _i++) {
+ var declaration = declarations_14[_i];
var inheritedDocs = findInheritedJSDocComments(declaration, declaration.symbol.name, checker);
if (inheritedDocs)
doc = doc.length === 0 ? inheritedDocs.slice() : inheritedDocs.concat(ts.lineBreakPart(), doc);
@@ -89299,10 +90186,10 @@ var ts;
}
function visit(node) {
switch (node.kind) {
- case 233:
- case 191:
+ case 234:
+ case 192:
+ case 154:
case 153:
- case 152:
var functionDeclaration = node;
var declarationName = getDeclarationName(functionDeclaration);
if (declarationName) {
@@ -89319,29 +90206,29 @@ var ts;
}
ts.forEachChild(node, visit);
break;
- case 234:
- case 204:
case 235:
+ case 205:
case 236:
case 237:
case 238:
- case 242:
- case 251:
- case 247:
- case 244:
+ case 239:
+ case 243:
+ case 252:
+ case 248:
case 245:
- case 155:
+ case 246:
case 156:
- case 165:
+ case 157:
+ case 166:
addDeclaration(node);
ts.forEachChild(node, visit);
break;
- case 148:
+ case 149:
if (!ts.hasModifier(node, 92)) {
break;
}
- case 231:
- case 181: {
+ case 232:
+ case 182: {
var decl = node;
if (ts.isBindingPattern(decl.name)) {
ts.forEachChild(decl.name, visit);
@@ -89351,24 +90238,24 @@ var ts;
visit(decl.initializer);
}
}
- case 272:
+ case 273:
+ case 152:
case 151:
- case 150:
addDeclaration(node);
break;
- case 249:
+ case 250:
if (node.exportClause) {
ts.forEach(node.exportClause.elements, visit);
}
break;
- case 243:
+ case 244:
var importClause = node.importClause;
if (importClause) {
if (importClause.name) {
addDeclaration(importClause);
}
if (importClause.namedBindings) {
- if (importClause.namedBindings.kind === 245) {
+ if (importClause.namedBindings.kind === 246) {
addDeclaration(importClause.namedBindings);
}
else {
@@ -89377,7 +90264,7 @@ var ts;
}
}
break;
- case 199:
+ case 200:
if (ts.getSpecialPropertyAssignmentKind(node) !== 0) {
addDeclaration(node);
}
@@ -89515,11 +90402,11 @@ var ts;
};
HostCache.prototype.getVersion = function (path) {
var file = this.getHostFileInformation(path);
- return file && file.version;
+ return (file && file.version);
};
HostCache.prototype.getScriptSnapshot = function (path) {
var file = this.getHostFileInformation(path);
- return file && file.scriptSnapshot;
+ return (file && file.scriptSnapshot);
};
return HostCache;
}());
@@ -89606,7 +90493,7 @@ var ts;
this.cancellationToken = cancellationToken;
}
CancellationTokenObject.prototype.isCancellationRequested = function () {
- return this.cancellationToken && this.cancellationToken.isCancellationRequested();
+ return !!this.cancellationToken && this.cancellationToken.isCancellationRequested();
};
CancellationTokenObject.prototype.throwIfCancellationRequested = function () {
if (this.isCancellationRequested()) {
@@ -89710,7 +90597,7 @@ var ts;
var hostCache = new HostCache(host, getCanonicalFileName);
var rootFileNames = hostCache.getRootFileNames();
var hasInvalidatedResolution = host.hasInvalidatedResolution || ts.returnFalse;
- if (ts.isProgramUptoDate(program, rootFileNames, hostCache.compilationSettings(), function (path) { return hostCache.getVersion(path); }, fileExists, hasInvalidatedResolution, host.hasChangedAutomaticTypeDirectiveNames)) {
+ if (ts.isProgramUptoDate(program, rootFileNames, hostCache.compilationSettings(), function (path) { return hostCache.getVersion(path); }, fileExists, hasInvalidatedResolution, !!host.hasChangedAutomaticTypeDirectiveNames)) {
return;
}
var newSettings = hostCache.compilationSettings();
@@ -89773,7 +90660,7 @@ var ts;
var entry = hostCache.getEntryByPath(path);
return entry ?
!ts.isString(entry) :
- (host.fileExists && host.fileExists(fileName));
+ (!!host.fileExists && host.fileExists(fileName));
}
function onReleaseOldSourceFile(oldSourceFile, oldOptions) {
var oldSettingsKey = documentRegistry.getKeyForCompilationSettings(oldOptions);
@@ -89834,7 +90721,7 @@ var ts;
}
function getSuggestionDiagnostics(fileName) {
synchronizeHostData();
- return ts.computeSuggestionDiagnostics(getValidSourceFile(fileName), program);
+ return ts.computeSuggestionDiagnostics(getValidSourceFile(fileName), program, cancellationToken);
}
function getCompilerOptionsDiagnostics() {
synchronizeHostData();
@@ -89849,7 +90736,7 @@ var ts;
function getCompletionEntryDetails(fileName, position, name, formattingOptions, source, preferences) {
if (preferences === void 0) { preferences = ts.defaultPreferences; }
synchronizeHostData();
- return ts.Completions.getCompletionEntryDetails(program, log, getValidSourceFile(fileName), position, { name: name, source: source }, host, formattingOptions && ts.formatting.getFormatContext(formattingOptions), getCanonicalFileName, preferences, cancellationToken);
+ return ts.Completions.getCompletionEntryDetails(program, log, getValidSourceFile(fileName), position, { name: name, source: source }, host, (formattingOptions && ts.formatting.getFormatContext(formattingOptions)), getCanonicalFileName, preferences, cancellationToken);
}
function getCompletionEntrySymbol(fileName, position, name, source) {
synchronizeHostData();
@@ -89870,10 +90757,10 @@ var ts;
if (ts.isLabelName(node)) {
return undefined;
}
- case 184:
- case 145:
+ case 185:
+ case 146:
case 99:
- case 173:
+ case 174:
case 97:
var type_4 = typeChecker.getTypeAtLocation(node);
return type_4 && {
@@ -90084,18 +90971,9 @@ var ts;
}
function getReferences(fileName, position, options) {
synchronizeHostData();
- var sourceFiles = [];
- if (options && options.isForRename) {
- for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) {
- var sourceFile = _a[_i];
- if (!program.isSourceFileDefaultLibrary(sourceFile)) {
- sourceFiles.push(sourceFile);
- }
- }
- }
- else {
- sourceFiles = program.getSourceFiles().slice();
- }
+ var sourceFiles = options && options.isForRename
+ ? program.getSourceFiles().filter(function (sourceFile) { return !program.isSourceFileDefaultLibrary(sourceFile); })
+ : program.getSourceFiles();
return ts.FindAllReferences.findReferencedEntries(program, cancellationToken, sourceFiles, getValidSourceFile(fileName), position, options);
}
function findReferences(fileName, position) {
@@ -90103,11 +90981,13 @@ var ts;
return ts.FindAllReferences.findReferencedSymbols(program, cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position);
}
function getNavigateToItems(searchValue, maxResultCount, fileName, excludeDtsFiles) {
+ if (excludeDtsFiles === void 0) { excludeDtsFiles = false; }
synchronizeHostData();
var sourceFiles = fileName ? [getValidSourceFile(fileName)] : program.getSourceFiles();
return ts.NavigateTo.getNavigateToItems(sourceFiles, program.getTypeChecker(), cancellationToken, searchValue, maxResultCount, excludeDtsFiles);
}
function getEmitOutput(fileName, emitOnlyDtsFiles) {
+ if (emitOnlyDtsFiles === void 0) { emitOnlyDtsFiles = false; }
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
var customTransformers = host.getCustomTransformers && host.getCustomTransformers();
@@ -90121,29 +91001,26 @@ var ts;
function getNonBoundSourceFile(fileName) {
return syntaxTreeCache.getCurrentSourceFile(fileName);
}
- function getSourceFile(fileName) {
- return getNonBoundSourceFile(fileName);
- }
function getNameOrDottedNameSpan(fileName, startPos, _endPos) {
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
var node = ts.getTouchingPropertyName(sourceFile, startPos, false);
if (node === sourceFile) {
- return;
+ return undefined;
}
switch (node.kind) {
- case 184:
- case 145:
+ case 185:
+ case 146:
case 9:
case 86:
case 101:
case 95:
case 97:
case 99:
- case 173:
+ case 174:
case 71:
break;
default:
- return;
+ return undefined;
}
var nodeForStartPos = node;
while (true) {
@@ -90151,7 +91028,7 @@ var ts;
nodeForStartPos = nodeForStartPos.parent;
}
else if (ts.isNameOfModuleDeclaration(nodeForStartPos)) {
- if (nodeForStartPos.parent.parent.kind === 238 &&
+ if (nodeForStartPos.parent.parent.kind === 239 &&
nodeForStartPos.parent.parent.body === nodeForStartPos.parent) {
nodeForStartPos = nodeForStartPos.parent.parent.name;
}
@@ -90278,8 +91155,9 @@ var ts;
var formatContext = ts.formatting.getFormatContext(formatOptions);
return ts.OrganizeImports.organizeImports(sourceFile, formatContext, host, program, preferences);
}
- function getEditsForFileRename(oldFilePath, newFilePath, formatOptions) {
- return ts.getEditsForFileRename(getProgram(), oldFilePath, newFilePath, host, ts.formatting.getFormatContext(formatOptions));
+ function getEditsForFileRename(oldFilePath, newFilePath, formatOptions, preferences) {
+ if (preferences === void 0) { preferences = ts.defaultPreferences; }
+ return ts.getEditsForFileRename(getProgram(), oldFilePath, newFilePath, host, ts.formatting.getFormatContext(formatOptions), preferences);
}
function applyCodeActionCommand(fileName, actionOrUndefined) {
var action = typeof fileName === "string" ? actionOrUndefined : fileName;
@@ -90292,7 +91170,7 @@ var ts;
? host.installPackage({ fileName: ts.toPath(action.file, currentDirectory, getCanonicalFileName), packageName: action.packageName })
: Promise.reject("Host does not implement `installPackage`");
default:
- ts.Debug.fail();
+ return ts.Debug.fail();
}
}
function getDocCommentTemplateAtPosition(fileName, position) {
@@ -90320,6 +91198,17 @@ var ts;
}
return true;
}
+ function getJsxClosingTagAtPosition(fileName, position) {
+ var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
+ var token = ts.findPrecedingToken(position, sourceFile);
+ if (!token)
+ return undefined;
+ var element = token.kind === 29 && ts.isJsxOpeningElement(token.parent) ? token.parent.parent
+ : ts.isJsxText(token) ? token.parent : undefined;
+ if (element && !ts.tagNamesAreEquivalent(element.openingElement.tagName, element.closingElement.tagName)) {
+ return { newText: "" + element.openingElement.tagName.getText(sourceFile) + ">" };
+ }
+ }
function getSpanOfEnclosingComment(fileName, position, onlyMultiLine) {
var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName);
var range = ts.formatting.getRangeOfEnclosingComment(sourceFile, position, onlyMultiLine);
@@ -90349,7 +91238,8 @@ var ts;
descriptor = descriptors[i];
}
}
- ts.Debug.assert(descriptor !== undefined);
+ if (descriptor === undefined)
+ return ts.Debug.fail();
if (isLetterOrDigit(fileContents.charCodeAt(matchPosition + descriptor.text.length))) {
continue;
}
@@ -90452,6 +91342,7 @@ var ts;
getFormattingEditsAfterKeystroke: getFormattingEditsAfterKeystroke,
getDocCommentTemplateAtPosition: getDocCommentTemplateAtPosition,
isValidBraceCompletionAtPosition: isValidBraceCompletionAtPosition,
+ getJsxClosingTagAtPosition: getJsxClosingTagAtPosition,
getSpanOfEnclosingComment: getSpanOfEnclosingComment,
getCodeFixesAtPosition: getCodeFixesAtPosition,
getCombinedCodeFix: getCombinedCodeFix,
@@ -90460,7 +91351,6 @@ var ts;
getEditsForFileRename: getEditsForFileRename,
getEmitOutput: getEmitOutput,
getNonBoundSourceFile: getNonBoundSourceFile,
- getSourceFile: getSourceFile,
getProgram: getProgram,
getApplicableRefactors: getApplicableRefactors,
getEditsForRefactor: getEditsForRefactor,
@@ -90493,7 +91383,7 @@ var ts;
}
function literalIsName(node) {
return ts.isDeclarationName(node) ||
- node.parent.kind === 253 ||
+ node.parent.kind === 254 ||
isArgumentOfElementAccessExpression(node) ||
ts.isLiteralComputedPropertyDeclarationName(node);
}
@@ -90501,12 +91391,12 @@ var ts;
switch (node.kind) {
case 9:
case 8:
- if (node.parent.kind === 146) {
+ if (node.parent.kind === 147) {
return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined;
}
case 71:
return ts.isObjectLiteralElement(node.parent) &&
- (node.parent.parent.kind === 183 || node.parent.parent.kind === 262) &&
+ (node.parent.parent.kind === 184 || node.parent.parent.kind === 263) &&
node.parent.name === node ? node.parent : undefined;
}
return undefined;
@@ -90523,7 +91413,7 @@ var ts;
if (name && type) {
var result_7 = [];
var symbol = type.getProperty(name);
- if (type.flags & 131072) {
+ if (type.flags & 262144) {
ts.forEach(type.types, function (t) {
var symbol = t.getProperty(name);
if (symbol) {
@@ -90543,7 +91433,7 @@ var ts;
function isArgumentOfElementAccessExpression(node) {
return node &&
node.parent &&
- node.parent.kind === 185 &&
+ node.parent.kind === 186 &&
node.parent.argumentExpression === node;
}
function getDefaultLibFilePath(options) {
@@ -90566,10 +91456,11 @@ var ts;
var tokenAtLocation = ts.getTokenAtPosition(sourceFile, position, false);
var lineOfPosition = sourceFile.getLineAndCharacterOfPosition(position).line;
if (sourceFile.getLineAndCharacterOfPosition(tokenAtLocation.getStart(sourceFile)).line > lineOfPosition) {
- tokenAtLocation = ts.findPrecedingToken(tokenAtLocation.pos, sourceFile);
- if (!tokenAtLocation || sourceFile.getLineAndCharacterOfPosition(tokenAtLocation.getEnd()).line !== lineOfPosition) {
+ var preceding = ts.findPrecedingToken(tokenAtLocation.pos, sourceFile);
+ if (!preceding || sourceFile.getLineAndCharacterOfPosition(preceding.getEnd()).line !== lineOfPosition) {
return undefined;
}
+ tokenAtLocation = preceding;
}
if (tokenAtLocation.flags & 4194304) {
return undefined;
@@ -90601,90 +91492,91 @@ var ts;
}
function spanInNode(node) {
if (node) {
+ var parent = node.parent;
switch (node.kind) {
- case 213:
+ case 214:
return spanInVariableDeclaration(node.declarationList.declarations[0]);
- case 231:
- case 151:
- case 150:
- return spanInVariableDeclaration(node);
- case 148:
- return spanInParameterDeclaration(node);
- case 233:
- case 153:
+ case 232:
case 152:
- case 155:
- case 156:
+ case 151:
+ return spanInVariableDeclaration(node);
+ case 149:
+ return spanInParameterDeclaration(node);
+ case 234:
case 154:
- case 191:
+ case 153:
+ case 156:
+ case 157:
+ case 155:
case 192:
+ case 193:
return spanInFunctionDeclaration(node);
- case 212:
+ case 213:
if (ts.isFunctionBlock(node)) {
return spanInFunctionBlock(node);
}
- case 239:
+ case 240:
return spanInBlock(node);
- case 268:
+ case 269:
return spanInBlock(node.block);
- case 215:
- return textSpan(node.expression);
- case 224:
- return textSpan(node.getChildAt(0), node.expression);
- case 218:
- return textSpanEndingAtNextToken(node, node.expression);
- case 217:
- return spanInNode(node.statement);
- case 230:
- return textSpan(node.getChildAt(0));
case 216:
- return textSpanEndingAtNextToken(node, node.expression);
- case 227:
- return spanInNode(node.statement);
- case 223:
- case 222:
- return textSpan(node.getChildAt(0), node.label);
+ return textSpan(node.expression);
+ case 225:
+ return textSpan(node.getChildAt(0), node.expression);
case 219:
- return spanInForStatement(node);
- case 220:
return textSpanEndingAtNextToken(node, node.expression);
- case 221:
- return spanInInitializerOfForLike(node);
- case 226:
+ case 218:
+ return spanInNode(node.statement);
+ case 231:
+ return textSpan(node.getChildAt(0));
+ case 217:
return textSpanEndingAtNextToken(node, node.expression);
- case 265:
- case 266:
- return spanInNode(node.statements[0]);
- case 229:
- return spanInBlock(node.tryBlock);
case 228:
+ return spanInNode(node.statement);
+ case 224:
+ case 223:
+ return textSpan(node.getChildAt(0), node.label);
+ case 220:
+ return spanInForStatement(node);
+ case 221:
+ return textSpanEndingAtNextToken(node, node.expression);
+ case 222:
+ return spanInInitializerOfForLike(node);
+ case 227:
+ return textSpanEndingAtNextToken(node, node.expression);
+ case 266:
+ case 267:
+ return spanInNode(node.statements[0]);
+ case 230:
+ return spanInBlock(node.tryBlock);
+ case 229:
return textSpan(node, node.expression);
- case 248:
- return textSpan(node, node.expression);
- case 242:
- return textSpan(node, node.moduleReference);
- case 243:
- return textSpan(node, node.moduleSpecifier);
case 249:
+ return textSpan(node, node.expression);
+ case 243:
+ return textSpan(node, node.moduleReference);
+ case 244:
return textSpan(node, node.moduleSpecifier);
- case 238:
+ case 250:
+ return textSpan(node, node.moduleSpecifier);
+ case 239:
if (ts.getModuleInstanceState(node) !== 1) {
return undefined;
}
- case 234:
- case 237:
- case 272:
- case 181:
- return textSpan(node);
- case 225:
- return spanInNode(node.statement);
- case 149:
- return spanInNodeArray(node.parent.decorators);
- case 179:
- case 180:
- return spanInBindingPattern(node);
case 235:
+ case 238:
+ case 273:
+ case 182:
+ return textSpan(node);
+ case 226:
+ return spanInNode(node.statement);
+ case 150:
+ return spanInNodeArray(parent.decorators);
+ case 180:
+ case 181:
+ return spanInBindingPattern(node);
case 236:
+ case 237:
return undefined;
case 25:
case 1:
@@ -90712,20 +91604,20 @@ var ts;
case 74:
case 87:
return spanInNextNode(node);
- case 144:
+ case 145:
return spanInOfKeyword(node);
default:
if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node)) {
return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node);
}
if ((node.kind === 71 ||
- node.kind === 203 ||
- node.kind === 269 ||
- node.kind === 270) &&
- ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) {
+ node.kind === 204 ||
+ node.kind === 270 ||
+ node.kind === 271) &&
+ ts.isArrayLiteralOrObjectLiteralDestructuringPattern(parent)) {
return textSpan(node);
}
- if (node.kind === 199) {
+ if (node.kind === 200) {
var _a = node, left = _a.left, operatorToken = _a.operatorToken;
if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left)) {
return spanInArrayLiteralOrObjectLiteralDestructuringPattern(left);
@@ -90738,20 +91630,20 @@ var ts;
}
}
if (ts.isExpressionNode(node)) {
- switch (node.parent.kind) {
- case 217:
+ switch (parent.kind) {
+ case 218:
return spanInPreviousNode(node);
- case 149:
+ case 150:
return spanInNode(node.parent);
- case 219:
- case 221:
+ case 220:
+ case 222:
return textSpan(node);
- case 199:
+ case 200:
if (node.parent.operatorToken.kind === 26) {
return textSpan(node);
}
break;
- case 192:
+ case 193:
if (node.parent.body === node) {
return textSpan(node);
}
@@ -90759,26 +91651,26 @@ var ts;
}
}
switch (node.parent.kind) {
- case 269:
+ case 270:
if (node.parent.name === node &&
!ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) {
return spanInNode(node.parent.initializer);
}
break;
- case 189:
+ case 190:
if (node.parent.type === node) {
return spanInNextNode(node.parent.type);
}
break;
- case 231:
- case 148: {
+ case 232:
+ case 149: {
var _b = node.parent, initializer = _b.initializer, type = _b.type;
if (initializer === node || type === node || ts.isAssignmentOperator(node.kind)) {
return spanInPreviousNode(node);
}
break;
}
- case 199: {
+ case 200: {
var left = node.parent.left;
if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) {
return spanInPreviousNode(node);
@@ -90802,15 +91694,16 @@ var ts;
}
}
function spanInVariableDeclaration(variableDeclaration) {
- if (variableDeclaration.parent.parent.kind === 220) {
+ if (variableDeclaration.parent.parent.kind === 221) {
return spanInNode(variableDeclaration.parent.parent);
}
+ var parent = variableDeclaration.parent;
if (ts.isBindingPattern(variableDeclaration.name)) {
return spanInBindingPattern(variableDeclaration.name);
}
if (variableDeclaration.initializer ||
ts.hasModifier(variableDeclaration, 1) ||
- variableDeclaration.parent.parent.kind === 221) {
+ parent.parent.kind === 222) {
return textSpanFromVariableDeclaration(variableDeclaration);
}
if (ts.isVariableDeclarationList(variableDeclaration.parent) &&
@@ -90843,7 +91736,7 @@ var ts;
}
function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) {
return ts.hasModifier(functionDeclaration, 1) ||
- (functionDeclaration.parent.kind === 234 && functionDeclaration.kind !== 154);
+ (functionDeclaration.parent.kind === 235 && functionDeclaration.kind !== 155);
}
function spanInFunctionDeclaration(functionDeclaration) {
if (!functionDeclaration.body) {
@@ -90863,22 +91756,22 @@ var ts;
}
function spanInBlock(block) {
switch (block.parent.kind) {
- case 238:
+ case 239:
if (ts.getModuleInstanceState(block.parent) !== 1) {
return undefined;
}
- case 218:
- case 216:
- case 220:
- return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]);
case 219:
+ case 217:
case 221:
+ return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]);
+ case 220:
+ case 222:
return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]);
}
return spanInNode(block.statements[0]);
}
function spanInInitializerOfForLike(forLikeStatement) {
- if (forLikeStatement.initializer.kind === 232) {
+ if (forLikeStatement.initializer.kind === 233) {
var variableDeclarationList = forLikeStatement.initializer;
if (variableDeclarationList.declarations.length > 0) {
return spanInNode(variableDeclarationList.declarations[0]);
@@ -90900,60 +91793,60 @@ var ts;
}
}
function spanInBindingPattern(bindingPattern) {
- var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 205 ? element : undefined; });
+ var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 206 ? element : undefined; });
if (firstBindingElement) {
return spanInNode(firstBindingElement);
}
- if (bindingPattern.parent.kind === 181) {
+ if (bindingPattern.parent.kind === 182) {
return textSpan(bindingPattern.parent);
}
return textSpanFromVariableDeclaration(bindingPattern.parent);
}
function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) {
- ts.Debug.assert(node.kind !== 180 && node.kind !== 179);
- var elements = node.kind === 182 ? node.elements : node.properties;
- var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 205 ? element : undefined; });
+ ts.Debug.assert(node.kind !== 181 && node.kind !== 180);
+ var elements = node.kind === 183 ? node.elements : node.properties;
+ var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 206 ? element : undefined; });
if (firstBindingElement) {
return spanInNode(firstBindingElement);
}
- return textSpan(node.parent.kind === 199 ? node.parent : node);
+ return textSpan(node.parent.kind === 200 ? node.parent : node);
}
function spanInOpenBraceToken(node) {
switch (node.parent.kind) {
- case 237:
+ case 238:
var enumDeclaration = node.parent;
return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile));
- case 234:
+ case 235:
var classDeclaration = node.parent;
return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile));
- case 240:
+ case 241:
return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]);
}
return spanInNode(node.parent);
}
function spanInCloseBraceToken(node) {
switch (node.parent.kind) {
- case 239:
+ case 240:
if (ts.getModuleInstanceState(node.parent.parent) !== 1) {
return undefined;
}
- case 237:
- case 234:
+ case 238:
+ case 235:
return textSpan(node);
- case 212:
+ case 213:
if (ts.isFunctionBlock(node.parent)) {
return textSpan(node);
}
- case 268:
+ case 269:
return spanInNode(ts.lastOrUndefined(node.parent.statements));
- case 240:
+ case 241:
var caseBlock = node.parent;
var lastClause = ts.lastOrUndefined(caseBlock.clauses);
if (lastClause) {
return spanInNode(ts.lastOrUndefined(lastClause.statements));
}
return undefined;
- case 179:
+ case 180:
var bindingPattern = node.parent;
return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern);
default:
@@ -90966,7 +91859,7 @@ var ts;
}
function spanInCloseBracketToken(node) {
switch (node.parent.kind) {
- case 180:
+ case 181:
var bindingPattern = node.parent;
return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern);
default:
@@ -90978,33 +91871,33 @@ var ts;
}
}
function spanInOpenParenToken(node) {
- if (node.parent.kind === 217 ||
- node.parent.kind === 186 ||
- node.parent.kind === 187) {
+ if (node.parent.kind === 218 ||
+ node.parent.kind === 187 ||
+ node.parent.kind === 188) {
return spanInPreviousNode(node);
}
- if (node.parent.kind === 190) {
+ if (node.parent.kind === 191) {
return spanInNextNode(node);
}
return spanInNode(node.parent);
}
function spanInCloseParenToken(node) {
switch (node.parent.kind) {
- case 191:
- case 233:
case 192:
- case 153:
- case 152:
- case 155:
- case 156:
+ case 234:
+ case 193:
case 154:
- case 218:
- case 217:
+ case 153:
+ case 156:
+ case 157:
+ case 155:
case 219:
- case 221:
- case 186:
+ case 218:
+ case 220:
+ case 222:
case 187:
- case 190:
+ case 188:
+ case 191:
return spanInPreviousNode(node);
default:
return spanInNode(node.parent);
@@ -91012,26 +91905,26 @@ var ts;
}
function spanInColonToken(node) {
if (ts.isFunctionLike(node.parent) ||
- node.parent.kind === 269 ||
- node.parent.kind === 148) {
+ node.parent.kind === 270 ||
+ node.parent.kind === 149) {
return spanInPreviousNode(node);
}
return spanInNode(node.parent);
}
function spanInGreaterThanOrLessThanToken(node) {
- if (node.parent.kind === 189) {
+ if (node.parent.kind === 190) {
return spanInNextNode(node);
}
return spanInNode(node.parent);
}
function spanInWhileKeyword(node) {
- if (node.parent.kind === 217) {
+ if (node.parent.kind === 218) {
return textSpanEndingAtNextToken(node, node.parent.expression);
}
return spanInNode(node.parent);
}
function spanInOfKeyword(node) {
- if (node.parent.kind === 221) {
+ if (node.parent.kind === 222) {
return spanInNextNode(node);
}
return spanInNode(node.parent);
@@ -91292,7 +92185,8 @@ var ts;
start: diagnostic.start,
length: diagnostic.length,
category: ts.diagnosticCategoryName(diagnostic),
- code: diagnostic.code
+ code: diagnostic.code,
+ reportsUnnecessary: diagnostic.reportsUnnecessary,
};
}
var LanguageServiceShimObject = (function (_super) {
@@ -91533,9 +92427,11 @@ var ts;
}
ClassifierShimObject.prototype.getEncodedLexicalClassifications = function (text, lexState, syntacticClassifierAbsent) {
var _this = this;
+ if (syntacticClassifierAbsent === void 0) { syntacticClassifierAbsent = false; }
return forwardJSONCall(this.logger, "getEncodedLexicalClassifications", function () { return convertClassifications(_this.classifier.getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent)); }, this.logPerformance);
};
ClassifierShimObject.prototype.getClassificationsForLine = function (text, lexState, classifyKeywordsInGenerics) {
+ if (classifyKeywordsInGenerics === void 0) { classifyKeywordsInGenerics = false; }
var classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics);
var result = "";
for (var _i = 0, _a = classification.entries; _i < _a.length; _i++) {
@@ -91884,7 +92780,7 @@ var ts;
function ThrottledOperations(host, logger) {
this.host = host;
this.pendingTimeouts = ts.createMap();
- this.logger = logger.hasLevel(server.LogLevel.verbose) && logger;
+ this.logger = logger.hasLevel(server.LogLevel.verbose) ? logger : undefined;
}
ThrottledOperations.prototype.schedule = function (operationId, delay, cb) {
var pendingTimeout = this.pendingTimeouts.get(operationId);
@@ -91982,6 +92878,7 @@ var ts;
(function (protocol) {
var CommandTypes;
(function (CommandTypes) {
+ CommandTypes["JsxClosingTag"] = "jsxClosingTag";
CommandTypes["Brace"] = "brace";
CommandTypes["BraceFull"] = "brace-full";
CommandTypes["BraceCompletion"] = "braceCompletion";
@@ -92485,15 +93382,15 @@ var ts;
}
var set = ts.createMap();
var unique = 0;
- for (var _i = 0, arr1_1 = arr1; _i < arr1_1.length; _i++) {
- var v = arr1_1[_i];
+ for (var _i = 0, _a = arr1; _i < _a.length; _i++) {
+ var v = _a[_i];
if (set.get(v) !== true) {
set.set(v, true);
unique++;
}
}
- for (var _a = 0, arr2_1 = arr2; _a < arr2_1.length; _a++) {
- var v = arr2_1[_a];
+ for (var _b = 0, _c = arr2; _b < _c.length; _b++) {
+ var v = _c[_b];
var isSet = set.get(v);
if (isSet === undefined) {
return false;
@@ -92756,11 +93653,11 @@ var ts;
};
Project.prototype.getScriptKind = function (fileName) {
var info = this.getOrCreateScriptInfoAndAttachToProject(fileName);
- return info && info.scriptKind;
+ return (info && info.scriptKind);
};
Project.prototype.getScriptVersion = function (filename) {
var info = this.getOrCreateScriptInfoAndAttachToProject(filename);
- return info && info.getLatestVersion();
+ return (info && info.getLatestVersion());
};
Project.prototype.getScriptSnapshot = function (filename) {
var scriptInfo = this.getOrCreateScriptInfoAndAttachToProject(filename);
@@ -92993,9 +93890,7 @@ var ts;
}
return ts.map(this.program.getSourceFiles(), function (sourceFile) {
var scriptInfo = _this.projectService.getScriptInfoForPath(sourceFile.path);
- if (!scriptInfo) {
- ts.Debug.fail("scriptInfo for a file '" + sourceFile.fileName + "' Path: '" + sourceFile.path + "' is missing.");
- }
+ ts.Debug.assert(!!scriptInfo, "getScriptInfo", function () { return "scriptInfo for a file '" + sourceFile.fileName + "' Path: '" + sourceFile.path + "' is missing."; });
return scriptInfo;
});
};
@@ -93065,6 +93960,7 @@ var ts;
if (info && (info.isScriptOpen() || !requireOpen)) {
return this.containsScriptInfo(info);
}
+ return false;
};
Project.prototype.isRoot = function (info) {
return this.rootFilesMap && this.rootFilesMap.get(info.path) === info;
@@ -93342,7 +94238,7 @@ var ts;
}
var searchPaths = [ts.combinePaths(this.projectService.getExecutingFilePath(), "../../..")].concat(this.projectService.pluginProbeLocations);
if (this.projectService.globalPlugins) {
- var _loop_22 = function (globalPluginName) {
+ var _loop_26 = function (globalPluginName) {
if (!globalPluginName)
return "continue";
if (options.plugins && options.plugins.some(function (p) { return p.name === globalPluginName; }))
@@ -93353,7 +94249,7 @@ var ts;
var this_1 = this;
for (var _i = 0, _a = this.projectService.globalPlugins; _i < _a.length; _i++) {
var globalPluginName = _a[_i];
- _loop_22(globalPluginName);
+ _loop_26(globalPluginName);
}
}
};
@@ -93756,7 +94652,7 @@ var ts;
var externalFilePropertyReader = {
getFileName: function (x) { return x.fileName; },
getScriptKind: function (x) { return tryConvertScriptKindName(x.scriptKind); },
- hasMixedContent: function (x) { return x.hasMixedContent; },
+ hasMixedContent: function (x) { return !!x.hasMixedContent; },
};
function findProjectByName(projectName, projects) {
for (var _i = 0, projects_1 = projects; _i < projects_1.length; _i++) {
@@ -93828,10 +94724,11 @@ var ts;
if (this.host.realpath) {
this.realpathToScriptInfos = ts.createMultiMap();
}
- this.currentDirectory = this.host.getCurrentDirectory();
+ this.currentDirectory = server.toNormalizedPath(this.host.getCurrentDirectory());
this.toCanonicalFileName = ts.createGetCanonicalFileName(this.host.useCaseSensitiveFileNames);
- this.globalCacheLocationDirectoryPath = this.typingsInstaller.globalTypingsCacheLocation &&
- ts.ensureTrailingDirectorySeparator(this.toPath(this.typingsInstaller.globalTypingsCacheLocation));
+ this.globalCacheLocationDirectoryPath = this.typingsInstaller.globalTypingsCacheLocation
+ ? ts.ensureTrailingDirectorySeparator(this.toPath(this.typingsInstaller.globalTypingsCacheLocation))
+ : undefined;
this.throttledOperations = new server.ThrottledOperations(this.host, this.logger);
if (this.typesMapLocation) {
this.loadTypesMap();
@@ -93847,7 +94744,7 @@ var ts;
hostInfo: "Unknown host",
extraFileExtensions: []
};
- this.documentRegistry = ts.createDocumentRegistry(this.host.useCaseSensitiveFileNames, this.currentDirectory);
+ this.documentRegistry = ts.createDocumentRegistryInternal(this.host.useCaseSensitiveFileNames, this.currentDirectory, this);
var watchLogLevel = this.logger.hasLevel(server.LogLevel.verbose) ? ts.WatchLogLevel.Verbose :
this.logger.loggingEnabled() ? ts.WatchLogLevel.TriggerOnly : ts.WatchLogLevel.None;
var log = watchLogLevel !== ts.WatchLogLevel.None ? (function (s) { return _this.logger.info(s); }) : ts.noop;
@@ -93862,6 +94759,14 @@ var ts;
ProjectService.prototype.getNormalizedAbsolutePath = function (fileName) {
return ts.getNormalizedAbsolutePath(fileName, this.host.getCurrentDirectory());
};
+ ProjectService.prototype.setDocument = function (key, path, sourceFile) {
+ var info = ts.Debug.assertDefined(this.getScriptInfoForPath(path));
+ info.cacheSourceFile = { key: key, sourceFile: sourceFile };
+ };
+ ProjectService.prototype.getDocument = function (key, path) {
+ var info = this.getScriptInfoForPath(path);
+ return info && info.cacheSourceFile && info.cacheSourceFile.key === key ? info.cacheSourceFile.sourceFile : undefined;
+ };
ProjectService.prototype.ensureInferredProjectsUpToDate_TestOnly = function () {
this.ensureProjectStructuresUptoDate();
};
@@ -94016,7 +94921,7 @@ var ts;
}
return scriptInfo.getDefaultProject();
}
- return scriptInfo && !scriptInfo.isOrphan() && scriptInfo.getDefaultProject();
+ return scriptInfo && !scriptInfo.isOrphan() ? scriptInfo.getDefaultProject() : undefined;
};
ProjectService.prototype.getScriptInfoEnsuringProjectsUptoDate = function (uncheckedFileName) {
this.ensureProjectStructuresUptoDate();
@@ -94140,7 +95045,7 @@ var ts;
}
project.updateGraph();
if (!this.useSingleInferredProject && !project.projectRootPath) {
- var _loop_23 = function (inferredProject) {
+ var _loop_27 = function (inferredProject) {
if (inferredProject === project || inferredProject.isOrphan()) {
return "continue";
}
@@ -94152,7 +95057,7 @@ var ts;
};
for (var _i = 0, _a = this.inferredProjects; _i < _a.length; _i++) {
var inferredProject = _a[_i];
- _loop_23(inferredProject);
+ _loop_27(inferredProject);
}
}
return project;
@@ -94528,7 +95433,7 @@ var ts;
if (!(project instanceof server.ConfiguredProject)) {
return "other";
}
- var configFilePath = project instanceof server.ConfiguredProject && project.getConfigFilePath();
+ var configFilePath = project instanceof server.ConfiguredProject ? project.getConfigFilePath() : undefined;
return server.getBaseConfigFileName(configFilePath) || "other";
}
function convertTypeAcquisition(_a) {
@@ -94735,7 +95640,7 @@ var ts;
return projects;
function combineProjects(toAddInfo) {
if (toAddInfo !== info) {
- var _loop_24 = function (project) {
+ var _loop_28 = function (project) {
if (project.languageServiceEnabled &&
!project.isOrphan() &&
!project.getCompilerOptions().preserveSymlinks &&
@@ -94751,7 +95656,7 @@ var ts;
};
for (var _i = 0, _a = toAddInfo.containingProjects; _i < _a.length; _i++) {
var project = _a[_i];
- _loop_24(project);
+ _loop_28(project);
}
}
}
@@ -94794,7 +95699,7 @@ var ts;
if (!openedByClient && !isDynamic && !(hostToQueryFileExistsOn || this.host).fileExists(fileName)) {
return;
}
- info = new server.ScriptInfo(this.host, fileName, scriptKind, hasMixedContent, path);
+ info = new server.ScriptInfo(this.host, fileName, scriptKind, !!hasMixedContent, path);
this.filenameToScriptInfo.set(info.path, info);
if (!openedByClient) {
this.watchClosedScriptInfo(info);
@@ -94996,13 +95901,13 @@ var ts;
this.printProjects();
};
ProjectService.prototype.collectChanges = function (lastKnownProjectVersions, currentProjects, result) {
- var _loop_25 = function (proj) {
- var knownProject = ts.forEach(lastKnownProjectVersions, function (p) { return p.projectName === proj.getProjectName() && p; });
+ var _loop_29 = function (proj) {
+ var knownProject = ts.find(lastKnownProjectVersions, function (p) { return p.projectName === proj.getProjectName(); });
result.push(proj.getChangesSinceVersion(knownProject && knownProject.version));
};
for (var _i = 0, currentProjects_1 = currentProjects; _i < currentProjects_1.length; _i++) {
var proj = currentProjects_1[_i];
- _loop_25(proj);
+ _loop_29(proj);
}
};
ProjectService.prototype.synchronizeProjectList = function (knownProjects) {
@@ -95093,7 +95998,8 @@ var ts;
};
ProjectService.prototype.applySafeList = function (proj) {
var _this = this;
- var rootFiles = proj.rootFiles, typeAcquisition = proj.typeAcquisition;
+ var rootFiles = proj.rootFiles;
+ var typeAcquisition = proj.typeAcquisition;
ts.Debug.assert(!!typeAcquisition, "proj.typeAcquisition should be set by now");
if (typeAcquisition.enable === false) {
return [];
@@ -95102,7 +96008,7 @@ var ts;
var excludeRules = [];
var normalizedNames = rootFiles.map(function (f) { return ts.normalizeSlashes(f.fileName); });
var excludedFiles = [];
- var _loop_26 = function (name) {
+ var _loop_30 = function (name) {
var rule = this_2.safelist[name];
for (var _i = 0, normalizedNames_1 = normalizedNames; _i < normalizedNames_1.length; _i++) {
var root = normalizedNames_1[_i];
@@ -95117,7 +96023,7 @@ var ts;
}
}
if (rule.exclude) {
- var _loop_28 = function (exclude) {
+ var _loop_32 = function (exclude) {
var processedRule = root.replace(rule.match, function () {
var groups = [];
for (var _i = 0; _i < arguments.length; _i++) {
@@ -95140,7 +96046,7 @@ var ts;
};
for (var _c = 0, _d = rule.exclude; _c < _d.length; _c++) {
var exclude = _d[_c];
- _loop_28(exclude);
+ _loop_32(exclude);
}
}
else {
@@ -95155,11 +96061,11 @@ var ts;
var this_2 = this;
for (var _i = 0, _a = Object.keys(this.safelist); _i < _a.length; _i++) {
var name = _a[_i];
- _loop_26(name);
+ _loop_30(name);
}
var excludeRegexes = excludeRules.map(function (e) { return new RegExp(e, "i"); });
var filesToKeep = [];
- var _loop_27 = function (i) {
+ var _loop_31 = function (i) {
if (excludeRegexes.some(function (re) { return re.test(normalizedNames[i]); })) {
excludedFiles.push(normalizedNames[i]);
}
@@ -95193,7 +96099,7 @@ var ts;
};
var this_3 = this;
for (var i = 0; i < proj.rootFiles.length; i++) {
- _loop_27(i);
+ _loop_31(i);
}
proj.rootFiles = filesToKeep;
return excludedFiles;
@@ -95364,8 +96270,8 @@ var ts;
return { line: lineAndCharacter.line + 1, offset: lineAndCharacter.character + 1 };
}
function formatConfigFileDiag(diag, includeFileName) {
- var start = diag.file && convertToLocation(ts.getLineAndCharacterOfPosition(diag.file, diag.start));
- var end = diag.file && convertToLocation(ts.getLineAndCharacterOfPosition(diag.file, diag.start + diag.length));
+ var start = (diag.file && convertToLocation(ts.getLineAndCharacterOfPosition(diag.file, diag.start)));
+ var end = (diag.file && convertToLocation(ts.getLineAndCharacterOfPosition(diag.file, diag.start + diag.length)));
var text = ts.flattenDiagnosticMessageText(diag.messageText, "\n");
var code = diag.code, source = diag.source;
var category = ts.diagnosticCategoryName(diag);
@@ -95743,6 +96649,9 @@ var ts;
_this.projectService.reloadProjects();
return _this.notRequired();
},
+ _a[server.CommandNames.JsxClosingTag] = function (request) {
+ return _this.requiredResponse(_this.getJsxClosingTag(request.arguments));
+ },
_a[server.CommandNames.GetCodeFixes] = function (request) {
return _this.requiredResponse(_this.getCodeFixes(request.arguments, true));
},
@@ -95791,6 +96700,7 @@ var ts;
this.logger = opts.logger;
this.canUseEvents = opts.canUseEvents;
this.suppressDiagnosticEvents = opts.suppressDiagnosticEvents;
+ this.noGetErrOnBackgroundUpdate = opts.noGetErrOnBackgroundUpdate;
var throttleWaitMilliseconds = opts.throttleWaitMilliseconds;
this.eventHandler = this.canUseEvents
? opts.eventHandler || (function (event) { return _this.defaultEventHandler(event); })
@@ -95862,7 +96772,7 @@ var ts;
var _this = this;
this.projectService.logger.info("got projects updated in background, updating diagnostics for " + openFiles);
if (openFiles.length) {
- if (!this.suppressDiagnosticEvents) {
+ if (!this.suppressDiagnosticEvents && !this.noGetErrOnBackgroundUpdate) {
var checkList_1 = this.createCheckList(openFiles);
this.errorCheck.startNew(function (next) { return _this.updateErrorCheck(next, checkList_1, 100, true); });
}
@@ -96004,20 +96914,20 @@ var ts;
return project.getLanguageService().getEncodedSemanticClassifications(file, args);
};
Session.prototype.getProject = function (projectFileName) {
- return projectFileName && this.projectService.findProject(projectFileName);
+ return projectFileName === undefined ? undefined : this.projectService.findProject(projectFileName);
};
Session.prototype.getConfigFileAndProject = function (args) {
var project = this.getProject(args.projectFileName);
var file = server.toNormalizedPath(args.file);
return {
- configFile: project && project.hasConfigFile(file) && file,
+ configFile: project && project.hasConfigFile(file) ? file : undefined,
project: project
};
};
Session.prototype.getConfigFileDiagnostics = function (configFile, project, includeLinePosition) {
var projectErrors = project.getAllProjectErrors();
var optionsErrors = project.getLanguageService().getCompilerOptionsDiagnostics();
- var diagnosticsForConfigFile = ts.filter(ts.concatenate(projectErrors, optionsErrors), function (diagnostic) { return diagnostic.file && diagnostic.file.fileName === configFile; });
+ var diagnosticsForConfigFile = ts.filter(ts.concatenate(projectErrors, optionsErrors), function (diagnostic) { return !!diagnostic.file && diagnostic.file.fileName === configFile; });
return includeLinePosition ?
this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(diagnosticsForConfigFile) :
ts.map(diagnosticsForConfigFile, function (diagnostic) { return formatConfigFileDiag(diagnostic, false); });
@@ -96030,8 +96940,8 @@ var ts;
length: d.length,
category: ts.diagnosticCategoryName(d),
code: d.code,
- startLocation: d.file && convertToLocation(ts.getLineAndCharacterOfPosition(d.file, d.start)),
- endLocation: d.file && convertToLocation(ts.getLineAndCharacterOfPosition(d.file, d.start + d.length))
+ startLocation: (d.file && convertToLocation(ts.getLineAndCharacterOfPosition(d.file, d.start))),
+ endLocation: (d.file && convertToLocation(ts.getLineAndCharacterOfPosition(d.file, d.start + d.length)))
}); });
};
Session.prototype.getCompilerOptionsDiagnostics = function (args) {
@@ -96167,21 +97077,27 @@ var ts;
if (configFile) {
return server.emptyArray;
}
- return this.getDiagnosticsWorker(args, false, function (project, file) { return project.getLanguageService().getSyntacticDiagnostics(file); }, args.includeLinePosition);
+ return this.getDiagnosticsWorker(args, false, function (project, file) { return project.getLanguageService().getSyntacticDiagnostics(file); }, !!args.includeLinePosition);
};
Session.prototype.getSemanticDiagnosticsSync = function (args) {
var _a = this.getConfigFileAndProject(args), configFile = _a.configFile, project = _a.project;
if (configFile) {
- return this.getConfigFileDiagnostics(configFile, project, args.includeLinePosition);
+ return this.getConfigFileDiagnostics(configFile, project, !!args.includeLinePosition);
}
- return this.getDiagnosticsWorker(args, true, function (project, file) { return project.getLanguageService().getSemanticDiagnostics(file); }, args.includeLinePosition);
+ return this.getDiagnosticsWorker(args, true, function (project, file) { return project.getLanguageService().getSemanticDiagnostics(file); }, !!args.includeLinePosition);
};
Session.prototype.getSuggestionDiagnosticsSync = function (args) {
var configFile = this.getConfigFileAndProject(args).configFile;
if (configFile) {
return server.emptyArray;
}
- return this.getDiagnosticsWorker(args, true, function (project, file) { return project.getLanguageService().getSuggestionDiagnostics(file); }, args.includeLinePosition);
+ return this.getDiagnosticsWorker(args, true, function (project, file) { return project.getLanguageService().getSuggestionDiagnostics(file); }, !!args.includeLinePosition);
+ };
+ Session.prototype.getJsxClosingTag = function (args) {
+ var _a = this.getFileAndProject(args), file = _a.file, project = _a.project;
+ var position = this.getPositionInFile(args, file);
+ var tag = project.getLanguageService().getJsxClosingTagAtPosition(file, position);
+ return tag === undefined ? undefined : { newText: tag.newText, caretOffset: 0 };
};
Session.prototype.getDocumentHighlights = function (args, simplifiedResult) {
var _a = this.getFileAndProject(args), file = _a.file, project = _a.project;
@@ -96354,13 +97270,10 @@ var ts;
var position = this.getPosition(args, scriptInfo);
if (simplifiedResult) {
var nameInfo = defaultProject.getLanguageService().getQuickInfoAtPosition(file, position);
- if (!nameInfo) {
- return undefined;
- }
- var displayString = ts.displayPartsToString(nameInfo.displayParts);
- var nameSpan = nameInfo.textSpan;
- var nameColStart = scriptInfo.positionToLineOffset(nameSpan.start).offset;
- var nameText = scriptInfo.getSnapshot().getText(nameSpan.start, ts.textSpanEnd(nameSpan));
+ var displayString = nameInfo ? ts.displayPartsToString(nameInfo.displayParts) : "";
+ var nameSpan = nameInfo && nameInfo.textSpan;
+ var nameColStart = nameSpan ? scriptInfo.positionToLineOffset(nameSpan.start).offset : 0;
+ var nameText = nameSpan ? scriptInfo.getSnapshot().getText(nameSpan.start, ts.textSpanEnd(nameSpan)) : "";
var refs = combineProjectOutput(file, function (path) { return _this.projectService.getScriptInfoForPath(path).fileName; }, projects, function (project, file) {
var references = project.getLanguageService().getReferencesAtPosition(file, position);
if (!references) {
@@ -96701,7 +97614,7 @@ var ts;
};
Session.prototype.reload = function (args, reqSeq) {
var file = server.toNormalizedPath(args.file);
- var tempFileName = args.tmpfile && server.toNormalizedPath(args.tmpfile);
+ var tempFileName = args.tmpfile === undefined ? undefined : server.toNormalizedPath(args.tmpfile);
var info = this.projectService.getScriptInfoForNormalizedPath(file);
if (info) {
this.changeSeq++;
@@ -96904,7 +97817,7 @@ var ts;
};
Session.prototype.getEditsForFileRename = function (args, simplifiedResult) {
var _a = this.getFileAndProject(args), file = _a.file, project = _a.project;
- var changes = project.getLanguageService().getEditsForFileRename(args.oldFilePath, args.newFilePath, this.getFormatOptions(file));
+ var changes = project.getLanguageService().getEditsForFileRename(args.oldFilePath, args.newFilePath, this.getFormatOptions(file), this.getPreferences(file));
return simplifiedResult ? this.mapTextChangesToCodeEdits(project, changes) : changes;
};
Session.prototype.getCodeFixes = function (args, simplifiedResult) {
@@ -97573,6 +98486,7 @@ var ts;
this.load(LineIndex.linesFromText(newText).lines);
return this;
}
+ return undefined;
}
else {
var checkText = void 0;
@@ -97912,8 +98826,7 @@ var ts;
return ts.combinePaths(ts.combinePaths(cacheLocation, "typescript"), ts.versionMajorMinor);
}
default:
- ts.Debug.fail("unsupported platform '" + process.platform + "'");
- return;
+ return ts.Debug.fail("unsupported platform '" + process.platform + "'");
}
}
function getNonWindowsCacheLocation(platformIsDarwin) {
@@ -98262,6 +99175,7 @@ var ts;
canUseEvents: true,
suppressDiagnosticEvents: suppressDiagnosticEvents,
syntaxOnly: syntaxOnly,
+ noGetErrOnBackgroundUpdate: noGetErrOnBackgroundUpdate,
globalPlugins: globalPlugins,
pluginProbeLocations: pluginProbeLocations,
allowLocalPluginLoads: allowLocalPluginLoads,
@@ -98283,7 +99197,7 @@ var ts;
return _this;
}
IOSession.prototype.event = function (body, eventName) {
- ts.Debug.assert(this.constructed, "Should only call `IOSession.prototype.event` on an initialized IOSession");
+ ts.Debug.assert(!!this.constructed, "Should only call `IOSession.prototype.event` on an initialized IOSession");
if (this.canUseEvents && this.eventPort) {
if (!this.eventSocket) {
if (this.logger.hasLevel(server.LogLevel.verbose)) {
@@ -98590,8 +99504,8 @@ var ts;
var eventPort;
{
var str = server.findArgument("--eventPort");
- var v = str && parseInt(str);
- if (!isNaN(v)) {
+ var v = str === undefined ? undefined : parseInt(str);
+ if (v !== undefined && !isNaN(v)) {
eventPort = v;
}
}
@@ -98619,6 +99533,7 @@ var ts;
var suppressDiagnosticEvents = server.hasArgument("--suppressDiagnosticEvents");
var syntaxOnly = server.hasArgument("--syntaxOnly");
var telemetryEnabled = server.hasArgument(server.Arguments.EnableTelemetry);
+ var noGetErrOnBackgroundUpdate = server.hasArgument("--noGetErrOnBackgroundUpdate");
logger.info("Starting TS Server");
logger.info("Version: " + ts.version);
logger.info("Arguments: " + process.argv.join(" "));
diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts
index cbf39a2a48f..76a5d890fa7 100644
--- a/lib/tsserverlibrary.d.ts
+++ b/lib/tsserverlibrary.d.ts
@@ -204,169 +204,170 @@ declare namespace ts {
TypeKeyword = 139,
UndefinedKeyword = 140,
UniqueKeyword = 141,
- FromKeyword = 142,
- GlobalKeyword = 143,
- OfKeyword = 144,
- QualifiedName = 145,
- ComputedPropertyName = 146,
- TypeParameter = 147,
- Parameter = 148,
- Decorator = 149,
- PropertySignature = 150,
- PropertyDeclaration = 151,
- MethodSignature = 152,
- MethodDeclaration = 153,
- Constructor = 154,
- GetAccessor = 155,
- SetAccessor = 156,
- CallSignature = 157,
- ConstructSignature = 158,
- IndexSignature = 159,
- TypePredicate = 160,
- TypeReference = 161,
- FunctionType = 162,
- ConstructorType = 163,
- TypeQuery = 164,
- TypeLiteral = 165,
- ArrayType = 166,
- TupleType = 167,
- UnionType = 168,
- IntersectionType = 169,
- ConditionalType = 170,
- InferType = 171,
- ParenthesizedType = 172,
- ThisType = 173,
- TypeOperator = 174,
- IndexedAccessType = 175,
- MappedType = 176,
- LiteralType = 177,
- ImportType = 178,
- ObjectBindingPattern = 179,
- ArrayBindingPattern = 180,
- BindingElement = 181,
- ArrayLiteralExpression = 182,
- ObjectLiteralExpression = 183,
- PropertyAccessExpression = 184,
- ElementAccessExpression = 185,
- CallExpression = 186,
- NewExpression = 187,
- TaggedTemplateExpression = 188,
- TypeAssertionExpression = 189,
- ParenthesizedExpression = 190,
- FunctionExpression = 191,
- ArrowFunction = 192,
- DeleteExpression = 193,
- TypeOfExpression = 194,
- VoidExpression = 195,
- AwaitExpression = 196,
- PrefixUnaryExpression = 197,
- PostfixUnaryExpression = 198,
- BinaryExpression = 199,
- ConditionalExpression = 200,
- TemplateExpression = 201,
- YieldExpression = 202,
- SpreadElement = 203,
- ClassExpression = 204,
- OmittedExpression = 205,
- ExpressionWithTypeArguments = 206,
- AsExpression = 207,
- NonNullExpression = 208,
- MetaProperty = 209,
- TemplateSpan = 210,
- SemicolonClassElement = 211,
- Block = 212,
- VariableStatement = 213,
- EmptyStatement = 214,
- ExpressionStatement = 215,
- IfStatement = 216,
- DoStatement = 217,
- WhileStatement = 218,
- ForStatement = 219,
- ForInStatement = 220,
- ForOfStatement = 221,
- ContinueStatement = 222,
- BreakStatement = 223,
- ReturnStatement = 224,
- WithStatement = 225,
- SwitchStatement = 226,
- LabeledStatement = 227,
- ThrowStatement = 228,
- TryStatement = 229,
- DebuggerStatement = 230,
- VariableDeclaration = 231,
- VariableDeclarationList = 232,
- FunctionDeclaration = 233,
- ClassDeclaration = 234,
- InterfaceDeclaration = 235,
- TypeAliasDeclaration = 236,
- EnumDeclaration = 237,
- ModuleDeclaration = 238,
- ModuleBlock = 239,
- CaseBlock = 240,
- NamespaceExportDeclaration = 241,
- ImportEqualsDeclaration = 242,
- ImportDeclaration = 243,
- ImportClause = 244,
- NamespaceImport = 245,
- NamedImports = 246,
- ImportSpecifier = 247,
- ExportAssignment = 248,
- ExportDeclaration = 249,
- NamedExports = 250,
- ExportSpecifier = 251,
- MissingDeclaration = 252,
- ExternalModuleReference = 253,
- JsxElement = 254,
- JsxSelfClosingElement = 255,
- JsxOpeningElement = 256,
- JsxClosingElement = 257,
- JsxFragment = 258,
- JsxOpeningFragment = 259,
- JsxClosingFragment = 260,
- JsxAttribute = 261,
- JsxAttributes = 262,
- JsxSpreadAttribute = 263,
- JsxExpression = 264,
- CaseClause = 265,
- DefaultClause = 266,
- HeritageClause = 267,
- CatchClause = 268,
- PropertyAssignment = 269,
- ShorthandPropertyAssignment = 270,
- SpreadAssignment = 271,
- EnumMember = 272,
- SourceFile = 273,
- Bundle = 274,
- UnparsedSource = 275,
- InputFiles = 276,
- JSDocTypeExpression = 277,
- JSDocAllType = 278,
- JSDocUnknownType = 279,
- JSDocNullableType = 280,
- JSDocNonNullableType = 281,
- JSDocOptionalType = 282,
- JSDocFunctionType = 283,
- JSDocVariadicType = 284,
- JSDocComment = 285,
- JSDocTypeLiteral = 286,
- JSDocSignature = 287,
- JSDocTag = 288,
- JSDocAugmentsTag = 289,
- JSDocClassTag = 290,
- JSDocCallbackTag = 291,
- JSDocParameterTag = 292,
- JSDocReturnTag = 293,
- JSDocTypeTag = 294,
- JSDocTemplateTag = 295,
- JSDocTypedefTag = 296,
- JSDocPropertyTag = 297,
- SyntaxList = 298,
- NotEmittedStatement = 299,
- PartiallyEmittedExpression = 300,
- CommaListExpression = 301,
- MergeDeclarationMarker = 302,
- EndOfDeclarationMarker = 303,
- Count = 304,
+ UnknownKeyword = 142,
+ FromKeyword = 143,
+ GlobalKeyword = 144,
+ OfKeyword = 145,
+ QualifiedName = 146,
+ ComputedPropertyName = 147,
+ TypeParameter = 148,
+ Parameter = 149,
+ Decorator = 150,
+ PropertySignature = 151,
+ PropertyDeclaration = 152,
+ MethodSignature = 153,
+ MethodDeclaration = 154,
+ Constructor = 155,
+ GetAccessor = 156,
+ SetAccessor = 157,
+ CallSignature = 158,
+ ConstructSignature = 159,
+ IndexSignature = 160,
+ TypePredicate = 161,
+ TypeReference = 162,
+ FunctionType = 163,
+ ConstructorType = 164,
+ TypeQuery = 165,
+ TypeLiteral = 166,
+ ArrayType = 167,
+ TupleType = 168,
+ UnionType = 169,
+ IntersectionType = 170,
+ ConditionalType = 171,
+ InferType = 172,
+ ParenthesizedType = 173,
+ ThisType = 174,
+ TypeOperator = 175,
+ IndexedAccessType = 176,
+ MappedType = 177,
+ LiteralType = 178,
+ ImportType = 179,
+ ObjectBindingPattern = 180,
+ ArrayBindingPattern = 181,
+ BindingElement = 182,
+ ArrayLiteralExpression = 183,
+ ObjectLiteralExpression = 184,
+ PropertyAccessExpression = 185,
+ ElementAccessExpression = 186,
+ CallExpression = 187,
+ NewExpression = 188,
+ TaggedTemplateExpression = 189,
+ TypeAssertionExpression = 190,
+ ParenthesizedExpression = 191,
+ FunctionExpression = 192,
+ ArrowFunction = 193,
+ DeleteExpression = 194,
+ TypeOfExpression = 195,
+ VoidExpression = 196,
+ AwaitExpression = 197,
+ PrefixUnaryExpression = 198,
+ PostfixUnaryExpression = 199,
+ BinaryExpression = 200,
+ ConditionalExpression = 201,
+ TemplateExpression = 202,
+ YieldExpression = 203,
+ SpreadElement = 204,
+ ClassExpression = 205,
+ OmittedExpression = 206,
+ ExpressionWithTypeArguments = 207,
+ AsExpression = 208,
+ NonNullExpression = 209,
+ MetaProperty = 210,
+ TemplateSpan = 211,
+ SemicolonClassElement = 212,
+ Block = 213,
+ VariableStatement = 214,
+ EmptyStatement = 215,
+ ExpressionStatement = 216,
+ IfStatement = 217,
+ DoStatement = 218,
+ WhileStatement = 219,
+ ForStatement = 220,
+ ForInStatement = 221,
+ ForOfStatement = 222,
+ ContinueStatement = 223,
+ BreakStatement = 224,
+ ReturnStatement = 225,
+ WithStatement = 226,
+ SwitchStatement = 227,
+ LabeledStatement = 228,
+ ThrowStatement = 229,
+ TryStatement = 230,
+ DebuggerStatement = 231,
+ VariableDeclaration = 232,
+ VariableDeclarationList = 233,
+ FunctionDeclaration = 234,
+ ClassDeclaration = 235,
+ InterfaceDeclaration = 236,
+ TypeAliasDeclaration = 237,
+ EnumDeclaration = 238,
+ ModuleDeclaration = 239,
+ ModuleBlock = 240,
+ CaseBlock = 241,
+ NamespaceExportDeclaration = 242,
+ ImportEqualsDeclaration = 243,
+ ImportDeclaration = 244,
+ ImportClause = 245,
+ NamespaceImport = 246,
+ NamedImports = 247,
+ ImportSpecifier = 248,
+ ExportAssignment = 249,
+ ExportDeclaration = 250,
+ NamedExports = 251,
+ ExportSpecifier = 252,
+ MissingDeclaration = 253,
+ ExternalModuleReference = 254,
+ JsxElement = 255,
+ JsxSelfClosingElement = 256,
+ JsxOpeningElement = 257,
+ JsxClosingElement = 258,
+ JsxFragment = 259,
+ JsxOpeningFragment = 260,
+ JsxClosingFragment = 261,
+ JsxAttribute = 262,
+ JsxAttributes = 263,
+ JsxSpreadAttribute = 264,
+ JsxExpression = 265,
+ CaseClause = 266,
+ DefaultClause = 267,
+ HeritageClause = 268,
+ CatchClause = 269,
+ PropertyAssignment = 270,
+ ShorthandPropertyAssignment = 271,
+ SpreadAssignment = 272,
+ EnumMember = 273,
+ SourceFile = 274,
+ Bundle = 275,
+ UnparsedSource = 276,
+ InputFiles = 277,
+ JSDocTypeExpression = 278,
+ JSDocAllType = 279,
+ JSDocUnknownType = 280,
+ JSDocNullableType = 281,
+ JSDocNonNullableType = 282,
+ JSDocOptionalType = 283,
+ JSDocFunctionType = 284,
+ JSDocVariadicType = 285,
+ JSDocComment = 286,
+ JSDocTypeLiteral = 287,
+ JSDocSignature = 288,
+ JSDocTag = 289,
+ JSDocAugmentsTag = 290,
+ JSDocClassTag = 291,
+ JSDocCallbackTag = 292,
+ JSDocParameterTag = 293,
+ JSDocReturnTag = 294,
+ JSDocTypeTag = 295,
+ JSDocTemplateTag = 296,
+ JSDocTypedefTag = 297,
+ JSDocPropertyTag = 298,
+ SyntaxList = 299,
+ NotEmittedStatement = 300,
+ PartiallyEmittedExpression = 301,
+ CommaListExpression = 302,
+ MergeDeclarationMarker = 303,
+ EndOfDeclarationMarker = 304,
+ Count = 305,
FirstAssignment = 58,
LastAssignment = 70,
FirstCompoundAssignment = 59,
@@ -374,15 +375,15 @@ declare namespace ts {
FirstReservedWord = 72,
LastReservedWord = 107,
FirstKeyword = 72,
- LastKeyword = 144,
+ LastKeyword = 145,
FirstFutureReservedWord = 108,
LastFutureReservedWord = 116,
- FirstTypeNode = 160,
- LastTypeNode = 178,
+ FirstTypeNode = 161,
+ LastTypeNode = 179,
FirstPunctuation = 17,
LastPunctuation = 70,
FirstToken = 0,
- LastToken = 144,
+ LastToken = 145,
FirstTriviaToken = 2,
LastTriviaToken = 7,
FirstLiteralToken = 8,
@@ -391,11 +392,11 @@ declare namespace ts {
LastTemplateToken = 16,
FirstBinaryOperator = 27,
LastBinaryOperator = 70,
- FirstNode = 145,
- FirstJSDocNode = 277,
- LastJSDocNode = 297,
- FirstJSDocTagNode = 288,
- LastJSDocTagNode = 297
+ FirstNode = 146,
+ FirstJSDocNode = 278,
+ LastJSDocNode = 298,
+ FirstJSDocTagNode = 289,
+ LastJSDocTagNode = 298
}
enum NodeFlags {
None = 0,
@@ -460,7 +461,7 @@ declare namespace ts {
flags: NodeFlags;
decorators?: NodeArray;
modifiers?: ModifiersArray;
- parent?: Node;
+ parent: Node;
}
interface JSDocContainer {
}
@@ -525,12 +526,12 @@ declare namespace ts {
}
interface Decorator extends Node {
kind: SyntaxKind.Decorator;
- parent?: NamedDeclaration;
+ parent: NamedDeclaration;
expression: LeftHandSideExpression;
}
interface TypeParameterDeclaration extends NamedDeclaration {
kind: SyntaxKind.TypeParameter;
- parent?: DeclarationWithTypeParameters | InferTypeNode;
+ parent: DeclarationWithTypeParameters | InferTypeNode;
name: Identifier;
constraint?: TypeNode;
default?: TypeNode;
@@ -541,7 +542,7 @@ declare namespace ts {
name?: PropertyName;
typeParameters?: NodeArray;
parameters: NodeArray;
- type: TypeNode | undefined;
+ type?: TypeNode;
}
type SignatureDeclaration = CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | AccessorDeclaration | FunctionExpression | ArrowFunction;
interface CallSignatureDeclaration extends SignatureDeclarationBase, TypeElement {
@@ -553,7 +554,7 @@ declare namespace ts {
type BindingName = Identifier | BindingPattern;
interface VariableDeclaration extends NamedDeclaration {
kind: SyntaxKind.VariableDeclaration;
- parent?: VariableDeclarationList | CatchClause;
+ parent: VariableDeclarationList | CatchClause;
name: BindingName;
exclamationToken?: ExclamationToken;
type?: TypeNode;
@@ -561,12 +562,12 @@ declare namespace ts {
}
interface VariableDeclarationList extends Node {
kind: SyntaxKind.VariableDeclarationList;
- parent?: VariableStatement | ForStatement | ForOfStatement | ForInStatement;
+ parent: VariableStatement | ForStatement | ForOfStatement | ForInStatement;
declarations: NodeArray;
}
interface ParameterDeclaration extends NamedDeclaration, JSDocContainer {
kind: SyntaxKind.Parameter;
- parent?: SignatureDeclaration;
+ parent: SignatureDeclaration;
dotDotDotToken?: DotDotDotToken;
name: BindingName;
questionToken?: QuestionToken;
@@ -575,7 +576,7 @@ declare namespace ts {
}
interface BindingElement extends NamedDeclaration {
kind: SyntaxKind.BindingElement;
- parent?: BindingPattern;
+ parent: BindingPattern;
propertyName?: PropertyName;
dotDotDotToken?: DotDotDotToken;
name: BindingName;
@@ -628,12 +629,12 @@ declare namespace ts {
}
interface ObjectBindingPattern extends Node {
kind: SyntaxKind.ObjectBindingPattern;
- parent?: VariableDeclaration | ParameterDeclaration | BindingElement;
+ parent: VariableDeclaration | ParameterDeclaration | BindingElement;
elements: NodeArray;
}
interface ArrayBindingPattern extends Node {
kind: SyntaxKind.ArrayBindingPattern;
- parent?: VariableDeclaration | ParameterDeclaration | BindingElement;
+ parent: VariableDeclaration | ParameterDeclaration | BindingElement;
elements: NodeArray;
}
type BindingPattern = ObjectBindingPattern | ArrayBindingPattern;
@@ -662,47 +663,47 @@ declare namespace ts {
}
interface MethodSignature extends SignatureDeclarationBase, TypeElement {
kind: SyntaxKind.MethodSignature;
- parent?: ObjectTypeDeclaration;
+ parent: ObjectTypeDeclaration;
name: PropertyName;
}
interface MethodDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer {
kind: SyntaxKind.MethodDeclaration;
- parent?: ClassLikeDeclaration | ObjectLiteralExpression;
+ parent: ClassLikeDeclaration | ObjectLiteralExpression;
name: PropertyName;
body?: FunctionBody;
}
interface ConstructorDeclaration extends FunctionLikeDeclarationBase, ClassElement, JSDocContainer {
kind: SyntaxKind.Constructor;
- parent?: ClassLikeDeclaration;
+ parent: ClassLikeDeclaration;
body?: FunctionBody;
}
/** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */
interface SemicolonClassElement extends ClassElement {
kind: SyntaxKind.SemicolonClassElement;
- parent?: ClassLikeDeclaration;
+ parent: ClassLikeDeclaration;
}
interface GetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer {
kind: SyntaxKind.GetAccessor;
- parent?: ClassLikeDeclaration | ObjectLiteralExpression;
+ parent: ClassLikeDeclaration | ObjectLiteralExpression;
name: PropertyName;
body?: FunctionBody;
}
interface SetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer {
kind: SyntaxKind.SetAccessor;
- parent?: ClassLikeDeclaration | ObjectLiteralExpression;
+ parent: ClassLikeDeclaration | ObjectLiteralExpression;
name: PropertyName;
body?: FunctionBody;
}
type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration;
interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement {
kind: SyntaxKind.IndexSignature;
- parent?: ObjectTypeDeclaration;
+ parent: ObjectTypeDeclaration;
}
interface TypeNode extends Node {
_typeNodeBrand: any;
}
interface KeywordTypeNode extends TypeNode {
- kind: SyntaxKind.AnyKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.VoidKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.NullKeyword | SyntaxKind.NeverKeyword;
+ kind: SyntaxKind.AnyKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.VoidKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.NullKeyword | SyntaxKind.NeverKeyword;
}
interface ImportTypeNode extends NodeWithTypeArguments {
kind: SyntaxKind.ImportType;
@@ -730,7 +731,7 @@ declare namespace ts {
}
interface TypePredicateNode extends TypeNode {
kind: SyntaxKind.TypePredicate;
- parent?: SignatureDeclaration;
+ parent: SignatureDeclaration;
parameterName: Identifier | ThisTypeNode;
type: TypeNode;
}
@@ -959,15 +960,15 @@ declare namespace ts {
}
interface TemplateHead extends LiteralLikeNode {
kind: SyntaxKind.TemplateHead;
- parent?: TemplateExpression;
+ parent: TemplateExpression;
}
interface TemplateMiddle extends LiteralLikeNode {
kind: SyntaxKind.TemplateMiddle;
- parent?: TemplateSpan;
+ parent: TemplateSpan;
}
interface TemplateTail extends LiteralLikeNode {
kind: SyntaxKind.TemplateTail;
- parent?: TemplateSpan;
+ parent: TemplateSpan;
}
type TemplateLiteral = TemplateExpression | NoSubstitutionTemplateLiteral;
interface TemplateExpression extends PrimaryExpression {
@@ -977,7 +978,7 @@ declare namespace ts {
}
interface TemplateSpan extends Node {
kind: SyntaxKind.TemplateSpan;
- parent?: TemplateExpression;
+ parent: TemplateExpression;
expression: Expression;
literal: TemplateMiddle | TemplateTail;
}
@@ -991,7 +992,7 @@ declare namespace ts {
}
interface SpreadElement extends Expression {
kind: SyntaxKind.SpreadElement;
- parent?: ArrayLiteralExpression | CallExpression | NewExpression;
+ parent: ArrayLiteralExpression | CallExpression | NewExpression;
expression: Expression;
}
/**
@@ -1044,7 +1045,7 @@ declare namespace ts {
}
interface ExpressionWithTypeArguments extends NodeWithTypeArguments {
kind: SyntaxKind.ExpressionWithTypeArguments;
- parent?: HeritageClause;
+ parent: HeritageClause;
expression: LeftHandSideExpression;
}
interface NewExpression extends PrimaryExpression, Declaration {
@@ -1090,11 +1091,11 @@ declare namespace ts {
type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute;
type JsxTagNameExpression = PrimaryExpression | PropertyAccessExpression;
interface JsxAttributes extends ObjectLiteralExpressionBase {
- parent?: JsxOpeningLikeElement;
+ parent: JsxOpeningLikeElement;
}
interface JsxOpeningElement extends Expression {
kind: SyntaxKind.JsxOpeningElement;
- parent?: JsxElement;
+ parent: JsxElement;
tagName: JsxTagNameExpression;
typeArguments?: NodeArray;
attributes: JsxAttributes;
@@ -1113,38 +1114,38 @@ declare namespace ts {
}
interface JsxOpeningFragment extends Expression {
kind: SyntaxKind.JsxOpeningFragment;
- parent?: JsxFragment;
+ parent: JsxFragment;
}
interface JsxClosingFragment extends Expression {
kind: SyntaxKind.JsxClosingFragment;
- parent?: JsxFragment;
+ parent: JsxFragment;
}
interface JsxAttribute extends ObjectLiteralElement {
kind: SyntaxKind.JsxAttribute;
- parent?: JsxAttributes;
+ parent: JsxAttributes;
name: Identifier;
initializer?: StringLiteral | JsxExpression;
}
interface JsxSpreadAttribute extends ObjectLiteralElement {
kind: SyntaxKind.JsxSpreadAttribute;
- parent?: JsxAttributes;
+ parent: JsxAttributes;
expression: Expression;
}
interface JsxClosingElement extends Node {
kind: SyntaxKind.JsxClosingElement;
- parent?: JsxElement;
+ parent: JsxElement;
tagName: JsxTagNameExpression;
}
interface JsxExpression extends Expression {
kind: SyntaxKind.JsxExpression;
- parent?: JsxElement | JsxAttributeLike;
+ parent: JsxElement | JsxAttributeLike;
dotDotDotToken?: Token;
expression?: Expression;
}
interface JsxText extends Node {
kind: SyntaxKind.JsxText;
containsOnlyWhiteSpaces: boolean;
- parent?: JsxElement;
+ parent: JsxElement;
}
type JsxChild = JsxText | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment;
interface Statement extends Node {
@@ -1245,18 +1246,18 @@ declare namespace ts {
}
interface CaseBlock extends Node {
kind: SyntaxKind.CaseBlock;
- parent?: SwitchStatement;
+ parent: SwitchStatement;
clauses: NodeArray;
}
interface CaseClause extends Node {
kind: SyntaxKind.CaseClause;
- parent?: CaseBlock;
+ parent: CaseBlock;
expression: Expression;
statements: NodeArray;
}
interface DefaultClause extends Node {
kind: SyntaxKind.DefaultClause;
- parent?: CaseBlock;
+ parent: CaseBlock;
statements: NodeArray;
}
type CaseOrDefaultClause = CaseClause | DefaultClause;
@@ -1267,7 +1268,7 @@ declare namespace ts {
}
interface ThrowStatement extends Statement {
kind: SyntaxKind.ThrowStatement;
- expression: Expression;
+ expression?: Expression;
}
interface TryStatement extends Statement {
kind: SyntaxKind.TryStatement;
@@ -1277,7 +1278,7 @@ declare namespace ts {
}
interface CatchClause extends Node {
kind: SyntaxKind.CatchClause;
- parent?: TryStatement;
+ parent: TryStatement;
variableDeclaration?: VariableDeclaration;
block: Block;
}
@@ -1317,7 +1318,7 @@ declare namespace ts {
}
interface HeritageClause extends Node {
kind: SyntaxKind.HeritageClause;
- parent?: InterfaceDeclaration | ClassLikeDeclaration;
+ parent: InterfaceDeclaration | ClassLikeDeclaration;
token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword;
types: NodeArray;
}
@@ -1329,7 +1330,7 @@ declare namespace ts {
}
interface EnumMember extends NamedDeclaration, JSDocContainer {
kind: SyntaxKind.EnumMember;
- parent?: EnumDeclaration;
+ parent: EnumDeclaration;
name: PropertyName;
initializer?: Expression;
}
@@ -1342,7 +1343,7 @@ declare namespace ts {
type ModuleBody = NamespaceBody | JSDocNamespaceBody;
interface ModuleDeclaration extends DeclarationStatement, JSDocContainer {
kind: SyntaxKind.ModuleDeclaration;
- parent?: ModuleBody | SourceFile;
+ parent: ModuleBody | SourceFile;
name: ModuleName;
body?: ModuleBody | JSDocNamespaceDeclaration;
}
@@ -1354,11 +1355,11 @@ declare namespace ts {
type JSDocNamespaceBody = Identifier | JSDocNamespaceDeclaration;
interface JSDocNamespaceDeclaration extends ModuleDeclaration {
name: Identifier;
- body: JSDocNamespaceBody;
+ body?: JSDocNamespaceBody;
}
interface ModuleBlock extends Node, Statement {
kind: SyntaxKind.ModuleBlock;
- parent?: ModuleDeclaration;
+ parent: ModuleDeclaration;
statements: NodeArray;
}
type ModuleReference = EntityName | ExternalModuleReference;
@@ -1369,18 +1370,18 @@ declare namespace ts {
*/
interface ImportEqualsDeclaration extends DeclarationStatement, JSDocContainer {
kind: SyntaxKind.ImportEqualsDeclaration;
- parent?: SourceFile | ModuleBlock;
+ parent: SourceFile | ModuleBlock;
name: Identifier;
moduleReference: ModuleReference;
}
interface ExternalModuleReference extends Node {
kind: SyntaxKind.ExternalModuleReference;
- parent?: ImportEqualsDeclaration;
- expression?: Expression;
+ parent: ImportEqualsDeclaration;
+ expression: Expression;
}
interface ImportDeclaration extends Statement {
kind: SyntaxKind.ImportDeclaration;
- parent?: SourceFile | ModuleBlock;
+ parent: SourceFile | ModuleBlock;
importClause?: ImportClause;
/** If this is not a StringLiteral it will be a grammar error. */
moduleSpecifier: Expression;
@@ -1388,13 +1389,13 @@ declare namespace ts {
type NamedImportBindings = NamespaceImport | NamedImports;
interface ImportClause extends NamedDeclaration {
kind: SyntaxKind.ImportClause;
- parent?: ImportDeclaration;
+ parent: ImportDeclaration;
name?: Identifier;
namedBindings?: NamedImportBindings;
}
interface NamespaceImport extends NamedDeclaration {
kind: SyntaxKind.NamespaceImport;
- parent?: ImportClause;
+ parent: ImportClause;
name: Identifier;
}
interface NamespaceExportDeclaration extends DeclarationStatement {
@@ -1403,7 +1404,7 @@ declare namespace ts {
}
interface ExportDeclaration extends DeclarationStatement {
kind: SyntaxKind.ExportDeclaration;
- parent?: SourceFile | ModuleBlock;
+ parent: SourceFile | ModuleBlock;
/** Will not be assigned in the case of `export * from "foo";` */
exportClause?: NamedExports;
/** If this is not a StringLiteral it will be a grammar error. */
@@ -1411,24 +1412,24 @@ declare namespace ts {
}
interface NamedImports extends Node {
kind: SyntaxKind.NamedImports;
- parent?: ImportClause;
+ parent: ImportClause;
elements: NodeArray;
}
interface NamedExports extends Node {
kind: SyntaxKind.NamedExports;
- parent?: ExportDeclaration;
+ parent: ExportDeclaration;
elements: NodeArray;
}
type NamedImportsOrExports = NamedImports | NamedExports;
interface ImportSpecifier extends NamedDeclaration {
kind: SyntaxKind.ImportSpecifier;
- parent?: NamedImports;
+ parent: NamedImports;
propertyName?: Identifier;
name: Identifier;
}
interface ExportSpecifier extends NamedDeclaration {
kind: SyntaxKind.ExportSpecifier;
- parent?: NamedExports;
+ parent: NamedExports;
propertyName?: Identifier;
name: Identifier;
}
@@ -1439,7 +1440,7 @@ declare namespace ts {
*/
interface ExportAssignment extends DeclarationStatement {
kind: SyntaxKind.ExportAssignment;
- parent?: SourceFile;
+ parent: SourceFile;
isExportEquals?: boolean;
expression: Expression;
}
@@ -1494,15 +1495,15 @@ declare namespace ts {
type JSDocTypeReferencingNode = JSDocVariadicType | JSDocOptionalType | JSDocNullableType | JSDocNonNullableType;
interface JSDoc extends Node {
kind: SyntaxKind.JSDocComment;
- parent?: HasJSDoc;
- tags: NodeArray | undefined;
- comment: string | undefined;
+ parent: HasJSDoc;
+ tags?: NodeArray;
+ comment?: string;
}
interface JSDocTag extends Node {
parent: JSDoc | JSDocTypeLiteral;
atToken: AtToken;
tagName: Identifier;
- comment: string | undefined;
+ comment?: string;
}
interface JSDocUnknownTag extends JSDocTag {
kind: SyntaxKind.JSDocTag;
@@ -1526,11 +1527,11 @@ declare namespace ts {
}
interface JSDocReturnTag extends JSDocTag {
kind: SyntaxKind.JSDocReturnTag;
- typeExpression: JSDocTypeExpression;
+ typeExpression?: JSDocTypeExpression;
}
interface JSDocTypeTag extends JSDocTag {
kind: SyntaxKind.JSDocTypeTag;
- typeExpression: JSDocTypeExpression;
+ typeExpression?: JSDocTypeExpression;
}
interface JSDocTypedefTag extends JSDocTag, NamedDeclaration {
parent: JSDoc;
@@ -1608,7 +1609,7 @@ declare namespace ts {
container?: FunctionExpression | ArrowFunction | MethodDeclaration;
}
interface FlowLabel extends FlowNodeBase {
- antecedents: FlowNode[];
+ antecedents: FlowNode[] | undefined;
}
interface FlowAssignment extends FlowNodeBase {
node: Expression | VariableDeclaration | BindingElement;
@@ -1635,7 +1636,7 @@ declare namespace ts {
}
interface AmdDependency {
path: string;
- name: string;
+ name?: string;
}
interface SourceFile extends Declaration {
kind: SyntaxKind.SourceFile;
@@ -1644,7 +1645,7 @@ declare namespace ts {
fileName: string;
text: string;
amdDependencies: ReadonlyArray;
- moduleName: string;
+ moduleName?: string;
referencedFiles: ReadonlyArray;
typeReferenceDirectives: ReadonlyArray;
languageVariant: LanguageVariant;
@@ -1704,7 +1705,7 @@ declare namespace ts {
fileExists(path: string): boolean;
readFile(path: string): string | undefined;
}
- type WriteFileCallback = (fileName: string, data: string, writeByteOrderMark: boolean, onError: ((message: string) => void) | undefined, sourceFiles: ReadonlyArray) => void;
+ type WriteFileCallback = (fileName: string, data: string, writeByteOrderMark: boolean, onError: ((message: string) => void) | undefined, sourceFiles?: ReadonlyArray) => void;
class OperationCanceledException {
}
interface CancellationToken {
@@ -1734,9 +1735,10 @@ declare namespace ts {
emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult;
getOptionsDiagnostics(cancellationToken?: CancellationToken): ReadonlyArray;
getGlobalDiagnostics(cancellationToken?: CancellationToken): ReadonlyArray;
- getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray;
+ getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray;
+ /** The first time this is called, it will return global diagnostics (no location). */
getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray;
- getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray;
+ getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray;
getConfigFileParsingDiagnostics(): ReadonlyArray;
/**
* Gets a type checker that can be used to semantically analyze source files in the program.
@@ -1793,7 +1795,7 @@ declare namespace ts {
emitSkipped: boolean;
/** Contains declaration emit diagnostics */
diagnostics: ReadonlyArray;
- emittedFiles: string[];
+ emittedFiles?: string[];
}
interface TypeChecker {
getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type;
@@ -1810,7 +1812,7 @@ declare namespace ts {
getNullableType(type: Type, flags: TypeFlags): Type;
getNonNullableType(type: Type): Type;
/** Note that the resulting nodes cannot be checked. */
- typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): TypeNode;
+ typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): TypeNode | undefined;
/** Note that the resulting nodes cannot be checked. */
signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): (SignatureDeclaration & {
typeArguments?: NodeArray;
@@ -1846,7 +1848,7 @@ declare namespace ts {
*/
getExportSymbolOfSymbol(symbol: Symbol): Symbol;
getPropertySymbolOfDestructuringAssignment(location: Identifier): Symbol | undefined;
- getTypeAtLocation(node: Node): Type;
+ getTypeAtLocation(node: Node): Type | undefined;
getTypeFromTypeNode(node: TypeNode): Type;
signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string;
typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string;
@@ -1863,9 +1865,10 @@ declare namespace ts {
getContextualType(node: Expression): Type | undefined;
/**
* returns unknownSignature in the case of an error.
+ * returns undefined if the node is not valid.
* @param argumentCount Apparent number of arguments, passed in case of a possibly incomplete call. This should come from an ArgumentListInfo. See `signatureHelp.ts`.
*/
- getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[], argumentCount?: number): Signature;
+ getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[], argumentCount?: number): Signature | undefined;
getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature | undefined;
isImplementationOfOverload(node: SignatureDeclaration): boolean | undefined;
isUndefinedSymbol(symbol: Symbol): boolean;
@@ -2069,8 +2072,8 @@ declare namespace ts {
interface Symbol {
flags: SymbolFlags;
escapedName: __String;
- declarations?: Declaration[];
- valueDeclaration?: Declaration;
+ declarations: Declaration[];
+ valueDeclaration: Declaration;
members?: SymbolTable;
exports?: SymbolTable;
globalExports?: SymbolTable;
@@ -2126,61 +2129,62 @@ declare namespace ts {
type SymbolTable = UnderscoreEscapedMap;
enum TypeFlags {
Any = 1,
- String = 2,
- Number = 4,
- Boolean = 8,
- Enum = 16,
- StringLiteral = 32,
- NumberLiteral = 64,
- BooleanLiteral = 128,
- EnumLiteral = 256,
- ESSymbol = 512,
- UniqueESSymbol = 1024,
- Void = 2048,
- Undefined = 4096,
- Null = 8192,
- Never = 16384,
- TypeParameter = 32768,
- Object = 65536,
- Union = 131072,
- Intersection = 262144,
- Index = 524288,
- IndexedAccess = 1048576,
- Conditional = 2097152,
- Substitution = 4194304,
- NonPrimitive = 134217728,
- Literal = 224,
- Unit = 13536,
- StringOrNumberLiteral = 96,
- PossiblyFalsy = 14574,
- StringLike = 34,
- NumberLike = 84,
- BooleanLike = 136,
- EnumLike = 272,
- ESSymbolLike = 1536,
- VoidLike = 6144,
- UnionOrIntersection = 393216,
- StructuredType = 458752,
- TypeVariable = 1081344,
- InstantiableNonPrimitive = 7372800,
- InstantiablePrimitive = 524288,
- Instantiable = 7897088,
- StructuredOrInstantiable = 8355840,
- Narrowable = 142575359,
- NotUnionOrUnit = 134283777
+ Unknown = 2,
+ String = 4,
+ Number = 8,
+ Boolean = 16,
+ Enum = 32,
+ StringLiteral = 64,
+ NumberLiteral = 128,
+ BooleanLiteral = 256,
+ EnumLiteral = 512,
+ ESSymbol = 1024,
+ UniqueESSymbol = 2048,
+ Void = 4096,
+ Undefined = 8192,
+ Null = 16384,
+ Never = 32768,
+ TypeParameter = 65536,
+ Object = 131072,
+ Union = 262144,
+ Intersection = 524288,
+ Index = 1048576,
+ IndexedAccess = 2097152,
+ Conditional = 4194304,
+ Substitution = 8388608,
+ NonPrimitive = 16777216,
+ Literal = 448,
+ Unit = 27072,
+ StringOrNumberLiteral = 192,
+ PossiblyFalsy = 29148,
+ StringLike = 68,
+ NumberLike = 168,
+ BooleanLike = 272,
+ EnumLike = 544,
+ ESSymbolLike = 3072,
+ VoidLike = 12288,
+ UnionOrIntersection = 786432,
+ StructuredType = 917504,
+ TypeVariable = 2162688,
+ InstantiableNonPrimitive = 14745600,
+ InstantiablePrimitive = 1048576,
+ Instantiable = 15794176,
+ StructuredOrInstantiable = 16711680,
+ Narrowable = 33492479,
+ NotUnionOrUnit = 16909315
}
type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression;
interface Type {
flags: TypeFlags;
- symbol?: Symbol;
+ symbol: Symbol;
pattern?: DestructuringPattern;
aliasSymbol?: Symbol;
aliasTypeArguments?: Type[];
}
interface LiteralType extends Type {
value: string | number;
- freshType?: LiteralType;
- regularType?: LiteralType;
+ freshType: LiteralType;
+ regularType: LiteralType;
}
interface UniqueESSymbolType extends Type {
symbol: Symbol;
@@ -2215,18 +2219,18 @@ declare namespace ts {
}
/** Class and interface types (ObjectFlags.Class and ObjectFlags.Interface). */
interface InterfaceType extends ObjectType {
- typeParameters: TypeParameter[];
- outerTypeParameters: TypeParameter[];
- localTypeParameters: TypeParameter[];
- thisType: TypeParameter;
+ typeParameters: TypeParameter[] | undefined;
+ outerTypeParameters: TypeParameter[] | undefined;
+ localTypeParameters: TypeParameter[] | undefined;
+ thisType: TypeParameter | undefined;
}
type BaseType = ObjectType | IntersectionType;
interface InterfaceTypeWithDeclaredMembers extends InterfaceType {
declaredProperties: Symbol[];
declaredCallSignatures: Signature[];
declaredConstructSignatures: Signature[];
- declaredStringIndexInfo: IndexInfo;
- declaredNumberIndexInfo: IndexInfo;
+ declaredStringIndexInfo?: IndexInfo;
+ declaredNumberIndexInfo?: IndexInfo;
}
/**
* Type references (ObjectFlags.Reference). When a class or interface has type parameters or
@@ -2277,11 +2281,11 @@ declare namespace ts {
trueType: Type;
falseType: Type;
isDistributive: boolean;
- inferTypeParameters: TypeParameter[];
+ inferTypeParameters?: TypeParameter[];
outerTypeParameters?: TypeParameter[];
instantiations?: Map;
- aliasSymbol: Symbol;
- aliasTypeArguments: Type[];
+ aliasSymbol?: Symbol;
+ aliasTypeArguments?: Type[];
}
interface ConditionalType extends InstantiableType {
root: ConditionalRoot;
@@ -2359,6 +2363,11 @@ declare namespace ts {
code: number;
source?: string;
}
+ interface DiagnosticWithLocation extends Diagnostic {
+ file: SourceFile;
+ start: number;
+ length: number;
+ }
enum DiagnosticCategory {
Warning = 0,
Error = 1,
@@ -2624,7 +2633,7 @@ declare namespace ts {
packageId?: PackageId;
}
interface ResolvedTypeReferenceDirectiveWithFailedLookupLocations {
- readonly resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective;
+ readonly resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | undefined;
readonly failedLookupLocations: ReadonlyArray;
}
interface CompilerHost extends ModuleResolutionHost {
@@ -2644,8 +2653,8 @@ declare namespace ts {
/**
* This method is a companion for 'resolveModuleNames' and is used to resolve 'types' references to actual type declaration files
*/
- resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string): (ResolvedTypeReferenceDirective | undefined)[];
- getEnvironmentVariable?(name: string): string;
+ resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[];
+ getEnvironmentVariable?(name: string): string | undefined;
createHash?(data: string): string;
}
interface SourceMapRange extends TextRange {
@@ -2657,6 +2666,7 @@ declare namespace ts {
skipTrivia?: (pos: number) => number;
}
enum EmitFlags {
+ None = 0,
SingleLine = 1,
AdviseOnEmitNode = 2,
NoSubstitution = 4,
@@ -2710,7 +2720,7 @@ declare namespace ts {
/** Resumes a suspended lexical environment, usually before visiting a function body. */
resumeLexicalEnvironment(): void;
/** Ends a lexical environment, returning any declarations. */
- endLexicalEnvironment(): Statement[];
+ endLexicalEnvironment(): Statement[] | undefined;
/** Hoists a function declaration to the containing scope. */
hoistFunctionDeclaration(node: FunctionDeclaration): void;
/** Hoists a variable declaration to the containing scope. */
@@ -2754,7 +2764,7 @@ declare namespace ts {
/** Gets the transformed source files. */
transformed: T[];
/** Gets diagnostics for the transformation. */
- diagnostics?: Diagnostic[];
+ diagnostics?: DiagnosticWithLocation[];
/**
* Gets a substitute for a node, if one is available; otherwise, returns the original node.
*
@@ -2841,7 +2851,7 @@ declare namespace ts {
* });
* ```
*/
- onEmitNode?(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void;
+ onEmitNode?(hint: EmitHint, node: Node | undefined, emitCallback: (hint: EmitHint, node: Node | undefined) => void): void;
/**
* A hook used by the Printer to perform just-in-time substitution of a node. This is
* primarily used by node transformations that need to substitute one node for another,
@@ -2954,13 +2964,13 @@ declare namespace ts {
}
}
declare namespace ts {
- const versionMajorMinor = "2.9";
+ const versionMajorMinor = "3.0";
/** The version of the TypeScript compiler release */
const version: string;
}
declare namespace ts {
function isExternalModuleNameRelative(moduleName: string): boolean;
- function sortAndDeduplicateDiagnostics(diagnostics: ReadonlyArray): Diagnostic[];
+ function sortAndDeduplicateDiagnostics(diagnostics: ReadonlyArray): T[];
}
declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any;
declare function clearTimeout(handle: any): void;
@@ -3014,7 +3024,7 @@ declare namespace ts {
interface FileWatcher {
close(): void;
}
- function getNodeMajorVersion(): number;
+ function getNodeMajorVersion(): number | undefined;
let sys: System;
}
declare namespace ts {
@@ -3041,8 +3051,8 @@ declare namespace ts {
scanJSDocToken(): JsDocSyntaxKind;
scan(): SyntaxKind;
getText(): string;
- setText(text: string, start?: number, length?: number): void;
- setOnError(onError: ErrorCallback): void;
+ setText(text: string | undefined, start?: number, length?: number): void;
+ setOnError(onError: ErrorCallback | undefined): void;
setScriptTarget(scriptTarget: ScriptTarget): void;
setLanguageVariant(variant: LanguageVariant): void;
setTextPos(textPos: number): void;
@@ -3062,15 +3072,15 @@ declare namespace ts {
function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined;
function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined;
function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined;
- function reduceEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U;
- function reduceEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U;
+ function reduceEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U | undefined;
+ function reduceEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U | undefined;
function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined;
function getTrailingCommentRanges(text: string, pos: number): CommentRange[] | undefined;
/** Optionally, get the shebang */
function getShebang(text: string): string | undefined;
- function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean;
- function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean;
- function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, text?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner;
+ function isIdentifierStart(ch: number, languageVersion: ScriptTarget | undefined): boolean;
+ function isIdentifierPart(ch: number, languageVersion: ScriptTarget | undefined): boolean;
+ function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, textInitial?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner;
}
declare namespace ts {
function getDefaultLibFileName(options: CompilerOptions): string;
@@ -3079,12 +3089,12 @@ declare namespace ts {
function textSpanContainsPosition(span: TextSpan, position: number): boolean;
function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean;
function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean;
- function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan;
+ function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan | undefined;
function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): boolean;
function textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean;
function decodedTextSpanIntersectsWith(start1: number, length1: number, start2: number, length2: number): boolean;
function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean;
- function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan;
+ function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan | undefined;
function createTextSpan(start: number, length: number): TextSpan;
function createTextSpanFromBounds(start: number, end: number): TextSpan;
function textChangeRangeNewSpan(range: TextChangeRange): TextSpan;
@@ -3100,7 +3110,7 @@ declare namespace ts {
* Vn.
*/
function collapseTextChangeRangesAcrossMultipleVersions(changes: ReadonlyArray): TextChangeRange;
- function getTypeParameterOwner(d: Declaration): Declaration;
+ function getTypeParameterOwner(d: Declaration): Declaration | undefined;
type ParameterPropertyDeclaration = ParameterDeclaration & {
parent: ConstructorDeclaration;
name: Identifier;
@@ -3122,6 +3132,8 @@ declare namespace ts {
}, errors?: Push): void;
function getOriginalNode(node: Node): Node;
function getOriginalNode(node: Node, nodeTest: (node: Node) => node is T): T;
+ function getOriginalNode(node: Node | undefined): Node | undefined;
+ function getOriginalNode(node: Node | undefined, nodeTest: (node: Node | undefined) => node is T): T | undefined;
/**
* Gets a value indicating whether a node originated in the parse tree.
*
@@ -3142,7 +3154,7 @@ declare namespace ts {
* @param nodeTest A callback used to ensure the correct type of parse tree node is returned.
* @returns The original parse tree node if found; otherwise, undefined.
*/
- function getParseTreeNode(node: Node, nodeTest?: (node: Node) => node is T): T;
+ function getParseTreeNode(node: Node | undefined, nodeTest?: (node: Node) => node is T): T | undefined;
/**
* Remove extra underscore from escaped identifier text content.
*
@@ -3160,7 +3172,7 @@ declare namespace ts {
*/
function unescapeIdentifier(id: string): string;
function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | undefined;
- function getNameOfDeclaration(declaration: Declaration | Expression): DeclarationName | undefined;
+ function getNameOfDeclaration(declaration: Declaration | Expression): DeclarationName;
/**
* Gets the JSDoc parameter tags for the node if present.
*
@@ -3389,8 +3401,10 @@ declare namespace ts {
*/
function isToken(n: Node): boolean;
function isLiteralExpression(node: Node): node is LiteralExpression;
+ type TemplateLiteralToken = NoSubstitutionTemplateLiteral | TemplateHead | TemplateMiddle | TemplateTail;
+ function isTemplateLiteralToken(node: Node): node is TemplateLiteralToken;
function isTemplateMiddleOrTemplateTail(node: Node): node is TemplateMiddle | TemplateTail;
- function isStringTextContainingNode(node: Node): boolean;
+ function isStringTextContainingNode(node: Node): node is StringLiteral | TemplateLiteralToken;
function isModifier(node: Node): node is Modifier;
function isEntityName(node: Node): node is EntityName;
function isPropertyName(node: Node): node is PropertyName;
@@ -3442,7 +3456,7 @@ declare namespace ts {
*/
function forEachChild(node: Node, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray) => T | undefined): T | undefined;
function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean, scriptKind?: ScriptKind): SourceFile;
- function parseIsolatedEntityName(text: string, languageVersion: ScriptTarget): EntityName;
+ function parseIsolatedEntityName(text: string, languageVersion: ScriptTarget): EntityName | undefined;
/**
* Parse json text into SyntaxTree and return node and parse errors if any
* @param fileName
@@ -3488,7 +3502,7 @@ declare namespace ts {
getOrCreateCacheForModuleName(nonRelativeModuleName: string): PerModuleNameCache;
}
interface PerModuleNameCache {
- get(directory: string): ResolvedModuleWithFailedLookupLocations;
+ get(directory: string): ResolvedModuleWithFailedLookupLocations | undefined;
set(directory: string, result: ResolvedModuleWithFailedLookupLocations): void;
}
function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string): ModuleResolutionCache;
@@ -3570,7 +3584,7 @@ declare namespace ts {
function updateConstructorTypeNode(node: ConstructorTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): ConstructorTypeNode;
function createTypeQueryNode(exprName: EntityName): TypeQueryNode;
function updateTypeQueryNode(node: TypeQueryNode, exprName: EntityName): TypeQueryNode;
- function createTypeLiteralNode(members: ReadonlyArray): TypeLiteralNode;
+ function createTypeLiteralNode(members: ReadonlyArray | undefined): TypeLiteralNode;
function updateTypeLiteralNode(node: TypeLiteralNode, members: NodeArray): TypeLiteralNode;
function createArrayTypeNode(elementType: TypeNode): ArrayTypeNode;
function updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode;
@@ -3609,23 +3623,23 @@ declare namespace ts {
function updateArrayLiteral(node: ArrayLiteralExpression, elements: ReadonlyArray): ArrayLiteralExpression;
function createObjectLiteral(properties?: ReadonlyArray, multiLine?: boolean): ObjectLiteralExpression;
function updateObjectLiteral(node: ObjectLiteralExpression, properties: ReadonlyArray): ObjectLiteralExpression;
- function createPropertyAccess(expression: Expression, name: string | Identifier): PropertyAccessExpression;
+ function createPropertyAccess(expression: Expression, name: string | Identifier | undefined): PropertyAccessExpression;
function updatePropertyAccess(node: PropertyAccessExpression, expression: Expression, name: Identifier): PropertyAccessExpression;
function createElementAccess(expression: Expression, index: number | Expression): ElementAccessExpression;
function updateElementAccess(node: ElementAccessExpression, expression: Expression, argumentExpression: Expression): ElementAccessExpression;
- function createCall(expression: Expression, typeArguments: ReadonlyArray | undefined, argumentsArray: ReadonlyArray): CallExpression;
+ function createCall(expression: Expression, typeArguments: ReadonlyArray | undefined, argumentsArray: ReadonlyArray | undefined): CallExpression;
function updateCall(node: CallExpression, expression: Expression, typeArguments: ReadonlyArray | undefined, argumentsArray: ReadonlyArray): CallExpression;
function createNew(expression: Expression, typeArguments: ReadonlyArray | undefined, argumentsArray: ReadonlyArray | undefined): NewExpression;
function updateNew(node: NewExpression, expression: Expression, typeArguments: ReadonlyArray | undefined, argumentsArray: ReadonlyArray | undefined): NewExpression;
function createTaggedTemplate(tag: Expression, template: TemplateLiteral): TaggedTemplateExpression;
- function createTaggedTemplate(tag: Expression, typeArguments: ReadonlyArray, template: TemplateLiteral): TaggedTemplateExpression;
+ function createTaggedTemplate(tag: Expression, typeArguments: ReadonlyArray | undefined, template: TemplateLiteral): TaggedTemplateExpression;
function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression;
- function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, typeArguments: ReadonlyArray, template: TemplateLiteral): TaggedTemplateExpression;
+ function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, typeArguments: ReadonlyArray | undefined, template: TemplateLiteral): TaggedTemplateExpression;
function createTypeAssertion(type: TypeNode, expression: Expression): TypeAssertion;
function updateTypeAssertion(node: TypeAssertion, type: TypeNode, expression: Expression): TypeAssertion;
function createParen(expression: Expression): ParenthesizedExpression;
function updateParen(node: ParenthesizedExpression, expression: Expression): ParenthesizedExpression;
- function createFunctionExpression(modifiers: ReadonlyArray | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, body: Block): FunctionExpression;
+ function createFunctionExpression(modifiers: ReadonlyArray | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray | undefined, type: TypeNode | undefined, body: Block): FunctionExpression;
function updateFunctionExpression(node: FunctionExpression, modifiers: ReadonlyArray | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, body: Block): FunctionExpression;
function createArrowFunction(modifiers: ReadonlyArray | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction;
function updateArrowFunction(node: ArrowFunction, modifiers: ReadonlyArray | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, body: ConciseBody): ArrowFunction;
@@ -3655,15 +3669,15 @@ declare namespace ts {
function createTemplateTail(text: string): TemplateTail;
function createNoSubstitutionTemplateLiteral(text: string): NoSubstitutionTemplateLiteral;
function createYield(expression?: Expression): YieldExpression;
- function createYield(asteriskToken: AsteriskToken, expression: Expression): YieldExpression;
+ function createYield(asteriskToken: AsteriskToken | undefined, expression: Expression): YieldExpression;
function updateYield(node: YieldExpression, asteriskToken: AsteriskToken | undefined, expression: Expression): YieldExpression;
function createSpread(expression: Expression): SpreadElement;
function updateSpread(node: SpreadElement, expression: Expression): SpreadElement;
- function createClassExpression(modifiers: ReadonlyArray | undefined, name: string | Identifier | undefined, typeParameters: ReadonlyArray | undefined, heritageClauses: ReadonlyArray, members: ReadonlyArray): ClassExpression;
- function updateClassExpression(node: ClassExpression, modifiers: ReadonlyArray | undefined, name: Identifier | undefined, typeParameters: ReadonlyArray | undefined, heritageClauses: ReadonlyArray, members: ReadonlyArray): ClassExpression;
+ function createClassExpression(modifiers: ReadonlyArray | undefined, name: string | Identifier | undefined, typeParameters: ReadonlyArray | undefined, heritageClauses: ReadonlyArray | undefined, members: ReadonlyArray): ClassExpression;
+ function updateClassExpression(node: ClassExpression, modifiers: ReadonlyArray | undefined, name: Identifier | undefined, typeParameters: ReadonlyArray | undefined, heritageClauses: ReadonlyArray | undefined, members: ReadonlyArray): ClassExpression;
function createOmittedExpression(): OmittedExpression;
- function createExpressionWithTypeArguments(typeArguments: ReadonlyArray, expression: Expression): ExpressionWithTypeArguments;
- function updateExpressionWithTypeArguments(node: ExpressionWithTypeArguments, typeArguments: ReadonlyArray, expression: Expression): ExpressionWithTypeArguments;
+ function createExpressionWithTypeArguments(typeArguments: ReadonlyArray | undefined, expression: Expression): ExpressionWithTypeArguments;
+ function updateExpressionWithTypeArguments(node: ExpressionWithTypeArguments, typeArguments: ReadonlyArray | undefined, expression: Expression): ExpressionWithTypeArguments;
function createAsExpression(expression: Expression, type: TypeNode): AsExpression;
function updateAsExpression(node: AsExpression, expression: Expression, type: TypeNode): AsExpression;
function createNonNullExpression(expression: Expression): NonNullExpression;
@@ -3690,8 +3704,8 @@ declare namespace ts {
function updateFor(node: ForStatement, initializer: ForInitializer | undefined, condition: Expression | undefined, incrementor: Expression | undefined, statement: Statement): ForStatement;
function createForIn(initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement;
function updateForIn(node: ForInStatement, initializer: ForInitializer, expression: Expression, statement: Statement): ForInStatement;
- function createForOf(awaitModifier: AwaitKeywordToken, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement;
- function updateForOf(node: ForOfStatement, awaitModifier: AwaitKeywordToken, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement;
+ function createForOf(awaitModifier: AwaitKeywordToken | undefined, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement;
+ function updateForOf(node: ForOfStatement, awaitModifier: AwaitKeywordToken | undefined, initializer: ForInitializer, expression: Expression, statement: Statement): ForOfStatement;
function createContinue(label?: string | Identifier): ContinueStatement;
function updateContinue(node: ContinueStatement, label: Identifier | undefined): ContinueStatement;
function createBreak(label?: string | Identifier): BreakStatement;
@@ -3715,8 +3729,8 @@ declare namespace ts {
function updateVariableDeclarationList(node: VariableDeclarationList, declarations: ReadonlyArray): VariableDeclarationList;
function createFunctionDeclaration(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration;
function updateFunctionDeclaration(node: FunctionDeclaration, decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, body: Block | undefined): FunctionDeclaration;
- function createClassDeclaration(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | Identifier | undefined, typeParameters: ReadonlyArray | undefined, heritageClauses: ReadonlyArray, members: ReadonlyArray): ClassDeclaration;
- function updateClassDeclaration(node: ClassDeclaration, decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: Identifier | undefined, typeParameters: ReadonlyArray | undefined, heritageClauses: ReadonlyArray, members: ReadonlyArray): ClassDeclaration;
+ function createClassDeclaration(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | Identifier | undefined, typeParameters: ReadonlyArray | undefined, heritageClauses: ReadonlyArray | undefined, members: ReadonlyArray): ClassDeclaration;
+ function updateClassDeclaration(node: ClassDeclaration, decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: Identifier | undefined, typeParameters: ReadonlyArray | undefined, heritageClauses: ReadonlyArray | undefined, members: ReadonlyArray): ClassDeclaration;
function createInterfaceDeclaration(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | Identifier, typeParameters: ReadonlyArray | undefined, heritageClauses: ReadonlyArray | undefined, members: ReadonlyArray): InterfaceDeclaration;
function updateInterfaceDeclaration(node: InterfaceDeclaration, decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: Identifier, typeParameters: ReadonlyArray | undefined, heritageClauses: ReadonlyArray | undefined, members: ReadonlyArray): InterfaceDeclaration;
function createTypeAliasDeclaration(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | Identifier, typeParameters: ReadonlyArray | undefined, type: TypeNode): TypeAliasDeclaration;
@@ -3734,7 +3748,7 @@ declare namespace ts {
function createImportEqualsDeclaration(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
function updateImportEqualsDeclaration(node: ImportEqualsDeclaration, decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration;
function createImportDeclaration(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression): ImportDeclaration;
- function updateImportDeclaration(node: ImportDeclaration, decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression | undefined): ImportDeclaration;
+ function updateImportDeclaration(node: ImportDeclaration, decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression): ImportDeclaration;
function createImportClause(name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause;
function updateImportClause(node: ImportClause, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause;
function createNamespaceImport(name: Identifier): NamespaceImport;
@@ -3743,7 +3757,7 @@ declare namespace ts {
function updateNamedImports(node: NamedImports, elements: ReadonlyArray): NamedImports;
function createImportSpecifier(propertyName: Identifier | undefined, name: Identifier): ImportSpecifier;
function updateImportSpecifier(node: ImportSpecifier, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier;
- function createExportAssignment(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, isExportEquals: boolean, expression: Expression): ExportAssignment;
+ function createExportAssignment(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment;
function updateExportAssignment(node: ExportAssignment, decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, expression: Expression): ExportAssignment;
function createExportDeclaration(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, exportClause: NamedExports | undefined, moduleSpecifier?: Expression): ExportDeclaration;
function updateExportDeclaration(node: ExportDeclaration, decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, exportClause: NamedExports | undefined, moduleSpecifier: Expression | undefined): ExportDeclaration;
@@ -3873,16 +3887,16 @@ declare namespace ts {
*/
function setCommentRange(node: T, range: TextRange): T;
function getSyntheticLeadingComments(node: Node): SynthesizedComment[] | undefined;
- function setSyntheticLeadingComments(node: T, comments: SynthesizedComment[]): T;
+ function setSyntheticLeadingComments(node: T, comments: SynthesizedComment[] | undefined): T;
function addSyntheticLeadingComment(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T;
function getSyntheticTrailingComments(node: Node): SynthesizedComment[] | undefined;
- function setSyntheticTrailingComments(node: T, comments: SynthesizedComment[]): T;
+ function setSyntheticTrailingComments(node: T, comments: SynthesizedComment[] | undefined): T;
function addSyntheticTrailingComment(node: T, kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean): T;
function moveSyntheticComments(node: T, original: Node): T;
/**
* Gets the constant value to emit for an expression.
*/
- function getConstantValue(node: PropertyAccessExpression | ElementAccessExpression): string | number;
+ function getConstantValue(node: PropertyAccessExpression | ElementAccessExpression): string | number | undefined;
/**
* Sets the constant value to emit for an expression.
*/
@@ -3918,7 +3932,7 @@ declare namespace ts {
* @param test A callback to execute to verify the Node is valid.
* @param lift An optional callback to execute to lift a NodeArray into a valid Node.
*/
- function visitNode(node: T, visitor: Visitor, test?: (node: Node) => boolean, lift?: (node: NodeArray) => T): T;
+ function visitNode(node: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: NodeArray) => T): T;
/**
* Visits a Node using the supplied visitor, possibly returning a new Node in its place.
*
@@ -3927,7 +3941,7 @@ declare namespace ts {
* @param test A callback to execute to verify the Node is valid.
* @param lift An optional callback to execute to lift a NodeArray into a valid Node.
*/
- function visitNode(node: T | undefined, visitor: Visitor, test?: (node: Node) => boolean, lift?: (node: NodeArray) => T): T | undefined;
+ function visitNode(node: T | undefined, visitor: Visitor | undefined, test?: (node: Node) => boolean, lift?: (node: NodeArray) => T): T | undefined;
/**
* Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
*
@@ -3937,7 +3951,7 @@ declare namespace ts {
* @param start An optional value indicating the starting offset at which to start visiting.
* @param count An optional value indicating the maximum number of nodes to visit.
*/
- function visitNodes(nodes: NodeArray