diff --git a/.gitignore b/.gitignore index 2d740532d56..8e2c10d7b32 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,5 @@ scripts/debug.bat scripts/run.bat scripts/word2md.js scripts/ior.js +scripts/*.js.map coverage/ diff --git a/bin/lib.core.d.ts b/bin/lib.core.d.ts index 1d3ed6dca4c..00dc83fa80a 100644 --- a/bin/lib.core.d.ts +++ b/bin/lib.core.d.ts @@ -499,6 +499,10 @@ declare var Number: { POSITIVE_INFINITY: number; } +interface TemplateStringsArray extends Array { + raw: string[]; +} + interface Math { /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ E: number; diff --git a/bin/lib.d.ts b/bin/lib.d.ts index 8fb56ba3129..8890fab4284 100644 --- a/bin/lib.d.ts +++ b/bin/lib.d.ts @@ -499,6 +499,10 @@ declare var Number: { POSITIVE_INFINITY: number; } +interface TemplateStringsArray extends Array { + raw: string[]; +} + interface Math { /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ E: number; diff --git a/bin/tsc.js b/bin/tsc.js index 53e1047e852..7818785929e 100644 --- a/bin/tsc.js +++ b/bin/tsc.js @@ -13,1421 +13,6 @@ See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -var ts; -(function (ts) { - ts.Diagnostics = { - Unterminated_string_literal: { code: 1002, category: 1 /* Error */, key: "Unterminated string literal." }, - Identifier_expected: { code: 1003, category: 1 /* Error */, key: "Identifier expected." }, - _0_expected: { code: 1005, category: 1 /* Error */, key: "'{0}' expected." }, - A_file_cannot_have_a_reference_to_itself: { code: 1006, category: 1 /* Error */, key: "A file cannot have a reference to itself." }, - Trailing_comma_not_allowed: { code: 1009, category: 1 /* Error */, key: "Trailing comma not allowed." }, - Asterisk_Slash_expected: { code: 1010, category: 1 /* Error */, key: "'*/' expected." }, - Unexpected_token: { code: 1012, category: 1 /* Error */, key: "Unexpected token." }, - Catch_clause_parameter_cannot_have_a_type_annotation: { code: 1013, category: 1 /* Error */, key: "Catch clause parameter cannot have a type annotation." }, - A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1 /* Error */, key: "A rest parameter must be last in a parameter list." }, - Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: 1 /* Error */, key: "Parameter cannot have question mark and initializer." }, - A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: 1 /* Error */, key: "A required parameter cannot follow an optional parameter." }, - An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: 1 /* Error */, key: "An index signature cannot have a rest parameter." }, - An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: 1 /* Error */, key: "An index signature parameter cannot have an accessibility modifier." }, - An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: 1 /* Error */, key: "An index signature parameter cannot have a question mark." }, - An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: 1 /* Error */, key: "An index signature parameter cannot have an initializer." }, - An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1 /* Error */, key: "An index signature must have a type annotation." }, - An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1 /* Error */, key: "An index signature parameter must have a type annotation." }, - An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1 /* Error */, key: "An index signature parameter type must be 'string' or 'number'." }, - A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: 1 /* Error */, key: "A class or interface declaration can only have one 'extends' clause." }, - An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: 1 /* Error */, key: "An 'extends' clause must precede an 'implements' clause." }, - A_class_can_only_extend_a_single_class: { code: 1026, category: 1 /* Error */, key: "A class can only extend a single class." }, - A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: 1 /* Error */, key: "A class declaration can only have one 'implements' clause." }, - Accessibility_modifier_already_seen: { code: 1028, category: 1 /* Error */, key: "Accessibility modifier already seen." }, - _0_modifier_must_precede_1_modifier: { code: 1029, category: 1 /* Error */, key: "'{0}' modifier must precede '{1}' modifier." }, - _0_modifier_already_seen: { code: 1030, category: 1 /* Error */, key: "'{0}' modifier already seen." }, - _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a class element." }, - An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: 1 /* Error */, key: "An interface declaration cannot have an 'implements' clause." }, - super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: 1 /* Error */, key: "'super' must be followed by an argument list or member access." }, - Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1 /* Error */, key: "Only ambient modules can use quoted names." }, - Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1 /* Error */, key: "Statements are not allowed in ambient contexts." }, - A_function_implementation_cannot_be_declared_in_an_ambient_context: { code: 1037, category: 1 /* Error */, key: "A function implementation cannot be declared in an ambient context." }, - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: 1 /* Error */, key: "A 'declare' modifier cannot be used in an already ambient context." }, - Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: 1 /* Error */, key: "Initializers are not allowed in ambient contexts." }, - _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a module element." }, - A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an interface declaration." }, - A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: 1 /* Error */, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, - A_rest_parameter_cannot_be_optional: { code: 1047, category: 1 /* Error */, key: "A rest parameter cannot be optional." }, - A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: 1 /* Error */, key: "A rest parameter cannot have an initializer." }, - A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: 1 /* Error */, key: "A 'set' accessor must have exactly one parameter." }, - A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: 1 /* Error */, key: "A 'set' accessor cannot have an optional parameter." }, - A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1 /* Error */, key: "A 'set' accessor parameter cannot have an initializer." }, - A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1 /* Error */, key: "A 'set' accessor cannot have rest parameter." }, - A_get_accessor_cannot_have_parameters: { code: 1054, category: 1 /* Error */, key: "A 'get' accessor cannot have parameters." }, - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1 /* Error */, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, - Enum_member_must_have_initializer: { code: 1061, category: 1 /* Error */, key: "Enum member must have initializer." }, - An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1 /* Error */, key: "An export assignment cannot be used in an internal module." }, - Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1 /* Error */, key: "Ambient enum elements can only have integer literal initializers." }, - Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: 1 /* Error */, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, - A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an import declaration." }, - Invalid_reference_directive_syntax: { code: 1084, category: 1 /* Error */, key: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1 /* Error */, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, - An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: 1 /* Error */, key: "An accessor cannot be declared in an ambient context." }, - _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a constructor declaration." }, - _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a parameter." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: 1 /* Error */, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, - Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: 1 /* Error */, key: "Type parameters cannot appear on a constructor declaration." }, - Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: 1 /* Error */, key: "Type annotation cannot appear on a constructor declaration." }, - An_accessor_cannot_have_type_parameters: { code: 1094, category: 1 /* Error */, key: "An accessor cannot have type parameters." }, - A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: 1 /* Error */, key: "A 'set' accessor cannot have a return type annotation." }, - An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: 1 /* Error */, key: "An index signature must have exactly one parameter." }, - _0_list_cannot_be_empty: { code: 1097, category: 1 /* Error */, key: "'{0}' list cannot be empty." }, - Type_parameter_list_cannot_be_empty: { code: 1098, category: 1 /* Error */, key: "Type parameter list cannot be empty." }, - Type_argument_list_cannot_be_empty: { code: 1099, category: 1 /* Error */, key: "Type argument list cannot be empty." }, - Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1 /* Error */, key: "Invalid use of '{0}' in strict mode." }, - with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1 /* Error */, key: "'with' statements are not allowed in strict mode." }, - delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1 /* Error */, key: "'delete' cannot be called on an identifier in strict mode." }, - A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1 /* Error */, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, - A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1 /* Error */, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, - Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1 /* Error */, key: "Jump target cannot cross function boundary." }, - A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: 1 /* Error */, key: "A 'return' statement can only be used within a function body." }, - Expression_expected: { code: 1109, category: 1 /* Error */, key: "Expression expected." }, - Type_expected: { code: 1110, category: 1 /* Error */, key: "Type expected." }, - A_constructor_implementation_cannot_be_declared_in_an_ambient_context: { code: 1111, category: 1 /* Error */, key: "A constructor implementation cannot be declared in an ambient context." }, - A_class_member_cannot_be_declared_optional: { code: 1112, category: 1 /* Error */, key: "A class member cannot be declared optional." }, - A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: 1 /* Error */, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: 1 /* Error */, key: "Duplicate label '{0}'" }, - A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: 1 /* Error */, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, - A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: 1 /* Error */, key: "A 'break' statement can only jump to a label of an enclosing statement." }, - An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: 1 /* Error */, key: "An object literal cannot have multiple properties with the same name in strict mode." }, - An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: 1 /* Error */, key: "An object literal cannot have multiple get/set accessors with the same name." }, - An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: 1 /* Error */, key: "An object literal cannot have property and accessor with the same name." }, - An_export_assignment_cannot_have_modifiers: { code: 1120, category: 1 /* Error */, key: "An export assignment cannot have modifiers." }, - Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: 1 /* Error */, key: "Octal literals are not allowed in strict mode." }, - A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: 1 /* Error */, key: "A tuple type element list cannot be empty." }, - Variable_declaration_list_cannot_be_empty: { code: 1123, category: 1 /* Error */, key: "Variable declaration list cannot be empty." }, - Digit_expected: { code: 1124, category: 1 /* Error */, key: "Digit expected." }, - Hexadecimal_digit_expected: { code: 1125, category: 1 /* Error */, key: "Hexadecimal digit expected." }, - Unexpected_end_of_text: { code: 1126, category: 1 /* Error */, key: "Unexpected end of text." }, - Invalid_character: { code: 1127, category: 1 /* Error */, key: "Invalid character." }, - Declaration_or_statement_expected: { code: 1128, category: 1 /* Error */, key: "Declaration or statement expected." }, - Statement_expected: { code: 1129, category: 1 /* Error */, key: "Statement expected." }, - case_or_default_expected: { code: 1130, category: 1 /* Error */, key: "'case' or 'default' expected." }, - Property_or_signature_expected: { code: 1131, category: 1 /* Error */, key: "Property or signature expected." }, - Enum_member_expected: { code: 1132, category: 1 /* Error */, key: "Enum member expected." }, - Type_reference_expected: { code: 1133, category: 1 /* Error */, key: "Type reference expected." }, - Variable_declaration_expected: { code: 1134, category: 1 /* Error */, key: "Variable declaration expected." }, - Argument_expression_expected: { code: 1135, category: 1 /* Error */, key: "Argument expression expected." }, - Property_assignment_expected: { code: 1136, category: 1 /* Error */, key: "Property assignment expected." }, - Expression_or_comma_expected: { code: 1137, category: 1 /* Error */, key: "Expression or comma expected." }, - Parameter_declaration_expected: { code: 1138, category: 1 /* Error */, key: "Parameter declaration expected." }, - Type_parameter_declaration_expected: { code: 1139, category: 1 /* Error */, key: "Type parameter declaration expected." }, - Type_argument_expected: { code: 1140, category: 1 /* Error */, key: "Type argument expected." }, - String_literal_expected: { code: 1141, category: 1 /* Error */, key: "String literal expected." }, - Line_break_not_permitted_here: { code: 1142, category: 1 /* Error */, key: "Line break not permitted here." }, - catch_or_finally_expected: { code: 1143, category: 1 /* Error */, key: "'catch' or 'finally' expected." }, - Block_or_expected: { code: 1144, category: 1 /* Error */, key: "Block or ';' expected." }, - Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: 1 /* Error */, key: "Modifiers not permitted on index signature members." }, - Declaration_expected: { code: 1146, category: 1 /* Error */, key: "Declaration expected." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: 1 /* Error */, key: "Import declarations in an internal module cannot reference an external module." }, - Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: 1 /* Error */, key: "Cannot compile external modules unless the '--module' flag is provided." }, - Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: 1 /* Error */, key: "Filename '{0}' differs from already included filename '{1}' only in casing" }, - new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - var_let_or_const_expected: { code: 1152, category: 1 /* Error */, key: "'var', 'let' or 'const' expected." }, - let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: 1 /* Error */, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: 1 /* Error */, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_must_be_initialized: { code: 1155, category: 1 /* Error */, key: "'const' declarations must be initialized" }, - const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: 1 /* Error */, key: "'const' declarations can only be declared inside a block." }, - let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: 1 /* Error */, key: "'let' declarations can only be declared inside a block." }, - Invalid_template_literal_expected: { code: 1158, category: 1 /* Error */, key: "Invalid template literal; expected '}'" }, - Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1159, category: 1 /* Error */, key: "Tagged templates are only available when targeting ECMAScript 6 and higher." }, - Duplicate_identifier_0: { code: 2300, category: 1 /* Error */, key: "Duplicate identifier '{0}'." }, - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1 /* Error */, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, - Static_members_cannot_reference_class_type_parameters: { code: 2302, category: 1 /* Error */, key: "Static members cannot reference class type parameters." }, - Circular_definition_of_import_alias_0: { code: 2303, category: 1 /* Error */, key: "Circular definition of import alias '{0}'." }, - Cannot_find_name_0: { code: 2304, category: 1 /* Error */, key: "Cannot find name '{0}'." }, - Module_0_has_no_exported_member_1: { code: 2305, category: 1 /* Error */, key: "Module '{0}' has no exported member '{1}'." }, - File_0_is_not_an_external_module: { code: 2306, category: 1 /* Error */, key: "File '{0}' is not an external module." }, - Cannot_find_external_module_0: { code: 2307, category: 1 /* Error */, key: "Cannot find external module '{0}'." }, - A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: 1 /* Error */, key: "A module cannot have more than one export assignment." }, - An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: 1 /* Error */, key: "An export assignment cannot be used in a module with other exported elements." }, - Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: 1 /* Error */, key: "Type '{0}' recursively references itself as a base type." }, - A_class_may_only_extend_another_class: { code: 2311, category: 1 /* Error */, key: "A class may only extend another class." }, - An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: 1 /* Error */, key: "An interface may only extend a class or another interface." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: 1 /* Error */, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, - Generic_type_0_requires_1_type_argument_s: { code: 2314, category: 1 /* Error */, key: "Generic type '{0}' requires {1} type argument(s)." }, - Type_0_is_not_generic: { code: 2315, category: 1 /* Error */, key: "Type '{0}' is not generic." }, - Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: 1 /* Error */, key: "Global type '{0}' must be a class or interface type." }, - Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1 /* Error */, key: "Global type '{0}' must have {1} type parameter(s)." }, - Cannot_find_global_type_0: { code: 2318, category: 1 /* Error */, key: "Cannot find global type '{0}'." }, - Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1 /* Error */, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: 1 /* Error */, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, - Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1 /* Error */, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1: { code: 2323, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}'." }, - Property_0_is_missing_in_type_1: { code: 2324, category: 1 /* Error */, key: "Property '{0}' is missing in type '{1}'." }, - Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: 1 /* Error */, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, - Types_of_property_0_are_incompatible: { code: 2326, category: 1 /* Error */, key: "Types of property '{0}' are incompatible." }, - Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: 1 /* Error */, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, - Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible." }, - Index_signature_is_missing_in_type_0: { code: 2329, category: 1 /* Error */, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible: { code: 2330, category: 1 /* Error */, key: "Index signatures are incompatible." }, - this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1 /* Error */, key: "'this' cannot be referenced in a module body." }, - this_cannot_be_referenced_in_current_location: { code: 2332, category: 1 /* Error */, key: "'this' cannot be referenced in current location." }, - this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1 /* Error */, key: "'this' cannot be referenced in constructor arguments." }, - this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: 1 /* Error */, key: "'this' cannot be referenced in a static property initializer." }, - super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: 1 /* Error */, key: "'super' can only be referenced in a derived class." }, - super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: 1 /* Error */, key: "'super' cannot be referenced in constructor arguments." }, - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: 1 /* Error */, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: 1 /* Error */, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, - Property_0_does_not_exist_on_type_1: { code: 2339, category: 1 /* Error */, key: "Property '{0}' does not exist on type '{1}'." }, - Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1 /* Error */, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, - Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: 1 /* Error */, key: "Property '{0}' is private and only accessible within class '{1}'." }, - An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: 1 /* Error */, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}'." }, - Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1 /* Error */, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, - Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1 /* Error */, key: "Supplied parameters do not match any signature of call target." }, - Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: 1 /* Error */, key: "Untyped function calls may not accept type arguments." }, - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: 1 /* Error */, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: 1 /* Error */, key: "Cannot invoke an expression whose type lacks a call signature." }, - Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1 /* Error */, key: "Only a void function can be called with the 'new' keyword." }, - Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1 /* Error */, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1 /* Error */, key: "No best common type exists among return expressions." }, - A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1 /* Error */, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1 /* Error */, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: 1 /* Error */, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: 1 /* Error */, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: 1 /* Error */, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, - The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2360, category: 1 /* Error */, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: 1 /* Error */, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: 1 /* Error */, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: 1 /* Error */, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: 1 /* Error */, key: "Invalid left-hand side of assignment expression." }, - Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: 1 /* Error */, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: 1 /* Error */, key: "Type parameter name cannot be '{0}'" }, - A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: 1 /* Error */, key: "A parameter property is only allowed in a constructor implementation." }, - A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: 1 /* Error */, key: "A rest parameter must be of an array type." }, - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: 1 /* Error */, key: "A parameter initializer is only allowed in a function or constructor implementation." }, - Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: 1 /* Error */, key: "Parameter '{0}' cannot be referenced in its initializer." }, - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: 1 /* Error */, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, - Duplicate_string_index_signature: { code: 2374, category: 1 /* Error */, key: "Duplicate string index signature." }, - Duplicate_number_index_signature: { code: 2375, category: 1 /* Error */, key: "Duplicate number index signature." }, - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: 1 /* Error */, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, - Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: 1 /* Error */, key: "Constructors for derived classes must contain a 'super' call." }, - A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: 1 /* Error */, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, - Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: 1 /* Error */, key: "Getter and setter accessors do not agree in visibility." }, - get_and_set_accessor_must_have_the_same_type: { code: 2380, category: 1 /* Error */, key: "'get' and 'set' accessor must have the same type." }, - A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: 1 /* Error */, key: "A signature with an implementation cannot use a string literal type." }, - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: 1 /* Error */, key: "Specialized overload signature is not assignable to any non-specialized signature." }, - Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: 1 /* Error */, key: "Overload signatures must all be exported or not exported." }, - Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: 1 /* Error */, key: "Overload signatures must all be ambient or non-ambient." }, - Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: 1 /* Error */, key: "Overload signatures must all be public, private or protected." }, - Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: 1 /* Error */, key: "Overload signatures must all be optional or required." }, - Function_overload_must_be_static: { code: 2387, category: 1 /* Error */, key: "Function overload must be static." }, - Function_overload_must_not_be_static: { code: 2388, category: 1 /* Error */, key: "Function overload must not be static." }, - Function_implementation_name_must_be_0: { code: 2389, category: 1 /* Error */, key: "Function implementation name must be '{0}'." }, - Constructor_implementation_is_missing: { code: 2390, category: 1 /* Error */, key: "Constructor implementation is missing." }, - Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: 1 /* Error */, key: "Function implementation is missing or not immediately following the declaration." }, - Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: 1 /* Error */, key: "Multiple constructor implementations are not allowed." }, - Duplicate_function_implementation: { code: 2393, category: 1 /* Error */, key: "Duplicate function implementation." }, - Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: 1 /* Error */, key: "Overload signature is not compatible with function implementation." }, - Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: 1 /* Error */, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: 1 /* Error */, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, - Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: { code: 2397, category: 1 /* Error */, key: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter." }, - Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: { code: 2398, category: 1 /* Error */, key: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter." }, - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: 1 /* Error */, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: 1 /* Error */, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: 1 /* Error */, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: 1 /* Error */, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: 1 /* Error */, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, - The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, - The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, - Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: 1 /* Error */, key: "Invalid left-hand side in 'for...in' statement." }, - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: 1 /* Error */, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, - Setters_cannot_return_a_value: { code: 2408, category: 1 /* Error */, key: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: 1 /* Error */, key: "Return type of constructor signature must be assignable to the instance type of the class" }, - All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: 1 /* Error */, key: "All symbols within a 'with' block will be resolved to 'any'." }, - Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, - Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, - Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1 /* Error */, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: 1 /* Error */, key: "Class name cannot be '{0}'" }, - Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1 /* Error */, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, - Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}'." }, - A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1 /* Error */, key: "A class may only implement another class or interface." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: 1 /* Error */, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1 /* Error */, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: 1 /* Error */, key: "Interface name cannot be '{0}'" }, - All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1 /* Error */, key: "All declarations of an interface must have identical type parameters." }, - Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: 1 /* Error */, key: "Enum name cannot be '{0}'" }, - In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: 1 /* Error */, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: 1 /* Error */, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, - A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: 1 /* Error */, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, - Ambient_external_modules_cannot_be_nested_in_other_modules: { code: 2435, category: 1 /* Error */, key: "Ambient external modules cannot be nested in other modules." }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: 1 /* Error */, key: "Ambient external module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: 1 /* Error */, key: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: 1 /* Error */, key: "Import name cannot be '{0}'" }, - Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: 1 /* Error */, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: 1 /* Error */, key: "Import declaration conflicts with local declaration of '{0}'" }, - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { code: 2441, category: 1 /* Error */, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, - Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: 1 /* Error */, key: "Types have separate declarations of a private property '{0}'." }, - Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: 1 /* Error */, key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, - Property_0_is_protected_in_type_1_but_public_in_type_2: { code: 2444, category: 1 /* Error */, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, - Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, - Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, - The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: 1 /* Error */, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, - Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: 1 /* Error */, key: "Block-scoped variable '{0}' used before its declaration.", isEarly: true }, - The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: 1 /* Error */, key: "The operand of an increment or decrement operator cannot be a constant.", isEarly: true }, - Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: 1 /* Error */, key: "Left-hand side of assignment expression cannot be a constant.", isEarly: true }, - Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: 1 /* Error */, key: "Cannot redeclare block-scoped variable '{0}'.", isEarly: true }, - An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: 1 /* Error */, key: "An enum member cannot have a numeric name." }, - The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: 1 /* Error */, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, - Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: 1 /* Error */, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, - Type_alias_0_circularly_references_itself: { code: 2456, category: 1 /* Error */, key: "Type alias '{0}' circularly references itself." }, - Type_alias_name_cannot_be_0: { code: 2457, category: 1 /* Error */, key: "Type alias name cannot be '{0}'" }, - Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1 /* Error */, key: "Import declaration '{0}' is using private name '{1}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4003, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4005, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4007, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4009, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4011, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4013, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4015, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4017, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4018, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2: { code: 4021, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, - Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, - Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, - Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: 1 /* Error */, key: "Exported variable '{0}' has or is using private name '{1}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, - Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, - Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using private name '{0}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: 1 /* Error */, key: "Return type of public method from exported class has or is using private name '{0}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: 1 /* Error */, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: 1 /* Error */, key: "Return type of method from exported interface has or is using private name '{0}'." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, - Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: 1 /* Error */, key: "Return type of exported function has or is using private name '{0}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, - Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4079, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, - Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2: { code: 4080, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from private module '{2}'." }, - Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using private name '{1}'." }, - Enum_declarations_must_all_be_const_or_non_const: { code: 4082, category: 1 /* Error */, key: "Enum declarations must all be const or non-const." }, - In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 4083, category: 1 /* Error */, key: "In 'const' enum declarations member initializer must be constant expression.", isEarly: true }, - const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 4084, category: 1 /* Error */, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, - Index_expression_arguments_in_const_enums_must_be_of_type_string: { code: 4085, category: 1 /* Error */, key: "Index expression arguments in 'const' enums must be of type 'string'." }, - const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 4086, category: 1 /* Error */, key: "'const' enum member initializer was evaluated to a non-finite value." }, - const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 4087, category: 1 /* Error */, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, - The_current_host_does_not_support_the_0_option: { code: 5001, category: 1 /* Error */, key: "The current host does not support the '{0}' option." }, - Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1 /* Error */, key: "Cannot find the common subdirectory path for the input files." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: 1 /* Error */, key: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: 1 /* Error */, key: "Unsupported file encoding." }, - Unknown_compiler_option_0: { code: 5023, category: 1 /* Error */, key: "Unknown compiler option '{0}'." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: 1 /* Error */, key: "Could not write file '{0}': {1}" }, - Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: 1 /* Error */, key: "Option mapRoot cannot be specified without specifying sourcemap option." }, - Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: 1 /* Error */, key: "Option sourceRoot cannot be specified without specifying sourcemap option." }, - Concatenate_and_emit_output_to_single_file: { code: 6001, category: 2 /* Message */, key: "Concatenate and emit output to single file." }, - Generates_corresponding_d_ts_file: { code: 6002, category: 2 /* Message */, key: "Generates corresponding '.d.ts' file." }, - Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: 2 /* Message */, key: "Specifies the location where debugger should locate map files instead of generated locations." }, - Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: 2 /* Message */, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, - Watch_input_files: { code: 6005, category: 2 /* Message */, key: "Watch input files." }, - Redirect_output_structure_to_the_directory: { code: 6006, category: 2 /* Message */, key: "Redirect output structure to the directory." }, - Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: 2 /* Message */, key: "Do not erase const enum declarations in generated code." }, - Do_not_emit_comments_to_output: { code: 6009, category: 2 /* Message */, key: "Do not emit comments to output." }, - Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, - Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2 /* Message */, key: "Specify module code generation: 'commonjs' or 'amd'" }, - Print_this_message: { code: 6017, category: 2 /* Message */, key: "Print this message." }, - Print_the_compiler_s_version: { code: 6019, category: 2 /* Message */, key: "Print the compiler's version." }, - Syntax_Colon_0: { code: 6023, category: 2 /* Message */, key: "Syntax: {0}" }, - options: { code: 6024, category: 2 /* Message */, key: "options" }, - file: { code: 6025, category: 2 /* Message */, key: "file" }, - Examples_Colon_0: { code: 6026, category: 2 /* Message */, key: "Examples: {0}" }, - Options_Colon: { code: 6027, category: 2 /* Message */, key: "Options:" }, - Version_0: { code: 6029, category: 2 /* Message */, key: "Version {0}" }, - Insert_command_line_options_and_files_from_a_file: { code: 6030, category: 2 /* Message */, key: "Insert command line options and files from a file." }, - File_change_detected_Compiling: { code: 6032, category: 2 /* Message */, key: "File change detected. Compiling..." }, - KIND: { code: 6034, category: 2 /* Message */, key: "KIND" }, - FILE: { code: 6035, category: 2 /* Message */, key: "FILE" }, - VERSION: { code: 6036, category: 2 /* Message */, key: "VERSION" }, - LOCATION: { code: 6037, category: 2 /* Message */, key: "LOCATION" }, - DIRECTORY: { code: 6038, category: 2 /* Message */, key: "DIRECTORY" }, - Compilation_complete_Watching_for_file_changes: { code: 6042, category: 2 /* Message */, key: "Compilation complete. Watching for file changes." }, - Generates_corresponding_map_file: { code: 6043, category: 2 /* Message */, key: "Generates corresponding '.map' file." }, - Compiler_option_0_expects_an_argument: { code: 6044, category: 1 /* Error */, key: "Compiler option '{0}' expects an argument." }, - Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1 /* Error */, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1 /* Error */, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." }, - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: 1 /* Error */, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, - Unsupported_locale_0: { code: 6049, category: 1 /* Error */, key: "Unsupported locale '{0}'." }, - Unable_to_open_file_0: { code: 6050, category: 1 /* Error */, key: "Unable to open file '{0}'." }, - Corrupted_locale_file_0: { code: 6051, category: 1 /* Error */, key: "Corrupted locale file {0}." }, - Warn_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: 2 /* Message */, key: "Warn on expressions and declarations with an implied 'any' type." }, - File_0_not_found: { code: 6053, category: 1 /* Error */, key: "File '{0}' not found." }, - File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: 1 /* Error */, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, - Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1 /* Error */, key: "Variable '{0}' implicitly has an '{1}' type." }, - Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1 /* Error */, key: "Parameter '{0}' implicitly has an '{1}' type." }, - Member_0_implicitly_has_an_1_type: { code: 7008, category: 1 /* Error */, key: "Member '{0}' implicitly has an '{1}' type." }, - new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: 1 /* Error */, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, - _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: 1 /* Error */, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: 1 /* Error */, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, - Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: 1 /* Error */, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: 1 /* Error */, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, - Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1 /* Error */, key: "Index signature of object type implicitly has an 'any' type." }, - Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1 /* Error */, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, - Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1 /* Error */, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, - Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1 /* Error */, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 7021, category: 1 /* Error */, key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." }, - _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { code: 7022, category: 1 /* Error */, key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." }, - _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: { code: 7023, category: 1 /* Error */, key: "'{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." }, - 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: { code: 7024, category: 1 /* Error */, key: "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." }, - You_cannot_rename_this_element: { code: 8000, category: 1 /* Error */, key: "You cannot rename this element." } - }; -})(ts || (ts = {})); -var ts; -(function (ts) { - var textToToken = { - "any": 109 /* AnyKeyword */, - "boolean": 110 /* BooleanKeyword */, - "break": 64 /* BreakKeyword */, - "case": 65 /* CaseKeyword */, - "catch": 66 /* CatchKeyword */, - "class": 67 /* ClassKeyword */, - "continue": 69 /* ContinueKeyword */, - "const": 68 /* ConstKeyword */, - "constructor": 111 /* ConstructorKeyword */, - "debugger": 70 /* DebuggerKeyword */, - "declare": 112 /* DeclareKeyword */, - "default": 71 /* DefaultKeyword */, - "delete": 72 /* DeleteKeyword */, - "do": 73 /* DoKeyword */, - "else": 74 /* ElseKeyword */, - "enum": 75 /* EnumKeyword */, - "export": 76 /* ExportKeyword */, - "extends": 77 /* ExtendsKeyword */, - "false": 78 /* FalseKeyword */, - "finally": 79 /* FinallyKeyword */, - "for": 80 /* ForKeyword */, - "function": 81 /* FunctionKeyword */, - "get": 113 /* GetKeyword */, - "if": 82 /* IfKeyword */, - "implements": 100 /* ImplementsKeyword */, - "import": 83 /* ImportKeyword */, - "in": 84 /* InKeyword */, - "instanceof": 85 /* InstanceOfKeyword */, - "interface": 101 /* InterfaceKeyword */, - "let": 102 /* LetKeyword */, - "module": 114 /* ModuleKeyword */, - "new": 86 /* NewKeyword */, - "null": 87 /* NullKeyword */, - "number": 116 /* NumberKeyword */, - "package": 103 /* PackageKeyword */, - "private": 104 /* PrivateKeyword */, - "protected": 105 /* ProtectedKeyword */, - "public": 106 /* PublicKeyword */, - "require": 115 /* RequireKeyword */, - "return": 88 /* ReturnKeyword */, - "set": 117 /* SetKeyword */, - "static": 107 /* StaticKeyword */, - "string": 118 /* StringKeyword */, - "super": 89 /* SuperKeyword */, - "switch": 90 /* SwitchKeyword */, - "this": 91 /* ThisKeyword */, - "throw": 92 /* ThrowKeyword */, - "true": 93 /* TrueKeyword */, - "try": 94 /* TryKeyword */, - "type": 119 /* TypeKeyword */, - "typeof": 95 /* TypeOfKeyword */, - "var": 96 /* VarKeyword */, - "void": 97 /* VoidKeyword */, - "while": 98 /* WhileKeyword */, - "with": 99 /* WithKeyword */, - "yield": 108 /* YieldKeyword */, - "{": 13 /* OpenBraceToken */, - "}": 14 /* CloseBraceToken */, - "(": 15 /* OpenParenToken */, - ")": 16 /* CloseParenToken */, - "[": 17 /* OpenBracketToken */, - "]": 18 /* CloseBracketToken */, - ".": 19 /* DotToken */, - "...": 20 /* DotDotDotToken */, - ";": 21 /* SemicolonToken */, - ",": 22 /* CommaToken */, - "<": 23 /* LessThanToken */, - ">": 24 /* GreaterThanToken */, - "<=": 25 /* LessThanEqualsToken */, - ">=": 26 /* GreaterThanEqualsToken */, - "==": 27 /* EqualsEqualsToken */, - "!=": 28 /* ExclamationEqualsToken */, - "===": 29 /* EqualsEqualsEqualsToken */, - "!==": 30 /* ExclamationEqualsEqualsToken */, - "=>": 31 /* EqualsGreaterThanToken */, - "+": 32 /* PlusToken */, - "-": 33 /* MinusToken */, - "*": 34 /* AsteriskToken */, - "/": 35 /* SlashToken */, - "%": 36 /* PercentToken */, - "++": 37 /* PlusPlusToken */, - "--": 38 /* MinusMinusToken */, - "<<": 39 /* LessThanLessThanToken */, - ">>": 40 /* GreaterThanGreaterThanToken */, - ">>>": 41 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 42 /* AmpersandToken */, - "|": 43 /* BarToken */, - "^": 44 /* CaretToken */, - "!": 45 /* ExclamationToken */, - "~": 46 /* TildeToken */, - "&&": 47 /* AmpersandAmpersandToken */, - "||": 48 /* BarBarToken */, - "?": 49 /* QuestionToken */, - ":": 50 /* ColonToken */, - "=": 51 /* EqualsToken */, - "+=": 52 /* PlusEqualsToken */, - "-=": 53 /* MinusEqualsToken */, - "*=": 54 /* AsteriskEqualsToken */, - "/=": 55 /* SlashEqualsToken */, - "%=": 56 /* PercentEqualsToken */, - "<<=": 57 /* LessThanLessThanEqualsToken */, - ">>=": 58 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 60 /* AmpersandEqualsToken */, - "|=": 61 /* BarEqualsToken */, - "^=": 62 /* CaretEqualsToken */ - }; - var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - function lookupInUnicodeMap(code, map) { - if (code < map[0]) { - return false; - } - var lo = 0; - var hi = map.length; - var mid; - while (lo + 1 < hi) { - mid = lo + (hi - lo) / 2; - mid -= mid % 2; - if (map[mid] <= code && code <= map[mid + 1]) { - return true; - } - if (code < map[mid]) { - hi = mid; - } - else { - lo = mid + 2; - } - } - return false; - } - function isUnicodeIdentifierStart(code, languageVersion) { - return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierStart) : lookupInUnicodeMap(code, unicodeES5IdentifierStart); - } - function isUnicodeIdentifierPart(code, languageVersion) { - return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierPart) : lookupInUnicodeMap(code, unicodeES5IdentifierPart); - } - function makeReverseMap(source) { - var result = []; - for (var name in source) { - if (source.hasOwnProperty(name)) { - result[source[name]] = name; - } - } - return result; - } - var tokenStrings = makeReverseMap(textToToken); - function tokenToString(t) { - return tokenStrings[t]; - } - ts.tokenToString = tokenToString; - function getLineStarts(text) { - var result = new Array(); - var pos = 0; - var lineStart = 0; - while (pos < text.length) { - var ch = text.charCodeAt(pos++); - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos) === 10 /* lineFeed */) { - pos++; - } - case 10 /* lineFeed */: - result.push(lineStart); - lineStart = pos; - break; - default: - if (ch > 127 /* maxAsciiCharacter */ && isLineBreak(ch)) { - result.push(lineStart); - lineStart = pos; - } - break; - } - } - result.push(lineStart); - return result; - } - ts.getLineStarts = getLineStarts; - function getPositionFromLineAndCharacter(lineStarts, line, character) { - ts.Debug.assert(line > 0); - return lineStarts[line - 1] + character - 1; - } - ts.getPositionFromLineAndCharacter = getPositionFromLineAndCharacter; - function getLineAndCharacterOfPosition(lineStarts, position) { - var lineNumber = ts.binarySearch(lineStarts, position); - if (lineNumber < 0) { - lineNumber = (~lineNumber) - 1; - } - return { - line: lineNumber + 1, - character: position - lineStarts[lineNumber] + 1 - }; - } - ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; - function positionToLineAndCharacter(text, pos) { - var lineStarts = getLineStarts(text); - return getLineAndCharacterOfPosition(lineStarts, pos); - } - ts.positionToLineAndCharacter = positionToLineAndCharacter; - var hasOwnProperty = Object.prototype.hasOwnProperty; - function isWhiteSpace(ch) { - return ch === 32 /* space */ || ch === 9 /* tab */ || ch === 11 /* verticalTab */ || ch === 12 /* formFeed */ || ch === 160 /* nonBreakingSpace */ || ch === 5760 /* ogham */ || ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ || ch === 8239 /* narrowNoBreakSpace */ || ch === 8287 /* mathematicalSpace */ || ch === 12288 /* ideographicSpace */ || ch === 65279 /* byteOrderMark */; - } - ts.isWhiteSpace = isWhiteSpace; - function isLineBreak(ch) { - return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */ || ch === 133 /* nextLine */; - } - ts.isLineBreak = isLineBreak; - function isDigit(ch) { - return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; - } - function isOctalDigit(ch) { - return ch >= 48 /* _0 */ && ch <= 55 /* _7 */; - } - ts.isOctalDigit = isOctalDigit; - function skipTrivia(text, pos, stopAfterLineBreak) { - while (true) { - var ch = text.charCodeAt(pos); - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) - pos++; - case 10 /* lineFeed */: - pos++; - if (stopAfterLineBreak) - return pos; - continue; - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - pos++; - continue; - case 47 /* slash */: - if (text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - while (pos < text.length) { - if (isLineBreak(text.charCodeAt(pos))) { - break; - } - pos++; - } - continue; - } - if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { - pos += 2; - while (pos < text.length) { - if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - break; - } - pos++; - } - continue; - } - break; - default: - if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { - pos++; - continue; - } - break; - } - return pos; - } - } - ts.skipTrivia = skipTrivia; - function getCommentRanges(text, pos, trailing) { - var result; - var collecting = trailing || pos === 0; - while (true) { - var ch = text.charCodeAt(pos); - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) - pos++; - case 10 /* lineFeed */: - pos++; - if (trailing) { - return result; - } - collecting = true; - if (result && result.length) { - result[result.length - 1].hasTrailingNewLine = true; - } - continue; - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - pos++; - continue; - case 47 /* slash */: - var nextChar = text.charCodeAt(pos + 1); - var hasTrailingNewLine = false; - if (nextChar === 47 /* slash */ || nextChar === 42 /* asterisk */) { - var startPos = pos; - pos += 2; - if (nextChar === 47 /* slash */) { - while (pos < text.length) { - if (isLineBreak(text.charCodeAt(pos))) { - hasTrailingNewLine = true; - break; - } - pos++; - } - } - else { - while (pos < text.length) { - if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - break; - } - pos++; - } - } - if (collecting) { - if (!result) - result = []; - result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); - } - continue; - } - break; - default: - if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { - if (result && result.length && isLineBreak(ch)) { - result[result.length - 1].hasTrailingNewLine = true; - } - pos++; - continue; - } - break; - } - return result; - } - } - function getLeadingCommentRanges(text, pos) { - return getCommentRanges(text, pos, false); - } - ts.getLeadingCommentRanges = getLeadingCommentRanges; - function getTrailingCommentRanges(text, pos) { - return getCommentRanges(text, pos, true); - } - ts.getTrailingCommentRanges = getTrailingCommentRanges; - function isIdentifierStart(ch, languageVersion) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); - } - ts.isIdentifierStart = isIdentifierStart; - function isIdentifierPart(ch, languageVersion) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); - } - ts.isIdentifierPart = isIdentifierPart; - function createScanner(languageVersion, skipTrivia, text, onError, onComment) { - var pos; - var len; - var startPos; - var tokenPos; - var token; - var tokenValue; - var precedingLineBreak; - function error(message) { - if (onError) { - onError(message); - } - } - function isIdentifierStart(ch) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); - } - function isIdentifierPart(ch) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); - } - function scanNumber() { - var start = pos; - while (isDigit(text.charCodeAt(pos))) - pos++; - if (text.charCodeAt(pos) === 46 /* dot */) { - pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; - } - var end = pos; - if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { - pos++; - if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) - pos++; - if (isDigit(text.charCodeAt(pos))) { - pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; - end = pos; - } - else { - error(ts.Diagnostics.Digit_expected); - } - } - return +(text.substring(start, end)); - } - function scanOctalDigits() { - var start = pos; - while (isOctalDigit(text.charCodeAt(pos))) { - pos++; - } - return +(text.substring(start, pos)); - } - function scanHexDigits(count, mustMatchCount) { - var digits = 0; - var value = 0; - while (digits < count || !mustMatchCount) { - var ch = text.charCodeAt(pos); - if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { - value = value * 16 + ch - 48 /* _0 */; - } - else if (ch >= 65 /* A */ && ch <= 70 /* F */) { - value = value * 16 + ch - 65 /* A */ + 10; - } - else if (ch >= 97 /* a */ && ch <= 102 /* f */) { - value = value * 16 + ch - 97 /* a */ + 10; - } - else { - break; - } - pos++; - digits++; - } - if (digits < count) { - value = -1; - } - return value; - } - function scanString() { - var quote = text.charCodeAt(pos++); - var result = ""; - var start = pos; - while (true) { - if (pos >= len) { - result += text.substring(start, pos); - error(ts.Diagnostics.Unexpected_end_of_text); - break; - } - var ch = text.charCodeAt(pos); - if (ch === quote) { - result += text.substring(start, pos); - pos++; - break; - } - if (ch === 92 /* backslash */) { - result += text.substring(start, pos); - result += scanEscapeSequence(); - start = pos; - continue; - } - if (isLineBreak(ch)) { - result += text.substring(start, pos); - error(ts.Diagnostics.Unterminated_string_literal); - break; - } - pos++; - } - return result; - } - function scanTemplateAndSetTokenValue() { - var startedWithBacktick = text.charCodeAt(pos) === 96 /* backtick */; - pos++; - var start = pos; - var contents = ""; - var resultingToken; - while (true) { - if (pos >= len) { - contents += text.substring(start, pos); - error(ts.Diagnostics.Unexpected_end_of_text); - resultingToken = startedWithBacktick ? 9 /* NoSubstitutionTemplateLiteral */ : 12 /* TemplateTail */; - break; - } - var currChar = text.charCodeAt(pos); - if (currChar === 96 /* backtick */) { - contents += text.substring(start, pos); - pos++; - resultingToken = startedWithBacktick ? 9 /* NoSubstitutionTemplateLiteral */ : 12 /* TemplateTail */; - break; - } - if (currChar === 36 /* $ */ && pos + 1 < len && text.charCodeAt(pos + 1) === 123 /* openBrace */) { - contents += text.substring(start, pos); - pos += 2; - resultingToken = startedWithBacktick ? 10 /* TemplateHead */ : 11 /* TemplateMiddle */; - break; - } - if (currChar === 92 /* backslash */) { - contents += text.substring(start, pos); - contents += scanEscapeSequence(); - start = pos; - continue; - } - if (currChar === 13 /* carriageReturn */) { - contents += text.substring(start, pos); - if (pos + 1 < len && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { - pos++; - } - pos++; - contents += "\n"; - start = pos; - continue; - } - pos++; - } - ts.Debug.assert(resultingToken !== undefined); - tokenValue = contents; - return resultingToken; - } - function scanEscapeSequence() { - pos++; - if (pos >= len) { - error(ts.Diagnostics.Unexpected_end_of_text); - return ""; - } - var ch = text.charCodeAt(pos++); - switch (ch) { - case 48 /* _0 */: - return "\0"; - case 98 /* b */: - return "\b"; - case 116 /* t */: - return "\t"; - case 110 /* n */: - return "\n"; - case 118 /* v */: - return "\v"; - case 102 /* f */: - return "\f"; - case 114 /* r */: - return "\r"; - case 39 /* singleQuote */: - return "\'"; - case 34 /* doubleQuote */: - return "\""; - case 120 /* x */: - case 117 /* u */: - var ch = scanHexDigits(ch === 120 /* x */ ? 2 : 4, true); - if (ch >= 0) { - return String.fromCharCode(ch); - } - else { - error(ts.Diagnostics.Hexadecimal_digit_expected); - return ""; - } - case 13 /* carriageReturn */: - if (pos < len && text.charCodeAt(pos) === 10 /* lineFeed */) { - pos++; - } - case 10 /* lineFeed */: - case 8232 /* lineSeparator */: - case 8233 /* paragraphSeparator */: - return ""; - default: - return String.fromCharCode(ch); - } - } - function peekUnicodeEscape() { - if (pos + 5 < len && text.charCodeAt(pos + 1) === 117 /* u */) { - var start = pos; - pos += 2; - var value = scanHexDigits(4, true); - pos = start; - return value; - } - return -1; - } - function scanIdentifierParts() { - var result = ""; - var start = pos; - while (pos < len) { - var ch = text.charCodeAt(pos); - if (isIdentifierPart(ch)) { - pos++; - } - else if (ch === 92 /* backslash */) { - ch = peekUnicodeEscape(); - if (!(ch >= 0 && isIdentifierPart(ch))) { - break; - } - result += text.substring(start, pos); - result += String.fromCharCode(ch); - pos += 6; - start = pos; - } - else { - break; - } - } - result += text.substring(start, pos); - return result; - } - function getIdentifierToken() { - var len = tokenValue.length; - if (len >= 2 && len <= 11) { - var ch = tokenValue.charCodeAt(0); - if (ch >= 97 /* a */ && ch <= 122 /* z */ && hasOwnProperty.call(textToToken, tokenValue)) { - return token = textToToken[tokenValue]; - } - } - return token = 63 /* Identifier */; - } - function scan() { - startPos = pos; - precedingLineBreak = false; - while (true) { - tokenPos = pos; - if (pos >= len) { - return token = 1 /* EndOfFileToken */; - } - var ch = text.charCodeAt(pos); - switch (ch) { - case 10 /* lineFeed */: - case 13 /* carriageReturn */: - precedingLineBreak = true; - if (skipTrivia) { - pos++; - continue; - } - else { - if (ch === 13 /* carriageReturn */ && pos + 1 < len && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { - pos += 2; - } - else { - pos++; - } - return token = 4 /* NewLineTrivia */; - } - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - if (skipTrivia) { - pos++; - continue; - } - else { - while (pos < len && isWhiteSpace(text.charCodeAt(pos))) { - pos++; - } - return token = 5 /* WhitespaceTrivia */; - } - case 33 /* exclamation */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 30 /* ExclamationEqualsEqualsToken */; - } - return pos += 2, token = 28 /* ExclamationEqualsToken */; - } - return pos++, token = 45 /* ExclamationToken */; - case 34 /* doubleQuote */: - case 39 /* singleQuote */: - tokenValue = scanString(); - return token = 7 /* StringLiteral */; - case 96 /* backtick */: - return token = scanTemplateAndSetTokenValue(); - case 37 /* percent */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 56 /* PercentEqualsToken */; - } - return pos++, token = 36 /* PercentToken */; - case 38 /* ampersand */: - if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { - return pos += 2, token = 47 /* AmpersandAmpersandToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 60 /* AmpersandEqualsToken */; - } - return pos++, token = 42 /* AmpersandToken */; - case 40 /* openParen */: - return pos++, token = 15 /* OpenParenToken */; - case 41 /* closeParen */: - return pos++, token = 16 /* CloseParenToken */; - case 42 /* asterisk */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 54 /* AsteriskEqualsToken */; - } - return pos++, token = 34 /* AsteriskToken */; - case 43 /* plus */: - if (text.charCodeAt(pos + 1) === 43 /* plus */) { - return pos += 2, token = 37 /* PlusPlusToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 52 /* PlusEqualsToken */; - } - return pos++, token = 32 /* PlusToken */; - case 44 /* comma */: - return pos++, token = 22 /* CommaToken */; - case 45 /* minus */: - if (text.charCodeAt(pos + 1) === 45 /* minus */) { - return pos += 2, token = 38 /* MinusMinusToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 53 /* MinusEqualsToken */; - } - return pos++, token = 33 /* MinusToken */; - case 46 /* dot */: - if (isDigit(text.charCodeAt(pos + 1))) { - tokenValue = "" + scanNumber(); - return token = 6 /* NumericLiteral */; - } - if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { - return pos += 3, token = 20 /* DotDotDotToken */; - } - return pos++, token = 19 /* DotToken */; - case 47 /* slash */: - if (text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - while (pos < len) { - if (isLineBreak(text.charCodeAt(pos))) { - break; - } - pos++; - } - if (onComment) { - onComment(tokenPos, pos); - } - if (skipTrivia) { - continue; - } - else { - return token = 2 /* SingleLineCommentTrivia */; - } - } - if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { - pos += 2; - var commentClosed = false; - while (pos < len) { - var ch = text.charCodeAt(pos); - if (ch === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - commentClosed = true; - break; - } - if (isLineBreak(ch)) { - precedingLineBreak = true; - } - pos++; - } - if (!commentClosed) { - error(ts.Diagnostics.Asterisk_Slash_expected); - } - if (onComment) { - onComment(tokenPos, pos); - } - if (skipTrivia) { - continue; - } - else { - return token = 3 /* MultiLineCommentTrivia */; - } - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 55 /* SlashEqualsToken */; - } - return pos++, token = 35 /* SlashToken */; - case 48 /* _0 */: - if (pos + 2 < len && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { - pos += 2; - var value = scanHexDigits(1, false); - if (value < 0) { - error(ts.Diagnostics.Hexadecimal_digit_expected); - value = 0; - } - tokenValue = "" + value; - return 6 /* NumericLiteral */; - } - if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { - tokenValue = "" + scanOctalDigits(); - return 6 /* NumericLiteral */; - } - case 49 /* _1 */: - case 50 /* _2 */: - case 51 /* _3 */: - case 52 /* _4 */: - case 53 /* _5 */: - case 54 /* _6 */: - case 55 /* _7 */: - case 56 /* _8 */: - case 57 /* _9 */: - tokenValue = "" + scanNumber(); - return token = 6 /* NumericLiteral */; - case 58 /* colon */: - return pos++, token = 50 /* ColonToken */; - case 59 /* semicolon */: - return pos++, token = 21 /* SemicolonToken */; - case 60 /* lessThan */: - if (text.charCodeAt(pos + 1) === 60 /* lessThan */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 57 /* LessThanLessThanEqualsToken */; - } - return pos += 2, token = 39 /* LessThanLessThanToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 25 /* LessThanEqualsToken */; - } - return pos++, token = 23 /* LessThanToken */; - case 61 /* equals */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 29 /* EqualsEqualsEqualsToken */; - } - return pos += 2, token = 27 /* EqualsEqualsToken */; - } - if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { - return pos += 2, token = 31 /* EqualsGreaterThanToken */; - } - return pos++, token = 51 /* EqualsToken */; - case 62 /* greaterThan */: - return pos++, token = 24 /* GreaterThanToken */; - case 63 /* question */: - return pos++, token = 49 /* QuestionToken */; - case 91 /* openBracket */: - return pos++, token = 17 /* OpenBracketToken */; - case 93 /* closeBracket */: - return pos++, token = 18 /* CloseBracketToken */; - case 94 /* caret */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 62 /* CaretEqualsToken */; - } - return pos++, token = 44 /* CaretToken */; - case 123 /* openBrace */: - return pos++, token = 13 /* OpenBraceToken */; - case 124 /* bar */: - if (text.charCodeAt(pos + 1) === 124 /* bar */) { - return pos += 2, token = 48 /* BarBarToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 61 /* BarEqualsToken */; - } - return pos++, token = 43 /* BarToken */; - case 125 /* closeBrace */: - return pos++, token = 14 /* CloseBraceToken */; - case 126 /* tilde */: - return pos++, token = 46 /* TildeToken */; - case 92 /* backslash */: - var ch = peekUnicodeEscape(); - if (ch >= 0 && isIdentifierStart(ch)) { - pos += 6; - tokenValue = String.fromCharCode(ch) + scanIdentifierParts(); - return token = getIdentifierToken(); - } - error(ts.Diagnostics.Invalid_character); - return pos++, token = 0 /* Unknown */; - default: - if (isIdentifierStart(ch)) { - pos++; - while (pos < len && isIdentifierPart(ch = text.charCodeAt(pos))) - pos++; - tokenValue = text.substring(tokenPos, pos); - if (ch === 92 /* backslash */) { - tokenValue += scanIdentifierParts(); - } - return token = getIdentifierToken(); - } - else if (isWhiteSpace(ch)) { - pos++; - continue; - } - else if (isLineBreak(ch)) { - precedingLineBreak = true; - pos++; - continue; - } - error(ts.Diagnostics.Invalid_character); - return pos++, token = 0 /* Unknown */; - } - } - } - function reScanGreaterToken() { - if (token === 24 /* GreaterThanToken */) { - if (text.charCodeAt(pos) === 62 /* greaterThan */) { - if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */; - } - return pos += 2, token = 41 /* GreaterThanGreaterThanGreaterThanToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 58 /* GreaterThanGreaterThanEqualsToken */; - } - return pos++, token = 40 /* GreaterThanGreaterThanToken */; - } - if (text.charCodeAt(pos) === 61 /* equals */) { - return pos++, token = 26 /* GreaterThanEqualsToken */; - } - } - return token; - } - function reScanSlashToken() { - if (token === 35 /* SlashToken */ || token === 55 /* SlashEqualsToken */) { - var p = tokenPos + 1; - var inEscape = false; - var inCharacterClass = false; - while (true) { - if (p >= len) { - return token; - } - var ch = text.charCodeAt(p); - if (isLineBreak(ch)) { - return token; - } - if (inEscape) { - inEscape = false; - } - else if (ch === 47 /* slash */ && !inCharacterClass) { - break; - } - else if (ch === 91 /* openBracket */) { - inCharacterClass = true; - } - else if (ch === 92 /* backslash */) { - inEscape = true; - } - else if (ch === 93 /* closeBracket */) { - inCharacterClass = false; - } - p++; - } - p++; - while (isIdentifierPart(text.charCodeAt(p))) { - p++; - } - pos = p; - tokenValue = text.substring(tokenPos, pos); - token = 8 /* RegularExpressionLiteral */; - } - return token; - } - function reScanTemplateToken() { - ts.Debug.assert(token === 14 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'"); - pos = tokenPos; - return token = scanTemplateAndSetTokenValue(); - } - function tryScan(callback) { - var savePos = pos; - var saveStartPos = startPos; - var saveTokenPos = tokenPos; - var saveToken = token; - var saveTokenValue = tokenValue; - var savePrecedingLineBreak = precedingLineBreak; - var result = callback(); - if (!result) { - pos = savePos; - startPos = saveStartPos; - tokenPos = saveTokenPos; - token = saveToken; - tokenValue = saveTokenValue; - precedingLineBreak = savePrecedingLineBreak; - } - return result; - } - function setText(newText) { - text = newText || ""; - len = text.length; - setTextPos(0); - } - function setTextPos(textPos) { - pos = textPos; - startPos = textPos; - tokenPos = textPos; - token = 0 /* Unknown */; - precedingLineBreak = false; - } - setText(text); - return { - getStartPos: function () { return startPos; }, - getTextPos: function () { return pos; }, - getToken: function () { return token; }, - getTokenPos: function () { return tokenPos; }, - getTokenText: function () { return text.substring(tokenPos, pos); }, - getTokenValue: function () { return tokenValue; }, - hasPrecedingLineBreak: function () { return precedingLineBreak; }, - isIdentifier: function () { return token === 63 /* Identifier */ || token > 99 /* LastReservedWord */; }, - isReservedWord: function () { return token >= 64 /* FirstReservedWord */ && token <= 99 /* LastReservedWord */; }, - reScanGreaterToken: reScanGreaterToken, - reScanSlashToken: reScanSlashToken, - reScanTemplateToken: reScanTemplateToken, - scan: scan, - setText: setText, - setTextPos: setTextPos, - tryScan: tryScan - }; - } - ts.createScanner = createScanner; -})(ts || (ts = {})); var ts; (function (ts) { (function (EmitReturnStatus) { @@ -1545,6 +130,13 @@ var ts; return result; } ts.sum = sum; + function lastOrUndefined(array) { + if (array.length === 0) { + return undefined; + } + return array[array.length - 1]; + } + ts.lastOrUndefined = lastOrUndefined; function binarySearch(array, value) { var low = 0; var high = array.length - 1; @@ -2192,7 +784,1429 @@ var sys = (function () { })(); var ts; (function (ts) { - var nodeConstructors = new Array(196 /* Count */); + ts.Diagnostics = { + Unterminated_string_literal: { code: 1002, category: 1 /* Error */, key: "Unterminated string literal." }, + Identifier_expected: { code: 1003, category: 1 /* Error */, key: "Identifier expected." }, + _0_expected: { code: 1005, category: 1 /* Error */, key: "'{0}' expected." }, + A_file_cannot_have_a_reference_to_itself: { code: 1006, category: 1 /* Error */, key: "A file cannot have a reference to itself." }, + Trailing_comma_not_allowed: { code: 1009, category: 1 /* Error */, key: "Trailing comma not allowed." }, + Asterisk_Slash_expected: { code: 1010, category: 1 /* Error */, key: "'*/' expected." }, + Unexpected_token: { code: 1012, category: 1 /* Error */, key: "Unexpected token." }, + Catch_clause_parameter_cannot_have_a_type_annotation: { code: 1013, category: 1 /* Error */, key: "Catch clause parameter cannot have a type annotation." }, + A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1 /* Error */, key: "A rest parameter must be last in a parameter list." }, + Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: 1 /* Error */, key: "Parameter cannot have question mark and initializer." }, + A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: 1 /* Error */, key: "A required parameter cannot follow an optional parameter." }, + An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: 1 /* Error */, key: "An index signature cannot have a rest parameter." }, + An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: 1 /* Error */, key: "An index signature parameter cannot have an accessibility modifier." }, + An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: 1 /* Error */, key: "An index signature parameter cannot have a question mark." }, + An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: 1 /* Error */, key: "An index signature parameter cannot have an initializer." }, + An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1 /* Error */, key: "An index signature must have a type annotation." }, + An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1 /* Error */, key: "An index signature parameter must have a type annotation." }, + An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1 /* Error */, key: "An index signature parameter type must be 'string' or 'number'." }, + A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: 1 /* Error */, key: "A class or interface declaration can only have one 'extends' clause." }, + An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: 1 /* Error */, key: "An 'extends' clause must precede an 'implements' clause." }, + A_class_can_only_extend_a_single_class: { code: 1026, category: 1 /* Error */, key: "A class can only extend a single class." }, + A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: 1 /* Error */, key: "A class declaration can only have one 'implements' clause." }, + Accessibility_modifier_already_seen: { code: 1028, category: 1 /* Error */, key: "Accessibility modifier already seen." }, + _0_modifier_must_precede_1_modifier: { code: 1029, category: 1 /* Error */, key: "'{0}' modifier must precede '{1}' modifier." }, + _0_modifier_already_seen: { code: 1030, category: 1 /* Error */, key: "'{0}' modifier already seen." }, + _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a class element." }, + An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: 1 /* Error */, key: "An interface declaration cannot have an 'implements' clause." }, + super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: 1 /* Error */, key: "'super' must be followed by an argument list or member access." }, + Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1 /* Error */, key: "Only ambient modules can use quoted names." }, + Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1 /* Error */, key: "Statements are not allowed in ambient contexts." }, + A_function_implementation_cannot_be_declared_in_an_ambient_context: { code: 1037, category: 1 /* Error */, key: "A function implementation cannot be declared in an ambient context." }, + A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: 1 /* Error */, key: "A 'declare' modifier cannot be used in an already ambient context." }, + Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: 1 /* Error */, key: "Initializers are not allowed in ambient contexts." }, + _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a module element." }, + A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an interface declaration." }, + A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: 1 /* Error */, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, + A_rest_parameter_cannot_be_optional: { code: 1047, category: 1 /* Error */, key: "A rest parameter cannot be optional." }, + A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: 1 /* Error */, key: "A rest parameter cannot have an initializer." }, + A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: 1 /* Error */, key: "A 'set' accessor must have exactly one parameter." }, + A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: 1 /* Error */, key: "A 'set' accessor cannot have an optional parameter." }, + A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1 /* Error */, key: "A 'set' accessor parameter cannot have an initializer." }, + A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1 /* Error */, key: "A 'set' accessor cannot have rest parameter." }, + A_get_accessor_cannot_have_parameters: { code: 1054, category: 1 /* Error */, key: "A 'get' accessor cannot have parameters." }, + Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1 /* Error */, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, + Enum_member_must_have_initializer: { code: 1061, category: 1 /* Error */, key: "Enum member must have initializer." }, + An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1 /* Error */, key: "An export assignment cannot be used in an internal module." }, + Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1 /* Error */, key: "Ambient enum elements can only have integer literal initializers." }, + Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: 1 /* Error */, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, + A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an import declaration." }, + Invalid_reference_directive_syntax: { code: 1084, category: 1 /* Error */, key: "Invalid 'reference' directive syntax." }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1 /* Error */, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, + An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: 1 /* Error */, key: "An accessor cannot be declared in an ambient context." }, + _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a constructor declaration." }, + _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a parameter." }, + Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: 1 /* Error */, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, + Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: 1 /* Error */, key: "Type parameters cannot appear on a constructor declaration." }, + Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: 1 /* Error */, key: "Type annotation cannot appear on a constructor declaration." }, + An_accessor_cannot_have_type_parameters: { code: 1094, category: 1 /* Error */, key: "An accessor cannot have type parameters." }, + A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: 1 /* Error */, key: "A 'set' accessor cannot have a return type annotation." }, + An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: 1 /* Error */, key: "An index signature must have exactly one parameter." }, + _0_list_cannot_be_empty: { code: 1097, category: 1 /* Error */, key: "'{0}' list cannot be empty." }, + Type_parameter_list_cannot_be_empty: { code: 1098, category: 1 /* Error */, key: "Type parameter list cannot be empty." }, + Type_argument_list_cannot_be_empty: { code: 1099, category: 1 /* Error */, key: "Type argument list cannot be empty." }, + Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1 /* Error */, key: "Invalid use of '{0}' in strict mode." }, + with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1 /* Error */, key: "'with' statements are not allowed in strict mode." }, + delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1 /* Error */, key: "'delete' cannot be called on an identifier in strict mode." }, + A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1 /* Error */, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, + A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1 /* Error */, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, + Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1 /* Error */, key: "Jump target cannot cross function boundary." }, + A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: 1 /* Error */, key: "A 'return' statement can only be used within a function body." }, + Expression_expected: { code: 1109, category: 1 /* Error */, key: "Expression expected." }, + Type_expected: { code: 1110, category: 1 /* Error */, key: "Type expected." }, + A_constructor_implementation_cannot_be_declared_in_an_ambient_context: { code: 1111, category: 1 /* Error */, key: "A constructor implementation cannot be declared in an ambient context." }, + A_class_member_cannot_be_declared_optional: { code: 1112, category: 1 /* Error */, key: "A class member cannot be declared optional." }, + A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: 1 /* Error */, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, + Duplicate_label_0: { code: 1114, category: 1 /* Error */, key: "Duplicate label '{0}'" }, + A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: 1 /* Error */, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, + A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: 1 /* Error */, key: "A 'break' statement can only jump to a label of an enclosing statement." }, + An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: 1 /* Error */, key: "An object literal cannot have multiple properties with the same name in strict mode." }, + An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: 1 /* Error */, key: "An object literal cannot have multiple get/set accessors with the same name." }, + An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: 1 /* Error */, key: "An object literal cannot have property and accessor with the same name." }, + An_export_assignment_cannot_have_modifiers: { code: 1120, category: 1 /* Error */, key: "An export assignment cannot have modifiers." }, + Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: 1 /* Error */, key: "Octal literals are not allowed in strict mode." }, + A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: 1 /* Error */, key: "A tuple type element list cannot be empty." }, + Variable_declaration_list_cannot_be_empty: { code: 1123, category: 1 /* Error */, key: "Variable declaration list cannot be empty." }, + Digit_expected: { code: 1124, category: 1 /* Error */, key: "Digit expected." }, + Hexadecimal_digit_expected: { code: 1125, category: 1 /* Error */, key: "Hexadecimal digit expected." }, + Unexpected_end_of_text: { code: 1126, category: 1 /* Error */, key: "Unexpected end of text." }, + Invalid_character: { code: 1127, category: 1 /* Error */, key: "Invalid character." }, + Declaration_or_statement_expected: { code: 1128, category: 1 /* Error */, key: "Declaration or statement expected." }, + Statement_expected: { code: 1129, category: 1 /* Error */, key: "Statement expected." }, + case_or_default_expected: { code: 1130, category: 1 /* Error */, key: "'case' or 'default' expected." }, + Property_or_signature_expected: { code: 1131, category: 1 /* Error */, key: "Property or signature expected." }, + Enum_member_expected: { code: 1132, category: 1 /* Error */, key: "Enum member expected." }, + Type_reference_expected: { code: 1133, category: 1 /* Error */, key: "Type reference expected." }, + Variable_declaration_expected: { code: 1134, category: 1 /* Error */, key: "Variable declaration expected." }, + Argument_expression_expected: { code: 1135, category: 1 /* Error */, key: "Argument expression expected." }, + Property_assignment_expected: { code: 1136, category: 1 /* Error */, key: "Property assignment expected." }, + Expression_or_comma_expected: { code: 1137, category: 1 /* Error */, key: "Expression or comma expected." }, + Parameter_declaration_expected: { code: 1138, category: 1 /* Error */, key: "Parameter declaration expected." }, + Type_parameter_declaration_expected: { code: 1139, category: 1 /* Error */, key: "Type parameter declaration expected." }, + Type_argument_expected: { code: 1140, category: 1 /* Error */, key: "Type argument expected." }, + String_literal_expected: { code: 1141, category: 1 /* Error */, key: "String literal expected." }, + Line_break_not_permitted_here: { code: 1142, category: 1 /* Error */, key: "Line break not permitted here." }, + catch_or_finally_expected: { code: 1143, category: 1 /* Error */, key: "'catch' or 'finally' expected." }, + Block_or_expected: { code: 1144, category: 1 /* Error */, key: "Block or ';' expected." }, + Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: 1 /* Error */, key: "Modifiers not permitted on index signature members." }, + Declaration_expected: { code: 1146, category: 1 /* Error */, key: "Declaration expected." }, + Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: 1 /* Error */, key: "Import declarations in an internal module cannot reference an external module." }, + Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: 1 /* Error */, key: "Cannot compile external modules unless the '--module' flag is provided." }, + Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: 1 /* Error */, key: "Filename '{0}' differs from already included filename '{1}' only in casing" }, + new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, + var_let_or_const_expected: { code: 1152, category: 1 /* Error */, key: "'var', 'let' or 'const' expected." }, + let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: 1 /* Error */, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: 1 /* Error */, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_must_be_initialized: { code: 1155, category: 1 /* Error */, key: "'const' declarations must be initialized" }, + const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: 1 /* Error */, key: "'const' declarations can only be declared inside a block." }, + let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: 1 /* Error */, key: "'let' declarations can only be declared inside a block." }, + Invalid_template_literal_expected: { code: 1158, category: 1 /* Error */, key: "Invalid template literal; expected '}'" }, + Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1159, category: 1 /* Error */, key: "Tagged templates are only available when targeting ECMAScript 6 and higher." }, + Unterminated_template_literal: { code: 1160, category: 1 /* Error */, key: "Unterminated template literal." }, + Unterminated_regular_expression_literal: { code: 1161, category: 1 /* Error */, key: "Unterminated regular expression literal." }, + An_object_member_cannot_be_declared_optional: { code: 1162, category: 1 /* Error */, key: "An object member cannot be declared optional." }, + Duplicate_identifier_0: { code: 2300, category: 1 /* Error */, key: "Duplicate identifier '{0}'." }, + Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1 /* Error */, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, + Static_members_cannot_reference_class_type_parameters: { code: 2302, category: 1 /* Error */, key: "Static members cannot reference class type parameters." }, + Circular_definition_of_import_alias_0: { code: 2303, category: 1 /* Error */, key: "Circular definition of import alias '{0}'." }, + Cannot_find_name_0: { code: 2304, category: 1 /* Error */, key: "Cannot find name '{0}'." }, + Module_0_has_no_exported_member_1: { code: 2305, category: 1 /* Error */, key: "Module '{0}' has no exported member '{1}'." }, + File_0_is_not_an_external_module: { code: 2306, category: 1 /* Error */, key: "File '{0}' is not an external module." }, + Cannot_find_external_module_0: { code: 2307, category: 1 /* Error */, key: "Cannot find external module '{0}'." }, + A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: 1 /* Error */, key: "A module cannot have more than one export assignment." }, + An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: 1 /* Error */, key: "An export assignment cannot be used in a module with other exported elements." }, + Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: 1 /* Error */, key: "Type '{0}' recursively references itself as a base type." }, + A_class_may_only_extend_another_class: { code: 2311, category: 1 /* Error */, key: "A class may only extend another class." }, + An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: 1 /* Error */, key: "An interface may only extend a class or another interface." }, + Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: 1 /* Error */, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, + Generic_type_0_requires_1_type_argument_s: { code: 2314, category: 1 /* Error */, key: "Generic type '{0}' requires {1} type argument(s)." }, + Type_0_is_not_generic: { code: 2315, category: 1 /* Error */, key: "Type '{0}' is not generic." }, + Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: 1 /* Error */, key: "Global type '{0}' must be a class or interface type." }, + Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1 /* Error */, key: "Global type '{0}' must have {1} type parameter(s)." }, + Cannot_find_global_type_0: { code: 2318, category: 1 /* Error */, key: "Cannot find global type '{0}'." }, + Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1 /* Error */, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, + Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: 1 /* Error */, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, + Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1 /* Error */, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, + Type_0_is_not_assignable_to_type_1: { code: 2322, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}'." }, + Property_0_is_missing_in_type_1: { code: 2324, category: 1 /* Error */, key: "Property '{0}' is missing in type '{1}'." }, + Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: 1 /* Error */, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, + Types_of_property_0_are_incompatible: { code: 2326, category: 1 /* Error */, key: "Types of property '{0}' are incompatible." }, + Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: 1 /* Error */, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, + Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible." }, + Index_signature_is_missing_in_type_0: { code: 2329, category: 1 /* Error */, key: "Index signature is missing in type '{0}'." }, + Index_signatures_are_incompatible: { code: 2330, category: 1 /* Error */, key: "Index signatures are incompatible." }, + this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1 /* Error */, key: "'this' cannot be referenced in a module body." }, + this_cannot_be_referenced_in_current_location: { code: 2332, category: 1 /* Error */, key: "'this' cannot be referenced in current location." }, + this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1 /* Error */, key: "'this' cannot be referenced in constructor arguments." }, + this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: 1 /* Error */, key: "'this' cannot be referenced in a static property initializer." }, + super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: 1 /* Error */, key: "'super' can only be referenced in a derived class." }, + super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: 1 /* Error */, key: "'super' cannot be referenced in constructor arguments." }, + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: 1 /* Error */, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, + super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: 1 /* Error */, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, + Property_0_does_not_exist_on_type_1: { code: 2339, category: 1 /* Error */, key: "Property '{0}' does not exist on type '{1}'." }, + Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1 /* Error */, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, + Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: 1 /* Error */, key: "Property '{0}' is private and only accessible within class '{1}'." }, + An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: 1 /* Error */, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, + Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}'." }, + Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1 /* Error */, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, + Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1 /* Error */, key: "Supplied parameters do not match any signature of call target." }, + Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: 1 /* Error */, key: "Untyped function calls may not accept type arguments." }, + Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: 1 /* Error */, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, + Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: 1 /* Error */, key: "Cannot invoke an expression whose type lacks a call signature." }, + Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1 /* Error */, key: "Only a void function can be called with the 'new' keyword." }, + Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1 /* Error */, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, + Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, + No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1 /* Error */, key: "No best common type exists among return expressions." }, + A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1 /* Error */, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, + An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1 /* Error */, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: 1 /* Error */, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, + The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: 1 /* Error */, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, + The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: 1 /* Error */, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, + The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2360, category: 1 /* Error */, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: 1 /* Error */, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, + The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: 1 /* Error */, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: 1 /* Error */, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: 1 /* Error */, key: "Invalid left-hand side of assignment expression." }, + Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: 1 /* Error */, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, + Type_parameter_name_cannot_be_0: { code: 2368, category: 1 /* Error */, key: "Type parameter name cannot be '{0}'" }, + A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: 1 /* Error */, key: "A parameter property is only allowed in a constructor implementation." }, + A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: 1 /* Error */, key: "A rest parameter must be of an array type." }, + A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: 1 /* Error */, key: "A parameter initializer is only allowed in a function or constructor implementation." }, + Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: 1 /* Error */, key: "Parameter '{0}' cannot be referenced in its initializer." }, + Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: 1 /* Error */, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, + Duplicate_string_index_signature: { code: 2374, category: 1 /* Error */, key: "Duplicate string index signature." }, + Duplicate_number_index_signature: { code: 2375, category: 1 /* Error */, key: "Duplicate number index signature." }, + A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: 1 /* Error */, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, + Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: 1 /* Error */, key: "Constructors for derived classes must contain a 'super' call." }, + A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: 1 /* Error */, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, + Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: 1 /* Error */, key: "Getter and setter accessors do not agree in visibility." }, + get_and_set_accessor_must_have_the_same_type: { code: 2380, category: 1 /* Error */, key: "'get' and 'set' accessor must have the same type." }, + A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: 1 /* Error */, key: "A signature with an implementation cannot use a string literal type." }, + Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: 1 /* Error */, key: "Specialized overload signature is not assignable to any non-specialized signature." }, + Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: 1 /* Error */, key: "Overload signatures must all be exported or not exported." }, + Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: 1 /* Error */, key: "Overload signatures must all be ambient or non-ambient." }, + Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: 1 /* Error */, key: "Overload signatures must all be public, private or protected." }, + Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: 1 /* Error */, key: "Overload signatures must all be optional or required." }, + Function_overload_must_be_static: { code: 2387, category: 1 /* Error */, key: "Function overload must be static." }, + Function_overload_must_not_be_static: { code: 2388, category: 1 /* Error */, key: "Function overload must not be static." }, + Function_implementation_name_must_be_0: { code: 2389, category: 1 /* Error */, key: "Function implementation name must be '{0}'." }, + Constructor_implementation_is_missing: { code: 2390, category: 1 /* Error */, key: "Constructor implementation is missing." }, + Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: 1 /* Error */, key: "Function implementation is missing or not immediately following the declaration." }, + Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: 1 /* Error */, key: "Multiple constructor implementations are not allowed." }, + Duplicate_function_implementation: { code: 2393, category: 1 /* Error */, key: "Duplicate function implementation." }, + Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: 1 /* Error */, key: "Overload signature is not compatible with function implementation." }, + Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: 1 /* Error */, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, + Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: 1 /* Error */, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, + Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: { code: 2397, category: 1 /* Error */, key: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter." }, + Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: { code: 2398, category: 1 /* Error */, key: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter." }, + Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: 1 /* Error */, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, + Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: 1 /* Error */, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, + Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: 1 /* Error */, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, + Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: 1 /* Error */, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, + Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: 1 /* Error */, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, + The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, + The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, + Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: 1 /* Error */, key: "Invalid left-hand side in 'for...in' statement." }, + The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: 1 /* Error */, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, + Setters_cannot_return_a_value: { code: 2408, category: 1 /* Error */, key: "Setters cannot return a value." }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: 1 /* Error */, key: "Return type of constructor signature must be assignable to the instance type of the class" }, + All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: 1 /* Error */, key: "All symbols within a 'with' block will be resolved to 'any'." }, + Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, + Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, + Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1 /* Error */, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, + Class_name_cannot_be_0: { code: 2414, category: 1 /* Error */, key: "Class name cannot be '{0}'" }, + Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}'." }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, + Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1 /* Error */, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, + Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}'." }, + A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1 /* Error */, key: "A class may only implement another class or interface." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: 1 /* Error */, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1 /* Error */, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, + Interface_name_cannot_be_0: { code: 2427, category: 1 /* Error */, key: "Interface name cannot be '{0}'" }, + All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1 /* Error */, key: "All declarations of an interface must have identical type parameters." }, + Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}'." }, + Enum_name_cannot_be_0: { code: 2431, category: 1 /* Error */, key: "Enum name cannot be '{0}'" }, + In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: 1 /* Error */, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, + A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: 1 /* Error */, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, + A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: 1 /* Error */, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, + Ambient_external_modules_cannot_be_nested_in_other_modules: { code: 2435, category: 1 /* Error */, key: "Ambient external modules cannot be nested in other modules." }, + Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: 1 /* Error */, key: "Ambient external module declaration cannot specify relative module name." }, + Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: 1 /* Error */, key: "Module '{0}' is hidden by a local declaration with the same name" }, + Import_name_cannot_be_0: { code: 2438, category: 1 /* Error */, key: "Import name cannot be '{0}'" }, + Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: 1 /* Error */, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." }, + Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: 1 /* Error */, key: "Import declaration conflicts with local declaration of '{0}'" }, + Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { code: 2441, category: 1 /* Error */, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, + Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: 1 /* Error */, key: "Types have separate declarations of a private property '{0}'." }, + Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: 1 /* Error */, key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, + Property_0_is_protected_in_type_1_but_public_in_type_2: { code: 2444, category: 1 /* Error */, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, + Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, + Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, + The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: 1 /* Error */, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, + Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: 1 /* Error */, key: "Block-scoped variable '{0}' used before its declaration.", isEarly: true }, + The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: 1 /* Error */, key: "The operand of an increment or decrement operator cannot be a constant.", isEarly: true }, + Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: 1 /* Error */, key: "Left-hand side of assignment expression cannot be a constant.", isEarly: true }, + Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: 1 /* Error */, key: "Cannot redeclare block-scoped variable '{0}'.", isEarly: true }, + An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: 1 /* Error */, key: "An enum member cannot have a numeric name." }, + The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: 1 /* Error */, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, + Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: 1 /* Error */, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, + Type_alias_0_circularly_references_itself: { code: 2456, category: 1 /* Error */, key: "Type alias '{0}' circularly references itself." }, + Type_alias_name_cannot_be_0: { code: 2457, category: 1 /* Error */, key: "Type alias name cannot be '{0}'" }, + An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: 1 /* Error */, key: "An AMD module cannot have multiple name assignments." }, + Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1 /* Error */, key: "Import declaration '{0}' is using private name '{1}'." }, + Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, + Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4003, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4005, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4007, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4009, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4011, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4013, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4015, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, + Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4017, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, + Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4018, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, + Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, + Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, + Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2: { code: 4021, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'." }, + Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, + Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, + Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, + Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: 1 /* Error */, key: "Exported variable '{0}' has or is using private name '{1}'." }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, + Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, + Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using private name '{0}'." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: 1 /* Error */, key: "Return type of public method from exported class has or is using private name '{0}'." }, + Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: 1 /* Error */, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: 1 /* Error */, key: "Return type of method from exported interface has or is using private name '{0}'." }, + Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, + Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: 1 /* Error */, key: "Return type of exported function has or is using private name '{0}'." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, + Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4079, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, + Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2: { code: 4080, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from private module '{2}'." }, + Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using private name '{1}'." }, + Enum_declarations_must_all_be_const_or_non_const: { code: 4082, category: 1 /* Error */, key: "Enum declarations must all be const or non-const." }, + In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 4083, category: 1 /* Error */, key: "In 'const' enum declarations member initializer must be constant expression.", isEarly: true }, + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 4084, category: 1 /* Error */, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, + Index_expression_arguments_in_const_enums_must_be_of_type_string: { code: 4085, category: 1 /* Error */, key: "Index expression arguments in 'const' enums must be of type 'string'." }, + const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 4086, category: 1 /* Error */, key: "'const' enum member initializer was evaluated to a non-finite value." }, + const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 4087, category: 1 /* Error */, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, + The_current_host_does_not_support_the_0_option: { code: 5001, category: 1 /* Error */, key: "The current host does not support the '{0}' option." }, + Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1 /* Error */, key: "Cannot find the common subdirectory path for the input files." }, + Cannot_read_file_0_Colon_1: { code: 5012, category: 1 /* Error */, key: "Cannot read file '{0}': {1}" }, + Unsupported_file_encoding: { code: 5013, category: 1 /* Error */, key: "Unsupported file encoding." }, + Unknown_compiler_option_0: { code: 5023, category: 1 /* Error */, key: "Unknown compiler option '{0}'." }, + Could_not_write_file_0_Colon_1: { code: 5033, category: 1 /* Error */, key: "Could not write file '{0}': {1}" }, + Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: 1 /* Error */, key: "Option mapRoot cannot be specified without specifying sourcemap option." }, + Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: 1 /* Error */, key: "Option sourceRoot cannot be specified without specifying sourcemap option." }, + Concatenate_and_emit_output_to_single_file: { code: 6001, category: 2 /* Message */, key: "Concatenate and emit output to single file." }, + Generates_corresponding_d_ts_file: { code: 6002, category: 2 /* Message */, key: "Generates corresponding '.d.ts' file." }, + Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: 2 /* Message */, key: "Specifies the location where debugger should locate map files instead of generated locations." }, + Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: 2 /* Message */, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, + Watch_input_files: { code: 6005, category: 2 /* Message */, key: "Watch input files." }, + Redirect_output_structure_to_the_directory: { code: 6006, category: 2 /* Message */, key: "Redirect output structure to the directory." }, + Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: 2 /* Message */, key: "Do not erase const enum declarations in generated code." }, + Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { code: 6008, category: 2 /* Message */, key: "Do not emit outputs if any type checking errors were reported." }, + Do_not_emit_comments_to_output: { code: 6009, category: 2 /* Message */, key: "Do not emit comments to output." }, + Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, + Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2 /* Message */, key: "Specify module code generation: 'commonjs' or 'amd'" }, + Print_this_message: { code: 6017, category: 2 /* Message */, key: "Print this message." }, + Print_the_compiler_s_version: { code: 6019, category: 2 /* Message */, key: "Print the compiler's version." }, + Syntax_Colon_0: { code: 6023, category: 2 /* Message */, key: "Syntax: {0}" }, + options: { code: 6024, category: 2 /* Message */, key: "options" }, + file: { code: 6025, category: 2 /* Message */, key: "file" }, + Examples_Colon_0: { code: 6026, category: 2 /* Message */, key: "Examples: {0}" }, + Options_Colon: { code: 6027, category: 2 /* Message */, key: "Options:" }, + Version_0: { code: 6029, category: 2 /* Message */, key: "Version {0}" }, + Insert_command_line_options_and_files_from_a_file: { code: 6030, category: 2 /* Message */, key: "Insert command line options and files from a file." }, + File_change_detected_Compiling: { code: 6032, category: 2 /* Message */, key: "File change detected. Compiling..." }, + KIND: { code: 6034, category: 2 /* Message */, key: "KIND" }, + FILE: { code: 6035, category: 2 /* Message */, key: "FILE" }, + VERSION: { code: 6036, category: 2 /* Message */, key: "VERSION" }, + LOCATION: { code: 6037, category: 2 /* Message */, key: "LOCATION" }, + DIRECTORY: { code: 6038, category: 2 /* Message */, key: "DIRECTORY" }, + Compilation_complete_Watching_for_file_changes: { code: 6042, category: 2 /* Message */, key: "Compilation complete. Watching for file changes." }, + Generates_corresponding_map_file: { code: 6043, category: 2 /* Message */, key: "Generates corresponding '.map' file." }, + Compiler_option_0_expects_an_argument: { code: 6044, category: 1 /* Error */, key: "Compiler option '{0}' expects an argument." }, + Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1 /* Error */, key: "Unterminated quoted string in response file '{0}'." }, + Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1 /* Error */, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, + Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." }, + Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: 1 /* Error */, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, + Unsupported_locale_0: { code: 6049, category: 1 /* Error */, key: "Unsupported locale '{0}'." }, + Unable_to_open_file_0: { code: 6050, category: 1 /* Error */, key: "Unable to open file '{0}'." }, + Corrupted_locale_file_0: { code: 6051, category: 1 /* Error */, key: "Corrupted locale file {0}." }, + Warn_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: 2 /* Message */, key: "Warn on expressions and declarations with an implied 'any' type." }, + File_0_not_found: { code: 6053, category: 1 /* Error */, key: "File '{0}' not found." }, + File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: 1 /* Error */, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, + Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1 /* Error */, key: "Variable '{0}' implicitly has an '{1}' type." }, + Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1 /* Error */, key: "Parameter '{0}' implicitly has an '{1}' type." }, + Member_0_implicitly_has_an_1_type: { code: 7008, category: 1 /* Error */, key: "Member '{0}' implicitly has an '{1}' type." }, + new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: 1 /* Error */, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, + _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: 1 /* Error */, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, + Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: 1 /* Error */, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, + Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: 1 /* Error */, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: 1 /* Error */, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, + Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1 /* Error */, key: "Index signature of object type implicitly has an 'any' type." }, + Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1 /* Error */, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, + Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1 /* Error */, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, + Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1 /* Error */, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 7021, category: 1 /* Error */, key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." }, + _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { code: 7022, category: 1 /* Error */, key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." }, + _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: { code: 7023, category: 1 /* Error */, key: "'{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." }, + 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: { code: 7024, category: 1 /* Error */, key: "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." }, + You_cannot_rename_this_element: { code: 8000, category: 1 /* Error */, key: "You cannot rename this element." } + }; +})(ts || (ts = {})); +var ts; +(function (ts) { + var textToToken = { + "any": 109 /* AnyKeyword */, + "boolean": 110 /* BooleanKeyword */, + "break": 64 /* BreakKeyword */, + "case": 65 /* CaseKeyword */, + "catch": 66 /* CatchKeyword */, + "class": 67 /* ClassKeyword */, + "continue": 69 /* ContinueKeyword */, + "const": 68 /* ConstKeyword */, + "constructor": 111 /* ConstructorKeyword */, + "debugger": 70 /* DebuggerKeyword */, + "declare": 112 /* DeclareKeyword */, + "default": 71 /* DefaultKeyword */, + "delete": 72 /* DeleteKeyword */, + "do": 73 /* DoKeyword */, + "else": 74 /* ElseKeyword */, + "enum": 75 /* EnumKeyword */, + "export": 76 /* ExportKeyword */, + "extends": 77 /* ExtendsKeyword */, + "false": 78 /* FalseKeyword */, + "finally": 79 /* FinallyKeyword */, + "for": 80 /* ForKeyword */, + "function": 81 /* FunctionKeyword */, + "get": 113 /* GetKeyword */, + "if": 82 /* IfKeyword */, + "implements": 100 /* ImplementsKeyword */, + "import": 83 /* ImportKeyword */, + "in": 84 /* InKeyword */, + "instanceof": 85 /* InstanceOfKeyword */, + "interface": 101 /* InterfaceKeyword */, + "let": 102 /* LetKeyword */, + "module": 114 /* ModuleKeyword */, + "new": 86 /* NewKeyword */, + "null": 87 /* NullKeyword */, + "number": 116 /* NumberKeyword */, + "package": 103 /* PackageKeyword */, + "private": 104 /* PrivateKeyword */, + "protected": 105 /* ProtectedKeyword */, + "public": 106 /* PublicKeyword */, + "require": 115 /* RequireKeyword */, + "return": 88 /* ReturnKeyword */, + "set": 117 /* SetKeyword */, + "static": 107 /* StaticKeyword */, + "string": 118 /* StringKeyword */, + "super": 89 /* SuperKeyword */, + "switch": 90 /* SwitchKeyword */, + "this": 91 /* ThisKeyword */, + "throw": 92 /* ThrowKeyword */, + "true": 93 /* TrueKeyword */, + "try": 94 /* TryKeyword */, + "type": 119 /* TypeKeyword */, + "typeof": 95 /* TypeOfKeyword */, + "var": 96 /* VarKeyword */, + "void": 97 /* VoidKeyword */, + "while": 98 /* WhileKeyword */, + "with": 99 /* WithKeyword */, + "yield": 108 /* YieldKeyword */, + "{": 13 /* OpenBraceToken */, + "}": 14 /* CloseBraceToken */, + "(": 15 /* OpenParenToken */, + ")": 16 /* CloseParenToken */, + "[": 17 /* OpenBracketToken */, + "]": 18 /* CloseBracketToken */, + ".": 19 /* DotToken */, + "...": 20 /* DotDotDotToken */, + ";": 21 /* SemicolonToken */, + ",": 22 /* CommaToken */, + "<": 23 /* LessThanToken */, + ">": 24 /* GreaterThanToken */, + "<=": 25 /* LessThanEqualsToken */, + ">=": 26 /* GreaterThanEqualsToken */, + "==": 27 /* EqualsEqualsToken */, + "!=": 28 /* ExclamationEqualsToken */, + "===": 29 /* EqualsEqualsEqualsToken */, + "!==": 30 /* ExclamationEqualsEqualsToken */, + "=>": 31 /* EqualsGreaterThanToken */, + "+": 32 /* PlusToken */, + "-": 33 /* MinusToken */, + "*": 34 /* AsteriskToken */, + "/": 35 /* SlashToken */, + "%": 36 /* PercentToken */, + "++": 37 /* PlusPlusToken */, + "--": 38 /* MinusMinusToken */, + "<<": 39 /* LessThanLessThanToken */, + ">>": 40 /* GreaterThanGreaterThanToken */, + ">>>": 41 /* GreaterThanGreaterThanGreaterThanToken */, + "&": 42 /* AmpersandToken */, + "|": 43 /* BarToken */, + "^": 44 /* CaretToken */, + "!": 45 /* ExclamationToken */, + "~": 46 /* TildeToken */, + "&&": 47 /* AmpersandAmpersandToken */, + "||": 48 /* BarBarToken */, + "?": 49 /* QuestionToken */, + ":": 50 /* ColonToken */, + "=": 51 /* EqualsToken */, + "+=": 52 /* PlusEqualsToken */, + "-=": 53 /* MinusEqualsToken */, + "*=": 54 /* AsteriskEqualsToken */, + "/=": 55 /* SlashEqualsToken */, + "%=": 56 /* PercentEqualsToken */, + "<<=": 57 /* LessThanLessThanEqualsToken */, + ">>=": 58 /* GreaterThanGreaterThanEqualsToken */, + ">>>=": 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */, + "&=": 60 /* AmpersandEqualsToken */, + "|=": 61 /* BarEqualsToken */, + "^=": 62 /* CaretEqualsToken */ + }; + var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + function lookupInUnicodeMap(code, map) { + if (code < map[0]) { + return false; + } + var lo = 0; + var hi = map.length; + var mid; + while (lo + 1 < hi) { + mid = lo + (hi - lo) / 2; + mid -= mid % 2; + if (map[mid] <= code && code <= map[mid + 1]) { + return true; + } + if (code < map[mid]) { + hi = mid; + } + else { + lo = mid + 2; + } + } + return false; + } + function isUnicodeIdentifierStart(code, languageVersion) { + return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierStart) : lookupInUnicodeMap(code, unicodeES5IdentifierStart); + } + function isUnicodeIdentifierPart(code, languageVersion) { + return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierPart) : lookupInUnicodeMap(code, unicodeES5IdentifierPart); + } + function makeReverseMap(source) { + var result = []; + for (var name in source) { + if (source.hasOwnProperty(name)) { + result[source[name]] = name; + } + } + return result; + } + var tokenStrings = makeReverseMap(textToToken); + function tokenToString(t) { + return tokenStrings[t]; + } + ts.tokenToString = tokenToString; + function computeLineStarts(text) { + var result = new Array(); + var pos = 0; + var lineStart = 0; + while (pos < text.length) { + var ch = text.charCodeAt(pos++); + switch (ch) { + case 13 /* carriageReturn */: + if (text.charCodeAt(pos) === 10 /* lineFeed */) { + pos++; + } + case 10 /* lineFeed */: + result.push(lineStart); + lineStart = pos; + break; + default: + if (ch > 127 /* maxAsciiCharacter */ && isLineBreak(ch)) { + result.push(lineStart); + lineStart = pos; + } + break; + } + } + result.push(lineStart); + return result; + } + ts.computeLineStarts = computeLineStarts; + function getPositionFromLineAndCharacter(lineStarts, line, character) { + ts.Debug.assert(line > 0); + return lineStarts[line - 1] + character - 1; + } + ts.getPositionFromLineAndCharacter = getPositionFromLineAndCharacter; + function getLineAndCharacterOfPosition(lineStarts, position) { + var lineNumber = ts.binarySearch(lineStarts, position); + if (lineNumber < 0) { + lineNumber = (~lineNumber) - 1; + } + return { + line: lineNumber + 1, + character: position - lineStarts[lineNumber] + 1 + }; + } + ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; + function positionToLineAndCharacter(text, pos) { + var lineStarts = computeLineStarts(text); + return getLineAndCharacterOfPosition(lineStarts, pos); + } + ts.positionToLineAndCharacter = positionToLineAndCharacter; + var hasOwnProperty = Object.prototype.hasOwnProperty; + function isWhiteSpace(ch) { + return ch === 32 /* space */ || ch === 9 /* tab */ || ch === 11 /* verticalTab */ || ch === 12 /* formFeed */ || ch === 160 /* nonBreakingSpace */ || ch === 5760 /* ogham */ || ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ || ch === 8239 /* narrowNoBreakSpace */ || ch === 8287 /* mathematicalSpace */ || ch === 12288 /* ideographicSpace */ || ch === 65279 /* byteOrderMark */; + } + ts.isWhiteSpace = isWhiteSpace; + function isLineBreak(ch) { + return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */ || ch === 133 /* nextLine */; + } + ts.isLineBreak = isLineBreak; + function isDigit(ch) { + return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; + } + function isOctalDigit(ch) { + return ch >= 48 /* _0 */ && ch <= 55 /* _7 */; + } + ts.isOctalDigit = isOctalDigit; + function skipTrivia(text, pos, stopAfterLineBreak) { + while (true) { + var ch = text.charCodeAt(pos); + switch (ch) { + case 13 /* carriageReturn */: + if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) + pos++; + case 10 /* lineFeed */: + pos++; + if (stopAfterLineBreak) + return pos; + continue; + case 9 /* tab */: + case 11 /* verticalTab */: + case 12 /* formFeed */: + case 32 /* space */: + pos++; + continue; + case 47 /* slash */: + if (text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + while (pos < text.length) { + if (isLineBreak(text.charCodeAt(pos))) { + break; + } + pos++; + } + continue; + } + if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { + pos += 2; + while (pos < text.length) { + if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + break; + } + pos++; + } + continue; + } + break; + default: + if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { + pos++; + continue; + } + break; + } + return pos; + } + } + ts.skipTrivia = skipTrivia; + function getCommentRanges(text, pos, trailing) { + var result; + var collecting = trailing || pos === 0; + while (true) { + var ch = text.charCodeAt(pos); + switch (ch) { + case 13 /* carriageReturn */: + if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) + pos++; + case 10 /* lineFeed */: + pos++; + if (trailing) { + return result; + } + collecting = true; + if (result && result.length) { + result[result.length - 1].hasTrailingNewLine = true; + } + continue; + case 9 /* tab */: + case 11 /* verticalTab */: + case 12 /* formFeed */: + case 32 /* space */: + pos++; + continue; + case 47 /* slash */: + var nextChar = text.charCodeAt(pos + 1); + var hasTrailingNewLine = false; + if (nextChar === 47 /* slash */ || nextChar === 42 /* asterisk */) { + var startPos = pos; + pos += 2; + if (nextChar === 47 /* slash */) { + while (pos < text.length) { + if (isLineBreak(text.charCodeAt(pos))) { + hasTrailingNewLine = true; + break; + } + pos++; + } + } + else { + while (pos < text.length) { + if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + break; + } + pos++; + } + } + if (collecting) { + if (!result) + result = []; + result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); + } + continue; + } + break; + default: + if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { + if (result && result.length && isLineBreak(ch)) { + result[result.length - 1].hasTrailingNewLine = true; + } + pos++; + continue; + } + break; + } + return result; + } + } + function getLeadingCommentRanges(text, pos) { + return getCommentRanges(text, pos, false); + } + ts.getLeadingCommentRanges = getLeadingCommentRanges; + function getTrailingCommentRanges(text, pos) { + return getCommentRanges(text, pos, true); + } + ts.getTrailingCommentRanges = getTrailingCommentRanges; + function isIdentifierStart(ch, languageVersion) { + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); + } + ts.isIdentifierStart = isIdentifierStart; + function isIdentifierPart(ch, languageVersion) { + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); + } + ts.isIdentifierPart = isIdentifierPart; + function createScanner(languageVersion, skipTrivia, text, onError, onComment) { + var pos; + var len; + var startPos; + var tokenPos; + var token; + var tokenValue; + var precedingLineBreak; + function error(message) { + if (onError) { + onError(message); + } + } + function isIdentifierStart(ch) { + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); + } + function isIdentifierPart(ch) { + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); + } + function scanNumber() { + var start = pos; + while (isDigit(text.charCodeAt(pos))) + pos++; + if (text.charCodeAt(pos) === 46 /* dot */) { + pos++; + while (isDigit(text.charCodeAt(pos))) + pos++; + } + var end = pos; + if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { + pos++; + if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) + pos++; + if (isDigit(text.charCodeAt(pos))) { + pos++; + while (isDigit(text.charCodeAt(pos))) + pos++; + end = pos; + } + else { + error(ts.Diagnostics.Digit_expected); + } + } + return +(text.substring(start, end)); + } + function scanOctalDigits() { + var start = pos; + while (isOctalDigit(text.charCodeAt(pos))) { + pos++; + } + return +(text.substring(start, pos)); + } + function scanHexDigits(count, mustMatchCount) { + var digits = 0; + var value = 0; + while (digits < count || !mustMatchCount) { + var ch = text.charCodeAt(pos); + if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { + value = value * 16 + ch - 48 /* _0 */; + } + else if (ch >= 65 /* A */ && ch <= 70 /* F */) { + value = value * 16 + ch - 65 /* A */ + 10; + } + else if (ch >= 97 /* a */ && ch <= 102 /* f */) { + value = value * 16 + ch - 97 /* a */ + 10; + } + else { + break; + } + pos++; + digits++; + } + if (digits < count) { + value = -1; + } + return value; + } + function scanString() { + var quote = text.charCodeAt(pos++); + var result = ""; + var start = pos; + while (true) { + if (pos >= len) { + result += text.substring(start, pos); + error(ts.Diagnostics.Unterminated_string_literal); + break; + } + var ch = text.charCodeAt(pos); + if (ch === quote) { + result += text.substring(start, pos); + pos++; + break; + } + if (ch === 92 /* backslash */) { + result += text.substring(start, pos); + result += scanEscapeSequence(); + start = pos; + continue; + } + if (isLineBreak(ch)) { + result += text.substring(start, pos); + error(ts.Diagnostics.Unterminated_string_literal); + break; + } + pos++; + } + return result; + } + function scanTemplateAndSetTokenValue() { + var startedWithBacktick = text.charCodeAt(pos) === 96 /* backtick */; + pos++; + var start = pos; + var contents = ""; + var resultingToken; + while (true) { + if (pos >= len) { + contents += text.substring(start, pos); + error(ts.Diagnostics.Unterminated_template_literal); + resultingToken = startedWithBacktick ? 9 /* NoSubstitutionTemplateLiteral */ : 12 /* TemplateTail */; + break; + } + var currChar = text.charCodeAt(pos); + if (currChar === 96 /* backtick */) { + contents += text.substring(start, pos); + pos++; + resultingToken = startedWithBacktick ? 9 /* NoSubstitutionTemplateLiteral */ : 12 /* TemplateTail */; + break; + } + if (currChar === 36 /* $ */ && pos + 1 < len && text.charCodeAt(pos + 1) === 123 /* openBrace */) { + contents += text.substring(start, pos); + pos += 2; + resultingToken = startedWithBacktick ? 10 /* TemplateHead */ : 11 /* TemplateMiddle */; + break; + } + if (currChar === 92 /* backslash */) { + contents += text.substring(start, pos); + contents += scanEscapeSequence(); + start = pos; + continue; + } + if (currChar === 13 /* carriageReturn */) { + contents += text.substring(start, pos); + if (pos + 1 < len && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { + pos++; + } + pos++; + contents += "\n"; + start = pos; + continue; + } + pos++; + } + ts.Debug.assert(resultingToken !== undefined); + tokenValue = contents; + return resultingToken; + } + function scanEscapeSequence() { + pos++; + if (pos >= len) { + error(ts.Diagnostics.Unexpected_end_of_text); + return ""; + } + var ch = text.charCodeAt(pos++); + switch (ch) { + case 48 /* _0 */: + return "\0"; + case 98 /* b */: + return "\b"; + case 116 /* t */: + return "\t"; + case 110 /* n */: + return "\n"; + case 118 /* v */: + return "\v"; + case 102 /* f */: + return "\f"; + case 114 /* r */: + return "\r"; + case 39 /* singleQuote */: + return "\'"; + case 34 /* doubleQuote */: + return "\""; + case 120 /* x */: + case 117 /* u */: + var ch = scanHexDigits(ch === 120 /* x */ ? 2 : 4, true); + if (ch >= 0) { + return String.fromCharCode(ch); + } + else { + error(ts.Diagnostics.Hexadecimal_digit_expected); + return ""; + } + case 13 /* carriageReturn */: + if (pos < len && text.charCodeAt(pos) === 10 /* lineFeed */) { + pos++; + } + case 10 /* lineFeed */: + case 8232 /* lineSeparator */: + case 8233 /* paragraphSeparator */: + return ""; + default: + return String.fromCharCode(ch); + } + } + function peekUnicodeEscape() { + if (pos + 5 < len && text.charCodeAt(pos + 1) === 117 /* u */) { + var start = pos; + pos += 2; + var value = scanHexDigits(4, true); + pos = start; + return value; + } + return -1; + } + function scanIdentifierParts() { + var result = ""; + var start = pos; + while (pos < len) { + var ch = text.charCodeAt(pos); + if (isIdentifierPart(ch)) { + pos++; + } + else if (ch === 92 /* backslash */) { + ch = peekUnicodeEscape(); + if (!(ch >= 0 && isIdentifierPart(ch))) { + break; + } + result += text.substring(start, pos); + result += String.fromCharCode(ch); + pos += 6; + start = pos; + } + else { + break; + } + } + result += text.substring(start, pos); + return result; + } + function getIdentifierToken() { + var len = tokenValue.length; + if (len >= 2 && len <= 11) { + var ch = tokenValue.charCodeAt(0); + if (ch >= 97 /* a */ && ch <= 122 /* z */ && hasOwnProperty.call(textToToken, tokenValue)) { + return token = textToToken[tokenValue]; + } + } + return token = 63 /* Identifier */; + } + function scan() { + startPos = pos; + precedingLineBreak = false; + while (true) { + tokenPos = pos; + if (pos >= len) { + return token = 1 /* EndOfFileToken */; + } + var ch = text.charCodeAt(pos); + switch (ch) { + case 10 /* lineFeed */: + case 13 /* carriageReturn */: + precedingLineBreak = true; + if (skipTrivia) { + pos++; + continue; + } + else { + if (ch === 13 /* carriageReturn */ && pos + 1 < len && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { + pos += 2; + } + else { + pos++; + } + return token = 4 /* NewLineTrivia */; + } + case 9 /* tab */: + case 11 /* verticalTab */: + case 12 /* formFeed */: + case 32 /* space */: + if (skipTrivia) { + pos++; + continue; + } + else { + while (pos < len && isWhiteSpace(text.charCodeAt(pos))) { + pos++; + } + return token = 5 /* WhitespaceTrivia */; + } + case 33 /* exclamation */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 30 /* ExclamationEqualsEqualsToken */; + } + return pos += 2, token = 28 /* ExclamationEqualsToken */; + } + return pos++, token = 45 /* ExclamationToken */; + case 34 /* doubleQuote */: + case 39 /* singleQuote */: + tokenValue = scanString(); + return token = 7 /* StringLiteral */; + case 96 /* backtick */: + return token = scanTemplateAndSetTokenValue(); + case 37 /* percent */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 56 /* PercentEqualsToken */; + } + return pos++, token = 36 /* PercentToken */; + case 38 /* ampersand */: + if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { + return pos += 2, token = 47 /* AmpersandAmpersandToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 60 /* AmpersandEqualsToken */; + } + return pos++, token = 42 /* AmpersandToken */; + case 40 /* openParen */: + return pos++, token = 15 /* OpenParenToken */; + case 41 /* closeParen */: + return pos++, token = 16 /* CloseParenToken */; + case 42 /* asterisk */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 54 /* AsteriskEqualsToken */; + } + return pos++, token = 34 /* AsteriskToken */; + case 43 /* plus */: + if (text.charCodeAt(pos + 1) === 43 /* plus */) { + return pos += 2, token = 37 /* PlusPlusToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 52 /* PlusEqualsToken */; + } + return pos++, token = 32 /* PlusToken */; + case 44 /* comma */: + return pos++, token = 22 /* CommaToken */; + case 45 /* minus */: + if (text.charCodeAt(pos + 1) === 45 /* minus */) { + return pos += 2, token = 38 /* MinusMinusToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 53 /* MinusEqualsToken */; + } + return pos++, token = 33 /* MinusToken */; + case 46 /* dot */: + if (isDigit(text.charCodeAt(pos + 1))) { + tokenValue = "" + scanNumber(); + return token = 6 /* NumericLiteral */; + } + if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { + return pos += 3, token = 20 /* DotDotDotToken */; + } + return pos++, token = 19 /* DotToken */; + case 47 /* slash */: + if (text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + while (pos < len) { + if (isLineBreak(text.charCodeAt(pos))) { + break; + } + pos++; + } + if (onComment) { + onComment(tokenPos, pos); + } + if (skipTrivia) { + continue; + } + else { + return token = 2 /* SingleLineCommentTrivia */; + } + } + if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { + pos += 2; + var commentClosed = false; + while (pos < len) { + var ch = text.charCodeAt(pos); + if (ch === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + commentClosed = true; + break; + } + if (isLineBreak(ch)) { + precedingLineBreak = true; + } + pos++; + } + if (!commentClosed) { + error(ts.Diagnostics.Asterisk_Slash_expected); + } + if (onComment) { + onComment(tokenPos, pos); + } + if (skipTrivia) { + continue; + } + else { + return token = 3 /* MultiLineCommentTrivia */; + } + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 55 /* SlashEqualsToken */; + } + return pos++, token = 35 /* SlashToken */; + case 48 /* _0 */: + if (pos + 2 < len && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { + pos += 2; + var value = scanHexDigits(1, false); + if (value < 0) { + error(ts.Diagnostics.Hexadecimal_digit_expected); + value = 0; + } + tokenValue = "" + value; + return token = 6 /* NumericLiteral */; + } + if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { + tokenValue = "" + scanOctalDigits(); + return token = 6 /* NumericLiteral */; + } + case 49 /* _1 */: + case 50 /* _2 */: + case 51 /* _3 */: + case 52 /* _4 */: + case 53 /* _5 */: + case 54 /* _6 */: + case 55 /* _7 */: + case 56 /* _8 */: + case 57 /* _9 */: + tokenValue = "" + scanNumber(); + return token = 6 /* NumericLiteral */; + case 58 /* colon */: + return pos++, token = 50 /* ColonToken */; + case 59 /* semicolon */: + return pos++, token = 21 /* SemicolonToken */; + case 60 /* lessThan */: + if (text.charCodeAt(pos + 1) === 60 /* lessThan */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 57 /* LessThanLessThanEqualsToken */; + } + return pos += 2, token = 39 /* LessThanLessThanToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 25 /* LessThanEqualsToken */; + } + return pos++, token = 23 /* LessThanToken */; + case 61 /* equals */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 29 /* EqualsEqualsEqualsToken */; + } + return pos += 2, token = 27 /* EqualsEqualsToken */; + } + if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { + return pos += 2, token = 31 /* EqualsGreaterThanToken */; + } + return pos++, token = 51 /* EqualsToken */; + case 62 /* greaterThan */: + return pos++, token = 24 /* GreaterThanToken */; + case 63 /* question */: + return pos++, token = 49 /* QuestionToken */; + case 91 /* openBracket */: + return pos++, token = 17 /* OpenBracketToken */; + case 93 /* closeBracket */: + return pos++, token = 18 /* CloseBracketToken */; + case 94 /* caret */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 62 /* CaretEqualsToken */; + } + return pos++, token = 44 /* CaretToken */; + case 123 /* openBrace */: + return pos++, token = 13 /* OpenBraceToken */; + case 124 /* bar */: + if (text.charCodeAt(pos + 1) === 124 /* bar */) { + return pos += 2, token = 48 /* BarBarToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 61 /* BarEqualsToken */; + } + return pos++, token = 43 /* BarToken */; + case 125 /* closeBrace */: + return pos++, token = 14 /* CloseBraceToken */; + case 126 /* tilde */: + return pos++, token = 46 /* TildeToken */; + case 92 /* backslash */: + var ch = peekUnicodeEscape(); + if (ch >= 0 && isIdentifierStart(ch)) { + pos += 6; + tokenValue = String.fromCharCode(ch) + scanIdentifierParts(); + return token = getIdentifierToken(); + } + error(ts.Diagnostics.Invalid_character); + return pos++, token = 0 /* Unknown */; + default: + if (isIdentifierStart(ch)) { + pos++; + while (pos < len && isIdentifierPart(ch = text.charCodeAt(pos))) + pos++; + tokenValue = text.substring(tokenPos, pos); + if (ch === 92 /* backslash */) { + tokenValue += scanIdentifierParts(); + } + return token = getIdentifierToken(); + } + else if (isWhiteSpace(ch)) { + pos++; + continue; + } + else if (isLineBreak(ch)) { + precedingLineBreak = true; + pos++; + continue; + } + error(ts.Diagnostics.Invalid_character); + return pos++, token = 0 /* Unknown */; + } + } + } + function reScanGreaterToken() { + if (token === 24 /* GreaterThanToken */) { + if (text.charCodeAt(pos) === 62 /* greaterThan */) { + if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */; + } + return pos += 2, token = 41 /* GreaterThanGreaterThanGreaterThanToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 58 /* GreaterThanGreaterThanEqualsToken */; + } + return pos++, token = 40 /* GreaterThanGreaterThanToken */; + } + if (text.charCodeAt(pos) === 61 /* equals */) { + return pos++, token = 26 /* GreaterThanEqualsToken */; + } + } + return token; + } + function reScanSlashToken() { + if (token === 35 /* SlashToken */ || token === 55 /* SlashEqualsToken */) { + var p = tokenPos + 1; + var inEscape = false; + var inCharacterClass = false; + while (true) { + if (p >= len) { + error(ts.Diagnostics.Unterminated_regular_expression_literal); + break; + } + var ch = text.charCodeAt(p); + if (isLineBreak(ch)) { + error(ts.Diagnostics.Unterminated_regular_expression_literal); + break; + } + if (inEscape) { + inEscape = false; + } + else if (ch === 47 /* slash */ && !inCharacterClass) { + p++; + break; + } + else if (ch === 91 /* openBracket */) { + inCharacterClass = true; + } + else if (ch === 92 /* backslash */) { + inEscape = true; + } + else if (ch === 93 /* closeBracket */) { + inCharacterClass = false; + } + p++; + } + while (p < len && isIdentifierPart(text.charCodeAt(p))) { + p++; + } + pos = p; + tokenValue = text.substring(tokenPos, pos); + token = 8 /* RegularExpressionLiteral */; + } + return token; + } + function reScanTemplateToken() { + ts.Debug.assert(token === 14 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'"); + pos = tokenPos; + return token = scanTemplateAndSetTokenValue(); + } + function tryScan(callback) { + var savePos = pos; + var saveStartPos = startPos; + var saveTokenPos = tokenPos; + var saveToken = token; + var saveTokenValue = tokenValue; + var savePrecedingLineBreak = precedingLineBreak; + var result = callback(); + if (!result) { + pos = savePos; + startPos = saveStartPos; + tokenPos = saveTokenPos; + token = saveToken; + tokenValue = saveTokenValue; + precedingLineBreak = savePrecedingLineBreak; + } + return result; + } + function setText(newText) { + text = newText || ""; + len = text.length; + setTextPos(0); + } + function setTextPos(textPos) { + pos = textPos; + startPos = textPos; + tokenPos = textPos; + token = 0 /* Unknown */; + precedingLineBreak = false; + } + setText(text); + return { + getStartPos: function () { return startPos; }, + getTextPos: function () { return pos; }, + getToken: function () { return token; }, + getTokenPos: function () { return tokenPos; }, + getTokenText: function () { return text.substring(tokenPos, pos); }, + getTokenValue: function () { return tokenValue; }, + hasPrecedingLineBreak: function () { return precedingLineBreak; }, + isIdentifier: function () { return token === 63 /* Identifier */ || token > 99 /* LastReservedWord */; }, + isReservedWord: function () { return token >= 64 /* FirstReservedWord */ && token <= 99 /* LastReservedWord */; }, + reScanGreaterToken: reScanGreaterToken, + reScanSlashToken: reScanSlashToken, + reScanTemplateToken: reScanTemplateToken, + scan: scan, + setText: setText, + setTextPos: setTextPos, + tryScan: tryScan + }; + } + ts.createScanner = createScanner; +})(ts || (ts = {})); +var ts; +(function (ts) { + var nodeConstructors = new Array(199 /* Count */); function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); } @@ -2205,7 +2219,7 @@ var ts; return node; } function getSourceFileOfNode(node) { - while (node && node.kind !== 193 /* SourceFile */) + while (node && node.kind !== 196 /* SourceFile */) node = node.parent; return node; } @@ -2221,6 +2235,9 @@ var ts; } ts.getStartPosOfNode = getStartPosOfNode; function getTokenPosOfNode(node, sourceFile) { + if (node.pos === node.end) { + return node.pos; + } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); } ts.getTokenPosOfNode = getTokenPosOfNode; @@ -2241,10 +2258,10 @@ var ts; return identifier.length >= 3 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ && identifier.charCodeAt(2) === 95 /* _ */ ? identifier.substr(1) : identifier; } ts.unescapeIdentifier = unescapeIdentifier; - function identifierToString(identifier) { - return identifier.kind === 120 /* Missing */ ? "(Missing)" : getTextOfNode(identifier); + function declarationNameToString(name) { + return name.kind === 120 /* Missing */ ? "(Missing)" : getTextOfNode(name); } - ts.identifierToString = identifierToString; + ts.declarationNameToString = declarationNameToString; function createDiagnosticForNode(node, message, arg0, arg1, arg2) { node = getErrorSpanForNode(node); var file = getSourceFileOfNode(node); @@ -2264,12 +2281,12 @@ var ts; function getErrorSpanForNode(node) { var errorSpan; switch (node.kind) { - case 181 /* VariableDeclaration */: - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: - case 188 /* ModuleDeclaration */: - case 187 /* EnumDeclaration */: - case 192 /* EnumMember */: + case 184 /* VariableDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 191 /* ModuleDeclaration */: + case 190 /* EnumDeclaration */: + case 195 /* EnumMember */: errorSpan = node.name; break; } @@ -2289,7 +2306,7 @@ var ts; } ts.isConstEnumDeclaration = isConstEnumDeclaration; function isPrologueDirective(node) { - return node.kind === 161 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; + return node.kind === 164 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; function isEvalOrArgumentsIdentifier(node) { @@ -2344,8 +2361,11 @@ var ts; case 123 /* Parameter */: return child(node.name) || child(node.type) || child(node.initializer); case 124 /* Property */: - case 141 /* PropertyAssignment */: + case 143 /* PropertyAssignment */: + case 144 /* ShorthandPropertyAssignment */: return child(node.name) || child(node.type) || child(node.initializer); + case 133 /* FunctionType */: + case 134 /* ConstructorType */: case 129 /* CallSignature */: case 130 /* ConstructSignature */: case 131 /* IndexSignature */: @@ -2354,110 +2374,110 @@ var ts; case 126 /* Constructor */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 149 /* FunctionExpression */: - case 182 /* FunctionDeclaration */: - case 150 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + case 153 /* ArrowFunction */: return child(node.name) || children(node.typeParameters) || children(node.parameters) || child(node.type) || child(node.body); case 132 /* TypeReference */: return child(node.typeName) || children(node.typeArguments); - case 133 /* TypeQuery */: + case 135 /* TypeQuery */: return child(node.exprName); - case 134 /* TypeLiteral */: + case 136 /* TypeLiteral */: return children(node.members); - case 135 /* ArrayType */: + case 137 /* ArrayType */: return child(node.elementType); - case 136 /* TupleType */: + case 138 /* TupleType */: return children(node.elementTypes); - case 137 /* UnionType */: + case 139 /* UnionType */: return children(node.types); - case 138 /* ParenType */: + case 140 /* ParenType */: return child(node.type); - case 139 /* ArrayLiteral */: + case 141 /* ArrayLiteral */: return children(node.elements); - case 140 /* ObjectLiteral */: + case 142 /* ObjectLiteral */: return children(node.properties); - case 142 /* PropertyAccess */: + case 145 /* PropertyAccess */: return child(node.left) || child(node.right); - case 143 /* IndexedAccess */: + case 146 /* IndexedAccess */: return child(node.object) || child(node.index); - case 144 /* CallExpression */: - case 145 /* NewExpression */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: return child(node.func) || children(node.typeArguments) || children(node.arguments); - case 146 /* TaggedTemplateExpression */: + case 149 /* TaggedTemplateExpression */: return child(node.tag) || child(node.template); - case 147 /* TypeAssertion */: + case 150 /* TypeAssertion */: return child(node.type) || child(node.operand); - case 148 /* ParenExpression */: + case 151 /* ParenExpression */: return child(node.expression); - case 151 /* PrefixOperator */: - case 152 /* PostfixOperator */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: return child(node.operand); - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: return child(node.left) || child(node.right); - case 154 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return child(node.condition) || child(node.whenTrue) || child(node.whenFalse); - case 158 /* Block */: - case 177 /* TryBlock */: - case 179 /* FinallyBlock */: - case 183 /* FunctionBlock */: - case 189 /* ModuleBlock */: - case 193 /* SourceFile */: + case 161 /* Block */: + case 180 /* TryBlock */: + case 182 /* FinallyBlock */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: + case 196 /* SourceFile */: return children(node.statements); - case 159 /* VariableStatement */: + case 162 /* VariableStatement */: return children(node.declarations); - case 161 /* ExpressionStatement */: + case 164 /* ExpressionStatement */: return child(node.expression); - case 162 /* IfStatement */: + case 165 /* IfStatement */: return child(node.expression) || child(node.thenStatement) || child(node.elseStatement); - case 163 /* DoStatement */: + case 166 /* DoStatement */: return child(node.statement) || child(node.expression); - case 164 /* WhileStatement */: + case 167 /* WhileStatement */: return child(node.expression) || child(node.statement); - case 165 /* ForStatement */: + case 168 /* ForStatement */: return children(node.declarations) || child(node.initializer) || child(node.condition) || child(node.iterator) || child(node.statement); - case 166 /* ForInStatement */: - return child(node.declaration) || child(node.variable) || child(node.expression) || child(node.statement); - case 167 /* ContinueStatement */: - case 168 /* BreakStatement */: + case 169 /* ForInStatement */: + return children(node.declarations) || child(node.variable) || child(node.expression) || child(node.statement); + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: return child(node.label); - case 169 /* ReturnStatement */: + case 172 /* ReturnStatement */: return child(node.expression); - case 170 /* WithStatement */: + case 173 /* WithStatement */: return child(node.expression) || child(node.statement); - case 171 /* SwitchStatement */: + case 174 /* SwitchStatement */: return child(node.expression) || children(node.clauses); - case 172 /* CaseClause */: - case 173 /* DefaultClause */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: return child(node.expression) || children(node.statements); - case 174 /* LabeledStatement */: + case 177 /* LabeledStatement */: return child(node.label) || child(node.statement); - case 175 /* ThrowStatement */: + case 178 /* ThrowStatement */: return child(node.expression); - case 176 /* TryStatement */: + case 179 /* TryStatement */: return child(node.tryBlock) || child(node.catchBlock) || child(node.finallyBlock); - case 178 /* CatchBlock */: + case 181 /* CatchBlock */: return child(node.variable) || children(node.statements); - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: return child(node.name) || child(node.type) || child(node.initializer); - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: return child(node.name) || children(node.typeParameters) || child(node.baseType) || children(node.implementedTypes) || children(node.members); - case 185 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: return child(node.name) || children(node.typeParameters) || children(node.baseTypes) || children(node.members); - case 186 /* TypeAliasDeclaration */: + case 189 /* TypeAliasDeclaration */: return child(node.name) || child(node.type); - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: return child(node.name) || children(node.members); - case 192 /* EnumMember */: + case 195 /* EnumMember */: return child(node.name) || child(node.initializer); - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return child(node.name) || child(node.body); - case 190 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: return child(node.name) || child(node.entityName) || child(node.externalModuleName); - case 191 /* ExportAssignment */: + case 194 /* ExportAssignment */: return child(node.exportName); - case 155 /* TemplateExpression */: + case 158 /* TemplateExpression */: return child(node.head) || children(node.templateSpans); - case 156 /* TemplateSpan */: + case 159 /* TemplateSpan */: return child(node.expression) || child(node.literal); } } @@ -2466,24 +2486,24 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 169 /* ReturnStatement */: + case 172 /* ReturnStatement */: return visitor(node); - case 158 /* Block */: - case 183 /* FunctionBlock */: - case 162 /* IfStatement */: - case 163 /* DoStatement */: - case 164 /* WhileStatement */: - case 165 /* ForStatement */: - case 166 /* ForInStatement */: - case 170 /* WithStatement */: - case 171 /* SwitchStatement */: - case 172 /* CaseClause */: - case 173 /* DefaultClause */: - case 174 /* LabeledStatement */: - case 176 /* TryStatement */: - case 177 /* TryBlock */: - case 178 /* CatchBlock */: - case 179 /* FinallyBlock */: + case 161 /* Block */: + case 186 /* FunctionBlock */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 173 /* WithStatement */: + case 174 /* SwitchStatement */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: + case 177 /* LabeledStatement */: + case 179 /* TryStatement */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: return forEachChild(node, traverse); } } @@ -2492,9 +2512,9 @@ var ts; function isAnyFunction(node) { if (node) { switch (node.kind) { - case 149 /* FunctionExpression */: - case 182 /* FunctionDeclaration */: - case 150 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + case 153 /* ArrowFunction */: case 125 /* Method */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: @@ -2521,20 +2541,20 @@ var ts; return undefined; } switch (node.kind) { - case 150 /* ArrowFunction */: + case 153 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } - case 182 /* FunctionDeclaration */: - case 149 /* FunctionExpression */: - case 188 /* ModuleDeclaration */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 191 /* ModuleDeclaration */: case 124 /* Property */: case 125 /* Method */: case 126 /* Constructor */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 187 /* EnumDeclaration */: - case 193 /* SourceFile */: + case 190 /* EnumDeclaration */: + case 196 /* SourceFile */: return node; } } @@ -2565,60 +2585,62 @@ var ts; case 93 /* TrueKeyword */: case 78 /* FalseKeyword */: case 8 /* RegularExpressionLiteral */: - case 139 /* ArrayLiteral */: - case 140 /* ObjectLiteral */: - case 142 /* PropertyAccess */: - case 143 /* IndexedAccess */: - case 144 /* CallExpression */: - case 145 /* NewExpression */: - case 146 /* TaggedTemplateExpression */: - case 147 /* TypeAssertion */: - case 148 /* ParenExpression */: - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: - case 151 /* PrefixOperator */: - case 152 /* PostfixOperator */: - case 153 /* BinaryExpression */: - case 154 /* ConditionalExpression */: - case 155 /* TemplateExpression */: - case 157 /* OmittedExpression */: + case 141 /* ArrayLiteral */: + case 142 /* ObjectLiteral */: + case 145 /* PropertyAccess */: + case 146 /* IndexedAccess */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: + case 149 /* TaggedTemplateExpression */: + case 150 /* TypeAssertion */: + case 151 /* ParenExpression */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: + case 156 /* BinaryExpression */: + case 157 /* ConditionalExpression */: + case 158 /* TemplateExpression */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 160 /* OmittedExpression */: return true; case 121 /* QualifiedName */: while (node.parent.kind === 121 /* QualifiedName */) node = node.parent; - return node.parent.kind === 133 /* TypeQuery */; + return node.parent.kind === 135 /* TypeQuery */; case 63 /* Identifier */: - if (node.parent.kind === 133 /* TypeQuery */) { + if (node.parent.kind === 135 /* TypeQuery */) { return true; } case 6 /* NumericLiteral */: case 7 /* StringLiteral */: - case 9 /* NoSubstitutionTemplateLiteral */: var parent = node.parent; switch (parent.kind) { - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: case 123 /* Parameter */: case 124 /* Property */: - case 192 /* EnumMember */: - case 141 /* PropertyAssignment */: + case 195 /* EnumMember */: + case 143 /* PropertyAssignment */: return parent.initializer === node; - case 161 /* ExpressionStatement */: - case 162 /* IfStatement */: - case 163 /* DoStatement */: - case 164 /* WhileStatement */: - case 169 /* ReturnStatement */: - case 170 /* WithStatement */: - case 171 /* SwitchStatement */: - case 172 /* CaseClause */: - case 175 /* ThrowStatement */: - case 171 /* SwitchStatement */: + case 164 /* ExpressionStatement */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 172 /* ReturnStatement */: + case 173 /* WithStatement */: + case 174 /* SwitchStatement */: + case 175 /* CaseClause */: + case 178 /* ThrowStatement */: + case 174 /* SwitchStatement */: return parent.expression === node; - case 165 /* ForStatement */: + case 168 /* ForStatement */: return parent.initializer === node || parent.condition === node || parent.iterator === node; - case 166 /* ForInStatement */: + case 169 /* ForInStatement */: return parent.variable === node || parent.expression === node; - case 147 /* TypeAssertion */: + case 150 /* TypeAssertion */: return node === parent.operand; + case 159 /* TemplateSpan */: + return node === parent.expression; default: if (isExpression(parent)) { return true; @@ -2657,20 +2679,21 @@ var ts; switch (node.kind) { case 122 /* TypeParameter */: case 123 /* Parameter */: - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: case 124 /* Property */: - case 141 /* PropertyAssignment */: - case 192 /* EnumMember */: + case 143 /* PropertyAssignment */: + case 144 /* ShorthandPropertyAssignment */: + case 195 /* EnumMember */: case 125 /* Method */: - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: - case 186 /* TypeAliasDeclaration */: - case 187 /* EnumDeclaration */: - case 188 /* ModuleDeclaration */: - case 190 /* ImportDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 190 /* EnumDeclaration */: + case 191 /* ModuleDeclaration */: + case 193 /* ImportDeclaration */: return true; } return false; @@ -2678,24 +2701,24 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 168 /* BreakStatement */: - case 167 /* ContinueStatement */: - case 180 /* DebuggerStatement */: - case 163 /* DoStatement */: - case 161 /* ExpressionStatement */: - case 160 /* EmptyStatement */: - case 166 /* ForInStatement */: - case 165 /* ForStatement */: - case 162 /* IfStatement */: - case 174 /* LabeledStatement */: - case 169 /* ReturnStatement */: - case 171 /* SwitchStatement */: + case 171 /* BreakStatement */: + case 170 /* ContinueStatement */: + case 183 /* DebuggerStatement */: + case 166 /* DoStatement */: + case 164 /* ExpressionStatement */: + case 163 /* EmptyStatement */: + case 169 /* ForInStatement */: + case 168 /* ForStatement */: + case 165 /* IfStatement */: + case 177 /* LabeledStatement */: + case 172 /* ReturnStatement */: + case 174 /* SwitchStatement */: case 92 /* ThrowKeyword */: - case 176 /* TryStatement */: - case 159 /* VariableStatement */: - case 164 /* WhileStatement */: - case 170 /* WithStatement */: - case 191 /* ExportAssignment */: + case 179 /* TryStatement */: + case 162 /* VariableStatement */: + case 167 /* WhileStatement */: + case 173 /* WithStatement */: + case 194 /* ExportAssignment */: return true; default: return false; @@ -2707,10 +2730,10 @@ var ts; return false; } var parent = name.parent; - if (isDeclaration(parent) || parent.kind === 149 /* FunctionExpression */) { + if (isDeclaration(parent) || parent.kind === 152 /* FunctionExpression */) { return parent.name === name; } - if (parent.kind === 178 /* CatchBlock */) { + if (parent.kind === 181 /* CatchBlock */) { return parent.variable === name; } return false; @@ -2718,16 +2741,16 @@ var ts; ts.isDeclarationOrFunctionExpressionOrCatchVariableName = isDeclarationOrFunctionExpressionOrCatchVariableName; function getAncestor(node, kind) { switch (kind) { - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: while (node) { switch (node.kind) { - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: return node; - case 187 /* EnumDeclaration */: - case 185 /* InterfaceDeclaration */: - case 186 /* TypeAliasDeclaration */: - case 188 /* ModuleDeclaration */: - case 190 /* ImportDeclaration */: + case 190 /* EnumDeclaration */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 191 /* ModuleDeclaration */: + case 193 /* ImportDeclaration */: return undefined; default: node = node.parent; @@ -2769,6 +2792,40 @@ var ts; } } ; + function getFileReferenceFromReferencePath(comment, commentRange) { + var simpleReferenceRegEx = /^\/\/\/\s*/gim; + if (simpleReferenceRegEx.exec(comment)) { + if (isNoDefaultLibRegEx.exec(comment)) { + return { + isNoDefaultLib: true + }; + } + else { + var matchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment); + if (matchResult) { + var start = commentRange.pos; + var end = commentRange.end; + return { + fileReference: { + pos: start, + end: end, + filename: matchResult[3] + }, + isNoDefaultLib: false + }; + } + else { + return { + diagnostic: ts.Diagnostics.Invalid_reference_directive_syntax, + isNoDefaultLib: false + }; + } + } + } + return undefined; + } + ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { return 64 /* FirstKeyword */ <= token && token <= 119 /* LastKeyword */; } @@ -2777,6 +2834,15 @@ var ts; return 2 /* FirstTriviaToken */ <= token && token <= 5 /* LastTriviaToken */; } ts.isTrivia = isTrivia; + function isUnterminatedTemplateEnd(node) { + ts.Debug.assert(node.kind === 9 /* NoSubstitutionTemplateLiteral */ || node.kind === 12 /* TemplateTail */); + var sourceText = getSourceFileOfNode(node).text; + if (node.end !== sourceText.length) { + return false; + } + return sourceText.charCodeAt(node.end - 1) !== 96 /* backtick */ || node.text.length === 0; + } + ts.isUnterminatedTemplateEnd = isUnterminatedTemplateEnd; function isModifier(token) { switch (token) { case 106 /* PublicKeyword */: @@ -2790,6 +2856,17 @@ var ts; return false; } ts.isModifier = isModifier; + function modifierToFlag(token) { + switch (token) { + case 107 /* StaticKeyword */: return 128 /* Static */; + case 106 /* PublicKeyword */: return 16 /* Public */; + case 105 /* ProtectedKeyword */: return 64 /* Protected */; + case 104 /* PrivateKeyword */: return 32 /* Private */; + case 76 /* ExportKeyword */: return 1 /* Export */; + case 112 /* DeclareKeyword */: return 2 /* Ambient */; + } + return 0; + } function createSourceFile(filename, sourceText, languageVersion, version, isOpen) { if (isOpen === void 0) { isOpen = false; } var file; @@ -2803,118 +2880,26 @@ var ts; var lineStarts; var isInStrictMode = false; var lookAheadMode = 0 /* NotLookingAhead */; - var inAmbientContext = false; - var inFunctionBody = false; - var inSwitchStatement = 0 /* NotNested */; - var inIterationStatement = 0 /* NotNested */; - var labelledStatementInfo = (function () { - var functionBoundarySentinel; - var currentLabelSet; - var labelSetStack; - var isIterationStack; - function addLabel(label) { - if (!currentLabelSet) { - currentLabelSet = {}; - } - currentLabelSet[label.text] = true; - } - function pushCurrentLabelSet(isIterationStatement) { - if (!labelSetStack && !isIterationStack) { - labelSetStack = []; - isIterationStack = []; - } - ts.Debug.assert(currentLabelSet !== undefined); - labelSetStack.push(currentLabelSet); - isIterationStack.push(isIterationStatement); - currentLabelSet = undefined; - } - function pushFunctionBoundary() { - if (!functionBoundarySentinel) { - functionBoundarySentinel = {}; - if (!labelSetStack && !isIterationStack) { - labelSetStack = []; - isIterationStack = []; - } - } - ts.Debug.assert(currentLabelSet === undefined); - labelSetStack.push(functionBoundarySentinel); - isIterationStack.push(false); - } - function pop() { - ts.Debug.assert(labelSetStack.length && isIterationStack.length && currentLabelSet === undefined); - labelSetStack.pop(); - isIterationStack.pop(); - } - function nodeIsNestedInLabel(label, requireIterationStatement, stopAtFunctionBoundary) { - if (!requireIterationStatement && currentLabelSet && ts.hasProperty(currentLabelSet, label.text)) { - return 1 /* Nested */; - } - if (!labelSetStack) { - return 0 /* NotNested */; - } - var crossedFunctionBoundary = false; - for (var i = labelSetStack.length - 1; i >= 0; i--) { - var labelSet = labelSetStack[i]; - if (labelSet === functionBoundarySentinel) { - if (stopAtFunctionBoundary) { - break; - } - else { - crossedFunctionBoundary = true; - continue; - } - } - if (requireIterationStatement && isIterationStack[i] === false) { - continue; - } - if (ts.hasProperty(labelSet, label.text)) { - return crossedFunctionBoundary ? 2 /* CrossingFunctionBoundary */ : 1 /* Nested */; - } - } - return 0 /* NotNested */; - } - return { - addLabel: addLabel, - pushCurrentLabelSet: pushCurrentLabelSet, - pushFunctionBoundary: pushFunctionBoundary, - pop: pop, - nodeIsNestedInLabel: nodeIsNestedInLabel - }; - })(); - function getLineAndCharacterlFromSourcePosition(position) { - if (!lineStarts) { - lineStarts = ts.getLineStarts(sourceText); - } - return ts.getLineAndCharacterOfPosition(lineStarts, position); + function getLineStarts() { + return lineStarts || (lineStarts = ts.computeLineStarts(sourceText)); + } + function getLineAndCharacterFromSourcePosition(position) { + return ts.getLineAndCharacterOfPosition(getLineStarts(), position); } function getPositionFromSourceLineAndCharacter(line, character) { - if (!lineStarts) { - lineStarts = ts.getLineStarts(sourceText); - } - return ts.getPositionFromLineAndCharacter(lineStarts, line, character); + return ts.getPositionFromLineAndCharacter(getLineStarts(), line, character); } function error(message, arg0, arg1, arg2) { var start = scanner.getTokenPos(); var length = scanner.getTextPos() - start; errorAtPos(start, length, message, arg0, arg1, arg2); } - function grammarErrorOnNode(node, message, arg0, arg1, arg2) { - var span = getErrorSpanForNode(node); - var start = span.end > span.pos ? ts.skipTrivia(file.text, span.pos) : span.pos; - var length = span.end - start; - file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - } - function reportInvalidUseInStrictMode(node) { - var name = sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end); - grammarErrorOnNode(node, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, name); - } - function grammarErrorAtPos(start, length, message, arg0, arg1, arg2) { - file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - } function errorAtPos(start, length, message, arg0, arg1, arg2) { - var lastErrorPos = file.syntacticErrors.length ? file.syntacticErrors[file.syntacticErrors.length - 1].start : -1; + var lastErrorPos = file.parseDiagnostics.length ? file.parseDiagnostics[file.parseDiagnostics.length - 1].start : -1; if (start !== lastErrorPos) { - file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + var diagnostic = ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); + diagnostic.isParseError = true; + file.parseDiagnostics.push(diagnostic); } if (lookAheadMode === 1 /* NoErrorYet */) { lookAheadMode = 2 /* Error */; @@ -2951,7 +2936,7 @@ var ts; } function lookAheadHelper(callback, alwaysResetState) { var saveToken = token; - var saveSyntacticErrorsLength = file.syntacticErrors.length; + var saveSyntacticErrorsLength = file.parseDiagnostics.length; var saveLookAheadMode = lookAheadMode; lookAheadMode = 1 /* NoErrorYet */; var result = callback(); @@ -2962,7 +2947,7 @@ var ts; lookAheadMode = saveLookAheadMode; if (!result || alwaysResetState) { token = saveToken; - file.syntacticErrors.length = saveSyntacticErrorsLength; + file.parseDiagnostics.length = saveSyntacticErrorsLength; } return result; } @@ -3014,28 +2999,32 @@ var ts; function createNode(kind, pos) { nodeCount++; var node = new (nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)))(); - if (!(pos >= 0)) + if (!(pos >= 0)) { pos = scanner.getStartPos(); + } node.pos = pos; node.end = pos; return node; } function finishNode(node) { node.end = scanner.getStartPos(); + if (isInStrictMode) { + node.flags |= 8192 /* ParsedInStrictMode */; + } return node; } - function createMissingNode() { - return createNode(120 /* Missing */); + function createMissingNode(pos) { + return createNode(120 /* Missing */, pos); } function internIdentifier(text) { + text = escapeIdentifier(text); return ts.hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); } function createIdentifier(isIdentifier) { identifierCount++; if (isIdentifier) { var node = createNode(63 /* Identifier */); - var text = escapeIdentifier(scanner.getTokenValue()); - node.text = internIdentifier(text); + node.text = internIdentifier(scanner.getTokenValue()); nextToken(); return finishNode(node); } @@ -3194,12 +3183,11 @@ var ts; parsingContext = saveParsingContext; return result; } - function parseDelimitedList(kind, parseElement, allowTrailingComma) { + function parseDelimitedList(kind, parseElement) { var saveParsingContext = parsingContext; parsingContext |= 1 << kind; var result = []; result.pos = getNodePos(); - var errorCountBeforeParsingList = file.syntacticErrors.length; var commaStart = -1; while (true) { if (isListElement(kind, false)) { @@ -3226,11 +3214,6 @@ var ts; } } if (commaStart >= 0) { - if (!allowTrailingComma) { - if (file.syntacticErrors.length === errorCountBeforeParsingList) { - grammarErrorAtPos(commaStart, scanner.getStartPos() - commaStart, ts.Diagnostics.Trailing_comma_not_allowed); - } - } result.hasTrailingComma = true; } result.end = getNodeEnd(); @@ -3252,7 +3235,7 @@ var ts; } function parseBracketedList(kind, parseElement, startToken, endToken) { if (parseExpected(startToken)) { - var result = parseDelimitedList(kind, parseElement, false); + var result = parseDelimitedList(kind, parseElement); parseExpected(endToken); return result; } @@ -3274,7 +3257,7 @@ var ts; return finishNode(node); } function parseTemplateExpression() { - var template = createNode(155 /* TemplateExpression */); + var template = createNode(158 /* TemplateExpression */); template.head = parseLiteralNode(); ts.Debug.assert(template.head.kind === 10 /* TemplateHead */, "Template head has wrong token kind"); var templateSpans = []; @@ -3287,7 +3270,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(156 /* TemplateSpan */); + var span = createNode(159 /* TemplateSpan */); span.expression = parseExpression(false); var literal; if (token === 14 /* CloseBraceToken */) { @@ -3310,12 +3293,7 @@ var ts; nextToken(); finishNode(node); if (node.kind === 6 /* NumericLiteral */ && sourceText.charCodeAt(tokenPos) === 48 /* _0 */ && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { - if (isInStrictMode) { - grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); - } - else if (languageVersion >= 1 /* ES5 */) { - grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); - } + node.flags |= 16384 /* OctalLiteral */; } return node; } @@ -3335,7 +3313,7 @@ var ts; return finishNode(node); } function parseTypeQuery() { - var node = createNode(133 /* TypeQuery */); + var node = createNode(135 /* TypeQuery */); parseExpected(95 /* TypeOfKeyword */); node.exprName = parseEntityName(true); return finishNode(node); @@ -3348,22 +3326,14 @@ var ts; node.constraint = parseType(); } else { - var expr = parseUnaryExpression(); - grammarErrorOnNode(expr, ts.Diagnostics.Type_expected); + node.expression = parseUnaryExpression(); } } return finishNode(node); } function parseTypeParameters() { if (token === 23 /* LessThanToken */) { - var pos = getNodePos(); - var result = parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 23 /* LessThanToken */, 24 /* GreaterThanToken */); - if (!result.length) { - var start = getTokenPos(pos); - var length = getNodePos() - start; - errorAtPos(start, length, ts.Diagnostics.Type_parameter_list_cannot_be_empty); - } - return result; + return parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 23 /* LessThanToken */, 24 /* GreaterThanToken */); } } function parseParameterType() { @@ -3372,10 +3342,17 @@ var ts; function isStartOfParameter() { return token === 20 /* DotDotDotToken */ || isIdentifier() || isModifier(token); } + function setModifiers(node, modifiers) { + if (modifiers) { + node.flags |= modifiers.flags; + node.modifiers = modifiers; + } + } function parseParameter(flags) { if (flags === void 0) { flags = 0; } var node = createNode(123 /* Parameter */); - node.flags |= parseAndCheckModifiers(3 /* Parameters */); + var modifiers = parseModifiers(3 /* Parameters */); + setModifiers(node, modifiers); if (parseOptional(20 /* DotDotDotToken */)) { node.flags |= 8 /* Rest */; } @@ -3396,7 +3373,6 @@ var ts; } var typeParameters = parseTypeParameters(); var parameters = parseParameterList(15 /* OpenParenToken */, 16 /* CloseParenToken */); - checkParameterList(parameters); var type; if (returnTokenRequired) { parseExpected(returnToken); @@ -3414,44 +3390,6 @@ var ts; function parseParameterList(startDelimiter, endDelimiter) { return parseBracketedList(13 /* Parameters */, parseParameter, startDelimiter, endDelimiter); } - function checkParameterList(parameters) { - var seenOptionalParameter = false; - var parameterCount = parameters.length; - for (var i = 0; i < parameterCount; i++) { - var parameter = parameters[i]; - if (isInStrictMode && isEvalOrArgumentsIdentifier(parameter.name)) { - reportInvalidUseInStrictMode(parameter.name); - return; - } - else if (parameter.flags & 8 /* Rest */) { - if (i !== (parameterCount - 1)) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); - return; - } - if (parameter.flags & 4 /* QuestionMark */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_be_optional); - return; - } - if (parameter.initializer) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer); - return; - } - } - else if (parameter.flags & 4 /* QuestionMark */ || parameter.initializer) { - seenOptionalParameter = true; - if (parameter.flags & 4 /* QuestionMark */ && parameter.initializer) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.Parameter_cannot_have_question_mark_and_initializer); - return; - } - } - else { - if (seenOptionalParameter) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); - return; - } - } - } - } function parseSignatureMember(kind, returnToken) { var node = createNode(kind); var sig = parseSignature(kind, returnToken, false); @@ -3461,60 +3399,14 @@ var ts; parseSemicolon(); return finishNode(node); } - function parseIndexSignatureMember() { - var node = createNode(131 /* IndexSignature */); - var errorCountBeforeIndexSignature = file.syntacticErrors.length; - var indexerStart = scanner.getTokenPos(); + function parseIndexSignatureMember(modifiers, pos) { + var node = createNode(131 /* IndexSignature */, pos); + setModifiers(node, modifiers); node.parameters = parseParameterList(17 /* OpenBracketToken */, 18 /* CloseBracketToken */); - var indexerLength = scanner.getStartPos() - indexerStart; node.type = parseTypeAnnotation(); parseSemicolon(); - if (file.syntacticErrors.length === errorCountBeforeIndexSignature) { - checkIndexSignature(node, indexerStart, indexerLength); - } return finishNode(node); } - function checkIndexSignature(node, indexerStart, indexerLength) { - var parameter = node.parameters[0]; - if (node.parameters.length !== 1) { - var arityDiagnostic = ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter; - if (parameter) { - grammarErrorOnNode(parameter.name, arityDiagnostic); - } - else { - grammarErrorAtPos(indexerStart, indexerLength, arityDiagnostic); - } - return; - } - else if (parameter.flags & 8 /* Rest */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); - return; - } - else if (parameter.flags & 243 /* Modifier */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); - return; - } - else if (parameter.flags & 4 /* QuestionMark */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); - return; - } - else if (parameter.initializer) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); - return; - } - else if (!parameter.type) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); - return; - } - else if (parameter.type.kind !== 118 /* StringKeyword */ && parameter.type.kind !== 116 /* NumberKeyword */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); - return; - } - else if (!node.type) { - grammarErrorAtPos(indexerStart, indexerLength, ts.Diagnostics.An_index_signature_must_have_a_type_annotation); - return; - } - } function parsePropertyOrMethod() { var node = createNode(0 /* Unknown */); node.name = parsePropertyName(); @@ -3551,7 +3443,7 @@ var ts; case 23 /* LessThanToken */: return parseSignatureMember(129 /* CallSignature */, 50 /* ColonToken */); case 17 /* OpenBracketToken */: - return parseIndexSignatureMember(); + return parseIndexSignatureMember(undefined); case 86 /* NewKeyword */: if (lookAhead(function () { return nextToken() === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */; })) { return parseSignatureMember(130 /* ConstructSignature */, 50 /* ColonToken */); @@ -3566,7 +3458,7 @@ var ts; } } function parseTypeLiteral() { - var node = createNode(134 /* TypeLiteral */); + var node = createNode(136 /* TypeLiteral */); if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseList(5 /* TypeMembers */, false, parseTypeMember); parseExpected(14 /* CloseBraceToken */); @@ -3577,32 +3469,25 @@ var ts; return finishNode(node); } function parseTupleType() { - var node = createNode(136 /* TupleType */); - var startTokenPos = scanner.getTokenPos(); - var startErrorCount = file.syntacticErrors.length; + var node = createNode(138 /* TupleType */); node.elementTypes = parseBracketedList(16 /* TupleElementTypes */, parseType, 17 /* OpenBracketToken */, 18 /* CloseBracketToken */); - if (!node.elementTypes.length && file.syntacticErrors.length === startErrorCount) { - grammarErrorAtPos(startTokenPos, scanner.getStartPos() - startTokenPos, ts.Diagnostics.A_tuple_type_element_list_cannot_be_empty); - } return finishNode(node); } function parseParenType() { - var node = createNode(138 /* ParenType */); + var node = createNode(140 /* ParenType */); parseExpected(15 /* OpenParenToken */); node.type = parseType(); parseExpected(16 /* CloseParenToken */); return finishNode(node); } - function parseFunctionType(signatureKind) { - var node = createNode(134 /* TypeLiteral */); - var member = createNode(signatureKind); - var sig = parseSignature(signatureKind, 31 /* EqualsGreaterThanToken */, true); + function parseFunctionType(typeKind) { + var member = createNode(typeKind); + var sig = parseSignature(typeKind === 133 /* FunctionType */ ? 129 /* CallSignature */ : 130 /* ConstructSignature */, 31 /* EqualsGreaterThanToken */, true); member.typeParameters = sig.typeParameters; member.parameters = sig.parameters; member.type = sig.type; finishNode(member); - node.members = createNodeArray(member); - return finishNode(node); + return member; } function parseKeywordAndNoDot() { var node = parseTokenNode(); @@ -3659,7 +3544,7 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(17 /* OpenBracketToken */)) { parseExpected(18 /* CloseBracketToken */); - var node = createNode(135 /* ArrayType */, type.pos); + var node = createNode(137 /* ArrayType */, type.pos); node.elementType = type; type = finishNode(node); } @@ -3674,7 +3559,7 @@ var ts; types.push(parsePrimaryType()); } types.end = getNodeEnd(); - var node = createNode(137 /* UnionType */, type.pos); + var node = createNode(139 /* UnionType */, type.pos); node.types = types; type = finishNode(node); } @@ -3703,10 +3588,10 @@ var ts; } function parseType() { if (isStartOfFunctionType()) { - return parseFunctionType(129 /* CallSignature */); + return parseFunctionType(133 /* FunctionType */); } if (token === 86 /* NewKeyword */) { - return parseFunctionType(130 /* ConstructSignature */); + return parseFunctionType(134 /* ConstructorType */); } return parseUnionType(); } @@ -3775,45 +3660,13 @@ var ts; if (expr.kind === 63 /* Identifier */ && token === 31 /* EqualsGreaterThanToken */) { return parseSimpleArrowFunctionExpression(expr); } - if (isLeftHandSideExpression(expr) && isAssignmentOperator()) { - if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { - reportInvalidUseInStrictMode(expr); - } + if (isLeftHandSideExpression(expr) && isAssignmentOperator(token)) { var operator = token; nextToken(); return makeBinaryExpression(expr, operator, parseAssignmentExpression(noIn)); } return expr; } - function isLeftHandSideExpression(expr) { - if (expr) { - switch (expr.kind) { - case 142 /* PropertyAccess */: - case 143 /* IndexedAccess */: - case 145 /* NewExpression */: - case 144 /* CallExpression */: - case 146 /* TaggedTemplateExpression */: - case 139 /* ArrayLiteral */: - case 148 /* ParenExpression */: - case 140 /* ObjectLiteral */: - case 149 /* FunctionExpression */: - case 63 /* Identifier */: - case 120 /* Missing */: - case 8 /* RegularExpressionLiteral */: - case 6 /* NumericLiteral */: - case 7 /* StringLiteral */: - case 9 /* NoSubstitutionTemplateLiteral */: - case 155 /* TemplateExpression */: - case 78 /* FalseKeyword */: - case 87 /* NullKeyword */: - case 91 /* ThisKeyword */: - case 93 /* TrueKeyword */: - case 89 /* SuperKeyword */: - return true; - } - } - return false; - } function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 31 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); parseExpected(31 /* EqualsGreaterThanToken */); @@ -3839,7 +3692,7 @@ var ts; return parseArrowExpressionTail(pos, sig, false); } else { - return makeFunctionExpression(150 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); + return makeFunctionExpression(153 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); } } var sig = tryParseSignatureIfArrowOrBraceFollows(); @@ -3905,23 +3758,20 @@ var ts; function parseArrowExpressionTail(pos, sig, noIn) { var body; if (token === 13 /* OpenBraceToken */) { - body = parseBody(false); + body = parseFunctionBlock(false); } else if (isStatement(true) && !isStartOfExpressionStatement() && token !== 81 /* FunctionKeyword */) { - body = parseBody(true); + body = parseFunctionBlock(true); } else { body = parseAssignmentExpression(noIn); } - return makeFunctionExpression(150 /* ArrowFunction */, pos, undefined, sig, body); - } - function isAssignmentOperator() { - return token >= 51 /* FirstAssignment */ && token <= 62 /* LastAssignment */; + return makeFunctionExpression(153 /* ArrowFunction */, pos, undefined, sig, body); } function parseConditionalExpression(noIn) { var expr = parseBinaryExpression(noIn); while (parseOptional(49 /* QuestionToken */)) { - var node = createNode(154 /* ConditionalExpression */, expr.pos); + var node = createNode(157 /* ConditionalExpression */, expr.pos); node.condition = expr; node.whenTrue = parseAssignmentExpression(false); parseExpected(50 /* ColonToken */); @@ -3985,7 +3835,7 @@ var ts; return undefined; } function makeBinaryExpression(left, operator, right) { - var node = createNode(153 /* BinaryExpression */, left.pos); + var node = createNode(156 /* BinaryExpression */, left.pos); node.left = left; node.operator = operator; node.right = right; @@ -4005,16 +3855,7 @@ var ts; case 38 /* MinusMinusToken */: var operator = token; nextToken(); - var operand = parseUnaryExpression(); - if (isInStrictMode) { - if ((operator === 37 /* PlusPlusToken */ || operator === 38 /* MinusMinusToken */) && isEvalOrArgumentsIdentifier(operand)) { - reportInvalidUseInStrictMode(operand); - } - else if (operator === 72 /* DeleteKeyword */ && operand.kind === 63 /* Identifier */) { - grammarErrorOnNode(operand, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); - } - } - return makeUnaryExpression(151 /* PrefixOperator */, pos, operator, operand); + return makeUnaryExpression(154 /* PrefixOperator */, pos, operator, parseUnaryExpression()); case 23 /* LessThanToken */: return parseTypeAssertion(); } @@ -4026,17 +3867,14 @@ var ts; var expr = parseCallAndAccess(primaryExpression, false); ts.Debug.assert(isLeftHandSideExpression(expr)); if ((token === 37 /* PlusPlusToken */ || token === 38 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { - reportInvalidUseInStrictMode(expr); - } var operator = token; nextToken(); - expr = makeUnaryExpression(152 /* PostfixOperator */, expr.pos, operator, expr); + expr = makeUnaryExpression(155 /* PostfixOperator */, expr.pos, operator, expr); } return expr; } function parseTypeAssertion() { - var node = createNode(147 /* TypeAssertion */); + var node = createNode(150 /* TypeAssertion */); parseExpected(23 /* LessThanToken */); node.type = parseType(); parseExpected(24 /* GreaterThanToken */); @@ -4053,25 +3891,28 @@ var ts; while (true) { var dotOrBracketStart = scanner.getTokenPos(); if (parseOptional(19 /* DotToken */)) { - var propertyAccess = createNode(142 /* PropertyAccess */, expr.pos); - if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord() && lookAhead(function () { return scanner.isReservedWord(); })) { - grammarErrorAtPos(dotOrBracketStart, scanner.getStartPos() - dotOrBracketStart, ts.Diagnostics.Identifier_expected); - var id = createMissingNode(); - } - else { - var id = parseIdentifierName(); + var propertyAccess = createNode(145 /* PropertyAccess */, expr.pos); + var id; + if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord()) { + var matchesPattern = lookAhead(function () { + nextToken(); + return !scanner.hasPrecedingLineBreak() && (scanner.isIdentifier() || scanner.isReservedWord); + }); + if (matchesPattern) { + errorAtPos(dotOrBracketStart + 1, 0, ts.Diagnostics.Identifier_expected); + id = createMissingNode(); + } } propertyAccess.left = expr; - propertyAccess.right = id; + propertyAccess.right = id || parseIdentifierName(); expr = finishNode(propertyAccess); continue; } if (parseOptional(17 /* OpenBracketToken */)) { - var indexedAccess = createNode(143 /* IndexedAccess */, expr.pos); + var indexedAccess = createNode(146 /* IndexedAccess */, expr.pos); indexedAccess.object = expr; if (inNewExpression && parseOptional(18 /* CloseBracketToken */)) { indexedAccess.index = createMissingNode(); - grammarErrorAtPos(dotOrBracketStart, scanner.getStartPos() - dotOrBracketStart, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); } else { indexedAccess.index = parseExpression(); @@ -4085,7 +3926,7 @@ var ts; continue; } if ((token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) && !inNewExpression) { - var callExpr = createNode(144 /* CallExpression */, expr.pos); + var callExpr = createNode(147 /* CallExpression */, expr.pos); callExpr.func = expr; if (token === 23 /* LessThanToken */) { if (!(callExpr.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) @@ -4094,19 +3935,16 @@ var ts; else { parseExpected(15 /* OpenParenToken */); } - callExpr.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression, false); + callExpr.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression); parseExpected(16 /* CloseParenToken */); expr = finishNode(callExpr); continue; } if (token === 9 /* NoSubstitutionTemplateLiteral */ || token === 10 /* TemplateHead */) { - var tagExpression = createNode(146 /* TaggedTemplateExpression */, expr.pos); + var tagExpression = createNode(149 /* TaggedTemplateExpression */, expr.pos); tagExpression.tag = expr; tagExpression.template = token === 9 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() : parseTemplateExpression(); expr = finishNode(tagExpression); - if (languageVersion < 2 /* ES6 */) { - grammarErrorOnNode(expr, ts.Diagnostics.Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher); - } continue; } return expr; @@ -4118,19 +3956,10 @@ var ts; return result; } function parseTypeArguments() { - var typeArgumentListStart = scanner.getTokenPos(); - var errorCountBeforeTypeParameterList = file.syntacticErrors.length; - var result = parseBracketedList(15 /* TypeArguments */, parseSingleTypeArgument, 23 /* LessThanToken */, 24 /* GreaterThanToken */); - if (!result.length && file.syntacticErrors.length === errorCountBeforeTypeParameterList) { - grammarErrorAtPos(typeArgumentListStart, scanner.getStartPos() - typeArgumentListStart, ts.Diagnostics.Type_argument_list_cannot_be_empty); - } - return result; + return parseBracketedList(15 /* TypeArguments */, parseSingleTypeArgument, 23 /* LessThanToken */, 24 /* GreaterThanToken */); } function parseSingleTypeArgument() { if (token === 22 /* CommaToken */) { - var errorStart = scanner.getTokenPos(); - var errorLength = scanner.getTextPos() - errorStart; - grammarErrorAtPos(errorStart, errorLength, ts.Diagnostics.Type_expected); return createNode(120 /* Missing */); } return parseType(); @@ -4174,50 +4003,60 @@ var ts; return createMissingNode(); } function parseParenExpression() { - var node = createNode(148 /* ParenExpression */); + var node = createNode(151 /* ParenExpression */); parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); parseExpected(16 /* CloseParenToken */); return finishNode(node); } - function parseAssignmentExpressionOrOmittedExpression(omittedExpressionDiagnostic) { - if (token === 22 /* CommaToken */) { - if (omittedExpressionDiagnostic) { - var errorStart = scanner.getTokenPos(); - var errorLength = scanner.getTextPos() - errorStart; - grammarErrorAtPos(errorStart, errorLength, omittedExpressionDiagnostic); - } - return createNode(157 /* OmittedExpression */); - } - return parseAssignmentExpression(); + function parseAssignmentExpressionOrOmittedExpression() { + return token === 22 /* CommaToken */ ? createNode(160 /* OmittedExpression */) : parseAssignmentExpression(); } function parseArrayLiteralElement() { - return parseAssignmentExpressionOrOmittedExpression(undefined); + return parseAssignmentExpressionOrOmittedExpression(); } function parseArgumentExpression() { - return parseAssignmentExpressionOrOmittedExpression(ts.Diagnostics.Argument_expression_expected); + return parseAssignmentExpressionOrOmittedExpression(); } function parseArrayLiteral() { - var node = createNode(139 /* ArrayLiteral */); + var node = createNode(141 /* ArrayLiteral */); parseExpected(17 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) node.flags |= 256 /* MultiLine */; - node.elements = parseDelimitedList(12 /* ArrayLiteralMembers */, parseArrayLiteralElement, true); + node.elements = parseDelimitedList(12 /* ArrayLiteralMembers */, parseArrayLiteralElement); parseExpected(18 /* CloseBracketToken */); return finishNode(node); } function parsePropertyAssignment() { - var node = createNode(141 /* PropertyAssignment */); - node.name = parsePropertyName(); + var nodePos = scanner.getStartPos(); + var tokenIsIdentifier = isIdentifier(); + var nameToken = token; + var propertyName = parsePropertyName(); + var node; if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + node = createNode(143 /* PropertyAssignment */, nodePos); + node.name = propertyName; var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); - var body = parseBody(false); - node.initializer = makeFunctionExpression(149 /* FunctionExpression */, node.pos, undefined, sig, body); + var body = parseFunctionBlock(false); + node.initializer = makeFunctionExpression(152 /* FunctionExpression */, node.pos, undefined, sig, body); + return finishNode(node); + } + var flags = 0; + if (token === 49 /* QuestionToken */) { + flags |= 4 /* QuestionMark */; + nextToken(); + } + if ((token === 22 /* CommaToken */ || token === 14 /* CloseBraceToken */) && tokenIsIdentifier) { + node = createNode(144 /* ShorthandPropertyAssignment */, nodePos); + node.name = propertyName; } else { + node = createNode(143 /* PropertyAssignment */, nodePos); + node.name = propertyName; parseExpected(50 /* ColonToken */); node.initializer = parseAssignmentExpression(false); } + node.flags = flags; return finishNode(node); } function parseObjectLiteralMember() { @@ -4225,63 +4064,18 @@ var ts; var initialToken = token; if (parseContextualModifier(113 /* GetKeyword */) || parseContextualModifier(117 /* SetKeyword */)) { var kind = initialToken === 113 /* GetKeyword */ ? 127 /* GetAccessor */ : 128 /* SetAccessor */; - return parseAndCheckMemberAccessorDeclaration(kind, initialPos, 0); + return parseMemberAccessorDeclaration(kind, initialPos, undefined); } return parsePropertyAssignment(); } function parseObjectLiteral() { - var node = createNode(140 /* ObjectLiteral */); + var node = createNode(142 /* ObjectLiteral */); parseExpected(13 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.flags |= 256 /* MultiLine */; } - node.properties = parseDelimitedList(11 /* ObjectLiteralMembers */, parseObjectLiteralMember, true); + node.properties = parseDelimitedList(11 /* ObjectLiteralMembers */, parseObjectLiteralMember); parseExpected(14 /* CloseBraceToken */); - var seen = {}; - var Property = 1; - var GetAccessor = 2; - var SetAccesor = 4; - var GetOrSetAccessor = GetAccessor | SetAccesor; - ts.forEach(node.properties, function (p) { - if (p.kind === 157 /* OmittedExpression */) { - return; - } - var currentKind; - if (p.kind === 141 /* PropertyAssignment */) { - currentKind = Property; - } - else if (p.kind === 127 /* GetAccessor */) { - currentKind = GetAccessor; - } - else if (p.kind === 128 /* SetAccessor */) { - currentKind = SetAccesor; - } - else { - ts.Debug.fail("Unexpected syntax kind:" + p.kind); - } - if (!ts.hasProperty(seen, p.name.text)) { - seen[p.name.text] = currentKind; - } - else { - var existingKind = seen[p.name.text]; - if (currentKind === Property && existingKind === Property) { - if (isInStrictMode) { - grammarErrorOnNode(p.name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); - } - } - else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { - if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[p.name.text] = currentKind | existingKind; - } - else { - grammarErrorOnNode(p.name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); - } - } - else { - grammarErrorOnNode(p.name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); - } - } - }); return finishNode(node); } function parseFunctionExpression() { @@ -4289,11 +4083,8 @@ var ts; parseExpected(81 /* FunctionKeyword */); var name = isIdentifier() ? parseIdentifier() : undefined; var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); - var body = parseBody(false); - if (name && isInStrictMode && isEvalOrArgumentsIdentifier(name)) { - reportInvalidUseInStrictMode(name); - } - return makeFunctionExpression(149 /* FunctionExpression */, pos, name, sig, body); + var body = parseFunctionBlock(false); + return makeFunctionExpression(152 /* FunctionExpression */, pos, name, sig, body); } function makeFunctionExpression(kind, pos, name, sig, body) { var node = createNode(kind, pos); @@ -4305,22 +4096,19 @@ var ts; return finishNode(node); } function parseNewExpression() { - var node = createNode(145 /* NewExpression */); + var node = createNode(148 /* NewExpression */); parseExpected(86 /* NewKeyword */); node.func = parseCallAndAccess(parsePrimaryExpression(), true); if (parseOptional(15 /* OpenParenToken */) || token === 23 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { - node.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression, false); + node.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression); parseExpected(16 /* CloseParenToken */); } return finishNode(node); } - function parseStatementAllowingLetDeclaration() { - return parseStatement(true); - } function parseBlock(ignoreMissingOpenBrace, checkForStrictMode) { - var node = createNode(158 /* Block */); + var node = createNode(161 /* Block */); if (parseExpected(13 /* OpenBraceToken */) || ignoreMissingOpenBrace) { - node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatementAllowingLetDeclaration); + node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatement); parseExpected(14 /* CloseBraceToken */); } else { @@ -4328,48 +4116,30 @@ var ts; } return finishNode(node); } - function parseBody(ignoreMissingOpenBrace) { - var saveInFunctionBody = inFunctionBody; - var saveInSwitchStatement = inSwitchStatement; - var saveInIterationStatement = inIterationStatement; - inFunctionBody = true; - if (inSwitchStatement === 1 /* Nested */) { - inSwitchStatement = 2 /* CrossingFunctionBoundary */; - } - if (inIterationStatement === 1 /* Nested */) { - inIterationStatement = 2 /* CrossingFunctionBoundary */; - } - labelledStatementInfo.pushFunctionBoundary(); + function parseFunctionBlock(ignoreMissingOpenBrace) { var block = parseBlock(ignoreMissingOpenBrace, true); - block.kind = 183 /* FunctionBlock */; - labelledStatementInfo.pop(); - inFunctionBody = saveInFunctionBody; - inSwitchStatement = saveInSwitchStatement; - inIterationStatement = saveInIterationStatement; + block.kind = 186 /* FunctionBlock */; return block; } function parseEmptyStatement() { - var node = createNode(160 /* EmptyStatement */); + var node = createNode(163 /* EmptyStatement */); parseExpected(21 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(162 /* IfStatement */); + var node = createNode(165 /* IfStatement */); parseExpected(82 /* IfKeyword */); parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); parseExpected(16 /* CloseParenToken */); - node.thenStatement = parseStatement(false); - node.elseStatement = parseOptional(74 /* ElseKeyword */) ? parseStatement(false) : undefined; + node.thenStatement = parseStatement(); + node.elseStatement = parseOptional(74 /* ElseKeyword */) ? parseStatement() : undefined; return finishNode(node); } function parseDoStatement() { - var node = createNode(163 /* DoStatement */); + var node = createNode(166 /* DoStatement */); parseExpected(73 /* DoKeyword */); - var saveInIterationStatement = inIterationStatement; - inIterationStatement = 1 /* Nested */; - node.statement = parseStatement(false); - inIterationStatement = saveInIterationStatement; + node.statement = parseStatement(); parseExpected(98 /* WhileKeyword */); parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); @@ -4378,15 +4148,12 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(164 /* WhileStatement */); + var node = createNode(167 /* WhileStatement */); parseExpected(98 /* WhileKeyword */); parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); parseExpected(16 /* CloseParenToken */); - var saveInIterationStatement = inIterationStatement; - inIterationStatement = 1 /* Nested */; - node.statement = parseStatement(false); - inIterationStatement = saveInIterationStatement; + node.statement = parseStatement(); return finishNode(node); } function parseForOrForInStatement() { @@ -4396,27 +4163,12 @@ var ts; if (token !== 21 /* SemicolonToken */) { if (parseOptional(96 /* VarKeyword */)) { var declarations = parseVariableDeclarationList(0, true); - if (!declarations.length) { - error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); - } } else if (parseOptional(102 /* LetKeyword */)) { var declarations = parseVariableDeclarationList(2048 /* Let */, true); - if (!declarations.length) { - error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); - } - if (languageVersion < 2 /* ES6 */) { - grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); - } } else if (parseOptional(68 /* ConstKeyword */)) { var declarations = parseVariableDeclarationList(4096 /* Const */, true); - if (!declarations.length) { - error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); - } - if (languageVersion < 2 /* ES6 */) { - grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); - } } else { var varOrInit = parseExpression(true); @@ -4424,12 +4176,9 @@ var ts; } var forOrForInStatement; if (parseOptional(84 /* InKeyword */)) { - var forInStatement = createNode(166 /* ForInStatement */, pos); + var forInStatement = createNode(169 /* ForInStatement */, pos); if (declarations) { - if (declarations.length > 1) { - error(ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); - } - forInStatement.declaration = declarations[0]; + forInStatement.declarations = declarations; } else { forInStatement.variable = varOrInit; @@ -4439,11 +4188,13 @@ var ts; forOrForInStatement = forInStatement; } else { - var forStatement = createNode(165 /* ForStatement */, pos); - if (declarations) + var forStatement = createNode(168 /* ForStatement */, pos); + if (declarations) { forStatement.declarations = declarations; - if (varOrInit) + } + if (varOrInit) { forStatement.initializer = varOrInit; + } parseExpected(21 /* SemicolonToken */); if (token !== 21 /* SemicolonToken */ && token !== 16 /* CloseParenToken */) { forStatement.condition = parseExpression(); @@ -4455,144 +4206,69 @@ var ts; parseExpected(16 /* CloseParenToken */); forOrForInStatement = forStatement; } - var saveInIterationStatement = inIterationStatement; - inIterationStatement = 1 /* Nested */; - forOrForInStatement.statement = parseStatement(false); - inIterationStatement = saveInIterationStatement; + forOrForInStatement.statement = parseStatement(); return finishNode(forOrForInStatement); } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - var errorCountBeforeStatement = file.syntacticErrors.length; - parseExpected(kind === 168 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */); - if (!canParseSemicolon()) + parseExpected(kind === 171 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */); + if (!canParseSemicolon()) { node.label = parseIdentifier(); + } parseSemicolon(); - finishNode(node); - if (!inAmbientContext && errorCountBeforeStatement === file.syntacticErrors.length) { - if (node.label) { - checkBreakOrContinueStatementWithLabel(node); - } - else { - checkBareBreakOrContinueStatement(node); - } - } - return node; - } - function checkBareBreakOrContinueStatement(node) { - if (node.kind === 168 /* BreakStatement */) { - if (inIterationStatement === 1 /* Nested */ || inSwitchStatement === 1 /* Nested */) { - return; - } - else if (inIterationStatement === 0 /* NotNested */ && inSwitchStatement === 0 /* NotNested */) { - grammarErrorOnNode(node, ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement); - return; - } - } - else if (node.kind === 167 /* ContinueStatement */) { - if (inIterationStatement === 1 /* Nested */) { - return; - } - else if (inIterationStatement === 0 /* NotNested */) { - grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement); - return; - } - } - else { - ts.Debug.fail("checkAnonymousBreakOrContinueStatement"); - } - ts.Debug.assert(inIterationStatement === 2 /* CrossingFunctionBoundary */ || inSwitchStatement === 2 /* CrossingFunctionBoundary */); - grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); - } - function checkBreakOrContinueStatementWithLabel(node) { - var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, node.kind === 167 /* ContinueStatement */, false); - if (nodeIsNestedInLabel === 1 /* Nested */) { - return; - } - if (nodeIsNestedInLabel === 2 /* CrossingFunctionBoundary */) { - grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); - return; - } - if (node.kind === 167 /* ContinueStatement */) { - grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); - } - else if (node.kind === 168 /* BreakStatement */) { - grammarErrorOnNode(node, ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement); - } - else { - ts.Debug.fail("checkBreakOrContinueStatementWithLabel"); - } + return finishNode(node); } function parseReturnStatement() { - var node = createNode(169 /* ReturnStatement */); - var errorCountBeforeReturnStatement = file.syntacticErrors.length; + var node = createNode(172 /* ReturnStatement */); var returnTokenStart = scanner.getTokenPos(); var returnTokenLength = scanner.getTextPos() - returnTokenStart; parseExpected(88 /* ReturnKeyword */); - if (!canParseSemicolon()) + if (!canParseSemicolon()) { node.expression = parseExpression(); - parseSemicolon(); - if (!inFunctionBody && !inAmbientContext && errorCountBeforeReturnStatement === file.syntacticErrors.length) { - grammarErrorAtPos(returnTokenStart, returnTokenLength, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); } + parseSemicolon(); return finishNode(node); } function parseWithStatement() { - var node = createNode(170 /* WithStatement */); - var startPos = scanner.getTokenPos(); + var node = createNode(173 /* WithStatement */); parseExpected(99 /* WithKeyword */); - var endPos = scanner.getStartPos(); parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); parseExpected(16 /* CloseParenToken */); - node.statement = parseStatement(false); - node = finishNode(node); - if (isInStrictMode) { - grammarErrorAtPos(startPos, endPos - startPos, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); - } - return node; + node.statement = parseStatement(); + return finishNode(node); } function parseCaseClause() { - var node = createNode(172 /* CaseClause */); + var node = createNode(175 /* CaseClause */); parseExpected(65 /* CaseKeyword */); node.expression = parseExpression(); parseExpected(50 /* ColonToken */); - node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatementAllowingLetDeclaration); + node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); return finishNode(node); } function parseDefaultClause() { - var node = createNode(173 /* DefaultClause */); + var node = createNode(176 /* DefaultClause */); parseExpected(71 /* DefaultKeyword */); parseExpected(50 /* ColonToken */); - node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatementAllowingLetDeclaration); + node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); return finishNode(node); } function parseCaseOrDefaultClause() { return token === 65 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(171 /* SwitchStatement */); + var node = createNode(174 /* SwitchStatement */); parseExpected(90 /* SwitchKeyword */); parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); parseExpected(16 /* CloseParenToken */); parseExpected(13 /* OpenBraceToken */); - var saveInSwitchStatement = inSwitchStatement; - inSwitchStatement = 1 /* Nested */; node.clauses = parseList(3 /* SwitchClauses */, false, parseCaseOrDefaultClause); - inSwitchStatement = saveInSwitchStatement; parseExpected(14 /* CloseBraceToken */); - var defaultClauses = ts.filter(node.clauses, function (clause) { return clause.kind === 173 /* DefaultClause */; }); - for (var i = 1, n = defaultClauses.length; i < n; i++) { - var clause = defaultClauses[i]; - var start = ts.skipTrivia(file.text, clause.pos); - var end = clause.statements.length > 0 ? clause.statements[0].pos : clause.end; - grammarErrorAtPos(start, end - start, ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); - } return finishNode(node); } function parseThrowStatement() { - var node = createNode(175 /* ThrowStatement */); + var node = createNode(178 /* ThrowStatement */); parseExpected(92 /* ThrowKeyword */); if (scanner.hasPrecedingLineBreak()) { error(ts.Diagnostics.Line_break_not_permitted_here); @@ -4602,13 +4278,13 @@ var ts; return finishNode(node); } function parseTryStatement() { - var node = createNode(176 /* TryStatement */); - node.tryBlock = parseTokenAndBlock(94 /* TryKeyword */, 177 /* TryBlock */); + var node = createNode(179 /* TryStatement */); + node.tryBlock = parseTokenAndBlock(94 /* TryKeyword */, 180 /* TryBlock */); if (token === 66 /* CatchKeyword */) { node.catchBlock = parseCatchBlock(); } if (token === 79 /* FinallyKeyword */) { - node.finallyBlock = parseTokenAndBlock(79 /* FinallyKeyword */, 179 /* FinallyBlock */); + node.finallyBlock = parseTokenAndBlock(79 /* FinallyKeyword */, 182 /* FinallyBlock */); } if (!(node.catchBlock || node.finallyBlock)) { error(ts.Diagnostics.catch_or_finally_expected); @@ -4628,24 +4304,17 @@ var ts; parseExpected(66 /* CatchKeyword */); parseExpected(15 /* OpenParenToken */); var variable = parseIdentifier(); - var typeAnnotationColonStart = scanner.getTokenPos(); - var typeAnnotationColonLength = scanner.getTextPos() - typeAnnotationColonStart; var typeAnnotation = parseTypeAnnotation(); parseExpected(16 /* CloseParenToken */); var result = parseBlock(false, false); - result.kind = 178 /* CatchBlock */; + result.kind = 181 /* CatchBlock */; result.pos = pos; result.variable = variable; - if (typeAnnotation) { - errorAtPos(typeAnnotationColonStart, typeAnnotationColonLength, ts.Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation); - } - if (isInStrictMode && isEvalOrArgumentsIdentifier(variable)) { - reportInvalidUseInStrictMode(variable); - } + result.type = typeAnnotation; return result; } function parseDebuggerStatement() { - var node = createNode(180 /* DebuggerStatement */); + var node = createNode(183 /* DebuggerStatement */); parseExpected(70 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -4653,28 +4322,18 @@ var ts; function isIterationStatementStart() { return token === 98 /* WhileKeyword */ || token === 73 /* DoKeyword */ || token === 80 /* ForKeyword */; } - function parseStatementWithLabelSet(allowLetAndConstDeclarations) { - labelledStatementInfo.pushCurrentLabelSet(isIterationStatementStart()); - var statement = parseStatement(allowLetAndConstDeclarations); - labelledStatementInfo.pop(); - return statement; - } function isLabel() { return isIdentifier() && lookAhead(function () { return nextToken() === 50 /* ColonToken */; }); } - function parseLabeledStatement(allowLetAndConstDeclarations) { - var node = createNode(174 /* LabeledStatement */); + function parseLabeledStatement() { + var node = createNode(177 /* LabeledStatement */); node.label = parseIdentifier(); parseExpected(50 /* ColonToken */); - if (labelledStatementInfo.nodeIsNestedInLabel(node.label, false, true)) { - grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, getTextOfNodeFromSourceText(sourceText, node.label)); - } - labelledStatementInfo.addLabel(node.label); - node.statement = isLabel() ? parseLabeledStatement(allowLetAndConstDeclarations) : parseStatementWithLabelSet(allowLetAndConstDeclarations); + node.statement = isLabel() ? parseLabeledStatement() : parseStatement(); return finishNode(node); } function parseExpressionStatement() { - var node = createNode(161 /* ExpressionStatement */); + var node = createNode(164 /* ExpressionStatement */); node.expression = parseExpression(); parseSemicolon(); return finishNode(node); @@ -4724,14 +4383,14 @@ var ts; return isStartOfExpression(); } } - function parseStatement(allowLetAndConstDeclarations) { + function parseStatement() { switch (token) { case 13 /* OpenBraceToken */: return parseBlock(false, false); case 96 /* VarKeyword */: case 102 /* LetKeyword */: case 68 /* ConstKeyword */: - return parseVariableStatement(allowLetAndConstDeclarations); + return parseVariableStatement(); case 81 /* FunctionKeyword */: return parseFunctionDeclaration(); case 21 /* SemicolonToken */: @@ -4745,9 +4404,9 @@ var ts; case 80 /* ForKeyword */: return parseForOrForInStatement(); case 69 /* ContinueKeyword */: - return parseBreakOrContinueStatement(167 /* ContinueStatement */); + return parseBreakOrContinueStatement(170 /* ContinueStatement */); case 64 /* BreakKeyword */: - return parseBreakOrContinueStatement(168 /* BreakStatement */); + return parseBreakOrContinueStatement(171 /* BreakStatement */); case 88 /* ReturnKeyword */: return parseReturnStatement(); case 99 /* WithKeyword */: @@ -4763,22 +4422,12 @@ var ts; case 70 /* DebuggerKeyword */: return parseDebuggerStatement(); default: - if (isLabel()) { - return parseLabeledStatement(allowLetAndConstDeclarations); - } - return parseExpressionStatement(); + return isLabel() ? parseLabeledStatement() : parseExpressionStatement(); } } - function parseAndCheckFunctionBody(isConstructor) { - var initialPosition = scanner.getTokenPos(); - var errorCountBeforeBody = file.syntacticErrors.length; + function parseFunctionBlockOrSemicolon() { if (token === 13 /* OpenBraceToken */) { - var body = parseBody(false); - if (body && inAmbientContext && file.syntacticErrors.length === errorCountBeforeBody) { - var diagnostic = isConstructor ? ts.Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context : ts.Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; - grammarErrorAtPos(initialPosition, 1, diagnostic); - } - return body; + return parseFunctionBlock(false); } if (canParseSemicolon()) { parseSemicolon(); @@ -4787,69 +4436,39 @@ var ts; error(ts.Diagnostics.Block_or_expected); } function parseVariableDeclaration(flags, noIn) { - var node = createNode(181 /* VariableDeclaration */); + var node = createNode(184 /* VariableDeclaration */); node.flags = flags; - var errorCountBeforeVariableDeclaration = file.syntacticErrors.length; node.name = parseIdentifier(); node.type = parseTypeAnnotation(); var initializerStart = scanner.getTokenPos(); var initializerFirstTokenLength = scanner.getTextPos() - initializerStart; node.initializer = parseInitializer(false, noIn); - if (inAmbientContext && node.initializer && errorCountBeforeVariableDeclaration === file.syntacticErrors.length) { - grammarErrorAtPos(initializerStart, initializerFirstTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } - if (!inAmbientContext && !node.initializer && flags & 4096 /* Const */) { - grammarErrorOnNode(node, ts.Diagnostics.const_declarations_must_be_initialized); - } - if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { - reportInvalidUseInStrictMode(node.name); - } return finishNode(node); } function parseVariableDeclarationList(flags, noIn) { - return parseDelimitedList(9 /* VariableDeclarations */, function () { return parseVariableDeclaration(flags, noIn); }, false); + return parseDelimitedList(9 /* VariableDeclarations */, function () { return parseVariableDeclaration(flags, noIn); }); } - function parseVariableStatement(allowLetAndConstDeclarations, pos, flags) { - var node = createNode(159 /* VariableStatement */, pos); - if (flags) + function parseVariableStatement(pos, flags) { + var node = createNode(162 /* VariableStatement */, pos); + if (flags) { node.flags = flags; - var errorCountBeforeVarStatement = file.syntacticErrors.length; + } if (token === 102 /* LetKeyword */) { node.flags |= 2048 /* Let */; } else if (token === 68 /* ConstKeyword */) { node.flags |= 4096 /* Const */; } - else if (token !== 96 /* VarKeyword */) { - error(ts.Diagnostics.var_let_or_const_expected); + else { + ts.Debug.assert(token === 96 /* VarKeyword */); } nextToken(); node.declarations = parseVariableDeclarationList(node.flags, false); parseSemicolon(); - finishNode(node); - if (!node.declarations.length && file.syntacticErrors.length === errorCountBeforeVarStatement) { - grammarErrorOnNode(node, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); - } - if (languageVersion < 2 /* ES6 */) { - if (node.flags & 2048 /* Let */) { - grammarErrorOnNode(node, ts.Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); - } - else if (node.flags & 4096 /* Const */) { - grammarErrorOnNode(node, ts.Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); - } - } - else if (!allowLetAndConstDeclarations) { - if (node.flags & 2048 /* Let */) { - grammarErrorOnNode(node, ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block); - } - else if (node.flags & 4096 /* Const */) { - grammarErrorOnNode(node, ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block); - } - } - return node; + return finishNode(node); } function parseFunctionDeclaration(pos, flags) { - var node = createNode(182 /* FunctionDeclaration */, pos); + var node = createNode(185 /* FunctionDeclaration */, pos); if (flags) node.flags = flags; parseExpected(81 /* FunctionKeyword */); @@ -4858,119 +4477,65 @@ var ts; node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; - node.body = parseAndCheckFunctionBody(false); - if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { - reportInvalidUseInStrictMode(node.name); - } + node.body = parseFunctionBlockOrSemicolon(); return finishNode(node); } - function parseConstructorDeclaration(pos, flags) { + function parseConstructorDeclaration(pos, modifiers) { var node = createNode(126 /* Constructor */, pos); - node.flags = flags; + setModifiers(node, modifiers); parseExpected(111 /* ConstructorKeyword */); var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; - node.body = parseAndCheckFunctionBody(true); - if (node.typeParameters) { - grammarErrorAtPos(node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); - } - if (node.type) { - grammarErrorOnNode(node.type, ts.Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); - } + node.body = parseFunctionBlockOrSemicolon(); return finishNode(node); } - function parsePropertyMemberDeclaration(pos, flags) { - var errorCountBeforePropertyDeclaration = file.syntacticErrors.length; + function parsePropertyMemberDeclaration(pos, modifiers) { var name = parsePropertyName(); + var flags = modifiers ? modifiers.flags : 0; var questionStart = scanner.getTokenPos(); if (parseOptional(49 /* QuestionToken */)) { - errorAtPos(questionStart, scanner.getStartPos() - questionStart, ts.Diagnostics.A_class_member_cannot_be_declared_optional); + flags |= 4 /* QuestionMark */; } if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { var method = createNode(125 /* Method */, pos); - method.flags = flags; + setModifiers(method, modifiers); + if (flags) { + method.flags = flags; + } method.name = name; var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); method.typeParameters = sig.typeParameters; method.parameters = sig.parameters; method.type = sig.type; - method.body = parseAndCheckFunctionBody(false); + method.body = parseFunctionBlockOrSemicolon(); return finishNode(method); } else { var property = createNode(124 /* Property */, pos); - property.flags = flags; + setModifiers(property, modifiers); + if (flags) { + property.flags = flags; + } property.name = name; property.type = parseTypeAnnotation(); var initializerStart = scanner.getTokenPos(); var initializerFirstTokenLength = scanner.getTextPos() - initializerStart; property.initializer = parseInitializer(false); parseSemicolon(); - if (inAmbientContext && property.initializer && errorCountBeforePropertyDeclaration === file.syntacticErrors.length) { - grammarErrorAtPos(initializerStart, initializerFirstTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } return finishNode(property); } } - function parseAndCheckMemberAccessorDeclaration(kind, pos, flags) { - var errorCountBeforeAccessor = file.syntacticErrors.length; - var accessor = parseMemberAccessorDeclaration(kind, pos, flags); - if (errorCountBeforeAccessor === file.syntacticErrors.length) { - if (languageVersion < 1 /* ES5 */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); - } - else if (inAmbientContext) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); - } - else if (accessor.typeParameters) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); - } - else if (kind === 127 /* GetAccessor */ && accessor.parameters.length) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); - } - else if (kind === 128 /* SetAccessor */) { - if (accessor.type) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); - } - else if (accessor.parameters.length !== 1) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); - } - else { - var parameter = accessor.parameters[0]; - if (parameter.flags & 8 /* Rest */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter); - } - else if (parameter.flags & 243 /* Modifier */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); - } - else if (parameter.flags & 4 /* QuestionMark */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); - } - else if (parameter.initializer) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); - } - } - } - } - return accessor; - } - function parseMemberAccessorDeclaration(kind, pos, flags) { + function parseMemberAccessorDeclaration(kind, pos, modifiers) { var node = createNode(kind, pos); - node.flags = flags; + setModifiers(node, modifiers); node.name = parsePropertyName(); var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; - if (inAmbientContext && canParseSemicolon()) { - parseSemicolon(); - node.body = createMissingNode(); - } - else { - node.body = parseBody(false); - } + node.body = parseFunctionBlockOrSemicolon(); return finishNode(node); } function isClassMemberStart() { @@ -5003,177 +4568,55 @@ var ts; } return false; } - function parseAndCheckModifiers(context) { + function parseModifiers(context) { var flags = 0; - var lastStaticModifierStart; - var lastStaticModifierLength; - var lastDeclareModifierStart; - var lastDeclareModifierLength; - var lastPrivateModifierStart; - var lastPrivateModifierLength; - var lastProtectedModifierStart; - var lastProtectedModifierLength; + var modifiers; while (true) { var modifierStart = scanner.getTokenPos(); var modifierToken = token; if (!parseAnyContextualModifier()) break; - var modifierLength = scanner.getStartPos() - modifierStart; - switch (modifierToken) { - case 106 /* PublicKeyword */: - if (flags & 112 /* AccessibilityModifier */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & 128 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "public", "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "public"); - } - flags |= 16 /* Public */; - break; - case 104 /* PrivateKeyword */: - if (flags & 112 /* AccessibilityModifier */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & 128 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "private", "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "private"); - } - lastPrivateModifierStart = modifierStart; - lastPrivateModifierLength = modifierLength; - flags |= 32 /* Private */; - break; - case 105 /* ProtectedKeyword */: - if (flags & 16 /* Public */ || flags & 32 /* Private */ || flags & 64 /* Protected */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & 128 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "protected", "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "protected"); - } - lastProtectedModifierStart = modifierStart; - lastProtectedModifierLength = modifierLength; - flags |= 64 /* Protected */; - break; - case 107 /* StaticKeyword */: - if (flags & 128 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); - } - else if (context === 3 /* Parameters */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); - } - lastStaticModifierStart = modifierStart; - lastStaticModifierLength = modifierLength; - flags |= 128 /* Static */; - break; - case 76 /* ExportKeyword */: - if (flags & 1 /* Export */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "export"); - } - else if (flags & 2 /* Ambient */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); - } - else if (context === 2 /* ClassMembers */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); - } - else if (context === 3 /* Parameters */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); - } - flags |= 1 /* Export */; - break; - case 112 /* DeclareKeyword */: - if (flags & 2 /* Ambient */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "declare"); - } - else if (context === 2 /* ClassMembers */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); - } - else if (context === 3 /* Parameters */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); - } - else if (inAmbientContext && context === 1 /* ModuleElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); - } - lastDeclareModifierStart = modifierStart; - lastDeclareModifierLength = modifierLength; - flags |= 2 /* Ambient */; - break; + if (!modifiers) { + modifiers = []; } + flags |= modifierToFlag(modifierToken); + modifiers.push(finishNode(createNode(modifierToken, modifierStart))); } - if (token === 111 /* ConstructorKeyword */ && flags & 128 /* Static */) { - grammarErrorAtPos(lastStaticModifierStart, lastStaticModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); + if (modifiers) { + modifiers.flags = flags; } - else if (token === 111 /* ConstructorKeyword */ && flags & 32 /* Private */) { - grammarErrorAtPos(lastPrivateModifierStart, lastPrivateModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); - } - else if (token === 111 /* ConstructorKeyword */ && flags & 64 /* Protected */) { - grammarErrorAtPos(lastProtectedModifierStart, lastProtectedModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "protected"); - } - else if (token === 83 /* ImportKeyword */) { - if (flags & 2 /* Ambient */) { - grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); - } - } - else if (token === 101 /* InterfaceKeyword */) { - if (flags & 2 /* Ambient */) { - grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); - } - } - else if (token !== 76 /* ExportKeyword */ && !(flags & 2 /* Ambient */) && inAmbientContext && context === 0 /* SourceElements */) { - var declarationStart = scanner.getTokenPos(); - var declarationFirstTokenLength = scanner.getTextPos() - declarationStart; - grammarErrorAtPos(declarationStart, declarationFirstTokenLength, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); - } - return flags; + return modifiers; } function parseClassMemberDeclaration() { var pos = getNodePos(); - var flags = parseAndCheckModifiers(2 /* ClassMembers */); + var modifiers = parseModifiers(2 /* ClassMembers */); if (parseContextualModifier(113 /* GetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(127 /* GetAccessor */, pos, flags); + return parseMemberAccessorDeclaration(127 /* GetAccessor */, pos, modifiers); } if (parseContextualModifier(117 /* SetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(128 /* SetAccessor */, pos, flags); + return parseMemberAccessorDeclaration(128 /* SetAccessor */, pos, modifiers); } if (token === 111 /* ConstructorKeyword */) { - return parseConstructorDeclaration(pos, flags); + return parseConstructorDeclaration(pos, modifiers); } if (token >= 63 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { - return parsePropertyMemberDeclaration(pos, flags); + return parsePropertyMemberDeclaration(pos, modifiers); } if (token === 17 /* OpenBracketToken */) { - if (flags) { - var start = getTokenPos(pos); - var length = getNodePos() - start; - errorAtPos(start, length, ts.Diagnostics.Modifiers_not_permitted_on_index_signature_members); - } - return parseIndexSignatureMember(); + return parseIndexSignatureMember(modifiers, pos); } ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassDeclaration(pos, flags) { - var node = createNode(184 /* ClassDeclaration */, pos); + var node = createNode(187 /* ClassDeclaration */, pos); node.flags = flags; - var errorCountBeforeClassDeclaration = file.syntacticErrors.length; parseExpected(67 /* ClassKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); node.baseType = parseOptional(77 /* ExtendsKeyword */) ? parseTypeReference() : undefined; - var implementsKeywordStart = scanner.getTokenPos(); - var implementsKeywordLength; if (parseOptional(100 /* ImplementsKeyword */)) { - implementsKeywordLength = scanner.getStartPos() - implementsKeywordStart; - node.implementedTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); + node.implementedTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference); } - var errorCountBeforeClassBody = file.syntacticErrors.length; if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseList(6 /* ClassMembers */, false, parseClassMemberDeclaration); parseExpected(14 /* CloseBraceToken */); @@ -5181,33 +4624,22 @@ var ts; else { node.members = createMissingList(); } - if (node.implementedTypes && !node.implementedTypes.length && errorCountBeforeClassBody === errorCountBeforeClassDeclaration) { - grammarErrorAtPos(implementsKeywordStart, implementsKeywordLength, ts.Diagnostics._0_list_cannot_be_empty, "implements"); - } return finishNode(node); } function parseInterfaceDeclaration(pos, flags) { - var node = createNode(185 /* InterfaceDeclaration */, pos); + var node = createNode(188 /* InterfaceDeclaration */, pos); node.flags = flags; - var errorCountBeforeInterfaceDeclaration = file.syntacticErrors.length; parseExpected(101 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); - var extendsKeywordStart = scanner.getTokenPos(); - var extendsKeywordLength; if (parseOptional(77 /* ExtendsKeyword */)) { - extendsKeywordLength = scanner.getStartPos() - extendsKeywordStart; - node.baseTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); + node.baseTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference); } - var errorCountBeforeInterfaceBody = file.syntacticErrors.length; node.members = parseTypeLiteral().members; - if (node.baseTypes && !node.baseTypes.length && errorCountBeforeInterfaceBody === errorCountBeforeInterfaceDeclaration) { - grammarErrorAtPos(extendsKeywordStart, extendsKeywordLength, ts.Diagnostics._0_list_cannot_be_empty, "extends"); - } return finishNode(node); } function parseTypeAliasDeclaration(pos, flags) { - var node = createNode(186 /* TypeAliasDeclaration */, pos); + var node = createNode(189 /* TypeAliasDeclaration */, pos); node.flags = flags; parseExpected(119 /* TypeKeyword */); node.name = parseIdentifier(); @@ -5218,43 +4650,13 @@ var ts; } function parseAndCheckEnumDeclaration(pos, flags) { var enumIsConst = flags & 4096 /* Const */; - function isIntegerLiteral(expression) { - function isInteger(literalExpression) { - return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); - } - if (expression.kind === 151 /* PrefixOperator */) { - var unaryExpression = expression; - if (unaryExpression.operator === 32 /* PlusToken */ || unaryExpression.operator === 33 /* MinusToken */) { - expression = unaryExpression.operand; - } - } - if (expression.kind === 6 /* NumericLiteral */) { - return isInteger(expression); - } - return false; - } - var inConstantEnumMemberSection = true; - function parseAndCheckEnumMember() { - var node = createNode(192 /* EnumMember */); - var errorCountBeforeEnumMember = file.syntacticErrors.length; + function parseEnumMember() { + var node = createNode(195 /* EnumMember */); node.name = parsePropertyName(); node.initializer = parseInitializer(false); - if (!enumIsConst) { - if (inAmbientContext) { - if (node.initializer && !isIntegerLiteral(node.initializer) && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, ts.Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers); - } - } - else if (node.initializer) { - inConstantEnumMemberSection = isIntegerLiteral(node.initializer); - } - else if (!inConstantEnumMemberSection && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, ts.Diagnostics.Enum_member_must_have_initializer); - } - } return finishNode(node); } - var node = createNode(187 /* EnumDeclaration */, pos); + var node = createNode(190 /* EnumDeclaration */, pos); node.flags = flags; if (enumIsConst) { parseExpected(68 /* ConstKeyword */); @@ -5262,7 +4664,7 @@ var ts; parseExpected(75 /* EnumKeyword */); node.name = parseIdentifier(); if (parseExpected(13 /* OpenBraceToken */)) { - node.members = parseDelimitedList(7 /* EnumMembers */, parseAndCheckEnumMember, true); + node.members = parseDelimitedList(7 /* EnumMembers */, parseEnumMember); parseExpected(14 /* CloseBraceToken */); } else { @@ -5271,7 +4673,7 @@ var ts; return finishNode(node); } function parseModuleBody() { - var node = createNode(189 /* ModuleBlock */); + var node = createNode(192 /* ModuleBlock */); if (parseExpected(13 /* OpenBraceToken */)) { node.statements = parseList(1 /* ModuleElements */, false, parseModuleElement); parseExpected(14 /* CloseBraceToken */); @@ -5282,7 +4684,7 @@ var ts; return finishNode(node); } function parseInternalModuleTail(pos, flags) { - var node = createNode(188 /* ModuleDeclaration */, pos); + var node = createNode(191 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseIdentifier(); if (parseOptional(19 /* DotToken */)) { @@ -5290,31 +4692,14 @@ var ts; } else { node.body = parseModuleBody(); - ts.forEach(node.body.statements, function (s) { - if (s.kind === 191 /* ExportAssignment */) { - grammarErrorOnNode(s, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); - } - else if (s.kind === 190 /* ImportDeclaration */ && s.externalModuleName) { - grammarErrorOnNode(s, ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); - } - }); } return finishNode(node); } function parseAmbientExternalModuleDeclaration(pos, flags) { - var node = createNode(188 /* ModuleDeclaration */, pos); + var node = createNode(191 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseStringLiteral(); - if (!inAmbientContext) { - var errorCount = file.syntacticErrors.length; - if (!errorCount || file.syntacticErrors[errorCount - 1].start < getTokenPos(pos)) { - grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); - } - } - var saveInAmbientContext = inAmbientContext; - inAmbientContext = true; node.body = parseModuleBody(); - inAmbientContext = saveInAmbientContext; return finishNode(node); } function parseModuleDeclaration(pos, flags) { @@ -5322,7 +4707,7 @@ var ts; return token === 7 /* StringLiteral */ ? parseAmbientExternalModuleDeclaration(pos, flags) : parseInternalModuleTail(pos, flags); } function parseImportDeclaration(pos, flags) { - var node = createNode(190 /* ImportDeclaration */, pos); + var node = createNode(193 /* ImportDeclaration */, pos); node.flags = flags; parseExpected(83 /* ImportKeyword */); node.name = parseIdentifier(); @@ -5338,8 +4723,9 @@ var ts; parseSemicolon(); return finishNode(node); } - function parseExportAssignmentTail(pos) { - var node = createNode(191 /* ExportAssignment */, pos); + function parseExportAssignmentTail(pos, modifiers) { + var node = createNode(194 /* ExportAssignment */, pos); + setModifiers(node, modifiers); node.exportName = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -5374,29 +4760,20 @@ var ts; } function parseDeclaration(modifierContext) { var pos = getNodePos(); - var errorCountBeforeModifiers = file.syntacticErrors.length; - var flags = parseAndCheckModifiers(modifierContext); + var modifiers = parseModifiers(modifierContext); if (token === 76 /* ExportKeyword */) { var modifiersEnd = scanner.getStartPos(); nextToken(); if (parseOptional(51 /* EqualsToken */)) { - var exportAssignmentTail = parseExportAssignmentTail(pos); - if (flags !== 0 && errorCountBeforeModifiers === file.syntacticErrors.length) { - var modifiersStart = ts.skipTrivia(sourceText, pos); - grammarErrorAtPos(modifiersStart, modifiersEnd - modifiersStart, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); - } - return exportAssignmentTail; + return parseExportAssignmentTail(pos, modifiers); } } - var saveInAmbientContext = inAmbientContext; - if (flags & 2 /* Ambient */) { - inAmbientContext = true; - } + var flags = modifiers ? modifiers.flags : 0; var result; switch (token) { case 96 /* VarKeyword */: case 102 /* LetKeyword */: - result = parseVariableStatement(true, pos, flags); + result = parseVariableStatement(pos, flags); break; case 68 /* ConstKeyword */: var isConstEnum = lookAhead(function () { return nextToken() === 75 /* EnumKeyword */; }); @@ -5404,7 +4781,7 @@ var ts; result = parseAndCheckEnumDeclaration(pos, flags | 4096 /* Const */); } else { - result = parseVariableStatement(true, pos, flags); + result = parseVariableStatement(pos, flags); } break; case 81 /* FunctionKeyword */: @@ -5431,7 +4808,9 @@ var ts; default: error(ts.Diagnostics.Declaration_expected); } - inAmbientContext = saveInAmbientContext; + if (modifiers) { + result.modifiers = modifiers; + } return result; } function isSourceElement(inErrorRecovery) { @@ -5444,50 +4823,38 @@ var ts; return parseSourceElementOrModuleElement(1 /* ModuleElements */); } function parseSourceElementOrModuleElement(modifierContext) { - if (isDeclarationStart()) { - return parseDeclaration(modifierContext); - } - var statementStart = scanner.getTokenPos(); - var statementFirstTokenLength = scanner.getTextPos() - statementStart; - var errorCountBeforeStatement = file.syntacticErrors.length; - var statement = parseStatement(true); - if (inAmbientContext && file.syntacticErrors.length === errorCountBeforeStatement) { - grammarErrorAtPos(statementStart, statementFirstTokenLength, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); - } - return statement; + return isDeclarationStart() ? parseDeclaration(modifierContext) : parseStatement(); } function processReferenceComments() { var referencedFiles = []; var amdDependencies = []; + var amdModuleName; commentRanges = []; token = scanner.scan(); for (var i = 0; i < commentRanges.length; i++) { var range = commentRanges[i]; var comment = sourceText.substring(range.pos, range.end); - var simpleReferenceRegEx = /^\/\/\/\s*/gim; - if (isNoDefaultLibRegEx.exec(comment)) { - file.hasNoDefaultLib = true; + var referencePathMatchResult = getFileReferenceFromReferencePath(comment, range); + if (referencePathMatchResult) { + var fileReference = referencePathMatchResult.fileReference; + file.hasNoDefaultLib = referencePathMatchResult.isNoDefaultLib; + var diagnostic = referencePathMatchResult.diagnostic; + if (fileReference) { + referencedFiles.push(fileReference); } - else { - var matchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment); - var start = range.pos; - var end = range.end; - var length = end - start; - if (!matchResult) { - errorAtPos(start, length, ts.Diagnostics.Invalid_reference_directive_syntax); - } - else { - referencedFiles.push({ - pos: start, - end: end, - filename: matchResult[3] - }); - } + if (diagnostic) { + errorAtPos(range.pos, range.end - range.pos, diagnostic); } } else { + var amdModuleNameRegEx = /^\/\/\/\s* 0) { + syntacticDiagnostics = file.parseDiagnostics; + } + else { + syntacticDiagnostics = file.grammarDiagnostics; + checkGrammar(sourceText, languageVersion, file); + } + } + ts.Debug.assert(syntacticDiagnostics !== undefined); + return syntacticDiagnostics; } scanner = ts.createScanner(languageVersion, true, sourceText, scanError, onComment); var rootNodeFlags = 0; if (ts.fileExtensionIs(filename, ".d.ts")) { rootNodeFlags = 1024 /* DeclarationFile */; - inAmbientContext = true; } - file = createRootNode(193 /* SourceFile */, 0, sourceText.length, rootNodeFlags); + file = createRootNode(196 /* SourceFile */, 0, sourceText.length, rootNodeFlags); file.filename = ts.normalizePath(filename); file.text = sourceText; - file.getLineAndCharacterFromPosition = getLineAndCharacterlFromSourcePosition; + file.getLineAndCharacterFromPosition = getLineAndCharacterFromSourcePosition; file.getPositionFromLineAndCharacter = getPositionFromSourceLineAndCharacter; - file.syntacticErrors = []; - file.semanticErrors = []; + file.getLineStarts = getLineStarts; + file.getSyntacticDiagnostics = getSyntacticDiagnostics; + file.parseDiagnostics = []; + file.grammarDiagnostics = []; + file.semanticDiagnostics = []; var referenceComments = processReferenceComments(); file.referencedFiles = referenceComments.referencedFiles; file.amdDependencies = referenceComments.amdDependencies; + file.amdModuleName = referenceComments.amdModuleName; file.statements = parseList(0 /* SourceElements */, true, parseSourceElement); file.externalModuleIndicator = getExternalModuleIndicator(); file.nodeCount = nodeCount; @@ -5531,6 +4916,901 @@ var ts; return file; } ts.createSourceFile = createSourceFile; + function isLeftHandSideExpression(expr) { + if (expr) { + switch (expr.kind) { + case 145 /* PropertyAccess */: + case 146 /* IndexedAccess */: + case 148 /* NewExpression */: + case 147 /* CallExpression */: + case 149 /* TaggedTemplateExpression */: + case 141 /* ArrayLiteral */: + case 151 /* ParenExpression */: + case 142 /* ObjectLiteral */: + case 152 /* FunctionExpression */: + case 63 /* Identifier */: + case 120 /* Missing */: + case 8 /* RegularExpressionLiteral */: + case 6 /* NumericLiteral */: + case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 158 /* TemplateExpression */: + case 78 /* FalseKeyword */: + case 87 /* NullKeyword */: + case 91 /* ThisKeyword */: + case 93 /* TrueKeyword */: + case 89 /* SuperKeyword */: + return true; + } + } + return false; + } + function isAssignmentOperator(token) { + return token >= 51 /* FirstAssignment */ && token <= 62 /* LastAssignment */; + } + function checkGrammar(sourceText, languageVersion, file) { + var grammarDiagnostics = file.grammarDiagnostics; + var scanner = ts.createScanner(languageVersion, true, sourceText); + var inAmbientContext = ts.fileExtensionIs(file.filename, ".d.ts"); + var inFunctionBlock = false; + var parent; + visitNode(file); + function visitNode(node) { + var savedParent = parent; + node.parent = parent; + parent = node; + if (!checkModifiers(node)) { + var savedInFunctionBlock = inFunctionBlock; + if (node.kind === 186 /* FunctionBlock */) { + inFunctionBlock = true; + } + var savedInAmbientContext = inAmbientContext; + if (node.flags & 2 /* Ambient */) { + inAmbientContext = true; + } + checkNodeAndChildren(node); + inAmbientContext = savedInAmbientContext; + inFunctionBlock = savedInFunctionBlock; + } + parent = savedParent; + } + function checkNodeAndChildren(node) { + var nodeKind = node.kind; + if (inAmbientContext && checkForStatementInAmbientContext(node, nodeKind)) { + return; + } + if (checkNode(node, nodeKind)) { + return; + } + forEachChild(node, visitNode); + } + function checkNode(node, nodeKind) { + switch (nodeKind) { + case 153 /* ArrowFunction */: + case 129 /* CallSignature */: + case 134 /* ConstructorType */: + case 130 /* ConstructSignature */: + case 133 /* FunctionType */: + return checkAnyParsedSignature(node); + case 171 /* BreakStatement */: + case 170 /* ContinueStatement */: + return checkBreakOrContinueStatement(node); + case 147 /* CallExpression */: + case 148 /* NewExpression */: + return checkCallOrNewExpression(node); + case 190 /* EnumDeclaration */: return checkEnumDeclaration(node); + case 123 /* Parameter */: return checkParameter(node); + case 156 /* BinaryExpression */: return checkBinaryExpression(node); + case 181 /* CatchBlock */: return checkCatchBlock(node); + case 187 /* ClassDeclaration */: return checkClassDeclaration(node); + case 126 /* Constructor */: return checkConstructor(node); + case 194 /* ExportAssignment */: return checkExportAssignment(node); + case 169 /* ForInStatement */: return checkForInStatement(node); + case 168 /* ForStatement */: return checkForStatement(node); + case 185 /* FunctionDeclaration */: return checkFunctionDeclaration(node); + case 152 /* FunctionExpression */: return checkFunctionExpression(node); + case 127 /* GetAccessor */: return checkGetAccessor(node); + case 146 /* IndexedAccess */: return checkIndexedAccess(node); + case 131 /* IndexSignature */: return checkIndexSignature(node); + case 188 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); + case 177 /* LabeledStatement */: return checkLabeledStatement(node); + case 125 /* Method */: return checkMethod(node); + case 191 /* ModuleDeclaration */: return checkModuleDeclaration(node); + case 142 /* ObjectLiteral */: return checkObjectLiteral(node); + case 6 /* NumericLiteral */: return checkNumericLiteral(node); + case 155 /* PostfixOperator */: return checkPostfixOperator(node); + case 154 /* PrefixOperator */: return checkPrefixOperator(node); + case 124 /* Property */: return checkProperty(node); + case 143 /* PropertyAssignment */: return checkPropertyAssignment(node); + case 172 /* ReturnStatement */: return checkReturnStatement(node); + case 128 /* SetAccessor */: return checkSetAccessor(node); + case 196 /* SourceFile */: return checkSourceFile(node); + case 144 /* ShorthandPropertyAssignment */: return checkShorthandPropertyAssignment(node); + case 174 /* SwitchStatement */: return checkSwitchStatement(node); + case 149 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); + case 138 /* TupleType */: return checkTupleType(node); + case 122 /* TypeParameter */: return checkTypeParameter(node); + case 132 /* TypeReference */: return checkTypeReference(node); + case 184 /* VariableDeclaration */: return checkVariableDeclaration(node); + case 162 /* VariableStatement */: return checkVariableStatement(node); + case 173 /* WithStatement */: return checkWithStatement(node); + } + } + function grammarErrorOnFirstToken(node, message, arg0, arg1, arg2) { + var start = ts.skipTrivia(sourceText, node.pos); + scanner.setTextPos(start); + scanner.scan(); + var end = scanner.getTextPos(); + grammarDiagnostics.push(ts.createFileDiagnostic(file, start, end - start, message, arg0, arg1, arg2)); + return true; + } + function grammarErrorOnNode(node, message, arg0, arg1, arg2) { + var span = getErrorSpanForNode(node); + var start = span.end > span.pos ? ts.skipTrivia(file.text, span.pos) : span.pos; + var length = span.end - start; + grammarDiagnostics.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + return true; + } + function grammarErrorAtPos(start, length, message, arg0, arg1, arg2) { + grammarDiagnostics.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + return true; + } + function reportInvalidUseInStrictMode(node) { + var name = sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end); + return grammarErrorOnNode(node, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, name); + } + function checkForStatementInAmbientContext(node, kind) { + switch (kind) { + case 161 /* Block */: + case 163 /* EmptyStatement */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: + case 172 /* ReturnStatement */: + case 173 /* WithStatement */: + case 174 /* SwitchStatement */: + case 178 /* ThrowStatement */: + case 179 /* TryStatement */: + case 183 /* DebuggerStatement */: + case 177 /* LabeledStatement */: + case 164 /* ExpressionStatement */: + return grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); + } + } + function checkAnyParsedSignature(node) { + return checkTypeParameterList(node.typeParameters) || checkParameterList(node.parameters); + } + function checkBinaryExpression(node) { + if (node.flags & 8192 /* ParsedInStrictMode */) { + if (isLeftHandSideExpression(node.left) && isAssignmentOperator(node.operator)) { + if (isEvalOrArgumentsIdentifier(node.left)) { + return reportInvalidUseInStrictMode(node.left); + } + } + } + } + function isIterationStatement(node, lookInLabeledStatements) { + switch (node.kind) { + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + return true; + case 177 /* LabeledStatement */: + return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); + } + return false; + } + function checkLabeledStatement(node) { + var current = node.parent; + while (current) { + if (isAnyFunction(current)) { + break; + } + if (current.kind === 177 /* LabeledStatement */ && current.label.text === node.label.text) { + return grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, getTextOfNodeFromSourceText(sourceText, node.label)); + } + current = current.parent; + } + } + function checkBreakOrContinueStatement(node) { + var current = node; + while (current) { + if (isAnyFunction(current)) { + return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); + } + switch (current.kind) { + case 177 /* LabeledStatement */: + if (node.label && current.label.text === node.label.text) { + var isMisplacedContinueLabel = node.kind === 170 /* ContinueStatement */ && !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); + } + return false; + } + break; + case 174 /* SwitchStatement */: + if (node.kind === 171 /* BreakStatement */ && !node.label) { + return false; + } + break; + default: + if (isIterationStatement(current, false) && !node.label) { + return false; + } + break; + } + current = current.parent; + } + if (node.label) { + var message = node.kind === 171 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; + return grammarErrorOnNode(node, message); + } + else { + var message = node.kind === 171 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; + return grammarErrorOnNode(node, message); + } + } + function checkCallOrNewExpression(node) { + return checkTypeArguments(node.typeArguments) || checkArguments(node.arguments); + } + function checkArguments(arguments) { + return checkForDisallowedTrailingComma(arguments) || checkForOmittedArgument(arguments); + } + function checkTypeArguments(typeArguments) { + return checkForDisallowedTrailingComma(typeArguments) || checkForAtLeastOneTypeArgument(typeArguments) || checkForMissingTypeArgument(typeArguments); + } + function checkForOmittedArgument(arguments) { + if (arguments) { + for (var i = 0, n = arguments.length; i < n; i++) { + var arg = arguments[i]; + if (arg.kind === 160 /* OmittedExpression */) { + return grammarErrorAtPos(arg.pos, 0, ts.Diagnostics.Argument_expression_expected); + } + } + } + } + function checkForMissingTypeArgument(typeArguments) { + if (typeArguments) { + for (var i = 0, n = typeArguments.length; i < n; i++) { + var arg = typeArguments[i]; + if (arg.kind === 120 /* Missing */) { + return grammarErrorAtPos(arg.pos, 0, ts.Diagnostics.Type_expected); + } + } + } + } + function checkForAtLeastOneTypeArgument(typeArguments) { + if (typeArguments && typeArguments.length === 0) { + var start = typeArguments.pos - "<".length; + var end = ts.skipTrivia(sourceText, typeArguments.end) + ">".length; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.Type_argument_list_cannot_be_empty); + } + } + function checkForDisallowedTrailingComma(list) { + if (list && list.hasTrailingComma) { + var start = list.end - ",".length; + var end = list.end; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.Trailing_comma_not_allowed); + } + } + function checkCatchBlock(node) { + if (node.type) { + var colonStart = ts.skipTrivia(sourceText, node.variable.end); + return grammarErrorAtPos(colonStart, ":".length, ts.Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation); + } + if (node.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(node.variable)) { + return reportInvalidUseInStrictMode(node.variable); + } + } + function checkClassDeclaration(node) { + return checkForDisallowedTrailingComma(node.implementedTypes) || checkForAtLeastOneHeritageClause(node.implementedTypes, "implements"); + } + function checkForAtLeastOneHeritageClause(types, listType) { + if (types && types.length === 0) { + return grammarErrorAtPos(types.pos, 0, ts.Diagnostics._0_list_cannot_be_empty, listType); + } + } + function checkConstructor(node) { + return checkAnyParsedSignature(node) || checkConstructorTypeParameters(node) || checkConstructorTypeAnnotation(node) || checkForBodyInAmbientContext(node.body, true); + } + function checkConstructorTypeParameters(node) { + if (node.typeParameters) { + return grammarErrorAtPos(node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); + } + } + function checkConstructorTypeAnnotation(node) { + if (node.type) { + return grammarErrorOnNode(node.type, ts.Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); + } + } + function checkEnumDeclaration(enumDecl) { + var enumIsConst = (enumDecl.flags & 4096 /* Const */) !== 0; + var hasError = false; + if (!enumIsConst) { + var inConstantEnumMemberSection = true; + for (var i = 0, n = enumDecl.members.length; i < n; i++) { + var node = enumDecl.members[i]; + if (inAmbientContext) { + if (node.initializer && !isIntegerLiteral(node.initializer)) { + hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers) || hasError; + } + } + else if (node.initializer) { + inConstantEnumMemberSection = isIntegerLiteral(node.initializer); + } + else if (!inConstantEnumMemberSection) { + hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Enum_member_must_have_initializer) || hasError; + } + } + } + return hasError; + } + function isIntegerLiteral(expression) { + function isInteger(literalExpression) { + return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); + } + if (expression.kind === 154 /* PrefixOperator */) { + var unaryExpression = expression; + if (unaryExpression.operator === 32 /* PlusToken */ || unaryExpression.operator === 33 /* MinusToken */) { + expression = unaryExpression.operand; + } + } + if (expression.kind === 6 /* NumericLiteral */) { + return isInteger(expression); + } + return false; + } + function checkExportAssignment(node) { + if (node.flags & 243 /* Modifier */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); + } + } + function checkForInStatement(node) { + return checkVariableDeclarations(node.declarations) || checkForMoreThanOneDeclaration(node.declarations); + } + function checkForStatement(node) { + return checkVariableDeclarations(node.declarations); + } + function checkForMoreThanOneDeclaration(declarations) { + if (declarations && declarations.length > 1) { + return grammarErrorOnFirstToken(declarations[1], ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); + } + } + function checkFunctionDeclaration(node) { + return checkAnyParsedSignature(node) || checkFunctionName(node.name) || checkForBodyInAmbientContext(node.body, false); + } + function checkFunctionExpression(node) { + return checkAnyParsedSignature(node) || checkFunctionName(node.name); + } + function checkFunctionName(name) { + if (name && name.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(name)) { + return reportInvalidUseInStrictMode(name); + } + } + function checkGetAccessor(node) { + return checkAnyParsedSignature(node) || checkAccessor(node); + } + function checkIndexedAccess(node) { + if (node.index.kind === 120 /* Missing */ && node.parent.kind === 148 /* NewExpression */ && node.parent.func === node) { + var start = ts.skipTrivia(sourceText, node.parent.pos); + var end = node.end; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); + } + } + function checkIndexSignature(node) { + return checkIndexSignatureParameters(node) || checkForIndexSignatureModifiers(node); + } + function checkForIndexSignatureModifiers(node) { + if (node.flags & 243 /* Modifier */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_not_permitted_on_index_signature_members); + } + } + function checkIndexSignatureParameters(node) { + var parameter = node.parameters[0]; + if (node.parameters.length !== 1) { + if (parameter) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter); + } + else { + return grammarErrorOnNode(node, ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter); + } + } + else if (parameter.flags & 8 /* Rest */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); + } + else if (parameter.flags & 243 /* Modifier */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); + } + else if (parameter.flags & 4 /* QuestionMark */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); + } + else if (parameter.initializer) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); + } + else if (!parameter.type) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); + } + else if (parameter.type.kind !== 118 /* StringKeyword */ && parameter.type.kind !== 116 /* NumberKeyword */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); + } + else if (!node.type) { + return grammarErrorOnNode(node, ts.Diagnostics.An_index_signature_must_have_a_type_annotation); + } + } + function checkInterfaceDeclaration(node) { + return checkForDisallowedTrailingComma(node.baseTypes) || checkForAtLeastOneHeritageClause(node.baseTypes, "extends"); + } + function checkMethod(node) { + return checkAnyParsedSignature(node) || checkForBodyInAmbientContext(node.body, false) || (node.parent.kind === 187 /* ClassDeclaration */ && checkForInvalidQuestionMark(node, ts.Diagnostics.A_class_member_cannot_be_declared_optional)); + } + function checkForBodyInAmbientContext(body, isConstructor) { + if (inAmbientContext && body && body.kind === 186 /* FunctionBlock */) { + var diagnostic = isConstructor ? ts.Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context : ts.Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; + return grammarErrorOnFirstToken(body, diagnostic); + } + } + function checkModuleDeclaration(node) { + return checkModuleDeclarationName(node) || checkModuleDeclarationStatements(node); + } + function checkModuleDeclarationName(node) { + if (!inAmbientContext && node.name.kind === 7 /* StringLiteral */) { + return grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); + } + } + function checkModuleDeclarationStatements(node) { + if (node.name.kind === 63 /* Identifier */ && node.body.kind === 192 /* ModuleBlock */) { + var statements = node.body.statements; + for (var i = 0, n = statements.length; i < n; i++) { + var statement = statements[i]; + if (statement.kind === 194 /* ExportAssignment */) { + return grammarErrorOnNode(statement, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); + } + else if (statement.kind === 193 /* ImportDeclaration */ && statement.externalModuleName) { + return grammarErrorOnNode(statement.externalModuleName, ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); + } + } + } + } + function checkObjectLiteral(node) { + var seen = {}; + var Property = 1; + var GetAccessor = 2; + var SetAccesor = 4; + var GetOrSetAccessor = GetAccessor | SetAccesor; + var inStrictMode = (node.flags & 8192 /* ParsedInStrictMode */) !== 0; + for (var i = 0, n = node.properties.length; i < n; i++) { + var prop = node.properties[i]; + if (prop.kind === 160 /* OmittedExpression */) { + continue; + } + var p = prop; + var name = p.name; + var currentKind; + if (p.kind === 143 /* PropertyAssignment */) { + currentKind = Property; + } + else if (p.kind === 144 /* ShorthandPropertyAssignment */) { + currentKind = Property; + } + else if (p.kind === 127 /* GetAccessor */) { + currentKind = GetAccessor; + } + else if (p.kind === 128 /* SetAccessor */) { + currentKind = SetAccesor; + } + else { + ts.Debug.fail("Unexpected syntax kind:" + p.kind); + } + if (!ts.hasProperty(seen, name.text)) { + seen[name.text] = currentKind; + } + else { + var existingKind = seen[name.text]; + if (currentKind === Property && existingKind === Property) { + if (inStrictMode) { + grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + } + } + else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { + if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { + seen[name.text] = currentKind | existingKind; + } + else { + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + } + } + else { + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + } + } + } + } + function checkNumericLiteral(node) { + if (node.flags & 16384 /* OctalLiteral */) { + if (node.flags & 8192 /* ParsedInStrictMode */) { + return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); + } + else if (languageVersion >= 1 /* ES5 */) { + return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); + } + } + } + function checkModifiers(node) { + switch (node.kind) { + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: + case 124 /* Property */: + case 125 /* Method */: + case 131 /* IndexSignature */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 191 /* ModuleDeclaration */: + case 190 /* EnumDeclaration */: + case 194 /* ExportAssignment */: + case 162 /* VariableStatement */: + case 185 /* FunctionDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 193 /* ImportDeclaration */: + case 123 /* Parameter */: + break; + default: + return false; + } + if (!node.modifiers) { + return; + } + var lastStatic, lastPrivate, lastProtected, lastDeclare; + var flags = 0; + for (var i = 0, n = node.modifiers.length; i < n; i++) { + var modifier = node.modifiers[i]; + switch (modifier.kind) { + case 106 /* PublicKeyword */: + case 105 /* ProtectedKeyword */: + case 104 /* PrivateKeyword */: + var text; + if (modifier.kind === 106 /* PublicKeyword */) { + text = "public"; + } + else if (modifier.kind === 105 /* ProtectedKeyword */) { + text = "protected"; + lastProtected = modifier; + } + else { + text = "private"; + lastPrivate = modifier; + } + if (flags & 112 /* AccessibilityModifier */) { + return grammarErrorOnNode(modifier, ts.Diagnostics.Accessibility_modifier_already_seen); + } + else if (flags & 128 /* Static */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); + } + else if (node.parent.kind === 192 /* ModuleBlock */ || node.parent.kind === 196 /* SourceFile */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); + } + flags |= modifierToFlag(modifier.kind); + break; + case 107 /* StaticKeyword */: + if (flags & 128 /* Static */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); + } + else if (node.parent.kind === 192 /* ModuleBlock */ || node.parent.kind === 196 /* SourceFile */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); + } + else if (node.kind === 123 /* Parameter */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); + } + flags |= 128 /* Static */; + lastStatic = modifier; + break; + case 76 /* ExportKeyword */: + if (flags & 1 /* Export */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "export"); + } + else if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); + } + else if (node.parent.kind === 187 /* ClassDeclaration */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); + } + else if (node.kind === 123 /* Parameter */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); + } + flags |= 1 /* Export */; + break; + case 112 /* DeclareKeyword */: + if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); + } + else if (node.parent.kind === 187 /* ClassDeclaration */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); + } + else if (node.kind === 123 /* Parameter */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); + } + else if (inAmbientContext && node.parent.kind === 192 /* ModuleBlock */) { + return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); + } + flags |= 2 /* Ambient */; + lastDeclare = modifier; + break; + } + } + if (node.kind === 126 /* Constructor */) { + if (flags & 128 /* Static */) { + return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); + } + else if (flags & 64 /* Protected */) { + return grammarErrorOnNode(lastProtected, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "protected"); + } + else if (flags & 32 /* Private */) { + return grammarErrorOnNode(lastPrivate, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); + } + } + else if (node.kind === 193 /* ImportDeclaration */ && flags & 2 /* Ambient */) { + return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); + } + else if (node.kind === 188 /* InterfaceDeclaration */ && flags & 2 /* Ambient */) { + return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); + } + } + function checkParameter(node) { + if (node.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(node.name)) { + return reportInvalidUseInStrictMode(node.name); + } + } + function checkTypeParameterList(typeParameters) { + if (checkForDisallowedTrailingComma(typeParameters)) { + return true; + } + if (typeParameters && typeParameters.length === 0) { + var start = typeParameters.pos - "<".length; + var end = ts.skipTrivia(sourceText, typeParameters.end) + ">".length; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.Type_parameter_list_cannot_be_empty); + } + } + function checkParameterList(parameters) { + if (checkForDisallowedTrailingComma(parameters)) { + return true; + } + var seenOptionalParameter = false; + var parameterCount = parameters.length; + for (var i = 0; i < parameterCount; i++) { + var parameter = parameters[i]; + if (parameter.flags & 8 /* Rest */) { + if (i !== (parameterCount - 1)) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); + } + if (parameter.flags & 4 /* QuestionMark */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_be_optional); + } + if (parameter.initializer) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer); + } + } + else if (parameter.flags & 4 /* QuestionMark */ || parameter.initializer) { + seenOptionalParameter = true; + if (parameter.flags & 4 /* QuestionMark */ && parameter.initializer) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.Parameter_cannot_have_question_mark_and_initializer); + } + } + else { + if (seenOptionalParameter) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); + } + } + } + } + function checkPostfixOperator(node) { + if (node.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(node.operand)) { + return reportInvalidUseInStrictMode(node.operand); + } + } + function checkPrefixOperator(node) { + if (node.flags & 8192 /* ParsedInStrictMode */) { + if ((node.operator === 37 /* PlusPlusToken */ || node.operator === 38 /* MinusMinusToken */) && isEvalOrArgumentsIdentifier(node.operand)) { + return reportInvalidUseInStrictMode(node.operand); + } + else if (node.operator === 72 /* DeleteKeyword */ && node.operand.kind === 63 /* Identifier */) { + return grammarErrorOnNode(node.operand, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); + } + } + } + function checkProperty(node) { + return (node.parent.kind === 187 /* ClassDeclaration */ && checkForInvalidQuestionMark(node, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) || checkForInitializerInAmbientContext(node); + } + function checkForInitializerInAmbientContext(node) { + if (inAmbientContext && node.initializer) { + return grammarErrorOnFirstToken(node.initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + } + } + function checkPropertyAssignment(node) { + return checkForInvalidQuestionMark(node, ts.Diagnostics.An_object_member_cannot_be_declared_optional); + } + function checkForInvalidQuestionMark(node, message) { + if (node.flags & 4 /* QuestionMark */) { + var pos = ts.skipTrivia(sourceText, node.name.end); + return grammarErrorAtPos(pos, "?".length, message); + } + } + function checkReturnStatement(node) { + if (!inFunctionBlock) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); + } + } + function checkSetAccessor(node) { + return checkAnyParsedSignature(node) || checkAccessor(node); + } + function checkAccessor(accessor) { + var kind = accessor.kind; + if (languageVersion < 1 /* ES5 */) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); + } + else if (inAmbientContext) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); + } + else if (accessor.body === undefined) { + return grammarErrorAtPos(accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + } + else if (accessor.typeParameters) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); + } + else if (kind === 127 /* GetAccessor */ && accessor.parameters.length) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); + } + else if (kind === 128 /* SetAccessor */) { + if (accessor.type) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); + } + else if (accessor.parameters.length !== 1) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); + } + else { + var parameter = accessor.parameters[0]; + if (parameter.flags & 8 /* Rest */) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter); + } + else if (parameter.flags & 243 /* Modifier */) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); + } + else if (parameter.flags & 4 /* QuestionMark */) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); + } + else if (parameter.initializer) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); + } + } + } + } + function checkSourceFile(node) { + return inAmbientContext && checkTopLevelElementsForRequiredDeclareModifier(file); + } + function checkTopLevelElementsForRequiredDeclareModifier(file) { + for (var i = 0, n = file.statements.length; i < n; i++) { + var decl = file.statements[i]; + if (isDeclaration(decl) || decl.kind === 162 /* VariableStatement */) { + if (checkTopLevelElementForRequiredDeclareModifier(decl)) { + return true; + } + } + } + } + function checkTopLevelElementForRequiredDeclareModifier(node) { + if (node.kind === 188 /* InterfaceDeclaration */ || node.kind === 193 /* ImportDeclaration */ || node.kind === 194 /* ExportAssignment */ || (node.flags & 2 /* Ambient */)) { + return false; + } + return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); + } + function checkShorthandPropertyAssignment(node) { + return checkForInvalidQuestionMark(node, ts.Diagnostics.An_object_member_cannot_be_declared_optional); + } + function checkSwitchStatement(node) { + var firstDefaultClause; + for (var i = 0, n = node.clauses.length; i < n; i++) { + var clause = node.clauses[i]; + if (clause.kind === 176 /* DefaultClause */) { + if (firstDefaultClause === undefined) { + firstDefaultClause = clause; + } + else { + var start = ts.skipTrivia(file.text, clause.pos); + var end = clause.statements.length > 0 ? clause.statements[0].pos : clause.end; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); + } + } + } + } + function checkTaggedTemplateExpression(node) { + if (languageVersion < 2 /* ES6 */) { + return grammarErrorOnFirstToken(node.template, ts.Diagnostics.Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + function checkTupleType(node) { + return checkForDisallowedTrailingComma(node.elementTypes) || checkForAtLeastOneType(node); + } + function checkForAtLeastOneType(node) { + if (node.elementTypes.length === 0) { + return grammarErrorOnNode(node, ts.Diagnostics.A_tuple_type_element_list_cannot_be_empty); + } + } + function checkTypeParameter(node) { + if (node.expression) { + return grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); + } + } + function checkTypeReference(node) { + return checkTypeArguments(node.typeArguments); + } + function checkVariableDeclaration(node) { + if (inAmbientContext && node.initializer) { + var equalsPos = node.type ? ts.skipTrivia(sourceText, node.type.end) : ts.skipTrivia(sourceText, node.name.end); + return grammarErrorAtPos(equalsPos, "=".length, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + } + if (!inAmbientContext && !node.initializer && node.flags & 4096 /* Const */) { + return grammarErrorOnNode(node, ts.Diagnostics.const_declarations_must_be_initialized); + } + if (node.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(node.name)) { + return reportInvalidUseInStrictMode(node.name); + } + } + function checkVariableDeclarations(declarations) { + if (declarations) { + if (checkForDisallowedTrailingComma(declarations)) { + return true; + } + if (!declarations.length) { + return grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); + } + var decl = declarations[0]; + if (languageVersion < 2 /* ES6 */) { + if (decl.flags & 2048 /* Let */) { + return grammarErrorOnFirstToken(decl, ts.Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + else if (decl.flags & 4096 /* Const */) { + return grammarErrorOnFirstToken(decl, ts.Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + } + } + function checkVariableStatement(node) { + return checkVariableDeclarations(node.declarations) || checkForDisallowedLetOrConstStatement(node); + } + function checkForDisallowedLetOrConstStatement(node) { + if (!allowLetAndConstDeclarations(node.parent)) { + if (node.flags & 2048 /* Let */) { + return grammarErrorOnNode(node, ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block); + } + else if (node.flags & 4096 /* Const */) { + return grammarErrorOnNode(node, ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block); + } + } + } + function allowLetAndConstDeclarations(parent) { + switch (parent.kind) { + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 173 /* WithStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + return false; + case 177 /* LabeledStatement */: + return allowLetAndConstDeclarations(parent.parent); + } + return true; + } + function checkWithStatement(node) { + if (node.flags & 8192 /* ParsedInStrictMode */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); + } + } + } function createProgram(rootNames, options, host) { var program; var files = []; @@ -5628,7 +5908,7 @@ var ts; else { files.push(file); } - ts.forEach(file.syntacticErrors, function (e) { + ts.forEach(file.getSyntacticDiagnostics(), function (e) { errors.push(e); }); } @@ -5643,7 +5923,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 190 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 193 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -5661,9 +5941,9 @@ var ts; } } } - else if (node.kind === 188 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { + else if (node.kind === 191 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { forEachChild(node.body, function (node) { - if (node.kind === 190 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 193 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -5736,16 +6016,16 @@ var ts; var ts; (function (ts) { function getModuleInstanceState(node) { - if (node.kind === 185 /* InterfaceDeclaration */) { + if (node.kind === 188 /* InterfaceDeclaration */) { return 0 /* NonInstantiated */; } - else if (node.kind === 187 /* EnumDeclaration */ && ts.isConstEnumDeclaration(node)) { + else if (node.kind === 190 /* EnumDeclaration */ && ts.isConstEnumDeclaration(node)) { return 2 /* ConstEnumOnly */; } - else if (node.kind === 190 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { + else if (node.kind === 193 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { return 0 /* NonInstantiated */; } - else if (node.kind === 189 /* ModuleBlock */) { + else if (node.kind === 192 /* ModuleBlock */) { var state = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -5761,7 +6041,7 @@ var ts; }); return state; } - else if (node.kind === 188 /* ModuleDeclaration */) { + else if (node.kind === 191 /* ModuleDeclaration */) { return getModuleInstanceState(node.body); } else { @@ -5801,20 +6081,26 @@ var ts; } function getDeclarationName(node) { if (node.name) { - if (node.kind === 188 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { + if (node.kind === 191 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { return '"' + node.name.text + '"'; } return node.name.text; } switch (node.kind) { - case 126 /* Constructor */: return "__constructor"; - case 129 /* CallSignature */: return "__call"; - case 130 /* ConstructSignature */: return "__new"; - case 131 /* IndexSignature */: return "__index"; + case 134 /* ConstructorType */: + case 126 /* Constructor */: + return "__constructor"; + case 133 /* FunctionType */: + case 129 /* CallSignature */: + return "__call"; + case 130 /* ConstructSignature */: + return "__new"; + case 131 /* IndexSignature */: + return "__index"; } } function getDisplayName(node) { - return node.name ? ts.identifierToString(node.name) : getDeclarationName(node); + return node.name ? ts.declarationNameToString(node.name) : getDeclarationName(node); } function declareSymbol(symbols, parent, node, includes, excludes) { var name = getDeclarationName(node); @@ -5826,9 +6112,9 @@ var ts; } var message = symbol.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(symbol.declarations, function (declaration) { - file.semanticErrors.push(ts.createDiagnosticForNode(declaration.name, message, getDisplayName(declaration))); + file.semanticDiagnostics.push(ts.createDiagnosticForNode(declaration.name, message, getDisplayName(declaration))); }); - file.semanticErrors.push(ts.createDiagnosticForNode(node.name, message, getDisplayName(node))); + file.semanticDiagnostics.push(ts.createDiagnosticForNode(node.name, message, getDisplayName(node))); symbol = createSymbol(0, name); } } @@ -5837,13 +6123,13 @@ var ts; } addDeclarationToSymbol(symbol, node, includes); symbol.parent = parent; - if (node.kind === 184 /* ClassDeclaration */ && symbol.exports) { + if (node.kind === 187 /* ClassDeclaration */ && symbol.exports) { var prototypeSymbol = createSymbol(4 /* Property */ | 536870912 /* Prototype */, "prototype"); if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { if (node.name) { node.name.parent = node; } - file.semanticErrors.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); + file.semanticDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); } symbol.exports[prototypeSymbol.name] = prototypeSymbol; prototypeSymbol.parent = symbol; @@ -5869,7 +6155,7 @@ var ts; if (symbolKind & 1536 /* Namespace */) { exportKind |= 16777216 /* ExportNamespace */; } - if (node.flags & 1 /* Export */ || (node.kind !== 190 /* ImportDeclaration */ && isAmbientContext(container))) { + if (node.flags & 1 /* Export */ || (node.kind !== 193 /* ImportDeclaration */ && isAmbientContext(container))) { if (exportKind) { var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); @@ -5910,14 +6196,16 @@ var ts; } function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { switch (container.kind) { - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 193 /* SourceFile */: + case 196 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; } + case 133 /* FunctionType */: + case 134 /* ConstructorType */: case 129 /* CallSignature */: case 130 /* ConstructSignature */: case 131 /* IndexSignature */: @@ -5925,22 +6213,22 @@ var ts; case 126 /* Constructor */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 182 /* FunctionDeclaration */: - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); break; - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: if (node.flags & 128 /* Static */) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - case 134 /* TypeLiteral */: - case 140 /* ObjectLiteral */: - case 185 /* InterfaceDeclaration */: + case 136 /* TypeLiteral */: + case 142 /* ObjectLiteral */: + case 188 /* InterfaceDeclaration */: declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); break; - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } @@ -5974,6 +6262,16 @@ var ts; } } } + function bindFunctionOrConstructorType(node) { + var symbolKind = node.kind === 133 /* FunctionType */ ? 131072 /* CallSignature */ : 262144 /* ConstructSignature */; + var symbol = createSymbol(symbolKind, getDeclarationName(node)); + addDeclarationToSymbol(symbol, node, symbolKind); + bindChildren(node, symbolKind, false); + var typeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type"); + addDeclarationToSymbol(typeLiteralSymbol, node, 2048 /* TypeLiteral */); + typeLiteralSymbol.members = {}; + typeLiteralSymbol.members[node.kind === 133 /* FunctionType */ ? "__call" : "__new"] = symbol; + } function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { var symbol = createSymbol(symbolKind, name); addDeclarationToSymbol(symbol, node, symbolKind); @@ -5991,10 +6289,10 @@ var ts; } function bindBlockScopedVariableDeclaration(node) { switch (blockScopeContainer.kind) { - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: declareModuleMember(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); break; - case 193 /* SourceFile */: + case 196 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); break; @@ -6016,7 +6314,7 @@ var ts; case 123 /* Parameter */: bindDeclaration(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */, false); break; - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: if (node.flags & 6144 /* BlockScoped */) { bindBlockScopedVariableDeclaration(node); } @@ -6025,25 +6323,26 @@ var ts; } break; case 124 /* Property */: - case 141 /* PropertyAssignment */: + case 143 /* PropertyAssignment */: + case 144 /* ShorthandPropertyAssignment */: bindDeclaration(node, 4 /* Property */, 107455 /* PropertyExcludes */, false); break; - case 192 /* EnumMember */: + case 195 /* EnumMember */: bindDeclaration(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */, false); break; case 129 /* CallSignature */: bindDeclaration(node, 131072 /* CallSignature */, 0, false); break; - case 125 /* Method */: - bindDeclaration(node, 8192 /* Method */, 99263 /* MethodExcludes */, true); - break; case 130 /* ConstructSignature */: bindDeclaration(node, 262144 /* ConstructSignature */, 0, true); break; + case 125 /* Method */: + bindDeclaration(node, 8192 /* Method */, 99263 /* MethodExcludes */, true); + break; case 131 /* IndexSignature */: bindDeclaration(node, 524288 /* IndexSignature */, 0, false); break; - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: bindDeclaration(node, 16 /* Function */, 106927 /* FunctionExcludes */, true); break; case 126 /* Constructor */: @@ -6055,29 +6354,33 @@ var ts; case 128 /* SetAccessor */: bindDeclaration(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */, true); break; - case 134 /* TypeLiteral */: + case 133 /* FunctionType */: + case 134 /* ConstructorType */: + bindFunctionOrConstructorType(node); + break; + case 136 /* TypeLiteral */: bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type", false); break; - case 140 /* ObjectLiteral */: + case 142 /* ObjectLiteral */: bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object", false); break; - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: bindAnonymousDeclaration(node, 16 /* Function */, "__function", true); break; - case 178 /* CatchBlock */: + case 181 /* CatchBlock */: bindCatchVariableDeclaration(node); break; - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: bindDeclaration(node, 32 /* Class */, 3258879 /* ClassExcludes */, false); break; - case 185 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: bindDeclaration(node, 64 /* Interface */, 3152288 /* InterfaceExcludes */, false); break; - case 186 /* TypeAliasDeclaration */: + case 189 /* TypeAliasDeclaration */: bindDeclaration(node, 2097152 /* TypeAlias */, 3152352 /* TypeAliasExcludes */, false); break; - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: if (ts.isConstEnumDeclaration(node)) { bindDeclaration(node, 128 /* ConstEnum */, 3259263 /* ConstEnumExcludes */, false); } @@ -6085,24 +6388,24 @@ var ts; bindDeclaration(node, 256 /* RegularEnum */, 3258623 /* RegularEnumExcludes */, false); } break; - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: bindModuleDeclaration(node); break; - case 190 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: bindDeclaration(node, 33554432 /* Import */, 33554432 /* ImportExcludes */, false); break; - case 193 /* SourceFile */: + case 196 /* SourceFile */: if (ts.isExternalModule(node)) { bindAnonymousDeclaration(node, 512 /* ValueModule */, '"' + ts.removeFileExtension(node.filename) + '"', true); break; } - case 158 /* Block */: - case 177 /* TryBlock */: - case 178 /* CatchBlock */: - case 179 /* FinallyBlock */: - case 165 /* ForStatement */: - case 166 /* ForInStatement */: - case 171 /* SwitchStatement */: + case 161 /* Block */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 174 /* SwitchStatement */: bindChildren(node, 0, true); break; default: @@ -6219,7 +6522,7 @@ var ts; function writeLiteral(s) { if (s && s.length) { write(s); - var lineStartsOfS = ts.getLineStarts(s); + var lineStartsOfS = ts.computeLineStarts(s); if (lineStartsOfS.length > 1) { lineCount = lineCount + lineStartsOfS.length - 1; linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; @@ -6505,7 +6808,7 @@ var ts; if (scopeName) { recordScopeNameStart(scopeName); } - else if (node.kind === 182 /* FunctionDeclaration */ || node.kind === 149 /* FunctionExpression */ || node.kind === 125 /* Method */ || node.kind === 127 /* GetAccessor */ || node.kind === 128 /* SetAccessor */ || node.kind === 188 /* ModuleDeclaration */ || node.kind === 184 /* ClassDeclaration */ || node.kind === 187 /* EnumDeclaration */) { + else if (node.kind === 185 /* FunctionDeclaration */ || node.kind === 152 /* FunctionExpression */ || node.kind === 125 /* Method */ || node.kind === 127 /* GetAccessor */ || node.kind === 128 /* SetAccessor */ || node.kind === 191 /* ModuleDeclaration */ || node.kind === 187 /* ClassDeclaration */ || node.kind === 190 /* EnumDeclaration */) { if (node.name) { scopeName = node.name.text; } @@ -6587,7 +6890,7 @@ var ts; } function emitNodeWithMap(node) { if (node) { - if (node.kind != 193 /* SourceFile */) { + if (node.kind != 196 /* SourceFile */) { recordEmitNodeStartSpan(node); emitNode(node); recordEmitNodeEndSpan(node); @@ -6696,14 +6999,14 @@ var ts; ts.forEachChild(node, emit); return; } - ts.Debug.assert(node.parent.kind !== 146 /* TaggedTemplateExpression */); - var templateNeedsParens = ts.isExpression(node.parent) && node.parent.kind !== 148 /* ParenExpression */ && comparePrecedenceToBinaryPlus(node.parent) !== -1 /* LessThan */; - if (templateNeedsParens) { + ts.Debug.assert(node.parent.kind !== 149 /* TaggedTemplateExpression */); + var emitOuterParens = ts.isExpression(node.parent) && templateNeedsParens(node, node.parent); + if (emitOuterParens) { write("("); } emitLiteral(node.head); ts.forEach(node.templateSpans, function (templateSpan) { - var needsParens = templateSpan.expression.kind !== 148 /* ParenExpression */ && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1 /* GreaterThan */; + var needsParens = templateSpan.expression.kind !== 151 /* ParenExpression */ && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1 /* GreaterThan */; write(" + "); if (needsParens) { write("("); @@ -6717,13 +7020,26 @@ var ts; emitLiteral(templateSpan.literal); } }); - if (templateNeedsParens) { + if (emitOuterParens) { write(")"); } + function templateNeedsParens(template, parent) { + switch (parent.kind) { + case 147 /* CallExpression */: + case 148 /* NewExpression */: + return parent.func === template; + case 151 /* ParenExpression */: + return false; + case 149 /* TaggedTemplateExpression */: + ts.Debug.fail("Path should be unreachable; tagged templates not supported pre-ES6."); + default: + return comparePrecedenceToBinaryPlus(parent) !== -1 /* LessThan */; + } + } function comparePrecedenceToBinaryPlus(expression) { ts.Debug.assert(compilerOptions.target <= 1 /* ES5 */); switch (expression.kind) { - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: switch (expression.operator) { case 34 /* AsteriskToken */: case 35 /* SlashToken */: @@ -6734,7 +7050,7 @@ var ts; default: return -1 /* LessThan */; } - case 154 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return -1 /* LessThan */; default: return 1 /* GreaterThan */; @@ -6745,7 +7061,7 @@ var ts; emit(span.expression); emit(span.literal); } - function emitQuotedIdentifier(node) { + function emitExpressionForPropertyName(node) { if (node.kind === 7 /* StringLiteral */) { emitLiteral(node); } @@ -6760,45 +7076,52 @@ var ts; write("\""); } } - function isNonExpressionIdentifier(node) { + function isNotExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { case 123 /* Parameter */: - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: case 124 /* Property */: - case 141 /* PropertyAssignment */: - case 192 /* EnumMember */: + case 143 /* PropertyAssignment */: + case 144 /* ShorthandPropertyAssignment */: + case 195 /* EnumMember */: case 125 /* Method */: - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 149 /* FunctionExpression */: - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: - case 187 /* EnumDeclaration */: - case 188 /* ModuleDeclaration */: - case 190 /* ImportDeclaration */: + case 152 /* FunctionExpression */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: + case 191 /* ModuleDeclaration */: + case 193 /* ImportDeclaration */: return parent.name === node; - case 168 /* BreakStatement */: - case 167 /* ContinueStatement */: - case 191 /* ExportAssignment */: + case 171 /* BreakStatement */: + case 170 /* ContinueStatement */: + case 194 /* ExportAssignment */: return false; - case 174 /* LabeledStatement */: + case 177 /* LabeledStatement */: return node.parent.label === node; - case 178 /* CatchBlock */: + case 181 /* CatchBlock */: return node.parent.variable === node; } } - function emitIdentifier(node) { - if (!isNonExpressionIdentifier(node)) { - var prefix = resolver.getExpressionNamePrefix(node); - if (prefix) { - write(prefix); - write("."); - } + function emitExpressionIdentifier(node) { + var prefix = resolver.getExpressionNamePrefix(node); + if (prefix) { + write(prefix); + write("."); } write(getSourceTextOfLocalNode(node)); } + function emitIdentifier(node) { + if (!isNotExpressionIdentifier(node)) { + emitExpressionIdentifier(node); + } + else { + write(getSourceTextOfLocalNode(node)); + } + } function emitThis(node) { if (resolver.getNodeCheckFlags(node) & 2 /* LexicalThis */) { write("_this"); @@ -6859,10 +7182,33 @@ var ts; emit(node.initializer); emitTrailingComments(node); } + function emitShortHandPropertyAssignment(node) { + function emitAsNormalPropertyAssignment() { + emitLeadingComments(node); + emit(node.name); + write(": "); + emitExpressionIdentifier(node.name); + emitTrailingComments(node); + } + if (compilerOptions.target < 2 /* ES6 */) { + emitAsNormalPropertyAssignment(); + } + else if (compilerOptions.target >= 2 /* ES6 */) { + var prefix = resolver.getExpressionNamePrefix(node.name); + if (prefix) { + emitAsNormalPropertyAssignment(); + } + else { + emitLeadingComments(node); + emit(node.name); + emitTrailingComments(node); + } + } + } function tryEmitConstantValue(node) { var constantValue = resolver.getConstantValue(node); if (constantValue !== undefined) { - var propertyName = node.kind === 142 /* PropertyAccess */ ? ts.identifierToString(node.right) : ts.getTextOfNode(node.index); + var propertyName = node.kind === 145 /* PropertyAccess */ ? ts.declarationNameToString(node.right) : ts.getTextOfNode(node.index); write(constantValue.toString() + " /* " + propertyName + " */"); return true; } @@ -6893,7 +7239,7 @@ var ts; } else { emit(node.func); - superCall = node.func.kind === 142 /* PropertyAccess */ && node.func.left.kind === 89 /* SuperKeyword */; + superCall = node.func.kind === 145 /* PropertyAccess */ && node.func.left.kind === 89 /* SuperKeyword */; } if (superCall) { write(".call("); @@ -6926,12 +7272,12 @@ var ts; emit(node.template); } function emitParenExpression(node) { - if (node.expression.kind === 147 /* TypeAssertion */) { + if (node.expression.kind === 150 /* TypeAssertion */) { var operand = node.expression.operand; - while (operand.kind == 147 /* TypeAssertion */) { + while (operand.kind == 150 /* TypeAssertion */) { operand = operand.operand; } - if (operand.kind !== 151 /* PrefixOperator */ && operand.kind !== 152 /* PostfixOperator */ && operand.kind !== 145 /* NewExpression */ && !(operand.kind === 144 /* CallExpression */ && node.parent.kind === 145 /* NewExpression */) && !(operand.kind === 149 /* FunctionExpression */ && node.parent.kind === 144 /* CallExpression */)) { + if (operand.kind !== 154 /* PrefixOperator */ && operand.kind !== 155 /* PostfixOperator */ && operand.kind !== 148 /* NewExpression */ && !(operand.kind === 147 /* CallExpression */ && node.parent.kind === 148 /* NewExpression */) && !(operand.kind === 152 /* FunctionExpression */ && node.parent.kind === 147 /* CallExpression */)) { emit(operand); return; } @@ -6941,13 +7287,13 @@ var ts; write(")"); } function emitUnaryExpression(node) { - if (node.kind === 151 /* PrefixOperator */) { + if (node.kind === 154 /* PrefixOperator */) { write(ts.tokenToString(node.operator)); } if (node.operator >= 63 /* Identifier */) { write(" "); } - else if (node.kind === 151 /* PrefixOperator */ && node.operand.kind === 151 /* PrefixOperator */) { + else if (node.kind === 154 /* PrefixOperator */ && node.operand.kind === 154 /* PrefixOperator */) { var operand = node.operand; if (node.operator === 32 /* PlusToken */ && (operand.operator === 32 /* PlusToken */ || operand.operator === 37 /* PlusPlusToken */)) { write(" "); @@ -6957,7 +7303,7 @@ var ts; } } emit(node.operand); - if (node.kind === 152 /* PostfixOperator */) { + if (node.kind === 155 /* PostfixOperator */) { write(ts.tokenToString(node.operator)); } } @@ -6980,8 +7326,8 @@ var ts; emitToken(13 /* OpenBraceToken */, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 189 /* ModuleBlock */) { - ts.Debug.assert(node.parent.kind === 188 /* ModuleDeclaration */); + if (node.kind === 192 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 191 /* ModuleDeclaration */); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); @@ -6991,7 +7337,7 @@ var ts; scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 158 /* Block */) { + if (node.kind === 161 /* Block */) { write(" "); emit(node); } @@ -7003,7 +7349,7 @@ var ts; } } function emitExpressionStatement(node) { - var isArrowExpression = node.expression.kind === 150 /* ArrowFunction */; + var isArrowExpression = node.expression.kind === 153 /* ArrowFunction */; emitLeadingComments(node); if (isArrowExpression) write("("); @@ -7024,7 +7370,7 @@ var ts; if (node.elseStatement) { writeLine(); emitToken(74 /* ElseKeyword */, node.thenStatement.end); - if (node.elseStatement.kind === 162 /* IfStatement */) { + if (node.elseStatement.kind === 165 /* IfStatement */) { write(" "); emit(node.elseStatement); } @@ -7037,7 +7383,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 158 /* Block */) { + if (node.statement.kind === 161 /* Block */) { write(" "); } else { @@ -7084,15 +7430,18 @@ var ts; var endPos = emitToken(80 /* ForKeyword */, node.pos); write(" "); endPos = emitToken(15 /* OpenParenToken */, endPos); - if (node.declaration) { - if (node.declaration.flags & 2048 /* Let */) { - emitToken(102 /* LetKeyword */, endPos); + if (node.declarations) { + if (node.declarations.length >= 1) { + var decl = node.declarations[0]; + if (decl.flags & 2048 /* Let */) { + emitToken(102 /* LetKeyword */, endPos); + } + else { + emitToken(96 /* VarKeyword */, endPos); + } + write(" "); + emit(decl); } - else { - emitToken(96 /* VarKeyword */, endPos); - } - write(" "); - emit(node.declaration); } else { emit(node.variable); @@ -7103,7 +7452,7 @@ var ts; emitEmbeddedStatement(node.statement); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 168 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */, node.pos); + emitToken(node.kind === 171 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */, node.pos); emitOptional(" ", node.label); write(";"); } @@ -7138,7 +7487,7 @@ var ts; return getLineOfLocalPosition(ts.skipTrivia(currentSourceFile.text, node1.pos)) === getLineOfLocalPosition(ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 172 /* CaseClause */) { + if (node.kind === 175 /* CaseClause */) { write("case "); emit(node.expression); write(":"); @@ -7193,7 +7542,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 188 /* ModuleDeclaration */); + } while (node && node.kind !== 191 /* ModuleDeclaration */); return node; } function emitModuleMemberName(node) { @@ -7305,7 +7654,7 @@ var ts; emitLeadingComments(node); } write("function "); - if (node.kind === 182 /* FunctionDeclaration */ || (node.kind === 149 /* FunctionExpression */ && node.name)) { + if (node.kind === 185 /* FunctionDeclaration */ || (node.kind === 152 /* FunctionExpression */ && node.name)) { emit(node.name); } emitSignatureAndBody(node); @@ -7335,16 +7684,16 @@ var ts; write(" {"); scopeEmitStart(node); increaseIndent(); - emitDetachedComments(node.body.kind === 183 /* FunctionBlock */ ? node.body.statements : node.body); + emitDetachedComments(node.body.kind === 186 /* FunctionBlock */ ? node.body.statements : node.body); var startIndex = 0; - if (node.body.kind === 183 /* FunctionBlock */) { + if (node.body.kind === 186 /* FunctionBlock */) { startIndex = emitDirectivePrologues(node.body.statements, true); } var outPos = writer.getTextPos(); emitCaptureThisForNodeIfNecessary(node); emitDefaultValueAssignments(node); emitRestParameter(node); - if (node.body.kind !== 183 /* FunctionBlock */ && outPos === writer.getTextPos()) { + if (node.body.kind !== 186 /* FunctionBlock */ && outPos === writer.getTextPos()) { decreaseIndent(); write(" "); emitStart(node.body); @@ -7357,7 +7706,7 @@ var ts; emitEnd(node.body); } else { - if (node.body.kind === 183 /* FunctionBlock */) { + if (node.body.kind === 186 /* FunctionBlock */) { emitLinesStartingAt(node.body.statements, startIndex); } else { @@ -7369,7 +7718,7 @@ var ts; emitTrailingComments(node.body); } writeLine(); - if (node.body.kind === 183 /* FunctionBlock */) { + if (node.body.kind === 186 /* FunctionBlock */) { emitLeadingCommentsOfPosition(node.body.statements.end); decreaseIndent(); emitToken(14 /* CloseBraceToken */, node.body.statements.end); @@ -7395,9 +7744,9 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 161 /* ExpressionStatement */) { + if (statement && statement.kind === 164 /* ExpressionStatement */) { var expr = statement.expression; - if (expr && expr.kind === 144 /* CallExpression */) { + if (expr && expr.kind === 147 /* CallExpression */) { var func = expr.func; if (func && func.kind === 89 /* SuperKeyword */) { return statement; @@ -7492,7 +7841,7 @@ var ts; write(".prototype"); } write(", "); - emitQuotedIdentifier(member.name); + emitExpressionForPropertyName(member.name); emitEnd(member.name); write(", {"); increaseIndent(); @@ -7698,7 +8047,7 @@ var ts; write("["); write(resolver.getLocalNameOfContainer(node)); write("["); - emitQuotedIdentifier(member.name); + emitExpressionForPropertyName(member.name); write("] = "); if (member.initializer && !isConstEnum) { emit(member.initializer); @@ -7707,7 +8056,7 @@ var ts; write(resolver.getEnumMemberValue(member).toString()); } write("] = "); - emitQuotedIdentifier(member.name); + emitExpressionForPropertyName(member.name); emitEnd(member); write(";"); emitTrailingComments(member); @@ -7715,7 +8064,7 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 188 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 191 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -7737,7 +8086,7 @@ var ts; write(resolver.getLocalNameOfContainer(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 189 /* ModuleBlock */) { + if (node.body.kind === 192 /* ModuleBlock */) { emit(node.body); } else { @@ -7771,7 +8120,7 @@ var ts; emitImportDeclaration = !ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportWithEntityName(node); } if (emitImportDeclaration) { - if (node.externalModuleName && node.parent.kind === 193 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { + if (node.externalModuleName && node.parent.kind === 196 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { if (node.flags & 1 /* Export */) { writeLine(); emitLeadingComments(node); @@ -7811,7 +8160,7 @@ var ts; function getExternalImportDeclarations(node) { var result = []; ts.forEach(node.statements, function (stat) { - if (stat.kind === 190 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { + if (stat.kind === 193 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { result.push(stat); } }); @@ -7819,7 +8168,7 @@ var ts; } function getFirstExportAssignment(sourceFile) { return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 191 /* ExportAssignment */) { + if (node.kind === 194 /* ExportAssignment */) { return node; } }); @@ -7827,7 +8176,11 @@ var ts; function emitAMDModule(node, startIndex) { var imports = getExternalImportDeclarations(node); writeLine(); - write("define([\"require\", \"exports\""); + write("define("); + if (node.amdModuleName) { + write("\"" + node.amdModuleName + "\", "); + } + write("[\"require\", \"exports\""); ts.forEach(imports, function (imp) { write(", "); emitLiteral(imp.externalModuleName); @@ -7960,102 +8313,104 @@ var ts; case 11 /* TemplateMiddle */: case 12 /* TemplateTail */: return emitLiteral(node); - case 155 /* TemplateExpression */: + case 158 /* TemplateExpression */: return emitTemplateExpression(node); - case 156 /* TemplateSpan */: + case 159 /* TemplateSpan */: return emitTemplateSpan(node); case 121 /* QualifiedName */: return emitPropertyAccess(node); - case 139 /* ArrayLiteral */: + case 141 /* ArrayLiteral */: return emitArrayLiteral(node); - case 140 /* ObjectLiteral */: + case 142 /* ObjectLiteral */: return emitObjectLiteral(node); - case 141 /* PropertyAssignment */: + case 143 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 142 /* PropertyAccess */: + case 144 /* ShorthandPropertyAssignment */: + return emitShortHandPropertyAssignment(node); + case 145 /* PropertyAccess */: return emitPropertyAccess(node); - case 143 /* IndexedAccess */: + case 146 /* IndexedAccess */: return emitIndexedAccess(node); - case 144 /* CallExpression */: + case 147 /* CallExpression */: return emitCallExpression(node); - case 145 /* NewExpression */: + case 148 /* NewExpression */: return emitNewExpression(node); - case 146 /* TaggedTemplateExpression */: + case 149 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 147 /* TypeAssertion */: + case 150 /* TypeAssertion */: return emit(node.operand); - case 148 /* ParenExpression */: + case 151 /* ParenExpression */: return emitParenExpression(node); - case 182 /* FunctionDeclaration */: - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: return emitFunctionDeclaration(node); - case 151 /* PrefixOperator */: - case 152 /* PostfixOperator */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: return emitUnaryExpression(node); - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: return emitBinaryExpression(node); - case 154 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return emitConditionalExpression(node); - case 157 /* OmittedExpression */: + case 160 /* OmittedExpression */: return; - case 158 /* Block */: - case 177 /* TryBlock */: - case 179 /* FinallyBlock */: - case 183 /* FunctionBlock */: - case 189 /* ModuleBlock */: + case 161 /* Block */: + case 180 /* TryBlock */: + case 182 /* FinallyBlock */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: return emitBlock(node); - case 159 /* VariableStatement */: + case 162 /* VariableStatement */: return emitVariableStatement(node); - case 160 /* EmptyStatement */: + case 163 /* EmptyStatement */: return write(";"); - case 161 /* ExpressionStatement */: + case 164 /* ExpressionStatement */: return emitExpressionStatement(node); - case 162 /* IfStatement */: + case 165 /* IfStatement */: return emitIfStatement(node); - case 163 /* DoStatement */: + case 166 /* DoStatement */: return emitDoStatement(node); - case 164 /* WhileStatement */: + case 167 /* WhileStatement */: return emitWhileStatement(node); - case 165 /* ForStatement */: + case 168 /* ForStatement */: return emitForStatement(node); - case 166 /* ForInStatement */: + case 169 /* ForInStatement */: return emitForInStatement(node); - case 167 /* ContinueStatement */: - case 168 /* BreakStatement */: + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: return emitBreakOrContinueStatement(node); - case 169 /* ReturnStatement */: + case 172 /* ReturnStatement */: return emitReturnStatement(node); - case 170 /* WithStatement */: + case 173 /* WithStatement */: return emitWithStatement(node); - case 171 /* SwitchStatement */: + case 174 /* SwitchStatement */: return emitSwitchStatement(node); - case 172 /* CaseClause */: - case 173 /* DefaultClause */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: return emitCaseOrDefaultClause(node); - case 174 /* LabeledStatement */: + case 177 /* LabeledStatement */: return emitLabelledStatement(node); - case 175 /* ThrowStatement */: + case 178 /* ThrowStatement */: return emitThrowStatement(node); - case 176 /* TryStatement */: + case 179 /* TryStatement */: return emitTryStatement(node); - case 178 /* CatchBlock */: + case 181 /* CatchBlock */: return emitCatchBlock(node); - case 180 /* DebuggerStatement */: + case 183 /* DebuggerStatement */: return emitDebuggerStatement(node); - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: return emitClassDeclaration(node); - case 185 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 190 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: return emitImportDeclaration(node); - case 193 /* SourceFile */: + case 196 /* SourceFile */: return emitSourceFile(node); } } @@ -8073,7 +8428,7 @@ var ts; return leadingComments; } function getLeadingCommentsToEmit(node) { - if (node.parent.kind === 193 /* SourceFile */ || node.pos !== node.parent.pos) { + if (node.parent.kind === 196 /* SourceFile */ || node.pos !== node.parent.pos) { var leadingComments; if (hasDetachedComments(node.pos)) { leadingComments = getLeadingCommentsWithoutDetachedComments(); @@ -8090,7 +8445,7 @@ var ts; emitComments(leadingComments, true, writer, writeComment); } function emitTrailingDeclarationComments(node) { - if (node.parent.kind === 193 /* SourceFile */ || node.end !== node.parent.end) { + if (node.parent.kind === 196 /* SourceFile */ || node.end !== node.parent.end) { var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); emitComments(trailingComments, false, writer, writeComment); } @@ -8282,7 +8637,7 @@ var ts; if (node.flags & 1 /* Export */) { write("export "); } - if (node.kind !== 185 /* InterfaceDeclaration */) { + if (node.kind !== 188 /* InterfaceDeclaration */) { write("declare "); } } @@ -8338,7 +8693,7 @@ var ts; emitDeclarationFlags(node); write("module "); emitSourceTextOfNode(node.name); - while (node.body.kind !== 189 /* ModuleBlock */) { + while (node.body.kind !== 192 /* ModuleBlock */) { node = node.body; write("."); emitSourceTextOfNode(node.name); @@ -8410,10 +8765,10 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 185 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; case 130 /* ConstructSignature */: @@ -8426,14 +8781,14 @@ var ts; if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : 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 === 184 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 187 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -8471,7 +8826,7 @@ var ts; resolver.writeTypeAtLocation(node, enclosingDeclaration, 1 /* WriteArrayAsGenericType */ | 2 /* UseTypeOfFunction */, writer); function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.kind === 184 /* ClassDeclaration */) { + if (node.parent.kind === 187 /* ClassDeclaration */) { if (symbolAccesibilityResult.errorModuleName) { diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2; } @@ -8556,7 +8911,7 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 181 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { + if (node.kind !== 184 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { emitSourceTextOfNode(node.name); if (node.kind === 124 /* Property */ && (node.flags & 4 /* QuestionMark */)) { write("?"); @@ -8569,14 +8924,14 @@ var ts; } function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.kind === 181 /* VariableDeclaration */) { + if (node.kind === 184 /* VariableDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? 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 === 124 /* Property */) { if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 === 184 /* ClassDeclaration */) { + else if (node.parent.kind === 187 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { @@ -8655,10 +9010,10 @@ var ts; } } function emitFunctionDeclaration(node) { - if ((node.kind !== 182 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { + if ((node.kind !== 185 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); emitDeclarationFlags(node); - if (node.kind === 182 /* FunctionDeclaration */) { + if (node.kind === 185 /* FunctionDeclaration */) { write("function "); emitSourceTextOfNode(node.name); } @@ -8720,14 +9075,14 @@ var ts; if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : 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 === 184 /* ClassDeclaration */) { + else if (node.parent.kind === 187 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; break; default: @@ -8771,14 +9126,14 @@ var ts; if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 === 184 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 187 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? 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; } break; - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -8794,7 +9149,7 @@ var ts; function emitNode(node) { switch (node.kind) { case 126 /* Constructor */: - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: case 125 /* Method */: return emitFunctionDeclaration(node); case 130 /* ConstructSignature */: @@ -8805,27 +9160,27 @@ var ts; case 127 /* GetAccessor */: case 128 /* SetAccessor */: return emitAccessorDeclaration(node); - case 159 /* VariableStatement */: + case 162 /* VariableStatement */: return emitVariableStatement(node); case 124 /* Property */: return emitPropertyDeclaration(node); - case 185 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: return emitClassDeclaration(node); - case 186 /* TypeAliasDeclaration */: + case 189 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 192 /* EnumMember */: + case 195 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 190 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: return emitImportDeclaration(node); - case 191 /* ExportAssignment */: + case 194 /* ExportAssignment */: return emitExportAssignment(node); - case 193 /* SourceFile */: + case 196 /* SourceFile */: return emitSourceFile(node); } } @@ -8887,9 +9242,9 @@ var ts; } } var hasSemanticErrors = resolver.hasSemanticErrors(); - var hasEarlyErrors = resolver.hasEarlyErrors(targetSourceFile); + var isEmitBlocked = resolver.isEmitBlocked(targetSourceFile); function emitFile(jsFilePath, sourceFile) { - if (!hasEarlyErrors) { + if (!isEmitBlocked) { emitJavaScript(jsFilePath, sourceFile); if (!hasSemanticErrors && compilerOptions.declaration) { emitDeclarations(jsFilePath, sourceFile); @@ -8919,25 +9274,25 @@ var ts; diagnostics.sort(ts.compareDiagnostics); diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); var hasEmitterError = ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1 /* Error */; }); - var returnCode; - if (hasEarlyErrors) { - returnCode = 1 /* AllOutputGenerationSkipped */; + var emitResultStatus; + if (isEmitBlocked) { + emitResultStatus = 1 /* AllOutputGenerationSkipped */; } else if (hasEmitterError) { - returnCode = 4 /* EmitErrorsEncountered */; + emitResultStatus = 4 /* EmitErrorsEncountered */; } else if (hasSemanticErrors && compilerOptions.declaration) { - returnCode = 3 /* DeclarationGenerationSkipped */; + emitResultStatus = 3 /* DeclarationGenerationSkipped */; } else if (hasSemanticErrors && !compilerOptions.declaration) { - returnCode = 2 /* JSGeneratedWithSemanticErrors */; + emitResultStatus = 2 /* JSGeneratedWithSemanticErrors */; } else { - returnCode = 0 /* Succeeded */; + emitResultStatus = 0 /* Succeeded */; } return { - emitResultStatus: returnCode, - errors: diagnostics, + emitResultStatus: emitResultStatus, + diagnostics: diagnostics, sourceMaps: sourceMapDataList }; } @@ -8996,16 +9351,18 @@ var ts; var compilerOptions = program.getCompilerOptions(); var checker = { getProgram: function () { return program; }, - getDiagnostics: getDiagnostics, - getGlobalDiagnostics: getGlobalDiagnostics, getNodeCount: function () { return ts.sum(program.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(program.getSourceFiles(), "identifierCount"); }, getSymbolCount: function () { return ts.sum(program.getSourceFiles(), "symbolCount"); }, getTypeCount: function () { return typeCount; }, + isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, + isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + getDiagnostics: getDiagnostics, + getGlobalDiagnostics: getGlobalDiagnostics, checkProgram: checkProgram, - emitFiles: invokeEmitter, + invokeEmitter: invokeEmitter, getParentOfSymbol: getParentOfSymbol, - getTypeOfSymbol: getTypeOfSymbol, + getNarrowedTypeOfSymbol: getNarrowedTypeOfSymbol, getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, @@ -9014,6 +9371,7 @@ var ts; getReturnTypeOfSignature: getReturnTypeOfSignature, getSymbolsInScope: getSymbolsInScope, getSymbolInfo: getSymbolInfo, + getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol, getTypeOfNode: getTypeOfNode, typeToString: typeToString, getSymbolDisplayBuilder: getSymbolDisplayBuilder, @@ -9028,9 +9386,8 @@ var ts; getSignatureFromDeclaration: getSignatureFromDeclaration, isImplementationOfOverload: isImplementationOfOverload, getAliasedSymbol: resolveImport, - isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, - isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, - hasEarlyErrors: hasEarlyErrors + hasEarlyErrors: hasEarlyErrors, + isEmitBlocked: isEmitBlocked }; var undefinedSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "undefined"); var argumentsSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "arguments"); @@ -9060,6 +9417,7 @@ var ts; var globalNumberType; var globalBooleanType; var globalRegExpType; + var globalTemplateStringsArrayType; var tupleTypes = {}; var unionTypes = {}; var stringLiteralTypes = {}; @@ -9208,10 +9566,10 @@ var ts; return nodeLinks[node.id] || (nodeLinks[node.id] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 193 /* SourceFile */); + return ts.getAncestor(node, 196 /* SourceFile */); } function isGlobalSourceFile(node) { - return node.kind === 193 /* SourceFile */ && !ts.isExternalModule(node); + return node.kind === 196 /* SourceFile */ && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -9252,21 +9610,21 @@ var ts; } } switch (location.kind) { - case 193 /* SourceFile */: + case 196 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 35653619 /* ModuleMember */)) { break loop; } break; - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; case 124 /* Property */: - if (location.parent.kind === 184 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { + if (location.parent.kind === 187 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (getSymbol(ctor.locals, name, meaning & 107455 /* Value */)) { @@ -9275,8 +9633,8 @@ var ts; } } break; - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 3152352 /* Type */)) { if (lastLocation && lastLocation.flags & 128 /* Static */) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); @@ -9289,14 +9647,14 @@ var ts; case 126 /* Constructor */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 182 /* FunctionDeclaration */: - case 150 /* ArrowFunction */: + case 185 /* FunctionDeclaration */: + case 153 /* ArrowFunction */: if (name === "arguments") { result = argumentsSymbol; break loop; } break; - case 149 /* FunctionExpression */: + case 152 /* FunctionExpression */: if (name === "arguments") { result = argumentsSymbol; break loop; @@ -9307,7 +9665,7 @@ var ts; break loop; } break; - case 178 /* CatchBlock */: + case 181 /* CatchBlock */: var id = location.variable; if (name === id.text) { result = location.symbol; @@ -9323,21 +9681,21 @@ var ts; } if (!result) { if (nameNotFoundMessage) { - error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.identifierToString(nameArg)); + error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); } return undefined; } if (nameNotFoundMessage) { if (propertyWithInvalidInitializer) { var propertyName = propertyWithInvalidInitializer.name; - error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.identifierToString(propertyName), typeof nameArg === "string" ? nameArg : ts.identifierToString(nameArg)); + error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); return undefined; } if (result.flags & 2 /* BlockScopedVariable */) { var declaration = ts.forEach(result.declarations, function (d) { return d.flags & 6144 /* BlockScoped */ ? d : undefined; }); ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); if (!isDefinedBefore(declaration, errorLocation)) { - error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.identifierToString(declaration.name)); + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); } } } @@ -9348,7 +9706,7 @@ var ts; var links = getSymbolLinks(symbol); if (!links.target) { links.target = resolvingSymbol; - var node = getDeclarationOfKind(symbol, 190 /* ImportDeclaration */); + var node = getDeclarationOfKind(symbol, 193 /* ImportDeclaration */); var target = node.externalModuleName ? resolveExternalModuleName(node, node.externalModuleName) : getSymbolOfPartOfRightHandSideOfImport(node.entityName, node); if (links.target === resolvingSymbol) { links.target = target || unknownSymbol; @@ -9364,7 +9722,7 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImport(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 190 /* ImportDeclaration */); + importDeclaration = ts.getAncestor(entityName, 193 /* ImportDeclaration */); ts.Debug.assert(importDeclaration !== undefined); } if (entityName.kind === 63 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { @@ -9374,7 +9732,7 @@ var ts; return resolveEntityName(importDeclaration, entityName, 1536 /* Namespace */); } else { - ts.Debug.assert(entityName.parent.kind === 190 /* ImportDeclaration */); + ts.Debug.assert(entityName.parent.kind === 193 /* ImportDeclaration */); return resolveEntityName(importDeclaration, entityName, 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */); } } @@ -9394,7 +9752,7 @@ var ts; return; var symbol = getSymbol(namespace.exports, name.right.text, meaning); if (!symbol) { - error(location, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.identifierToString(name.right)); + error(location, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(name.right)); return; } } @@ -9479,9 +9837,9 @@ var ts; var seenExportedMember = false; var result = []; ts.forEach(symbol.declarations, function (declaration) { - var block = (declaration.kind === 193 /* SourceFile */ ? declaration : declaration.body); + var block = (declaration.kind === 196 /* SourceFile */ ? declaration : declaration.body); ts.forEach(block.statements, function (node) { - if (node.kind === 191 /* ExportAssignment */) { + if (node.kind === 194 /* ExportAssignment */) { result.push(node); } else { @@ -9588,17 +9946,17 @@ var ts; } } switch (location.kind) { - case 193 /* SourceFile */: + case 196 /* SourceFile */: if (!ts.isExternalModule(location)) { break; } - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location).exports)) { return result; } break; - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: if (result = callback(getSymbolOfNode(location).members)) { return result; } @@ -9629,7 +9987,7 @@ var ts; } return ts.forEachValue(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 33554432 /* Import */) { - if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 190 /* ImportDeclaration */ && declaration.externalModuleName; })) { + if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 193 /* ImportDeclaration */ && declaration.externalModuleName; })) { var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable); if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) { return [symbolFromSymbolTable]; @@ -9711,7 +10069,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 188 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 193 /* SourceFile */ && ts.isExternalModule(declaration)); + return (declaration.kind === 191 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 196 /* SourceFile */ && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -9721,7 +10079,7 @@ var ts; return { aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 190 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { + if (declaration.kind === 193 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { if (!ts.contains(aliasesToMakeVisible, declaration)) { @@ -9742,7 +10100,7 @@ var ts; var firstIdentifier = getFirstIdentifier(entityName); var symbolOfNameSpace = resolveName(entityName.parent, firstIdentifier.text, 1536 /* Namespace */, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); var hasNamespaceDeclarationsVisibile = hasVisibleDeclarations(symbolOfNameSpace); - return hasNamespaceDeclarationsVisibile ? { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : { accessibility: 1 /* NotAccessible */, errorSymbolName: ts.identifierToString(firstIdentifier) }; + return hasNamespaceDeclarationsVisibile ? { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : { accessibility: 1 /* NotAccessible */, errorSymbolName: ts.declarationNameToString(firstIdentifier) }; } function releaseStringWriter(writer) { writer.clear(); @@ -9781,10 +10139,10 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { var node = type.symbol.declarations[0].parent; - while (node.kind === 138 /* ParenType */) { + while (node.kind === 140 /* ParenType */) { node = node.parent; } - if (node.kind === 186 /* TypeAliasDeclaration */) { + if (node.kind === 189 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -9796,7 +10154,7 @@ var ts; if (symbol.declarations && symbol.declarations.length > 0) { var declaration = symbol.declarations[0]; if (declaration.name) { - writer.writeSymbol(ts.identifierToString(declaration.name), symbol); + writer.writeSymbol(ts.declarationNameToString(declaration.name), symbol); return; } } @@ -9947,7 +10305,7 @@ var ts; function shouldWriteTypeOfFunctionSymbol() { if (type.symbol) { var isStaticMethodSymbol = !!(type.symbol.flags & 8192 /* Method */ && ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128 /* Static */; })); - var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 193 /* SourceFile */ || declaration.parent.kind === 189 /* ModuleBlock */; })); + var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 196 /* SourceFile */ || declaration.parent.kind === 192 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2 /* UseTypeOfFunction */) || (typeStack && ts.contains(typeStack, type)); } @@ -10166,12 +10524,12 @@ var ts; function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 188 /* ModuleDeclaration */) { + if (node.kind === 191 /* ModuleDeclaration */) { if (node.name.kind === 7 /* StringLiteral */) { return node; } } - else if (node.kind === 193 /* SourceFile */) { + else if (node.kind === 196 /* SourceFile */) { return ts.isExternalModule(node) ? node : undefined; } } @@ -10213,16 +10571,16 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 181 /* VariableDeclaration */: - case 188 /* ModuleDeclaration */: - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: - case 186 /* TypeAliasDeclaration */: - case 182 /* FunctionDeclaration */: - case 187 /* EnumDeclaration */: - case 190 /* ImportDeclaration */: - var parent = node.kind === 181 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (!(node.flags & 1 /* Export */) && !(node.kind !== 190 /* ImportDeclaration */ && parent.kind !== 193 /* SourceFile */ && ts.isInAmbientContext(parent))) { + case 184 /* VariableDeclaration */: + case 191 /* ModuleDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 185 /* FunctionDeclaration */: + case 190 /* EnumDeclaration */: + case 193 /* ImportDeclaration */: + var parent = node.kind === 184 /* VariableDeclaration */ ? node.parent.parent : node.parent; + if (!(node.flags & 1 /* Export */) && !(node.kind !== 193 /* ImportDeclaration */ && parent.kind !== 196 /* SourceFile */ && ts.isInAmbientContext(parent))) { return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); } return isDeclarationVisible(parent); @@ -10236,9 +10594,9 @@ var ts; case 129 /* CallSignature */: case 131 /* IndexSignature */: case 123 /* Parameter */: - case 189 /* ModuleBlock */: + case 192 /* ModuleBlock */: return isDeclarationVisible(node.parent); - case 193 /* SourceFile */: + case 196 /* SourceFile */: return true; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); @@ -10256,8 +10614,8 @@ var ts; var classType = getDeclaredTypeOfSymbol(prototype.parent); return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; } - function getTypeOfVariableDeclaration(declaration) { - if (declaration.parent.kind === 166 /* ForInStatement */) { + function getTypeOfVariableOrPropertyDeclaration(declaration) { + if (declaration.parent.kind === 169 /* ForInStatement */) { return anyType; } if (declaration.type) { @@ -10278,7 +10636,7 @@ var ts; } if (declaration.initializer) { var type = checkAndMarkExpression(declaration.initializer); - if (declaration.kind !== 141 /* PropertyAssignment */) { + if (declaration.kind !== 143 /* PropertyAssignment */) { var unwidenedType = type; type = getWidenedType(type); if (type !== unwidenedType) { @@ -10287,6 +10645,10 @@ var ts; } return type; } + if (declaration.kind === 144 /* ShorthandPropertyAssignment */) { + var type = checkIdentifier(declaration.name); + return type; + } var type = declaration.flags & 8 /* Rest */ ? createArrayType(anyType) : anyType; checkImplicitAny(type); return type; @@ -10310,7 +10672,7 @@ var ts; default: var diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; } - error(declaration, diagnostic, ts.identifierToString(declaration.name), typeToString(type)); + error(declaration, diagnostic, ts.declarationNameToString(declaration.name), typeToString(type)); } } function getTypeOfVariableOrParameterOrProperty(symbol) { @@ -10320,11 +10682,11 @@ var ts; return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.kind === 178 /* CatchBlock */) { + if (declaration.kind === 181 /* CatchBlock */) { return links.type = anyType; } links.type = resolvingType; - var type = getTypeOfVariableDeclaration(declaration); + var type = getTypeOfVariableOrPropertyDeclaration(declaration); if (links.type === resolvingType) { links.type = type; } @@ -10375,7 +10737,7 @@ var ts; type = setterParameterType; } else { - if (getter) { + if (getter && getter.body) { type = getReturnTypeFromBody(getter); } else { @@ -10460,7 +10822,7 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 185 /* InterfaceDeclaration */ || node.kind === 184 /* ClassDeclaration */) { + if (node.kind === 188 /* InterfaceDeclaration */ || node.kind === 187 /* ClassDeclaration */) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { @@ -10491,7 +10853,7 @@ var ts; type.typeArguments = type.typeParameters; } type.baseTypes = []; - var declaration = getDeclarationOfKind(symbol, 184 /* ClassDeclaration */); + var declaration = getDeclarationOfKind(symbol, 187 /* ClassDeclaration */); if (declaration.baseType) { var baseType = getTypeFromTypeReferenceNode(declaration.baseType); if (baseType !== unknownType) { @@ -10531,7 +10893,7 @@ var ts; } type.baseTypes = []; ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 185 /* InterfaceDeclaration */ && declaration.baseTypes) { + if (declaration.kind === 188 /* InterfaceDeclaration */ && declaration.baseTypes) { ts.forEach(declaration.baseTypes, function (node) { var baseType = getTypeFromTypeReferenceNode(node); if (baseType !== unknownType) { @@ -10562,7 +10924,7 @@ var ts; var links = getSymbolLinks(symbol); if (!links.declaredType) { links.declaredType = resolvingType; - var declaration = getDeclarationOfKind(symbol, 186 /* TypeAliasDeclaration */); + var declaration = getDeclarationOfKind(symbol, 189 /* TypeAliasDeclaration */); var type = getTypeFromTypeNode(declaration.type); if (links.declaredType === resolvingType) { links.declaredType = type; @@ -10570,7 +10932,7 @@ var ts; } else if (links.declaredType === resolvingType) { links.declaredType = unknownType; - var declaration = getDeclarationOfKind(symbol, 186 /* TypeAliasDeclaration */); + var declaration = getDeclarationOfKind(symbol, 189 /* TypeAliasDeclaration */); error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); } return links.declaredType; @@ -11039,7 +11401,9 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 182 /* FunctionDeclaration */: + case 133 /* FunctionType */: + case 134 /* ConstructorType */: + case 185 /* FunctionDeclaration */: case 125 /* Method */: case 126 /* Constructor */: case 129 /* CallSignature */: @@ -11047,8 +11411,8 @@ var ts; case 131 /* IndexSignature */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -11081,7 +11445,7 @@ var ts; if (compilerOptions.noImplicitAny) { var declaration = signature.declaration; if (declaration.name) { - error(declaration.name, 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, ts.identifierToString(declaration.name)); + error(declaration.name, 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, ts.declarationNameToString(declaration.name)); } else { error(declaration, ts.Diagnostics.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); @@ -11269,9 +11633,9 @@ var ts; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; switch (declaration.kind) { - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: - case 187 /* EnumDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: return declaration; } } @@ -11411,7 +11775,7 @@ var ts; } return links.resolvedType; } - function getTypeFromTypeLiteralNode(node) { + function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { links.resolvedType = createObjectType(32768 /* Anonymous */, node.symbol); @@ -11448,18 +11812,20 @@ var ts; return getTypeFromStringLiteral(node); case 132 /* TypeReference */: return getTypeFromTypeReferenceNode(node); - case 133 /* TypeQuery */: + case 135 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 135 /* ArrayType */: + case 137 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 136 /* TupleType */: + case 138 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 137 /* UnionType */: + case 139 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 138 /* ParenType */: + case 140 /* ParenType */: return getTypeFromTypeNode(node.type); - case 134 /* TypeLiteral */: - return getTypeFromTypeLiteralNode(node); + case 133 /* FunctionType */: + case 134 /* ConstructorType */: + case 136 /* TypeLiteral */: + return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); case 63 /* Identifier */: case 121 /* QualifiedName */: var symbol = getSymbolInfo(node); @@ -11606,16 +11972,16 @@ var ts; } function isContextSensitiveExpression(node) { switch (node.kind) { - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: return !node.typeParameters && !ts.forEach(node.parameters, function (p) { return p.type; }); - case 140 /* ObjectLiteral */: - return ts.forEach(node.properties, function (p) { return p.kind === 141 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); - case 139 /* ArrayLiteral */: + case 142 /* ObjectLiteral */: + return ts.forEach(node.properties, function (p) { return p.kind === 143 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); + case 141 /* ArrayLiteral */: return ts.forEach(node.elements, function (e) { return isContextSensitiveExpression(e); }); - case 154 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return isContextSensitiveExpression(node.whenTrue) || isContextSensitiveExpression(node.whenFalse); - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: return node.operator === 48 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); } return false; @@ -11664,6 +12030,7 @@ var ts; var errorInfo; var sourceStack; var targetStack; + var maybeStack; var expandingFlags; var depth = 0; var overflow = false; @@ -11808,11 +12175,11 @@ var ts; var id = source.id + "," + target.id; var related = relation[id]; if (related !== undefined) { - return related; + return related ? -1 /* True */ : 0 /* False */; } if (depth > 0) { for (var i = 0; i < depth; i++) { - if (source === sourceStack[i] && target === targetStack[i]) { + if (maybeStack[i][id]) { return 1 /* Maybe */; } } @@ -11824,10 +12191,13 @@ var ts; else { sourceStack = []; targetStack = []; + maybeStack = []; expandingFlags = 0; } sourceStack[depth] = source; targetStack[depth] = target; + maybeStack[depth] = {}; + maybeStack[depth][id] = true; depth++; var saveExpandingFlags = expandingFlags; if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack)) @@ -11835,7 +12205,7 @@ var ts; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; if (expandingFlags === 3) { - var result = -1 /* True */; + var result = 1 /* Maybe */; } else { var result = propertiesRelatedTo(source, target, reportErrors); @@ -11854,8 +12224,15 @@ var ts; } expandingFlags = saveExpandingFlags; depth--; - if (result !== 1 /* Maybe */) { - relation[id] = result; + if (result) { + var maybeCache = maybeStack[depth]; + var destinationCache = result === -1 /* True */ || depth === 0 ? relation : maybeStack[depth - 1]; + for (var p in maybeCache) { + destinationCache[p] = maybeCache[p]; + } + } + else { + relation[id] = false; } return result; } @@ -12334,8 +12711,9 @@ var ts; } function createInferenceContext(typeParameters, inferUnionTypes) { var inferences = []; - for (var i = 0; i < typeParameters.length; i++) - inferences.push([]); + for (var i = 0; i < typeParameters.length; i++) { + inferences.push({ primary: undefined, secondary: undefined }); + } return { typeParameters: typeParameters, inferUnionTypes: inferUnionTypes, @@ -12348,6 +12726,7 @@ var ts; var sourceStack; var targetStack; var depth = 0; + var inferiority = 0; inferFromTypes(source, target); function isInProcess(source, target) { for (var i = 0; i < depth; i++) { @@ -12374,10 +12753,10 @@ var ts; var typeParameters = context.typeParameters; for (var i = 0; i < typeParameters.length; i++) { if (target === typeParameters[i]) { - context.inferenceCount++; var inferences = context.inferences[i]; - if (!ts.contains(inferences, source)) - inferences.push(source); + var candidates = inferiority ? inferences.secondary || (inferences.secondary = []) : inferences.primary || (inferences.primary = []); + if (!ts.contains(candidates, source)) + candidates.push(source); break; } } @@ -12391,7 +12770,6 @@ var ts; } else if (target.flags & 16384 /* Union */) { var targetTypes = target.types; - var startCount = context.inferenceCount; var typeParameterCount = 0; var typeParameter; for (var i = 0; i < targetTypes.length; i++) { @@ -12404,8 +12782,10 @@ var ts; inferFromTypes(source, t); } } - if (context.inferenceCount === startCount && typeParameterCount === 1) { + if (typeParameterCount === 1) { + inferiority++; inferFromTypes(source, typeParameter); + inferiority--; } } else if (source.flags & 16384 /* Union */) { @@ -12467,10 +12847,14 @@ var ts; } } } + function getInferenceCandidates(context, index) { + var inferences = context.inferences[index]; + return inferences.primary || inferences.secondary || emptyArray; + } function getInferredType(context, index) { var inferredType = context.inferredTypes[index]; if (!inferredType) { - var inferences = context.inferences[index]; + var inferences = getInferenceCandidates(context, index); if (inferences.length) { var unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences) : getCommonSupertype(inferences); inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : inferenceFailureType; @@ -12505,7 +12889,7 @@ var ts; function isInTypeQuery(node) { while (node) { switch (node.kind) { - case 133 /* TypeQuery */: + case 135 /* TypeQuery */: return true; case 63 /* Identifier */: case 121 /* QualifiedName */: @@ -12541,7 +12925,7 @@ var ts; function isAssignedInBinaryExpression(node) { if (node.operator >= 51 /* FirstAssignment */ && node.operator <= 62 /* LastAssignment */) { var n = node.left; - while (n.kind === 148 /* ParenExpression */) { + while (n.kind === 151 /* ParenExpression */) { n = n.expression; } if (n.kind === 63 /* Identifier */ && getResolvedSymbol(n) === symbol) { @@ -12558,40 +12942,40 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: return isAssignedInBinaryExpression(node); - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: return isAssignedInVariableDeclaration(node); - case 139 /* ArrayLiteral */: - case 140 /* ObjectLiteral */: - case 142 /* PropertyAccess */: - case 143 /* IndexedAccess */: - case 144 /* CallExpression */: - case 145 /* NewExpression */: - case 147 /* TypeAssertion */: - case 148 /* ParenExpression */: - case 151 /* PrefixOperator */: - case 152 /* PostfixOperator */: - case 154 /* ConditionalExpression */: - case 158 /* Block */: - case 159 /* VariableStatement */: - case 161 /* ExpressionStatement */: - case 162 /* IfStatement */: - case 163 /* DoStatement */: - case 164 /* WhileStatement */: - case 165 /* ForStatement */: - case 166 /* ForInStatement */: - case 169 /* ReturnStatement */: - case 170 /* WithStatement */: - case 171 /* SwitchStatement */: - case 172 /* CaseClause */: - case 173 /* DefaultClause */: - case 174 /* LabeledStatement */: - case 175 /* ThrowStatement */: - case 176 /* TryStatement */: - case 177 /* TryBlock */: - case 178 /* CatchBlock */: - case 179 /* FinallyBlock */: + case 141 /* ArrayLiteral */: + case 142 /* ObjectLiteral */: + case 145 /* PropertyAccess */: + case 146 /* IndexedAccess */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: + case 150 /* TypeAssertion */: + case 151 /* ParenExpression */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: + case 157 /* ConditionalExpression */: + case 161 /* Block */: + case 162 /* VariableStatement */: + case 164 /* ExpressionStatement */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 172 /* ReturnStatement */: + case 173 /* WithStatement */: + case 174 /* SwitchStatement */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: + case 177 /* LabeledStatement */: + case 178 /* ThrowStatement */: + case 179 /* TryStatement */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: return ts.forEachChild(node, isAssignedIn); } return false; @@ -12599,26 +12983,23 @@ var ts; } function getNarrowedTypeOfSymbol(symbol, node) { var type = getTypeOfSymbol(symbol); - if (symbol.flags & 3 /* Variable */ && type.flags & 65025 /* Structured */) { - while (true) { + if (node && (symbol.flags & 3 /* Variable */ && type.flags & 65025 /* Structured */)) { + loop: while (true) { var child = node; node = node.parent; - if (!node || node.kind === 183 /* FunctionBlock */ || node.kind === 189 /* ModuleBlock */) { - break; - } var narrowedType = type; switch (node.kind) { - case 162 /* IfStatement */: + case 165 /* IfStatement */: if (child !== node.expression) { narrowedType = narrowType(type, node.expression, child === node.thenStatement); } break; - case 154 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: if (child !== node.condition) { narrowedType = narrowType(type, node.condition, child === node.whenTrue); } break; - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: if (child === node.right) { if (node.operator === 47 /* AmpersandAmpersandToken */) { narrowedType = narrowType(type, node.left, true); @@ -12628,8 +13009,16 @@ var ts; } } break; + case 196 /* SourceFile */: + case 191 /* ModuleDeclaration */: + case 185 /* FunctionDeclaration */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: + break loop; } - if (narrowedType !== type) { + if (narrowedType !== type && isTypeSubtypeOf(narrowedType, type)) { if (isVariableAssignedWithin(symbol, node)) { break; } @@ -12641,7 +13030,7 @@ var ts; function narrowTypeByEquality(type, expr, assumeTrue) { var left = expr.left; var right = expr.right; - if (left.kind !== 151 /* PrefixOperator */ || left.operator !== 95 /* TypeOfKeyword */ || left.operand.kind !== 63 /* Identifier */ || right.kind !== 7 /* StringLiteral */ || getResolvedSymbol(left.operand) !== symbol) { + if (left.kind !== 154 /* PrefixOperator */ || left.operator !== 95 /* TypeOfKeyword */ || left.operand.kind !== 63 /* Identifier */ || right.kind !== 7 /* StringLiteral */ || getResolvedSymbol(left.operand) !== symbol) { return type; } var t = right.text; @@ -12695,9 +13084,9 @@ var ts; } function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 148 /* ParenExpression */: + case 151 /* ParenExpression */: return narrowType(type, expr.expression, assumeTrue); - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: var operator = expr.operator; if (operator === 29 /* EqualsEqualsEqualsToken */ || operator === 30 /* ExclamationEqualsEqualsToken */) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -12712,7 +13101,7 @@ var ts; return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 151 /* PrefixOperator */: + case 154 /* PrefixOperator */: if (expr.operator === 45 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -12724,7 +13113,7 @@ var ts; function checkIdentifier(node) { var symbol = getResolvedSymbol(node); if (symbol.flags & 33554432 /* Import */) { - getSymbolLinks(symbol).referenced = !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveImport(symbol)); + getSymbolLinks(symbol).referenced = getSymbolLinks(symbol).referenced || (!isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveImport(symbol))); } checkCollisionWithCapturedSuperVariable(node, node); checkCollisionWithCapturedThisVariable(node, node); @@ -12732,7 +13121,7 @@ var ts; return getNarrowedTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol), node); } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 184 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 187 /* ClassDeclaration */ ? container.parent : undefined; getNodeLinks(node).flags |= 2 /* LexicalThis */; if (container.kind === 124 /* Property */ || container.kind === 126 /* Constructor */) { getNodeLinks(classNode).flags |= 4 /* CaptureThis */; @@ -12744,15 +13133,15 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 150 /* ArrowFunction */) { + if (container.kind === 153 /* ArrowFunction */) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = true; } switch (container.kind) { - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); break; - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; case 126 /* Constructor */: @@ -12769,7 +13158,7 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } - var classNode = container.parent && container.parent.kind === 184 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 187 /* ClassDeclaration */ ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); return container.flags & 128 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); @@ -12782,9 +13171,9 @@ var ts; if (!node) return node; switch (node.kind) { - case 182 /* FunctionDeclaration */: - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: case 124 /* Property */: case 125 /* Method */: case 126 /* Constructor */: @@ -12803,8 +13192,8 @@ var ts; return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 144 /* CallExpression */ && node.parent.func === node; - var enclosingClass = ts.getAncestor(node, 184 /* ClassDeclaration */); + var isCallExpression = node.parent.kind === 147 /* CallExpression */ && node.parent.func === node; + var enclosingClass = ts.getAncestor(node, 187 /* ClassDeclaration */); var baseClass; if (enclosingClass && enclosingClass.baseType) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); @@ -12822,11 +13211,11 @@ var ts; } else { var needToCaptureLexicalThis = false; - while (container && container.kind === 150 /* ArrowFunction */) { + while (container && container.kind === 153 /* ArrowFunction */) { container = getSuperContainer(container); needToCaptureLexicalThis = true; } - if (container && container.parent && container.parent.kind === 184 /* ClassDeclaration */) { + if (container && container.parent && container.parent.kind === 187 /* ClassDeclaration */) { if (container.flags & 128 /* Static */) { canUseSuperExpression = container.kind === 125 /* Method */ || container.kind === 127 /* GetAccessor */ || container.kind === 128 /* SetAccessor */; } @@ -12865,7 +13254,7 @@ var ts; } function getContextuallyTypedParameterType(parameter) { var func = parameter.parent; - if (func.kind === 149 /* FunctionExpression */ || func.kind === 150 /* ArrowFunction */) { + if (func.kind === 152 /* FunctionExpression */ || func.kind === 153 /* ArrowFunction */) { if (isContextSensitiveExpression(func)) { var contextualSignature = getContextualSignature(func); if (contextualSignature) { @@ -13004,25 +13393,25 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: case 123 /* Parameter */: case 124 /* Property */: return getContextualTypeForInitializerExpression(node); - case 150 /* ArrowFunction */: - case 169 /* ReturnStatement */: + case 153 /* ArrowFunction */: + case 172 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 144 /* CallExpression */: - case 145 /* NewExpression */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: return getContextualTypeForArgument(node); - case 147 /* TypeAssertion */: + case 150 /* TypeAssertion */: return getTypeFromTypeNode(parent.type); - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 141 /* PropertyAssignment */: + case 143 /* PropertyAssignment */: return getContextualTypeForPropertyExpression(node); - case 139 /* ArrayLiteral */: + case 141 /* ArrayLiteral */: return getContextualTypeForElementExpression(node); - case 154 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); } return undefined; @@ -13044,19 +13433,31 @@ var ts; if (!(type.flags & 16384 /* Union */)) { return getNonGenericSignature(type); } - var result; + var signatureList; var types = type.types; for (var i = 0; i < types.length; i++) { + if (signatureList && getSignaturesOfObjectOrUnionType(types[i], 0 /* Call */).length > 1) { + return undefined; + } var signature = getNonGenericSignature(types[i]); if (signature) { - if (!result) { - result = signature; + if (!signatureList) { + signatureList = [signature]; } - else if (!compareSignatures(result, signature, true, compareTypes)) { + else if (!compareSignatures(signatureList[0], signature, false, compareTypes)) { return undefined; } + else { + signatureList.push(signature); + } } } + var result; + if (signatureList) { + result = cloneSignature(signatureList[0]); + result.resolvedReturnType = undefined; + result.unionSignatures = signatureList; + } return result; } function isInferentialContext(mapper) { @@ -13085,7 +13486,15 @@ var ts; if (ts.hasProperty(members, id)) { var member = members[id]; if (member.flags & 4 /* Property */) { - var type = checkExpression(member.declarations[0].initializer, contextualMapper); + var memberDecl = member.declarations[0]; + var type; + if (memberDecl.kind === 143 /* PropertyAssignment */) { + type = checkExpression(memberDecl.initializer, contextualMapper); + } + else { + ts.Debug.assert(memberDecl.kind === 144 /* ShorthandPropertyAssignment */); + type = checkExpression(memberDecl.name, contextualMapper); + } var prop = createSymbol(4 /* Property */ | 268435456 /* Transient */ | member.flags, member.name); prop.declarations = member.declarations; prop.parent = member.parent; @@ -13140,7 +13549,7 @@ var ts; if (!(flags & (32 /* Private */ | 64 /* Protected */))) { return; } - var enclosingClassDeclaration = ts.getAncestor(node, 184 /* ClassDeclaration */); + var enclosingClassDeclaration = ts.getAncestor(node, 187 /* ClassDeclaration */); var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (flags & 32 /* Private */) { @@ -13175,7 +13584,7 @@ var ts; var prop = getPropertyOfType(apparentType, node.right.text); if (!prop) { if (node.right.text) { - error(node.right, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.identifierToString(node.right), typeToString(type)); + error(node.right, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.declarationNameToString(node.right), typeToString(type)); } return unknownType; } @@ -13245,29 +13654,64 @@ var ts; return unknownType; } function resolveUntypedCall(node) { - ts.forEach(node.arguments, function (argument) { - checkExpression(argument); - }); + if (node.kind === 149 /* TaggedTemplateExpression */) { + checkExpression(node.template); + } + else { + ts.forEach(node.arguments, function (argument) { + checkExpression(argument); + }); + } return anySignature; } function resolveErrorCall(node) { resolveUntypedCall(node); return unknownSignature; } - function signatureHasCorrectArity(node, signature) { - if (!node.arguments) { - return signature.minArgumentCount === 0; + function hasCorrectArity(node, args, signature) { + var adjustedArgCount; + var typeArguments; + var callIsIncomplete; + if (node.kind === 149 /* TaggedTemplateExpression */) { + var tagExpression = node; + adjustedArgCount = args.length; + typeArguments = undefined; + if (tagExpression.template.kind === 158 /* TemplateExpression */) { + var templateExpression = tagExpression.template; + var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); + ts.Debug.assert(lastSpan !== undefined); + callIsIncomplete = lastSpan.literal.kind === 120 /* Missing */ || ts.isUnterminatedTemplateEnd(lastSpan.literal); + } + else { + var templateLiteral = tagExpression.template; + ts.Debug.assert(templateLiteral.kind === 9 /* NoSubstitutionTemplateLiteral */); + callIsIncomplete = ts.isUnterminatedTemplateEnd(templateLiteral); + } } - var args = node.arguments; - var numberOfArgs = args.hasTrailingComma ? args.length + 1 : args.length; - var hasTooManyArguments = !signature.hasRestParameter && numberOfArgs > signature.parameters.length; - var hasRightNumberOfTypeArguments = !node.typeArguments || (signature.typeParameters && node.typeArguments.length === signature.typeParameters.length); - if (hasTooManyArguments || !hasRightNumberOfTypeArguments) { - return false; + else { + var callExpression = node; + if (!callExpression.arguments) { + ts.Debug.assert(callExpression.kind === 148 /* NewExpression */); + return signature.minArgumentCount === 0; + } + adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length; + callIsIncomplete = callExpression.arguments.end === callExpression.end; + typeArguments = callExpression.typeArguments; + } + ts.Debug.assert(adjustedArgCount !== undefined, "'adjustedArgCount' undefined"); + ts.Debug.assert(callIsIncomplete !== undefined, "'callIsIncomplete' undefined"); + return checkArity(adjustedArgCount, typeArguments, callIsIncomplete, signature); + function checkArity(adjustedArgCount, typeArguments, callIsIncomplete, signature) { + if (!signature.hasRestParameter && adjustedArgCount > signature.parameters.length) { + return false; + } + var hasRightNumberOfTypeArgs = !typeArguments || (signature.typeParameters && typeArguments.length === signature.typeParameters.length); + if (!hasRightNumberOfTypeArgs) { + return false; + } + var hasEnoughArguments = adjustedArgCount >= signature.minArgumentCount; + return callIsIncomplete || hasEnoughArguments; } - var callIsIncomplete = args.end === node.end; - var hasEnoughArguments = numberOfArgs >= signature.minArgumentCount; - return callIsIncomplete || hasEnoughArguments; } function getSingleCallSignature(type) { if (type.flags & 48128 /* ObjectType */) { @@ -13290,17 +13734,21 @@ var ts; var context = createInferenceContext(typeParameters, false); var mapper = createInferenceMapper(context); for (var i = 0; i < args.length; i++) { - if (args[i].kind === 157 /* OmittedExpression */) { + if (args[i].kind === 160 /* OmittedExpression */) { continue; } if (!excludeArgument || excludeArgument[i] === undefined) { var parameterType = getTypeAtPosition(signature, i); + if (i === 0 && args[i].parent.kind === 149 /* TaggedTemplateExpression */) { + inferTypes(context, globalTemplateStringsArrayType, parameterType); + continue; + } inferTypes(context, checkExpressionWithContextualType(args[i], parameterType, mapper), parameterType); } } if (excludeArgument) { for (var i = 0; i < args.length; i++) { - if (args[i].kind === 157 /* OmittedExpression */) { + if (args[i].kind === 160 /* OmittedExpression */) { continue; } if (excludeArgument[i] === false) { @@ -13334,37 +13782,60 @@ var ts; } return typeArgumentsAreAssignable; } - function checkApplicableSignature(node, signature, relation, excludeArgument, reportErrors) { - if (node.arguments) { - for (var i = 0; i < node.arguments.length; i++) { - var arg = node.arguments[i]; - if (arg.kind === 157 /* OmittedExpression */) { - continue; - } - var paramType = getTypeAtPosition(signature, i); - var argType = arg.kind === 7 /* StringLiteral */ && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); - var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); - if (!isValidArgument) { - return false; - } + function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) { + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + var argType; + if (arg.kind === 160 /* OmittedExpression */) { + continue; + } + var paramType = getTypeAtPosition(signature, i); + if (i === 0 && node.kind === 149 /* TaggedTemplateExpression */) { + argType = globalTemplateStringsArrayType; + } + else { + argType = arg.kind === 7 /* StringLiteral */ && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); + } + var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); + if (!isValidArgument) { + return false; } } return true; } + function getEffectiveCallArguments(node) { + var args; + if (node.kind === 149 /* TaggedTemplateExpression */) { + var template = node.template; + args = [template]; + if (template.kind === 158 /* TemplateExpression */) { + ts.forEach(template.templateSpans, function (span) { + args.push(span.expression); + }); + } + } + else { + args = node.arguments || emptyArray; + } + return args; + } function resolveCall(node, signatures, candidatesOutArray) { - ts.forEach(node.typeArguments, checkSourceElement); + var isTaggedTemplate = node.kind === 149 /* TaggedTemplateExpression */; + var typeArguments = isTaggedTemplate ? undefined : node.typeArguments; + ts.forEach(typeArguments, checkSourceElement); var candidates = candidatesOutArray || []; collectCandidates(); if (!candidates.length) { error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); return resolveErrorCall(node); } - var args = node.arguments || emptyArray; + var args = getEffectiveCallArguments(node); var excludeArgument; - for (var i = 0; i < args.length; i++) { + for (var i = isTaggedTemplate ? 1 : 0; i < args.length; i++) { if (isContextSensitiveExpression(args[i])) { - if (!excludeArgument) + if (!excludeArgument) { excludeArgument = new Array(args.length); + } excludeArgument[i] = true; } } @@ -13373,30 +13844,30 @@ var ts; var resultOfFailedInference; var result; if (candidates.length > 1) { - result = chooseOverload(candidates, subtypeRelation, excludeArgument); + result = chooseOverload(candidates, subtypeRelation); } if (!result) { candidateForArgumentError = undefined; candidateForTypeArgumentError = undefined; resultOfFailedInference = undefined; - result = chooseOverload(candidates, assignableRelation, excludeArgument); + result = chooseOverload(candidates, assignableRelation); } if (result) { return result; } if (candidateForArgumentError) { - checkApplicableSignature(node, candidateForArgumentError, assignableRelation, undefined, true); + checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, undefined, true); } else if (candidateForTypeArgumentError) { - if (node.typeArguments) { + if (!isTaggedTemplate && node.typeArguments) { checkTypeArguments(candidateForTypeArgumentError, node.typeArguments, [], true); } else { ts.Debug.assert(resultOfFailedInference.failedTypeParameterIndex >= 0); var failedTypeParameter = candidateForTypeArgumentError.typeParameters[resultOfFailedInference.failedTypeParameterIndex]; - var inferenceCandidates = resultOfFailedInference.inferences[resultOfFailedInference.failedTypeParameterIndex]; + var inferenceCandidates = getInferenceCandidates(resultOfFailedInference, resultOfFailedInference.failedTypeParameterIndex); var diagnosticChainHead = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly, typeToString(failedTypeParameter)); - reportNoCommonSupertypeError(inferenceCandidates, node.func, diagnosticChainHead); + reportNoCommonSupertypeError(inferenceCandidates, node.func || node.tag, diagnosticChainHead); } } else { @@ -13404,15 +13875,15 @@ var ts; } if (!fullTypeCheck) { for (var i = 0, n = candidates.length; i < n; i++) { - if (signatureHasCorrectArity(node, candidates[i])) { + if (hasCorrectArity(node, args, candidates[i])) { return candidates[i]; } } } return resolveErrorCall(node); - function chooseOverload(candidates, relation, excludeArgument) { + function chooseOverload(candidates, relation) { for (var i = 0; i < candidates.length; i++) { - if (!signatureHasCorrectArity(node, candidates[i])) { + if (!hasCorrectArity(node, args, candidates[i])) { continue; } var originalCandidate = candidates[i]; @@ -13422,9 +13893,9 @@ var ts; if (candidate.typeParameters) { var typeArgumentTypes; var typeArgumentsAreValid; - if (node.typeArguments) { + if (typeArguments) { typeArgumentTypes = new Array(candidate.typeParameters.length); - typeArgumentsAreValid = checkTypeArguments(candidate, node.typeArguments, typeArgumentTypes, false); + typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false); } else { inferenceResult = inferTypeArguments(candidate, args, excludeArgument); @@ -13436,7 +13907,7 @@ var ts; } candidate = getSignatureInstantiation(candidate, typeArgumentTypes); } - if (!checkApplicableSignature(node, candidate, relation, excludeArgument, false)) { + if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, false)) { break; } var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; @@ -13452,7 +13923,7 @@ var ts; } else { candidateForTypeArgumentError = originalCandidate; - if (!node.typeArguments) { + if (!typeArguments) { resultOfFailedInference = inferenceResult; } } @@ -13555,11 +14026,38 @@ var ts; error(node, ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature); return resolveErrorCall(node); } + function resolveTaggedTemplateExpression(node, candidatesOutArray) { + var tagType = checkExpression(node.tag); + var apparentType = getApparentType(tagType); + if (apparentType === unknownType) { + return resolveErrorCall(node); + } + var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); + if (tagType === anyType || (!callSignatures.length && !(tagType.flags & 16384 /* Union */) && isTypeAssignableTo(tagType, globalFunctionType))) { + return resolveUntypedCall(node); + } + if (!callSignatures.length) { + error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature); + return resolveErrorCall(node); + } + return resolveCall(node, callSignatures, candidatesOutArray); + } function getResolvedSignature(node, candidatesOutArray) { var links = getNodeLinks(node); if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - links.resolvedSignature = node.kind === 144 /* CallExpression */ ? resolveCallExpression(node, candidatesOutArray) : resolveNewExpression(node, candidatesOutArray); + if (node.kind === 147 /* CallExpression */) { + links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); + } + else if (node.kind === 148 /* NewExpression */) { + links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); + } + else if (node.kind === 149 /* TaggedTemplateExpression */) { + links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); + } + else { + ts.Debug.fail("Branch in 'getResolvedSignature' should be unreachable."); + } } return links.resolvedSignature; } @@ -13568,9 +14066,9 @@ var ts; if (node.func.kind === 89 /* SuperKeyword */) { return voidType; } - if (node.kind === 145 /* NewExpression */) { + if (node.kind === 148 /* NewExpression */) { var declaration = signature.declaration; - if (declaration && (declaration.kind !== 126 /* Constructor */ && declaration.kind !== 130 /* ConstructSignature */)) { + if (declaration && declaration.kind !== 126 /* Constructor */ && declaration.kind !== 130 /* ConstructSignature */ && declaration.kind !== 134 /* ConstructorType */) { if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -13580,9 +14078,7 @@ var ts; return getReturnTypeOfSignature(signature); } function checkTaggedTemplateExpression(node) { - checkExpression(node.tag); - checkExpression(node.template); - return anyType; + return getReturnTypeOfSignature(getResolvedSignature(node)); } function checkTypeAssertion(node) { var exprType = checkExpression(node.operand); @@ -13613,7 +14109,7 @@ var ts; } function getReturnTypeFromBody(func, contextualMapper) { var contextualSignature = getContextualSignature(func); - if (func.body.kind !== 183 /* FunctionBlock */) { + if (func.body.kind !== 186 /* FunctionBlock */) { var unwidenedType = checkAndMarkExpression(func.body, contextualMapper); var widenedType = getWidenedType(unwidenedType); if (fullTypeCheck && compilerOptions.noImplicitAny && !contextualSignature && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { @@ -13632,7 +14128,7 @@ var ts; if (fullTypeCheck && compilerOptions.noImplicitAny && !contextualSignature && widenedType !== commonType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { var typeName = typeToString(widenedType); if (func.name) { - error(func, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.identifierToString(func.name), typeName); + error(func, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.declarationNameToString(func.name), typeName); } else { error(func, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); @@ -13661,7 +14157,7 @@ var ts; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 175 /* ThrowStatement */); + return (body.statements.length === 1) && (body.statements[0].kind === 178 /* ThrowStatement */); } function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { if (!fullTypeCheck) { @@ -13670,7 +14166,7 @@ var ts; if (returnType === voidType || returnType === anyType) { return; } - if (!func.body || func.body.kind !== 183 /* FunctionBlock */) { + if (!func.body || func.body.kind !== 186 /* FunctionBlock */) { return; } var bodyBlock = func.body; @@ -13714,7 +14210,7 @@ var ts; if (node.type) { checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } - if (node.body.kind === 183 /* FunctionBlock */) { + if (node.body.kind === 186 /* FunctionBlock */) { checkSourceElement(node.body); } else { @@ -13742,12 +14238,12 @@ var ts; case 63 /* Identifier */: var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3 /* Variable */) !== 0; - case 142 /* PropertyAccess */: + case 145 /* PropertyAccess */: var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || (symbol.flags & ~8 /* EnumMember */) !== 0; - case 143 /* IndexedAccess */: + case 146 /* IndexedAccess */: return true; - case 148 /* ParenExpression */: + case 151 /* ParenExpression */: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -13756,10 +14252,10 @@ var ts; function isConstVariableReference(n) { switch (n.kind) { case 63 /* Identifier */: - case 142 /* PropertyAccess */: + case 145 /* PropertyAccess */: var symbol = findSymbol(n); return symbol && (symbol.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 4096 /* Const */) !== 0; - case 143 /* IndexedAccess */: + case 146 /* IndexedAccess */: var index = n.index; var symbol = findSymbol(n.object); if (symbol && index.kind === 7 /* StringLiteral */) { @@ -13768,7 +14264,7 @@ var ts; return prop && (prop.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 4096 /* Const */) !== 0; } return false; - case 148 /* ParenExpression */: + case 151 /* ParenExpression */: return isConstVariableReference(n.expression); default: return false; @@ -14003,7 +14499,7 @@ var ts; } } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 142 /* PropertyAccess */ && node.parent.left === node) || (node.parent.kind === 143 /* IndexedAccess */ && node.parent.object === node) || ((node.kind === 63 /* Identifier */ || node.kind === 121 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 145 /* PropertyAccess */ && node.parent.left === node) || (node.parent.kind === 146 /* IndexedAccess */ && node.parent.object === node) || ((node.kind === 63 /* Identifier */ || node.kind === 121 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(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); } @@ -14025,7 +14521,7 @@ var ts; return booleanType; case 6 /* NumericLiteral */: return numberType; - case 155 /* TemplateExpression */: + case 158 /* TemplateExpression */: return checkTemplateExpression(node); case 7 /* StringLiteral */: case 9 /* NoSubstitutionTemplateLiteral */: @@ -14034,35 +14530,35 @@ var ts; return globalRegExpType; case 121 /* QualifiedName */: return checkPropertyAccess(node); - case 139 /* ArrayLiteral */: + case 141 /* ArrayLiteral */: return checkArrayLiteral(node, contextualMapper); - case 140 /* ObjectLiteral */: + case 142 /* ObjectLiteral */: return checkObjectLiteral(node, contextualMapper); - case 142 /* PropertyAccess */: + case 145 /* PropertyAccess */: return checkPropertyAccess(node); - case 143 /* IndexedAccess */: + case 146 /* IndexedAccess */: return checkIndexedAccess(node); - case 144 /* CallExpression */: - case 145 /* NewExpression */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: return checkCallExpression(node); - case 146 /* TaggedTemplateExpression */: + case 149 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 147 /* TypeAssertion */: + case 150 /* TypeAssertion */: return checkTypeAssertion(node); - case 148 /* ParenExpression */: + case 151 /* ParenExpression */: return checkExpression(node.expression); - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: return checkFunctionExpression(node, contextualMapper); - case 151 /* PrefixOperator */: + case 154 /* PrefixOperator */: return checkPrefixExpression(node); - case 152 /* PostfixOperator */: + case 155 /* PostfixOperator */: return checkPostfixExpression(node); - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: return checkBinaryExpression(node, contextualMapper); - case 154 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return checkConditionalExpression(node, contextualMapper); - case 157 /* OmittedExpression */: + case 160 /* OmittedExpression */: return undefinedType; } return unknownType; @@ -14098,7 +14594,7 @@ var ts; if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, 107455 /* Value */) === referencedSymbol) { if (referencedSymbol.valueDeclaration.kind === 123 /* Parameter */) { if (referencedSymbol.valueDeclaration === parameterDeclaration) { - error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.identifierToString(parameterDeclaration.name)); + error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(parameterDeclaration.name)); return; } var enclosingOrReferencedParameter = ts.forEach(parameterDeclaration.parent.parameters, function (p) { return p === parameterDeclaration || p === referencedSymbol.valueDeclaration ? p : undefined; }); @@ -14106,7 +14602,7 @@ var ts; return; } } - error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.identifierToString(parameterDeclaration.name), ts.identifierToString(n)); + error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.declarationNameToString(parameterDeclaration.name), ts.declarationNameToString(n)); } } else { @@ -14142,7 +14638,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 185 /* InterfaceDeclaration */) { + if (node.kind === 188 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -14198,17 +14694,17 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 144 /* CallExpression */ && n.func.kind === 89 /* SuperKeyword */; + return n.kind === 147 /* CallExpression */ && n.func.kind === 89 /* SuperKeyword */; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 149 /* FunctionExpression */: - case 182 /* FunctionDeclaration */: - case 150 /* ArrowFunction */: - case 140 /* ObjectLiteral */: return false; + case 152 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + case 153 /* ArrowFunction */: + case 142 /* ObjectLiteral */: return false; default: return ts.forEachChild(n, containsSuperCall); } } @@ -14216,7 +14712,7 @@ var ts; if (n.kind === 91 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 149 /* FunctionExpression */ && n.kind !== 182 /* FunctionDeclaration */) { + else if (n.kind !== 152 /* FunctionExpression */ && n.kind !== 185 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } @@ -14228,7 +14724,7 @@ var ts; var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */); }); if (superCallShouldBeFirst) { var statements = node.body.statements; - if (!statements.length || statements[0].kind !== 161 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 164 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); } else { @@ -14286,7 +14782,7 @@ var ts; function checkTypeLiteral(node) { ts.forEach(node.members, checkSourceElement); if (fullTypeCheck) { - var type = getTypeFromTypeLiteralNode(node); + var type = getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); checkIndexConstraints(type); checkTypeForDuplicateIndexSignatures(node); } @@ -14315,9 +14811,8 @@ var ts; error(signatureDeclarationNode, ts.Diagnostics.A_signature_with_an_implementation_cannot_use_a_string_literal_type); return; } - var symbol = getSymbolOfNode(signatureDeclarationNode); var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 185 /* InterfaceDeclaration */) { + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 188 /* InterfaceDeclaration */) { ts.Debug.assert(signatureDeclarationNode.kind === 129 /* CallSignature */ || signatureDeclarationNode.kind === 130 /* ConstructSignature */); var signatureKind = signatureDeclarationNode.kind === 129 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); @@ -14337,7 +14832,7 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = n.flags; - if (n.parent.kind !== 185 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { + if (n.parent.kind !== 188 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { if (!(flags & 2 /* Ambient */)) { flags |= 1 /* Export */; } @@ -14404,7 +14899,7 @@ var ts; return; } else if (subsequentNode.body) { - error(errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.identifierToString(node.name)); + error(errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); return; } } @@ -14423,11 +14918,11 @@ var ts; for (var i = 0; i < declarations.length; i++) { var node = declarations[i]; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 185 /* InterfaceDeclaration */ || node.parent.kind === 134 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 188 /* InterfaceDeclaration */ || node.parent.kind === 136 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 182 /* FunctionDeclaration */ || node.kind === 125 /* Method */ || node.kind === 126 /* Constructor */) { + if (node.kind === 185 /* FunctionDeclaration */ || node.kind === 125 /* Method */ || node.kind === 126 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -14515,20 +15010,20 @@ var ts; if (commonDeclarationSpace) { ts.forEach(symbol.declarations, function (d) { if (getDeclarationSpaces(d) & commonDeclarationSpace) { - error(d.name, ts.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts.identifierToString(d.name)); + error(d.name, ts.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts.declarationNameToString(d.name)); } }); } function getDeclarationSpaces(d) { switch (d.kind) { - case 185 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: return 8388608 /* ExportType */; - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return d.name.kind === 7 /* StringLiteral */ || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 16777216 /* ExportNamespace */ | 4194304 /* ExportValue */ : 16777216 /* ExportNamespace */; - case 184 /* ClassDeclaration */: - case 187 /* EnumDeclaration */: + case 187 /* ClassDeclaration */: + case 190 /* EnumDeclaration */: return 8388608 /* ExportType */ | 4194304 /* ExportValue */; - case 190 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: var result = 0; var target = resolveImport(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { @@ -14561,7 +15056,7 @@ var ts; if (!isPrivateWithinAmbient(node)) { var typeName = typeToString(anyType); if (node.name) { - error(node, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.identifierToString(node.name), typeName); + error(node, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.declarationNameToString(node.name), typeName); } else { error(node, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); @@ -14603,10 +15098,10 @@ var ts; return; } switch (current.kind) { - case 182 /* FunctionDeclaration */: - case 149 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: case 125 /* Method */: - case 150 /* ArrowFunction */: + case 153 /* ArrowFunction */: case 126 /* Constructor */: if (ts.hasRestParameters(current)) { error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter); @@ -14658,7 +15153,7 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } - var enclosingClass = ts.getAncestor(node, 184 /* ClassDeclaration */); + var enclosingClass = ts.getAncestor(node, 187 /* ClassDeclaration */); if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; } @@ -14676,12 +15171,12 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 188 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + if (node.kind === 191 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return; } - var parent = node.kind === 181 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (parent.kind === 193 /* SourceFile */ && ts.isExternalModule(parent)) { - error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, name.text, name.text); + var parent = node.kind === 184 /* VariableDeclaration */ ? node.parent.parent : node.parent; + if (parent.kind === 196 /* SourceFile */ && ts.isExternalModule(parent)) { + error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } function checkCollisionWithConstDeclarations(node) { @@ -14709,7 +15204,7 @@ var ts; type = typeOfValueDeclaration; } else { - type = getTypeOfVariableDeclaration(node); + type = getTypeOfVariableOrPropertyDeclaration(node); } if (node.initializer) { if (!(getNodeLinks(node.initializer).flags & 1 /* TypeChecked */)) { @@ -14722,7 +15217,7 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); if (!useTypeFromValueDeclaration) { if (typeOfValueDeclaration !== unknownType && type !== unknownType && !isTypeIdenticalTo(typeOfValueDeclaration, type)) { - error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.identifierToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); + error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.declarationNameToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); } } } @@ -14758,10 +15253,13 @@ var ts; checkSourceElement(node.statement); } function checkForInStatement(node) { - if (node.declaration) { - checkVariableDeclaration(node.declaration); - if (node.declaration.type) { - error(node.declaration, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation); + if (node.declarations) { + if (node.declarations.length >= 1) { + var decl = node.declarations[0]; + checkVariableDeclaration(decl); + if (decl.type) { + error(decl, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation); + } } } if (node.variable) { @@ -14899,7 +15397,7 @@ var ts; if (fullTypeCheck) { for (var j = 0; j < i; j++) { if (typeParameterDeclarations[j].symbol === node.symbol) { - error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.identifierToString(node.name)); + error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.declarationNameToString(node.name)); } } } @@ -15068,7 +15566,7 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = getDeclarationOfKind(symbol, 185 /* InterfaceDeclaration */); + var firstInterfaceDecl = getDeclarationOfKind(symbol, 188 /* InterfaceDeclaration */); if (symbol.declarations.length > 1) { if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); @@ -15139,7 +15637,7 @@ var ts; return evalConstant(initializer); function evalConstant(e) { switch (e.kind) { - case 151 /* PrefixOperator */: + case 154 /* PrefixOperator */: var value = evalConstant(e.operand); if (value === undefined) { return undefined; @@ -15150,7 +15648,7 @@ var ts; case 46 /* TildeToken */: return enumIsConst ? ~value : undefined; } return undefined; - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: if (!enumIsConst) { return undefined; } @@ -15178,11 +15676,11 @@ var ts; return undefined; case 6 /* NumericLiteral */: return +e.text; - case 148 /* ParenExpression */: + case 151 /* ParenExpression */: return enumIsConst ? evalConstant(e.expression) : undefined; case 63 /* Identifier */: - case 143 /* IndexedAccess */: - case 142 /* PropertyAccess */: + case 146 /* IndexedAccess */: + case 145 /* PropertyAccess */: if (!enumIsConst) { return undefined; } @@ -15195,7 +15693,7 @@ var ts; propertyName = e.text; } else { - if (e.kind === 143 /* IndexedAccess */) { + if (e.kind === 146 /* IndexedAccess */) { if (e.index.kind !== 7 /* StringLiteral */) { return undefined; } @@ -15251,7 +15749,7 @@ var ts; } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 187 /* EnumDeclaration */) { + if (declaration.kind !== 190 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -15274,7 +15772,7 @@ var ts; var declarations = symbol.declarations; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; - if ((declaration.kind === 184 /* ClassDeclaration */ || (declaration.kind === 182 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { + if ((declaration.kind === 187 /* ClassDeclaration */ || (declaration.kind === 185 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { return declaration; } } @@ -15328,7 +15826,7 @@ var ts; checkExpression(node.entityName); } else { - error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.identifierToString(moduleName)); + error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.declarationNameToString(moduleName)); } } if (target.flags & 3152352 /* Type */) { @@ -15337,10 +15835,10 @@ var ts; } } else { - if (node.parent.kind === 193 /* SourceFile */) { + if (node.parent.kind === 196 /* SourceFile */) { target = resolveImport(symbol); } - else if (node.parent.kind === 189 /* ModuleBlock */ && node.parent.parent.name.kind === 7 /* StringLiteral */) { + else if (node.parent.kind === 192 /* ModuleBlock */ && node.parent.parent.name.kind === 7 /* StringLiteral */) { if (isExternalModuleNameRelative(node.externalModuleName.text)) { error(node, ts.Diagnostics.Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); target = unknownSymbol; @@ -15362,7 +15860,7 @@ var ts; } function checkExportAssignment(node) { var container = node.parent; - if (container.kind !== 193 /* SourceFile */) { + if (container.kind !== 196 /* SourceFile */) { container = container.parent; } checkTypeOfExportAssignmentSymbol(getSymbolOfNode(container)); @@ -15377,6 +15875,8 @@ var ts; return checkParameter(node); case 124 /* Property */: return checkPropertyDeclaration(node); + case 133 /* FunctionType */: + case 134 /* ConstructorType */: case 129 /* CallSignature */: case 130 /* ConstructSignature */: case 131 /* IndexSignature */: @@ -15390,76 +15890,76 @@ var ts; return checkAccessorDeclaration(node); case 132 /* TypeReference */: return checkTypeReference(node); - case 133 /* TypeQuery */: + case 135 /* TypeQuery */: return checkTypeQuery(node); - case 134 /* TypeLiteral */: + case 136 /* TypeLiteral */: return checkTypeLiteral(node); - case 135 /* ArrayType */: + case 137 /* ArrayType */: return checkArrayType(node); - case 136 /* TupleType */: + case 138 /* TupleType */: return checkTupleType(node); - case 137 /* UnionType */: + case 139 /* UnionType */: return checkUnionType(node); - case 138 /* ParenType */: + case 140 /* ParenType */: return checkSourceElement(node.type); - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 158 /* Block */: + case 161 /* Block */: return checkBlock(node); - case 183 /* FunctionBlock */: - case 189 /* ModuleBlock */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: return checkBody(node); - case 159 /* VariableStatement */: + case 162 /* VariableStatement */: return checkVariableStatement(node); - case 161 /* ExpressionStatement */: + case 164 /* ExpressionStatement */: return checkExpressionStatement(node); - case 162 /* IfStatement */: + case 165 /* IfStatement */: return checkIfStatement(node); - case 163 /* DoStatement */: + case 166 /* DoStatement */: return checkDoStatement(node); - case 164 /* WhileStatement */: + case 167 /* WhileStatement */: return checkWhileStatement(node); - case 165 /* ForStatement */: + case 168 /* ForStatement */: return checkForStatement(node); - case 166 /* ForInStatement */: + case 169 /* ForInStatement */: return checkForInStatement(node); - case 167 /* ContinueStatement */: - case 168 /* BreakStatement */: + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 169 /* ReturnStatement */: + case 172 /* ReturnStatement */: return checkReturnStatement(node); - case 170 /* WithStatement */: + case 173 /* WithStatement */: return checkWithStatement(node); - case 171 /* SwitchStatement */: + case 174 /* SwitchStatement */: return checkSwitchStatement(node); - case 174 /* LabeledStatement */: + case 177 /* LabeledStatement */: return checkLabeledStatement(node); - case 175 /* ThrowStatement */: + case 178 /* ThrowStatement */: return checkThrowStatement(node); - case 176 /* TryStatement */: + case 179 /* TryStatement */: return checkTryStatement(node); - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: return ts.Debug.fail("Checker encountered variable declaration"); - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: return checkClassDeclaration(node); - case 185 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 186 /* TypeAliasDeclaration */: + case 189 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 190 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: return checkImportDeclaration(node); - case 191 /* ExportAssignment */: + case 194 /* ExportAssignment */: return checkExportAssignment(node); } } function checkFunctionExpressionBodies(node) { switch (node.kind) { - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: ts.forEach(node.parameters, checkFunctionExpressionBodies); checkFunctionExpressionBody(node); break; @@ -15467,55 +15967,55 @@ var ts; case 126 /* Constructor */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: ts.forEach(node.parameters, checkFunctionExpressionBodies); break; - case 170 /* WithStatement */: + case 173 /* WithStatement */: checkFunctionExpressionBodies(node.expression); break; case 123 /* Parameter */: case 124 /* Property */: - case 139 /* ArrayLiteral */: - case 140 /* ObjectLiteral */: - case 141 /* PropertyAssignment */: - case 142 /* PropertyAccess */: - case 143 /* IndexedAccess */: - case 144 /* CallExpression */: - case 145 /* NewExpression */: - case 146 /* TaggedTemplateExpression */: - case 147 /* TypeAssertion */: - case 148 /* ParenExpression */: - case 151 /* PrefixOperator */: - case 152 /* PostfixOperator */: - case 153 /* BinaryExpression */: - case 154 /* ConditionalExpression */: - case 158 /* Block */: - case 183 /* FunctionBlock */: - case 189 /* ModuleBlock */: - case 159 /* VariableStatement */: - case 161 /* ExpressionStatement */: - case 162 /* IfStatement */: - case 163 /* DoStatement */: - case 164 /* WhileStatement */: - case 165 /* ForStatement */: - case 166 /* ForInStatement */: - case 167 /* ContinueStatement */: - case 168 /* BreakStatement */: - case 169 /* ReturnStatement */: - case 171 /* SwitchStatement */: - case 172 /* CaseClause */: - case 173 /* DefaultClause */: - case 174 /* LabeledStatement */: - case 175 /* ThrowStatement */: - case 176 /* TryStatement */: - case 177 /* TryBlock */: - case 178 /* CatchBlock */: - case 179 /* FinallyBlock */: - case 181 /* VariableDeclaration */: - case 184 /* ClassDeclaration */: - case 187 /* EnumDeclaration */: - case 192 /* EnumMember */: - case 193 /* SourceFile */: + case 141 /* ArrayLiteral */: + case 142 /* ObjectLiteral */: + case 143 /* PropertyAssignment */: + case 145 /* PropertyAccess */: + case 146 /* IndexedAccess */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: + case 149 /* TaggedTemplateExpression */: + case 150 /* TypeAssertion */: + case 151 /* ParenExpression */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: + case 156 /* BinaryExpression */: + case 157 /* ConditionalExpression */: + case 161 /* Block */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: + case 162 /* VariableStatement */: + case 164 /* ExpressionStatement */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: + case 172 /* ReturnStatement */: + case 174 /* SwitchStatement */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: + case 177 /* LabeledStatement */: + case 178 /* ThrowStatement */: + case 179 /* TryStatement */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 184 /* VariableDeclaration */: + case 187 /* ClassDeclaration */: + case 190 /* EnumDeclaration */: + case 195 /* EnumMember */: + case 196 /* SourceFile */: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -15586,7 +16086,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 170 /* WithStatement */ && node.parent.statement === node) { + if (node.parent.kind === 173 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; @@ -15622,27 +16122,27 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 193 /* SourceFile */: + case 196 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 35653619 /* ModuleMember */); break; - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: if (!(memberFlags & 128 /* Static */)) { copySymbols(getSymbolOfNode(location).members, meaning & 3152352 /* Type */); } break; - case 149 /* FunctionExpression */: + case 152 /* FunctionExpression */: if (location.name) { copySymbol(location.symbol, meaning); } break; - case 178 /* CatchBlock */: + case 181 /* CatchBlock */: if (location.variable.text) { copySymbol(location.symbol, meaning); } @@ -15660,10 +16160,10 @@ var ts; function isTypeDeclaration(node) { switch (node.kind) { case 122 /* TypeParameter */: - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: - case 186 /* TypeAliasDeclaration */: - case 187 /* EnumDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 190 /* EnumDeclaration */: return true; } } @@ -15674,7 +16174,7 @@ var ts; return node.parent && node.parent.kind === 132 /* TypeReference */; } function isTypeNode(node) { - if (132 /* FirstTypeNode */ <= node.kind && node.kind <= 138 /* LastTypeNode */) { + if (132 /* FirstTypeNode */ <= node.kind && node.kind <= 140 /* LastTypeNode */) { return true; } switch (node.kind) { @@ -15684,20 +16184,20 @@ var ts; case 110 /* BooleanKeyword */: return true; case 97 /* VoidKeyword */: - return node.parent.kind !== 151 /* PrefixOperator */; + return node.parent.kind !== 154 /* PrefixOperator */; case 7 /* StringLiteral */: return node.parent.kind === 123 /* Parameter */; case 63 /* Identifier */: - if (node.parent.kind === 121 /* QualifiedName */) { + if (node.parent.kind === 121 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } case 121 /* QualifiedName */: ts.Debug.assert(node.kind === 63 /* Identifier */ || node.kind === 121 /* QualifiedName */, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); var parent = node.parent; - if (parent.kind === 133 /* TypeQuery */) { + if (parent.kind === 135 /* TypeQuery */) { return false; } - if (132 /* FirstTypeNode */ <= parent.kind && parent.kind <= 138 /* LastTypeNode */) { + if (132 /* FirstTypeNode */ <= parent.kind && parent.kind <= 140 /* LastTypeNode */) { return true; } switch (parent.kind) { @@ -15705,11 +16205,11 @@ var ts; return node === parent.constraint; case 124 /* Property */: case 123 /* Parameter */: - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: return node === parent.type; - case 182 /* FunctionDeclaration */: - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: case 126 /* Constructor */: case 125 /* Method */: case 127 /* GetAccessor */: @@ -15719,12 +16219,12 @@ var ts; case 130 /* ConstructSignature */: case 131 /* IndexSignature */: return node === parent.type; - case 147 /* TypeAssertion */: + case 150 /* TypeAssertion */: return node === parent.type; - case 144 /* CallExpression */: - case 145 /* NewExpression */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: return parent.typeArguments && parent.typeArguments.indexOf(node) >= 0; - case 146 /* TaggedTemplateExpression */: + case 149 /* TaggedTemplateExpression */: return false; } } @@ -15734,22 +16234,22 @@ var ts; while (node.parent.kind === 121 /* QualifiedName */) { node = node.parent; } - if (node.parent.kind === 190 /* ImportDeclaration */) { + if (node.parent.kind === 193 /* ImportDeclaration */) { return node.parent.entityName === node; } - if (node.parent.kind === 191 /* ExportAssignment */) { + if (node.parent.kind === 194 /* ExportAssignment */) { return node.parent.exportName === node; } return false; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 121 /* QualifiedName */ || node.parent.kind === 142 /* PropertyAccess */) && node.parent.right === node; + return (node.parent.kind === 121 /* QualifiedName */ || node.parent.kind === 145 /* PropertyAccess */) && node.parent.right === node; } function getSymbolOfEntityName(entityName) { if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 191 /* ExportAssignment */) { + if (entityName.parent.kind === 194 /* ExportAssignment */) { return resolveEntityName(entityName.parent.parent, entityName, 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */ | 33554432 /* Import */); } if (isInRightSideOfImportOrExportAssignment(entityName)) { @@ -15763,7 +16263,7 @@ var ts; var meaning = 107455 /* Value */ | 33554432 /* Import */; return resolveEntityName(entityName, entityName, meaning); } - else if (entityName.kind === 121 /* QualifiedName */ || entityName.kind === 142 /* PropertyAccess */) { + else if (entityName.kind === 121 /* QualifiedName */ || entityName.kind === 145 /* PropertyAccess */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccess(entityName); @@ -15789,11 +16289,11 @@ var ts; return getSymbolOfNode(node.parent); } if (node.kind === 63 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 191 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); + return node.parent.kind === 194 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); } switch (node.kind) { case 63 /* Identifier */: - case 142 /* PropertyAccess */: + case 145 /* PropertyAccess */: case 121 /* QualifiedName */: return getSymbolOfEntityName(node); case 91 /* ThisKeyword */: @@ -15807,13 +16307,13 @@ var ts; } return undefined; case 7 /* StringLiteral */: - if (node.parent.kind === 190 /* ImportDeclaration */ && node.parent.externalModuleName === node) { + if (node.parent.kind === 193 /* ImportDeclaration */ && node.parent.externalModuleName === node) { var importSymbol = getSymbolOfNode(node.parent); var moduleType = getTypeOfSymbol(importSymbol); return moduleType ? moduleType.symbol : undefined; } case 6 /* NumericLiteral */: - if (node.parent.kind == 143 /* IndexedAccess */ && node.parent.index === node) { + if (node.parent.kind == 146 /* IndexedAccess */ && node.parent.index === node) { var objectType = checkExpression(node.parent.object); if (objectType === unknownType) return undefined; @@ -15826,6 +16326,12 @@ var ts; } return undefined; } + function getShorthandAssignmentValueSymbol(location) { + if (location && location.kind === 144 /* ShorthandPropertyAssignment */) { + return resolveEntityName(location, location.name, 107455 /* Value */); + } + return undefined; + } function getTypeOfNode(node) { if (isInsideWithStatementBody(node)) { return unknownType; @@ -15895,7 +16401,7 @@ var ts; return [symbol]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 512 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 193 /* SourceFile */; + return symbol.flags & 512 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 196 /* SourceFile */; } function isNodeDescendentOf(node, ancestor) { while (node) { @@ -15928,7 +16434,7 @@ var ts; function getLocalNameForSymbol(symbol, location) { var node = location; while (node) { - if ((node.kind === 188 /* ModuleDeclaration */ || node.kind === 187 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { + if ((node.kind === 191 /* ModuleDeclaration */ || node.kind === 190 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { return getLocalNameOfContainer(node); } node = node.parent; @@ -15952,15 +16458,17 @@ var ts; return symbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol) ? symbolToString(symbol) : undefined; } function isTopLevelValueImportWithEntityName(node) { - if (node.parent.kind !== 193 /* SourceFile */ || !node.entityName) { + if (node.parent.kind !== 196 /* SourceFile */ || !node.entityName) { return false; } - var symbol = getSymbolOfNode(node); return isImportResolvedToValue(getSymbolOfNode(node)); } function hasSemanticErrors() { return getDiagnostics().length > 0 || getGlobalDiagnostics().length > 0; } + function isEmitBlocked(sourceFile) { + return program.getDiagnostics(sourceFile).length !== 0 || hasEarlyErrors(sourceFile) || (compilerOptions.noEmitOnError && getDiagnostics(sourceFile).length !== 0); + } function hasEarlyErrors(sourceFile) { return ts.forEach(getDiagnostics(sourceFile), function (d) { return d.isEarly; }); } @@ -16001,7 +16509,7 @@ var ts; if (symbol && (symbol.flags & 8 /* EnumMember */)) { var declaration = symbol.valueDeclaration; var constantValue; - if (declaration.kind === 192 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { + if (declaration.kind === 195 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { return constantValue; } } @@ -16009,7 +16517,7 @@ var ts; } function writeTypeAtLocation(location, enclosingDeclaration, flags, writer) { var symbol = getSymbolOfNode(location); - var type = symbol && !(symbol.flags & 2048 /* TypeLiteral */) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); + var type = symbol && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* CallSignature */ | 262144 /* ConstructSignature */)) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { @@ -16027,7 +16535,7 @@ var ts; getEnumMemberValue: getEnumMemberValue, isTopLevelValueImportWithEntityName: isTopLevelValueImportWithEntityName, hasSemanticErrors: hasSemanticErrors, - hasEarlyErrors: hasEarlyErrors, + isEmitBlocked: isEmitBlocked, isDeclarationVisible: isDeclarationVisible, isImplementationOfOverload: isImplementationOfOverload, writeTypeAtLocation: writeTypeAtLocation, @@ -16042,7 +16550,7 @@ var ts; function initializeTypeChecker() { ts.forEach(program.getSourceFiles(), function (file) { ts.bindSourceFile(file); - ts.forEach(file.semanticErrors, addDiagnostic); + ts.forEach(file.semanticDiagnostics, addDiagnostic); }); ts.forEach(program.getSourceFiles(), function (file) { if (!ts.isExternalModule(file)) { @@ -16061,6 +16569,7 @@ var ts; globalNumberType = getGlobalType("Number"); globalBooleanType = getGlobalType("Boolean"); globalRegExpType = getGlobalType("RegExp"); + globalTemplateStringsArrayType = compilerOptions.target >= 2 /* ES6 */ ? getGlobalType("TemplateStringsArray") : unknownType; } initializeTypeChecker(); return checker; @@ -16119,6 +16628,11 @@ var ts; paramType: ts.Diagnostics.KIND, error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_or_amd }, + { + name: "noEmitOnError", + type: "boolean", + description: ts.Diagnostics.Do_not_emit_outputs_if_any_type_checking_errors_were_reported + }, { name: "noImplicitAny", type: "boolean", @@ -16559,17 +17073,17 @@ var ts; var checker = program.getTypeChecker(true); var checkStart = new Date().getTime(); errors = checker.getDiagnostics(); - if (!checker.hasEarlyErrors()) { + if (checker.isEmitBlocked()) { + exitStatus = 1 /* AllOutputGenerationSkipped */; + } + else { var emitStart = new Date().getTime(); - var emitOutput = checker.emitFiles(); - var emitErrors = emitOutput.errors; + var emitOutput = checker.invokeEmitter(); + var emitErrors = emitOutput.diagnostics; exitStatus = emitOutput.emitResultStatus; var reportStart = new Date().getTime(); errors = ts.concatenate(errors, emitErrors); } - else { - exitStatus = 1 /* AllOutputGenerationSkipped */; - } } reportDiagnostics(errors); if (commandLine.options.diagnostics) { diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js index ea97ea9ea75..367a79bd47a 100644 --- a/bin/typescriptServices.js +++ b/bin/typescriptServices.js @@ -13,1421 +13,6 @@ See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -var ts; -(function (ts) { - ts.Diagnostics = { - Unterminated_string_literal: { code: 1002, category: 1 /* Error */, key: "Unterminated string literal." }, - Identifier_expected: { code: 1003, category: 1 /* Error */, key: "Identifier expected." }, - _0_expected: { code: 1005, category: 1 /* Error */, key: "'{0}' expected." }, - A_file_cannot_have_a_reference_to_itself: { code: 1006, category: 1 /* Error */, key: "A file cannot have a reference to itself." }, - Trailing_comma_not_allowed: { code: 1009, category: 1 /* Error */, key: "Trailing comma not allowed." }, - Asterisk_Slash_expected: { code: 1010, category: 1 /* Error */, key: "'*/' expected." }, - Unexpected_token: { code: 1012, category: 1 /* Error */, key: "Unexpected token." }, - Catch_clause_parameter_cannot_have_a_type_annotation: { code: 1013, category: 1 /* Error */, key: "Catch clause parameter cannot have a type annotation." }, - A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1 /* Error */, key: "A rest parameter must be last in a parameter list." }, - Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: 1 /* Error */, key: "Parameter cannot have question mark and initializer." }, - A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: 1 /* Error */, key: "A required parameter cannot follow an optional parameter." }, - An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: 1 /* Error */, key: "An index signature cannot have a rest parameter." }, - An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: 1 /* Error */, key: "An index signature parameter cannot have an accessibility modifier." }, - An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: 1 /* Error */, key: "An index signature parameter cannot have a question mark." }, - An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: 1 /* Error */, key: "An index signature parameter cannot have an initializer." }, - An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1 /* Error */, key: "An index signature must have a type annotation." }, - An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1 /* Error */, key: "An index signature parameter must have a type annotation." }, - An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1 /* Error */, key: "An index signature parameter type must be 'string' or 'number'." }, - A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: 1 /* Error */, key: "A class or interface declaration can only have one 'extends' clause." }, - An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: 1 /* Error */, key: "An 'extends' clause must precede an 'implements' clause." }, - A_class_can_only_extend_a_single_class: { code: 1026, category: 1 /* Error */, key: "A class can only extend a single class." }, - A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: 1 /* Error */, key: "A class declaration can only have one 'implements' clause." }, - Accessibility_modifier_already_seen: { code: 1028, category: 1 /* Error */, key: "Accessibility modifier already seen." }, - _0_modifier_must_precede_1_modifier: { code: 1029, category: 1 /* Error */, key: "'{0}' modifier must precede '{1}' modifier." }, - _0_modifier_already_seen: { code: 1030, category: 1 /* Error */, key: "'{0}' modifier already seen." }, - _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a class element." }, - An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: 1 /* Error */, key: "An interface declaration cannot have an 'implements' clause." }, - super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: 1 /* Error */, key: "'super' must be followed by an argument list or member access." }, - Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1 /* Error */, key: "Only ambient modules can use quoted names." }, - Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1 /* Error */, key: "Statements are not allowed in ambient contexts." }, - A_function_implementation_cannot_be_declared_in_an_ambient_context: { code: 1037, category: 1 /* Error */, key: "A function implementation cannot be declared in an ambient context." }, - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: 1 /* Error */, key: "A 'declare' modifier cannot be used in an already ambient context." }, - Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: 1 /* Error */, key: "Initializers are not allowed in ambient contexts." }, - _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a module element." }, - A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an interface declaration." }, - A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: 1 /* Error */, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, - A_rest_parameter_cannot_be_optional: { code: 1047, category: 1 /* Error */, key: "A rest parameter cannot be optional." }, - A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: 1 /* Error */, key: "A rest parameter cannot have an initializer." }, - A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: 1 /* Error */, key: "A 'set' accessor must have exactly one parameter." }, - A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: 1 /* Error */, key: "A 'set' accessor cannot have an optional parameter." }, - A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1 /* Error */, key: "A 'set' accessor parameter cannot have an initializer." }, - A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1 /* Error */, key: "A 'set' accessor cannot have rest parameter." }, - A_get_accessor_cannot_have_parameters: { code: 1054, category: 1 /* Error */, key: "A 'get' accessor cannot have parameters." }, - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1 /* Error */, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, - Enum_member_must_have_initializer: { code: 1061, category: 1 /* Error */, key: "Enum member must have initializer." }, - An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1 /* Error */, key: "An export assignment cannot be used in an internal module." }, - Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1 /* Error */, key: "Ambient enum elements can only have integer literal initializers." }, - Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: 1 /* Error */, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, - A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an import declaration." }, - Invalid_reference_directive_syntax: { code: 1084, category: 1 /* Error */, key: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1 /* Error */, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, - An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: 1 /* Error */, key: "An accessor cannot be declared in an ambient context." }, - _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a constructor declaration." }, - _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a parameter." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: 1 /* Error */, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, - Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: 1 /* Error */, key: "Type parameters cannot appear on a constructor declaration." }, - Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: 1 /* Error */, key: "Type annotation cannot appear on a constructor declaration." }, - An_accessor_cannot_have_type_parameters: { code: 1094, category: 1 /* Error */, key: "An accessor cannot have type parameters." }, - A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: 1 /* Error */, key: "A 'set' accessor cannot have a return type annotation." }, - An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: 1 /* Error */, key: "An index signature must have exactly one parameter." }, - _0_list_cannot_be_empty: { code: 1097, category: 1 /* Error */, key: "'{0}' list cannot be empty." }, - Type_parameter_list_cannot_be_empty: { code: 1098, category: 1 /* Error */, key: "Type parameter list cannot be empty." }, - Type_argument_list_cannot_be_empty: { code: 1099, category: 1 /* Error */, key: "Type argument list cannot be empty." }, - Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1 /* Error */, key: "Invalid use of '{0}' in strict mode." }, - with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1 /* Error */, key: "'with' statements are not allowed in strict mode." }, - delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1 /* Error */, key: "'delete' cannot be called on an identifier in strict mode." }, - A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1 /* Error */, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, - A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1 /* Error */, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, - Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1 /* Error */, key: "Jump target cannot cross function boundary." }, - A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: 1 /* Error */, key: "A 'return' statement can only be used within a function body." }, - Expression_expected: { code: 1109, category: 1 /* Error */, key: "Expression expected." }, - Type_expected: { code: 1110, category: 1 /* Error */, key: "Type expected." }, - A_constructor_implementation_cannot_be_declared_in_an_ambient_context: { code: 1111, category: 1 /* Error */, key: "A constructor implementation cannot be declared in an ambient context." }, - A_class_member_cannot_be_declared_optional: { code: 1112, category: 1 /* Error */, key: "A class member cannot be declared optional." }, - A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: 1 /* Error */, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: 1 /* Error */, key: "Duplicate label '{0}'" }, - A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: 1 /* Error */, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, - A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: 1 /* Error */, key: "A 'break' statement can only jump to a label of an enclosing statement." }, - An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: 1 /* Error */, key: "An object literal cannot have multiple properties with the same name in strict mode." }, - An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: 1 /* Error */, key: "An object literal cannot have multiple get/set accessors with the same name." }, - An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: 1 /* Error */, key: "An object literal cannot have property and accessor with the same name." }, - An_export_assignment_cannot_have_modifiers: { code: 1120, category: 1 /* Error */, key: "An export assignment cannot have modifiers." }, - Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: 1 /* Error */, key: "Octal literals are not allowed in strict mode." }, - A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: 1 /* Error */, key: "A tuple type element list cannot be empty." }, - Variable_declaration_list_cannot_be_empty: { code: 1123, category: 1 /* Error */, key: "Variable declaration list cannot be empty." }, - Digit_expected: { code: 1124, category: 1 /* Error */, key: "Digit expected." }, - Hexadecimal_digit_expected: { code: 1125, category: 1 /* Error */, key: "Hexadecimal digit expected." }, - Unexpected_end_of_text: { code: 1126, category: 1 /* Error */, key: "Unexpected end of text." }, - Invalid_character: { code: 1127, category: 1 /* Error */, key: "Invalid character." }, - Declaration_or_statement_expected: { code: 1128, category: 1 /* Error */, key: "Declaration or statement expected." }, - Statement_expected: { code: 1129, category: 1 /* Error */, key: "Statement expected." }, - case_or_default_expected: { code: 1130, category: 1 /* Error */, key: "'case' or 'default' expected." }, - Property_or_signature_expected: { code: 1131, category: 1 /* Error */, key: "Property or signature expected." }, - Enum_member_expected: { code: 1132, category: 1 /* Error */, key: "Enum member expected." }, - Type_reference_expected: { code: 1133, category: 1 /* Error */, key: "Type reference expected." }, - Variable_declaration_expected: { code: 1134, category: 1 /* Error */, key: "Variable declaration expected." }, - Argument_expression_expected: { code: 1135, category: 1 /* Error */, key: "Argument expression expected." }, - Property_assignment_expected: { code: 1136, category: 1 /* Error */, key: "Property assignment expected." }, - Expression_or_comma_expected: { code: 1137, category: 1 /* Error */, key: "Expression or comma expected." }, - Parameter_declaration_expected: { code: 1138, category: 1 /* Error */, key: "Parameter declaration expected." }, - Type_parameter_declaration_expected: { code: 1139, category: 1 /* Error */, key: "Type parameter declaration expected." }, - Type_argument_expected: { code: 1140, category: 1 /* Error */, key: "Type argument expected." }, - String_literal_expected: { code: 1141, category: 1 /* Error */, key: "String literal expected." }, - Line_break_not_permitted_here: { code: 1142, category: 1 /* Error */, key: "Line break not permitted here." }, - catch_or_finally_expected: { code: 1143, category: 1 /* Error */, key: "'catch' or 'finally' expected." }, - Block_or_expected: { code: 1144, category: 1 /* Error */, key: "Block or ';' expected." }, - Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: 1 /* Error */, key: "Modifiers not permitted on index signature members." }, - Declaration_expected: { code: 1146, category: 1 /* Error */, key: "Declaration expected." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: 1 /* Error */, key: "Import declarations in an internal module cannot reference an external module." }, - Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: 1 /* Error */, key: "Cannot compile external modules unless the '--module' flag is provided." }, - Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: 1 /* Error */, key: "Filename '{0}' differs from already included filename '{1}' only in casing" }, - new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - var_let_or_const_expected: { code: 1152, category: 1 /* Error */, key: "'var', 'let' or 'const' expected." }, - let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: 1 /* Error */, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: 1 /* Error */, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_must_be_initialized: { code: 1155, category: 1 /* Error */, key: "'const' declarations must be initialized" }, - const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: 1 /* Error */, key: "'const' declarations can only be declared inside a block." }, - let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: 1 /* Error */, key: "'let' declarations can only be declared inside a block." }, - Invalid_template_literal_expected: { code: 1158, category: 1 /* Error */, key: "Invalid template literal; expected '}'" }, - Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1159, category: 1 /* Error */, key: "Tagged templates are only available when targeting ECMAScript 6 and higher." }, - Duplicate_identifier_0: { code: 2300, category: 1 /* Error */, key: "Duplicate identifier '{0}'." }, - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1 /* Error */, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, - Static_members_cannot_reference_class_type_parameters: { code: 2302, category: 1 /* Error */, key: "Static members cannot reference class type parameters." }, - Circular_definition_of_import_alias_0: { code: 2303, category: 1 /* Error */, key: "Circular definition of import alias '{0}'." }, - Cannot_find_name_0: { code: 2304, category: 1 /* Error */, key: "Cannot find name '{0}'." }, - Module_0_has_no_exported_member_1: { code: 2305, category: 1 /* Error */, key: "Module '{0}' has no exported member '{1}'." }, - File_0_is_not_an_external_module: { code: 2306, category: 1 /* Error */, key: "File '{0}' is not an external module." }, - Cannot_find_external_module_0: { code: 2307, category: 1 /* Error */, key: "Cannot find external module '{0}'." }, - A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: 1 /* Error */, key: "A module cannot have more than one export assignment." }, - An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: 1 /* Error */, key: "An export assignment cannot be used in a module with other exported elements." }, - Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: 1 /* Error */, key: "Type '{0}' recursively references itself as a base type." }, - A_class_may_only_extend_another_class: { code: 2311, category: 1 /* Error */, key: "A class may only extend another class." }, - An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: 1 /* Error */, key: "An interface may only extend a class or another interface." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: 1 /* Error */, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, - Generic_type_0_requires_1_type_argument_s: { code: 2314, category: 1 /* Error */, key: "Generic type '{0}' requires {1} type argument(s)." }, - Type_0_is_not_generic: { code: 2315, category: 1 /* Error */, key: "Type '{0}' is not generic." }, - Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: 1 /* Error */, key: "Global type '{0}' must be a class or interface type." }, - Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1 /* Error */, key: "Global type '{0}' must have {1} type parameter(s)." }, - Cannot_find_global_type_0: { code: 2318, category: 1 /* Error */, key: "Cannot find global type '{0}'." }, - Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1 /* Error */, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: 1 /* Error */, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, - Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1 /* Error */, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1: { code: 2323, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}'." }, - Property_0_is_missing_in_type_1: { code: 2324, category: 1 /* Error */, key: "Property '{0}' is missing in type '{1}'." }, - Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: 1 /* Error */, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, - Types_of_property_0_are_incompatible: { code: 2326, category: 1 /* Error */, key: "Types of property '{0}' are incompatible." }, - Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: 1 /* Error */, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, - Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible." }, - Index_signature_is_missing_in_type_0: { code: 2329, category: 1 /* Error */, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible: { code: 2330, category: 1 /* Error */, key: "Index signatures are incompatible." }, - this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1 /* Error */, key: "'this' cannot be referenced in a module body." }, - this_cannot_be_referenced_in_current_location: { code: 2332, category: 1 /* Error */, key: "'this' cannot be referenced in current location." }, - this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1 /* Error */, key: "'this' cannot be referenced in constructor arguments." }, - this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: 1 /* Error */, key: "'this' cannot be referenced in a static property initializer." }, - super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: 1 /* Error */, key: "'super' can only be referenced in a derived class." }, - super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: 1 /* Error */, key: "'super' cannot be referenced in constructor arguments." }, - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: 1 /* Error */, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: 1 /* Error */, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, - Property_0_does_not_exist_on_type_1: { code: 2339, category: 1 /* Error */, key: "Property '{0}' does not exist on type '{1}'." }, - Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1 /* Error */, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, - Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: 1 /* Error */, key: "Property '{0}' is private and only accessible within class '{1}'." }, - An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: 1 /* Error */, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}'." }, - Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1 /* Error */, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, - Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1 /* Error */, key: "Supplied parameters do not match any signature of call target." }, - Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: 1 /* Error */, key: "Untyped function calls may not accept type arguments." }, - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: 1 /* Error */, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: 1 /* Error */, key: "Cannot invoke an expression whose type lacks a call signature." }, - Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1 /* Error */, key: "Only a void function can be called with the 'new' keyword." }, - Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1 /* Error */, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1 /* Error */, key: "No best common type exists among return expressions." }, - A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1 /* Error */, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1 /* Error */, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: 1 /* Error */, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: 1 /* Error */, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: 1 /* Error */, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, - The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2360, category: 1 /* Error */, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: 1 /* Error */, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: 1 /* Error */, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: 1 /* Error */, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: 1 /* Error */, key: "Invalid left-hand side of assignment expression." }, - Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: 1 /* Error */, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: 1 /* Error */, key: "Type parameter name cannot be '{0}'" }, - A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: 1 /* Error */, key: "A parameter property is only allowed in a constructor implementation." }, - A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: 1 /* Error */, key: "A rest parameter must be of an array type." }, - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: 1 /* Error */, key: "A parameter initializer is only allowed in a function or constructor implementation." }, - Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: 1 /* Error */, key: "Parameter '{0}' cannot be referenced in its initializer." }, - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: 1 /* Error */, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, - Duplicate_string_index_signature: { code: 2374, category: 1 /* Error */, key: "Duplicate string index signature." }, - Duplicate_number_index_signature: { code: 2375, category: 1 /* Error */, key: "Duplicate number index signature." }, - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: 1 /* Error */, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, - Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: 1 /* Error */, key: "Constructors for derived classes must contain a 'super' call." }, - A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: 1 /* Error */, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, - Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: 1 /* Error */, key: "Getter and setter accessors do not agree in visibility." }, - get_and_set_accessor_must_have_the_same_type: { code: 2380, category: 1 /* Error */, key: "'get' and 'set' accessor must have the same type." }, - A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: 1 /* Error */, key: "A signature with an implementation cannot use a string literal type." }, - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: 1 /* Error */, key: "Specialized overload signature is not assignable to any non-specialized signature." }, - Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: 1 /* Error */, key: "Overload signatures must all be exported or not exported." }, - Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: 1 /* Error */, key: "Overload signatures must all be ambient or non-ambient." }, - Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: 1 /* Error */, key: "Overload signatures must all be public, private or protected." }, - Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: 1 /* Error */, key: "Overload signatures must all be optional or required." }, - Function_overload_must_be_static: { code: 2387, category: 1 /* Error */, key: "Function overload must be static." }, - Function_overload_must_not_be_static: { code: 2388, category: 1 /* Error */, key: "Function overload must not be static." }, - Function_implementation_name_must_be_0: { code: 2389, category: 1 /* Error */, key: "Function implementation name must be '{0}'." }, - Constructor_implementation_is_missing: { code: 2390, category: 1 /* Error */, key: "Constructor implementation is missing." }, - Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: 1 /* Error */, key: "Function implementation is missing or not immediately following the declaration." }, - Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: 1 /* Error */, key: "Multiple constructor implementations are not allowed." }, - Duplicate_function_implementation: { code: 2393, category: 1 /* Error */, key: "Duplicate function implementation." }, - Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: 1 /* Error */, key: "Overload signature is not compatible with function implementation." }, - Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: 1 /* Error */, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: 1 /* Error */, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, - Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: { code: 2397, category: 1 /* Error */, key: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter." }, - Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: { code: 2398, category: 1 /* Error */, key: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter." }, - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: 1 /* Error */, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: 1 /* Error */, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: 1 /* Error */, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: 1 /* Error */, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: 1 /* Error */, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, - The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, - The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, - Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: 1 /* Error */, key: "Invalid left-hand side in 'for...in' statement." }, - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: 1 /* Error */, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, - Setters_cannot_return_a_value: { code: 2408, category: 1 /* Error */, key: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: 1 /* Error */, key: "Return type of constructor signature must be assignable to the instance type of the class" }, - All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: 1 /* Error */, key: "All symbols within a 'with' block will be resolved to 'any'." }, - Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, - Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, - Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1 /* Error */, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: 1 /* Error */, key: "Class name cannot be '{0}'" }, - Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1 /* Error */, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, - Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}'." }, - A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1 /* Error */, key: "A class may only implement another class or interface." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: 1 /* Error */, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1 /* Error */, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: 1 /* Error */, key: "Interface name cannot be '{0}'" }, - All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1 /* Error */, key: "All declarations of an interface must have identical type parameters." }, - Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: 1 /* Error */, key: "Enum name cannot be '{0}'" }, - In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: 1 /* Error */, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: 1 /* Error */, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, - A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: 1 /* Error */, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, - Ambient_external_modules_cannot_be_nested_in_other_modules: { code: 2435, category: 1 /* Error */, key: "Ambient external modules cannot be nested in other modules." }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: 1 /* Error */, key: "Ambient external module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: 1 /* Error */, key: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: 1 /* Error */, key: "Import name cannot be '{0}'" }, - Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: 1 /* Error */, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: 1 /* Error */, key: "Import declaration conflicts with local declaration of '{0}'" }, - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { code: 2441, category: 1 /* Error */, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, - Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: 1 /* Error */, key: "Types have separate declarations of a private property '{0}'." }, - Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: 1 /* Error */, key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, - Property_0_is_protected_in_type_1_but_public_in_type_2: { code: 2444, category: 1 /* Error */, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, - Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, - Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, - The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: 1 /* Error */, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, - Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: 1 /* Error */, key: "Block-scoped variable '{0}' used before its declaration.", isEarly: true }, - The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: 1 /* Error */, key: "The operand of an increment or decrement operator cannot be a constant.", isEarly: true }, - Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: 1 /* Error */, key: "Left-hand side of assignment expression cannot be a constant.", isEarly: true }, - Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: 1 /* Error */, key: "Cannot redeclare block-scoped variable '{0}'.", isEarly: true }, - An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: 1 /* Error */, key: "An enum member cannot have a numeric name." }, - The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: 1 /* Error */, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, - Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: 1 /* Error */, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, - Type_alias_0_circularly_references_itself: { code: 2456, category: 1 /* Error */, key: "Type alias '{0}' circularly references itself." }, - Type_alias_name_cannot_be_0: { code: 2457, category: 1 /* Error */, key: "Type alias name cannot be '{0}'" }, - Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1 /* Error */, key: "Import declaration '{0}' is using private name '{1}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4003, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4005, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4007, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4009, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4011, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4013, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4015, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4017, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4018, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2: { code: 4021, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, - Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, - Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, - Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: 1 /* Error */, key: "Exported variable '{0}' has or is using private name '{1}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, - Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, - Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using private name '{0}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: 1 /* Error */, key: "Return type of public method from exported class has or is using private name '{0}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: 1 /* Error */, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: 1 /* Error */, key: "Return type of method from exported interface has or is using private name '{0}'." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, - Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: 1 /* Error */, key: "Return type of exported function has or is using private name '{0}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, - Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4079, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, - Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2: { code: 4080, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from private module '{2}'." }, - Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using private name '{1}'." }, - Enum_declarations_must_all_be_const_or_non_const: { code: 4082, category: 1 /* Error */, key: "Enum declarations must all be const or non-const." }, - In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 4083, category: 1 /* Error */, key: "In 'const' enum declarations member initializer must be constant expression.", isEarly: true }, - const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 4084, category: 1 /* Error */, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, - Index_expression_arguments_in_const_enums_must_be_of_type_string: { code: 4085, category: 1 /* Error */, key: "Index expression arguments in 'const' enums must be of type 'string'." }, - const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 4086, category: 1 /* Error */, key: "'const' enum member initializer was evaluated to a non-finite value." }, - const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 4087, category: 1 /* Error */, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, - The_current_host_does_not_support_the_0_option: { code: 5001, category: 1 /* Error */, key: "The current host does not support the '{0}' option." }, - Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1 /* Error */, key: "Cannot find the common subdirectory path for the input files." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: 1 /* Error */, key: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: 1 /* Error */, key: "Unsupported file encoding." }, - Unknown_compiler_option_0: { code: 5023, category: 1 /* Error */, key: "Unknown compiler option '{0}'." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: 1 /* Error */, key: "Could not write file '{0}': {1}" }, - Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: 1 /* Error */, key: "Option mapRoot cannot be specified without specifying sourcemap option." }, - Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: 1 /* Error */, key: "Option sourceRoot cannot be specified without specifying sourcemap option." }, - Concatenate_and_emit_output_to_single_file: { code: 6001, category: 2 /* Message */, key: "Concatenate and emit output to single file." }, - Generates_corresponding_d_ts_file: { code: 6002, category: 2 /* Message */, key: "Generates corresponding '.d.ts' file." }, - Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: 2 /* Message */, key: "Specifies the location where debugger should locate map files instead of generated locations." }, - Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: 2 /* Message */, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, - Watch_input_files: { code: 6005, category: 2 /* Message */, key: "Watch input files." }, - Redirect_output_structure_to_the_directory: { code: 6006, category: 2 /* Message */, key: "Redirect output structure to the directory." }, - Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: 2 /* Message */, key: "Do not erase const enum declarations in generated code." }, - Do_not_emit_comments_to_output: { code: 6009, category: 2 /* Message */, key: "Do not emit comments to output." }, - Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, - Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2 /* Message */, key: "Specify module code generation: 'commonjs' or 'amd'" }, - Print_this_message: { code: 6017, category: 2 /* Message */, key: "Print this message." }, - Print_the_compiler_s_version: { code: 6019, category: 2 /* Message */, key: "Print the compiler's version." }, - Syntax_Colon_0: { code: 6023, category: 2 /* Message */, key: "Syntax: {0}" }, - options: { code: 6024, category: 2 /* Message */, key: "options" }, - file: { code: 6025, category: 2 /* Message */, key: "file" }, - Examples_Colon_0: { code: 6026, category: 2 /* Message */, key: "Examples: {0}" }, - Options_Colon: { code: 6027, category: 2 /* Message */, key: "Options:" }, - Version_0: { code: 6029, category: 2 /* Message */, key: "Version {0}" }, - Insert_command_line_options_and_files_from_a_file: { code: 6030, category: 2 /* Message */, key: "Insert command line options and files from a file." }, - File_change_detected_Compiling: { code: 6032, category: 2 /* Message */, key: "File change detected. Compiling..." }, - KIND: { code: 6034, category: 2 /* Message */, key: "KIND" }, - FILE: { code: 6035, category: 2 /* Message */, key: "FILE" }, - VERSION: { code: 6036, category: 2 /* Message */, key: "VERSION" }, - LOCATION: { code: 6037, category: 2 /* Message */, key: "LOCATION" }, - DIRECTORY: { code: 6038, category: 2 /* Message */, key: "DIRECTORY" }, - Compilation_complete_Watching_for_file_changes: { code: 6042, category: 2 /* Message */, key: "Compilation complete. Watching for file changes." }, - Generates_corresponding_map_file: { code: 6043, category: 2 /* Message */, key: "Generates corresponding '.map' file." }, - Compiler_option_0_expects_an_argument: { code: 6044, category: 1 /* Error */, key: "Compiler option '{0}' expects an argument." }, - Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1 /* Error */, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1 /* Error */, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." }, - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: 1 /* Error */, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, - Unsupported_locale_0: { code: 6049, category: 1 /* Error */, key: "Unsupported locale '{0}'." }, - Unable_to_open_file_0: { code: 6050, category: 1 /* Error */, key: "Unable to open file '{0}'." }, - Corrupted_locale_file_0: { code: 6051, category: 1 /* Error */, key: "Corrupted locale file {0}." }, - Warn_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: 2 /* Message */, key: "Warn on expressions and declarations with an implied 'any' type." }, - File_0_not_found: { code: 6053, category: 1 /* Error */, key: "File '{0}' not found." }, - File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: 1 /* Error */, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, - Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1 /* Error */, key: "Variable '{0}' implicitly has an '{1}' type." }, - Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1 /* Error */, key: "Parameter '{0}' implicitly has an '{1}' type." }, - Member_0_implicitly_has_an_1_type: { code: 7008, category: 1 /* Error */, key: "Member '{0}' implicitly has an '{1}' type." }, - new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: 1 /* Error */, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, - _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: 1 /* Error */, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: 1 /* Error */, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, - Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: 1 /* Error */, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: 1 /* Error */, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, - Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1 /* Error */, key: "Index signature of object type implicitly has an 'any' type." }, - Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1 /* Error */, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, - Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1 /* Error */, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, - Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1 /* Error */, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 7021, category: 1 /* Error */, key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." }, - _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { code: 7022, category: 1 /* Error */, key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." }, - _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: { code: 7023, category: 1 /* Error */, key: "'{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." }, - 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: { code: 7024, category: 1 /* Error */, key: "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." }, - You_cannot_rename_this_element: { code: 8000, category: 1 /* Error */, key: "You cannot rename this element." } - }; -})(ts || (ts = {})); -var ts; -(function (ts) { - var textToToken = { - "any": 109 /* AnyKeyword */, - "boolean": 110 /* BooleanKeyword */, - "break": 64 /* BreakKeyword */, - "case": 65 /* CaseKeyword */, - "catch": 66 /* CatchKeyword */, - "class": 67 /* ClassKeyword */, - "continue": 69 /* ContinueKeyword */, - "const": 68 /* ConstKeyword */, - "constructor": 111 /* ConstructorKeyword */, - "debugger": 70 /* DebuggerKeyword */, - "declare": 112 /* DeclareKeyword */, - "default": 71 /* DefaultKeyword */, - "delete": 72 /* DeleteKeyword */, - "do": 73 /* DoKeyword */, - "else": 74 /* ElseKeyword */, - "enum": 75 /* EnumKeyword */, - "export": 76 /* ExportKeyword */, - "extends": 77 /* ExtendsKeyword */, - "false": 78 /* FalseKeyword */, - "finally": 79 /* FinallyKeyword */, - "for": 80 /* ForKeyword */, - "function": 81 /* FunctionKeyword */, - "get": 113 /* GetKeyword */, - "if": 82 /* IfKeyword */, - "implements": 100 /* ImplementsKeyword */, - "import": 83 /* ImportKeyword */, - "in": 84 /* InKeyword */, - "instanceof": 85 /* InstanceOfKeyword */, - "interface": 101 /* InterfaceKeyword */, - "let": 102 /* LetKeyword */, - "module": 114 /* ModuleKeyword */, - "new": 86 /* NewKeyword */, - "null": 87 /* NullKeyword */, - "number": 116 /* NumberKeyword */, - "package": 103 /* PackageKeyword */, - "private": 104 /* PrivateKeyword */, - "protected": 105 /* ProtectedKeyword */, - "public": 106 /* PublicKeyword */, - "require": 115 /* RequireKeyword */, - "return": 88 /* ReturnKeyword */, - "set": 117 /* SetKeyword */, - "static": 107 /* StaticKeyword */, - "string": 118 /* StringKeyword */, - "super": 89 /* SuperKeyword */, - "switch": 90 /* SwitchKeyword */, - "this": 91 /* ThisKeyword */, - "throw": 92 /* ThrowKeyword */, - "true": 93 /* TrueKeyword */, - "try": 94 /* TryKeyword */, - "type": 119 /* TypeKeyword */, - "typeof": 95 /* TypeOfKeyword */, - "var": 96 /* VarKeyword */, - "void": 97 /* VoidKeyword */, - "while": 98 /* WhileKeyword */, - "with": 99 /* WithKeyword */, - "yield": 108 /* YieldKeyword */, - "{": 13 /* OpenBraceToken */, - "}": 14 /* CloseBraceToken */, - "(": 15 /* OpenParenToken */, - ")": 16 /* CloseParenToken */, - "[": 17 /* OpenBracketToken */, - "]": 18 /* CloseBracketToken */, - ".": 19 /* DotToken */, - "...": 20 /* DotDotDotToken */, - ";": 21 /* SemicolonToken */, - ",": 22 /* CommaToken */, - "<": 23 /* LessThanToken */, - ">": 24 /* GreaterThanToken */, - "<=": 25 /* LessThanEqualsToken */, - ">=": 26 /* GreaterThanEqualsToken */, - "==": 27 /* EqualsEqualsToken */, - "!=": 28 /* ExclamationEqualsToken */, - "===": 29 /* EqualsEqualsEqualsToken */, - "!==": 30 /* ExclamationEqualsEqualsToken */, - "=>": 31 /* EqualsGreaterThanToken */, - "+": 32 /* PlusToken */, - "-": 33 /* MinusToken */, - "*": 34 /* AsteriskToken */, - "/": 35 /* SlashToken */, - "%": 36 /* PercentToken */, - "++": 37 /* PlusPlusToken */, - "--": 38 /* MinusMinusToken */, - "<<": 39 /* LessThanLessThanToken */, - ">>": 40 /* GreaterThanGreaterThanToken */, - ">>>": 41 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 42 /* AmpersandToken */, - "|": 43 /* BarToken */, - "^": 44 /* CaretToken */, - "!": 45 /* ExclamationToken */, - "~": 46 /* TildeToken */, - "&&": 47 /* AmpersandAmpersandToken */, - "||": 48 /* BarBarToken */, - "?": 49 /* QuestionToken */, - ":": 50 /* ColonToken */, - "=": 51 /* EqualsToken */, - "+=": 52 /* PlusEqualsToken */, - "-=": 53 /* MinusEqualsToken */, - "*=": 54 /* AsteriskEqualsToken */, - "/=": 55 /* SlashEqualsToken */, - "%=": 56 /* PercentEqualsToken */, - "<<=": 57 /* LessThanLessThanEqualsToken */, - ">>=": 58 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 60 /* AmpersandEqualsToken */, - "|=": 61 /* BarEqualsToken */, - "^=": 62 /* CaretEqualsToken */ - }; - var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - function lookupInUnicodeMap(code, map) { - if (code < map[0]) { - return false; - } - var lo = 0; - var hi = map.length; - var mid; - while (lo + 1 < hi) { - mid = lo + (hi - lo) / 2; - mid -= mid % 2; - if (map[mid] <= code && code <= map[mid + 1]) { - return true; - } - if (code < map[mid]) { - hi = mid; - } - else { - lo = mid + 2; - } - } - return false; - } - function isUnicodeIdentifierStart(code, languageVersion) { - return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierStart) : lookupInUnicodeMap(code, unicodeES5IdentifierStart); - } - function isUnicodeIdentifierPart(code, languageVersion) { - return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierPart) : lookupInUnicodeMap(code, unicodeES5IdentifierPart); - } - function makeReverseMap(source) { - var result = []; - for (var name in source) { - if (source.hasOwnProperty(name)) { - result[source[name]] = name; - } - } - return result; - } - var tokenStrings = makeReverseMap(textToToken); - function tokenToString(t) { - return tokenStrings[t]; - } - ts.tokenToString = tokenToString; - function getLineStarts(text) { - var result = new Array(); - var pos = 0; - var lineStart = 0; - while (pos < text.length) { - var ch = text.charCodeAt(pos++); - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos) === 10 /* lineFeed */) { - pos++; - } - case 10 /* lineFeed */: - result.push(lineStart); - lineStart = pos; - break; - default: - if (ch > 127 /* maxAsciiCharacter */ && isLineBreak(ch)) { - result.push(lineStart); - lineStart = pos; - } - break; - } - } - result.push(lineStart); - return result; - } - ts.getLineStarts = getLineStarts; - function getPositionFromLineAndCharacter(lineStarts, line, character) { - ts.Debug.assert(line > 0); - return lineStarts[line - 1] + character - 1; - } - ts.getPositionFromLineAndCharacter = getPositionFromLineAndCharacter; - function getLineAndCharacterOfPosition(lineStarts, position) { - var lineNumber = ts.binarySearch(lineStarts, position); - if (lineNumber < 0) { - lineNumber = (~lineNumber) - 1; - } - return { - line: lineNumber + 1, - character: position - lineStarts[lineNumber] + 1 - }; - } - ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; - function positionToLineAndCharacter(text, pos) { - var lineStarts = getLineStarts(text); - return getLineAndCharacterOfPosition(lineStarts, pos); - } - ts.positionToLineAndCharacter = positionToLineAndCharacter; - var hasOwnProperty = Object.prototype.hasOwnProperty; - function isWhiteSpace(ch) { - return ch === 32 /* space */ || ch === 9 /* tab */ || ch === 11 /* verticalTab */ || ch === 12 /* formFeed */ || ch === 160 /* nonBreakingSpace */ || ch === 5760 /* ogham */ || ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ || ch === 8239 /* narrowNoBreakSpace */ || ch === 8287 /* mathematicalSpace */ || ch === 12288 /* ideographicSpace */ || ch === 65279 /* byteOrderMark */; - } - ts.isWhiteSpace = isWhiteSpace; - function isLineBreak(ch) { - return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */ || ch === 133 /* nextLine */; - } - ts.isLineBreak = isLineBreak; - function isDigit(ch) { - return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; - } - function isOctalDigit(ch) { - return ch >= 48 /* _0 */ && ch <= 55 /* _7 */; - } - ts.isOctalDigit = isOctalDigit; - function skipTrivia(text, pos, stopAfterLineBreak) { - while (true) { - var ch = text.charCodeAt(pos); - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) - pos++; - case 10 /* lineFeed */: - pos++; - if (stopAfterLineBreak) - return pos; - continue; - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - pos++; - continue; - case 47 /* slash */: - if (text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - while (pos < text.length) { - if (isLineBreak(text.charCodeAt(pos))) { - break; - } - pos++; - } - continue; - } - if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { - pos += 2; - while (pos < text.length) { - if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - break; - } - pos++; - } - continue; - } - break; - default: - if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { - pos++; - continue; - } - break; - } - return pos; - } - } - ts.skipTrivia = skipTrivia; - function getCommentRanges(text, pos, trailing) { - var result; - var collecting = trailing || pos === 0; - while (true) { - var ch = text.charCodeAt(pos); - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) - pos++; - case 10 /* lineFeed */: - pos++; - if (trailing) { - return result; - } - collecting = true; - if (result && result.length) { - result[result.length - 1].hasTrailingNewLine = true; - } - continue; - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - pos++; - continue; - case 47 /* slash */: - var nextChar = text.charCodeAt(pos + 1); - var hasTrailingNewLine = false; - if (nextChar === 47 /* slash */ || nextChar === 42 /* asterisk */) { - var startPos = pos; - pos += 2; - if (nextChar === 47 /* slash */) { - while (pos < text.length) { - if (isLineBreak(text.charCodeAt(pos))) { - hasTrailingNewLine = true; - break; - } - pos++; - } - } - else { - while (pos < text.length) { - if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - break; - } - pos++; - } - } - if (collecting) { - if (!result) - result = []; - result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); - } - continue; - } - break; - default: - if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { - if (result && result.length && isLineBreak(ch)) { - result[result.length - 1].hasTrailingNewLine = true; - } - pos++; - continue; - } - break; - } - return result; - } - } - function getLeadingCommentRanges(text, pos) { - return getCommentRanges(text, pos, false); - } - ts.getLeadingCommentRanges = getLeadingCommentRanges; - function getTrailingCommentRanges(text, pos) { - return getCommentRanges(text, pos, true); - } - ts.getTrailingCommentRanges = getTrailingCommentRanges; - function isIdentifierStart(ch, languageVersion) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); - } - ts.isIdentifierStart = isIdentifierStart; - function isIdentifierPart(ch, languageVersion) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); - } - ts.isIdentifierPart = isIdentifierPart; - function createScanner(languageVersion, skipTrivia, text, onError, onComment) { - var pos; - var len; - var startPos; - var tokenPos; - var token; - var tokenValue; - var precedingLineBreak; - function error(message) { - if (onError) { - onError(message); - } - } - function isIdentifierStart(ch) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); - } - function isIdentifierPart(ch) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); - } - function scanNumber() { - var start = pos; - while (isDigit(text.charCodeAt(pos))) - pos++; - if (text.charCodeAt(pos) === 46 /* dot */) { - pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; - } - var end = pos; - if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { - pos++; - if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) - pos++; - if (isDigit(text.charCodeAt(pos))) { - pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; - end = pos; - } - else { - error(ts.Diagnostics.Digit_expected); - } - } - return +(text.substring(start, end)); - } - function scanOctalDigits() { - var start = pos; - while (isOctalDigit(text.charCodeAt(pos))) { - pos++; - } - return +(text.substring(start, pos)); - } - function scanHexDigits(count, mustMatchCount) { - var digits = 0; - var value = 0; - while (digits < count || !mustMatchCount) { - var ch = text.charCodeAt(pos); - if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { - value = value * 16 + ch - 48 /* _0 */; - } - else if (ch >= 65 /* A */ && ch <= 70 /* F */) { - value = value * 16 + ch - 65 /* A */ + 10; - } - else if (ch >= 97 /* a */ && ch <= 102 /* f */) { - value = value * 16 + ch - 97 /* a */ + 10; - } - else { - break; - } - pos++; - digits++; - } - if (digits < count) { - value = -1; - } - return value; - } - function scanString() { - var quote = text.charCodeAt(pos++); - var result = ""; - var start = pos; - while (true) { - if (pos >= len) { - result += text.substring(start, pos); - error(ts.Diagnostics.Unexpected_end_of_text); - break; - } - var ch = text.charCodeAt(pos); - if (ch === quote) { - result += text.substring(start, pos); - pos++; - break; - } - if (ch === 92 /* backslash */) { - result += text.substring(start, pos); - result += scanEscapeSequence(); - start = pos; - continue; - } - if (isLineBreak(ch)) { - result += text.substring(start, pos); - error(ts.Diagnostics.Unterminated_string_literal); - break; - } - pos++; - } - return result; - } - function scanTemplateAndSetTokenValue() { - var startedWithBacktick = text.charCodeAt(pos) === 96 /* backtick */; - pos++; - var start = pos; - var contents = ""; - var resultingToken; - while (true) { - if (pos >= len) { - contents += text.substring(start, pos); - error(ts.Diagnostics.Unexpected_end_of_text); - resultingToken = startedWithBacktick ? 9 /* NoSubstitutionTemplateLiteral */ : 12 /* TemplateTail */; - break; - } - var currChar = text.charCodeAt(pos); - if (currChar === 96 /* backtick */) { - contents += text.substring(start, pos); - pos++; - resultingToken = startedWithBacktick ? 9 /* NoSubstitutionTemplateLiteral */ : 12 /* TemplateTail */; - break; - } - if (currChar === 36 /* $ */ && pos + 1 < len && text.charCodeAt(pos + 1) === 123 /* openBrace */) { - contents += text.substring(start, pos); - pos += 2; - resultingToken = startedWithBacktick ? 10 /* TemplateHead */ : 11 /* TemplateMiddle */; - break; - } - if (currChar === 92 /* backslash */) { - contents += text.substring(start, pos); - contents += scanEscapeSequence(); - start = pos; - continue; - } - if (currChar === 13 /* carriageReturn */) { - contents += text.substring(start, pos); - if (pos + 1 < len && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { - pos++; - } - pos++; - contents += "\n"; - start = pos; - continue; - } - pos++; - } - ts.Debug.assert(resultingToken !== undefined); - tokenValue = contents; - return resultingToken; - } - function scanEscapeSequence() { - pos++; - if (pos >= len) { - error(ts.Diagnostics.Unexpected_end_of_text); - return ""; - } - var ch = text.charCodeAt(pos++); - switch (ch) { - case 48 /* _0 */: - return "\0"; - case 98 /* b */: - return "\b"; - case 116 /* t */: - return "\t"; - case 110 /* n */: - return "\n"; - case 118 /* v */: - return "\v"; - case 102 /* f */: - return "\f"; - case 114 /* r */: - return "\r"; - case 39 /* singleQuote */: - return "\'"; - case 34 /* doubleQuote */: - return "\""; - case 120 /* x */: - case 117 /* u */: - var ch = scanHexDigits(ch === 120 /* x */ ? 2 : 4, true); - if (ch >= 0) { - return String.fromCharCode(ch); - } - else { - error(ts.Diagnostics.Hexadecimal_digit_expected); - return ""; - } - case 13 /* carriageReturn */: - if (pos < len && text.charCodeAt(pos) === 10 /* lineFeed */) { - pos++; - } - case 10 /* lineFeed */: - case 8232 /* lineSeparator */: - case 8233 /* paragraphSeparator */: - return ""; - default: - return String.fromCharCode(ch); - } - } - function peekUnicodeEscape() { - if (pos + 5 < len && text.charCodeAt(pos + 1) === 117 /* u */) { - var start = pos; - pos += 2; - var value = scanHexDigits(4, true); - pos = start; - return value; - } - return -1; - } - function scanIdentifierParts() { - var result = ""; - var start = pos; - while (pos < len) { - var ch = text.charCodeAt(pos); - if (isIdentifierPart(ch)) { - pos++; - } - else if (ch === 92 /* backslash */) { - ch = peekUnicodeEscape(); - if (!(ch >= 0 && isIdentifierPart(ch))) { - break; - } - result += text.substring(start, pos); - result += String.fromCharCode(ch); - pos += 6; - start = pos; - } - else { - break; - } - } - result += text.substring(start, pos); - return result; - } - function getIdentifierToken() { - var len = tokenValue.length; - if (len >= 2 && len <= 11) { - var ch = tokenValue.charCodeAt(0); - if (ch >= 97 /* a */ && ch <= 122 /* z */ && hasOwnProperty.call(textToToken, tokenValue)) { - return token = textToToken[tokenValue]; - } - } - return token = 63 /* Identifier */; - } - function scan() { - startPos = pos; - precedingLineBreak = false; - while (true) { - tokenPos = pos; - if (pos >= len) { - return token = 1 /* EndOfFileToken */; - } - var ch = text.charCodeAt(pos); - switch (ch) { - case 10 /* lineFeed */: - case 13 /* carriageReturn */: - precedingLineBreak = true; - if (skipTrivia) { - pos++; - continue; - } - else { - if (ch === 13 /* carriageReturn */ && pos + 1 < len && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { - pos += 2; - } - else { - pos++; - } - return token = 4 /* NewLineTrivia */; - } - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - if (skipTrivia) { - pos++; - continue; - } - else { - while (pos < len && isWhiteSpace(text.charCodeAt(pos))) { - pos++; - } - return token = 5 /* WhitespaceTrivia */; - } - case 33 /* exclamation */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 30 /* ExclamationEqualsEqualsToken */; - } - return pos += 2, token = 28 /* ExclamationEqualsToken */; - } - return pos++, token = 45 /* ExclamationToken */; - case 34 /* doubleQuote */: - case 39 /* singleQuote */: - tokenValue = scanString(); - return token = 7 /* StringLiteral */; - case 96 /* backtick */: - return token = scanTemplateAndSetTokenValue(); - case 37 /* percent */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 56 /* PercentEqualsToken */; - } - return pos++, token = 36 /* PercentToken */; - case 38 /* ampersand */: - if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { - return pos += 2, token = 47 /* AmpersandAmpersandToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 60 /* AmpersandEqualsToken */; - } - return pos++, token = 42 /* AmpersandToken */; - case 40 /* openParen */: - return pos++, token = 15 /* OpenParenToken */; - case 41 /* closeParen */: - return pos++, token = 16 /* CloseParenToken */; - case 42 /* asterisk */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 54 /* AsteriskEqualsToken */; - } - return pos++, token = 34 /* AsteriskToken */; - case 43 /* plus */: - if (text.charCodeAt(pos + 1) === 43 /* plus */) { - return pos += 2, token = 37 /* PlusPlusToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 52 /* PlusEqualsToken */; - } - return pos++, token = 32 /* PlusToken */; - case 44 /* comma */: - return pos++, token = 22 /* CommaToken */; - case 45 /* minus */: - if (text.charCodeAt(pos + 1) === 45 /* minus */) { - return pos += 2, token = 38 /* MinusMinusToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 53 /* MinusEqualsToken */; - } - return pos++, token = 33 /* MinusToken */; - case 46 /* dot */: - if (isDigit(text.charCodeAt(pos + 1))) { - tokenValue = "" + scanNumber(); - return token = 6 /* NumericLiteral */; - } - if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { - return pos += 3, token = 20 /* DotDotDotToken */; - } - return pos++, token = 19 /* DotToken */; - case 47 /* slash */: - if (text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - while (pos < len) { - if (isLineBreak(text.charCodeAt(pos))) { - break; - } - pos++; - } - if (onComment) { - onComment(tokenPos, pos); - } - if (skipTrivia) { - continue; - } - else { - return token = 2 /* SingleLineCommentTrivia */; - } - } - if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { - pos += 2; - var commentClosed = false; - while (pos < len) { - var ch = text.charCodeAt(pos); - if (ch === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - commentClosed = true; - break; - } - if (isLineBreak(ch)) { - precedingLineBreak = true; - } - pos++; - } - if (!commentClosed) { - error(ts.Diagnostics.Asterisk_Slash_expected); - } - if (onComment) { - onComment(tokenPos, pos); - } - if (skipTrivia) { - continue; - } - else { - return token = 3 /* MultiLineCommentTrivia */; - } - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 55 /* SlashEqualsToken */; - } - return pos++, token = 35 /* SlashToken */; - case 48 /* _0 */: - if (pos + 2 < len && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { - pos += 2; - var value = scanHexDigits(1, false); - if (value < 0) { - error(ts.Diagnostics.Hexadecimal_digit_expected); - value = 0; - } - tokenValue = "" + value; - return 6 /* NumericLiteral */; - } - if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { - tokenValue = "" + scanOctalDigits(); - return 6 /* NumericLiteral */; - } - case 49 /* _1 */: - case 50 /* _2 */: - case 51 /* _3 */: - case 52 /* _4 */: - case 53 /* _5 */: - case 54 /* _6 */: - case 55 /* _7 */: - case 56 /* _8 */: - case 57 /* _9 */: - tokenValue = "" + scanNumber(); - return token = 6 /* NumericLiteral */; - case 58 /* colon */: - return pos++, token = 50 /* ColonToken */; - case 59 /* semicolon */: - return pos++, token = 21 /* SemicolonToken */; - case 60 /* lessThan */: - if (text.charCodeAt(pos + 1) === 60 /* lessThan */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 57 /* LessThanLessThanEqualsToken */; - } - return pos += 2, token = 39 /* LessThanLessThanToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 25 /* LessThanEqualsToken */; - } - return pos++, token = 23 /* LessThanToken */; - case 61 /* equals */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 29 /* EqualsEqualsEqualsToken */; - } - return pos += 2, token = 27 /* EqualsEqualsToken */; - } - if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { - return pos += 2, token = 31 /* EqualsGreaterThanToken */; - } - return pos++, token = 51 /* EqualsToken */; - case 62 /* greaterThan */: - return pos++, token = 24 /* GreaterThanToken */; - case 63 /* question */: - return pos++, token = 49 /* QuestionToken */; - case 91 /* openBracket */: - return pos++, token = 17 /* OpenBracketToken */; - case 93 /* closeBracket */: - return pos++, token = 18 /* CloseBracketToken */; - case 94 /* caret */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 62 /* CaretEqualsToken */; - } - return pos++, token = 44 /* CaretToken */; - case 123 /* openBrace */: - return pos++, token = 13 /* OpenBraceToken */; - case 124 /* bar */: - if (text.charCodeAt(pos + 1) === 124 /* bar */) { - return pos += 2, token = 48 /* BarBarToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 61 /* BarEqualsToken */; - } - return pos++, token = 43 /* BarToken */; - case 125 /* closeBrace */: - return pos++, token = 14 /* CloseBraceToken */; - case 126 /* tilde */: - return pos++, token = 46 /* TildeToken */; - case 92 /* backslash */: - var ch = peekUnicodeEscape(); - if (ch >= 0 && isIdentifierStart(ch)) { - pos += 6; - tokenValue = String.fromCharCode(ch) + scanIdentifierParts(); - return token = getIdentifierToken(); - } - error(ts.Diagnostics.Invalid_character); - return pos++, token = 0 /* Unknown */; - default: - if (isIdentifierStart(ch)) { - pos++; - while (pos < len && isIdentifierPart(ch = text.charCodeAt(pos))) - pos++; - tokenValue = text.substring(tokenPos, pos); - if (ch === 92 /* backslash */) { - tokenValue += scanIdentifierParts(); - } - return token = getIdentifierToken(); - } - else if (isWhiteSpace(ch)) { - pos++; - continue; - } - else if (isLineBreak(ch)) { - precedingLineBreak = true; - pos++; - continue; - } - error(ts.Diagnostics.Invalid_character); - return pos++, token = 0 /* Unknown */; - } - } - } - function reScanGreaterToken() { - if (token === 24 /* GreaterThanToken */) { - if (text.charCodeAt(pos) === 62 /* greaterThan */) { - if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */; - } - return pos += 2, token = 41 /* GreaterThanGreaterThanGreaterThanToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 58 /* GreaterThanGreaterThanEqualsToken */; - } - return pos++, token = 40 /* GreaterThanGreaterThanToken */; - } - if (text.charCodeAt(pos) === 61 /* equals */) { - return pos++, token = 26 /* GreaterThanEqualsToken */; - } - } - return token; - } - function reScanSlashToken() { - if (token === 35 /* SlashToken */ || token === 55 /* SlashEqualsToken */) { - var p = tokenPos + 1; - var inEscape = false; - var inCharacterClass = false; - while (true) { - if (p >= len) { - return token; - } - var ch = text.charCodeAt(p); - if (isLineBreak(ch)) { - return token; - } - if (inEscape) { - inEscape = false; - } - else if (ch === 47 /* slash */ && !inCharacterClass) { - break; - } - else if (ch === 91 /* openBracket */) { - inCharacterClass = true; - } - else if (ch === 92 /* backslash */) { - inEscape = true; - } - else if (ch === 93 /* closeBracket */) { - inCharacterClass = false; - } - p++; - } - p++; - while (isIdentifierPart(text.charCodeAt(p))) { - p++; - } - pos = p; - tokenValue = text.substring(tokenPos, pos); - token = 8 /* RegularExpressionLiteral */; - } - return token; - } - function reScanTemplateToken() { - ts.Debug.assert(token === 14 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'"); - pos = tokenPos; - return token = scanTemplateAndSetTokenValue(); - } - function tryScan(callback) { - var savePos = pos; - var saveStartPos = startPos; - var saveTokenPos = tokenPos; - var saveToken = token; - var saveTokenValue = tokenValue; - var savePrecedingLineBreak = precedingLineBreak; - var result = callback(); - if (!result) { - pos = savePos; - startPos = saveStartPos; - tokenPos = saveTokenPos; - token = saveToken; - tokenValue = saveTokenValue; - precedingLineBreak = savePrecedingLineBreak; - } - return result; - } - function setText(newText) { - text = newText || ""; - len = text.length; - setTextPos(0); - } - function setTextPos(textPos) { - pos = textPos; - startPos = textPos; - tokenPos = textPos; - token = 0 /* Unknown */; - precedingLineBreak = false; - } - setText(text); - return { - getStartPos: function () { return startPos; }, - getTextPos: function () { return pos; }, - getToken: function () { return token; }, - getTokenPos: function () { return tokenPos; }, - getTokenText: function () { return text.substring(tokenPos, pos); }, - getTokenValue: function () { return tokenValue; }, - hasPrecedingLineBreak: function () { return precedingLineBreak; }, - isIdentifier: function () { return token === 63 /* Identifier */ || token > 99 /* LastReservedWord */; }, - isReservedWord: function () { return token >= 64 /* FirstReservedWord */ && token <= 99 /* LastReservedWord */; }, - reScanGreaterToken: reScanGreaterToken, - reScanSlashToken: reScanSlashToken, - reScanTemplateToken: reScanTemplateToken, - scan: scan, - setText: setText, - setTextPos: setTextPos, - tryScan: tryScan - }; - } - ts.createScanner = createScanner; -})(ts || (ts = {})); var ts; (function (ts) { (function (EmitReturnStatus) { @@ -1545,6 +130,13 @@ var ts; return result; } ts.sum = sum; + function lastOrUndefined(array) { + if (array.length === 0) { + return undefined; + } + return array[array.length - 1]; + } + ts.lastOrUndefined = lastOrUndefined; function binarySearch(array, value) { var low = 0; var high = array.length - 1; @@ -1997,7 +589,1429 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var nodeConstructors = new Array(196 /* Count */); + ts.Diagnostics = { + Unterminated_string_literal: { code: 1002, category: 1 /* Error */, key: "Unterminated string literal." }, + Identifier_expected: { code: 1003, category: 1 /* Error */, key: "Identifier expected." }, + _0_expected: { code: 1005, category: 1 /* Error */, key: "'{0}' expected." }, + A_file_cannot_have_a_reference_to_itself: { code: 1006, category: 1 /* Error */, key: "A file cannot have a reference to itself." }, + Trailing_comma_not_allowed: { code: 1009, category: 1 /* Error */, key: "Trailing comma not allowed." }, + Asterisk_Slash_expected: { code: 1010, category: 1 /* Error */, key: "'*/' expected." }, + Unexpected_token: { code: 1012, category: 1 /* Error */, key: "Unexpected token." }, + Catch_clause_parameter_cannot_have_a_type_annotation: { code: 1013, category: 1 /* Error */, key: "Catch clause parameter cannot have a type annotation." }, + A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1 /* Error */, key: "A rest parameter must be last in a parameter list." }, + Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: 1 /* Error */, key: "Parameter cannot have question mark and initializer." }, + A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: 1 /* Error */, key: "A required parameter cannot follow an optional parameter." }, + An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: 1 /* Error */, key: "An index signature cannot have a rest parameter." }, + An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: 1 /* Error */, key: "An index signature parameter cannot have an accessibility modifier." }, + An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: 1 /* Error */, key: "An index signature parameter cannot have a question mark." }, + An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: 1 /* Error */, key: "An index signature parameter cannot have an initializer." }, + An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1 /* Error */, key: "An index signature must have a type annotation." }, + An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1 /* Error */, key: "An index signature parameter must have a type annotation." }, + An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1 /* Error */, key: "An index signature parameter type must be 'string' or 'number'." }, + A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: 1 /* Error */, key: "A class or interface declaration can only have one 'extends' clause." }, + An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: 1 /* Error */, key: "An 'extends' clause must precede an 'implements' clause." }, + A_class_can_only_extend_a_single_class: { code: 1026, category: 1 /* Error */, key: "A class can only extend a single class." }, + A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: 1 /* Error */, key: "A class declaration can only have one 'implements' clause." }, + Accessibility_modifier_already_seen: { code: 1028, category: 1 /* Error */, key: "Accessibility modifier already seen." }, + _0_modifier_must_precede_1_modifier: { code: 1029, category: 1 /* Error */, key: "'{0}' modifier must precede '{1}' modifier." }, + _0_modifier_already_seen: { code: 1030, category: 1 /* Error */, key: "'{0}' modifier already seen." }, + _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a class element." }, + An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: 1 /* Error */, key: "An interface declaration cannot have an 'implements' clause." }, + super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: 1 /* Error */, key: "'super' must be followed by an argument list or member access." }, + Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1 /* Error */, key: "Only ambient modules can use quoted names." }, + Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1 /* Error */, key: "Statements are not allowed in ambient contexts." }, + A_function_implementation_cannot_be_declared_in_an_ambient_context: { code: 1037, category: 1 /* Error */, key: "A function implementation cannot be declared in an ambient context." }, + A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: 1 /* Error */, key: "A 'declare' modifier cannot be used in an already ambient context." }, + Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: 1 /* Error */, key: "Initializers are not allowed in ambient contexts." }, + _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a module element." }, + A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an interface declaration." }, + A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: 1 /* Error */, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, + A_rest_parameter_cannot_be_optional: { code: 1047, category: 1 /* Error */, key: "A rest parameter cannot be optional." }, + A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: 1 /* Error */, key: "A rest parameter cannot have an initializer." }, + A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: 1 /* Error */, key: "A 'set' accessor must have exactly one parameter." }, + A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: 1 /* Error */, key: "A 'set' accessor cannot have an optional parameter." }, + A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1 /* Error */, key: "A 'set' accessor parameter cannot have an initializer." }, + A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1 /* Error */, key: "A 'set' accessor cannot have rest parameter." }, + A_get_accessor_cannot_have_parameters: { code: 1054, category: 1 /* Error */, key: "A 'get' accessor cannot have parameters." }, + Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1 /* Error */, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, + Enum_member_must_have_initializer: { code: 1061, category: 1 /* Error */, key: "Enum member must have initializer." }, + An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1 /* Error */, key: "An export assignment cannot be used in an internal module." }, + Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1 /* Error */, key: "Ambient enum elements can only have integer literal initializers." }, + Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: 1 /* Error */, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, + A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an import declaration." }, + Invalid_reference_directive_syntax: { code: 1084, category: 1 /* Error */, key: "Invalid 'reference' directive syntax." }, + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1 /* Error */, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, + An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: 1 /* Error */, key: "An accessor cannot be declared in an ambient context." }, + _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a constructor declaration." }, + _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a parameter." }, + Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: 1 /* Error */, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, + Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: 1 /* Error */, key: "Type parameters cannot appear on a constructor declaration." }, + Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: 1 /* Error */, key: "Type annotation cannot appear on a constructor declaration." }, + An_accessor_cannot_have_type_parameters: { code: 1094, category: 1 /* Error */, key: "An accessor cannot have type parameters." }, + A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: 1 /* Error */, key: "A 'set' accessor cannot have a return type annotation." }, + An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: 1 /* Error */, key: "An index signature must have exactly one parameter." }, + _0_list_cannot_be_empty: { code: 1097, category: 1 /* Error */, key: "'{0}' list cannot be empty." }, + Type_parameter_list_cannot_be_empty: { code: 1098, category: 1 /* Error */, key: "Type parameter list cannot be empty." }, + Type_argument_list_cannot_be_empty: { code: 1099, category: 1 /* Error */, key: "Type argument list cannot be empty." }, + Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1 /* Error */, key: "Invalid use of '{0}' in strict mode." }, + with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1 /* Error */, key: "'with' statements are not allowed in strict mode." }, + delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1 /* Error */, key: "'delete' cannot be called on an identifier in strict mode." }, + A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1 /* Error */, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, + A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1 /* Error */, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, + Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1 /* Error */, key: "Jump target cannot cross function boundary." }, + A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: 1 /* Error */, key: "A 'return' statement can only be used within a function body." }, + Expression_expected: { code: 1109, category: 1 /* Error */, key: "Expression expected." }, + Type_expected: { code: 1110, category: 1 /* Error */, key: "Type expected." }, + A_constructor_implementation_cannot_be_declared_in_an_ambient_context: { code: 1111, category: 1 /* Error */, key: "A constructor implementation cannot be declared in an ambient context." }, + A_class_member_cannot_be_declared_optional: { code: 1112, category: 1 /* Error */, key: "A class member cannot be declared optional." }, + A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: 1 /* Error */, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, + Duplicate_label_0: { code: 1114, category: 1 /* Error */, key: "Duplicate label '{0}'" }, + A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: 1 /* Error */, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, + A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: 1 /* Error */, key: "A 'break' statement can only jump to a label of an enclosing statement." }, + An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: 1 /* Error */, key: "An object literal cannot have multiple properties with the same name in strict mode." }, + An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: 1 /* Error */, key: "An object literal cannot have multiple get/set accessors with the same name." }, + An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: 1 /* Error */, key: "An object literal cannot have property and accessor with the same name." }, + An_export_assignment_cannot_have_modifiers: { code: 1120, category: 1 /* Error */, key: "An export assignment cannot have modifiers." }, + Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: 1 /* Error */, key: "Octal literals are not allowed in strict mode." }, + A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: 1 /* Error */, key: "A tuple type element list cannot be empty." }, + Variable_declaration_list_cannot_be_empty: { code: 1123, category: 1 /* Error */, key: "Variable declaration list cannot be empty." }, + Digit_expected: { code: 1124, category: 1 /* Error */, key: "Digit expected." }, + Hexadecimal_digit_expected: { code: 1125, category: 1 /* Error */, key: "Hexadecimal digit expected." }, + Unexpected_end_of_text: { code: 1126, category: 1 /* Error */, key: "Unexpected end of text." }, + Invalid_character: { code: 1127, category: 1 /* Error */, key: "Invalid character." }, + Declaration_or_statement_expected: { code: 1128, category: 1 /* Error */, key: "Declaration or statement expected." }, + Statement_expected: { code: 1129, category: 1 /* Error */, key: "Statement expected." }, + case_or_default_expected: { code: 1130, category: 1 /* Error */, key: "'case' or 'default' expected." }, + Property_or_signature_expected: { code: 1131, category: 1 /* Error */, key: "Property or signature expected." }, + Enum_member_expected: { code: 1132, category: 1 /* Error */, key: "Enum member expected." }, + Type_reference_expected: { code: 1133, category: 1 /* Error */, key: "Type reference expected." }, + Variable_declaration_expected: { code: 1134, category: 1 /* Error */, key: "Variable declaration expected." }, + Argument_expression_expected: { code: 1135, category: 1 /* Error */, key: "Argument expression expected." }, + Property_assignment_expected: { code: 1136, category: 1 /* Error */, key: "Property assignment expected." }, + Expression_or_comma_expected: { code: 1137, category: 1 /* Error */, key: "Expression or comma expected." }, + Parameter_declaration_expected: { code: 1138, category: 1 /* Error */, key: "Parameter declaration expected." }, + Type_parameter_declaration_expected: { code: 1139, category: 1 /* Error */, key: "Type parameter declaration expected." }, + Type_argument_expected: { code: 1140, category: 1 /* Error */, key: "Type argument expected." }, + String_literal_expected: { code: 1141, category: 1 /* Error */, key: "String literal expected." }, + Line_break_not_permitted_here: { code: 1142, category: 1 /* Error */, key: "Line break not permitted here." }, + catch_or_finally_expected: { code: 1143, category: 1 /* Error */, key: "'catch' or 'finally' expected." }, + Block_or_expected: { code: 1144, category: 1 /* Error */, key: "Block or ';' expected." }, + Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: 1 /* Error */, key: "Modifiers not permitted on index signature members." }, + Declaration_expected: { code: 1146, category: 1 /* Error */, key: "Declaration expected." }, + Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: 1 /* Error */, key: "Import declarations in an internal module cannot reference an external module." }, + Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: 1 /* Error */, key: "Cannot compile external modules unless the '--module' flag is provided." }, + Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: 1 /* Error */, key: "Filename '{0}' differs from already included filename '{1}' only in casing" }, + new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, + var_let_or_const_expected: { code: 1152, category: 1 /* Error */, key: "'var', 'let' or 'const' expected." }, + let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: 1 /* Error */, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: 1 /* Error */, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, + const_declarations_must_be_initialized: { code: 1155, category: 1 /* Error */, key: "'const' declarations must be initialized" }, + const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: 1 /* Error */, key: "'const' declarations can only be declared inside a block." }, + let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: 1 /* Error */, key: "'let' declarations can only be declared inside a block." }, + Invalid_template_literal_expected: { code: 1158, category: 1 /* Error */, key: "Invalid template literal; expected '}'" }, + Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1159, category: 1 /* Error */, key: "Tagged templates are only available when targeting ECMAScript 6 and higher." }, + Unterminated_template_literal: { code: 1160, category: 1 /* Error */, key: "Unterminated template literal." }, + Unterminated_regular_expression_literal: { code: 1161, category: 1 /* Error */, key: "Unterminated regular expression literal." }, + An_object_member_cannot_be_declared_optional: { code: 1162, category: 1 /* Error */, key: "An object member cannot be declared optional." }, + Duplicate_identifier_0: { code: 2300, category: 1 /* Error */, key: "Duplicate identifier '{0}'." }, + Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1 /* Error */, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, + Static_members_cannot_reference_class_type_parameters: { code: 2302, category: 1 /* Error */, key: "Static members cannot reference class type parameters." }, + Circular_definition_of_import_alias_0: { code: 2303, category: 1 /* Error */, key: "Circular definition of import alias '{0}'." }, + Cannot_find_name_0: { code: 2304, category: 1 /* Error */, key: "Cannot find name '{0}'." }, + Module_0_has_no_exported_member_1: { code: 2305, category: 1 /* Error */, key: "Module '{0}' has no exported member '{1}'." }, + File_0_is_not_an_external_module: { code: 2306, category: 1 /* Error */, key: "File '{0}' is not an external module." }, + Cannot_find_external_module_0: { code: 2307, category: 1 /* Error */, key: "Cannot find external module '{0}'." }, + A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: 1 /* Error */, key: "A module cannot have more than one export assignment." }, + An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: 1 /* Error */, key: "An export assignment cannot be used in a module with other exported elements." }, + Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: 1 /* Error */, key: "Type '{0}' recursively references itself as a base type." }, + A_class_may_only_extend_another_class: { code: 2311, category: 1 /* Error */, key: "A class may only extend another class." }, + An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: 1 /* Error */, key: "An interface may only extend a class or another interface." }, + Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: 1 /* Error */, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, + Generic_type_0_requires_1_type_argument_s: { code: 2314, category: 1 /* Error */, key: "Generic type '{0}' requires {1} type argument(s)." }, + Type_0_is_not_generic: { code: 2315, category: 1 /* Error */, key: "Type '{0}' is not generic." }, + Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: 1 /* Error */, key: "Global type '{0}' must be a class or interface type." }, + Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1 /* Error */, key: "Global type '{0}' must have {1} type parameter(s)." }, + Cannot_find_global_type_0: { code: 2318, category: 1 /* Error */, key: "Cannot find global type '{0}'." }, + Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1 /* Error */, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, + Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: 1 /* Error */, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, + Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1 /* Error */, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, + Type_0_is_not_assignable_to_type_1: { code: 2322, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}'." }, + Property_0_is_missing_in_type_1: { code: 2324, category: 1 /* Error */, key: "Property '{0}' is missing in type '{1}'." }, + Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: 1 /* Error */, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, + Types_of_property_0_are_incompatible: { code: 2326, category: 1 /* Error */, key: "Types of property '{0}' are incompatible." }, + Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: 1 /* Error */, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, + Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible." }, + Index_signature_is_missing_in_type_0: { code: 2329, category: 1 /* Error */, key: "Index signature is missing in type '{0}'." }, + Index_signatures_are_incompatible: { code: 2330, category: 1 /* Error */, key: "Index signatures are incompatible." }, + this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1 /* Error */, key: "'this' cannot be referenced in a module body." }, + this_cannot_be_referenced_in_current_location: { code: 2332, category: 1 /* Error */, key: "'this' cannot be referenced in current location." }, + this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1 /* Error */, key: "'this' cannot be referenced in constructor arguments." }, + this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: 1 /* Error */, key: "'this' cannot be referenced in a static property initializer." }, + super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: 1 /* Error */, key: "'super' can only be referenced in a derived class." }, + super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: 1 /* Error */, key: "'super' cannot be referenced in constructor arguments." }, + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: 1 /* Error */, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, + super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: 1 /* Error */, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, + Property_0_does_not_exist_on_type_1: { code: 2339, category: 1 /* Error */, key: "Property '{0}' does not exist on type '{1}'." }, + Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1 /* Error */, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, + Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: 1 /* Error */, key: "Property '{0}' is private and only accessible within class '{1}'." }, + An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: 1 /* Error */, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, + Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}'." }, + Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1 /* Error */, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, + Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1 /* Error */, key: "Supplied parameters do not match any signature of call target." }, + Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: 1 /* Error */, key: "Untyped function calls may not accept type arguments." }, + Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: 1 /* Error */, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, + Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: 1 /* Error */, key: "Cannot invoke an expression whose type lacks a call signature." }, + Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1 /* Error */, key: "Only a void function can be called with the 'new' keyword." }, + Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1 /* Error */, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, + Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, + No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1 /* Error */, key: "No best common type exists among return expressions." }, + A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1 /* Error */, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, + An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1 /* Error */, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: 1 /* Error */, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, + The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: 1 /* Error */, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, + The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: 1 /* Error */, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, + The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2360, category: 1 /* Error */, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." }, + The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: 1 /* Error */, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, + The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: 1 /* Error */, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: 1 /* Error */, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, + Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: 1 /* Error */, key: "Invalid left-hand side of assignment expression." }, + Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: 1 /* Error */, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, + Type_parameter_name_cannot_be_0: { code: 2368, category: 1 /* Error */, key: "Type parameter name cannot be '{0}'" }, + A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: 1 /* Error */, key: "A parameter property is only allowed in a constructor implementation." }, + A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: 1 /* Error */, key: "A rest parameter must be of an array type." }, + A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: 1 /* Error */, key: "A parameter initializer is only allowed in a function or constructor implementation." }, + Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: 1 /* Error */, key: "Parameter '{0}' cannot be referenced in its initializer." }, + Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: 1 /* Error */, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, + Duplicate_string_index_signature: { code: 2374, category: 1 /* Error */, key: "Duplicate string index signature." }, + Duplicate_number_index_signature: { code: 2375, category: 1 /* Error */, key: "Duplicate number index signature." }, + A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: 1 /* Error */, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, + Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: 1 /* Error */, key: "Constructors for derived classes must contain a 'super' call." }, + A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: 1 /* Error */, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, + Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: 1 /* Error */, key: "Getter and setter accessors do not agree in visibility." }, + get_and_set_accessor_must_have_the_same_type: { code: 2380, category: 1 /* Error */, key: "'get' and 'set' accessor must have the same type." }, + A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: 1 /* Error */, key: "A signature with an implementation cannot use a string literal type." }, + Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: 1 /* Error */, key: "Specialized overload signature is not assignable to any non-specialized signature." }, + Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: 1 /* Error */, key: "Overload signatures must all be exported or not exported." }, + Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: 1 /* Error */, key: "Overload signatures must all be ambient or non-ambient." }, + Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: 1 /* Error */, key: "Overload signatures must all be public, private or protected." }, + Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: 1 /* Error */, key: "Overload signatures must all be optional or required." }, + Function_overload_must_be_static: { code: 2387, category: 1 /* Error */, key: "Function overload must be static." }, + Function_overload_must_not_be_static: { code: 2388, category: 1 /* Error */, key: "Function overload must not be static." }, + Function_implementation_name_must_be_0: { code: 2389, category: 1 /* Error */, key: "Function implementation name must be '{0}'." }, + Constructor_implementation_is_missing: { code: 2390, category: 1 /* Error */, key: "Constructor implementation is missing." }, + Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: 1 /* Error */, key: "Function implementation is missing or not immediately following the declaration." }, + Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: 1 /* Error */, key: "Multiple constructor implementations are not allowed." }, + Duplicate_function_implementation: { code: 2393, category: 1 /* Error */, key: "Duplicate function implementation." }, + Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: 1 /* Error */, key: "Overload signature is not compatible with function implementation." }, + Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: 1 /* Error */, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, + Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: 1 /* Error */, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, + Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: { code: 2397, category: 1 /* Error */, key: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter." }, + Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: { code: 2398, category: 1 /* Error */, key: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter." }, + Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: 1 /* Error */, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, + Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: 1 /* Error */, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, + Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: 1 /* Error */, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, + Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: 1 /* Error */, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, + Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: 1 /* Error */, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, + The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, + The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, + Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: 1 /* Error */, key: "Invalid left-hand side in 'for...in' statement." }, + The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: 1 /* Error */, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, + Setters_cannot_return_a_value: { code: 2408, category: 1 /* Error */, key: "Setters cannot return a value." }, + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: 1 /* Error */, key: "Return type of constructor signature must be assignable to the instance type of the class" }, + All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: 1 /* Error */, key: "All symbols within a 'with' block will be resolved to 'any'." }, + Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, + Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, + Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1 /* Error */, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, + Class_name_cannot_be_0: { code: 2414, category: 1 /* Error */, key: "Class name cannot be '{0}'" }, + Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}'." }, + Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, + Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1 /* Error */, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, + Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}'." }, + A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1 /* Error */, key: "A class may only implement another class or interface." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: 1 /* Error */, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1 /* Error */, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, + Interface_name_cannot_be_0: { code: 2427, category: 1 /* Error */, key: "Interface name cannot be '{0}'" }, + All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1 /* Error */, key: "All declarations of an interface must have identical type parameters." }, + Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}'." }, + Enum_name_cannot_be_0: { code: 2431, category: 1 /* Error */, key: "Enum name cannot be '{0}'" }, + In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: 1 /* Error */, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, + A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: 1 /* Error */, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, + A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: 1 /* Error */, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, + Ambient_external_modules_cannot_be_nested_in_other_modules: { code: 2435, category: 1 /* Error */, key: "Ambient external modules cannot be nested in other modules." }, + Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: 1 /* Error */, key: "Ambient external module declaration cannot specify relative module name." }, + Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: 1 /* Error */, key: "Module '{0}' is hidden by a local declaration with the same name" }, + Import_name_cannot_be_0: { code: 2438, category: 1 /* Error */, key: "Import name cannot be '{0}'" }, + Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: 1 /* Error */, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." }, + Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: 1 /* Error */, key: "Import declaration conflicts with local declaration of '{0}'" }, + Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { code: 2441, category: 1 /* Error */, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, + Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: 1 /* Error */, key: "Types have separate declarations of a private property '{0}'." }, + Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: 1 /* Error */, key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, + Property_0_is_protected_in_type_1_but_public_in_type_2: { code: 2444, category: 1 /* Error */, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, + Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, + Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, + The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: 1 /* Error */, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, + Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: 1 /* Error */, key: "Block-scoped variable '{0}' used before its declaration.", isEarly: true }, + The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: 1 /* Error */, key: "The operand of an increment or decrement operator cannot be a constant.", isEarly: true }, + Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: 1 /* Error */, key: "Left-hand side of assignment expression cannot be a constant.", isEarly: true }, + Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: 1 /* Error */, key: "Cannot redeclare block-scoped variable '{0}'.", isEarly: true }, + An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: 1 /* Error */, key: "An enum member cannot have a numeric name." }, + The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: 1 /* Error */, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, + Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: 1 /* Error */, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, + Type_alias_0_circularly_references_itself: { code: 2456, category: 1 /* Error */, key: "Type alias '{0}' circularly references itself." }, + Type_alias_name_cannot_be_0: { code: 2457, category: 1 /* Error */, key: "Type alias name cannot be '{0}'" }, + An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: 1 /* Error */, key: "An AMD module cannot have multiple name assignments." }, + Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1 /* Error */, key: "Import declaration '{0}' is using private name '{1}'." }, + Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, + Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4003, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4005, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4007, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4009, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4011, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4013, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, + Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4015, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, + Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, + Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4017, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, + Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4018, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, + Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, + Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, + Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2: { code: 4021, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'." }, + Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, + Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, + Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, + Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: 1 /* Error */, key: "Exported variable '{0}' has or is using private name '{1}'." }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, + Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, + Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, + Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using private name '{0}'." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, + Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: 1 /* Error */, key: "Return type of public method from exported class has or is using private name '{0}'." }, + Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: 1 /* Error */, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, + Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: 1 /* Error */, key: "Return type of method from exported interface has or is using private name '{0}'." }, + Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, + Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, + Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: 1 /* Error */, key: "Return type of exported function has or is using private name '{0}'." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, + Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, + Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, + Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4079, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, + Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2: { code: 4080, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using name '{1}' from private module '{2}'." }, + Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: 1 /* Error */, key: "Exported type alias '{0}' has or is using private name '{1}'." }, + Enum_declarations_must_all_be_const_or_non_const: { code: 4082, category: 1 /* Error */, key: "Enum declarations must all be const or non-const." }, + In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 4083, category: 1 /* Error */, key: "In 'const' enum declarations member initializer must be constant expression.", isEarly: true }, + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 4084, category: 1 /* Error */, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, + Index_expression_arguments_in_const_enums_must_be_of_type_string: { code: 4085, category: 1 /* Error */, key: "Index expression arguments in 'const' enums must be of type 'string'." }, + const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 4086, category: 1 /* Error */, key: "'const' enum member initializer was evaluated to a non-finite value." }, + const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 4087, category: 1 /* Error */, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, + The_current_host_does_not_support_the_0_option: { code: 5001, category: 1 /* Error */, key: "The current host does not support the '{0}' option." }, + Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1 /* Error */, key: "Cannot find the common subdirectory path for the input files." }, + Cannot_read_file_0_Colon_1: { code: 5012, category: 1 /* Error */, key: "Cannot read file '{0}': {1}" }, + Unsupported_file_encoding: { code: 5013, category: 1 /* Error */, key: "Unsupported file encoding." }, + Unknown_compiler_option_0: { code: 5023, category: 1 /* Error */, key: "Unknown compiler option '{0}'." }, + Could_not_write_file_0_Colon_1: { code: 5033, category: 1 /* Error */, key: "Could not write file '{0}': {1}" }, + Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: 1 /* Error */, key: "Option mapRoot cannot be specified without specifying sourcemap option." }, + Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: 1 /* Error */, key: "Option sourceRoot cannot be specified without specifying sourcemap option." }, + Concatenate_and_emit_output_to_single_file: { code: 6001, category: 2 /* Message */, key: "Concatenate and emit output to single file." }, + Generates_corresponding_d_ts_file: { code: 6002, category: 2 /* Message */, key: "Generates corresponding '.d.ts' file." }, + Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: 2 /* Message */, key: "Specifies the location where debugger should locate map files instead of generated locations." }, + Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: 2 /* Message */, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, + Watch_input_files: { code: 6005, category: 2 /* Message */, key: "Watch input files." }, + Redirect_output_structure_to_the_directory: { code: 6006, category: 2 /* Message */, key: "Redirect output structure to the directory." }, + Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: 2 /* Message */, key: "Do not erase const enum declarations in generated code." }, + Do_not_emit_outputs_if_any_type_checking_errors_were_reported: { code: 6008, category: 2 /* Message */, key: "Do not emit outputs if any type checking errors were reported." }, + Do_not_emit_comments_to_output: { code: 6009, category: 2 /* Message */, key: "Do not emit comments to output." }, + Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, + Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2 /* Message */, key: "Specify module code generation: 'commonjs' or 'amd'" }, + Print_this_message: { code: 6017, category: 2 /* Message */, key: "Print this message." }, + Print_the_compiler_s_version: { code: 6019, category: 2 /* Message */, key: "Print the compiler's version." }, + Syntax_Colon_0: { code: 6023, category: 2 /* Message */, key: "Syntax: {0}" }, + options: { code: 6024, category: 2 /* Message */, key: "options" }, + file: { code: 6025, category: 2 /* Message */, key: "file" }, + Examples_Colon_0: { code: 6026, category: 2 /* Message */, key: "Examples: {0}" }, + Options_Colon: { code: 6027, category: 2 /* Message */, key: "Options:" }, + Version_0: { code: 6029, category: 2 /* Message */, key: "Version {0}" }, + Insert_command_line_options_and_files_from_a_file: { code: 6030, category: 2 /* Message */, key: "Insert command line options and files from a file." }, + File_change_detected_Compiling: { code: 6032, category: 2 /* Message */, key: "File change detected. Compiling..." }, + KIND: { code: 6034, category: 2 /* Message */, key: "KIND" }, + FILE: { code: 6035, category: 2 /* Message */, key: "FILE" }, + VERSION: { code: 6036, category: 2 /* Message */, key: "VERSION" }, + LOCATION: { code: 6037, category: 2 /* Message */, key: "LOCATION" }, + DIRECTORY: { code: 6038, category: 2 /* Message */, key: "DIRECTORY" }, + Compilation_complete_Watching_for_file_changes: { code: 6042, category: 2 /* Message */, key: "Compilation complete. Watching for file changes." }, + Generates_corresponding_map_file: { code: 6043, category: 2 /* Message */, key: "Generates corresponding '.map' file." }, + Compiler_option_0_expects_an_argument: { code: 6044, category: 1 /* Error */, key: "Compiler option '{0}' expects an argument." }, + Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1 /* Error */, key: "Unterminated quoted string in response file '{0}'." }, + Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1 /* Error */, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, + Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." }, + Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: 1 /* Error */, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, + Unsupported_locale_0: { code: 6049, category: 1 /* Error */, key: "Unsupported locale '{0}'." }, + Unable_to_open_file_0: { code: 6050, category: 1 /* Error */, key: "Unable to open file '{0}'." }, + Corrupted_locale_file_0: { code: 6051, category: 1 /* Error */, key: "Corrupted locale file {0}." }, + Warn_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: 2 /* Message */, key: "Warn on expressions and declarations with an implied 'any' type." }, + File_0_not_found: { code: 6053, category: 1 /* Error */, key: "File '{0}' not found." }, + File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: 1 /* Error */, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, + Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1 /* Error */, key: "Variable '{0}' implicitly has an '{1}' type." }, + Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1 /* Error */, key: "Parameter '{0}' implicitly has an '{1}' type." }, + Member_0_implicitly_has_an_1_type: { code: 7008, category: 1 /* Error */, key: "Member '{0}' implicitly has an '{1}' type." }, + new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: 1 /* Error */, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, + _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: 1 /* Error */, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, + Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: 1 /* Error */, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, + Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: 1 /* Error */, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: 1 /* Error */, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, + Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1 /* Error */, key: "Index signature of object type implicitly has an 'any' type." }, + Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1 /* Error */, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, + Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1 /* Error */, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, + Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1 /* Error */, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, + _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 7021, category: 1 /* Error */, key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." }, + _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { code: 7022, category: 1 /* Error */, key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." }, + _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: { code: 7023, category: 1 /* Error */, key: "'{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." }, + 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: { code: 7024, category: 1 /* Error */, key: "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." }, + You_cannot_rename_this_element: { code: 8000, category: 1 /* Error */, key: "You cannot rename this element." } + }; +})(ts || (ts = {})); +var ts; +(function (ts) { + var textToToken = { + "any": 109 /* AnyKeyword */, + "boolean": 110 /* BooleanKeyword */, + "break": 64 /* BreakKeyword */, + "case": 65 /* CaseKeyword */, + "catch": 66 /* CatchKeyword */, + "class": 67 /* ClassKeyword */, + "continue": 69 /* ContinueKeyword */, + "const": 68 /* ConstKeyword */, + "constructor": 111 /* ConstructorKeyword */, + "debugger": 70 /* DebuggerKeyword */, + "declare": 112 /* DeclareKeyword */, + "default": 71 /* DefaultKeyword */, + "delete": 72 /* DeleteKeyword */, + "do": 73 /* DoKeyword */, + "else": 74 /* ElseKeyword */, + "enum": 75 /* EnumKeyword */, + "export": 76 /* ExportKeyword */, + "extends": 77 /* ExtendsKeyword */, + "false": 78 /* FalseKeyword */, + "finally": 79 /* FinallyKeyword */, + "for": 80 /* ForKeyword */, + "function": 81 /* FunctionKeyword */, + "get": 113 /* GetKeyword */, + "if": 82 /* IfKeyword */, + "implements": 100 /* ImplementsKeyword */, + "import": 83 /* ImportKeyword */, + "in": 84 /* InKeyword */, + "instanceof": 85 /* InstanceOfKeyword */, + "interface": 101 /* InterfaceKeyword */, + "let": 102 /* LetKeyword */, + "module": 114 /* ModuleKeyword */, + "new": 86 /* NewKeyword */, + "null": 87 /* NullKeyword */, + "number": 116 /* NumberKeyword */, + "package": 103 /* PackageKeyword */, + "private": 104 /* PrivateKeyword */, + "protected": 105 /* ProtectedKeyword */, + "public": 106 /* PublicKeyword */, + "require": 115 /* RequireKeyword */, + "return": 88 /* ReturnKeyword */, + "set": 117 /* SetKeyword */, + "static": 107 /* StaticKeyword */, + "string": 118 /* StringKeyword */, + "super": 89 /* SuperKeyword */, + "switch": 90 /* SwitchKeyword */, + "this": 91 /* ThisKeyword */, + "throw": 92 /* ThrowKeyword */, + "true": 93 /* TrueKeyword */, + "try": 94 /* TryKeyword */, + "type": 119 /* TypeKeyword */, + "typeof": 95 /* TypeOfKeyword */, + "var": 96 /* VarKeyword */, + "void": 97 /* VoidKeyword */, + "while": 98 /* WhileKeyword */, + "with": 99 /* WithKeyword */, + "yield": 108 /* YieldKeyword */, + "{": 13 /* OpenBraceToken */, + "}": 14 /* CloseBraceToken */, + "(": 15 /* OpenParenToken */, + ")": 16 /* CloseParenToken */, + "[": 17 /* OpenBracketToken */, + "]": 18 /* CloseBracketToken */, + ".": 19 /* DotToken */, + "...": 20 /* DotDotDotToken */, + ";": 21 /* SemicolonToken */, + ",": 22 /* CommaToken */, + "<": 23 /* LessThanToken */, + ">": 24 /* GreaterThanToken */, + "<=": 25 /* LessThanEqualsToken */, + ">=": 26 /* GreaterThanEqualsToken */, + "==": 27 /* EqualsEqualsToken */, + "!=": 28 /* ExclamationEqualsToken */, + "===": 29 /* EqualsEqualsEqualsToken */, + "!==": 30 /* ExclamationEqualsEqualsToken */, + "=>": 31 /* EqualsGreaterThanToken */, + "+": 32 /* PlusToken */, + "-": 33 /* MinusToken */, + "*": 34 /* AsteriskToken */, + "/": 35 /* SlashToken */, + "%": 36 /* PercentToken */, + "++": 37 /* PlusPlusToken */, + "--": 38 /* MinusMinusToken */, + "<<": 39 /* LessThanLessThanToken */, + ">>": 40 /* GreaterThanGreaterThanToken */, + ">>>": 41 /* GreaterThanGreaterThanGreaterThanToken */, + "&": 42 /* AmpersandToken */, + "|": 43 /* BarToken */, + "^": 44 /* CaretToken */, + "!": 45 /* ExclamationToken */, + "~": 46 /* TildeToken */, + "&&": 47 /* AmpersandAmpersandToken */, + "||": 48 /* BarBarToken */, + "?": 49 /* QuestionToken */, + ":": 50 /* ColonToken */, + "=": 51 /* EqualsToken */, + "+=": 52 /* PlusEqualsToken */, + "-=": 53 /* MinusEqualsToken */, + "*=": 54 /* AsteriskEqualsToken */, + "/=": 55 /* SlashEqualsToken */, + "%=": 56 /* PercentEqualsToken */, + "<<=": 57 /* LessThanLessThanEqualsToken */, + ">>=": 58 /* GreaterThanGreaterThanEqualsToken */, + ">>>=": 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */, + "&=": 60 /* AmpersandEqualsToken */, + "|=": 61 /* BarEqualsToken */, + "^=": 62 /* CaretEqualsToken */ + }; + var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; + function lookupInUnicodeMap(code, map) { + if (code < map[0]) { + return false; + } + var lo = 0; + var hi = map.length; + var mid; + while (lo + 1 < hi) { + mid = lo + (hi - lo) / 2; + mid -= mid % 2; + if (map[mid] <= code && code <= map[mid + 1]) { + return true; + } + if (code < map[mid]) { + hi = mid; + } + else { + lo = mid + 2; + } + } + return false; + } + function isUnicodeIdentifierStart(code, languageVersion) { + return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierStart) : lookupInUnicodeMap(code, unicodeES5IdentifierStart); + } + function isUnicodeIdentifierPart(code, languageVersion) { + return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierPart) : lookupInUnicodeMap(code, unicodeES5IdentifierPart); + } + function makeReverseMap(source) { + var result = []; + for (var name in source) { + if (source.hasOwnProperty(name)) { + result[source[name]] = name; + } + } + return result; + } + var tokenStrings = makeReverseMap(textToToken); + function tokenToString(t) { + return tokenStrings[t]; + } + ts.tokenToString = tokenToString; + function computeLineStarts(text) { + var result = new Array(); + var pos = 0; + var lineStart = 0; + while (pos < text.length) { + var ch = text.charCodeAt(pos++); + switch (ch) { + case 13 /* carriageReturn */: + if (text.charCodeAt(pos) === 10 /* lineFeed */) { + pos++; + } + case 10 /* lineFeed */: + result.push(lineStart); + lineStart = pos; + break; + default: + if (ch > 127 /* maxAsciiCharacter */ && isLineBreak(ch)) { + result.push(lineStart); + lineStart = pos; + } + break; + } + } + result.push(lineStart); + return result; + } + ts.computeLineStarts = computeLineStarts; + function getPositionFromLineAndCharacter(lineStarts, line, character) { + ts.Debug.assert(line > 0); + return lineStarts[line - 1] + character - 1; + } + ts.getPositionFromLineAndCharacter = getPositionFromLineAndCharacter; + function getLineAndCharacterOfPosition(lineStarts, position) { + var lineNumber = ts.binarySearch(lineStarts, position); + if (lineNumber < 0) { + lineNumber = (~lineNumber) - 1; + } + return { + line: lineNumber + 1, + character: position - lineStarts[lineNumber] + 1 + }; + } + ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; + function positionToLineAndCharacter(text, pos) { + var lineStarts = computeLineStarts(text); + return getLineAndCharacterOfPosition(lineStarts, pos); + } + ts.positionToLineAndCharacter = positionToLineAndCharacter; + var hasOwnProperty = Object.prototype.hasOwnProperty; + function isWhiteSpace(ch) { + return ch === 32 /* space */ || ch === 9 /* tab */ || ch === 11 /* verticalTab */ || ch === 12 /* formFeed */ || ch === 160 /* nonBreakingSpace */ || ch === 5760 /* ogham */ || ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ || ch === 8239 /* narrowNoBreakSpace */ || ch === 8287 /* mathematicalSpace */ || ch === 12288 /* ideographicSpace */ || ch === 65279 /* byteOrderMark */; + } + ts.isWhiteSpace = isWhiteSpace; + function isLineBreak(ch) { + return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */ || ch === 133 /* nextLine */; + } + ts.isLineBreak = isLineBreak; + function isDigit(ch) { + return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; + } + function isOctalDigit(ch) { + return ch >= 48 /* _0 */ && ch <= 55 /* _7 */; + } + ts.isOctalDigit = isOctalDigit; + function skipTrivia(text, pos, stopAfterLineBreak) { + while (true) { + var ch = text.charCodeAt(pos); + switch (ch) { + case 13 /* carriageReturn */: + if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) + pos++; + case 10 /* lineFeed */: + pos++; + if (stopAfterLineBreak) + return pos; + continue; + case 9 /* tab */: + case 11 /* verticalTab */: + case 12 /* formFeed */: + case 32 /* space */: + pos++; + continue; + case 47 /* slash */: + if (text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + while (pos < text.length) { + if (isLineBreak(text.charCodeAt(pos))) { + break; + } + pos++; + } + continue; + } + if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { + pos += 2; + while (pos < text.length) { + if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + break; + } + pos++; + } + continue; + } + break; + default: + if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { + pos++; + continue; + } + break; + } + return pos; + } + } + ts.skipTrivia = skipTrivia; + function getCommentRanges(text, pos, trailing) { + var result; + var collecting = trailing || pos === 0; + while (true) { + var ch = text.charCodeAt(pos); + switch (ch) { + case 13 /* carriageReturn */: + if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) + pos++; + case 10 /* lineFeed */: + pos++; + if (trailing) { + return result; + } + collecting = true; + if (result && result.length) { + result[result.length - 1].hasTrailingNewLine = true; + } + continue; + case 9 /* tab */: + case 11 /* verticalTab */: + case 12 /* formFeed */: + case 32 /* space */: + pos++; + continue; + case 47 /* slash */: + var nextChar = text.charCodeAt(pos + 1); + var hasTrailingNewLine = false; + if (nextChar === 47 /* slash */ || nextChar === 42 /* asterisk */) { + var startPos = pos; + pos += 2; + if (nextChar === 47 /* slash */) { + while (pos < text.length) { + if (isLineBreak(text.charCodeAt(pos))) { + hasTrailingNewLine = true; + break; + } + pos++; + } + } + else { + while (pos < text.length) { + if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + break; + } + pos++; + } + } + if (collecting) { + if (!result) + result = []; + result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); + } + continue; + } + break; + default: + if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { + if (result && result.length && isLineBreak(ch)) { + result[result.length - 1].hasTrailingNewLine = true; + } + pos++; + continue; + } + break; + } + return result; + } + } + function getLeadingCommentRanges(text, pos) { + return getCommentRanges(text, pos, false); + } + ts.getLeadingCommentRanges = getLeadingCommentRanges; + function getTrailingCommentRanges(text, pos) { + return getCommentRanges(text, pos, true); + } + ts.getTrailingCommentRanges = getTrailingCommentRanges; + function isIdentifierStart(ch, languageVersion) { + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); + } + ts.isIdentifierStart = isIdentifierStart; + function isIdentifierPart(ch, languageVersion) { + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); + } + ts.isIdentifierPart = isIdentifierPart; + function createScanner(languageVersion, skipTrivia, text, onError, onComment) { + var pos; + var len; + var startPos; + var tokenPos; + var token; + var tokenValue; + var precedingLineBreak; + function error(message) { + if (onError) { + onError(message); + } + } + function isIdentifierStart(ch) { + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); + } + function isIdentifierPart(ch) { + return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); + } + function scanNumber() { + var start = pos; + while (isDigit(text.charCodeAt(pos))) + pos++; + if (text.charCodeAt(pos) === 46 /* dot */) { + pos++; + while (isDigit(text.charCodeAt(pos))) + pos++; + } + var end = pos; + if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { + pos++; + if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) + pos++; + if (isDigit(text.charCodeAt(pos))) { + pos++; + while (isDigit(text.charCodeAt(pos))) + pos++; + end = pos; + } + else { + error(ts.Diagnostics.Digit_expected); + } + } + return +(text.substring(start, end)); + } + function scanOctalDigits() { + var start = pos; + while (isOctalDigit(text.charCodeAt(pos))) { + pos++; + } + return +(text.substring(start, pos)); + } + function scanHexDigits(count, mustMatchCount) { + var digits = 0; + var value = 0; + while (digits < count || !mustMatchCount) { + var ch = text.charCodeAt(pos); + if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { + value = value * 16 + ch - 48 /* _0 */; + } + else if (ch >= 65 /* A */ && ch <= 70 /* F */) { + value = value * 16 + ch - 65 /* A */ + 10; + } + else if (ch >= 97 /* a */ && ch <= 102 /* f */) { + value = value * 16 + ch - 97 /* a */ + 10; + } + else { + break; + } + pos++; + digits++; + } + if (digits < count) { + value = -1; + } + return value; + } + function scanString() { + var quote = text.charCodeAt(pos++); + var result = ""; + var start = pos; + while (true) { + if (pos >= len) { + result += text.substring(start, pos); + error(ts.Diagnostics.Unterminated_string_literal); + break; + } + var ch = text.charCodeAt(pos); + if (ch === quote) { + result += text.substring(start, pos); + pos++; + break; + } + if (ch === 92 /* backslash */) { + result += text.substring(start, pos); + result += scanEscapeSequence(); + start = pos; + continue; + } + if (isLineBreak(ch)) { + result += text.substring(start, pos); + error(ts.Diagnostics.Unterminated_string_literal); + break; + } + pos++; + } + return result; + } + function scanTemplateAndSetTokenValue() { + var startedWithBacktick = text.charCodeAt(pos) === 96 /* backtick */; + pos++; + var start = pos; + var contents = ""; + var resultingToken; + while (true) { + if (pos >= len) { + contents += text.substring(start, pos); + error(ts.Diagnostics.Unterminated_template_literal); + resultingToken = startedWithBacktick ? 9 /* NoSubstitutionTemplateLiteral */ : 12 /* TemplateTail */; + break; + } + var currChar = text.charCodeAt(pos); + if (currChar === 96 /* backtick */) { + contents += text.substring(start, pos); + pos++; + resultingToken = startedWithBacktick ? 9 /* NoSubstitutionTemplateLiteral */ : 12 /* TemplateTail */; + break; + } + if (currChar === 36 /* $ */ && pos + 1 < len && text.charCodeAt(pos + 1) === 123 /* openBrace */) { + contents += text.substring(start, pos); + pos += 2; + resultingToken = startedWithBacktick ? 10 /* TemplateHead */ : 11 /* TemplateMiddle */; + break; + } + if (currChar === 92 /* backslash */) { + contents += text.substring(start, pos); + contents += scanEscapeSequence(); + start = pos; + continue; + } + if (currChar === 13 /* carriageReturn */) { + contents += text.substring(start, pos); + if (pos + 1 < len && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { + pos++; + } + pos++; + contents += "\n"; + start = pos; + continue; + } + pos++; + } + ts.Debug.assert(resultingToken !== undefined); + tokenValue = contents; + return resultingToken; + } + function scanEscapeSequence() { + pos++; + if (pos >= len) { + error(ts.Diagnostics.Unexpected_end_of_text); + return ""; + } + var ch = text.charCodeAt(pos++); + switch (ch) { + case 48 /* _0 */: + return "\0"; + case 98 /* b */: + return "\b"; + case 116 /* t */: + return "\t"; + case 110 /* n */: + return "\n"; + case 118 /* v */: + return "\v"; + case 102 /* f */: + return "\f"; + case 114 /* r */: + return "\r"; + case 39 /* singleQuote */: + return "\'"; + case 34 /* doubleQuote */: + return "\""; + case 120 /* x */: + case 117 /* u */: + var ch = scanHexDigits(ch === 120 /* x */ ? 2 : 4, true); + if (ch >= 0) { + return String.fromCharCode(ch); + } + else { + error(ts.Diagnostics.Hexadecimal_digit_expected); + return ""; + } + case 13 /* carriageReturn */: + if (pos < len && text.charCodeAt(pos) === 10 /* lineFeed */) { + pos++; + } + case 10 /* lineFeed */: + case 8232 /* lineSeparator */: + case 8233 /* paragraphSeparator */: + return ""; + default: + return String.fromCharCode(ch); + } + } + function peekUnicodeEscape() { + if (pos + 5 < len && text.charCodeAt(pos + 1) === 117 /* u */) { + var start = pos; + pos += 2; + var value = scanHexDigits(4, true); + pos = start; + return value; + } + return -1; + } + function scanIdentifierParts() { + var result = ""; + var start = pos; + while (pos < len) { + var ch = text.charCodeAt(pos); + if (isIdentifierPart(ch)) { + pos++; + } + else if (ch === 92 /* backslash */) { + ch = peekUnicodeEscape(); + if (!(ch >= 0 && isIdentifierPart(ch))) { + break; + } + result += text.substring(start, pos); + result += String.fromCharCode(ch); + pos += 6; + start = pos; + } + else { + break; + } + } + result += text.substring(start, pos); + return result; + } + function getIdentifierToken() { + var len = tokenValue.length; + if (len >= 2 && len <= 11) { + var ch = tokenValue.charCodeAt(0); + if (ch >= 97 /* a */ && ch <= 122 /* z */ && hasOwnProperty.call(textToToken, tokenValue)) { + return token = textToToken[tokenValue]; + } + } + return token = 63 /* Identifier */; + } + function scan() { + startPos = pos; + precedingLineBreak = false; + while (true) { + tokenPos = pos; + if (pos >= len) { + return token = 1 /* EndOfFileToken */; + } + var ch = text.charCodeAt(pos); + switch (ch) { + case 10 /* lineFeed */: + case 13 /* carriageReturn */: + precedingLineBreak = true; + if (skipTrivia) { + pos++; + continue; + } + else { + if (ch === 13 /* carriageReturn */ && pos + 1 < len && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { + pos += 2; + } + else { + pos++; + } + return token = 4 /* NewLineTrivia */; + } + case 9 /* tab */: + case 11 /* verticalTab */: + case 12 /* formFeed */: + case 32 /* space */: + if (skipTrivia) { + pos++; + continue; + } + else { + while (pos < len && isWhiteSpace(text.charCodeAt(pos))) { + pos++; + } + return token = 5 /* WhitespaceTrivia */; + } + case 33 /* exclamation */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 30 /* ExclamationEqualsEqualsToken */; + } + return pos += 2, token = 28 /* ExclamationEqualsToken */; + } + return pos++, token = 45 /* ExclamationToken */; + case 34 /* doubleQuote */: + case 39 /* singleQuote */: + tokenValue = scanString(); + return token = 7 /* StringLiteral */; + case 96 /* backtick */: + return token = scanTemplateAndSetTokenValue(); + case 37 /* percent */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 56 /* PercentEqualsToken */; + } + return pos++, token = 36 /* PercentToken */; + case 38 /* ampersand */: + if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { + return pos += 2, token = 47 /* AmpersandAmpersandToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 60 /* AmpersandEqualsToken */; + } + return pos++, token = 42 /* AmpersandToken */; + case 40 /* openParen */: + return pos++, token = 15 /* OpenParenToken */; + case 41 /* closeParen */: + return pos++, token = 16 /* CloseParenToken */; + case 42 /* asterisk */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 54 /* AsteriskEqualsToken */; + } + return pos++, token = 34 /* AsteriskToken */; + case 43 /* plus */: + if (text.charCodeAt(pos + 1) === 43 /* plus */) { + return pos += 2, token = 37 /* PlusPlusToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 52 /* PlusEqualsToken */; + } + return pos++, token = 32 /* PlusToken */; + case 44 /* comma */: + return pos++, token = 22 /* CommaToken */; + case 45 /* minus */: + if (text.charCodeAt(pos + 1) === 45 /* minus */) { + return pos += 2, token = 38 /* MinusMinusToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 53 /* MinusEqualsToken */; + } + return pos++, token = 33 /* MinusToken */; + case 46 /* dot */: + if (isDigit(text.charCodeAt(pos + 1))) { + tokenValue = "" + scanNumber(); + return token = 6 /* NumericLiteral */; + } + if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { + return pos += 3, token = 20 /* DotDotDotToken */; + } + return pos++, token = 19 /* DotToken */; + case 47 /* slash */: + if (text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + while (pos < len) { + if (isLineBreak(text.charCodeAt(pos))) { + break; + } + pos++; + } + if (onComment) { + onComment(tokenPos, pos); + } + if (skipTrivia) { + continue; + } + else { + return token = 2 /* SingleLineCommentTrivia */; + } + } + if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { + pos += 2; + var commentClosed = false; + while (pos < len) { + var ch = text.charCodeAt(pos); + if (ch === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + commentClosed = true; + break; + } + if (isLineBreak(ch)) { + precedingLineBreak = true; + } + pos++; + } + if (!commentClosed) { + error(ts.Diagnostics.Asterisk_Slash_expected); + } + if (onComment) { + onComment(tokenPos, pos); + } + if (skipTrivia) { + continue; + } + else { + return token = 3 /* MultiLineCommentTrivia */; + } + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 55 /* SlashEqualsToken */; + } + return pos++, token = 35 /* SlashToken */; + case 48 /* _0 */: + if (pos + 2 < len && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { + pos += 2; + var value = scanHexDigits(1, false); + if (value < 0) { + error(ts.Diagnostics.Hexadecimal_digit_expected); + value = 0; + } + tokenValue = "" + value; + return token = 6 /* NumericLiteral */; + } + if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { + tokenValue = "" + scanOctalDigits(); + return token = 6 /* NumericLiteral */; + } + case 49 /* _1 */: + case 50 /* _2 */: + case 51 /* _3 */: + case 52 /* _4 */: + case 53 /* _5 */: + case 54 /* _6 */: + case 55 /* _7 */: + case 56 /* _8 */: + case 57 /* _9 */: + tokenValue = "" + scanNumber(); + return token = 6 /* NumericLiteral */; + case 58 /* colon */: + return pos++, token = 50 /* ColonToken */; + case 59 /* semicolon */: + return pos++, token = 21 /* SemicolonToken */; + case 60 /* lessThan */: + if (text.charCodeAt(pos + 1) === 60 /* lessThan */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 57 /* LessThanLessThanEqualsToken */; + } + return pos += 2, token = 39 /* LessThanLessThanToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 25 /* LessThanEqualsToken */; + } + return pos++, token = 23 /* LessThanToken */; + case 61 /* equals */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 29 /* EqualsEqualsEqualsToken */; + } + return pos += 2, token = 27 /* EqualsEqualsToken */; + } + if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { + return pos += 2, token = 31 /* EqualsGreaterThanToken */; + } + return pos++, token = 51 /* EqualsToken */; + case 62 /* greaterThan */: + return pos++, token = 24 /* GreaterThanToken */; + case 63 /* question */: + return pos++, token = 49 /* QuestionToken */; + case 91 /* openBracket */: + return pos++, token = 17 /* OpenBracketToken */; + case 93 /* closeBracket */: + return pos++, token = 18 /* CloseBracketToken */; + case 94 /* caret */: + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 62 /* CaretEqualsToken */; + } + return pos++, token = 44 /* CaretToken */; + case 123 /* openBrace */: + return pos++, token = 13 /* OpenBraceToken */; + case 124 /* bar */: + if (text.charCodeAt(pos + 1) === 124 /* bar */) { + return pos += 2, token = 48 /* BarBarToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 61 /* BarEqualsToken */; + } + return pos++, token = 43 /* BarToken */; + case 125 /* closeBrace */: + return pos++, token = 14 /* CloseBraceToken */; + case 126 /* tilde */: + return pos++, token = 46 /* TildeToken */; + case 92 /* backslash */: + var ch = peekUnicodeEscape(); + if (ch >= 0 && isIdentifierStart(ch)) { + pos += 6; + tokenValue = String.fromCharCode(ch) + scanIdentifierParts(); + return token = getIdentifierToken(); + } + error(ts.Diagnostics.Invalid_character); + return pos++, token = 0 /* Unknown */; + default: + if (isIdentifierStart(ch)) { + pos++; + while (pos < len && isIdentifierPart(ch = text.charCodeAt(pos))) + pos++; + tokenValue = text.substring(tokenPos, pos); + if (ch === 92 /* backslash */) { + tokenValue += scanIdentifierParts(); + } + return token = getIdentifierToken(); + } + else if (isWhiteSpace(ch)) { + pos++; + continue; + } + else if (isLineBreak(ch)) { + precedingLineBreak = true; + pos++; + continue; + } + error(ts.Diagnostics.Invalid_character); + return pos++, token = 0 /* Unknown */; + } + } + } + function reScanGreaterToken() { + if (token === 24 /* GreaterThanToken */) { + if (text.charCodeAt(pos) === 62 /* greaterThan */) { + if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { + if (text.charCodeAt(pos + 2) === 61 /* equals */) { + return pos += 3, token = 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */; + } + return pos += 2, token = 41 /* GreaterThanGreaterThanGreaterThanToken */; + } + if (text.charCodeAt(pos + 1) === 61 /* equals */) { + return pos += 2, token = 58 /* GreaterThanGreaterThanEqualsToken */; + } + return pos++, token = 40 /* GreaterThanGreaterThanToken */; + } + if (text.charCodeAt(pos) === 61 /* equals */) { + return pos++, token = 26 /* GreaterThanEqualsToken */; + } + } + return token; + } + function reScanSlashToken() { + if (token === 35 /* SlashToken */ || token === 55 /* SlashEqualsToken */) { + var p = tokenPos + 1; + var inEscape = false; + var inCharacterClass = false; + while (true) { + if (p >= len) { + error(ts.Diagnostics.Unterminated_regular_expression_literal); + break; + } + var ch = text.charCodeAt(p); + if (isLineBreak(ch)) { + error(ts.Diagnostics.Unterminated_regular_expression_literal); + break; + } + if (inEscape) { + inEscape = false; + } + else if (ch === 47 /* slash */ && !inCharacterClass) { + p++; + break; + } + else if (ch === 91 /* openBracket */) { + inCharacterClass = true; + } + else if (ch === 92 /* backslash */) { + inEscape = true; + } + else if (ch === 93 /* closeBracket */) { + inCharacterClass = false; + } + p++; + } + while (p < len && isIdentifierPart(text.charCodeAt(p))) { + p++; + } + pos = p; + tokenValue = text.substring(tokenPos, pos); + token = 8 /* RegularExpressionLiteral */; + } + return token; + } + function reScanTemplateToken() { + ts.Debug.assert(token === 14 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'"); + pos = tokenPos; + return token = scanTemplateAndSetTokenValue(); + } + function tryScan(callback) { + var savePos = pos; + var saveStartPos = startPos; + var saveTokenPos = tokenPos; + var saveToken = token; + var saveTokenValue = tokenValue; + var savePrecedingLineBreak = precedingLineBreak; + var result = callback(); + if (!result) { + pos = savePos; + startPos = saveStartPos; + tokenPos = saveTokenPos; + token = saveToken; + tokenValue = saveTokenValue; + precedingLineBreak = savePrecedingLineBreak; + } + return result; + } + function setText(newText) { + text = newText || ""; + len = text.length; + setTextPos(0); + } + function setTextPos(textPos) { + pos = textPos; + startPos = textPos; + tokenPos = textPos; + token = 0 /* Unknown */; + precedingLineBreak = false; + } + setText(text); + return { + getStartPos: function () { return startPos; }, + getTextPos: function () { return pos; }, + getToken: function () { return token; }, + getTokenPos: function () { return tokenPos; }, + getTokenText: function () { return text.substring(tokenPos, pos); }, + getTokenValue: function () { return tokenValue; }, + hasPrecedingLineBreak: function () { return precedingLineBreak; }, + isIdentifier: function () { return token === 63 /* Identifier */ || token > 99 /* LastReservedWord */; }, + isReservedWord: function () { return token >= 64 /* FirstReservedWord */ && token <= 99 /* LastReservedWord */; }, + reScanGreaterToken: reScanGreaterToken, + reScanSlashToken: reScanSlashToken, + reScanTemplateToken: reScanTemplateToken, + scan: scan, + setText: setText, + setTextPos: setTextPos, + tryScan: tryScan + }; + } + ts.createScanner = createScanner; +})(ts || (ts = {})); +var ts; +(function (ts) { + var nodeConstructors = new Array(199 /* Count */); function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); } @@ -2010,7 +2024,7 @@ var ts; return node; } function getSourceFileOfNode(node) { - while (node && node.kind !== 193 /* SourceFile */) + while (node && node.kind !== 196 /* SourceFile */) node = node.parent; return node; } @@ -2026,6 +2040,9 @@ var ts; } ts.getStartPosOfNode = getStartPosOfNode; function getTokenPosOfNode(node, sourceFile) { + if (node.pos === node.end) { + return node.pos; + } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); } ts.getTokenPosOfNode = getTokenPosOfNode; @@ -2046,10 +2063,10 @@ var ts; return identifier.length >= 3 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ && identifier.charCodeAt(2) === 95 /* _ */ ? identifier.substr(1) : identifier; } ts.unescapeIdentifier = unescapeIdentifier; - function identifierToString(identifier) { - return identifier.kind === 120 /* Missing */ ? "(Missing)" : getTextOfNode(identifier); + function declarationNameToString(name) { + return name.kind === 120 /* Missing */ ? "(Missing)" : getTextOfNode(name); } - ts.identifierToString = identifierToString; + ts.declarationNameToString = declarationNameToString; function createDiagnosticForNode(node, message, arg0, arg1, arg2) { node = getErrorSpanForNode(node); var file = getSourceFileOfNode(node); @@ -2069,12 +2086,12 @@ var ts; function getErrorSpanForNode(node) { var errorSpan; switch (node.kind) { - case 181 /* VariableDeclaration */: - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: - case 188 /* ModuleDeclaration */: - case 187 /* EnumDeclaration */: - case 192 /* EnumMember */: + case 184 /* VariableDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 191 /* ModuleDeclaration */: + case 190 /* EnumDeclaration */: + case 195 /* EnumMember */: errorSpan = node.name; break; } @@ -2094,7 +2111,7 @@ var ts; } ts.isConstEnumDeclaration = isConstEnumDeclaration; function isPrologueDirective(node) { - return node.kind === 161 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; + return node.kind === 164 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; function isEvalOrArgumentsIdentifier(node) { @@ -2149,8 +2166,11 @@ var ts; case 123 /* Parameter */: return child(node.name) || child(node.type) || child(node.initializer); case 124 /* Property */: - case 141 /* PropertyAssignment */: + case 143 /* PropertyAssignment */: + case 144 /* ShorthandPropertyAssignment */: return child(node.name) || child(node.type) || child(node.initializer); + case 133 /* FunctionType */: + case 134 /* ConstructorType */: case 129 /* CallSignature */: case 130 /* ConstructSignature */: case 131 /* IndexSignature */: @@ -2159,110 +2179,110 @@ var ts; case 126 /* Constructor */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 149 /* FunctionExpression */: - case 182 /* FunctionDeclaration */: - case 150 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + case 153 /* ArrowFunction */: return child(node.name) || children(node.typeParameters) || children(node.parameters) || child(node.type) || child(node.body); case 132 /* TypeReference */: return child(node.typeName) || children(node.typeArguments); - case 133 /* TypeQuery */: + case 135 /* TypeQuery */: return child(node.exprName); - case 134 /* TypeLiteral */: + case 136 /* TypeLiteral */: return children(node.members); - case 135 /* ArrayType */: + case 137 /* ArrayType */: return child(node.elementType); - case 136 /* TupleType */: + case 138 /* TupleType */: return children(node.elementTypes); - case 137 /* UnionType */: + case 139 /* UnionType */: return children(node.types); - case 138 /* ParenType */: + case 140 /* ParenType */: return child(node.type); - case 139 /* ArrayLiteral */: + case 141 /* ArrayLiteral */: return children(node.elements); - case 140 /* ObjectLiteral */: + case 142 /* ObjectLiteral */: return children(node.properties); - case 142 /* PropertyAccess */: + case 145 /* PropertyAccess */: return child(node.left) || child(node.right); - case 143 /* IndexedAccess */: + case 146 /* IndexedAccess */: return child(node.object) || child(node.index); - case 144 /* CallExpression */: - case 145 /* NewExpression */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: return child(node.func) || children(node.typeArguments) || children(node.arguments); - case 146 /* TaggedTemplateExpression */: + case 149 /* TaggedTemplateExpression */: return child(node.tag) || child(node.template); - case 147 /* TypeAssertion */: + case 150 /* TypeAssertion */: return child(node.type) || child(node.operand); - case 148 /* ParenExpression */: + case 151 /* ParenExpression */: return child(node.expression); - case 151 /* PrefixOperator */: - case 152 /* PostfixOperator */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: return child(node.operand); - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: return child(node.left) || child(node.right); - case 154 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return child(node.condition) || child(node.whenTrue) || child(node.whenFalse); - case 158 /* Block */: - case 177 /* TryBlock */: - case 179 /* FinallyBlock */: - case 183 /* FunctionBlock */: - case 189 /* ModuleBlock */: - case 193 /* SourceFile */: + case 161 /* Block */: + case 180 /* TryBlock */: + case 182 /* FinallyBlock */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: + case 196 /* SourceFile */: return children(node.statements); - case 159 /* VariableStatement */: + case 162 /* VariableStatement */: return children(node.declarations); - case 161 /* ExpressionStatement */: + case 164 /* ExpressionStatement */: return child(node.expression); - case 162 /* IfStatement */: + case 165 /* IfStatement */: return child(node.expression) || child(node.thenStatement) || child(node.elseStatement); - case 163 /* DoStatement */: + case 166 /* DoStatement */: return child(node.statement) || child(node.expression); - case 164 /* WhileStatement */: + case 167 /* WhileStatement */: return child(node.expression) || child(node.statement); - case 165 /* ForStatement */: + case 168 /* ForStatement */: return children(node.declarations) || child(node.initializer) || child(node.condition) || child(node.iterator) || child(node.statement); - case 166 /* ForInStatement */: - return child(node.declaration) || child(node.variable) || child(node.expression) || child(node.statement); - case 167 /* ContinueStatement */: - case 168 /* BreakStatement */: + case 169 /* ForInStatement */: + return children(node.declarations) || child(node.variable) || child(node.expression) || child(node.statement); + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: return child(node.label); - case 169 /* ReturnStatement */: + case 172 /* ReturnStatement */: return child(node.expression); - case 170 /* WithStatement */: + case 173 /* WithStatement */: return child(node.expression) || child(node.statement); - case 171 /* SwitchStatement */: + case 174 /* SwitchStatement */: return child(node.expression) || children(node.clauses); - case 172 /* CaseClause */: - case 173 /* DefaultClause */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: return child(node.expression) || children(node.statements); - case 174 /* LabeledStatement */: + case 177 /* LabeledStatement */: return child(node.label) || child(node.statement); - case 175 /* ThrowStatement */: + case 178 /* ThrowStatement */: return child(node.expression); - case 176 /* TryStatement */: + case 179 /* TryStatement */: return child(node.tryBlock) || child(node.catchBlock) || child(node.finallyBlock); - case 178 /* CatchBlock */: + case 181 /* CatchBlock */: return child(node.variable) || children(node.statements); - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: return child(node.name) || child(node.type) || child(node.initializer); - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: return child(node.name) || children(node.typeParameters) || child(node.baseType) || children(node.implementedTypes) || children(node.members); - case 185 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: return child(node.name) || children(node.typeParameters) || children(node.baseTypes) || children(node.members); - case 186 /* TypeAliasDeclaration */: + case 189 /* TypeAliasDeclaration */: return child(node.name) || child(node.type); - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: return child(node.name) || children(node.members); - case 192 /* EnumMember */: + case 195 /* EnumMember */: return child(node.name) || child(node.initializer); - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return child(node.name) || child(node.body); - case 190 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: return child(node.name) || child(node.entityName) || child(node.externalModuleName); - case 191 /* ExportAssignment */: + case 194 /* ExportAssignment */: return child(node.exportName); - case 155 /* TemplateExpression */: + case 158 /* TemplateExpression */: return child(node.head) || children(node.templateSpans); - case 156 /* TemplateSpan */: + case 159 /* TemplateSpan */: return child(node.expression) || child(node.literal); } } @@ -2271,24 +2291,24 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 169 /* ReturnStatement */: + case 172 /* ReturnStatement */: return visitor(node); - case 158 /* Block */: - case 183 /* FunctionBlock */: - case 162 /* IfStatement */: - case 163 /* DoStatement */: - case 164 /* WhileStatement */: - case 165 /* ForStatement */: - case 166 /* ForInStatement */: - case 170 /* WithStatement */: - case 171 /* SwitchStatement */: - case 172 /* CaseClause */: - case 173 /* DefaultClause */: - case 174 /* LabeledStatement */: - case 176 /* TryStatement */: - case 177 /* TryBlock */: - case 178 /* CatchBlock */: - case 179 /* FinallyBlock */: + case 161 /* Block */: + case 186 /* FunctionBlock */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 173 /* WithStatement */: + case 174 /* SwitchStatement */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: + case 177 /* LabeledStatement */: + case 179 /* TryStatement */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: return forEachChild(node, traverse); } } @@ -2297,9 +2317,9 @@ var ts; function isAnyFunction(node) { if (node) { switch (node.kind) { - case 149 /* FunctionExpression */: - case 182 /* FunctionDeclaration */: - case 150 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + case 153 /* ArrowFunction */: case 125 /* Method */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: @@ -2326,20 +2346,20 @@ var ts; return undefined; } switch (node.kind) { - case 150 /* ArrowFunction */: + case 153 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } - case 182 /* FunctionDeclaration */: - case 149 /* FunctionExpression */: - case 188 /* ModuleDeclaration */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 191 /* ModuleDeclaration */: case 124 /* Property */: case 125 /* Method */: case 126 /* Constructor */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 187 /* EnumDeclaration */: - case 193 /* SourceFile */: + case 190 /* EnumDeclaration */: + case 196 /* SourceFile */: return node; } } @@ -2370,60 +2390,62 @@ var ts; case 93 /* TrueKeyword */: case 78 /* FalseKeyword */: case 8 /* RegularExpressionLiteral */: - case 139 /* ArrayLiteral */: - case 140 /* ObjectLiteral */: - case 142 /* PropertyAccess */: - case 143 /* IndexedAccess */: - case 144 /* CallExpression */: - case 145 /* NewExpression */: - case 146 /* TaggedTemplateExpression */: - case 147 /* TypeAssertion */: - case 148 /* ParenExpression */: - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: - case 151 /* PrefixOperator */: - case 152 /* PostfixOperator */: - case 153 /* BinaryExpression */: - case 154 /* ConditionalExpression */: - case 155 /* TemplateExpression */: - case 157 /* OmittedExpression */: + case 141 /* ArrayLiteral */: + case 142 /* ObjectLiteral */: + case 145 /* PropertyAccess */: + case 146 /* IndexedAccess */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: + case 149 /* TaggedTemplateExpression */: + case 150 /* TypeAssertion */: + case 151 /* ParenExpression */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: + case 156 /* BinaryExpression */: + case 157 /* ConditionalExpression */: + case 158 /* TemplateExpression */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 160 /* OmittedExpression */: return true; case 121 /* QualifiedName */: while (node.parent.kind === 121 /* QualifiedName */) node = node.parent; - return node.parent.kind === 133 /* TypeQuery */; + return node.parent.kind === 135 /* TypeQuery */; case 63 /* Identifier */: - if (node.parent.kind === 133 /* TypeQuery */) { + if (node.parent.kind === 135 /* TypeQuery */) { return true; } case 6 /* NumericLiteral */: case 7 /* StringLiteral */: - case 9 /* NoSubstitutionTemplateLiteral */: var parent = node.parent; switch (parent.kind) { - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: case 123 /* Parameter */: case 124 /* Property */: - case 192 /* EnumMember */: - case 141 /* PropertyAssignment */: + case 195 /* EnumMember */: + case 143 /* PropertyAssignment */: return parent.initializer === node; - case 161 /* ExpressionStatement */: - case 162 /* IfStatement */: - case 163 /* DoStatement */: - case 164 /* WhileStatement */: - case 169 /* ReturnStatement */: - case 170 /* WithStatement */: - case 171 /* SwitchStatement */: - case 172 /* CaseClause */: - case 175 /* ThrowStatement */: - case 171 /* SwitchStatement */: + case 164 /* ExpressionStatement */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 172 /* ReturnStatement */: + case 173 /* WithStatement */: + case 174 /* SwitchStatement */: + case 175 /* CaseClause */: + case 178 /* ThrowStatement */: + case 174 /* SwitchStatement */: return parent.expression === node; - case 165 /* ForStatement */: + case 168 /* ForStatement */: return parent.initializer === node || parent.condition === node || parent.iterator === node; - case 166 /* ForInStatement */: + case 169 /* ForInStatement */: return parent.variable === node || parent.expression === node; - case 147 /* TypeAssertion */: + case 150 /* TypeAssertion */: return node === parent.operand; + case 159 /* TemplateSpan */: + return node === parent.expression; default: if (isExpression(parent)) { return true; @@ -2462,20 +2484,21 @@ var ts; switch (node.kind) { case 122 /* TypeParameter */: case 123 /* Parameter */: - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: case 124 /* Property */: - case 141 /* PropertyAssignment */: - case 192 /* EnumMember */: + case 143 /* PropertyAssignment */: + case 144 /* ShorthandPropertyAssignment */: + case 195 /* EnumMember */: case 125 /* Method */: - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: - case 186 /* TypeAliasDeclaration */: - case 187 /* EnumDeclaration */: - case 188 /* ModuleDeclaration */: - case 190 /* ImportDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 190 /* EnumDeclaration */: + case 191 /* ModuleDeclaration */: + case 193 /* ImportDeclaration */: return true; } return false; @@ -2483,24 +2506,24 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 168 /* BreakStatement */: - case 167 /* ContinueStatement */: - case 180 /* DebuggerStatement */: - case 163 /* DoStatement */: - case 161 /* ExpressionStatement */: - case 160 /* EmptyStatement */: - case 166 /* ForInStatement */: - case 165 /* ForStatement */: - case 162 /* IfStatement */: - case 174 /* LabeledStatement */: - case 169 /* ReturnStatement */: - case 171 /* SwitchStatement */: + case 171 /* BreakStatement */: + case 170 /* ContinueStatement */: + case 183 /* DebuggerStatement */: + case 166 /* DoStatement */: + case 164 /* ExpressionStatement */: + case 163 /* EmptyStatement */: + case 169 /* ForInStatement */: + case 168 /* ForStatement */: + case 165 /* IfStatement */: + case 177 /* LabeledStatement */: + case 172 /* ReturnStatement */: + case 174 /* SwitchStatement */: case 92 /* ThrowKeyword */: - case 176 /* TryStatement */: - case 159 /* VariableStatement */: - case 164 /* WhileStatement */: - case 170 /* WithStatement */: - case 191 /* ExportAssignment */: + case 179 /* TryStatement */: + case 162 /* VariableStatement */: + case 167 /* WhileStatement */: + case 173 /* WithStatement */: + case 194 /* ExportAssignment */: return true; default: return false; @@ -2512,10 +2535,10 @@ var ts; return false; } var parent = name.parent; - if (isDeclaration(parent) || parent.kind === 149 /* FunctionExpression */) { + if (isDeclaration(parent) || parent.kind === 152 /* FunctionExpression */) { return parent.name === name; } - if (parent.kind === 178 /* CatchBlock */) { + if (parent.kind === 181 /* CatchBlock */) { return parent.variable === name; } return false; @@ -2523,16 +2546,16 @@ var ts; ts.isDeclarationOrFunctionExpressionOrCatchVariableName = isDeclarationOrFunctionExpressionOrCatchVariableName; function getAncestor(node, kind) { switch (kind) { - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: while (node) { switch (node.kind) { - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: return node; - case 187 /* EnumDeclaration */: - case 185 /* InterfaceDeclaration */: - case 186 /* TypeAliasDeclaration */: - case 188 /* ModuleDeclaration */: - case 190 /* ImportDeclaration */: + case 190 /* EnumDeclaration */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 191 /* ModuleDeclaration */: + case 193 /* ImportDeclaration */: return undefined; default: node = node.parent; @@ -2574,6 +2597,40 @@ var ts; } } ; + function getFileReferenceFromReferencePath(comment, commentRange) { + var simpleReferenceRegEx = /^\/\/\/\s*/gim; + if (simpleReferenceRegEx.exec(comment)) { + if (isNoDefaultLibRegEx.exec(comment)) { + return { + isNoDefaultLib: true + }; + } + else { + var matchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment); + if (matchResult) { + var start = commentRange.pos; + var end = commentRange.end; + return { + fileReference: { + pos: start, + end: end, + filename: matchResult[3] + }, + isNoDefaultLib: false + }; + } + else { + return { + diagnostic: ts.Diagnostics.Invalid_reference_directive_syntax, + isNoDefaultLib: false + }; + } + } + } + return undefined; + } + ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { return 64 /* FirstKeyword */ <= token && token <= 119 /* LastKeyword */; } @@ -2582,6 +2639,15 @@ var ts; return 2 /* FirstTriviaToken */ <= token && token <= 5 /* LastTriviaToken */; } ts.isTrivia = isTrivia; + function isUnterminatedTemplateEnd(node) { + ts.Debug.assert(node.kind === 9 /* NoSubstitutionTemplateLiteral */ || node.kind === 12 /* TemplateTail */); + var sourceText = getSourceFileOfNode(node).text; + if (node.end !== sourceText.length) { + return false; + } + return sourceText.charCodeAt(node.end - 1) !== 96 /* backtick */ || node.text.length === 0; + } + ts.isUnterminatedTemplateEnd = isUnterminatedTemplateEnd; function isModifier(token) { switch (token) { case 106 /* PublicKeyword */: @@ -2595,6 +2661,17 @@ var ts; return false; } ts.isModifier = isModifier; + function modifierToFlag(token) { + switch (token) { + case 107 /* StaticKeyword */: return 128 /* Static */; + case 106 /* PublicKeyword */: return 16 /* Public */; + case 105 /* ProtectedKeyword */: return 64 /* Protected */; + case 104 /* PrivateKeyword */: return 32 /* Private */; + case 76 /* ExportKeyword */: return 1 /* Export */; + case 112 /* DeclareKeyword */: return 2 /* Ambient */; + } + return 0; + } function createSourceFile(filename, sourceText, languageVersion, version, isOpen) { if (isOpen === void 0) { isOpen = false; } var file; @@ -2608,118 +2685,26 @@ var ts; var lineStarts; var isInStrictMode = false; var lookAheadMode = 0 /* NotLookingAhead */; - var inAmbientContext = false; - var inFunctionBody = false; - var inSwitchStatement = 0 /* NotNested */; - var inIterationStatement = 0 /* NotNested */; - var labelledStatementInfo = (function () { - var functionBoundarySentinel; - var currentLabelSet; - var labelSetStack; - var isIterationStack; - function addLabel(label) { - if (!currentLabelSet) { - currentLabelSet = {}; - } - currentLabelSet[label.text] = true; - } - function pushCurrentLabelSet(isIterationStatement) { - if (!labelSetStack && !isIterationStack) { - labelSetStack = []; - isIterationStack = []; - } - ts.Debug.assert(currentLabelSet !== undefined); - labelSetStack.push(currentLabelSet); - isIterationStack.push(isIterationStatement); - currentLabelSet = undefined; - } - function pushFunctionBoundary() { - if (!functionBoundarySentinel) { - functionBoundarySentinel = {}; - if (!labelSetStack && !isIterationStack) { - labelSetStack = []; - isIterationStack = []; - } - } - ts.Debug.assert(currentLabelSet === undefined); - labelSetStack.push(functionBoundarySentinel); - isIterationStack.push(false); - } - function pop() { - ts.Debug.assert(labelSetStack.length && isIterationStack.length && currentLabelSet === undefined); - labelSetStack.pop(); - isIterationStack.pop(); - } - function nodeIsNestedInLabel(label, requireIterationStatement, stopAtFunctionBoundary) { - if (!requireIterationStatement && currentLabelSet && ts.hasProperty(currentLabelSet, label.text)) { - return 1 /* Nested */; - } - if (!labelSetStack) { - return 0 /* NotNested */; - } - var crossedFunctionBoundary = false; - for (var i = labelSetStack.length - 1; i >= 0; i--) { - var labelSet = labelSetStack[i]; - if (labelSet === functionBoundarySentinel) { - if (stopAtFunctionBoundary) { - break; - } - else { - crossedFunctionBoundary = true; - continue; - } - } - if (requireIterationStatement && isIterationStack[i] === false) { - continue; - } - if (ts.hasProperty(labelSet, label.text)) { - return crossedFunctionBoundary ? 2 /* CrossingFunctionBoundary */ : 1 /* Nested */; - } - } - return 0 /* NotNested */; - } - return { - addLabel: addLabel, - pushCurrentLabelSet: pushCurrentLabelSet, - pushFunctionBoundary: pushFunctionBoundary, - pop: pop, - nodeIsNestedInLabel: nodeIsNestedInLabel - }; - })(); - function getLineAndCharacterlFromSourcePosition(position) { - if (!lineStarts) { - lineStarts = ts.getLineStarts(sourceText); - } - return ts.getLineAndCharacterOfPosition(lineStarts, position); + function getLineStarts() { + return lineStarts || (lineStarts = ts.computeLineStarts(sourceText)); + } + function getLineAndCharacterFromSourcePosition(position) { + return ts.getLineAndCharacterOfPosition(getLineStarts(), position); } function getPositionFromSourceLineAndCharacter(line, character) { - if (!lineStarts) { - lineStarts = ts.getLineStarts(sourceText); - } - return ts.getPositionFromLineAndCharacter(lineStarts, line, character); + return ts.getPositionFromLineAndCharacter(getLineStarts(), line, character); } function error(message, arg0, arg1, arg2) { var start = scanner.getTokenPos(); var length = scanner.getTextPos() - start; errorAtPos(start, length, message, arg0, arg1, arg2); } - function grammarErrorOnNode(node, message, arg0, arg1, arg2) { - var span = getErrorSpanForNode(node); - var start = span.end > span.pos ? ts.skipTrivia(file.text, span.pos) : span.pos; - var length = span.end - start; - file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - } - function reportInvalidUseInStrictMode(node) { - var name = sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end); - grammarErrorOnNode(node, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, name); - } - function grammarErrorAtPos(start, length, message, arg0, arg1, arg2) { - file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - } function errorAtPos(start, length, message, arg0, arg1, arg2) { - var lastErrorPos = file.syntacticErrors.length ? file.syntacticErrors[file.syntacticErrors.length - 1].start : -1; + var lastErrorPos = file.parseDiagnostics.length ? file.parseDiagnostics[file.parseDiagnostics.length - 1].start : -1; if (start !== lastErrorPos) { - file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + var diagnostic = ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); + diagnostic.isParseError = true; + file.parseDiagnostics.push(diagnostic); } if (lookAheadMode === 1 /* NoErrorYet */) { lookAheadMode = 2 /* Error */; @@ -2756,7 +2741,7 @@ var ts; } function lookAheadHelper(callback, alwaysResetState) { var saveToken = token; - var saveSyntacticErrorsLength = file.syntacticErrors.length; + var saveSyntacticErrorsLength = file.parseDiagnostics.length; var saveLookAheadMode = lookAheadMode; lookAheadMode = 1 /* NoErrorYet */; var result = callback(); @@ -2767,7 +2752,7 @@ var ts; lookAheadMode = saveLookAheadMode; if (!result || alwaysResetState) { token = saveToken; - file.syntacticErrors.length = saveSyntacticErrorsLength; + file.parseDiagnostics.length = saveSyntacticErrorsLength; } return result; } @@ -2819,28 +2804,32 @@ var ts; function createNode(kind, pos) { nodeCount++; var node = new (nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)))(); - if (!(pos >= 0)) + if (!(pos >= 0)) { pos = scanner.getStartPos(); + } node.pos = pos; node.end = pos; return node; } function finishNode(node) { node.end = scanner.getStartPos(); + if (isInStrictMode) { + node.flags |= 8192 /* ParsedInStrictMode */; + } return node; } - function createMissingNode() { - return createNode(120 /* Missing */); + function createMissingNode(pos) { + return createNode(120 /* Missing */, pos); } function internIdentifier(text) { + text = escapeIdentifier(text); return ts.hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); } function createIdentifier(isIdentifier) { identifierCount++; if (isIdentifier) { var node = createNode(63 /* Identifier */); - var text = escapeIdentifier(scanner.getTokenValue()); - node.text = internIdentifier(text); + node.text = internIdentifier(scanner.getTokenValue()); nextToken(); return finishNode(node); } @@ -2999,12 +2988,11 @@ var ts; parsingContext = saveParsingContext; return result; } - function parseDelimitedList(kind, parseElement, allowTrailingComma) { + function parseDelimitedList(kind, parseElement) { var saveParsingContext = parsingContext; parsingContext |= 1 << kind; var result = []; result.pos = getNodePos(); - var errorCountBeforeParsingList = file.syntacticErrors.length; var commaStart = -1; while (true) { if (isListElement(kind, false)) { @@ -3031,11 +3019,6 @@ var ts; } } if (commaStart >= 0) { - if (!allowTrailingComma) { - if (file.syntacticErrors.length === errorCountBeforeParsingList) { - grammarErrorAtPos(commaStart, scanner.getStartPos() - commaStart, ts.Diagnostics.Trailing_comma_not_allowed); - } - } result.hasTrailingComma = true; } result.end = getNodeEnd(); @@ -3057,7 +3040,7 @@ var ts; } function parseBracketedList(kind, parseElement, startToken, endToken) { if (parseExpected(startToken)) { - var result = parseDelimitedList(kind, parseElement, false); + var result = parseDelimitedList(kind, parseElement); parseExpected(endToken); return result; } @@ -3079,7 +3062,7 @@ var ts; return finishNode(node); } function parseTemplateExpression() { - var template = createNode(155 /* TemplateExpression */); + var template = createNode(158 /* TemplateExpression */); template.head = parseLiteralNode(); ts.Debug.assert(template.head.kind === 10 /* TemplateHead */, "Template head has wrong token kind"); var templateSpans = []; @@ -3092,7 +3075,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(156 /* TemplateSpan */); + var span = createNode(159 /* TemplateSpan */); span.expression = parseExpression(false); var literal; if (token === 14 /* CloseBraceToken */) { @@ -3115,12 +3098,7 @@ var ts; nextToken(); finishNode(node); if (node.kind === 6 /* NumericLiteral */ && sourceText.charCodeAt(tokenPos) === 48 /* _0 */ && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { - if (isInStrictMode) { - grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); - } - else if (languageVersion >= 1 /* ES5 */) { - grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); - } + node.flags |= 16384 /* OctalLiteral */; } return node; } @@ -3140,7 +3118,7 @@ var ts; return finishNode(node); } function parseTypeQuery() { - var node = createNode(133 /* TypeQuery */); + var node = createNode(135 /* TypeQuery */); parseExpected(95 /* TypeOfKeyword */); node.exprName = parseEntityName(true); return finishNode(node); @@ -3153,22 +3131,14 @@ var ts; node.constraint = parseType(); } else { - var expr = parseUnaryExpression(); - grammarErrorOnNode(expr, ts.Diagnostics.Type_expected); + node.expression = parseUnaryExpression(); } } return finishNode(node); } function parseTypeParameters() { if (token === 23 /* LessThanToken */) { - var pos = getNodePos(); - var result = parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 23 /* LessThanToken */, 24 /* GreaterThanToken */); - if (!result.length) { - var start = getTokenPos(pos); - var length = getNodePos() - start; - errorAtPos(start, length, ts.Diagnostics.Type_parameter_list_cannot_be_empty); - } - return result; + return parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 23 /* LessThanToken */, 24 /* GreaterThanToken */); } } function parseParameterType() { @@ -3177,10 +3147,17 @@ var ts; function isStartOfParameter() { return token === 20 /* DotDotDotToken */ || isIdentifier() || isModifier(token); } + function setModifiers(node, modifiers) { + if (modifiers) { + node.flags |= modifiers.flags; + node.modifiers = modifiers; + } + } function parseParameter(flags) { if (flags === void 0) { flags = 0; } var node = createNode(123 /* Parameter */); - node.flags |= parseAndCheckModifiers(3 /* Parameters */); + var modifiers = parseModifiers(3 /* Parameters */); + setModifiers(node, modifiers); if (parseOptional(20 /* DotDotDotToken */)) { node.flags |= 8 /* Rest */; } @@ -3201,7 +3178,6 @@ var ts; } var typeParameters = parseTypeParameters(); var parameters = parseParameterList(15 /* OpenParenToken */, 16 /* CloseParenToken */); - checkParameterList(parameters); var type; if (returnTokenRequired) { parseExpected(returnToken); @@ -3219,44 +3195,6 @@ var ts; function parseParameterList(startDelimiter, endDelimiter) { return parseBracketedList(13 /* Parameters */, parseParameter, startDelimiter, endDelimiter); } - function checkParameterList(parameters) { - var seenOptionalParameter = false; - var parameterCount = parameters.length; - for (var i = 0; i < parameterCount; i++) { - var parameter = parameters[i]; - if (isInStrictMode && isEvalOrArgumentsIdentifier(parameter.name)) { - reportInvalidUseInStrictMode(parameter.name); - return; - } - else if (parameter.flags & 8 /* Rest */) { - if (i !== (parameterCount - 1)) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); - return; - } - if (parameter.flags & 4 /* QuestionMark */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_be_optional); - return; - } - if (parameter.initializer) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer); - return; - } - } - else if (parameter.flags & 4 /* QuestionMark */ || parameter.initializer) { - seenOptionalParameter = true; - if (parameter.flags & 4 /* QuestionMark */ && parameter.initializer) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.Parameter_cannot_have_question_mark_and_initializer); - return; - } - } - else { - if (seenOptionalParameter) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); - return; - } - } - } - } function parseSignatureMember(kind, returnToken) { var node = createNode(kind); var sig = parseSignature(kind, returnToken, false); @@ -3266,60 +3204,14 @@ var ts; parseSemicolon(); return finishNode(node); } - function parseIndexSignatureMember() { - var node = createNode(131 /* IndexSignature */); - var errorCountBeforeIndexSignature = file.syntacticErrors.length; - var indexerStart = scanner.getTokenPos(); + function parseIndexSignatureMember(modifiers, pos) { + var node = createNode(131 /* IndexSignature */, pos); + setModifiers(node, modifiers); node.parameters = parseParameterList(17 /* OpenBracketToken */, 18 /* CloseBracketToken */); - var indexerLength = scanner.getStartPos() - indexerStart; node.type = parseTypeAnnotation(); parseSemicolon(); - if (file.syntacticErrors.length === errorCountBeforeIndexSignature) { - checkIndexSignature(node, indexerStart, indexerLength); - } return finishNode(node); } - function checkIndexSignature(node, indexerStart, indexerLength) { - var parameter = node.parameters[0]; - if (node.parameters.length !== 1) { - var arityDiagnostic = ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter; - if (parameter) { - grammarErrorOnNode(parameter.name, arityDiagnostic); - } - else { - grammarErrorAtPos(indexerStart, indexerLength, arityDiagnostic); - } - return; - } - else if (parameter.flags & 8 /* Rest */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); - return; - } - else if (parameter.flags & 243 /* Modifier */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); - return; - } - else if (parameter.flags & 4 /* QuestionMark */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); - return; - } - else if (parameter.initializer) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); - return; - } - else if (!parameter.type) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); - return; - } - else if (parameter.type.kind !== 118 /* StringKeyword */ && parameter.type.kind !== 116 /* NumberKeyword */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); - return; - } - else if (!node.type) { - grammarErrorAtPos(indexerStart, indexerLength, ts.Diagnostics.An_index_signature_must_have_a_type_annotation); - return; - } - } function parsePropertyOrMethod() { var node = createNode(0 /* Unknown */); node.name = parsePropertyName(); @@ -3356,7 +3248,7 @@ var ts; case 23 /* LessThanToken */: return parseSignatureMember(129 /* CallSignature */, 50 /* ColonToken */); case 17 /* OpenBracketToken */: - return parseIndexSignatureMember(); + return parseIndexSignatureMember(undefined); case 86 /* NewKeyword */: if (lookAhead(function () { return nextToken() === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */; })) { return parseSignatureMember(130 /* ConstructSignature */, 50 /* ColonToken */); @@ -3371,7 +3263,7 @@ var ts; } } function parseTypeLiteral() { - var node = createNode(134 /* TypeLiteral */); + var node = createNode(136 /* TypeLiteral */); if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseList(5 /* TypeMembers */, false, parseTypeMember); parseExpected(14 /* CloseBraceToken */); @@ -3382,32 +3274,25 @@ var ts; return finishNode(node); } function parseTupleType() { - var node = createNode(136 /* TupleType */); - var startTokenPos = scanner.getTokenPos(); - var startErrorCount = file.syntacticErrors.length; + var node = createNode(138 /* TupleType */); node.elementTypes = parseBracketedList(16 /* TupleElementTypes */, parseType, 17 /* OpenBracketToken */, 18 /* CloseBracketToken */); - if (!node.elementTypes.length && file.syntacticErrors.length === startErrorCount) { - grammarErrorAtPos(startTokenPos, scanner.getStartPos() - startTokenPos, ts.Diagnostics.A_tuple_type_element_list_cannot_be_empty); - } return finishNode(node); } function parseParenType() { - var node = createNode(138 /* ParenType */); + var node = createNode(140 /* ParenType */); parseExpected(15 /* OpenParenToken */); node.type = parseType(); parseExpected(16 /* CloseParenToken */); return finishNode(node); } - function parseFunctionType(signatureKind) { - var node = createNode(134 /* TypeLiteral */); - var member = createNode(signatureKind); - var sig = parseSignature(signatureKind, 31 /* EqualsGreaterThanToken */, true); + function parseFunctionType(typeKind) { + var member = createNode(typeKind); + var sig = parseSignature(typeKind === 133 /* FunctionType */ ? 129 /* CallSignature */ : 130 /* ConstructSignature */, 31 /* EqualsGreaterThanToken */, true); member.typeParameters = sig.typeParameters; member.parameters = sig.parameters; member.type = sig.type; finishNode(member); - node.members = createNodeArray(member); - return finishNode(node); + return member; } function parseKeywordAndNoDot() { var node = parseTokenNode(); @@ -3464,7 +3349,7 @@ var ts; var type = parseNonArrayType(); while (!scanner.hasPrecedingLineBreak() && parseOptional(17 /* OpenBracketToken */)) { parseExpected(18 /* CloseBracketToken */); - var node = createNode(135 /* ArrayType */, type.pos); + var node = createNode(137 /* ArrayType */, type.pos); node.elementType = type; type = finishNode(node); } @@ -3479,7 +3364,7 @@ var ts; types.push(parsePrimaryType()); } types.end = getNodeEnd(); - var node = createNode(137 /* UnionType */, type.pos); + var node = createNode(139 /* UnionType */, type.pos); node.types = types; type = finishNode(node); } @@ -3508,10 +3393,10 @@ var ts; } function parseType() { if (isStartOfFunctionType()) { - return parseFunctionType(129 /* CallSignature */); + return parseFunctionType(133 /* FunctionType */); } if (token === 86 /* NewKeyword */) { - return parseFunctionType(130 /* ConstructSignature */); + return parseFunctionType(134 /* ConstructorType */); } return parseUnionType(); } @@ -3580,45 +3465,13 @@ var ts; if (expr.kind === 63 /* Identifier */ && token === 31 /* EqualsGreaterThanToken */) { return parseSimpleArrowFunctionExpression(expr); } - if (isLeftHandSideExpression(expr) && isAssignmentOperator()) { - if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { - reportInvalidUseInStrictMode(expr); - } + if (isLeftHandSideExpression(expr) && isAssignmentOperator(token)) { var operator = token; nextToken(); return makeBinaryExpression(expr, operator, parseAssignmentExpression(noIn)); } return expr; } - function isLeftHandSideExpression(expr) { - if (expr) { - switch (expr.kind) { - case 142 /* PropertyAccess */: - case 143 /* IndexedAccess */: - case 145 /* NewExpression */: - case 144 /* CallExpression */: - case 146 /* TaggedTemplateExpression */: - case 139 /* ArrayLiteral */: - case 148 /* ParenExpression */: - case 140 /* ObjectLiteral */: - case 149 /* FunctionExpression */: - case 63 /* Identifier */: - case 120 /* Missing */: - case 8 /* RegularExpressionLiteral */: - case 6 /* NumericLiteral */: - case 7 /* StringLiteral */: - case 9 /* NoSubstitutionTemplateLiteral */: - case 155 /* TemplateExpression */: - case 78 /* FalseKeyword */: - case 87 /* NullKeyword */: - case 91 /* ThisKeyword */: - case 93 /* TrueKeyword */: - case 89 /* SuperKeyword */: - return true; - } - } - return false; - } function parseSimpleArrowFunctionExpression(identifier) { ts.Debug.assert(token === 31 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); parseExpected(31 /* EqualsGreaterThanToken */); @@ -3644,7 +3497,7 @@ var ts; return parseArrowExpressionTail(pos, sig, false); } else { - return makeFunctionExpression(150 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); + return makeFunctionExpression(153 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); } } var sig = tryParseSignatureIfArrowOrBraceFollows(); @@ -3710,23 +3563,20 @@ var ts; function parseArrowExpressionTail(pos, sig, noIn) { var body; if (token === 13 /* OpenBraceToken */) { - body = parseBody(false); + body = parseFunctionBlock(false); } else if (isStatement(true) && !isStartOfExpressionStatement() && token !== 81 /* FunctionKeyword */) { - body = parseBody(true); + body = parseFunctionBlock(true); } else { body = parseAssignmentExpression(noIn); } - return makeFunctionExpression(150 /* ArrowFunction */, pos, undefined, sig, body); - } - function isAssignmentOperator() { - return token >= 51 /* FirstAssignment */ && token <= 62 /* LastAssignment */; + return makeFunctionExpression(153 /* ArrowFunction */, pos, undefined, sig, body); } function parseConditionalExpression(noIn) { var expr = parseBinaryExpression(noIn); while (parseOptional(49 /* QuestionToken */)) { - var node = createNode(154 /* ConditionalExpression */, expr.pos); + var node = createNode(157 /* ConditionalExpression */, expr.pos); node.condition = expr; node.whenTrue = parseAssignmentExpression(false); parseExpected(50 /* ColonToken */); @@ -3790,7 +3640,7 @@ var ts; return undefined; } function makeBinaryExpression(left, operator, right) { - var node = createNode(153 /* BinaryExpression */, left.pos); + var node = createNode(156 /* BinaryExpression */, left.pos); node.left = left; node.operator = operator; node.right = right; @@ -3810,16 +3660,7 @@ var ts; case 38 /* MinusMinusToken */: var operator = token; nextToken(); - var operand = parseUnaryExpression(); - if (isInStrictMode) { - if ((operator === 37 /* PlusPlusToken */ || operator === 38 /* MinusMinusToken */) && isEvalOrArgumentsIdentifier(operand)) { - reportInvalidUseInStrictMode(operand); - } - else if (operator === 72 /* DeleteKeyword */ && operand.kind === 63 /* Identifier */) { - grammarErrorOnNode(operand, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); - } - } - return makeUnaryExpression(151 /* PrefixOperator */, pos, operator, operand); + return makeUnaryExpression(154 /* PrefixOperator */, pos, operator, parseUnaryExpression()); case 23 /* LessThanToken */: return parseTypeAssertion(); } @@ -3831,17 +3672,14 @@ var ts; var expr = parseCallAndAccess(primaryExpression, false); ts.Debug.assert(isLeftHandSideExpression(expr)); if ((token === 37 /* PlusPlusToken */ || token === 38 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { - reportInvalidUseInStrictMode(expr); - } var operator = token; nextToken(); - expr = makeUnaryExpression(152 /* PostfixOperator */, expr.pos, operator, expr); + expr = makeUnaryExpression(155 /* PostfixOperator */, expr.pos, operator, expr); } return expr; } function parseTypeAssertion() { - var node = createNode(147 /* TypeAssertion */); + var node = createNode(150 /* TypeAssertion */); parseExpected(23 /* LessThanToken */); node.type = parseType(); parseExpected(24 /* GreaterThanToken */); @@ -3858,25 +3696,28 @@ var ts; while (true) { var dotOrBracketStart = scanner.getTokenPos(); if (parseOptional(19 /* DotToken */)) { - var propertyAccess = createNode(142 /* PropertyAccess */, expr.pos); - if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord() && lookAhead(function () { return scanner.isReservedWord(); })) { - grammarErrorAtPos(dotOrBracketStart, scanner.getStartPos() - dotOrBracketStart, ts.Diagnostics.Identifier_expected); - var id = createMissingNode(); - } - else { - var id = parseIdentifierName(); + var propertyAccess = createNode(145 /* PropertyAccess */, expr.pos); + var id; + if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord()) { + var matchesPattern = lookAhead(function () { + nextToken(); + return !scanner.hasPrecedingLineBreak() && (scanner.isIdentifier() || scanner.isReservedWord); + }); + if (matchesPattern) { + errorAtPos(dotOrBracketStart + 1, 0, ts.Diagnostics.Identifier_expected); + id = createMissingNode(); + } } propertyAccess.left = expr; - propertyAccess.right = id; + propertyAccess.right = id || parseIdentifierName(); expr = finishNode(propertyAccess); continue; } if (parseOptional(17 /* OpenBracketToken */)) { - var indexedAccess = createNode(143 /* IndexedAccess */, expr.pos); + var indexedAccess = createNode(146 /* IndexedAccess */, expr.pos); indexedAccess.object = expr; if (inNewExpression && parseOptional(18 /* CloseBracketToken */)) { indexedAccess.index = createMissingNode(); - grammarErrorAtPos(dotOrBracketStart, scanner.getStartPos() - dotOrBracketStart, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); } else { indexedAccess.index = parseExpression(); @@ -3890,7 +3731,7 @@ var ts; continue; } if ((token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) && !inNewExpression) { - var callExpr = createNode(144 /* CallExpression */, expr.pos); + var callExpr = createNode(147 /* CallExpression */, expr.pos); callExpr.func = expr; if (token === 23 /* LessThanToken */) { if (!(callExpr.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) @@ -3899,19 +3740,16 @@ var ts; else { parseExpected(15 /* OpenParenToken */); } - callExpr.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression, false); + callExpr.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression); parseExpected(16 /* CloseParenToken */); expr = finishNode(callExpr); continue; } if (token === 9 /* NoSubstitutionTemplateLiteral */ || token === 10 /* TemplateHead */) { - var tagExpression = createNode(146 /* TaggedTemplateExpression */, expr.pos); + var tagExpression = createNode(149 /* TaggedTemplateExpression */, expr.pos); tagExpression.tag = expr; tagExpression.template = token === 9 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() : parseTemplateExpression(); expr = finishNode(tagExpression); - if (languageVersion < 2 /* ES6 */) { - grammarErrorOnNode(expr, ts.Diagnostics.Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher); - } continue; } return expr; @@ -3923,19 +3761,10 @@ var ts; return result; } function parseTypeArguments() { - var typeArgumentListStart = scanner.getTokenPos(); - var errorCountBeforeTypeParameterList = file.syntacticErrors.length; - var result = parseBracketedList(15 /* TypeArguments */, parseSingleTypeArgument, 23 /* LessThanToken */, 24 /* GreaterThanToken */); - if (!result.length && file.syntacticErrors.length === errorCountBeforeTypeParameterList) { - grammarErrorAtPos(typeArgumentListStart, scanner.getStartPos() - typeArgumentListStart, ts.Diagnostics.Type_argument_list_cannot_be_empty); - } - return result; + return parseBracketedList(15 /* TypeArguments */, parseSingleTypeArgument, 23 /* LessThanToken */, 24 /* GreaterThanToken */); } function parseSingleTypeArgument() { if (token === 22 /* CommaToken */) { - var errorStart = scanner.getTokenPos(); - var errorLength = scanner.getTextPos() - errorStart; - grammarErrorAtPos(errorStart, errorLength, ts.Diagnostics.Type_expected); return createNode(120 /* Missing */); } return parseType(); @@ -3979,50 +3808,60 @@ var ts; return createMissingNode(); } function parseParenExpression() { - var node = createNode(148 /* ParenExpression */); + var node = createNode(151 /* ParenExpression */); parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); parseExpected(16 /* CloseParenToken */); return finishNode(node); } - function parseAssignmentExpressionOrOmittedExpression(omittedExpressionDiagnostic) { - if (token === 22 /* CommaToken */) { - if (omittedExpressionDiagnostic) { - var errorStart = scanner.getTokenPos(); - var errorLength = scanner.getTextPos() - errorStart; - grammarErrorAtPos(errorStart, errorLength, omittedExpressionDiagnostic); - } - return createNode(157 /* OmittedExpression */); - } - return parseAssignmentExpression(); + function parseAssignmentExpressionOrOmittedExpression() { + return token === 22 /* CommaToken */ ? createNode(160 /* OmittedExpression */) : parseAssignmentExpression(); } function parseArrayLiteralElement() { - return parseAssignmentExpressionOrOmittedExpression(undefined); + return parseAssignmentExpressionOrOmittedExpression(); } function parseArgumentExpression() { - return parseAssignmentExpressionOrOmittedExpression(ts.Diagnostics.Argument_expression_expected); + return parseAssignmentExpressionOrOmittedExpression(); } function parseArrayLiteral() { - var node = createNode(139 /* ArrayLiteral */); + var node = createNode(141 /* ArrayLiteral */); parseExpected(17 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) node.flags |= 256 /* MultiLine */; - node.elements = parseDelimitedList(12 /* ArrayLiteralMembers */, parseArrayLiteralElement, true); + node.elements = parseDelimitedList(12 /* ArrayLiteralMembers */, parseArrayLiteralElement); parseExpected(18 /* CloseBracketToken */); return finishNode(node); } function parsePropertyAssignment() { - var node = createNode(141 /* PropertyAssignment */); - node.name = parsePropertyName(); + var nodePos = scanner.getStartPos(); + var tokenIsIdentifier = isIdentifier(); + var nameToken = token; + var propertyName = parsePropertyName(); + var node; if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + node = createNode(143 /* PropertyAssignment */, nodePos); + node.name = propertyName; var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); - var body = parseBody(false); - node.initializer = makeFunctionExpression(149 /* FunctionExpression */, node.pos, undefined, sig, body); + var body = parseFunctionBlock(false); + node.initializer = makeFunctionExpression(152 /* FunctionExpression */, node.pos, undefined, sig, body); + return finishNode(node); + } + var flags = 0; + if (token === 49 /* QuestionToken */) { + flags |= 4 /* QuestionMark */; + nextToken(); + } + if ((token === 22 /* CommaToken */ || token === 14 /* CloseBraceToken */) && tokenIsIdentifier) { + node = createNode(144 /* ShorthandPropertyAssignment */, nodePos); + node.name = propertyName; } else { + node = createNode(143 /* PropertyAssignment */, nodePos); + node.name = propertyName; parseExpected(50 /* ColonToken */); node.initializer = parseAssignmentExpression(false); } + node.flags = flags; return finishNode(node); } function parseObjectLiteralMember() { @@ -4030,63 +3869,18 @@ var ts; var initialToken = token; if (parseContextualModifier(113 /* GetKeyword */) || parseContextualModifier(117 /* SetKeyword */)) { var kind = initialToken === 113 /* GetKeyword */ ? 127 /* GetAccessor */ : 128 /* SetAccessor */; - return parseAndCheckMemberAccessorDeclaration(kind, initialPos, 0); + return parseMemberAccessorDeclaration(kind, initialPos, undefined); } return parsePropertyAssignment(); } function parseObjectLiteral() { - var node = createNode(140 /* ObjectLiteral */); + var node = createNode(142 /* ObjectLiteral */); parseExpected(13 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.flags |= 256 /* MultiLine */; } - node.properties = parseDelimitedList(11 /* ObjectLiteralMembers */, parseObjectLiteralMember, true); + node.properties = parseDelimitedList(11 /* ObjectLiteralMembers */, parseObjectLiteralMember); parseExpected(14 /* CloseBraceToken */); - var seen = {}; - var Property = 1; - var GetAccessor = 2; - var SetAccesor = 4; - var GetOrSetAccessor = GetAccessor | SetAccesor; - ts.forEach(node.properties, function (p) { - if (p.kind === 157 /* OmittedExpression */) { - return; - } - var currentKind; - if (p.kind === 141 /* PropertyAssignment */) { - currentKind = Property; - } - else if (p.kind === 127 /* GetAccessor */) { - currentKind = GetAccessor; - } - else if (p.kind === 128 /* SetAccessor */) { - currentKind = SetAccesor; - } - else { - ts.Debug.fail("Unexpected syntax kind:" + p.kind); - } - if (!ts.hasProperty(seen, p.name.text)) { - seen[p.name.text] = currentKind; - } - else { - var existingKind = seen[p.name.text]; - if (currentKind === Property && existingKind === Property) { - if (isInStrictMode) { - grammarErrorOnNode(p.name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); - } - } - else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { - if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[p.name.text] = currentKind | existingKind; - } - else { - grammarErrorOnNode(p.name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); - } - } - else { - grammarErrorOnNode(p.name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); - } - } - }); return finishNode(node); } function parseFunctionExpression() { @@ -4094,11 +3888,8 @@ var ts; parseExpected(81 /* FunctionKeyword */); var name = isIdentifier() ? parseIdentifier() : undefined; var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); - var body = parseBody(false); - if (name && isInStrictMode && isEvalOrArgumentsIdentifier(name)) { - reportInvalidUseInStrictMode(name); - } - return makeFunctionExpression(149 /* FunctionExpression */, pos, name, sig, body); + var body = parseFunctionBlock(false); + return makeFunctionExpression(152 /* FunctionExpression */, pos, name, sig, body); } function makeFunctionExpression(kind, pos, name, sig, body) { var node = createNode(kind, pos); @@ -4110,22 +3901,19 @@ var ts; return finishNode(node); } function parseNewExpression() { - var node = createNode(145 /* NewExpression */); + var node = createNode(148 /* NewExpression */); parseExpected(86 /* NewKeyword */); node.func = parseCallAndAccess(parsePrimaryExpression(), true); if (parseOptional(15 /* OpenParenToken */) || token === 23 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { - node.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression, false); + node.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression); parseExpected(16 /* CloseParenToken */); } return finishNode(node); } - function parseStatementAllowingLetDeclaration() { - return parseStatement(true); - } function parseBlock(ignoreMissingOpenBrace, checkForStrictMode) { - var node = createNode(158 /* Block */); + var node = createNode(161 /* Block */); if (parseExpected(13 /* OpenBraceToken */) || ignoreMissingOpenBrace) { - node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatementAllowingLetDeclaration); + node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatement); parseExpected(14 /* CloseBraceToken */); } else { @@ -4133,48 +3921,30 @@ var ts; } return finishNode(node); } - function parseBody(ignoreMissingOpenBrace) { - var saveInFunctionBody = inFunctionBody; - var saveInSwitchStatement = inSwitchStatement; - var saveInIterationStatement = inIterationStatement; - inFunctionBody = true; - if (inSwitchStatement === 1 /* Nested */) { - inSwitchStatement = 2 /* CrossingFunctionBoundary */; - } - if (inIterationStatement === 1 /* Nested */) { - inIterationStatement = 2 /* CrossingFunctionBoundary */; - } - labelledStatementInfo.pushFunctionBoundary(); + function parseFunctionBlock(ignoreMissingOpenBrace) { var block = parseBlock(ignoreMissingOpenBrace, true); - block.kind = 183 /* FunctionBlock */; - labelledStatementInfo.pop(); - inFunctionBody = saveInFunctionBody; - inSwitchStatement = saveInSwitchStatement; - inIterationStatement = saveInIterationStatement; + block.kind = 186 /* FunctionBlock */; return block; } function parseEmptyStatement() { - var node = createNode(160 /* EmptyStatement */); + var node = createNode(163 /* EmptyStatement */); parseExpected(21 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(162 /* IfStatement */); + var node = createNode(165 /* IfStatement */); parseExpected(82 /* IfKeyword */); parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); parseExpected(16 /* CloseParenToken */); - node.thenStatement = parseStatement(false); - node.elseStatement = parseOptional(74 /* ElseKeyword */) ? parseStatement(false) : undefined; + node.thenStatement = parseStatement(); + node.elseStatement = parseOptional(74 /* ElseKeyword */) ? parseStatement() : undefined; return finishNode(node); } function parseDoStatement() { - var node = createNode(163 /* DoStatement */); + var node = createNode(166 /* DoStatement */); parseExpected(73 /* DoKeyword */); - var saveInIterationStatement = inIterationStatement; - inIterationStatement = 1 /* Nested */; - node.statement = parseStatement(false); - inIterationStatement = saveInIterationStatement; + node.statement = parseStatement(); parseExpected(98 /* WhileKeyword */); parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); @@ -4183,15 +3953,12 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(164 /* WhileStatement */); + var node = createNode(167 /* WhileStatement */); parseExpected(98 /* WhileKeyword */); parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); parseExpected(16 /* CloseParenToken */); - var saveInIterationStatement = inIterationStatement; - inIterationStatement = 1 /* Nested */; - node.statement = parseStatement(false); - inIterationStatement = saveInIterationStatement; + node.statement = parseStatement(); return finishNode(node); } function parseForOrForInStatement() { @@ -4201,27 +3968,12 @@ var ts; if (token !== 21 /* SemicolonToken */) { if (parseOptional(96 /* VarKeyword */)) { var declarations = parseVariableDeclarationList(0, true); - if (!declarations.length) { - error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); - } } else if (parseOptional(102 /* LetKeyword */)) { var declarations = parseVariableDeclarationList(2048 /* Let */, true); - if (!declarations.length) { - error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); - } - if (languageVersion < 2 /* ES6 */) { - grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); - } } else if (parseOptional(68 /* ConstKeyword */)) { var declarations = parseVariableDeclarationList(4096 /* Const */, true); - if (!declarations.length) { - error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); - } - if (languageVersion < 2 /* ES6 */) { - grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); - } } else { var varOrInit = parseExpression(true); @@ -4229,12 +3981,9 @@ var ts; } var forOrForInStatement; if (parseOptional(84 /* InKeyword */)) { - var forInStatement = createNode(166 /* ForInStatement */, pos); + var forInStatement = createNode(169 /* ForInStatement */, pos); if (declarations) { - if (declarations.length > 1) { - error(ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); - } - forInStatement.declaration = declarations[0]; + forInStatement.declarations = declarations; } else { forInStatement.variable = varOrInit; @@ -4244,11 +3993,13 @@ var ts; forOrForInStatement = forInStatement; } else { - var forStatement = createNode(165 /* ForStatement */, pos); - if (declarations) + var forStatement = createNode(168 /* ForStatement */, pos); + if (declarations) { forStatement.declarations = declarations; - if (varOrInit) + } + if (varOrInit) { forStatement.initializer = varOrInit; + } parseExpected(21 /* SemicolonToken */); if (token !== 21 /* SemicolonToken */ && token !== 16 /* CloseParenToken */) { forStatement.condition = parseExpression(); @@ -4260,144 +4011,69 @@ var ts; parseExpected(16 /* CloseParenToken */); forOrForInStatement = forStatement; } - var saveInIterationStatement = inIterationStatement; - inIterationStatement = 1 /* Nested */; - forOrForInStatement.statement = parseStatement(false); - inIterationStatement = saveInIterationStatement; + forOrForInStatement.statement = parseStatement(); return finishNode(forOrForInStatement); } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - var errorCountBeforeStatement = file.syntacticErrors.length; - parseExpected(kind === 168 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */); - if (!canParseSemicolon()) + parseExpected(kind === 171 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */); + if (!canParseSemicolon()) { node.label = parseIdentifier(); + } parseSemicolon(); - finishNode(node); - if (!inAmbientContext && errorCountBeforeStatement === file.syntacticErrors.length) { - if (node.label) { - checkBreakOrContinueStatementWithLabel(node); - } - else { - checkBareBreakOrContinueStatement(node); - } - } - return node; - } - function checkBareBreakOrContinueStatement(node) { - if (node.kind === 168 /* BreakStatement */) { - if (inIterationStatement === 1 /* Nested */ || inSwitchStatement === 1 /* Nested */) { - return; - } - else if (inIterationStatement === 0 /* NotNested */ && inSwitchStatement === 0 /* NotNested */) { - grammarErrorOnNode(node, ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement); - return; - } - } - else if (node.kind === 167 /* ContinueStatement */) { - if (inIterationStatement === 1 /* Nested */) { - return; - } - else if (inIterationStatement === 0 /* NotNested */) { - grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement); - return; - } - } - else { - ts.Debug.fail("checkAnonymousBreakOrContinueStatement"); - } - ts.Debug.assert(inIterationStatement === 2 /* CrossingFunctionBoundary */ || inSwitchStatement === 2 /* CrossingFunctionBoundary */); - grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); - } - function checkBreakOrContinueStatementWithLabel(node) { - var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, node.kind === 167 /* ContinueStatement */, false); - if (nodeIsNestedInLabel === 1 /* Nested */) { - return; - } - if (nodeIsNestedInLabel === 2 /* CrossingFunctionBoundary */) { - grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); - return; - } - if (node.kind === 167 /* ContinueStatement */) { - grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); - } - else if (node.kind === 168 /* BreakStatement */) { - grammarErrorOnNode(node, ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement); - } - else { - ts.Debug.fail("checkBreakOrContinueStatementWithLabel"); - } + return finishNode(node); } function parseReturnStatement() { - var node = createNode(169 /* ReturnStatement */); - var errorCountBeforeReturnStatement = file.syntacticErrors.length; + var node = createNode(172 /* ReturnStatement */); var returnTokenStart = scanner.getTokenPos(); var returnTokenLength = scanner.getTextPos() - returnTokenStart; parseExpected(88 /* ReturnKeyword */); - if (!canParseSemicolon()) + if (!canParseSemicolon()) { node.expression = parseExpression(); - parseSemicolon(); - if (!inFunctionBody && !inAmbientContext && errorCountBeforeReturnStatement === file.syntacticErrors.length) { - grammarErrorAtPos(returnTokenStart, returnTokenLength, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); } + parseSemicolon(); return finishNode(node); } function parseWithStatement() { - var node = createNode(170 /* WithStatement */); - var startPos = scanner.getTokenPos(); + var node = createNode(173 /* WithStatement */); parseExpected(99 /* WithKeyword */); - var endPos = scanner.getStartPos(); parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); parseExpected(16 /* CloseParenToken */); - node.statement = parseStatement(false); - node = finishNode(node); - if (isInStrictMode) { - grammarErrorAtPos(startPos, endPos - startPos, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); - } - return node; + node.statement = parseStatement(); + return finishNode(node); } function parseCaseClause() { - var node = createNode(172 /* CaseClause */); + var node = createNode(175 /* CaseClause */); parseExpected(65 /* CaseKeyword */); node.expression = parseExpression(); parseExpected(50 /* ColonToken */); - node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatementAllowingLetDeclaration); + node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); return finishNode(node); } function parseDefaultClause() { - var node = createNode(173 /* DefaultClause */); + var node = createNode(176 /* DefaultClause */); parseExpected(71 /* DefaultKeyword */); parseExpected(50 /* ColonToken */); - node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatementAllowingLetDeclaration); + node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); return finishNode(node); } function parseCaseOrDefaultClause() { return token === 65 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(171 /* SwitchStatement */); + var node = createNode(174 /* SwitchStatement */); parseExpected(90 /* SwitchKeyword */); parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); parseExpected(16 /* CloseParenToken */); parseExpected(13 /* OpenBraceToken */); - var saveInSwitchStatement = inSwitchStatement; - inSwitchStatement = 1 /* Nested */; node.clauses = parseList(3 /* SwitchClauses */, false, parseCaseOrDefaultClause); - inSwitchStatement = saveInSwitchStatement; parseExpected(14 /* CloseBraceToken */); - var defaultClauses = ts.filter(node.clauses, function (clause) { return clause.kind === 173 /* DefaultClause */; }); - for (var i = 1, n = defaultClauses.length; i < n; i++) { - var clause = defaultClauses[i]; - var start = ts.skipTrivia(file.text, clause.pos); - var end = clause.statements.length > 0 ? clause.statements[0].pos : clause.end; - grammarErrorAtPos(start, end - start, ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); - } return finishNode(node); } function parseThrowStatement() { - var node = createNode(175 /* ThrowStatement */); + var node = createNode(178 /* ThrowStatement */); parseExpected(92 /* ThrowKeyword */); if (scanner.hasPrecedingLineBreak()) { error(ts.Diagnostics.Line_break_not_permitted_here); @@ -4407,13 +4083,13 @@ var ts; return finishNode(node); } function parseTryStatement() { - var node = createNode(176 /* TryStatement */); - node.tryBlock = parseTokenAndBlock(94 /* TryKeyword */, 177 /* TryBlock */); + var node = createNode(179 /* TryStatement */); + node.tryBlock = parseTokenAndBlock(94 /* TryKeyword */, 180 /* TryBlock */); if (token === 66 /* CatchKeyword */) { node.catchBlock = parseCatchBlock(); } if (token === 79 /* FinallyKeyword */) { - node.finallyBlock = parseTokenAndBlock(79 /* FinallyKeyword */, 179 /* FinallyBlock */); + node.finallyBlock = parseTokenAndBlock(79 /* FinallyKeyword */, 182 /* FinallyBlock */); } if (!(node.catchBlock || node.finallyBlock)) { error(ts.Diagnostics.catch_or_finally_expected); @@ -4433,24 +4109,17 @@ var ts; parseExpected(66 /* CatchKeyword */); parseExpected(15 /* OpenParenToken */); var variable = parseIdentifier(); - var typeAnnotationColonStart = scanner.getTokenPos(); - var typeAnnotationColonLength = scanner.getTextPos() - typeAnnotationColonStart; var typeAnnotation = parseTypeAnnotation(); parseExpected(16 /* CloseParenToken */); var result = parseBlock(false, false); - result.kind = 178 /* CatchBlock */; + result.kind = 181 /* CatchBlock */; result.pos = pos; result.variable = variable; - if (typeAnnotation) { - errorAtPos(typeAnnotationColonStart, typeAnnotationColonLength, ts.Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation); - } - if (isInStrictMode && isEvalOrArgumentsIdentifier(variable)) { - reportInvalidUseInStrictMode(variable); - } + result.type = typeAnnotation; return result; } function parseDebuggerStatement() { - var node = createNode(180 /* DebuggerStatement */); + var node = createNode(183 /* DebuggerStatement */); parseExpected(70 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -4458,28 +4127,18 @@ var ts; function isIterationStatementStart() { return token === 98 /* WhileKeyword */ || token === 73 /* DoKeyword */ || token === 80 /* ForKeyword */; } - function parseStatementWithLabelSet(allowLetAndConstDeclarations) { - labelledStatementInfo.pushCurrentLabelSet(isIterationStatementStart()); - var statement = parseStatement(allowLetAndConstDeclarations); - labelledStatementInfo.pop(); - return statement; - } function isLabel() { return isIdentifier() && lookAhead(function () { return nextToken() === 50 /* ColonToken */; }); } - function parseLabeledStatement(allowLetAndConstDeclarations) { - var node = createNode(174 /* LabeledStatement */); + function parseLabeledStatement() { + var node = createNode(177 /* LabeledStatement */); node.label = parseIdentifier(); parseExpected(50 /* ColonToken */); - if (labelledStatementInfo.nodeIsNestedInLabel(node.label, false, true)) { - grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, getTextOfNodeFromSourceText(sourceText, node.label)); - } - labelledStatementInfo.addLabel(node.label); - node.statement = isLabel() ? parseLabeledStatement(allowLetAndConstDeclarations) : parseStatementWithLabelSet(allowLetAndConstDeclarations); + node.statement = isLabel() ? parseLabeledStatement() : parseStatement(); return finishNode(node); } function parseExpressionStatement() { - var node = createNode(161 /* ExpressionStatement */); + var node = createNode(164 /* ExpressionStatement */); node.expression = parseExpression(); parseSemicolon(); return finishNode(node); @@ -4529,14 +4188,14 @@ var ts; return isStartOfExpression(); } } - function parseStatement(allowLetAndConstDeclarations) { + function parseStatement() { switch (token) { case 13 /* OpenBraceToken */: return parseBlock(false, false); case 96 /* VarKeyword */: case 102 /* LetKeyword */: case 68 /* ConstKeyword */: - return parseVariableStatement(allowLetAndConstDeclarations); + return parseVariableStatement(); case 81 /* FunctionKeyword */: return parseFunctionDeclaration(); case 21 /* SemicolonToken */: @@ -4550,9 +4209,9 @@ var ts; case 80 /* ForKeyword */: return parseForOrForInStatement(); case 69 /* ContinueKeyword */: - return parseBreakOrContinueStatement(167 /* ContinueStatement */); + return parseBreakOrContinueStatement(170 /* ContinueStatement */); case 64 /* BreakKeyword */: - return parseBreakOrContinueStatement(168 /* BreakStatement */); + return parseBreakOrContinueStatement(171 /* BreakStatement */); case 88 /* ReturnKeyword */: return parseReturnStatement(); case 99 /* WithKeyword */: @@ -4568,22 +4227,12 @@ var ts; case 70 /* DebuggerKeyword */: return parseDebuggerStatement(); default: - if (isLabel()) { - return parseLabeledStatement(allowLetAndConstDeclarations); - } - return parseExpressionStatement(); + return isLabel() ? parseLabeledStatement() : parseExpressionStatement(); } } - function parseAndCheckFunctionBody(isConstructor) { - var initialPosition = scanner.getTokenPos(); - var errorCountBeforeBody = file.syntacticErrors.length; + function parseFunctionBlockOrSemicolon() { if (token === 13 /* OpenBraceToken */) { - var body = parseBody(false); - if (body && inAmbientContext && file.syntacticErrors.length === errorCountBeforeBody) { - var diagnostic = isConstructor ? ts.Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context : ts.Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; - grammarErrorAtPos(initialPosition, 1, diagnostic); - } - return body; + return parseFunctionBlock(false); } if (canParseSemicolon()) { parseSemicolon(); @@ -4592,69 +4241,39 @@ var ts; error(ts.Diagnostics.Block_or_expected); } function parseVariableDeclaration(flags, noIn) { - var node = createNode(181 /* VariableDeclaration */); + var node = createNode(184 /* VariableDeclaration */); node.flags = flags; - var errorCountBeforeVariableDeclaration = file.syntacticErrors.length; node.name = parseIdentifier(); node.type = parseTypeAnnotation(); var initializerStart = scanner.getTokenPos(); var initializerFirstTokenLength = scanner.getTextPos() - initializerStart; node.initializer = parseInitializer(false, noIn); - if (inAmbientContext && node.initializer && errorCountBeforeVariableDeclaration === file.syntacticErrors.length) { - grammarErrorAtPos(initializerStart, initializerFirstTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } - if (!inAmbientContext && !node.initializer && flags & 4096 /* Const */) { - grammarErrorOnNode(node, ts.Diagnostics.const_declarations_must_be_initialized); - } - if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { - reportInvalidUseInStrictMode(node.name); - } return finishNode(node); } function parseVariableDeclarationList(flags, noIn) { - return parseDelimitedList(9 /* VariableDeclarations */, function () { return parseVariableDeclaration(flags, noIn); }, false); + return parseDelimitedList(9 /* VariableDeclarations */, function () { return parseVariableDeclaration(flags, noIn); }); } - function parseVariableStatement(allowLetAndConstDeclarations, pos, flags) { - var node = createNode(159 /* VariableStatement */, pos); - if (flags) + function parseVariableStatement(pos, flags) { + var node = createNode(162 /* VariableStatement */, pos); + if (flags) { node.flags = flags; - var errorCountBeforeVarStatement = file.syntacticErrors.length; + } if (token === 102 /* LetKeyword */) { node.flags |= 2048 /* Let */; } else if (token === 68 /* ConstKeyword */) { node.flags |= 4096 /* Const */; } - else if (token !== 96 /* VarKeyword */) { - error(ts.Diagnostics.var_let_or_const_expected); + else { + ts.Debug.assert(token === 96 /* VarKeyword */); } nextToken(); node.declarations = parseVariableDeclarationList(node.flags, false); parseSemicolon(); - finishNode(node); - if (!node.declarations.length && file.syntacticErrors.length === errorCountBeforeVarStatement) { - grammarErrorOnNode(node, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); - } - if (languageVersion < 2 /* ES6 */) { - if (node.flags & 2048 /* Let */) { - grammarErrorOnNode(node, ts.Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); - } - else if (node.flags & 4096 /* Const */) { - grammarErrorOnNode(node, ts.Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); - } - } - else if (!allowLetAndConstDeclarations) { - if (node.flags & 2048 /* Let */) { - grammarErrorOnNode(node, ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block); - } - else if (node.flags & 4096 /* Const */) { - grammarErrorOnNode(node, ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block); - } - } - return node; + return finishNode(node); } function parseFunctionDeclaration(pos, flags) { - var node = createNode(182 /* FunctionDeclaration */, pos); + var node = createNode(185 /* FunctionDeclaration */, pos); if (flags) node.flags = flags; parseExpected(81 /* FunctionKeyword */); @@ -4663,119 +4282,65 @@ var ts; node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; - node.body = parseAndCheckFunctionBody(false); - if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { - reportInvalidUseInStrictMode(node.name); - } + node.body = parseFunctionBlockOrSemicolon(); return finishNode(node); } - function parseConstructorDeclaration(pos, flags) { + function parseConstructorDeclaration(pos, modifiers) { var node = createNode(126 /* Constructor */, pos); - node.flags = flags; + setModifiers(node, modifiers); parseExpected(111 /* ConstructorKeyword */); var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; - node.body = parseAndCheckFunctionBody(true); - if (node.typeParameters) { - grammarErrorAtPos(node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); - } - if (node.type) { - grammarErrorOnNode(node.type, ts.Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); - } + node.body = parseFunctionBlockOrSemicolon(); return finishNode(node); } - function parsePropertyMemberDeclaration(pos, flags) { - var errorCountBeforePropertyDeclaration = file.syntacticErrors.length; + function parsePropertyMemberDeclaration(pos, modifiers) { var name = parsePropertyName(); + var flags = modifiers ? modifiers.flags : 0; var questionStart = scanner.getTokenPos(); if (parseOptional(49 /* QuestionToken */)) { - errorAtPos(questionStart, scanner.getStartPos() - questionStart, ts.Diagnostics.A_class_member_cannot_be_declared_optional); + flags |= 4 /* QuestionMark */; } if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { var method = createNode(125 /* Method */, pos); - method.flags = flags; + setModifiers(method, modifiers); + if (flags) { + method.flags = flags; + } method.name = name; var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); method.typeParameters = sig.typeParameters; method.parameters = sig.parameters; method.type = sig.type; - method.body = parseAndCheckFunctionBody(false); + method.body = parseFunctionBlockOrSemicolon(); return finishNode(method); } else { var property = createNode(124 /* Property */, pos); - property.flags = flags; + setModifiers(property, modifiers); + if (flags) { + property.flags = flags; + } property.name = name; property.type = parseTypeAnnotation(); var initializerStart = scanner.getTokenPos(); var initializerFirstTokenLength = scanner.getTextPos() - initializerStart; property.initializer = parseInitializer(false); parseSemicolon(); - if (inAmbientContext && property.initializer && errorCountBeforePropertyDeclaration === file.syntacticErrors.length) { - grammarErrorAtPos(initializerStart, initializerFirstTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } return finishNode(property); } } - function parseAndCheckMemberAccessorDeclaration(kind, pos, flags) { - var errorCountBeforeAccessor = file.syntacticErrors.length; - var accessor = parseMemberAccessorDeclaration(kind, pos, flags); - if (errorCountBeforeAccessor === file.syntacticErrors.length) { - if (languageVersion < 1 /* ES5 */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); - } - else if (inAmbientContext) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); - } - else if (accessor.typeParameters) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); - } - else if (kind === 127 /* GetAccessor */ && accessor.parameters.length) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); - } - else if (kind === 128 /* SetAccessor */) { - if (accessor.type) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); - } - else if (accessor.parameters.length !== 1) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); - } - else { - var parameter = accessor.parameters[0]; - if (parameter.flags & 8 /* Rest */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter); - } - else if (parameter.flags & 243 /* Modifier */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); - } - else if (parameter.flags & 4 /* QuestionMark */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); - } - else if (parameter.initializer) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); - } - } - } - } - return accessor; - } - function parseMemberAccessorDeclaration(kind, pos, flags) { + function parseMemberAccessorDeclaration(kind, pos, modifiers) { var node = createNode(kind, pos); - node.flags = flags; + setModifiers(node, modifiers); node.name = parsePropertyName(); var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; - if (inAmbientContext && canParseSemicolon()) { - parseSemicolon(); - node.body = createMissingNode(); - } - else { - node.body = parseBody(false); - } + node.body = parseFunctionBlockOrSemicolon(); return finishNode(node); } function isClassMemberStart() { @@ -4808,177 +4373,55 @@ var ts; } return false; } - function parseAndCheckModifiers(context) { + function parseModifiers(context) { var flags = 0; - var lastStaticModifierStart; - var lastStaticModifierLength; - var lastDeclareModifierStart; - var lastDeclareModifierLength; - var lastPrivateModifierStart; - var lastPrivateModifierLength; - var lastProtectedModifierStart; - var lastProtectedModifierLength; + var modifiers; while (true) { var modifierStart = scanner.getTokenPos(); var modifierToken = token; if (!parseAnyContextualModifier()) break; - var modifierLength = scanner.getStartPos() - modifierStart; - switch (modifierToken) { - case 106 /* PublicKeyword */: - if (flags & 112 /* AccessibilityModifier */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & 128 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "public", "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "public"); - } - flags |= 16 /* Public */; - break; - case 104 /* PrivateKeyword */: - if (flags & 112 /* AccessibilityModifier */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & 128 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "private", "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "private"); - } - lastPrivateModifierStart = modifierStart; - lastPrivateModifierLength = modifierLength; - flags |= 32 /* Private */; - break; - case 105 /* ProtectedKeyword */: - if (flags & 16 /* Public */ || flags & 32 /* Private */ || flags & 64 /* Protected */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & 128 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "protected", "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "protected"); - } - lastProtectedModifierStart = modifierStart; - lastProtectedModifierLength = modifierLength; - flags |= 64 /* Protected */; - break; - case 107 /* StaticKeyword */: - if (flags & 128 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); - } - else if (context === 3 /* Parameters */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); - } - lastStaticModifierStart = modifierStart; - lastStaticModifierLength = modifierLength; - flags |= 128 /* Static */; - break; - case 76 /* ExportKeyword */: - if (flags & 1 /* Export */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "export"); - } - else if (flags & 2 /* Ambient */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); - } - else if (context === 2 /* ClassMembers */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); - } - else if (context === 3 /* Parameters */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); - } - flags |= 1 /* Export */; - break; - case 112 /* DeclareKeyword */: - if (flags & 2 /* Ambient */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "declare"); - } - else if (context === 2 /* ClassMembers */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); - } - else if (context === 3 /* Parameters */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); - } - else if (inAmbientContext && context === 1 /* ModuleElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); - } - lastDeclareModifierStart = modifierStart; - lastDeclareModifierLength = modifierLength; - flags |= 2 /* Ambient */; - break; + if (!modifiers) { + modifiers = []; } + flags |= modifierToFlag(modifierToken); + modifiers.push(finishNode(createNode(modifierToken, modifierStart))); } - if (token === 111 /* ConstructorKeyword */ && flags & 128 /* Static */) { - grammarErrorAtPos(lastStaticModifierStart, lastStaticModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); + if (modifiers) { + modifiers.flags = flags; } - else if (token === 111 /* ConstructorKeyword */ && flags & 32 /* Private */) { - grammarErrorAtPos(lastPrivateModifierStart, lastPrivateModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); - } - else if (token === 111 /* ConstructorKeyword */ && flags & 64 /* Protected */) { - grammarErrorAtPos(lastProtectedModifierStart, lastProtectedModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "protected"); - } - else if (token === 83 /* ImportKeyword */) { - if (flags & 2 /* Ambient */) { - grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); - } - } - else if (token === 101 /* InterfaceKeyword */) { - if (flags & 2 /* Ambient */) { - grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); - } - } - else if (token !== 76 /* ExportKeyword */ && !(flags & 2 /* Ambient */) && inAmbientContext && context === 0 /* SourceElements */) { - var declarationStart = scanner.getTokenPos(); - var declarationFirstTokenLength = scanner.getTextPos() - declarationStart; - grammarErrorAtPos(declarationStart, declarationFirstTokenLength, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); - } - return flags; + return modifiers; } function parseClassMemberDeclaration() { var pos = getNodePos(); - var flags = parseAndCheckModifiers(2 /* ClassMembers */); + var modifiers = parseModifiers(2 /* ClassMembers */); if (parseContextualModifier(113 /* GetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(127 /* GetAccessor */, pos, flags); + return parseMemberAccessorDeclaration(127 /* GetAccessor */, pos, modifiers); } if (parseContextualModifier(117 /* SetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(128 /* SetAccessor */, pos, flags); + return parseMemberAccessorDeclaration(128 /* SetAccessor */, pos, modifiers); } if (token === 111 /* ConstructorKeyword */) { - return parseConstructorDeclaration(pos, flags); + return parseConstructorDeclaration(pos, modifiers); } if (token >= 63 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { - return parsePropertyMemberDeclaration(pos, flags); + return parsePropertyMemberDeclaration(pos, modifiers); } if (token === 17 /* OpenBracketToken */) { - if (flags) { - var start = getTokenPos(pos); - var length = getNodePos() - start; - errorAtPos(start, length, ts.Diagnostics.Modifiers_not_permitted_on_index_signature_members); - } - return parseIndexSignatureMember(); + return parseIndexSignatureMember(modifiers, pos); } ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassDeclaration(pos, flags) { - var node = createNode(184 /* ClassDeclaration */, pos); + var node = createNode(187 /* ClassDeclaration */, pos); node.flags = flags; - var errorCountBeforeClassDeclaration = file.syntacticErrors.length; parseExpected(67 /* ClassKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); node.baseType = parseOptional(77 /* ExtendsKeyword */) ? parseTypeReference() : undefined; - var implementsKeywordStart = scanner.getTokenPos(); - var implementsKeywordLength; if (parseOptional(100 /* ImplementsKeyword */)) { - implementsKeywordLength = scanner.getStartPos() - implementsKeywordStart; - node.implementedTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); + node.implementedTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference); } - var errorCountBeforeClassBody = file.syntacticErrors.length; if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseList(6 /* ClassMembers */, false, parseClassMemberDeclaration); parseExpected(14 /* CloseBraceToken */); @@ -4986,33 +4429,22 @@ var ts; else { node.members = createMissingList(); } - if (node.implementedTypes && !node.implementedTypes.length && errorCountBeforeClassBody === errorCountBeforeClassDeclaration) { - grammarErrorAtPos(implementsKeywordStart, implementsKeywordLength, ts.Diagnostics._0_list_cannot_be_empty, "implements"); - } return finishNode(node); } function parseInterfaceDeclaration(pos, flags) { - var node = createNode(185 /* InterfaceDeclaration */, pos); + var node = createNode(188 /* InterfaceDeclaration */, pos); node.flags = flags; - var errorCountBeforeInterfaceDeclaration = file.syntacticErrors.length; parseExpected(101 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); - var extendsKeywordStart = scanner.getTokenPos(); - var extendsKeywordLength; if (parseOptional(77 /* ExtendsKeyword */)) { - extendsKeywordLength = scanner.getStartPos() - extendsKeywordStart; - node.baseTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); + node.baseTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference); } - var errorCountBeforeInterfaceBody = file.syntacticErrors.length; node.members = parseTypeLiteral().members; - if (node.baseTypes && !node.baseTypes.length && errorCountBeforeInterfaceBody === errorCountBeforeInterfaceDeclaration) { - grammarErrorAtPos(extendsKeywordStart, extendsKeywordLength, ts.Diagnostics._0_list_cannot_be_empty, "extends"); - } return finishNode(node); } function parseTypeAliasDeclaration(pos, flags) { - var node = createNode(186 /* TypeAliasDeclaration */, pos); + var node = createNode(189 /* TypeAliasDeclaration */, pos); node.flags = flags; parseExpected(119 /* TypeKeyword */); node.name = parseIdentifier(); @@ -5023,43 +4455,13 @@ var ts; } function parseAndCheckEnumDeclaration(pos, flags) { var enumIsConst = flags & 4096 /* Const */; - function isIntegerLiteral(expression) { - function isInteger(literalExpression) { - return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); - } - if (expression.kind === 151 /* PrefixOperator */) { - var unaryExpression = expression; - if (unaryExpression.operator === 32 /* PlusToken */ || unaryExpression.operator === 33 /* MinusToken */) { - expression = unaryExpression.operand; - } - } - if (expression.kind === 6 /* NumericLiteral */) { - return isInteger(expression); - } - return false; - } - var inConstantEnumMemberSection = true; - function parseAndCheckEnumMember() { - var node = createNode(192 /* EnumMember */); - var errorCountBeforeEnumMember = file.syntacticErrors.length; + function parseEnumMember() { + var node = createNode(195 /* EnumMember */); node.name = parsePropertyName(); node.initializer = parseInitializer(false); - if (!enumIsConst) { - if (inAmbientContext) { - if (node.initializer && !isIntegerLiteral(node.initializer) && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, ts.Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers); - } - } - else if (node.initializer) { - inConstantEnumMemberSection = isIntegerLiteral(node.initializer); - } - else if (!inConstantEnumMemberSection && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, ts.Diagnostics.Enum_member_must_have_initializer); - } - } return finishNode(node); } - var node = createNode(187 /* EnumDeclaration */, pos); + var node = createNode(190 /* EnumDeclaration */, pos); node.flags = flags; if (enumIsConst) { parseExpected(68 /* ConstKeyword */); @@ -5067,7 +4469,7 @@ var ts; parseExpected(75 /* EnumKeyword */); node.name = parseIdentifier(); if (parseExpected(13 /* OpenBraceToken */)) { - node.members = parseDelimitedList(7 /* EnumMembers */, parseAndCheckEnumMember, true); + node.members = parseDelimitedList(7 /* EnumMembers */, parseEnumMember); parseExpected(14 /* CloseBraceToken */); } else { @@ -5076,7 +4478,7 @@ var ts; return finishNode(node); } function parseModuleBody() { - var node = createNode(189 /* ModuleBlock */); + var node = createNode(192 /* ModuleBlock */); if (parseExpected(13 /* OpenBraceToken */)) { node.statements = parseList(1 /* ModuleElements */, false, parseModuleElement); parseExpected(14 /* CloseBraceToken */); @@ -5087,7 +4489,7 @@ var ts; return finishNode(node); } function parseInternalModuleTail(pos, flags) { - var node = createNode(188 /* ModuleDeclaration */, pos); + var node = createNode(191 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseIdentifier(); if (parseOptional(19 /* DotToken */)) { @@ -5095,31 +4497,14 @@ var ts; } else { node.body = parseModuleBody(); - ts.forEach(node.body.statements, function (s) { - if (s.kind === 191 /* ExportAssignment */) { - grammarErrorOnNode(s, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); - } - else if (s.kind === 190 /* ImportDeclaration */ && s.externalModuleName) { - grammarErrorOnNode(s, ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); - } - }); } return finishNode(node); } function parseAmbientExternalModuleDeclaration(pos, flags) { - var node = createNode(188 /* ModuleDeclaration */, pos); + var node = createNode(191 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseStringLiteral(); - if (!inAmbientContext) { - var errorCount = file.syntacticErrors.length; - if (!errorCount || file.syntacticErrors[errorCount - 1].start < getTokenPos(pos)) { - grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); - } - } - var saveInAmbientContext = inAmbientContext; - inAmbientContext = true; node.body = parseModuleBody(); - inAmbientContext = saveInAmbientContext; return finishNode(node); } function parseModuleDeclaration(pos, flags) { @@ -5127,7 +4512,7 @@ var ts; return token === 7 /* StringLiteral */ ? parseAmbientExternalModuleDeclaration(pos, flags) : parseInternalModuleTail(pos, flags); } function parseImportDeclaration(pos, flags) { - var node = createNode(190 /* ImportDeclaration */, pos); + var node = createNode(193 /* ImportDeclaration */, pos); node.flags = flags; parseExpected(83 /* ImportKeyword */); node.name = parseIdentifier(); @@ -5143,8 +4528,9 @@ var ts; parseSemicolon(); return finishNode(node); } - function parseExportAssignmentTail(pos) { - var node = createNode(191 /* ExportAssignment */, pos); + function parseExportAssignmentTail(pos, modifiers) { + var node = createNode(194 /* ExportAssignment */, pos); + setModifiers(node, modifiers); node.exportName = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -5179,29 +4565,20 @@ var ts; } function parseDeclaration(modifierContext) { var pos = getNodePos(); - var errorCountBeforeModifiers = file.syntacticErrors.length; - var flags = parseAndCheckModifiers(modifierContext); + var modifiers = parseModifiers(modifierContext); if (token === 76 /* ExportKeyword */) { var modifiersEnd = scanner.getStartPos(); nextToken(); if (parseOptional(51 /* EqualsToken */)) { - var exportAssignmentTail = parseExportAssignmentTail(pos); - if (flags !== 0 && errorCountBeforeModifiers === file.syntacticErrors.length) { - var modifiersStart = ts.skipTrivia(sourceText, pos); - grammarErrorAtPos(modifiersStart, modifiersEnd - modifiersStart, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); - } - return exportAssignmentTail; + return parseExportAssignmentTail(pos, modifiers); } } - var saveInAmbientContext = inAmbientContext; - if (flags & 2 /* Ambient */) { - inAmbientContext = true; - } + var flags = modifiers ? modifiers.flags : 0; var result; switch (token) { case 96 /* VarKeyword */: case 102 /* LetKeyword */: - result = parseVariableStatement(true, pos, flags); + result = parseVariableStatement(pos, flags); break; case 68 /* ConstKeyword */: var isConstEnum = lookAhead(function () { return nextToken() === 75 /* EnumKeyword */; }); @@ -5209,7 +4586,7 @@ var ts; result = parseAndCheckEnumDeclaration(pos, flags | 4096 /* Const */); } else { - result = parseVariableStatement(true, pos, flags); + result = parseVariableStatement(pos, flags); } break; case 81 /* FunctionKeyword */: @@ -5236,7 +4613,9 @@ var ts; default: error(ts.Diagnostics.Declaration_expected); } - inAmbientContext = saveInAmbientContext; + if (modifiers) { + result.modifiers = modifiers; + } return result; } function isSourceElement(inErrorRecovery) { @@ -5249,50 +4628,38 @@ var ts; return parseSourceElementOrModuleElement(1 /* ModuleElements */); } function parseSourceElementOrModuleElement(modifierContext) { - if (isDeclarationStart()) { - return parseDeclaration(modifierContext); - } - var statementStart = scanner.getTokenPos(); - var statementFirstTokenLength = scanner.getTextPos() - statementStart; - var errorCountBeforeStatement = file.syntacticErrors.length; - var statement = parseStatement(true); - if (inAmbientContext && file.syntacticErrors.length === errorCountBeforeStatement) { - grammarErrorAtPos(statementStart, statementFirstTokenLength, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); - } - return statement; + return isDeclarationStart() ? parseDeclaration(modifierContext) : parseStatement(); } function processReferenceComments() { var referencedFiles = []; var amdDependencies = []; + var amdModuleName; commentRanges = []; token = scanner.scan(); for (var i = 0; i < commentRanges.length; i++) { var range = commentRanges[i]; var comment = sourceText.substring(range.pos, range.end); - var simpleReferenceRegEx = /^\/\/\/\s*/gim; - if (isNoDefaultLibRegEx.exec(comment)) { - file.hasNoDefaultLib = true; + var referencePathMatchResult = getFileReferenceFromReferencePath(comment, range); + if (referencePathMatchResult) { + var fileReference = referencePathMatchResult.fileReference; + file.hasNoDefaultLib = referencePathMatchResult.isNoDefaultLib; + var diagnostic = referencePathMatchResult.diagnostic; + if (fileReference) { + referencedFiles.push(fileReference); } - else { - var matchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment); - var start = range.pos; - var end = range.end; - var length = end - start; - if (!matchResult) { - errorAtPos(start, length, ts.Diagnostics.Invalid_reference_directive_syntax); - } - else { - referencedFiles.push({ - pos: start, - end: end, - filename: matchResult[3] - }); - } + if (diagnostic) { + errorAtPos(range.pos, range.end - range.pos, diagnostic); } } else { + var amdModuleNameRegEx = /^\/\/\/\s* 0) { + syntacticDiagnostics = file.parseDiagnostics; + } + else { + syntacticDiagnostics = file.grammarDiagnostics; + checkGrammar(sourceText, languageVersion, file); + } + } + ts.Debug.assert(syntacticDiagnostics !== undefined); + return syntacticDiagnostics; } scanner = ts.createScanner(languageVersion, true, sourceText, scanError, onComment); var rootNodeFlags = 0; if (ts.fileExtensionIs(filename, ".d.ts")) { rootNodeFlags = 1024 /* DeclarationFile */; - inAmbientContext = true; } - file = createRootNode(193 /* SourceFile */, 0, sourceText.length, rootNodeFlags); + file = createRootNode(196 /* SourceFile */, 0, sourceText.length, rootNodeFlags); file.filename = ts.normalizePath(filename); file.text = sourceText; - file.getLineAndCharacterFromPosition = getLineAndCharacterlFromSourcePosition; + file.getLineAndCharacterFromPosition = getLineAndCharacterFromSourcePosition; file.getPositionFromLineAndCharacter = getPositionFromSourceLineAndCharacter; - file.syntacticErrors = []; - file.semanticErrors = []; + file.getLineStarts = getLineStarts; + file.getSyntacticDiagnostics = getSyntacticDiagnostics; + file.parseDiagnostics = []; + file.grammarDiagnostics = []; + file.semanticDiagnostics = []; var referenceComments = processReferenceComments(); file.referencedFiles = referenceComments.referencedFiles; file.amdDependencies = referenceComments.amdDependencies; + file.amdModuleName = referenceComments.amdModuleName; file.statements = parseList(0 /* SourceElements */, true, parseSourceElement); file.externalModuleIndicator = getExternalModuleIndicator(); file.nodeCount = nodeCount; @@ -5336,6 +4721,901 @@ var ts; return file; } ts.createSourceFile = createSourceFile; + function isLeftHandSideExpression(expr) { + if (expr) { + switch (expr.kind) { + case 145 /* PropertyAccess */: + case 146 /* IndexedAccess */: + case 148 /* NewExpression */: + case 147 /* CallExpression */: + case 149 /* TaggedTemplateExpression */: + case 141 /* ArrayLiteral */: + case 151 /* ParenExpression */: + case 142 /* ObjectLiteral */: + case 152 /* FunctionExpression */: + case 63 /* Identifier */: + case 120 /* Missing */: + case 8 /* RegularExpressionLiteral */: + case 6 /* NumericLiteral */: + case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 158 /* TemplateExpression */: + case 78 /* FalseKeyword */: + case 87 /* NullKeyword */: + case 91 /* ThisKeyword */: + case 93 /* TrueKeyword */: + case 89 /* SuperKeyword */: + return true; + } + } + return false; + } + function isAssignmentOperator(token) { + return token >= 51 /* FirstAssignment */ && token <= 62 /* LastAssignment */; + } + function checkGrammar(sourceText, languageVersion, file) { + var grammarDiagnostics = file.grammarDiagnostics; + var scanner = ts.createScanner(languageVersion, true, sourceText); + var inAmbientContext = ts.fileExtensionIs(file.filename, ".d.ts"); + var inFunctionBlock = false; + var parent; + visitNode(file); + function visitNode(node) { + var savedParent = parent; + node.parent = parent; + parent = node; + if (!checkModifiers(node)) { + var savedInFunctionBlock = inFunctionBlock; + if (node.kind === 186 /* FunctionBlock */) { + inFunctionBlock = true; + } + var savedInAmbientContext = inAmbientContext; + if (node.flags & 2 /* Ambient */) { + inAmbientContext = true; + } + checkNodeAndChildren(node); + inAmbientContext = savedInAmbientContext; + inFunctionBlock = savedInFunctionBlock; + } + parent = savedParent; + } + function checkNodeAndChildren(node) { + var nodeKind = node.kind; + if (inAmbientContext && checkForStatementInAmbientContext(node, nodeKind)) { + return; + } + if (checkNode(node, nodeKind)) { + return; + } + forEachChild(node, visitNode); + } + function checkNode(node, nodeKind) { + switch (nodeKind) { + case 153 /* ArrowFunction */: + case 129 /* CallSignature */: + case 134 /* ConstructorType */: + case 130 /* ConstructSignature */: + case 133 /* FunctionType */: + return checkAnyParsedSignature(node); + case 171 /* BreakStatement */: + case 170 /* ContinueStatement */: + return checkBreakOrContinueStatement(node); + case 147 /* CallExpression */: + case 148 /* NewExpression */: + return checkCallOrNewExpression(node); + case 190 /* EnumDeclaration */: return checkEnumDeclaration(node); + case 123 /* Parameter */: return checkParameter(node); + case 156 /* BinaryExpression */: return checkBinaryExpression(node); + case 181 /* CatchBlock */: return checkCatchBlock(node); + case 187 /* ClassDeclaration */: return checkClassDeclaration(node); + case 126 /* Constructor */: return checkConstructor(node); + case 194 /* ExportAssignment */: return checkExportAssignment(node); + case 169 /* ForInStatement */: return checkForInStatement(node); + case 168 /* ForStatement */: return checkForStatement(node); + case 185 /* FunctionDeclaration */: return checkFunctionDeclaration(node); + case 152 /* FunctionExpression */: return checkFunctionExpression(node); + case 127 /* GetAccessor */: return checkGetAccessor(node); + case 146 /* IndexedAccess */: return checkIndexedAccess(node); + case 131 /* IndexSignature */: return checkIndexSignature(node); + case 188 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); + case 177 /* LabeledStatement */: return checkLabeledStatement(node); + case 125 /* Method */: return checkMethod(node); + case 191 /* ModuleDeclaration */: return checkModuleDeclaration(node); + case 142 /* ObjectLiteral */: return checkObjectLiteral(node); + case 6 /* NumericLiteral */: return checkNumericLiteral(node); + case 155 /* PostfixOperator */: return checkPostfixOperator(node); + case 154 /* PrefixOperator */: return checkPrefixOperator(node); + case 124 /* Property */: return checkProperty(node); + case 143 /* PropertyAssignment */: return checkPropertyAssignment(node); + case 172 /* ReturnStatement */: return checkReturnStatement(node); + case 128 /* SetAccessor */: return checkSetAccessor(node); + case 196 /* SourceFile */: return checkSourceFile(node); + case 144 /* ShorthandPropertyAssignment */: return checkShorthandPropertyAssignment(node); + case 174 /* SwitchStatement */: return checkSwitchStatement(node); + case 149 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); + case 138 /* TupleType */: return checkTupleType(node); + case 122 /* TypeParameter */: return checkTypeParameter(node); + case 132 /* TypeReference */: return checkTypeReference(node); + case 184 /* VariableDeclaration */: return checkVariableDeclaration(node); + case 162 /* VariableStatement */: return checkVariableStatement(node); + case 173 /* WithStatement */: return checkWithStatement(node); + } + } + function grammarErrorOnFirstToken(node, message, arg0, arg1, arg2) { + var start = ts.skipTrivia(sourceText, node.pos); + scanner.setTextPos(start); + scanner.scan(); + var end = scanner.getTextPos(); + grammarDiagnostics.push(ts.createFileDiagnostic(file, start, end - start, message, arg0, arg1, arg2)); + return true; + } + function grammarErrorOnNode(node, message, arg0, arg1, arg2) { + var span = getErrorSpanForNode(node); + var start = span.end > span.pos ? ts.skipTrivia(file.text, span.pos) : span.pos; + var length = span.end - start; + grammarDiagnostics.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + return true; + } + function grammarErrorAtPos(start, length, message, arg0, arg1, arg2) { + grammarDiagnostics.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + return true; + } + function reportInvalidUseInStrictMode(node) { + var name = sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end); + return grammarErrorOnNode(node, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, name); + } + function checkForStatementInAmbientContext(node, kind) { + switch (kind) { + case 161 /* Block */: + case 163 /* EmptyStatement */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: + case 172 /* ReturnStatement */: + case 173 /* WithStatement */: + case 174 /* SwitchStatement */: + case 178 /* ThrowStatement */: + case 179 /* TryStatement */: + case 183 /* DebuggerStatement */: + case 177 /* LabeledStatement */: + case 164 /* ExpressionStatement */: + return grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); + } + } + function checkAnyParsedSignature(node) { + return checkTypeParameterList(node.typeParameters) || checkParameterList(node.parameters); + } + function checkBinaryExpression(node) { + if (node.flags & 8192 /* ParsedInStrictMode */) { + if (isLeftHandSideExpression(node.left) && isAssignmentOperator(node.operator)) { + if (isEvalOrArgumentsIdentifier(node.left)) { + return reportInvalidUseInStrictMode(node.left); + } + } + } + } + function isIterationStatement(node, lookInLabeledStatements) { + switch (node.kind) { + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + return true; + case 177 /* LabeledStatement */: + return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); + } + return false; + } + function checkLabeledStatement(node) { + var current = node.parent; + while (current) { + if (isAnyFunction(current)) { + break; + } + if (current.kind === 177 /* LabeledStatement */ && current.label.text === node.label.text) { + return grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, getTextOfNodeFromSourceText(sourceText, node.label)); + } + current = current.parent; + } + } + function checkBreakOrContinueStatement(node) { + var current = node; + while (current) { + if (isAnyFunction(current)) { + return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); + } + switch (current.kind) { + case 177 /* LabeledStatement */: + if (node.label && current.label.text === node.label.text) { + var isMisplacedContinueLabel = node.kind === 170 /* ContinueStatement */ && !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); + } + return false; + } + break; + case 174 /* SwitchStatement */: + if (node.kind === 171 /* BreakStatement */ && !node.label) { + return false; + } + break; + default: + if (isIterationStatement(current, false) && !node.label) { + return false; + } + break; + } + current = current.parent; + } + if (node.label) { + var message = node.kind === 171 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; + return grammarErrorOnNode(node, message); + } + else { + var message = node.kind === 171 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; + return grammarErrorOnNode(node, message); + } + } + function checkCallOrNewExpression(node) { + return checkTypeArguments(node.typeArguments) || checkArguments(node.arguments); + } + function checkArguments(arguments) { + return checkForDisallowedTrailingComma(arguments) || checkForOmittedArgument(arguments); + } + function checkTypeArguments(typeArguments) { + return checkForDisallowedTrailingComma(typeArguments) || checkForAtLeastOneTypeArgument(typeArguments) || checkForMissingTypeArgument(typeArguments); + } + function checkForOmittedArgument(arguments) { + if (arguments) { + for (var i = 0, n = arguments.length; i < n; i++) { + var arg = arguments[i]; + if (arg.kind === 160 /* OmittedExpression */) { + return grammarErrorAtPos(arg.pos, 0, ts.Diagnostics.Argument_expression_expected); + } + } + } + } + function checkForMissingTypeArgument(typeArguments) { + if (typeArguments) { + for (var i = 0, n = typeArguments.length; i < n; i++) { + var arg = typeArguments[i]; + if (arg.kind === 120 /* Missing */) { + return grammarErrorAtPos(arg.pos, 0, ts.Diagnostics.Type_expected); + } + } + } + } + function checkForAtLeastOneTypeArgument(typeArguments) { + if (typeArguments && typeArguments.length === 0) { + var start = typeArguments.pos - "<".length; + var end = ts.skipTrivia(sourceText, typeArguments.end) + ">".length; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.Type_argument_list_cannot_be_empty); + } + } + function checkForDisallowedTrailingComma(list) { + if (list && list.hasTrailingComma) { + var start = list.end - ",".length; + var end = list.end; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.Trailing_comma_not_allowed); + } + } + function checkCatchBlock(node) { + if (node.type) { + var colonStart = ts.skipTrivia(sourceText, node.variable.end); + return grammarErrorAtPos(colonStart, ":".length, ts.Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation); + } + if (node.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(node.variable)) { + return reportInvalidUseInStrictMode(node.variable); + } + } + function checkClassDeclaration(node) { + return checkForDisallowedTrailingComma(node.implementedTypes) || checkForAtLeastOneHeritageClause(node.implementedTypes, "implements"); + } + function checkForAtLeastOneHeritageClause(types, listType) { + if (types && types.length === 0) { + return grammarErrorAtPos(types.pos, 0, ts.Diagnostics._0_list_cannot_be_empty, listType); + } + } + function checkConstructor(node) { + return checkAnyParsedSignature(node) || checkConstructorTypeParameters(node) || checkConstructorTypeAnnotation(node) || checkForBodyInAmbientContext(node.body, true); + } + function checkConstructorTypeParameters(node) { + if (node.typeParameters) { + return grammarErrorAtPos(node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); + } + } + function checkConstructorTypeAnnotation(node) { + if (node.type) { + return grammarErrorOnNode(node.type, ts.Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); + } + } + function checkEnumDeclaration(enumDecl) { + var enumIsConst = (enumDecl.flags & 4096 /* Const */) !== 0; + var hasError = false; + if (!enumIsConst) { + var inConstantEnumMemberSection = true; + for (var i = 0, n = enumDecl.members.length; i < n; i++) { + var node = enumDecl.members[i]; + if (inAmbientContext) { + if (node.initializer && !isIntegerLiteral(node.initializer)) { + hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers) || hasError; + } + } + else if (node.initializer) { + inConstantEnumMemberSection = isIntegerLiteral(node.initializer); + } + else if (!inConstantEnumMemberSection) { + hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Enum_member_must_have_initializer) || hasError; + } + } + } + return hasError; + } + function isIntegerLiteral(expression) { + function isInteger(literalExpression) { + return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); + } + if (expression.kind === 154 /* PrefixOperator */) { + var unaryExpression = expression; + if (unaryExpression.operator === 32 /* PlusToken */ || unaryExpression.operator === 33 /* MinusToken */) { + expression = unaryExpression.operand; + } + } + if (expression.kind === 6 /* NumericLiteral */) { + return isInteger(expression); + } + return false; + } + function checkExportAssignment(node) { + if (node.flags & 243 /* Modifier */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); + } + } + function checkForInStatement(node) { + return checkVariableDeclarations(node.declarations) || checkForMoreThanOneDeclaration(node.declarations); + } + function checkForStatement(node) { + return checkVariableDeclarations(node.declarations); + } + function checkForMoreThanOneDeclaration(declarations) { + if (declarations && declarations.length > 1) { + return grammarErrorOnFirstToken(declarations[1], ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); + } + } + function checkFunctionDeclaration(node) { + return checkAnyParsedSignature(node) || checkFunctionName(node.name) || checkForBodyInAmbientContext(node.body, false); + } + function checkFunctionExpression(node) { + return checkAnyParsedSignature(node) || checkFunctionName(node.name); + } + function checkFunctionName(name) { + if (name && name.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(name)) { + return reportInvalidUseInStrictMode(name); + } + } + function checkGetAccessor(node) { + return checkAnyParsedSignature(node) || checkAccessor(node); + } + function checkIndexedAccess(node) { + if (node.index.kind === 120 /* Missing */ && node.parent.kind === 148 /* NewExpression */ && node.parent.func === node) { + var start = ts.skipTrivia(sourceText, node.parent.pos); + var end = node.end; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); + } + } + function checkIndexSignature(node) { + return checkIndexSignatureParameters(node) || checkForIndexSignatureModifiers(node); + } + function checkForIndexSignatureModifiers(node) { + if (node.flags & 243 /* Modifier */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_not_permitted_on_index_signature_members); + } + } + function checkIndexSignatureParameters(node) { + var parameter = node.parameters[0]; + if (node.parameters.length !== 1) { + if (parameter) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter); + } + else { + return grammarErrorOnNode(node, ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter); + } + } + else if (parameter.flags & 8 /* Rest */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); + } + else if (parameter.flags & 243 /* Modifier */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); + } + else if (parameter.flags & 4 /* QuestionMark */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); + } + else if (parameter.initializer) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); + } + else if (!parameter.type) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); + } + else if (parameter.type.kind !== 118 /* StringKeyword */ && parameter.type.kind !== 116 /* NumberKeyword */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); + } + else if (!node.type) { + return grammarErrorOnNode(node, ts.Diagnostics.An_index_signature_must_have_a_type_annotation); + } + } + function checkInterfaceDeclaration(node) { + return checkForDisallowedTrailingComma(node.baseTypes) || checkForAtLeastOneHeritageClause(node.baseTypes, "extends"); + } + function checkMethod(node) { + return checkAnyParsedSignature(node) || checkForBodyInAmbientContext(node.body, false) || (node.parent.kind === 187 /* ClassDeclaration */ && checkForInvalidQuestionMark(node, ts.Diagnostics.A_class_member_cannot_be_declared_optional)); + } + function checkForBodyInAmbientContext(body, isConstructor) { + if (inAmbientContext && body && body.kind === 186 /* FunctionBlock */) { + var diagnostic = isConstructor ? ts.Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context : ts.Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; + return grammarErrorOnFirstToken(body, diagnostic); + } + } + function checkModuleDeclaration(node) { + return checkModuleDeclarationName(node) || checkModuleDeclarationStatements(node); + } + function checkModuleDeclarationName(node) { + if (!inAmbientContext && node.name.kind === 7 /* StringLiteral */) { + return grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); + } + } + function checkModuleDeclarationStatements(node) { + if (node.name.kind === 63 /* Identifier */ && node.body.kind === 192 /* ModuleBlock */) { + var statements = node.body.statements; + for (var i = 0, n = statements.length; i < n; i++) { + var statement = statements[i]; + if (statement.kind === 194 /* ExportAssignment */) { + return grammarErrorOnNode(statement, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); + } + else if (statement.kind === 193 /* ImportDeclaration */ && statement.externalModuleName) { + return grammarErrorOnNode(statement.externalModuleName, ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); + } + } + } + } + function checkObjectLiteral(node) { + var seen = {}; + var Property = 1; + var GetAccessor = 2; + var SetAccesor = 4; + var GetOrSetAccessor = GetAccessor | SetAccesor; + var inStrictMode = (node.flags & 8192 /* ParsedInStrictMode */) !== 0; + for (var i = 0, n = node.properties.length; i < n; i++) { + var prop = node.properties[i]; + if (prop.kind === 160 /* OmittedExpression */) { + continue; + } + var p = prop; + var name = p.name; + var currentKind; + if (p.kind === 143 /* PropertyAssignment */) { + currentKind = Property; + } + else if (p.kind === 144 /* ShorthandPropertyAssignment */) { + currentKind = Property; + } + else if (p.kind === 127 /* GetAccessor */) { + currentKind = GetAccessor; + } + else if (p.kind === 128 /* SetAccessor */) { + currentKind = SetAccesor; + } + else { + ts.Debug.fail("Unexpected syntax kind:" + p.kind); + } + if (!ts.hasProperty(seen, name.text)) { + seen[name.text] = currentKind; + } + else { + var existingKind = seen[name.text]; + if (currentKind === Property && existingKind === Property) { + if (inStrictMode) { + grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + } + } + else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { + if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { + seen[name.text] = currentKind | existingKind; + } + else { + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + } + } + else { + return grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + } + } + } + } + function checkNumericLiteral(node) { + if (node.flags & 16384 /* OctalLiteral */) { + if (node.flags & 8192 /* ParsedInStrictMode */) { + return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); + } + else if (languageVersion >= 1 /* ES5 */) { + return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); + } + } + } + function checkModifiers(node) { + switch (node.kind) { + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: + case 124 /* Property */: + case 125 /* Method */: + case 131 /* IndexSignature */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 191 /* ModuleDeclaration */: + case 190 /* EnumDeclaration */: + case 194 /* ExportAssignment */: + case 162 /* VariableStatement */: + case 185 /* FunctionDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 193 /* ImportDeclaration */: + case 123 /* Parameter */: + break; + default: + return false; + } + if (!node.modifiers) { + return; + } + var lastStatic, lastPrivate, lastProtected, lastDeclare; + var flags = 0; + for (var i = 0, n = node.modifiers.length; i < n; i++) { + var modifier = node.modifiers[i]; + switch (modifier.kind) { + case 106 /* PublicKeyword */: + case 105 /* ProtectedKeyword */: + case 104 /* PrivateKeyword */: + var text; + if (modifier.kind === 106 /* PublicKeyword */) { + text = "public"; + } + else if (modifier.kind === 105 /* ProtectedKeyword */) { + text = "protected"; + lastProtected = modifier; + } + else { + text = "private"; + lastPrivate = modifier; + } + if (flags & 112 /* AccessibilityModifier */) { + return grammarErrorOnNode(modifier, ts.Diagnostics.Accessibility_modifier_already_seen); + } + else if (flags & 128 /* Static */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); + } + else if (node.parent.kind === 192 /* ModuleBlock */ || node.parent.kind === 196 /* SourceFile */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); + } + flags |= modifierToFlag(modifier.kind); + break; + case 107 /* StaticKeyword */: + if (flags & 128 /* Static */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); + } + else if (node.parent.kind === 192 /* ModuleBlock */ || node.parent.kind === 196 /* SourceFile */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); + } + else if (node.kind === 123 /* Parameter */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); + } + flags |= 128 /* Static */; + lastStatic = modifier; + break; + case 76 /* ExportKeyword */: + if (flags & 1 /* Export */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "export"); + } + else if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); + } + else if (node.parent.kind === 187 /* ClassDeclaration */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); + } + else if (node.kind === 123 /* Parameter */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); + } + flags |= 1 /* Export */; + break; + case 112 /* DeclareKeyword */: + if (flags & 2 /* Ambient */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); + } + else if (node.parent.kind === 187 /* ClassDeclaration */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); + } + else if (node.kind === 123 /* Parameter */) { + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); + } + else if (inAmbientContext && node.parent.kind === 192 /* ModuleBlock */) { + return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); + } + flags |= 2 /* Ambient */; + lastDeclare = modifier; + break; + } + } + if (node.kind === 126 /* Constructor */) { + if (flags & 128 /* Static */) { + return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); + } + else if (flags & 64 /* Protected */) { + return grammarErrorOnNode(lastProtected, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "protected"); + } + else if (flags & 32 /* Private */) { + return grammarErrorOnNode(lastPrivate, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); + } + } + else if (node.kind === 193 /* ImportDeclaration */ && flags & 2 /* Ambient */) { + return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); + } + else if (node.kind === 188 /* InterfaceDeclaration */ && flags & 2 /* Ambient */) { + return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); + } + } + function checkParameter(node) { + if (node.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(node.name)) { + return reportInvalidUseInStrictMode(node.name); + } + } + function checkTypeParameterList(typeParameters) { + if (checkForDisallowedTrailingComma(typeParameters)) { + return true; + } + if (typeParameters && typeParameters.length === 0) { + var start = typeParameters.pos - "<".length; + var end = ts.skipTrivia(sourceText, typeParameters.end) + ">".length; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.Type_parameter_list_cannot_be_empty); + } + } + function checkParameterList(parameters) { + if (checkForDisallowedTrailingComma(parameters)) { + return true; + } + var seenOptionalParameter = false; + var parameterCount = parameters.length; + for (var i = 0; i < parameterCount; i++) { + var parameter = parameters[i]; + if (parameter.flags & 8 /* Rest */) { + if (i !== (parameterCount - 1)) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); + } + if (parameter.flags & 4 /* QuestionMark */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_be_optional); + } + if (parameter.initializer) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer); + } + } + else if (parameter.flags & 4 /* QuestionMark */ || parameter.initializer) { + seenOptionalParameter = true; + if (parameter.flags & 4 /* QuestionMark */ && parameter.initializer) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.Parameter_cannot_have_question_mark_and_initializer); + } + } + else { + if (seenOptionalParameter) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); + } + } + } + } + function checkPostfixOperator(node) { + if (node.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(node.operand)) { + return reportInvalidUseInStrictMode(node.operand); + } + } + function checkPrefixOperator(node) { + if (node.flags & 8192 /* ParsedInStrictMode */) { + if ((node.operator === 37 /* PlusPlusToken */ || node.operator === 38 /* MinusMinusToken */) && isEvalOrArgumentsIdentifier(node.operand)) { + return reportInvalidUseInStrictMode(node.operand); + } + else if (node.operator === 72 /* DeleteKeyword */ && node.operand.kind === 63 /* Identifier */) { + return grammarErrorOnNode(node.operand, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); + } + } + } + function checkProperty(node) { + return (node.parent.kind === 187 /* ClassDeclaration */ && checkForInvalidQuestionMark(node, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) || checkForInitializerInAmbientContext(node); + } + function checkForInitializerInAmbientContext(node) { + if (inAmbientContext && node.initializer) { + return grammarErrorOnFirstToken(node.initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + } + } + function checkPropertyAssignment(node) { + return checkForInvalidQuestionMark(node, ts.Diagnostics.An_object_member_cannot_be_declared_optional); + } + function checkForInvalidQuestionMark(node, message) { + if (node.flags & 4 /* QuestionMark */) { + var pos = ts.skipTrivia(sourceText, node.name.end); + return grammarErrorAtPos(pos, "?".length, message); + } + } + function checkReturnStatement(node) { + if (!inFunctionBlock) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); + } + } + function checkSetAccessor(node) { + return checkAnyParsedSignature(node) || checkAccessor(node); + } + function checkAccessor(accessor) { + var kind = accessor.kind; + if (languageVersion < 1 /* ES5 */) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); + } + else if (inAmbientContext) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); + } + else if (accessor.body === undefined) { + return grammarErrorAtPos(accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + } + else if (accessor.typeParameters) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); + } + else if (kind === 127 /* GetAccessor */ && accessor.parameters.length) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); + } + else if (kind === 128 /* SetAccessor */) { + if (accessor.type) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); + } + else if (accessor.parameters.length !== 1) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); + } + else { + var parameter = accessor.parameters[0]; + if (parameter.flags & 8 /* Rest */) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter); + } + else if (parameter.flags & 243 /* Modifier */) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); + } + else if (parameter.flags & 4 /* QuestionMark */) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); + } + else if (parameter.initializer) { + return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); + } + } + } + } + function checkSourceFile(node) { + return inAmbientContext && checkTopLevelElementsForRequiredDeclareModifier(file); + } + function checkTopLevelElementsForRequiredDeclareModifier(file) { + for (var i = 0, n = file.statements.length; i < n; i++) { + var decl = file.statements[i]; + if (isDeclaration(decl) || decl.kind === 162 /* VariableStatement */) { + if (checkTopLevelElementForRequiredDeclareModifier(decl)) { + return true; + } + } + } + } + function checkTopLevelElementForRequiredDeclareModifier(node) { + if (node.kind === 188 /* InterfaceDeclaration */ || node.kind === 193 /* ImportDeclaration */ || node.kind === 194 /* ExportAssignment */ || (node.flags & 2 /* Ambient */)) { + return false; + } + return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); + } + function checkShorthandPropertyAssignment(node) { + return checkForInvalidQuestionMark(node, ts.Diagnostics.An_object_member_cannot_be_declared_optional); + } + function checkSwitchStatement(node) { + var firstDefaultClause; + for (var i = 0, n = node.clauses.length; i < n; i++) { + var clause = node.clauses[i]; + if (clause.kind === 176 /* DefaultClause */) { + if (firstDefaultClause === undefined) { + firstDefaultClause = clause; + } + else { + var start = ts.skipTrivia(file.text, clause.pos); + var end = clause.statements.length > 0 ? clause.statements[0].pos : clause.end; + return grammarErrorAtPos(start, end - start, ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); + } + } + } + } + function checkTaggedTemplateExpression(node) { + if (languageVersion < 2 /* ES6 */) { + return grammarErrorOnFirstToken(node.template, ts.Diagnostics.Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + function checkTupleType(node) { + return checkForDisallowedTrailingComma(node.elementTypes) || checkForAtLeastOneType(node); + } + function checkForAtLeastOneType(node) { + if (node.elementTypes.length === 0) { + return grammarErrorOnNode(node, ts.Diagnostics.A_tuple_type_element_list_cannot_be_empty); + } + } + function checkTypeParameter(node) { + if (node.expression) { + return grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); + } + } + function checkTypeReference(node) { + return checkTypeArguments(node.typeArguments); + } + function checkVariableDeclaration(node) { + if (inAmbientContext && node.initializer) { + var equalsPos = node.type ? ts.skipTrivia(sourceText, node.type.end) : ts.skipTrivia(sourceText, node.name.end); + return grammarErrorAtPos(equalsPos, "=".length, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + } + if (!inAmbientContext && !node.initializer && node.flags & 4096 /* Const */) { + return grammarErrorOnNode(node, ts.Diagnostics.const_declarations_must_be_initialized); + } + if (node.flags & 8192 /* ParsedInStrictMode */ && isEvalOrArgumentsIdentifier(node.name)) { + return reportInvalidUseInStrictMode(node.name); + } + } + function checkVariableDeclarations(declarations) { + if (declarations) { + if (checkForDisallowedTrailingComma(declarations)) { + return true; + } + if (!declarations.length) { + return grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); + } + var decl = declarations[0]; + if (languageVersion < 2 /* ES6 */) { + if (decl.flags & 2048 /* Let */) { + return grammarErrorOnFirstToken(decl, ts.Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + else if (decl.flags & 4096 /* Const */) { + return grammarErrorOnFirstToken(decl, ts.Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + } + } + function checkVariableStatement(node) { + return checkVariableDeclarations(node.declarations) || checkForDisallowedLetOrConstStatement(node); + } + function checkForDisallowedLetOrConstStatement(node) { + if (!allowLetAndConstDeclarations(node.parent)) { + if (node.flags & 2048 /* Let */) { + return grammarErrorOnNode(node, ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block); + } + else if (node.flags & 4096 /* Const */) { + return grammarErrorOnNode(node, ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block); + } + } + } + function allowLetAndConstDeclarations(parent) { + switch (parent.kind) { + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 173 /* WithStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + return false; + case 177 /* LabeledStatement */: + return allowLetAndConstDeclarations(parent.parent); + } + return true; + } + function checkWithStatement(node) { + if (node.flags & 8192 /* ParsedInStrictMode */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); + } + } + } function createProgram(rootNames, options, host) { var program; var files = []; @@ -5433,7 +5713,7 @@ var ts; else { files.push(file); } - ts.forEach(file.syntacticErrors, function (e) { + ts.forEach(file.getSyntacticDiagnostics(), function (e) { errors.push(e); }); } @@ -5448,7 +5728,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 190 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 193 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -5466,9 +5746,9 @@ var ts; } } } - else if (node.kind === 188 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { + else if (node.kind === 191 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { forEachChild(node.body, function (node) { - if (node.kind === 190 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 193 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -5541,16 +5821,16 @@ var ts; var ts; (function (ts) { function getModuleInstanceState(node) { - if (node.kind === 185 /* InterfaceDeclaration */) { + if (node.kind === 188 /* InterfaceDeclaration */) { return 0 /* NonInstantiated */; } - else if (node.kind === 187 /* EnumDeclaration */ && ts.isConstEnumDeclaration(node)) { + else if (node.kind === 190 /* EnumDeclaration */ && ts.isConstEnumDeclaration(node)) { return 2 /* ConstEnumOnly */; } - else if (node.kind === 190 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { + else if (node.kind === 193 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { return 0 /* NonInstantiated */; } - else if (node.kind === 189 /* ModuleBlock */) { + else if (node.kind === 192 /* ModuleBlock */) { var state = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { switch (getModuleInstanceState(n)) { @@ -5566,7 +5846,7 @@ var ts; }); return state; } - else if (node.kind === 188 /* ModuleDeclaration */) { + else if (node.kind === 191 /* ModuleDeclaration */) { return getModuleInstanceState(node.body); } else { @@ -5606,20 +5886,26 @@ var ts; } function getDeclarationName(node) { if (node.name) { - if (node.kind === 188 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { + if (node.kind === 191 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { return '"' + node.name.text + '"'; } return node.name.text; } switch (node.kind) { - case 126 /* Constructor */: return "__constructor"; - case 129 /* CallSignature */: return "__call"; - case 130 /* ConstructSignature */: return "__new"; - case 131 /* IndexSignature */: return "__index"; + case 134 /* ConstructorType */: + case 126 /* Constructor */: + return "__constructor"; + case 133 /* FunctionType */: + case 129 /* CallSignature */: + return "__call"; + case 130 /* ConstructSignature */: + return "__new"; + case 131 /* IndexSignature */: + return "__index"; } } function getDisplayName(node) { - return node.name ? ts.identifierToString(node.name) : getDeclarationName(node); + return node.name ? ts.declarationNameToString(node.name) : getDeclarationName(node); } function declareSymbol(symbols, parent, node, includes, excludes) { var name = getDeclarationName(node); @@ -5631,9 +5917,9 @@ var ts; } var message = symbol.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(symbol.declarations, function (declaration) { - file.semanticErrors.push(ts.createDiagnosticForNode(declaration.name, message, getDisplayName(declaration))); + file.semanticDiagnostics.push(ts.createDiagnosticForNode(declaration.name, message, getDisplayName(declaration))); }); - file.semanticErrors.push(ts.createDiagnosticForNode(node.name, message, getDisplayName(node))); + file.semanticDiagnostics.push(ts.createDiagnosticForNode(node.name, message, getDisplayName(node))); symbol = createSymbol(0, name); } } @@ -5642,13 +5928,13 @@ var ts; } addDeclarationToSymbol(symbol, node, includes); symbol.parent = parent; - if (node.kind === 184 /* ClassDeclaration */ && symbol.exports) { + if (node.kind === 187 /* ClassDeclaration */ && symbol.exports) { var prototypeSymbol = createSymbol(4 /* Property */ | 536870912 /* Prototype */, "prototype"); if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { if (node.name) { node.name.parent = node; } - file.semanticErrors.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); + file.semanticDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); } symbol.exports[prototypeSymbol.name] = prototypeSymbol; prototypeSymbol.parent = symbol; @@ -5674,7 +5960,7 @@ var ts; if (symbolKind & 1536 /* Namespace */) { exportKind |= 16777216 /* ExportNamespace */; } - if (node.flags & 1 /* Export */ || (node.kind !== 190 /* ImportDeclaration */ && isAmbientContext(container))) { + if (node.flags & 1 /* Export */ || (node.kind !== 193 /* ImportDeclaration */ && isAmbientContext(container))) { if (exportKind) { var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); @@ -5715,14 +6001,16 @@ var ts; } function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { switch (container.kind) { - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 193 /* SourceFile */: + case 196 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; } + case 133 /* FunctionType */: + case 134 /* ConstructorType */: case 129 /* CallSignature */: case 130 /* ConstructSignature */: case 131 /* IndexSignature */: @@ -5730,22 +6018,22 @@ var ts; case 126 /* Constructor */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 182 /* FunctionDeclaration */: - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); break; - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: if (node.flags & 128 /* Static */) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - case 134 /* TypeLiteral */: - case 140 /* ObjectLiteral */: - case 185 /* InterfaceDeclaration */: + case 136 /* TypeLiteral */: + case 142 /* ObjectLiteral */: + case 188 /* InterfaceDeclaration */: declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); break; - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } @@ -5779,6 +6067,16 @@ var ts; } } } + function bindFunctionOrConstructorType(node) { + var symbolKind = node.kind === 133 /* FunctionType */ ? 131072 /* CallSignature */ : 262144 /* ConstructSignature */; + var symbol = createSymbol(symbolKind, getDeclarationName(node)); + addDeclarationToSymbol(symbol, node, symbolKind); + bindChildren(node, symbolKind, false); + var typeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type"); + addDeclarationToSymbol(typeLiteralSymbol, node, 2048 /* TypeLiteral */); + typeLiteralSymbol.members = {}; + typeLiteralSymbol.members[node.kind === 133 /* FunctionType */ ? "__call" : "__new"] = symbol; + } function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { var symbol = createSymbol(symbolKind, name); addDeclarationToSymbol(symbol, node, symbolKind); @@ -5796,10 +6094,10 @@ var ts; } function bindBlockScopedVariableDeclaration(node) { switch (blockScopeContainer.kind) { - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: declareModuleMember(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); break; - case 193 /* SourceFile */: + case 196 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); break; @@ -5821,7 +6119,7 @@ var ts; case 123 /* Parameter */: bindDeclaration(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */, false); break; - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: if (node.flags & 6144 /* BlockScoped */) { bindBlockScopedVariableDeclaration(node); } @@ -5830,25 +6128,26 @@ var ts; } break; case 124 /* Property */: - case 141 /* PropertyAssignment */: + case 143 /* PropertyAssignment */: + case 144 /* ShorthandPropertyAssignment */: bindDeclaration(node, 4 /* Property */, 107455 /* PropertyExcludes */, false); break; - case 192 /* EnumMember */: + case 195 /* EnumMember */: bindDeclaration(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */, false); break; case 129 /* CallSignature */: bindDeclaration(node, 131072 /* CallSignature */, 0, false); break; - case 125 /* Method */: - bindDeclaration(node, 8192 /* Method */, 99263 /* MethodExcludes */, true); - break; case 130 /* ConstructSignature */: bindDeclaration(node, 262144 /* ConstructSignature */, 0, true); break; + case 125 /* Method */: + bindDeclaration(node, 8192 /* Method */, 99263 /* MethodExcludes */, true); + break; case 131 /* IndexSignature */: bindDeclaration(node, 524288 /* IndexSignature */, 0, false); break; - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: bindDeclaration(node, 16 /* Function */, 106927 /* FunctionExcludes */, true); break; case 126 /* Constructor */: @@ -5860,29 +6159,33 @@ var ts; case 128 /* SetAccessor */: bindDeclaration(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */, true); break; - case 134 /* TypeLiteral */: + case 133 /* FunctionType */: + case 134 /* ConstructorType */: + bindFunctionOrConstructorType(node); + break; + case 136 /* TypeLiteral */: bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type", false); break; - case 140 /* ObjectLiteral */: + case 142 /* ObjectLiteral */: bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object", false); break; - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: bindAnonymousDeclaration(node, 16 /* Function */, "__function", true); break; - case 178 /* CatchBlock */: + case 181 /* CatchBlock */: bindCatchVariableDeclaration(node); break; - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: bindDeclaration(node, 32 /* Class */, 3258879 /* ClassExcludes */, false); break; - case 185 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: bindDeclaration(node, 64 /* Interface */, 3152288 /* InterfaceExcludes */, false); break; - case 186 /* TypeAliasDeclaration */: + case 189 /* TypeAliasDeclaration */: bindDeclaration(node, 2097152 /* TypeAlias */, 3152352 /* TypeAliasExcludes */, false); break; - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: if (ts.isConstEnumDeclaration(node)) { bindDeclaration(node, 128 /* ConstEnum */, 3259263 /* ConstEnumExcludes */, false); } @@ -5890,24 +6193,24 @@ var ts; bindDeclaration(node, 256 /* RegularEnum */, 3258623 /* RegularEnumExcludes */, false); } break; - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: bindModuleDeclaration(node); break; - case 190 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: bindDeclaration(node, 33554432 /* Import */, 33554432 /* ImportExcludes */, false); break; - case 193 /* SourceFile */: + case 196 /* SourceFile */: if (ts.isExternalModule(node)) { bindAnonymousDeclaration(node, 512 /* ValueModule */, '"' + ts.removeFileExtension(node.filename) + '"', true); break; } - case 158 /* Block */: - case 177 /* TryBlock */: - case 178 /* CatchBlock */: - case 179 /* FinallyBlock */: - case 165 /* ForStatement */: - case 166 /* ForInStatement */: - case 171 /* SwitchStatement */: + case 161 /* Block */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 174 /* SwitchStatement */: bindChildren(node, 0, true); break; default: @@ -6024,7 +6327,7 @@ var ts; function writeLiteral(s) { if (s && s.length) { write(s); - var lineStartsOfS = ts.getLineStarts(s); + var lineStartsOfS = ts.computeLineStarts(s); if (lineStartsOfS.length > 1) { lineCount = lineCount + lineStartsOfS.length - 1; linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; @@ -6310,7 +6613,7 @@ var ts; if (scopeName) { recordScopeNameStart(scopeName); } - else if (node.kind === 182 /* FunctionDeclaration */ || node.kind === 149 /* FunctionExpression */ || node.kind === 125 /* Method */ || node.kind === 127 /* GetAccessor */ || node.kind === 128 /* SetAccessor */ || node.kind === 188 /* ModuleDeclaration */ || node.kind === 184 /* ClassDeclaration */ || node.kind === 187 /* EnumDeclaration */) { + else if (node.kind === 185 /* FunctionDeclaration */ || node.kind === 152 /* FunctionExpression */ || node.kind === 125 /* Method */ || node.kind === 127 /* GetAccessor */ || node.kind === 128 /* SetAccessor */ || node.kind === 191 /* ModuleDeclaration */ || node.kind === 187 /* ClassDeclaration */ || node.kind === 190 /* EnumDeclaration */) { if (node.name) { scopeName = node.name.text; } @@ -6392,7 +6695,7 @@ var ts; } function emitNodeWithMap(node) { if (node) { - if (node.kind != 193 /* SourceFile */) { + if (node.kind != 196 /* SourceFile */) { recordEmitNodeStartSpan(node); emitNode(node); recordEmitNodeEndSpan(node); @@ -6501,14 +6804,14 @@ var ts; ts.forEachChild(node, emit); return; } - ts.Debug.assert(node.parent.kind !== 146 /* TaggedTemplateExpression */); - var templateNeedsParens = ts.isExpression(node.parent) && node.parent.kind !== 148 /* ParenExpression */ && comparePrecedenceToBinaryPlus(node.parent) !== -1 /* LessThan */; - if (templateNeedsParens) { + ts.Debug.assert(node.parent.kind !== 149 /* TaggedTemplateExpression */); + var emitOuterParens = ts.isExpression(node.parent) && templateNeedsParens(node, node.parent); + if (emitOuterParens) { write("("); } emitLiteral(node.head); ts.forEach(node.templateSpans, function (templateSpan) { - var needsParens = templateSpan.expression.kind !== 148 /* ParenExpression */ && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1 /* GreaterThan */; + var needsParens = templateSpan.expression.kind !== 151 /* ParenExpression */ && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1 /* GreaterThan */; write(" + "); if (needsParens) { write("("); @@ -6522,13 +6825,26 @@ var ts; emitLiteral(templateSpan.literal); } }); - if (templateNeedsParens) { + if (emitOuterParens) { write(")"); } + function templateNeedsParens(template, parent) { + switch (parent.kind) { + case 147 /* CallExpression */: + case 148 /* NewExpression */: + return parent.func === template; + case 151 /* ParenExpression */: + return false; + case 149 /* TaggedTemplateExpression */: + ts.Debug.fail("Path should be unreachable; tagged templates not supported pre-ES6."); + default: + return comparePrecedenceToBinaryPlus(parent) !== -1 /* LessThan */; + } + } function comparePrecedenceToBinaryPlus(expression) { ts.Debug.assert(compilerOptions.target <= 1 /* ES5 */); switch (expression.kind) { - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: switch (expression.operator) { case 34 /* AsteriskToken */: case 35 /* SlashToken */: @@ -6539,7 +6855,7 @@ var ts; default: return -1 /* LessThan */; } - case 154 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return -1 /* LessThan */; default: return 1 /* GreaterThan */; @@ -6550,7 +6866,7 @@ var ts; emit(span.expression); emit(span.literal); } - function emitQuotedIdentifier(node) { + function emitExpressionForPropertyName(node) { if (node.kind === 7 /* StringLiteral */) { emitLiteral(node); } @@ -6565,45 +6881,52 @@ var ts; write("\""); } } - function isNonExpressionIdentifier(node) { + function isNotExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { case 123 /* Parameter */: - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: case 124 /* Property */: - case 141 /* PropertyAssignment */: - case 192 /* EnumMember */: + case 143 /* PropertyAssignment */: + case 144 /* ShorthandPropertyAssignment */: + case 195 /* EnumMember */: case 125 /* Method */: - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 149 /* FunctionExpression */: - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: - case 187 /* EnumDeclaration */: - case 188 /* ModuleDeclaration */: - case 190 /* ImportDeclaration */: + case 152 /* FunctionExpression */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: + case 191 /* ModuleDeclaration */: + case 193 /* ImportDeclaration */: return parent.name === node; - case 168 /* BreakStatement */: - case 167 /* ContinueStatement */: - case 191 /* ExportAssignment */: + case 171 /* BreakStatement */: + case 170 /* ContinueStatement */: + case 194 /* ExportAssignment */: return false; - case 174 /* LabeledStatement */: + case 177 /* LabeledStatement */: return node.parent.label === node; - case 178 /* CatchBlock */: + case 181 /* CatchBlock */: return node.parent.variable === node; } } - function emitIdentifier(node) { - if (!isNonExpressionIdentifier(node)) { - var prefix = resolver.getExpressionNamePrefix(node); - if (prefix) { - write(prefix); - write("."); - } + function emitExpressionIdentifier(node) { + var prefix = resolver.getExpressionNamePrefix(node); + if (prefix) { + write(prefix); + write("."); } write(getSourceTextOfLocalNode(node)); } + function emitIdentifier(node) { + if (!isNotExpressionIdentifier(node)) { + emitExpressionIdentifier(node); + } + else { + write(getSourceTextOfLocalNode(node)); + } + } function emitThis(node) { if (resolver.getNodeCheckFlags(node) & 2 /* LexicalThis */) { write("_this"); @@ -6664,10 +6987,33 @@ var ts; emit(node.initializer); emitTrailingComments(node); } + function emitShortHandPropertyAssignment(node) { + function emitAsNormalPropertyAssignment() { + emitLeadingComments(node); + emit(node.name); + write(": "); + emitExpressionIdentifier(node.name); + emitTrailingComments(node); + } + if (compilerOptions.target < 2 /* ES6 */) { + emitAsNormalPropertyAssignment(); + } + else if (compilerOptions.target >= 2 /* ES6 */) { + var prefix = resolver.getExpressionNamePrefix(node.name); + if (prefix) { + emitAsNormalPropertyAssignment(); + } + else { + emitLeadingComments(node); + emit(node.name); + emitTrailingComments(node); + } + } + } function tryEmitConstantValue(node) { var constantValue = resolver.getConstantValue(node); if (constantValue !== undefined) { - var propertyName = node.kind === 142 /* PropertyAccess */ ? ts.identifierToString(node.right) : ts.getTextOfNode(node.index); + var propertyName = node.kind === 145 /* PropertyAccess */ ? ts.declarationNameToString(node.right) : ts.getTextOfNode(node.index); write(constantValue.toString() + " /* " + propertyName + " */"); return true; } @@ -6698,7 +7044,7 @@ var ts; } else { emit(node.func); - superCall = node.func.kind === 142 /* PropertyAccess */ && node.func.left.kind === 89 /* SuperKeyword */; + superCall = node.func.kind === 145 /* PropertyAccess */ && node.func.left.kind === 89 /* SuperKeyword */; } if (superCall) { write(".call("); @@ -6731,12 +7077,12 @@ var ts; emit(node.template); } function emitParenExpression(node) { - if (node.expression.kind === 147 /* TypeAssertion */) { + if (node.expression.kind === 150 /* TypeAssertion */) { var operand = node.expression.operand; - while (operand.kind == 147 /* TypeAssertion */) { + while (operand.kind == 150 /* TypeAssertion */) { operand = operand.operand; } - if (operand.kind !== 151 /* PrefixOperator */ && operand.kind !== 152 /* PostfixOperator */ && operand.kind !== 145 /* NewExpression */ && !(operand.kind === 144 /* CallExpression */ && node.parent.kind === 145 /* NewExpression */) && !(operand.kind === 149 /* FunctionExpression */ && node.parent.kind === 144 /* CallExpression */)) { + if (operand.kind !== 154 /* PrefixOperator */ && operand.kind !== 155 /* PostfixOperator */ && operand.kind !== 148 /* NewExpression */ && !(operand.kind === 147 /* CallExpression */ && node.parent.kind === 148 /* NewExpression */) && !(operand.kind === 152 /* FunctionExpression */ && node.parent.kind === 147 /* CallExpression */)) { emit(operand); return; } @@ -6746,13 +7092,13 @@ var ts; write(")"); } function emitUnaryExpression(node) { - if (node.kind === 151 /* PrefixOperator */) { + if (node.kind === 154 /* PrefixOperator */) { write(ts.tokenToString(node.operator)); } if (node.operator >= 63 /* Identifier */) { write(" "); } - else if (node.kind === 151 /* PrefixOperator */ && node.operand.kind === 151 /* PrefixOperator */) { + else if (node.kind === 154 /* PrefixOperator */ && node.operand.kind === 154 /* PrefixOperator */) { var operand = node.operand; if (node.operator === 32 /* PlusToken */ && (operand.operator === 32 /* PlusToken */ || operand.operator === 37 /* PlusPlusToken */)) { write(" "); @@ -6762,7 +7108,7 @@ var ts; } } emit(node.operand); - if (node.kind === 152 /* PostfixOperator */) { + if (node.kind === 155 /* PostfixOperator */) { write(ts.tokenToString(node.operator)); } } @@ -6785,8 +7131,8 @@ var ts; emitToken(13 /* OpenBraceToken */, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 189 /* ModuleBlock */) { - ts.Debug.assert(node.parent.kind === 188 /* ModuleDeclaration */); + if (node.kind === 192 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 191 /* ModuleDeclaration */); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); @@ -6796,7 +7142,7 @@ var ts; scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 158 /* Block */) { + if (node.kind === 161 /* Block */) { write(" "); emit(node); } @@ -6808,7 +7154,7 @@ var ts; } } function emitExpressionStatement(node) { - var isArrowExpression = node.expression.kind === 150 /* ArrowFunction */; + var isArrowExpression = node.expression.kind === 153 /* ArrowFunction */; emitLeadingComments(node); if (isArrowExpression) write("("); @@ -6829,7 +7175,7 @@ var ts; if (node.elseStatement) { writeLine(); emitToken(74 /* ElseKeyword */, node.thenStatement.end); - if (node.elseStatement.kind === 162 /* IfStatement */) { + if (node.elseStatement.kind === 165 /* IfStatement */) { write(" "); emit(node.elseStatement); } @@ -6842,7 +7188,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 158 /* Block */) { + if (node.statement.kind === 161 /* Block */) { write(" "); } else { @@ -6889,15 +7235,18 @@ var ts; var endPos = emitToken(80 /* ForKeyword */, node.pos); write(" "); endPos = emitToken(15 /* OpenParenToken */, endPos); - if (node.declaration) { - if (node.declaration.flags & 2048 /* Let */) { - emitToken(102 /* LetKeyword */, endPos); + if (node.declarations) { + if (node.declarations.length >= 1) { + var decl = node.declarations[0]; + if (decl.flags & 2048 /* Let */) { + emitToken(102 /* LetKeyword */, endPos); + } + else { + emitToken(96 /* VarKeyword */, endPos); + } + write(" "); + emit(decl); } - else { - emitToken(96 /* VarKeyword */, endPos); - } - write(" "); - emit(node.declaration); } else { emit(node.variable); @@ -6908,7 +7257,7 @@ var ts; emitEmbeddedStatement(node.statement); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 168 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */, node.pos); + emitToken(node.kind === 171 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */, node.pos); emitOptional(" ", node.label); write(";"); } @@ -6943,7 +7292,7 @@ var ts; return getLineOfLocalPosition(ts.skipTrivia(currentSourceFile.text, node1.pos)) === getLineOfLocalPosition(ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 172 /* CaseClause */) { + if (node.kind === 175 /* CaseClause */) { write("case "); emit(node.expression); write(":"); @@ -6998,7 +7347,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 188 /* ModuleDeclaration */); + } while (node && node.kind !== 191 /* ModuleDeclaration */); return node; } function emitModuleMemberName(node) { @@ -7110,7 +7459,7 @@ var ts; emitLeadingComments(node); } write("function "); - if (node.kind === 182 /* FunctionDeclaration */ || (node.kind === 149 /* FunctionExpression */ && node.name)) { + if (node.kind === 185 /* FunctionDeclaration */ || (node.kind === 152 /* FunctionExpression */ && node.name)) { emit(node.name); } emitSignatureAndBody(node); @@ -7140,16 +7489,16 @@ var ts; write(" {"); scopeEmitStart(node); increaseIndent(); - emitDetachedComments(node.body.kind === 183 /* FunctionBlock */ ? node.body.statements : node.body); + emitDetachedComments(node.body.kind === 186 /* FunctionBlock */ ? node.body.statements : node.body); var startIndex = 0; - if (node.body.kind === 183 /* FunctionBlock */) { + if (node.body.kind === 186 /* FunctionBlock */) { startIndex = emitDirectivePrologues(node.body.statements, true); } var outPos = writer.getTextPos(); emitCaptureThisForNodeIfNecessary(node); emitDefaultValueAssignments(node); emitRestParameter(node); - if (node.body.kind !== 183 /* FunctionBlock */ && outPos === writer.getTextPos()) { + if (node.body.kind !== 186 /* FunctionBlock */ && outPos === writer.getTextPos()) { decreaseIndent(); write(" "); emitStart(node.body); @@ -7162,7 +7511,7 @@ var ts; emitEnd(node.body); } else { - if (node.body.kind === 183 /* FunctionBlock */) { + if (node.body.kind === 186 /* FunctionBlock */) { emitLinesStartingAt(node.body.statements, startIndex); } else { @@ -7174,7 +7523,7 @@ var ts; emitTrailingComments(node.body); } writeLine(); - if (node.body.kind === 183 /* FunctionBlock */) { + if (node.body.kind === 186 /* FunctionBlock */) { emitLeadingCommentsOfPosition(node.body.statements.end); decreaseIndent(); emitToken(14 /* CloseBraceToken */, node.body.statements.end); @@ -7200,9 +7549,9 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 161 /* ExpressionStatement */) { + if (statement && statement.kind === 164 /* ExpressionStatement */) { var expr = statement.expression; - if (expr && expr.kind === 144 /* CallExpression */) { + if (expr && expr.kind === 147 /* CallExpression */) { var func = expr.func; if (func && func.kind === 89 /* SuperKeyword */) { return statement; @@ -7297,7 +7646,7 @@ var ts; write(".prototype"); } write(", "); - emitQuotedIdentifier(member.name); + emitExpressionForPropertyName(member.name); emitEnd(member.name); write(", {"); increaseIndent(); @@ -7503,7 +7852,7 @@ var ts; write("["); write(resolver.getLocalNameOfContainer(node)); write("["); - emitQuotedIdentifier(member.name); + emitExpressionForPropertyName(member.name); write("] = "); if (member.initializer && !isConstEnum) { emit(member.initializer); @@ -7512,7 +7861,7 @@ var ts; write(resolver.getEnumMemberValue(member).toString()); } write("] = "); - emitQuotedIdentifier(member.name); + emitExpressionForPropertyName(member.name); emitEnd(member); write(";"); emitTrailingComments(member); @@ -7520,7 +7869,7 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 188 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 191 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -7542,7 +7891,7 @@ var ts; write(resolver.getLocalNameOfContainer(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 189 /* ModuleBlock */) { + if (node.body.kind === 192 /* ModuleBlock */) { emit(node.body); } else { @@ -7576,7 +7925,7 @@ var ts; emitImportDeclaration = !ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportWithEntityName(node); } if (emitImportDeclaration) { - if (node.externalModuleName && node.parent.kind === 193 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { + if (node.externalModuleName && node.parent.kind === 196 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { if (node.flags & 1 /* Export */) { writeLine(); emitLeadingComments(node); @@ -7616,7 +7965,7 @@ var ts; function getExternalImportDeclarations(node) { var result = []; ts.forEach(node.statements, function (stat) { - if (stat.kind === 190 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { + if (stat.kind === 193 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { result.push(stat); } }); @@ -7624,7 +7973,7 @@ var ts; } function getFirstExportAssignment(sourceFile) { return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 191 /* ExportAssignment */) { + if (node.kind === 194 /* ExportAssignment */) { return node; } }); @@ -7632,7 +7981,11 @@ var ts; function emitAMDModule(node, startIndex) { var imports = getExternalImportDeclarations(node); writeLine(); - write("define([\"require\", \"exports\""); + write("define("); + if (node.amdModuleName) { + write("\"" + node.amdModuleName + "\", "); + } + write("[\"require\", \"exports\""); ts.forEach(imports, function (imp) { write(", "); emitLiteral(imp.externalModuleName); @@ -7765,102 +8118,104 @@ var ts; case 11 /* TemplateMiddle */: case 12 /* TemplateTail */: return emitLiteral(node); - case 155 /* TemplateExpression */: + case 158 /* TemplateExpression */: return emitTemplateExpression(node); - case 156 /* TemplateSpan */: + case 159 /* TemplateSpan */: return emitTemplateSpan(node); case 121 /* QualifiedName */: return emitPropertyAccess(node); - case 139 /* ArrayLiteral */: + case 141 /* ArrayLiteral */: return emitArrayLiteral(node); - case 140 /* ObjectLiteral */: + case 142 /* ObjectLiteral */: return emitObjectLiteral(node); - case 141 /* PropertyAssignment */: + case 143 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 142 /* PropertyAccess */: + case 144 /* ShorthandPropertyAssignment */: + return emitShortHandPropertyAssignment(node); + case 145 /* PropertyAccess */: return emitPropertyAccess(node); - case 143 /* IndexedAccess */: + case 146 /* IndexedAccess */: return emitIndexedAccess(node); - case 144 /* CallExpression */: + case 147 /* CallExpression */: return emitCallExpression(node); - case 145 /* NewExpression */: + case 148 /* NewExpression */: return emitNewExpression(node); - case 146 /* TaggedTemplateExpression */: + case 149 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 147 /* TypeAssertion */: + case 150 /* TypeAssertion */: return emit(node.operand); - case 148 /* ParenExpression */: + case 151 /* ParenExpression */: return emitParenExpression(node); - case 182 /* FunctionDeclaration */: - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: return emitFunctionDeclaration(node); - case 151 /* PrefixOperator */: - case 152 /* PostfixOperator */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: return emitUnaryExpression(node); - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: return emitBinaryExpression(node); - case 154 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return emitConditionalExpression(node); - case 157 /* OmittedExpression */: + case 160 /* OmittedExpression */: return; - case 158 /* Block */: - case 177 /* TryBlock */: - case 179 /* FinallyBlock */: - case 183 /* FunctionBlock */: - case 189 /* ModuleBlock */: + case 161 /* Block */: + case 180 /* TryBlock */: + case 182 /* FinallyBlock */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: return emitBlock(node); - case 159 /* VariableStatement */: + case 162 /* VariableStatement */: return emitVariableStatement(node); - case 160 /* EmptyStatement */: + case 163 /* EmptyStatement */: return write(";"); - case 161 /* ExpressionStatement */: + case 164 /* ExpressionStatement */: return emitExpressionStatement(node); - case 162 /* IfStatement */: + case 165 /* IfStatement */: return emitIfStatement(node); - case 163 /* DoStatement */: + case 166 /* DoStatement */: return emitDoStatement(node); - case 164 /* WhileStatement */: + case 167 /* WhileStatement */: return emitWhileStatement(node); - case 165 /* ForStatement */: + case 168 /* ForStatement */: return emitForStatement(node); - case 166 /* ForInStatement */: + case 169 /* ForInStatement */: return emitForInStatement(node); - case 167 /* ContinueStatement */: - case 168 /* BreakStatement */: + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: return emitBreakOrContinueStatement(node); - case 169 /* ReturnStatement */: + case 172 /* ReturnStatement */: return emitReturnStatement(node); - case 170 /* WithStatement */: + case 173 /* WithStatement */: return emitWithStatement(node); - case 171 /* SwitchStatement */: + case 174 /* SwitchStatement */: return emitSwitchStatement(node); - case 172 /* CaseClause */: - case 173 /* DefaultClause */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: return emitCaseOrDefaultClause(node); - case 174 /* LabeledStatement */: + case 177 /* LabeledStatement */: return emitLabelledStatement(node); - case 175 /* ThrowStatement */: + case 178 /* ThrowStatement */: return emitThrowStatement(node); - case 176 /* TryStatement */: + case 179 /* TryStatement */: return emitTryStatement(node); - case 178 /* CatchBlock */: + case 181 /* CatchBlock */: return emitCatchBlock(node); - case 180 /* DebuggerStatement */: + case 183 /* DebuggerStatement */: return emitDebuggerStatement(node); - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: return emitClassDeclaration(node); - case 185 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 190 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: return emitImportDeclaration(node); - case 193 /* SourceFile */: + case 196 /* SourceFile */: return emitSourceFile(node); } } @@ -7878,7 +8233,7 @@ var ts; return leadingComments; } function getLeadingCommentsToEmit(node) { - if (node.parent.kind === 193 /* SourceFile */ || node.pos !== node.parent.pos) { + if (node.parent.kind === 196 /* SourceFile */ || node.pos !== node.parent.pos) { var leadingComments; if (hasDetachedComments(node.pos)) { leadingComments = getLeadingCommentsWithoutDetachedComments(); @@ -7895,7 +8250,7 @@ var ts; emitComments(leadingComments, true, writer, writeComment); } function emitTrailingDeclarationComments(node) { - if (node.parent.kind === 193 /* SourceFile */ || node.end !== node.parent.end) { + if (node.parent.kind === 196 /* SourceFile */ || node.end !== node.parent.end) { var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); emitComments(trailingComments, false, writer, writeComment); } @@ -8087,7 +8442,7 @@ var ts; if (node.flags & 1 /* Export */) { write("export "); } - if (node.kind !== 185 /* InterfaceDeclaration */) { + if (node.kind !== 188 /* InterfaceDeclaration */) { write("declare "); } } @@ -8143,7 +8498,7 @@ var ts; emitDeclarationFlags(node); write("module "); emitSourceTextOfNode(node.name); - while (node.body.kind !== 189 /* ModuleBlock */) { + while (node.body.kind !== 192 /* ModuleBlock */) { node = node.body; write("."); emitSourceTextOfNode(node.name); @@ -8215,10 +8570,10 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 185 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; case 130 /* ConstructSignature */: @@ -8231,14 +8586,14 @@ var ts; if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : 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 === 184 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 187 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -8276,7 +8631,7 @@ var ts; resolver.writeTypeAtLocation(node, enclosingDeclaration, 1 /* WriteArrayAsGenericType */ | 2 /* UseTypeOfFunction */, writer); function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.kind === 184 /* ClassDeclaration */) { + if (node.parent.kind === 187 /* ClassDeclaration */) { if (symbolAccesibilityResult.errorModuleName) { diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2; } @@ -8361,7 +8716,7 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 181 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { + if (node.kind !== 184 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { emitSourceTextOfNode(node.name); if (node.kind === 124 /* Property */ && (node.flags & 4 /* QuestionMark */)) { write("?"); @@ -8374,14 +8729,14 @@ var ts; } function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.kind === 181 /* VariableDeclaration */) { + if (node.kind === 184 /* VariableDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? 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 === 124 /* Property */) { if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 === 184 /* ClassDeclaration */) { + else if (node.parent.kind === 187 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; } else { @@ -8460,10 +8815,10 @@ var ts; } } function emitFunctionDeclaration(node) { - if ((node.kind !== 182 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { + if ((node.kind !== 185 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); emitDeclarationFlags(node); - if (node.kind === 182 /* FunctionDeclaration */) { + if (node.kind === 185 /* FunctionDeclaration */) { write("function "); emitSourceTextOfNode(node.name); } @@ -8525,14 +8880,14 @@ var ts; if (node.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : 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 === 184 /* ClassDeclaration */) { + else if (node.parent.kind === 187 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; break; default: @@ -8576,14 +8931,14 @@ var ts; if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : 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 === 184 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 187 /* ClassDeclaration */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? 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; } break; - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; break; default: @@ -8599,7 +8954,7 @@ var ts; function emitNode(node) { switch (node.kind) { case 126 /* Constructor */: - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: case 125 /* Method */: return emitFunctionDeclaration(node); case 130 /* ConstructSignature */: @@ -8610,27 +8965,27 @@ var ts; case 127 /* GetAccessor */: case 128 /* SetAccessor */: return emitAccessorDeclaration(node); - case 159 /* VariableStatement */: + case 162 /* VariableStatement */: return emitVariableStatement(node); case 124 /* Property */: return emitPropertyDeclaration(node); - case 185 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: return emitClassDeclaration(node); - case 186 /* TypeAliasDeclaration */: + case 189 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 192 /* EnumMember */: + case 195 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 190 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: return emitImportDeclaration(node); - case 191 /* ExportAssignment */: + case 194 /* ExportAssignment */: return emitExportAssignment(node); - case 193 /* SourceFile */: + case 196 /* SourceFile */: return emitSourceFile(node); } } @@ -8692,9 +9047,9 @@ var ts; } } var hasSemanticErrors = resolver.hasSemanticErrors(); - var hasEarlyErrors = resolver.hasEarlyErrors(targetSourceFile); + var isEmitBlocked = resolver.isEmitBlocked(targetSourceFile); function emitFile(jsFilePath, sourceFile) { - if (!hasEarlyErrors) { + if (!isEmitBlocked) { emitJavaScript(jsFilePath, sourceFile); if (!hasSemanticErrors && compilerOptions.declaration) { emitDeclarations(jsFilePath, sourceFile); @@ -8724,25 +9079,25 @@ var ts; diagnostics.sort(ts.compareDiagnostics); diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); var hasEmitterError = ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1 /* Error */; }); - var returnCode; - if (hasEarlyErrors) { - returnCode = 1 /* AllOutputGenerationSkipped */; + var emitResultStatus; + if (isEmitBlocked) { + emitResultStatus = 1 /* AllOutputGenerationSkipped */; } else if (hasEmitterError) { - returnCode = 4 /* EmitErrorsEncountered */; + emitResultStatus = 4 /* EmitErrorsEncountered */; } else if (hasSemanticErrors && compilerOptions.declaration) { - returnCode = 3 /* DeclarationGenerationSkipped */; + emitResultStatus = 3 /* DeclarationGenerationSkipped */; } else if (hasSemanticErrors && !compilerOptions.declaration) { - returnCode = 2 /* JSGeneratedWithSemanticErrors */; + emitResultStatus = 2 /* JSGeneratedWithSemanticErrors */; } else { - returnCode = 0 /* Succeeded */; + emitResultStatus = 0 /* Succeeded */; } return { - emitResultStatus: returnCode, - errors: diagnostics, + emitResultStatus: emitResultStatus, + diagnostics: diagnostics, sourceMaps: sourceMapDataList }; } @@ -8801,16 +9156,18 @@ var ts; var compilerOptions = program.getCompilerOptions(); var checker = { getProgram: function () { return program; }, - getDiagnostics: getDiagnostics, - getGlobalDiagnostics: getGlobalDiagnostics, getNodeCount: function () { return ts.sum(program.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(program.getSourceFiles(), "identifierCount"); }, getSymbolCount: function () { return ts.sum(program.getSourceFiles(), "symbolCount"); }, getTypeCount: function () { return typeCount; }, + isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, + isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + getDiagnostics: getDiagnostics, + getGlobalDiagnostics: getGlobalDiagnostics, checkProgram: checkProgram, - emitFiles: invokeEmitter, + invokeEmitter: invokeEmitter, getParentOfSymbol: getParentOfSymbol, - getTypeOfSymbol: getTypeOfSymbol, + getNarrowedTypeOfSymbol: getNarrowedTypeOfSymbol, getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, getPropertiesOfType: getPropertiesOfType, getPropertyOfType: getPropertyOfType, @@ -8819,6 +9176,7 @@ var ts; getReturnTypeOfSignature: getReturnTypeOfSignature, getSymbolsInScope: getSymbolsInScope, getSymbolInfo: getSymbolInfo, + getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol, getTypeOfNode: getTypeOfNode, typeToString: typeToString, getSymbolDisplayBuilder: getSymbolDisplayBuilder, @@ -8833,9 +9191,8 @@ var ts; getSignatureFromDeclaration: getSignatureFromDeclaration, isImplementationOfOverload: isImplementationOfOverload, getAliasedSymbol: resolveImport, - isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, - isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, - hasEarlyErrors: hasEarlyErrors + hasEarlyErrors: hasEarlyErrors, + isEmitBlocked: isEmitBlocked }; var undefinedSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "undefined"); var argumentsSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "arguments"); @@ -8865,6 +9222,7 @@ var ts; var globalNumberType; var globalBooleanType; var globalRegExpType; + var globalTemplateStringsArrayType; var tupleTypes = {}; var unionTypes = {}; var stringLiteralTypes = {}; @@ -9013,10 +9371,10 @@ var ts; return nodeLinks[node.id] || (nodeLinks[node.id] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 193 /* SourceFile */); + return ts.getAncestor(node, 196 /* SourceFile */); } function isGlobalSourceFile(node) { - return node.kind === 193 /* SourceFile */ && !ts.isExternalModule(node); + return node.kind === 196 /* SourceFile */ && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { @@ -9057,21 +9415,21 @@ var ts; } } switch (location.kind) { - case 193 /* SourceFile */: + case 196 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 35653619 /* ModuleMember */)) { break loop; } break; - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; case 124 /* Property */: - if (location.parent.kind === 184 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { + if (location.parent.kind === 187 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (getSymbol(ctor.locals, name, meaning & 107455 /* Value */)) { @@ -9080,8 +9438,8 @@ var ts; } } break; - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 3152352 /* Type */)) { if (lastLocation && lastLocation.flags & 128 /* Static */) { error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); @@ -9094,14 +9452,14 @@ var ts; case 126 /* Constructor */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 182 /* FunctionDeclaration */: - case 150 /* ArrowFunction */: + case 185 /* FunctionDeclaration */: + case 153 /* ArrowFunction */: if (name === "arguments") { result = argumentsSymbol; break loop; } break; - case 149 /* FunctionExpression */: + case 152 /* FunctionExpression */: if (name === "arguments") { result = argumentsSymbol; break loop; @@ -9112,7 +9470,7 @@ var ts; break loop; } break; - case 178 /* CatchBlock */: + case 181 /* CatchBlock */: var id = location.variable; if (name === id.text) { result = location.symbol; @@ -9128,21 +9486,21 @@ var ts; } if (!result) { if (nameNotFoundMessage) { - error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.identifierToString(nameArg)); + error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); } return undefined; } if (nameNotFoundMessage) { if (propertyWithInvalidInitializer) { var propertyName = propertyWithInvalidInitializer.name; - error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.identifierToString(propertyName), typeof nameArg === "string" ? nameArg : ts.identifierToString(nameArg)); + error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); return undefined; } if (result.flags & 2 /* BlockScopedVariable */) { var declaration = ts.forEach(result.declarations, function (d) { return d.flags & 6144 /* BlockScoped */ ? d : undefined; }); ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); if (!isDefinedBefore(declaration, errorLocation)) { - error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.identifierToString(declaration.name)); + error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); } } } @@ -9153,7 +9511,7 @@ var ts; var links = getSymbolLinks(symbol); if (!links.target) { links.target = resolvingSymbol; - var node = getDeclarationOfKind(symbol, 190 /* ImportDeclaration */); + var node = getDeclarationOfKind(symbol, 193 /* ImportDeclaration */); var target = node.externalModuleName ? resolveExternalModuleName(node, node.externalModuleName) : getSymbolOfPartOfRightHandSideOfImport(node.entityName, node); if (links.target === resolvingSymbol) { links.target = target || unknownSymbol; @@ -9169,7 +9527,7 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImport(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 190 /* ImportDeclaration */); + importDeclaration = ts.getAncestor(entityName, 193 /* ImportDeclaration */); ts.Debug.assert(importDeclaration !== undefined); } if (entityName.kind === 63 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { @@ -9179,7 +9537,7 @@ var ts; return resolveEntityName(importDeclaration, entityName, 1536 /* Namespace */); } else { - ts.Debug.assert(entityName.parent.kind === 190 /* ImportDeclaration */); + ts.Debug.assert(entityName.parent.kind === 193 /* ImportDeclaration */); return resolveEntityName(importDeclaration, entityName, 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */); } } @@ -9199,7 +9557,7 @@ var ts; return; var symbol = getSymbol(namespace.exports, name.right.text, meaning); if (!symbol) { - error(location, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.identifierToString(name.right)); + error(location, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(name.right)); return; } } @@ -9284,9 +9642,9 @@ var ts; var seenExportedMember = false; var result = []; ts.forEach(symbol.declarations, function (declaration) { - var block = (declaration.kind === 193 /* SourceFile */ ? declaration : declaration.body); + var block = (declaration.kind === 196 /* SourceFile */ ? declaration : declaration.body); ts.forEach(block.statements, function (node) { - if (node.kind === 191 /* ExportAssignment */) { + if (node.kind === 194 /* ExportAssignment */) { result.push(node); } else { @@ -9393,17 +9751,17 @@ var ts; } } switch (location.kind) { - case 193 /* SourceFile */: + case 196 /* SourceFile */: if (!ts.isExternalModule(location)) { break; } - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location).exports)) { return result; } break; - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: if (result = callback(getSymbolOfNode(location).members)) { return result; } @@ -9434,7 +9792,7 @@ var ts; } return ts.forEachValue(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 33554432 /* Import */) { - if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 190 /* ImportDeclaration */ && declaration.externalModuleName; })) { + if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 193 /* ImportDeclaration */ && declaration.externalModuleName; })) { var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable); if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) { return [symbolFromSymbolTable]; @@ -9516,7 +9874,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 188 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 193 /* SourceFile */ && ts.isExternalModule(declaration)); + return (declaration.kind === 191 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 196 /* SourceFile */ && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -9526,7 +9884,7 @@ var ts; return { aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 190 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { + if (declaration.kind === 193 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { if (!ts.contains(aliasesToMakeVisible, declaration)) { @@ -9547,7 +9905,7 @@ var ts; var firstIdentifier = getFirstIdentifier(entityName); var symbolOfNameSpace = resolveName(entityName.parent, firstIdentifier.text, 1536 /* Namespace */, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); var hasNamespaceDeclarationsVisibile = hasVisibleDeclarations(symbolOfNameSpace); - return hasNamespaceDeclarationsVisibile ? { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : { accessibility: 1 /* NotAccessible */, errorSymbolName: ts.identifierToString(firstIdentifier) }; + return hasNamespaceDeclarationsVisibile ? { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : { accessibility: 1 /* NotAccessible */, errorSymbolName: ts.declarationNameToString(firstIdentifier) }; } function releaseStringWriter(writer) { writer.clear(); @@ -9586,10 +9944,10 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { var node = type.symbol.declarations[0].parent; - while (node.kind === 138 /* ParenType */) { + while (node.kind === 140 /* ParenType */) { node = node.parent; } - if (node.kind === 186 /* TypeAliasDeclaration */) { + if (node.kind === 189 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -9601,7 +9959,7 @@ var ts; if (symbol.declarations && symbol.declarations.length > 0) { var declaration = symbol.declarations[0]; if (declaration.name) { - writer.writeSymbol(ts.identifierToString(declaration.name), symbol); + writer.writeSymbol(ts.declarationNameToString(declaration.name), symbol); return; } } @@ -9752,7 +10110,7 @@ var ts; function shouldWriteTypeOfFunctionSymbol() { if (type.symbol) { var isStaticMethodSymbol = !!(type.symbol.flags & 8192 /* Method */ && ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128 /* Static */; })); - var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 193 /* SourceFile */ || declaration.parent.kind === 189 /* ModuleBlock */; })); + var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 196 /* SourceFile */ || declaration.parent.kind === 192 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2 /* UseTypeOfFunction */) || (typeStack && ts.contains(typeStack, type)); } @@ -9971,12 +10329,12 @@ var ts; function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 188 /* ModuleDeclaration */) { + if (node.kind === 191 /* ModuleDeclaration */) { if (node.name.kind === 7 /* StringLiteral */) { return node; } } - else if (node.kind === 193 /* SourceFile */) { + else if (node.kind === 196 /* SourceFile */) { return ts.isExternalModule(node) ? node : undefined; } } @@ -10018,16 +10376,16 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 181 /* VariableDeclaration */: - case 188 /* ModuleDeclaration */: - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: - case 186 /* TypeAliasDeclaration */: - case 182 /* FunctionDeclaration */: - case 187 /* EnumDeclaration */: - case 190 /* ImportDeclaration */: - var parent = node.kind === 181 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (!(node.flags & 1 /* Export */) && !(node.kind !== 190 /* ImportDeclaration */ && parent.kind !== 193 /* SourceFile */ && ts.isInAmbientContext(parent))) { + case 184 /* VariableDeclaration */: + case 191 /* ModuleDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 185 /* FunctionDeclaration */: + case 190 /* EnumDeclaration */: + case 193 /* ImportDeclaration */: + var parent = node.kind === 184 /* VariableDeclaration */ ? node.parent.parent : node.parent; + if (!(node.flags & 1 /* Export */) && !(node.kind !== 193 /* ImportDeclaration */ && parent.kind !== 196 /* SourceFile */ && ts.isInAmbientContext(parent))) { return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); } return isDeclarationVisible(parent); @@ -10041,9 +10399,9 @@ var ts; case 129 /* CallSignature */: case 131 /* IndexSignature */: case 123 /* Parameter */: - case 189 /* ModuleBlock */: + case 192 /* ModuleBlock */: return isDeclarationVisible(node.parent); - case 193 /* SourceFile */: + case 196 /* SourceFile */: return true; default: ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); @@ -10061,8 +10419,8 @@ var ts; var classType = getDeclaredTypeOfSymbol(prototype.parent); return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; } - function getTypeOfVariableDeclaration(declaration) { - if (declaration.parent.kind === 166 /* ForInStatement */) { + function getTypeOfVariableOrPropertyDeclaration(declaration) { + if (declaration.parent.kind === 169 /* ForInStatement */) { return anyType; } if (declaration.type) { @@ -10083,7 +10441,7 @@ var ts; } if (declaration.initializer) { var type = checkAndMarkExpression(declaration.initializer); - if (declaration.kind !== 141 /* PropertyAssignment */) { + if (declaration.kind !== 143 /* PropertyAssignment */) { var unwidenedType = type; type = getWidenedType(type); if (type !== unwidenedType) { @@ -10092,6 +10450,10 @@ var ts; } return type; } + if (declaration.kind === 144 /* ShorthandPropertyAssignment */) { + var type = checkIdentifier(declaration.name); + return type; + } var type = declaration.flags & 8 /* Rest */ ? createArrayType(anyType) : anyType; checkImplicitAny(type); return type; @@ -10115,7 +10477,7 @@ var ts; default: var diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; } - error(declaration, diagnostic, ts.identifierToString(declaration.name), typeToString(type)); + error(declaration, diagnostic, ts.declarationNameToString(declaration.name), typeToString(type)); } } function getTypeOfVariableOrParameterOrProperty(symbol) { @@ -10125,11 +10487,11 @@ var ts; return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.kind === 178 /* CatchBlock */) { + if (declaration.kind === 181 /* CatchBlock */) { return links.type = anyType; } links.type = resolvingType; - var type = getTypeOfVariableDeclaration(declaration); + var type = getTypeOfVariableOrPropertyDeclaration(declaration); if (links.type === resolvingType) { links.type = type; } @@ -10180,7 +10542,7 @@ var ts; type = setterParameterType; } else { - if (getter) { + if (getter && getter.body) { type = getReturnTypeFromBody(getter); } else { @@ -10265,7 +10627,7 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 185 /* InterfaceDeclaration */ || node.kind === 184 /* ClassDeclaration */) { + if (node.kind === 188 /* InterfaceDeclaration */ || node.kind === 187 /* ClassDeclaration */) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { @@ -10296,7 +10658,7 @@ var ts; type.typeArguments = type.typeParameters; } type.baseTypes = []; - var declaration = getDeclarationOfKind(symbol, 184 /* ClassDeclaration */); + var declaration = getDeclarationOfKind(symbol, 187 /* ClassDeclaration */); if (declaration.baseType) { var baseType = getTypeFromTypeReferenceNode(declaration.baseType); if (baseType !== unknownType) { @@ -10336,7 +10698,7 @@ var ts; } type.baseTypes = []; ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 185 /* InterfaceDeclaration */ && declaration.baseTypes) { + if (declaration.kind === 188 /* InterfaceDeclaration */ && declaration.baseTypes) { ts.forEach(declaration.baseTypes, function (node) { var baseType = getTypeFromTypeReferenceNode(node); if (baseType !== unknownType) { @@ -10367,7 +10729,7 @@ var ts; var links = getSymbolLinks(symbol); if (!links.declaredType) { links.declaredType = resolvingType; - var declaration = getDeclarationOfKind(symbol, 186 /* TypeAliasDeclaration */); + var declaration = getDeclarationOfKind(symbol, 189 /* TypeAliasDeclaration */); var type = getTypeFromTypeNode(declaration.type); if (links.declaredType === resolvingType) { links.declaredType = type; @@ -10375,7 +10737,7 @@ var ts; } else if (links.declaredType === resolvingType) { links.declaredType = unknownType; - var declaration = getDeclarationOfKind(symbol, 186 /* TypeAliasDeclaration */); + var declaration = getDeclarationOfKind(symbol, 189 /* TypeAliasDeclaration */); error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); } return links.declaredType; @@ -10844,7 +11206,9 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 182 /* FunctionDeclaration */: + case 133 /* FunctionType */: + case 134 /* ConstructorType */: + case 185 /* FunctionDeclaration */: case 125 /* Method */: case 126 /* Constructor */: case 129 /* CallSignature */: @@ -10852,8 +11216,8 @@ var ts; case 131 /* IndexSignature */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -10886,7 +11250,7 @@ var ts; if (compilerOptions.noImplicitAny) { var declaration = signature.declaration; if (declaration.name) { - error(declaration.name, 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, ts.identifierToString(declaration.name)); + error(declaration.name, 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, ts.declarationNameToString(declaration.name)); } else { error(declaration, ts.Diagnostics.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); @@ -11074,9 +11438,9 @@ var ts; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; switch (declaration.kind) { - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: - case 187 /* EnumDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: return declaration; } } @@ -11216,7 +11580,7 @@ var ts; } return links.resolvedType; } - function getTypeFromTypeLiteralNode(node) { + function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { links.resolvedType = createObjectType(32768 /* Anonymous */, node.symbol); @@ -11253,18 +11617,20 @@ var ts; return getTypeFromStringLiteral(node); case 132 /* TypeReference */: return getTypeFromTypeReferenceNode(node); - case 133 /* TypeQuery */: + case 135 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 135 /* ArrayType */: + case 137 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 136 /* TupleType */: + case 138 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 137 /* UnionType */: + case 139 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 138 /* ParenType */: + case 140 /* ParenType */: return getTypeFromTypeNode(node.type); - case 134 /* TypeLiteral */: - return getTypeFromTypeLiteralNode(node); + case 133 /* FunctionType */: + case 134 /* ConstructorType */: + case 136 /* TypeLiteral */: + return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); case 63 /* Identifier */: case 121 /* QualifiedName */: var symbol = getSymbolInfo(node); @@ -11411,16 +11777,16 @@ var ts; } function isContextSensitiveExpression(node) { switch (node.kind) { - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: return !node.typeParameters && !ts.forEach(node.parameters, function (p) { return p.type; }); - case 140 /* ObjectLiteral */: - return ts.forEach(node.properties, function (p) { return p.kind === 141 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); - case 139 /* ArrayLiteral */: + case 142 /* ObjectLiteral */: + return ts.forEach(node.properties, function (p) { return p.kind === 143 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); + case 141 /* ArrayLiteral */: return ts.forEach(node.elements, function (e) { return isContextSensitiveExpression(e); }); - case 154 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return isContextSensitiveExpression(node.whenTrue) || isContextSensitiveExpression(node.whenFalse); - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: return node.operator === 48 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); } return false; @@ -11469,6 +11835,7 @@ var ts; var errorInfo; var sourceStack; var targetStack; + var maybeStack; var expandingFlags; var depth = 0; var overflow = false; @@ -11613,11 +11980,11 @@ var ts; var id = source.id + "," + target.id; var related = relation[id]; if (related !== undefined) { - return related; + return related ? -1 /* True */ : 0 /* False */; } if (depth > 0) { for (var i = 0; i < depth; i++) { - if (source === sourceStack[i] && target === targetStack[i]) { + if (maybeStack[i][id]) { return 1 /* Maybe */; } } @@ -11629,10 +11996,13 @@ var ts; else { sourceStack = []; targetStack = []; + maybeStack = []; expandingFlags = 0; } sourceStack[depth] = source; targetStack[depth] = target; + maybeStack[depth] = {}; + maybeStack[depth][id] = true; depth++; var saveExpandingFlags = expandingFlags; if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack)) @@ -11640,7 +12010,7 @@ var ts; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; if (expandingFlags === 3) { - var result = -1 /* True */; + var result = 1 /* Maybe */; } else { var result = propertiesRelatedTo(source, target, reportErrors); @@ -11659,8 +12029,15 @@ var ts; } expandingFlags = saveExpandingFlags; depth--; - if (result !== 1 /* Maybe */) { - relation[id] = result; + if (result) { + var maybeCache = maybeStack[depth]; + var destinationCache = result === -1 /* True */ || depth === 0 ? relation : maybeStack[depth - 1]; + for (var p in maybeCache) { + destinationCache[p] = maybeCache[p]; + } + } + else { + relation[id] = false; } return result; } @@ -12139,8 +12516,9 @@ var ts; } function createInferenceContext(typeParameters, inferUnionTypes) { var inferences = []; - for (var i = 0; i < typeParameters.length; i++) - inferences.push([]); + for (var i = 0; i < typeParameters.length; i++) { + inferences.push({ primary: undefined, secondary: undefined }); + } return { typeParameters: typeParameters, inferUnionTypes: inferUnionTypes, @@ -12153,6 +12531,7 @@ var ts; var sourceStack; var targetStack; var depth = 0; + var inferiority = 0; inferFromTypes(source, target); function isInProcess(source, target) { for (var i = 0; i < depth; i++) { @@ -12179,10 +12558,10 @@ var ts; var typeParameters = context.typeParameters; for (var i = 0; i < typeParameters.length; i++) { if (target === typeParameters[i]) { - context.inferenceCount++; var inferences = context.inferences[i]; - if (!ts.contains(inferences, source)) - inferences.push(source); + var candidates = inferiority ? inferences.secondary || (inferences.secondary = []) : inferences.primary || (inferences.primary = []); + if (!ts.contains(candidates, source)) + candidates.push(source); break; } } @@ -12196,7 +12575,6 @@ var ts; } else if (target.flags & 16384 /* Union */) { var targetTypes = target.types; - var startCount = context.inferenceCount; var typeParameterCount = 0; var typeParameter; for (var i = 0; i < targetTypes.length; i++) { @@ -12209,8 +12587,10 @@ var ts; inferFromTypes(source, t); } } - if (context.inferenceCount === startCount && typeParameterCount === 1) { + if (typeParameterCount === 1) { + inferiority++; inferFromTypes(source, typeParameter); + inferiority--; } } else if (source.flags & 16384 /* Union */) { @@ -12272,10 +12652,14 @@ var ts; } } } + function getInferenceCandidates(context, index) { + var inferences = context.inferences[index]; + return inferences.primary || inferences.secondary || emptyArray; + } function getInferredType(context, index) { var inferredType = context.inferredTypes[index]; if (!inferredType) { - var inferences = context.inferences[index]; + var inferences = getInferenceCandidates(context, index); if (inferences.length) { var unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences) : getCommonSupertype(inferences); inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : inferenceFailureType; @@ -12310,7 +12694,7 @@ var ts; function isInTypeQuery(node) { while (node) { switch (node.kind) { - case 133 /* TypeQuery */: + case 135 /* TypeQuery */: return true; case 63 /* Identifier */: case 121 /* QualifiedName */: @@ -12346,7 +12730,7 @@ var ts; function isAssignedInBinaryExpression(node) { if (node.operator >= 51 /* FirstAssignment */ && node.operator <= 62 /* LastAssignment */) { var n = node.left; - while (n.kind === 148 /* ParenExpression */) { + while (n.kind === 151 /* ParenExpression */) { n = n.expression; } if (n.kind === 63 /* Identifier */ && getResolvedSymbol(n) === symbol) { @@ -12363,40 +12747,40 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: return isAssignedInBinaryExpression(node); - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: return isAssignedInVariableDeclaration(node); - case 139 /* ArrayLiteral */: - case 140 /* ObjectLiteral */: - case 142 /* PropertyAccess */: - case 143 /* IndexedAccess */: - case 144 /* CallExpression */: - case 145 /* NewExpression */: - case 147 /* TypeAssertion */: - case 148 /* ParenExpression */: - case 151 /* PrefixOperator */: - case 152 /* PostfixOperator */: - case 154 /* ConditionalExpression */: - case 158 /* Block */: - case 159 /* VariableStatement */: - case 161 /* ExpressionStatement */: - case 162 /* IfStatement */: - case 163 /* DoStatement */: - case 164 /* WhileStatement */: - case 165 /* ForStatement */: - case 166 /* ForInStatement */: - case 169 /* ReturnStatement */: - case 170 /* WithStatement */: - case 171 /* SwitchStatement */: - case 172 /* CaseClause */: - case 173 /* DefaultClause */: - case 174 /* LabeledStatement */: - case 175 /* ThrowStatement */: - case 176 /* TryStatement */: - case 177 /* TryBlock */: - case 178 /* CatchBlock */: - case 179 /* FinallyBlock */: + case 141 /* ArrayLiteral */: + case 142 /* ObjectLiteral */: + case 145 /* PropertyAccess */: + case 146 /* IndexedAccess */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: + case 150 /* TypeAssertion */: + case 151 /* ParenExpression */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: + case 157 /* ConditionalExpression */: + case 161 /* Block */: + case 162 /* VariableStatement */: + case 164 /* ExpressionStatement */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 172 /* ReturnStatement */: + case 173 /* WithStatement */: + case 174 /* SwitchStatement */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: + case 177 /* LabeledStatement */: + case 178 /* ThrowStatement */: + case 179 /* TryStatement */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: return ts.forEachChild(node, isAssignedIn); } return false; @@ -12404,26 +12788,23 @@ var ts; } function getNarrowedTypeOfSymbol(symbol, node) { var type = getTypeOfSymbol(symbol); - if (symbol.flags & 3 /* Variable */ && type.flags & 65025 /* Structured */) { - while (true) { + if (node && (symbol.flags & 3 /* Variable */ && type.flags & 65025 /* Structured */)) { + loop: while (true) { var child = node; node = node.parent; - if (!node || node.kind === 183 /* FunctionBlock */ || node.kind === 189 /* ModuleBlock */) { - break; - } var narrowedType = type; switch (node.kind) { - case 162 /* IfStatement */: + case 165 /* IfStatement */: if (child !== node.expression) { narrowedType = narrowType(type, node.expression, child === node.thenStatement); } break; - case 154 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: if (child !== node.condition) { narrowedType = narrowType(type, node.condition, child === node.whenTrue); } break; - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: if (child === node.right) { if (node.operator === 47 /* AmpersandAmpersandToken */) { narrowedType = narrowType(type, node.left, true); @@ -12433,8 +12814,16 @@ var ts; } } break; + case 196 /* SourceFile */: + case 191 /* ModuleDeclaration */: + case 185 /* FunctionDeclaration */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: + break loop; } - if (narrowedType !== type) { + if (narrowedType !== type && isTypeSubtypeOf(narrowedType, type)) { if (isVariableAssignedWithin(symbol, node)) { break; } @@ -12446,7 +12835,7 @@ var ts; function narrowTypeByEquality(type, expr, assumeTrue) { var left = expr.left; var right = expr.right; - if (left.kind !== 151 /* PrefixOperator */ || left.operator !== 95 /* TypeOfKeyword */ || left.operand.kind !== 63 /* Identifier */ || right.kind !== 7 /* StringLiteral */ || getResolvedSymbol(left.operand) !== symbol) { + if (left.kind !== 154 /* PrefixOperator */ || left.operator !== 95 /* TypeOfKeyword */ || left.operand.kind !== 63 /* Identifier */ || right.kind !== 7 /* StringLiteral */ || getResolvedSymbol(left.operand) !== symbol) { return type; } var t = right.text; @@ -12500,9 +12889,9 @@ var ts; } function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 148 /* ParenExpression */: + case 151 /* ParenExpression */: return narrowType(type, expr.expression, assumeTrue); - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: var operator = expr.operator; if (operator === 29 /* EqualsEqualsEqualsToken */ || operator === 30 /* ExclamationEqualsEqualsToken */) { return narrowTypeByEquality(type, expr, assumeTrue); @@ -12517,7 +12906,7 @@ var ts; return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 151 /* PrefixOperator */: + case 154 /* PrefixOperator */: if (expr.operator === 45 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -12529,7 +12918,7 @@ var ts; function checkIdentifier(node) { var symbol = getResolvedSymbol(node); if (symbol.flags & 33554432 /* Import */) { - getSymbolLinks(symbol).referenced = !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveImport(symbol)); + getSymbolLinks(symbol).referenced = getSymbolLinks(symbol).referenced || (!isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveImport(symbol))); } checkCollisionWithCapturedSuperVariable(node, node); checkCollisionWithCapturedThisVariable(node, node); @@ -12537,7 +12926,7 @@ var ts; return getNarrowedTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol), node); } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 184 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 187 /* ClassDeclaration */ ? container.parent : undefined; getNodeLinks(node).flags |= 2 /* LexicalThis */; if (container.kind === 124 /* Property */ || container.kind === 126 /* Constructor */) { getNodeLinks(classNode).flags |= 4 /* CaptureThis */; @@ -12549,15 +12938,15 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 150 /* ArrowFunction */) { + if (container.kind === 153 /* ArrowFunction */) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = true; } switch (container.kind) { - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); break; - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; case 126 /* Constructor */: @@ -12574,7 +12963,7 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } - var classNode = container.parent && container.parent.kind === 184 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 187 /* ClassDeclaration */ ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); return container.flags & 128 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); @@ -12587,9 +12976,9 @@ var ts; if (!node) return node; switch (node.kind) { - case 182 /* FunctionDeclaration */: - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: case 124 /* Property */: case 125 /* Method */: case 126 /* Constructor */: @@ -12608,8 +12997,8 @@ var ts; return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 144 /* CallExpression */ && node.parent.func === node; - var enclosingClass = ts.getAncestor(node, 184 /* ClassDeclaration */); + var isCallExpression = node.parent.kind === 147 /* CallExpression */ && node.parent.func === node; + var enclosingClass = ts.getAncestor(node, 187 /* ClassDeclaration */); var baseClass; if (enclosingClass && enclosingClass.baseType) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); @@ -12627,11 +13016,11 @@ var ts; } else { var needToCaptureLexicalThis = false; - while (container && container.kind === 150 /* ArrowFunction */) { + while (container && container.kind === 153 /* ArrowFunction */) { container = getSuperContainer(container); needToCaptureLexicalThis = true; } - if (container && container.parent && container.parent.kind === 184 /* ClassDeclaration */) { + if (container && container.parent && container.parent.kind === 187 /* ClassDeclaration */) { if (container.flags & 128 /* Static */) { canUseSuperExpression = container.kind === 125 /* Method */ || container.kind === 127 /* GetAccessor */ || container.kind === 128 /* SetAccessor */; } @@ -12670,7 +13059,7 @@ var ts; } function getContextuallyTypedParameterType(parameter) { var func = parameter.parent; - if (func.kind === 149 /* FunctionExpression */ || func.kind === 150 /* ArrowFunction */) { + if (func.kind === 152 /* FunctionExpression */ || func.kind === 153 /* ArrowFunction */) { if (isContextSensitiveExpression(func)) { var contextualSignature = getContextualSignature(func); if (contextualSignature) { @@ -12809,25 +13198,25 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: case 123 /* Parameter */: case 124 /* Property */: return getContextualTypeForInitializerExpression(node); - case 150 /* ArrowFunction */: - case 169 /* ReturnStatement */: + case 153 /* ArrowFunction */: + case 172 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 144 /* CallExpression */: - case 145 /* NewExpression */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: return getContextualTypeForArgument(node); - case 147 /* TypeAssertion */: + case 150 /* TypeAssertion */: return getTypeFromTypeNode(parent.type); - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 141 /* PropertyAssignment */: + case 143 /* PropertyAssignment */: return getContextualTypeForPropertyExpression(node); - case 139 /* ArrayLiteral */: + case 141 /* ArrayLiteral */: return getContextualTypeForElementExpression(node); - case 154 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); } return undefined; @@ -12849,19 +13238,31 @@ var ts; if (!(type.flags & 16384 /* Union */)) { return getNonGenericSignature(type); } - var result; + var signatureList; var types = type.types; for (var i = 0; i < types.length; i++) { + if (signatureList && getSignaturesOfObjectOrUnionType(types[i], 0 /* Call */).length > 1) { + return undefined; + } var signature = getNonGenericSignature(types[i]); if (signature) { - if (!result) { - result = signature; + if (!signatureList) { + signatureList = [signature]; } - else if (!compareSignatures(result, signature, true, compareTypes)) { + else if (!compareSignatures(signatureList[0], signature, false, compareTypes)) { return undefined; } + else { + signatureList.push(signature); + } } } + var result; + if (signatureList) { + result = cloneSignature(signatureList[0]); + result.resolvedReturnType = undefined; + result.unionSignatures = signatureList; + } return result; } function isInferentialContext(mapper) { @@ -12890,7 +13291,15 @@ var ts; if (ts.hasProperty(members, id)) { var member = members[id]; if (member.flags & 4 /* Property */) { - var type = checkExpression(member.declarations[0].initializer, contextualMapper); + var memberDecl = member.declarations[0]; + var type; + if (memberDecl.kind === 143 /* PropertyAssignment */) { + type = checkExpression(memberDecl.initializer, contextualMapper); + } + else { + ts.Debug.assert(memberDecl.kind === 144 /* ShorthandPropertyAssignment */); + type = checkExpression(memberDecl.name, contextualMapper); + } var prop = createSymbol(4 /* Property */ | 268435456 /* Transient */ | member.flags, member.name); prop.declarations = member.declarations; prop.parent = member.parent; @@ -12945,7 +13354,7 @@ var ts; if (!(flags & (32 /* Private */ | 64 /* Protected */))) { return; } - var enclosingClassDeclaration = ts.getAncestor(node, 184 /* ClassDeclaration */); + var enclosingClassDeclaration = ts.getAncestor(node, 187 /* ClassDeclaration */); var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (flags & 32 /* Private */) { @@ -12980,7 +13389,7 @@ var ts; var prop = getPropertyOfType(apparentType, node.right.text); if (!prop) { if (node.right.text) { - error(node.right, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.identifierToString(node.right), typeToString(type)); + error(node.right, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.declarationNameToString(node.right), typeToString(type)); } return unknownType; } @@ -13050,29 +13459,64 @@ var ts; return unknownType; } function resolveUntypedCall(node) { - ts.forEach(node.arguments, function (argument) { - checkExpression(argument); - }); + if (node.kind === 149 /* TaggedTemplateExpression */) { + checkExpression(node.template); + } + else { + ts.forEach(node.arguments, function (argument) { + checkExpression(argument); + }); + } return anySignature; } function resolveErrorCall(node) { resolveUntypedCall(node); return unknownSignature; } - function signatureHasCorrectArity(node, signature) { - if (!node.arguments) { - return signature.minArgumentCount === 0; + function hasCorrectArity(node, args, signature) { + var adjustedArgCount; + var typeArguments; + var callIsIncomplete; + if (node.kind === 149 /* TaggedTemplateExpression */) { + var tagExpression = node; + adjustedArgCount = args.length; + typeArguments = undefined; + if (tagExpression.template.kind === 158 /* TemplateExpression */) { + var templateExpression = tagExpression.template; + var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); + ts.Debug.assert(lastSpan !== undefined); + callIsIncomplete = lastSpan.literal.kind === 120 /* Missing */ || ts.isUnterminatedTemplateEnd(lastSpan.literal); + } + else { + var templateLiteral = tagExpression.template; + ts.Debug.assert(templateLiteral.kind === 9 /* NoSubstitutionTemplateLiteral */); + callIsIncomplete = ts.isUnterminatedTemplateEnd(templateLiteral); + } } - var args = node.arguments; - var numberOfArgs = args.hasTrailingComma ? args.length + 1 : args.length; - var hasTooManyArguments = !signature.hasRestParameter && numberOfArgs > signature.parameters.length; - var hasRightNumberOfTypeArguments = !node.typeArguments || (signature.typeParameters && node.typeArguments.length === signature.typeParameters.length); - if (hasTooManyArguments || !hasRightNumberOfTypeArguments) { - return false; + else { + var callExpression = node; + if (!callExpression.arguments) { + ts.Debug.assert(callExpression.kind === 148 /* NewExpression */); + return signature.minArgumentCount === 0; + } + adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length; + callIsIncomplete = callExpression.arguments.end === callExpression.end; + typeArguments = callExpression.typeArguments; + } + ts.Debug.assert(adjustedArgCount !== undefined, "'adjustedArgCount' undefined"); + ts.Debug.assert(callIsIncomplete !== undefined, "'callIsIncomplete' undefined"); + return checkArity(adjustedArgCount, typeArguments, callIsIncomplete, signature); + function checkArity(adjustedArgCount, typeArguments, callIsIncomplete, signature) { + if (!signature.hasRestParameter && adjustedArgCount > signature.parameters.length) { + return false; + } + var hasRightNumberOfTypeArgs = !typeArguments || (signature.typeParameters && typeArguments.length === signature.typeParameters.length); + if (!hasRightNumberOfTypeArgs) { + return false; + } + var hasEnoughArguments = adjustedArgCount >= signature.minArgumentCount; + return callIsIncomplete || hasEnoughArguments; } - var callIsIncomplete = args.end === node.end; - var hasEnoughArguments = numberOfArgs >= signature.minArgumentCount; - return callIsIncomplete || hasEnoughArguments; } function getSingleCallSignature(type) { if (type.flags & 48128 /* ObjectType */) { @@ -13095,17 +13539,21 @@ var ts; var context = createInferenceContext(typeParameters, false); var mapper = createInferenceMapper(context); for (var i = 0; i < args.length; i++) { - if (args[i].kind === 157 /* OmittedExpression */) { + if (args[i].kind === 160 /* OmittedExpression */) { continue; } if (!excludeArgument || excludeArgument[i] === undefined) { var parameterType = getTypeAtPosition(signature, i); + if (i === 0 && args[i].parent.kind === 149 /* TaggedTemplateExpression */) { + inferTypes(context, globalTemplateStringsArrayType, parameterType); + continue; + } inferTypes(context, checkExpressionWithContextualType(args[i], parameterType, mapper), parameterType); } } if (excludeArgument) { for (var i = 0; i < args.length; i++) { - if (args[i].kind === 157 /* OmittedExpression */) { + if (args[i].kind === 160 /* OmittedExpression */) { continue; } if (excludeArgument[i] === false) { @@ -13139,37 +13587,60 @@ var ts; } return typeArgumentsAreAssignable; } - function checkApplicableSignature(node, signature, relation, excludeArgument, reportErrors) { - if (node.arguments) { - for (var i = 0; i < node.arguments.length; i++) { - var arg = node.arguments[i]; - if (arg.kind === 157 /* OmittedExpression */) { - continue; - } - var paramType = getTypeAtPosition(signature, i); - var argType = arg.kind === 7 /* StringLiteral */ && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); - var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); - if (!isValidArgument) { - return false; - } + function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) { + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + var argType; + if (arg.kind === 160 /* OmittedExpression */) { + continue; + } + var paramType = getTypeAtPosition(signature, i); + if (i === 0 && node.kind === 149 /* TaggedTemplateExpression */) { + argType = globalTemplateStringsArrayType; + } + else { + argType = arg.kind === 7 /* StringLiteral */ && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); + } + var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); + if (!isValidArgument) { + return false; } } return true; } + function getEffectiveCallArguments(node) { + var args; + if (node.kind === 149 /* TaggedTemplateExpression */) { + var template = node.template; + args = [template]; + if (template.kind === 158 /* TemplateExpression */) { + ts.forEach(template.templateSpans, function (span) { + args.push(span.expression); + }); + } + } + else { + args = node.arguments || emptyArray; + } + return args; + } function resolveCall(node, signatures, candidatesOutArray) { - ts.forEach(node.typeArguments, checkSourceElement); + var isTaggedTemplate = node.kind === 149 /* TaggedTemplateExpression */; + var typeArguments = isTaggedTemplate ? undefined : node.typeArguments; + ts.forEach(typeArguments, checkSourceElement); var candidates = candidatesOutArray || []; collectCandidates(); if (!candidates.length) { error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); return resolveErrorCall(node); } - var args = node.arguments || emptyArray; + var args = getEffectiveCallArguments(node); var excludeArgument; - for (var i = 0; i < args.length; i++) { + for (var i = isTaggedTemplate ? 1 : 0; i < args.length; i++) { if (isContextSensitiveExpression(args[i])) { - if (!excludeArgument) + if (!excludeArgument) { excludeArgument = new Array(args.length); + } excludeArgument[i] = true; } } @@ -13178,30 +13649,30 @@ var ts; var resultOfFailedInference; var result; if (candidates.length > 1) { - result = chooseOverload(candidates, subtypeRelation, excludeArgument); + result = chooseOverload(candidates, subtypeRelation); } if (!result) { candidateForArgumentError = undefined; candidateForTypeArgumentError = undefined; resultOfFailedInference = undefined; - result = chooseOverload(candidates, assignableRelation, excludeArgument); + result = chooseOverload(candidates, assignableRelation); } if (result) { return result; } if (candidateForArgumentError) { - checkApplicableSignature(node, candidateForArgumentError, assignableRelation, undefined, true); + checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, undefined, true); } else if (candidateForTypeArgumentError) { - if (node.typeArguments) { + if (!isTaggedTemplate && node.typeArguments) { checkTypeArguments(candidateForTypeArgumentError, node.typeArguments, [], true); } else { ts.Debug.assert(resultOfFailedInference.failedTypeParameterIndex >= 0); var failedTypeParameter = candidateForTypeArgumentError.typeParameters[resultOfFailedInference.failedTypeParameterIndex]; - var inferenceCandidates = resultOfFailedInference.inferences[resultOfFailedInference.failedTypeParameterIndex]; + var inferenceCandidates = getInferenceCandidates(resultOfFailedInference, resultOfFailedInference.failedTypeParameterIndex); var diagnosticChainHead = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly, typeToString(failedTypeParameter)); - reportNoCommonSupertypeError(inferenceCandidates, node.func, diagnosticChainHead); + reportNoCommonSupertypeError(inferenceCandidates, node.func || node.tag, diagnosticChainHead); } } else { @@ -13209,15 +13680,15 @@ var ts; } if (!fullTypeCheck) { for (var i = 0, n = candidates.length; i < n; i++) { - if (signatureHasCorrectArity(node, candidates[i])) { + if (hasCorrectArity(node, args, candidates[i])) { return candidates[i]; } } } return resolveErrorCall(node); - function chooseOverload(candidates, relation, excludeArgument) { + function chooseOverload(candidates, relation) { for (var i = 0; i < candidates.length; i++) { - if (!signatureHasCorrectArity(node, candidates[i])) { + if (!hasCorrectArity(node, args, candidates[i])) { continue; } var originalCandidate = candidates[i]; @@ -13227,9 +13698,9 @@ var ts; if (candidate.typeParameters) { var typeArgumentTypes; var typeArgumentsAreValid; - if (node.typeArguments) { + if (typeArguments) { typeArgumentTypes = new Array(candidate.typeParameters.length); - typeArgumentsAreValid = checkTypeArguments(candidate, node.typeArguments, typeArgumentTypes, false); + typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false); } else { inferenceResult = inferTypeArguments(candidate, args, excludeArgument); @@ -13241,7 +13712,7 @@ var ts; } candidate = getSignatureInstantiation(candidate, typeArgumentTypes); } - if (!checkApplicableSignature(node, candidate, relation, excludeArgument, false)) { + if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, false)) { break; } var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; @@ -13257,7 +13728,7 @@ var ts; } else { candidateForTypeArgumentError = originalCandidate; - if (!node.typeArguments) { + if (!typeArguments) { resultOfFailedInference = inferenceResult; } } @@ -13360,11 +13831,38 @@ var ts; error(node, ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature); return resolveErrorCall(node); } + function resolveTaggedTemplateExpression(node, candidatesOutArray) { + var tagType = checkExpression(node.tag); + var apparentType = getApparentType(tagType); + if (apparentType === unknownType) { + return resolveErrorCall(node); + } + var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); + if (tagType === anyType || (!callSignatures.length && !(tagType.flags & 16384 /* Union */) && isTypeAssignableTo(tagType, globalFunctionType))) { + return resolveUntypedCall(node); + } + if (!callSignatures.length) { + error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature); + return resolveErrorCall(node); + } + return resolveCall(node, callSignatures, candidatesOutArray); + } function getResolvedSignature(node, candidatesOutArray) { var links = getNodeLinks(node); if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - links.resolvedSignature = node.kind === 144 /* CallExpression */ ? resolveCallExpression(node, candidatesOutArray) : resolveNewExpression(node, candidatesOutArray); + if (node.kind === 147 /* CallExpression */) { + links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); + } + else if (node.kind === 148 /* NewExpression */) { + links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); + } + else if (node.kind === 149 /* TaggedTemplateExpression */) { + links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); + } + else { + ts.Debug.fail("Branch in 'getResolvedSignature' should be unreachable."); + } } return links.resolvedSignature; } @@ -13373,9 +13871,9 @@ var ts; if (node.func.kind === 89 /* SuperKeyword */) { return voidType; } - if (node.kind === 145 /* NewExpression */) { + if (node.kind === 148 /* NewExpression */) { var declaration = signature.declaration; - if (declaration && (declaration.kind !== 126 /* Constructor */ && declaration.kind !== 130 /* ConstructSignature */)) { + if (declaration && declaration.kind !== 126 /* Constructor */ && declaration.kind !== 130 /* ConstructSignature */ && declaration.kind !== 134 /* ConstructorType */) { if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -13385,9 +13883,7 @@ var ts; return getReturnTypeOfSignature(signature); } function checkTaggedTemplateExpression(node) { - checkExpression(node.tag); - checkExpression(node.template); - return anyType; + return getReturnTypeOfSignature(getResolvedSignature(node)); } function checkTypeAssertion(node) { var exprType = checkExpression(node.operand); @@ -13418,7 +13914,7 @@ var ts; } function getReturnTypeFromBody(func, contextualMapper) { var contextualSignature = getContextualSignature(func); - if (func.body.kind !== 183 /* FunctionBlock */) { + if (func.body.kind !== 186 /* FunctionBlock */) { var unwidenedType = checkAndMarkExpression(func.body, contextualMapper); var widenedType = getWidenedType(unwidenedType); if (fullTypeCheck && compilerOptions.noImplicitAny && !contextualSignature && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { @@ -13437,7 +13933,7 @@ var ts; if (fullTypeCheck && compilerOptions.noImplicitAny && !contextualSignature && widenedType !== commonType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { var typeName = typeToString(widenedType); if (func.name) { - error(func, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.identifierToString(func.name), typeName); + error(func, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.declarationNameToString(func.name), typeName); } else { error(func, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); @@ -13466,7 +13962,7 @@ var ts; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 175 /* ThrowStatement */); + return (body.statements.length === 1) && (body.statements[0].kind === 178 /* ThrowStatement */); } function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { if (!fullTypeCheck) { @@ -13475,7 +13971,7 @@ var ts; if (returnType === voidType || returnType === anyType) { return; } - if (!func.body || func.body.kind !== 183 /* FunctionBlock */) { + if (!func.body || func.body.kind !== 186 /* FunctionBlock */) { return; } var bodyBlock = func.body; @@ -13519,7 +14015,7 @@ var ts; if (node.type) { checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } - if (node.body.kind === 183 /* FunctionBlock */) { + if (node.body.kind === 186 /* FunctionBlock */) { checkSourceElement(node.body); } else { @@ -13547,12 +14043,12 @@ var ts; case 63 /* Identifier */: var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3 /* Variable */) !== 0; - case 142 /* PropertyAccess */: + case 145 /* PropertyAccess */: var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || (symbol.flags & ~8 /* EnumMember */) !== 0; - case 143 /* IndexedAccess */: + case 146 /* IndexedAccess */: return true; - case 148 /* ParenExpression */: + case 151 /* ParenExpression */: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -13561,10 +14057,10 @@ var ts; function isConstVariableReference(n) { switch (n.kind) { case 63 /* Identifier */: - case 142 /* PropertyAccess */: + case 145 /* PropertyAccess */: var symbol = findSymbol(n); return symbol && (symbol.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 4096 /* Const */) !== 0; - case 143 /* IndexedAccess */: + case 146 /* IndexedAccess */: var index = n.index; var symbol = findSymbol(n.object); if (symbol && index.kind === 7 /* StringLiteral */) { @@ -13573,7 +14069,7 @@ var ts; return prop && (prop.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 4096 /* Const */) !== 0; } return false; - case 148 /* ParenExpression */: + case 151 /* ParenExpression */: return isConstVariableReference(n.expression); default: return false; @@ -13808,7 +14304,7 @@ var ts; } } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 142 /* PropertyAccess */ && node.parent.left === node) || (node.parent.kind === 143 /* IndexedAccess */ && node.parent.object === node) || ((node.kind === 63 /* Identifier */ || node.kind === 121 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 145 /* PropertyAccess */ && node.parent.left === node) || (node.parent.kind === 146 /* IndexedAccess */ && node.parent.object === node) || ((node.kind === 63 /* Identifier */ || node.kind === 121 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(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); } @@ -13830,7 +14326,7 @@ var ts; return booleanType; case 6 /* NumericLiteral */: return numberType; - case 155 /* TemplateExpression */: + case 158 /* TemplateExpression */: return checkTemplateExpression(node); case 7 /* StringLiteral */: case 9 /* NoSubstitutionTemplateLiteral */: @@ -13839,35 +14335,35 @@ var ts; return globalRegExpType; case 121 /* QualifiedName */: return checkPropertyAccess(node); - case 139 /* ArrayLiteral */: + case 141 /* ArrayLiteral */: return checkArrayLiteral(node, contextualMapper); - case 140 /* ObjectLiteral */: + case 142 /* ObjectLiteral */: return checkObjectLiteral(node, contextualMapper); - case 142 /* PropertyAccess */: + case 145 /* PropertyAccess */: return checkPropertyAccess(node); - case 143 /* IndexedAccess */: + case 146 /* IndexedAccess */: return checkIndexedAccess(node); - case 144 /* CallExpression */: - case 145 /* NewExpression */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: return checkCallExpression(node); - case 146 /* TaggedTemplateExpression */: + case 149 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 147 /* TypeAssertion */: + case 150 /* TypeAssertion */: return checkTypeAssertion(node); - case 148 /* ParenExpression */: + case 151 /* ParenExpression */: return checkExpression(node.expression); - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: return checkFunctionExpression(node, contextualMapper); - case 151 /* PrefixOperator */: + case 154 /* PrefixOperator */: return checkPrefixExpression(node); - case 152 /* PostfixOperator */: + case 155 /* PostfixOperator */: return checkPostfixExpression(node); - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: return checkBinaryExpression(node, contextualMapper); - case 154 /* ConditionalExpression */: + case 157 /* ConditionalExpression */: return checkConditionalExpression(node, contextualMapper); - case 157 /* OmittedExpression */: + case 160 /* OmittedExpression */: return undefinedType; } return unknownType; @@ -13903,7 +14399,7 @@ var ts; if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, 107455 /* Value */) === referencedSymbol) { if (referencedSymbol.valueDeclaration.kind === 123 /* Parameter */) { if (referencedSymbol.valueDeclaration === parameterDeclaration) { - error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.identifierToString(parameterDeclaration.name)); + error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(parameterDeclaration.name)); return; } var enclosingOrReferencedParameter = ts.forEach(parameterDeclaration.parent.parameters, function (p) { return p === parameterDeclaration || p === referencedSymbol.valueDeclaration ? p : undefined; }); @@ -13911,7 +14407,7 @@ var ts; return; } } - error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.identifierToString(parameterDeclaration.name), ts.identifierToString(n)); + error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.declarationNameToString(parameterDeclaration.name), ts.declarationNameToString(n)); } } else { @@ -13947,7 +14443,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 185 /* InterfaceDeclaration */) { + if (node.kind === 188 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -14003,17 +14499,17 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 144 /* CallExpression */ && n.func.kind === 89 /* SuperKeyword */; + return n.kind === 147 /* CallExpression */ && n.func.kind === 89 /* SuperKeyword */; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 149 /* FunctionExpression */: - case 182 /* FunctionDeclaration */: - case 150 /* ArrowFunction */: - case 140 /* ObjectLiteral */: return false; + case 152 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + case 153 /* ArrowFunction */: + case 142 /* ObjectLiteral */: return false; default: return ts.forEachChild(n, containsSuperCall); } } @@ -14021,7 +14517,7 @@ var ts; if (n.kind === 91 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 149 /* FunctionExpression */ && n.kind !== 182 /* FunctionDeclaration */) { + else if (n.kind !== 152 /* FunctionExpression */ && n.kind !== 185 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } @@ -14033,7 +14529,7 @@ var ts; var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */); }); if (superCallShouldBeFirst) { var statements = node.body.statements; - if (!statements.length || statements[0].kind !== 161 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 164 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); } else { @@ -14091,7 +14587,7 @@ var ts; function checkTypeLiteral(node) { ts.forEach(node.members, checkSourceElement); if (fullTypeCheck) { - var type = getTypeFromTypeLiteralNode(node); + var type = getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); checkIndexConstraints(type); checkTypeForDuplicateIndexSignatures(node); } @@ -14120,9 +14616,8 @@ var ts; error(signatureDeclarationNode, ts.Diagnostics.A_signature_with_an_implementation_cannot_use_a_string_literal_type); return; } - var symbol = getSymbolOfNode(signatureDeclarationNode); var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 185 /* InterfaceDeclaration */) { + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 188 /* InterfaceDeclaration */) { ts.Debug.assert(signatureDeclarationNode.kind === 129 /* CallSignature */ || signatureDeclarationNode.kind === 130 /* ConstructSignature */); var signatureKind = signatureDeclarationNode.kind === 129 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); @@ -14142,7 +14637,7 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = n.flags; - if (n.parent.kind !== 185 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { + if (n.parent.kind !== 188 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { if (!(flags & 2 /* Ambient */)) { flags |= 1 /* Export */; } @@ -14209,7 +14704,7 @@ var ts; return; } else if (subsequentNode.body) { - error(errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.identifierToString(node.name)); + error(errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); return; } } @@ -14228,11 +14723,11 @@ var ts; for (var i = 0; i < declarations.length; i++) { var node = declarations[i]; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 185 /* InterfaceDeclaration */ || node.parent.kind === 134 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 188 /* InterfaceDeclaration */ || node.parent.kind === 136 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 182 /* FunctionDeclaration */ || node.kind === 125 /* Method */ || node.kind === 126 /* Constructor */) { + if (node.kind === 185 /* FunctionDeclaration */ || node.kind === 125 /* Method */ || node.kind === 126 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -14320,20 +14815,20 @@ var ts; if (commonDeclarationSpace) { ts.forEach(symbol.declarations, function (d) { if (getDeclarationSpaces(d) & commonDeclarationSpace) { - error(d.name, ts.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts.identifierToString(d.name)); + error(d.name, ts.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts.declarationNameToString(d.name)); } }); } function getDeclarationSpaces(d) { switch (d.kind) { - case 185 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: return 8388608 /* ExportType */; - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return d.name.kind === 7 /* StringLiteral */ || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 16777216 /* ExportNamespace */ | 4194304 /* ExportValue */ : 16777216 /* ExportNamespace */; - case 184 /* ClassDeclaration */: - case 187 /* EnumDeclaration */: + case 187 /* ClassDeclaration */: + case 190 /* EnumDeclaration */: return 8388608 /* ExportType */ | 4194304 /* ExportValue */; - case 190 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: var result = 0; var target = resolveImport(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { @@ -14366,7 +14861,7 @@ var ts; if (!isPrivateWithinAmbient(node)) { var typeName = typeToString(anyType); if (node.name) { - error(node, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.identifierToString(node.name), typeName); + error(node, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.declarationNameToString(node.name), typeName); } else { error(node, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); @@ -14408,10 +14903,10 @@ var ts; return; } switch (current.kind) { - case 182 /* FunctionDeclaration */: - case 149 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: case 125 /* Method */: - case 150 /* ArrowFunction */: + case 153 /* ArrowFunction */: case 126 /* Constructor */: if (ts.hasRestParameters(current)) { error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter); @@ -14463,7 +14958,7 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } - var enclosingClass = ts.getAncestor(node, 184 /* ClassDeclaration */); + var enclosingClass = ts.getAncestor(node, 187 /* ClassDeclaration */); if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; } @@ -14481,12 +14976,12 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 188 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { + if (node.kind === 191 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return; } - var parent = node.kind === 181 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (parent.kind === 193 /* SourceFile */ && ts.isExternalModule(parent)) { - error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, name.text, name.text); + var parent = node.kind === 184 /* VariableDeclaration */ ? node.parent.parent : node.parent; + if (parent.kind === 196 /* SourceFile */ && ts.isExternalModule(parent)) { + error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } function checkCollisionWithConstDeclarations(node) { @@ -14514,7 +15009,7 @@ var ts; type = typeOfValueDeclaration; } else { - type = getTypeOfVariableDeclaration(node); + type = getTypeOfVariableOrPropertyDeclaration(node); } if (node.initializer) { if (!(getNodeLinks(node.initializer).flags & 1 /* TypeChecked */)) { @@ -14527,7 +15022,7 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); if (!useTypeFromValueDeclaration) { if (typeOfValueDeclaration !== unknownType && type !== unknownType && !isTypeIdenticalTo(typeOfValueDeclaration, type)) { - error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.identifierToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); + error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.declarationNameToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); } } } @@ -14563,10 +15058,13 @@ var ts; checkSourceElement(node.statement); } function checkForInStatement(node) { - if (node.declaration) { - checkVariableDeclaration(node.declaration); - if (node.declaration.type) { - error(node.declaration, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation); + if (node.declarations) { + if (node.declarations.length >= 1) { + var decl = node.declarations[0]; + checkVariableDeclaration(decl); + if (decl.type) { + error(decl, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation); + } } } if (node.variable) { @@ -14704,7 +15202,7 @@ var ts; if (fullTypeCheck) { for (var j = 0; j < i; j++) { if (typeParameterDeclarations[j].symbol === node.symbol) { - error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.identifierToString(node.name)); + error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.declarationNameToString(node.name)); } } } @@ -14873,7 +15371,7 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = getDeclarationOfKind(symbol, 185 /* InterfaceDeclaration */); + var firstInterfaceDecl = getDeclarationOfKind(symbol, 188 /* InterfaceDeclaration */); if (symbol.declarations.length > 1) { if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); @@ -14944,7 +15442,7 @@ var ts; return evalConstant(initializer); function evalConstant(e) { switch (e.kind) { - case 151 /* PrefixOperator */: + case 154 /* PrefixOperator */: var value = evalConstant(e.operand); if (value === undefined) { return undefined; @@ -14955,7 +15453,7 @@ var ts; case 46 /* TildeToken */: return enumIsConst ? ~value : undefined; } return undefined; - case 153 /* BinaryExpression */: + case 156 /* BinaryExpression */: if (!enumIsConst) { return undefined; } @@ -14983,11 +15481,11 @@ var ts; return undefined; case 6 /* NumericLiteral */: return +e.text; - case 148 /* ParenExpression */: + case 151 /* ParenExpression */: return enumIsConst ? evalConstant(e.expression) : undefined; case 63 /* Identifier */: - case 143 /* IndexedAccess */: - case 142 /* PropertyAccess */: + case 146 /* IndexedAccess */: + case 145 /* PropertyAccess */: if (!enumIsConst) { return undefined; } @@ -15000,7 +15498,7 @@ var ts; propertyName = e.text; } else { - if (e.kind === 143 /* IndexedAccess */) { + if (e.kind === 146 /* IndexedAccess */) { if (e.index.kind !== 7 /* StringLiteral */) { return undefined; } @@ -15056,7 +15554,7 @@ var ts; } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 187 /* EnumDeclaration */) { + if (declaration.kind !== 190 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -15079,7 +15577,7 @@ var ts; var declarations = symbol.declarations; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; - if ((declaration.kind === 184 /* ClassDeclaration */ || (declaration.kind === 182 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { + if ((declaration.kind === 187 /* ClassDeclaration */ || (declaration.kind === 185 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { return declaration; } } @@ -15133,7 +15631,7 @@ var ts; checkExpression(node.entityName); } else { - error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.identifierToString(moduleName)); + error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.declarationNameToString(moduleName)); } } if (target.flags & 3152352 /* Type */) { @@ -15142,10 +15640,10 @@ var ts; } } else { - if (node.parent.kind === 193 /* SourceFile */) { + if (node.parent.kind === 196 /* SourceFile */) { target = resolveImport(symbol); } - else if (node.parent.kind === 189 /* ModuleBlock */ && node.parent.parent.name.kind === 7 /* StringLiteral */) { + else if (node.parent.kind === 192 /* ModuleBlock */ && node.parent.parent.name.kind === 7 /* StringLiteral */) { if (isExternalModuleNameRelative(node.externalModuleName.text)) { error(node, ts.Diagnostics.Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); target = unknownSymbol; @@ -15167,7 +15665,7 @@ var ts; } function checkExportAssignment(node) { var container = node.parent; - if (container.kind !== 193 /* SourceFile */) { + if (container.kind !== 196 /* SourceFile */) { container = container.parent; } checkTypeOfExportAssignmentSymbol(getSymbolOfNode(container)); @@ -15182,6 +15680,8 @@ var ts; return checkParameter(node); case 124 /* Property */: return checkPropertyDeclaration(node); + case 133 /* FunctionType */: + case 134 /* ConstructorType */: case 129 /* CallSignature */: case 130 /* ConstructSignature */: case 131 /* IndexSignature */: @@ -15195,76 +15695,76 @@ var ts; return checkAccessorDeclaration(node); case 132 /* TypeReference */: return checkTypeReference(node); - case 133 /* TypeQuery */: + case 135 /* TypeQuery */: return checkTypeQuery(node); - case 134 /* TypeLiteral */: + case 136 /* TypeLiteral */: return checkTypeLiteral(node); - case 135 /* ArrayType */: + case 137 /* ArrayType */: return checkArrayType(node); - case 136 /* TupleType */: + case 138 /* TupleType */: return checkTupleType(node); - case 137 /* UnionType */: + case 139 /* UnionType */: return checkUnionType(node); - case 138 /* ParenType */: + case 140 /* ParenType */: return checkSourceElement(node.type); - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 158 /* Block */: + case 161 /* Block */: return checkBlock(node); - case 183 /* FunctionBlock */: - case 189 /* ModuleBlock */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: return checkBody(node); - case 159 /* VariableStatement */: + case 162 /* VariableStatement */: return checkVariableStatement(node); - case 161 /* ExpressionStatement */: + case 164 /* ExpressionStatement */: return checkExpressionStatement(node); - case 162 /* IfStatement */: + case 165 /* IfStatement */: return checkIfStatement(node); - case 163 /* DoStatement */: + case 166 /* DoStatement */: return checkDoStatement(node); - case 164 /* WhileStatement */: + case 167 /* WhileStatement */: return checkWhileStatement(node); - case 165 /* ForStatement */: + case 168 /* ForStatement */: return checkForStatement(node); - case 166 /* ForInStatement */: + case 169 /* ForInStatement */: return checkForInStatement(node); - case 167 /* ContinueStatement */: - case 168 /* BreakStatement */: + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 169 /* ReturnStatement */: + case 172 /* ReturnStatement */: return checkReturnStatement(node); - case 170 /* WithStatement */: + case 173 /* WithStatement */: return checkWithStatement(node); - case 171 /* SwitchStatement */: + case 174 /* SwitchStatement */: return checkSwitchStatement(node); - case 174 /* LabeledStatement */: + case 177 /* LabeledStatement */: return checkLabeledStatement(node); - case 175 /* ThrowStatement */: + case 178 /* ThrowStatement */: return checkThrowStatement(node); - case 176 /* TryStatement */: + case 179 /* TryStatement */: return checkTryStatement(node); - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: return ts.Debug.fail("Checker encountered variable declaration"); - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: return checkClassDeclaration(node); - case 185 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 186 /* TypeAliasDeclaration */: + case 189 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 190 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: return checkImportDeclaration(node); - case 191 /* ExportAssignment */: + case 194 /* ExportAssignment */: return checkExportAssignment(node); } } function checkFunctionExpressionBodies(node) { switch (node.kind) { - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: ts.forEach(node.parameters, checkFunctionExpressionBodies); checkFunctionExpressionBody(node); break; @@ -15272,55 +15772,55 @@ var ts; case 126 /* Constructor */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: ts.forEach(node.parameters, checkFunctionExpressionBodies); break; - case 170 /* WithStatement */: + case 173 /* WithStatement */: checkFunctionExpressionBodies(node.expression); break; case 123 /* Parameter */: case 124 /* Property */: - case 139 /* ArrayLiteral */: - case 140 /* ObjectLiteral */: - case 141 /* PropertyAssignment */: - case 142 /* PropertyAccess */: - case 143 /* IndexedAccess */: - case 144 /* CallExpression */: - case 145 /* NewExpression */: - case 146 /* TaggedTemplateExpression */: - case 147 /* TypeAssertion */: - case 148 /* ParenExpression */: - case 151 /* PrefixOperator */: - case 152 /* PostfixOperator */: - case 153 /* BinaryExpression */: - case 154 /* ConditionalExpression */: - case 158 /* Block */: - case 183 /* FunctionBlock */: - case 189 /* ModuleBlock */: - case 159 /* VariableStatement */: - case 161 /* ExpressionStatement */: - case 162 /* IfStatement */: - case 163 /* DoStatement */: - case 164 /* WhileStatement */: - case 165 /* ForStatement */: - case 166 /* ForInStatement */: - case 167 /* ContinueStatement */: - case 168 /* BreakStatement */: - case 169 /* ReturnStatement */: - case 171 /* SwitchStatement */: - case 172 /* CaseClause */: - case 173 /* DefaultClause */: - case 174 /* LabeledStatement */: - case 175 /* ThrowStatement */: - case 176 /* TryStatement */: - case 177 /* TryBlock */: - case 178 /* CatchBlock */: - case 179 /* FinallyBlock */: - case 181 /* VariableDeclaration */: - case 184 /* ClassDeclaration */: - case 187 /* EnumDeclaration */: - case 192 /* EnumMember */: - case 193 /* SourceFile */: + case 141 /* ArrayLiteral */: + case 142 /* ObjectLiteral */: + case 143 /* PropertyAssignment */: + case 145 /* PropertyAccess */: + case 146 /* IndexedAccess */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: + case 149 /* TaggedTemplateExpression */: + case 150 /* TypeAssertion */: + case 151 /* ParenExpression */: + case 154 /* PrefixOperator */: + case 155 /* PostfixOperator */: + case 156 /* BinaryExpression */: + case 157 /* ConditionalExpression */: + case 161 /* Block */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: + case 162 /* VariableStatement */: + case 164 /* ExpressionStatement */: + case 165 /* IfStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 170 /* ContinueStatement */: + case 171 /* BreakStatement */: + case 172 /* ReturnStatement */: + case 174 /* SwitchStatement */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: + case 177 /* LabeledStatement */: + case 178 /* ThrowStatement */: + case 179 /* TryStatement */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 184 /* VariableDeclaration */: + case 187 /* ClassDeclaration */: + case 190 /* EnumDeclaration */: + case 195 /* EnumMember */: + case 196 /* SourceFile */: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -15391,7 +15891,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 170 /* WithStatement */ && node.parent.statement === node) { + if (node.parent.kind === 173 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; @@ -15427,27 +15927,27 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 193 /* SourceFile */: + case 196 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 35653619 /* ModuleMember */); break; - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: if (!(memberFlags & 128 /* Static */)) { copySymbols(getSymbolOfNode(location).members, meaning & 3152352 /* Type */); } break; - case 149 /* FunctionExpression */: + case 152 /* FunctionExpression */: if (location.name) { copySymbol(location.symbol, meaning); } break; - case 178 /* CatchBlock */: + case 181 /* CatchBlock */: if (location.variable.text) { copySymbol(location.symbol, meaning); } @@ -15465,10 +15965,10 @@ var ts; function isTypeDeclaration(node) { switch (node.kind) { case 122 /* TypeParameter */: - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: - case 186 /* TypeAliasDeclaration */: - case 187 /* EnumDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 190 /* EnumDeclaration */: return true; } } @@ -15479,7 +15979,7 @@ var ts; return node.parent && node.parent.kind === 132 /* TypeReference */; } function isTypeNode(node) { - if (132 /* FirstTypeNode */ <= node.kind && node.kind <= 138 /* LastTypeNode */) { + if (132 /* FirstTypeNode */ <= node.kind && node.kind <= 140 /* LastTypeNode */) { return true; } switch (node.kind) { @@ -15489,20 +15989,20 @@ var ts; case 110 /* BooleanKeyword */: return true; case 97 /* VoidKeyword */: - return node.parent.kind !== 151 /* PrefixOperator */; + return node.parent.kind !== 154 /* PrefixOperator */; case 7 /* StringLiteral */: return node.parent.kind === 123 /* Parameter */; case 63 /* Identifier */: - if (node.parent.kind === 121 /* QualifiedName */) { + if (node.parent.kind === 121 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } case 121 /* QualifiedName */: ts.Debug.assert(node.kind === 63 /* Identifier */ || node.kind === 121 /* QualifiedName */, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); var parent = node.parent; - if (parent.kind === 133 /* TypeQuery */) { + if (parent.kind === 135 /* TypeQuery */) { return false; } - if (132 /* FirstTypeNode */ <= parent.kind && parent.kind <= 138 /* LastTypeNode */) { + if (132 /* FirstTypeNode */ <= parent.kind && parent.kind <= 140 /* LastTypeNode */) { return true; } switch (parent.kind) { @@ -15510,11 +16010,11 @@ var ts; return node === parent.constraint; case 124 /* Property */: case 123 /* Parameter */: - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: return node === parent.type; - case 182 /* FunctionDeclaration */: - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: case 126 /* Constructor */: case 125 /* Method */: case 127 /* GetAccessor */: @@ -15524,12 +16024,12 @@ var ts; case 130 /* ConstructSignature */: case 131 /* IndexSignature */: return node === parent.type; - case 147 /* TypeAssertion */: + case 150 /* TypeAssertion */: return node === parent.type; - case 144 /* CallExpression */: - case 145 /* NewExpression */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: return parent.typeArguments && parent.typeArguments.indexOf(node) >= 0; - case 146 /* TaggedTemplateExpression */: + case 149 /* TaggedTemplateExpression */: return false; } } @@ -15539,22 +16039,22 @@ var ts; while (node.parent.kind === 121 /* QualifiedName */) { node = node.parent; } - if (node.parent.kind === 190 /* ImportDeclaration */) { + if (node.parent.kind === 193 /* ImportDeclaration */) { return node.parent.entityName === node; } - if (node.parent.kind === 191 /* ExportAssignment */) { + if (node.parent.kind === 194 /* ExportAssignment */) { return node.parent.exportName === node; } return false; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 121 /* QualifiedName */ || node.parent.kind === 142 /* PropertyAccess */) && node.parent.right === node; + return (node.parent.kind === 121 /* QualifiedName */ || node.parent.kind === 145 /* PropertyAccess */) && node.parent.right === node; } function getSymbolOfEntityName(entityName) { if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 191 /* ExportAssignment */) { + if (entityName.parent.kind === 194 /* ExportAssignment */) { return resolveEntityName(entityName.parent.parent, entityName, 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */ | 33554432 /* Import */); } if (isInRightSideOfImportOrExportAssignment(entityName)) { @@ -15568,7 +16068,7 @@ var ts; var meaning = 107455 /* Value */ | 33554432 /* Import */; return resolveEntityName(entityName, entityName, meaning); } - else if (entityName.kind === 121 /* QualifiedName */ || entityName.kind === 142 /* PropertyAccess */) { + else if (entityName.kind === 121 /* QualifiedName */ || entityName.kind === 145 /* PropertyAccess */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccess(entityName); @@ -15594,11 +16094,11 @@ var ts; return getSymbolOfNode(node.parent); } if (node.kind === 63 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 191 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); + return node.parent.kind === 194 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); } switch (node.kind) { case 63 /* Identifier */: - case 142 /* PropertyAccess */: + case 145 /* PropertyAccess */: case 121 /* QualifiedName */: return getSymbolOfEntityName(node); case 91 /* ThisKeyword */: @@ -15612,13 +16112,13 @@ var ts; } return undefined; case 7 /* StringLiteral */: - if (node.parent.kind === 190 /* ImportDeclaration */ && node.parent.externalModuleName === node) { + if (node.parent.kind === 193 /* ImportDeclaration */ && node.parent.externalModuleName === node) { var importSymbol = getSymbolOfNode(node.parent); var moduleType = getTypeOfSymbol(importSymbol); return moduleType ? moduleType.symbol : undefined; } case 6 /* NumericLiteral */: - if (node.parent.kind == 143 /* IndexedAccess */ && node.parent.index === node) { + if (node.parent.kind == 146 /* IndexedAccess */ && node.parent.index === node) { var objectType = checkExpression(node.parent.object); if (objectType === unknownType) return undefined; @@ -15631,6 +16131,12 @@ var ts; } return undefined; } + function getShorthandAssignmentValueSymbol(location) { + if (location && location.kind === 144 /* ShorthandPropertyAssignment */) { + return resolveEntityName(location, location.name, 107455 /* Value */); + } + return undefined; + } function getTypeOfNode(node) { if (isInsideWithStatementBody(node)) { return unknownType; @@ -15700,7 +16206,7 @@ var ts; return [symbol]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 512 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 193 /* SourceFile */; + return symbol.flags & 512 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 196 /* SourceFile */; } function isNodeDescendentOf(node, ancestor) { while (node) { @@ -15733,7 +16239,7 @@ var ts; function getLocalNameForSymbol(symbol, location) { var node = location; while (node) { - if ((node.kind === 188 /* ModuleDeclaration */ || node.kind === 187 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { + if ((node.kind === 191 /* ModuleDeclaration */ || node.kind === 190 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { return getLocalNameOfContainer(node); } node = node.parent; @@ -15757,15 +16263,17 @@ var ts; return symbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol) ? symbolToString(symbol) : undefined; } function isTopLevelValueImportWithEntityName(node) { - if (node.parent.kind !== 193 /* SourceFile */ || !node.entityName) { + if (node.parent.kind !== 196 /* SourceFile */ || !node.entityName) { return false; } - var symbol = getSymbolOfNode(node); return isImportResolvedToValue(getSymbolOfNode(node)); } function hasSemanticErrors() { return getDiagnostics().length > 0 || getGlobalDiagnostics().length > 0; } + function isEmitBlocked(sourceFile) { + return program.getDiagnostics(sourceFile).length !== 0 || hasEarlyErrors(sourceFile) || (compilerOptions.noEmitOnError && getDiagnostics(sourceFile).length !== 0); + } function hasEarlyErrors(sourceFile) { return ts.forEach(getDiagnostics(sourceFile), function (d) { return d.isEarly; }); } @@ -15806,7 +16314,7 @@ var ts; if (symbol && (symbol.flags & 8 /* EnumMember */)) { var declaration = symbol.valueDeclaration; var constantValue; - if (declaration.kind === 192 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { + if (declaration.kind === 195 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { return constantValue; } } @@ -15814,7 +16322,7 @@ var ts; } function writeTypeAtLocation(location, enclosingDeclaration, flags, writer) { var symbol = getSymbolOfNode(location); - var type = symbol && !(symbol.flags & 2048 /* TypeLiteral */) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); + var type = symbol && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* CallSignature */ | 262144 /* ConstructSignature */)) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { @@ -15832,7 +16340,7 @@ var ts; getEnumMemberValue: getEnumMemberValue, isTopLevelValueImportWithEntityName: isTopLevelValueImportWithEntityName, hasSemanticErrors: hasSemanticErrors, - hasEarlyErrors: hasEarlyErrors, + isEmitBlocked: isEmitBlocked, isDeclarationVisible: isDeclarationVisible, isImplementationOfOverload: isImplementationOfOverload, writeTypeAtLocation: writeTypeAtLocation, @@ -15847,7 +16355,7 @@ var ts; function initializeTypeChecker() { ts.forEach(program.getSourceFiles(), function (file) { ts.bindSourceFile(file); - ts.forEach(file.semanticErrors, addDiagnostic); + ts.forEach(file.semanticDiagnostics, addDiagnostic); }); ts.forEach(program.getSourceFiles(), function (file) { if (!ts.isExternalModule(file)) { @@ -15866,1729 +16374,19 @@ var ts; globalNumberType = getGlobalType("Number"); globalBooleanType = getGlobalType("Boolean"); globalRegExpType = getGlobalType("RegExp"); + globalTemplateStringsArrayType = compilerOptions.target >= 2 /* ES6 */ ? getGlobalType("TemplateStringsArray") : unknownType; } initializeTypeChecker(); return checker; } ts.createTypeChecker = createTypeChecker; })(ts || (ts = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.DiagnosticCode = { - error_TS_0_1: "error TS{0}: {1}", - warning_TS_0_1: "warning TS{0}: {1}", - Unrecognized_escape_sequence: "Unrecognized escape sequence.", - Unexpected_character_0: "Unexpected character {0}.", - Missing_close_quote_character: "Missing close quote character.", - Identifier_expected: "Identifier expected.", - _0_keyword_expected: "'{0}' keyword expected.", - _0_expected: "'{0}' expected.", - Identifier_expected_0_is_a_keyword: "Identifier expected; '{0}' is a keyword.", - Automatic_semicolon_insertion_not_allowed: "Automatic semicolon insertion not allowed.", - Unexpected_token_0_expected: "Unexpected token; '{0}' expected.", - Trailing_comma_not_allowed: "Trailing comma not allowed.", - public_or_private_modifier_must_precede_static: "'public' or 'private' modifier must precede 'static'.", - Unexpected_token: "Unexpected token.", - Catch_clause_parameter_cannot_have_a_type_annotation: "Catch clause parameter cannot have a type annotation.", - A_rest_parameter_must_be_last_in_a_parameter_list: "A rest parameter must be last in a parameter list.", - Parameter_cannot_have_question_mark_and_initializer: "Parameter cannot have question mark and initializer.", - A_required_parameter_cannot_follow_an_optional_parameter: "A required parameter cannot follow an optional parameter.", - Index_signatures_cannot_have_rest_parameters: "Index signatures cannot have rest parameters.", - Index_signature_parameter_cannot_have_accessibility_modifiers: "Index signature parameter cannot have accessibility modifiers.", - Index_signature_parameter_cannot_have_a_question_mark: "Index signature parameter cannot have a question mark.", - Index_signature_parameter_cannot_have_an_initializer: "Index signature parameter cannot have an initializer.", - Index_signature_must_have_a_type_annotation: "Index signature must have a type annotation.", - Index_signature_parameter_must_have_a_type_annotation: "Index signature parameter must have a type annotation.", - Index_signature_parameter_type_must_be_string_or_number: "Index signature parameter type must be 'string' or 'number'.", - extends_clause_already_seen: "'extends' clause already seen.", - extends_clause_must_precede_implements_clause: "'extends' clause must precede 'implements' clause.", - Classes_can_only_extend_a_single_class: "Classes can only extend a single class.", - implements_clause_already_seen: "'implements' clause already seen.", - Accessibility_modifier_already_seen: "Accessibility modifier already seen.", - _0_modifier_must_precede_1_modifier: "'{0}' modifier must precede '{1}' modifier.", - _0_modifier_already_seen: "'{0}' modifier already seen.", - _0_modifier_cannot_appear_on_a_class_element: "'{0}' modifier cannot appear on a class element.", - Interface_declaration_cannot_have_implements_clause: "Interface declaration cannot have 'implements' clause.", - super_invocation_cannot_have_type_arguments: "'super' invocation cannot have type arguments.", - Only_ambient_modules_can_use_quoted_names: "Only ambient modules can use quoted names.", - Statements_are_not_allowed_in_ambient_contexts: "Statements are not allowed in ambient contexts.", - A_function_implementation_cannot_be_declared_in_an_ambient_context: "A function implementation cannot be declared in an ambient context.", - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: "A 'declare' modifier cannot be used in an already ambient context.", - Initializers_are_not_allowed_in_ambient_contexts: "Initializers are not allowed in ambient contexts.", - _0_modifier_cannot_appear_on_a_module_element: "'{0}' modifier cannot appear on a module element.", - A_declare_modifier_cannot_be_used_with_an_interface_declaration: "A 'declare' modifier cannot be used with an interface declaration.", - A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: "A 'declare' modifier is required for a top level declaration in a .d.ts file.", - A_rest_parameter_cannot_be_optional: "A rest parameter cannot be optional.", - A_rest_parameter_cannot_have_an_initializer: "A rest parameter cannot have an initializer.", - set_accessor_must_have_exactly_one_parameter: "'set' accessor must have exactly one parameter.", - set_accessor_parameter_cannot_be_optional: "'set' accessor parameter cannot be optional.", - set_accessor_parameter_cannot_have_an_initializer: "'set' accessor parameter cannot have an initializer.", - set_accessor_cannot_have_rest_parameter: "'set' accessor cannot have rest parameter.", - get_accessor_cannot_have_parameters: "'get' accessor cannot have parameters.", - Modifiers_cannot_appear_here: "Modifiers cannot appear here.", - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: "Accessors are only available when targeting ECMAScript 5 and higher.", - Enum_member_must_have_initializer: "Enum member must have initializer.", - Export_assignment_cannot_be_used_in_internal_modules: "Export assignment cannot be used in internal modules.", - Ambient_enum_elements_can_only_have_integer_literal_initializers: "Ambient enum elements can only have integer literal initializers.", - module_class_interface_enum_import_or_statement: "module, class, interface, enum, import or statement", - constructor_function_accessor_or_variable: "constructor, function, accessor or variable", - statement: "statement", - case_or_default_clause: "case or default clause", - identifier: "identifier", - call_construct_index_property_or_function_signature: "call, construct, index, property or function signature", - expression: "expression", - type_name: "type name", - property_or_accessor: "property or accessor", - parameter: "parameter", - type: "type", - type_parameter: "type parameter", - A_declare_modifier_cannot_be_used_with_an_import_declaration: "A 'declare' modifier cannot be used with an import declaration.", - Invalid_reference_directive_syntax: "Invalid 'reference' directive syntax.", - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: "Octal literals are not available when targeting ECMAScript 5 and higher.", - Accessors_are_not_allowed_in_ambient_contexts: "Accessors are not allowed in ambient contexts.", - _0_modifier_cannot_appear_on_a_constructor_declaration: "'{0}' modifier cannot appear on a constructor declaration.", - _0_modifier_cannot_appear_on_a_parameter: "'{0}' modifier cannot appear on a parameter.", - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: "Only a single variable declaration is allowed in a 'for...in' statement.", - Type_parameters_cannot_appear_on_a_constructor_declaration: "Type parameters cannot appear on a constructor declaration.", - Type_annotation_cannot_appear_on_a_constructor_declaration: "Type annotation cannot appear on a constructor declaration.", - Type_parameters_cannot_appear_on_an_accessor: "Type parameters cannot appear on an accessor.", - Type_annotation_cannot_appear_on_a_set_accessor: "Type annotation cannot appear on a 'set' accessor.", - Index_signature_must_have_exactly_one_parameter: "Index signature must have exactly one parameter.", - _0_list_cannot_be_empty: "'{0}' list cannot be empty.", - variable_declaration: "variable declaration", - type_argument: "type argument", - Invalid_use_of_0_in_strict_mode: "Invalid use of '{0}' in strict mode.", - with_statements_are_not_allowed_in_strict_mode: "'with' statements are not allowed in strict mode.", - delete_cannot_be_called_on_an_identifier_in_strict_mode: "'delete' cannot be called on an identifier in strict mode.", - Invalid_left_hand_side_in_for_in_statement: "Invalid left-hand side in 'for...in' statement.", - continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: "'continue' statement can only be used within an enclosing iteration statement.", - break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: "'break' statement can only be used within an enclosing iteration or switch statement.", - Jump_target_not_found: "Jump target not found.", - Jump_target_cannot_cross_function_boundary: "Jump target cannot cross function boundary.", - return_statement_must_be_contained_within_a_function_body: "'return' statement must be contained within a function body.", - Expression_expected: "Expression expected.", - Type_expected: "Type expected.", - Template_literal_cannot_be_used_as_an_element_name: "Template literal cannot be used as an element name.", - Duplicate_identifier_0: "Duplicate identifier '{0}'.", - The_name_0_does_not_exist_in_the_current_scope: "The name '{0}' does not exist in the current scope.", - The_name_0_does_not_refer_to_a_value: "The name '{0}' does not refer to a value.", - super_can_only_be_used_inside_a_class_instance_method: "'super' can only be used inside a class instance method.", - The_left_hand_side_of_an_assignment_expression_must_be_a_variable_property_or_indexer: "The left-hand side of an assignment expression must be a variable, property or indexer.", - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: "Value of type '{0}' is not callable. Did you mean to include 'new'?", - Value_of_type_0_is_not_callable: "Value of type '{0}' is not callable.", - Value_of_type_0_is_not_newable: "Value of type '{0}' is not newable.", - An_index_expression_argument_must_be_string_number_or_any: "An index expression argument must be 'string', 'number', or 'any'.", - Operator_0_cannot_be_applied_to_types_1_and_2: "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - Type_0_is_not_assignable_to_type_1: "Type '{0}' is not assignable to type '{1}'.", - Type_0_is_not_assignable_to_type_1_NL_2: "Type '{0}' is not assignable to type '{1}':{NL}{2}", - Expected_var_class_interface_or_module: "Expected var, class, interface, or module.", - Getter_0_already_declared: "Getter '{0}' already declared.", - Setter_0_already_declared: "Setter '{0}' already declared.", - Exported_class_0_extends_private_class_1: "Exported class '{0}' extends private class '{1}'.", - Exported_class_0_implements_private_interface_1: "Exported class '{0}' implements private interface '{1}'.", - Exported_interface_0_extends_private_interface_1: "Exported interface '{0}' extends private interface '{1}'.", - Exported_class_0_extends_class_from_inaccessible_module_1: "Exported class '{0}' extends class from inaccessible module {1}.", - Exported_class_0_implements_interface_from_inaccessible_module_1: "Exported class '{0}' implements interface from inaccessible module {1}.", - Exported_interface_0_extends_interface_from_inaccessible_module_1: "Exported interface '{0}' extends interface from inaccessible module {1}.", - Public_static_property_0_of_exported_class_has_or_is_using_private_type_1: "Public static property '{0}' of exported class has or is using private type '{1}'.", - Public_property_0_of_exported_class_has_or_is_using_private_type_1: "Public property '{0}' of exported class has or is using private type '{1}'.", - Property_0_of_exported_interface_has_or_is_using_private_type_1: "Property '{0}' of exported interface has or is using private type '{1}'.", - Exported_variable_0_has_or_is_using_private_type_1: "Exported variable '{0}' has or is using private type '{1}'.", - Public_static_property_0_of_exported_class_is_using_inaccessible_module_1: "Public static property '{0}' of exported class is using inaccessible module {1}.", - Public_property_0_of_exported_class_is_using_inaccessible_module_1: "Public property '{0}' of exported class is using inaccessible module {1}.", - Property_0_of_exported_interface_is_using_inaccessible_module_1: "Property '{0}' of exported interface is using inaccessible module {1}.", - Exported_variable_0_is_using_inaccessible_module_1: "Exported variable '{0}' is using inaccessible module {1}.", - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1: "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_type_1: "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1: "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - Parameter_0_of_exported_function_has_or_is_using_private_type_1: "Parameter '{0}' of exported function has or is using private type '{1}'.", - Parameter_0_of_constructor_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - Parameter_0_of_public_static_property_setter_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - Parameter_0_of_public_property_setter_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - Parameter_0_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_1: "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - Parameter_0_of_call_signature_from_exported_interface_is_using_inaccessible_module_1: "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - Parameter_0_of_public_static_method_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - Parameter_0_of_public_method_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - Parameter_0_of_method_from_exported_interface_is_using_inaccessible_module_1: "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - Parameter_0_of_exported_function_is_using_inaccessible_module_1: "Parameter '{0}' of exported function is using inaccessible module {1}.", - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_type_0: "Return type of public static property getter from exported class has or is using private type '{0}'.", - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_type_0: "Return type of public property getter from exported class has or is using private type '{0}'.", - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_0: "Return type of constructor signature from exported interface has or is using private type '{0}'.", - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_type_0: "Return type of call signature from exported interface has or is using private type '{0}'.", - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_type_0: "Return type of index signature from exported interface has or is using private type '{0}'.", - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_type_0: "Return type of public static method from exported class has or is using private type '{0}'.", - Return_type_of_public_method_from_exported_class_has_or_is_using_private_type_0: "Return type of public method from exported class has or is using private type '{0}'.", - Return_type_of_method_from_exported_interface_has_or_is_using_private_type_0: "Return type of method from exported interface has or is using private type '{0}'.", - Return_type_of_exported_function_has_or_is_using_private_type_0: "Return type of exported function has or is using private type '{0}'.", - Return_type_of_public_static_property_getter_from_exported_class_is_using_inaccessible_module_0: "Return type of public static property getter from exported class is using inaccessible module {0}.", - Return_type_of_public_property_getter_from_exported_class_is_using_inaccessible_module_0: "Return type of public property getter from exported class is using inaccessible module {0}.", - Return_type_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_0: "Return type of constructor signature from exported interface is using inaccessible module {0}.", - Return_type_of_call_signature_from_exported_interface_is_using_inaccessible_module_0: "Return type of call signature from exported interface is using inaccessible module {0}.", - Return_type_of_index_signature_from_exported_interface_is_using_inaccessible_module_0: "Return type of index signature from exported interface is using inaccessible module {0}.", - Return_type_of_public_static_method_from_exported_class_is_using_inaccessible_module_0: "Return type of public static method from exported class is using inaccessible module {0}.", - Return_type_of_public_method_from_exported_class_is_using_inaccessible_module_0: "Return type of public method from exported class is using inaccessible module {0}.", - Return_type_of_method_from_exported_interface_is_using_inaccessible_module_0: "Return type of method from exported interface is using inaccessible module {0}.", - Return_type_of_exported_function_is_using_inaccessible_module_0: "Return type of exported function is using inaccessible module {0}.", - new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - A_parameter_list_must_follow_a_generic_type_argument_list_expected: "A parameter list must follow a generic type argument list. '(' expected.", - Multiple_constructor_implementations_are_not_allowed: "Multiple constructor implementations are not allowed.", - Cannot_find_external_module_0: "Cannot find external module '{0}'.", - Module_cannot_be_aliased_to_a_non_module_type: "Module cannot be aliased to a non-module type.", - A_class_may_only_extend_another_class: "A class may only extend another class.", - A_class_may_only_implement_another_class_or_interface: "A class may only implement another class or interface.", - An_interface_may_only_extend_a_class_or_another_interface: "An interface may only extend a class or another interface.", - Unable_to_resolve_type: "Unable to resolve type.", - Unable_to_resolve_type_of_0: "Unable to resolve type of '{0}'.", - Unable_to_resolve_type_parameter_constraint: "Unable to resolve type parameter constraint.", - Type_parameter_constraint_cannot_be_a_primitive_type: "Type parameter constraint cannot be a primitive type.", - Supplied_parameters_do_not_match_any_signature_of_call_target: "Supplied parameters do not match any signature of call target.", - Supplied_parameters_do_not_match_any_signature_of_call_target_NL_0: "Supplied parameters do not match any signature of call target:{NL}{0}", - Cannot_use_new_with_an_expression_whose_type_lacks_a_signature: "Cannot use 'new' with an expression whose type lacks a signature.", - Only_a_void_function_can_be_called_with_the_new_keyword: "Only a void function can be called with the 'new' keyword.", - Could_not_select_overload_for_new_expression: "Could not select overload for 'new' expression.", - Type_0_does_not_satisfy_the_constraint_1: "Type '{0}' does not satisfy the constraint '{1}'.", - Could_not_select_overload_for_call_expression: "Could not select overload for 'call' expression.", - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: "Cannot invoke an expression whose type lacks a call signature.", - Calls_to_super_are_only_valid_inside_a_class: "Calls to 'super' are only valid inside a class.", - Generic_type_0_requires_1_type_argument_s: "Generic type '{0}' requires {1} type argument(s).", - Type_of_array_literal_cannot_be_determined_Best_common_type_could_not_be_found_for_array_elements: "Type of array literal cannot be determined. Best common type could not be found for array elements.", - Could_not_find_enclosing_symbol_for_dotted_name_0: "Could not find enclosing symbol for dotted name '{0}'.", - Property_0_does_not_exist_on_value_of_type_1: "Property '{0}' does not exist on value of type '{1}'.", - Cannot_find_name_0: "Cannot find name '{0}'.", - get_and_set_accessor_must_have_the_same_type: "'get' and 'set' accessor must have the same type.", - this_cannot_be_referenced_in_current_location: "'this' cannot be referenced in current location.", - Static_members_cannot_reference_class_type_parameters: "Static members cannot reference class type parameters.", - Type_0_recursively_references_itself_as_a_base_type: "Type '{0}' recursively references itself as a base type.", - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class.", - super_can_only_be_referenced_in_a_derived_class: "'super' can only be referenced in a derived class.", - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - Constructors_for_derived_classes_must_contain_a_super_call: "Constructors for derived classes must contain a 'super' call.", - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: "Super calls are not permitted outside constructors or in nested functions inside constructors.", - _0_1_is_inaccessible: "'{0}.{1}' is inaccessible.", - this_cannot_be_referenced_in_a_module_body: "'this' cannot be referenced in a module body.", - Invalid_expression_types_not_known_to_support_the_addition_operator: "Invalid '+' expression - types not known to support the addition operator.", - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: "An arithmetic operand must be of type 'any', 'number' or an enum type.", - Variable_declarations_of_a_for_statement_cannot_use_a_type_annotation: "Variable declarations of a 'for' statement cannot use a type annotation.", - Variable_declarations_of_a_for_statement_must_be_of_types_string_or_any: "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.", - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type.", - Setters_cannot_return_a_value: "Setters cannot return a value.", - Tried_to_query_type_of_uninitialized_module_0: "Tried to query type of uninitialized module '{0}'.", - Tried_to_set_variable_type_to_uninitialized_module_type_0: "Tried to set variable type to uninitialized module type '{0}'.", - Type_0_is_not_generic: "Type '{0}' is not generic.", - Getters_must_return_a_value: "Getters must return a value.", - Getter_and_setter_accessors_do_not_agree_in_visibility: "Getter and setter accessors do not agree in visibility.", - Invalid_left_hand_side_of_assignment_expression: "Invalid left-hand side of assignment expression.", - Function_declared_a_non_void_return_type_but_has_no_return_expression: "Function declared a non-void return type, but has no return expression.", - Cannot_resolve_return_type_reference: "Cannot resolve return type reference.", - Constructors_cannot_have_a_return_type_of_void: "Constructors cannot have a return type of 'void'.", - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - All_symbols_within_a_with_block_will_be_resolved_to_any: "All symbols within a with block will be resolved to 'any'.", - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: "Import declarations in an internal module cannot reference an external module.", - Class_0_declares_interface_1_but_does_not_implement_it_NL_2: "Class {0} declares interface {1} but does not implement it:{NL}{2}", - Class_0_declares_class_1_as_an_interface_but_does_not_implement_it_NL_2: "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: "The operand of an increment or decrement operator must be a variable, property or indexer.", - this_cannot_be_referenced_in_a_static_property_initializer: "'this' cannot be referenced in a static property initializer.", - Class_0_cannot_extend_class_1_NL_2: "Class '{0}' cannot extend class '{1}':{NL}{2}", - Interface_0_cannot_extend_class_1_NL_2: "Interface '{0}' cannot extend class '{1}':{NL}{2}", - Interface_0_cannot_extend_interface_1_NL_2: "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - Overload_signature_is_not_compatible_with_function_definition: "Overload signature is not compatible with function definition.", - Overload_signature_is_not_compatible_with_function_definition_NL_0: "Overload signature is not compatible with function definition:{NL}{0}", - Overload_signatures_must_all_be_public_or_private: "Overload signatures must all be public or private.", - Overload_signatures_must_all_be_exported_or_not_exported: "Overload signatures must all be exported or not exported.", - Overload_signatures_must_all_be_ambient_or_non_ambient: "Overload signatures must all be ambient or non-ambient.", - Overload_signatures_must_all_be_optional_or_required: "Overload signatures must all be optional or required.", - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: "Specialized overload signature is not assignable to any non-specialized signature.", - this_cannot_be_referenced_in_constructor_arguments: "'this' cannot be referenced in constructor arguments.", - Instance_member_cannot_be_accessed_off_a_class: "Instance member cannot be accessed off a class.", - Untyped_function_calls_may_not_accept_type_arguments: "Untyped function calls may not accept type arguments.", - Non_generic_functions_may_not_accept_type_arguments: "Non-generic functions may not accept type arguments.", - A_generic_type_may_not_reference_itself_with_a_wrapped_form_of_its_own_type_parameters: "A generic type may not reference itself with a wrapped form of its own type parameters.", - A_rest_parameter_must_be_of_an_array_type: "A rest parameter must be of an array type.", - Overload_signature_implementation_cannot_use_specialized_type: "Overload signature implementation cannot use specialized type.", - Export_assignments_may_only_be_used_at_the_top_level_of_external_modules: "Export assignments may only be used at the top-level of external modules.", - Export_assignments_may_only_be_made_with_variables_functions_classes_interfaces_enums_and_internal_modules: "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules.", - Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword: "Only public methods of the base class are accessible via the 'super' keyword.", - Numeric_indexer_type_0_must_be_assignable_to_string_indexer_type_1: "Numeric indexer type '{0}' must be assignable to string indexer type '{1}'.", - Numeric_indexer_type_0_must_be_assignable_to_string_indexer_type_1_NL_2: "Numeric indexer type '{0}' must be assignable to string indexer type '{1}':{NL}{2}", - All_numerically_named_properties_must_be_assignable_to_numeric_indexer_type_0: "All numerically named properties must be assignable to numeric indexer type '{0}'.", - All_numerically_named_properties_must_be_assignable_to_numeric_indexer_type_0_NL_1: "All numerically named properties must be assignable to numeric indexer type '{0}':{NL}{1}", - All_named_properties_must_be_assignable_to_string_indexer_type_0: "All named properties must be assignable to string indexer type '{0}'.", - All_named_properties_must_be_assignable_to_string_indexer_type_0_NL_1: "All named properties must be assignable to string indexer type '{0}':{NL}{1}", - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: "A parameter initializer is only allowed in a function or constructor implementation.", - Function_expression_declared_a_non_void_return_type_but_has_no_return_expression: "Function expression declared a non-void return type, but has no return expression.", - Import_declaration_referencing_identifier_from_internal_module_can_only_be_made_with_variables_functions_classes_interfaces_enums_and_internal_modules: "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - Module_0_has_no_exported_member_1: "Module '{0}' has no exported member '{1}'.", - Unable_to_resolve_module_reference_0: "Unable to resolve module reference '{0}'.", - Could_not_find_module_0_in_module_1: "Could not find module '{0}' in module '{1}'.", - Exported_import_declaration_0_is_assigned_value_with_type_that_has_or_is_using_private_type_1: "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - Exported_import_declaration_0_is_assigned_value_with_type_that_is_using_inaccessible_module_1: "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - Exported_import_declaration_0_is_assigned_type_that_has_or_is_using_private_type_1: "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - Exported_import_declaration_0_is_assigned_type_that_is_using_inaccessible_module_1: "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - Exported_import_declaration_0_is_assigned_container_that_is_or_is_using_inaccessible_module_1: "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_1: "Type name '{0}' in extends clause does not reference constructor function for '{1}'.", - Internal_module_reference_0_in_import_declaration_does_not_reference_module_instance_for_1: "Internal module reference '{0}' in import declaration does not reference module instance for '{1}'.", - Module_0_cannot_merge_with_previous_declaration_of_1_in_a_different_file_2: "Module '{0}' cannot merge with previous declaration of '{1}' in a different file '{2}'.", - Interface_0_cannot_simultaneously_extend_types_1_and_2_NL_3: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':{NL}{3}", - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it.", - Ambient_external_module_declaration_cannot_be_reopened: "Ambient external module declaration cannot be reopened.", - All_declarations_of_merged_declaration_0_must_be_exported_or_not_exported: "All declarations of merged declaration '{0}' must be exported or not exported.", - super_cannot_be_referenced_in_constructor_arguments: "'super' cannot be referenced in constructor arguments.", - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: "Return type of constructor signature must be assignable to the instance type of the class.", - Ambient_external_module_declaration_must_be_defined_in_global_context: "Ambient external module declaration must be defined in global context.", - Ambient_external_module_declaration_cannot_specify_relative_module_name: "Ambient external module declaration cannot specify relative module name.", - Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name.", - No_best_common_type_exists_among_return_expressions: "No best common type exists among return expressions.", - Import_declaration_cannot_refer_to_external_module_reference_when_noResolve_option_is_set: "Import declaration cannot refer to external module reference when --noResolve option is set.", - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.", - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.", - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference.", - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: "Expression resolves to '_super' that compiler uses to capture base class reference.", - TypeParameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - TypeParameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - TypeParameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1: "TypeParameter '{0}' of public static method from exported class has or is using private type '{1}'.", - TypeParameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1: "TypeParameter '{0}' of public method from exported class has or is using private type '{1}'.", - TypeParameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of method from exported interface has or is using private type '{1}'.", - TypeParameter_0_of_exported_function_has_or_is_using_private_type_1: "TypeParameter '{0}' of exported function has or is using private type '{1}'.", - TypeParameter_0_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - TypeParameter_0_of_call_signature_from_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of call signature from exported interface is using inaccessible module {1}", - TypeParameter_0_of_public_static_method_from_exported_class_is_using_inaccessible_module_1: "TypeParameter '{0}' of public static method from exported class is using inaccessible module {1}.", - TypeParameter_0_of_public_method_from_exported_class_is_using_inaccessible_module_1: "TypeParameter '{0}' of public method from exported class is using inaccessible module {1}.", - TypeParameter_0_of_method_from_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of method from exported interface is using inaccessible module {1}.", - TypeParameter_0_of_exported_function_is_using_inaccessible_module_1: "TypeParameter '{0}' of exported function is using inaccessible module {1}.", - TypeParameter_0_of_exported_class_has_or_is_using_private_type_1: "TypeParameter '{0}' of exported class has or is using private type '{1}'.", - TypeParameter_0_of_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of exported interface has or is using private type '{1}'.", - TypeParameter_0_of_exported_class_is_using_inaccessible_module_1: "TypeParameter '{0}' of exported class is using inaccessible module {1}.", - TypeParameter_0_of_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of exported interface is using inaccessible module {1}.", - Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter.", - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", - No_best_common_type_exists_between_0_and_1: "No best common type exists between '{0}' and '{1}'.", - No_best_common_type_exists_between_0_1_and_2: "No best common type exists between '{0}', '{1}', and '{2}'.", - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module.", - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list.", - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.", - Parameter_0_cannot_be_referenced_in_its_initializer: "Parameter '{0}' cannot be referenced in its initializer.", - Duplicate_string_index_signature: "Duplicate string index signature.", - Duplicate_number_index_signature: "Duplicate number index signature.", - All_declarations_of_an_interface_must_have_identical_type_parameters: "All declarations of an interface must have identical type parameters.", - Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter.", - Neither_type_0_nor_type_1_is_assignable_to_the_other: "Neither type '{0}' nor type '{1}' is assignable to the other.", - Neither_type_0_nor_type_1_is_assignable_to_the_other_NL_2: "Neither type '{0}' nor type '{1}' is assignable to the other:{NL}{2}", - Duplicate_function_implementation: "Duplicate function implementation.", - Function_implementation_expected: "Function implementation expected.", - Function_overload_name_must_be_0: "Function overload name must be '{0}'.", - Constructor_implementation_expected: "Constructor implementation expected.", - Class_name_cannot_be_0: "Class name cannot be '{0}'.", - Interface_name_cannot_be_0: "Interface name cannot be '{0}'.", - Enum_name_cannot_be_0: "Enum name cannot be '{0}'.", - A_module_cannot_have_multiple_export_assignments: "A module cannot have multiple export assignments.", - Export_assignment_not_allowed_in_module_with_exported_element: "Export assignment not allowed in module with exported element.", - A_parameter_property_is_only_allowed_in_a_constructor_implementation: "A parameter property is only allowed in a constructor implementation.", - Function_overload_must_be_static: "Function overload must be static.", - Function_overload_must_not_be_static: "Function overload must not be static.", - Type_0_is_missing_property_1_from_type_2: "Type '{0}' is missing property '{1}' from type '{2}'.", - Types_of_property_0_of_types_1_and_2_are_incompatible: "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - Types_of_property_0_of_types_1_and_2_are_incompatible_NL_3: "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - Property_0_defined_as_private_in_type_1_is_defined_as_public_in_type_2: "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - Property_0_defined_as_public_in_type_1_is_defined_as_private_in_type_2: "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - Types_0_and_1_define_property_2_as_private: "Types '{0}' and '{1}' define property '{2}' as private.", - Call_signatures_of_types_0_and_1_are_incompatible: "Call signatures of types '{0}' and '{1}' are incompatible.", - Call_signatures_of_types_0_and_1_are_incompatible_NL_2: "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - Type_0_requires_a_call_signature_but_type_1_lacks_one: "Type '{0}' requires a call signature, but type '{1}' lacks one.", - Construct_signatures_of_types_0_and_1_are_incompatible: "Construct signatures of types '{0}' and '{1}' are incompatible.", - Construct_signatures_of_types_0_and_1_are_incompatible_NL_2: "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - Type_0_requires_a_construct_signature_but_type_1_lacks_one: "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - Index_signatures_of_types_0_and_1_are_incompatible: "Index signatures of types '{0}' and '{1}' are incompatible.", - Index_signatures_of_types_0_and_1_are_incompatible_NL_2: "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - Call_signature_expects_0_or_fewer_parameters: "Call signature expects {0} or fewer parameters.", - Could_not_apply_type_0_to_argument_1_which_is_of_type_2: "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - Types_of_static_property_0_of_class_1_and_class_2_are_incompatible: "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - Types_of_static_property_0_of_class_1_and_class_2_are_incompatible_NL_3: "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - Type_reference_cannot_refer_to_container_0: "Type reference cannot refer to container '{0}'.", - Type_reference_must_refer_to_type: "Type reference must refer to type.", - In_enums_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_the_first_enum_element: "In enums with multiple declarations only one declaration can omit an initializer for the first enum element.", - _0_overload_s: " (+ {0} overload(s))", - Variable_declaration_cannot_have_the_same_name_as_an_import_declaration: "Variable declaration cannot have the same name as an import declaration.", - Signature_expected_0_type_arguments_got_1_instead: "Signature expected {0} type arguments, got {1} instead.", - Property_0_defined_as_optional_in_type_1_but_is_required_in_type_2: "Property '{0}' defined as optional in type '{1}', but is required in type '{2}'.", - Types_0_and_1_originating_in_infinitely_expanding_type_reference_do_not_refer_to_same_named_type: "Types '{0}' and '{1}' originating in infinitely expanding type reference do not refer to same named type.", - Types_0_and_1_originating_in_infinitely_expanding_type_reference_have_incompatible_type_arguments: "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments.", - Types_0_and_1_originating_in_infinitely_expanding_type_reference_have_incompatible_type_arguments_NL_2: "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments:{NL}{2}", - Named_properties_0_of_types_1_and_2_are_not_identical: "Named properties '{0}' of types '{1}' and '{2}' are not identical.", - Types_of_string_indexer_of_types_0_and_1_are_not_identical: "Types of string indexer of types '{0}' and '{1}' are not identical.", - Types_of_number_indexer_of_types_0_and_1_are_not_identical: "Types of number indexer of types '{0}' and '{1}' are not identical.", - Type_of_number_indexer_in_type_0_is_not_assignable_to_string_indexer_type_in_type_1_NL_2: "Type of number indexer in type '{0}' is not assignable to string indexer type in type '{1}'.{NL}{2}", - Type_of_property_0_in_type_1_is_not_assignable_to_string_indexer_type_in_type_2_NL_3: "Type of property '{0}' in type '{1}' is not assignable to string indexer type in type '{2}'.{NL}{3}", - Type_of_property_0_in_type_1_is_not_assignable_to_number_indexer_type_in_type_2_NL_3: "Type of property '{0}' in type '{1}' is not assignable to number indexer type in type '{2}'.{NL}{3}", - Static_property_0_defined_as_private_in_type_1_is_defined_as_public_in_type_2: "Static property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - Static_property_0_defined_as_public_in_type_1_is_defined_as_private_in_type_2: "Static property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - Types_0_and_1_define_static_property_2_as_private: "Types '{0}' and '{1}' define static property '{2}' as private.", - Current_host_does_not_support_0_option: "Current host does not support '{0}' option.", - ECMAScript_target_version_0_not_supported_Specify_a_valid_target_version_1_default_or_2: "ECMAScript target version '{0}' not supported. Specify a valid target version: '{1}' (default), or '{2}'", - Argument_for_0_option_must_be_1_or_2: "Argument for '{0}' option must be '{1}' or '{2}'", - Could_not_find_file_0: "Could not find file: '{0}'.", - A_file_cannot_have_a_reference_to_itself: "A file cannot have a reference to itself.", - Cannot_resolve_referenced_file_0: "Cannot resolve referenced file: '{0}'.", - Cannot_find_the_common_subdirectory_path_for_the_input_files: "Cannot find the common subdirectory path for the input files.", - Emit_Error_0: "Emit Error: {0}.", - Cannot_read_file_0_1: "Cannot read file '{0}': {1}", - Unsupported_file_encoding: "Unsupported file encoding.", - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: "Locale must be of the form or -. For example '{0}' or '{1}'.", - Unsupported_locale_0: "Unsupported locale: '{0}'.", - Execution_Failed_NL: "Execution Failed.{NL}", - Invalid_call_to_up: "Invalid call to 'up'", - Invalid_call_to_down: "Invalid call to 'down'", - Base64_value_0_finished_with_a_continuation_bit: "Base64 value '{0}' finished with a continuation bit.", - Unknown_compiler_option_0: "Unknown compiler option '{0}'", - Expected_0_arguments_to_message_got_1_instead: "Expected {0} arguments to message, got {1} instead.", - Expected_the_message_0_to_have_1_arguments_but_it_had_2: "Expected the message '{0}' to have {1} arguments, but it had {2}", - Could_not_delete_file_0: "Could not delete file '{0}'", - Could_not_create_directory_0: "Could not create directory '{0}'", - Error_while_executing_file_0: "Error while executing file '{0}': ", - Cannot_compile_external_modules_unless_the_module_flag_is_provided: "Cannot compile external modules unless the '--module' flag is provided.", - Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: "Option mapRoot cannot be specified without specifying sourcemap option.", - Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: "Option sourceRoot cannot be specified without specifying sourcemap option.", - Options_mapRoot_and_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - Option_0_specified_without_1: "Option '{0}' specified without '{1}'", - codepage_option_not_supported_on_current_platform: "'codepage' option not supported on current platform.", - Concatenate_and_emit_output_to_single_file: "Concatenate and emit output to single file.", - Generates_corresponding_0_file: "Generates corresponding {0} file.", - Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: "Specifies the location where debugger should locate map files instead of generated locations.", - Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: "Specifies the location where debugger should locate TypeScript files instead of source locations.", - Watch_input_files: "Watch input files.", - Redirect_output_structure_to_the_directory: "Redirect output structure to the directory.", - Do_not_emit_comments_to_output: "Do not emit comments to output.", - Skip_resolution_and_preprocessing: "Skip resolution and preprocessing.", - Specify_ECMAScript_target_version_0_default_or_1: "Specify ECMAScript target version: '{0}' (default), or '{1}'", - Specify_module_code_generation_0_or_1: "Specify module code generation: '{0}' or '{1}'", - Print_this_message: "Print this message.", - Print_the_compiler_s_version_0: "Print the compiler's version: {0}", - Allow_use_of_deprecated_0_keyword_when_referencing_an_external_module: "Allow use of deprecated '{0}' keyword when referencing an external module.", - Specify_locale_for_errors_and_messages_For_example_0_or_1: "Specify locale for errors and messages. For example '{0}' or '{1}'", - Syntax_0: "Syntax: {0}", - options: "options", - file1: "file", - Examples: "Examples:", - Options: "Options:", - Insert_command_line_options_and_files_from_a_file: "Insert command line options and files from a file.", - Version_0: "Version {0}", - Use_the_0_flag_to_see_options: "Use the '{0}' flag to see options.", - NL_Recompiling_0: "{NL}Recompiling ({0}):", - STRING: "STRING", - KIND: "KIND", - file2: "FILE", - VERSION: "VERSION", - LOCATION: "LOCATION", - DIRECTORY: "DIRECTORY", - NUMBER: "NUMBER", - Specify_the_codepage_to_use_when_opening_source_files: "Specify the codepage to use when opening source files.", - Additional_locations: "Additional locations:", - This_version_of_the_Javascript_runtime_does_not_support_the_0_function: "This version of the Javascript runtime does not support the '{0}' function.", - Unknown_rule: "Unknown rule.", - Invalid_line_number_0: "Invalid line number ({0})", - Warn_on_expressions_and_declarations_with_an_implied_any_type: "Warn on expressions and declarations with an implied 'any' type.", - Variable_0_implicitly_has_an_any_type: "Variable '{0}' implicitly has an 'any' type.", - Parameter_0_of_1_implicitly_has_an_any_type: "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - Parameter_0_of_function_type_implicitly_has_an_any_type: "Parameter '{0}' of function type implicitly has an 'any' type.", - Member_0_of_object_type_implicitly_has_an_any_type: "Member '{0}' of object type implicitly has an 'any' type.", - new_expression_which_lacks_a_constructor_signature_implicitly_has_an_any_type: "'new' expression, which lacks a constructor signature, implicitly has an 'any' type.", - _0_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - Parameter_0_of_lambda_function_implicitly_has_an_any_type: "Parameter '{0}' of lambda function implicitly has an 'any' type.", - Constructor_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - Lambda_Function_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - Array_Literal_implicitly_has_an_any_type_from_widening: "Array Literal implicitly has an 'any' type from widening.", - _0_which_lacks_get_accessor_and_parameter_type_annotation_on_set_accessor_implicitly_has_an_any_type: "'{0}', which lacks 'get' accessor and parameter type annotation on 'set' accessor, implicitly has an 'any' type.", - Index_signature_of_object_type_implicitly_has_an_any_type: "Index signature of object type implicitly has an 'any' type.", - Object_literal_s_property_0_implicitly_has_an_any_type_from_widening: "Object literal's property '{0}' implicitly has an 'any' type from widening." - }; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (DiagnosticCategory) { - DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; - DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; - DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; - DiagnosticCategory[DiagnosticCategory["NoPrefix"] = 3] = "NoPrefix"; - })(TypeScript.DiagnosticCategory || (TypeScript.DiagnosticCategory = {})); - var DiagnosticCategory = TypeScript.DiagnosticCategory; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.diagnosticInformationMap = { - "error TS{0}: {1}": { "code": 0, "category": 3 /* NoPrefix */ }, - "warning TS{0}: {1}": { "code": 1, "category": 3 /* NoPrefix */ }, - "Unrecognized escape sequence.": { "code": 1000, "category": 1 /* Error */ }, - "Unexpected character {0}.": { "code": 1001, "category": 1 /* Error */ }, - "Missing close quote character.": { "code": 1002, "category": 1 /* Error */ }, - "Identifier expected.": { "code": 1003, "category": 1 /* Error */ }, - "'{0}' keyword expected.": { "code": 1004, "category": 1 /* Error */ }, - "'{0}' expected.": { "code": 1005, "category": 1 /* Error */ }, - "Identifier expected; '{0}' is a keyword.": { "code": 1006, "category": 1 /* Error */ }, - "Automatic semicolon insertion not allowed.": { "code": 1007, "category": 1 /* Error */ }, - "Unexpected token; '{0}' expected.": { "code": 1008, "category": 1 /* Error */ }, - "Trailing comma not allowed.": { "code": 1009, "category": 1 /* Error */ }, - "'*/' expected.": { "code": 1010, "category": 1 /* Error */ }, - "'public' or 'private' modifier must precede 'static'.": { "code": 1011, "category": 1 /* Error */ }, - "Unexpected token.": { "code": 1012, "category": 1 /* Error */ }, - "Catch clause parameter cannot have a type annotation.": { "code": 1013, "category": 1 /* Error */ }, - "A rest parameter must be last in a parameter list.": { "code": 1014, "category": 1 /* Error */ }, - "Parameter cannot have question mark and initializer.": { "code": 1015, "category": 1 /* Error */ }, - "A required parameter cannot follow an optional parameter.": { "code": 1016, "category": 1 /* Error */ }, - "Index signatures cannot have rest parameters.": { "code": 1017, "category": 1 /* Error */ }, - "Index signature parameter cannot have accessibility modifiers.": { "code": 1018, "category": 1 /* Error */ }, - "Index signature parameter cannot have a question mark.": { "code": 1019, "category": 1 /* Error */ }, - "Index signature parameter cannot have an initializer.": { "code": 1020, "category": 1 /* Error */ }, - "Index signature must have a type annotation.": { "code": 1021, "category": 1 /* Error */ }, - "Index signature parameter must have a type annotation.": { "code": 1022, "category": 1 /* Error */ }, - "Index signature parameter type must be 'string' or 'number'.": { "code": 1023, "category": 1 /* Error */ }, - "'extends' clause already seen.": { "code": 1024, "category": 1 /* Error */ }, - "'extends' clause must precede 'implements' clause.": { "code": 1025, "category": 1 /* Error */ }, - "Classes can only extend a single class.": { "code": 1026, "category": 1 /* Error */ }, - "'implements' clause already seen.": { "code": 1027, "category": 1 /* Error */ }, - "Accessibility modifier already seen.": { "code": 1028, "category": 1 /* Error */ }, - "'{0}' modifier must precede '{1}' modifier.": { "code": 1029, "category": 1 /* Error */ }, - "'{0}' modifier already seen.": { "code": 1030, "category": 1 /* Error */ }, - "'{0}' modifier cannot appear on a class element.": { "code": 1031, "category": 1 /* Error */ }, - "Interface declaration cannot have 'implements' clause.": { "code": 1032, "category": 1 /* Error */ }, - "'super' invocation cannot have type arguments.": { "code": 1034, "category": 1 /* Error */ }, - "Only ambient modules can use quoted names.": { "code": 1035, "category": 1 /* Error */ }, - "Statements are not allowed in ambient contexts.": { "code": 1036, "category": 1 /* Error */ }, - "A function implementation cannot be declared in an ambient context.": { "code": 1037, "category": 1 /* Error */ }, - "A 'declare' modifier cannot be used in an already ambient context.": { "code": 1038, "category": 1 /* Error */ }, - "Initializers are not allowed in ambient contexts.": { "code": 1039, "category": 1 /* Error */ }, - "'{0}' modifier cannot appear on a module element.": { "code": 1044, "category": 1 /* Error */ }, - "A 'declare' modifier cannot be used with an interface declaration.": { "code": 1045, "category": 1 /* Error */ }, - "A 'declare' modifier is required for a top level declaration in a .d.ts file.": { "code": 1046, "category": 1 /* Error */ }, - "A rest parameter cannot be optional.": { "code": 1047, "category": 1 /* Error */ }, - "A rest parameter cannot have an initializer.": { "code": 1048, "category": 1 /* Error */ }, - "'set' accessor must have exactly one parameter.": { "code": 1049, "category": 1 /* Error */ }, - "'set' accessor parameter cannot be optional.": { "code": 1051, "category": 1 /* Error */ }, - "'set' accessor parameter cannot have an initializer.": { "code": 1052, "category": 1 /* Error */ }, - "'set' accessor cannot have rest parameter.": { "code": 1053, "category": 1 /* Error */ }, - "'get' accessor cannot have parameters.": { "code": 1054, "category": 1 /* Error */ }, - "Modifiers cannot appear here.": { "code": 1055, "category": 1 /* Error */ }, - "Accessors are only available when targeting ECMAScript 5 and higher.": { "code": 1056, "category": 1 /* Error */ }, - "Enum member must have initializer.": { "code": 1061, "category": 1 /* Error */ }, - "Export assignment cannot be used in internal modules.": { "code": 1063, "category": 1 /* Error */ }, - "Ambient enum elements can only have integer literal initializers.": { "code": 1066, "category": 1 /* Error */ }, - "module, class, interface, enum, import or statement": { "code": 1067, "category": 3 /* NoPrefix */ }, - "constructor, function, accessor or variable": { "code": 1068, "category": 3 /* NoPrefix */ }, - "statement": { "code": 1069, "category": 3 /* NoPrefix */ }, - "case or default clause": { "code": 1070, "category": 3 /* NoPrefix */ }, - "identifier": { "code": 1071, "category": 3 /* NoPrefix */ }, - "call, construct, index, property or function signature": { "code": 1072, "category": 3 /* NoPrefix */ }, - "expression": { "code": 1073, "category": 3 /* NoPrefix */ }, - "type name": { "code": 1074, "category": 3 /* NoPrefix */ }, - "property or accessor": { "code": 1075, "category": 3 /* NoPrefix */ }, - "parameter": { "code": 1076, "category": 3 /* NoPrefix */ }, - "type": { "code": 1077, "category": 3 /* NoPrefix */ }, - "type parameter": { "code": 1078, "category": 3 /* NoPrefix */ }, - "A 'declare' modifier cannot be used with an import declaration.": { "code": 1079, "category": 1 /* Error */ }, - "Invalid 'reference' directive syntax.": { "code": 1084, "category": 1 /* Error */ }, - "Octal literals are not available when targeting ECMAScript 5 and higher.": { "code": 1085, "category": 1 /* Error */ }, - "Accessors are not allowed in ambient contexts.": { "code": 1086, "category": 1 /* Error */ }, - "'{0}' modifier cannot appear on a constructor declaration.": { "code": 1089, "category": 1 /* Error */ }, - "'{0}' modifier cannot appear on a parameter.": { "code": 1090, "category": 1 /* Error */ }, - "Only a single variable declaration is allowed in a 'for...in' statement.": { "code": 1091, "category": 1 /* Error */ }, - "Type parameters cannot appear on a constructor declaration.": { "code": 1092, "category": 1 /* Error */ }, - "Type annotation cannot appear on a constructor declaration.": { "code": 1093, "category": 1 /* Error */ }, - "Type parameters cannot appear on an accessor.": { "code": 1094, "category": 1 /* Error */ }, - "Type annotation cannot appear on a 'set' accessor.": { "code": 1095, "category": 1 /* Error */ }, - "Index signature must have exactly one parameter.": { "code": 1096, "category": 1 /* Error */ }, - "'{0}' list cannot be empty.": { "code": 1097, "category": 1 /* Error */ }, - "variable declaration": { "code": 1098, "category": 3 /* NoPrefix */ }, - "type argument": { "code": 1099, "category": 3 /* NoPrefix */ }, - "Invalid use of '{0}' in strict mode.": { "code": 1100, "category": 1 /* Error */ }, - "'with' statements are not allowed in strict mode.": { "code": 1101, "category": 1 /* Error */ }, - "'delete' cannot be called on an identifier in strict mode.": { "code": 1102, "category": 1 /* Error */ }, - "Invalid left-hand side in 'for...in' statement.": { "code": 1103, "category": 1 /* Error */ }, - "'continue' statement can only be used within an enclosing iteration statement.": { "code": 1104, "category": 1 /* Error */ }, - "'break' statement can only be used within an enclosing iteration or switch statement.": { "code": 1105, "category": 1 /* Error */ }, - "Jump target not found.": { "code": 1106, "category": 1 /* Error */ }, - "Jump target cannot cross function boundary.": { "code": 1107, "category": 1 /* Error */ }, - "'return' statement must be contained within a function body.": { "code": 1108, "category": 1 /* Error */ }, - "Expression expected.": { "code": 1109, "category": 1 /* Error */ }, - "Type expected.": { "code": 1110, "category": 1 /* Error */ }, - "Template literal cannot be used as an element name.": { "code": 1111, "category": 1 /* Error */ }, - "Duplicate identifier '{0}'.": { "code": 2000, "category": 1 /* Error */ }, - "The name '{0}' does not exist in the current scope.": { "code": 2001, "category": 1 /* Error */ }, - "The name '{0}' does not refer to a value.": { "code": 2002, "category": 1 /* Error */ }, - "'super' can only be used inside a class instance method.": { "code": 2003, "category": 1 /* Error */ }, - "The left-hand side of an assignment expression must be a variable, property or indexer.": { "code": 2004, "category": 1 /* Error */ }, - "Value of type '{0}' is not callable. Did you mean to include 'new'?": { "code": 2161, "category": 1 /* Error */ }, - "Value of type '{0}' is not callable.": { "code": 2006, "category": 1 /* Error */ }, - "Value of type '{0}' is not newable.": { "code": 2007, "category": 1 /* Error */ }, - "An index expression argument must be 'string', 'number', or 'any'.": { "code": 2008, "category": 1 /* Error */ }, - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": { "code": 2009, "category": 1 /* Error */ }, - "Type '{0}' is not assignable to type '{1}'.": { "code": 2011, "category": 1 /* Error */ }, - "Type '{0}' is not assignable to type '{1}':{NL}{2}": { "code": 2012, "category": 1 /* Error */ }, - "Expected var, class, interface, or module.": { "code": 2013, "category": 1 /* Error */ }, - "Getter '{0}' already declared.": { "code": 2015, "category": 1 /* Error */ }, - "Setter '{0}' already declared.": { "code": 2016, "category": 1 /* Error */ }, - "Exported class '{0}' extends private class '{1}'.": { "code": 2018, "category": 1 /* Error */ }, - "Exported class '{0}' implements private interface '{1}'.": { "code": 2019, "category": 1 /* Error */ }, - "Exported interface '{0}' extends private interface '{1}'.": { "code": 2020, "category": 1 /* Error */ }, - "Exported class '{0}' extends class from inaccessible module {1}.": { "code": 2021, "category": 1 /* Error */ }, - "Exported class '{0}' implements interface from inaccessible module {1}.": { "code": 2022, "category": 1 /* Error */ }, - "Exported interface '{0}' extends interface from inaccessible module {1}.": { "code": 2023, "category": 1 /* Error */ }, - "Public static property '{0}' of exported class has or is using private type '{1}'.": { "code": 2024, "category": 1 /* Error */ }, - "Public property '{0}' of exported class has or is using private type '{1}'.": { "code": 2025, "category": 1 /* Error */ }, - "Property '{0}' of exported interface has or is using private type '{1}'.": { "code": 2026, "category": 1 /* Error */ }, - "Exported variable '{0}' has or is using private type '{1}'.": { "code": 2027, "category": 1 /* Error */ }, - "Public static property '{0}' of exported class is using inaccessible module {1}.": { "code": 2028, "category": 1 /* Error */ }, - "Public property '{0}' of exported class is using inaccessible module {1}.": { "code": 2029, "category": 1 /* Error */ }, - "Property '{0}' of exported interface is using inaccessible module {1}.": { "code": 2030, "category": 1 /* Error */ }, - "Exported variable '{0}' is using inaccessible module {1}.": { "code": 2031, "category": 1 /* Error */ }, - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": { "code": 2032, "category": 1 /* Error */ }, - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": { "code": 2033, "category": 1 /* Error */ }, - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": { "code": 2034, "category": 1 /* Error */ }, - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": { "code": 2035, "category": 1 /* Error */ }, - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": { "code": 2036, "category": 1 /* Error */ }, - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": { "code": 2037, "category": 1 /* Error */ }, - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": { "code": 2038, "category": 1 /* Error */ }, - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": { "code": 2039, "category": 1 /* Error */ }, - "Parameter '{0}' of exported function has or is using private type '{1}'.": { "code": 2040, "category": 1 /* Error */ }, - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": { "code": 2041, "category": 1 /* Error */ }, - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": { "code": 2042, "category": 1 /* Error */ }, - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": { "code": 2043, "category": 1 /* Error */ }, - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": { "code": 2044, "category": 1 /* Error */ }, - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": { "code": 2045, "category": 1 /* Error */ }, - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": { "code": 2046, "category": 1 /* Error */ }, - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": { "code": 2047, "category": 1 /* Error */ }, - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": { "code": 2048, "category": 1 /* Error */ }, - "Parameter '{0}' of exported function is using inaccessible module {1}.": { "code": 2049, "category": 1 /* Error */ }, - "Return type of public static property getter from exported class has or is using private type '{0}'.": { "code": 2050, "category": 1 /* Error */ }, - "Return type of public property getter from exported class has or is using private type '{0}'.": { "code": 2051, "category": 1 /* Error */ }, - "Return type of constructor signature from exported interface has or is using private type '{0}'.": { "code": 2052, "category": 1 /* Error */ }, - "Return type of call signature from exported interface has or is using private type '{0}'.": { "code": 2053, "category": 1 /* Error */ }, - "Return type of index signature from exported interface has or is using private type '{0}'.": { "code": 2054, "category": 1 /* Error */ }, - "Return type of public static method from exported class has or is using private type '{0}'.": { "code": 2055, "category": 1 /* Error */ }, - "Return type of public method from exported class has or is using private type '{0}'.": { "code": 2056, "category": 1 /* Error */ }, - "Return type of method from exported interface has or is using private type '{0}'.": { "code": 2057, "category": 1 /* Error */ }, - "Return type of exported function has or is using private type '{0}'.": { "code": 2058, "category": 1 /* Error */ }, - "Return type of public static property getter from exported class is using inaccessible module {0}.": { "code": 2059, "category": 1 /* Error */ }, - "Return type of public property getter from exported class is using inaccessible module {0}.": { "code": 2060, "category": 1 /* Error */ }, - "Return type of constructor signature from exported interface is using inaccessible module {0}.": { "code": 2061, "category": 1 /* Error */ }, - "Return type of call signature from exported interface is using inaccessible module {0}.": { "code": 2062, "category": 1 /* Error */ }, - "Return type of index signature from exported interface is using inaccessible module {0}.": { "code": 2063, "category": 1 /* Error */ }, - "Return type of public static method from exported class is using inaccessible module {0}.": { "code": 2064, "category": 1 /* Error */ }, - "Return type of public method from exported class is using inaccessible module {0}.": { "code": 2065, "category": 1 /* Error */ }, - "Return type of method from exported interface is using inaccessible module {0}.": { "code": 2066, "category": 1 /* Error */ }, - "Return type of exported function is using inaccessible module {0}.": { "code": 2067, "category": 1 /* Error */ }, - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": { "code": 2068, "category": 1 /* Error */ }, - "A parameter list must follow a generic type argument list. '(' expected.": { "code": 2069, "category": 1 /* Error */ }, - "Multiple constructor implementations are not allowed.": { "code": 2070, "category": 1 /* Error */ }, - "Cannot find external module '{0}'.": { "code": 2071, "category": 1 /* Error */ }, - "Module cannot be aliased to a non-module type.": { "code": 2072, "category": 1 /* Error */ }, - "A class may only extend another class.": { "code": 2073, "category": 1 /* Error */ }, - "A class may only implement another class or interface.": { "code": 2074, "category": 1 /* Error */ }, - "An interface may only extend a class or another interface.": { "code": 2075, "category": 1 /* Error */ }, - "Unable to resolve type.": { "code": 2077, "category": 1 /* Error */ }, - "Unable to resolve type of '{0}'.": { "code": 2078, "category": 1 /* Error */ }, - "Unable to resolve type parameter constraint.": { "code": 2079, "category": 1 /* Error */ }, - "Type parameter constraint cannot be a primitive type.": { "code": 2080, "category": 1 /* Error */ }, - "Supplied parameters do not match any signature of call target.": { "code": 2081, "category": 1 /* Error */ }, - "Supplied parameters do not match any signature of call target:{NL}{0}": { "code": 2082, "category": 1 /* Error */ }, - "Cannot use 'new' with an expression whose type lacks a signature.": { "code": 2083, "category": 1 /* Error */ }, - "Only a void function can be called with the 'new' keyword.": { "code": 2084, "category": 1 /* Error */ }, - "Could not select overload for 'new' expression.": { "code": 2085, "category": 1 /* Error */ }, - "Type '{0}' does not satisfy the constraint '{1}'.": { "code": 2086, "category": 1 /* Error */ }, - "Could not select overload for 'call' expression.": { "code": 2087, "category": 1 /* Error */ }, - "Cannot invoke an expression whose type lacks a call signature.": { "code": 2088, "category": 1 /* Error */ }, - "Calls to 'super' are only valid inside a class.": { "code": 2089, "category": 1 /* Error */ }, - "Generic type '{0}' requires {1} type argument(s).": { "code": 2090, "category": 1 /* Error */ }, - "Type of array literal cannot be determined. Best common type could not be found for array elements.": { "code": 2092, "category": 1 /* Error */ }, - "Could not find enclosing symbol for dotted name '{0}'.": { "code": 2093, "category": 1 /* Error */ }, - "Property '{0}' does not exist on value of type '{1}'.": { "code": 2094, "category": 1 /* Error */ }, - "Cannot find name '{0}'.": { "code": 2095, "category": 1 /* Error */ }, - "'get' and 'set' accessor must have the same type.": { "code": 2096, "category": 1 /* Error */ }, - "'this' cannot be referenced in current location.": { "code": 2097, "category": 1 /* Error */ }, - "Static members cannot reference class type parameters.": { "code": 2099, "category": 1 /* Error */ }, - "Type '{0}' recursively references itself as a base type.": { "code": 2100, "category": 1 /* Error */ }, - "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class.": { "code": 2102, "category": 1 /* Error */ }, - "'super' can only be referenced in a derived class.": { "code": 2103, "category": 1 /* Error */ }, - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": { "code": 2104, "category": 1 /* Error */ }, - "Constructors for derived classes must contain a 'super' call.": { "code": 2105, "category": 1 /* Error */ }, - "Super calls are not permitted outside constructors or in nested functions inside constructors.": { "code": 2106, "category": 1 /* Error */ }, - "'{0}.{1}' is inaccessible.": { "code": 2107, "category": 1 /* Error */ }, - "'this' cannot be referenced in a module body.": { "code": 2108, "category": 1 /* Error */ }, - "Invalid '+' expression - types not known to support the addition operator.": { "code": 2111, "category": 1 /* Error */ }, - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { "code": 2112, "category": 1 /* Error */ }, - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { "code": 2113, "category": 1 /* Error */ }, - "An arithmetic operand must be of type 'any', 'number' or an enum type.": { "code": 2114, "category": 1 /* Error */ }, - "Variable declarations of a 'for' statement cannot use a type annotation.": { "code": 2115, "category": 1 /* Error */ }, - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": { "code": 2116, "category": 1 /* Error */ }, - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": { "code": 2117, "category": 1 /* Error */ }, - "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.": { "code": 2118, "category": 1 /* Error */ }, - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": { "code": 2119, "category": 1 /* Error */ }, - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": { "code": 2120, "category": 1 /* Error */ }, - "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type.": { "code": 2121, "category": 1 /* Error */ }, - "Setters cannot return a value.": { "code": 2122, "category": 1 /* Error */ }, - "Tried to query type of uninitialized module '{0}'.": { "code": 2123, "category": 1 /* Error */ }, - "Tried to set variable type to uninitialized module type '{0}'.": { "code": 2124, "category": 1 /* Error */ }, - "Type '{0}' is not generic.": { "code": 2125, "category": 1 /* Error */ }, - "Getters must return a value.": { "code": 2126, "category": 1 /* Error */ }, - "Getter and setter accessors do not agree in visibility.": { "code": 2127, "category": 1 /* Error */ }, - "Invalid left-hand side of assignment expression.": { "code": 2130, "category": 1 /* Error */ }, - "Function declared a non-void return type, but has no return expression.": { "code": 2131, "category": 1 /* Error */ }, - "Cannot resolve return type reference.": { "code": 2132, "category": 1 /* Error */ }, - "Constructors cannot have a return type of 'void'.": { "code": 2133, "category": 1 /* Error */ }, - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": { "code": 2134, "category": 1 /* Error */ }, - "All symbols within a with block will be resolved to 'any'.": { "code": 2135, "category": 1 /* Error */ }, - "Import declarations in an internal module cannot reference an external module.": { "code": 2136, "category": 1 /* Error */ }, - "Class {0} declares interface {1} but does not implement it:{NL}{2}": { "code": 2137, "category": 1 /* Error */ }, - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": { "code": 2138, "category": 1 /* Error */ }, - "The operand of an increment or decrement operator must be a variable, property or indexer.": { "code": 2139, "category": 1 /* Error */ }, - "'this' cannot be referenced in a static property initializer.": { "code": 2140, "category": 1 /* Error */ }, - "Class '{0}' cannot extend class '{1}':{NL}{2}": { "code": 2141, "category": 1 /* Error */ }, - "Interface '{0}' cannot extend class '{1}':{NL}{2}": { "code": 2142, "category": 1 /* Error */ }, - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": { "code": 2143, "category": 1 /* Error */ }, - "Overload signature is not compatible with function definition.": { "code": 2148, "category": 1 /* Error */ }, - "Overload signature is not compatible with function definition:{NL}{0}": { "code": 2149, "category": 1 /* Error */ }, - "Overload signatures must all be public or private.": { "code": 2150, "category": 1 /* Error */ }, - "Overload signatures must all be exported or not exported.": { "code": 2151, "category": 1 /* Error */ }, - "Overload signatures must all be ambient or non-ambient.": { "code": 2152, "category": 1 /* Error */ }, - "Overload signatures must all be optional or required.": { "code": 2153, "category": 1 /* Error */ }, - "Specialized overload signature is not assignable to any non-specialized signature.": { "code": 2154, "category": 1 /* Error */ }, - "'this' cannot be referenced in constructor arguments.": { "code": 2155, "category": 1 /* Error */ }, - "Instance member cannot be accessed off a class.": { "code": 2157, "category": 1 /* Error */ }, - "Untyped function calls may not accept type arguments.": { "code": 2158, "category": 1 /* Error */ }, - "Non-generic functions may not accept type arguments.": { "code": 2159, "category": 1 /* Error */ }, - "A generic type may not reference itself with a wrapped form of its own type parameters.": { "code": 2160, "category": 1 /* Error */ }, - "A rest parameter must be of an array type.": { "code": 2162, "category": 1 /* Error */ }, - "Overload signature implementation cannot use specialized type.": { "code": 2163, "category": 1 /* Error */ }, - "Export assignments may only be used at the top-level of external modules.": { "code": 2164, "category": 1 /* Error */ }, - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules.": { "code": 2165, "category": 1 /* Error */ }, - "Only public methods of the base class are accessible via the 'super' keyword.": { "code": 2166, "category": 1 /* Error */ }, - "Numeric indexer type '{0}' must be assignable to string indexer type '{1}'.": { "code": 2167, "category": 1 /* Error */ }, - "Numeric indexer type '{0}' must be assignable to string indexer type '{1}':{NL}{2}": { "code": 2168, "category": 1 /* Error */ }, - "All numerically named properties must be assignable to numeric indexer type '{0}'.": { "code": 2169, "category": 1 /* Error */ }, - "All numerically named properties must be assignable to numeric indexer type '{0}':{NL}{1}": { "code": 2170, "category": 1 /* Error */ }, - "All named properties must be assignable to string indexer type '{0}'.": { "code": 2171, "category": 1 /* Error */ }, - "All named properties must be assignable to string indexer type '{0}':{NL}{1}": { "code": 2172, "category": 1 /* Error */ }, - "A parameter initializer is only allowed in a function or constructor implementation.": { "code": 2174, "category": 1 /* Error */ }, - "Function expression declared a non-void return type, but has no return expression.": { "code": 2176, "category": 1 /* Error */ }, - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": { "code": 2177, "category": 1 /* Error */ }, - "Module '{0}' has no exported member '{1}'.": { "code": 2178, "category": 1 /* Error */ }, - "Unable to resolve module reference '{0}'.": { "code": 2179, "category": 1 /* Error */ }, - "Could not find module '{0}' in module '{1}'.": { "code": 2180, "category": 1 /* Error */ }, - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": { "code": 2181, "category": 1 /* Error */ }, - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": { "code": 2182, "category": 1 /* Error */ }, - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": { "code": 2183, "category": 1 /* Error */ }, - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": { "code": 2184, "category": 1 /* Error */ }, - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": { "code": 2185, "category": 1 /* Error */ }, - "Type name '{0}' in extends clause does not reference constructor function for '{1}'.": { "code": 2186, "category": 1 /* Error */ }, - "Internal module reference '{0}' in import declaration does not reference module instance for '{1}'.": { "code": 2187, "category": 1 /* Error */ }, - "Module '{0}' cannot merge with previous declaration of '{1}' in a different file '{2}'.": { "code": 2188, "category": 1 /* Error */ }, - "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':{NL}{3}": { "code": 2189, "category": 1 /* Error */ }, - "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it.": { "code": 2190, "category": 1 /* Error */ }, - "Ambient external module declaration cannot be reopened.": { "code": 2191, "category": 1 /* Error */ }, - "All declarations of merged declaration '{0}' must be exported or not exported.": { "code": 2192, "category": 1 /* Error */ }, - "'super' cannot be referenced in constructor arguments.": { "code": 2193, "category": 1 /* Error */ }, - "Return type of constructor signature must be assignable to the instance type of the class.": { "code": 2194, "category": 1 /* Error */ }, - "Ambient external module declaration must be defined in global context.": { "code": 2195, "category": 1 /* Error */ }, - "Ambient external module declaration cannot specify relative module name.": { "code": 2196, "category": 1 /* Error */ }, - "Import declaration in an ambient external module declaration cannot reference external module through relative external module name.": { "code": 2197, "category": 1 /* Error */ }, - "No best common type exists among return expressions.": { "code": 2198, "category": 1 /* Error */ }, - "Import declaration cannot refer to external module reference when --noResolve option is set.": { "code": 2199, "category": 1 /* Error */ }, - "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.": { "code": 2200, "category": 1 /* Error */ }, - "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.": { "code": 2205, "category": 1 /* Error */ }, - "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference.": { "code": 2206, "category": 1 /* Error */ }, - "Expression resolves to '_super' that compiler uses to capture base class reference.": { "code": 2207, "category": 1 /* Error */ }, - "TypeParameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": { "code": 2208, "category": 1 /* Error */ }, - "TypeParameter '{0}' of call signature from exported interface has or is using private type '{1}'.": { "code": 2209, "category": 1 /* Error */ }, - "TypeParameter '{0}' of public static method from exported class has or is using private type '{1}'.": { "code": 2210, "category": 1 /* Error */ }, - "TypeParameter '{0}' of public method from exported class has or is using private type '{1}'.": { "code": 2211, "category": 1 /* Error */ }, - "TypeParameter '{0}' of method from exported interface has or is using private type '{1}'.": { "code": 2212, "category": 1 /* Error */ }, - "TypeParameter '{0}' of exported function has or is using private type '{1}'.": { "code": 2213, "category": 1 /* Error */ }, - "TypeParameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": { "code": 2214, "category": 1 /* Error */ }, - "TypeParameter '{0}' of call signature from exported interface is using inaccessible module {1}": { "code": 2215, "category": 1 /* Error */ }, - "TypeParameter '{0}' of public static method from exported class is using inaccessible module {1}.": { "code": 2216, "category": 1 /* Error */ }, - "TypeParameter '{0}' of public method from exported class is using inaccessible module {1}.": { "code": 2217, "category": 1 /* Error */ }, - "TypeParameter '{0}' of method from exported interface is using inaccessible module {1}.": { "code": 2218, "category": 1 /* Error */ }, - "TypeParameter '{0}' of exported function is using inaccessible module {1}.": { "code": 2219, "category": 1 /* Error */ }, - "TypeParameter '{0}' of exported class has or is using private type '{1}'.": { "code": 2220, "category": 1 /* Error */ }, - "TypeParameter '{0}' of exported interface has or is using private type '{1}'.": { "code": 2221, "category": 1 /* Error */ }, - "TypeParameter '{0}' of exported class is using inaccessible module {1}.": { "code": 2222, "category": 1 /* Error */ }, - "TypeParameter '{0}' of exported interface is using inaccessible module {1}.": { "code": 2223, "category": 1 /* Error */ }, - "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter.": { "code": 2224, "category": 1 /* Error */ }, - "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.": { "code": 2225, "category": 1 /* Error */ }, - "No best common type exists between '{0}' and '{1}'.": { "code": 2226, "category": 1 /* Error */ }, - "No best common type exists between '{0}', '{1}', and '{2}'.": { "code": 2227, "category": 1 /* Error */ }, - "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module.": { "code": 2228, "category": 1 /* Error */ }, - "Constraint of a type parameter cannot reference any type parameter from the same type parameter list.": { "code": 2229, "category": 1 /* Error */ }, - "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.": { "code": 2230, "category": 1 /* Error */ }, - "Parameter '{0}' cannot be referenced in its initializer.": { "code": 2231, "category": 1 /* Error */ }, - "Duplicate string index signature.": { "code": 2232, "category": 1 /* Error */ }, - "Duplicate number index signature.": { "code": 2233, "category": 1 /* Error */ }, - "All declarations of an interface must have identical type parameters.": { "code": 2234, "category": 1 /* Error */ }, - "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter.": { "code": 2235, "category": 1 /* Error */ }, - "Neither type '{0}' nor type '{1}' is assignable to the other.": { "code": 2236, "category": 1 /* Error */ }, - "Neither type '{0}' nor type '{1}' is assignable to the other:{NL}{2}": { "code": 2237, "category": 1 /* Error */ }, - "Duplicate function implementation.": { "code": 2237, "category": 1 /* Error */ }, - "Function implementation expected.": { "code": 2238, "category": 1 /* Error */ }, - "Function overload name must be '{0}'.": { "code": 2239, "category": 1 /* Error */ }, - "Constructor implementation expected.": { "code": 2240, "category": 1 /* Error */ }, - "Class name cannot be '{0}'.": { "code": 2241, "category": 1 /* Error */ }, - "Interface name cannot be '{0}'.": { "code": 2242, "category": 1 /* Error */ }, - "Enum name cannot be '{0}'.": { "code": 2243, "category": 1 /* Error */ }, - "A module cannot have multiple export assignments.": { "code": 2244, "category": 1 /* Error */ }, - "Export assignment not allowed in module with exported element.": { "code": 2245, "category": 1 /* Error */ }, - "A parameter property is only allowed in a constructor implementation.": { "code": 2246, "category": 1 /* Error */ }, - "Function overload must be static.": { "code": 2247, "category": 1 /* Error */ }, - "Function overload must not be static.": { "code": 2248, "category": 1 /* Error */ }, - "Type '{0}' is missing property '{1}' from type '{2}'.": { "code": 4000, "category": 3 /* NoPrefix */ }, - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": { "code": 4001, "category": 3 /* NoPrefix */ }, - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": { "code": 4002, "category": 3 /* NoPrefix */ }, - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": { "code": 4003, "category": 3 /* NoPrefix */ }, - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": { "code": 4004, "category": 3 /* NoPrefix */ }, - "Types '{0}' and '{1}' define property '{2}' as private.": { "code": 4005, "category": 3 /* NoPrefix */ }, - "Call signatures of types '{0}' and '{1}' are incompatible.": { "code": 4006, "category": 3 /* NoPrefix */ }, - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": { "code": 4007, "category": 3 /* NoPrefix */ }, - "Type '{0}' requires a call signature, but type '{1}' lacks one.": { "code": 4008, "category": 3 /* NoPrefix */ }, - "Construct signatures of types '{0}' and '{1}' are incompatible.": { "code": 4009, "category": 3 /* NoPrefix */ }, - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": { "code": 4010, "category": 3 /* NoPrefix */ }, - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": { "code": 4011, "category": 3 /* NoPrefix */ }, - "Index signatures of types '{0}' and '{1}' are incompatible.": { "code": 4012, "category": 3 /* NoPrefix */ }, - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": { "code": 4013, "category": 3 /* NoPrefix */ }, - "Call signature expects {0} or fewer parameters.": { "code": 4014, "category": 3 /* NoPrefix */ }, - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": { "code": 4015, "category": 3 /* NoPrefix */ }, - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": { "code": 4016, "category": 3 /* NoPrefix */ }, - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": { "code": 4017, "category": 3 /* NoPrefix */ }, - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": { "code": 4018, "category": 3 /* NoPrefix */ }, - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": { "code": 4019, "category": 3 /* NoPrefix */ }, - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": { "code": 4020, "category": 3 /* NoPrefix */ }, - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": { "code": 4021, "category": 3 /* NoPrefix */ }, - "Type reference cannot refer to container '{0}'.": { "code": 4022, "category": 1 /* Error */ }, - "Type reference must refer to type.": { "code": 4023, "category": 1 /* Error */ }, - "In enums with multiple declarations only one declaration can omit an initializer for the first enum element.": { "code": 4024, "category": 1 /* Error */ }, - " (+ {0} overload(s))": { "code": 4025, "category": 2 /* Message */ }, - "Variable declaration cannot have the same name as an import declaration.": { "code": 4026, "category": 1 /* Error */ }, - "Signature expected {0} type arguments, got {1} instead.": { "code": 4027, "category": 1 /* Error */ }, - "Property '{0}' defined as optional in type '{1}', but is required in type '{2}'.": { "code": 4028, "category": 3 /* NoPrefix */ }, - "Types '{0}' and '{1}' originating in infinitely expanding type reference do not refer to same named type.": { "code": 4029, "category": 3 /* NoPrefix */ }, - "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments.": { "code": 4030, "category": 3 /* NoPrefix */ }, - "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments:{NL}{2}": { "code": 4031, "category": 3 /* NoPrefix */ }, - "Named properties '{0}' of types '{1}' and '{2}' are not identical.": { "code": 4032, "category": 3 /* NoPrefix */ }, - "Types of string indexer of types '{0}' and '{1}' are not identical.": { "code": 4033, "category": 3 /* NoPrefix */ }, - "Types of number indexer of types '{0}' and '{1}' are not identical.": { "code": 4034, "category": 3 /* NoPrefix */ }, - "Type of number indexer in type '{0}' is not assignable to string indexer type in type '{1}'.{NL}{2}": { "code": 4035, "category": 3 /* NoPrefix */ }, - "Type of property '{0}' in type '{1}' is not assignable to string indexer type in type '{2}'.{NL}{3}": { "code": 4036, "category": 3 /* NoPrefix */ }, - "Type of property '{0}' in type '{1}' is not assignable to number indexer type in type '{2}'.{NL}{3}": { "code": 4037, "category": 3 /* NoPrefix */ }, - "Static property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": { "code": 4038, "category": 3 /* NoPrefix */ }, - "Static property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": { "code": 4039, "category": 3 /* NoPrefix */ }, - "Types '{0}' and '{1}' define static property '{2}' as private.": { "code": 4040, "category": 3 /* NoPrefix */ }, - "Current host does not support '{0}' option.": { "code": 5001, "category": 1 /* Error */ }, - "ECMAScript target version '{0}' not supported. Specify a valid target version: '{1}' (default), or '{2}'": { "code": 5002, "category": 1 /* Error */ }, - "Argument for '{0}' option must be '{1}' or '{2}'": { "code": 5003, "category": 1 /* Error */ }, - "Could not find file: '{0}'.": { "code": 5004, "category": 1 /* Error */ }, - "A file cannot have a reference to itself.": { "code": 5006, "category": 1 /* Error */ }, - "Cannot resolve referenced file: '{0}'.": { "code": 5007, "category": 1 /* Error */ }, - "Cannot find the common subdirectory path for the input files.": { "code": 5009, "category": 1 /* Error */ }, - "Emit Error: {0}.": { "code": 5011, "category": 1 /* Error */ }, - "Cannot read file '{0}': {1}": { "code": 5012, "category": 1 /* Error */ }, - "Unsupported file encoding.": { "code": 5013, "category": 3 /* NoPrefix */ }, - "Locale must be of the form or -. For example '{0}' or '{1}'.": { "code": 5014, "category": 1 /* Error */ }, - "Unsupported locale: '{0}'.": { "code": 5015, "category": 1 /* Error */ }, - "Execution Failed.{NL}": { "code": 5016, "category": 1 /* Error */ }, - "Invalid call to 'up'": { "code": 5019, "category": 1 /* Error */ }, - "Invalid call to 'down'": { "code": 5020, "category": 1 /* Error */ }, - "Base64 value '{0}' finished with a continuation bit.": { "code": 5021, "category": 1 /* Error */ }, - "Unknown compiler option '{0}'": { "code": 5023, "category": 1 /* Error */ }, - "Expected {0} arguments to message, got {1} instead.": { "code": 5024, "category": 1 /* Error */ }, - "Expected the message '{0}' to have {1} arguments, but it had {2}": { "code": 5025, "category": 1 /* Error */ }, - "Could not delete file '{0}'": { "code": 5034, "category": 1 /* Error */ }, - "Could not create directory '{0}'": { "code": 5035, "category": 1 /* Error */ }, - "Error while executing file '{0}': ": { "code": 5036, "category": 1 /* Error */ }, - "Cannot compile external modules unless the '--module' flag is provided.": { "code": 5037, "category": 1 /* Error */ }, - "Option mapRoot cannot be specified without specifying sourcemap option.": { "code": 5038, "category": 1 /* Error */ }, - "Option sourceRoot cannot be specified without specifying sourcemap option.": { "code": 5039, "category": 1 /* Error */ }, - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": { "code": 5040, "category": 1 /* Error */ }, - "Option '{0}' specified without '{1}'": { "code": 5041, "category": 1 /* Error */ }, - "'codepage' option not supported on current platform.": { "code": 5042, "category": 1 /* Error */ }, - "Concatenate and emit output to single file.": { "code": 6001, "category": 2 /* Message */ }, - "Generates corresponding {0} file.": { "code": 6002, "category": 2 /* Message */ }, - "Specifies the location where debugger should locate map files instead of generated locations.": { "code": 6003, "category": 2 /* Message */ }, - "Specifies the location where debugger should locate TypeScript files instead of source locations.": { "code": 6004, "category": 2 /* Message */ }, - "Watch input files.": { "code": 6005, "category": 2 /* Message */ }, - "Redirect output structure to the directory.": { "code": 6006, "category": 2 /* Message */ }, - "Do not emit comments to output.": { "code": 6009, "category": 2 /* Message */ }, - "Skip resolution and preprocessing.": { "code": 6010, "category": 2 /* Message */ }, - "Specify ECMAScript target version: '{0}' (default), or '{1}'": { "code": 6015, "category": 2 /* Message */ }, - "Specify module code generation: '{0}' or '{1}'": { "code": 6016, "category": 2 /* Message */ }, - "Print this message.": { "code": 6017, "category": 2 /* Message */ }, - "Print the compiler's version: {0}": { "code": 6019, "category": 2 /* Message */ }, - "Allow use of deprecated '{0}' keyword when referencing an external module.": { "code": 6021, "category": 2 /* Message */ }, - "Specify locale for errors and messages. For example '{0}' or '{1}'": { "code": 6022, "category": 2 /* Message */ }, - "Syntax: {0}": { "code": 6023, "category": 2 /* Message */ }, - "options": { "code": 6024, "category": 2 /* Message */ }, - "file1": { "code": 6025, "category": 2 /* Message */ }, - "Examples:": { "code": 6026, "category": 2 /* Message */ }, - "Options:": { "code": 6027, "category": 2 /* Message */ }, - "Insert command line options and files from a file.": { "code": 6030, "category": 2 /* Message */ }, - "Version {0}": { "code": 6029, "category": 2 /* Message */ }, - "Use the '{0}' flag to see options.": { "code": 6031, "category": 2 /* Message */ }, - "{NL}Recompiling ({0}):": { "code": 6032, "category": 2 /* Message */ }, - "STRING": { "code": 6033, "category": 2 /* Message */ }, - "KIND": { "code": 6034, "category": 2 /* Message */ }, - "file2": { "code": 6035, "category": 2 /* Message */ }, - "VERSION": { "code": 6036, "category": 2 /* Message */ }, - "LOCATION": { "code": 6037, "category": 2 /* Message */ }, - "DIRECTORY": { "code": 6038, "category": 2 /* Message */ }, - "NUMBER": { "code": 6039, "category": 2 /* Message */ }, - "Specify the codepage to use when opening source files.": { "code": 6040, "category": 2 /* Message */ }, - "Additional locations:": { "code": 6041, "category": 2 /* Message */ }, - "This version of the Javascript runtime does not support the '{0}' function.": { "code": 7000, "category": 1 /* Error */ }, - "Unknown rule.": { "code": 7002, "category": 1 /* Error */ }, - "Invalid line number ({0})": { "code": 7003, "category": 1 /* Error */ }, - "Warn on expressions and declarations with an implied 'any' type.": { "code": 7004, "category": 2 /* Message */ }, - "Variable '{0}' implicitly has an 'any' type.": { "code": 7005, "category": 1 /* Error */ }, - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": { "code": 7006, "category": 1 /* Error */ }, - "Parameter '{0}' of function type implicitly has an 'any' type.": { "code": 7007, "category": 1 /* Error */ }, - "Member '{0}' of object type implicitly has an 'any' type.": { "code": 7008, "category": 1 /* Error */ }, - "'new' expression, which lacks a constructor signature, implicitly has an 'any' type.": { "code": 7009, "category": 1 /* Error */ }, - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": { "code": 7010, "category": 1 /* Error */ }, - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": { "code": 7011, "category": 1 /* Error */ }, - "Parameter '{0}' of lambda function implicitly has an 'any' type.": { "code": 7012, "category": 1 /* Error */ }, - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": { "code": 7013, "category": 1 /* Error */ }, - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": { "code": 7014, "category": 1 /* Error */ }, - "Array Literal implicitly has an 'any' type from widening.": { "code": 7015, "category": 1 /* Error */ }, - "'{0}', which lacks 'get' accessor and parameter type annotation on 'set' accessor, implicitly has an 'any' type.": { "code": 7016, "category": 1 /* Error */ }, - "Index signature of object type implicitly has an 'any' type.": { "code": 7017, "category": 1 /* Error */ }, - "Object literal's property '{0}' implicitly has an 'any' type from widening.": { "code": 7018, "category": 1 /* Error */ } - }; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ArrayUtilities = (function () { - function ArrayUtilities() { - } - ArrayUtilities.sequenceEquals = function (array1, array2, equals) { - if (array1 === array2) { - return true; - } - if (!array1 || !array2) { - return false; - } - if (array1.length !== array2.length) { - return false; - } - for (var i = 0, n = array1.length; i < n; i++) { - if (!equals(array1[i], array2[i])) { - return false; - } - } - return true; - }; - ArrayUtilities.contains = function (array, value) { - for (var i = 0; i < array.length; i++) { - if (array[i] === value) { - return true; - } - } - return false; - }; - ArrayUtilities.distinct = function (array, equalsFn) { - var result = []; - for (var i = 0, n = array.length; i < n; i++) { - var current = array[i]; - for (var j = 0; j < result.length; j++) { - if (equalsFn(result[j], current)) { - break; - } - } - if (j === result.length) { - result.push(current); - } - } - return result; - }; - ArrayUtilities.last = function (array) { - if (array.length === 0) { - throw TypeScript.Errors.argumentOutOfRange('array'); - } - return array[array.length - 1]; - }; - ArrayUtilities.lastOrDefault = function (array, predicate) { - for (var i = array.length - 1; i >= 0; i--) { - var v = array[i]; - if (predicate(v, i)) { - return v; - } - } - return undefined; - }; - ArrayUtilities.firstOrDefault = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - var value = array[i]; - if (func(value, i)) { - return value; - } - } - return undefined; - }; - ArrayUtilities.first = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - var value = array[i]; - if (!func || func(value, i)) { - return value; - } - } - throw TypeScript.Errors.invalidOperation(); - }; - ArrayUtilities.sum = function (array, func) { - var result = 0; - for (var i = 0, n = array.length; i < n; i++) { - result += func(array[i]); - } - return result; - }; - ArrayUtilities.select = function (values, func) { - var result = new Array(values.length); - for (var i = 0; i < values.length; i++) { - result[i] = func(values[i]); - } - return result; - }; - ArrayUtilities.where = function (values, func) { - var result = new Array(); - for (var i = 0; i < values.length; i++) { - if (func(values[i])) { - result.push(values[i]); - } - } - return result; - }; - ArrayUtilities.any = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - if (func(array[i])) { - return true; - } - } - return false; - }; - ArrayUtilities.all = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - if (!func(array[i])) { - return false; - } - } - return true; - }; - ArrayUtilities.binarySearch = function (array, value) { - var low = 0; - var high = array.length - 1; - while (low <= high) { - var middle = low + ((high - low) >> 1); - var midValue = array[middle]; - if (midValue === value) { - return middle; - } - else if (midValue > value) { - high = middle - 1; - } - else { - low = middle + 1; - } - } - return ~low; - }; - ArrayUtilities.createArray = function (length, defaultValue) { - var result = new Array(length); - for (var i = 0; i < length; i++) { - result[i] = defaultValue; - } - return result; - }; - ArrayUtilities.grow = function (array, length, defaultValue) { - var count = length - array.length; - for (var i = 0; i < count; i++) { - array.push(defaultValue); - } - }; - ArrayUtilities.copy = function (sourceArray, sourceIndex, destinationArray, destinationIndex, length) { - for (var i = 0; i < length; i++) { - destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i]; - } - }; - ArrayUtilities.indexOf = function (array, predicate) { - for (var i = 0, n = array.length; i < n; i++) { - if (predicate(array[i])) { - return i; - } - } - return -1; - }; - return ArrayUtilities; - })(); - TypeScript.ArrayUtilities = ArrayUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (AssertionLevel) { - AssertionLevel[AssertionLevel["None"] = 0] = "None"; - AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; - AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; - AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; - })(TypeScript.AssertionLevel || (TypeScript.AssertionLevel = {})); - var AssertionLevel = TypeScript.AssertionLevel; - var Debug = (function () { - function Debug() { - } - Debug.shouldAssert = function (level) { - return this.currentAssertionLevel >= level; - }; - Debug.assert = function (expression, message, verboseDebugInfo) { - if (!expression) { - var verboseDebugString = ""; - if (verboseDebugInfo) { - verboseDebugString = "\r\nVerbose Debug Information:" + verboseDebugInfo(); - } - message = message || ""; - throw new Error("Debug Failure. False expression: " + message + verboseDebugString); - } - }; - Debug.fail = function (message) { - Debug.assert(false, message); - }; - Debug.currentAssertionLevel = 0 /* None */; - return Debug; - })(); - TypeScript.Debug = Debug; -})(TypeScript || (TypeScript = {})); -var __extends = this.__extends || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); -}; -var TypeScript; -(function (TypeScript) { - var Location = (function () { - function Location(fileName, lineMap, start, length) { - this._fileName = fileName; - this._lineMap = lineMap; - this._start = start; - this._length = length; - } - Location.prototype.fileName = function () { - return this._fileName; - }; - Location.prototype.lineMap = function () { - return this._lineMap; - }; - Location.prototype.line = function () { - return this._lineMap ? this._lineMap.getLineNumberFromPosition(this.start()) : 0; - }; - Location.prototype.character = function () { - return this._lineMap ? this._lineMap.getLineAndCharacterFromPosition(this.start()).character() : 0; - }; - Location.prototype.start = function () { - return this._start; - }; - Location.prototype.length = function () { - return this._length; - }; - Location.equals = function (location1, location2) { - return location1._fileName === location2._fileName && location1._start === location2._start && location1._length === location2._length; - }; - return Location; - })(); - TypeScript.Location = Location; - var Diagnostic = (function (_super) { - __extends(Diagnostic, _super); - function Diagnostic(fileName, lineMap, start, length, diagnosticKey, _arguments, additionalLocations) { - _super.call(this, fileName, lineMap, start, length); - this._diagnosticKey = diagnosticKey; - this._arguments = (_arguments && _arguments.length > 0) ? _arguments : undefined; - this._additionalLocations = (additionalLocations && additionalLocations.length > 0) ? additionalLocations : undefined; - } - Diagnostic.prototype.toJSON = function (key) { - var result = {}; - result.start = this.start(); - result.length = this.length(); - result.diagnosticCode = this._diagnosticKey; - var _arguments = this.arguments(); - if (_arguments && _arguments.length > 0) { - result.arguments = _arguments; - } - return result; - }; - Diagnostic.prototype.diagnosticKey = function () { - return this._diagnosticKey; - }; - Diagnostic.prototype.arguments = function () { - return this._arguments; - }; - Diagnostic.prototype.text = function () { - return TypeScript.getLocalizedText(this._diagnosticKey, this._arguments); - }; - Diagnostic.prototype.message = function () { - return TypeScript.getDiagnosticMessage(this._diagnosticKey, this._arguments); - }; - Diagnostic.prototype.additionalLocations = function () { - return this._additionalLocations || []; - }; - Diagnostic.equals = function (diagnostic1, diagnostic2) { - return Location.equals(diagnostic1, diagnostic2) && diagnostic1._diagnosticKey === diagnostic2._diagnosticKey && TypeScript.ArrayUtilities.sequenceEquals(diagnostic1._arguments, diagnostic2._arguments, function (v1, v2) { return v1 === v2; }); - }; - Diagnostic.prototype.info = function () { - return getDiagnosticInfoFromKey(this.diagnosticKey()); - }; - return Diagnostic; - })(Location); - TypeScript.Diagnostic = Diagnostic; - function newLine() { - return "\r\n"; - } - TypeScript.newLine = newLine; - function getLargestIndex(diagnostic) { - var largest = -1; - var regex = /\{(\d+)\}/g; - var match; - while (match = regex.exec(diagnostic)) { - var val = parseInt(match[1]); - if (!isNaN(val) && val > largest) { - largest = val; - } - } - return largest; - } - function getDiagnosticInfoFromKey(diagnosticKey) { - var result = TypeScript.diagnosticInformationMap[diagnosticKey]; - TypeScript.Debug.assert(result); - return result; - } - function getLocalizedText(diagnosticKey, args) { - var diagnosticMessageText = diagnosticKey; - TypeScript.Debug.assert(diagnosticMessageText !== undefined && diagnosticMessageText !== null); - var actualCount = args ? args.length : 0; - var expectedCount = 1 + getLargestIndex(diagnosticKey); - if (expectedCount !== actualCount) { - throw new Error(getLocalizedText(TypeScript.DiagnosticCode.Expected_0_arguments_to_message_got_1_instead, [expectedCount, actualCount])); - } - var valueCount = 1 + getLargestIndex(diagnosticMessageText); - if (valueCount !== expectedCount) { - throw new Error(getLocalizedText(TypeScript.DiagnosticCode.Expected_the_message_0_to_have_1_arguments_but_it_had_2, [diagnosticMessageText, expectedCount, valueCount])); - } - diagnosticMessageText = diagnosticMessageText.replace(/{(\d+)}/g, function (match, num) { - return typeof args[num] !== 'undefined' ? args[num] : match; - }); - diagnosticMessageText = diagnosticMessageText.replace(/{(NL)}/g, function (match) { - return TypeScript.newLine(); - }); - return diagnosticMessageText; - } - TypeScript.getLocalizedText = getLocalizedText; - function getDiagnosticMessage(diagnosticKey, args) { - var diagnostic = getDiagnosticInfoFromKey(diagnosticKey); - var diagnosticMessageText = getLocalizedText(diagnosticKey, args); - var message; - if (diagnostic.category === 1 /* Error */) { - message = getLocalizedText(TypeScript.DiagnosticCode.error_TS_0_1, [diagnostic.code, diagnosticMessageText]); - } - else if (diagnostic.category === 0 /* Warning */) { - message = getLocalizedText(TypeScript.DiagnosticCode.warning_TS_0_1, [diagnostic.code, diagnosticMessageText]); - } - else { - message = diagnosticMessageText; - } - return message; - } - TypeScript.getDiagnosticMessage = getDiagnosticMessage; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Errors = (function () { - function Errors() { - } - Errors.argument = function (argument, message) { - return new Error("Invalid argument: " + argument + ". " + message); - }; - Errors.argumentOutOfRange = function (argument) { - return new Error("Argument out of range: " + argument); - }; - Errors.argumentNull = function (argument) { - return new Error("Argument null: " + argument); - }; - Errors.abstract = function () { - return new Error("Operation not implemented properly by subclass."); - }; - Errors.notYetImplemented = function () { - return new Error("Not yet implemented."); - }; - Errors.invalidOperation = function (message) { - return new Error("Invalid operation: " + message); - }; - return Errors; - })(); - TypeScript.Errors = Errors; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var IntegerUtilities; - (function (IntegerUtilities) { - function integerDivide(numerator, denominator) { - return (numerator / denominator) >> 0; - } - IntegerUtilities.integerDivide = integerDivide; - function integerMultiplyLow32Bits(n1, n2) { - var resultLow32 = (((n1 & 0xffff0000) * n2) >>> 0) + (((n1 & 0x0000ffff) * n2) >>> 0) >>> 0; - return resultLow32; - } - IntegerUtilities.integerMultiplyLow32Bits = integerMultiplyLow32Bits; - function isInteger(text) { - return /^[0-9]+$/.test(text); - } - IntegerUtilities.isInteger = isInteger; - function isHexInteger(text) { - return /^0(x|X)[0-9a-fA-F]+$/.test(text); - } - IntegerUtilities.isHexInteger = isHexInteger; - })(IntegerUtilities = TypeScript.IntegerUtilities || (TypeScript.IntegerUtilities = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var LineMap = (function () { - function LineMap(_computeLineStarts, length) { - this._computeLineStarts = _computeLineStarts; - this.length = length; - this._lineStarts = undefined; - } - LineMap.prototype.toJSON = function (key) { - return { lineStarts: this.lineStarts(), length: this.length }; - }; - LineMap.prototype.equals = function (other) { - return this.length === other.length && TypeScript.ArrayUtilities.sequenceEquals(this.lineStarts(), other.lineStarts(), function (v1, v2) { return v1 === v2; }); - }; - LineMap.prototype.lineStarts = function () { - if (!this._lineStarts) { - this._lineStarts = this._computeLineStarts(); - } - return this._lineStarts; - }; - LineMap.prototype.lineCount = function () { - return this.lineStarts().length; - }; - LineMap.prototype.getPosition = function (line, character) { - return this.lineStarts()[line] + character; - }; - LineMap.prototype.getLineNumberFromPosition = function (position) { - if (position < 0 || position > this.length) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - if (position === this.length) { - return this.lineCount() - 1; - } - var lineNumber = TypeScript.ArrayUtilities.binarySearch(this.lineStarts(), position); - if (lineNumber < 0) { - lineNumber = (~lineNumber) - 1; - } - return lineNumber; - }; - LineMap.prototype.getLineStartPosition = function (lineNumber) { - return this.lineStarts()[lineNumber]; - }; - LineMap.prototype.fillLineAndCharacterFromPosition = function (position, lineAndCharacter) { - if (position < 0 || position > this.length) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - var lineNumber = this.getLineNumberFromPosition(position); - lineAndCharacter.line = lineNumber; - lineAndCharacter.character = position - this.lineStarts()[lineNumber]; - }; - LineMap.prototype.getLineAndCharacterFromPosition = function (position) { - if (position < 0 || position > this.length) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - var lineNumber = this.getLineNumberFromPosition(position); - return new TypeScript.LineAndCharacter(lineNumber, position - this.lineStarts()[lineNumber]); - }; - LineMap.empty = new LineMap(function () { return [0]; }, 0); - return LineMap; - })(); - TypeScript.LineMap = LineMap; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var LineAndCharacter = (function () { - function LineAndCharacter(line, character) { - this._line = 0; - this._character = 0; - if (line < 0) { - throw TypeScript.Errors.argumentOutOfRange("line"); - } - if (character < 0) { - throw TypeScript.Errors.argumentOutOfRange("character"); - } - this._line = line; - this._character = character; - } - LineAndCharacter.prototype.line = function () { - return this._line; - }; - LineAndCharacter.prototype.character = function () { - return this._character; - }; - return LineAndCharacter; - })(); - TypeScript.LineAndCharacter = LineAndCharacter; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var StringUtilities = (function () { - function StringUtilities() { - } - StringUtilities.isString = function (value) { - return Object.prototype.toString.apply(value, []) === '[object String]'; - }; - StringUtilities.endsWith = function (string, value) { - return string.substring(string.length - value.length, string.length) === value; - }; - StringUtilities.startsWith = function (string, value) { - return string.substr(0, value.length) === value; - }; - StringUtilities.repeat = function (value, count) { - return Array(count + 1).join(value); - }; - return StringUtilities; - })(); - TypeScript.StringUtilities = StringUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (CharacterCodes) { - CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; - CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 127] = "maxAsciiCharacter"; - CharacterCodes[CharacterCodes["lineFeed"] = 10] = "lineFeed"; - CharacterCodes[CharacterCodes["carriageReturn"] = 13] = "carriageReturn"; - CharacterCodes[CharacterCodes["lineSeparator"] = 0x2028] = "lineSeparator"; - CharacterCodes[CharacterCodes["paragraphSeparator"] = 0x2029] = "paragraphSeparator"; - CharacterCodes[CharacterCodes["nextLine"] = 0x0085] = "nextLine"; - CharacterCodes[CharacterCodes["space"] = 0x0020] = "space"; - CharacterCodes[CharacterCodes["nonBreakingSpace"] = 0x00A0] = "nonBreakingSpace"; - CharacterCodes[CharacterCodes["enQuad"] = 0x2000] = "enQuad"; - CharacterCodes[CharacterCodes["emQuad"] = 0x2001] = "emQuad"; - CharacterCodes[CharacterCodes["enSpace"] = 0x2002] = "enSpace"; - CharacterCodes[CharacterCodes["emSpace"] = 0x2003] = "emSpace"; - CharacterCodes[CharacterCodes["threePerEmSpace"] = 0x2004] = "threePerEmSpace"; - CharacterCodes[CharacterCodes["fourPerEmSpace"] = 0x2005] = "fourPerEmSpace"; - CharacterCodes[CharacterCodes["sixPerEmSpace"] = 0x2006] = "sixPerEmSpace"; - CharacterCodes[CharacterCodes["figureSpace"] = 0x2007] = "figureSpace"; - CharacterCodes[CharacterCodes["punctuationSpace"] = 0x2008] = "punctuationSpace"; - CharacterCodes[CharacterCodes["thinSpace"] = 0x2009] = "thinSpace"; - CharacterCodes[CharacterCodes["hairSpace"] = 0x200A] = "hairSpace"; - CharacterCodes[CharacterCodes["zeroWidthSpace"] = 0x200B] = "zeroWidthSpace"; - CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 0x202F] = "narrowNoBreakSpace"; - CharacterCodes[CharacterCodes["ideographicSpace"] = 0x3000] = "ideographicSpace"; - CharacterCodes[CharacterCodes["_"] = 95] = "_"; - CharacterCodes[CharacterCodes["$"] = 36] = "$"; - CharacterCodes[CharacterCodes["_0"] = 48] = "_0"; - CharacterCodes[CharacterCodes["_1"] = 49] = "_1"; - CharacterCodes[CharacterCodes["_2"] = 50] = "_2"; - CharacterCodes[CharacterCodes["_3"] = 51] = "_3"; - CharacterCodes[CharacterCodes["_4"] = 52] = "_4"; - CharacterCodes[CharacterCodes["_5"] = 53] = "_5"; - CharacterCodes[CharacterCodes["_6"] = 54] = "_6"; - CharacterCodes[CharacterCodes["_7"] = 55] = "_7"; - CharacterCodes[CharacterCodes["_8"] = 56] = "_8"; - CharacterCodes[CharacterCodes["_9"] = 57] = "_9"; - CharacterCodes[CharacterCodes["a"] = 97] = "a"; - CharacterCodes[CharacterCodes["b"] = 98] = "b"; - CharacterCodes[CharacterCodes["c"] = 99] = "c"; - CharacterCodes[CharacterCodes["d"] = 100] = "d"; - CharacterCodes[CharacterCodes["e"] = 101] = "e"; - CharacterCodes[CharacterCodes["f"] = 102] = "f"; - CharacterCodes[CharacterCodes["g"] = 103] = "g"; - CharacterCodes[CharacterCodes["h"] = 104] = "h"; - CharacterCodes[CharacterCodes["i"] = 105] = "i"; - CharacterCodes[CharacterCodes["j"] = 106] = "j"; - CharacterCodes[CharacterCodes["k"] = 107] = "k"; - CharacterCodes[CharacterCodes["l"] = 108] = "l"; - CharacterCodes[CharacterCodes["m"] = 109] = "m"; - CharacterCodes[CharacterCodes["n"] = 110] = "n"; - CharacterCodes[CharacterCodes["o"] = 111] = "o"; - CharacterCodes[CharacterCodes["p"] = 112] = "p"; - CharacterCodes[CharacterCodes["q"] = 113] = "q"; - CharacterCodes[CharacterCodes["r"] = 114] = "r"; - CharacterCodes[CharacterCodes["s"] = 115] = "s"; - CharacterCodes[CharacterCodes["t"] = 116] = "t"; - CharacterCodes[CharacterCodes["u"] = 117] = "u"; - CharacterCodes[CharacterCodes["v"] = 118] = "v"; - CharacterCodes[CharacterCodes["w"] = 119] = "w"; - CharacterCodes[CharacterCodes["x"] = 120] = "x"; - CharacterCodes[CharacterCodes["y"] = 121] = "y"; - CharacterCodes[CharacterCodes["z"] = 122] = "z"; - CharacterCodes[CharacterCodes["A"] = 65] = "A"; - CharacterCodes[CharacterCodes["B"] = 66] = "B"; - CharacterCodes[CharacterCodes["C"] = 67] = "C"; - CharacterCodes[CharacterCodes["D"] = 68] = "D"; - CharacterCodes[CharacterCodes["E"] = 69] = "E"; - CharacterCodes[CharacterCodes["F"] = 70] = "F"; - CharacterCodes[CharacterCodes["G"] = 71] = "G"; - CharacterCodes[CharacterCodes["H"] = 72] = "H"; - CharacterCodes[CharacterCodes["I"] = 73] = "I"; - CharacterCodes[CharacterCodes["J"] = 74] = "J"; - CharacterCodes[CharacterCodes["K"] = 75] = "K"; - CharacterCodes[CharacterCodes["L"] = 76] = "L"; - CharacterCodes[CharacterCodes["M"] = 77] = "M"; - CharacterCodes[CharacterCodes["N"] = 78] = "N"; - CharacterCodes[CharacterCodes["O"] = 79] = "O"; - CharacterCodes[CharacterCodes["P"] = 80] = "P"; - CharacterCodes[CharacterCodes["Q"] = 81] = "Q"; - CharacterCodes[CharacterCodes["R"] = 82] = "R"; - CharacterCodes[CharacterCodes["S"] = 83] = "S"; - CharacterCodes[CharacterCodes["T"] = 84] = "T"; - CharacterCodes[CharacterCodes["U"] = 85] = "U"; - CharacterCodes[CharacterCodes["V"] = 86] = "V"; - CharacterCodes[CharacterCodes["W"] = 87] = "W"; - CharacterCodes[CharacterCodes["X"] = 88] = "X"; - CharacterCodes[CharacterCodes["Y"] = 89] = "Y"; - CharacterCodes[CharacterCodes["Z"] = 90] = "Z"; - CharacterCodes[CharacterCodes["ampersand"] = 38] = "ampersand"; - CharacterCodes[CharacterCodes["asterisk"] = 42] = "asterisk"; - CharacterCodes[CharacterCodes["at"] = 64] = "at"; - CharacterCodes[CharacterCodes["backslash"] = 92] = "backslash"; - CharacterCodes[CharacterCodes["backtick"] = 96] = "backtick"; - CharacterCodes[CharacterCodes["bar"] = 124] = "bar"; - CharacterCodes[CharacterCodes["caret"] = 94] = "caret"; - CharacterCodes[CharacterCodes["closeBrace"] = 125] = "closeBrace"; - CharacterCodes[CharacterCodes["closeBracket"] = 93] = "closeBracket"; - CharacterCodes[CharacterCodes["closeParen"] = 41] = "closeParen"; - CharacterCodes[CharacterCodes["colon"] = 58] = "colon"; - CharacterCodes[CharacterCodes["comma"] = 44] = "comma"; - CharacterCodes[CharacterCodes["dot"] = 46] = "dot"; - CharacterCodes[CharacterCodes["doubleQuote"] = 34] = "doubleQuote"; - CharacterCodes[CharacterCodes["equals"] = 61] = "equals"; - CharacterCodes[CharacterCodes["exclamation"] = 33] = "exclamation"; - CharacterCodes[CharacterCodes["greaterThan"] = 62] = "greaterThan"; - CharacterCodes[CharacterCodes["lessThan"] = 60] = "lessThan"; - CharacterCodes[CharacterCodes["minus"] = 45] = "minus"; - CharacterCodes[CharacterCodes["openBrace"] = 123] = "openBrace"; - CharacterCodes[CharacterCodes["openBracket"] = 91] = "openBracket"; - CharacterCodes[CharacterCodes["openParen"] = 40] = "openParen"; - CharacterCodes[CharacterCodes["percent"] = 37] = "percent"; - CharacterCodes[CharacterCodes["plus"] = 43] = "plus"; - CharacterCodes[CharacterCodes["question"] = 63] = "question"; - CharacterCodes[CharacterCodes["semicolon"] = 59] = "semicolon"; - CharacterCodes[CharacterCodes["singleQuote"] = 39] = "singleQuote"; - CharacterCodes[CharacterCodes["slash"] = 47] = "slash"; - CharacterCodes[CharacterCodes["tilde"] = 126] = "tilde"; - CharacterCodes[CharacterCodes["backspace"] = 8] = "backspace"; - CharacterCodes[CharacterCodes["formFeed"] = 12] = "formFeed"; - CharacterCodes[CharacterCodes["byteOrderMark"] = 0xFEFF] = "byteOrderMark"; - CharacterCodes[CharacterCodes["tab"] = 9] = "tab"; - CharacterCodes[CharacterCodes["verticalTab"] = 11] = "verticalTab"; - })(TypeScript.CharacterCodes || (TypeScript.CharacterCodes = {})); - var CharacterCodes = TypeScript.CharacterCodes; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ScriptSnapshot; - (function (ScriptSnapshot) { - var StringScriptSnapshot = (function () { - function StringScriptSnapshot(text) { - this.text = text; - this._lineStartPositions = undefined; - } - StringScriptSnapshot.prototype.getText = function (start, end) { - return this.text.substring(start, end); - }; - StringScriptSnapshot.prototype.getLength = function () { - return this.text.length; - }; - StringScriptSnapshot.prototype.getLineStartPositions = function () { - if (!this._lineStartPositions) { - this._lineStartPositions = TypeScript.TextUtilities.parseLineStarts(this.text); - } - return this._lineStartPositions; - }; - StringScriptSnapshot.prototype.getChangeRange = function (oldSnapshot) { - throw TypeScript.Errors.notYetImplemented(); - }; - return StringScriptSnapshot; - })(); - function fromString(text) { - return new StringScriptSnapshot(text); - } - ScriptSnapshot.fromString = fromString; - })(ScriptSnapshot = TypeScript.ScriptSnapshot || (TypeScript.ScriptSnapshot = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var LineMap1; - (function (LineMap1) { - function fromSimpleText(text) { - return new TypeScript.LineMap(function () { return TypeScript.TextUtilities.parseLineStarts({ charCodeAt: function (index) { return text.charCodeAt(index); }, length: text.length() }); }, text.length()); - } - LineMap1.fromSimpleText = fromSimpleText; - function fromScriptSnapshot(scriptSnapshot) { - return new TypeScript.LineMap(function () { return scriptSnapshot.getLineStartPositions(); }, scriptSnapshot.getLength()); - } - LineMap1.fromScriptSnapshot = fromScriptSnapshot; - function fromString(text) { - return new TypeScript.LineMap(function () { return TypeScript.TextUtilities.parseLineStarts(text); }, text.length); - } - LineMap1.fromString = fromString; - })(LineMap1 = TypeScript.LineMap1 || (TypeScript.LineMap1 = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SimpleText; - (function (SimpleText) { - var SimpleStringText = (function () { - function SimpleStringText(value) { - this.value = value; - this._lineMap = undefined; - } - SimpleStringText.prototype.length = function () { - return this.value.length; - }; - SimpleStringText.prototype.substr = function (start, length) { - var val = this.value; - return start === 0 && length == val.length ? val : val.substr(start, length); - }; - SimpleStringText.prototype.charCodeAt = function (index) { - return this.value.charCodeAt(index); - }; - SimpleStringText.prototype.lineMap = function () { - if (!this._lineMap) { - this._lineMap = TypeScript.LineMap1.fromString(this.value); - } - return this._lineMap; - }; - return SimpleStringText; - })(); - var SimpleScriptSnapshotText = (function () { - function SimpleScriptSnapshotText(scriptSnapshot) { - this.scriptSnapshot = scriptSnapshot; - this._lineMap = undefined; - } - SimpleScriptSnapshotText.prototype.charCodeAt = function (index) { - return this.scriptSnapshot.getText(index, index + 1).charCodeAt(0); - }; - SimpleScriptSnapshotText.prototype.length = function () { - return this.scriptSnapshot.getLength(); - }; - SimpleScriptSnapshotText.prototype.substr = function (start, length) { - return this.scriptSnapshot.getText(start, start + length); - }; - SimpleScriptSnapshotText.prototype.lineMap = function () { - var _this = this; - if (!this._lineMap) { - this._lineMap = new TypeScript.LineMap(function () { return _this.scriptSnapshot.getLineStartPositions(); }, this.length()); - } - return this._lineMap; - }; - return SimpleScriptSnapshotText; - })(); - function fromString(value) { - return new SimpleStringText(value); - } - SimpleText.fromString = fromString; - function fromScriptSnapshot(scriptSnapshot) { - return new SimpleScriptSnapshotText(scriptSnapshot); - } - SimpleText.fromScriptSnapshot = fromScriptSnapshot; - })(SimpleText = TypeScript.SimpleText || (TypeScript.SimpleText = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var TextUtilities; - (function (TextUtilities) { - function parseLineStarts(text) { - var length = text.length; - if (0 === length) { - var result = new Array(); - result.push(0); - return result; - } - var position = 0; - var index = 0; - var arrayBuilder = new Array(); - var lineNumber = 0; - while (index < length) { - var c = text.charCodeAt(index); - var lineBreakLength; - if (c > 13 /* carriageReturn */ && c <= 127) { - index++; - continue; - } - else if (c === 13 /* carriageReturn */ && index + 1 < length && text.charCodeAt(index + 1) === 10 /* lineFeed */) { - lineBreakLength = 2; - } - else if (c === 10 /* lineFeed */) { - lineBreakLength = 1; - } - else { - lineBreakLength = TextUtilities.getLengthOfLineBreak(text, index); - } - if (0 === lineBreakLength) { - index++; - } - else { - arrayBuilder.push(position); - index += lineBreakLength; - position = index; - lineNumber++; - } - } - arrayBuilder.push(position); - return arrayBuilder; - } - TextUtilities.parseLineStarts = parseLineStarts; - function getLengthOfLineBreakSlow(text, index, c) { - if (c === 13 /* carriageReturn */) { - var next = index + 1; - return (next < text.length) && 10 /* lineFeed */ === text.charCodeAt(next) ? 2 : 1; - } - else if (isAnyLineBreakCharacter(c)) { - return 1; - } - else { - return 0; - } - } - TextUtilities.getLengthOfLineBreakSlow = getLengthOfLineBreakSlow; - function getLengthOfLineBreak(text, index) { - var c = text.charCodeAt(index); - if (c > 13 /* carriageReturn */ && c <= 127) { - return 0; - } - return getLengthOfLineBreakSlow(text, index, c); - } - TextUtilities.getLengthOfLineBreak = getLengthOfLineBreak; - function isAnyLineBreakCharacter(c) { - return c === 10 /* lineFeed */ || c === 13 /* carriageReturn */ || c === 133 /* nextLine */ || c === 8232 /* lineSeparator */ || c === 8233 /* paragraphSeparator */; - } - TextUtilities.isAnyLineBreakCharacter = isAnyLineBreakCharacter; - })(TextUtilities = TypeScript.TextUtilities || (TypeScript.TextUtilities = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { +var ts; +(function (ts) { var TextSpan = (function () { function TextSpan(start, length) { - if (start < 0) { - TypeScript.Errors.argument("start"); - } - if (length < 0) { - TypeScript.Errors.argument("length"); - } + ts.Debug.assert(start >= 0, "start"); + ts.Debug.assert(length >= 0, "length"); this._start = start; this._length = length; } @@ -17645,21 +16443,16 @@ var TypeScript; return undefined; }; TextSpan.fromBounds = function (start, end) { - TypeScript.Debug.assert(start >= 0); - TypeScript.Debug.assert(end - start >= 0); + ts.Debug.assert(start >= 0); + ts.Debug.assert(end - start >= 0); return new TextSpan(start, end - start); }; return TextSpan; })(); - TypeScript.TextSpan = TextSpan; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { + ts.TextSpan = TextSpan; var TextChangeRange = (function () { function TextChangeRange(span, newLength) { - if (newLength < 0) { - throw TypeScript.Errors.argumentOutOfRange("newLength"); - } + ts.Debug.assert(newLength >= 0, "newLength"); this._span = span; this._newLength = newLength; } @@ -17670,7 +16463,7 @@ var TypeScript; return this._newLength; }; TextChangeRange.prototype.newSpan = function () { - return new TypeScript.TextSpan(this.span().start(), this.newLength()); + return new TextSpan(this.span().start(), this.newLength()); }; TextChangeRange.prototype.isUnchanged = function () { return this.span().isEmpty() && this.newLength() === 0; @@ -17698,10417 +16491,13 @@ var TypeScript; oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); } - return new TextChangeRange(TypeScript.TextSpan.fromBounds(oldStartN, oldEndN), newEndN - oldStartN); + return new TextChangeRange(TextSpan.fromBounds(oldStartN, oldEndN), newEndN - oldStartN); }; - TextChangeRange.unchanged = new TextChangeRange(new TypeScript.TextSpan(0, 0), 0); + TextChangeRange.unchanged = new TextChangeRange(new TextSpan(0, 0), 0); return TextChangeRange; })(); - TypeScript.TextChangeRange = TextChangeRange; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var CharacterInfo; - (function (CharacterInfo) { - function isDecimalDigit(c) { - return c >= 48 /* _0 */ && c <= 57 /* _9 */; - } - CharacterInfo.isDecimalDigit = isDecimalDigit; - function isOctalDigit(c) { - return c >= 48 /* _0 */ && c <= 55 /* _7 */; - } - CharacterInfo.isOctalDigit = isOctalDigit; - function isHexDigit(c) { - return CharacterInfo.isDecimalDigit(c) || (c >= 65 /* A */ && c <= 70 /* F */) || (c >= 97 /* a */ && c <= 102 /* f */); - } - CharacterInfo.isHexDigit = isHexDigit; - function hexValue(c) { - return CharacterInfo.isDecimalDigit(c) ? (c - 48 /* _0 */) : (c >= 65 /* A */ && c <= 70 /* F */) ? c - 65 /* A */ + 10 : c - 97 /* a */ + 10; - } - CharacterInfo.hexValue = hexValue; - function isWhitespace(ch) { - switch (ch) { - case 32 /* space */: - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 65279 /* byteOrderMark */: - return true; - } - return false; - } - CharacterInfo.isWhitespace = isWhitespace; - function isLineTerminator(ch) { - switch (ch) { - case 13 /* carriageReturn */: - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - return true; - } - return false; - } - CharacterInfo.isLineTerminator = isLineTerminator; - })(CharacterInfo = TypeScript.CharacterInfo || (TypeScript.CharacterInfo = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (SyntaxConstants) { - SyntaxConstants[SyntaxConstants["None"] = 0] = "None"; - SyntaxConstants[SyntaxConstants["NodeDataComputed"] = 0x00000001] = "NodeDataComputed"; - SyntaxConstants[SyntaxConstants["NodeIncrementallyUnusableMask"] = 0x00000002] = "NodeIncrementallyUnusableMask"; - SyntaxConstants[SyntaxConstants["NodeParsedInStrictModeMask"] = 0x00000004] = "NodeParsedInStrictModeMask"; - SyntaxConstants[SyntaxConstants["NodeFullWidthShift"] = 3] = "NodeFullWidthShift"; - })(TypeScript.SyntaxConstants || (TypeScript.SyntaxConstants = {})); - var SyntaxConstants = TypeScript.SyntaxConstants; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var FormattingOptions = (function () { - function FormattingOptions(useTabs, spacesPerTab, indentSpaces, newLineCharacter) { - this.useTabs = useTabs; - this.spacesPerTab = spacesPerTab; - this.indentSpaces = indentSpaces; - this.newLineCharacter = newLineCharacter; - } - FormattingOptions.defaultOptions = new FormattingOptions(false, 4, 4, "\r\n"); - return FormattingOptions; - })(); - TypeScript.FormattingOptions = FormattingOptions; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (SyntaxKind) { - SyntaxKind[SyntaxKind["None"] = 0] = "None"; - SyntaxKind[SyntaxKind["List"] = 1] = "List"; - SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 2] = "WhitespaceTrivia"; - SyntaxKind[SyntaxKind["NewLineTrivia"] = 3] = "NewLineTrivia"; - SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 4] = "MultiLineCommentTrivia"; - SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 5] = "SingleLineCommentTrivia"; - SyntaxKind[SyntaxKind["SkippedTokenTrivia"] = 6] = "SkippedTokenTrivia"; - SyntaxKind[SyntaxKind["ErrorToken"] = 7] = "ErrorToken"; - SyntaxKind[SyntaxKind["EndOfFileToken"] = 8] = "EndOfFileToken"; - SyntaxKind[SyntaxKind["IdentifierName"] = 9] = "IdentifierName"; - SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 10] = "RegularExpressionLiteral"; - SyntaxKind[SyntaxKind["NumericLiteral"] = 11] = "NumericLiteral"; - SyntaxKind[SyntaxKind["StringLiteral"] = 12] = "StringLiteral"; - SyntaxKind[SyntaxKind["NoSubstitutionTemplateToken"] = 13] = "NoSubstitutionTemplateToken"; - SyntaxKind[SyntaxKind["TemplateStartToken"] = 14] = "TemplateStartToken"; - SyntaxKind[SyntaxKind["TemplateMiddleToken"] = 15] = "TemplateMiddleToken"; - SyntaxKind[SyntaxKind["TemplateEndToken"] = 16] = "TemplateEndToken"; - SyntaxKind[SyntaxKind["BreakKeyword"] = 17] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 18] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 19] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 20] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 21] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 22] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 23] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 24] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 25] = "ElseKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 26] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 27] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 28] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 29] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 30] = "IfKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 31] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 32] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 33] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 34] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 35] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 36] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 37] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 38] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 39] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 40] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 41] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 42] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 43] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 44] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 45] = "WithKeyword"; - SyntaxKind[SyntaxKind["ClassKeyword"] = 46] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 47] = "ConstKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 48] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 49] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 50] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 51] = "ImportKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 52] = "SuperKeyword"; - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 53] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 54] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 55] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 56] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 57] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 58] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 59] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 60] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 61] = "YieldKeyword"; - SyntaxKind[SyntaxKind["AnyKeyword"] = 62] = "AnyKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 63] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 64] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 65] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 66] = "GetKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 67] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 68] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 69] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 70] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 71] = "StringKeyword"; - SyntaxKind[SyntaxKind["OpenBraceToken"] = 72] = "OpenBraceToken"; - SyntaxKind[SyntaxKind["CloseBraceToken"] = 73] = "CloseBraceToken"; - SyntaxKind[SyntaxKind["OpenParenToken"] = 74] = "OpenParenToken"; - SyntaxKind[SyntaxKind["CloseParenToken"] = 75] = "CloseParenToken"; - SyntaxKind[SyntaxKind["OpenBracketToken"] = 76] = "OpenBracketToken"; - SyntaxKind[SyntaxKind["CloseBracketToken"] = 77] = "CloseBracketToken"; - SyntaxKind[SyntaxKind["DotToken"] = 78] = "DotToken"; - SyntaxKind[SyntaxKind["DotDotDotToken"] = 79] = "DotDotDotToken"; - SyntaxKind[SyntaxKind["SemicolonToken"] = 80] = "SemicolonToken"; - SyntaxKind[SyntaxKind["CommaToken"] = 81] = "CommaToken"; - SyntaxKind[SyntaxKind["LessThanToken"] = 82] = "LessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanToken"] = 83] = "GreaterThanToken"; - SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 84] = "LessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 85] = "GreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 86] = "EqualsEqualsToken"; - SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 87] = "EqualsGreaterThanToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 88] = "ExclamationEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 89] = "EqualsEqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 90] = "ExclamationEqualsEqualsToken"; - SyntaxKind[SyntaxKind["PlusToken"] = 91] = "PlusToken"; - SyntaxKind[SyntaxKind["MinusToken"] = 92] = "MinusToken"; - SyntaxKind[SyntaxKind["AsteriskToken"] = 93] = "AsteriskToken"; - SyntaxKind[SyntaxKind["PercentToken"] = 94] = "PercentToken"; - SyntaxKind[SyntaxKind["PlusPlusToken"] = 95] = "PlusPlusToken"; - SyntaxKind[SyntaxKind["MinusMinusToken"] = 96] = "MinusMinusToken"; - SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 97] = "LessThanLessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 98] = "GreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 99] = "GreaterThanGreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["AmpersandToken"] = 100] = "AmpersandToken"; - SyntaxKind[SyntaxKind["BarToken"] = 101] = "BarToken"; - SyntaxKind[SyntaxKind["CaretToken"] = 102] = "CaretToken"; - SyntaxKind[SyntaxKind["ExclamationToken"] = 103] = "ExclamationToken"; - SyntaxKind[SyntaxKind["TildeToken"] = 104] = "TildeToken"; - SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 105] = "AmpersandAmpersandToken"; - SyntaxKind[SyntaxKind["BarBarToken"] = 106] = "BarBarToken"; - SyntaxKind[SyntaxKind["QuestionToken"] = 107] = "QuestionToken"; - SyntaxKind[SyntaxKind["ColonToken"] = 108] = "ColonToken"; - SyntaxKind[SyntaxKind["EqualsToken"] = 109] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 110] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 111] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 112] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 113] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 114] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 115] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 116] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 117] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 118] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 119] = "CaretEqualsToken"; - SyntaxKind[SyntaxKind["SlashToken"] = 120] = "SlashToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 121] = "SlashEqualsToken"; - SyntaxKind[SyntaxKind["SourceUnit"] = 122] = "SourceUnit"; - SyntaxKind[SyntaxKind["QualifiedName"] = 123] = "QualifiedName"; - SyntaxKind[SyntaxKind["ObjectType"] = 124] = "ObjectType"; - SyntaxKind[SyntaxKind["FunctionType"] = 125] = "FunctionType"; - SyntaxKind[SyntaxKind["ArrayType"] = 126] = "ArrayType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 127] = "ConstructorType"; - SyntaxKind[SyntaxKind["GenericType"] = 128] = "GenericType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 129] = "TypeQuery"; - SyntaxKind[SyntaxKind["TupleType"] = 130] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 131] = "UnionType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 132] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 133] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 134] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 135] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 136] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 137] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 138] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 139] = "ExportAssignment"; - SyntaxKind[SyntaxKind["MemberFunctionDeclaration"] = 140] = "MemberFunctionDeclaration"; - SyntaxKind[SyntaxKind["MemberVariableDeclaration"] = 141] = "MemberVariableDeclaration"; - SyntaxKind[SyntaxKind["ConstructorDeclaration"] = 142] = "ConstructorDeclaration"; - SyntaxKind[SyntaxKind["IndexMemberDeclaration"] = 143] = "IndexMemberDeclaration"; - SyntaxKind[SyntaxKind["GetAccessor"] = 144] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 145] = "SetAccessor"; - SyntaxKind[SyntaxKind["PropertySignature"] = 146] = "PropertySignature"; - SyntaxKind[SyntaxKind["CallSignature"] = 147] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 148] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 149] = "IndexSignature"; - SyntaxKind[SyntaxKind["MethodSignature"] = 150] = "MethodSignature"; - SyntaxKind[SyntaxKind["Block"] = 151] = "Block"; - SyntaxKind[SyntaxKind["IfStatement"] = 152] = "IfStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 153] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 154] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 155] = "ReturnStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 156] = "SwitchStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 157] = "BreakStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 158] = "ContinueStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 159] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 160] = "ForInStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 161] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 162] = "ThrowStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 163] = "WhileStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 164] = "TryStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 165] = "LabeledStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 166] = "DoStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 167] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 168] = "WithStatement"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 169] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 170] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 171] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 172] = "VoidExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 173] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 174] = "BinaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 175] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["MemberAccessExpression"] = 176] = "MemberAccessExpression"; - SyntaxKind[SyntaxKind["InvocationExpression"] = 177] = "InvocationExpression"; - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 178] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 179] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectCreationExpression"] = 180] = "ObjectCreationExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 181] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["ParenthesizedArrowFunctionExpression"] = 182] = "ParenthesizedArrowFunctionExpression"; - SyntaxKind[SyntaxKind["SimpleArrowFunctionExpression"] = 183] = "SimpleArrowFunctionExpression"; - SyntaxKind[SyntaxKind["CastExpression"] = 184] = "CastExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 185] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 186] = "FunctionExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 187] = "OmittedExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 188] = "TemplateExpression"; - SyntaxKind[SyntaxKind["TemplateAccessExpression"] = 189] = "TemplateAccessExpression"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 190] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarator"] = 191] = "VariableDeclarator"; - SyntaxKind[SyntaxKind["ArgumentList"] = 192] = "ArgumentList"; - SyntaxKind[SyntaxKind["ParameterList"] = 193] = "ParameterList"; - SyntaxKind[SyntaxKind["TypeArgumentList"] = 194] = "TypeArgumentList"; - SyntaxKind[SyntaxKind["TypeParameterList"] = 195] = "TypeParameterList"; - SyntaxKind[SyntaxKind["HeritageClause"] = 196] = "HeritageClause"; - SyntaxKind[SyntaxKind["EqualsValueClause"] = 197] = "EqualsValueClause"; - SyntaxKind[SyntaxKind["CaseSwitchClause"] = 198] = "CaseSwitchClause"; - SyntaxKind[SyntaxKind["DefaultSwitchClause"] = 199] = "DefaultSwitchClause"; - SyntaxKind[SyntaxKind["ElseClause"] = 200] = "ElseClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 201] = "CatchClause"; - SyntaxKind[SyntaxKind["FinallyClause"] = 202] = "FinallyClause"; - SyntaxKind[SyntaxKind["TemplateClause"] = 203] = "TemplateClause"; - SyntaxKind[SyntaxKind["TypeParameter"] = 204] = "TypeParameter"; - SyntaxKind[SyntaxKind["Constraint"] = 205] = "Constraint"; - SyntaxKind[SyntaxKind["SimplePropertyAssignment"] = 206] = "SimplePropertyAssignment"; - SyntaxKind[SyntaxKind["FunctionPropertyAssignment"] = 207] = "FunctionPropertyAssignment"; - SyntaxKind[SyntaxKind["Parameter"] = 208] = "Parameter"; - SyntaxKind[SyntaxKind["EnumElement"] = 209] = "EnumElement"; - SyntaxKind[SyntaxKind["TypeAnnotation"] = 210] = "TypeAnnotation"; - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 211] = "ExternalModuleReference"; - SyntaxKind[SyntaxKind["ModuleNameModuleReference"] = 212] = "ModuleNameModuleReference"; - SyntaxKind[SyntaxKind["FirstStandardKeyword"] = SyntaxKind.BreakKeyword] = "FirstStandardKeyword"; - SyntaxKind[SyntaxKind["LastStandardKeyword"] = SyntaxKind.WithKeyword] = "LastStandardKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedKeyword"] = SyntaxKind.ClassKeyword] = "FirstFutureReservedKeyword"; - SyntaxKind[SyntaxKind["LastFutureReservedKeyword"] = SyntaxKind.SuperKeyword] = "LastFutureReservedKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedStrictKeyword"] = SyntaxKind.ImplementsKeyword] = "FirstFutureReservedStrictKeyword"; - SyntaxKind[SyntaxKind["LastFutureReservedStrictKeyword"] = SyntaxKind.YieldKeyword] = "LastFutureReservedStrictKeyword"; - SyntaxKind[SyntaxKind["FirstTypeScriptKeyword"] = SyntaxKind.AnyKeyword] = "FirstTypeScriptKeyword"; - SyntaxKind[SyntaxKind["LastTypeScriptKeyword"] = SyntaxKind.StringKeyword] = "LastTypeScriptKeyword"; - SyntaxKind[SyntaxKind["FirstKeyword"] = SyntaxKind.FirstStandardKeyword] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.LastTypeScriptKeyword] = "LastKeyword"; - SyntaxKind[SyntaxKind["FirstToken"] = SyntaxKind.ErrorToken] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = SyntaxKind.SlashEqualsToken] = "LastToken"; - SyntaxKind[SyntaxKind["FirstPunctuation"] = SyntaxKind.OpenBraceToken] = "FirstPunctuation"; - SyntaxKind[SyntaxKind["LastPunctuation"] = SyntaxKind.SlashEqualsToken] = "LastPunctuation"; - SyntaxKind[SyntaxKind["FirstFixedWidth"] = SyntaxKind.FirstKeyword] = "FirstFixedWidth"; - SyntaxKind[SyntaxKind["LastFixedWidth"] = SyntaxKind.LastPunctuation] = "LastFixedWidth"; - SyntaxKind[SyntaxKind["FirstTrivia"] = SyntaxKind.WhitespaceTrivia] = "FirstTrivia"; - SyntaxKind[SyntaxKind["LastTrivia"] = SyntaxKind.SkippedTokenTrivia] = "LastTrivia"; - SyntaxKind[SyntaxKind["FirstNode"] = SyntaxKind.SourceUnit] = "FirstNode"; - SyntaxKind[SyntaxKind["LastNode"] = SyntaxKind.ModuleNameModuleReference] = "LastNode"; - })(TypeScript.SyntaxKind || (TypeScript.SyntaxKind = {})); - var SyntaxKind = TypeScript.SyntaxKind; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxFacts; - (function (SyntaxFacts) { - var textToKeywordKind = { - "any": 62 /* AnyKeyword */, - "boolean": 63 /* BooleanKeyword */, - "break": 17 /* BreakKeyword */, - "case": 18 /* CaseKeyword */, - "catch": 19 /* CatchKeyword */, - "class": 46 /* ClassKeyword */, - "continue": 20 /* ContinueKeyword */, - "const": 47 /* ConstKeyword */, - "constructor": 64 /* ConstructorKeyword */, - "debugger": 21 /* DebuggerKeyword */, - "declare": 65 /* DeclareKeyword */, - "default": 22 /* DefaultKeyword */, - "delete": 23 /* DeleteKeyword */, - "do": 24 /* DoKeyword */, - "else": 25 /* ElseKeyword */, - "enum": 48 /* EnumKeyword */, - "export": 49 /* ExportKeyword */, - "extends": 50 /* ExtendsKeyword */, - "false": 26 /* FalseKeyword */, - "finally": 27 /* FinallyKeyword */, - "for": 28 /* ForKeyword */, - "function": 29 /* FunctionKeyword */, - "get": 66 /* GetKeyword */, - "if": 30 /* IfKeyword */, - "implements": 53 /* ImplementsKeyword */, - "import": 51 /* ImportKeyword */, - "in": 31 /* InKeyword */, - "instanceof": 32 /* InstanceOfKeyword */, - "interface": 54 /* InterfaceKeyword */, - "let": 55 /* LetKeyword */, - "module": 67 /* ModuleKeyword */, - "new": 33 /* NewKeyword */, - "null": 34 /* NullKeyword */, - "number": 69 /* NumberKeyword */, - "package": 56 /* PackageKeyword */, - "private": 57 /* PrivateKeyword */, - "protected": 58 /* ProtectedKeyword */, - "public": 59 /* PublicKeyword */, - "require": 68 /* RequireKeyword */, - "return": 35 /* ReturnKeyword */, - "set": 70 /* SetKeyword */, - "static": 60 /* StaticKeyword */, - "string": 71 /* StringKeyword */, - "super": 52 /* SuperKeyword */, - "switch": 36 /* SwitchKeyword */, - "this": 37 /* ThisKeyword */, - "throw": 38 /* ThrowKeyword */, - "true": 39 /* TrueKeyword */, - "try": 40 /* TryKeyword */, - "typeof": 41 /* TypeOfKeyword */, - "var": 42 /* VarKeyword */, - "void": 43 /* VoidKeyword */, - "while": 44 /* WhileKeyword */, - "with": 45 /* WithKeyword */, - "yield": 61 /* YieldKeyword */, - "{": 72 /* OpenBraceToken */, - "}": 73 /* CloseBraceToken */, - "(": 74 /* OpenParenToken */, - ")": 75 /* CloseParenToken */, - "[": 76 /* OpenBracketToken */, - "]": 77 /* CloseBracketToken */, - ".": 78 /* DotToken */, - "...": 79 /* DotDotDotToken */, - ";": 80 /* SemicolonToken */, - ",": 81 /* CommaToken */, - "<": 82 /* LessThanToken */, - ">": 83 /* GreaterThanToken */, - "<=": 84 /* LessThanEqualsToken */, - ">=": 85 /* GreaterThanEqualsToken */, - "==": 86 /* EqualsEqualsToken */, - "=>": 87 /* EqualsGreaterThanToken */, - "!=": 88 /* ExclamationEqualsToken */, - "===": 89 /* EqualsEqualsEqualsToken */, - "!==": 90 /* ExclamationEqualsEqualsToken */, - "+": 91 /* PlusToken */, - "-": 92 /* MinusToken */, - "*": 93 /* AsteriskToken */, - "%": 94 /* PercentToken */, - "++": 95 /* PlusPlusToken */, - "--": 96 /* MinusMinusToken */, - "<<": 97 /* LessThanLessThanToken */, - ">>": 98 /* GreaterThanGreaterThanToken */, - ">>>": 99 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 100 /* AmpersandToken */, - "|": 101 /* BarToken */, - "^": 102 /* CaretToken */, - "!": 103 /* ExclamationToken */, - "~": 104 /* TildeToken */, - "&&": 105 /* AmpersandAmpersandToken */, - "||": 106 /* BarBarToken */, - "?": 107 /* QuestionToken */, - ":": 108 /* ColonToken */, - "=": 109 /* EqualsToken */, - "+=": 110 /* PlusEqualsToken */, - "-=": 111 /* MinusEqualsToken */, - "*=": 112 /* AsteriskEqualsToken */, - "%=": 113 /* PercentEqualsToken */, - "<<=": 114 /* LessThanLessThanEqualsToken */, - ">>=": 115 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 117 /* AmpersandEqualsToken */, - "|=": 118 /* BarEqualsToken */, - "^=": 119 /* CaretEqualsToken */, - "/": 120 /* SlashToken */, - "/=": 121 /* SlashEqualsToken */ - }; - var kindToText = new Array(); - for (var name in textToKeywordKind) { - if (textToKeywordKind.hasOwnProperty(name)) { - kindToText[textToKeywordKind[name]] = name; - } - } - kindToText[64 /* ConstructorKeyword */] = "constructor"; - function getTokenKind(text) { - if (textToKeywordKind.hasOwnProperty(text)) { - return textToKeywordKind[text]; - } - return 0 /* None */; - } - SyntaxFacts.getTokenKind = getTokenKind; - function getText(kind) { - var result = kindToText[kind]; - return result; - } - SyntaxFacts.getText = getText; - function isAnyKeyword(kind) { - return kind >= TypeScript.SyntaxKind.FirstKeyword && kind <= TypeScript.SyntaxKind.LastKeyword; - } - SyntaxFacts.isAnyKeyword = isAnyKeyword; - function isAnyPunctuation(kind) { - return kind >= TypeScript.SyntaxKind.FirstPunctuation && kind <= TypeScript.SyntaxKind.LastPunctuation; - } - SyntaxFacts.isAnyPunctuation = isAnyPunctuation; - function isPrefixUnaryExpressionOperatorToken(tokenKind) { - switch (tokenKind) { - case 91 /* PlusToken */: - case 92 /* MinusToken */: - case 104 /* TildeToken */: - case 103 /* ExclamationToken */: - case 95 /* PlusPlusToken */: - case 96 /* MinusMinusToken */: - return true; - default: - return false; - } - } - SyntaxFacts.isPrefixUnaryExpressionOperatorToken = isPrefixUnaryExpressionOperatorToken; - function isBinaryExpressionOperatorToken(tokenKind) { - switch (tokenKind) { - case 93 /* AsteriskToken */: - case 120 /* SlashToken */: - case 94 /* PercentToken */: - case 91 /* PlusToken */: - case 92 /* MinusToken */: - case 97 /* LessThanLessThanToken */: - case 98 /* GreaterThanGreaterThanToken */: - case 99 /* GreaterThanGreaterThanGreaterThanToken */: - case 82 /* LessThanToken */: - case 83 /* GreaterThanToken */: - case 84 /* LessThanEqualsToken */: - case 85 /* GreaterThanEqualsToken */: - case 32 /* InstanceOfKeyword */: - case 31 /* InKeyword */: - case 86 /* EqualsEqualsToken */: - case 88 /* ExclamationEqualsToken */: - case 89 /* EqualsEqualsEqualsToken */: - case 90 /* ExclamationEqualsEqualsToken */: - case 100 /* AmpersandToken */: - case 102 /* CaretToken */: - case 101 /* BarToken */: - case 105 /* AmpersandAmpersandToken */: - case 106 /* BarBarToken */: - case 118 /* BarEqualsToken */: - case 117 /* AmpersandEqualsToken */: - case 119 /* CaretEqualsToken */: - case 114 /* LessThanLessThanEqualsToken */: - case 115 /* GreaterThanGreaterThanEqualsToken */: - case 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 110 /* PlusEqualsToken */: - case 111 /* MinusEqualsToken */: - case 112 /* AsteriskEqualsToken */: - case 121 /* SlashEqualsToken */: - case 113 /* PercentEqualsToken */: - case 109 /* EqualsToken */: - case 81 /* CommaToken */: - return true; - default: - return false; - } - } - SyntaxFacts.isBinaryExpressionOperatorToken = isBinaryExpressionOperatorToken; - function isAssignmentOperatorToken(tokenKind) { - switch (tokenKind) { - case 118 /* BarEqualsToken */: - case 117 /* AmpersandEqualsToken */: - case 119 /* CaretEqualsToken */: - case 114 /* LessThanLessThanEqualsToken */: - case 115 /* GreaterThanGreaterThanEqualsToken */: - case 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 110 /* PlusEqualsToken */: - case 111 /* MinusEqualsToken */: - case 112 /* AsteriskEqualsToken */: - case 121 /* SlashEqualsToken */: - case 113 /* PercentEqualsToken */: - case 109 /* EqualsToken */: - return true; - default: - return false; - } - } - SyntaxFacts.isAssignmentOperatorToken = isAssignmentOperatorToken; - function isType(kind) { - switch (kind) { - case 126 /* ArrayType */: - case 62 /* AnyKeyword */: - case 69 /* NumberKeyword */: - case 63 /* BooleanKeyword */: - case 71 /* StringKeyword */: - case 43 /* VoidKeyword */: - case 125 /* FunctionType */: - case 124 /* ObjectType */: - case 127 /* ConstructorType */: - case 129 /* TypeQuery */: - case 128 /* GenericType */: - case 123 /* QualifiedName */: - case 9 /* IdentifierName */: - return true; - } - return false; - } - SyntaxFacts.isType = isType; - })(SyntaxFacts = TypeScript.SyntaxFacts || (TypeScript.SyntaxFacts = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Scanner; - (function (Scanner) { - TypeScript.Debug.assert(TypeScript.SyntaxKind.LastToken <= 127); - var ScannerConstants; - (function (ScannerConstants) { - ScannerConstants[ScannerConstants["LargeTokenFullStartShift"] = 4] = "LargeTokenFullStartShift"; - ScannerConstants[ScannerConstants["LargeTokenFullWidthShift"] = 7] = "LargeTokenFullWidthShift"; - ScannerConstants[ScannerConstants["LargeTokenLeadingTriviaBitMask"] = 0x01] = "LargeTokenLeadingTriviaBitMask"; - ScannerConstants[ScannerConstants["LargeTokenLeadingCommentBitMask"] = 0x02] = "LargeTokenLeadingCommentBitMask"; - ScannerConstants[ScannerConstants["LargeTokenTrailingTriviaBitMask"] = 0x04] = "LargeTokenTrailingTriviaBitMask"; - ScannerConstants[ScannerConstants["LargeTokenTrailingCommentBitMask"] = 0x08] = "LargeTokenTrailingCommentBitMask"; - ScannerConstants[ScannerConstants["LargeTokenTriviaBitMask"] = 0x0F] = "LargeTokenTriviaBitMask"; - ScannerConstants[ScannerConstants["FixedWidthTokenFullStartShift"] = 7] = "FixedWidthTokenFullStartShift"; - ScannerConstants[ScannerConstants["FixedWidthTokenMaxFullStart"] = 0x7FFFFF] = "FixedWidthTokenMaxFullStart"; - ScannerConstants[ScannerConstants["SmallTokenFullWidthShift"] = 7] = "SmallTokenFullWidthShift"; - ScannerConstants[ScannerConstants["SmallTokenFullStartShift"] = 12] = "SmallTokenFullStartShift"; - ScannerConstants[ScannerConstants["SmallTokenMaxFullStart"] = 0x3FFFF] = "SmallTokenMaxFullStart"; - ScannerConstants[ScannerConstants["SmallTokenMaxFullWidth"] = 0x1F] = "SmallTokenMaxFullWidth"; - ScannerConstants[ScannerConstants["SmallTokenFullWidthMask"] = 0x1F] = "SmallTokenFullWidthMask"; - ScannerConstants[ScannerConstants["KindMask"] = 0x7F] = "KindMask"; - ScannerConstants[ScannerConstants["IsVariableWidthMask"] = 0x80] = "IsVariableWidthMask"; - })(ScannerConstants || (ScannerConstants = {})); - TypeScript.Debug.assert(largeTokenUnpackFullStart(largeTokenPackFullStartAndInfo(1 << 26, 3)) === (1 << 26)); - TypeScript.Debug.assert(largeTokenUnpackFullStart(largeTokenPackFullStartAndInfo(3 << 25, 1)) === (3 << 25)); - TypeScript.Debug.assert(largeTokenUnpackFullStart(largeTokenPackFullStartAndInfo(10 << 23, 2)) === (10 << 23)); - function fixedWidthTokenPackData(fullStart, kind) { - return (fullStart << 7 /* FixedWidthTokenFullStartShift */) | kind; - } - function fixedWidthTokenUnpackFullStart(packedData) { - return packedData >> 7 /* FixedWidthTokenFullStartShift */; - } - function smallTokenPackData(fullStart, fullWidth, kind) { - return (fullStart << 12 /* SmallTokenFullStartShift */) | (fullWidth << 7 /* SmallTokenFullWidthShift */) | kind; - } - function smallTokenUnpackFullWidth(packedData) { - return (packedData >> 7 /* SmallTokenFullWidthShift */) & 31 /* SmallTokenFullWidthMask */; - } - function smallTokenUnpackFullStart(packedData) { - return packedData >> 12 /* SmallTokenFullStartShift */; - } - function largeTokenPackFullStartAndInfo(fullStart, triviaInfo) { - return (fullStart << 4 /* LargeTokenFullStartShift */) | triviaInfo; - } - function largeTokenUnpackFullWidth(packedFullWidthAndKind) { - return packedFullWidthAndKind >> 7 /* LargeTokenFullWidthShift */; - } - function largeTokenUnpackFullStart(packedFullStartAndInfo) { - return packedFullStartAndInfo >> 4 /* LargeTokenFullStartShift */; - } - function largeTokenUnpackHasLeadingTrivia(packed) { - return (packed & 1 /* LargeTokenLeadingTriviaBitMask */) !== 0; - } - function largeTokenUnpackHasTrailingTrivia(packed) { - return (packed & 4 /* LargeTokenTrailingTriviaBitMask */) !== 0; - } - function largeTokenUnpackHasLeadingComment(packed) { - return (packed & 2 /* LargeTokenLeadingCommentBitMask */) !== 0; - } - function largeTokenUnpackHasTrailingComment(packed) { - return (packed & 8 /* LargeTokenTrailingCommentBitMask */) !== 0; - } - function largeTokenUnpackTriviaInfo(packed) { - return packed & 15 /* LargeTokenTriviaBitMask */; - } - var isKeywordStartCharacter = TypeScript.ArrayUtilities.createArray(127 /* maxAsciiCharacter */, 0); - var isIdentifierStartCharacter = TypeScript.ArrayUtilities.createArray(127 /* maxAsciiCharacter */, false); - var isIdentifierPartCharacter = TypeScript.ArrayUtilities.createArray(127 /* maxAsciiCharacter */, false); - for (var character = 0; character < 127 /* maxAsciiCharacter */; character++) { - if ((character >= 97 /* a */ && character <= 122 /* z */) || (character >= 65 /* A */ && character <= 90 /* Z */) || character === 95 /* _ */ || character === 36 /* $ */) { - isIdentifierStartCharacter[character] = true; - isIdentifierPartCharacter[character] = true; - } - else if (character >= 48 /* _0 */ && character <= 57 /* _9 */) { - isIdentifierPartCharacter[character] = true; - } - } - for (var keywordKind = TypeScript.SyntaxKind.FirstKeyword; keywordKind <= TypeScript.SyntaxKind.LastKeyword; keywordKind++) { - var keyword = TypeScript.SyntaxFacts.getText(keywordKind); - isKeywordStartCharacter[keyword.charCodeAt(0)] = 1; - } - function isContextualToken(token) { - switch (token.kind()) { - case 10 /* RegularExpressionLiteral */: - case 98 /* GreaterThanGreaterThanToken */: - case 99 /* GreaterThanGreaterThanGreaterThanToken */: - case 85 /* GreaterThanEqualsToken */: - case 115 /* GreaterThanGreaterThanEqualsToken */: - case 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - return true; - case 15 /* TemplateMiddleToken */: - case 16 /* TemplateEndToken */: - return true; - default: - return token.isKeywordConvertedToIdentifier(); - } - } - Scanner.isContextualToken = isContextualToken; - var lastTokenInfo = { leadingTriviaWidth: -1, width: -1 }; - var lastTokenInfoTokenID = -1; - var triviaScanner = createScannerInternal(2 /* Latest */, TypeScript.SimpleText.fromString(""), function () { - }); - function fillSizeInfo(token, text) { - if (lastTokenInfoTokenID !== TypeScript.syntaxID(token)) { - triviaScanner.fillTokenInfo(token, text, lastTokenInfo); - lastTokenInfoTokenID = TypeScript.syntaxID(token); - } - } - function fullText(token, text) { - return text.substr(token.fullStart(), token.fullWidth()); - } - function leadingTrivia(token, text) { - if (!token.hasLeadingTrivia()) { - return TypeScript.Syntax.emptyTriviaList; - } - return triviaScanner.scanTrivia(token, text, false); - } - function trailingTrivia(token, text) { - if (!token.hasTrailingTrivia()) { - return TypeScript.Syntax.emptyTriviaList; - } - return triviaScanner.scanTrivia(token, text, true); - } - function leadingTriviaWidth(token, text) { - if (!token.hasLeadingTrivia()) { - return 0; - } - fillSizeInfo(token, text); - return lastTokenInfo.leadingTriviaWidth; - } - function trailingTriviaWidth(token, text) { - if (!token.hasTrailingTrivia()) { - return 0; - } - fillSizeInfo(token, text); - return token.fullWidth() - lastTokenInfo.leadingTriviaWidth - lastTokenInfo.width; - } - function tokenIsIncrementallyUnusable(token) { - return false; - } - var FixedWidthTokenWithNoTrivia = (function () { - function FixedWidthTokenWithNoTrivia(_packedData) { - this._packedData = _packedData; - } - FixedWidthTokenWithNoTrivia.prototype.setFullStart = function (fullStart) { - this._packedData = fixedWidthTokenPackData(fullStart, this.kind()); - }; - FixedWidthTokenWithNoTrivia.prototype.childCount = function () { - return 0; - }; - FixedWidthTokenWithNoTrivia.prototype.childAt = function (index) { - throw TypeScript.Errors.invalidOperation(); - }; - FixedWidthTokenWithNoTrivia.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - FixedWidthTokenWithNoTrivia.prototype.isIncrementallyUnusable = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.isKeywordConvertedToIdentifier = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasSkippedToken = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.fullText = function () { - return TypeScript.SyntaxFacts.getText(this.kind()); - }; - FixedWidthTokenWithNoTrivia.prototype.text = function () { - return this.fullText(); - }; - FixedWidthTokenWithNoTrivia.prototype.leadingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - FixedWidthTokenWithNoTrivia.prototype.trailingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - FixedWidthTokenWithNoTrivia.prototype.leadingTriviaWidth = function () { - return 0; - }; - FixedWidthTokenWithNoTrivia.prototype.trailingTriviaWidth = function () { - return 0; - }; - FixedWidthTokenWithNoTrivia.prototype.kind = function () { - return this._packedData & 127 /* KindMask */; - }; - FixedWidthTokenWithNoTrivia.prototype.fullWidth = function () { - return fixedWidthTokenLength(this._packedData & 127 /* KindMask */); - }; - FixedWidthTokenWithNoTrivia.prototype.fullStart = function () { - return fixedWidthTokenUnpackFullStart(this._packedData); - }; - FixedWidthTokenWithNoTrivia.prototype.hasLeadingTrivia = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasTrailingTrivia = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasLeadingComment = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasTrailingComment = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.clone = function () { - return new FixedWidthTokenWithNoTrivia(this._packedData); - }; - return FixedWidthTokenWithNoTrivia; - })(); - var LargeScannerToken = (function () { - function LargeScannerToken(_packedFullStartAndInfo, _packedFullWidthAndKind, cachedText) { - this._packedFullStartAndInfo = _packedFullStartAndInfo; - this._packedFullWidthAndKind = _packedFullWidthAndKind; - if (cachedText !== undefined) { - this.cachedText = cachedText; - } - } - LargeScannerToken.prototype.setFullStart = function (fullStart) { - this._packedFullStartAndInfo = largeTokenPackFullStartAndInfo(fullStart, largeTokenUnpackTriviaInfo(this._packedFullStartAndInfo)); - }; - LargeScannerToken.prototype.childCount = function () { - return 0; - }; - LargeScannerToken.prototype.childAt = function (index) { - throw TypeScript.Errors.invalidOperation(); - }; - LargeScannerToken.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - LargeScannerToken.prototype.syntaxTreeText = function (text) { - var result = text || TypeScript.syntaxTree(this).text; - TypeScript.Debug.assert(result); - return result; - }; - LargeScannerToken.prototype.isIncrementallyUnusable = function () { - return tokenIsIncrementallyUnusable(this); - }; - LargeScannerToken.prototype.isKeywordConvertedToIdentifier = function () { - return false; - }; - LargeScannerToken.prototype.hasSkippedToken = function () { - return false; - }; - LargeScannerToken.prototype.fullText = function (text) { - return fullText(this, this.syntaxTreeText(text)); - }; - LargeScannerToken.prototype.text = function () { - var cachedText = this.cachedText; - return cachedText !== undefined ? cachedText : TypeScript.SyntaxFacts.getText(this.kind()); - }; - LargeScannerToken.prototype.leadingTrivia = function (text) { - return leadingTrivia(this, this.syntaxTreeText(text)); - }; - LargeScannerToken.prototype.trailingTrivia = function (text) { - return trailingTrivia(this, this.syntaxTreeText(text)); - }; - LargeScannerToken.prototype.leadingTriviaWidth = function (text) { - return leadingTriviaWidth(this, this.syntaxTreeText(text)); - }; - LargeScannerToken.prototype.trailingTriviaWidth = function (text) { - return trailingTriviaWidth(this, this.syntaxTreeText(text)); - }; - LargeScannerToken.prototype.kind = function () { - return this._packedFullWidthAndKind & 127 /* KindMask */; - }; - LargeScannerToken.prototype.fullWidth = function () { - return largeTokenUnpackFullWidth(this._packedFullWidthAndKind); - }; - LargeScannerToken.prototype.fullStart = function () { - return largeTokenUnpackFullStart(this._packedFullStartAndInfo); - }; - LargeScannerToken.prototype.hasLeadingTrivia = function () { - return largeTokenUnpackHasLeadingTrivia(this._packedFullStartAndInfo); - }; - LargeScannerToken.prototype.hasTrailingTrivia = function () { - return largeTokenUnpackHasTrailingTrivia(this._packedFullStartAndInfo); - }; - LargeScannerToken.prototype.hasLeadingComment = function () { - return largeTokenUnpackHasLeadingComment(this._packedFullStartAndInfo); - }; - LargeScannerToken.prototype.hasTrailingComment = function () { - return largeTokenUnpackHasTrailingComment(this._packedFullStartAndInfo); - }; - LargeScannerToken.prototype.clone = function () { - return new LargeScannerToken(this._packedFullStartAndInfo, this._packedFullWidthAndKind, this.cachedText); - }; - return LargeScannerToken; - })(); - function createScanner(languageVersion, text, reportDiagnostic) { - var scanner = createScannerInternal(languageVersion, text, reportDiagnostic); - return { - setIndex: scanner.setIndex, - scan: scanner.scan - }; - } - Scanner.createScanner = createScanner; - function createScannerInternal(languageVersion, text, reportDiagnostic) { - var str; - var index; - var start; - var end; - function setIndex(_index) { - index = _index; - } - function reset(_text, _start, _end) { - TypeScript.Debug.assert(_start <= _text.length(), "Token's start was not within the bounds of text: " + _start + " - [0, " + _text.length() + ")"); - TypeScript.Debug.assert(_end <= _text.length(), "Token's end was not within the bounds of text: " + _end + " - [0, " + _text.length() + ")"); - if (!str || text !== _text) { - text = _text; - str = _text.substr(0, _text.length()); - } - start = _start; - end = _end; - index = _start; - } - function scan(allowContextualToken) { - var fullStart = index; - var leadingTriviaInfo = scanTriviaInfo(false); - var start = index; - var kindAndIsVariableWidth = scanSyntaxKind(allowContextualToken); - var end = index; - var trailingTriviaInfo = scanTriviaInfo(true); - var fullWidth = index - fullStart; - var kind = kindAndIsVariableWidth & 127 /* KindMask */; - var isFixedWidth = kind >= TypeScript.SyntaxKind.FirstFixedWidth && kind <= TypeScript.SyntaxKind.LastFixedWidth && ((kindAndIsVariableWidth & 128 /* IsVariableWidthMask */) === 0); - if (isFixedWidth && leadingTriviaInfo === 0 && trailingTriviaInfo === 0 && fullStart <= 8388607 /* FixedWidthTokenMaxFullStart */ && (kindAndIsVariableWidth & 128 /* IsVariableWidthMask */) === 0) { - return new FixedWidthTokenWithNoTrivia((fullStart << 7 /* FixedWidthTokenFullStartShift */) | kind); - } - else { - var packedFullStartAndTriviaInfo = (fullStart << 4 /* LargeTokenFullStartShift */) | leadingTriviaInfo | (trailingTriviaInfo << 2); - var packedFullWidthAndKind = (fullWidth << 7 /* LargeTokenFullWidthShift */) | kind; - var cachedText = isFixedWidth ? undefined : text.substr(start, end - start); - return new LargeScannerToken(packedFullStartAndTriviaInfo, packedFullWidthAndKind, cachedText); - } - } - function scanTrivia(parent, text, isTrailing) { - var tokenFullStart = parent.fullStart(); - var tokenStart = tokenFullStart + leadingTriviaWidth(parent, text); - if (isTrailing) { - reset(text, tokenStart + parent.text().length, tokenFullStart + parent.fullWidth()); - } - else { - reset(text, tokenFullStart, tokenStart); - } - var trivia = []; - while (true) { - if (index < end) { - var ch = str.charCodeAt(index); - switch (ch) { - case 32 /* space */: - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 65279 /* byteOrderMark */: - trivia.push(scanWhitespaceTrivia()); - continue; - case 47 /* slash */: - var ch2 = str.charCodeAt(index + 1); - if (ch2 === 47 /* slash */) { - trivia.push(scanSingleLineCommentTrivia()); - continue; - } - if (ch2 === 42 /* asterisk */) { - trivia.push(scanMultiLineCommentTrivia()); - continue; - } - throw TypeScript.Errors.invalidOperation(); - case 13 /* carriageReturn */: - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - trivia.push(scanLineTerminatorSequenceTrivia(ch)); - if (!isTrailing) { - continue; - } - break; - default: - throw TypeScript.Errors.invalidOperation(); - } - } - var triviaList = TypeScript.Syntax.triviaList(trivia); - triviaList.parent = parent; - return triviaList; - } - } - function scanTriviaInfo(isTrailing) { - var result = 0; - var _end = end; - while (index < _end) { - var ch = str.charCodeAt(index); - switch (ch) { - case 9 /* tab */: - case 32 /* space */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - index++; - result |= 1; - continue; - case 13 /* carriageReturn */: - if ((index + 1) < end && str.charCodeAt(index + 1) === 10 /* lineFeed */) { - index++; - } - case 10 /* lineFeed */: - index++; - result |= 1; - if (isTrailing) { - return result; - } - continue; - case 47 /* slash */: - if ((index + 1) < _end) { - var ch2 = str.charCodeAt(index + 1); - if (ch2 === 47 /* slash */) { - result |= 3; - skipSingleLineCommentTrivia(); - continue; - } - if (ch2 === 42 /* asterisk */) { - result |= 3; - skipMultiLineCommentTrivia(); - continue; - } - } - return result; - default: - if (ch > 127 /* maxAsciiCharacter */ && slowScanTriviaInfo(ch)) { - result |= 1; - continue; - } - return result; - } - } - return result; - } - function slowScanTriviaInfo(ch) { - switch (ch) { - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - case 65279 /* byteOrderMark */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - index++; - return true; - default: - return false; - } - } - function isNewLineCharacter(ch) { - switch (ch) { - case 13 /* carriageReturn */: - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - return true; - default: - return false; - } - } - function scanWhitespaceTrivia() { - var absoluteStartIndex = index; - while (true) { - var ch = str.charCodeAt(index); - switch (ch) { - case 32 /* space */: - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 65279 /* byteOrderMark */: - index++; - continue; - } - break; - } - return createTrivia(2 /* WhitespaceTrivia */, absoluteStartIndex); - } - function createTrivia(kind, absoluteStartIndex) { - var fullWidth = index - absoluteStartIndex; - return TypeScript.Syntax.deferredTrivia(kind, text, absoluteStartIndex, fullWidth); - } - function scanSingleLineCommentTrivia() { - var absoluteStartIndex = index; - skipSingleLineCommentTrivia(); - return createTrivia(5 /* SingleLineCommentTrivia */, absoluteStartIndex); - } - function skipSingleLineCommentTrivia() { - index += 2; - while (index < end) { - if (isNewLineCharacter(str.charCodeAt(index))) { - return; - } - index++; - } - } - function scanMultiLineCommentTrivia() { - var absoluteStartIndex = index; - skipMultiLineCommentTrivia(); - return createTrivia(4 /* MultiLineCommentTrivia */, absoluteStartIndex); - } - function skipMultiLineCommentTrivia() { - index += 2; - while (true) { - if (index === end) { - reportDiagnostic(end, 0, TypeScript.DiagnosticCode._0_expected, ["*/"]); - return; - } - if ((index + 1) < end && str.charCodeAt(index) === 42 /* asterisk */ && str.charCodeAt(index + 1) === 47 /* slash */) { - index += 2; - return; - } - index++; - } - } - function scanLineTerminatorSequenceTrivia(ch) { - var absoluteStartIndex = index; - skipLineTerminatorSequence(ch); - return createTrivia(3 /* NewLineTrivia */, absoluteStartIndex); - } - function skipLineTerminatorSequence(ch) { - index++; - if (ch === 13 /* carriageReturn */ && str.charCodeAt(index) === 10 /* lineFeed */) { - index++; - } - } - function scanSyntaxKind(allowContextualToken) { - if (index >= end) { - return 8 /* EndOfFileToken */; - } - var character = str.charCodeAt(index); - index++; - switch (character) { - case 33 /* exclamation */: return scanExclamationToken(); - case 34 /* doubleQuote */: return scanStringLiteral(character); - case 37 /* percent */: return scanPercentToken(); - case 38 /* ampersand */: return scanAmpersandToken(); - case 39 /* singleQuote */: return scanStringLiteral(character); - case 40 /* openParen */: return 74 /* OpenParenToken */; - case 41 /* closeParen */: return 75 /* CloseParenToken */; - case 42 /* asterisk */: return scanAsteriskToken(); - case 43 /* plus */: return scanPlusToken(); - case 44 /* comma */: return 81 /* CommaToken */; - case 45 /* minus */: return scanMinusToken(); - case 46 /* dot */: return scanDotToken(); - case 47 /* slash */: return scanSlashToken(allowContextualToken); - case 48 /* _0 */: - case 49 /* _1 */: - case 50 /* _2 */: - case 51 /* _3 */: - case 52 /* _4 */: - case 53 /* _5 */: - case 54 /* _6 */: - case 55 /* _7 */: - case 56 /* _8 */: - case 57 /* _9 */: - return scanNumericLiteral(character); - case 58 /* colon */: return 108 /* ColonToken */; - case 59 /* semicolon */: return 80 /* SemicolonToken */; - case 60 /* lessThan */: return scanLessThanToken(); - case 61 /* equals */: return scanEqualsToken(); - case 62 /* greaterThan */: return scanGreaterThanToken(allowContextualToken); - case 63 /* question */: return 107 /* QuestionToken */; - case 91 /* openBracket */: return 76 /* OpenBracketToken */; - case 93 /* closeBracket */: return 77 /* CloseBracketToken */; - case 94 /* caret */: return scanCaretToken(); - case 96 /* backtick */: return scanTemplateToken(character); - case 123 /* openBrace */: return 72 /* OpenBraceToken */; - case 124 /* bar */: return scanBarToken(); - case 125 /* closeBrace */: return scanCloseBraceToken(allowContextualToken, character); - case 126 /* tilde */: return 104 /* TildeToken */; - } - if (isIdentifierStartCharacter[character]) { - var result = tryFastScanIdentifierOrKeyword(character); - if (result !== 0 /* None */) { - return result; - } - } - index--; - if (isIdentifierStart(peekCharOrUnicodeEscape())) { - return slowScanIdentifierOrKeyword(); - } - var text = String.fromCharCode(character); - var messageText = getErrorMessageText(text); - reportDiagnostic(index, 1, TypeScript.DiagnosticCode.Unexpected_character_0, [messageText]); - index++; - return 7 /* ErrorToken */; - } - function isIdentifierStart(interpretedChar) { - if (isIdentifierStartCharacter[interpretedChar]) { - return true; - } - return interpretedChar > 127 /* maxAsciiCharacter */ && TypeScript.Unicode.isIdentifierStart(interpretedChar, languageVersion); - } - function isIdentifierPart(interpretedChar) { - if (isIdentifierPartCharacter[interpretedChar]) { - return true; - } - return interpretedChar > 127 /* maxAsciiCharacter */ && TypeScript.Unicode.isIdentifierPart(interpretedChar, languageVersion); - } - function tryFastScanIdentifierOrKeyword(firstCharacter) { - var startIndex = index; - var character = firstCharacter; - while (index < end) { - character = str.charCodeAt(index); - if (!isIdentifierPartCharacter[character]) { - break; - } - index++; - } - if (index < end && (character === 92 /* backslash */ || character > 127 /* maxAsciiCharacter */)) { - index = startIndex; - return 0 /* None */; - } - else { - if (isKeywordStartCharacter[firstCharacter]) { - return TypeScript.ScannerUtilities.identifierKind(str, startIndex - 1, index - startIndex + 1); - } - else { - return 9 /* IdentifierName */; - } - } - } - function slowScanIdentifierOrKeyword() { - var startIndex = index; - do { - scanCharOrUnicodeEscape(); - } while (isIdentifierPart(peekCharOrUnicodeEscape())); - var length = index - startIndex; - var text = str.substr(startIndex, length); - var valueText = TypeScript.massageEscapes(text); - var keywordKind = TypeScript.SyntaxFacts.getTokenKind(valueText); - if (keywordKind >= TypeScript.SyntaxKind.FirstKeyword && keywordKind <= TypeScript.SyntaxKind.LastKeyword) { - return keywordKind | 128 /* IsVariableWidthMask */; - } - return 9 /* IdentifierName */; - } - function scanNumericLiteral(ch) { - if (isHexNumericLiteral(ch)) { - scanHexNumericLiteral(); - } - else if (isOctalNumericLiteral(ch)) { - scanOctalNumericLiteral(); - } - else { - scanDecimalNumericLiteral(); - } - return 11 /* NumericLiteral */; - } - function isOctalNumericLiteral(ch) { - return ch === 48 /* _0 */ && TypeScript.CharacterInfo.isOctalDigit(str.charCodeAt(index)); - } - function scanOctalNumericLiteral() { - var start = index - 1; - while (TypeScript.CharacterInfo.isOctalDigit(str.charCodeAt(index))) { - index++; - } - if (languageVersion >= 1 /* ES5 */) { - reportDiagnostic(start, index - start, TypeScript.DiagnosticCode.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher, undefined); - } - } - function scanDecimalDigits() { - while (TypeScript.CharacterInfo.isDecimalDigit(str.charCodeAt(index))) { - index++; - } - } - function scanDecimalNumericLiteral() { - scanDecimalDigits(); - if (str.charCodeAt(index) === 46 /* dot */) { - index++; - } - scanDecimalNumericLiteralAfterDot(); - } - function scanDecimalNumericLiteralAfterDot() { - scanDecimalDigits(); - var ch = str.charCodeAt(index); - if (ch === 101 /* e */ || ch === 69 /* E */) { - var nextChar1 = str.charCodeAt(index + 1); - if (TypeScript.CharacterInfo.isDecimalDigit(nextChar1)) { - index++; - scanDecimalDigits(); - } - else if (nextChar1 === 45 /* minus */ || nextChar1 === 43 /* plus */) { - var nextChar2 = str.charCodeAt(index + 2); - if (TypeScript.CharacterInfo.isDecimalDigit(nextChar2)) { - index += 2; - scanDecimalDigits(); - } - } - } - } - function scanHexNumericLiteral() { - index++; - while (TypeScript.CharacterInfo.isHexDigit(str.charCodeAt(index))) { - index++; - } - } - function isHexNumericLiteral(ch) { - if (ch === 48 /* _0 */) { - var ch = str.charCodeAt(index); - if (ch === 120 /* x */ || ch === 88 /* X */) { - return TypeScript.CharacterInfo.isHexDigit(str.charCodeAt(index + 1)); - } - } - return false; - } - function scanLessThanToken() { - var ch0 = str.charCodeAt(index); - if (ch0 === 61 /* equals */) { - index++; - return 84 /* LessThanEqualsToken */; - } - else if (ch0 === 60 /* lessThan */) { - index++; - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 114 /* LessThanLessThanEqualsToken */; - } - else { - return 97 /* LessThanLessThanToken */; - } - } - else { - return 82 /* LessThanToken */; - } - } - function scanGreaterThanToken(allowContextualToken) { - if (allowContextualToken) { - var ch0 = str.charCodeAt(index); - if (ch0 === 62 /* greaterThan */) { - index++; - var ch1 = str.charCodeAt(index); - if (ch1 === 62 /* greaterThan */) { - index++; - var ch2 = str.charCodeAt(index); - if (ch2 === 61 /* equals */) { - index++; - return 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */; - } - else { - return 99 /* GreaterThanGreaterThanGreaterThanToken */; - } - } - else if (ch1 === 61 /* equals */) { - index++; - return 115 /* GreaterThanGreaterThanEqualsToken */; - } - else { - return 98 /* GreaterThanGreaterThanToken */; - } - } - else if (ch0 === 61 /* equals */) { - index++; - return 85 /* GreaterThanEqualsToken */; - } - } - return 83 /* GreaterThanToken */; - } - function scanBarToken() { - var ch = str.charCodeAt(index); - if (ch === 61 /* equals */) { - index++; - return 118 /* BarEqualsToken */; - } - else if (ch === 124 /* bar */) { - index++; - return 106 /* BarBarToken */; - } - else { - return 101 /* BarToken */; - } - } - function scanCaretToken() { - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 119 /* CaretEqualsToken */; - } - else { - return 102 /* CaretToken */; - } - } - function scanCloseBraceToken(allowContextualToken, startChar) { - return allowContextualToken ? scanTemplateToken(startChar) : 73 /* CloseBraceToken */; - } - function scanTemplateToken(startChar) { - var startedWithBacktick = startChar === 96 /* backtick */; - while (true) { - if (index === end) { - reportDiagnostic(end, 0, TypeScript.DiagnosticCode._0_expected, ["`"]); - break; - } - var ch = str.charCodeAt(index); - index++; - if (ch === 96 /* backtick */) { - break; - } - if (ch === 36 /* $ */ && index < end && str.charCodeAt(index) === 123 /* openBrace */) { - index++; - return startedWithBacktick ? 14 /* TemplateStartToken */ : 15 /* TemplateMiddleToken */; - } - } - return startedWithBacktick ? 13 /* NoSubstitutionTemplateToken */ : 16 /* TemplateEndToken */; - } - function scanAmpersandToken() { - var character = str.charCodeAt(index); - if (character === 61 /* equals */) { - index++; - return 117 /* AmpersandEqualsToken */; - } - else if (character === 38 /* ampersand */) { - index++; - return 105 /* AmpersandAmpersandToken */; - } - else { - return 100 /* AmpersandToken */; - } - } - function scanPercentToken() { - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 113 /* PercentEqualsToken */; - } - else { - return 94 /* PercentToken */; - } - } - function scanMinusToken() { - var character = str.charCodeAt(index); - if (character === 61 /* equals */) { - index++; - return 111 /* MinusEqualsToken */; - } - else if (character === 45 /* minus */) { - index++; - return 96 /* MinusMinusToken */; - } - else { - return 92 /* MinusToken */; - } - } - function scanPlusToken() { - var character = str.charCodeAt(index); - if (character === 61 /* equals */) { - index++; - return 110 /* PlusEqualsToken */; - } - else if (character === 43 /* plus */) { - index++; - return 95 /* PlusPlusToken */; - } - else { - return 91 /* PlusToken */; - } - } - function scanAsteriskToken() { - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 112 /* AsteriskEqualsToken */; - } - else { - return 93 /* AsteriskToken */; - } - } - function scanEqualsToken() { - var character = str.charCodeAt(index); - if (character === 61 /* equals */) { - index++; - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 89 /* EqualsEqualsEqualsToken */; - } - else { - return 86 /* EqualsEqualsToken */; - } - } - else if (character === 62 /* greaterThan */) { - index++; - return 87 /* EqualsGreaterThanToken */; - } - else { - return 109 /* EqualsToken */; - } - } - function scanDotToken() { - var nextChar = str.charCodeAt(index); - if (TypeScript.CharacterInfo.isDecimalDigit(nextChar)) { - scanDecimalNumericLiteralAfterDot(); - return 11 /* NumericLiteral */; - } - if (nextChar === 46 /* dot */ && str.charCodeAt(index + 1) === 46 /* dot */) { - index += 2; - return 79 /* DotDotDotToken */; - } - else { - return 78 /* DotToken */; - } - } - function scanSlashToken(allowContextualToken) { - if (allowContextualToken) { - var result = tryScanRegularExpressionToken(); - if (result !== 0 /* None */) { - return result; - } - } - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 121 /* SlashEqualsToken */; - } - else { - return 120 /* SlashToken */; - } - } - function tryScanRegularExpressionToken() { - var startIndex = index; - var inEscape = false; - var inCharacterClass = false; - while (true) { - var ch = str.charCodeAt(index); - if (isNaN(ch) || isNewLineCharacter(ch)) { - index = startIndex; - return 0 /* None */; - } - index++; - if (inEscape) { - inEscape = false; - continue; - } - switch (ch) { - case 92 /* backslash */: - inEscape = true; - continue; - case 91 /* openBracket */: - inCharacterClass = true; - continue; - case 93 /* closeBracket */: - inCharacterClass = false; - continue; - case 47 /* slash */: - if (inCharacterClass) { - continue; - } - break; - default: - continue; - } - break; - } - while (isIdentifierPartCharacter[str.charCodeAt(index)]) { - index++; - } - return 10 /* RegularExpressionLiteral */; - } - function scanExclamationToken() { - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 90 /* ExclamationEqualsEqualsToken */; - } - else { - return 88 /* ExclamationEqualsToken */; - } - } - else { - return 103 /* ExclamationToken */; - } - } - function getErrorMessageText(text) { - if (text === "\\") { - return '"\\"'; - } - return JSON.stringify(text); - } - function skipEscapeSequence() { - var rewindPoint = index; - index++; - var ch = str.charCodeAt(index); - if (isNaN(ch)) { - return; - } - index++; - switch (ch) { - case 120 /* x */: - case 117 /* u */: - index = rewindPoint; - var value = scanUnicodeOrHexEscape(true); - break; - case 13 /* carriageReturn */: - if (str.charCodeAt(index) === 10 /* lineFeed */) { - index++; - } - break; - default: - break; - } - } - function scanStringLiteral(quoteCharacter) { - while (true) { - var ch = str.charCodeAt(index); - if (ch === 92 /* backslash */) { - skipEscapeSequence(); - } - else if (ch === quoteCharacter) { - index++; - break; - } - else if (isNaN(ch) || isNewLineCharacter(ch)) { - reportDiagnostic(Math.min(index, end), 1, TypeScript.DiagnosticCode.Missing_close_quote_character, undefined); - break; - } - else { - index++; - } - } - return 12 /* StringLiteral */; - } - function isUnicodeEscape(character) { - return character === 92 /* backslash */ && str.charCodeAt(index + 1) === 117 /* u */; - } - function peekCharOrUnicodeEscape() { - var character = str.charCodeAt(index); - if (isUnicodeEscape(character)) { - return peekUnicodeOrHexEscape(); - } - else { - return character; - } - } - function peekUnicodeOrHexEscape() { - var startIndex = index; - var ch = scanUnicodeOrHexEscape(false); - index = startIndex; - return ch; - } - function scanCharOrUnicodeEscape() { - if (str.charCodeAt(index) === 92 /* backslash */ && str.charCodeAt(index + 1) === 117 /* u */) { - scanUnicodeOrHexEscape(true); - } - else { - index++; - } - } - function scanUnicodeOrHexEscape(report) { - var start = index; - var character = str.charCodeAt(index); - index++; - character = str.charCodeAt(index); - var intChar = 0; - index++; - var count = character === 117 /* u */ ? 4 : 2; - for (var i = 0; i < count; i++) { - var ch2 = str.charCodeAt(index); - if (!TypeScript.CharacterInfo.isHexDigit(ch2)) { - if (report) { - reportDiagnostic(start, index - start, TypeScript.DiagnosticCode.Unrecognized_escape_sequence, undefined); - } - break; - } - intChar = (intChar << 4) + TypeScript.CharacterInfo.hexValue(ch2); - index++; - } - return intChar; - } - function fillTokenInfo(token, text, tokenInfo) { - var fullStart = token.fullStart(); - var fullEnd = fullStart + token.fullWidth(); - reset(text, fullStart, fullEnd); - scanTriviaInfo(false); - var start = index; - scanSyntaxKind(isContextualToken(token)); - var end = index; - tokenInfo.leadingTriviaWidth = start - fullStart; - tokenInfo.width = end - start; - } - reset(text, 0, text.length()); - return { - setIndex: setIndex, - scan: scan, - fillTokenInfo: fillTokenInfo, - scanTrivia: scanTrivia - }; - } - function isValidIdentifier(text, languageVersion) { - var hadError = false; - var scanner = createScanner(languageVersion, text, function () { return hadError = true; }); - var token = scanner.scan(false); - return !hadError && TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token) && TypeScript.width(token) === text.length(); - } - Scanner.isValidIdentifier = isValidIdentifier; - function createParserSource(fileName, text, languageVersion) { - var _absolutePosition = 0; - var _tokenDiagnostics = []; - var rewindPointPool = []; - var rewindPointPoolCount = 0; - var lastDiagnostic = undefined; - var reportDiagnostic = function (position, fullWidth, diagnosticKey, args) { - lastDiagnostic = new TypeScript.Diagnostic(fileName, text.lineMap(), position, fullWidth, diagnosticKey, args); - }; - var slidingWindow = new TypeScript.SlidingWindow(fetchNextItem, TypeScript.ArrayUtilities.createArray(1024, undefined), undefined); - var scanner = createScanner(languageVersion, text, reportDiagnostic); - function release() { - slidingWindow = undefined; - scanner = undefined; - _tokenDiagnostics = []; - rewindPointPool = []; - lastDiagnostic = undefined; - reportDiagnostic = undefined; - } - function currentNode() { - return undefined; - } - function consumeNode(node) { - throw TypeScript.Errors.invalidOperation(); - } - function absolutePosition() { - return _absolutePosition; - } - function tokenDiagnostics() { - return _tokenDiagnostics; - } - function getOrCreateRewindPoint() { - if (rewindPointPoolCount === 0) { - return {}; - } - rewindPointPoolCount--; - var result = rewindPointPool[rewindPointPoolCount]; - rewindPointPool[rewindPointPoolCount] = undefined; - return result; - } - function getRewindPoint() { - var slidingWindowIndex = slidingWindow.getAndPinAbsoluteIndex(); - var rewindPoint = getOrCreateRewindPoint(); - rewindPoint.slidingWindowIndex = slidingWindowIndex; - rewindPoint.absolutePosition = _absolutePosition; - return rewindPoint; - } - function rewind(rewindPoint) { - slidingWindow.rewindToPinnedIndex(rewindPoint.slidingWindowIndex); - _absolutePosition = rewindPoint.absolutePosition; - } - function releaseRewindPoint(rewindPoint) { - slidingWindow.releaseAndUnpinAbsoluteIndex(rewindPoint.absoluteIndex); - rewindPointPool[rewindPointPoolCount] = rewindPoint; - rewindPointPoolCount++; - } - function fetchNextItem(allowContextualToken) { - var token = scanner.scan(allowContextualToken); - if (lastDiagnostic === undefined) { - return token; - } - _tokenDiagnostics.push(lastDiagnostic); - lastDiagnostic = undefined; - return TypeScript.Syntax.realizeToken(token, text); - } - function peekToken(n) { - return slidingWindow.peekItemN(n); - } - function consumeToken(token) { - _absolutePosition += token.fullWidth(); - slidingWindow.moveToNextItem(); - } - function currentToken() { - return slidingWindow.currentItem(false); - } - function removeDiagnosticsOnOrAfterPosition(position) { - var tokenDiagnosticsLength = _tokenDiagnostics.length; - while (tokenDiagnosticsLength > 0) { - var diagnostic = _tokenDiagnostics[tokenDiagnosticsLength - 1]; - if (diagnostic.start() >= position) { - tokenDiagnosticsLength--; - _tokenDiagnostics.pop(); - } - else { - break; - } - } - } - function resetToPosition(absolutePosition) { - TypeScript.Debug.assert(absolutePosition <= text.length(), "Trying to set the position outside the bounds of the text!"); - _absolutePosition = absolutePosition; - removeDiagnosticsOnOrAfterPosition(absolutePosition); - slidingWindow.disgardAllItemsFromCurrentIndexOnwards(); - scanner.setIndex(absolutePosition); - } - function currentContextualToken() { - resetToPosition(_absolutePosition); - var token = slidingWindow.currentItem(true); - return token; - } - return { - text: text, - fileName: fileName, - languageVersion: languageVersion, - currentNode: currentNode, - currentToken: currentToken, - currentContextualToken: currentContextualToken, - peekToken: peekToken, - consumeNode: consumeNode, - consumeToken: consumeToken, - getRewindPoint: getRewindPoint, - rewind: rewind, - releaseRewindPoint: releaseRewindPoint, - tokenDiagnostics: tokenDiagnostics, - release: release, - absolutePosition: absolutePosition, - resetToPosition: resetToPosition - }; - } - Scanner.createParserSource = createParserSource; - function fixedWidthTokenLength(kind) { - switch (kind) { - case 17 /* BreakKeyword */: return 5; - case 18 /* CaseKeyword */: return 4; - case 19 /* CatchKeyword */: return 5; - case 20 /* ContinueKeyword */: return 8; - case 21 /* DebuggerKeyword */: return 8; - case 22 /* DefaultKeyword */: return 7; - case 23 /* DeleteKeyword */: return 6; - case 24 /* DoKeyword */: return 2; - case 25 /* ElseKeyword */: return 4; - case 26 /* FalseKeyword */: return 5; - case 27 /* FinallyKeyword */: return 7; - case 28 /* ForKeyword */: return 3; - case 29 /* FunctionKeyword */: return 8; - case 30 /* IfKeyword */: return 2; - case 31 /* InKeyword */: return 2; - case 32 /* InstanceOfKeyword */: return 10; - case 33 /* NewKeyword */: return 3; - case 34 /* NullKeyword */: return 4; - case 35 /* ReturnKeyword */: return 6; - case 36 /* SwitchKeyword */: return 6; - case 37 /* ThisKeyword */: return 4; - case 38 /* ThrowKeyword */: return 5; - case 39 /* TrueKeyword */: return 4; - case 40 /* TryKeyword */: return 3; - case 41 /* TypeOfKeyword */: return 6; - case 42 /* VarKeyword */: return 3; - case 43 /* VoidKeyword */: return 4; - case 44 /* WhileKeyword */: return 5; - case 45 /* WithKeyword */: return 4; - case 46 /* ClassKeyword */: return 5; - case 47 /* ConstKeyword */: return 5; - case 48 /* EnumKeyword */: return 4; - case 49 /* ExportKeyword */: return 6; - case 50 /* ExtendsKeyword */: return 7; - case 51 /* ImportKeyword */: return 6; - case 52 /* SuperKeyword */: return 5; - case 53 /* ImplementsKeyword */: return 10; - case 54 /* InterfaceKeyword */: return 9; - case 55 /* LetKeyword */: return 3; - case 56 /* PackageKeyword */: return 7; - case 57 /* PrivateKeyword */: return 7; - case 58 /* ProtectedKeyword */: return 9; - case 59 /* PublicKeyword */: return 6; - case 60 /* StaticKeyword */: return 6; - case 61 /* YieldKeyword */: return 5; - case 62 /* AnyKeyword */: return 3; - case 63 /* BooleanKeyword */: return 7; - case 64 /* ConstructorKeyword */: return 11; - case 65 /* DeclareKeyword */: return 7; - case 66 /* GetKeyword */: return 3; - case 67 /* ModuleKeyword */: return 6; - case 68 /* RequireKeyword */: return 7; - case 69 /* NumberKeyword */: return 6; - case 70 /* SetKeyword */: return 3; - case 71 /* StringKeyword */: return 6; - case 72 /* OpenBraceToken */: return 1; - case 73 /* CloseBraceToken */: return 1; - case 74 /* OpenParenToken */: return 1; - case 75 /* CloseParenToken */: return 1; - case 76 /* OpenBracketToken */: return 1; - case 77 /* CloseBracketToken */: return 1; - case 78 /* DotToken */: return 1; - case 79 /* DotDotDotToken */: return 3; - case 80 /* SemicolonToken */: return 1; - case 81 /* CommaToken */: return 1; - case 82 /* LessThanToken */: return 1; - case 83 /* GreaterThanToken */: return 1; - case 84 /* LessThanEqualsToken */: return 2; - case 85 /* GreaterThanEqualsToken */: return 2; - case 86 /* EqualsEqualsToken */: return 2; - case 87 /* EqualsGreaterThanToken */: return 2; - case 88 /* ExclamationEqualsToken */: return 2; - case 89 /* EqualsEqualsEqualsToken */: return 3; - case 90 /* ExclamationEqualsEqualsToken */: return 3; - case 91 /* PlusToken */: return 1; - case 92 /* MinusToken */: return 1; - case 93 /* AsteriskToken */: return 1; - case 94 /* PercentToken */: return 1; - case 95 /* PlusPlusToken */: return 2; - case 96 /* MinusMinusToken */: return 2; - case 97 /* LessThanLessThanToken */: return 2; - case 98 /* GreaterThanGreaterThanToken */: return 2; - case 99 /* GreaterThanGreaterThanGreaterThanToken */: return 3; - case 100 /* AmpersandToken */: return 1; - case 101 /* BarToken */: return 1; - case 102 /* CaretToken */: return 1; - case 103 /* ExclamationToken */: return 1; - case 104 /* TildeToken */: return 1; - case 105 /* AmpersandAmpersandToken */: return 2; - case 106 /* BarBarToken */: return 2; - case 107 /* QuestionToken */: return 1; - case 108 /* ColonToken */: return 1; - case 109 /* EqualsToken */: return 1; - case 110 /* PlusEqualsToken */: return 2; - case 111 /* MinusEqualsToken */: return 2; - case 112 /* AsteriskEqualsToken */: return 2; - case 113 /* PercentEqualsToken */: return 2; - case 114 /* LessThanLessThanEqualsToken */: return 3; - case 115 /* GreaterThanGreaterThanEqualsToken */: return 3; - case 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */: return 4; - case 117 /* AmpersandEqualsToken */: return 2; - case 118 /* BarEqualsToken */: return 2; - case 119 /* CaretEqualsToken */: return 2; - case 120 /* SlashToken */: return 1; - case 121 /* SlashEqualsToken */: return 2; - default: throw new Error(); - } - } - })(Scanner = TypeScript.Scanner || (TypeScript.Scanner = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ScannerUtilities; - (function (ScannerUtilities) { - function fixedWidthTokenLength(kind) { - switch (kind) { - case 17 /* BreakKeyword */: return 5; - case 18 /* CaseKeyword */: return 4; - case 19 /* CatchKeyword */: return 5; - case 20 /* ContinueKeyword */: return 8; - case 21 /* DebuggerKeyword */: return 8; - case 22 /* DefaultKeyword */: return 7; - case 23 /* DeleteKeyword */: return 6; - case 24 /* DoKeyword */: return 2; - case 25 /* ElseKeyword */: return 4; - case 26 /* FalseKeyword */: return 5; - case 27 /* FinallyKeyword */: return 7; - case 28 /* ForKeyword */: return 3; - case 29 /* FunctionKeyword */: return 8; - case 30 /* IfKeyword */: return 2; - case 31 /* InKeyword */: return 2; - case 32 /* InstanceOfKeyword */: return 10; - case 33 /* NewKeyword */: return 3; - case 34 /* NullKeyword */: return 4; - case 35 /* ReturnKeyword */: return 6; - case 36 /* SwitchKeyword */: return 6; - case 37 /* ThisKeyword */: return 4; - case 38 /* ThrowKeyword */: return 5; - case 39 /* TrueKeyword */: return 4; - case 40 /* TryKeyword */: return 3; - case 41 /* TypeOfKeyword */: return 6; - case 42 /* VarKeyword */: return 3; - case 43 /* VoidKeyword */: return 4; - case 44 /* WhileKeyword */: return 5; - case 45 /* WithKeyword */: return 4; - case 46 /* ClassKeyword */: return 5; - case 47 /* ConstKeyword */: return 5; - case 48 /* EnumKeyword */: return 4; - case 49 /* ExportKeyword */: return 6; - case 50 /* ExtendsKeyword */: return 7; - case 51 /* ImportKeyword */: return 6; - case 52 /* SuperKeyword */: return 5; - case 53 /* ImplementsKeyword */: return 10; - case 54 /* InterfaceKeyword */: return 9; - case 55 /* LetKeyword */: return 3; - case 56 /* PackageKeyword */: return 7; - case 57 /* PrivateKeyword */: return 7; - case 58 /* ProtectedKeyword */: return 9; - case 59 /* PublicKeyword */: return 6; - case 60 /* StaticKeyword */: return 6; - case 61 /* YieldKeyword */: return 5; - case 62 /* AnyKeyword */: return 3; - case 63 /* BooleanKeyword */: return 7; - case 64 /* ConstructorKeyword */: return 11; - case 65 /* DeclareKeyword */: return 7; - case 66 /* GetKeyword */: return 3; - case 67 /* ModuleKeyword */: return 6; - case 68 /* RequireKeyword */: return 7; - case 69 /* NumberKeyword */: return 6; - case 70 /* SetKeyword */: return 3; - case 71 /* StringKeyword */: return 6; - case 72 /* OpenBraceToken */: return 1; - case 73 /* CloseBraceToken */: return 1; - case 74 /* OpenParenToken */: return 1; - case 75 /* CloseParenToken */: return 1; - case 76 /* OpenBracketToken */: return 1; - case 77 /* CloseBracketToken */: return 1; - case 78 /* DotToken */: return 1; - case 79 /* DotDotDotToken */: return 3; - case 80 /* SemicolonToken */: return 1; - case 81 /* CommaToken */: return 1; - case 82 /* LessThanToken */: return 1; - case 83 /* GreaterThanToken */: return 1; - case 84 /* LessThanEqualsToken */: return 2; - case 85 /* GreaterThanEqualsToken */: return 2; - case 86 /* EqualsEqualsToken */: return 2; - case 87 /* EqualsGreaterThanToken */: return 2; - case 88 /* ExclamationEqualsToken */: return 2; - case 89 /* EqualsEqualsEqualsToken */: return 3; - case 90 /* ExclamationEqualsEqualsToken */: return 3; - case 91 /* PlusToken */: return 1; - case 92 /* MinusToken */: return 1; - case 93 /* AsteriskToken */: return 1; - case 94 /* PercentToken */: return 1; - case 95 /* PlusPlusToken */: return 2; - case 96 /* MinusMinusToken */: return 2; - case 97 /* LessThanLessThanToken */: return 2; - case 98 /* GreaterThanGreaterThanToken */: return 2; - case 99 /* GreaterThanGreaterThanGreaterThanToken */: return 3; - case 100 /* AmpersandToken */: return 1; - case 101 /* BarToken */: return 1; - case 102 /* CaretToken */: return 1; - case 103 /* ExclamationToken */: return 1; - case 104 /* TildeToken */: return 1; - case 105 /* AmpersandAmpersandToken */: return 2; - case 106 /* BarBarToken */: return 2; - case 107 /* QuestionToken */: return 1; - case 108 /* ColonToken */: return 1; - case 109 /* EqualsToken */: return 1; - case 110 /* PlusEqualsToken */: return 2; - case 111 /* MinusEqualsToken */: return 2; - case 112 /* AsteriskEqualsToken */: return 2; - case 113 /* PercentEqualsToken */: return 2; - case 114 /* LessThanLessThanEqualsToken */: return 3; - case 115 /* GreaterThanGreaterThanEqualsToken */: return 3; - case 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */: return 4; - case 117 /* AmpersandEqualsToken */: return 2; - case 118 /* BarEqualsToken */: return 2; - case 119 /* CaretEqualsToken */: return 2; - case 120 /* SlashToken */: return 1; - case 121 /* SlashEqualsToken */: return 2; - default: throw new Error(); - } - } - ScannerUtilities.fixedWidthTokenLength = fixedWidthTokenLength; - function identifierKind(str, start, length) { - switch (length) { - case 2: - switch (str.charCodeAt(start)) { - case 100 /* d */: return (str.charCodeAt(start + 1) === 111 /* o */) ? 24 /* DoKeyword */ : 9 /* IdentifierName */; - case 105 /* i */: - switch (str.charCodeAt(start + 1)) { - case 102 /* f */: return 30 /* IfKeyword */; - case 110 /* n */: return 31 /* InKeyword */; - default: return 9 /* IdentifierName */; - } - default: return 9 /* IdentifierName */; - } - case 3: - switch (str.charCodeAt(start)) { - case 97 /* a */: return (str.charCodeAt(start + 1) === 110 /* n */ && str.charCodeAt(start + 2) === 121 /* y */) ? 62 /* AnyKeyword */ : 9 /* IdentifierName */; - case 102 /* f */: return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 114 /* r */) ? 28 /* ForKeyword */ : 9 /* IdentifierName */; - case 103 /* g */: return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */) ? 66 /* GetKeyword */ : 9 /* IdentifierName */; - case 108 /* l */: return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */) ? 55 /* LetKeyword */ : 9 /* IdentifierName */; - case 110 /* n */: return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 119 /* w */) ? 33 /* NewKeyword */ : 9 /* IdentifierName */; - case 115 /* s */: return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */) ? 70 /* SetKeyword */ : 9 /* IdentifierName */; - case 116 /* t */: return (str.charCodeAt(start + 1) === 114 /* r */ && str.charCodeAt(start + 2) === 121 /* y */) ? 40 /* TryKeyword */ : 9 /* IdentifierName */; - case 118 /* v */: return (str.charCodeAt(start + 1) === 97 /* a */ && str.charCodeAt(start + 2) === 114 /* r */) ? 42 /* VarKeyword */ : 9 /* IdentifierName */; - default: return 9 /* IdentifierName */; - } - case 4: - switch (str.charCodeAt(start)) { - case 99 /* c */: return (str.charCodeAt(start + 1) === 97 /* a */ && str.charCodeAt(start + 2) === 115 /* s */ && str.charCodeAt(start + 3) === 101 /* e */) ? 18 /* CaseKeyword */ : 9 /* IdentifierName */; - case 101 /* e */: - switch (str.charCodeAt(start + 1)) { - case 108 /* l */: return (str.charCodeAt(start + 2) === 115 /* s */ && str.charCodeAt(start + 3) === 101 /* e */) ? 25 /* ElseKeyword */ : 9 /* IdentifierName */; - case 110 /* n */: return (str.charCodeAt(start + 2) === 117 /* u */ && str.charCodeAt(start + 3) === 109 /* m */) ? 48 /* EnumKeyword */ : 9 /* IdentifierName */; - default: return 9 /* IdentifierName */; - } - case 110 /* n */: return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 108 /* l */ && str.charCodeAt(start + 3) === 108 /* l */) ? 34 /* NullKeyword */ : 9 /* IdentifierName */; - case 116 /* t */: - switch (str.charCodeAt(start + 1)) { - case 104 /* h */: return (str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 115 /* s */) ? 37 /* ThisKeyword */ : 9 /* IdentifierName */; - case 114 /* r */: return (str.charCodeAt(start + 2) === 117 /* u */ && str.charCodeAt(start + 3) === 101 /* e */) ? 39 /* TrueKeyword */ : 9 /* IdentifierName */; - default: return 9 /* IdentifierName */; - } - case 118 /* v */: return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 100 /* d */) ? 43 /* VoidKeyword */ : 9 /* IdentifierName */; - case 119 /* w */: return (str.charCodeAt(start + 1) === 105 /* i */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 104 /* h */) ? 45 /* WithKeyword */ : 9 /* IdentifierName */; - default: return 9 /* IdentifierName */; - } - case 5: - switch (str.charCodeAt(start)) { - case 98 /* b */: return (str.charCodeAt(start + 1) === 114 /* r */ && str.charCodeAt(start + 2) === 101 /* e */ && str.charCodeAt(start + 3) === 97 /* a */ && str.charCodeAt(start + 4) === 107 /* k */) ? 17 /* BreakKeyword */ : 9 /* IdentifierName */; - case 99 /* c */: - switch (str.charCodeAt(start + 1)) { - case 97 /* a */: return (str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 99 /* c */ && str.charCodeAt(start + 4) === 104 /* h */) ? 19 /* CatchKeyword */ : 9 /* IdentifierName */; - case 108 /* l */: return (str.charCodeAt(start + 2) === 97 /* a */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 115 /* s */) ? 46 /* ClassKeyword */ : 9 /* IdentifierName */; - case 111 /* o */: return (str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 116 /* t */) ? 47 /* ConstKeyword */ : 9 /* IdentifierName */; - default: return 9 /* IdentifierName */; - } - case 102 /* f */: return (str.charCodeAt(start + 1) === 97 /* a */ && str.charCodeAt(start + 2) === 108 /* l */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 101 /* e */) ? 26 /* FalseKeyword */ : 9 /* IdentifierName */; - case 115 /* s */: return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 114 /* r */) ? 52 /* SuperKeyword */ : 9 /* IdentifierName */; - case 116 /* t */: return (str.charCodeAt(start + 1) === 104 /* h */ && str.charCodeAt(start + 2) === 114 /* r */ && str.charCodeAt(start + 3) === 111 /* o */ && str.charCodeAt(start + 4) === 119 /* w */) ? 38 /* ThrowKeyword */ : 9 /* IdentifierName */; - case 119 /* w */: return (str.charCodeAt(start + 1) === 104 /* h */ && str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 101 /* e */) ? 44 /* WhileKeyword */ : 9 /* IdentifierName */; - case 121 /* y */: return (str.charCodeAt(start + 1) === 105 /* i */ && str.charCodeAt(start + 2) === 101 /* e */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 100 /* d */) ? 61 /* YieldKeyword */ : 9 /* IdentifierName */; - default: return 9 /* IdentifierName */; - } - case 6: - switch (str.charCodeAt(start)) { - case 100 /* d */: return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 108 /* l */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 116 /* t */ && str.charCodeAt(start + 5) === 101 /* e */) ? 23 /* DeleteKeyword */ : 9 /* IdentifierName */; - case 101 /* e */: return (str.charCodeAt(start + 1) === 120 /* x */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 111 /* o */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 116 /* t */) ? 49 /* ExportKeyword */ : 9 /* IdentifierName */; - case 105 /* i */: return (str.charCodeAt(start + 1) === 109 /* m */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 111 /* o */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 116 /* t */) ? 51 /* ImportKeyword */ : 9 /* IdentifierName */; - case 109 /* m */: return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 100 /* d */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 108 /* l */ && str.charCodeAt(start + 5) === 101 /* e */) ? 67 /* ModuleKeyword */ : 9 /* IdentifierName */; - case 110 /* n */: return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 109 /* m */ && str.charCodeAt(start + 3) === 98 /* b */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 114 /* r */) ? 69 /* NumberKeyword */ : 9 /* IdentifierName */; - case 112 /* p */: return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 98 /* b */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 99 /* c */) ? 59 /* PublicKeyword */ : 9 /* IdentifierName */; - case 114 /* r */: return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 110 /* n */) ? 35 /* ReturnKeyword */ : 9 /* IdentifierName */; - case 115 /* s */: - switch (str.charCodeAt(start + 1)) { - case 116 /* t */: - switch (str.charCodeAt(start + 2)) { - case 97 /* a */: return (str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 99 /* c */) ? 60 /* StaticKeyword */ : 9 /* IdentifierName */; - case 114 /* r */: return (str.charCodeAt(start + 3) === 105 /* i */ && str.charCodeAt(start + 4) === 110 /* n */ && str.charCodeAt(start + 5) === 103 /* g */) ? 71 /* StringKeyword */ : 9 /* IdentifierName */; - default: return 9 /* IdentifierName */; - } - case 119 /* w */: return (str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 99 /* c */ && str.charCodeAt(start + 5) === 104 /* h */) ? 36 /* SwitchKeyword */ : 9 /* IdentifierName */; - default: return 9 /* IdentifierName */; - } - case 116 /* t */: return (str.charCodeAt(start + 1) === 121 /* y */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 111 /* o */ && str.charCodeAt(start + 5) === 102 /* f */) ? 41 /* TypeOfKeyword */ : 9 /* IdentifierName */; - default: return 9 /* IdentifierName */; - } - case 7: - switch (str.charCodeAt(start)) { - case 98 /* b */: return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 111 /* o */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 97 /* a */ && str.charCodeAt(start + 6) === 110 /* n */) ? 63 /* BooleanKeyword */ : 9 /* IdentifierName */; - case 100 /* d */: - switch (str.charCodeAt(start + 1)) { - case 101 /* e */: - switch (str.charCodeAt(start + 2)) { - case 99 /* c */: return (str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 114 /* r */ && str.charCodeAt(start + 6) === 101 /* e */) ? 65 /* DeclareKeyword */ : 9 /* IdentifierName */; - case 102 /* f */: return (str.charCodeAt(start + 3) === 97 /* a */ && str.charCodeAt(start + 4) === 117 /* u */ && str.charCodeAt(start + 5) === 108 /* l */ && str.charCodeAt(start + 6) === 116 /* t */) ? 22 /* DefaultKeyword */ : 9 /* IdentifierName */; - default: return 9 /* IdentifierName */; - } - default: return 9 /* IdentifierName */; - } - case 101 /* e */: return (str.charCodeAt(start + 1) === 120 /* x */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 110 /* n */ && str.charCodeAt(start + 5) === 100 /* d */ && str.charCodeAt(start + 6) === 115 /* s */) ? 50 /* ExtendsKeyword */ : 9 /* IdentifierName */; - case 102 /* f */: return (str.charCodeAt(start + 1) === 105 /* i */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 97 /* a */ && str.charCodeAt(start + 4) === 108 /* l */ && str.charCodeAt(start + 5) === 108 /* l */ && str.charCodeAt(start + 6) === 121 /* y */) ? 27 /* FinallyKeyword */ : 9 /* IdentifierName */; - case 112 /* p */: - switch (str.charCodeAt(start + 1)) { - case 97 /* a */: return (str.charCodeAt(start + 2) === 99 /* c */ && str.charCodeAt(start + 3) === 107 /* k */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 103 /* g */ && str.charCodeAt(start + 6) === 101 /* e */) ? 56 /* PackageKeyword */ : 9 /* IdentifierName */; - case 114 /* r */: return (str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 118 /* v */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 116 /* t */ && str.charCodeAt(start + 6) === 101 /* e */) ? 57 /* PrivateKeyword */ : 9 /* IdentifierName */; - default: return 9 /* IdentifierName */; - } - case 114 /* r */: return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 113 /* q */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 114 /* r */ && str.charCodeAt(start + 6) === 101 /* e */) ? 68 /* RequireKeyword */ : 9 /* IdentifierName */; - default: return 9 /* IdentifierName */; - } - case 8: - switch (str.charCodeAt(start)) { - case 99 /* c */: return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 110 /* n */ && str.charCodeAt(start + 6) === 117 /* u */ && str.charCodeAt(start + 7) === 101 /* e */) ? 20 /* ContinueKeyword */ : 9 /* IdentifierName */; - case 100 /* d */: return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 98 /* b */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 103 /* g */ && str.charCodeAt(start + 5) === 103 /* g */ && str.charCodeAt(start + 6) === 101 /* e */ && str.charCodeAt(start + 7) === 114 /* r */) ? 21 /* DebuggerKeyword */ : 9 /* IdentifierName */; - case 102 /* f */: return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 99 /* c */ && str.charCodeAt(start + 4) === 116 /* t */ && str.charCodeAt(start + 5) === 105 /* i */ && str.charCodeAt(start + 6) === 111 /* o */ && str.charCodeAt(start + 7) === 110 /* n */) ? 29 /* FunctionKeyword */ : 9 /* IdentifierName */; - default: return 9 /* IdentifierName */; - } - case 9: - switch (str.charCodeAt(start)) { - case 105 /* i */: return (str.charCodeAt(start + 1) === 110 /* n */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 102 /* f */ && str.charCodeAt(start + 6) === 97 /* a */ && str.charCodeAt(start + 7) === 99 /* c */ && str.charCodeAt(start + 8) === 101 /* e */) ? 54 /* InterfaceKeyword */ : 9 /* IdentifierName */; - case 112 /* p */: return (str.charCodeAt(start + 1) === 114 /* r */ && str.charCodeAt(start + 2) === 111 /* o */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 99 /* c */ && str.charCodeAt(start + 6) === 116 /* t */ && str.charCodeAt(start + 7) === 101 /* e */ && str.charCodeAt(start + 8) === 100 /* d */) ? 58 /* ProtectedKeyword */ : 9 /* IdentifierName */; - default: return 9 /* IdentifierName */; - } - case 10: - switch (str.charCodeAt(start)) { - case 105 /* i */: - switch (str.charCodeAt(start + 1)) { - case 109 /* m */: return (str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 109 /* m */ && str.charCodeAt(start + 6) === 101 /* e */ && str.charCodeAt(start + 7) === 110 /* n */ && str.charCodeAt(start + 8) === 116 /* t */ && str.charCodeAt(start + 9) === 115 /* s */) ? 53 /* ImplementsKeyword */ : 9 /* IdentifierName */; - case 110 /* n */: return (str.charCodeAt(start + 2) === 115 /* s */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 110 /* n */ && str.charCodeAt(start + 6) === 99 /* c */ && str.charCodeAt(start + 7) === 101 /* e */ && str.charCodeAt(start + 8) === 111 /* o */ && str.charCodeAt(start + 9) === 102 /* f */) ? 32 /* InstanceOfKeyword */ : 9 /* IdentifierName */; - default: return 9 /* IdentifierName */; - } - default: return 9 /* IdentifierName */; - } - case 11: return (str.charCodeAt(start) === 99 /* c */ && str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 116 /* t */ && str.charCodeAt(start + 5) === 114 /* r */ && str.charCodeAt(start + 6) === 117 /* u */ && str.charCodeAt(start + 7) === 99 /* c */ && str.charCodeAt(start + 8) === 116 /* t */ && str.charCodeAt(start + 9) === 111 /* o */ && str.charCodeAt(start + 10) === 114 /* r */) ? 64 /* ConstructorKeyword */ : 9 /* IdentifierName */; - default: return 9 /* IdentifierName */; - } - } - ScannerUtilities.identifierKind = identifierKind; - })(ScannerUtilities = TypeScript.ScannerUtilities || (TypeScript.ScannerUtilities = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SlidingWindow = (function () { - function SlidingWindow(fetchNextItem, window, defaultValue, sourceLength) { - if (sourceLength === void 0) { sourceLength = -1; } - this.fetchNextItem = fetchNextItem; - this.window = window; - this.defaultValue = defaultValue; - this.sourceLength = sourceLength; - this.windowCount = 0; - this.windowAbsoluteStartIndex = 0; - this.currentRelativeItemIndex = 0; - this._pinCount = 0; - this.firstPinnedAbsoluteIndex = -1; - } - SlidingWindow.prototype.addMoreItemsToWindow = function (argument) { - var sourceLength = this.sourceLength; - if (sourceLength >= 0 && this.absoluteIndex() >= sourceLength) { - return false; - } - if (this.windowCount >= this.window.length) { - this.tryShiftOrGrowWindow(); - } - var item = this.fetchNextItem(argument); - this.window[this.windowCount] = item; - this.windowCount++; - return true; - }; - SlidingWindow.prototype.tryShiftOrGrowWindow = function () { - var currentIndexIsPastWindowHalfwayPoint = this.currentRelativeItemIndex > (this.window.length >>> 1); - var isAllowedToShift = this.firstPinnedAbsoluteIndex === -1 || this.firstPinnedAbsoluteIndex > this.windowAbsoluteStartIndex; - if (currentIndexIsPastWindowHalfwayPoint && isAllowedToShift) { - var shiftStartIndex = this.firstPinnedAbsoluteIndex === -1 ? this.currentRelativeItemIndex : this.firstPinnedAbsoluteIndex - this.windowAbsoluteStartIndex; - var shiftCount = this.windowCount - shiftStartIndex; - if (shiftCount > 0) { - TypeScript.ArrayUtilities.copy(this.window, shiftStartIndex, this.window, 0, shiftCount); - } - this.windowAbsoluteStartIndex += shiftStartIndex; - this.windowCount -= shiftStartIndex; - this.currentRelativeItemIndex -= shiftStartIndex; - } - else { - TypeScript.ArrayUtilities.grow(this.window, this.window.length * 2, this.defaultValue); - } - }; - SlidingWindow.prototype.absoluteIndex = function () { - return this.windowAbsoluteStartIndex + this.currentRelativeItemIndex; - }; - SlidingWindow.prototype.isAtEndOfSource = function () { - return this.absoluteIndex() >= this.sourceLength; - }; - SlidingWindow.prototype.getAndPinAbsoluteIndex = function () { - var absoluteIndex = this.absoluteIndex(); - var pinCount = this._pinCount++; - if (pinCount === 0) { - this.firstPinnedAbsoluteIndex = absoluteIndex; - } - return absoluteIndex; - }; - SlidingWindow.prototype.releaseAndUnpinAbsoluteIndex = function (absoluteIndex) { - this._pinCount--; - if (this._pinCount === 0) { - this.firstPinnedAbsoluteIndex = -1; - } - }; - SlidingWindow.prototype.rewindToPinnedIndex = function (absoluteIndex) { - var relativeIndex = absoluteIndex - this.windowAbsoluteStartIndex; - this.currentRelativeItemIndex = relativeIndex; - }; - SlidingWindow.prototype.currentItem = function (argument) { - if (this.currentRelativeItemIndex >= this.windowCount) { - if (!this.addMoreItemsToWindow(argument)) { - return this.defaultValue; - } - } - return this.window[this.currentRelativeItemIndex]; - }; - SlidingWindow.prototype.peekItemN = function (n) { - while (this.currentRelativeItemIndex + n >= this.windowCount) { - if (!this.addMoreItemsToWindow(undefined)) { - return this.defaultValue; - } - } - return this.window[this.currentRelativeItemIndex + n]; - }; - SlidingWindow.prototype.moveToNextItem = function () { - this.currentRelativeItemIndex++; - }; - SlidingWindow.prototype.disgardAllItemsFromCurrentIndexOnwards = function () { - this.windowCount = this.currentRelativeItemIndex; - }; - return SlidingWindow; - })(); - TypeScript.SlidingWindow = SlidingWindow; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Syntax; - (function (Syntax) { - Syntax._nextSyntaxID = 1; - function nodeHasSkippedOrMissingTokens(node) { - for (var i = 0; i < TypeScript.childCount(node); i++) { - var child = TypeScript.childAt(node, i); - if (TypeScript.isToken(child)) { - var token = child; - if (token.hasSkippedToken() || (TypeScript.width(token) === 0 && token.kind() !== 8 /* EndOfFileToken */)) { - return true; - } - } - } - return false; - } - Syntax.nodeHasSkippedOrMissingTokens = nodeHasSkippedOrMissingTokens; - function isUnterminatedStringLiteral(token) { - if (token && token.kind() === 12 /* StringLiteral */) { - var text = token.text(); - return text.length < 2 || text.charCodeAt(text.length - 1) !== text.charCodeAt(0); - } - return false; - } - Syntax.isUnterminatedStringLiteral = isUnterminatedStringLiteral; - function isUnterminatedMultilineCommentTrivia(trivia) { - if (trivia && trivia.kind() === 4 /* MultiLineCommentTrivia */) { - var text = trivia.fullText(); - return text.length < 4 || text.substring(text.length - 2) !== "*/"; - } - return false; - } - Syntax.isUnterminatedMultilineCommentTrivia = isUnterminatedMultilineCommentTrivia; - function isEntirelyInsideCommentTrivia(trivia, fullStart, position) { - if (trivia && trivia.isComment() && position > fullStart) { - var end = fullStart + trivia.fullWidth(); - if (position < end) { - return true; - } - else if (position === end) { - return trivia.kind() === 5 /* SingleLineCommentTrivia */ || isUnterminatedMultilineCommentTrivia(trivia); - } - } - return false; - } - Syntax.isEntirelyInsideCommentTrivia = isEntirelyInsideCommentTrivia; - function isEntirelyInsideComment(sourceUnit, position) { - var positionedToken = TypeScript.findToken(sourceUnit, position); - var fullStart = positionedToken.fullStart(); - var triviaList = undefined; - var lastTriviaBeforeToken = undefined; - if (positionedToken.kind() === 8 /* EndOfFileToken */) { - if (positionedToken.hasLeadingTrivia()) { - triviaList = positionedToken.leadingTrivia(); - } - else { - positionedToken = TypeScript.previousToken(positionedToken); - if (positionedToken) { - if (positionedToken && positionedToken.hasTrailingTrivia()) { - triviaList = positionedToken.trailingTrivia(); - fullStart = TypeScript.end(positionedToken); - } - } - } - } - else { - if (position <= (fullStart + positionedToken.leadingTriviaWidth())) { - triviaList = positionedToken.leadingTrivia(); - } - else if (position >= (fullStart + TypeScript.width(positionedToken))) { - triviaList = positionedToken.trailingTrivia(); - fullStart = TypeScript.end(positionedToken); - } - } - if (triviaList) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (position <= fullStart) { - break; - } - else if (position <= fullStart + trivia.fullWidth() && trivia.isComment()) { - lastTriviaBeforeToken = trivia; - break; - } - fullStart += trivia.fullWidth(); - } - } - return lastTriviaBeforeToken && isEntirelyInsideCommentTrivia(lastTriviaBeforeToken, fullStart, position); - } - Syntax.isEntirelyInsideComment = isEntirelyInsideComment; - function isEntirelyInStringOrRegularExpressionLiteral(sourceUnit, position) { - var positionedToken = TypeScript.findToken(sourceUnit, position); - if (positionedToken) { - if (positionedToken.kind() === 8 /* EndOfFileToken */) { - positionedToken = TypeScript.previousToken(positionedToken); - return positionedToken && positionedToken.trailingTriviaWidth() === 0 && isUnterminatedStringLiteral(positionedToken); - } - else if (position > TypeScript.start(positionedToken)) { - return (position < TypeScript.end(positionedToken) && (positionedToken.kind() === 12 /* StringLiteral */ || positionedToken.kind() === 10 /* RegularExpressionLiteral */)) || (position <= TypeScript.end(positionedToken) && isUnterminatedStringLiteral(positionedToken)); - } - } - return false; - } - Syntax.isEntirelyInStringOrRegularExpressionLiteral = isEntirelyInStringOrRegularExpressionLiteral; - function getAncestorOfKind(positionedToken, kind) { - while (positionedToken && positionedToken.parent) { - if (positionedToken.parent.kind() === kind) { - return positionedToken.parent; - } - positionedToken = positionedToken.parent; - } - return undefined; - } - Syntax.getAncestorOfKind = getAncestorOfKind; - function hasAncestorOfKind(positionedToken, kind) { - return !!getAncestorOfKind(positionedToken, kind); - } - Syntax.hasAncestorOfKind = hasAncestorOfKind; - function isIntegerLiteral(expression) { - if (expression) { - switch (expression.kind()) { - case 169 /* PrefixUnaryExpression */: - var prefixExpr = expression; - if (prefixExpr.operatorToken.kind() == 91 /* PlusToken */ || prefixExpr.operatorToken.kind() === 92 /* MinusToken */) { - expression = prefixExpr.operand; - return TypeScript.isToken(expression) && TypeScript.IntegerUtilities.isInteger(expression.text()); - } - return false; - case 11 /* NumericLiteral */: - var text = expression.text(); - return TypeScript.IntegerUtilities.isInteger(text) || TypeScript.IntegerUtilities.isHexInteger(text); - } - } - return false; - } - Syntax.isIntegerLiteral = isIntegerLiteral; - function containingNode(element) { - var current = element.parent; - while (current && !TypeScript.isNode(current)) { - current = current.parent; - } - return current; - } - Syntax.containingNode = containingNode; - function findTokenOnLeft(sourceUnit, position) { - var positionedToken = TypeScript.findToken(sourceUnit, position); - var _start = TypeScript.start(positionedToken); - if (position > _start) { - return positionedToken; - } - if (positionedToken.fullStart() === 0) { - return undefined; - } - return TypeScript.previousToken(positionedToken); - } - Syntax.findTokenOnLeft = findTokenOnLeft; - function findCompleteTokenOnLeft(sourceUnit, position) { - var positionedToken = TypeScript.findToken(sourceUnit, position); - if (TypeScript.width(positionedToken) > 0 && position >= TypeScript.end(positionedToken)) { - return positionedToken; - } - return TypeScript.previousToken(positionedToken); - } - Syntax.findCompleteTokenOnLeft = findCompleteTokenOnLeft; - function firstTokenInLineContainingPosition(syntaxTree, position) { - var current = TypeScript.findToken(syntaxTree.sourceUnit(), position); - while (true) { - if (isFirstTokenInLine(current, syntaxTree.lineMap())) { - break; - } - current = TypeScript.previousToken(current); - } - return current; - } - Syntax.firstTokenInLineContainingPosition = firstTokenInLineContainingPosition; - function isFirstTokenInLine(token, lineMap) { - var _previousToken = TypeScript.previousToken(token); - if (_previousToken === undefined) { - return true; - } - return lineMap.getLineNumberFromPosition(TypeScript.end(_previousToken)) !== lineMap.getLineNumberFromPosition(TypeScript.start(token)); - } - })(Syntax = TypeScript.Syntax || (TypeScript.Syntax = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function syntaxTree(element) { - if (element) { - while (element) { - if (element.kind() === 122 /* SourceUnit */) { - return element.syntaxTree; - } - element = element.parent; - } - } - return undefined; - } - TypeScript.syntaxTree = syntaxTree; - function parsedInStrictMode(node) { - var info = node.__data; - if (info === undefined) { - return false; - } - return (info & 4 /* NodeParsedInStrictModeMask */) !== 0; - } - TypeScript.parsedInStrictMode = parsedInStrictMode; - function previousToken(token) { - var start = token.fullStart(); - if (start === 0) { - return undefined; - } - return findToken(syntaxTree(token).sourceUnit(), start - 1); - } - TypeScript.previousToken = previousToken; - function findToken(sourceUnit, position) { - if (position < 0) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - var token = findTokenWorker(sourceUnit, 0, position); - if (token) { - TypeScript.Debug.assert(token.fullWidth() > 0); - return token; - } - if (position === fullWidth(sourceUnit)) { - return sourceUnit.endOfFileToken; - } - if (position > fullWidth(sourceUnit)) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - throw TypeScript.Errors.invalidOperation(); - } - TypeScript.findToken = findToken; - function findSkippedTokenInPositionedToken(positionedToken, position) { - var positionInLeadingTriviaList = (position < start(positionedToken)); - return findSkippedTokenInTriviaList(positionedToken, position, positionInLeadingTriviaList); - } - TypeScript.findSkippedTokenInPositionedToken = findSkippedTokenInPositionedToken; - function findSkippedTokenInLeadingTriviaList(positionedToken, position) { - return findSkippedTokenInTriviaList(positionedToken, position, true); - } - TypeScript.findSkippedTokenInLeadingTriviaList = findSkippedTokenInLeadingTriviaList; - function findSkippedTokenInTrailingTriviaList(positionedToken, position) { - return findSkippedTokenInTriviaList(positionedToken, position, false); - } - TypeScript.findSkippedTokenInTrailingTriviaList = findSkippedTokenInTrailingTriviaList; - function findSkippedTokenInTriviaList(positionedToken, position, lookInLeadingTriviaList) { - var triviaList = undefined; - var fullStart; - if (lookInLeadingTriviaList) { - triviaList = positionedToken.leadingTrivia(); - fullStart = positionedToken.fullStart(); - } - else { - triviaList = positionedToken.trailingTrivia(); - fullStart = end(positionedToken); - } - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - var triviaWidth = trivia.fullWidth(); - if (trivia.isSkippedToken() && position >= fullStart && position <= fullStart + triviaWidth) { - return trivia.skippedToken(); - } - fullStart += triviaWidth; - } - } - return undefined; - } - function findTokenWorker(element, elementPosition, position) { - if (isToken(element)) { - return element; - } - for (var i = 0, n = TypeScript.childCount(element); i < n; i++) { - var child = TypeScript.childAt(element, i); - if (child) { - var childFullWidth = fullWidth(child); - var elementEndPosition = elementPosition + childFullWidth; - if (position < elementEndPosition) { - return findTokenWorker(child, elementPosition, position); - } - elementPosition = elementEndPosition; - } - } - return undefined; - } - function tryGetEndOfFileAt(element, position) { - if (element.kind() === 122 /* SourceUnit */ && position === fullWidth(element)) { - var sourceUnit = element; - return sourceUnit.endOfFileToken; - } - return undefined; - } - function nextToken(token, text) { - if (token.kind() === 8 /* EndOfFileToken */) { - return undefined; - } - return findToken(syntaxTree(token).sourceUnit(), fullEnd(token)); - } - TypeScript.nextToken = nextToken; - function isNode(element) { - if (element) { - var kind = element.kind(); - return kind >= TypeScript.SyntaxKind.FirstNode && kind <= TypeScript.SyntaxKind.LastNode; - } - return false; - } - TypeScript.isNode = isNode; - function isTokenKind(kind) { - return kind >= TypeScript.SyntaxKind.FirstToken && kind <= TypeScript.SyntaxKind.LastToken; - } - function isToken(element) { - if (element) { - return isTokenKind(element.kind()); - } - return false; - } - TypeScript.isToken = isToken; - function isList(element) { - return element instanceof Array; - } - TypeScript.isList = isList; - function syntaxID(element) { - var obj = element; - if (obj._syntaxID === undefined) { - obj._syntaxID = TypeScript.Syntax._nextSyntaxID++; - } - return obj._syntaxID; - } - TypeScript.syntaxID = syntaxID; - function collectTextElements(element, elements, text) { - if (element) { - if (isToken(element)) { - elements.push(element.fullText(text)); - } - else { - for (var i = 0, n = TypeScript.childCount(element); i < n; i++) { - collectTextElements(TypeScript.childAt(element, i), elements, text); - } - } - } - } - function fullText(element, text) { - if (isToken(element)) { - return element.fullText(text); - } - var elements = []; - collectTextElements(element, elements, text); - return elements.join(""); - } - TypeScript.fullText = fullText; - function leadingTriviaWidth(element, text) { - var token = firstToken(element); - return token ? token.leadingTriviaWidth(text) : 0; - } - TypeScript.leadingTriviaWidth = leadingTriviaWidth; - function trailingTriviaWidth(element, text) { - var token = lastToken(element); - return token ? token.trailingTriviaWidth(text) : 0; - } - TypeScript.trailingTriviaWidth = trailingTriviaWidth; - function firstToken(element) { - if (element) { - var kind = element.kind(); - if (isTokenKind(kind)) { - return element.fullWidth() > 0 || kind === 8 /* EndOfFileToken */ ? element : undefined; - } - for (var i = 0, n = TypeScript.childCount(element); i < n; i++) { - var token = firstToken(TypeScript.childAt(element, i)); - if (token) { - return token; - } - } - } - return undefined; - } - TypeScript.firstToken = firstToken; - function lastToken(element) { - if (isToken(element)) { - return fullWidth(element) > 0 || element.kind() === 8 /* EndOfFileToken */ ? element : undefined; - } - if (element.kind() === 122 /* SourceUnit */) { - return element.endOfFileToken; - } - for (var i = TypeScript.childCount(element) - 1; i >= 0; i--) { - var child = TypeScript.childAt(element, i); - if (child) { - var token = lastToken(child); - if (token) { - return token; - } - } - } - return undefined; - } - TypeScript.lastToken = lastToken; - function fullStart(element) { - var token = isToken(element) ? element : firstToken(element); - return token ? token.fullStart() : -1; - } - TypeScript.fullStart = fullStart; - function fullWidth(element) { - if (isToken(element)) { - return element.fullWidth(); - } - var info = data(element); - return info >>> 3 /* NodeFullWidthShift */; - } - TypeScript.fullWidth = fullWidth; - function isIncrementallyUnusable(element) { - if (isToken(element)) { - return element.isIncrementallyUnusable(); - } - return (data(element) & 2 /* NodeIncrementallyUnusableMask */) !== 0; - } - TypeScript.isIncrementallyUnusable = isIncrementallyUnusable; - function data(element) { - var dataElement = element; - var info = dataElement.__data; - if (info === undefined) { - info = 0; - } - if ((info & 1 /* NodeDataComputed */) === 0) { - info |= computeData(element); - dataElement.__data = info; - } - return info; - } - function computeData(element) { - var slotCount = TypeScript.childCount(element); - var fullWidth = 0; - var isIncrementallyUnusable = slotCount === 0 && !isList(element); - for (var i = 0, n = slotCount; i < n; i++) { - var child = TypeScript.childAt(element, i); - if (child) { - fullWidth += TypeScript.fullWidth(child); - isIncrementallyUnusable = isIncrementallyUnusable || TypeScript.isIncrementallyUnusable(child); - } - } - return (fullWidth << 3 /* NodeFullWidthShift */) | (isIncrementallyUnusable ? 2 /* NodeIncrementallyUnusableMask */ : 0) | 1 /* NodeDataComputed */; - } - function start(element, text) { - var token = isToken(element) ? element : firstToken(element); - return token ? token.fullStart() + token.leadingTriviaWidth(text) : -1; - } - TypeScript.start = start; - function end(element, text) { - var token = isToken(element) ? element : lastToken(element); - return token ? fullEnd(token) - token.trailingTriviaWidth(text) : -1; - } - TypeScript.end = end; - function width(element, text) { - if (isToken(element)) { - return element.text().length; - } - return fullWidth(element) - leadingTriviaWidth(element, text) - trailingTriviaWidth(element, text); - } - TypeScript.width = width; - function fullEnd(element) { - return fullStart(element) + fullWidth(element); - } - TypeScript.fullEnd = fullEnd; - function existsNewLineBetweenTokens(token1, token2, text) { - if (token1 === token2) { - return false; - } - if (!token1 || !token2) { - return true; - } - var lineMap = text.lineMap(); - return lineMap.getLineNumberFromPosition(end(token1, text)) !== lineMap.getLineNumberFromPosition(start(token2, text)); - } - TypeScript.existsNewLineBetweenTokens = existsNewLineBetweenTokens; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxFacts; - (function (SyntaxFacts) { - function isDirectivePrologueElement(node) { - if (node.kind() === 154 /* ExpressionStatement */) { - var expressionStatement = node; - var expression = expressionStatement.expression; - if (expression.kind() === 12 /* StringLiteral */) { - return true; - } - } - return false; - } - SyntaxFacts.isDirectivePrologueElement = isDirectivePrologueElement; - function isUseStrictDirective(node) { - var expressionStatement = node; - var stringLiteral = expressionStatement.expression; - var text = stringLiteral.text(); - return text === '"use strict"' || text === "'use strict'"; - } - SyntaxFacts.isUseStrictDirective = isUseStrictDirective; - function isIdentifierNameOrAnyKeyword(token) { - var tokenKind = token.kind(); - return tokenKind === 9 /* IdentifierName */ || SyntaxFacts.isAnyKeyword(tokenKind); - } - SyntaxFacts.isIdentifierNameOrAnyKeyword = isIdentifierNameOrAnyKeyword; - function isAccessibilityModifier(kind) { - switch (kind) { - case 59 /* PublicKeyword */: - case 57 /* PrivateKeyword */: - case 58 /* ProtectedKeyword */: - return true; - } - return false; - } - SyntaxFacts.isAccessibilityModifier = isAccessibilityModifier; - })(SyntaxFacts = TypeScript.SyntaxFacts || (TypeScript.SyntaxFacts = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function separatorCount(list) { - return list.length >> 1; - } - TypeScript.separatorCount = separatorCount; - function nonSeparatorCount(list) { - return (list.length + 1) >> 1; - } - TypeScript.nonSeparatorCount = nonSeparatorCount; - function separatorAt(list, index) { - return list[(index << 1) + 1]; - } - TypeScript.separatorAt = separatorAt; - function nonSeparatorAt(list, index) { - return list[index << 1]; - } - TypeScript.nonSeparatorAt = nonSeparatorAt; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Syntax; - (function (Syntax) { - function addArrayFunction(name, func) { - if (Object.defineProperty) { - Object.defineProperty(Array.prototype, name, { value: func, writable: true }); - } - else { - Array.prototype[name] = func; - } - } - addArrayFunction("kind", function () { - return 1 /* List */; - }); - function list(nodes) { - for (var i = 0, n = nodes.length; i < n; i++) { - nodes[i].parent = nodes; - } - return nodes; - } - Syntax.list = list; - function separatedList(nodesAndTokens) { - for (var i = 0, n = nodesAndTokens.length; i < n; i++) { - nodesAndTokens[i].parent = nodesAndTokens; - } - return nodesAndTokens; - } - Syntax.separatedList = separatedList; - })(Syntax = TypeScript.Syntax || (TypeScript.Syntax = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function tokenValue(token) { - if (token.fullWidth() === 0) { - return undefined; - } - var kind = token.kind(); - var text = token.text(); - if (kind === 9 /* IdentifierName */) { - return massageEscapes(text); - } - switch (kind) { - case 39 /* TrueKeyword */: - return true; - case 26 /* FalseKeyword */: - return false; - case 34 /* NullKeyword */: - return undefined; - } - if (TypeScript.SyntaxFacts.isAnyKeyword(kind) || TypeScript.SyntaxFacts.isAnyPunctuation(kind)) { - return TypeScript.SyntaxFacts.getText(kind); - } - if (kind === 11 /* NumericLiteral */) { - return TypeScript.IntegerUtilities.isHexInteger(text) ? parseInt(text, 16) : parseFloat(text); - } - else if (kind === 12 /* StringLiteral */) { - return (text.length > 1 && text.charCodeAt(text.length - 1) === text.charCodeAt(0)) ? massageEscapes(text.substr(1, text.length - "''".length)) : massageEscapes(text.substr(1)); - } - else if (kind === 13 /* NoSubstitutionTemplateToken */ || kind === 16 /* TemplateEndToken */) { - return (text.length > 1 && text.charCodeAt(text.length - 1) === 96 /* backtick */) ? massageTemplate(text.substr(1, text.length - "``".length)) : massageTemplate(text.substr(1)); - } - else if (kind === 14 /* TemplateStartToken */ || kind === 15 /* TemplateMiddleToken */) { - return massageTemplate(text.substr(1, text.length - "`${".length)); - } - else if (kind === 10 /* RegularExpressionLiteral */) { - return regularExpressionValue(text); - } - else if (kind === 8 /* EndOfFileToken */ || kind === 7 /* ErrorToken */) { - return undefined; - } - else { - throw TypeScript.Errors.invalidOperation(); - } - } - TypeScript.tokenValue = tokenValue; - function tokenValueText(token) { - var value = tokenValue(token); - return value === undefined ? "" : massageDisallowedIdentifiers(value.toString()); - } - TypeScript.tokenValueText = tokenValueText; - function massageTemplate(text) { - text = text.replace("\r\n", "\n").replace("\r", "\n"); - return massageEscapes(text); - } - function massageEscapes(text) { - return text.indexOf("\\") >= 0 ? convertEscapes(text) : text; - } - TypeScript.massageEscapes = massageEscapes; - function regularExpressionValue(text) { - try { - var lastSlash = text.lastIndexOf("/"); - var body = text.substring(1, lastSlash); - var flags = text.substring(lastSlash + 1); - return new RegExp(body, flags); - } - catch (e) { - return undefined; - } - } - function massageDisallowedIdentifiers(text) { - if (text.charCodeAt(0) === 95 /* _ */ && text.charCodeAt(1) === 95 /* _ */) { - return "_" + text; - } - return text; - } - var characterArray = []; - function convertEscapes(text) { - characterArray.length = 0; - var result = ""; - for (var i = 0, n = text.length; i < n; i++) { - var ch = text.charCodeAt(i); - if (ch === 92 /* backslash */) { - i++; - if (i < n) { - ch = text.charCodeAt(i); - switch (ch) { - case 48 /* _0 */: - characterArray.push(0 /* nullCharacter */); - continue; - case 98 /* b */: - characterArray.push(8 /* backspace */); - continue; - case 102 /* f */: - characterArray.push(12 /* formFeed */); - continue; - case 110 /* n */: - characterArray.push(10 /* lineFeed */); - continue; - case 114 /* r */: - characterArray.push(13 /* carriageReturn */); - continue; - case 116 /* t */: - characterArray.push(9 /* tab */); - continue; - case 118 /* v */: - characterArray.push(11 /* verticalTab */); - continue; - case 120 /* x */: - characterArray.push(hexValue(text, i + 1, 2)); - i += 2; - continue; - case 117 /* u */: - characterArray.push(hexValue(text, i + 1, 4)); - i += 4; - continue; - case 13 /* carriageReturn */: - var nextIndex = i + 1; - if (nextIndex < text.length && text.charCodeAt(nextIndex) === 10 /* lineFeed */) { - i++; - } - continue; - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - continue; - default: - } - } - } - characterArray.push(ch); - if (i && !(i % 1024)) { - result = result.concat(String.fromCharCode.apply(undefined, characterArray)); - characterArray.length = 0; - } - } - if (characterArray.length) { - result = result.concat(String.fromCharCode.apply(undefined, characterArray)); - } - return result; - } - function hexValue(text, start, length) { - var intChar = 0; - for (var i = 0; i < length; i++) { - var ch2 = text.charCodeAt(start + i); - if (!TypeScript.CharacterInfo.isHexDigit(ch2)) { - break; - } - intChar = (intChar << 4) + TypeScript.CharacterInfo.hexValue(ch2); - } - return intChar; - } -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Syntax; - (function (Syntax) { - function realizeToken(token, text) { - return new RealizedToken(token.fullStart(), token.kind(), token.isKeywordConvertedToIdentifier(), token.leadingTrivia(text), token.text(), token.trailingTrivia(text)); - } - Syntax.realizeToken = realizeToken; - function convertKeywordToIdentifier(token) { - return new ConvertedKeywordToken(token); - } - Syntax.convertKeywordToIdentifier = convertKeywordToIdentifier; - function withLeadingTrivia(token, leadingTrivia, text) { - return new RealizedToken(token.fullStart(), token.kind(), token.isKeywordConvertedToIdentifier(), leadingTrivia, token.text(), token.trailingTrivia(text)); - } - Syntax.withLeadingTrivia = withLeadingTrivia; - function withTrailingTrivia(token, trailingTrivia, text) { - return new RealizedToken(token.fullStart(), token.kind(), token.isKeywordConvertedToIdentifier(), token.leadingTrivia(text), token.text(), trailingTrivia); - } - Syntax.withTrailingTrivia = withTrailingTrivia; - function emptyToken(kind) { - return new EmptyToken(kind); - } - Syntax.emptyToken = emptyToken; - var EmptyToken = (function () { - function EmptyToken(_kind) { - this._kind = _kind; - } - EmptyToken.prototype.setFullStart = function (fullStart) { - }; - EmptyToken.prototype.kind = function () { - return this._kind; - }; - EmptyToken.prototype.childCount = function () { - return 0; - }; - EmptyToken.prototype.childAt = function (index) { - throw TypeScript.Errors.invalidOperation(); - }; - EmptyToken.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - EmptyToken.prototype.clone = function () { - return new EmptyToken(this.kind()); - }; - EmptyToken.prototype.isIncrementallyUnusable = function () { - return true; - }; - EmptyToken.prototype.isKeywordConvertedToIdentifier = function () { - return false; - }; - EmptyToken.prototype.fullWidth = function () { - return 0; - }; - EmptyToken.prototype.position = function () { - var previousElement = this.previousNonZeroWidthElement(); - return !previousElement ? 0 : TypeScript.fullStart(previousElement) + TypeScript.fullWidth(previousElement); - }; - EmptyToken.prototype.previousNonZeroWidthElement = function () { - var current = this; - while (true) { - var parent = current.parent; - if (parent === undefined) { - TypeScript.Debug.assert(current.kind() === 122 /* SourceUnit */, "We had a node without a parent that was not the root node!"); - return undefined; - } - for (var i = 0, n = TypeScript.childCount(parent); i < n; i++) { - if (TypeScript.childAt(parent, i) === current) { - break; - } - } - TypeScript.Debug.assert(i !== n, "Could not find current element in parent's child list!"); - for (var j = i - 1; j >= 0; j--) { - var sibling = TypeScript.childAt(parent, j); - if (sibling && TypeScript.fullWidth(sibling) > 0) { - return sibling; - } - } - current = current.parent; - } - }; - EmptyToken.prototype.fullStart = function () { - return this.position(); - }; - EmptyToken.prototype.text = function () { - return ""; - }; - EmptyToken.prototype.fullText = function () { - return ""; - }; - EmptyToken.prototype.hasLeadingTrivia = function () { - return false; - }; - EmptyToken.prototype.hasTrailingTrivia = function () { - return false; - }; - EmptyToken.prototype.hasLeadingComment = function () { - return false; - }; - EmptyToken.prototype.hasTrailingComment = function () { - return false; - }; - EmptyToken.prototype.hasSkippedToken = function () { - return false; - }; - EmptyToken.prototype.leadingTriviaWidth = function () { - return 0; - }; - EmptyToken.prototype.trailingTriviaWidth = function () { - return 0; - }; - EmptyToken.prototype.leadingTrivia = function () { - return Syntax.emptyTriviaList; - }; - EmptyToken.prototype.trailingTrivia = function () { - return Syntax.emptyTriviaList; - }; - return EmptyToken; - })(); - var RealizedToken = (function () { - function RealizedToken(fullStart, kind, isKeywordConvertedToIdentifier, leadingTrivia, text, trailingTrivia) { - this._fullStart = fullStart; - this._kind = kind; - this._isKeywordConvertedToIdentifier = isKeywordConvertedToIdentifier; - this._text = text; - this._leadingTrivia = leadingTrivia.clone(); - this._trailingTrivia = trailingTrivia.clone(); - if (!this._leadingTrivia.isShared()) { - this._leadingTrivia.parent = this; - } - if (!this._trailingTrivia.isShared()) { - this._trailingTrivia.parent = this; - } - } - RealizedToken.prototype.setFullStart = function (fullStart) { - this._fullStart = fullStart; - }; - RealizedToken.prototype.kind = function () { - return this._kind; - }; - RealizedToken.prototype.childCount = function () { - return 0; - }; - RealizedToken.prototype.childAt = function (index) { - throw TypeScript.Errors.invalidOperation(); - }; - RealizedToken.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - RealizedToken.prototype.clone = function () { - return new RealizedToken(this._fullStart, this.kind(), this._isKeywordConvertedToIdentifier, this._leadingTrivia, this._text, this._trailingTrivia); - }; - RealizedToken.prototype.isIncrementallyUnusable = function () { - return true; - }; - RealizedToken.prototype.isKeywordConvertedToIdentifier = function () { - return this._isKeywordConvertedToIdentifier; - }; - RealizedToken.prototype.fullStart = function () { - return this._fullStart; - }; - RealizedToken.prototype.fullWidth = function () { - return this._leadingTrivia.fullWidth() + this._text.length + this._trailingTrivia.fullWidth(); - }; - RealizedToken.prototype.text = function () { - return this._text; - }; - RealizedToken.prototype.fullText = function () { - return this._leadingTrivia.fullText() + this.text() + this._trailingTrivia.fullText(); - }; - RealizedToken.prototype.hasLeadingTrivia = function () { - return this._leadingTrivia.count() > 0; - }; - RealizedToken.prototype.hasTrailingTrivia = function () { - return this._trailingTrivia.count() > 0; - }; - RealizedToken.prototype.hasLeadingComment = function () { - return this._leadingTrivia.hasComment(); - }; - RealizedToken.prototype.hasTrailingComment = function () { - return this._trailingTrivia.hasComment(); - }; - RealizedToken.prototype.leadingTriviaWidth = function () { - return this._leadingTrivia.fullWidth(); - }; - RealizedToken.prototype.trailingTriviaWidth = function () { - return this._trailingTrivia.fullWidth(); - }; - RealizedToken.prototype.hasSkippedToken = function () { - return this._leadingTrivia.hasSkippedToken() || this._trailingTrivia.hasSkippedToken(); - }; - RealizedToken.prototype.leadingTrivia = function () { - return this._leadingTrivia; - }; - RealizedToken.prototype.trailingTrivia = function () { - return this._trailingTrivia; - }; - return RealizedToken; - })(); - var ConvertedKeywordToken = (function () { - function ConvertedKeywordToken(underlyingToken) { - this.underlyingToken = underlyingToken; - } - ConvertedKeywordToken.prototype.kind = function () { - return 9 /* IdentifierName */; - }; - ConvertedKeywordToken.prototype.setFullStart = function (fullStart) { - this.underlyingToken.setFullStart(fullStart); - }; - ConvertedKeywordToken.prototype.childCount = function () { - return 0; - }; - ConvertedKeywordToken.prototype.childAt = function (index) { - throw TypeScript.Errors.invalidOperation(); - }; - ConvertedKeywordToken.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - ConvertedKeywordToken.prototype.fullStart = function () { - return this.underlyingToken.fullStart(); - }; - ConvertedKeywordToken.prototype.fullWidth = function () { - return this.underlyingToken.fullWidth(); - }; - ConvertedKeywordToken.prototype.text = function () { - return this.underlyingToken.text(); - }; - ConvertedKeywordToken.prototype.syntaxTreeText = function (text) { - var result = text || TypeScript.syntaxTree(this).text; - TypeScript.Debug.assert(result); - return result; - }; - ConvertedKeywordToken.prototype.fullText = function (text) { - return this.underlyingToken.fullText(this.syntaxTreeText(text)); - }; - ConvertedKeywordToken.prototype.hasLeadingTrivia = function () { - return this.underlyingToken.hasLeadingTrivia(); - }; - ConvertedKeywordToken.prototype.hasTrailingTrivia = function () { - return this.underlyingToken.hasTrailingTrivia(); - }; - ConvertedKeywordToken.prototype.hasLeadingComment = function () { - return this.underlyingToken.hasLeadingComment(); - }; - ConvertedKeywordToken.prototype.hasTrailingComment = function () { - return this.underlyingToken.hasTrailingComment(); - }; - ConvertedKeywordToken.prototype.hasSkippedToken = function () { - return this.underlyingToken.hasSkippedToken(); - }; - ConvertedKeywordToken.prototype.leadingTrivia = function (text) { - var result = this.underlyingToken.leadingTrivia(this.syntaxTreeText(text)); - result.parent = this; - return result; - }; - ConvertedKeywordToken.prototype.trailingTrivia = function (text) { - var result = this.underlyingToken.trailingTrivia(this.syntaxTreeText(text)); - result.parent = this; - return result; - }; - ConvertedKeywordToken.prototype.leadingTriviaWidth = function (text) { - return this.underlyingToken.leadingTriviaWidth(this.syntaxTreeText(text)); - }; - ConvertedKeywordToken.prototype.trailingTriviaWidth = function (text) { - return this.underlyingToken.trailingTriviaWidth(this.syntaxTreeText(text)); - }; - ConvertedKeywordToken.prototype.isKeywordConvertedToIdentifier = function () { - return true; - }; - ConvertedKeywordToken.prototype.isIncrementallyUnusable = function () { - return this.underlyingToken.isIncrementallyUnusable(); - }; - ConvertedKeywordToken.prototype.clone = function () { - return new ConvertedKeywordToken(this.underlyingToken); - }; - return ConvertedKeywordToken; - })(); - })(Syntax = TypeScript.Syntax || (TypeScript.Syntax = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Syntax; - (function (Syntax) { - var AbstractTrivia = (function () { - function AbstractTrivia(_kind) { - this._kind = _kind; - } - AbstractTrivia.prototype.kind = function () { - return this._kind; - }; - AbstractTrivia.prototype.clone = function () { - throw TypeScript.Errors.abstract(); - }; - AbstractTrivia.prototype.fullStart = function () { - throw TypeScript.Errors.abstract(); - }; - AbstractTrivia.prototype.fullWidth = function () { - throw TypeScript.Errors.abstract(); - }; - AbstractTrivia.prototype.fullText = function () { - throw TypeScript.Errors.abstract(); - }; - AbstractTrivia.prototype.skippedToken = function () { - throw TypeScript.Errors.abstract(); - }; - AbstractTrivia.prototype.isWhitespace = function () { - return this.kind() === 2 /* WhitespaceTrivia */; - }; - AbstractTrivia.prototype.isComment = function () { - return this.kind() === 5 /* SingleLineCommentTrivia */ || this.kind() === 4 /* MultiLineCommentTrivia */; - }; - AbstractTrivia.prototype.isNewLine = function () { - return this.kind() === 3 /* NewLineTrivia */; - }; - AbstractTrivia.prototype.isSkippedToken = function () { - return this.kind() === 6 /* SkippedTokenTrivia */; - }; - return AbstractTrivia; - })(); - var SkippedTokenTrivia = (function (_super) { - __extends(SkippedTokenTrivia, _super); - function SkippedTokenTrivia(_skippedToken, _fullText) { - _super.call(this, 6 /* SkippedTokenTrivia */); - this._skippedToken = _skippedToken; - this._fullText = _fullText; - _skippedToken.parent = this; - } - SkippedTokenTrivia.prototype.clone = function () { - return new SkippedTokenTrivia(this._skippedToken.clone(), this._fullText); - }; - SkippedTokenTrivia.prototype.fullStart = function () { - return this._skippedToken.fullStart(); - }; - SkippedTokenTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - SkippedTokenTrivia.prototype.fullText = function () { - return this._fullText; - }; - SkippedTokenTrivia.prototype.skippedToken = function () { - return this._skippedToken; - }; - return SkippedTokenTrivia; - })(AbstractTrivia); - var DeferredTrivia = (function (_super) { - __extends(DeferredTrivia, _super); - function DeferredTrivia(kind, _text, _fullStart, _fullWidth) { - _super.call(this, kind); - this._text = _text; - this._fullStart = _fullStart; - this._fullWidth = _fullWidth; - } - DeferredTrivia.prototype.clone = function () { - return new DeferredTrivia(this.kind(), this._text, this._fullStart, this._fullWidth); - }; - DeferredTrivia.prototype.fullStart = function () { - return this._fullStart; - }; - DeferredTrivia.prototype.fullWidth = function () { - return this._fullWidth; - }; - DeferredTrivia.prototype.fullText = function () { - return this._text.substr(this._fullStart, this._fullWidth); - }; - DeferredTrivia.prototype.skippedToken = function () { - throw TypeScript.Errors.invalidOperation(); - }; - return DeferredTrivia; - })(AbstractTrivia); - function deferredTrivia(kind, text, fullStart, fullWidth) { - return new DeferredTrivia(kind, text, fullStart, fullWidth); - } - Syntax.deferredTrivia = deferredTrivia; - function skippedTokenTrivia(token, text) { - TypeScript.Debug.assert(!token.hasLeadingTrivia()); - TypeScript.Debug.assert(!token.hasTrailingTrivia()); - TypeScript.Debug.assert(token.fullWidth() > 0); - return new SkippedTokenTrivia(token, token.fullText(text)); - } - Syntax.skippedTokenTrivia = skippedTokenTrivia; - function splitMultiLineCommentTriviaIntoMultipleLines(trivia) { - var result = []; - var triviaText = trivia.fullText(); - var currentIndex = 0; - for (var i = 0; i < triviaText.length; i++) { - var ch = triviaText.charCodeAt(i); - switch (ch) { - case 13 /* carriageReturn */: - if (i < triviaText.length - 1 && triviaText.charCodeAt(i + 1) === 10 /* lineFeed */) { - i++; - } - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - result.push(triviaText.substring(currentIndex, i + 1)); - currentIndex = i + 1; - continue; - } - } - result.push(triviaText.substring(currentIndex)); - return result; - } - Syntax.splitMultiLineCommentTriviaIntoMultipleLines = splitMultiLineCommentTriviaIntoMultipleLines; - })(Syntax = TypeScript.Syntax || (TypeScript.Syntax = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Syntax; - (function (Syntax) { - var EmptyTriviaList = (function () { - function EmptyTriviaList() { - } - EmptyTriviaList.prototype.isShared = function () { - return true; - }; - EmptyTriviaList.prototype.count = function () { - return 0; - }; - EmptyTriviaList.prototype.syntaxTriviaAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - EmptyTriviaList.prototype.last = function () { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - EmptyTriviaList.prototype.fullWidth = function () { - return 0; - }; - EmptyTriviaList.prototype.fullText = function () { - return ""; - }; - EmptyTriviaList.prototype.hasComment = function () { - return false; - }; - EmptyTriviaList.prototype.hasNewLine = function () { - return false; - }; - EmptyTriviaList.prototype.hasSkippedToken = function () { - return false; - }; - EmptyTriviaList.prototype.toArray = function () { - return []; - }; - EmptyTriviaList.prototype.clone = function () { - return this; - }; - return EmptyTriviaList; - })(); - ; - Syntax.emptyTriviaList = new EmptyTriviaList(); - function isComment(trivia) { - return trivia.kind() === 4 /* MultiLineCommentTrivia */ || trivia.kind() === 5 /* SingleLineCommentTrivia */; - } - var SingletonSyntaxTriviaList = (function () { - function SingletonSyntaxTriviaList(item) { - this.item = item.clone(); - this.item.parent = this; - } - SingletonSyntaxTriviaList.prototype.isShared = function () { - return false; - }; - SingletonSyntaxTriviaList.prototype.count = function () { - return 1; - }; - SingletonSyntaxTriviaList.prototype.syntaxTriviaAt = function (index) { - if (index !== 0) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - return this.item; - }; - SingletonSyntaxTriviaList.prototype.last = function () { - return this.item; - }; - SingletonSyntaxTriviaList.prototype.fullWidth = function () { - return this.item.fullWidth(); - }; - SingletonSyntaxTriviaList.prototype.fullText = function () { - return this.item.fullText(); - }; - SingletonSyntaxTriviaList.prototype.hasComment = function () { - return isComment(this.item); - }; - SingletonSyntaxTriviaList.prototype.hasNewLine = function () { - return this.item.kind() === 3 /* NewLineTrivia */; - }; - SingletonSyntaxTriviaList.prototype.hasSkippedToken = function () { - return this.item.kind() === 6 /* SkippedTokenTrivia */; - }; - SingletonSyntaxTriviaList.prototype.toArray = function () { - return [this.item]; - }; - SingletonSyntaxTriviaList.prototype.clone = function () { - return new SingletonSyntaxTriviaList(this.item.clone()); - }; - return SingletonSyntaxTriviaList; - })(); - var NormalSyntaxTriviaList = (function () { - function NormalSyntaxTriviaList(trivia) { - var _this = this; - this.trivia = trivia.map(function (t) { - var cloned = t.clone(); - cloned.parent = _this; - return cloned; - }); - } - NormalSyntaxTriviaList.prototype.isShared = function () { - return false; - }; - NormalSyntaxTriviaList.prototype.count = function () { - return this.trivia.length; - }; - NormalSyntaxTriviaList.prototype.syntaxTriviaAt = function (index) { - if (index < 0 || index >= this.trivia.length) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - return this.trivia[index]; - }; - NormalSyntaxTriviaList.prototype.last = function () { - return this.trivia[this.trivia.length - 1]; - }; - NormalSyntaxTriviaList.prototype.fullWidth = function () { - return TypeScript.ArrayUtilities.sum(this.trivia, function (t) { return t.fullWidth(); }); - }; - NormalSyntaxTriviaList.prototype.fullText = function () { - var result = []; - for (var i = 0, n = this.trivia.length; i < n; i++) { - result.push(this.trivia[i].fullText()); - } - return result.join(""); - }; - NormalSyntaxTriviaList.prototype.hasComment = function () { - for (var i = 0; i < this.trivia.length; i++) { - if (isComment(this.trivia[i])) { - return true; - } - } - return false; - }; - NormalSyntaxTriviaList.prototype.hasNewLine = function () { - for (var i = 0; i < this.trivia.length; i++) { - if (this.trivia[i].kind() === 3 /* NewLineTrivia */) { - return true; - } - } - return false; - }; - NormalSyntaxTriviaList.prototype.hasSkippedToken = function () { - for (var i = 0; i < this.trivia.length; i++) { - if (this.trivia[i].kind() === 6 /* SkippedTokenTrivia */) { - return true; - } - } - return false; - }; - NormalSyntaxTriviaList.prototype.toArray = function () { - return this.trivia.slice(0); - }; - NormalSyntaxTriviaList.prototype.clone = function () { - return new NormalSyntaxTriviaList(this.trivia.map(function (t) { return t.clone(); })); - }; - return NormalSyntaxTriviaList; - })(); - function triviaList(trivia) { - if (!trivia || trivia.length === 0) { - return Syntax.emptyTriviaList; - } - if (trivia.length === 1) { - return new SingletonSyntaxTriviaList(trivia[0]); - } - return new NormalSyntaxTriviaList(trivia); - } - Syntax.triviaList = triviaList; - })(Syntax = TypeScript.Syntax || (TypeScript.Syntax = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxUtilities = (function () { - function SyntaxUtilities() { - } - SyntaxUtilities.isAnyFunctionExpressionOrDeclaration = function (ast) { - switch (ast.kind()) { - case 183 /* SimpleArrowFunctionExpression */: - case 182 /* ParenthesizedArrowFunctionExpression */: - case 186 /* FunctionExpression */: - case 134 /* FunctionDeclaration */: - case 140 /* MemberFunctionDeclaration */: - case 207 /* FunctionPropertyAssignment */: - case 142 /* ConstructorDeclaration */: - case 144 /* GetAccessor */: - case 145 /* SetAccessor */: - return true; - } - return false; - }; - SyntaxUtilities.isLastTokenOnLine = function (token, text) { - var _nextToken = TypeScript.nextToken(token, text); - if (_nextToken === undefined) { - return true; - } - var lineMap = text.lineMap(); - var tokenLine = lineMap.getLineNumberFromPosition(TypeScript.end(token, text)); - var nextTokenLine = lineMap.getLineNumberFromPosition(TypeScript.start(_nextToken, text)); - return tokenLine !== nextTokenLine; - }; - SyntaxUtilities.isLeftHandSizeExpression = function (element) { - if (element) { - switch (element.kind()) { - case 176 /* MemberAccessExpression */: - case 185 /* ElementAccessExpression */: - case 189 /* TemplateAccessExpression */: - case 180 /* ObjectCreationExpression */: - case 177 /* InvocationExpression */: - case 178 /* ArrayLiteralExpression */: - case 181 /* ParenthesizedExpression */: - case 179 /* ObjectLiteralExpression */: - case 186 /* FunctionExpression */: - case 9 /* IdentifierName */: - case 10 /* RegularExpressionLiteral */: - case 11 /* NumericLiteral */: - case 12 /* StringLiteral */: - case 26 /* FalseKeyword */: - case 34 /* NullKeyword */: - case 37 /* ThisKeyword */: - case 39 /* TrueKeyword */: - case 52 /* SuperKeyword */: - return true; - } - } - return false; - }; - SyntaxUtilities.isSwitchClause = function (element) { - if (element) { - switch (element.kind()) { - case 198 /* CaseSwitchClause */: - case 199 /* DefaultSwitchClause */: - return true; - } - } - return false; - }; - SyntaxUtilities.isTypeMember = function (element) { - if (element) { - switch (element.kind()) { - case 148 /* ConstructSignature */: - case 150 /* MethodSignature */: - case 149 /* IndexSignature */: - case 146 /* PropertySignature */: - case 147 /* CallSignature */: - return true; - } - } - return false; - }; - SyntaxUtilities.isClassElement = function (element) { - if (element) { - switch (element.kind()) { - case 142 /* ConstructorDeclaration */: - case 143 /* IndexMemberDeclaration */: - case 140 /* MemberFunctionDeclaration */: - case 144 /* GetAccessor */: - case 145 /* SetAccessor */: - case 140 /* MemberFunctionDeclaration */: - case 141 /* MemberVariableDeclaration */: - return true; - } - } - return false; - }; - SyntaxUtilities.isModuleElement = function (element) { - if (element) { - switch (element.kind()) { - case 138 /* ImportDeclaration */: - case 139 /* ExportAssignment */: - case 136 /* ClassDeclaration */: - case 133 /* InterfaceDeclaration */: - case 135 /* ModuleDeclaration */: - case 137 /* EnumDeclaration */: - case 134 /* FunctionDeclaration */: - case 153 /* VariableStatement */: - case 151 /* Block */: - case 152 /* IfStatement */: - case 154 /* ExpressionStatement */: - case 162 /* ThrowStatement */: - case 155 /* ReturnStatement */: - case 156 /* SwitchStatement */: - case 157 /* BreakStatement */: - case 158 /* ContinueStatement */: - case 160 /* ForInStatement */: - case 159 /* ForStatement */: - case 163 /* WhileStatement */: - case 168 /* WithStatement */: - case 161 /* EmptyStatement */: - case 164 /* TryStatement */: - case 165 /* LabeledStatement */: - case 166 /* DoStatement */: - case 167 /* DebuggerStatement */: - return true; - } - } - return false; - }; - SyntaxUtilities.isStatement = function (element) { - if (element) { - switch (element.kind()) { - case 134 /* FunctionDeclaration */: - case 153 /* VariableStatement */: - case 151 /* Block */: - case 152 /* IfStatement */: - case 154 /* ExpressionStatement */: - case 162 /* ThrowStatement */: - case 155 /* ReturnStatement */: - case 156 /* SwitchStatement */: - case 157 /* BreakStatement */: - case 158 /* ContinueStatement */: - case 160 /* ForInStatement */: - case 159 /* ForStatement */: - case 163 /* WhileStatement */: - case 168 /* WithStatement */: - case 161 /* EmptyStatement */: - case 164 /* TryStatement */: - case 165 /* LabeledStatement */: - case 166 /* DoStatement */: - case 167 /* DebuggerStatement */: - return true; - } - } - return false; - }; - SyntaxUtilities.isAngleBracket = function (positionedElement) { - var element = positionedElement; - var parent = positionedElement.parent; - if (parent && (element.kind() === 82 /* LessThanToken */ || element.kind() === 83 /* GreaterThanToken */)) { - switch (parent.kind()) { - case 194 /* TypeArgumentList */: - case 195 /* TypeParameterList */: - case 184 /* CastExpression */: - return true; - } - } - return false; - }; - SyntaxUtilities.getToken = function (list, kind) { - for (var i = 0, n = list.length; i < n; i++) { - var token = list[i]; - if (token.kind() === kind) { - return token; - } - } - return undefined; - }; - SyntaxUtilities.containsToken = function (list, kind) { - return !!SyntaxUtilities.getToken(list, kind); - }; - SyntaxUtilities.hasExportKeyword = function (moduleElement) { - return !!SyntaxUtilities.getExportKeyword(moduleElement); - }; - SyntaxUtilities.getExportKeyword = function (moduleElement) { - switch (moduleElement.kind()) { - case 135 /* ModuleDeclaration */: - case 136 /* ClassDeclaration */: - case 134 /* FunctionDeclaration */: - case 153 /* VariableStatement */: - case 137 /* EnumDeclaration */: - case 133 /* InterfaceDeclaration */: - case 138 /* ImportDeclaration */: - return SyntaxUtilities.getToken(moduleElement.modifiers, 49 /* ExportKeyword */); - default: - return undefined; - } - }; - SyntaxUtilities.isAmbientDeclarationSyntax = function (positionNode) { - if (!positionNode) { - return false; - } - var node = positionNode; - switch (node.kind()) { - case 135 /* ModuleDeclaration */: - case 136 /* ClassDeclaration */: - case 134 /* FunctionDeclaration */: - case 153 /* VariableStatement */: - case 137 /* EnumDeclaration */: - if (SyntaxUtilities.containsToken(node.modifiers, 65 /* DeclareKeyword */)) { - return true; - } - case 138 /* ImportDeclaration */: - case 142 /* ConstructorDeclaration */: - case 140 /* MemberFunctionDeclaration */: - case 144 /* GetAccessor */: - case 145 /* SetAccessor */: - case 141 /* MemberVariableDeclaration */: - if (SyntaxUtilities.isClassElement(node) || SyntaxUtilities.isModuleElement(node)) { - return SyntaxUtilities.isAmbientDeclarationSyntax(TypeScript.Syntax.containingNode(positionNode)); - } - case 209 /* EnumElement */: - return SyntaxUtilities.isAmbientDeclarationSyntax(TypeScript.Syntax.containingNode(TypeScript.Syntax.containingNode(positionNode))); - default: - return SyntaxUtilities.isAmbientDeclarationSyntax(TypeScript.Syntax.containingNode(positionNode)); - } - }; - return SyntaxUtilities; - })(); - TypeScript.SyntaxUtilities = SyntaxUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var childCountArray = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 4, 3, 5, 2, 2, 3, 3, 3, 6, 6, 7, 8, 6, 6, 4, 5, 3, 5, 3, 5, 5, 3, 3, 2, 4, 3, 3, 6, 3, 2, 3, 7, 3, 3, 10, 8, 1, 3, 5, 4, 3, 7, 2, 5, 2, 2, 2, 2, 5, 3, 2, 3, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 0, 2, 2, 2, 3, 4, 3, 3, 3, 2, 2, 4, 3, 2, 6, 2, 2, 2, 2, 3, 3, 6, 2, 2, 4, 1]; - function childCount(element) { - if (TypeScript.isList(element)) { - return element.length; - } - return childCountArray[element.kind()]; - } - TypeScript.childCount = childCount; - function sourceUnitChildAt(node, index) { - switch (index) { - case 0: return node.moduleElements; - case 1: return node.endOfFileToken; - } - } - function qualifiedNameChildAt(node, index) { - switch (index) { - case 0: return node.left; - case 1: return node.dotToken; - case 2: return node.right; - } - } - function objectTypeChildAt(node, index) { - switch (index) { - case 0: return node.openBraceToken; - case 1: return node.typeMembers; - case 2: return node.closeBraceToken; - } - } - function functionTypeChildAt(node, index) { - switch (index) { - case 0: return node.typeParameterList; - case 1: return node.parameterList; - case 2: return node.equalsGreaterThanToken; - case 3: return node.type; - } - } - function arrayTypeChildAt(node, index) { - switch (index) { - case 0: return node.type; - case 1: return node.openBracketToken; - case 2: return node.closeBracketToken; - } - } - function constructorTypeChildAt(node, index) { - switch (index) { - case 0: return node.newKeyword; - case 1: return node.typeParameterList; - case 2: return node.parameterList; - case 3: return node.equalsGreaterThanToken; - case 4: return node.type; - } - } - function genericTypeChildAt(node, index) { - switch (index) { - case 0: return node.name; - case 1: return node.typeArgumentList; - } - } - function typeQueryChildAt(node, index) { - switch (index) { - case 0: return node.typeOfKeyword; - case 1: return node.name; - } - } - function tupleTypeChildAt(node, index) { - switch (index) { - case 0: return node.openBracketToken; - case 1: return node.types; - case 2: return node.closeBracketToken; - } - } - function unionTypeChildAt(node, index) { - switch (index) { - case 0: return node.left; - case 1: return node.barToken; - case 2: return node.right; - } - } - function parenthesizedTypeChildAt(node, index) { - switch (index) { - case 0: return node.openParenToken; - case 1: return node.type; - case 2: return node.closeParenToken; - } - } - function interfaceDeclarationChildAt(node, index) { - switch (index) { - case 0: return node.modifiers; - case 1: return node.interfaceKeyword; - case 2: return node.identifier; - case 3: return node.typeParameterList; - case 4: return node.heritageClauses; - case 5: return node.body; - } - } - function functionDeclarationChildAt(node, index) { - switch (index) { - case 0: return node.modifiers; - case 1: return node.functionKeyword; - case 2: return node.identifier; - case 3: return node.callSignature; - case 4: return node.block; - case 5: return node.semicolonToken; - } - } - function moduleDeclarationChildAt(node, index) { - switch (index) { - case 0: return node.modifiers; - case 1: return node.moduleKeyword; - case 2: return node.name; - case 3: return node.stringLiteral; - case 4: return node.openBraceToken; - case 5: return node.moduleElements; - case 6: return node.closeBraceToken; - } - } - function classDeclarationChildAt(node, index) { - switch (index) { - case 0: return node.modifiers; - case 1: return node.classKeyword; - case 2: return node.identifier; - case 3: return node.typeParameterList; - case 4: return node.heritageClauses; - case 5: return node.openBraceToken; - case 6: return node.classElements; - case 7: return node.closeBraceToken; - } - } - function enumDeclarationChildAt(node, index) { - switch (index) { - case 0: return node.modifiers; - case 1: return node.enumKeyword; - case 2: return node.identifier; - case 3: return node.openBraceToken; - case 4: return node.enumElements; - case 5: return node.closeBraceToken; - } - } - function importDeclarationChildAt(node, index) { - switch (index) { - case 0: return node.modifiers; - case 1: return node.importKeyword; - case 2: return node.identifier; - case 3: return node.equalsToken; - case 4: return node.moduleReference; - case 5: return node.semicolonToken; - } - } - function exportAssignmentChildAt(node, index) { - switch (index) { - case 0: return node.exportKeyword; - case 1: return node.equalsToken; - case 2: return node.identifier; - case 3: return node.semicolonToken; - } - } - function memberFunctionDeclarationChildAt(node, index) { - switch (index) { - case 0: return node.modifiers; - case 1: return node.propertyName; - case 2: return node.callSignature; - case 3: return node.block; - case 4: return node.semicolonToken; - } - } - function memberVariableDeclarationChildAt(node, index) { - switch (index) { - case 0: return node.modifiers; - case 1: return node.variableDeclarator; - case 2: return node.semicolonToken; - } - } - function constructorDeclarationChildAt(node, index) { - switch (index) { - case 0: return node.modifiers; - case 1: return node.constructorKeyword; - case 2: return node.callSignature; - case 3: return node.block; - case 4: return node.semicolonToken; - } - } - function indexMemberDeclarationChildAt(node, index) { - switch (index) { - case 0: return node.modifiers; - case 1: return node.indexSignature; - case 2: return node.semicolonToken; - } - } - function getAccessorChildAt(node, index) { - switch (index) { - case 0: return node.modifiers; - case 1: return node.getKeyword; - case 2: return node.propertyName; - case 3: return node.callSignature; - case 4: return node.block; - } - } - function setAccessorChildAt(node, index) { - switch (index) { - case 0: return node.modifiers; - case 1: return node.setKeyword; - case 2: return node.propertyName; - case 3: return node.callSignature; - case 4: return node.block; - } - } - function propertySignatureChildAt(node, index) { - switch (index) { - case 0: return node.propertyName; - case 1: return node.questionToken; - case 2: return node.typeAnnotation; - } - } - function callSignatureChildAt(node, index) { - switch (index) { - case 0: return node.typeParameterList; - case 1: return node.parameterList; - case 2: return node.typeAnnotation; - } - } - function constructSignatureChildAt(node, index) { - switch (index) { - case 0: return node.newKeyword; - case 1: return node.callSignature; - } - } - function indexSignatureChildAt(node, index) { - switch (index) { - case 0: return node.openBracketToken; - case 1: return node.parameters; - case 2: return node.closeBracketToken; - case 3: return node.typeAnnotation; - } - } - function methodSignatureChildAt(node, index) { - switch (index) { - case 0: return node.propertyName; - case 1: return node.questionToken; - case 2: return node.callSignature; - } - } - function blockChildAt(node, index) { - switch (index) { - case 0: return node.openBraceToken; - case 1: return node.statements; - case 2: return node.closeBraceToken; - } - } - function ifStatementChildAt(node, index) { - switch (index) { - case 0: return node.ifKeyword; - case 1: return node.openParenToken; - case 2: return node.condition; - case 3: return node.closeParenToken; - case 4: return node.statement; - case 5: return node.elseClause; - } - } - function variableStatementChildAt(node, index) { - switch (index) { - case 0: return node.modifiers; - case 1: return node.variableDeclaration; - case 2: return node.semicolonToken; - } - } - function expressionStatementChildAt(node, index) { - switch (index) { - case 0: return node.expression; - case 1: return node.semicolonToken; - } - } - function returnStatementChildAt(node, index) { - switch (index) { - case 0: return node.returnKeyword; - case 1: return node.expression; - case 2: return node.semicolonToken; - } - } - function switchStatementChildAt(node, index) { - switch (index) { - case 0: return node.switchKeyword; - case 1: return node.openParenToken; - case 2: return node.expression; - case 3: return node.closeParenToken; - case 4: return node.openBraceToken; - case 5: return node.switchClauses; - case 6: return node.closeBraceToken; - } - } - function breakStatementChildAt(node, index) { - switch (index) { - case 0: return node.breakKeyword; - case 1: return node.identifier; - case 2: return node.semicolonToken; - } - } - function continueStatementChildAt(node, index) { - switch (index) { - case 0: return node.continueKeyword; - case 1: return node.identifier; - case 2: return node.semicolonToken; - } - } - function forStatementChildAt(node, index) { - switch (index) { - case 0: return node.forKeyword; - case 1: return node.openParenToken; - case 2: return node.variableDeclaration; - case 3: return node.initializer; - case 4: return node.firstSemicolonToken; - case 5: return node.condition; - case 6: return node.secondSemicolonToken; - case 7: return node.incrementor; - case 8: return node.closeParenToken; - case 9: return node.statement; - } - } - function forInStatementChildAt(node, index) { - switch (index) { - case 0: return node.forKeyword; - case 1: return node.openParenToken; - case 2: return node.variableDeclaration; - case 3: return node.left; - case 4: return node.inKeyword; - case 5: return node.expression; - case 6: return node.closeParenToken; - case 7: return node.statement; - } - } - function emptyStatementChildAt(node, index) { - switch (index) { - case 0: return node.semicolonToken; - } - } - function throwStatementChildAt(node, index) { - switch (index) { - case 0: return node.throwKeyword; - case 1: return node.expression; - case 2: return node.semicolonToken; - } - } - function whileStatementChildAt(node, index) { - switch (index) { - case 0: return node.whileKeyword; - case 1: return node.openParenToken; - case 2: return node.condition; - case 3: return node.closeParenToken; - case 4: return node.statement; - } - } - function tryStatementChildAt(node, index) { - switch (index) { - case 0: return node.tryKeyword; - case 1: return node.block; - case 2: return node.catchClause; - case 3: return node.finallyClause; - } - } - function labeledStatementChildAt(node, index) { - switch (index) { - case 0: return node.identifier; - case 1: return node.colonToken; - case 2: return node.statement; - } - } - function doStatementChildAt(node, index) { - switch (index) { - case 0: return node.doKeyword; - case 1: return node.statement; - case 2: return node.whileKeyword; - case 3: return node.openParenToken; - case 4: return node.condition; - case 5: return node.closeParenToken; - case 6: return node.semicolonToken; - } - } - function debuggerStatementChildAt(node, index) { - switch (index) { - case 0: return node.debuggerKeyword; - case 1: return node.semicolonToken; - } - } - function withStatementChildAt(node, index) { - switch (index) { - case 0: return node.withKeyword; - case 1: return node.openParenToken; - case 2: return node.condition; - case 3: return node.closeParenToken; - case 4: return node.statement; - } - } - function prefixUnaryExpressionChildAt(node, index) { - switch (index) { - case 0: return node.operatorToken; - case 1: return node.operand; - } - } - function deleteExpressionChildAt(node, index) { - switch (index) { - case 0: return node.deleteKeyword; - case 1: return node.expression; - } - } - function typeOfExpressionChildAt(node, index) { - switch (index) { - case 0: return node.typeOfKeyword; - case 1: return node.expression; - } - } - function voidExpressionChildAt(node, index) { - switch (index) { - case 0: return node.voidKeyword; - case 1: return node.expression; - } - } - function conditionalExpressionChildAt(node, index) { - switch (index) { - case 0: return node.condition; - case 1: return node.questionToken; - case 2: return node.whenTrue; - case 3: return node.colonToken; - case 4: return node.whenFalse; - } - } - function binaryExpressionChildAt(node, index) { - switch (index) { - case 0: return node.left; - case 1: return node.operatorToken; - case 2: return node.right; - } - } - function postfixUnaryExpressionChildAt(node, index) { - switch (index) { - case 0: return node.operand; - case 1: return node.operatorToken; - } - } - function memberAccessExpressionChildAt(node, index) { - switch (index) { - case 0: return node.expression; - case 1: return node.dotToken; - case 2: return node.name; - } - } - function invocationExpressionChildAt(node, index) { - switch (index) { - case 0: return node.expression; - case 1: return node.argumentList; - } - } - function arrayLiteralExpressionChildAt(node, index) { - switch (index) { - case 0: return node.openBracketToken; - case 1: return node.expressions; - case 2: return node.closeBracketToken; - } - } - function objectLiteralExpressionChildAt(node, index) { - switch (index) { - case 0: return node.openBraceToken; - case 1: return node.propertyAssignments; - case 2: return node.closeBraceToken; - } - } - function objectCreationExpressionChildAt(node, index) { - switch (index) { - case 0: return node.newKeyword; - case 1: return node.expression; - case 2: return node.argumentList; - } - } - function parenthesizedExpressionChildAt(node, index) { - switch (index) { - case 0: return node.openParenToken; - case 1: return node.expression; - case 2: return node.closeParenToken; - } - } - function parenthesizedArrowFunctionExpressionChildAt(node, index) { - switch (index) { - case 0: return node.callSignature; - case 1: return node.equalsGreaterThanToken; - case 2: return node.block; - case 3: return node.expression; - } - } - function simpleArrowFunctionExpressionChildAt(node, index) { - switch (index) { - case 0: return node.parameter; - case 1: return node.equalsGreaterThanToken; - case 2: return node.block; - case 3: return node.expression; - } - } - function castExpressionChildAt(node, index) { - switch (index) { - case 0: return node.lessThanToken; - case 1: return node.type; - case 2: return node.greaterThanToken; - case 3: return node.expression; - } - } - function elementAccessExpressionChildAt(node, index) { - switch (index) { - case 0: return node.expression; - case 1: return node.openBracketToken; - case 2: return node.argumentExpression; - case 3: return node.closeBracketToken; - } - } - function functionExpressionChildAt(node, index) { - switch (index) { - case 0: return node.functionKeyword; - case 1: return node.identifier; - case 2: return node.callSignature; - case 3: return node.block; - } - } - function omittedExpressionChildAt(node, index) { - throw TypeScript.Errors.invalidOperation(); - } - function templateExpressionChildAt(node, index) { - switch (index) { - case 0: return node.templateStartToken; - case 1: return node.templateClauses; - } - } - function templateAccessExpressionChildAt(node, index) { - switch (index) { - case 0: return node.expression; - case 1: return node.templateExpression; - } - } - function variableDeclarationChildAt(node, index) { - switch (index) { - case 0: return node.varKeyword; - case 1: return node.variableDeclarators; - } - } - function variableDeclaratorChildAt(node, index) { - switch (index) { - case 0: return node.propertyName; - case 1: return node.typeAnnotation; - case 2: return node.equalsValueClause; - } - } - function argumentListChildAt(node, index) { - switch (index) { - case 0: return node.typeArgumentList; - case 1: return node.openParenToken; - case 2: return node.arguments; - case 3: return node.closeParenToken; - } - } - function parameterListChildAt(node, index) { - switch (index) { - case 0: return node.openParenToken; - case 1: return node.parameters; - case 2: return node.closeParenToken; - } - } - function typeArgumentListChildAt(node, index) { - switch (index) { - case 0: return node.lessThanToken; - case 1: return node.typeArguments; - case 2: return node.greaterThanToken; - } - } - function typeParameterListChildAt(node, index) { - switch (index) { - case 0: return node.lessThanToken; - case 1: return node.typeParameters; - case 2: return node.greaterThanToken; - } - } - function heritageClauseChildAt(node, index) { - switch (index) { - case 0: return node.extendsOrImplementsKeyword; - case 1: return node.typeNames; - } - } - function equalsValueClauseChildAt(node, index) { - switch (index) { - case 0: return node.equalsToken; - case 1: return node.value; - } - } - function caseSwitchClauseChildAt(node, index) { - switch (index) { - case 0: return node.caseKeyword; - case 1: return node.expression; - case 2: return node.colonToken; - case 3: return node.statements; - } - } - function defaultSwitchClauseChildAt(node, index) { - switch (index) { - case 0: return node.defaultKeyword; - case 1: return node.colonToken; - case 2: return node.statements; - } - } - function elseClauseChildAt(node, index) { - switch (index) { - case 0: return node.elseKeyword; - case 1: return node.statement; - } - } - function catchClauseChildAt(node, index) { - switch (index) { - case 0: return node.catchKeyword; - case 1: return node.openParenToken; - case 2: return node.identifier; - case 3: return node.typeAnnotation; - case 4: return node.closeParenToken; - case 5: return node.block; - } - } - function finallyClauseChildAt(node, index) { - switch (index) { - case 0: return node.finallyKeyword; - case 1: return node.block; - } - } - function templateClauseChildAt(node, index) { - switch (index) { - case 0: return node.expression; - case 1: return node.templateMiddleOrEndToken; - } - } - function typeParameterChildAt(node, index) { - switch (index) { - case 0: return node.identifier; - case 1: return node.constraint; - } - } - function constraintChildAt(node, index) { - switch (index) { - case 0: return node.extendsKeyword; - case 1: return node.typeOrExpression; - } - } - function simplePropertyAssignmentChildAt(node, index) { - switch (index) { - case 0: return node.propertyName; - case 1: return node.colonToken; - case 2: return node.expression; - } - } - function functionPropertyAssignmentChildAt(node, index) { - switch (index) { - case 0: return node.propertyName; - case 1: return node.callSignature; - case 2: return node.block; - } - } - function parameterChildAt(node, index) { - switch (index) { - case 0: return node.dotDotDotToken; - case 1: return node.modifiers; - case 2: return node.identifier; - case 3: return node.questionToken; - case 4: return node.typeAnnotation; - case 5: return node.equalsValueClause; - } - } - function enumElementChildAt(node, index) { - switch (index) { - case 0: return node.propertyName; - case 1: return node.equalsValueClause; - } - } - function typeAnnotationChildAt(node, index) { - switch (index) { - case 0: return node.colonToken; - case 1: return node.type; - } - } - function externalModuleReferenceChildAt(node, index) { - switch (index) { - case 0: return node.requireKeyword; - case 1: return node.openParenToken; - case 2: return node.stringLiteral; - case 3: return node.closeParenToken; - } - } - function moduleNameModuleReferenceChildAt(node, index) { - switch (index) { - case 0: return node.moduleName; - } - } - function childAt(element, index) { - if (TypeScript.isList(element)) { - return element[index]; - } - switch (element.kind()) { - case 122 /* SourceUnit */: return sourceUnitChildAt(element, index); - case 123 /* QualifiedName */: return qualifiedNameChildAt(element, index); - case 124 /* ObjectType */: return objectTypeChildAt(element, index); - case 125 /* FunctionType */: return functionTypeChildAt(element, index); - case 126 /* ArrayType */: return arrayTypeChildAt(element, index); - case 127 /* ConstructorType */: return constructorTypeChildAt(element, index); - case 128 /* GenericType */: return genericTypeChildAt(element, index); - case 129 /* TypeQuery */: return typeQueryChildAt(element, index); - case 130 /* TupleType */: return tupleTypeChildAt(element, index); - case 131 /* UnionType */: return unionTypeChildAt(element, index); - case 132 /* ParenthesizedType */: return parenthesizedTypeChildAt(element, index); - case 133 /* InterfaceDeclaration */: return interfaceDeclarationChildAt(element, index); - case 134 /* FunctionDeclaration */: return functionDeclarationChildAt(element, index); - case 135 /* ModuleDeclaration */: return moduleDeclarationChildAt(element, index); - case 136 /* ClassDeclaration */: return classDeclarationChildAt(element, index); - case 137 /* EnumDeclaration */: return enumDeclarationChildAt(element, index); - case 138 /* ImportDeclaration */: return importDeclarationChildAt(element, index); - case 139 /* ExportAssignment */: return exportAssignmentChildAt(element, index); - case 140 /* MemberFunctionDeclaration */: return memberFunctionDeclarationChildAt(element, index); - case 141 /* MemberVariableDeclaration */: return memberVariableDeclarationChildAt(element, index); - case 142 /* ConstructorDeclaration */: return constructorDeclarationChildAt(element, index); - case 143 /* IndexMemberDeclaration */: return indexMemberDeclarationChildAt(element, index); - case 144 /* GetAccessor */: return getAccessorChildAt(element, index); - case 145 /* SetAccessor */: return setAccessorChildAt(element, index); - case 146 /* PropertySignature */: return propertySignatureChildAt(element, index); - case 147 /* CallSignature */: return callSignatureChildAt(element, index); - case 148 /* ConstructSignature */: return constructSignatureChildAt(element, index); - case 149 /* IndexSignature */: return indexSignatureChildAt(element, index); - case 150 /* MethodSignature */: return methodSignatureChildAt(element, index); - case 151 /* Block */: return blockChildAt(element, index); - case 152 /* IfStatement */: return ifStatementChildAt(element, index); - case 153 /* VariableStatement */: return variableStatementChildAt(element, index); - case 154 /* ExpressionStatement */: return expressionStatementChildAt(element, index); - case 155 /* ReturnStatement */: return returnStatementChildAt(element, index); - case 156 /* SwitchStatement */: return switchStatementChildAt(element, index); - case 157 /* BreakStatement */: return breakStatementChildAt(element, index); - case 158 /* ContinueStatement */: return continueStatementChildAt(element, index); - case 159 /* ForStatement */: return forStatementChildAt(element, index); - case 160 /* ForInStatement */: return forInStatementChildAt(element, index); - case 161 /* EmptyStatement */: return emptyStatementChildAt(element, index); - case 162 /* ThrowStatement */: return throwStatementChildAt(element, index); - case 163 /* WhileStatement */: return whileStatementChildAt(element, index); - case 164 /* TryStatement */: return tryStatementChildAt(element, index); - case 165 /* LabeledStatement */: return labeledStatementChildAt(element, index); - case 166 /* DoStatement */: return doStatementChildAt(element, index); - case 167 /* DebuggerStatement */: return debuggerStatementChildAt(element, index); - case 168 /* WithStatement */: return withStatementChildAt(element, index); - case 169 /* PrefixUnaryExpression */: return prefixUnaryExpressionChildAt(element, index); - case 170 /* DeleteExpression */: return deleteExpressionChildAt(element, index); - case 171 /* TypeOfExpression */: return typeOfExpressionChildAt(element, index); - case 172 /* VoidExpression */: return voidExpressionChildAt(element, index); - case 173 /* ConditionalExpression */: return conditionalExpressionChildAt(element, index); - case 174 /* BinaryExpression */: return binaryExpressionChildAt(element, index); - case 175 /* PostfixUnaryExpression */: return postfixUnaryExpressionChildAt(element, index); - case 176 /* MemberAccessExpression */: return memberAccessExpressionChildAt(element, index); - case 177 /* InvocationExpression */: return invocationExpressionChildAt(element, index); - case 178 /* ArrayLiteralExpression */: return arrayLiteralExpressionChildAt(element, index); - case 179 /* ObjectLiteralExpression */: return objectLiteralExpressionChildAt(element, index); - case 180 /* ObjectCreationExpression */: return objectCreationExpressionChildAt(element, index); - case 181 /* ParenthesizedExpression */: return parenthesizedExpressionChildAt(element, index); - case 182 /* ParenthesizedArrowFunctionExpression */: return parenthesizedArrowFunctionExpressionChildAt(element, index); - case 183 /* SimpleArrowFunctionExpression */: return simpleArrowFunctionExpressionChildAt(element, index); - case 184 /* CastExpression */: return castExpressionChildAt(element, index); - case 185 /* ElementAccessExpression */: return elementAccessExpressionChildAt(element, index); - case 186 /* FunctionExpression */: return functionExpressionChildAt(element, index); - case 187 /* OmittedExpression */: return omittedExpressionChildAt(element, index); - case 188 /* TemplateExpression */: return templateExpressionChildAt(element, index); - case 189 /* TemplateAccessExpression */: return templateAccessExpressionChildAt(element, index); - case 190 /* VariableDeclaration */: return variableDeclarationChildAt(element, index); - case 191 /* VariableDeclarator */: return variableDeclaratorChildAt(element, index); - case 192 /* ArgumentList */: return argumentListChildAt(element, index); - case 193 /* ParameterList */: return parameterListChildAt(element, index); - case 194 /* TypeArgumentList */: return typeArgumentListChildAt(element, index); - case 195 /* TypeParameterList */: return typeParameterListChildAt(element, index); - case 196 /* HeritageClause */: return heritageClauseChildAt(element, index); - case 197 /* EqualsValueClause */: return equalsValueClauseChildAt(element, index); - case 198 /* CaseSwitchClause */: return caseSwitchClauseChildAt(element, index); - case 199 /* DefaultSwitchClause */: return defaultSwitchClauseChildAt(element, index); - case 200 /* ElseClause */: return elseClauseChildAt(element, index); - case 201 /* CatchClause */: return catchClauseChildAt(element, index); - case 202 /* FinallyClause */: return finallyClauseChildAt(element, index); - case 203 /* TemplateClause */: return templateClauseChildAt(element, index); - case 204 /* TypeParameter */: return typeParameterChildAt(element, index); - case 205 /* Constraint */: return constraintChildAt(element, index); - case 206 /* SimplePropertyAssignment */: return simplePropertyAssignmentChildAt(element, index); - case 207 /* FunctionPropertyAssignment */: return functionPropertyAssignmentChildAt(element, index); - case 208 /* Parameter */: return parameterChildAt(element, index); - case 209 /* EnumElement */: return enumElementChildAt(element, index); - case 210 /* TypeAnnotation */: return typeAnnotationChildAt(element, index); - case 211 /* ExternalModuleReference */: return externalModuleReferenceChildAt(element, index); - case 212 /* ModuleNameModuleReference */: return moduleNameModuleReferenceChildAt(element, index); - } - } - TypeScript.childAt = childAt; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function visitNodeOrToken(visitor, element) { - if (element === undefined) { - return undefined; - } - switch (element.kind()) { - case 122 /* SourceUnit */: return visitor.visitSourceUnit(element); - case 123 /* QualifiedName */: return visitor.visitQualifiedName(element); - case 124 /* ObjectType */: return visitor.visitObjectType(element); - case 125 /* FunctionType */: return visitor.visitFunctionType(element); - case 126 /* ArrayType */: return visitor.visitArrayType(element); - case 127 /* ConstructorType */: return visitor.visitConstructorType(element); - case 128 /* GenericType */: return visitor.visitGenericType(element); - case 129 /* TypeQuery */: return visitor.visitTypeQuery(element); - case 130 /* TupleType */: return visitor.visitTupleType(element); - case 131 /* UnionType */: return visitor.visitUnionType(element); - case 132 /* ParenthesizedType */: return visitor.visitParenthesizedType(element); - case 133 /* InterfaceDeclaration */: return visitor.visitInterfaceDeclaration(element); - case 134 /* FunctionDeclaration */: return visitor.visitFunctionDeclaration(element); - case 135 /* ModuleDeclaration */: return visitor.visitModuleDeclaration(element); - case 136 /* ClassDeclaration */: return visitor.visitClassDeclaration(element); - case 137 /* EnumDeclaration */: return visitor.visitEnumDeclaration(element); - case 138 /* ImportDeclaration */: return visitor.visitImportDeclaration(element); - case 139 /* ExportAssignment */: return visitor.visitExportAssignment(element); - case 140 /* MemberFunctionDeclaration */: return visitor.visitMemberFunctionDeclaration(element); - case 141 /* MemberVariableDeclaration */: return visitor.visitMemberVariableDeclaration(element); - case 142 /* ConstructorDeclaration */: return visitor.visitConstructorDeclaration(element); - case 143 /* IndexMemberDeclaration */: return visitor.visitIndexMemberDeclaration(element); - case 144 /* GetAccessor */: return visitor.visitGetAccessor(element); - case 145 /* SetAccessor */: return visitor.visitSetAccessor(element); - case 146 /* PropertySignature */: return visitor.visitPropertySignature(element); - case 147 /* CallSignature */: return visitor.visitCallSignature(element); - case 148 /* ConstructSignature */: return visitor.visitConstructSignature(element); - case 149 /* IndexSignature */: return visitor.visitIndexSignature(element); - case 150 /* MethodSignature */: return visitor.visitMethodSignature(element); - case 151 /* Block */: return visitor.visitBlock(element); - case 152 /* IfStatement */: return visitor.visitIfStatement(element); - case 153 /* VariableStatement */: return visitor.visitVariableStatement(element); - case 154 /* ExpressionStatement */: return visitor.visitExpressionStatement(element); - case 155 /* ReturnStatement */: return visitor.visitReturnStatement(element); - case 156 /* SwitchStatement */: return visitor.visitSwitchStatement(element); - case 157 /* BreakStatement */: return visitor.visitBreakStatement(element); - case 158 /* ContinueStatement */: return visitor.visitContinueStatement(element); - case 159 /* ForStatement */: return visitor.visitForStatement(element); - case 160 /* ForInStatement */: return visitor.visitForInStatement(element); - case 161 /* EmptyStatement */: return visitor.visitEmptyStatement(element); - case 162 /* ThrowStatement */: return visitor.visitThrowStatement(element); - case 163 /* WhileStatement */: return visitor.visitWhileStatement(element); - case 164 /* TryStatement */: return visitor.visitTryStatement(element); - case 165 /* LabeledStatement */: return visitor.visitLabeledStatement(element); - case 166 /* DoStatement */: return visitor.visitDoStatement(element); - case 167 /* DebuggerStatement */: return visitor.visitDebuggerStatement(element); - case 168 /* WithStatement */: return visitor.visitWithStatement(element); - case 169 /* PrefixUnaryExpression */: return visitor.visitPrefixUnaryExpression(element); - case 170 /* DeleteExpression */: return visitor.visitDeleteExpression(element); - case 171 /* TypeOfExpression */: return visitor.visitTypeOfExpression(element); - case 172 /* VoidExpression */: return visitor.visitVoidExpression(element); - case 173 /* ConditionalExpression */: return visitor.visitConditionalExpression(element); - case 174 /* BinaryExpression */: return visitor.visitBinaryExpression(element); - case 175 /* PostfixUnaryExpression */: return visitor.visitPostfixUnaryExpression(element); - case 176 /* MemberAccessExpression */: return visitor.visitMemberAccessExpression(element); - case 177 /* InvocationExpression */: return visitor.visitInvocationExpression(element); - case 178 /* ArrayLiteralExpression */: return visitor.visitArrayLiteralExpression(element); - case 179 /* ObjectLiteralExpression */: return visitor.visitObjectLiteralExpression(element); - case 180 /* ObjectCreationExpression */: return visitor.visitObjectCreationExpression(element); - case 181 /* ParenthesizedExpression */: return visitor.visitParenthesizedExpression(element); - case 182 /* ParenthesizedArrowFunctionExpression */: return visitor.visitParenthesizedArrowFunctionExpression(element); - case 183 /* SimpleArrowFunctionExpression */: return visitor.visitSimpleArrowFunctionExpression(element); - case 184 /* CastExpression */: return visitor.visitCastExpression(element); - case 185 /* ElementAccessExpression */: return visitor.visitElementAccessExpression(element); - case 186 /* FunctionExpression */: return visitor.visitFunctionExpression(element); - case 187 /* OmittedExpression */: return visitor.visitOmittedExpression(element); - case 188 /* TemplateExpression */: return visitor.visitTemplateExpression(element); - case 189 /* TemplateAccessExpression */: return visitor.visitTemplateAccessExpression(element); - case 190 /* VariableDeclaration */: return visitor.visitVariableDeclaration(element); - case 191 /* VariableDeclarator */: return visitor.visitVariableDeclarator(element); - case 192 /* ArgumentList */: return visitor.visitArgumentList(element); - case 193 /* ParameterList */: return visitor.visitParameterList(element); - case 194 /* TypeArgumentList */: return visitor.visitTypeArgumentList(element); - case 195 /* TypeParameterList */: return visitor.visitTypeParameterList(element); - case 196 /* HeritageClause */: return visitor.visitHeritageClause(element); - case 197 /* EqualsValueClause */: return visitor.visitEqualsValueClause(element); - case 198 /* CaseSwitchClause */: return visitor.visitCaseSwitchClause(element); - case 199 /* DefaultSwitchClause */: return visitor.visitDefaultSwitchClause(element); - case 200 /* ElseClause */: return visitor.visitElseClause(element); - case 201 /* CatchClause */: return visitor.visitCatchClause(element); - case 202 /* FinallyClause */: return visitor.visitFinallyClause(element); - case 203 /* TemplateClause */: return visitor.visitTemplateClause(element); - case 204 /* TypeParameter */: return visitor.visitTypeParameter(element); - case 205 /* Constraint */: return visitor.visitConstraint(element); - case 206 /* SimplePropertyAssignment */: return visitor.visitSimplePropertyAssignment(element); - case 207 /* FunctionPropertyAssignment */: return visitor.visitFunctionPropertyAssignment(element); - case 208 /* Parameter */: return visitor.visitParameter(element); - case 209 /* EnumElement */: return visitor.visitEnumElement(element); - case 210 /* TypeAnnotation */: return visitor.visitTypeAnnotation(element); - case 211 /* ExternalModuleReference */: return visitor.visitExternalModuleReference(element); - case 212 /* ModuleNameModuleReference */: return visitor.visitModuleNameModuleReference(element); - default: return visitor.visitToken(element); - } - } - TypeScript.visitNodeOrToken = visitNodeOrToken; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxWalker = (function () { - function SyntaxWalker() { - } - SyntaxWalker.prototype.visitToken = function (token) { - }; - SyntaxWalker.prototype.visitOptionalToken = function (token) { - if (token === undefined) { - return; - } - this.visitToken(token); - }; - SyntaxWalker.prototype.visitList = function (list) { - for (var i = 0, n = list.length; i < n; i++) { - TypeScript.visitNodeOrToken(this, list[i]); - } - }; - SyntaxWalker.prototype.visitSourceUnit = function (node) { - this.visitList(node.moduleElements); - this.visitToken(node.endOfFileToken); - }; - SyntaxWalker.prototype.visitQualifiedName = function (node) { - TypeScript.visitNodeOrToken(this, node.left); - this.visitToken(node.dotToken); - this.visitToken(node.right); - }; - SyntaxWalker.prototype.visitObjectType = function (node) { - this.visitToken(node.openBraceToken); - this.visitList(node.typeMembers); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitFunctionType = function (node) { - TypeScript.visitNodeOrToken(this, node.typeParameterList); - TypeScript.visitNodeOrToken(this, node.parameterList); - this.visitToken(node.equalsGreaterThanToken); - TypeScript.visitNodeOrToken(this, node.type); - }; - SyntaxWalker.prototype.visitArrayType = function (node) { - TypeScript.visitNodeOrToken(this, node.type); - this.visitToken(node.openBracketToken); - this.visitToken(node.closeBracketToken); - }; - SyntaxWalker.prototype.visitConstructorType = function (node) { - this.visitToken(node.newKeyword); - TypeScript.visitNodeOrToken(this, node.typeParameterList); - TypeScript.visitNodeOrToken(this, node.parameterList); - this.visitToken(node.equalsGreaterThanToken); - TypeScript.visitNodeOrToken(this, node.type); - }; - SyntaxWalker.prototype.visitGenericType = function (node) { - TypeScript.visitNodeOrToken(this, node.name); - TypeScript.visitNodeOrToken(this, node.typeArgumentList); - }; - SyntaxWalker.prototype.visitTypeQuery = function (node) { - this.visitToken(node.typeOfKeyword); - TypeScript.visitNodeOrToken(this, node.name); - }; - SyntaxWalker.prototype.visitTupleType = function (node) { - this.visitToken(node.openBracketToken); - this.visitList(node.types); - this.visitToken(node.closeBracketToken); - }; - SyntaxWalker.prototype.visitUnionType = function (node) { - TypeScript.visitNodeOrToken(this, node.left); - this.visitToken(node.barToken); - TypeScript.visitNodeOrToken(this, node.right); - }; - SyntaxWalker.prototype.visitParenthesizedType = function (node) { - this.visitToken(node.openParenToken); - TypeScript.visitNodeOrToken(this, node.type); - this.visitToken(node.closeParenToken); - }; - SyntaxWalker.prototype.visitInterfaceDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.interfaceKeyword); - this.visitToken(node.identifier); - TypeScript.visitNodeOrToken(this, node.typeParameterList); - this.visitList(node.heritageClauses); - TypeScript.visitNodeOrToken(this, node.body); - }; - SyntaxWalker.prototype.visitFunctionDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.functionKeyword); - this.visitToken(node.identifier); - TypeScript.visitNodeOrToken(this, node.callSignature); - TypeScript.visitNodeOrToken(this, node.block); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitModuleDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.moduleKeyword); - TypeScript.visitNodeOrToken(this, node.name); - this.visitOptionalToken(node.stringLiteral); - this.visitToken(node.openBraceToken); - this.visitList(node.moduleElements); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitClassDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.classKeyword); - this.visitToken(node.identifier); - TypeScript.visitNodeOrToken(this, node.typeParameterList); - this.visitList(node.heritageClauses); - this.visitToken(node.openBraceToken); - this.visitList(node.classElements); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitEnumDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.enumKeyword); - this.visitToken(node.identifier); - this.visitToken(node.openBraceToken); - this.visitList(node.enumElements); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitImportDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.importKeyword); - this.visitToken(node.identifier); - this.visitToken(node.equalsToken); - TypeScript.visitNodeOrToken(this, node.moduleReference); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitExportAssignment = function (node) { - this.visitToken(node.exportKeyword); - this.visitToken(node.equalsToken); - this.visitToken(node.identifier); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitMemberFunctionDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.propertyName); - TypeScript.visitNodeOrToken(this, node.callSignature); - TypeScript.visitNodeOrToken(this, node.block); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitMemberVariableDeclaration = function (node) { - this.visitList(node.modifiers); - TypeScript.visitNodeOrToken(this, node.variableDeclarator); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitConstructorDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.constructorKeyword); - TypeScript.visitNodeOrToken(this, node.callSignature); - TypeScript.visitNodeOrToken(this, node.block); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitIndexMemberDeclaration = function (node) { - this.visitList(node.modifiers); - TypeScript.visitNodeOrToken(this, node.indexSignature); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitGetAccessor = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.getKeyword); - this.visitToken(node.propertyName); - TypeScript.visitNodeOrToken(this, node.callSignature); - TypeScript.visitNodeOrToken(this, node.block); - }; - SyntaxWalker.prototype.visitSetAccessor = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.setKeyword); - this.visitToken(node.propertyName); - TypeScript.visitNodeOrToken(this, node.callSignature); - TypeScript.visitNodeOrToken(this, node.block); - }; - SyntaxWalker.prototype.visitPropertySignature = function (node) { - this.visitToken(node.propertyName); - this.visitOptionalToken(node.questionToken); - TypeScript.visitNodeOrToken(this, node.typeAnnotation); - }; - SyntaxWalker.prototype.visitCallSignature = function (node) { - TypeScript.visitNodeOrToken(this, node.typeParameterList); - TypeScript.visitNodeOrToken(this, node.parameterList); - TypeScript.visitNodeOrToken(this, node.typeAnnotation); - }; - SyntaxWalker.prototype.visitConstructSignature = function (node) { - this.visitToken(node.newKeyword); - TypeScript.visitNodeOrToken(this, node.callSignature); - }; - SyntaxWalker.prototype.visitIndexSignature = function (node) { - this.visitToken(node.openBracketToken); - this.visitList(node.parameters); - this.visitToken(node.closeBracketToken); - TypeScript.visitNodeOrToken(this, node.typeAnnotation); - }; - SyntaxWalker.prototype.visitMethodSignature = function (node) { - this.visitToken(node.propertyName); - this.visitOptionalToken(node.questionToken); - TypeScript.visitNodeOrToken(this, node.callSignature); - }; - SyntaxWalker.prototype.visitBlock = function (node) { - this.visitToken(node.openBraceToken); - this.visitList(node.statements); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitIfStatement = function (node) { - this.visitToken(node.ifKeyword); - this.visitToken(node.openParenToken); - TypeScript.visitNodeOrToken(this, node.condition); - this.visitToken(node.closeParenToken); - TypeScript.visitNodeOrToken(this, node.statement); - TypeScript.visitNodeOrToken(this, node.elseClause); - }; - SyntaxWalker.prototype.visitVariableStatement = function (node) { - this.visitList(node.modifiers); - TypeScript.visitNodeOrToken(this, node.variableDeclaration); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitExpressionStatement = function (node) { - TypeScript.visitNodeOrToken(this, node.expression); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitReturnStatement = function (node) { - this.visitToken(node.returnKeyword); - TypeScript.visitNodeOrToken(this, node.expression); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitSwitchStatement = function (node) { - this.visitToken(node.switchKeyword); - this.visitToken(node.openParenToken); - TypeScript.visitNodeOrToken(this, node.expression); - this.visitToken(node.closeParenToken); - this.visitToken(node.openBraceToken); - this.visitList(node.switchClauses); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitBreakStatement = function (node) { - this.visitToken(node.breakKeyword); - this.visitOptionalToken(node.identifier); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitContinueStatement = function (node) { - this.visitToken(node.continueKeyword); - this.visitOptionalToken(node.identifier); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitForStatement = function (node) { - this.visitToken(node.forKeyword); - this.visitToken(node.openParenToken); - TypeScript.visitNodeOrToken(this, node.variableDeclaration); - TypeScript.visitNodeOrToken(this, node.initializer); - this.visitToken(node.firstSemicolonToken); - TypeScript.visitNodeOrToken(this, node.condition); - this.visitToken(node.secondSemicolonToken); - TypeScript.visitNodeOrToken(this, node.incrementor); - this.visitToken(node.closeParenToken); - TypeScript.visitNodeOrToken(this, node.statement); - }; - SyntaxWalker.prototype.visitForInStatement = function (node) { - this.visitToken(node.forKeyword); - this.visitToken(node.openParenToken); - TypeScript.visitNodeOrToken(this, node.variableDeclaration); - TypeScript.visitNodeOrToken(this, node.left); - this.visitToken(node.inKeyword); - TypeScript.visitNodeOrToken(this, node.expression); - this.visitToken(node.closeParenToken); - TypeScript.visitNodeOrToken(this, node.statement); - }; - SyntaxWalker.prototype.visitEmptyStatement = function (node) { - this.visitToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitThrowStatement = function (node) { - this.visitToken(node.throwKeyword); - TypeScript.visitNodeOrToken(this, node.expression); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitWhileStatement = function (node) { - this.visitToken(node.whileKeyword); - this.visitToken(node.openParenToken); - TypeScript.visitNodeOrToken(this, node.condition); - this.visitToken(node.closeParenToken); - TypeScript.visitNodeOrToken(this, node.statement); - }; - SyntaxWalker.prototype.visitTryStatement = function (node) { - this.visitToken(node.tryKeyword); - TypeScript.visitNodeOrToken(this, node.block); - TypeScript.visitNodeOrToken(this, node.catchClause); - TypeScript.visitNodeOrToken(this, node.finallyClause); - }; - SyntaxWalker.prototype.visitLabeledStatement = function (node) { - this.visitToken(node.identifier); - this.visitToken(node.colonToken); - TypeScript.visitNodeOrToken(this, node.statement); - }; - SyntaxWalker.prototype.visitDoStatement = function (node) { - this.visitToken(node.doKeyword); - TypeScript.visitNodeOrToken(this, node.statement); - this.visitToken(node.whileKeyword); - this.visitToken(node.openParenToken); - TypeScript.visitNodeOrToken(this, node.condition); - this.visitToken(node.closeParenToken); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitDebuggerStatement = function (node) { - this.visitToken(node.debuggerKeyword); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitWithStatement = function (node) { - this.visitToken(node.withKeyword); - this.visitToken(node.openParenToken); - TypeScript.visitNodeOrToken(this, node.condition); - this.visitToken(node.closeParenToken); - TypeScript.visitNodeOrToken(this, node.statement); - }; - SyntaxWalker.prototype.visitPrefixUnaryExpression = function (node) { - this.visitToken(node.operatorToken); - TypeScript.visitNodeOrToken(this, node.operand); - }; - SyntaxWalker.prototype.visitDeleteExpression = function (node) { - this.visitToken(node.deleteKeyword); - TypeScript.visitNodeOrToken(this, node.expression); - }; - SyntaxWalker.prototype.visitTypeOfExpression = function (node) { - this.visitToken(node.typeOfKeyword); - TypeScript.visitNodeOrToken(this, node.expression); - }; - SyntaxWalker.prototype.visitVoidExpression = function (node) { - this.visitToken(node.voidKeyword); - TypeScript.visitNodeOrToken(this, node.expression); - }; - SyntaxWalker.prototype.visitConditionalExpression = function (node) { - TypeScript.visitNodeOrToken(this, node.condition); - this.visitToken(node.questionToken); - TypeScript.visitNodeOrToken(this, node.whenTrue); - this.visitToken(node.colonToken); - TypeScript.visitNodeOrToken(this, node.whenFalse); - }; - SyntaxWalker.prototype.visitBinaryExpression = function (node) { - TypeScript.visitNodeOrToken(this, node.left); - this.visitToken(node.operatorToken); - TypeScript.visitNodeOrToken(this, node.right); - }; - SyntaxWalker.prototype.visitPostfixUnaryExpression = function (node) { - TypeScript.visitNodeOrToken(this, node.operand); - this.visitToken(node.operatorToken); - }; - SyntaxWalker.prototype.visitMemberAccessExpression = function (node) { - TypeScript.visitNodeOrToken(this, node.expression); - this.visitToken(node.dotToken); - this.visitToken(node.name); - }; - SyntaxWalker.prototype.visitInvocationExpression = function (node) { - TypeScript.visitNodeOrToken(this, node.expression); - TypeScript.visitNodeOrToken(this, node.argumentList); - }; - SyntaxWalker.prototype.visitArrayLiteralExpression = function (node) { - this.visitToken(node.openBracketToken); - this.visitList(node.expressions); - this.visitToken(node.closeBracketToken); - }; - SyntaxWalker.prototype.visitObjectLiteralExpression = function (node) { - this.visitToken(node.openBraceToken); - this.visitList(node.propertyAssignments); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitObjectCreationExpression = function (node) { - this.visitToken(node.newKeyword); - TypeScript.visitNodeOrToken(this, node.expression); - TypeScript.visitNodeOrToken(this, node.argumentList); - }; - SyntaxWalker.prototype.visitParenthesizedExpression = function (node) { - this.visitToken(node.openParenToken); - TypeScript.visitNodeOrToken(this, node.expression); - this.visitToken(node.closeParenToken); - }; - SyntaxWalker.prototype.visitParenthesizedArrowFunctionExpression = function (node) { - TypeScript.visitNodeOrToken(this, node.callSignature); - this.visitToken(node.equalsGreaterThanToken); - TypeScript.visitNodeOrToken(this, node.block); - TypeScript.visitNodeOrToken(this, node.expression); - }; - SyntaxWalker.prototype.visitSimpleArrowFunctionExpression = function (node) { - TypeScript.visitNodeOrToken(this, node.parameter); - this.visitToken(node.equalsGreaterThanToken); - TypeScript.visitNodeOrToken(this, node.block); - TypeScript.visitNodeOrToken(this, node.expression); - }; - SyntaxWalker.prototype.visitCastExpression = function (node) { - this.visitToken(node.lessThanToken); - TypeScript.visitNodeOrToken(this, node.type); - this.visitToken(node.greaterThanToken); - TypeScript.visitNodeOrToken(this, node.expression); - }; - SyntaxWalker.prototype.visitElementAccessExpression = function (node) { - TypeScript.visitNodeOrToken(this, node.expression); - this.visitToken(node.openBracketToken); - TypeScript.visitNodeOrToken(this, node.argumentExpression); - this.visitToken(node.closeBracketToken); - }; - SyntaxWalker.prototype.visitFunctionExpression = function (node) { - this.visitToken(node.functionKeyword); - this.visitOptionalToken(node.identifier); - TypeScript.visitNodeOrToken(this, node.callSignature); - TypeScript.visitNodeOrToken(this, node.block); - }; - SyntaxWalker.prototype.visitOmittedExpression = function (node) { - }; - SyntaxWalker.prototype.visitTemplateExpression = function (node) { - this.visitToken(node.templateStartToken); - this.visitList(node.templateClauses); - }; - SyntaxWalker.prototype.visitTemplateAccessExpression = function (node) { - TypeScript.visitNodeOrToken(this, node.expression); - TypeScript.visitNodeOrToken(this, node.templateExpression); - }; - SyntaxWalker.prototype.visitVariableDeclaration = function (node) { - this.visitToken(node.varKeyword); - this.visitList(node.variableDeclarators); - }; - SyntaxWalker.prototype.visitVariableDeclarator = function (node) { - this.visitToken(node.propertyName); - TypeScript.visitNodeOrToken(this, node.typeAnnotation); - TypeScript.visitNodeOrToken(this, node.equalsValueClause); - }; - SyntaxWalker.prototype.visitArgumentList = function (node) { - TypeScript.visitNodeOrToken(this, node.typeArgumentList); - this.visitToken(node.openParenToken); - this.visitList(node.arguments); - this.visitToken(node.closeParenToken); - }; - SyntaxWalker.prototype.visitParameterList = function (node) { - this.visitToken(node.openParenToken); - this.visitList(node.parameters); - this.visitToken(node.closeParenToken); - }; - SyntaxWalker.prototype.visitTypeArgumentList = function (node) { - this.visitToken(node.lessThanToken); - this.visitList(node.typeArguments); - this.visitToken(node.greaterThanToken); - }; - SyntaxWalker.prototype.visitTypeParameterList = function (node) { - this.visitToken(node.lessThanToken); - this.visitList(node.typeParameters); - this.visitToken(node.greaterThanToken); - }; - SyntaxWalker.prototype.visitHeritageClause = function (node) { - this.visitToken(node.extendsOrImplementsKeyword); - this.visitList(node.typeNames); - }; - SyntaxWalker.prototype.visitEqualsValueClause = function (node) { - this.visitToken(node.equalsToken); - TypeScript.visitNodeOrToken(this, node.value); - }; - SyntaxWalker.prototype.visitCaseSwitchClause = function (node) { - this.visitToken(node.caseKeyword); - TypeScript.visitNodeOrToken(this, node.expression); - this.visitToken(node.colonToken); - this.visitList(node.statements); - }; - SyntaxWalker.prototype.visitDefaultSwitchClause = function (node) { - this.visitToken(node.defaultKeyword); - this.visitToken(node.colonToken); - this.visitList(node.statements); - }; - SyntaxWalker.prototype.visitElseClause = function (node) { - this.visitToken(node.elseKeyword); - TypeScript.visitNodeOrToken(this, node.statement); - }; - SyntaxWalker.prototype.visitCatchClause = function (node) { - this.visitToken(node.catchKeyword); - this.visitToken(node.openParenToken); - this.visitToken(node.identifier); - TypeScript.visitNodeOrToken(this, node.typeAnnotation); - this.visitToken(node.closeParenToken); - TypeScript.visitNodeOrToken(this, node.block); - }; - SyntaxWalker.prototype.visitFinallyClause = function (node) { - this.visitToken(node.finallyKeyword); - TypeScript.visitNodeOrToken(this, node.block); - }; - SyntaxWalker.prototype.visitTemplateClause = function (node) { - TypeScript.visitNodeOrToken(this, node.expression); - this.visitToken(node.templateMiddleOrEndToken); - }; - SyntaxWalker.prototype.visitTypeParameter = function (node) { - this.visitToken(node.identifier); - TypeScript.visitNodeOrToken(this, node.constraint); - }; - SyntaxWalker.prototype.visitConstraint = function (node) { - this.visitToken(node.extendsKeyword); - TypeScript.visitNodeOrToken(this, node.typeOrExpression); - }; - SyntaxWalker.prototype.visitSimplePropertyAssignment = function (node) { - this.visitToken(node.propertyName); - this.visitToken(node.colonToken); - TypeScript.visitNodeOrToken(this, node.expression); - }; - SyntaxWalker.prototype.visitFunctionPropertyAssignment = function (node) { - this.visitToken(node.propertyName); - TypeScript.visitNodeOrToken(this, node.callSignature); - TypeScript.visitNodeOrToken(this, node.block); - }; - SyntaxWalker.prototype.visitParameter = function (node) { - this.visitOptionalToken(node.dotDotDotToken); - this.visitList(node.modifiers); - this.visitToken(node.identifier); - this.visitOptionalToken(node.questionToken); - TypeScript.visitNodeOrToken(this, node.typeAnnotation); - TypeScript.visitNodeOrToken(this, node.equalsValueClause); - }; - SyntaxWalker.prototype.visitEnumElement = function (node) { - this.visitToken(node.propertyName); - TypeScript.visitNodeOrToken(this, node.equalsValueClause); - }; - SyntaxWalker.prototype.visitTypeAnnotation = function (node) { - this.visitToken(node.colonToken); - TypeScript.visitNodeOrToken(this, node.type); - }; - SyntaxWalker.prototype.visitExternalModuleReference = function (node) { - this.visitToken(node.requireKeyword); - this.visitToken(node.openParenToken); - this.visitToken(node.stringLiteral); - this.visitToken(node.closeParenToken); - }; - SyntaxWalker.prototype.visitModuleNameModuleReference = function (node) { - TypeScript.visitNodeOrToken(this, node.moduleName); - }; - return SyntaxWalker; - })(); - TypeScript.SyntaxWalker = SyntaxWalker; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Parser; - (function (Parser) { - var arrayPool = []; - var arrayPoolCount = 0; - function getArray() { - if (arrayPoolCount === 0) { - return []; - } - arrayPoolCount--; - var result = arrayPool[arrayPoolCount]; - arrayPool[arrayPoolCount] = undefined; - return result; - } - function returnArray(array) { - array.length = 0; - arrayPool[arrayPoolCount] = array; - arrayPoolCount++; - } - function createParseSyntaxTree() { - var fileName; - var source; - var languageVersion; - var listParsingState = 0; - var isInStrictMode = false; - var diagnostics = []; - var parseNodeData = 0; - function parseSyntaxTree(_source, isDeclaration) { - fileName = _source.fileName; - source = _source; - languageVersion = source.languageVersion; - var result = parseSyntaxTreeWorker(isDeclaration); - diagnostics = []; - parseNodeData = 0 /* None */; - fileName = undefined; - source.release(); - source = undefined; - _source = undefined; - return result; - } - function parseSyntaxTreeWorker(isDeclaration) { - var sourceUnit = parseSourceUnit(); - var allDiagnostics = source.tokenDiagnostics().concat(diagnostics); - allDiagnostics.sort(function (a, b) { return a.start() - b.start(); }); - return new TypeScript.SyntaxTree(sourceUnit, isDeclaration, allDiagnostics, fileName, source.text, languageVersion); - } - function getRewindPoint() { - var rewindPoint = source.getRewindPoint(); - rewindPoint.diagnosticsCount = diagnostics.length; - rewindPoint.isInStrictMode = isInStrictMode; - rewindPoint.listParsingState = listParsingState; - return rewindPoint; - } - function rewind(rewindPoint) { - source.rewind(rewindPoint); - diagnostics.length = rewindPoint.diagnosticsCount; - } - function releaseRewindPoint(rewindPoint) { - source.releaseRewindPoint(rewindPoint); - } - function currentNode() { - var node = source.currentNode(); - if (!node || TypeScript.parsedInStrictMode(node) !== isInStrictMode) { - return undefined; - } - return node; - } - function currentToken() { - return source.currentToken(); - } - function currentContextualToken() { - return source.currentContextualToken(); - } - function peekToken(n) { - return source.peekToken(n); - } - function consumeToken(token) { - source.consumeToken(token); - return token; - } - function consumeNode(node) { - source.consumeNode(node); - } - function eatToken(kind) { - var token = currentToken(); - if (token.kind() === kind) { - return consumeToken(token); - } - return createMissingToken(kind, token); - } - function tryEatToken(kind) { - var _currentToken = currentToken(); - if (_currentToken.kind() === kind) { - return consumeToken(_currentToken); - } - return undefined; - } - function isIdentifier(token) { - var tokenKind = token.kind(); - if (tokenKind === 9 /* IdentifierName */) { - return true; - } - if (tokenKind >= TypeScript.SyntaxKind.FirstFutureReservedStrictKeyword) { - if (tokenKind <= TypeScript.SyntaxKind.LastFutureReservedStrictKeyword) { - return !isInStrictMode; - } - return tokenKind <= TypeScript.SyntaxKind.LastTypeScriptKeyword; - } - return false; - } - function eatIdentifierNameToken() { - var token = currentToken(); - var tokenKind = token.kind(); - if (tokenKind === 9 /* IdentifierName */) { - return consumeToken(token); - } - if (TypeScript.SyntaxFacts.isAnyKeyword(tokenKind)) { - return TypeScript.Syntax.convertKeywordToIdentifier(consumeToken(token)); - } - return createMissingToken(9 /* IdentifierName */, token); - } - function eatOptionalIdentifierToken() { - return isIdentifier(currentToken()) ? eatIdentifierToken() : undefined; - } - function eatIdentifierToken(diagnosticCode) { - var token = currentToken(); - if (isIdentifier(token)) { - consumeToken(token); - if (token.kind() === 9 /* IdentifierName */) { - return token; - } - return TypeScript.Syntax.convertKeywordToIdentifier(token); - } - return createMissingToken(9 /* IdentifierName */, token, diagnosticCode); - } - function previousTokenHasTrailingNewLine(token) { - var tokenFullStart = token.fullStart(); - if (tokenFullStart === 0) { - return false; - } - var lineNumber = source.text.lineMap().getLineNumberFromPosition(tokenFullStart); - var lineStart = source.text.lineMap().getLineStartPosition(lineNumber); - return lineStart == tokenFullStart; - } - function canEatAutomaticSemicolon(allowWithoutNewLine) { - var token = currentToken(); - var tokenKind = token.kind(); - if (tokenKind === 8 /* EndOfFileToken */) { - return true; - } - if (tokenKind === 73 /* CloseBraceToken */) { - return true; - } - if (allowWithoutNewLine) { - return true; - } - if (previousTokenHasTrailingNewLine(token)) { - return true; - } - return false; - } - function canEatExplicitOrAutomaticSemicolon(allowWithoutNewline) { - var token = currentToken(); - if (token.kind() === 80 /* SemicolonToken */) { - return true; - } - return canEatAutomaticSemicolon(allowWithoutNewline); - } - function eatExplicitOrAutomaticSemicolon(allowWithoutNewline) { - var token = currentToken(); - if (token.kind() === 80 /* SemicolonToken */) { - return consumeToken(token); - } - if (canEatAutomaticSemicolon(allowWithoutNewline)) { - return undefined; - } - return eatToken(80 /* SemicolonToken */); - } - function createMissingToken(expectedKind, actual, diagnosticCode) { - var diagnostic = getExpectedTokenDiagnostic(expectedKind, actual, diagnosticCode); - addDiagnostic(diagnostic); - return TypeScript.Syntax.emptyToken(expectedKind); - } - function getExpectedTokenDiagnostic(expectedKind, actual, diagnosticCode) { - var token = currentToken(); - var args = undefined; - if (!diagnosticCode) { - if (TypeScript.SyntaxFacts.isAnyKeyword(expectedKind) || TypeScript.SyntaxFacts.isAnyPunctuation(expectedKind)) { - diagnosticCode = TypeScript.DiagnosticCode._0_expected; - args = [TypeScript.SyntaxFacts.getText(expectedKind)]; - } - else { - if (actual && TypeScript.SyntaxFacts.isAnyKeyword(actual.kind())) { - diagnosticCode = TypeScript.DiagnosticCode.Identifier_expected_0_is_a_keyword; - args = [TypeScript.SyntaxFacts.getText(actual.kind())]; - } - else { - diagnosticCode = TypeScript.DiagnosticCode.Identifier_expected; - } - } - } - return new TypeScript.Diagnostic(fileName, source.text.lineMap(), TypeScript.start(token, source.text), TypeScript.width(token), diagnosticCode, args); - } - function getBinaryExpressionPrecedence(tokenKind) { - switch (tokenKind) { - case 106 /* BarBarToken */: return 2 /* LogicalOrExpressionPrecedence */; - case 105 /* AmpersandAmpersandToken */: return 3 /* LogicalAndExpressionPrecedence */; - case 101 /* BarToken */: return 4 /* BitwiseOrExpressionPrecedence */; - case 102 /* CaretToken */: return 5 /* BitwiseExclusiveOrExpressionPrecedence */; - case 100 /* AmpersandToken */: return 6 /* BitwiseAndExpressionPrecedence */; - case 86 /* EqualsEqualsToken */: - case 88 /* ExclamationEqualsToken */: - case 89 /* EqualsEqualsEqualsToken */: - case 90 /* ExclamationEqualsEqualsToken */: - return 7 /* EqualityExpressionPrecedence */; - case 82 /* LessThanToken */: - case 83 /* GreaterThanToken */: - case 84 /* LessThanEqualsToken */: - case 85 /* GreaterThanEqualsToken */: - case 32 /* InstanceOfKeyword */: - case 31 /* InKeyword */: - return 8 /* RelationalExpressionPrecedence */; - case 97 /* LessThanLessThanToken */: - case 98 /* GreaterThanGreaterThanToken */: - case 99 /* GreaterThanGreaterThanGreaterThanToken */: - return 9 /* ShiftExpressionPrecdence */; - case 91 /* PlusToken */: - case 92 /* MinusToken */: - return 10 /* AdditiveExpressionPrecedence */; - case 93 /* AsteriskToken */: - case 120 /* SlashToken */: - case 94 /* PercentToken */: - return 11 /* MultiplicativeExpressionPrecedence */; - } - throw TypeScript.Errors.invalidOperation(); - } - function addSkippedTokenAfterNodeOrToken(nodeOrToken, skippedToken) { - if (TypeScript.isToken(nodeOrToken)) { - return addSkippedTokenAfterToken(nodeOrToken, skippedToken); - } - else if (TypeScript.isNode(nodeOrToken)) { - return addSkippedTokenAfterNode(nodeOrToken, skippedToken); - } - else { - throw TypeScript.Errors.invalidOperation(); - } - } - function replaceTokenInParent(node, oldToken, newToken) { - replaceTokenInParentWorker(oldToken, newToken); - var parent = oldToken.parent; - newToken.parent = parent; - while (true) { - TypeScript.Debug.assert(TypeScript.isNode(parent) || TypeScript.isList(parent)); - var dataElement = parent; - if (dataElement.__data) { - dataElement.__data &= 4 /* NodeParsedInStrictModeMask */; - } - dataElement.__cachedTokens = undefined; - if (parent === node) { - break; - } - parent = parent.parent; - } - } - function replaceTokenInParentWorker(oldToken, newToken) { - var parent = oldToken.parent; - if (TypeScript.isNode(parent)) { - var node = parent; - for (var key in node) { - if (node[key] === oldToken) { - node[key] = newToken; - return; - } - } - } - else if (TypeScript.isList(parent)) { - var list1 = parent; - for (var i = 0, n = list1.length; i < n; i++) { - if (list1[i] === oldToken) { - list1[i] = newToken; - return; - } - } - } - throw TypeScript.Errors.invalidOperation(); - } - function addSkippedTokenAfterNode(node, skippedToken) { - var oldToken = TypeScript.lastToken(node); - var newToken = addSkippedTokenAfterToken(oldToken, skippedToken); - replaceTokenInParent(node, oldToken, newToken); - return node; - } - function addSkippedTokensBeforeNode(node, skippedTokens) { - if (skippedTokens.length > 0) { - var oldToken = TypeScript.firstToken(node); - var newToken = addSkippedTokensBeforeToken(oldToken, skippedTokens); - replaceTokenInParent(node, oldToken, newToken); - } - return node; - } - function addSkippedTokensBeforeToken(token, skippedTokens) { - var leadingTrivia = []; - for (var i = 0, n = skippedTokens.length; i < n; i++) { - var skippedToken = skippedTokens[i]; - addSkippedTokenToTriviaArray(leadingTrivia, skippedToken); - } - addTriviaTo(token.leadingTrivia(source.text), leadingTrivia); - var updatedToken = TypeScript.Syntax.withLeadingTrivia(token, TypeScript.Syntax.triviaList(leadingTrivia), source.text); - updatedToken.setFullStart(skippedTokens[0].fullStart()); - returnArray(skippedTokens); - return updatedToken; - } - function addSkippedTokensAfterToken(token, skippedTokens) { - if (skippedTokens.length === 0) { - returnArray(skippedTokens); - return token; - } - var trailingTrivia = token.trailingTrivia(source.text).toArray(); - for (var i = 0, n = skippedTokens.length; i < n; i++) { - addSkippedTokenToTriviaArray(trailingTrivia, skippedTokens[i]); - } - returnArray(skippedTokens); - return TypeScript.Syntax.withTrailingTrivia(token, TypeScript.Syntax.triviaList(trailingTrivia), source.text); - } - function addSkippedTokenAfterToken(token, skippedToken) { - var trailingTrivia = token.trailingTrivia(source.text).toArray(); - addSkippedTokenToTriviaArray(trailingTrivia, skippedToken); - return TypeScript.Syntax.withTrailingTrivia(token, TypeScript.Syntax.triviaList(trailingTrivia), source.text); - } - function addSkippedTokenToTriviaArray(array, skippedToken) { - addTriviaTo(skippedToken.leadingTrivia(source.text), array); - var trimmedToken = TypeScript.Syntax.withTrailingTrivia(TypeScript.Syntax.withLeadingTrivia(skippedToken, TypeScript.Syntax.emptyTriviaList, source.text), TypeScript.Syntax.emptyTriviaList, source.text); - trimmedToken.setFullStart(TypeScript.start(skippedToken, source.text)); - array.push(TypeScript.Syntax.skippedTokenTrivia(trimmedToken, source.text)); - addTriviaTo(skippedToken.trailingTrivia(source.text), array); - } - function addTriviaTo(list, array) { - for (var i = 0, n = list.count(); i < n; i++) { - array.push(list.syntaxTriviaAt(i)); - } - } - function setStrictMode(_isInStrictMode) { - isInStrictMode = _isInStrictMode; - parseNodeData = _isInStrictMode ? 4 /* NodeParsedInStrictModeMask */ : 0; - } - function parseSourceUnit() { - var savedIsInStrictMode = isInStrictMode; - var skippedTokens = getArray(); - var moduleElements = parseSyntaxList(0 /* SourceUnit_ModuleElements */, skippedTokens, updateStrictModeState); - setStrictMode(savedIsInStrictMode); - var sourceUnit = new TypeScript.SourceUnitSyntax(parseNodeData, moduleElements, currentToken()); - sourceUnit = addSkippedTokensBeforeNode(sourceUnit, skippedTokens); - if (TypeScript.Debug.shouldAssert(2 /* Aggressive */)) { - TypeScript.Debug.assert(TypeScript.fullWidth(sourceUnit) === source.text.length()); - if (TypeScript.Debug.shouldAssert(3 /* VeryAggressive */)) { - TypeScript.Debug.assert(TypeScript.fullText(sourceUnit) === source.text.substr(0, source.text.length())); - } - } - return sourceUnit; - } - function updateStrictModeState(items) { - if (!isInStrictMode) { - for (var i = 0; i < items.length; i++) { - var item = items[i]; - if (!TypeScript.SyntaxFacts.isDirectivePrologueElement(item)) { - return; - } - } - setStrictMode(TypeScript.SyntaxFacts.isUseStrictDirective(items[items.length - 1])); - } - } - function isModuleElement(inErrorRecovery) { - if (TypeScript.SyntaxUtilities.isModuleElement(currentNode())) { - return true; - } - var _modifierCount = modifierCount(); - return isInterfaceEnumClassModuleImportOrExport(_modifierCount) || isStatement(_modifierCount, inErrorRecovery); - } - function tryParseModuleElement(inErrorRecovery) { - var node = currentNode(); - if (TypeScript.SyntaxUtilities.isModuleElement(node)) { - consumeNode(node); - return node; - } - var _currentToken = currentToken(); - var _modifierCount = modifierCount(); - if (_modifierCount) { - switch (peekToken(_modifierCount).kind()) { - case 51 /* ImportKeyword */: return parseImportDeclaration(); - case 67 /* ModuleKeyword */: return parseModuleDeclaration(); - case 54 /* InterfaceKeyword */: return parseInterfaceDeclaration(); - case 46 /* ClassKeyword */: return parseClassDeclaration(); - case 48 /* EnumKeyword */: return parseEnumDeclaration(); - } - } - var nextToken = peekToken(1); - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 67 /* ModuleKeyword */: - if (isIdentifier(nextToken) || nextToken.kind() === 12 /* StringLiteral */) { - return parseModuleDeclaration(); - } - break; - case 51 /* ImportKeyword */: - if (isIdentifier(nextToken)) { - return parseImportDeclaration(); - } - break; - case 46 /* ClassKeyword */: - if (isIdentifier(nextToken)) { - return parseClassDeclaration(); - } - break; - case 48 /* EnumKeyword */: - if (isIdentifier(nextToken)) { - return parseEnumDeclaration(); - } - break; - case 54 /* InterfaceKeyword */: - if (isIdentifier(nextToken)) { - return parseInterfaceDeclaration(); - } - break; - case 49 /* ExportKeyword */: - if (nextToken.kind() === 109 /* EqualsToken */) { - return parseExportAssignment(); - } - break; - } - return tryParseStatementWorker(_currentToken, currentTokenKind, _modifierCount, inErrorRecovery); - } - function parseImportDeclaration() { - return new TypeScript.ImportDeclarationSyntax(parseNodeData, parseModifiers(), eatToken(51 /* ImportKeyword */), eatIdentifierToken(), eatToken(109 /* EqualsToken */), parseModuleReference(), eatExplicitOrAutomaticSemicolon(false)); - } - function parseExportAssignment() { - return new TypeScript.ExportAssignmentSyntax(parseNodeData, eatToken(49 /* ExportKeyword */), eatToken(109 /* EqualsToken */), eatIdentifierToken(), eatExplicitOrAutomaticSemicolon(false)); - } - function parseModuleReference() { - return isExternalModuleReference() ? parseExternalModuleReference() : parseModuleNameModuleReference(); - } - function isExternalModuleReference() { - return currentToken().kind() === 68 /* RequireKeyword */ && peekToken(1).kind() === 74 /* OpenParenToken */; - } - function parseExternalModuleReference() { - return new TypeScript.ExternalModuleReferenceSyntax(parseNodeData, eatToken(68 /* RequireKeyword */), eatToken(74 /* OpenParenToken */), eatToken(12 /* StringLiteral */), eatToken(75 /* CloseParenToken */)); - } - function parseModuleNameModuleReference() { - return new TypeScript.ModuleNameModuleReferenceSyntax(parseNodeData, parseName(false)); - } - function tryParseTypeArgumentList(inExpression) { - var _currentToken = currentToken(); - if (_currentToken.kind() !== 82 /* LessThanToken */) { - return undefined; - } - if (!inExpression) { - var lessThanToken = consumeToken(_currentToken); - var skippedTokens = getArray(); - var typeArguments = parseSeparatedSyntaxList(19 /* TypeArgumentList_Types */, skippedTokens); - lessThanToken = addSkippedTokensAfterToken(lessThanToken, skippedTokens); - return new TypeScript.TypeArgumentListSyntax(parseNodeData, lessThanToken, typeArguments, eatToken(83 /* GreaterThanToken */)); - } - var rewindPoint = getRewindPoint(); - var lessThanToken = consumeToken(_currentToken); - var skippedTokens = getArray(); - var typeArguments = parseSeparatedSyntaxList(19 /* TypeArgumentList_Types */, skippedTokens); - var lessThanToken = addSkippedTokensAfterToken(lessThanToken, skippedTokens); - var greaterThanToken = eatToken(83 /* GreaterThanToken */); - if (greaterThanToken.fullWidth() === 0 || !canFollowTypeArgumentListInExpression(currentToken().kind())) { - rewind(rewindPoint); - releaseRewindPoint(rewindPoint); - return undefined; - } - else { - releaseRewindPoint(rewindPoint); - return new TypeScript.TypeArgumentListSyntax(parseNodeData, lessThanToken, typeArguments, greaterThanToken); - } - } - function canFollowTypeArgumentListInExpression(kind) { - switch (kind) { - case 74 /* OpenParenToken */: - case 78 /* DotToken */: - case 75 /* CloseParenToken */: - case 77 /* CloseBracketToken */: - case 108 /* ColonToken */: - case 80 /* SemicolonToken */: - case 81 /* CommaToken */: - case 107 /* QuestionToken */: - case 86 /* EqualsEqualsToken */: - case 89 /* EqualsEqualsEqualsToken */: - case 88 /* ExclamationEqualsToken */: - case 90 /* ExclamationEqualsEqualsToken */: - case 105 /* AmpersandAmpersandToken */: - case 106 /* BarBarToken */: - case 102 /* CaretToken */: - case 100 /* AmpersandToken */: - case 101 /* BarToken */: - case 73 /* CloseBraceToken */: - case 8 /* EndOfFileToken */: - return true; - default: - return false; - } - } - function parseName(allowIdentifierName) { - return tryParseName(allowIdentifierName) || eatIdentifierToken(); - } - function eatRightSideOfName(allowIdentifierNames) { - var _currentToken = currentToken(); - if (TypeScript.SyntaxFacts.isAnyKeyword(_currentToken.kind()) && previousTokenHasTrailingNewLine(_currentToken)) { - var token1 = peekToken(1); - if (!TypeScript.existsNewLineBetweenTokens(_currentToken, token1, source.text) && TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token1)) { - return createMissingToken(9 /* IdentifierName */, _currentToken); - } - } - return allowIdentifierNames ? eatIdentifierNameToken() : eatIdentifierToken(); - } - function tryParseName(allowIdentifierNames) { - var token0 = currentToken(); - var shouldContinue = isIdentifier(token0); - if (!shouldContinue) { - return undefined; - } - var current = eatIdentifierToken(); - while (shouldContinue && currentToken().kind() === 78 /* DotToken */) { - var dotToken = consumeToken(currentToken()); - var identifierName = eatRightSideOfName(allowIdentifierNames); - current = new TypeScript.QualifiedNameSyntax(parseNodeData, current, dotToken, identifierName); - shouldContinue = identifierName.fullWidth() > 0; - } - return current; - } - function parseEnumDeclaration() { - var modifiers = parseModifiers(); - var enumKeyword = eatToken(48 /* EnumKeyword */); - var identifier = eatIdentifierToken(); - var openBraceToken = eatToken(72 /* OpenBraceToken */); - var enumElements; - if (openBraceToken.fullWidth() > 0) { - var skippedTokens = getArray(); - enumElements = parseSeparatedSyntaxList(8 /* EnumDeclaration_EnumElements */, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - return new TypeScript.EnumDeclarationSyntax(parseNodeData, modifiers, enumKeyword, identifier, openBraceToken, enumElements || [], eatToken(73 /* CloseBraceToken */)); - } - function isEnumElement(inErrorRecovery) { - var node = currentNode(); - if (node && node.kind() === 209 /* EnumElement */) { - return true; - } - return isPropertyName(currentToken(), inErrorRecovery); - } - function tryParseEnumElementEqualsValueClause() { - return isEqualsValueClause(false) ? parseEqualsValueClause(true) : undefined; - } - function tryParseEnumElement(inErrorRecovery) { - var node = currentNode(); - if (node && node.kind() === 209 /* EnumElement */) { - consumeNode(node); - return node; - } - if (!isPropertyName(currentToken(), inErrorRecovery)) { - return undefined; - } - return new TypeScript.EnumElementSyntax(parseNodeData, eatPropertyName(), tryParseEnumElementEqualsValueClause()); - } - function isModifierKind(kind) { - switch (kind) { - case 49 /* ExportKeyword */: - case 59 /* PublicKeyword */: - case 57 /* PrivateKeyword */: - case 58 /* ProtectedKeyword */: - case 60 /* StaticKeyword */: - case 65 /* DeclareKeyword */: - return true; - } - return false; - } - function isModifier(token, index) { - if (isModifierKind(token.kind())) { - var nextToken = peekToken(index + 1); - var nextTokenKind = nextToken.kind(); - switch (nextTokenKind) { - case 9 /* IdentifierName */: - case 76 /* OpenBracketToken */: - case 11 /* NumericLiteral */: - case 12 /* StringLiteral */: - return true; - default: - return TypeScript.SyntaxFacts.isAnyKeyword(nextTokenKind); - } - } - return false; - } - function modifierCount() { - var modifierCount = 0; - while (isModifier(peekToken(modifierCount), modifierCount)) { - modifierCount++; - } - return modifierCount; - } - function parseModifiers() { - var tokens = getArray(); - while (true) { - var token = currentToken(); - if (isModifier(token, 0)) { - tokens.push(consumeToken(token)); - continue; - } - break; - } - return TypeScript.Syntax.list(tokens); - } - function parseHeritageClauses() { - var heritageClauses; - if (isHeritageClause()) { - heritageClauses = parseSyntaxList(10 /* ClassOrInterfaceDeclaration_HeritageClauses */, undefined); - } - return heritageClauses || []; - } - function tryParseHeritageClauseTypeName() { - return isHeritageClauseTypeName() ? tryParseNameOrGenericType() : undefined; - } - function parseClassDeclaration() { - var modifiers = parseModifiers(); - var classKeyword = eatToken(46 /* ClassKeyword */); - var identifier = eatIdentifierToken(); - var typeParameterList = tryParseTypeParameterList(false); - var heritageClauses = parseHeritageClauses(); - var openBraceToken = eatToken(72 /* OpenBraceToken */); - var classElements; - if (openBraceToken.fullWidth() > 0) { - var skippedTokens = getArray(); - classElements = parseSyntaxList(1 /* ClassDeclaration_ClassElements */, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - ; - return new TypeScript.ClassDeclarationSyntax(parseNodeData, modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements || [], eatToken(73 /* CloseBraceToken */)); - } - function isAccessor(modifierCount, inErrorRecovery) { - var tokenKind = peekToken(modifierCount).kind(); - if (tokenKind !== 66 /* GetKeyword */ && tokenKind !== 70 /* SetKeyword */) { - return false; - } - return isPropertyName(peekToken(modifierCount + 1), inErrorRecovery); - } - function parseAccessor(checkForStrictMode) { - var modifiers = parseModifiers(); - var _currenToken = currentToken(); - var tokenKind = _currenToken.kind(); - if (tokenKind === 66 /* GetKeyword */) { - return parseGetMemberAccessorDeclaration(modifiers, _currenToken, checkForStrictMode); - } - else if (tokenKind === 70 /* SetKeyword */) { - return parseSetMemberAccessorDeclaration(modifiers, _currenToken, checkForStrictMode); - } - else { - throw TypeScript.Errors.invalidOperation(); - } - } - function parseGetMemberAccessorDeclaration(modifiers, getKeyword, checkForStrictMode) { - return new TypeScript.GetAccessorSyntax(parseNodeData, modifiers, consumeToken(getKeyword), eatPropertyName(), parseCallSignature(false), parseBlock(false, checkForStrictMode)); - } - function parseSetMemberAccessorDeclaration(modifiers, setKeyword, checkForStrictMode) { - return new TypeScript.SetAccessorSyntax(parseNodeData, modifiers, consumeToken(setKeyword), eatPropertyName(), parseCallSignature(false), parseBlock(false, checkForStrictMode)); - } - function isClassElement(inErrorRecovery) { - if (TypeScript.SyntaxUtilities.isClassElement(currentNode())) { - return true; - } - var _modifierCount = modifierCount(); - return isConstructorDeclaration(_modifierCount) || isMemberFunctionDeclaration(_modifierCount, inErrorRecovery) || isAccessor(_modifierCount, inErrorRecovery) || isMemberVariableDeclaration(_modifierCount, inErrorRecovery) || isIndexMemberDeclaration(_modifierCount); - } - function tryParseClassElement(inErrorRecovery) { - var node = currentNode(); - if (TypeScript.SyntaxUtilities.isClassElement(node)) { - consumeNode(node); - return node; - } - var _modifierCount = modifierCount(); - if (isConstructorDeclaration(_modifierCount)) { - return parseConstructorDeclaration(); - } - else if (isMemberFunctionDeclaration(_modifierCount, inErrorRecovery)) { - return parseMemberFunctionDeclaration(); - } - else if (isAccessor(_modifierCount, inErrorRecovery)) { - return parseAccessor(false); - } - else if (isMemberVariableDeclaration(_modifierCount, inErrorRecovery)) { - return parseMemberVariableDeclaration(); - } - else if (isIndexMemberDeclaration(_modifierCount)) { - return parseIndexMemberDeclaration(); - } - else { - return undefined; - } - } - function isConstructorDeclaration(modifierCount) { - return peekToken(modifierCount).kind() === 64 /* ConstructorKeyword */; - } - function parseConstructorDeclaration() { - var modifiers = parseModifiers(); - var constructorKeyword = eatToken(64 /* ConstructorKeyword */); - var callSignature = parseCallSignature(false); - var semicolonToken = undefined; - var block = undefined; - if (isBlock()) { - block = parseBlock(false, true); - } - else { - semicolonToken = eatExplicitOrAutomaticSemicolon(false); - } - return new TypeScript.ConstructorDeclarationSyntax(parseNodeData, modifiers, constructorKeyword, callSignature, block, semicolonToken); - } - function isMemberFunctionDeclaration(modifierCount, inErrorRecovery) { - return isPropertyName(peekToken(modifierCount), inErrorRecovery) && isCallSignature(modifierCount + 1); - } - function parseMemberFunctionDeclaration() { - var modifiers = parseModifiers(); - var propertyName = eatPropertyName(); - var callSignature = parseCallSignature(false); - var parseBlockEvenWithNoOpenBrace = tryAddUnexpectedEqualsGreaterThanToken(callSignature); - var block = undefined; - var semicolon = undefined; - if (parseBlockEvenWithNoOpenBrace || isBlock()) { - block = parseBlock(parseBlockEvenWithNoOpenBrace, true); - } - else { - semicolon = eatExplicitOrAutomaticSemicolon(false); - } - return new TypeScript.MemberFunctionDeclarationSyntax(parseNodeData, modifiers, propertyName, callSignature, block, semicolon); - } - function isDefinitelyMemberVariablePropertyName(index) { - if (TypeScript.SyntaxFacts.isAnyKeyword(peekToken(index).kind())) { - var nextToken = peekToken(index + 1); - switch (nextToken.kind()) { - case 80 /* SemicolonToken */: - case 109 /* EqualsToken */: - case 108 /* ColonToken */: - case 73 /* CloseBraceToken */: - case 8 /* EndOfFileToken */: - return true; - default: - return previousTokenHasTrailingNewLine(nextToken); - } - } - else { - return true; - } - } - function isMemberVariableDeclaration(modifierCount, inErrorRecover) { - return isPropertyName(peekToken(modifierCount), inErrorRecover) && isDefinitelyMemberVariablePropertyName(modifierCount); - } - function parseMemberVariableDeclaration() { - return new TypeScript.MemberVariableDeclarationSyntax(parseNodeData, parseModifiers(), tryParseVariableDeclarator(true, true), eatExplicitOrAutomaticSemicolon(false)); - } - function isIndexMemberDeclaration(modifierCount) { - return isIndexSignature(modifierCount); - } - function parseIndexMemberDeclaration() { - return new TypeScript.IndexMemberDeclarationSyntax(parseNodeData, parseModifiers(), parseIndexSignature(), eatExplicitOrAutomaticSemicolon(false)); - } - function tryAddUnexpectedEqualsGreaterThanToken(callSignature) { - var token0 = currentToken(); - var hasEqualsGreaterThanToken = token0.kind() === 87 /* EqualsGreaterThanToken */; - if (hasEqualsGreaterThanToken) { - var _lastToken = TypeScript.lastToken(callSignature); - if (_lastToken && _lastToken.fullWidth() > 0) { - var diagnostic = new TypeScript.Diagnostic(fileName, source.text.lineMap(), TypeScript.start(token0, source.text), TypeScript.width(token0), TypeScript.DiagnosticCode.Unexpected_token_0_expected, [TypeScript.SyntaxFacts.getText(72 /* OpenBraceToken */)]); - addDiagnostic(diagnostic); - consumeToken(token0); - addSkippedTokenAfterNode(callSignature, token0); - return true; - } - } - return false; - } - function isFunctionDeclaration(modifierCount) { - return peekToken(modifierCount).kind() === 29 /* FunctionKeyword */; - } - function parseFunctionDeclaration() { - var modifiers = parseModifiers(); - var functionKeyword = eatToken(29 /* FunctionKeyword */); - var identifier = eatIdentifierToken(); - var callSignature = parseCallSignature(false); - var parseBlockEvenWithNoOpenBrace = tryAddUnexpectedEqualsGreaterThanToken(callSignature); - var semicolonToken = undefined; - var block = undefined; - if (parseBlockEvenWithNoOpenBrace || isBlock()) { - block = parseBlock(parseBlockEvenWithNoOpenBrace, true); - } - else { - semicolonToken = eatExplicitOrAutomaticSemicolon(false); - } - return new TypeScript.FunctionDeclarationSyntax(parseNodeData, modifiers, functionKeyword, identifier, callSignature, block, semicolonToken); - } - function parseModuleDeclaration() { - var modifiers = parseModifiers(); - var moduleKeyword = eatToken(67 /* ModuleKeyword */); - var moduleName = undefined; - var stringLiteral = undefined; - if (currentToken().kind() === 12 /* StringLiteral */) { - stringLiteral = eatToken(12 /* StringLiteral */); - } - else { - moduleName = parseName(false); - } - var openBraceToken = eatToken(72 /* OpenBraceToken */); - var moduleElements; - if (openBraceToken.fullWidth() > 0) { - var skippedTokens = getArray(); - moduleElements = parseSyntaxList(2 /* ModuleDeclaration_ModuleElements */, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - return new TypeScript.ModuleDeclarationSyntax(parseNodeData, modifiers, moduleKeyword, moduleName, stringLiteral, openBraceToken, moduleElements || [], eatToken(73 /* CloseBraceToken */)); - } - function parseInterfaceDeclaration() { - return new TypeScript.InterfaceDeclarationSyntax(parseNodeData, parseModifiers(), eatToken(54 /* InterfaceKeyword */), eatIdentifierToken(), tryParseTypeParameterList(false), parseHeritageClauses(), parseObjectType()); - } - function parseObjectType() { - var openBraceToken = eatToken(72 /* OpenBraceToken */); - var typeMembers; - if (openBraceToken.fullWidth() > 0) { - var skippedTokens = getArray(); - typeMembers = parseSeparatedSyntaxList(9 /* ObjectType_TypeMembers */, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - return new TypeScript.ObjectTypeSyntax(parseNodeData, openBraceToken, typeMembers || [], eatToken(73 /* CloseBraceToken */)); - } - function parseTupleType(currentToken) { - var openBracket = consumeToken(currentToken); - var types; - if (openBracket.fullWidth() > 0) { - var skippedTokens = getArray(); - types = parseSeparatedSyntaxList(21 /* TupleType_Types */, skippedTokens); - openBracket = addSkippedTokensAfterToken(openBracket, skippedTokens); - } - return new TypeScript.TupleTypeSyntax(parseNodeData, openBracket, types || [], eatToken(77 /* CloseBracketToken */)); - } - function isTypeMember(inErrorRecovery) { - if (TypeScript.SyntaxUtilities.isTypeMember(currentNode())) { - return true; - } - return isCallSignature(0) || isConstructSignature() || isIndexSignature(0) || isMethodSignature(inErrorRecovery) || isPropertySignature(inErrorRecovery); - } - function tryParseTypeMember(inErrorRecovery) { - var node = currentNode(); - if (TypeScript.SyntaxUtilities.isTypeMember(node)) { - consumeNode(node); - return node; - } - if (isCallSignature(0)) { - return parseCallSignature(false); - } - else if (isConstructSignature()) { - return parseConstructSignature(); - } - else if (isIndexSignature(0)) { - return parseIndexSignature(); - } - else if (isMethodSignature(inErrorRecovery)) { - return parseMethodSignature(); - } - else if (isPropertySignature(inErrorRecovery)) { - return parsePropertySignature(); - } - else { - return undefined; - } - } - function parseConstructSignature() { - return new TypeScript.ConstructSignatureSyntax(parseNodeData, eatToken(33 /* NewKeyword */), parseCallSignature(false)); - } - function parseIndexSignature() { - var openBracketToken = eatToken(76 /* OpenBracketToken */); - var skippedTokens = getArray(); - var parameters = parseSeparatedSyntaxList(18 /* IndexSignature_Parameters */, skippedTokens); - openBracketToken = addSkippedTokensAfterToken(openBracketToken, skippedTokens); - return new TypeScript.IndexSignatureSyntax(parseNodeData, openBracketToken, parameters, eatToken(77 /* CloseBracketToken */), parseOptionalTypeAnnotation(false)); - } - function parseMethodSignature() { - return new TypeScript.MethodSignatureSyntax(parseNodeData, eatPropertyName(), tryEatToken(107 /* QuestionToken */), parseCallSignature(false)); - } - function parsePropertySignature() { - return new TypeScript.PropertySignatureSyntax(parseNodeData, eatPropertyName(), tryEatToken(107 /* QuestionToken */), parseOptionalTypeAnnotation(false)); - } - function isCallSignature(peekIndex) { - var tokenKind = peekToken(peekIndex).kind(); - return tokenKind === 74 /* OpenParenToken */ || tokenKind === 82 /* LessThanToken */; - } - function isConstructSignature() { - if (currentToken().kind() !== 33 /* NewKeyword */) { - return false; - } - return isCallSignature(1); - } - function isIndexSignature(peekIndex) { - return peekToken(peekIndex).kind() === 76 /* OpenBracketToken */; - } - function isMethodSignature(inErrorRecovery) { - if (isPropertyName(currentToken(), inErrorRecovery)) { - if (isCallSignature(1)) { - return true; - } - if (peekToken(1).kind() === 107 /* QuestionToken */ && isCallSignature(2)) { - return true; - } - } - return false; - } - function isPropertySignature(inErrorRecovery) { - var _currentToken = currentToken(); - if (isModifier(_currentToken, 0)) { - if (!TypeScript.existsNewLineBetweenTokens(_currentToken, peekToken(1), source.text) && isPropertyName(peekToken(1), inErrorRecovery)) { - return false; - } - } - return isPropertyName(_currentToken, inErrorRecovery); - } - function isHeritageClause() { - var tokenKind = currentToken().kind(); - return tokenKind === 50 /* ExtendsKeyword */ || tokenKind === 53 /* ImplementsKeyword */; - } - function isNotHeritageClauseTypeName() { - var tokenKind = currentToken().kind(); - if (tokenKind === 53 /* ImplementsKeyword */ || tokenKind === 50 /* ExtendsKeyword */) { - return isIdentifier(peekToken(1)); - } - return false; - } - function isHeritageClauseTypeName() { - if (isIdentifier(currentToken())) { - return !isNotHeritageClauseTypeName(); - } - return false; - } - function tryParseHeritageClause() { - var extendsOrImplementsKeyword = currentToken(); - var tokenKind = extendsOrImplementsKeyword.kind(); - if (tokenKind !== 50 /* ExtendsKeyword */ && tokenKind !== 53 /* ImplementsKeyword */) { - return undefined; - } - consumeToken(extendsOrImplementsKeyword); - var skippedTokens = getArray(); - var typeNames = parseSeparatedSyntaxList(11 /* HeritageClause_TypeNameList */, skippedTokens); - extendsOrImplementsKeyword = addSkippedTokensAfterToken(extendsOrImplementsKeyword, skippedTokens); - return new TypeScript.HeritageClauseSyntax(parseNodeData, extendsOrImplementsKeyword, typeNames); - } - function isInterfaceEnumClassModuleImportOrExport(modifierCount, _currentToken) { - if (modifierCount) { - switch (peekToken(modifierCount).kind()) { - case 51 /* ImportKeyword */: - case 67 /* ModuleKeyword */: - case 54 /* InterfaceKeyword */: - case 46 /* ClassKeyword */: - case 48 /* EnumKeyword */: - return true; - } - } - _currentToken = _currentToken || currentToken(); - var nextToken = peekToken(1); - switch (_currentToken.kind()) { - case 67 /* ModuleKeyword */: - return isIdentifier(nextToken) || nextToken.kind() === 12 /* StringLiteral */; - case 51 /* ImportKeyword */: - case 46 /* ClassKeyword */: - case 48 /* EnumKeyword */: - case 54 /* InterfaceKeyword */: - return isIdentifier(nextToken); - case 49 /* ExportKeyword */: - return nextToken.kind() === 109 /* EqualsToken */; - } - return false; - } - function isStatement(modifierCount, inErrorRecovery) { - if (TypeScript.SyntaxUtilities.isStatement(currentNode())) { - return true; - } - var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 59 /* PublicKeyword */: - case 57 /* PrivateKeyword */: - case 58 /* ProtectedKeyword */: - case 60 /* StaticKeyword */: - var token1 = peekToken(1); - if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token1)) { - return false; - } - break; - case 30 /* IfKeyword */: - case 72 /* OpenBraceToken */: - case 35 /* ReturnKeyword */: - case 36 /* SwitchKeyword */: - case 38 /* ThrowKeyword */: - case 17 /* BreakKeyword */: - case 20 /* ContinueKeyword */: - case 28 /* ForKeyword */: - case 44 /* WhileKeyword */: - case 45 /* WithKeyword */: - case 24 /* DoKeyword */: - case 40 /* TryKeyword */: - case 21 /* DebuggerKeyword */: - return true; - } - if (isInterfaceEnumClassModuleImportOrExport(modifierCount, _currentToken)) { - return false; - } - return isLabeledStatement(_currentToken) || isVariableStatement(modifierCount) || isFunctionDeclaration(modifierCount) || isEmptyStatement(_currentToken, inErrorRecovery) || isExpressionStatement(_currentToken); - } - function parseStatement(inErrorRecovery) { - return tryParseStatement(inErrorRecovery) || parseExpressionStatement(); - } - function tryParseStatement(inErrorRecovery) { - var node = currentNode(); - if (TypeScript.SyntaxUtilities.isStatement(node)) { - consumeNode(node); - return node; - } - var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); - return tryParseStatementWorker(_currentToken, currentTokenKind, modifierCount(), inErrorRecovery); - } - function tryParseStatementWorker(_currentToken, currentTokenKind, modifierCount, inErrorRecovery) { - switch (currentTokenKind) { - case 59 /* PublicKeyword */: - case 57 /* PrivateKeyword */: - case 58 /* ProtectedKeyword */: - case 60 /* StaticKeyword */: - if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(peekToken(1))) { - return undefined; - } - else { - break; - } - case 30 /* IfKeyword */: return parseIfStatement(_currentToken); - case 72 /* OpenBraceToken */: return parseBlock(false, false); - case 35 /* ReturnKeyword */: return parseReturnStatement(_currentToken); - case 36 /* SwitchKeyword */: return parseSwitchStatement(_currentToken); - case 38 /* ThrowKeyword */: return parseThrowStatement(_currentToken); - case 17 /* BreakKeyword */: return parseBreakStatement(_currentToken); - case 20 /* ContinueKeyword */: return parseContinueStatement(_currentToken); - case 28 /* ForKeyword */: return parseForOrForInStatement(_currentToken); - case 44 /* WhileKeyword */: return parseWhileStatement(_currentToken); - case 45 /* WithKeyword */: return parseWithStatement(_currentToken); - case 24 /* DoKeyword */: return parseDoStatement(_currentToken); - case 40 /* TryKeyword */: return parseTryStatement(_currentToken); - case 21 /* DebuggerKeyword */: return parseDebuggerStatement(_currentToken); - } - if (isInterfaceEnumClassModuleImportOrExport(modifierCount, _currentToken)) { - return undefined; - } - else if (isVariableStatement(modifierCount)) { - return parseVariableStatement(); - } - else if (isLabeledStatement(_currentToken)) { - return parseLabeledStatement(_currentToken); - } - else if (isFunctionDeclaration(modifierCount)) { - return parseFunctionDeclaration(); - } - else if (isEmptyStatement(_currentToken, inErrorRecovery)) { - return parseEmptyStatement(_currentToken); - } - else if (isExpressionStatement(_currentToken)) { - return parseExpressionStatement(); - } - else { - return undefined; - } - } - function parseDebuggerStatement(debuggerKeyword) { - return new TypeScript.DebuggerStatementSyntax(parseNodeData, consumeToken(debuggerKeyword), eatExplicitOrAutomaticSemicolon(false)); - } - function parseDoStatement(doKeyword) { - return new TypeScript.DoStatementSyntax(parseNodeData, consumeToken(doKeyword), parseStatement(false), eatToken(44 /* WhileKeyword */), eatToken(74 /* OpenParenToken */), parseExpression(true), eatToken(75 /* CloseParenToken */), eatExplicitOrAutomaticSemicolon(true)); - } - function isLabeledStatement(currentToken) { - return isIdentifier(currentToken) && peekToken(1).kind() === 108 /* ColonToken */; - } - function parseLabeledStatement(identifierToken) { - return new TypeScript.LabeledStatementSyntax(parseNodeData, consumeToken(identifierToken), eatToken(108 /* ColonToken */), parseStatement(false)); - } - function parseTryStatement(tryKeyword) { - var tryKeyword = consumeToken(tryKeyword); - var savedListParsingState = listParsingState; - listParsingState |= (1 << 6 /* TryBlock_Statements */); - var block = parseBlock(false, false); - listParsingState = savedListParsingState; - var catchClause = undefined; - if (currentToken().kind() === 19 /* CatchKeyword */) { - catchClause = parseCatchClause(); - } - var finallyClause = undefined; - if (!catchClause || currentToken().kind() === 27 /* FinallyKeyword */) { - finallyClause = parseFinallyClause(); - } - return new TypeScript.TryStatementSyntax(parseNodeData, tryKeyword, block, catchClause, finallyClause); - } - function parseCatchClauseBlock() { - var savedListParsingState = listParsingState; - listParsingState |= (1 << 7 /* CatchBlock_Statements */); - var block = parseBlock(false, false); - listParsingState = savedListParsingState; - return block; - } - function parseCatchClause() { - return new TypeScript.CatchClauseSyntax(parseNodeData, eatToken(19 /* CatchKeyword */), eatToken(74 /* OpenParenToken */), eatIdentifierToken(), parseOptionalTypeAnnotation(false), eatToken(75 /* CloseParenToken */), parseCatchClauseBlock()); - } - function parseFinallyClause() { - return new TypeScript.FinallyClauseSyntax(parseNodeData, eatToken(27 /* FinallyKeyword */), parseBlock(false, false)); - } - function parseWithStatement(withKeyword) { - return new TypeScript.WithStatementSyntax(parseNodeData, consumeToken(withKeyword), eatToken(74 /* OpenParenToken */), parseExpression(true), eatToken(75 /* CloseParenToken */), parseStatement(false)); - } - function parseWhileStatement(whileKeyword) { - return new TypeScript.WhileStatementSyntax(parseNodeData, consumeToken(whileKeyword), eatToken(74 /* OpenParenToken */), parseExpression(true), eatToken(75 /* CloseParenToken */), parseStatement(false)); - } - function isEmptyStatement(currentToken, inErrorRecovery) { - if (inErrorRecovery) { - return false; - } - return currentToken.kind() === 80 /* SemicolonToken */; - } - function parseEmptyStatement(semicolonToken) { - return new TypeScript.EmptyStatementSyntax(parseNodeData, consumeToken(semicolonToken)); - } - function parseForOrForInStatement(forKeyword) { - consumeToken(forKeyword); - var openParenToken = eatToken(74 /* OpenParenToken */); - var _currentToken = currentToken(); - var tokenKind = _currentToken.kind(); - if (tokenKind === 42 /* VarKeyword */) { - return parseForOrForInStatementWithVariableDeclaration(forKeyword, openParenToken); - } - else if (tokenKind === 80 /* SemicolonToken */) { - return parseForStatementWithNoVariableDeclarationOrInitializer(forKeyword, openParenToken); - } - else { - return parseForOrForInStatementWithInitializer(forKeyword, openParenToken); - } - } - function parseForOrForInStatementWithVariableDeclaration(forKeyword, openParenToken) { - var variableDeclaration = parseVariableDeclaration(false); - return currentToken().kind() === 31 /* InKeyword */ ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, undefined) : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, undefined); - } - function parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, initializer) { - return new TypeScript.ForInStatementSyntax(parseNodeData, forKeyword, openParenToken, variableDeclaration, initializer, eatToken(31 /* InKeyword */), parseExpression(true), eatToken(75 /* CloseParenToken */), parseStatement(false)); - } - function parseForOrForInStatementWithInitializer(forKeyword, openParenToken) { - var initializer = parseExpression(false); - return currentToken().kind() === 31 /* InKeyword */ ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, undefined, initializer) : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, undefined, initializer); - } - function parseForStatementWithNoVariableDeclarationOrInitializer(forKeyword, openParenToken) { - return parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, undefined, undefined); - } - function tryParseForStatementCondition() { - var tokenKind = currentToken().kind(); - if (tokenKind !== 80 /* SemicolonToken */ && tokenKind !== 75 /* CloseParenToken */ && tokenKind !== 8 /* EndOfFileToken */) { - return parseExpression(true); - } - return undefined; - } - function tryParseForStatementIncrementor() { - var tokenKind = currentToken().kind(); - if (tokenKind !== 75 /* CloseParenToken */ && tokenKind !== 8 /* EndOfFileToken */) { - return parseExpression(true); - } - return undefined; - } - function parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, initializer) { - return new TypeScript.ForStatementSyntax(parseNodeData, forKeyword, openParenToken, variableDeclaration, initializer, eatToken(80 /* SemicolonToken */), tryParseForStatementCondition(), eatToken(80 /* SemicolonToken */), tryParseForStatementIncrementor(), eatToken(75 /* CloseParenToken */), parseStatement(false)); - } - function tryEatBreakOrContinueLabel() { - var identifier = undefined; - if (!canEatExplicitOrAutomaticSemicolon(false)) { - if (isIdentifier(currentToken())) { - return eatIdentifierToken(); - } - } - return undefined; - } - function parseBreakStatement(breakKeyword) { - return new TypeScript.BreakStatementSyntax(parseNodeData, consumeToken(breakKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(false)); - } - function parseContinueStatement(continueKeyword) { - return new TypeScript.ContinueStatementSyntax(parseNodeData, consumeToken(continueKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(false)); - } - function parseSwitchStatement(switchKeyword) { - consumeToken(switchKeyword); - var openParenToken = eatToken(74 /* OpenParenToken */); - var expression = parseExpression(true); - var closeParenToken = eatToken(75 /* CloseParenToken */); - var openBraceToken = eatToken(72 /* OpenBraceToken */); - var switchClauses; - if (openBraceToken.fullWidth() > 0) { - var skippedTokens = getArray(); - switchClauses = parseSyntaxList(3 /* SwitchStatement_SwitchClauses */, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - return new TypeScript.SwitchStatementSyntax(parseNodeData, switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses || [], eatToken(73 /* CloseBraceToken */)); - } - function isSwitchClause() { - if (TypeScript.SyntaxUtilities.isSwitchClause(currentNode())) { - return true; - } - var currentTokenKind = currentToken().kind(); - return currentTokenKind === 18 /* CaseKeyword */ || currentTokenKind === 22 /* DefaultKeyword */; - } - function tryParseSwitchClause() { - var node = currentNode(); - if (TypeScript.SyntaxUtilities.isSwitchClause(node)) { - consumeNode(node); - return node; - } - var _currentToken = currentToken(); - var kind = _currentToken.kind(); - if (kind === 18 /* CaseKeyword */) { - return parseCaseSwitchClause(_currentToken); - } - else if (kind === 22 /* DefaultKeyword */) { - return parseDefaultSwitchClause(_currentToken); - } - else { - return undefined; - } - } - function parseCaseSwitchClause(caseKeyword) { - consumeToken(caseKeyword); - var expression = parseExpression(true); - var colonToken = eatToken(108 /* ColonToken */); - var statements; - if (colonToken.fullWidth() > 0) { - var skippedTokens = getArray(); - statements = parseSyntaxList(4 /* SwitchClause_Statements */, skippedTokens); - colonToken = addSkippedTokensAfterToken(colonToken, skippedTokens); - } - return new TypeScript.CaseSwitchClauseSyntax(parseNodeData, caseKeyword, expression, colonToken, statements || []); - } - function parseDefaultSwitchClause(defaultKeyword) { - consumeToken(defaultKeyword); - var colonToken = eatToken(108 /* ColonToken */); - var statements; - if (colonToken.fullWidth() > 0) { - var skippedTokens = getArray(); - statements = parseSyntaxList(4 /* SwitchClause_Statements */, skippedTokens); - colonToken = addSkippedTokensAfterToken(colonToken, skippedTokens); - } - return new TypeScript.DefaultSwitchClauseSyntax(parseNodeData, defaultKeyword, colonToken, statements || []); - } - function parseThrowStatementExpression() { - return canEatExplicitOrAutomaticSemicolon(false) ? createMissingToken(9 /* IdentifierName */, undefined) : parseExpression(true); - } - function parseThrowStatement(throwKeyword) { - return new TypeScript.ThrowStatementSyntax(parseNodeData, consumeToken(throwKeyword), parseThrowStatementExpression(), eatExplicitOrAutomaticSemicolon(false)); - } - function tryParseReturnStatementExpression() { - return !canEatExplicitOrAutomaticSemicolon(false) ? parseExpression(true) : undefined; - } - function parseReturnStatement(returnKeyword) { - return new TypeScript.ReturnStatementSyntax(parseNodeData, consumeToken(returnKeyword), tryParseReturnStatementExpression(), eatExplicitOrAutomaticSemicolon(false)); - } - function isExpressionStatement(currentToken) { - var tokenKind = currentToken.kind(); - return tokenKind !== 72 /* OpenBraceToken */ && tokenKind !== 29 /* FunctionKeyword */ && isExpression(currentToken); - } - function isAssignmentOrOmittedExpression() { - var _currentToken = currentToken(); - return _currentToken.kind() === 81 /* CommaToken */ || isExpression(_currentToken); - } - function tryParseAssignmentOrOmittedExpression() { - if (currentToken().kind() === 81 /* CommaToken */) { - return new TypeScript.OmittedExpressionSyntax(parseNodeData); - } - return tryParseAssignmentExpressionOrHigher(false, true); - } - function isExpression(currentToken) { - switch (currentToken.kind()) { - case 11 /* NumericLiteral */: - case 12 /* StringLiteral */: - case 10 /* RegularExpressionLiteral */: - case 13 /* NoSubstitutionTemplateToken */: - case 14 /* TemplateStartToken */: - case 76 /* OpenBracketToken */: - case 74 /* OpenParenToken */: - case 82 /* LessThanToken */: - case 95 /* PlusPlusToken */: - case 96 /* MinusMinusToken */: - case 91 /* PlusToken */: - case 92 /* MinusToken */: - case 104 /* TildeToken */: - case 103 /* ExclamationToken */: - case 72 /* OpenBraceToken */: - case 87 /* EqualsGreaterThanToken */: - case 120 /* SlashToken */: - case 121 /* SlashEqualsToken */: - case 52 /* SuperKeyword */: - case 37 /* ThisKeyword */: - case 39 /* TrueKeyword */: - case 26 /* FalseKeyword */: - case 34 /* NullKeyword */: - case 33 /* NewKeyword */: - case 23 /* DeleteKeyword */: - case 43 /* VoidKeyword */: - case 41 /* TypeOfKeyword */: - case 29 /* FunctionKeyword */: - return true; - } - return isIdentifier(currentToken); - } - function parseExpressionStatement() { - return new TypeScript.ExpressionStatementSyntax(parseNodeData, parseExpression(true), eatExplicitOrAutomaticSemicolon(false)); - } - function parseIfStatement(ifKeyword) { - return new TypeScript.IfStatementSyntax(parseNodeData, consumeToken(ifKeyword), eatToken(74 /* OpenParenToken */), parseExpression(true), eatToken(75 /* CloseParenToken */), parseStatement(false), parseOptionalElseClause()); - } - function parseOptionalElseClause() { - return currentToken().kind() === 25 /* ElseKeyword */ ? parseElseClause() : undefined; - } - function parseElseClause() { - return new TypeScript.ElseClauseSyntax(parseNodeData, eatToken(25 /* ElseKeyword */), parseStatement(false)); - } - function isVariableStatement(modifierCount) { - return peekToken(modifierCount).kind() === 42 /* VarKeyword */; - } - function parseVariableStatement() { - return new TypeScript.VariableStatementSyntax(parseNodeData, parseModifiers(), parseVariableDeclaration(true), eatExplicitOrAutomaticSemicolon(false)); - } - function parseVariableDeclaration(allowIn) { - var varKeyword = eatToken(42 /* VarKeyword */); - var listParsingState = allowIn ? 12 /* VariableDeclaration_VariableDeclarators_AllowIn */ : 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */; - var skippedTokens = getArray(); - var variableDeclarators = parseSeparatedSyntaxList(listParsingState, skippedTokens); - varKeyword = addSkippedTokensAfterToken(varKeyword, skippedTokens); - return new TypeScript.VariableDeclarationSyntax(parseNodeData, varKeyword, variableDeclarators); - } - function isVariableDeclarator() { - var node = currentNode(); - if (node && node.kind() === 191 /* VariableDeclarator */) { - return true; - } - return isIdentifier(currentToken()); - } - function canReuseVariableDeclaratorNode(node) { - if (!node || node.kind() !== 191 /* VariableDeclarator */) { - return false; - } - var variableDeclarator = node; - return variableDeclarator.equalsValueClause === undefined; - } - function tryParseVariableDeclarator(allowIn, allowPropertyName) { - var node = currentNode(); - if (canReuseVariableDeclaratorNode(node)) { - consumeNode(node); - return node; - } - if (allowPropertyName) { - } - if (!allowPropertyName && !isIdentifier(currentToken())) { - return undefined; - } - var propertyName = allowPropertyName ? eatPropertyName() : eatIdentifierToken(); - var equalsValueClause = undefined; - var typeAnnotation = undefined; - if (propertyName.fullWidth() > 0) { - typeAnnotation = parseOptionalTypeAnnotation(false); - if (isEqualsValueClause(false)) { - equalsValueClause = parseEqualsValueClause(allowIn); - } - } - return new TypeScript.VariableDeclaratorSyntax(parseNodeData, propertyName, typeAnnotation, equalsValueClause); - } - function isEqualsValueClause(inParameter) { - var token0 = currentToken(); - if (token0.kind() === 109 /* EqualsToken */) { - return true; - } - if (!previousTokenHasTrailingNewLine(token0)) { - var tokenKind = token0.kind(); - if (tokenKind === 87 /* EqualsGreaterThanToken */) { - return false; - } - if (tokenKind === 72 /* OpenBraceToken */ && inParameter) { - return false; - } - return isExpression(token0); - } - return false; - } - function parseEqualsValueClause(allowIn) { - return new TypeScript.EqualsValueClauseSyntax(parseNodeData, eatToken(109 /* EqualsToken */), tryParseAssignmentExpressionOrHigher(true, allowIn)); - } - function parseExpression(allowIn) { - var leftOperand = tryParseAssignmentExpressionOrHigher(true, allowIn); - while (true) { - var _currentToken = currentToken(); - if (_currentToken.kind() !== 81 /* CommaToken */) { - break; - } - leftOperand = new TypeScript.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(_currentToken), tryParseAssignmentExpressionOrHigher(true, allowIn)); - } - return leftOperand; - } - function tryParseAssignmentExpressionOrHigher(force, allowIn) { - var _currentToken = currentToken(); - var arrowFunction = tryParseAnyArrowFunctionExpression(_currentToken); - if (arrowFunction) { - return arrowFunction; - } - var leftOperand = tryParseBinaryExpressionOrHigher(_currentToken, force, 1 /* Lowest */, allowIn); - if (leftOperand === undefined) { - return undefined; - } - if (TypeScript.SyntaxUtilities.isLeftHandSizeExpression(leftOperand)) { - var operatorToken = currentOperatorToken(); - if (TypeScript.SyntaxFacts.isAssignmentOperatorToken(operatorToken.kind())) { - return new TypeScript.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), tryParseAssignmentExpressionOrHigher(true, allowIn)); - } - } - return parseConditionalExpressionRest(allowIn, leftOperand); - } - function tryParseAnyArrowFunctionExpression(_currentToken) { - return isSimpleArrowFunctionExpression(_currentToken) ? parseSimpleArrowFunctionExpression() : tryParseParenthesizedArrowFunctionExpression(); - } - function tryParseUnaryExpressionOrHigher(_currentToken, force) { - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 91 /* PlusToken */: - case 92 /* MinusToken */: - case 104 /* TildeToken */: - case 103 /* ExclamationToken */: - case 95 /* PlusPlusToken */: - case 96 /* MinusMinusToken */: - return new TypeScript.PrefixUnaryExpressionSyntax(parseNodeData, consumeToken(_currentToken), tryParseUnaryExpressionOrHigher(currentToken(), true)); - case 41 /* TypeOfKeyword */: return parseTypeOfExpression(_currentToken); - case 43 /* VoidKeyword */: return parseVoidExpression(_currentToken); - case 23 /* DeleteKeyword */: return parseDeleteExpression(_currentToken); - case 82 /* LessThanToken */: return parseCastExpression(_currentToken); - default: - return tryParsePostfixExpressionOrHigher(_currentToken, force); - } - } - function tryParseBinaryExpressionOrHigher(_currentToken, force, precedence, allowIn) { - var leftOperand = tryParseUnaryExpressionOrHigher(_currentToken, force); - if (leftOperand === undefined) { - return undefined; - } - return parseBinaryExpressionRest(precedence, allowIn, leftOperand); - } - function parseConditionalExpressionRest(allowIn, leftOperand) { - var _currentToken = currentToken(); - if (_currentToken.kind() !== 107 /* QuestionToken */) { - return leftOperand; - } - return new TypeScript.ConditionalExpressionSyntax(parseNodeData, leftOperand, consumeToken(_currentToken), tryParseAssignmentExpressionOrHigher(true, true), eatToken(108 /* ColonToken */), tryParseAssignmentExpressionOrHigher(true, allowIn)); - } - function parseBinaryExpressionRest(precedence, allowIn, leftOperand) { - while (true) { - var operatorToken = currentOperatorToken(); - var tokenKind = operatorToken.kind(); - if (!TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken(tokenKind) || tokenKind === 81 /* CommaToken */ || TypeScript.SyntaxFacts.isAssignmentOperatorToken(tokenKind)) { - break; - } - if (tokenKind === 31 /* InKeyword */ && !allowIn) { - break; - } - var newPrecedence = getBinaryExpressionPrecedence(tokenKind); - if (newPrecedence <= precedence) { - break; - } - leftOperand = new TypeScript.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), tryParseBinaryExpressionOrHigher(currentToken(), true, newPrecedence, allowIn)); - } - return leftOperand; - } - function currentOperatorToken() { - var token0 = currentToken(); - if (token0.kind() === 83 /* GreaterThanToken */) { - return currentContextualToken(); - } - return token0; - } - function tryParseMemberExpressionOrHigher(_currentToken, force, inObjectCreation) { - var expression = tryParsePrimaryExpression(_currentToken, force); - if (expression === undefined) { - return undefined; - } - return parseMemberExpressionRest(expression, inObjectCreation); - } - function parseCallExpressionRest(expression) { - while (true) { - var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 74 /* OpenParenToken */: - expression = new TypeScript.InvocationExpressionSyntax(parseNodeData, expression, parseArgumentList(undefined)); - continue; - case 82 /* LessThanToken */: - var argumentList = tryParseArgumentList(); - if (argumentList === undefined) { - break; - } - expression = new TypeScript.InvocationExpressionSyntax(parseNodeData, expression, argumentList); - continue; - case 76 /* OpenBracketToken */: - expression = parseElementAccessExpression(expression, _currentToken, false); - continue; - case 78 /* DotToken */: - expression = new TypeScript.MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); - continue; - case 13 /* NoSubstitutionTemplateToken */: - case 14 /* TemplateStartToken */: - expression = new TypeScript.TemplateAccessExpressionSyntax(parseNodeData, expression, parseTemplateExpression(_currentToken)); - continue; - } - return expression; - } - } - function parseMemberExpressionRest(expression, inObjectCreation) { - while (true) { - var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 76 /* OpenBracketToken */: - expression = parseElementAccessExpression(expression, _currentToken, inObjectCreation); - continue; - case 78 /* DotToken */: - expression = new TypeScript.MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); - continue; - case 13 /* NoSubstitutionTemplateToken */: - case 14 /* TemplateStartToken */: - expression = new TypeScript.TemplateAccessExpressionSyntax(parseNodeData, expression, parseTemplateExpression(_currentToken)); - continue; - } - return expression; - } - } - function tryParseLeftHandSideExpressionOrHigher(_currentToken, force) { - var expression = undefined; - if (_currentToken.kind() === 52 /* SuperKeyword */) { - expression = parseSuperExpression(_currentToken); - } - else { - expression = tryParseMemberExpressionOrHigher(_currentToken, force, false); - if (expression === undefined) { - return undefined; - } - } - return parseCallExpressionRest(expression); - } - function parseSuperExpression(superToken) { - var expression = consumeToken(superToken); - var currentTokenKind = currentToken().kind(); - return currentTokenKind === 74 /* OpenParenToken */ || currentTokenKind === 78 /* DotToken */ ? expression : new TypeScript.MemberAccessExpressionSyntax(parseNodeData, expression, eatToken(78 /* DotToken */), eatIdentifierNameToken()); - } - function tryParsePostfixExpressionOrHigher(_currentToken, force) { - var expression = tryParseLeftHandSideExpressionOrHigher(_currentToken, force); - if (expression === undefined) { - return undefined; - } - var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 95 /* PlusPlusToken */: - case 96 /* MinusMinusToken */: - if (previousTokenHasTrailingNewLine(_currentToken)) { - break; - } - return new TypeScript.PostfixUnaryExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken)); - } - return expression; - } - function tryParseGenericArgumentList() { - var rewindPoint = getRewindPoint(); - var typeArgumentList = tryParseTypeArgumentList(true); - var token0 = currentToken(); - var tokenKind = token0.kind(); - var isOpenParen = tokenKind === 74 /* OpenParenToken */; - var isDot = tokenKind === 78 /* DotToken */; - var isOpenParenOrDot = isOpenParen || isDot; - var argumentList = undefined; - if (!typeArgumentList || !isOpenParenOrDot) { - rewind(rewindPoint); - releaseRewindPoint(rewindPoint); - return undefined; - } - else { - releaseRewindPoint(rewindPoint); - if (isDot) { - var diagnostic = new TypeScript.Diagnostic(fileName, source.text.lineMap(), TypeScript.start(token0, source.text), TypeScript.width(token0), TypeScript.DiagnosticCode.A_parameter_list_must_follow_a_generic_type_argument_list_expected, undefined); - addDiagnostic(diagnostic); - return new TypeScript.ArgumentListSyntax(parseNodeData, typeArgumentList, TypeScript.Syntax.emptyToken(74 /* OpenParenToken */), [], TypeScript.Syntax.emptyToken(75 /* CloseParenToken */)); - } - else { - return parseArgumentList(typeArgumentList); - } - } - } - function tryParseArgumentList() { - var tokenKind = currentToken().kind(); - if (tokenKind === 82 /* LessThanToken */) { - return tryParseGenericArgumentList(); - } - if (tokenKind === 74 /* OpenParenToken */) { - return parseArgumentList(undefined); - } - return undefined; - } - function parseArgumentList(typeArgumentList) { - var openParenToken = eatToken(74 /* OpenParenToken */); - var _arguments; - if (openParenToken.fullWidth() > 0) { - var skippedTokens = getArray(); - _arguments = parseSeparatedSyntaxList(14 /* ArgumentList_AssignmentExpressions */, skippedTokens); - openParenToken = addSkippedTokensAfterToken(openParenToken, skippedTokens); - } - return new TypeScript.ArgumentListSyntax(parseNodeData, typeArgumentList, openParenToken, _arguments || [], eatToken(75 /* CloseParenToken */)); - } - function tryParseArgumentListExpression() { - var force = currentToken().kind() === 81 /* CommaToken */; - return tryParseAssignmentExpressionOrHigher(force, true); - } - function parseElementAccessArgumentExpression(openBracketToken, inObjectCreation) { - if (inObjectCreation && currentToken().kind() === 77 /* CloseBracketToken */) { - var errorStart = TypeScript.start(openBracketToken, source.text); - var errorEnd = TypeScript.end(currentToken(), source.text); - var diagnostic = new TypeScript.Diagnostic(fileName, source.text.lineMap(), errorStart, errorEnd - errorStart, TypeScript.DiagnosticCode.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead, undefined); - addDiagnostic(diagnostic); - return TypeScript.Syntax.emptyToken(9 /* IdentifierName */); - } - else { - return parseExpression(true); - } - } - function parseElementAccessExpression(expression, openBracketToken, inObjectCreation) { - return new TypeScript.ElementAccessExpressionSyntax(parseNodeData, expression, consumeToken(openBracketToken), parseElementAccessArgumentExpression(openBracketToken, inObjectCreation), eatToken(77 /* CloseBracketToken */)); - } - function tryParsePrimaryExpression(_currentToken, force) { - if (isIdentifier(_currentToken)) { - return eatIdentifierToken(); - } - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 37 /* ThisKeyword */: - case 39 /* TrueKeyword */: - case 26 /* FalseKeyword */: - case 34 /* NullKeyword */: - case 11 /* NumericLiteral */: - case 10 /* RegularExpressionLiteral */: - case 12 /* StringLiteral */: - return consumeToken(_currentToken); - case 29 /* FunctionKeyword */: return parseFunctionExpression(_currentToken); - case 76 /* OpenBracketToken */: return parseArrayLiteralExpression(_currentToken); - case 72 /* OpenBraceToken */: return parseObjectLiteralExpression(_currentToken); - case 74 /* OpenParenToken */: return parseParenthesizedExpression(_currentToken); - case 33 /* NewKeyword */: return parseObjectCreationExpression(_currentToken); - case 13 /* NoSubstitutionTemplateToken */: - case 14 /* TemplateStartToken */: - return parseTemplateExpression(_currentToken); - case 120 /* SlashToken */: - case 121 /* SlashEqualsToken */: - var result = tryReparseDivideAsRegularExpression(); - return result || eatIdentifierToken(TypeScript.DiagnosticCode.Expression_expected); - } - if (!force) { - return undefined; - } - return eatIdentifierToken(TypeScript.DiagnosticCode.Expression_expected); - } - function tryReparseDivideAsRegularExpression() { - var currentToken = currentContextualToken(); - var tokenKind = currentToken.kind(); - if (tokenKind === 120 /* SlashToken */ || tokenKind === 121 /* SlashEqualsToken */) { - return undefined; - } - else if (tokenKind === 10 /* RegularExpressionLiteral */) { - return consumeToken(currentToken); - } - else { - throw TypeScript.Errors.invalidOperation(); - } - } - function parseTypeOfExpression(typeOfKeyword) { - return new TypeScript.TypeOfExpressionSyntax(parseNodeData, consumeToken(typeOfKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); - } - function parseDeleteExpression(deleteKeyword) { - return new TypeScript.DeleteExpressionSyntax(parseNodeData, consumeToken(deleteKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); - } - function parseVoidExpression(voidKeyword) { - return new TypeScript.VoidExpressionSyntax(parseNodeData, consumeToken(voidKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); - } - function parseFunctionExpression(functionKeyword) { - return new TypeScript.FunctionExpressionSyntax(parseNodeData, consumeToken(functionKeyword), eatOptionalIdentifierToken(), parseCallSignature(false), parseBlock(false, true)); - } - function parseObjectCreationExpression(newKeyword) { - return new TypeScript.ObjectCreationExpressionSyntax(parseNodeData, consumeToken(newKeyword), tryParseMemberExpressionOrHigher(currentToken(), true, true), tryParseArgumentList()); - } - function parseTemplateExpression(startToken) { - consumeToken(startToken); - if (startToken.kind() === 13 /* NoSubstitutionTemplateToken */) { - return startToken; - } - var templateClauses = getArray(); - do { - templateClauses.push(parseTemplateClause()); - } while (templateClauses[templateClauses.length - 1].templateMiddleOrEndToken.kind() === 15 /* TemplateMiddleToken */); - return new TypeScript.TemplateExpressionSyntax(parseNodeData, startToken, TypeScript.Syntax.list(templateClauses)); - } - function parseTemplateClause() { - var expression = parseExpression(true); - var token = currentToken(); - if (token.kind() === 73 /* CloseBraceToken */) { - token = currentContextualToken(); - TypeScript.Debug.assert(token.kind() === 15 /* TemplateMiddleToken */ || token.kind() === 16 /* TemplateEndToken */); - consumeToken(token); - } - else { - var diagnostic = getExpectedTokenDiagnostic(73 /* CloseBraceToken */); - addDiagnostic(diagnostic); - token = TypeScript.Syntax.emptyToken(16 /* TemplateEndToken */); - } - return new TypeScript.TemplateClauseSyntax(parseNodeData, expression, token); - } - function parseCastExpression(lessThanToken) { - return new TypeScript.CastExpressionSyntax(parseNodeData, consumeToken(lessThanToken), parseType(), eatToken(83 /* GreaterThanToken */), tryParseUnaryExpressionOrHigher(currentToken(), true)); - } - function parseParenthesizedExpression(openParenToken) { - return new TypeScript.ParenthesizedExpressionSyntax(parseNodeData, consumeToken(openParenToken), parseExpression(true), eatToken(75 /* CloseParenToken */)); - } - function tryParseParenthesizedArrowFunctionExpression() { - var tokenKind = currentToken().kind(); - if (tokenKind !== 74 /* OpenParenToken */ && tokenKind !== 82 /* LessThanToken */) { - return undefined; - } - if (isDefinitelyArrowFunctionExpression()) { - return tryParseParenthesizedArrowFunctionExpressionWorker(false); - } - if (!isPossiblyArrowFunctionExpression()) { - return undefined; - } - var rewindPoint = getRewindPoint(); - var arrowFunction = tryParseParenthesizedArrowFunctionExpressionWorker(true); - if (arrowFunction === undefined) { - rewind(rewindPoint); - } - releaseRewindPoint(rewindPoint); - return arrowFunction; - } - function tryParseParenthesizedArrowFunctionExpressionWorker(requireArrow) { - var _currentToken = currentToken(); - var callSignature = parseCallSignature(true); - if (requireArrow && currentToken().kind() !== 87 /* EqualsGreaterThanToken */) { - return undefined; - } - var equalsGreaterThanToken = eatToken(87 /* EqualsGreaterThanToken */); - var block = tryParseArrowFunctionBlock(); - var expression = undefined; - if (block === undefined) { - expression = tryParseAssignmentExpressionOrHigher(true, true); - } - return new TypeScript.ParenthesizedArrowFunctionExpressionSyntax(parseNodeData, callSignature, equalsGreaterThanToken, block, expression); - } - function tryParseArrowFunctionBlock() { - if (isBlock()) { - return parseBlock(false, false); - } - else { - var _modifierCount = modifierCount(); - if (isStatement(_modifierCount, false) && !isExpressionStatement(currentToken()) && !isFunctionDeclaration(_modifierCount)) { - return parseBlock(true, false); - } - else { - return undefined; - } - } - } - function isSimpleArrowFunctionExpression(_currentToken) { - if (_currentToken.kind() === 87 /* EqualsGreaterThanToken */) { - return true; - } - return isIdentifier(_currentToken) && peekToken(1).kind() === 87 /* EqualsGreaterThanToken */; - } - function parseSimpleArrowFunctionExpression() { - var parameter = eatSimpleParameter(); - var equalsGreaterThanToken = eatToken(87 /* EqualsGreaterThanToken */); - var block = tryParseArrowFunctionBlock(); - var expression = undefined; - if (block === undefined) { - expression = tryParseAssignmentExpressionOrHigher(true, true); - } - return new TypeScript.SimpleArrowFunctionExpressionSyntax(parseNodeData, parameter, equalsGreaterThanToken, block, expression); - } - function isBlock() { - return currentToken().kind() === 72 /* OpenBraceToken */; - } - function isDefinitelyArrowFunctionExpression() { - var token0 = currentToken(); - if (token0.kind() !== 74 /* OpenParenToken */) { - return false; - } - var token1 = peekToken(1); - var token1Kind = token1.kind(); - var token2; - if (token1Kind === 75 /* CloseParenToken */) { - token2 = peekToken(2); - var token2Kind = token2.kind(); - return token2Kind === 108 /* ColonToken */ || token2Kind === 87 /* EqualsGreaterThanToken */ || token2Kind === 72 /* OpenBraceToken */; - } - if (token1Kind === 79 /* DotDotDotToken */) { - return true; - } - token2 = peekToken(2); - token2Kind = token2.kind(); - if (TypeScript.SyntaxFacts.isAccessibilityModifier(token1Kind)) { - if (isIdentifier(token2)) { - return true; - } - } - if (!isIdentifier(token1)) { - return false; - } - if (token2Kind === 108 /* ColonToken */) { - return true; - } - var token3 = peekToken(3); - var token3Kind = token3.kind(); - if (token2Kind === 107 /* QuestionToken */) { - if (token3Kind === 108 /* ColonToken */ || token3Kind === 75 /* CloseParenToken */ || token3Kind === 81 /* CommaToken */) { - return true; - } - } - if (token2Kind === 75 /* CloseParenToken */) { - if (token3Kind === 87 /* EqualsGreaterThanToken */) { - return true; - } - } - return false; - } - function isPossiblyArrowFunctionExpression() { - var token0 = currentToken(); - if (token0.kind() !== 74 /* OpenParenToken */) { - return true; - } - var token1 = peekToken(1); - if (!isIdentifier(token1)) { - return false; - } - var token2 = peekToken(2); - var token2Kind = token2.kind(); - if (token2Kind === 109 /* EqualsToken */) { - return true; - } - if (token2Kind === 81 /* CommaToken */) { - return true; - } - if (token2Kind === 75 /* CloseParenToken */) { - var token3 = peekToken(3); - if (token3.kind() === 108 /* ColonToken */) { - return true; - } - } - return false; - } - function parseObjectLiteralExpression(openBraceToken) { - consumeToken(openBraceToken); - var skippedTokens = getArray(); - var propertyAssignments = parseSeparatedSyntaxList(15 /* ObjectLiteralExpression_PropertyAssignments */, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - return new TypeScript.ObjectLiteralExpressionSyntax(parseNodeData, openBraceToken, propertyAssignments, eatToken(73 /* CloseBraceToken */)); - } - function tryParsePropertyAssignment(inErrorRecovery) { - if (isAccessor(modifierCount(), inErrorRecovery)) { - return parseAccessor(true); - } - else if (isFunctionPropertyAssignment(inErrorRecovery)) { - return parseFunctionPropertyAssignment(); - } - else if (isSimplePropertyAssignment(inErrorRecovery)) { - return parseSimplePropertyAssignment(); - } - else { - return undefined; - } - } - function isPropertyAssignment(inErrorRecovery) { - return isAccessor(modifierCount(), inErrorRecovery) || isFunctionPropertyAssignment(inErrorRecovery) || isSimplePropertyAssignment(inErrorRecovery); - } - function eatPropertyName() { - var _currentToken = currentToken(); - return TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(_currentToken) ? eatIdentifierNameToken() : consumeToken(_currentToken); - } - function isFunctionPropertyAssignment(inErrorRecovery) { - return isPropertyName(currentToken(), inErrorRecovery) && isCallSignature(1); - } - function parseFunctionPropertyAssignment() { - return new TypeScript.FunctionPropertyAssignmentSyntax(parseNodeData, eatPropertyName(), parseCallSignature(false), parseBlock(false, true)); - } - function isSimplePropertyAssignment(inErrorRecovery) { - return isPropertyName(currentToken(), inErrorRecovery); - } - function parseSimplePropertyAssignment() { - return new TypeScript.SimplePropertyAssignmentSyntax(parseNodeData, eatPropertyName(), eatToken(108 /* ColonToken */), tryParseAssignmentExpressionOrHigher(true, true)); - } - function isPropertyName(token, inErrorRecovery) { - if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token)) { - if (inErrorRecovery) { - return isIdentifier(token); - } - else { - return true; - } - } - var kind = token.kind(); - return kind === 12 /* StringLiteral */ || kind === 11 /* NumericLiteral */ || kind === 13 /* NoSubstitutionTemplateToken */; - } - function parseArrayLiteralExpression(openBracketToken) { - consumeToken(openBracketToken); - var skippedTokens = getArray(); - var expressions = parseSeparatedSyntaxList(16 /* ArrayLiteralExpression_AssignmentExpressions */, skippedTokens); - openBracketToken = addSkippedTokensAfterToken(openBracketToken, skippedTokens); - return new TypeScript.ArrayLiteralExpressionSyntax(parseNodeData, openBracketToken, expressions, eatToken(77 /* CloseBracketToken */)); - } - function parseBlock(parseBlockEvenWithNoOpenBrace, checkForStrictMode) { - var openBraceToken = eatToken(72 /* OpenBraceToken */); - var statements; - if (parseBlockEvenWithNoOpenBrace || openBraceToken.fullWidth() > 0) { - var savedIsInStrictMode = isInStrictMode; - var processItems = checkForStrictMode ? updateStrictModeState : undefined; - var skippedTokens = getArray(); - var statements = parseSyntaxList(5 /* Block_Statements */, skippedTokens, processItems); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - setStrictMode(savedIsInStrictMode); - } - return new TypeScript.BlockSyntax(parseNodeData, openBraceToken, statements || [], eatToken(73 /* CloseBraceToken */)); - } - function parseCallSignature(requireCompleteTypeParameterList) { - return new TypeScript.CallSignatureSyntax(parseNodeData, tryParseTypeParameterList(requireCompleteTypeParameterList), parseParameterList(), parseOptionalTypeAnnotation(false)); - } - function tryParseTypeParameterList(requireCompleteTypeParameterList) { - var _currentToken = currentToken(); - if (_currentToken.kind() !== 82 /* LessThanToken */) { - return undefined; - } - var rewindPoint = getRewindPoint(); - var lessThanToken = consumeToken(_currentToken); - var skippedTokens = getArray(); - var typeParameters = parseSeparatedSyntaxList(20 /* TypeParameterList_TypeParameters */, skippedTokens); - lessThanToken = addSkippedTokensAfterToken(lessThanToken, skippedTokens); - var greaterThanToken = eatToken(83 /* GreaterThanToken */); - if (requireCompleteTypeParameterList && greaterThanToken.fullWidth() === 0) { - rewind(rewindPoint); - releaseRewindPoint(rewindPoint); - return undefined; - } - else { - releaseRewindPoint(rewindPoint); - return new TypeScript.TypeParameterListSyntax(parseNodeData, lessThanToken, typeParameters, greaterThanToken); - } - } - function isTypeParameter() { - return isIdentifier(currentToken()); - } - function tryParseTypeParameter() { - if (!isIdentifier(currentToken())) { - return undefined; - } - return new TypeScript.TypeParameterSyntax(parseNodeData, eatIdentifierToken(), tryParseConstraint()); - } - function tryParseConstraint() { - if (currentToken().kind() !== 50 /* ExtendsKeyword */) { - return undefined; - } - return new TypeScript.ConstraintSyntax(parseNodeData, eatToken(50 /* ExtendsKeyword */), parseTypeOrExpression()); - } - function tryParseParameterList() { - if (currentToken().kind() === 74 /* OpenParenToken */) { - var token1 = peekToken(1); - if (token1.kind() === 75 /* CloseParenToken */ || isParameterHelper(token1)) { - return parseParameterList(); - } - } - return undefined; - } - function parseParameterList() { - var openParenToken = eatToken(74 /* OpenParenToken */); - var parameters; - if (openParenToken.fullWidth() > 0) { - var skippedTokens = getArray(); - parameters = parseSeparatedSyntaxList(17 /* ParameterList_Parameters */, skippedTokens); - openParenToken = addSkippedTokensAfterToken(openParenToken, skippedTokens); - } - return new TypeScript.ParameterListSyntax(parseNodeData, openParenToken, parameters || [], eatToken(75 /* CloseParenToken */)); - } - function parseOptionalTypeAnnotation(allowStringLiteral) { - return currentToken().kind() === 108 /* ColonToken */ ? parseTypeAnnotation(allowStringLiteral) : undefined; - } - function parseTypeAnnotationType(allowStringLiteral) { - if (allowStringLiteral) { - var _currentToken = currentToken(); - if (_currentToken.kind() === 12 /* StringLiteral */) { - return consumeToken(_currentToken); - } - } - return parseType(); - } - function parseTypeAnnotation(allowStringLiteral) { - return new TypeScript.TypeAnnotationSyntax(parseNodeData, consumeToken(currentToken()), parseTypeAnnotationType(allowStringLiteral)); - } - function isType() { - var _currentToken = currentToken(); - switch (_currentToken.kind()) { - case 41 /* TypeOfKeyword */: - case 62 /* AnyKeyword */: - case 69 /* NumberKeyword */: - case 63 /* BooleanKeyword */: - case 71 /* StringKeyword */: - case 43 /* VoidKeyword */: - case 72 /* OpenBraceToken */: - case 74 /* OpenParenToken */: - case 82 /* LessThanToken */: - case 33 /* NewKeyword */: - return true; - default: - return isIdentifier(_currentToken); - } - } - function parseTypeOrExpression() { - var result = tryParseType(); - if (result) { - return result; - } - var _currentToken = currentToken(); - if (isExpression(_currentToken)) { - return tryParseUnaryExpressionOrHigher(_currentToken, true); - } - return eatIdentifierToken(TypeScript.DiagnosticCode.Type_expected); - } - function parseType() { - return tryParseType() || eatIdentifierToken(TypeScript.DiagnosticCode.Type_expected); - } - function tryParseType() { - if (isFunctionType()) { - return parseFunctionType(); - } - if (currentToken().kind() === 33 /* NewKeyword */) { - return parseConstructorType(); - } - return tryParseUnionTypeOrHigher(); - } - function tryParseUnionTypeOrHigher() { - var type = tryParsePrimaryType(); - if (type) { - var barToken; - while ((barToken = currentToken()).kind() === 101 /* BarToken */) { - consumeToken(barToken); - var right = parsePrimaryType(); - type = new TypeScript.UnionTypeSyntax(parseNodeData, type, barToken, right); - } - } - return type; - } - function parsePrimaryType() { - return tryParsePrimaryType() || eatIdentifierToken(TypeScript.DiagnosticCode.Type_expected); - } - function tryParsePrimaryType() { - var type = tryParseNonArrayType(); - while (type) { - var _currentToken = currentToken(); - if (previousTokenHasTrailingNewLine(_currentToken) || _currentToken.kind() !== 76 /* OpenBracketToken */) { - break; - } - type = new TypeScript.ArrayTypeSyntax(parseNodeData, type, consumeToken(_currentToken), eatToken(77 /* CloseBracketToken */)); - } - return type; - } - function parseTypeQuery(typeOfKeyword) { - return new TypeScript.TypeQuerySyntax(parseNodeData, consumeToken(typeOfKeyword), parseName(true)); - } - function tryParseNonArrayType() { - var _currentToken = currentToken(); - switch (_currentToken.kind()) { - case 62 /* AnyKeyword */: - case 69 /* NumberKeyword */: - case 63 /* BooleanKeyword */: - case 71 /* StringKeyword */: - if (peekToken(1).kind() === 78 /* DotToken */) { - break; - } - return consumeToken(_currentToken); - case 43 /* VoidKeyword */: return consumeToken(_currentToken); - case 74 /* OpenParenToken */: return parseParenthesizedType(_currentToken); - case 72 /* OpenBraceToken */: return parseObjectType(); - case 41 /* TypeOfKeyword */: return parseTypeQuery(_currentToken); - case 76 /* OpenBracketToken */: return parseTupleType(_currentToken); - } - return tryParseNameOrGenericType(); - } - function parseParenthesizedType(openParenToken) { - return new TypeScript.ParenthesizedTypeSyntax(parseNodeData, consumeToken(openParenToken), parseType(), eatToken(75 /* CloseParenToken */)); - } - function tryParseNameOrGenericType() { - var name = tryParseName(false); - if (name === undefined) { - return undefined; - } - if (previousTokenHasTrailingNewLine(currentToken())) { - return name; - } - var typeArgumentList = tryParseTypeArgumentList(false); - return !typeArgumentList ? name : new TypeScript.GenericTypeSyntax(parseNodeData, name, typeArgumentList); - } - function isFunctionType() { - var token0 = currentToken(); - var token0Kind = token0.kind(); - if (token0Kind === 82 /* LessThanToken */) { - return true; - } - if (token0Kind === 74 /* OpenParenToken */) { - var token1 = peekToken(1); - var token1Kind = token1.kind(); - if (token1Kind === 75 /* CloseParenToken */ || token1Kind === 79 /* DotDotDotToken */) { - return true; - } - if (isModifierKind(token1Kind) || isIdentifier(token1)) { - var token2 = peekToken(2); - var token2Kind = token2.kind(); - if (token2Kind === 108 /* ColonToken */ || token2Kind === 81 /* CommaToken */ || token2Kind === 107 /* QuestionToken */ || token2Kind === 109 /* EqualsToken */ || isIdentifier(token2) || isModifierKind(token2Kind)) { - return true; - } - if (token2Kind === 75 /* CloseParenToken */) { - return peekToken(3).kind() === 87 /* EqualsGreaterThanToken */; - } - } - } - return false; - } - function parseFunctionType() { - var typeParameterList = tryParseTypeParameterList(false); - var parameterList = parseParameterList(); - return new TypeScript.FunctionTypeSyntax(parseNodeData, typeParameterList, parameterList, eatToken(87 /* EqualsGreaterThanToken */), parseType()); - } - function parseConstructorType() { - return new TypeScript.ConstructorTypeSyntax(parseNodeData, eatToken(33 /* NewKeyword */), tryParseTypeParameterList(false), parseParameterList(), eatToken(87 /* EqualsGreaterThanToken */), parseType()); - } - function isParameter() { - if (currentNode() && currentNode().kind() === 208 /* Parameter */) { - return true; - } - return isParameterHelper(currentToken()); - } - function isParameterHelper(token) { - var tokenKind = token.kind(); - return tokenKind === 79 /* DotDotDotToken */ || isModifierKind(tokenKind) || isIdentifier(token); - } - function eatSimpleParameter() { - return new TypeScript.ParameterSyntax(parseNodeData, undefined, [], eatIdentifierToken(), undefined, undefined, undefined); - } - function tryParseParameter() { - var node = currentNode(); - if (node && node.kind() === 208 /* Parameter */) { - consumeNode(node); - return node; - } - var dotDotDotToken = tryEatToken(79 /* DotDotDotToken */); - var modifiers = parseModifiers(); - var _currentToken = currentToken(); - if (!isIdentifier(_currentToken) && !dotDotDotToken && modifiers.length === 0) { - if (isModifierKind(_currentToken.kind())) { - modifiers = TypeScript.Syntax.list([consumeToken(_currentToken)]); - } - else { - return undefined; - } - } - var identifier = eatIdentifierToken(); - var questionToken = tryEatToken(107 /* QuestionToken */); - var typeAnnotation = parseOptionalTypeAnnotation(true); - var equalsValueClause = undefined; - if (isEqualsValueClause(true)) { - equalsValueClause = parseEqualsValueClause(true); - } - return new TypeScript.ParameterSyntax(parseNodeData, dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause); - } - function parseSyntaxList(currentListType, skippedTokens, processItems) { - var savedListParsingState = listParsingState; - listParsingState |= (1 << currentListType); - var result = parseSyntaxListWorker(currentListType, skippedTokens, processItems); - listParsingState = savedListParsingState; - return result; - } - function parseSeparatedSyntaxList(currentListType, skippedTokens) { - var savedListParsingState = listParsingState; - listParsingState |= (1 << currentListType); - var result = parseSeparatedSyntaxListWorker(currentListType, skippedTokens); - listParsingState = savedListParsingState; - return result; - } - function abortParsingListOrMoveToNextToken(currentListType, nodeAndSeparators, skippedTokens) { - reportUnexpectedTokenDiagnostic(currentListType); - for (var state = ListParsingState.LastListParsingState; state >= ListParsingState.FirstListParsingState; state--) { - if ((listParsingState & (1 << state)) !== 0) { - if (isExpectedListTerminator(state) || isExpectedListItem(state, true)) { - return true; - } - } - } - addSkippedTokenToList(nodeAndSeparators, skippedTokens, consumeToken(currentToken())); - return false; - } - function addSkippedTokenToList(nodesAndSeparators, skippedTokens, skippedToken) { - var length = nodesAndSeparators.length; - for (var i = length - 1; i >= 0; i--) { - var item = nodesAndSeparators[i]; - var _lastToken = TypeScript.lastToken(item); - if (_lastToken && _lastToken.fullWidth() > 0) { - nodesAndSeparators[i] = addSkippedTokenAfterNodeOrToken(item, skippedToken); - return; - } - } - skippedTokens.push(skippedToken); - } - function tryParseExpectedListItem(currentListType, inErrorRecovery, items, processItems) { - var item = tryParseExpectedListItemWorker(currentListType, inErrorRecovery); - if (item === undefined) { - return false; - } - items.push(item); - if (processItems) { - processItems(items); - } - return true; - } - function listIsTerminated(currentListType) { - return isExpectedListTerminator(currentListType) || currentToken().kind() === 8 /* EndOfFileToken */; - } - function parseSyntaxListWorker(currentListType, skippedTokens, processItems) { - var items = []; - while (true) { - var succeeded = tryParseExpectedListItem(currentListType, false, items, processItems); - if (!succeeded) { - if (listIsTerminated(currentListType)) { - break; - } - var abort = abortParsingListOrMoveToNextToken(currentListType, items, skippedTokens); - if (abort) { - break; - } - } - } - return TypeScript.Syntax.list(items); - } - function parseSeparatedSyntaxListWorker(currentListType, skippedTokens) { - var nodesAndSeparators = []; - var _separatorKind = currentListType === 9 /* ObjectType_TypeMembers */ ? 80 /* SemicolonToken */ : 81 /* CommaToken */; - var allowAutomaticSemicolonInsertion = _separatorKind === 80 /* SemicolonToken */; - var inErrorRecovery = false; - while (true) { - var succeeded = tryParseExpectedListItem(currentListType, inErrorRecovery, nodesAndSeparators, undefined); - if (!succeeded) { - if (listIsTerminated(currentListType)) { - break; - } - var abort = abortParsingListOrMoveToNextToken(currentListType, nodesAndSeparators, skippedTokens); - if (abort) { - break; - } - else { - inErrorRecovery = true; - continue; - } - } - inErrorRecovery = false; - var _currentToken = currentToken(); - var tokenKind = _currentToken.kind(); - if (tokenKind === _separatorKind || tokenKind === 81 /* CommaToken */) { - nodesAndSeparators.push(consumeToken(_currentToken)); - continue; - } - if (listIsTerminated(currentListType)) { - break; - } - if (allowAutomaticSemicolonInsertion && canEatAutomaticSemicolon(false)) { - var semicolonToken = eatExplicitOrAutomaticSemicolon(false) || TypeScript.Syntax.emptyToken(80 /* SemicolonToken */); - nodesAndSeparators.push(semicolonToken); - continue; - } - nodesAndSeparators.push(eatToken(_separatorKind)); - inErrorRecovery = true; - } - return TypeScript.Syntax.separatedList(nodesAndSeparators); - } - function reportUnexpectedTokenDiagnostic(listType) { - var token = currentToken(); - var diagnostic = new TypeScript.Diagnostic(fileName, source.text.lineMap(), TypeScript.start(token, source.text), TypeScript.width(token), TypeScript.DiagnosticCode.Unexpected_token_0_expected, [getExpectedListElementType(listType)]); - addDiagnostic(diagnostic); - } - function addDiagnostic(diagnostic) { - if (diagnostics.length > 0 && diagnostics[diagnostics.length - 1].start() === diagnostic.start()) { - return; - } - diagnostics.push(diagnostic); - } - function isExpectedListTerminator(currentListType) { - switch (currentListType) { - case 0 /* SourceUnit_ModuleElements */: return isExpectedSourceUnit_ModuleElementsTerminator(); - case 1 /* ClassDeclaration_ClassElements */: return isExpectedClassDeclaration_ClassElementsTerminator(); - case 2 /* ModuleDeclaration_ModuleElements */: return isExpectedModuleDeclaration_ModuleElementsTerminator(); - case 3 /* SwitchStatement_SwitchClauses */: return isExpectedSwitchStatement_SwitchClausesTerminator(); - case 4 /* SwitchClause_Statements */: return isExpectedSwitchClause_StatementsTerminator(); - case 5 /* Block_Statements */: return isExpectedBlock_StatementsTerminator(); - case 6 /* TryBlock_Statements */: return isExpectedTryBlock_StatementsTerminator(); - case 7 /* CatchBlock_Statements */: return isExpectedCatchBlock_StatementsTerminator(); - case 8 /* EnumDeclaration_EnumElements */: return isExpectedEnumDeclaration_EnumElementsTerminator(); - case 9 /* ObjectType_TypeMembers */: return isExpectedObjectType_TypeMembersTerminator(); - case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: return isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator(); - case 11 /* HeritageClause_TypeNameList */: return isExpectedHeritageClause_TypeNameListTerminator(); - case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: return isExpectedVariableDeclaration_VariableDeclarators_AllowInTerminator(); - case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: return isExpectedVariableDeclaration_VariableDeclarators_DisallowInTerminator(); - case 14 /* ArgumentList_AssignmentExpressions */: return isExpectedArgumentList_AssignmentExpressionsTerminator(); - case 15 /* ObjectLiteralExpression_PropertyAssignments */: return isExpectedObjectLiteralExpression_PropertyAssignmentsTerminator(); - case 16 /* ArrayLiteralExpression_AssignmentExpressions */: return isExpectedLiteralExpression_AssignmentExpressionsTerminator(); - case 17 /* ParameterList_Parameters */: return isExpectedParameterList_ParametersTerminator(); - case 18 /* IndexSignature_Parameters */: return isExpectedIndexSignature_ParametersTerminator(); - case 19 /* TypeArgumentList_Types */: return isExpectedTypeArgumentList_TypesTerminator(); - case 20 /* TypeParameterList_TypeParameters */: return isExpectedTypeParameterList_TypeParametersTerminator(); - case 21 /* TupleType_Types */: return isExpectedTupleType_TypesTerminator(); - default: - throw TypeScript.Errors.invalidOperation(); - } - } - function isExpectedSourceUnit_ModuleElementsTerminator() { - return currentToken().kind() === 8 /* EndOfFileToken */; - } - function isExpectedEnumDeclaration_EnumElementsTerminator() { - return currentToken().kind() === 73 /* CloseBraceToken */; - } - function isExpectedModuleDeclaration_ModuleElementsTerminator() { - return currentToken().kind() === 73 /* CloseBraceToken */; - } - function isExpectedObjectType_TypeMembersTerminator() { - return currentToken().kind() === 73 /* CloseBraceToken */; - } - function isExpectedObjectLiteralExpression_PropertyAssignmentsTerminator() { - return currentToken().kind() === 73 /* CloseBraceToken */; - } - function isExpectedLiteralExpression_AssignmentExpressionsTerminator() { - return currentToken().kind() === 77 /* CloseBracketToken */; - } - function isExpectedTypeArgumentList_TypesTerminator() { - var token = currentToken(); - var tokenKind = token.kind(); - if (tokenKind === 83 /* GreaterThanToken */) { - return true; - } - if (canFollowTypeArgumentListInExpression(tokenKind)) { - return true; - } - return false; - } - function isExpectedTupleType_TypesTerminator() { - var token = currentToken(); - var tokenKind = token.kind(); - if (tokenKind === 77 /* CloseBracketToken */) { - return true; - } - return false; - } - function isExpectedTypeParameterList_TypeParametersTerminator() { - var tokenKind = currentToken().kind(); - if (tokenKind === 83 /* GreaterThanToken */) { - return true; - } - if (tokenKind === 74 /* OpenParenToken */ || tokenKind === 72 /* OpenBraceToken */ || tokenKind === 50 /* ExtendsKeyword */ || tokenKind === 53 /* ImplementsKeyword */) { - return true; - } - return false; - } - function isExpectedParameterList_ParametersTerminator() { - var tokenKind = currentToken().kind(); - if (tokenKind === 75 /* CloseParenToken */) { - return true; - } - if (tokenKind === 72 /* OpenBraceToken */) { - return true; - } - if (tokenKind === 87 /* EqualsGreaterThanToken */) { - return true; - } - return false; - } - function isExpectedIndexSignature_ParametersTerminator() { - var tokenKind = currentToken().kind(); - if (tokenKind === 77 /* CloseBracketToken */) { - return true; - } - if (tokenKind === 72 /* OpenBraceToken */) { - return true; - } - return false; - } - function isExpectedVariableDeclaration_VariableDeclarators_DisallowInTerminator() { - var tokenKind = currentToken().kind(); - if (tokenKind === 80 /* SemicolonToken */ || tokenKind === 75 /* CloseParenToken */) { - return true; - } - if (tokenKind === 31 /* InKeyword */) { - return true; - } - return false; - } - function isExpectedVariableDeclaration_VariableDeclarators_AllowInTerminator() { - if (currentToken().kind() === 87 /* EqualsGreaterThanToken */) { - return true; - } - return canEatExplicitOrAutomaticSemicolon(false); - } - function isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator() { - var tokenKind = currentToken().kind(); - if (tokenKind === 72 /* OpenBraceToken */ || tokenKind === 73 /* CloseBraceToken */) { - return true; - } - return false; - } - function isExpectedHeritageClause_TypeNameListTerminator() { - var tokenKind = currentToken().kind(); - if (tokenKind === 50 /* ExtendsKeyword */ || tokenKind === 53 /* ImplementsKeyword */) { - return true; - } - if (isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator()) { - return true; - } - return false; - } - function isExpectedArgumentList_AssignmentExpressionsTerminator() { - var token0 = currentToken(); - var tokenKind = token0.kind(); - return tokenKind === 75 /* CloseParenToken */ || tokenKind === 80 /* SemicolonToken */; - } - function isExpectedClassDeclaration_ClassElementsTerminator() { - return currentToken().kind() === 73 /* CloseBraceToken */; - } - function isExpectedSwitchStatement_SwitchClausesTerminator() { - return currentToken().kind() === 73 /* CloseBraceToken */; - } - function isExpectedSwitchClause_StatementsTerminator() { - return currentToken().kind() === 73 /* CloseBraceToken */ || isSwitchClause(); - } - function isExpectedBlock_StatementsTerminator() { - return currentToken().kind() === 73 /* CloseBraceToken */; - } - function isExpectedTryBlock_StatementsTerminator() { - var tokenKind = currentToken().kind(); - return tokenKind === 19 /* CatchKeyword */ || tokenKind === 27 /* FinallyKeyword */; - } - function isExpectedCatchBlock_StatementsTerminator() { - return currentToken().kind() === 27 /* FinallyKeyword */; - } - function isExpectedListItem(currentListType, inErrorRecovery) { - switch (currentListType) { - case 0 /* SourceUnit_ModuleElements */: return isModuleElement(inErrorRecovery); - case 1 /* ClassDeclaration_ClassElements */: return isClassElement(inErrorRecovery); - case 2 /* ModuleDeclaration_ModuleElements */: return isModuleElement(inErrorRecovery); - case 3 /* SwitchStatement_SwitchClauses */: return isSwitchClause(); - case 4 /* SwitchClause_Statements */: return isStatement(modifierCount(), inErrorRecovery); - case 5 /* Block_Statements */: return isStatement(modifierCount(), inErrorRecovery); - case 6 /* TryBlock_Statements */: return false; - case 7 /* CatchBlock_Statements */: return false; - case 8 /* EnumDeclaration_EnumElements */: return isEnumElement(inErrorRecovery); - case 9 /* ObjectType_TypeMembers */: return isTypeMember(inErrorRecovery); - case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: return isHeritageClause(); - case 11 /* HeritageClause_TypeNameList */: return isHeritageClauseTypeName(); - case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: return isVariableDeclarator(); - case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: return isVariableDeclarator(); - case 14 /* ArgumentList_AssignmentExpressions */: return isExpectedArgumentList_AssignmentExpression(); - case 15 /* ObjectLiteralExpression_PropertyAssignments */: return isPropertyAssignment(inErrorRecovery); - case 16 /* ArrayLiteralExpression_AssignmentExpressions */: return isAssignmentOrOmittedExpression(); - case 17 /* ParameterList_Parameters */: return isParameter(); - case 18 /* IndexSignature_Parameters */: return isParameter(); - case 19 /* TypeArgumentList_Types */: return isType(); - case 20 /* TypeParameterList_TypeParameters */: return isTypeParameter(); - case 21 /* TupleType_Types */: return isType(); - default: throw TypeScript.Errors.invalidOperation(); - } - } - function isExpectedArgumentList_AssignmentExpression() { - var _currentToken = currentToken(); - if (isExpression(_currentToken)) { - return true; - } - if (_currentToken.kind() === 81 /* CommaToken */) { - return true; - } - return false; - } - function tryParseExpectedListItemWorker(currentListType, inErrorRecovery) { - switch (currentListType) { - case 0 /* SourceUnit_ModuleElements */: return tryParseModuleElement(inErrorRecovery); - case 1 /* ClassDeclaration_ClassElements */: return tryParseClassElement(inErrorRecovery); - case 2 /* ModuleDeclaration_ModuleElements */: return tryParseModuleElement(inErrorRecovery); - case 3 /* SwitchStatement_SwitchClauses */: return tryParseSwitchClause(); - case 4 /* SwitchClause_Statements */: return tryParseStatement(inErrorRecovery); - case 5 /* Block_Statements */: return tryParseStatement(inErrorRecovery); - case 6 /* TryBlock_Statements */: return tryParseStatement(inErrorRecovery); - case 7 /* CatchBlock_Statements */: return tryParseStatement(inErrorRecovery); - case 8 /* EnumDeclaration_EnumElements */: return tryParseEnumElement(inErrorRecovery); - case 9 /* ObjectType_TypeMembers */: return tryParseTypeMember(inErrorRecovery); - case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: return tryParseHeritageClause(); - case 11 /* HeritageClause_TypeNameList */: return tryParseHeritageClauseTypeName(); - case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: return tryParseVariableDeclarator(true, false); - case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: return tryParseVariableDeclarator(false, false); - case 14 /* ArgumentList_AssignmentExpressions */: return tryParseArgumentListExpression(); - case 15 /* ObjectLiteralExpression_PropertyAssignments */: return tryParsePropertyAssignment(inErrorRecovery); - case 16 /* ArrayLiteralExpression_AssignmentExpressions */: return tryParseAssignmentOrOmittedExpression(); - case 17 /* ParameterList_Parameters */: return tryParseParameter(); - case 18 /* IndexSignature_Parameters */: return tryParseParameter(); - case 19 /* TypeArgumentList_Types */: return tryParseType(); - case 20 /* TypeParameterList_TypeParameters */: return tryParseTypeParameter(); - case 21 /* TupleType_Types */: return tryParseType(); - default: throw TypeScript.Errors.invalidOperation(); - } - } - function getExpectedListElementType(currentListType) { - switch (currentListType) { - case 0 /* SourceUnit_ModuleElements */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.module_class_interface_enum_import_or_statement, undefined); - case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: return '{'; - case 1 /* ClassDeclaration_ClassElements */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.constructor_function_accessor_or_variable, undefined); - case 2 /* ModuleDeclaration_ModuleElements */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.module_class_interface_enum_import_or_statement, undefined); - case 3 /* SwitchStatement_SwitchClauses */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.case_or_default_clause, undefined); - case 4 /* SwitchClause_Statements */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.statement, undefined); - case 5 /* Block_Statements */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.statement, undefined); - case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, undefined); - case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, undefined); - case 8 /* EnumDeclaration_EnumElements */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, undefined); - case 9 /* ObjectType_TypeMembers */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.call_construct_index_property_or_function_signature, undefined); - case 14 /* ArgumentList_AssignmentExpressions */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.expression, undefined); - case 11 /* HeritageClause_TypeNameList */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_name, undefined); - case 15 /* ObjectLiteralExpression_PropertyAssignments */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.property_or_accessor, undefined); - case 17 /* ParameterList_Parameters */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.parameter, undefined); - case 18 /* IndexSignature_Parameters */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.parameter, undefined); - case 19 /* TypeArgumentList_Types */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type, undefined); - case 20 /* TypeParameterList_TypeParameters */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_parameter, undefined); - case 21 /* TupleType_Types */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type, undefined); - case 16 /* ArrayLiteralExpression_AssignmentExpressions */: return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.expression, undefined); - default: throw TypeScript.Errors.invalidOperation(); - } - } - return parseSyntaxTree; - } - var BinaryExpressionPrecedence; - (function (BinaryExpressionPrecedence) { - BinaryExpressionPrecedence[BinaryExpressionPrecedence["Lowest"] = 1] = "Lowest"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["LogicalOrExpressionPrecedence"] = 2] = "LogicalOrExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["LogicalAndExpressionPrecedence"] = 3] = "LogicalAndExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["BitwiseOrExpressionPrecedence"] = 4] = "BitwiseOrExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["BitwiseExclusiveOrExpressionPrecedence"] = 5] = "BitwiseExclusiveOrExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["BitwiseAndExpressionPrecedence"] = 6] = "BitwiseAndExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["EqualityExpressionPrecedence"] = 7] = "EqualityExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["RelationalExpressionPrecedence"] = 8] = "RelationalExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["ShiftExpressionPrecdence"] = 9] = "ShiftExpressionPrecdence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["AdditiveExpressionPrecedence"] = 10] = "AdditiveExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["MultiplicativeExpressionPrecedence"] = 11] = "MultiplicativeExpressionPrecedence"; - })(BinaryExpressionPrecedence || (BinaryExpressionPrecedence = {})); - var ListParsingState; - (function (ListParsingState) { - ListParsingState[ListParsingState["SourceUnit_ModuleElements"] = 0] = "SourceUnit_ModuleElements"; - ListParsingState[ListParsingState["ClassDeclaration_ClassElements"] = 1] = "ClassDeclaration_ClassElements"; - ListParsingState[ListParsingState["ModuleDeclaration_ModuleElements"] = 2] = "ModuleDeclaration_ModuleElements"; - ListParsingState[ListParsingState["SwitchStatement_SwitchClauses"] = 3] = "SwitchStatement_SwitchClauses"; - ListParsingState[ListParsingState["SwitchClause_Statements"] = 4] = "SwitchClause_Statements"; - ListParsingState[ListParsingState["Block_Statements"] = 5] = "Block_Statements"; - ListParsingState[ListParsingState["TryBlock_Statements"] = 6] = "TryBlock_Statements"; - ListParsingState[ListParsingState["CatchBlock_Statements"] = 7] = "CatchBlock_Statements"; - ListParsingState[ListParsingState["EnumDeclaration_EnumElements"] = 8] = "EnumDeclaration_EnumElements"; - ListParsingState[ListParsingState["ObjectType_TypeMembers"] = 9] = "ObjectType_TypeMembers"; - ListParsingState[ListParsingState["ClassOrInterfaceDeclaration_HeritageClauses"] = 10] = "ClassOrInterfaceDeclaration_HeritageClauses"; - ListParsingState[ListParsingState["HeritageClause_TypeNameList"] = 11] = "HeritageClause_TypeNameList"; - ListParsingState[ListParsingState["VariableDeclaration_VariableDeclarators_AllowIn"] = 12] = "VariableDeclaration_VariableDeclarators_AllowIn"; - ListParsingState[ListParsingState["VariableDeclaration_VariableDeclarators_DisallowIn"] = 13] = "VariableDeclaration_VariableDeclarators_DisallowIn"; - ListParsingState[ListParsingState["ArgumentList_AssignmentExpressions"] = 14] = "ArgumentList_AssignmentExpressions"; - ListParsingState[ListParsingState["ObjectLiteralExpression_PropertyAssignments"] = 15] = "ObjectLiteralExpression_PropertyAssignments"; - ListParsingState[ListParsingState["ArrayLiteralExpression_AssignmentExpressions"] = 16] = "ArrayLiteralExpression_AssignmentExpressions"; - ListParsingState[ListParsingState["ParameterList_Parameters"] = 17] = "ParameterList_Parameters"; - ListParsingState[ListParsingState["IndexSignature_Parameters"] = 18] = "IndexSignature_Parameters"; - ListParsingState[ListParsingState["TypeArgumentList_Types"] = 19] = "TypeArgumentList_Types"; - ListParsingState[ListParsingState["TypeParameterList_TypeParameters"] = 20] = "TypeParameterList_TypeParameters"; - ListParsingState[ListParsingState["TupleType_Types"] = 21] = "TupleType_Types"; - ListParsingState[ListParsingState["FirstListParsingState"] = ListParsingState.SourceUnit_ModuleElements] = "FirstListParsingState"; - ListParsingState[ListParsingState["LastListParsingState"] = ListParsingState.TupleType_Types] = "LastListParsingState"; - })(ListParsingState || (ListParsingState = {})); - var parseSyntaxTree = createParseSyntaxTree(); - function parse(fileName, text, languageVersion, isDeclaration) { - return parseSource(TypeScript.Scanner.createParserSource(fileName, text, languageVersion), isDeclaration); - } - Parser.parse = parse; - function parseSource(source, isDeclaration) { - return parseSyntaxTree(source, isDeclaration); - } - Parser.parseSource = parseSource; - })(Parser = TypeScript.Parser || (TypeScript.Parser = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.SourceUnitSyntax = function (data, moduleElements, endOfFileToken) { - if (data) { - this.__data = data; - } - this.moduleElements = moduleElements, this.endOfFileToken = endOfFileToken; - moduleElements.parent = this, endOfFileToken.parent = this; - }; - TypeScript.SourceUnitSyntax.prototype.kind = function () { - return 122 /* SourceUnit */; - }; - TypeScript.QualifiedNameSyntax = function (data, left, dotToken, right) { - if (data) { - this.__data = data; - } - this.left = left, this.dotToken = dotToken, this.right = right; - left.parent = this, dotToken.parent = this, right.parent = this; - }; - TypeScript.QualifiedNameSyntax.prototype.kind = function () { - return 123 /* QualifiedName */; - }; - TypeScript.ObjectTypeSyntax = function (data, openBraceToken, typeMembers, closeBraceToken) { - if (data) { - this.__data = data; - } - this.openBraceToken = openBraceToken, this.typeMembers = typeMembers, this.closeBraceToken = closeBraceToken; - openBraceToken.parent = this, typeMembers.parent = this, closeBraceToken.parent = this; - }; - TypeScript.ObjectTypeSyntax.prototype.kind = function () { - return 124 /* ObjectType */; - }; - TypeScript.FunctionTypeSyntax = function (data, typeParameterList, parameterList, equalsGreaterThanToken, type) { - if (data) { - this.__data = data; - } - this.typeParameterList = typeParameterList, this.parameterList = parameterList, this.equalsGreaterThanToken = equalsGreaterThanToken, this.type = type; - typeParameterList && (typeParameterList.parent = this), parameterList.parent = this, equalsGreaterThanToken.parent = this, type.parent = this; - }; - TypeScript.FunctionTypeSyntax.prototype.kind = function () { - return 125 /* FunctionType */; - }; - TypeScript.ArrayTypeSyntax = function (data, type, openBracketToken, closeBracketToken) { - if (data) { - this.__data = data; - } - this.type = type, this.openBracketToken = openBracketToken, this.closeBracketToken = closeBracketToken; - type.parent = this, openBracketToken.parent = this, closeBracketToken.parent = this; - }; - TypeScript.ArrayTypeSyntax.prototype.kind = function () { - return 126 /* ArrayType */; - }; - TypeScript.ConstructorTypeSyntax = function (data, newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type) { - if (data) { - this.__data = data; - } - this.newKeyword = newKeyword, this.typeParameterList = typeParameterList, this.parameterList = parameterList, this.equalsGreaterThanToken = equalsGreaterThanToken, this.type = type; - newKeyword.parent = this, typeParameterList && (typeParameterList.parent = this), parameterList.parent = this, equalsGreaterThanToken.parent = this, type.parent = this; - }; - TypeScript.ConstructorTypeSyntax.prototype.kind = function () { - return 127 /* ConstructorType */; - }; - TypeScript.GenericTypeSyntax = function (data, name, typeArgumentList) { - if (data) { - this.__data = data; - } - this.name = name, this.typeArgumentList = typeArgumentList; - name.parent = this, typeArgumentList.parent = this; - }; - TypeScript.GenericTypeSyntax.prototype.kind = function () { - return 128 /* GenericType */; - }; - TypeScript.TypeQuerySyntax = function (data, typeOfKeyword, name) { - if (data) { - this.__data = data; - } - this.typeOfKeyword = typeOfKeyword, this.name = name; - typeOfKeyword.parent = this, name.parent = this; - }; - TypeScript.TypeQuerySyntax.prototype.kind = function () { - return 129 /* TypeQuery */; - }; - TypeScript.TupleTypeSyntax = function (data, openBracketToken, types, closeBracketToken) { - if (data) { - this.__data = data; - } - this.openBracketToken = openBracketToken, this.types = types, this.closeBracketToken = closeBracketToken; - openBracketToken.parent = this, types.parent = this, closeBracketToken.parent = this; - }; - TypeScript.TupleTypeSyntax.prototype.kind = function () { - return 130 /* TupleType */; - }; - TypeScript.UnionTypeSyntax = function (data, left, barToken, right) { - if (data) { - this.__data = data; - } - this.left = left, this.barToken = barToken, this.right = right; - left.parent = this, barToken.parent = this, right.parent = this; - }; - TypeScript.UnionTypeSyntax.prototype.kind = function () { - return 131 /* UnionType */; - }; - TypeScript.ParenthesizedTypeSyntax = function (data, openParenToken, type, closeParenToken) { - if (data) { - this.__data = data; - } - this.openParenToken = openParenToken, this.type = type, this.closeParenToken = closeParenToken; - openParenToken.parent = this, type.parent = this, closeParenToken.parent = this; - }; - TypeScript.ParenthesizedTypeSyntax.prototype.kind = function () { - return 132 /* ParenthesizedType */; - }; - TypeScript.InterfaceDeclarationSyntax = function (data, modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body) { - if (data) { - this.__data = data; - } - this.modifiers = modifiers, this.interfaceKeyword = interfaceKeyword, this.identifier = identifier, this.typeParameterList = typeParameterList, this.heritageClauses = heritageClauses, this.body = body; - modifiers.parent = this, interfaceKeyword.parent = this, identifier.parent = this, typeParameterList && (typeParameterList.parent = this), heritageClauses.parent = this, body.parent = this; - }; - TypeScript.InterfaceDeclarationSyntax.prototype.kind = function () { - return 133 /* InterfaceDeclaration */; - }; - TypeScript.FunctionDeclarationSyntax = function (data, modifiers, functionKeyword, identifier, callSignature, block, semicolonToken) { - if (data) { - this.__data = data; - } - this.modifiers = modifiers, this.functionKeyword = functionKeyword, this.identifier = identifier, this.callSignature = callSignature, this.block = block, this.semicolonToken = semicolonToken; - modifiers.parent = this, functionKeyword.parent = this, identifier.parent = this, callSignature.parent = this, block && (block.parent = this), semicolonToken && (semicolonToken.parent = this); - }; - TypeScript.FunctionDeclarationSyntax.prototype.kind = function () { - return 134 /* FunctionDeclaration */; - }; - TypeScript.ModuleDeclarationSyntax = function (data, modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken) { - if (data) { - this.__data = data; - } - this.modifiers = modifiers, this.moduleKeyword = moduleKeyword, this.name = name, this.stringLiteral = stringLiteral, this.openBraceToken = openBraceToken, this.moduleElements = moduleElements, this.closeBraceToken = closeBraceToken; - modifiers.parent = this, moduleKeyword.parent = this, name && (name.parent = this), stringLiteral && (stringLiteral.parent = this), openBraceToken.parent = this, moduleElements.parent = this, closeBraceToken.parent = this; - }; - TypeScript.ModuleDeclarationSyntax.prototype.kind = function () { - return 135 /* ModuleDeclaration */; - }; - TypeScript.ClassDeclarationSyntax = function (data, modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken) { - if (data) { - this.__data = data; - } - this.modifiers = modifiers, this.classKeyword = classKeyword, this.identifier = identifier, this.typeParameterList = typeParameterList, this.heritageClauses = heritageClauses, this.openBraceToken = openBraceToken, this.classElements = classElements, this.closeBraceToken = closeBraceToken; - modifiers.parent = this, classKeyword.parent = this, identifier.parent = this, typeParameterList && (typeParameterList.parent = this), heritageClauses.parent = this, openBraceToken.parent = this, classElements.parent = this, closeBraceToken.parent = this; - }; - TypeScript.ClassDeclarationSyntax.prototype.kind = function () { - return 136 /* ClassDeclaration */; - }; - TypeScript.EnumDeclarationSyntax = function (data, modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken) { - if (data) { - this.__data = data; - } - this.modifiers = modifiers, this.enumKeyword = enumKeyword, this.identifier = identifier, this.openBraceToken = openBraceToken, this.enumElements = enumElements, this.closeBraceToken = closeBraceToken; - modifiers.parent = this, enumKeyword.parent = this, identifier.parent = this, openBraceToken.parent = this, enumElements.parent = this, closeBraceToken.parent = this; - }; - TypeScript.EnumDeclarationSyntax.prototype.kind = function () { - return 137 /* EnumDeclaration */; - }; - TypeScript.ImportDeclarationSyntax = function (data, modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken) { - if (data) { - this.__data = data; - } - this.modifiers = modifiers, this.importKeyword = importKeyword, this.identifier = identifier, this.equalsToken = equalsToken, this.moduleReference = moduleReference, this.semicolonToken = semicolonToken; - modifiers.parent = this, importKeyword.parent = this, identifier.parent = this, equalsToken.parent = this, moduleReference.parent = this, semicolonToken && (semicolonToken.parent = this); - }; - TypeScript.ImportDeclarationSyntax.prototype.kind = function () { - return 138 /* ImportDeclaration */; - }; - TypeScript.ExportAssignmentSyntax = function (data, exportKeyword, equalsToken, identifier, semicolonToken) { - if (data) { - this.__data = data; - } - this.exportKeyword = exportKeyword, this.equalsToken = equalsToken, this.identifier = identifier, this.semicolonToken = semicolonToken; - exportKeyword.parent = this, equalsToken.parent = this, identifier.parent = this, semicolonToken && (semicolonToken.parent = this); - }; - TypeScript.ExportAssignmentSyntax.prototype.kind = function () { - return 139 /* ExportAssignment */; - }; - TypeScript.MemberFunctionDeclarationSyntax = function (data, modifiers, propertyName, callSignature, block, semicolonToken) { - if (data) { - this.__data = data; - } - this.modifiers = modifiers, this.propertyName = propertyName, this.callSignature = callSignature, this.block = block, this.semicolonToken = semicolonToken; - modifiers.parent = this, propertyName.parent = this, callSignature.parent = this, block && (block.parent = this), semicolonToken && (semicolonToken.parent = this); - }; - TypeScript.MemberFunctionDeclarationSyntax.prototype.kind = function () { - return 140 /* MemberFunctionDeclaration */; - }; - TypeScript.MemberVariableDeclarationSyntax = function (data, modifiers, variableDeclarator, semicolonToken) { - if (data) { - this.__data = data; - } - this.modifiers = modifiers, this.variableDeclarator = variableDeclarator, this.semicolonToken = semicolonToken; - modifiers.parent = this, variableDeclarator.parent = this, semicolonToken && (semicolonToken.parent = this); - }; - TypeScript.MemberVariableDeclarationSyntax.prototype.kind = function () { - return 141 /* MemberVariableDeclaration */; - }; - TypeScript.ConstructorDeclarationSyntax = function (data, modifiers, constructorKeyword, callSignature, block, semicolonToken) { - if (data) { - this.__data = data; - } - this.modifiers = modifiers, this.constructorKeyword = constructorKeyword, this.callSignature = callSignature, this.block = block, this.semicolonToken = semicolonToken; - modifiers.parent = this, constructorKeyword.parent = this, callSignature.parent = this, block && (block.parent = this), semicolonToken && (semicolonToken.parent = this); - }; - TypeScript.ConstructorDeclarationSyntax.prototype.kind = function () { - return 142 /* ConstructorDeclaration */; - }; - TypeScript.IndexMemberDeclarationSyntax = function (data, modifiers, indexSignature, semicolonToken) { - if (data) { - this.__data = data; - } - this.modifiers = modifiers, this.indexSignature = indexSignature, this.semicolonToken = semicolonToken; - modifiers.parent = this, indexSignature.parent = this, semicolonToken && (semicolonToken.parent = this); - }; - TypeScript.IndexMemberDeclarationSyntax.prototype.kind = function () { - return 143 /* IndexMemberDeclaration */; - }; - TypeScript.GetAccessorSyntax = function (data, modifiers, getKeyword, propertyName, callSignature, block) { - if (data) { - this.__data = data; - } - this.modifiers = modifiers, this.getKeyword = getKeyword, this.propertyName = propertyName, this.callSignature = callSignature, this.block = block; - modifiers.parent = this, getKeyword.parent = this, propertyName.parent = this, callSignature.parent = this, block.parent = this; - }; - TypeScript.GetAccessorSyntax.prototype.kind = function () { - return 144 /* GetAccessor */; - }; - TypeScript.SetAccessorSyntax = function (data, modifiers, setKeyword, propertyName, callSignature, block) { - if (data) { - this.__data = data; - } - this.modifiers = modifiers, this.setKeyword = setKeyword, this.propertyName = propertyName, this.callSignature = callSignature, this.block = block; - modifiers.parent = this, setKeyword.parent = this, propertyName.parent = this, callSignature.parent = this, block.parent = this; - }; - TypeScript.SetAccessorSyntax.prototype.kind = function () { - return 145 /* SetAccessor */; - }; - TypeScript.PropertySignatureSyntax = function (data, propertyName, questionToken, typeAnnotation) { - if (data) { - this.__data = data; - } - this.propertyName = propertyName, this.questionToken = questionToken, this.typeAnnotation = typeAnnotation; - propertyName.parent = this, questionToken && (questionToken.parent = this), typeAnnotation && (typeAnnotation.parent = this); - }; - TypeScript.PropertySignatureSyntax.prototype.kind = function () { - return 146 /* PropertySignature */; - }; - TypeScript.CallSignatureSyntax = function (data, typeParameterList, parameterList, typeAnnotation) { - if (data) { - this.__data = data; - } - this.typeParameterList = typeParameterList, this.parameterList = parameterList, this.typeAnnotation = typeAnnotation; - typeParameterList && (typeParameterList.parent = this), parameterList.parent = this, typeAnnotation && (typeAnnotation.parent = this); - }; - TypeScript.CallSignatureSyntax.prototype.kind = function () { - return 147 /* CallSignature */; - }; - TypeScript.ConstructSignatureSyntax = function (data, newKeyword, callSignature) { - if (data) { - this.__data = data; - } - this.newKeyword = newKeyword, this.callSignature = callSignature; - newKeyword.parent = this, callSignature.parent = this; - }; - TypeScript.ConstructSignatureSyntax.prototype.kind = function () { - return 148 /* ConstructSignature */; - }; - TypeScript.IndexSignatureSyntax = function (data, openBracketToken, parameters, closeBracketToken, typeAnnotation) { - if (data) { - this.__data = data; - } - this.openBracketToken = openBracketToken, this.parameters = parameters, this.closeBracketToken = closeBracketToken, this.typeAnnotation = typeAnnotation; - openBracketToken.parent = this, parameters.parent = this, closeBracketToken.parent = this, typeAnnotation && (typeAnnotation.parent = this); - }; - TypeScript.IndexSignatureSyntax.prototype.kind = function () { - return 149 /* IndexSignature */; - }; - TypeScript.MethodSignatureSyntax = function (data, propertyName, questionToken, callSignature) { - if (data) { - this.__data = data; - } - this.propertyName = propertyName, this.questionToken = questionToken, this.callSignature = callSignature; - propertyName.parent = this, questionToken && (questionToken.parent = this), callSignature.parent = this; - }; - TypeScript.MethodSignatureSyntax.prototype.kind = function () { - return 150 /* MethodSignature */; - }; - TypeScript.BlockSyntax = function (data, openBraceToken, statements, closeBraceToken) { - if (data) { - this.__data = data; - } - this.openBraceToken = openBraceToken, this.statements = statements, this.closeBraceToken = closeBraceToken; - openBraceToken.parent = this, statements.parent = this, closeBraceToken.parent = this; - }; - TypeScript.BlockSyntax.prototype.kind = function () { - return 151 /* Block */; - }; - TypeScript.IfStatementSyntax = function (data, ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause) { - if (data) { - this.__data = data; - } - this.ifKeyword = ifKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.statement = statement, this.elseClause = elseClause; - ifKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, statement.parent = this, elseClause && (elseClause.parent = this); - }; - TypeScript.IfStatementSyntax.prototype.kind = function () { - return 152 /* IfStatement */; - }; - TypeScript.VariableStatementSyntax = function (data, modifiers, variableDeclaration, semicolonToken) { - if (data) { - this.__data = data; - } - this.modifiers = modifiers, this.variableDeclaration = variableDeclaration, this.semicolonToken = semicolonToken; - modifiers.parent = this, variableDeclaration.parent = this, semicolonToken && (semicolonToken.parent = this); - }; - TypeScript.VariableStatementSyntax.prototype.kind = function () { - return 153 /* VariableStatement */; - }; - TypeScript.ExpressionStatementSyntax = function (data, expression, semicolonToken) { - if (data) { - this.__data = data; - } - this.expression = expression, this.semicolonToken = semicolonToken; - expression.parent = this, semicolonToken && (semicolonToken.parent = this); - }; - TypeScript.ExpressionStatementSyntax.prototype.kind = function () { - return 154 /* ExpressionStatement */; - }; - TypeScript.ReturnStatementSyntax = function (data, returnKeyword, expression, semicolonToken) { - if (data) { - this.__data = data; - } - this.returnKeyword = returnKeyword, this.expression = expression, this.semicolonToken = semicolonToken; - returnKeyword.parent = this, expression && (expression.parent = this), semicolonToken && (semicolonToken.parent = this); - }; - TypeScript.ReturnStatementSyntax.prototype.kind = function () { - return 155 /* ReturnStatement */; - }; - TypeScript.SwitchStatementSyntax = function (data, switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken) { - if (data) { - this.__data = data; - } - this.switchKeyword = switchKeyword, this.openParenToken = openParenToken, this.expression = expression, this.closeParenToken = closeParenToken, this.openBraceToken = openBraceToken, this.switchClauses = switchClauses, this.closeBraceToken = closeBraceToken; - switchKeyword.parent = this, openParenToken.parent = this, expression.parent = this, closeParenToken.parent = this, openBraceToken.parent = this, switchClauses.parent = this, closeBraceToken.parent = this; - }; - TypeScript.SwitchStatementSyntax.prototype.kind = function () { - return 156 /* SwitchStatement */; - }; - TypeScript.BreakStatementSyntax = function (data, breakKeyword, identifier, semicolonToken) { - if (data) { - this.__data = data; - } - this.breakKeyword = breakKeyword, this.identifier = identifier, this.semicolonToken = semicolonToken; - breakKeyword.parent = this, identifier && (identifier.parent = this), semicolonToken && (semicolonToken.parent = this); - }; - TypeScript.BreakStatementSyntax.prototype.kind = function () { - return 157 /* BreakStatement */; - }; - TypeScript.ContinueStatementSyntax = function (data, continueKeyword, identifier, semicolonToken) { - if (data) { - this.__data = data; - } - this.continueKeyword = continueKeyword, this.identifier = identifier, this.semicolonToken = semicolonToken; - continueKeyword.parent = this, identifier && (identifier.parent = this), semicolonToken && (semicolonToken.parent = this); - }; - TypeScript.ContinueStatementSyntax.prototype.kind = function () { - return 158 /* ContinueStatement */; - }; - TypeScript.ForStatementSyntax = function (data, forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement) { - if (data) { - this.__data = data; - } - this.forKeyword = forKeyword, this.openParenToken = openParenToken, this.variableDeclaration = variableDeclaration, this.initializer = initializer, this.firstSemicolonToken = firstSemicolonToken, this.condition = condition, this.secondSemicolonToken = secondSemicolonToken, this.incrementor = incrementor, this.closeParenToken = closeParenToken, this.statement = statement; - forKeyword.parent = this, openParenToken.parent = this, variableDeclaration && (variableDeclaration.parent = this), initializer && (initializer.parent = this), firstSemicolonToken.parent = this, condition && (condition.parent = this), secondSemicolonToken.parent = this, incrementor && (incrementor.parent = this), closeParenToken.parent = this, statement.parent = this; - }; - TypeScript.ForStatementSyntax.prototype.kind = function () { - return 159 /* ForStatement */; - }; - TypeScript.ForInStatementSyntax = function (data, forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement) { - if (data) { - this.__data = data; - } - this.forKeyword = forKeyword, this.openParenToken = openParenToken, this.variableDeclaration = variableDeclaration, this.left = left, this.inKeyword = inKeyword, this.expression = expression, this.closeParenToken = closeParenToken, this.statement = statement; - forKeyword.parent = this, openParenToken.parent = this, variableDeclaration && (variableDeclaration.parent = this), left && (left.parent = this), inKeyword.parent = this, expression.parent = this, closeParenToken.parent = this, statement.parent = this; - }; - TypeScript.ForInStatementSyntax.prototype.kind = function () { - return 160 /* ForInStatement */; - }; - TypeScript.EmptyStatementSyntax = function (data, semicolonToken) { - if (data) { - this.__data = data; - } - this.semicolonToken = semicolonToken; - semicolonToken.parent = this; - }; - TypeScript.EmptyStatementSyntax.prototype.kind = function () { - return 161 /* EmptyStatement */; - }; - TypeScript.ThrowStatementSyntax = function (data, throwKeyword, expression, semicolonToken) { - if (data) { - this.__data = data; - } - this.throwKeyword = throwKeyword, this.expression = expression, this.semicolonToken = semicolonToken; - throwKeyword.parent = this, expression.parent = this, semicolonToken && (semicolonToken.parent = this); - }; - TypeScript.ThrowStatementSyntax.prototype.kind = function () { - return 162 /* ThrowStatement */; - }; - TypeScript.WhileStatementSyntax = function (data, whileKeyword, openParenToken, condition, closeParenToken, statement) { - if (data) { - this.__data = data; - } - this.whileKeyword = whileKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.statement = statement; - whileKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, statement.parent = this; - }; - TypeScript.WhileStatementSyntax.prototype.kind = function () { - return 163 /* WhileStatement */; - }; - TypeScript.TryStatementSyntax = function (data, tryKeyword, block, catchClause, finallyClause) { - if (data) { - this.__data = data; - } - this.tryKeyword = tryKeyword, this.block = block, this.catchClause = catchClause, this.finallyClause = finallyClause; - tryKeyword.parent = this, block.parent = this, catchClause && (catchClause.parent = this), finallyClause && (finallyClause.parent = this); - }; - TypeScript.TryStatementSyntax.prototype.kind = function () { - return 164 /* TryStatement */; - }; - TypeScript.LabeledStatementSyntax = function (data, identifier, colonToken, statement) { - if (data) { - this.__data = data; - } - this.identifier = identifier, this.colonToken = colonToken, this.statement = statement; - identifier.parent = this, colonToken.parent = this, statement.parent = this; - }; - TypeScript.LabeledStatementSyntax.prototype.kind = function () { - return 165 /* LabeledStatement */; - }; - TypeScript.DoStatementSyntax = function (data, doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken) { - if (data) { - this.__data = data; - } - this.doKeyword = doKeyword, this.statement = statement, this.whileKeyword = whileKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.semicolonToken = semicolonToken; - doKeyword.parent = this, statement.parent = this, whileKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, semicolonToken && (semicolonToken.parent = this); - }; - TypeScript.DoStatementSyntax.prototype.kind = function () { - return 166 /* DoStatement */; - }; - TypeScript.DebuggerStatementSyntax = function (data, debuggerKeyword, semicolonToken) { - if (data) { - this.__data = data; - } - this.debuggerKeyword = debuggerKeyword, this.semicolonToken = semicolonToken; - debuggerKeyword.parent = this, semicolonToken && (semicolonToken.parent = this); - }; - TypeScript.DebuggerStatementSyntax.prototype.kind = function () { - return 167 /* DebuggerStatement */; - }; - TypeScript.WithStatementSyntax = function (data, withKeyword, openParenToken, condition, closeParenToken, statement) { - if (data) { - this.__data = data; - } - this.withKeyword = withKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.statement = statement; - withKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, statement.parent = this; - }; - TypeScript.WithStatementSyntax.prototype.kind = function () { - return 168 /* WithStatement */; - }; - TypeScript.PrefixUnaryExpressionSyntax = function (data, operatorToken, operand) { - if (data) { - this.__data = data; - } - this.operatorToken = operatorToken, this.operand = operand; - operatorToken.parent = this, operand.parent = this; - }; - TypeScript.PrefixUnaryExpressionSyntax.prototype.kind = function () { - return 169 /* PrefixUnaryExpression */; - }; - TypeScript.DeleteExpressionSyntax = function (data, deleteKeyword, expression) { - if (data) { - this.__data = data; - } - this.deleteKeyword = deleteKeyword, this.expression = expression; - deleteKeyword.parent = this, expression.parent = this; - }; - TypeScript.DeleteExpressionSyntax.prototype.kind = function () { - return 170 /* DeleteExpression */; - }; - TypeScript.TypeOfExpressionSyntax = function (data, typeOfKeyword, expression) { - if (data) { - this.__data = data; - } - this.typeOfKeyword = typeOfKeyword, this.expression = expression; - typeOfKeyword.parent = this, expression.parent = this; - }; - TypeScript.TypeOfExpressionSyntax.prototype.kind = function () { - return 171 /* TypeOfExpression */; - }; - TypeScript.VoidExpressionSyntax = function (data, voidKeyword, expression) { - if (data) { - this.__data = data; - } - this.voidKeyword = voidKeyword, this.expression = expression; - voidKeyword.parent = this, expression.parent = this; - }; - TypeScript.VoidExpressionSyntax.prototype.kind = function () { - return 172 /* VoidExpression */; - }; - TypeScript.ConditionalExpressionSyntax = function (data, condition, questionToken, whenTrue, colonToken, whenFalse) { - if (data) { - this.__data = data; - } - this.condition = condition, this.questionToken = questionToken, this.whenTrue = whenTrue, this.colonToken = colonToken, this.whenFalse = whenFalse; - condition.parent = this, questionToken.parent = this, whenTrue.parent = this, colonToken.parent = this, whenFalse.parent = this; - }; - TypeScript.ConditionalExpressionSyntax.prototype.kind = function () { - return 173 /* ConditionalExpression */; - }; - TypeScript.BinaryExpressionSyntax = function (data, left, operatorToken, right) { - if (data) { - this.__data = data; - } - this.left = left, this.operatorToken = operatorToken, this.right = right; - left.parent = this, operatorToken.parent = this, right.parent = this; - }; - TypeScript.BinaryExpressionSyntax.prototype.kind = function () { - return 174 /* BinaryExpression */; - }; - TypeScript.PostfixUnaryExpressionSyntax = function (data, operand, operatorToken) { - if (data) { - this.__data = data; - } - this.operand = operand, this.operatorToken = operatorToken; - operand.parent = this, operatorToken.parent = this; - }; - TypeScript.PostfixUnaryExpressionSyntax.prototype.kind = function () { - return 175 /* PostfixUnaryExpression */; - }; - TypeScript.MemberAccessExpressionSyntax = function (data, expression, dotToken, name) { - if (data) { - this.__data = data; - } - this.expression = expression, this.dotToken = dotToken, this.name = name; - expression.parent = this, dotToken.parent = this, name.parent = this; - }; - TypeScript.MemberAccessExpressionSyntax.prototype.kind = function () { - return 176 /* MemberAccessExpression */; - }; - TypeScript.InvocationExpressionSyntax = function (data, expression, argumentList) { - if (data) { - this.__data = data; - } - this.expression = expression, this.argumentList = argumentList; - expression.parent = this, argumentList.parent = this; - }; - TypeScript.InvocationExpressionSyntax.prototype.kind = function () { - return 177 /* InvocationExpression */; - }; - TypeScript.ArrayLiteralExpressionSyntax = function (data, openBracketToken, expressions, closeBracketToken) { - if (data) { - this.__data = data; - } - this.openBracketToken = openBracketToken, this.expressions = expressions, this.closeBracketToken = closeBracketToken; - openBracketToken.parent = this, expressions.parent = this, closeBracketToken.parent = this; - }; - TypeScript.ArrayLiteralExpressionSyntax.prototype.kind = function () { - return 178 /* ArrayLiteralExpression */; - }; - TypeScript.ObjectLiteralExpressionSyntax = function (data, openBraceToken, propertyAssignments, closeBraceToken) { - if (data) { - this.__data = data; - } - this.openBraceToken = openBraceToken, this.propertyAssignments = propertyAssignments, this.closeBraceToken = closeBraceToken; - openBraceToken.parent = this, propertyAssignments.parent = this, closeBraceToken.parent = this; - }; - TypeScript.ObjectLiteralExpressionSyntax.prototype.kind = function () { - return 179 /* ObjectLiteralExpression */; - }; - TypeScript.ObjectCreationExpressionSyntax = function (data, newKeyword, expression, argumentList) { - if (data) { - this.__data = data; - } - this.newKeyword = newKeyword, this.expression = expression, this.argumentList = argumentList; - newKeyword.parent = this, expression.parent = this, argumentList && (argumentList.parent = this); - }; - TypeScript.ObjectCreationExpressionSyntax.prototype.kind = function () { - return 180 /* ObjectCreationExpression */; - }; - TypeScript.ParenthesizedExpressionSyntax = function (data, openParenToken, expression, closeParenToken) { - if (data) { - this.__data = data; - } - this.openParenToken = openParenToken, this.expression = expression, this.closeParenToken = closeParenToken; - openParenToken.parent = this, expression.parent = this, closeParenToken.parent = this; - }; - TypeScript.ParenthesizedExpressionSyntax.prototype.kind = function () { - return 181 /* ParenthesizedExpression */; - }; - TypeScript.ParenthesizedArrowFunctionExpressionSyntax = function (data, callSignature, equalsGreaterThanToken, block, expression) { - if (data) { - this.__data = data; - } - this.callSignature = callSignature, this.equalsGreaterThanToken = equalsGreaterThanToken, this.block = block, this.expression = expression; - callSignature.parent = this, equalsGreaterThanToken.parent = this, block && (block.parent = this), expression && (expression.parent = this); - }; - TypeScript.ParenthesizedArrowFunctionExpressionSyntax.prototype.kind = function () { - return 182 /* ParenthesizedArrowFunctionExpression */; - }; - TypeScript.SimpleArrowFunctionExpressionSyntax = function (data, parameter, equalsGreaterThanToken, block, expression) { - if (data) { - this.__data = data; - } - this.parameter = parameter, this.equalsGreaterThanToken = equalsGreaterThanToken, this.block = block, this.expression = expression; - parameter.parent = this, equalsGreaterThanToken.parent = this, block && (block.parent = this), expression && (expression.parent = this); - }; - TypeScript.SimpleArrowFunctionExpressionSyntax.prototype.kind = function () { - return 183 /* SimpleArrowFunctionExpression */; - }; - TypeScript.CastExpressionSyntax = function (data, lessThanToken, type, greaterThanToken, expression) { - if (data) { - this.__data = data; - } - this.lessThanToken = lessThanToken, this.type = type, this.greaterThanToken = greaterThanToken, this.expression = expression; - lessThanToken.parent = this, type.parent = this, greaterThanToken.parent = this, expression.parent = this; - }; - TypeScript.CastExpressionSyntax.prototype.kind = function () { - return 184 /* CastExpression */; - }; - TypeScript.ElementAccessExpressionSyntax = function (data, expression, openBracketToken, argumentExpression, closeBracketToken) { - if (data) { - this.__data = data; - } - this.expression = expression, this.openBracketToken = openBracketToken, this.argumentExpression = argumentExpression, this.closeBracketToken = closeBracketToken; - expression.parent = this, openBracketToken.parent = this, argumentExpression.parent = this, closeBracketToken.parent = this; - }; - TypeScript.ElementAccessExpressionSyntax.prototype.kind = function () { - return 185 /* ElementAccessExpression */; - }; - TypeScript.FunctionExpressionSyntax = function (data, functionKeyword, identifier, callSignature, block) { - if (data) { - this.__data = data; - } - this.functionKeyword = functionKeyword, this.identifier = identifier, this.callSignature = callSignature, this.block = block; - functionKeyword.parent = this, identifier && (identifier.parent = this), callSignature.parent = this, block.parent = this; - }; - TypeScript.FunctionExpressionSyntax.prototype.kind = function () { - return 186 /* FunctionExpression */; - }; - TypeScript.OmittedExpressionSyntax = function (data) { - if (data) { - this.__data = data; - } - }; - TypeScript.OmittedExpressionSyntax.prototype.kind = function () { - return 187 /* OmittedExpression */; - }; - TypeScript.TemplateExpressionSyntax = function (data, templateStartToken, templateClauses) { - if (data) { - this.__data = data; - } - this.templateStartToken = templateStartToken, this.templateClauses = templateClauses; - templateStartToken.parent = this, templateClauses.parent = this; - }; - TypeScript.TemplateExpressionSyntax.prototype.kind = function () { - return 188 /* TemplateExpression */; - }; - TypeScript.TemplateAccessExpressionSyntax = function (data, expression, templateExpression) { - if (data) { - this.__data = data; - } - this.expression = expression, this.templateExpression = templateExpression; - expression.parent = this, templateExpression.parent = this; - }; - TypeScript.TemplateAccessExpressionSyntax.prototype.kind = function () { - return 189 /* TemplateAccessExpression */; - }; - TypeScript.VariableDeclarationSyntax = function (data, varKeyword, variableDeclarators) { - if (data) { - this.__data = data; - } - this.varKeyword = varKeyword, this.variableDeclarators = variableDeclarators; - varKeyword.parent = this, variableDeclarators.parent = this; - }; - TypeScript.VariableDeclarationSyntax.prototype.kind = function () { - return 190 /* VariableDeclaration */; - }; - TypeScript.VariableDeclaratorSyntax = function (data, propertyName, typeAnnotation, equalsValueClause) { - if (data) { - this.__data = data; - } - this.propertyName = propertyName, this.typeAnnotation = typeAnnotation, this.equalsValueClause = equalsValueClause; - propertyName.parent = this, typeAnnotation && (typeAnnotation.parent = this), equalsValueClause && (equalsValueClause.parent = this); - }; - TypeScript.VariableDeclaratorSyntax.prototype.kind = function () { - return 191 /* VariableDeclarator */; - }; - TypeScript.ArgumentListSyntax = function (data, typeArgumentList, openParenToken, _arguments, closeParenToken) { - if (data) { - this.__data = data; - } - this.typeArgumentList = typeArgumentList, this.openParenToken = openParenToken, this.arguments = _arguments, this.closeParenToken = closeParenToken; - typeArgumentList && (typeArgumentList.parent = this), openParenToken.parent = this, _arguments.parent = this, closeParenToken.parent = this; - }; - TypeScript.ArgumentListSyntax.prototype.kind = function () { - return 192 /* ArgumentList */; - }; - TypeScript.ParameterListSyntax = function (data, openParenToken, parameters, closeParenToken) { - if (data) { - this.__data = data; - } - this.openParenToken = openParenToken, this.parameters = parameters, this.closeParenToken = closeParenToken; - openParenToken.parent = this, parameters.parent = this, closeParenToken.parent = this; - }; - TypeScript.ParameterListSyntax.prototype.kind = function () { - return 193 /* ParameterList */; - }; - TypeScript.TypeArgumentListSyntax = function (data, lessThanToken, typeArguments, greaterThanToken) { - if (data) { - this.__data = data; - } - this.lessThanToken = lessThanToken, this.typeArguments = typeArguments, this.greaterThanToken = greaterThanToken; - lessThanToken.parent = this, typeArguments.parent = this, greaterThanToken.parent = this; - }; - TypeScript.TypeArgumentListSyntax.prototype.kind = function () { - return 194 /* TypeArgumentList */; - }; - TypeScript.TypeParameterListSyntax = function (data, lessThanToken, typeParameters, greaterThanToken) { - if (data) { - this.__data = data; - } - this.lessThanToken = lessThanToken, this.typeParameters = typeParameters, this.greaterThanToken = greaterThanToken; - lessThanToken.parent = this, typeParameters.parent = this, greaterThanToken.parent = this; - }; - TypeScript.TypeParameterListSyntax.prototype.kind = function () { - return 195 /* TypeParameterList */; - }; - TypeScript.HeritageClauseSyntax = function (data, extendsOrImplementsKeyword, typeNames) { - if (data) { - this.__data = data; - } - this.extendsOrImplementsKeyword = extendsOrImplementsKeyword, this.typeNames = typeNames; - extendsOrImplementsKeyword.parent = this, typeNames.parent = this; - }; - TypeScript.HeritageClauseSyntax.prototype.kind = function () { - return 196 /* HeritageClause */; - }; - TypeScript.EqualsValueClauseSyntax = function (data, equalsToken, value) { - if (data) { - this.__data = data; - } - this.equalsToken = equalsToken, this.value = value; - equalsToken.parent = this, value.parent = this; - }; - TypeScript.EqualsValueClauseSyntax.prototype.kind = function () { - return 197 /* EqualsValueClause */; - }; - TypeScript.CaseSwitchClauseSyntax = function (data, caseKeyword, expression, colonToken, statements) { - if (data) { - this.__data = data; - } - this.caseKeyword = caseKeyword, this.expression = expression, this.colonToken = colonToken, this.statements = statements; - caseKeyword.parent = this, expression.parent = this, colonToken.parent = this, statements.parent = this; - }; - TypeScript.CaseSwitchClauseSyntax.prototype.kind = function () { - return 198 /* CaseSwitchClause */; - }; - TypeScript.DefaultSwitchClauseSyntax = function (data, defaultKeyword, colonToken, statements) { - if (data) { - this.__data = data; - } - this.defaultKeyword = defaultKeyword, this.colonToken = colonToken, this.statements = statements; - defaultKeyword.parent = this, colonToken.parent = this, statements.parent = this; - }; - TypeScript.DefaultSwitchClauseSyntax.prototype.kind = function () { - return 199 /* DefaultSwitchClause */; - }; - TypeScript.ElseClauseSyntax = function (data, elseKeyword, statement) { - if (data) { - this.__data = data; - } - this.elseKeyword = elseKeyword, this.statement = statement; - elseKeyword.parent = this, statement.parent = this; - }; - TypeScript.ElseClauseSyntax.prototype.kind = function () { - return 200 /* ElseClause */; - }; - TypeScript.CatchClauseSyntax = function (data, catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block) { - if (data) { - this.__data = data; - } - this.catchKeyword = catchKeyword, this.openParenToken = openParenToken, this.identifier = identifier, this.typeAnnotation = typeAnnotation, this.closeParenToken = closeParenToken, this.block = block; - catchKeyword.parent = this, openParenToken.parent = this, identifier.parent = this, typeAnnotation && (typeAnnotation.parent = this), closeParenToken.parent = this, block.parent = this; - }; - TypeScript.CatchClauseSyntax.prototype.kind = function () { - return 201 /* CatchClause */; - }; - TypeScript.FinallyClauseSyntax = function (data, finallyKeyword, block) { - if (data) { - this.__data = data; - } - this.finallyKeyword = finallyKeyword, this.block = block; - finallyKeyword.parent = this, block.parent = this; - }; - TypeScript.FinallyClauseSyntax.prototype.kind = function () { - return 202 /* FinallyClause */; - }; - TypeScript.TemplateClauseSyntax = function (data, expression, templateMiddleOrEndToken) { - if (data) { - this.__data = data; - } - this.expression = expression, this.templateMiddleOrEndToken = templateMiddleOrEndToken; - expression.parent = this, templateMiddleOrEndToken.parent = this; - }; - TypeScript.TemplateClauseSyntax.prototype.kind = function () { - return 203 /* TemplateClause */; - }; - TypeScript.TypeParameterSyntax = function (data, identifier, constraint) { - if (data) { - this.__data = data; - } - this.identifier = identifier, this.constraint = constraint; - identifier.parent = this, constraint && (constraint.parent = this); - }; - TypeScript.TypeParameterSyntax.prototype.kind = function () { - return 204 /* TypeParameter */; - }; - TypeScript.ConstraintSyntax = function (data, extendsKeyword, typeOrExpression) { - if (data) { - this.__data = data; - } - this.extendsKeyword = extendsKeyword, this.typeOrExpression = typeOrExpression; - extendsKeyword.parent = this, typeOrExpression.parent = this; - }; - TypeScript.ConstraintSyntax.prototype.kind = function () { - return 205 /* Constraint */; - }; - TypeScript.SimplePropertyAssignmentSyntax = function (data, propertyName, colonToken, expression) { - if (data) { - this.__data = data; - } - this.propertyName = propertyName, this.colonToken = colonToken, this.expression = expression; - propertyName.parent = this, colonToken.parent = this, expression.parent = this; - }; - TypeScript.SimplePropertyAssignmentSyntax.prototype.kind = function () { - return 206 /* SimplePropertyAssignment */; - }; - TypeScript.FunctionPropertyAssignmentSyntax = function (data, propertyName, callSignature, block) { - if (data) { - this.__data = data; - } - this.propertyName = propertyName, this.callSignature = callSignature, this.block = block; - propertyName.parent = this, callSignature.parent = this, block.parent = this; - }; - TypeScript.FunctionPropertyAssignmentSyntax.prototype.kind = function () { - return 207 /* FunctionPropertyAssignment */; - }; - TypeScript.ParameterSyntax = function (data, dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause) { - if (data) { - this.__data = data; - } - this.dotDotDotToken = dotDotDotToken, this.modifiers = modifiers, this.identifier = identifier, this.questionToken = questionToken, this.typeAnnotation = typeAnnotation, this.equalsValueClause = equalsValueClause; - dotDotDotToken && (dotDotDotToken.parent = this), modifiers.parent = this, identifier.parent = this, questionToken && (questionToken.parent = this), typeAnnotation && (typeAnnotation.parent = this), equalsValueClause && (equalsValueClause.parent = this); - }; - TypeScript.ParameterSyntax.prototype.kind = function () { - return 208 /* Parameter */; - }; - TypeScript.EnumElementSyntax = function (data, propertyName, equalsValueClause) { - if (data) { - this.__data = data; - } - this.propertyName = propertyName, this.equalsValueClause = equalsValueClause; - propertyName.parent = this, equalsValueClause && (equalsValueClause.parent = this); - }; - TypeScript.EnumElementSyntax.prototype.kind = function () { - return 209 /* EnumElement */; - }; - TypeScript.TypeAnnotationSyntax = function (data, colonToken, type) { - if (data) { - this.__data = data; - } - this.colonToken = colonToken, this.type = type; - colonToken.parent = this, type.parent = this; - }; - TypeScript.TypeAnnotationSyntax.prototype.kind = function () { - return 210 /* TypeAnnotation */; - }; - TypeScript.ExternalModuleReferenceSyntax = function (data, requireKeyword, openParenToken, stringLiteral, closeParenToken) { - if (data) { - this.__data = data; - } - this.requireKeyword = requireKeyword, this.openParenToken = openParenToken, this.stringLiteral = stringLiteral, this.closeParenToken = closeParenToken; - requireKeyword.parent = this, openParenToken.parent = this, stringLiteral.parent = this, closeParenToken.parent = this; - }; - TypeScript.ExternalModuleReferenceSyntax.prototype.kind = function () { - return 211 /* ExternalModuleReference */; - }; - TypeScript.ModuleNameModuleReferenceSyntax = function (data, moduleName) { - if (data) { - this.__data = data; - } - this.moduleName = moduleName; - moduleName.parent = this; - }; - TypeScript.ModuleNameModuleReferenceSyntax.prototype.kind = function () { - return 212 /* ModuleNameModuleReference */; - }; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.syntaxDiagnosticsTime = 0; - var SyntaxTree = (function () { - function SyntaxTree(sourceUnit, isDeclaration, diagnostics, fileName, text, languageVersion) { - this.text = text; - this._allDiagnostics = undefined; - this._sourceUnit = sourceUnit; - this._isDeclaration = isDeclaration; - this._parserDiagnostics = diagnostics; - this._fileName = fileName; - this._lineMap = text.lineMap(); - this._languageVersion = languageVersion; - sourceUnit.syntaxTree = this; - } - SyntaxTree.prototype.sourceUnit = function () { - return this._sourceUnit; - }; - SyntaxTree.prototype.isDeclaration = function () { - return this._isDeclaration; - }; - SyntaxTree.prototype.computeDiagnostics = function () { - if (this._parserDiagnostics.length > 0) { - return this._parserDiagnostics; - } - var diagnostics = []; - TypeScript.visitNodeOrToken(new GrammarCheckerWalker(this, diagnostics), this.sourceUnit()); - return diagnostics; - }; - SyntaxTree.prototype.diagnostics = function () { - if (!this._allDiagnostics) { - var start = new Date().getTime(); - this._allDiagnostics = this.computeDiagnostics(); - TypeScript.syntaxDiagnosticsTime += new Date().getTime() - start; - } - return this._allDiagnostics; - }; - SyntaxTree.prototype.fileName = function () { - return this._fileName; - }; - SyntaxTree.prototype.lineMap = function () { - return this._lineMap; - }; - SyntaxTree.prototype.languageVersion = function () { - return this._languageVersion; - }; - SyntaxTree.prototype.cacheSyntaxTreeInfo = function () { - var firstToken = firstSyntaxTreeToken(this); - var leadingTrivia = firstToken.leadingTrivia(this.text); - this._isExternalModule = !!externalModuleIndicatorSpanWorker(this, firstToken); - var amdDependencies = []; - for (var i = 0, n = leadingTrivia.count(); i < n; i++) { - var trivia = leadingTrivia.syntaxTriviaAt(i); - if (trivia.isComment()) { - var amdDependency = this.getAmdDependency(trivia.fullText()); - if (amdDependency) { - amdDependencies.push(amdDependency); - } - } - } - this._amdDependencies = amdDependencies; - }; - SyntaxTree.prototype.getAmdDependency = function (comment) { - var amdDependencyRegEx = /^\/\/\/\s* 0) { - var modifiers = parameter.modifiers; - for (var i = 0, n = modifiers.length; i < n; i++) { - var modifier = modifiers[i]; - if (this.checkParameterAccessibilityModifier(parameterList, modifier, i)) { - return true; - } - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkParameterAccessibilityModifier = function (parameterList, modifier, modifierIndex) { - if (!TypeScript.SyntaxFacts.isAccessibilityModifier(modifier.kind())) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_parameter, [modifier.text()]); - return true; - } - else { - if (modifierIndex > 0) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode.Accessibility_modifier_already_seen); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkForTrailingComma = function (list) { - if (list.length === 0 || list.length % 2 === 1) { - return false; - } - var child = list[list.length - 1]; - this.pushDiagnostic(child, TypeScript.DiagnosticCode.Trailing_comma_not_allowed); - return true; - }; - GrammarCheckerWalker.prototype.checkForAtLeastOneElement = function (list, reportToken, listKind) { - if (TypeScript.childCount(list) > 0) { - return false; - } - this.pushDiagnostic(reportToken, TypeScript.DiagnosticCode._0_list_cannot_be_empty, [listKind]); - return true; - }; - GrammarCheckerWalker.prototype.visitParameterList = function (node) { - if (this.checkParameterListAcessibilityModifiers(node) || this.checkParameterListOrder(node) || this.checkForTrailingComma(node.parameters)) { - return; - } - _super.prototype.visitParameterList.call(this, node); - }; - GrammarCheckerWalker.prototype.visitHeritageClause = function (node) { - if (this.checkForTrailingComma(node.typeNames) || this.checkForAtLeastOneElement(node.typeNames, node.extendsOrImplementsKeyword, TypeScript.SyntaxFacts.getText(node.extendsOrImplementsKeyword.kind()))) { - return; - } - _super.prototype.visitHeritageClause.call(this, node); - }; - GrammarCheckerWalker.prototype.visitArgumentList = function (node) { - if (this.checkForTrailingComma(node.arguments)) { - return; - } - _super.prototype.visitArgumentList.call(this, node); - }; - GrammarCheckerWalker.prototype.visitVariableDeclaration = function (node) { - if (this.checkForAtLeastOneElement(node.variableDeclarators, node.varKeyword, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.variable_declaration, undefined)) || this.checkForTrailingComma(node.variableDeclarators)) { - return; - } - _super.prototype.visitVariableDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.visitTypeArgumentList = function (node) { - if (this.checkForTrailingComma(node.typeArguments) || this.checkForAtLeastOneElement(node.typeArguments, node.lessThanToken, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_argument, undefined))) { - return; - } - _super.prototype.visitTypeArgumentList.call(this, node); - }; - GrammarCheckerWalker.prototype.visitTupleType = function (node) { - if (this.checkForTrailingComma(node.types) || this.checkForAtLeastOneElement(node.types, node.openBracketToken, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type, undefined))) { - return; - } - _super.prototype.visitTupleType.call(this, node); - }; - GrammarCheckerWalker.prototype.visitTypeParameterList = function (node) { - if (this.checkForTrailingComma(node.typeParameters) || this.checkForAtLeastOneElement(node.typeParameters, node.lessThanToken, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_parameter, undefined))) { - return; - } - _super.prototype.visitTypeParameterList.call(this, node); - }; - GrammarCheckerWalker.prototype.checkIndexSignatureParameter = function (node) { - if (node.parameters.length !== 1) { - this.pushDiagnostic(node.openBracketToken, TypeScript.DiagnosticCode.Index_signature_must_have_exactly_one_parameter); - return true; - } - var parameter = TypeScript.nonSeparatorAt(node.parameters, 0); - if (parameter.dotDotDotToken) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signatures_cannot_have_rest_parameters); - return true; - } - else if (parameter.modifiers.length > 0) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signature_parameter_cannot_have_accessibility_modifiers); - return true; - } - else if (parameter.questionToken) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signature_parameter_cannot_have_a_question_mark); - return true; - } - else if (parameter.equalsValueClause) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signature_parameter_cannot_have_an_initializer); - return true; - } - else if (!parameter.typeAnnotation) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signature_parameter_must_have_a_type_annotation); - return true; - } - else if (parameter.typeAnnotation.type.kind() !== 71 /* StringKeyword */ && parameter.typeAnnotation.type.kind() !== 69 /* NumberKeyword */) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signature_parameter_type_must_be_string_or_number); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitIndexSignature = function (node) { - if (this.checkIndexSignatureParameter(node)) { - return; - } - if (!node.typeAnnotation) { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Index_signature_must_have_a_type_annotation); - return; - } - _super.prototype.visitIndexSignature.call(this, node); - }; - GrammarCheckerWalker.prototype.checkClassDeclarationHeritageClauses = function (node) { - var seenExtendsClause = false; - var seenImplementsClause = false; - for (var i = 0, n = node.heritageClauses.length; i < n; i++) { - TypeScript.Debug.assert(i <= 2); - var heritageClause = node.heritageClauses[i]; - if (heritageClause.extendsOrImplementsKeyword.kind() === 50 /* ExtendsKeyword */) { - if (seenExtendsClause) { - this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.extends_clause_already_seen); - return true; - } - if (seenImplementsClause) { - this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.extends_clause_must_precede_implements_clause); - return true; - } - if (TypeScript.nonSeparatorCount(heritageClause.typeNames) > 1) { - this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.Classes_can_only_extend_a_single_class); - return true; - } - seenExtendsClause = true; - } - else { - TypeScript.Debug.assert(heritageClause.extendsOrImplementsKeyword.kind() === 53 /* ImplementsKeyword */); - if (seenImplementsClause) { - this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.implements_clause_already_seen); - return true; - } - seenImplementsClause = true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkForDisallowedDeclareModifier = function (modifiers) { - if (this.inAmbientDeclaration) { - var declareToken = TypeScript.SyntaxUtilities.getToken(modifiers, 65 /* DeclareKeyword */); - if (declareToken) { - this.pushDiagnostic(declareToken, TypeScript.DiagnosticCode.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkForRequiredDeclareModifier = function (moduleElement, reportToken, modifiers) { - if (!this.inAmbientDeclaration && this.syntaxTree.isDeclaration()) { - if (!TypeScript.SyntaxUtilities.containsToken(modifiers, 65 /* DeclareKeyword */)) { - this.pushDiagnostic(reportToken, TypeScript.DiagnosticCode.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); - return true; - } - } - }; - GrammarCheckerWalker.prototype.visitClassDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.identifier, node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkClassDeclarationHeritageClauses(node)) { - return; - } - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 65 /* DeclareKeyword */); - _super.prototype.visitClassDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.checkInterfaceDeclarationHeritageClauses = function (node) { - var seenExtendsClause = false; - for (var i = 0, n = node.heritageClauses.length; i < n; i++) { - TypeScript.Debug.assert(i <= 1); - var heritageClause = node.heritageClauses[i]; - if (heritageClause.extendsOrImplementsKeyword.kind() === 50 /* ExtendsKeyword */) { - if (seenExtendsClause) { - this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.extends_clause_already_seen); - return true; - } - seenExtendsClause = true; - } - else { - TypeScript.Debug.assert(heritageClause.extendsOrImplementsKeyword.kind() === 53 /* ImplementsKeyword */); - this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.Interface_declaration_cannot_have_implements_clause); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkInterfaceModifiers = function (modifiers) { - for (var i = 0, n = modifiers.length; i < n; i++) { - var modifier = modifiers[i]; - if (modifier.kind() === 65 /* DeclareKeyword */) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode.A_declare_modifier_cannot_be_used_with_an_interface_declaration); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitInterfaceDeclaration = function (node) { - if (this.checkInterfaceModifiers(node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkInterfaceDeclarationHeritageClauses(node)) { - return; - } - _super.prototype.visitInterfaceDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.checkClassElementModifiers = function (list) { - var seenAccessibilityModifier = false; - var seenStaticModifier = false; - for (var i = 0, n = list.length; i < n; i++) { - var modifier = list[i]; - if (TypeScript.SyntaxFacts.isAccessibilityModifier(modifier.kind())) { - if (seenAccessibilityModifier) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode.Accessibility_modifier_already_seen); - return true; - } - if (seenStaticModifier) { - var previousToken = list[i - 1]; - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_must_precede_1_modifier, [modifier.text(), previousToken.text()]); - return true; - } - seenAccessibilityModifier = true; - } - else if (modifier.kind() === 60 /* StaticKeyword */) { - if (seenStaticModifier) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_already_seen, [modifier.text()]); - return true; - } - seenStaticModifier = true; - } - else { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_class_element, [modifier.text()]); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitMemberVariableDeclaration = function (node) { - if (this.checkClassElementModifiers(node.modifiers)) { - return; - } - _super.prototype.visitMemberVariableDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.visitMethodSignature = function (node) { - if (this.checkForTemplatePropertyName(node.propertyName)) { - return; - } - _super.prototype.visitMethodSignature.call(this, node); - }; - GrammarCheckerWalker.prototype.visitPropertySignature = function (node) { - if (this.checkForTemplatePropertyName(node.propertyName)) { - return; - } - _super.prototype.visitPropertySignature.call(this, node); - }; - GrammarCheckerWalker.prototype.visitMemberFunctionDeclaration = function (node) { - if (this.checkClassElementModifiers(node.modifiers) || this.checkForTemplatePropertyName(node.propertyName)) { - return; - } - _super.prototype.visitMemberFunctionDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.checkGetAccessorParameter = function (node) { - if (node.callSignature.parameterList.parameters.length !== 0) { - this.pushDiagnostic(node.propertyName, TypeScript.DiagnosticCode.get_accessor_cannot_have_parameters); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitIndexMemberDeclaration = function (node) { - if (this.checkIndexMemberModifiers(node)) { - return; - } - _super.prototype.visitIndexMemberDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.checkIndexMemberModifiers = function (node) { - if (node.modifiers.length > 0) { - this.pushDiagnostic(node.modifiers[0], TypeScript.DiagnosticCode.Modifiers_cannot_appear_here); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkEcmaScriptVersionIsAtLeast = function (reportToken, languageVersion, diagnosticKey) { - if (this.syntaxTree.languageVersion() < languageVersion) { - this.pushDiagnostic(reportToken, diagnosticKey); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitObjectLiteralExpression = function (node) { - var savedInObjectLiteralExpression = this.inObjectLiteralExpression; - this.inObjectLiteralExpression = true; - _super.prototype.visitObjectLiteralExpression.call(this, node); - this.inObjectLiteralExpression = savedInObjectLiteralExpression; - }; - GrammarCheckerWalker.prototype.visitGetAccessor = function (node) { - if (this.checkForAccessorDeclarationInAmbientContext(node) || this.checkEcmaScriptVersionIsAtLeast(node.propertyName, 1 /* ES5 */, TypeScript.DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || this.checkForDisallowedModifiers(node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkForDisallowedAccessorTypeParameters(node.callSignature) || this.checkGetAccessorParameter(node) || this.checkForTemplatePropertyName(node.propertyName)) { - return; - } - _super.prototype.visitGetAccessor.call(this, node); - }; - GrammarCheckerWalker.prototype.checkForDisallowedSetAccessorTypeAnnotation = function (accessor) { - if (accessor.callSignature.typeAnnotation) { - this.pushDiagnostic(accessor.callSignature.typeAnnotation, TypeScript.DiagnosticCode.Type_annotation_cannot_appear_on_a_set_accessor); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkForDisallowedAccessorTypeParameters = function (callSignature) { - if (callSignature.typeParameterList) { - this.pushDiagnostic(callSignature.typeParameterList, TypeScript.DiagnosticCode.Type_parameters_cannot_appear_on_an_accessor); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkForAccessorDeclarationInAmbientContext = function (accessor) { - if (this.inAmbientDeclaration) { - this.pushDiagnostic(accessor, TypeScript.DiagnosticCode.Accessors_are_not_allowed_in_ambient_contexts); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkSetAccessorParameter = function (node) { - var parameters = node.callSignature.parameterList.parameters; - if (TypeScript.nonSeparatorCount(parameters) !== 1) { - this.pushDiagnostic(node.propertyName, TypeScript.DiagnosticCode.set_accessor_must_have_exactly_one_parameter); - return true; - } - var parameter = TypeScript.nonSeparatorAt(parameters, 0); - if (parameter.questionToken) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.set_accessor_parameter_cannot_be_optional); - return true; - } - if (parameter.equalsValueClause) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.set_accessor_parameter_cannot_have_an_initializer); - return true; - } - if (parameter.dotDotDotToken) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.set_accessor_cannot_have_rest_parameter); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitSimplePropertyAssignment = function (node) { - if (this.checkForTemplatePropertyName(node.propertyName)) { - return; - } - _super.prototype.visitSimplePropertyAssignment.call(this, node); - }; - GrammarCheckerWalker.prototype.visitSetAccessor = function (node) { - if (this.checkForAccessorDeclarationInAmbientContext(node) || this.checkEcmaScriptVersionIsAtLeast(node.propertyName, 1 /* ES5 */, TypeScript.DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || this.checkForDisallowedModifiers(node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkForDisallowedAccessorTypeParameters(node.callSignature) || this.checkForDisallowedSetAccessorTypeAnnotation(node) || this.checkSetAccessorParameter(node) || this.checkForTemplatePropertyName(node.propertyName)) { - return; - } - _super.prototype.visitSetAccessor.call(this, node); - }; - GrammarCheckerWalker.prototype.visitEnumDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.identifier, node.modifiers) || this.checkModuleElementModifiers(node.modifiers), this.checkEnumElements(node)) { - return; - } - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 65 /* DeclareKeyword */); - _super.prototype.visitEnumDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.checkEnumElements = function (node) { - var previousValueWasComputed = false; - for (var i = 0, n = TypeScript.nonSeparatorCount(node.enumElements); i < n; i++) { - var enumElement = TypeScript.nonSeparatorAt(node.enumElements, i); - if (!enumElement.equalsValueClause && previousValueWasComputed) { - this.pushDiagnostic(enumElement, TypeScript.DiagnosticCode.Enum_member_must_have_initializer); - return true; - } - if (enumElement.equalsValueClause) { - var value = enumElement.equalsValueClause.value; - previousValueWasComputed = !TypeScript.Syntax.isIntegerLiteral(value); - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitEnumElement = function (node) { - if (this.checkForTemplatePropertyName(node.propertyName)) { - return; - } - if (this.inAmbientDeclaration && node.equalsValueClause) { - var expression = node.equalsValueClause.value; - if (!TypeScript.Syntax.isIntegerLiteral(expression)) { - this.pushDiagnostic(node.equalsValueClause.value, TypeScript.DiagnosticCode.Ambient_enum_elements_can_only_have_integer_literal_initializers); - return; - } - } - _super.prototype.visitEnumElement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitInvocationExpression = function (node) { - if (node.expression.kind() === 52 /* SuperKeyword */ && node.argumentList.typeArgumentList) { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.super_invocation_cannot_have_type_arguments); - } - _super.prototype.visitInvocationExpression.call(this, node); - }; - GrammarCheckerWalker.prototype.checkModuleElementModifiers = function (modifiers) { - var seenExportModifier = false; - var seenDeclareModifier = false; - for (var i = 0, n = modifiers.length; i < n; i++) { - var modifier = modifiers[i]; - if (TypeScript.SyntaxFacts.isAccessibilityModifier(modifier.kind()) || modifier.kind() === 60 /* StaticKeyword */) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_module_element, [modifier.text()]); - return true; - } - if (modifier.kind() === 65 /* DeclareKeyword */) { - if (seenDeclareModifier) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode.Accessibility_modifier_already_seen); - return; - } - seenDeclareModifier = true; - } - else if (modifier.kind() === 49 /* ExportKeyword */) { - if (seenExportModifier) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_already_seen, [modifier.text()]); - return; - } - if (seenDeclareModifier) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_must_precede_1_modifier, [TypeScript.SyntaxFacts.getText(49 /* ExportKeyword */), TypeScript.SyntaxFacts.getText(65 /* DeclareKeyword */)]); - return; - } - seenExportModifier = true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkForDisallowedImportDeclaration = function (node) { - if (!node.stringLiteral) { - for (var i = 0, n = node.moduleElements.length; i < n; i++) { - var child = node.moduleElements[i]; - if (child.kind() === 138 /* ImportDeclaration */) { - var importDeclaration = child; - if (importDeclaration.moduleReference.kind() === 211 /* ExternalModuleReference */) { - this.pushDiagnostic(importDeclaration, TypeScript.DiagnosticCode.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); - } - } - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkForDisallowedDeclareModifierOnImportDeclaration = function (modifiers) { - var declareToken = TypeScript.SyntaxUtilities.getToken(modifiers, 65 /* DeclareKeyword */); - if (declareToken) { - this.pushDiagnostic(declareToken, TypeScript.DiagnosticCode.A_declare_modifier_cannot_be_used_with_an_import_declaration); - return true; - } - }; - GrammarCheckerWalker.prototype.visitImportDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifierOnImportDeclaration(node.modifiers) || this.checkModuleElementModifiers(node.modifiers)) { - return; - } - _super.prototype.visitImportDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.visitModuleDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.stringLiteral ? node.stringLiteral : TypeScript.firstToken(node.name), node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkForDisallowedImportDeclaration(node)) { - return; - } - if (node.stringLiteral) { - if (!this.inAmbientDeclaration && !TypeScript.SyntaxUtilities.containsToken(node.modifiers, 65 /* DeclareKeyword */)) { - this.pushDiagnostic(node.stringLiteral, TypeScript.DiagnosticCode.Only_ambient_modules_can_use_quoted_names); - return; - } - } - if (!node.stringLiteral && this.checkForDisallowedExportAssignment(node)) { - return; - } - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 65 /* DeclareKeyword */); - _super.prototype.visitModuleDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.checkForDisallowedExportAssignment = function (node) { - for (var i = 0, n = node.moduleElements.length; i < n; i++) { - var child = node.moduleElements[i]; - if (child.kind() === 139 /* ExportAssignment */) { - this.pushDiagnostic(child, TypeScript.DiagnosticCode.Export_assignment_cannot_be_used_in_internal_modules); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitBlock = function (node) { - if (this.checkForBlockInAmbientContext(node)) { - return; - } - var savedInBlock = this.inBlock; - this.inBlock = true; - _super.prototype.visitBlock.call(this, node); - this.inBlock = savedInBlock; - }; - GrammarCheckerWalker.prototype.checkForBlockInAmbientContext = function (node) { - if (this.inAmbientDeclaration || this.syntaxTree.isDeclaration()) { - if (node.parent.kind() === 1 /* List */) { - this.pushDiagnostic(TypeScript.firstToken(node), TypeScript.DiagnosticCode.Statements_are_not_allowed_in_ambient_contexts); - } - else { - this.pushDiagnostic(TypeScript.firstToken(node), TypeScript.DiagnosticCode.A_function_implementation_cannot_be_declared_in_an_ambient_context); - } - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkForStatementInAmbientContxt = function (node) { - if (this.inAmbientDeclaration || this.syntaxTree.isDeclaration()) { - this.pushDiagnostic(TypeScript.firstToken(node), TypeScript.DiagnosticCode.Statements_are_not_allowed_in_ambient_contexts); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitBreakStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkBreakStatementTarget(node)) { - return; - } - _super.prototype.visitBreakStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitContinueStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkContinueStatementTarget(node)) { - return; - } - _super.prototype.visitContinueStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.checkBreakStatementTarget = function (node) { - if (node.identifier) { - var breakableLabels = this.getEnclosingLabels(node, true, false); - if (!TypeScript.ArrayUtilities.any(breakableLabels, function (s) { return TypeScript.tokenValueText(s.identifier) === TypeScript.tokenValueText(node.identifier); })) { - var breakableLabels = this.getEnclosingLabels(node, true, true); - if (TypeScript.ArrayUtilities.any(breakableLabels, function (s) { return TypeScript.tokenValueText(s.identifier) === TypeScript.tokenValueText(node.identifier); })) { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary); - } - else { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Jump_target_not_found); - } - return true; - } - } - else if (!this.inIterationStatement(node, false) && !this.inSwitchStatement(node)) { - if (this.inIterationStatement(node, true)) { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary); - } - else { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement); - } - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.inSwitchStatement = function (ast) { - while (ast) { - if (ast.kind() === 156 /* SwitchStatement */) { - return true; - } - if (TypeScript.SyntaxUtilities.isAnyFunctionExpressionOrDeclaration(ast)) { - return false; - } - ast = ast.parent; - } - return false; - }; - GrammarCheckerWalker.prototype.isIterationStatement = function (ast) { - switch (ast.kind()) { - case 159 /* ForStatement */: - case 160 /* ForInStatement */: - case 163 /* WhileStatement */: - case 166 /* DoStatement */: - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.inIterationStatement = function (element, crossFunctions) { - while (element) { - if (this.isIterationStatement(element)) { - return true; - } - if (!crossFunctions && TypeScript.SyntaxUtilities.isAnyFunctionExpressionOrDeclaration(element)) { - return false; - } - element = element.parent; - } - return false; - }; - GrammarCheckerWalker.prototype.getEnclosingLabels = function (element, breakable, crossFunctions) { - var result = []; - element = element.parent; - while (element) { - if (element.kind() === 165 /* LabeledStatement */) { - var labeledStatement = element; - if (breakable) { - result.push(labeledStatement); - } - else { - if (this.labelIsOnContinuableConstruct(labeledStatement.statement)) { - result.push(labeledStatement); - } - } - } - if (!crossFunctions && TypeScript.SyntaxUtilities.isAnyFunctionExpressionOrDeclaration(element)) { - break; - } - element = element.parent; - } - return result; - }; - GrammarCheckerWalker.prototype.labelIsOnContinuableConstruct = function (statement) { - switch (statement.kind()) { - case 165 /* LabeledStatement */: - return this.labelIsOnContinuableConstruct(statement.statement); - case 163 /* WhileStatement */: - case 159 /* ForStatement */: - case 160 /* ForInStatement */: - case 166 /* DoStatement */: - return true; - default: - return false; - } - }; - GrammarCheckerWalker.prototype.checkContinueStatementTarget = function (node) { - if (!this.inIterationStatement(node, false)) { - if (this.inIterationStatement(node, true)) { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary); - } - else { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.continue_statement_can_only_be_used_within_an_enclosing_iteration_statement); - } - return true; - } - else if (node.identifier) { - var continuableLabels = this.getEnclosingLabels(node, false, false); - if (!TypeScript.ArrayUtilities.any(continuableLabels, function (s) { return TypeScript.tokenValueText(s.identifier) === TypeScript.tokenValueText(node.identifier); })) { - var continuableLabels = this.getEnclosingLabels(node, false, true); - if (TypeScript.ArrayUtilities.any(continuableLabels, function (s) { return TypeScript.tokenValueText(s.identifier) === TypeScript.tokenValueText(node.identifier); })) { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary); - } - else { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Jump_target_not_found); - } - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitDebuggerStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitDebuggerStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitDoStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitDoStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitEmptyStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitEmptyStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitExpressionStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitExpressionStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitForInStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkForInStatementVariableDeclaration(node) || this.checkForInLeftHandSideExpression(node)) { - return; - } - _super.prototype.visitForInStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.checkForInLeftHandSideExpression = function (node) { - if (node.left && !TypeScript.SyntaxUtilities.isLeftHandSizeExpression(node.left)) { - this.pushDiagnostic(node.left, TypeScript.DiagnosticCode.Invalid_left_hand_side_in_for_in_statement); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkForInStatementVariableDeclaration = function (node) { - if (node.variableDeclaration && node.variableDeclaration.variableDeclarators.length > 1) { - this.pushDiagnostic(node.variableDeclaration, TypeScript.DiagnosticCode.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitForStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitForStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitIfStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitIfStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitLabeledStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkForInvalidLabelIdentifier(node)) { - return; - } - _super.prototype.visitLabeledStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.checkForInvalidLabelIdentifier = function (node) { - var labelIdentifier = TypeScript.tokenValueText(node.identifier); - var breakableLabels = this.getEnclosingLabels(node, true, false); - var matchingLabel = TypeScript.ArrayUtilities.firstOrDefault(breakableLabels, function (s) { return TypeScript.tokenValueText(s.identifier) === labelIdentifier; }); - if (matchingLabel) { - this.pushDiagnostic(node.identifier, TypeScript.DiagnosticCode.Duplicate_identifier_0, [labelIdentifier]); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitReturnStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkForReturnStatementNotInFunctionBody(node)) { - return; - } - _super.prototype.visitReturnStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.checkForReturnStatementNotInFunctionBody = function (node) { - for (var element = node; element; element = element.parent) { - if (TypeScript.SyntaxUtilities.isAnyFunctionExpressionOrDeclaration(element)) { - return false; - } - } - this.pushDiagnostic(TypeScript.firstToken(node), TypeScript.DiagnosticCode.return_statement_must_be_contained_within_a_function_body); - return true; - }; - GrammarCheckerWalker.prototype.visitSwitchStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitSwitchStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitThrowStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitThrowStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitTryStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitTryStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitWhileStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitWhileStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitWithStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkForWithInStrictMode(node)) { - return; - } - _super.prototype.visitWithStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.checkForWithInStrictMode = function (node) { - if (TypeScript.parsedInStrictMode(node)) { - this.pushDiagnostic(TypeScript.firstToken(node), TypeScript.DiagnosticCode.with_statements_are_not_allowed_in_strict_mode); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkForDisallowedModifiers = function (modifiers) { - if (this.inBlock || this.inObjectLiteralExpression) { - if (modifiers.length > 0) { - this.pushDiagnostic(modifiers[0], TypeScript.DiagnosticCode.Modifiers_cannot_appear_here); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitFunctionDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForDisallowedModifiers(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.identifier, node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkForDisallowedEvalOrArguments(node, node.identifier)) { - return; - } - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 65 /* DeclareKeyword */); - _super.prototype.visitFunctionDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.visitFunctionExpression = function (node) { - if (this.checkForDisallowedEvalOrArguments(node, node.identifier)) { - return; - } - _super.prototype.visitFunctionExpression.call(this, node); - }; - GrammarCheckerWalker.prototype.visitFunctionPropertyAssignment = function (node) { - if (this.checkForTemplatePropertyName(node.propertyName)) { - return; - } - _super.prototype.visitFunctionPropertyAssignment.call(this, node); - }; - GrammarCheckerWalker.prototype.visitVariableStatement = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForDisallowedModifiers(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.variableDeclaration.varKeyword, node.modifiers) || this.checkModuleElementModifiers(node.modifiers)) { - return; - } - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 65 /* DeclareKeyword */); - _super.prototype.visitVariableStatement.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.checkListSeparators = function (list, kind) { - for (var i = 0, n = TypeScript.separatorCount(list); i < n; i++) { - var child = TypeScript.separatorAt(list, i); - if (child.kind() !== kind) { - this.pushDiagnostic(child, TypeScript.DiagnosticCode._0_expected, [TypeScript.SyntaxFacts.getText(kind)]); - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitObjectType = function (node) { - if (this.checkListSeparators(node.typeMembers, 80 /* SemicolonToken */)) { - return; - } - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitObjectType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.visitArrayType = function (node) { - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitArrayType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.visitFunctionType = function (node) { - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitFunctionType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.visitConstructorType = function (node) { - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitConstructorType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.visitVariableDeclarator = function (node) { - if (this.checkVariableDeclaratorInitializer(node) || this.checkVariableDeclaratorIdentifier(node) || this.checkForTemplatePropertyName(node.propertyName)) { - return; - } - _super.prototype.visitVariableDeclarator.call(this, node); - }; - GrammarCheckerWalker.prototype.checkForTemplatePropertyName = function (token) { - if (token.kind() === 13 /* NoSubstitutionTemplateToken */) { - this.pushDiagnostic(token, TypeScript.DiagnosticCode.Template_literal_cannot_be_used_as_an_element_name); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkVariableDeclaratorIdentifier = function (node) { - if (node.parent.kind() !== 141 /* MemberVariableDeclaration */) { - if (this.checkForDisallowedEvalOrArguments(node, node.propertyName)) { - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkVariableDeclaratorInitializer = function (node) { - if (this.inAmbientDeclaration && node.equalsValueClause) { - this.pushDiagnostic(TypeScript.firstToken(node.equalsValueClause.value), TypeScript.DiagnosticCode.Initializers_are_not_allowed_in_ambient_contexts); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitConstructorDeclaration = function (node) { - if (this.checkClassElementModifiers(node.modifiers) || this.checkConstructorModifiers(node.modifiers) || this.checkConstructorTypeParameterList(node) || this.checkConstructorTypeAnnotation(node)) { - return; - } - _super.prototype.visitConstructorDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.checkConstructorModifiers = function (modifiers) { - for (var i = 0, n = modifiers.length; i < n; i++) { - var child = modifiers[i]; - if (child.kind() !== 59 /* PublicKeyword */) { - this.pushDiagnostic(child, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_constructor_declaration, [TypeScript.SyntaxFacts.getText(child.kind())]); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkConstructorTypeParameterList = function (node) { - if (node.callSignature.typeParameterList) { - this.pushDiagnostic(node.callSignature.typeParameterList, TypeScript.DiagnosticCode.Type_parameters_cannot_appear_on_a_constructor_declaration); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkConstructorTypeAnnotation = function (node) { - if (node.callSignature.typeAnnotation) { - this.pushDiagnostic(node.callSignature.typeAnnotation, TypeScript.DiagnosticCode.Type_annotation_cannot_appear_on_a_constructor_declaration); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitBinaryExpression = function (node) { - if (this.checkIllegalAssignment(node)) { - return; - } - _super.prototype.visitBinaryExpression.call(this, node); - }; - GrammarCheckerWalker.prototype.visitPrefixUnaryExpression = function (node) { - if (TypeScript.parsedInStrictMode(node) && this.isPreIncrementOrDecrementExpression(node) && this.isEvalOrArguments(node.operand)) { - this.pushDiagnostic(node.operatorToken, TypeScript.DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(node.operand)]); - } - _super.prototype.visitPrefixUnaryExpression.call(this, node); - }; - GrammarCheckerWalker.prototype.visitPostfixUnaryExpression = function (node) { - if (TypeScript.parsedInStrictMode(node) && this.isEvalOrArguments(node.operand)) { - this.pushDiagnostic(node.operatorToken, TypeScript.DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(node.operand)]); - } - _super.prototype.visitPostfixUnaryExpression.call(this, node); - }; - GrammarCheckerWalker.prototype.visitParameter = function (node) { - if (this.checkForDisallowedEvalOrArguments(node, node.identifier)) { - return; - } - _super.prototype.visitParameter.call(this, node); - }; - GrammarCheckerWalker.prototype.checkForDisallowedEvalOrArguments = function (node, token) { - if (token) { - if (TypeScript.parsedInStrictMode(node) && this.isEvalOrArguments(token)) { - this.pushDiagnostic(token, TypeScript.DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(token)]); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.isPreIncrementOrDecrementExpression = function (node) { - switch (node.operatorToken.kind()) { - case 96 /* MinusMinusToken */: - case 95 /* PlusPlusToken */: - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitDeleteExpression = function (node) { - if (TypeScript.parsedInStrictMode(node) && node.expression.kind() === 9 /* IdentifierName */) { - this.pushDiagnostic(TypeScript.firstToken(node), TypeScript.DiagnosticCode.delete_cannot_be_called_on_an_identifier_in_strict_mode); - return; - } - _super.prototype.visitDeleteExpression.call(this, node); - }; - GrammarCheckerWalker.prototype.checkIllegalAssignment = function (node) { - if (TypeScript.parsedInStrictMode(node) && TypeScript.SyntaxFacts.isAssignmentOperatorToken(node.operatorToken.kind()) && this.isEvalOrArguments(node.left)) { - this.pushDiagnostic(node.operatorToken, TypeScript.DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(node.left)]); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.getEvalOrArguments = function (expr) { - if (expr.kind() === 9 /* IdentifierName */) { - var text = TypeScript.tokenValueText(expr); - if (text === "eval" || text === "arguments") { - return text; - } - } - return undefined; - }; - GrammarCheckerWalker.prototype.isEvalOrArguments = function (expr) { - return !!this.getEvalOrArguments(expr); - }; - GrammarCheckerWalker.prototype.visitConstraint = function (node) { - if (this.checkConstraintType(node)) { - return; - } - _super.prototype.visitConstraint.call(this, node); - }; - GrammarCheckerWalker.prototype.checkConstraintType = function (node) { - if (!TypeScript.SyntaxFacts.isType(node.typeOrExpression.kind())) { - this.pushDiagnostic(node.typeOrExpression, TypeScript.DiagnosticCode.Type_expected); - return true; - } - return false; - }; - return GrammarCheckerWalker; - })(TypeScript.SyntaxWalker); - function firstSyntaxTreeToken(syntaxTree) { - var scanner = TypeScript.Scanner.createScanner(syntaxTree.languageVersion(), syntaxTree.text, function () { - }); - return scanner.scan(false); - } - function externalModuleIndicatorSpan(syntaxTree) { - var firstToken = firstSyntaxTreeToken(syntaxTree); - return externalModuleIndicatorSpanWorker(syntaxTree, firstToken); - } - TypeScript.externalModuleIndicatorSpan = externalModuleIndicatorSpan; - function externalModuleIndicatorSpanWorker(syntaxTree, firstToken) { - var leadingTrivia = firstToken.leadingTrivia(syntaxTree.text); - return implicitImportSpan(leadingTrivia) || topLevelImportOrExportSpan(syntaxTree.sourceUnit()); - } - TypeScript.externalModuleIndicatorSpanWorker = externalModuleIndicatorSpanWorker; - function implicitImportSpan(sourceUnitLeadingTrivia) { - for (var i = 0, n = sourceUnitLeadingTrivia.count(); i < n; i++) { - var trivia = sourceUnitLeadingTrivia.syntaxTriviaAt(i); - if (trivia.isComment()) { - var span = implicitImportSpanWorker(trivia); - if (span) { - return span; - } - } - } - return undefined; - } - function implicitImportSpanWorker(trivia) { - var implicitImportRegEx = /^(\/\/\/\s*/gim; - var match = implicitImportRegEx.exec(trivia.fullText()); - if (match) { - return new TypeScript.TextSpan(trivia.fullStart(), trivia.fullWidth()); - } - return undefined; - } - function topLevelImportOrExportSpan(node) { - for (var i = 0, n = node.moduleElements.length; i < n; i++) { - var moduleElement = node.moduleElements[i]; - var _firstToken = TypeScript.firstToken(moduleElement); - if (_firstToken && _firstToken.kind() === 49 /* ExportKeyword */) { - return new TypeScript.TextSpan(TypeScript.start(_firstToken), TypeScript.width(_firstToken)); - } - if (moduleElement.kind() === 138 /* ImportDeclaration */) { - var importDecl = moduleElement; - if (importDecl.moduleReference.kind() === 211 /* ExternalModuleReference */) { - var literal = importDecl.moduleReference.stringLiteral; - return new TypeScript.TextSpan(TypeScript.start(literal), TypeScript.width(literal)); - } - } - } - return undefined; - } -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Unicode = (function () { - function Unicode() { - } - Unicode.lookupInUnicodeMap = function (code, map) { - if (code < map[0]) { - return false; - } - var lo = 0; - var hi = map.length; - var mid; - while (lo + 1 < hi) { - mid = lo + (hi - lo) / 2; - mid -= mid % 2; - if (map[mid] <= code && code <= map[mid + 1]) { - return true; - } - if (code < map[mid]) { - hi = mid; - } - else { - lo = mid + 2; - } - } - return false; - }; - Unicode.isIdentifierStart = function (code, languageVersion) { - if (languageVersion === 0 /* ES3 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES3IdentifierStart); - } - else if (languageVersion >= 1 /* ES5 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES5IdentifierStart); - } - else { - throw TypeScript.Errors.argumentOutOfRange("languageVersion"); - } - }; - Unicode.isIdentifierPart = function (code, languageVersion) { - if (languageVersion === 0 /* ES3 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES3IdentifierPart); - } - else if (languageVersion >= 1 /* ES5 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES5IdentifierPart); - } - else { - throw TypeScript.Errors.argumentOutOfRange("languageVersion"); - } - }; - Unicode.unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - Unicode.unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - Unicode.unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - Unicode.unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - return Unicode; - })(); - TypeScript.Unicode = Unicode; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var IncrementalParser; - (function (IncrementalParser) { - function createParserSource(oldSyntaxTree, textChangeRange, text) { - var fileName = oldSyntaxTree.fileName(); - var languageVersion = oldSyntaxTree.languageVersion(); - var _scannerParserSource; - var _changeRange; - var _changeRangeNewSpan; - var _changeDelta = 0; - var _oldSourceUnitCursor = getSyntaxCursor(); - var oldSourceUnit = oldSyntaxTree.sourceUnit(); - var _outstandingRewindPointCount = 0; - if (oldSourceUnit.moduleElements.length > 0) { - _oldSourceUnitCursor.pushElement(TypeScript.childAt(oldSourceUnit.moduleElements, 0), 0); - } - _changeRange = extendToAffectedRange(textChangeRange, oldSourceUnit); - _changeRangeNewSpan = _changeRange.newSpan(); - if (TypeScript.Debug.shouldAssert(2 /* Aggressive */)) { - TypeScript.Debug.assert((TypeScript.fullWidth(oldSourceUnit) - _changeRange.span().length() + _changeRange.newLength()) === text.length()); - } - _scannerParserSource = TypeScript.Scanner.createParserSource(oldSyntaxTree.fileName(), text, oldSyntaxTree.languageVersion()); - function release() { - _scannerParserSource.release(); - _scannerParserSource = undefined; - _oldSourceUnitCursor = undefined; - _outstandingRewindPointCount = 0; - } - function extendToAffectedRange(changeRange, sourceUnit) { - var maxLookahead = 1; - var start = changeRange.span().start(); - for (var i = 0; start > 0 && i <= maxLookahead; i++) { - var token = TypeScript.findToken(sourceUnit, start); - var position = token.fullStart(); - start = Math.max(0, position - 1); - } - var finalSpan = TypeScript.TextSpan.fromBounds(start, changeRange.span().end()); - var finalLength = changeRange.newLength() + (changeRange.span().start() - start); - return new TypeScript.TextChangeRange(finalSpan, finalLength); - } - function absolutePosition() { - return _scannerParserSource.absolutePosition(); - } - function tokenDiagnostics() { - return _scannerParserSource.tokenDiagnostics(); - } - function getRewindPoint() { - var rewindPoint = _scannerParserSource.getRewindPoint(); - var oldSourceUnitCursorClone = cloneSyntaxCursor(_oldSourceUnitCursor); - rewindPoint.changeDelta = _changeDelta; - rewindPoint.changeRange = _changeRange; - rewindPoint.oldSourceUnitCursor = _oldSourceUnitCursor; - _oldSourceUnitCursor = oldSourceUnitCursorClone; - _outstandingRewindPointCount++; - return rewindPoint; - } - function rewind(rewindPoint) { - _changeRange = rewindPoint.changeRange; - _changeDelta = rewindPoint.changeDelta; - returnSyntaxCursor(_oldSourceUnitCursor); - _oldSourceUnitCursor = rewindPoint.oldSourceUnitCursor; - rewindPoint.oldSourceUnitCursor = undefined; - _scannerParserSource.rewind(rewindPoint); - } - function releaseRewindPoint(rewindPoint) { - if (rewindPoint.oldSourceUnitCursor) { - returnSyntaxCursor(rewindPoint.oldSourceUnitCursor); - } - _scannerParserSource.releaseRewindPoint(rewindPoint); - _outstandingRewindPointCount--; - TypeScript.Debug.assert(_outstandingRewindPointCount >= 0); - } - function isPinned() { - return _outstandingRewindPointCount > 0; - } - function canReadFromOldSourceUnit() { - if (isPinned()) { - return false; - } - if (_changeRange && _changeRangeNewSpan.intersectsWithPosition(absolutePosition())) { - return false; - } - syncCursorToNewTextIfBehind(); - return _changeDelta === 0 && !_oldSourceUnitCursor.isFinished(); - } - function updateTokens(nodeOrToken) { - if (isPastChangeRange()) { - var position = absolutePosition(); - if (TypeScript.isToken(nodeOrToken)) { - nodeOrToken.setFullStart(position); - } - else { - var tokens = getTokens(nodeOrToken); - for (var i = 0, n = tokens.length; i < n; i++) { - var token = tokens[i]; - token.setFullStart(position); - position += token.fullWidth(); - } - } - } - } - function getTokens(node) { - var tokens = node.__cachedTokens; - if (!tokens) { - tokens = []; - tokenCollectorWalker.tokens = tokens; - TypeScript.visitNodeOrToken(tokenCollectorWalker, node); - node.__cachedTokens = tokens; - tokenCollectorWalker.tokens = undefined; - } - return tokens; - } - function currentNode() { - if (canReadFromOldSourceUnit()) { - var node = tryGetNodeFromOldSourceUnit(); - if (node) { - updateTokens(node); - return node; - } - } - return undefined; - } - function currentToken() { - if (canReadFromOldSourceUnit()) { - var token = tryGetTokenFromOldSourceUnit(); - if (token) { - updateTokens(token); - return token; - } - } - return _scannerParserSource.currentToken(); - } - function currentContextualToken() { - return _scannerParserSource.currentContextualToken(); - } - function syncCursorToNewTextIfBehind() { - while (true) { - if (_oldSourceUnitCursor.isFinished()) { - break; - } - if (_changeDelta >= 0) { - break; - } - var currentNodeOrToken = _oldSourceUnitCursor.currentNodeOrToken(); - if (TypeScript.isNode(currentNodeOrToken) && (TypeScript.fullWidth(currentNodeOrToken) > Math.abs(_changeDelta))) { - _oldSourceUnitCursor.moveToFirstChild(); - } - else { - _oldSourceUnitCursor.moveToNextSibling(); - _changeDelta += TypeScript.fullWidth(currentNodeOrToken); - } - } - } - function intersectsWithChangeRangeSpanInOriginalText(start, length) { - return !isPastChangeRange() && _changeRange.span().intersectsWith(start, length); - } - function tryGetNodeFromOldSourceUnit() { - while (true) { - var node = _oldSourceUnitCursor.currentNode(); - if (node === undefined) { - return undefined; - } - if (!intersectsWithChangeRangeSpanInOriginalText(absolutePosition(), TypeScript.fullWidth(node))) { - var isIncrementallyUnusuable = TypeScript.isIncrementallyUnusable(node); - if (!isIncrementallyUnusuable) { - return node; - } - } - _oldSourceUnitCursor.moveToFirstChild(); - } - } - function canReuseTokenFromOldSourceUnit(position, token) { - if (token) { - if (!intersectsWithChangeRangeSpanInOriginalText(position, token.fullWidth())) { - if (!token.isIncrementallyUnusable() && !TypeScript.Scanner.isContextualToken(token)) { - return true; - } - } - } - return false; - } - function tryGetTokenFromOldSourceUnit() { - var token = _oldSourceUnitCursor.currentToken(); - return canReuseTokenFromOldSourceUnit(absolutePosition(), token) ? token : undefined; - } - function peekToken(n) { - if (canReadFromOldSourceUnit()) { - var token = tryPeekTokenFromOldSourceUnit(n); - if (token) { - return token; - } - } - return _scannerParserSource.peekToken(n); - } - function tryPeekTokenFromOldSourceUnit(n) { - var cursorClone = cloneSyntaxCursor(_oldSourceUnitCursor); - var token = tryPeekTokenFromOldSourceUnitWorker(n); - returnSyntaxCursor(_oldSourceUnitCursor); - _oldSourceUnitCursor = cursorClone; - return token; - } - function tryPeekTokenFromOldSourceUnitWorker(n) { - var currentPosition = absolutePosition(); - _oldSourceUnitCursor.moveToFirstToken(); - for (var i = 0; i < n; i++) { - var interimToken = _oldSourceUnitCursor.currentToken(); - if (!canReuseTokenFromOldSourceUnit(currentPosition, interimToken)) { - return undefined; - } - currentPosition += interimToken.fullWidth(); - _oldSourceUnitCursor.moveToNextSibling(); - } - var token = _oldSourceUnitCursor.currentToken(); - return canReuseTokenFromOldSourceUnit(currentPosition, token) ? token : undefined; - } - function consumeNode(node) { - _oldSourceUnitCursor.moveToNextSibling(); - var _absolutePosition = absolutePosition() + TypeScript.fullWidth(node); - _scannerParserSource.resetToPosition(_absolutePosition); - } - function consumeToken(currentToken) { - if (_oldSourceUnitCursor.currentToken() === currentToken) { - _oldSourceUnitCursor.moveToNextSibling(); - var _absolutePosition = absolutePosition() + currentToken.fullWidth(); - _scannerParserSource.resetToPosition(_absolutePosition); - } - else { - _changeDelta -= currentToken.fullWidth(); - _scannerParserSource.consumeToken(currentToken); - if (!isPastChangeRange()) { - if (absolutePosition() >= _changeRangeNewSpan.end()) { - _changeDelta += _changeRange.newLength() - _changeRange.span().length(); - _changeRange = undefined; - } - } - } - } - function isPastChangeRange() { - return _changeRange === undefined; - } - return { - text: text, - fileName: fileName, - languageVersion: languageVersion, - currentNode: currentNode, - currentToken: currentToken, - currentContextualToken: currentContextualToken, - peekToken: peekToken, - consumeNode: consumeNode, - consumeToken: consumeToken, - getRewindPoint: getRewindPoint, - rewind: rewind, - releaseRewindPoint: releaseRewindPoint, - tokenDiagnostics: tokenDiagnostics, - release: release - }; - } - function createSyntaxCursorPiece(element, indexInParent) { - return { element: element, indexInParent: indexInParent }; - } - var syntaxCursorPool = []; - var syntaxCursorPoolCount = 0; - function returnSyntaxCursor(cursor) { - cursor.clean(); - syntaxCursorPool[syntaxCursorPoolCount] = cursor; - syntaxCursorPoolCount++; - } - function getSyntaxCursor() { - var cursor = syntaxCursorPoolCount > 0 ? syntaxCursorPool[syntaxCursorPoolCount - 1] : createSyntaxCursor(); - if (syntaxCursorPoolCount > 0) { - syntaxCursorPoolCount--; - syntaxCursorPool[syntaxCursorPoolCount] = undefined; - } - return cursor; - } - function cloneSyntaxCursor(cursor) { - var newCursor = getSyntaxCursor(); - newCursor.deepCopyFrom(cursor); - return newCursor; - } - function createSyntaxCursor() { - var pieces = []; - var currentPieceIndex = -1; - function clean() { - for (var i = 0, n = pieces.length; i < n; i++) { - var piece = pieces[i]; - if (piece.element === undefined) { - break; - } - piece.element = undefined; - piece.indexInParent = -1; - } - currentPieceIndex = -1; - } - function deepCopyFrom(other) { - for (var i = 0, n = other.pieces.length; i < n; i++) { - var piece = other.pieces[i]; - if (piece.element === undefined) { - break; - } - pushElement(piece.element, piece.indexInParent); - } - } - function isFinished() { - return currentPieceIndex < 0; - } - function currentNodeOrToken() { - if (isFinished()) { - return undefined; - } - var result = pieces[currentPieceIndex].element; - return result; - } - function currentNode() { - var element = currentNodeOrToken(); - return TypeScript.isNode(element) ? element : undefined; - } - function isEmptyList(element) { - return TypeScript.isList(element) && element.length === 0; - } - function moveToFirstChild() { - var nodeOrToken = currentNodeOrToken(); - if (nodeOrToken === undefined) { - return; - } - if (TypeScript.isToken(nodeOrToken)) { - return; - } - for (var i = 0, n = TypeScript.childCount(nodeOrToken); i < n; i++) { - var child = TypeScript.childAt(nodeOrToken, i); - if (child && !isEmptyList(child)) { - pushElement(child, i); - moveToFirstChildIfList(); - return; - } - } - moveToNextSibling(); - } - function moveToNextSibling() { - while (!isFinished()) { - var currentPiece = pieces[currentPieceIndex]; - var parent = currentPiece.element.parent; - for (var i = currentPiece.indexInParent + 1, n = TypeScript.childCount(parent); i < n; i++) { - var sibling = TypeScript.childAt(parent, i); - if (sibling && !isEmptyList(sibling)) { - currentPiece.element = sibling; - currentPiece.indexInParent = i; - moveToFirstChildIfList(); - return; - } - } - currentPiece.element = undefined; - currentPiece.indexInParent = -1; - currentPieceIndex--; - } - } - function moveToFirstChildIfList() { - var element = pieces[currentPieceIndex].element; - if (TypeScript.isList(element)) { - pushElement(TypeScript.childAt(element, 0), 0); - } - } - function pushElement(element, indexInParent) { - currentPieceIndex++; - if (currentPieceIndex === pieces.length) { - pieces.push(createSyntaxCursorPiece(element, indexInParent)); - } - else { - var piece = pieces[currentPieceIndex]; - piece.element = element; - piece.indexInParent = indexInParent; - } - } - function moveToFirstToken() { - while (!isFinished()) { - var element = pieces[currentPieceIndex].element; - if (TypeScript.isNode(element)) { - moveToFirstChild(); - continue; - } - return; - } - } - function currentToken() { - moveToFirstToken(); - var element = currentNodeOrToken(); - return element; - } - return { - pieces: pieces, - clean: clean, - isFinished: isFinished, - moveToFirstChild: moveToFirstChild, - moveToFirstToken: moveToFirstToken, - moveToNextSibling: moveToNextSibling, - currentNodeOrToken: currentNodeOrToken, - currentNode: currentNode, - currentToken: currentToken, - pushElement: pushElement, - deepCopyFrom: deepCopyFrom - }; - } - var TokenCollectorWalker = (function (_super) { - __extends(TokenCollectorWalker, _super); - function TokenCollectorWalker() { - _super.apply(this, arguments); - this.tokens = []; - } - TokenCollectorWalker.prototype.visitToken = function (token) { - this.tokens.push(token); - }; - return TokenCollectorWalker; - })(TypeScript.SyntaxWalker); - var tokenCollectorWalker = new TokenCollectorWalker(); - function parse(oldSyntaxTree, textChangeRange, newText) { - if (textChangeRange.isUnchanged()) { - return oldSyntaxTree; - } - return TypeScript.Parser.parseSource(createParserSource(oldSyntaxTree, textChangeRange, newText), oldSyntaxTree.isDeclaration()); - } - IncrementalParser.parse = parse; - })(IncrementalParser = TypeScript.IncrementalParser || (TypeScript.IncrementalParser = {})); -})(TypeScript || (TypeScript = {})); + ts.TextChangeRange = TextChangeRange; +})(ts || (ts = {})); var ts; (function (ts) { var OutliningElementsCollector; @@ -28119,8 +16508,8 @@ var ts; function addOutliningSpan(hintSpanNode, startElement, endElement, autoCollapse) { if (hintSpanNode && startElement && endElement) { var span = { - textSpan: TypeScript.TextSpan.fromBounds(startElement.pos, endElement.end), - hintSpan: TypeScript.TextSpan.fromBounds(hintSpanNode.getStart(), hintSpanNode.end), + textSpan: ts.TextSpan.fromBounds(startElement.pos, endElement.end), + hintSpan: ts.TextSpan.fromBounds(hintSpanNode.getStart(), hintSpanNode.end), bannerText: collapseText, autoCollapse: autoCollapse }; @@ -28129,10 +16518,10 @@ var ts; } function autoCollapse(node) { switch (node.kind) { - case 189 /* ModuleBlock */: - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: - case 187 /* EnumDeclaration */: + case 192 /* ModuleBlock */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: return false; } return true; @@ -28144,15 +16533,15 @@ var ts; return; } switch (n.kind) { - case 158 /* Block */: + case 161 /* Block */: var parent = n.parent; var openBrace = ts.findChildOfKind(n, 13 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 14 /* CloseBraceToken */, sourceFile); - if (parent.kind === 163 /* DoStatement */ || parent.kind === 166 /* ForInStatement */ || parent.kind === 165 /* ForStatement */ || parent.kind === 162 /* IfStatement */ || parent.kind === 164 /* WhileStatement */ || parent.kind === 170 /* WithStatement */) { + if (parent.kind === 166 /* DoStatement */ || parent.kind === 169 /* ForInStatement */ || parent.kind === 168 /* ForStatement */ || parent.kind === 165 /* IfStatement */ || parent.kind === 167 /* WhileStatement */ || parent.kind === 173 /* WithStatement */) { addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); } else { - var span = TypeScript.TextSpan.fromBounds(n.getStart(), n.end); + var span = ts.TextSpan.fromBounds(n.getStart(), n.end); elements.push({ textSpan: span, hintSpan: span, @@ -28161,25 +16550,25 @@ var ts; }); } break; - case 183 /* FunctionBlock */: - case 189 /* ModuleBlock */: - case 177 /* TryBlock */: - case 178 /* CatchBlock */: - case 179 /* FinallyBlock */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: var openBrace = ts.findChildOfKind(n, 13 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 14 /* CloseBraceToken */, sourceFile); addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); break; - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: - case 187 /* EnumDeclaration */: - case 140 /* ObjectLiteral */: - case 171 /* SwitchStatement */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: + case 142 /* ObjectLiteral */: + case 174 /* SwitchStatement */: var openBrace = ts.findChildOfKind(n, 13 /* OpenBraceToken */, sourceFile); var closeBrace = ts.findChildOfKind(n, 14 /* CloseBraceToken */, sourceFile); addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); break; - case 139 /* ArrayLiteral */: + case 141 /* ArrayLiteral */: var openBracket = ts.findChildOfKind(n, 17 /* OpenBracketToken */, sourceFile); var closeBracket = ts.findChildOfKind(n, 18 /* CloseBracketToken */, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); @@ -28207,14 +16596,14 @@ var ts; var current = node.parent; while (current) { switch (current.kind) { - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: do { current = current.parent; - } while (current.kind === 188 /* ModuleDeclaration */); - case 184 /* ClassDeclaration */: - case 187 /* EnumDeclaration */: - case 185 /* InterfaceDeclaration */: - case 182 /* FunctionDeclaration */: + } while (current.kind === 191 /* ModuleDeclaration */); + case 187 /* ClassDeclaration */: + case 190 /* EnumDeclaration */: + case 188 /* InterfaceDeclaration */: + case 185 /* FunctionDeclaration */: indent++; } current = current.parent; @@ -28225,10 +16614,10 @@ var ts; var childNodes = []; for (var i = 0, n = nodes.length; i < n; i++) { var node = nodes[i]; - if (node.kind === 184 /* ClassDeclaration */ || node.kind === 187 /* EnumDeclaration */ || node.kind === 185 /* InterfaceDeclaration */ || node.kind === 188 /* ModuleDeclaration */ || node.kind === 182 /* FunctionDeclaration */) { + if (node.kind === 187 /* ClassDeclaration */ || node.kind === 190 /* EnumDeclaration */ || node.kind === 188 /* InterfaceDeclaration */ || node.kind === 191 /* ModuleDeclaration */ || node.kind === 185 /* FunctionDeclaration */) { childNodes.push(node); } - else if (node.kind === 159 /* VariableStatement */) { + else if (node.kind === 162 /* VariableStatement */) { childNodes.push.apply(childNodes, node.declarations); } } @@ -28249,7 +16638,7 @@ var ts; return 1; } else if (n2.name) { - -1; + return -1; } else { return n1.kind - n2.kind; @@ -28261,17 +16650,17 @@ var ts; for (var i = 0, n = nodes.length; i < n; i++) { var node = nodes[i]; switch (node.kind) { - case 184 /* ClassDeclaration */: - case 187 /* EnumDeclaration */: - case 185 /* InterfaceDeclaration */: + case 187 /* ClassDeclaration */: + case 190 /* EnumDeclaration */: + case 188 /* InterfaceDeclaration */: topLevelNodes.push(node); break; - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: var moduleDeclaration = node; topLevelNodes.push(node); addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); break; - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); @@ -28282,12 +16671,12 @@ var ts; } } function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 182 /* FunctionDeclaration */) { - if (functionDeclaration.body && functionDeclaration.body.kind === 183 /* FunctionBlock */) { - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 182 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { + if (functionDeclaration.kind === 185 /* FunctionDeclaration */) { + if (functionDeclaration.body && functionDeclaration.body.kind === 186 /* FunctionBlock */) { + if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 185 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { return true; } - if (functionDeclaration.parent.kind !== 183 /* FunctionBlock */) { + if (functionDeclaration.parent.kind !== 186 /* FunctionBlock */) { return true; } } @@ -28350,7 +16739,7 @@ var ts; return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); case 131 /* IndexSignature */: return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 192 /* EnumMember */: + case 195 /* EnumMember */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); case 129 /* CallSignature */: return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); @@ -28358,9 +16747,9 @@ var ts; return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); case 124 /* Property */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: if (node.flags & 4096 /* Const */) { return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.constantElement); } @@ -28397,17 +16786,17 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 193 /* SourceFile */: + case 196 /* SourceFile */: return createSourceFileItem(node); - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: return createClassItem(node); - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: return createEnumItem(node); - case 185 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: return createIterfaceItem(node); - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return createModuleItem(node); - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: return createFunctionItem(node); } return undefined; @@ -28417,7 +16806,7 @@ var ts; } var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 188 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 191 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -28429,7 +16818,7 @@ var ts; return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } function createFunctionItem(node) { - if (node.name && node.body && node.body.kind === 183 /* FunctionBlock */) { + if (node.name && node.body && node.body.kind === 186 /* FunctionBlock */) { var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); return getNavigationBarItem(node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); } @@ -28450,7 +16839,7 @@ var ts; var constructor = ts.forEach(node.members, function (member) { return member.kind === 126 /* Constructor */ && member; }); - var nodes = constructor ? constructor.parameters.concat(node.members) : node.members; + var nodes = constructor ? node.members.concat(constructor.parameters) : node.members; var childItems = getItemsWorker(sortNodes(nodes), createChildItem); } return getNavigationBarItem(node.name.text, ts.ScriptElementKind.classElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); @@ -28465,13 +16854,13 @@ var ts; } } function getInnermostModule(node) { - while (node.body.kind === 188 /* ModuleDeclaration */) { + while (node.body.kind === 191 /* ModuleDeclaration */) { node = node.body; } return node; } function getNodeSpan(node) { - return node.kind === 193 /* SourceFile */ ? TypeScript.TextSpan.fromBounds(node.getFullStart(), node.getEnd()) : TypeScript.TextSpan.fromBounds(node.getStart(), node.getEnd()); + return node.kind === 196 /* SourceFile */ ? ts.TextSpan.fromBounds(node.getFullStart(), node.getEnd()) : ts.TextSpan.fromBounds(node.getStart(), node.getEnd()); } function getTextOfNode(node) { return ts.getTextOfNodeFromSourceText(sourceFile.text, node); @@ -28480,106 +16869,6 @@ var ts; NavigationBar.getNavigationBarItems = getNavigationBarItems; })(NavigationBar = ts.NavigationBar || (ts.NavigationBar = {})); })(ts || (ts = {})); -var TypeScript; -(function (TypeScript) { - var Indentation; - (function (Indentation) { - function columnForEndOfTokenAtPosition(syntaxTree, position, options) { - var token = TypeScript.findToken(syntaxTree.sourceUnit(), position); - return columnForStartOfTokenAtPosition(syntaxTree, position, options) + TypeScript.width(token); - } - Indentation.columnForEndOfTokenAtPosition = columnForEndOfTokenAtPosition; - function columnForStartOfTokenAtPosition(syntaxTree, position, options) { - var token = TypeScript.findToken(syntaxTree.sourceUnit(), position); - var firstTokenInLine = TypeScript.Syntax.firstTokenInLineContainingPosition(syntaxTree, token.fullStart()); - var leadingTextInReverse = []; - var current = token; - while (current !== firstTokenInLine) { - current = TypeScript.previousToken(current); - if (current === firstTokenInLine) { - leadingTextInReverse.push(current.trailingTrivia().fullText()); - leadingTextInReverse.push(current.text()); - } - else { - leadingTextInReverse.push(current.fullText()); - } - } - collectLeadingTriviaTextToStartOfLine(firstTokenInLine, leadingTextInReverse); - return columnForLeadingTextInReverse(leadingTextInReverse, options); - } - Indentation.columnForStartOfTokenAtPosition = columnForStartOfTokenAtPosition; - function columnForStartOfFirstTokenInLineContainingPosition(syntaxTree, position, options) { - var firstTokenInLine = TypeScript.Syntax.firstTokenInLineContainingPosition(syntaxTree, position); - var leadingTextInReverse = []; - collectLeadingTriviaTextToStartOfLine(firstTokenInLine, leadingTextInReverse); - return columnForLeadingTextInReverse(leadingTextInReverse, options); - } - Indentation.columnForStartOfFirstTokenInLineContainingPosition = columnForStartOfFirstTokenInLineContainingPosition; - function collectLeadingTriviaTextToStartOfLine(firstTokenInLine, leadingTextInReverse) { - var leadingTrivia = firstTokenInLine.leadingTrivia(); - for (var i = leadingTrivia.count() - 1; i >= 0; i--) { - var trivia = leadingTrivia.syntaxTriviaAt(i); - if (trivia.kind() === 3 /* NewLineTrivia */) { - break; - } - if (trivia.kind() === 4 /* MultiLineCommentTrivia */) { - var lineSegments = TypeScript.Syntax.splitMultiLineCommentTriviaIntoMultipleLines(trivia); - leadingTextInReverse.push(TypeScript.ArrayUtilities.last(lineSegments)); - if (lineSegments.length > 0) { - break; - } - } - leadingTextInReverse.push(trivia.fullText()); - } - } - function columnForLeadingTextInReverse(leadingTextInReverse, options) { - var column = 0; - for (var i = leadingTextInReverse.length - 1; i >= 0; i--) { - var text = leadingTextInReverse[i]; - column = columnForPositionInStringWorker(text, text.length, column, options); - } - return column; - } - function columnForPositionInString(input, position, options) { - return columnForPositionInStringWorker(input, position, 0, options); - } - Indentation.columnForPositionInString = columnForPositionInString; - function columnForPositionInStringWorker(input, position, startColumn, options) { - var column = startColumn; - var spacesPerTab = options.spacesPerTab; - for (var j = 0; j < position; j++) { - var ch = input.charCodeAt(j); - if (ch === 9 /* tab */) { - column += spacesPerTab - column % spacesPerTab; - } - else { - column++; - } - } - return column; - } - function indentationString(column, options) { - var numberOfTabs = 0; - var numberOfSpaces = Math.max(0, column); - if (options.useTabs) { - numberOfTabs = Math.floor(column / options.spacesPerTab); - numberOfSpaces -= numberOfTabs * options.spacesPerTab; - } - return TypeScript.StringUtilities.repeat('\t', numberOfTabs) + TypeScript.StringUtilities.repeat(' ', numberOfSpaces); - } - Indentation.indentationString = indentationString; - function firstNonWhitespacePosition(value) { - for (var i = 0; i < value.length; i++) { - var ch = value.charCodeAt(i); - if (!TypeScript.CharacterInfo.isWhitespace(ch)) { - return i; - } - } - return value.length; - } - Indentation.firstNonWhitespacePosition = firstNonWhitespacePosition; - })(Indentation = TypeScript.Indentation || (TypeScript.Indentation = {})); -})(TypeScript || (TypeScript = {})); var ts; (function (ts) { var SignatureHelp; @@ -28604,7 +16893,7 @@ var ts; } return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); function getImmediatelyContainingArgumentInfo(node) { - if (node.parent.kind !== 144 /* CallExpression */ && node.parent.kind !== 145 /* NewExpression */) { + if (node.parent.kind !== 147 /* CallExpression */ && node.parent.kind !== 148 /* NewExpression */) { return undefined; } var parent = node.parent; @@ -28619,8 +16908,8 @@ var ts; return ts.findListItemInfo(node); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 193 /* SourceFile */; n = n.parent) { - if (n.kind === 183 /* FunctionBlock */) { + for (var n = node; n.kind !== 196 /* SourceFile */; n = n.parent) { + if (n.kind === 186 /* FunctionBlock */) { return undefined; } if (n.pos < n.parent.pos || n.end > n.parent.end) { @@ -28664,33 +16953,33 @@ var ts; var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeInfoResolver, callTargetSymbol, undefined, undefined); var items = ts.map(candidates, function (candidateSignature) { var signatureHelpParameters; - var prefixParts = []; - var suffixParts = []; + var prefixDisplayParts = []; + var suffixDisplayParts = []; if (callTargetDisplayParts) { - prefixParts.push.apply(prefixParts, callTargetDisplayParts); + prefixDisplayParts.push.apply(prefixDisplayParts, callTargetDisplayParts); } if (isTypeParameterHelp) { - prefixParts.push(ts.punctuationPart(23 /* LessThanToken */)); + prefixDisplayParts.push(ts.punctuationPart(23 /* LessThanToken */)); var typeParameters = candidateSignature.typeParameters; signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray; - suffixParts.push(ts.punctuationPart(24 /* GreaterThanToken */)); + suffixDisplayParts.push(ts.punctuationPart(24 /* GreaterThanToken */)); var parameterParts = ts.mapToDisplayParts(function (writer) { return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, argumentListOrTypeArgumentList); }); - suffixParts.push.apply(suffixParts, parameterParts); + suffixDisplayParts.push.apply(suffixDisplayParts, parameterParts); } else { var typeParameterParts = ts.mapToDisplayParts(function (writer) { return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, argumentListOrTypeArgumentList); }); - prefixParts.push.apply(prefixParts, typeParameterParts); - prefixParts.push(ts.punctuationPart(15 /* OpenParenToken */)); + prefixDisplayParts.push.apply(prefixDisplayParts, typeParameterParts); + prefixDisplayParts.push(ts.punctuationPart(15 /* OpenParenToken */)); var parameters = candidateSignature.parameters; signatureHelpParameters = parameters.length > 0 ? ts.map(parameters, createSignatureHelpParameterForParameter) : emptyArray; - suffixParts.push(ts.punctuationPart(16 /* CloseParenToken */)); + suffixDisplayParts.push(ts.punctuationPart(16 /* CloseParenToken */)); } var returnTypeParts = ts.mapToDisplayParts(function (writer) { return typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, argumentListOrTypeArgumentList); }); - suffixParts.push.apply(suffixParts, returnTypeParts); + suffixDisplayParts.push.apply(suffixDisplayParts, returnTypeParts); return { isVariadic: candidateSignature.hasRestParameter, - prefixDisplayParts: prefixParts, - suffixDisplayParts: suffixParts, + prefixDisplayParts: prefixDisplayParts, + suffixDisplayParts: suffixDisplayParts, separatorDisplayParts: [ts.punctuationPart(22 /* CommaToken */), ts.spacePart()], parameters: signatureHelpParameters, documentation: candidateSignature.getDocumentationComment() @@ -28698,7 +16987,7 @@ var ts; }); var applicableSpanStart = argumentListOrTypeArgumentList.getFullStart(); var applicableSpanEnd = ts.skipTrivia(sourceFile.text, argumentListOrTypeArgumentList.end, false); - var applicableSpan = new TypeScript.TextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); + var applicableSpan = new ts.TextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); var argumentIndex = (argumentInfoOrTypeArgumentInfo.listItemIndex + 1) >> 1; var argumentCount = argumentListOrTypeArgumentList.getChildCount() === 0 ? 0 : 1 + ts.countWhere(argumentListOrTypeArgumentList.getChildren(), function (arg) { return arg.kind === 22 /* CommaToken */; }); var selectedItemIndex = candidates.indexOf(bestSignature); @@ -28738,16 +17027,67 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + function getEndLinePosition(line, sourceFile) { + ts.Debug.assert(line >= 1); + var lineStarts = sourceFile.getLineStarts(); + var lineIndex = line - 1; + if (lineIndex === lineStarts.length - 1) { + return sourceFile.text.length - 1; + } + else { + var start = lineStarts[lineIndex]; + var pos = lineStarts[lineIndex + 1] - 1; + ts.Debug.assert(ts.isLineBreak(sourceFile.text.charCodeAt(pos))); + while (start <= pos && ts.isLineBreak(sourceFile.text.charCodeAt(pos))) { + pos--; + } + return pos; + } + } + ts.getEndLinePosition = getEndLinePosition; + function getStartPositionOfLine(line, sourceFile) { + ts.Debug.assert(line >= 1); + return sourceFile.getLineStarts()[line - 1]; + } + ts.getStartPositionOfLine = getStartPositionOfLine; + function getStartLinePositionForPosition(position, sourceFile) { + var lineStarts = sourceFile.getLineStarts(); + var line = sourceFile.getLineAndCharacterFromPosition(position).line; + return lineStarts[line - 1]; + } + ts.getStartLinePositionForPosition = getStartLinePositionForPosition; + function rangeContainsRange(r1, r2) { + return startEndContainsRange(r1.pos, r1.end, r2); + } + ts.rangeContainsRange = rangeContainsRange; + function startEndContainsRange(start, end, range) { + return start <= range.pos && end >= range.end; + } + ts.startEndContainsRange = startEndContainsRange; + function rangeContainsStartEnd(range, start, end) { + return range.pos <= start && range.end >= end; + } + ts.rangeContainsStartEnd = rangeContainsStartEnd; + function rangeOverlapsWithStartEnd(r1, start, end) { + return startEndOverlapsWithStartEnd(r1.pos, r1.end, start, end); + } + ts.rangeOverlapsWithStartEnd = rangeOverlapsWithStartEnd; + function startEndOverlapsWithStartEnd(start1, end1, start2, end2) { + var start = Math.max(start1, start2); + var end = Math.min(end1, end2); + return start < end; + } + ts.startEndOverlapsWithStartEnd = startEndOverlapsWithStartEnd; function findListItemInfo(node) { - var syntaxList = findContainingList(node); - if (!syntaxList) { + var list = findContainingList(node); + if (!list) { return undefined; } - var children = syntaxList.getChildren(); - var index = ts.indexOf(children, node); + var children = list.getChildren(); + var listItemIndex = ts.indexOf(children, node); return { - listItemIndex: index, - list: syntaxList + listItemIndex: listItemIndex, + list: list }; } ts.findListItemInfo = findListItemInfo; @@ -28757,7 +17097,7 @@ var ts; ts.findChildOfKind = findChildOfKind; function findContainingList(node) { var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { - if (c.kind === 195 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { + if (c.kind === 198 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { return c; } }); @@ -28765,7 +17105,7 @@ var ts; } ts.findContainingList = findContainingList; function findListItemIndexContainingPosition(list, position) { - ts.Debug.assert(list.kind === 195 /* SyntaxList */); + ts.Debug.assert(list.kind === 198 /* SyntaxList */); var children = list.getChildren(); for (var i = 0; i < children.length; i++) { if (children[i].pos <= position && children[i].end > position) { @@ -28776,11 +17116,11 @@ var ts; } ts.findListItemIndexContainingPosition = findListItemIndexContainingPosition; function getTouchingWord(sourceFile, position) { - return getTouchingToken(sourceFile, position, isWord); + return getTouchingToken(sourceFile, position, function (n) { return isWord(n.kind); }); } ts.getTouchingWord = getTouchingWord; function getTouchingPropertyName(sourceFile, position) { - return getTouchingToken(sourceFile, position, isPropertyName); + return getTouchingToken(sourceFile, position, function (n) { return isPropertyName(n.kind); }); } ts.getTouchingPropertyName = getTouchingPropertyName; function getTouchingToken(sourceFile, position, includeItemAtEndPosition) { @@ -28872,7 +17212,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 193 /* SourceFile */); + ts.Debug.assert(startNode !== undefined || n.kind === 196 /* SourceFile */); if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, children.length); return candidate && findRightmostToken(candidate); @@ -28888,19 +17228,16 @@ var ts; } ts.findPrecedingToken = findPrecedingToken; function nodeHasTokens(n) { - if (n.kind === 161 /* ExpressionStatement */) { - return nodeHasTokens(n.expression); - } - if (n.kind === 1 /* EndOfFileToken */ || n.kind === 157 /* OmittedExpression */ || n.kind === 120 /* Missing */) { + if (n.kind === 0 /* Unknown */) { return false; } - return n.kind !== 195 /* SyntaxList */ || n.getChildCount() !== 0; + return n.getWidth() !== 0; } function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 132 /* TypeReference */ || node.kind === 144 /* CallExpression */) { + if (node.kind === 132 /* TypeReference */ || node.kind === 147 /* CallExpression */) { return node.typeArguments; } - if (ts.isAnyFunction(node) || node.kind === 184 /* ClassDeclaration */ || node.kind === 185 /* InterfaceDeclaration */) { + if (ts.isAnyFunction(node) || node.kind === 187 /* ClassDeclaration */ || node.kind === 188 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -28910,1885 +17247,21 @@ var ts; return n.kind >= 1 /* FirstToken */ && n.kind <= 119 /* LastToken */; } ts.isToken = isToken; - function isWord(n) { - return n.kind === 63 /* Identifier */ || ts.isKeyword(n.kind); + function isWord(kind) { + return kind === 63 /* Identifier */ || ts.isKeyword(kind); } - function isPropertyName(n) { - return n.kind === 7 /* StringLiteral */ || n.kind === 6 /* NumericLiteral */ || isWord(n); + function isPropertyName(kind) { + return kind === 7 /* StringLiteral */ || kind === 6 /* NumericLiteral */ || isWord(kind); } - function isComment(n) { - return n.kind === 2 /* SingleLineCommentTrivia */ || n.kind === 3 /* MultiLineCommentTrivia */; + function isComment(kind) { + return kind === 2 /* SingleLineCommentTrivia */ || kind === 3 /* MultiLineCommentTrivia */; } ts.isComment = isComment; - function isPunctuation(n) { - return 13 /* FirstPunctuation */ <= n.kind && n.kind <= 62 /* LastPunctuation */; + function isPunctuation(kind) { + return 13 /* FirstPunctuation */ <= kind && kind <= 62 /* LastPunctuation */; } ts.isPunctuation = isPunctuation; })(ts || (ts = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var TextSnapshot = (function () { - function TextSnapshot(snapshot) { - this.snapshot = snapshot; - this.lines = []; - } - TextSnapshot.prototype.getLength = function () { - return this.snapshot.length(); - }; - TextSnapshot.prototype.getText = function (span) { - return this.snapshot.substr(span.start(), span.length()); - }; - TextSnapshot.prototype.getLineNumberFromPosition = function (position) { - return this.snapshot.lineMap().getLineNumberFromPosition(position); - }; - TextSnapshot.prototype.getLineFromPosition = function (position) { - var lineNumber = this.getLineNumberFromPosition(position); - return this.getLineFromLineNumber(lineNumber); - }; - TextSnapshot.prototype.getLineFromLineNumber = function (lineNumber) { - var line = this.lines[lineNumber]; - if (line === undefined) { - line = this.getLineFromLineNumberWorker(lineNumber); - this.lines[lineNumber] = line; - } - return line; - }; - TextSnapshot.prototype.getLineFromLineNumberWorker = function (lineNumber) { - var lineMap = this.snapshot.lineMap().lineStarts(); - var lineMapIndex = lineNumber; - if (lineMapIndex < 0 || lineMapIndex >= lineMap.length) - throw new Error(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Invalid_line_number_0, [lineMapIndex])); - var start = lineMap[lineMapIndex]; - var end; - var endIncludingLineBreak; - var lineBreak = ""; - if (lineMapIndex == lineMap.length) { - end = endIncludingLineBreak = this.snapshot.length(); - } - else { - endIncludingLineBreak = (lineMapIndex >= lineMap.length - 1 ? this.snapshot.length() : lineMap[lineMapIndex + 1]); - for (var p = endIncludingLineBreak - 1; p >= start; p--) { - var c = this.snapshot.substr(p, 1); - if (c != "\r" && c != "\n") { - break; - } - } - end = p + 1; - lineBreak = this.snapshot.substr(end, endIncludingLineBreak - end); - } - var result = new Formatting.TextSnapshotLine(this, lineNumber, start, end, lineBreak); - return result; - }; - return TextSnapshot; - })(); - Formatting.TextSnapshot = TextSnapshot; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var TextSnapshotLine = (function () { - function TextSnapshotLine(_snapshot, _lineNumber, _start, _end, _lineBreak) { - this._snapshot = _snapshot; - this._lineNumber = _lineNumber; - this._start = _start; - this._end = _end; - this._lineBreak = _lineBreak; - } - TextSnapshotLine.prototype.snapshot = function () { - return this._snapshot; - }; - TextSnapshotLine.prototype.start = function () { - return new Formatting.SnapshotPoint(this._snapshot, this._start); - }; - TextSnapshotLine.prototype.startPosition = function () { - return this._start; - }; - TextSnapshotLine.prototype.end = function () { - return new Formatting.SnapshotPoint(this._snapshot, this._end); - }; - TextSnapshotLine.prototype.endPosition = function () { - return this._end; - }; - TextSnapshotLine.prototype.endIncludingLineBreak = function () { - return new Formatting.SnapshotPoint(this._snapshot, this._end + this._lineBreak.length); - }; - TextSnapshotLine.prototype.endIncludingLineBreakPosition = function () { - return this._end + this._lineBreak.length; - }; - TextSnapshotLine.prototype.length = function () { - return this._end - this._start; - }; - TextSnapshotLine.prototype.lineNumber = function () { - return this._lineNumber; - }; - TextSnapshotLine.prototype.getText = function () { - return this._snapshot.getText(TypeScript.TextSpan.fromBounds(this._start, this._end)); - }; - return TextSnapshotLine; - })(); - Formatting.TextSnapshotLine = TextSnapshotLine; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var SnapshotPoint = (function () { - function SnapshotPoint(snapshot, position) { - this.snapshot = snapshot; - this.position = position; - } - SnapshotPoint.prototype.getContainingLine = function () { - return this.snapshot.getLineFromPosition(this.position); - }; - SnapshotPoint.prototype.add = function (offset) { - return new SnapshotPoint(this.snapshot, this.position + offset); - }; - return SnapshotPoint; - })(); - Formatting.SnapshotPoint = SnapshotPoint; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var FormattingContext = (function () { - function FormattingContext(snapshot, formattingRequestKind) { - this.snapshot = snapshot; - this.formattingRequestKind = formattingRequestKind; - this.currentTokenSpan = null; - this.nextTokenSpan = null; - this.contextNode = null; - this.currentTokenParent = null; - this.nextTokenParent = null; - this.contextNodeAllOnSameLine = null; - this.nextNodeAllOnSameLine = null; - this.tokensAreOnSameLine = null; - this.contextNodeBlockIsOnOneLine = null; - this.nextNodeBlockIsOnOneLine = null; - TypeScript.Debug.assert(this.snapshot != null, "snapshot is null"); - } - FormattingContext.prototype.updateContext = function (currentTokenSpan, currentTokenParent, nextTokenSpan, nextTokenParent, commonParent) { - TypeScript.Debug.assert(currentTokenSpan != null, "currentTokenSpan is null"); - TypeScript.Debug.assert(currentTokenParent != null, "currentTokenParent is null"); - TypeScript.Debug.assert(nextTokenSpan != null, "nextTokenSpan is null"); - TypeScript.Debug.assert(nextTokenParent != null, "nextTokenParent is null"); - TypeScript.Debug.assert(commonParent != null, "commonParent is null"); - this.currentTokenSpan = currentTokenSpan; - this.currentTokenParent = currentTokenParent; - this.nextTokenSpan = nextTokenSpan; - this.nextTokenParent = nextTokenParent; - this.contextNode = commonParent; - this.contextNodeAllOnSameLine = null; - this.nextNodeAllOnSameLine = null; - this.tokensAreOnSameLine = null; - this.contextNodeBlockIsOnOneLine = null; - this.nextNodeBlockIsOnOneLine = null; - }; - FormattingContext.prototype.ContextNodeAllOnSameLine = function () { - if (this.contextNodeAllOnSameLine === null) { - this.contextNodeAllOnSameLine = this.NodeIsOnOneLine(this.contextNode); - } - return this.contextNodeAllOnSameLine; - }; - FormattingContext.prototype.NextNodeAllOnSameLine = function () { - if (this.nextNodeAllOnSameLine === null) { - this.nextNodeAllOnSameLine = this.NodeIsOnOneLine(this.nextTokenParent); - } - return this.nextNodeAllOnSameLine; - }; - FormattingContext.prototype.TokensAreOnSameLine = function () { - if (this.tokensAreOnSameLine === null) { - var startLine = this.snapshot.getLineNumberFromPosition(this.currentTokenSpan.start()); - var endLine = this.snapshot.getLineNumberFromPosition(this.nextTokenSpan.start()); - this.tokensAreOnSameLine = (startLine == endLine); - } - return this.tokensAreOnSameLine; - }; - FormattingContext.prototype.ContextNodeBlockIsOnOneLine = function () { - if (this.contextNodeBlockIsOnOneLine === null) { - this.contextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.contextNode); - } - return this.contextNodeBlockIsOnOneLine; - }; - FormattingContext.prototype.NextNodeBlockIsOnOneLine = function () { - if (this.nextNodeBlockIsOnOneLine === null) { - this.nextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.nextTokenParent); - } - return this.nextNodeBlockIsOnOneLine; - }; - FormattingContext.prototype.NodeIsOnOneLine = function (node) { - var startLine = this.snapshot.getLineNumberFromPosition(node.start()); - var endLine = this.snapshot.getLineNumberFromPosition(node.end()); - return startLine == endLine; - }; - FormattingContext.prototype.BlockIsOnOneLine = function (node) { - var block = node.node(); - return this.snapshot.getLineNumberFromPosition(TypeScript.end(block.openBraceToken)) === this.snapshot.getLineNumberFromPosition(TypeScript.start(block.closeBraceToken)); - }; - return FormattingContext; - })(); - Formatting.FormattingContext = FormattingContext; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var FormattingManager = (function () { - function FormattingManager(syntaxTree, snapshot, rulesProvider, editorOptions) { - this.syntaxTree = syntaxTree; - this.snapshot = snapshot; - this.rulesProvider = rulesProvider; - this.options = new TypeScript.FormattingOptions(!editorOptions.ConvertTabsToSpaces, editorOptions.TabSize, editorOptions.IndentSize, editorOptions.NewLineCharacter); - } - FormattingManager.prototype.formatSelection = function (minChar, limChar) { - var span = TypeScript.TextSpan.fromBounds(minChar, limChar); - return this.formatSpan(span, 1 /* FormatSelection */); - }; - FormattingManager.prototype.formatDocument = function () { - var span = TypeScript.TextSpan.fromBounds(0, this.snapshot.getLength()); - return this.formatSpan(span, 0 /* FormatDocument */); - }; - FormattingManager.prototype.formatOnSemicolon = function (caretPosition) { - var sourceUnit = this.syntaxTree.sourceUnit(); - var semicolonPositionedToken = TypeScript.findToken(sourceUnit, caretPosition - 1); - if (semicolonPositionedToken.kind() === 80 /* SemicolonToken */) { - var current = semicolonPositionedToken; - while (current.parent !== null && TypeScript.end(current.parent) === TypeScript.end(semicolonPositionedToken) && current.parent.kind() !== 1 /* List */) { - current = current.parent; - } - var span = new TypeScript.TextSpan(TypeScript.fullStart(current), TypeScript.fullWidth(current)); - return this.formatSpan(span, 3 /* FormatOnSemicolon */); - } - return []; - }; - FormattingManager.prototype.formatOnClosingCurlyBrace = function (caretPosition) { - var sourceUnit = this.syntaxTree.sourceUnit(); - var closeBracePositionedToken = TypeScript.findToken(sourceUnit, caretPosition - 1); - if (closeBracePositionedToken.kind() === 73 /* CloseBraceToken */) { - var current = closeBracePositionedToken; - while (current.parent !== null && TypeScript.end(current.parent) === TypeScript.end(closeBracePositionedToken) && current.parent.kind() !== 1 /* List */) { - current = current.parent; - } - var span = new TypeScript.TextSpan(TypeScript.fullStart(current), TypeScript.fullWidth(current)); - return this.formatSpan(span, 4 /* FormatOnClosingCurlyBrace */); - } - return []; - }; - FormattingManager.prototype.formatOnEnter = function (caretPosition) { - var lineNumber = this.snapshot.getLineNumberFromPosition(caretPosition); - if (lineNumber > 0) { - var prevLine = this.snapshot.getLineFromLineNumber(lineNumber - 1); - var currentLine = this.snapshot.getLineFromLineNumber(lineNumber); - var span = TypeScript.TextSpan.fromBounds(prevLine.startPosition(), currentLine.endPosition()); - return this.formatSpan(span, 2 /* FormatOnEnter */); - } - return []; - }; - FormattingManager.prototype.formatSpan = function (span, formattingRequestKind) { - var startLine = this.snapshot.getLineFromPosition(span.start()); - span = TypeScript.TextSpan.fromBounds(startLine.startPosition(), span.end()); - var result = []; - var formattingEdits = Formatting.Formatter.getEdits(span, this.syntaxTree.sourceUnit(), this.options, true, this.snapshot, this.rulesProvider, formattingRequestKind); - formattingEdits.forEach(function (item) { - result.push({ - span: new TypeScript.TextSpan(item.position, item.length), - newText: item.replaceWith - }); - }); - return result; - }; - return FormattingManager; - })(); - Formatting.FormattingManager = FormattingManager; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - (function (FormattingRequestKind) { - FormattingRequestKind[FormattingRequestKind["FormatDocument"] = 0] = "FormatDocument"; - FormattingRequestKind[FormattingRequestKind["FormatSelection"] = 1] = "FormatSelection"; - FormattingRequestKind[FormattingRequestKind["FormatOnEnter"] = 2] = "FormatOnEnter"; - FormattingRequestKind[FormattingRequestKind["FormatOnSemicolon"] = 3] = "FormatOnSemicolon"; - FormattingRequestKind[FormattingRequestKind["FormatOnClosingCurlyBrace"] = 4] = "FormatOnClosingCurlyBrace"; - FormattingRequestKind[FormattingRequestKind["FormatOnPaste"] = 5] = "FormatOnPaste"; - })(Formatting.FormattingRequestKind || (Formatting.FormattingRequestKind = {})); - var FormattingRequestKind = Formatting.FormattingRequestKind; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var Rule = (function () { - function Rule(Descriptor, Operation, Flag) { - if (Flag === void 0) { Flag = 0 /* None */; } - this.Descriptor = Descriptor; - this.Operation = Operation; - this.Flag = Flag; - } - Rule.prototype.toString = function () { - return "[desc=" + this.Descriptor + "," + "operation=" + this.Operation + "," + "flag=" + this.Flag + "]"; - }; - return Rule; - })(); - Formatting.Rule = Rule; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - (function (RuleAction) { - RuleAction[RuleAction["Ignore"] = 0] = "Ignore"; - RuleAction[RuleAction["Space"] = 1] = "Space"; - RuleAction[RuleAction["NewLine"] = 2] = "NewLine"; - RuleAction[RuleAction["Delete"] = 3] = "Delete"; - })(Formatting.RuleAction || (Formatting.RuleAction = {})); - var RuleAction = Formatting.RuleAction; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var RuleDescriptor = (function () { - function RuleDescriptor(LeftTokenRange, RightTokenRange) { - this.LeftTokenRange = LeftTokenRange; - this.RightTokenRange = RightTokenRange; - } - RuleDescriptor.prototype.toString = function () { - return "[leftRange=" + this.LeftTokenRange + "," + "rightRange=" + this.RightTokenRange + "]"; - }; - RuleDescriptor.create1 = function (left, right) { - return RuleDescriptor.create4(Formatting.Shared.TokenRange.FromToken(left), Formatting.Shared.TokenRange.FromToken(right)); - }; - RuleDescriptor.create2 = function (left, right) { - return RuleDescriptor.create4(left, Formatting.Shared.TokenRange.FromToken(right)); - }; - RuleDescriptor.create3 = function (left, right) { - return RuleDescriptor.create4(Formatting.Shared.TokenRange.FromToken(left), right); - }; - RuleDescriptor.create4 = function (left, right) { - return new RuleDescriptor(left, right); - }; - return RuleDescriptor; - })(); - Formatting.RuleDescriptor = RuleDescriptor; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - (function (RuleFlags) { - RuleFlags[RuleFlags["None"] = 0] = "None"; - RuleFlags[RuleFlags["CanDeleteNewLines"] = 1] = "CanDeleteNewLines"; - })(Formatting.RuleFlags || (Formatting.RuleFlags = {})); - var RuleFlags = Formatting.RuleFlags; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var RuleOperation = (function () { - function RuleOperation() { - this.Context = null; - this.Action = null; - } - RuleOperation.prototype.toString = function () { - return "[context=" + this.Context + "," + "action=" + this.Action + "]"; - }; - RuleOperation.create1 = function (action) { - return RuleOperation.create2(Formatting.RuleOperationContext.Any, action); - }; - RuleOperation.create2 = function (context, action) { - var result = new RuleOperation(); - result.Context = context; - result.Action = action; - return result; - }; - return RuleOperation; - })(); - Formatting.RuleOperation = RuleOperation; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var RuleOperationContext = (function () { - function RuleOperationContext() { - var funcs = []; - for (var _i = 0; _i < arguments.length; _i++) { - funcs[_i - 0] = arguments[_i]; - } - this.customContextChecks = funcs; - } - RuleOperationContext.prototype.IsAny = function () { - return this == RuleOperationContext.Any; - }; - RuleOperationContext.prototype.InContext = function (context) { - if (this.IsAny()) { - return true; - } - for (var i = 0, len = this.customContextChecks.length; i < len; i++) { - if (!this.customContextChecks[i](context)) { - return false; - } - } - return true; - }; - RuleOperationContext.Any = new RuleOperationContext(); - return RuleOperationContext; - })(); - Formatting.RuleOperationContext = RuleOperationContext; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var Rules = (function () { - function Rules() { - this.IgnoreBeforeComment = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.Comments), Formatting.RuleOperation.create1(0 /* Ignore */)); - this.IgnoreAfterLineComment = new Formatting.Rule(Formatting.RuleDescriptor.create3(5 /* SingleLineCommentTrivia */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create1(0 /* Ignore */)); - this.NoSpaceBeforeSemicolon = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 80 /* SemicolonToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeColon = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 108 /* ColonToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); - this.NoSpaceBeforeQMark = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 107 /* QuestionToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); - this.SpaceAfterColon = new Formatting.Rule(Formatting.RuleDescriptor.create3(108 /* ColonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 1 /* Space */)); - this.SpaceAfterQMark = new Formatting.Rule(Formatting.RuleDescriptor.create3(107 /* QuestionToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 1 /* Space */)); - this.SpaceAfterSemicolon = new Formatting.Rule(Formatting.RuleDescriptor.create3(80 /* SemicolonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceAfterCloseBrace = new Formatting.Rule(Formatting.RuleDescriptor.create3(73 /* CloseBraceToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsAfterCodeBlockContext), 1 /* Space */)); - this.SpaceBetweenCloseBraceAndElse = new Formatting.Rule(Formatting.RuleDescriptor.create1(73 /* CloseBraceToken */, 25 /* ElseKeyword */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceBetweenCloseBraceAndWhile = new Formatting.Rule(Formatting.RuleDescriptor.create1(73 /* CloseBraceToken */, 44 /* WhileKeyword */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceAfterCloseBrace = new Formatting.Rule(Formatting.RuleDescriptor.create3(73 /* CloseBraceToken */, Formatting.Shared.TokenRange.FromTokens([75 /* CloseParenToken */, 77 /* CloseBracketToken */, 81 /* CommaToken */, 80 /* SemicolonToken */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeDot = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 78 /* DotToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterDot = new Formatting.Rule(Formatting.RuleDescriptor.create3(78 /* DotToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeOpenBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 76 /* OpenBracketToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterOpenBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(76 /* OpenBracketToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeCloseBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 77 /* CloseBracketToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterCloseBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(77 /* CloseBracketToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.FunctionOpenBraceLeftTokenRange = Formatting.Shared.TokenRange.AnyIncludingMultilineComments; - this.SpaceBeforeOpenBraceInFunction = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 72 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 1 /* Space */), 1 /* CanDeleteNewLines */); - this.TypeScriptOpenBraceLeftTokenRange = Formatting.Shared.TokenRange.FromTokens([9 /* IdentifierName */, 4 /* MultiLineCommentTrivia */]); - this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 72 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 1 /* Space */), 1 /* CanDeleteNewLines */); - this.ControlOpenBraceLeftTokenRange = Formatting.Shared.TokenRange.FromTokens([75 /* CloseParenToken */, 4 /* MultiLineCommentTrivia */, 24 /* DoKeyword */, 40 /* TryKeyword */, 27 /* FinallyKeyword */, 25 /* ElseKeyword */]); - this.SpaceBeforeOpenBraceInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 72 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 1 /* Space */), 1 /* CanDeleteNewLines */); - this.SpaceAfterOpenBrace = new Formatting.Rule(Formatting.RuleDescriptor.create3(72 /* OpenBraceToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 1 /* Space */)); - this.SpaceBeforeCloseBrace = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 73 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 1 /* Space */)); - this.NoSpaceBetweenEmptyBraceBrackets = new Formatting.Rule(Formatting.RuleDescriptor.create1(72 /* OpenBraceToken */, 73 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectContext), 3 /* Delete */)); - this.NewLineAfterOpenBraceInBlockContext = new Formatting.Rule(Formatting.RuleDescriptor.create3(72 /* OpenBraceToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 2 /* NewLine */)); - this.NewLineBeforeCloseBraceInBlockContext = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.AnyIncludingMultilineComments, 73 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 2 /* NewLine */)); - this.NoSpaceAfterUnaryPrefixOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.UnaryPrefixOperators, Formatting.Shared.TokenRange.UnaryPrefixExpressions), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); - this.NoSpaceAfterUnaryPreincrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create3(95 /* PlusPlusToken */, Formatting.Shared.TokenRange.UnaryPreincrementExpressions), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterUnaryPredecrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create3(96 /* MinusMinusToken */, Formatting.Shared.TokenRange.UnaryPredecrementExpressions), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeUnaryPostincrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.UnaryPostincrementExpressions, 95 /* PlusPlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeUnaryPostdecrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.UnaryPostdecrementExpressions, 96 /* MinusMinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterPostincrementWhenFollowedByAdd = new Formatting.Rule(Formatting.RuleDescriptor.create1(95 /* PlusPlusToken */, 91 /* PlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterAddWhenFollowedByUnaryPlus = new Formatting.Rule(Formatting.RuleDescriptor.create1(91 /* PlusToken */, 91 /* PlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterAddWhenFollowedByPreincrement = new Formatting.Rule(Formatting.RuleDescriptor.create1(91 /* PlusToken */, 95 /* PlusPlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterPostdecrementWhenFollowedBySubtract = new Formatting.Rule(Formatting.RuleDescriptor.create1(96 /* MinusMinusToken */, 92 /* MinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new Formatting.Rule(Formatting.RuleDescriptor.create1(92 /* MinusToken */, 92 /* MinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterSubtractWhenFollowedByPredecrement = new Formatting.Rule(Formatting.RuleDescriptor.create1(92 /* MinusToken */, 96 /* MinusMinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.NoSpaceBeforeComma = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 81 /* CommaToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterCertainKeywords = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.FromTokens([42 /* VarKeyword */, 38 /* ThrowKeyword */, 33 /* NewKeyword */, 23 /* DeleteKeyword */, 35 /* ReturnKeyword */, 41 /* TypeOfKeyword */]), Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceBeforeOpenParenInFuncCall = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 74 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext), 3 /* Delete */)); - this.SpaceAfterFunctionInFuncDecl = new Formatting.Rule(Formatting.RuleDescriptor.create3(29 /* FunctionKeyword */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 1 /* Space */)); - this.NoSpaceBeforeOpenParenInFuncDecl = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 74 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 3 /* Delete */)); - this.SpaceAfterVoidOperator = new Formatting.Rule(Formatting.RuleDescriptor.create3(43 /* VoidKeyword */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsVoidOpContext), 1 /* Space */)); - this.NoSpaceBetweenReturnAndSemicolon = new Formatting.Rule(Formatting.RuleDescriptor.create1(35 /* ReturnKeyword */, 80 /* SemicolonToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceBetweenStatements = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.FromTokens([75 /* CloseParenToken */, 24 /* DoKeyword */, 25 /* ElseKeyword */, 18 /* CaseKeyword */]), Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotForContext), 1 /* Space */)); - this.SpaceAfterTryFinally = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.FromTokens([40 /* TryKeyword */, 27 /* FinallyKeyword */]), 72 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceAfterGetSetInMember = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.FromTokens([66 /* GetKeyword */, 70 /* SetKeyword */]), 9 /* IdentifierName */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 1 /* Space */)); - this.SpaceBeforeBinaryKeywordOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.BinaryKeywordOperators), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterBinaryKeywordOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.BinaryKeywordOperators, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.NoSpaceAfterConstructor = new Formatting.Rule(Formatting.RuleDescriptor.create1(64 /* ConstructorKeyword */, 74 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterModuleImport = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.FromTokens([67 /* ModuleKeyword */, 68 /* RequireKeyword */]), 74 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterCertainTypeScriptKeywords = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.FromTokens([46 /* ClassKeyword */, 65 /* DeclareKeyword */, 48 /* EnumKeyword */, 49 /* ExportKeyword */, 50 /* ExtendsKeyword */, 66 /* GetKeyword */, 53 /* ImplementsKeyword */, 51 /* ImportKeyword */, 54 /* InterfaceKeyword */, 67 /* ModuleKeyword */, 57 /* PrivateKeyword */, 59 /* PublicKeyword */, 70 /* SetKeyword */, 60 /* StaticKeyword */]), Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceBeforeCertainTypeScriptKeywords = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.FromTokens([50 /* ExtendsKeyword */, 53 /* ImplementsKeyword */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceAfterModuleName = new Formatting.Rule(Formatting.RuleDescriptor.create1(12 /* StringLiteral */, 72 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsModuleDeclContext), 1 /* Space */)); - this.SpaceAfterArrow = new Formatting.Rule(Formatting.RuleDescriptor.create3(87 /* EqualsGreaterThanToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceAfterEllipsis = new Formatting.Rule(Formatting.RuleDescriptor.create1(79 /* DotDotDotToken */, 9 /* IdentifierName */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterOptionalParameters = new Formatting.Rule(Formatting.RuleDescriptor.create3(107 /* QuestionToken */, Formatting.Shared.TokenRange.FromTokens([75 /* CloseParenToken */, 81 /* CommaToken */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); - this.NoSpaceBeforeOpenAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.TypeNames, 82 /* LessThanToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceBetweenCloseParenAndAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create1(75 /* CloseParenToken */, 82 /* LessThanToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceAfterOpenAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(82 /* LessThanToken */, Formatting.Shared.TokenRange.TypeNames), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceBeforeCloseAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 83 /* GreaterThanToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceAfterCloseAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(83 /* GreaterThanToken */, Formatting.Shared.TokenRange.FromTokens([74 /* OpenParenToken */, 76 /* OpenBracketToken */, 83 /* GreaterThanToken */, 81 /* CommaToken */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new Formatting.Rule(Formatting.RuleDescriptor.create1(72 /* OpenBraceToken */, 73 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), 3 /* Delete */)); - this.HighPriorityCommonRules = [ - this.IgnoreBeforeComment, - this.IgnoreAfterLineComment, - this.NoSpaceBeforeColon, - this.SpaceAfterColon, - this.NoSpaceBeforeQMark, - this.SpaceAfterQMark, - this.NoSpaceBeforeDot, - this.NoSpaceAfterDot, - this.NoSpaceAfterUnaryPrefixOperator, - this.NoSpaceAfterUnaryPreincrementOperator, - this.NoSpaceAfterUnaryPredecrementOperator, - this.NoSpaceBeforeUnaryPostincrementOperator, - this.NoSpaceBeforeUnaryPostdecrementOperator, - this.SpaceAfterPostincrementWhenFollowedByAdd, - this.SpaceAfterAddWhenFollowedByUnaryPlus, - this.SpaceAfterAddWhenFollowedByPreincrement, - this.SpaceAfterPostdecrementWhenFollowedBySubtract, - this.SpaceAfterSubtractWhenFollowedByUnaryMinus, - this.SpaceAfterSubtractWhenFollowedByPredecrement, - this.NoSpaceAfterCloseBrace, - this.SpaceAfterOpenBrace, - this.SpaceBeforeCloseBrace, - this.NewLineBeforeCloseBraceInBlockContext, - this.SpaceAfterCloseBrace, - this.SpaceBetweenCloseBraceAndElse, - this.SpaceBetweenCloseBraceAndWhile, - this.NoSpaceBetweenEmptyBraceBrackets, - this.SpaceAfterFunctionInFuncDecl, - this.NewLineAfterOpenBraceInBlockContext, - this.SpaceAfterGetSetInMember, - this.NoSpaceBetweenReturnAndSemicolon, - this.SpaceAfterCertainKeywords, - this.NoSpaceBeforeOpenParenInFuncCall, - this.SpaceBeforeBinaryKeywordOperator, - this.SpaceAfterBinaryKeywordOperator, - this.SpaceAfterVoidOperator, - this.NoSpaceAfterConstructor, - this.NoSpaceAfterModuleImport, - this.SpaceAfterCertainTypeScriptKeywords, - this.SpaceBeforeCertainTypeScriptKeywords, - this.SpaceAfterModuleName, - this.SpaceAfterArrow, - this.NoSpaceAfterEllipsis, - this.NoSpaceAfterOptionalParameters, - this.NoSpaceBetweenEmptyInterfaceBraceBrackets, - this.NoSpaceBeforeOpenAngularBracket, - this.NoSpaceBetweenCloseParenAndAngularBracket, - this.NoSpaceAfterOpenAngularBracket, - this.NoSpaceBeforeCloseAngularBracket, - this.NoSpaceAfterCloseAngularBracket - ]; - this.LowPriorityCommonRules = [ - this.NoSpaceBeforeSemicolon, - this.SpaceBeforeOpenBraceInControl, - this.SpaceBeforeOpenBraceInFunction, - this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock, - this.NoSpaceBeforeComma, - this.NoSpaceBeforeOpenBracket, - this.NoSpaceAfterOpenBracket, - this.NoSpaceBeforeCloseBracket, - this.NoSpaceAfterCloseBracket, - this.SpaceAfterSemicolon, - this.NoSpaceBeforeOpenParenInFuncDecl, - this.SpaceBetweenStatements, - this.SpaceAfterTryFinally - ]; - this.SpaceAfterComma = new Formatting.Rule(Formatting.RuleDescriptor.create3(81 /* CommaToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceAfterComma = new Formatting.Rule(Formatting.RuleDescriptor.create3(81 /* CommaToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceBeforeBinaryOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.BinaryOperators), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterBinaryOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.BinaryOperators, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.NoSpaceBeforeBinaryOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.BinaryOperators), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 3 /* Delete */)); - this.NoSpaceAfterBinaryOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.BinaryOperators, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 3 /* Delete */)); - this.SpaceAfterKeywordInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Keywords, 74 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext), 1 /* Space */)); - this.NoSpaceAfterKeywordInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Keywords, 74 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext), 3 /* Delete */)); - this.NewLineBeforeOpenBraceInFunction = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 72 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeMultilineBlockContext), 2 /* NewLine */), 1 /* CanDeleteNewLines */); - this.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 72 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsBeforeMultilineBlockContext), 2 /* NewLine */), 1 /* CanDeleteNewLines */); - this.NewLineBeforeOpenBraceInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 72 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsBeforeMultilineBlockContext), 2 /* NewLine */), 1 /* CanDeleteNewLines */); - this.SpaceAfterSemicolonInFor = new Formatting.Rule(Formatting.RuleDescriptor.create3(80 /* SemicolonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 1 /* Space */)); - this.NoSpaceAfterSemicolonInFor = new Formatting.Rule(Formatting.RuleDescriptor.create3(80 /* SemicolonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 3 /* Delete */)); - this.SpaceAfterOpenParen = new Formatting.Rule(Formatting.RuleDescriptor.create3(74 /* OpenParenToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceBeforeCloseParen = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 75 /* CloseParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceBetweenParens = new Formatting.Rule(Formatting.RuleDescriptor.create1(74 /* OpenParenToken */, 75 /* CloseParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterOpenParen = new Formatting.Rule(Formatting.RuleDescriptor.create3(74 /* OpenParenToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeCloseParen = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 75 /* CloseParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterAnonymousFunctionKeyword = new Formatting.Rule(Formatting.RuleDescriptor.create1(29 /* FunctionKeyword */, 74 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 1 /* Space */)); - this.NoSpaceAfterAnonymousFunctionKeyword = new Formatting.Rule(Formatting.RuleDescriptor.create1(29 /* FunctionKeyword */, 74 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 3 /* Delete */)); - } - Rules.prototype.getRuleName = function (rule) { - var o = this; - for (var name in o) { - if (o[name] === rule) { - return name; - } - } - throw new Error(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Unknown_rule, null)); - }; - Rules.IsForContext = function (context) { - return context.contextNode.kind() === 159 /* ForStatement */; - }; - Rules.IsNotForContext = function (context) { - return !Rules.IsForContext(context); - }; - Rules.IsBinaryOpContext = function (context) { - switch (context.contextNode.kind()) { - case 174 /* BinaryExpression */: - case 173 /* ConditionalExpression */: - return true; - case 138 /* ImportDeclaration */: - case 191 /* VariableDeclarator */: - case 197 /* EqualsValueClause */: - return context.currentTokenSpan.kind === 109 /* EqualsToken */ || context.nextTokenSpan.kind === 109 /* EqualsToken */; - case 160 /* ForInStatement */: - return context.currentTokenSpan.kind === 31 /* InKeyword */ || context.nextTokenSpan.kind === 31 /* InKeyword */; - } - return false; - }; - Rules.IsNotBinaryOpContext = function (context) { - return !Rules.IsBinaryOpContext(context); - }; - Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { - return context.TokensAreOnSameLine() || Rules.IsBeforeMultilineBlockContext(context); - }; - Rules.IsBeforeMultilineBlockContext = function (context) { - return Rules.IsBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine()); - }; - Rules.IsMultilineBlockContext = function (context) { - return Rules.IsBlockContext(context) && !(context.ContextNodeAllOnSameLine() || context.ContextNodeBlockIsOnOneLine()); - }; - Rules.IsSingleLineBlockContext = function (context) { - return Rules.IsBlockContext(context) && (context.ContextNodeAllOnSameLine() || context.ContextNodeBlockIsOnOneLine()); - }; - Rules.IsBlockContext = function (context) { - return Rules.NodeIsBlockContext(context.contextNode); - }; - Rules.IsBeforeBlockContext = function (context) { - return Rules.NodeIsBlockContext(context.nextTokenParent); - }; - Rules.NodeIsBlockContext = function (node) { - if (Rules.NodeIsTypeScriptDeclWithBlockContext(node)) { - return true; - } - switch (node.kind()) { - case 151 /* Block */: - case 156 /* SwitchStatement */: - case 179 /* ObjectLiteralExpression */: - return true; - } - return false; - }; - Rules.IsFunctionDeclContext = function (context) { - switch (context.contextNode.kind()) { - case 134 /* FunctionDeclaration */: - case 140 /* MemberFunctionDeclaration */: - case 144 /* GetAccessor */: - case 145 /* SetAccessor */: - case 150 /* MethodSignature */: - case 147 /* CallSignature */: - case 186 /* FunctionExpression */: - case 142 /* ConstructorDeclaration */: - case 183 /* SimpleArrowFunctionExpression */: - case 182 /* ParenthesizedArrowFunctionExpression */: - case 133 /* InterfaceDeclaration */: - return true; - } - return false; - }; - Rules.IsTypeScriptDeclWithBlockContext = function (context) { - return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode); - }; - Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { - switch (node.kind()) { - case 136 /* ClassDeclaration */: - case 137 /* EnumDeclaration */: - case 124 /* ObjectType */: - case 135 /* ModuleDeclaration */: - return true; - } - return false; - }; - Rules.IsAfterCodeBlockContext = function (context) { - switch (context.currentTokenParent.kind()) { - case 136 /* ClassDeclaration */: - case 135 /* ModuleDeclaration */: - case 137 /* EnumDeclaration */: - case 151 /* Block */: - case 156 /* SwitchStatement */: - return true; - } - return false; - }; - Rules.IsControlDeclContext = function (context) { - switch (context.contextNode.kind()) { - case 152 /* IfStatement */: - case 156 /* SwitchStatement */: - case 159 /* ForStatement */: - case 160 /* ForInStatement */: - case 163 /* WhileStatement */: - case 164 /* TryStatement */: - case 166 /* DoStatement */: - case 168 /* WithStatement */: - case 200 /* ElseClause */: - case 201 /* CatchClause */: - case 202 /* FinallyClause */: - return true; - default: - return false; - } - }; - Rules.IsObjectContext = function (context) { - return context.contextNode.kind() === 179 /* ObjectLiteralExpression */; - }; - Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind() === 177 /* InvocationExpression */; - }; - Rules.IsNewContext = function (context) { - return context.contextNode.kind() === 180 /* ObjectCreationExpression */; - }; - Rules.IsFunctionCallOrNewContext = function (context) { - return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); - }; - Rules.IsSameLineTokenContext = function (context) { - return context.TokensAreOnSameLine(); - }; - Rules.IsNotFormatOnEnter = function (context) { - return context.formattingRequestKind != 2 /* FormatOnEnter */; - }; - Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind() === 135 /* ModuleDeclaration */; - }; - Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind() === 124 /* ObjectType */ && context.contextNode.parent().kind() !== 133 /* InterfaceDeclaration */; - }; - Rules.IsTypeArgumentOrParameter = function (tokenKind, parentKind) { - return ((tokenKind === 82 /* LessThanToken */ || tokenKind === 83 /* GreaterThanToken */) && (parentKind === 195 /* TypeParameterList */ || parentKind === 194 /* TypeArgumentList */)); - }; - Rules.IsTypeArgumentOrParameterContext = function (context) { - return Rules.IsTypeArgumentOrParameter(context.currentTokenSpan.kind, context.currentTokenParent.kind()) || Rules.IsTypeArgumentOrParameter(context.nextTokenSpan.kind, context.nextTokenParent.kind()); - }; - Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 43 /* VoidKeyword */ && context.currentTokenParent.kind() === 172 /* VoidExpression */; - }; - return Rules; - })(); - Formatting.Rules = Rules; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var RulesMap = (function () { - function RulesMap() { - this.map = []; - this.mapRowLength = 0; - } - RulesMap.create = function (rules) { - var result = new RulesMap(); - result.Initialize(rules); - return result; - }; - RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = TypeScript.SyntaxKind.LastToken + 1; - this.map = new Array(this.mapRowLength * this.mapRowLength); - var rulesBucketConstructionStateList = new Array(this.map.length); - this.FillRules(rules, rulesBucketConstructionStateList); - return this.map; - }; - RulesMap.prototype.FillRules = function (rules, rulesBucketConstructionStateList) { - var _this = this; - rules.forEach(function (rule) { - _this.FillRule(rule, rulesBucketConstructionStateList); - }); - }; - RulesMap.prototype.GetRuleBucketIndex = function (row, column) { - var rulesBucketIndex = (row * this.mapRowLength) + column; - return rulesBucketIndex; - }; - RulesMap.prototype.FillRule = function (rule, rulesBucketConstructionStateList) { - var _this = this; - var specificRule = rule.Descriptor.LeftTokenRange != Formatting.Shared.TokenRange.Any && rule.Descriptor.RightTokenRange != Formatting.Shared.TokenRange.Any; - rule.Descriptor.LeftTokenRange.GetTokens().forEach(function (left) { - rule.Descriptor.RightTokenRange.GetTokens().forEach(function (right) { - var rulesBucketIndex = _this.GetRuleBucketIndex(left, right); - var rulesBucket = _this.map[rulesBucketIndex]; - if (rulesBucket == undefined) { - rulesBucket = _this.map[rulesBucketIndex] = new RulesBucket(); - } - rulesBucket.AddRule(rule, specificRule, rulesBucketConstructionStateList, rulesBucketIndex); - }); - }); - }; - RulesMap.prototype.GetRule = function (context) { - var bucketIndex = this.GetRuleBucketIndex(context.currentTokenSpan.kind, context.nextTokenSpan.kind); - var bucket = this.map[bucketIndex]; - if (bucket != null) { - for (var i = 0, len = bucket.Rules().length; i < len; i++) { - var rule = bucket.Rules()[i]; - if (rule.Operation.Context.InContext(context)) - return rule; - } - } - return null; - }; - return RulesMap; - })(); - Formatting.RulesMap = RulesMap; - var MaskBitSize = 5; - var Mask = 0x1f; - (function (RulesPosition) { - RulesPosition[RulesPosition["IgnoreRulesSpecific"] = 0] = "IgnoreRulesSpecific"; - RulesPosition[RulesPosition["IgnoreRulesAny"] = MaskBitSize * 1] = "IgnoreRulesAny"; - RulesPosition[RulesPosition["ContextRulesSpecific"] = MaskBitSize * 2] = "ContextRulesSpecific"; - RulesPosition[RulesPosition["ContextRulesAny"] = MaskBitSize * 3] = "ContextRulesAny"; - RulesPosition[RulesPosition["NoContextRulesSpecific"] = MaskBitSize * 4] = "NoContextRulesSpecific"; - RulesPosition[RulesPosition["NoContextRulesAny"] = MaskBitSize * 5] = "NoContextRulesAny"; - })(Formatting.RulesPosition || (Formatting.RulesPosition = {})); - var RulesPosition = Formatting.RulesPosition; - var RulesBucketConstructionState = (function () { - function RulesBucketConstructionState() { - this.rulesInsertionIndexBitmap = 0; - } - RulesBucketConstructionState.prototype.GetInsertionIndex = function (maskPosition) { - var index = 0; - var pos = 0; - var indexBitmap = this.rulesInsertionIndexBitmap; - while (pos <= maskPosition) { - index += (indexBitmap & Mask); - indexBitmap >>= MaskBitSize; - pos += MaskBitSize; - } - return index; - }; - RulesBucketConstructionState.prototype.IncreaseInsertionIndex = function (maskPosition) { - var value = (this.rulesInsertionIndexBitmap >> maskPosition) & Mask; - value++; - TypeScript.Debug.assert((value & Mask) == value, "Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."); - var temp = this.rulesInsertionIndexBitmap & ~(Mask << maskPosition); - temp |= value << maskPosition; - this.rulesInsertionIndexBitmap = temp; - }; - return RulesBucketConstructionState; - })(); - Formatting.RulesBucketConstructionState = RulesBucketConstructionState; - var RulesBucket = (function () { - function RulesBucket() { - this.rules = []; - } - RulesBucket.prototype.Rules = function () { - return this.rules; - }; - RulesBucket.prototype.AddRule = function (rule, specificTokens, constructionState, rulesBucketIndex) { - var position; - if (rule.Operation.Action == 0 /* Ignore */) { - position = specificTokens ? 0 /* IgnoreRulesSpecific */ : RulesPosition.IgnoreRulesAny; - } - else if (!rule.Operation.Context.IsAny()) { - position = specificTokens ? RulesPosition.ContextRulesSpecific : RulesPosition.ContextRulesAny; - } - else { - position = specificTokens ? RulesPosition.NoContextRulesSpecific : RulesPosition.NoContextRulesAny; - } - var state = constructionState[rulesBucketIndex]; - if (state === undefined) { - state = constructionState[rulesBucketIndex] = new RulesBucketConstructionState(); - } - var index = state.GetInsertionIndex(position); - this.rules.splice(index, 0, rule); - state.IncreaseInsertionIndex(position); - }; - return RulesBucket; - })(); - Formatting.RulesBucket = RulesBucket; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var RulesProvider = (function () { - function RulesProvider(logger) { - this.logger = logger; - this.globalRules = new Formatting.Rules(); - } - RulesProvider.prototype.getRuleName = function (rule) { - return this.globalRules.getRuleName(rule); - }; - RulesProvider.prototype.getRuleByName = function (name) { - return this.globalRules[name]; - }; - RulesProvider.prototype.getRulesMap = function () { - return this.rulesMap; - }; - RulesProvider.prototype.ensureUpToDate = function (options) { - if (this.options == null || !ts.compareDataObjects(this.options, options)) { - var activeRules = this.createActiveRules(options); - var rulesMap = Formatting.RulesMap.create(activeRules); - this.activeRules = activeRules; - this.rulesMap = rulesMap; - this.options = ts.clone(options); - } - }; - RulesProvider.prototype.createActiveRules = function (options) { - var rules = this.globalRules.HighPriorityCommonRules.slice(0); - if (options.InsertSpaceAfterCommaDelimiter) { - rules.push(this.globalRules.SpaceAfterComma); - } - else { - rules.push(this.globalRules.NoSpaceAfterComma); - } - if (options.InsertSpaceAfterFunctionKeywordForAnonymousFunctions) { - rules.push(this.globalRules.SpaceAfterAnonymousFunctionKeyword); - } - else { - rules.push(this.globalRules.NoSpaceAfterAnonymousFunctionKeyword); - } - if (options.InsertSpaceAfterKeywordsInControlFlowStatements) { - rules.push(this.globalRules.SpaceAfterKeywordInControl); - } - else { - rules.push(this.globalRules.NoSpaceAfterKeywordInControl); - } - if (options.InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis) { - rules.push(this.globalRules.SpaceAfterOpenParen); - rules.push(this.globalRules.SpaceBeforeCloseParen); - rules.push(this.globalRules.NoSpaceBetweenParens); - } - else { - rules.push(this.globalRules.NoSpaceAfterOpenParen); - rules.push(this.globalRules.NoSpaceBeforeCloseParen); - rules.push(this.globalRules.NoSpaceBetweenParens); - } - if (options.InsertSpaceAfterSemicolonInForStatements) { - rules.push(this.globalRules.SpaceAfterSemicolonInFor); - } - else { - rules.push(this.globalRules.NoSpaceAfterSemicolonInFor); - } - if (options.InsertSpaceBeforeAndAfterBinaryOperators) { - rules.push(this.globalRules.SpaceBeforeBinaryOperator); - rules.push(this.globalRules.SpaceAfterBinaryOperator); - } - else { - rules.push(this.globalRules.NoSpaceBeforeBinaryOperator); - rules.push(this.globalRules.NoSpaceAfterBinaryOperator); - } - if (options.PlaceOpenBraceOnNewLineForControlBlocks) { - rules.push(this.globalRules.NewLineBeforeOpenBraceInControl); - } - if (options.PlaceOpenBraceOnNewLineForFunctions) { - rules.push(this.globalRules.NewLineBeforeOpenBraceInFunction); - rules.push(this.globalRules.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock); - } - rules = rules.concat(this.globalRules.LowPriorityCommonRules); - return rules; - }; - return RulesProvider; - })(); - Formatting.RulesProvider = RulesProvider; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var TextEditInfo = (function () { - function TextEditInfo(position, length, replaceWith) { - this.position = position; - this.length = length; - this.replaceWith = replaceWith; - } - TextEditInfo.prototype.toString = function () { - return "[ position: " + this.position + ", length: " + this.length + ", replaceWith: '" + this.replaceWith + "' ]"; - }; - return TextEditInfo; - })(); - Formatting.TextEditInfo = TextEditInfo; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var Shared; - (function (Shared) { - var TokenRangeAccess = (function () { - function TokenRangeAccess(from, to, except) { - this.tokens = []; - for (var token = from; token <= to; token++) { - if (except.indexOf(token) < 0) { - this.tokens.push(token); - } - } - } - TokenRangeAccess.prototype.GetTokens = function () { - return this.tokens; - }; - TokenRangeAccess.prototype.Contains = function (token) { - return this.tokens.indexOf(token) >= 0; - }; - TokenRangeAccess.prototype.toString = function () { - return "[tokenRangeStart=" + TypeScript.SyntaxKind[this.tokens[0]] + "," + "tokenRangeEnd=" + TypeScript.SyntaxKind[this.tokens[this.tokens.length - 1]] + "]"; - }; - return TokenRangeAccess; - })(); - Shared.TokenRangeAccess = TokenRangeAccess; - var TokenValuesAccess = (function () { - function TokenValuesAccess(tks) { - this.tokens = tks && tks.length ? tks : []; - } - TokenValuesAccess.prototype.GetTokens = function () { - return this.tokens; - }; - TokenValuesAccess.prototype.Contains = function (token) { - return this.tokens.indexOf(token) >= 0; - }; - return TokenValuesAccess; - })(); - Shared.TokenValuesAccess = TokenValuesAccess; - var TokenSingleValueAccess = (function () { - function TokenSingleValueAccess(token) { - this.token = token; - } - TokenSingleValueAccess.prototype.GetTokens = function () { - return [this.token]; - }; - TokenSingleValueAccess.prototype.Contains = function (tokenValue) { - return tokenValue == this.token; - }; - TokenSingleValueAccess.prototype.toString = function () { - return "[singleTokenKind=" + TypeScript.SyntaxKind[this.token] + "]"; - }; - return TokenSingleValueAccess; - })(); - Shared.TokenSingleValueAccess = TokenSingleValueAccess; - var TokenAllAccess = (function () { - function TokenAllAccess() { - } - TokenAllAccess.prototype.GetTokens = function () { - var result = []; - for (var token = TypeScript.SyntaxKind.FirstToken; token <= TypeScript.SyntaxKind.LastToken; token++) { - result.push(token); - } - return result; - }; - TokenAllAccess.prototype.Contains = function (tokenValue) { - return true; - }; - TokenAllAccess.prototype.toString = function () { - return "[allTokens]"; - }; - return TokenAllAccess; - })(); - Shared.TokenAllAccess = TokenAllAccess; - var TokenRange = (function () { - function TokenRange(tokenAccess) { - this.tokenAccess = tokenAccess; - } - TokenRange.FromToken = function (token) { - return new TokenRange(new TokenSingleValueAccess(token)); - }; - TokenRange.FromTokens = function (tokens) { - return new TokenRange(new TokenValuesAccess(tokens)); - }; - TokenRange.FromRange = function (f, to, except) { - if (except === void 0) { except = []; } - return new TokenRange(new TokenRangeAccess(f, to, except)); - }; - TokenRange.AllTokens = function () { - return new TokenRange(new TokenAllAccess()); - }; - TokenRange.prototype.GetTokens = function () { - return this.tokenAccess.GetTokens(); - }; - TokenRange.prototype.Contains = function (token) { - return this.tokenAccess.Contains(token); - }; - TokenRange.prototype.toString = function () { - return this.tokenAccess.toString(); - }; - TokenRange.Any = TokenRange.AllTokens(); - TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([4 /* MultiLineCommentTrivia */])); - TokenRange.Keywords = TokenRange.FromRange(TypeScript.SyntaxKind.FirstKeyword, TypeScript.SyntaxKind.LastKeyword); - TokenRange.Operators = TokenRange.FromRange(80 /* SemicolonToken */, 121 /* SlashEqualsToken */); - TokenRange.BinaryOperators = TokenRange.FromRange(82 /* LessThanToken */, 121 /* SlashEqualsToken */); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([31 /* InKeyword */, 32 /* InstanceOfKeyword */]); - TokenRange.ReservedKeywords = TokenRange.FromRange(TypeScript.SyntaxKind.FirstFutureReservedStrictKeyword, TypeScript.SyntaxKind.LastFutureReservedStrictKeyword); - TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([95 /* PlusPlusToken */, 96 /* MinusMinusToken */, 104 /* TildeToken */, 103 /* ExclamationToken */]); - TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([11 /* NumericLiteral */, 9 /* IdentifierName */, 74 /* OpenParenToken */, 76 /* OpenBracketToken */, 72 /* OpenBraceToken */, 37 /* ThisKeyword */, 33 /* NewKeyword */]); - TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([9 /* IdentifierName */, 74 /* OpenParenToken */, 37 /* ThisKeyword */, 33 /* NewKeyword */]); - TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([9 /* IdentifierName */, 75 /* CloseParenToken */, 77 /* CloseBracketToken */, 33 /* NewKeyword */]); - TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([9 /* IdentifierName */, 74 /* OpenParenToken */, 37 /* ThisKeyword */, 33 /* NewKeyword */]); - TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([9 /* IdentifierName */, 75 /* CloseParenToken */, 77 /* CloseBracketToken */, 33 /* NewKeyword */]); - TokenRange.Comments = TokenRange.FromTokens([5 /* SingleLineCommentTrivia */, 4 /* MultiLineCommentTrivia */]); - TokenRange.TypeNames = TokenRange.FromTokens([9 /* IdentifierName */, 69 /* NumberKeyword */, 71 /* StringKeyword */, 63 /* BooleanKeyword */, 43 /* VoidKeyword */, 62 /* AnyKeyword */]); - return TokenRange; - })(); - Shared.TokenRange = TokenRange; - })(Shared = Formatting.Shared || (Formatting.Shared = {})); - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var TokenSpan = (function (_super) { - __extends(TokenSpan, _super); - function TokenSpan(kind, start, length) { - _super.call(this, start, length); - this.kind = kind; - } - return TokenSpan; - })(TypeScript.TextSpan); - Formatting.TokenSpan = TokenSpan; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var IndentationNodeContext = (function () { - function IndentationNodeContext(parent, node, fullStart, indentationAmount, childIndentationAmountDelta) { - this.update(parent, node, fullStart, indentationAmount, childIndentationAmountDelta); - } - IndentationNodeContext.prototype.parent = function () { - return this._parent; - }; - IndentationNodeContext.prototype.node = function () { - return this._node; - }; - IndentationNodeContext.prototype.fullStart = function () { - return this._fullStart; - }; - IndentationNodeContext.prototype.fullWidth = function () { - return TypeScript.fullWidth(this._node); - }; - IndentationNodeContext.prototype.start = function () { - return this._fullStart + TypeScript.leadingTriviaWidth(this._node); - }; - IndentationNodeContext.prototype.end = function () { - return this._fullStart + TypeScript.leadingTriviaWidth(this._node) + TypeScript.width(this._node); - }; - IndentationNodeContext.prototype.indentationAmount = function () { - return this._indentationAmount; - }; - IndentationNodeContext.prototype.childIndentationAmountDelta = function () { - return this._childIndentationAmountDelta; - }; - IndentationNodeContext.prototype.depth = function () { - return this._depth; - }; - IndentationNodeContext.prototype.kind = function () { - return this._node.kind(); - }; - IndentationNodeContext.prototype.hasSkippedOrMissingTokenChild = function () { - if (this._hasSkippedOrMissingTokenChild === null) { - this._hasSkippedOrMissingTokenChild = TypeScript.Syntax.nodeHasSkippedOrMissingTokens(this._node); - } - return this._hasSkippedOrMissingTokenChild; - }; - IndentationNodeContext.prototype.clone = function (pool) { - var parent = null; - if (this._parent) { - parent = this._parent.clone(pool); - } - return pool.getNode(parent, this._node, this._fullStart, this._indentationAmount, this._childIndentationAmountDelta); - }; - IndentationNodeContext.prototype.update = function (parent, node, fullStart, indentationAmount, childIndentationAmountDelta) { - this._parent = parent; - this._node = node; - this._fullStart = fullStart; - this._indentationAmount = indentationAmount; - this._childIndentationAmountDelta = childIndentationAmountDelta; - this._hasSkippedOrMissingTokenChild = null; - if (parent) { - this._depth = parent.depth() + 1; - } - else { - this._depth = 0; - } - }; - return IndentationNodeContext; - })(); - Formatting.IndentationNodeContext = IndentationNodeContext; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var IndentationNodeContextPool = (function () { - function IndentationNodeContextPool() { - this.nodes = []; - } - IndentationNodeContextPool.prototype.getNode = function (parent, node, fullStart, indentationLevel, childIndentationLevelDelta) { - if (this.nodes.length > 0) { - var cachedNode = this.nodes.pop(); - cachedNode.update(parent, node, fullStart, indentationLevel, childIndentationLevelDelta); - return cachedNode; - } - return new Formatting.IndentationNodeContext(parent, node, fullStart, indentationLevel, childIndentationLevelDelta); - }; - IndentationNodeContextPool.prototype.releaseNode = function (node, recursive) { - if (recursive === void 0) { recursive = false; } - this.nodes.push(node); - if (recursive) { - var parent = node.parent(); - if (parent) { - this.releaseNode(parent, recursive); - } - } - }; - return IndentationNodeContextPool; - })(); - Formatting.IndentationNodeContextPool = IndentationNodeContextPool; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var IndentationTrackingWalker = (function () { - function IndentationTrackingWalker(textSpan, sourceUnit, snapshot, indentFirstToken, options) { - this.options = options; - this._position = 0; - this._parent = null; - this._indentationNodeContextPool = new Formatting.IndentationNodeContextPool(); - this._textSpan = textSpan; - this._text = sourceUnit.syntaxTree.text; - this._snapshot = snapshot; - this._parent = this._indentationNodeContextPool.getNode(null, sourceUnit, 0, 0, 0); - this._lastTriviaWasNewLine = indentFirstToken; - } - IndentationTrackingWalker.prototype.position = function () { - return this._position; - }; - IndentationTrackingWalker.prototype.parent = function () { - return this._parent; - }; - IndentationTrackingWalker.prototype.textSpan = function () { - return this._textSpan; - }; - IndentationTrackingWalker.prototype.snapshot = function () { - return this._snapshot; - }; - IndentationTrackingWalker.prototype.indentationNodeContextPool = function () { - return this._indentationNodeContextPool; - }; - IndentationTrackingWalker.prototype.forceIndentNextToken = function (tokenStart) { - this._lastTriviaWasNewLine = true; - this.forceRecomputeIndentationOfParent(tokenStart, true); - }; - IndentationTrackingWalker.prototype.forceSkipIndentingNextToken = function (tokenStart) { - this._lastTriviaWasNewLine = false; - this.forceRecomputeIndentationOfParent(tokenStart, false); - }; - IndentationTrackingWalker.prototype.indentToken = function (token, indentationAmount, commentIndentationAmount) { - throw TypeScript.Errors.abstract(); - }; - IndentationTrackingWalker.prototype.visitTokenInSpan = function (token) { - if (this._lastTriviaWasNewLine) { - var indentationAmount = this.getTokenIndentationAmount(token); - var commentIndentationAmount = this.getCommentIndentationAmount(token); - this.indentToken(token, indentationAmount, commentIndentationAmount); - } - }; - IndentationTrackingWalker.prototype.visitToken = function (token) { - var tokenSpan = new TypeScript.TextSpan(this._position, token.fullWidth()); - if (tokenSpan.intersectsWithTextSpan(this._textSpan)) { - this.visitTokenInSpan(token); - var trivia = token.trailingTrivia(); - this._lastTriviaWasNewLine = trivia.hasNewLine() && trivia.syntaxTriviaAt(trivia.count() - 1).kind() == 3 /* NewLineTrivia */; - } - this._position += token.fullWidth(); - }; - IndentationTrackingWalker.prototype.walk = function (element) { - if (element) { - if (TypeScript.isToken(element)) { - this.visitToken(element); - } - else if (element.kind() === 1 /* List */) { - for (var i = 0, n = TypeScript.childCount(element); i < n; i++) { - this.walk(TypeScript.childAt(element, i)); - } - } - else { - this.visitNode(element); - } - } - }; - IndentationTrackingWalker.prototype.visitNode = function (node) { - var nodeSpan = new TypeScript.TextSpan(this._position, TypeScript.fullWidth(node)); - if (nodeSpan.intersectsWithTextSpan(this._textSpan)) { - var indentation = this.getNodeIndentation(node); - var currentParent = this._parent; - this._parent = this._indentationNodeContextPool.getNode(currentParent, node, this._position, indentation.indentationAmount, indentation.indentationAmountDelta); - for (var i = 0, n = TypeScript.childCount(node); i < n; i++) { - this.walk(TypeScript.childAt(node, i)); - } - this._indentationNodeContextPool.releaseNode(this._parent); - this._parent = currentParent; - } - else { - this._position += TypeScript.fullWidth(node); - } - }; - IndentationTrackingWalker.prototype.getTokenIndentationAmount = function (token) { - if (TypeScript.firstToken(this._parent.node()) === token || token.kind() === 72 /* OpenBraceToken */ || token.kind() === 73 /* CloseBraceToken */ || token.kind() === 76 /* OpenBracketToken */ || token.kind() === 77 /* CloseBracketToken */ || (token.kind() === 44 /* WhileKeyword */ && this._parent.node().kind() == 166 /* DoStatement */)) { - return this._parent.indentationAmount(); - } - return (this._parent.indentationAmount() + this._parent.childIndentationAmountDelta()); - }; - IndentationTrackingWalker.prototype.getCommentIndentationAmount = function (token) { - if (token.kind() === 73 /* CloseBraceToken */ || token.kind() === 77 /* CloseBracketToken */) { - return (this._parent.indentationAmount() + this._parent.childIndentationAmountDelta()); - } - return this._parent.indentationAmount(); - }; - IndentationTrackingWalker.prototype.getNodeIndentation = function (node, newLineInsertedByFormatting) { - var parent = this._parent; - var parentIndentationAmount; - if (this._textSpan.containsPosition(parent.start())) { - parentIndentationAmount = parent.indentationAmount(); - } - else { - if (parent.kind() === 151 /* Block */ && !this.shouldIndentBlockInParent(this._parent.parent())) { - parent = this._parent.parent(); - } - var line = this._snapshot.getLineFromPosition(parent.start()).getText(); - var firstNonWhiteSpacePosition = TypeScript.Indentation.firstNonWhitespacePosition(line); - parentIndentationAmount = TypeScript.Indentation.columnForPositionInString(line, firstNonWhiteSpacePosition, this.options); - } - var parentIndentationAmountDelta = parent.childIndentationAmountDelta(); - var indentationAmount; - var indentationAmountDelta; - var parentNode = parent.node(); - switch (node.kind()) { - default: - indentationAmount = (parentIndentationAmount + parentIndentationAmountDelta); - indentationAmountDelta = 0; - break; - case 136 /* ClassDeclaration */: - case 135 /* ModuleDeclaration */: - case 124 /* ObjectType */: - case 137 /* EnumDeclaration */: - case 156 /* SwitchStatement */: - case 179 /* ObjectLiteralExpression */: - case 142 /* ConstructorDeclaration */: - case 134 /* FunctionDeclaration */: - case 186 /* FunctionExpression */: - case 140 /* MemberFunctionDeclaration */: - case 144 /* GetAccessor */: - case 145 /* SetAccessor */: - case 143 /* IndexMemberDeclaration */: - case 201 /* CatchClause */: - case 178 /* ArrayLiteralExpression */: - case 126 /* ArrayType */: - case 185 /* ElementAccessExpression */: - case 149 /* IndexSignature */: - case 159 /* ForStatement */: - case 160 /* ForInStatement */: - case 163 /* WhileStatement */: - case 166 /* DoStatement */: - case 168 /* WithStatement */: - case 198 /* CaseSwitchClause */: - case 199 /* DefaultSwitchClause */: - case 155 /* ReturnStatement */: - case 162 /* ThrowStatement */: - case 183 /* SimpleArrowFunctionExpression */: - case 182 /* ParenthesizedArrowFunctionExpression */: - case 190 /* VariableDeclaration */: - case 139 /* ExportAssignment */: - case 177 /* InvocationExpression */: - case 180 /* ObjectCreationExpression */: - case 147 /* CallSignature */: - case 148 /* ConstructSignature */: - indentationAmount = (parentIndentationAmount + parentIndentationAmountDelta); - indentationAmountDelta = this.options.indentSpaces; - break; - case 152 /* IfStatement */: - if (parent.kind() === 200 /* ElseClause */ && !TypeScript.SyntaxUtilities.isLastTokenOnLine(parentNode.elseKeyword, this._text)) { - indentationAmount = parentIndentationAmount; - } - else { - indentationAmount = (parentIndentationAmount + parentIndentationAmountDelta); - } - indentationAmountDelta = this.options.indentSpaces; - break; - case 200 /* ElseClause */: - indentationAmount = parentIndentationAmount; - indentationAmountDelta = this.options.indentSpaces; - break; - case 151 /* Block */: - if (this.shouldIndentBlockInParent(parent)) { - indentationAmount = parentIndentationAmount + parentIndentationAmountDelta; - } - else { - indentationAmount = parentIndentationAmount; - } - indentationAmountDelta = this.options.indentSpaces; - break; - } - if (parentNode) { - if (!newLineInsertedByFormatting) { - var parentStartLine = this._snapshot.getLineNumberFromPosition(parent.start()); - var currentNodeStartLine = this._snapshot.getLineNumberFromPosition(this._position + TypeScript.leadingTriviaWidth(node)); - if (parentStartLine === currentNodeStartLine || newLineInsertedByFormatting === false) { - indentationAmount = parentIndentationAmount; - indentationAmountDelta = Math.min(this.options.indentSpaces, parentIndentationAmountDelta + indentationAmountDelta); - } - } - } - return { - indentationAmount: indentationAmount, - indentationAmountDelta: indentationAmountDelta - }; - }; - IndentationTrackingWalker.prototype.shouldIndentBlockInParent = function (parent) { - switch (parent.kind()) { - case 122 /* SourceUnit */: - case 135 /* ModuleDeclaration */: - case 151 /* Block */: - case 198 /* CaseSwitchClause */: - case 199 /* DefaultSwitchClause */: - return true; - default: - return false; - } - }; - IndentationTrackingWalker.prototype.forceRecomputeIndentationOfParent = function (tokenStart, newLineAdded) { - var parent = this._parent; - if (parent.fullStart() === tokenStart) { - this._parent = parent.parent(); - var indentation = this.getNodeIndentation(parent.node(), newLineAdded); - parent.update(parent.parent(), parent.node(), parent.fullStart(), indentation.indentationAmount, indentation.indentationAmountDelta); - this._parent = parent; - } - }; - return IndentationTrackingWalker; - })(); - Formatting.IndentationTrackingWalker = IndentationTrackingWalker; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var MultipleTokenIndenter = (function (_super) { - __extends(MultipleTokenIndenter, _super); - function MultipleTokenIndenter(textSpan, sourceUnit, snapshot, indentFirstToken, options) { - _super.call(this, textSpan, sourceUnit, snapshot, indentFirstToken, options); - this._edits = []; - } - MultipleTokenIndenter.prototype.indentToken = function (token, indentationAmount, commentIndentationAmount) { - if (token.fullWidth() === 0) { - return; - } - if (this.parent().hasSkippedOrMissingTokenChild()) { - return; - } - var tokenSpan = new TypeScript.TextSpan(this.position() + token.leadingTriviaWidth(), TypeScript.width(token)); - if (!this.textSpan().containsTextSpan(tokenSpan)) { - return; - } - var indentationString = TypeScript.Indentation.indentationString(indentationAmount, this.options); - var commentIndentationString = TypeScript.Indentation.indentationString(commentIndentationAmount, this.options); - this.recordIndentationEditsForToken(token, indentationString, commentIndentationString); - }; - MultipleTokenIndenter.prototype.edits = function () { - return this._edits; - }; - MultipleTokenIndenter.prototype.recordEdit = function (position, length, replaceWith) { - this._edits.push(new Formatting.TextEditInfo(position, length, replaceWith)); - }; - MultipleTokenIndenter.prototype.recordIndentationEditsForToken = function (token, indentationString, commentIndentationString) { - var position = this.position(); - var indentNextTokenOrTrivia = true; - var leadingWhiteSpace = ""; - var triviaList = token.leadingTrivia(); - if (triviaList) { - for (var i = 0, length = triviaList.count(); i < length; i++, position += trivia.fullWidth()) { - var trivia = triviaList.syntaxTriviaAt(i); - if (!this.textSpan().containsTextSpan(new TypeScript.TextSpan(position, trivia.fullWidth()))) { - continue; - } - switch (trivia.kind()) { - case 4 /* MultiLineCommentTrivia */: - this.recordIndentationEditsForMultiLineComment(trivia, position, commentIndentationString, leadingWhiteSpace, !indentNextTokenOrTrivia); - indentNextTokenOrTrivia = false; - leadingWhiteSpace = ""; - break; - case 5 /* SingleLineCommentTrivia */: - case 6 /* SkippedTokenTrivia */: - if (indentNextTokenOrTrivia) { - this.recordIndentationEditsForSingleLineOrSkippedText(trivia, position, commentIndentationString); - indentNextTokenOrTrivia = false; - } - break; - case 2 /* WhitespaceTrivia */: - var nextTrivia = length > i + 1 && triviaList.syntaxTriviaAt(i + 1); - var whiteSpaceIndentationString = nextTrivia && nextTrivia.isComment() ? commentIndentationString : indentationString; - if (indentNextTokenOrTrivia) { - if (!(nextTrivia && nextTrivia.isNewLine())) { - this.recordIndentationEditsForWhitespace(trivia, position, whiteSpaceIndentationString); - } - indentNextTokenOrTrivia = false; - } - leadingWhiteSpace += trivia.fullText(); - break; - case 3 /* NewLineTrivia */: - indentNextTokenOrTrivia = true; - leadingWhiteSpace = ""; - break; - default: - throw TypeScript.Errors.invalidOperation(); - } - } - } - if (token.kind() !== 8 /* EndOfFileToken */ && indentNextTokenOrTrivia) { - if (indentationString.length > 0) { - this.recordEdit(position, 0, indentationString); - } - } - }; - MultipleTokenIndenter.prototype.recordIndentationEditsForSingleLineOrSkippedText = function (trivia, fullStart, indentationString) { - if (indentationString.length > 0) { - this.recordEdit(fullStart, 0, indentationString); - } - }; - MultipleTokenIndenter.prototype.recordIndentationEditsForWhitespace = function (trivia, fullStart, indentationString) { - var text = trivia.fullText(); - if (indentationString === text) { - return; - } - this.recordEdit(fullStart, text.length, indentationString); - }; - MultipleTokenIndenter.prototype.recordIndentationEditsForMultiLineComment = function (trivia, fullStart, indentationString, leadingWhiteSpace, firstLineAlreadyIndented) { - var position = fullStart; - var segments = TypeScript.Syntax.splitMultiLineCommentTriviaIntoMultipleLines(trivia); - if (segments.length <= 1) { - if (!firstLineAlreadyIndented) { - this.recordIndentationEditsForSingleLineOrSkippedText(trivia, fullStart, indentationString); - } - return; - } - var whiteSpaceColumnsInFirstSegment = TypeScript.Indentation.columnForPositionInString(leadingWhiteSpace, leadingWhiteSpace.length, this.options); - var indentationColumns = TypeScript.Indentation.columnForPositionInString(indentationString, indentationString.length, this.options); - var startIndex = 0; - if (firstLineAlreadyIndented) { - startIndex = 1; - position += segments[0].length; - } - for (var i = startIndex; i < segments.length; i++) { - var segment = segments[i]; - this.recordIndentationEditsForSegment(segment, position, indentationColumns, whiteSpaceColumnsInFirstSegment); - position += segment.length; - } - }; - MultipleTokenIndenter.prototype.recordIndentationEditsForSegment = function (segment, fullStart, indentationColumns, whiteSpaceColumnsInFirstSegment) { - var firstNonWhitespacePosition = TypeScript.Indentation.firstNonWhitespacePosition(segment); - var leadingWhiteSpaceColumns = TypeScript.Indentation.columnForPositionInString(segment, firstNonWhitespacePosition, this.options); - var deltaFromFirstSegment = leadingWhiteSpaceColumns - whiteSpaceColumnsInFirstSegment; - var finalColumns = indentationColumns + deltaFromFirstSegment; - if (finalColumns < 0) { - finalColumns = 0; - } - var indentationString = TypeScript.Indentation.indentationString(finalColumns, this.options); - if (firstNonWhitespacePosition < segment.length && TypeScript.CharacterInfo.isLineTerminator(segment.charCodeAt(firstNonWhitespacePosition))) { - return; - } - if (indentationString === segment.substring(0, firstNonWhitespacePosition)) { - return; - } - this.recordEdit(fullStart, firstNonWhitespacePosition, indentationString); - }; - return MultipleTokenIndenter; - })(Formatting.IndentationTrackingWalker); - Formatting.MultipleTokenIndenter = MultipleTokenIndenter; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var Formatter = (function (_super) { - __extends(Formatter, _super); - function Formatter(textSpan, sourceUnit, indentFirstToken, options, snapshot, rulesProvider, formattingRequestKind) { - _super.call(this, textSpan, sourceUnit, snapshot, indentFirstToken, options); - this.previousTokenSpan = null; - this.previousTokenParent = null; - this.scriptHasErrors = false; - this.previousTokenParent = this.parent().clone(this.indentationNodeContextPool()); - this.rulesProvider = rulesProvider; - this.formattingRequestKind = formattingRequestKind; - this.formattingContext = new Formatting.FormattingContext(this.snapshot(), this.formattingRequestKind); - } - Formatter.getEdits = function (textSpan, sourceUnit, options, indentFirstToken, snapshot, rulesProvider, formattingRequestKind) { - var walker = new Formatter(textSpan, sourceUnit, indentFirstToken, options, snapshot, rulesProvider, formattingRequestKind); - walker.walk(sourceUnit); - return walker.edits(); - }; - Formatter.prototype.visitTokenInSpan = function (token) { - if (token.fullWidth() !== 0) { - var tokenSpan = new TypeScript.TextSpan(this.position() + token.leadingTriviaWidth(), TypeScript.width(token)); - if (this.textSpan().containsTextSpan(tokenSpan)) { - this.processToken(token); - } - } - _super.prototype.visitTokenInSpan.call(this, token); - }; - Formatter.prototype.processToken = function (token) { - var position = this.position(); - if (token.leadingTriviaWidth() !== 0) { - this.processTrivia(token.leadingTrivia(), position); - position += token.leadingTriviaWidth(); - } - var currentTokenSpan = new Formatting.TokenSpan(token.kind(), position, TypeScript.width(token)); - if (!this.parent().hasSkippedOrMissingTokenChild()) { - if (this.previousTokenSpan) { - this.formatPair(this.previousTokenSpan, this.previousTokenParent, currentTokenSpan, this.parent()); - } - else { - this.trimWhitespaceInLineRange(this.getLineNumber(this.textSpan()), this.getLineNumber(currentTokenSpan)); - } - } - this.previousTokenSpan = currentTokenSpan; - if (this.previousTokenParent) { - this.indentationNodeContextPool().releaseNode(this.previousTokenParent, true); - } - this.previousTokenParent = this.parent().clone(this.indentationNodeContextPool()); - position += TypeScript.width(token); - if (token.trailingTriviaWidth() !== 0) { - this.processTrivia(token.trailingTrivia(), position); - } - }; - Formatter.prototype.processTrivia = function (triviaList, fullStart) { - var position = fullStart; - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isComment() || trivia.isSkippedToken()) { - var currentTokenSpan = new Formatting.TokenSpan(trivia.kind(), position, trivia.fullWidth()); - if (this.textSpan().containsTextSpan(currentTokenSpan)) { - if (trivia.isComment() && this.previousTokenSpan) { - this.formatPair(this.previousTokenSpan, this.previousTokenParent, currentTokenSpan, this.parent()); - } - else { - var startLine = this.getLineNumber(this.previousTokenSpan || this.textSpan()); - this.trimWhitespaceInLineRange(startLine, this.getLineNumber(currentTokenSpan)); - } - this.previousTokenSpan = currentTokenSpan; - if (this.previousTokenParent) { - this.indentationNodeContextPool().releaseNode(this.previousTokenParent, true); - } - this.previousTokenParent = this.parent().clone(this.indentationNodeContextPool()); - } - } - position += trivia.fullWidth(); - } - }; - Formatter.prototype.findCommonParents = function (parent1, parent2) { - var shallowParent; - var shallowParentDepth; - var deepParent; - var deepParentDepth; - if (parent1.depth() < parent2.depth()) { - shallowParent = parent1; - shallowParentDepth = parent1.depth(); - deepParent = parent2; - deepParentDepth = parent2.depth(); - } - else { - shallowParent = parent2; - shallowParentDepth = parent2.depth(); - deepParent = parent1; - deepParentDepth = parent1.depth(); - } - TypeScript.Debug.assert(shallowParentDepth >= 0, "Expected shallowParentDepth >= 0"); - TypeScript.Debug.assert(deepParentDepth >= 0, "Expected deepParentDepth >= 0"); - TypeScript.Debug.assert(deepParentDepth >= shallowParentDepth, "Expected deepParentDepth >= shallowParentDepth"); - while (deepParentDepth > shallowParentDepth) { - deepParent = deepParent.parent(); - deepParentDepth--; - } - TypeScript.Debug.assert(deepParentDepth === shallowParentDepth, "Expected deepParentDepth === shallowParentDepth"); - while (deepParent.node() && shallowParent.node()) { - if (deepParent.node() === shallowParent.node()) { - return deepParent; - } - deepParent = deepParent.parent(); - shallowParent = shallowParent.parent(); - } - throw TypeScript.Errors.invalidOperation(); - }; - Formatter.prototype.formatPair = function (t1, t1Parent, t2, t2Parent) { - var token1Line = this.getLineNumber(t1); - var token2Line = this.getLineNumber(t2); - var commonParent = this.findCommonParents(t1Parent, t2Parent); - this.formattingContext.updateContext(t1, t1Parent, t2, t2Parent, commonParent); - var rule = this.rulesProvider.getRulesMap().GetRule(this.formattingContext); - if (rule != null) { - this.RecordRuleEdits(rule, t1, t2); - if ((rule.Operation.Action == 1 /* Space */ || rule.Operation.Action == 3 /* Delete */) && token1Line != token2Line) { - this.forceSkipIndentingNextToken(t2.start()); - } - if (rule.Operation.Action == 2 /* NewLine */ && token1Line == token2Line) { - this.forceIndentNextToken(t2.start()); - } - } - if (token1Line != token2Line && (!rule || (rule.Operation.Action != 3 /* Delete */ && rule.Flag != 1 /* CanDeleteNewLines */))) { - this.trimWhitespaceInLineRange(token1Line, token2Line, t1); - } - }; - Formatter.prototype.getLineNumber = function (span) { - return this.snapshot().getLineNumberFromPosition(span.start()); - }; - Formatter.prototype.trimWhitespaceInLineRange = function (startLine, endLine, token) { - for (var lineNumber = startLine; lineNumber < endLine; ++lineNumber) { - var line = this.snapshot().getLineFromLineNumber(lineNumber); - this.trimWhitespace(line, token); - } - }; - Formatter.prototype.trimWhitespace = function (line, token) { - if (token && (token.kind == 4 /* MultiLineCommentTrivia */ || token.kind == 5 /* SingleLineCommentTrivia */) && token.start() <= line.endPosition() && token.end() >= line.endPosition()) - return; - var text = line.getText(); - var index = 0; - for (index = text.length - 1; index >= 0; --index) { - if (!TypeScript.CharacterInfo.isWhitespace(text.charCodeAt(index))) { - break; - } - } - ++index; - if (index < text.length) { - this.recordEdit(line.startPosition() + index, line.length() - index, ""); - } - }; - Formatter.prototype.RecordRuleEdits = function (rule, t1, t2) { - if (rule.Operation.Action == 0 /* Ignore */) { - return; - } - var betweenSpan; - switch (rule.Operation.Action) { - case 3 /* Delete */: - { - betweenSpan = new TypeScript.TextSpan(t1.end(), t2.start() - t1.end()); - if (betweenSpan.length() > 0) { - this.recordEdit(betweenSpan.start(), betweenSpan.length(), ""); - return; - } - } - break; - case 2 /* NewLine */: - { - if (!(rule.Flag == 1 /* CanDeleteNewLines */ || this.getLineNumber(t1) == this.getLineNumber(t2))) { - return; - } - betweenSpan = new TypeScript.TextSpan(t1.end(), t2.start() - t1.end()); - var doEdit = false; - var betweenText = this.snapshot().getText(betweenSpan); - var lineFeedLoc = betweenText.indexOf(this.options.newLineCharacter); - if (lineFeedLoc < 0) { - doEdit = true; - } - else { - lineFeedLoc = betweenText.indexOf(this.options.newLineCharacter, lineFeedLoc + 1); - if (lineFeedLoc >= 0) { - doEdit = true; - } - } - if (doEdit) { - this.recordEdit(betweenSpan.start(), betweenSpan.length(), this.options.newLineCharacter); - return; - } - } - break; - case 1 /* Space */: - { - if (!(rule.Flag == 1 /* CanDeleteNewLines */ || this.getLineNumber(t1) == this.getLineNumber(t2))) { - return; - } - betweenSpan = new TypeScript.TextSpan(t1.end(), t2.start() - t1.end()); - if (betweenSpan.length() > 1 || this.snapshot().getText(betweenSpan) != " ") { - this.recordEdit(betweenSpan.start(), betweenSpan.length(), " "); - return; - } - } - break; - } - }; - return Formatter; - })(Formatting.MultipleTokenIndenter); - Formatting.Formatter = Formatter; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); var ts; (function (ts) { var formatting; @@ -30807,7 +17280,7 @@ var ts; return 0; } var lineAtPosition = sourceFile.getLineAndCharacterFromPosition(position).line; - if (precedingToken.kind === 22 /* CommaToken */ && precedingToken.parent.kind !== 153 /* BinaryExpression */) { + if (precedingToken.kind === 22 /* CommaToken */ && precedingToken.parent.kind !== 156 /* BinaryExpression */) { var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1) { return actualIndentation; @@ -30818,13 +17291,13 @@ var ts; var currentStart; var indentationDelta; while (current) { - if (positionBelongsToNode(current, position, sourceFile) && nodeContentIsIndented(current, previous)) { + if (positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current.kind, previous ? previous.kind : 0 /* Unknown */)) { currentStart = getStartLineAndCharacterForNode(current, sourceFile); if (nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile)) { indentationDelta = 0; } else { - indentationDelta = lineAtPosition !== currentStart.line ? options.indentSpaces : 0; + indentationDelta = lineAtPosition !== currentStart.line ? options.IndentSize : 0; } break; } @@ -30838,21 +17311,39 @@ var ts; if (!current) { return 0; } + return getIndentationForNodeWorker(current, currentStart, undefined, indentationDelta, sourceFile, options); + } + SmartIndenter.getIndentation = getIndentation; + function getIndentationForNode(n, ignoreActualIndentationRange, sourceFile, options) { + var start = sourceFile.getLineAndCharacterFromPosition(n.getStart(sourceFile)); + return getIndentationForNodeWorker(n, start, ignoreActualIndentationRange, 0, sourceFile, options); + } + SmartIndenter.getIndentationForNode = getIndentationForNode; + function getIndentationForNodeWorker(current, currentStart, ignoreActualIndentationRange, indentationDelta, sourceFile, options) { var parent = current.parent; var parentStart; while (parent) { - var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); - if (actualIndentation !== -1) { - return actualIndentation + indentationDelta; + var useActualIndentation = true; + if (ignoreActualIndentationRange) { + var start = current.getStart(sourceFile); + useActualIndentation = start < ignoreActualIndentationRange.pos || start > ignoreActualIndentationRange.end; } - parentStart = sourceFile.getLineAndCharacterFromPosition(parent.getStart(sourceFile)); + if (useActualIndentation) { + var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation + indentationDelta; + } + } + parentStart = getParentStart(parent, current, sourceFile); var parentAndChildShareLine = parentStart.line === currentStart.line || childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); - var actualIndentation = getActualIndentationForNode(current, parent, currentStart, parentAndChildShareLine, sourceFile, options); - if (actualIndentation !== -1) { - return actualIndentation + indentationDelta; + if (useActualIndentation) { + var actualIndentation = getActualIndentationForNode(current, parent, currentStart, parentAndChildShareLine, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation + indentationDelta; + } } - if (nodeContentIsIndented(parent, current) && !parentAndChildShareLine) { - indentationDelta += options.indentSpaces; + if (shouldIndentChildNode(parent.kind, current.kind) && !parentAndChildShareLine) { + indentationDelta += options.IndentSize; } current = parent; currentStart = parentStart; @@ -30860,14 +17351,20 @@ var ts; } return indentationDelta; } - SmartIndenter.getIndentation = getIndentation; + function getParentStart(parent, child, sourceFile) { + var containingList = getContainingList(child, sourceFile); + if (containingList) { + return sourceFile.getLineAndCharacterFromPosition(containingList.pos); + } + return sourceFile.getLineAndCharacterFromPosition(parent.getStart(sourceFile)); + } function getActualIndentationForListItemBeforeComma(commaToken, sourceFile, options) { var commaItemInfo = ts.findListItemInfo(commaToken); ts.Debug.assert(commaItemInfo && commaItemInfo.listItemIndex > 0); return deriveActualIndentationFromList(commaItemInfo.list.getChildren(), commaItemInfo.listItemIndex - 1, sourceFile, options); } function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { - var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && (parent.kind === 193 /* SourceFile */ || !parentAndChildShareLine); + var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && (parent.kind === 196 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1; } @@ -30894,46 +17391,58 @@ var ts; return candidate.end > position || !isCompletedNode(candidate, sourceFile); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 162 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 165 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 74 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; return elseKeywordStartLine === childStartLine; } + return false; } - function getActualIndentationForListItem(node, sourceFile, options) { + SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement = childStartsOnTheSameLineWithElseInIfStatement; + function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { case 132 /* TypeReference */: - if (node.parent.typeArguments) { - return getActualIndentationFromList(node.parent.typeArguments); + if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { + return node.parent.typeArguments; } break; - case 140 /* ObjectLiteral */: - return getActualIndentationFromList(node.parent.properties); - case 134 /* TypeLiteral */: - return getActualIndentationFromList(node.parent.members); - case 139 /* ArrayLiteral */: - return getActualIndentationFromList(node.parent.elements); - case 182 /* FunctionDeclaration */: - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 142 /* ObjectLiteral */: + return node.parent.properties; + case 141 /* ArrayLiteral */: + return node.parent.elements; + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: case 125 /* Method */: case 129 /* CallSignature */: case 130 /* ConstructSignature */: - if (node.parent.typeParameters && node.end < node.parent.typeParameters.end) { - return getActualIndentationFromList(node.parent.typeParameters); + var start = node.getStart(sourceFile); + if (node.parent.typeParameters && ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { + return node.parent.typeParameters; } - return getActualIndentationFromList(node.parent.parameters); - case 145 /* NewExpression */: - case 144 /* CallExpression */: - if (node.parent.typeArguments && node.end < node.parent.typeArguments.end) { - return getActualIndentationFromList(node.parent.typeArguments); + if (ts.rangeContainsStartEnd(node.parent.parameters, start, node.getEnd())) { + return node.parent.parameters; } - return getActualIndentationFromList(node.parent.arguments); + break; + case 148 /* NewExpression */: + case 147 /* CallExpression */: + var start = node.getStart(sourceFile); + if (node.parent.typeArguments && ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { + return node.parent.typeArguments; + } + if (ts.rangeContainsStartEnd(node.parent.arguments, start, node.getEnd())) { + return node.parent.arguments; + } + break; } } - return -1; + return undefined; + } + function getActualIndentationForListItem(node, sourceFile, options) { + var containingList = getContainingList(node, sourceFile); + return containingList ? getActualIndentationFromList(containingList) : -1; function getActualIndentationFromList(list) { var index = ts.indexOf(list, node); return index !== -1 ? deriveActualIndentationFromList(list, index, sourceFile, options) : -1; @@ -30957,14 +17466,17 @@ var ts; } function findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options) { var lineStart = sourceFile.getPositionFromLineAndCharacter(lineAndCharacter.line, 1); + return findFirstNonWhitespaceColumn(lineStart, lineStart + lineAndCharacter.character, sourceFile, options); + } + function findFirstNonWhitespaceColumn(startPos, endPos, sourceFile, options) { var column = 0; - for (var i = 0; i < lineAndCharacter.character; ++i) { - var charCode = sourceFile.text.charCodeAt(lineStart + i); - if (!ts.isWhiteSpace(charCode)) { + for (var pos = startPos; pos < endPos; ++pos) { + var ch = sourceFile.text.charCodeAt(pos); + if (!ts.isWhiteSpace(ch)) { return column; } - if (charCode === 9 /* tab */) { - column += options.spacesPerTab; + if (ch === 9 /* tab */) { + column += options.TabSize + (column % options.TabSize); } else { column++; @@ -30972,52 +17484,59 @@ var ts; } return column; } - function nodeContentIsIndented(parent, child) { - switch (parent.kind) { - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: - case 187 /* EnumDeclaration */: + SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; + function nodeContentIsAlwaysIndented(kind) { + switch (kind) { + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: + case 141 /* ArrayLiteral */: + case 161 /* Block */: + case 186 /* FunctionBlock */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 192 /* ModuleBlock */: + case 142 /* ObjectLiteral */: + case 136 /* TypeLiteral */: + case 174 /* SwitchStatement */: + case 176 /* DefaultClause */: + case 175 /* CaseClause */: + case 151 /* ParenExpression */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: + case 162 /* VariableStatement */: + case 184 /* VariableDeclaration */: + case 194 /* ExportAssignment */: + case 172 /* ReturnStatement */: return true; - case 188 /* ModuleDeclaration */: - return false; - case 182 /* FunctionDeclaration */: + } + return false; + } + function shouldIndentChildNode(parent, child) { + if (nodeContentIsAlwaysIndented(parent)) { + return true; + } + switch (parent) { + case 166 /* DoStatement */: + case 167 /* WhileStatement */: + case 169 /* ForInStatement */: + case 168 /* ForStatement */: + case 165 /* IfStatement */: + return child !== 161 /* Block */; + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: case 125 /* Method */: - case 149 /* FunctionExpression */: + case 153 /* ArrowFunction */: + case 126 /* Constructor */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 126 /* Constructor */: - return false; - case 163 /* DoStatement */: - case 164 /* WhileStatement */: - case 166 /* ForInStatement */: - case 165 /* ForStatement */: - return child && child.kind !== 158 /* Block */; - case 162 /* IfStatement */: - return child && child.kind !== 158 /* Block */; - case 176 /* TryStatement */: - return false; - case 139 /* ArrayLiteral */: - case 158 /* Block */: - case 183 /* FunctionBlock */: - case 177 /* TryBlock */: - case 178 /* CatchBlock */: - case 179 /* FinallyBlock */: - case 189 /* ModuleBlock */: - case 140 /* ObjectLiteral */: - case 134 /* TypeLiteral */: - case 171 /* SwitchStatement */: - case 173 /* DefaultClause */: - case 172 /* CaseClause */: - case 148 /* ParenExpression */: - case 144 /* CallExpression */: - case 145 /* NewExpression */: - case 159 /* VariableStatement */: - case 181 /* VariableDeclaration */: - return true; + return child !== 186 /* FunctionBlock */; default: return false; } } + SmartIndenter.shouldIndentChildNode = shouldIndentChildNode; function nodeEndsWith(n, expectedLastToken, sourceFile) { var children = n.getChildren(sourceFile); if (children.length) { @@ -31033,46 +17552,46 @@ var ts; } function isCompletedNode(n, sourceFile) { switch (n.kind) { - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: - case 187 /* EnumDeclaration */: - case 140 /* ObjectLiteral */: - case 158 /* Block */: - case 178 /* CatchBlock */: - case 179 /* FinallyBlock */: - case 183 /* FunctionBlock */: - case 189 /* ModuleBlock */: - case 171 /* SwitchStatement */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: + case 142 /* ObjectLiteral */: + case 161 /* Block */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: + case 174 /* SwitchStatement */: return nodeEndsWith(n, 14 /* CloseBraceToken */, sourceFile); - case 148 /* ParenExpression */: + case 151 /* ParenExpression */: case 129 /* CallSignature */: - case 144 /* CallExpression */: + case 147 /* CallExpression */: case 130 /* ConstructSignature */: return nodeEndsWith(n, 16 /* CloseParenToken */, sourceFile); - case 182 /* FunctionDeclaration */: - case 149 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: case 125 /* Method */: - case 150 /* ArrowFunction */: + case 153 /* ArrowFunction */: return !n.body || isCompletedNode(n.body, sourceFile); - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return n.body && isCompletedNode(n.body, sourceFile); - case 162 /* IfStatement */: + case 165 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 161 /* ExpressionStatement */: + case 164 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile); - case 139 /* ArrayLiteral */: + case 141 /* ArrayLiteral */: return nodeEndsWith(n, 18 /* CloseBracketToken */, sourceFile); case 120 /* Missing */: return false; - case 172 /* CaseClause */: - case 173 /* DefaultClause */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: return false; - case 164 /* WhileStatement */: + case 167 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 163 /* DoStatement */: + case 166 /* DoStatement */: var hasWhileKeyword = ts.findChildOfKind(n, 98 /* WhileKeyword */, sourceFile); if (hasWhileKeyword) { return nodeEndsWith(n, 16 /* CloseParenToken */, sourceFile); @@ -31085,93 +17604,1739 @@ var ts; })(SmartIndenter = formatting.SmartIndenter || (formatting.SmartIndenter = {})); })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); -var TypeScript; -(function (TypeScript) { - var NullLogger = (function () { - function NullLogger() { - } - NullLogger.prototype.log = function (s) { - }; - return NullLogger; - })(); - TypeScript.NullLogger = NullLogger; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var proto = "__proto__"; - var BlockIntrinsics = (function () { - function BlockIntrinsics() { - this.prototype = undefined; - this.toString = undefined; - this.toLocaleString = undefined; - this.valueOf = undefined; - this.hasOwnProperty = undefined; - this.propertyIsEnumerable = undefined; - this.isPrototypeOf = undefined; - this["constructor"] = undefined; - this[proto] = null; - this[proto] = undefined; - } - return BlockIntrinsics; - })(); - function createIntrinsicsObject() { - return new BlockIntrinsics(); - } - TypeScript.createIntrinsicsObject = createIntrinsicsObject; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function stripStartAndEndQuotes(str) { - var firstCharCode = str && str.charCodeAt(0); - if (str && str.length >= 2 && firstCharCode === str.charCodeAt(str.length - 1) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) { - return str.substring(1, str.length - 1); - } - return str; - } - TypeScript.stripStartAndEndQuotes = stripStartAndEndQuotes; - var switchToForwardSlashesRegEx = /\\/g; - function switchToForwardSlashes(path) { - return path.replace(switchToForwardSlashesRegEx, "/"); - } - TypeScript.switchToForwardSlashes = switchToForwardSlashes; - function isFileOfExtension(fname, ext) { - var invariantFname = fname.toLocaleUpperCase(); - var invariantExt = ext.toLocaleUpperCase(); - var extLength = invariantExt.length; - return invariantFname.length > extLength && invariantFname.substring(invariantFname.length - extLength, invariantFname.length) === invariantExt; - } - function isDTSFile(fname) { - return isFileOfExtension(fname, ".d.ts"); - } - TypeScript.isDTSFile = isDTSFile; - function getPathComponents(path) { - return path.split("/"); - } - TypeScript.getPathComponents = getPathComponents; - var normalizePathRegEx = /^\\\\[^\\]/; - function normalizePath(path) { - if (normalizePathRegEx.test(path)) { - path = "file:" + path; - } - var parts = getPathComponents(switchToForwardSlashes(path)); - var normalizedParts = []; - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - if (part === ".") { - continue; - } - if (normalizedParts.length > 0 && TypeScript.ArrayUtilities.last(normalizedParts) !== ".." && part === "..") { - normalizedParts.pop(); - continue; - } - normalizedParts.push(part); - } - return normalizedParts.join("/"); - } - TypeScript.normalizePath = normalizePath; -})(TypeScript || (TypeScript = {})); var ts; (function (ts) { + var formatting; + (function (formatting) { + var internedTabsIndentation; + var internedSpacesIndentation; + function getIndentationString(indentation, options) { + if (!options.ConvertTabsToSpaces) { + var tabs = Math.floor(indentation / options.TabSize); + var spaces = indentation - tabs * options.TabSize; + var tabString; + if (!internedTabsIndentation) { + internedTabsIndentation = []; + } + if (internedTabsIndentation[tabs] === undefined) { + internedTabsIndentation[tabs] = tabString = repeat('\t', tabs); + } + else { + tabString = internedTabsIndentation[tabs]; + } + return spaces ? tabString + repeat(" ", spaces) : tabString; + } + else { + var spacesString; + var quotient = Math.floor(indentation / options.IndentSize); + var remainder = indentation % options.IndentSize; + if (!internedSpacesIndentation) { + internedSpacesIndentation = []; + } + if (internedSpacesIndentation[quotient] === undefined) { + spacesString = repeat(" ", options.IndentSize * quotient); + internedSpacesIndentation[quotient] = spacesString; + } + else { + spacesString = internedSpacesIndentation[quotient]; + } + return remainder ? spacesString + repeat(" ", remainder) : spacesString; + } + function repeat(value, count) { + var s = ""; + for (var i = 0; i < count; ++i) { + s += value; + } + return s; + } + } + formatting.getIndentationString = getIndentationString; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var scanner = ts.createScanner(2 /* Latest */, false); + function getFormattingScanner(sourceFile, startPos, endPos) { + scanner.setText(sourceFile.text); + scanner.setTextPos(startPos); + var wasNewLine = true; + var leadingTrivia; + var trailingTrivia; + var savedPos; + var lastScanAction; + var lastTokenInfo; + return { + advance: advance, + readTokenInfo: readTokenInfo, + isOnToken: isOnToken, + lastTrailingTriviaWasNewLine: function () { return wasNewLine; }, + close: function () { + lastTokenInfo = undefined; + scanner.setText(undefined); + } + }; + function advance() { + lastTokenInfo = undefined; + var isStarted = scanner.getStartPos() !== startPos; + if (isStarted) { + if (trailingTrivia) { + ts.Debug.assert(trailingTrivia.length !== 0); + wasNewLine = trailingTrivia[trailingTrivia.length - 1].kind === 4 /* NewLineTrivia */; + } + else { + wasNewLine = false; + } + } + leadingTrivia = undefined; + trailingTrivia = undefined; + if (!isStarted) { + scanner.scan(); + } + var t; + var pos = scanner.getStartPos(); + while (pos < endPos) { + var t = scanner.getToken(); + if (!ts.isTrivia(t)) { + break; + } + scanner.scan(); + var item = { + pos: pos, + end: scanner.getStartPos(), + kind: t + }; + pos = scanner.getStartPos(); + if (!leadingTrivia) { + leadingTrivia = []; + } + leadingTrivia.push(item); + } + savedPos = scanner.getStartPos(); + } + function shouldRescanGreaterThanToken(container) { + if (container.kind !== 156 /* BinaryExpression */) { + return false; + } + switch (container.operator) { + case 26 /* GreaterThanEqualsToken */: + case 58 /* GreaterThanGreaterThanEqualsToken */: + case 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 41 /* GreaterThanGreaterThanGreaterThanToken */: + case 40 /* GreaterThanGreaterThanToken */: + return true; + } + return false; + } + function shouldRescanSlashToken(container) { + return container.kind === 8 /* RegularExpressionLiteral */; + } + function shouldRescanTemplateToken(container) { + return container.kind === 159 /* TemplateSpan */; + } + function startsWithSlashToken(t) { + return t === 35 /* SlashToken */ || t === 55 /* SlashEqualsToken */; + } + function readTokenInfo(n) { + if (!isOnToken()) { + return { + leadingTrivia: leadingTrivia, + trailingTrivia: undefined, + token: undefined + }; + } + var expectedScanAction = shouldRescanGreaterThanToken(n) ? 1 /* RescanGreaterThanToken */ : shouldRescanSlashToken(n) ? 2 /* RescanSlashToken */ : shouldRescanTemplateToken(n) ? 3 /* RescanTemplateToken */ : 0 /* Scan */; + if (lastTokenInfo && expectedScanAction === lastScanAction) { + return lastTokenInfo; + } + if (scanner.getStartPos() !== savedPos) { + ts.Debug.assert(lastTokenInfo !== undefined); + scanner.setTextPos(savedPos); + scanner.scan(); + } + var currentToken = scanner.getToken(); + if (expectedScanAction === 1 /* RescanGreaterThanToken */ && currentToken === 24 /* GreaterThanToken */) { + currentToken = scanner.reScanGreaterToken(); + ts.Debug.assert(n.operator === currentToken); + lastScanAction = 1 /* RescanGreaterThanToken */; + } + else if (expectedScanAction === 2 /* RescanSlashToken */ && startsWithSlashToken(currentToken)) { + currentToken = scanner.reScanSlashToken(); + ts.Debug.assert(n.kind === currentToken); + lastScanAction = 2 /* RescanSlashToken */; + } + else if (expectedScanAction === 3 /* RescanTemplateToken */ && currentToken === 14 /* CloseBraceToken */) { + currentToken = scanner.reScanTemplateToken(); + lastScanAction = 3 /* RescanTemplateToken */; + } + else { + lastScanAction = 0 /* Scan */; + } + var token = { + pos: scanner.getStartPos(), + end: scanner.getTextPos(), + kind: currentToken + }; + while (scanner.getStartPos() < endPos) { + currentToken = scanner.scan(); + if (!ts.isTrivia(currentToken)) { + break; + } + var trivia = { + pos: scanner.getStartPos(), + end: scanner.getTextPos(), + kind: currentToken + }; + if (!trailingTrivia) { + trailingTrivia = []; + } + trailingTrivia.push(trivia); + if (currentToken === 4 /* NewLineTrivia */) { + scanner.scan(); + break; + } + } + return lastTokenInfo = { + leadingTrivia: leadingTrivia, + trailingTrivia: trailingTrivia, + token: token + }; + } + function isOnToken() { + var current = (lastTokenInfo && lastTokenInfo.token.kind) || scanner.getToken(); + var startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); + return startPos < endPos && current !== 1 /* EndOfFileToken */ && !ts.isTrivia(current); + } + } + formatting.getFormattingScanner = getFormattingScanner; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var FormattingContext = (function () { + function FormattingContext(sourceFile, formattingRequestKind) { + this.sourceFile = sourceFile; + this.formattingRequestKind = formattingRequestKind; + } + FormattingContext.prototype.updateContext = function (currentRange, currentTokenParent, nextRange, nextTokenParent, commonParent) { + ts.Debug.assert(currentRange !== undefined, "currentTokenSpan is null"); + ts.Debug.assert(currentTokenParent !== undefined, "currentTokenParent is null"); + ts.Debug.assert(nextRange !== undefined, "nextTokenSpan is null"); + ts.Debug.assert(nextTokenParent !== undefined, "nextTokenParent is null"); + ts.Debug.assert(commonParent !== undefined, "commonParent is null"); + this.currentTokenSpan = currentRange; + this.currentTokenParent = currentTokenParent; + this.nextTokenSpan = nextRange; + this.nextTokenParent = nextTokenParent; + this.contextNode = commonParent; + this.contextNodeAllOnSameLine = undefined; + this.nextNodeAllOnSameLine = undefined; + this.tokensAreOnSameLine = undefined; + this.contextNodeBlockIsOnOneLine = undefined; + this.nextNodeBlockIsOnOneLine = undefined; + }; + FormattingContext.prototype.ContextNodeAllOnSameLine = function () { + if (this.contextNodeAllOnSameLine === undefined) { + this.contextNodeAllOnSameLine = this.NodeIsOnOneLine(this.contextNode); + } + return this.contextNodeAllOnSameLine; + }; + FormattingContext.prototype.NextNodeAllOnSameLine = function () { + if (this.nextNodeAllOnSameLine === undefined) { + this.nextNodeAllOnSameLine = this.NodeIsOnOneLine(this.nextTokenParent); + } + return this.nextNodeAllOnSameLine; + }; + FormattingContext.prototype.TokensAreOnSameLine = function () { + if (this.tokensAreOnSameLine === undefined) { + var startLine = this.sourceFile.getLineAndCharacterFromPosition(this.currentTokenSpan.pos).line; + var endLine = this.sourceFile.getLineAndCharacterFromPosition(this.nextTokenSpan.pos).line; + this.tokensAreOnSameLine = (startLine == endLine); + } + return this.tokensAreOnSameLine; + }; + FormattingContext.prototype.ContextNodeBlockIsOnOneLine = function () { + if (this.contextNodeBlockIsOnOneLine === undefined) { + this.contextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.contextNode); + } + return this.contextNodeBlockIsOnOneLine; + }; + FormattingContext.prototype.NextNodeBlockIsOnOneLine = function () { + if (this.nextNodeBlockIsOnOneLine === undefined) { + this.nextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.nextTokenParent); + } + return this.nextNodeBlockIsOnOneLine; + }; + FormattingContext.prototype.NodeIsOnOneLine = function (node) { + var startLine = this.sourceFile.getLineAndCharacterFromPosition(node.getStart(this.sourceFile)).line; + var endLine = this.sourceFile.getLineAndCharacterFromPosition(node.getEnd()).line; + return startLine == endLine; + }; + FormattingContext.prototype.BlockIsOnOneLine = function (node) { + var openBrace = ts.findChildOfKind(node, 13 /* OpenBraceToken */, this.sourceFile); + var closeBrace = ts.findChildOfKind(node, 14 /* CloseBraceToken */, this.sourceFile); + if (openBrace && closeBrace) { + var startLine = this.sourceFile.getLineAndCharacterFromPosition(openBrace.getEnd()).line; + var endLine = this.sourceFile.getLineAndCharacterFromPosition(closeBrace.getStart(this.sourceFile)).line; + return startLine === endLine; + } + return false; + }; + return FormattingContext; + })(); + formatting.FormattingContext = FormattingContext; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var Rule = (function () { + function Rule(Descriptor, Operation, Flag) { + if (Flag === void 0) { Flag = 0 /* None */; } + this.Descriptor = Descriptor; + this.Operation = Operation; + this.Flag = Flag; + } + Rule.prototype.toString = function () { + return "[desc=" + this.Descriptor + "," + "operation=" + this.Operation + "," + "flag=" + this.Flag + "]"; + }; + return Rule; + })(); + formatting.Rule = Rule; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var RuleDescriptor = (function () { + function RuleDescriptor(LeftTokenRange, RightTokenRange) { + this.LeftTokenRange = LeftTokenRange; + this.RightTokenRange = RightTokenRange; + } + RuleDescriptor.prototype.toString = function () { + return "[leftRange=" + this.LeftTokenRange + "," + "rightRange=" + this.RightTokenRange + "]"; + }; + RuleDescriptor.create1 = function (left, right) { + return RuleDescriptor.create4(formatting.Shared.TokenRange.FromToken(left), formatting.Shared.TokenRange.FromToken(right)); + }; + RuleDescriptor.create2 = function (left, right) { + return RuleDescriptor.create4(left, formatting.Shared.TokenRange.FromToken(right)); + }; + RuleDescriptor.create3 = function (left, right) { + return RuleDescriptor.create4(formatting.Shared.TokenRange.FromToken(left), right); + }; + RuleDescriptor.create4 = function (left, right) { + return new RuleDescriptor(left, right); + }; + return RuleDescriptor; + })(); + formatting.RuleDescriptor = RuleDescriptor; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var RuleOperation = (function () { + function RuleOperation() { + this.Context = null; + this.Action = null; + } + RuleOperation.prototype.toString = function () { + return "[context=" + this.Context + "," + "action=" + this.Action + "]"; + }; + RuleOperation.create1 = function (action) { + return RuleOperation.create2(formatting.RuleOperationContext.Any, action); + }; + RuleOperation.create2 = function (context, action) { + var result = new RuleOperation(); + result.Context = context; + result.Action = action; + return result; + }; + return RuleOperation; + })(); + formatting.RuleOperation = RuleOperation; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var RuleOperationContext = (function () { + function RuleOperationContext() { + var funcs = []; + for (var _i = 0; _i < arguments.length; _i++) { + funcs[_i - 0] = arguments[_i]; + } + this.customContextChecks = funcs; + } + RuleOperationContext.prototype.IsAny = function () { + return this == RuleOperationContext.Any; + }; + RuleOperationContext.prototype.InContext = function (context) { + if (this.IsAny()) { + return true; + } + for (var i = 0, len = this.customContextChecks.length; i < len; i++) { + if (!this.customContextChecks[i](context)) { + return false; + } + } + return true; + }; + RuleOperationContext.Any = new RuleOperationContext(); + return RuleOperationContext; + })(); + formatting.RuleOperationContext = RuleOperationContext; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var Rules = (function () { + function Rules() { + this.IgnoreBeforeComment = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.Comments), formatting.RuleOperation.create1(1 /* Ignore */)); + this.IgnoreAfterLineComment = new formatting.Rule(formatting.RuleDescriptor.create3(2 /* SingleLineCommentTrivia */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create1(1 /* Ignore */)); + this.NoSpaceBeforeSemicolon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 21 /* SemicolonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeColon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 50 /* ColonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); + this.NoSpaceBeforeQMark = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 49 /* QuestionToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); + this.SpaceAfterColon = new formatting.Rule(formatting.RuleDescriptor.create3(50 /* ColonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 2 /* Space */)); + this.SpaceAfterQMark = new formatting.Rule(formatting.RuleDescriptor.create3(49 /* QuestionToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 2 /* Space */)); + this.SpaceAfterSemicolon = new formatting.Rule(formatting.RuleDescriptor.create3(21 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(14 /* CloseBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2 /* Space */)); + this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(14 /* CloseBraceToken */, 74 /* ElseKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(14 /* CloseBraceToken */, 98 /* WhileKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(14 /* CloseBraceToken */, formatting.Shared.TokenRange.FromTokens([16 /* CloseParenToken */, 18 /* CloseBracketToken */, 22 /* CommaToken */, 21 /* SemicolonToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 19 /* DotToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(19 /* DotToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* OpenBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(17 /* OpenBracketToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18 /* CloseBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(18 /* CloseBracketToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.FunctionOpenBraceLeftTokenRange = formatting.Shared.TokenRange.AnyIncludingMultilineComments; + this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 13 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); + this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([63 /* Identifier */, 3 /* MultiLineCommentTrivia */]); + this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 13 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); + this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([16 /* CloseParenToken */, 3 /* MultiLineCommentTrivia */, 73 /* DoKeyword */, 94 /* TryKeyword */, 79 /* FinallyKeyword */, 74 /* ElseKeyword */]); + this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 13 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); + this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(13 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2 /* Space */)); + this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 14 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2 /* Space */)); + this.NoSpaceBetweenEmptyBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(13 /* OpenBraceToken */, 14 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectContext), 8 /* Delete */)); + this.NewLineAfterOpenBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create3(13 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4 /* NewLine */)); + this.NewLineBeforeCloseBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.AnyIncludingMultilineComments, 14 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4 /* NewLine */)); + this.NoSpaceAfterUnaryPrefixOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.UnaryPrefixOperators, formatting.Shared.TokenRange.UnaryPrefixExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); + this.NoSpaceAfterUnaryPreincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(37 /* PlusPlusToken */, formatting.Shared.TokenRange.UnaryPreincrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterUnaryPredecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(38 /* MinusMinusToken */, formatting.Shared.TokenRange.UnaryPredecrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeUnaryPostincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostincrementExpressions, 37 /* PlusPlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeUnaryPostdecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostdecrementExpressions, 38 /* MinusMinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterPostincrementWhenFollowedByAdd = new formatting.Rule(formatting.RuleDescriptor.create1(37 /* PlusPlusToken */, 32 /* PlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterAddWhenFollowedByUnaryPlus = new formatting.Rule(formatting.RuleDescriptor.create1(32 /* PlusToken */, 32 /* PlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterAddWhenFollowedByPreincrement = new formatting.Rule(formatting.RuleDescriptor.create1(32 /* PlusToken */, 37 /* PlusPlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterPostdecrementWhenFollowedBySubtract = new formatting.Rule(formatting.RuleDescriptor.create1(38 /* MinusMinusToken */, 33 /* MinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new formatting.Rule(formatting.RuleDescriptor.create1(33 /* MinusToken */, 33 /* MinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(33 /* MinusToken */, 38 /* MinusMinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 22 /* CommaToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([96 /* VarKeyword */, 92 /* ThrowKeyword */, 86 /* NewKeyword */, 72 /* DeleteKeyword */, 88 /* ReturnKeyword */, 95 /* TypeOfKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 15 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext), 8 /* Delete */)); + this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(81 /* FunctionKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 15 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 8 /* Delete */)); + this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(97 /* VoidKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsVoidOpContext), 2 /* Space */)); + this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(88 /* ReturnKeyword */, 21 /* SemicolonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([16 /* CloseParenToken */, 73 /* DoKeyword */, 74 /* ElseKeyword */, 65 /* CaseKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotForContext), 2 /* Space */)); + this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([94 /* TryKeyword */, 79 /* FinallyKeyword */]), 13 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([113 /* GetKeyword */, 117 /* SetKeyword */]), 63 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + this.SpaceBeforeBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryKeywordOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(111 /* ConstructorKeyword */, 15 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([114 /* ModuleKeyword */, 115 /* RequireKeyword */]), 15 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([67 /* ClassKeyword */, 112 /* DeclareKeyword */, 75 /* EnumKeyword */, 76 /* ExportKeyword */, 77 /* ExtendsKeyword */, 113 /* GetKeyword */, 100 /* ImplementsKeyword */, 83 /* ImportKeyword */, 101 /* InterfaceKeyword */, 114 /* ModuleKeyword */, 104 /* PrivateKeyword */, 106 /* PublicKeyword */, 117 /* SetKeyword */, 107 /* StaticKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([77 /* ExtendsKeyword */, 100 /* ImplementsKeyword */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(7 /* StringLiteral */, 13 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2 /* Space */)); + this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(31 /* EqualsGreaterThanToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(20 /* DotDotDotToken */, 63 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(49 /* QuestionToken */, formatting.Shared.TokenRange.FromTokens([16 /* CloseParenToken */, 22 /* CommaToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); + this.NoSpaceBeforeOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.TypeNames, 23 /* LessThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + this.NoSpaceBetweenCloseParenAndAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create1(16 /* CloseParenToken */, 23 /* LessThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + this.NoSpaceAfterOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(23 /* LessThanToken */, formatting.Shared.TokenRange.TypeNames), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + this.NoSpaceBeforeCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 24 /* GreaterThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(24 /* GreaterThanToken */, formatting.Shared.TokenRange.FromTokens([15 /* OpenParenToken */, 17 /* OpenBracketToken */, 24 /* GreaterThanToken */, 22 /* CommaToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); + this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(13 /* OpenBraceToken */, 14 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), 8 /* Delete */)); + this.HighPriorityCommonRules = [ + this.IgnoreBeforeComment, + this.IgnoreAfterLineComment, + this.NoSpaceBeforeColon, + this.SpaceAfterColon, + this.NoSpaceBeforeQMark, + this.SpaceAfterQMark, + this.NoSpaceBeforeDot, + this.NoSpaceAfterDot, + this.NoSpaceAfterUnaryPrefixOperator, + this.NoSpaceAfterUnaryPreincrementOperator, + this.NoSpaceAfterUnaryPredecrementOperator, + this.NoSpaceBeforeUnaryPostincrementOperator, + this.NoSpaceBeforeUnaryPostdecrementOperator, + this.SpaceAfterPostincrementWhenFollowedByAdd, + this.SpaceAfterAddWhenFollowedByUnaryPlus, + this.SpaceAfterAddWhenFollowedByPreincrement, + this.SpaceAfterPostdecrementWhenFollowedBySubtract, + this.SpaceAfterSubtractWhenFollowedByUnaryMinus, + this.SpaceAfterSubtractWhenFollowedByPredecrement, + this.NoSpaceAfterCloseBrace, + this.SpaceAfterOpenBrace, + this.SpaceBeforeCloseBrace, + this.NewLineBeforeCloseBraceInBlockContext, + this.SpaceAfterCloseBrace, + this.SpaceBetweenCloseBraceAndElse, + this.SpaceBetweenCloseBraceAndWhile, + this.NoSpaceBetweenEmptyBraceBrackets, + this.SpaceAfterFunctionInFuncDecl, + this.NewLineAfterOpenBraceInBlockContext, + this.SpaceAfterGetSetInMember, + this.NoSpaceBetweenReturnAndSemicolon, + this.SpaceAfterCertainKeywords, + this.NoSpaceBeforeOpenParenInFuncCall, + this.SpaceBeforeBinaryKeywordOperator, + this.SpaceAfterBinaryKeywordOperator, + this.SpaceAfterVoidOperator, + this.NoSpaceAfterConstructor, + this.NoSpaceAfterModuleImport, + this.SpaceAfterCertainTypeScriptKeywords, + this.SpaceBeforeCertainTypeScriptKeywords, + this.SpaceAfterModuleName, + this.SpaceAfterArrow, + this.NoSpaceAfterEllipsis, + this.NoSpaceAfterOptionalParameters, + this.NoSpaceBetweenEmptyInterfaceBraceBrackets, + this.NoSpaceBeforeOpenAngularBracket, + this.NoSpaceBetweenCloseParenAndAngularBracket, + this.NoSpaceAfterOpenAngularBracket, + this.NoSpaceBeforeCloseAngularBracket, + this.NoSpaceAfterCloseAngularBracket + ]; + this.LowPriorityCommonRules = [ + this.NoSpaceBeforeSemicolon, + this.SpaceBeforeOpenBraceInControl, + this.SpaceBeforeOpenBraceInFunction, + this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock, + this.NoSpaceBeforeComma, + this.NoSpaceBeforeOpenBracket, + this.NoSpaceAfterOpenBracket, + this.NoSpaceBeforeCloseBracket, + this.NoSpaceAfterCloseBracket, + this.SpaceAfterSemicolon, + this.NoSpaceBeforeOpenParenInFuncDecl, + this.SpaceBetweenStatements, + this.SpaceAfterTryFinally + ]; + this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(22 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(22 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.SpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); + this.NoSpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 8 /* Delete */)); + this.NoSpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 8 /* Delete */)); + this.SpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 15 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 2 /* Space */)); + this.NoSpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 15 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 8 /* Delete */)); + this.NewLineBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 13 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); + this.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 13 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); + this.NewLineBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 13 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); + this.SpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(21 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 2 /* Space */)); + this.NoSpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(21 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 8 /* Delete */)); + this.SpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(15 /* OpenParenToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.SpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); + this.NoSpaceBetweenParens = new formatting.Rule(formatting.RuleDescriptor.create1(15 /* OpenParenToken */, 16 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(15 /* OpenParenToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.NoSpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); + this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(81 /* FunctionKeyword */, 15 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); + this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(81 /* FunctionKeyword */, 15 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 8 /* Delete */)); + } + Rules.prototype.getRuleName = function (rule) { + var o = this; + for (var name in o) { + if (o[name] === rule) { + return name; + } + } + throw new Error("Unknown rule"); + }; + Rules.IsForContext = function (context) { + return context.contextNode.kind === 168 /* ForStatement */; + }; + Rules.IsNotForContext = function (context) { + return !Rules.IsForContext(context); + }; + Rules.IsBinaryOpContext = function (context) { + switch (context.contextNode.kind) { + case 156 /* BinaryExpression */: + case 157 /* ConditionalExpression */: + return true; + case 193 /* ImportDeclaration */: + case 184 /* VariableDeclaration */: + case 123 /* Parameter */: + case 195 /* EnumMember */: + case 124 /* Property */: + return context.currentTokenSpan.kind === 51 /* EqualsToken */ || context.nextTokenSpan.kind === 51 /* EqualsToken */; + case 169 /* ForInStatement */: + return context.currentTokenSpan.kind === 84 /* InKeyword */ || context.nextTokenSpan.kind === 84 /* InKeyword */; + } + return false; + }; + Rules.IsNotBinaryOpContext = function (context) { + return !Rules.IsBinaryOpContext(context); + }; + Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { + return context.TokensAreOnSameLine() || Rules.IsBeforeMultilineBlockContext(context); + }; + Rules.IsBeforeMultilineBlockContext = function (context) { + return Rules.IsBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine()); + }; + Rules.IsMultilineBlockContext = function (context) { + return Rules.IsBlockContext(context) && !(context.ContextNodeAllOnSameLine() || context.ContextNodeBlockIsOnOneLine()); + }; + Rules.IsSingleLineBlockContext = function (context) { + return Rules.IsBlockContext(context) && (context.ContextNodeAllOnSameLine() || context.ContextNodeBlockIsOnOneLine()); + }; + Rules.IsBlockContext = function (context) { + return Rules.NodeIsBlockContext(context.contextNode); + }; + Rules.IsBeforeBlockContext = function (context) { + return Rules.NodeIsBlockContext(context.nextTokenParent); + }; + Rules.NodeIsBlockContext = function (node) { + if (Rules.NodeIsTypeScriptDeclWithBlockContext(node)) { + return true; + } + switch (node.kind) { + case 161 /* Block */: + case 174 /* SwitchStatement */: + case 142 /* ObjectLiteral */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: + return true; + } + return false; + }; + Rules.IsFunctionDeclContext = function (context) { + switch (context.contextNode.kind) { + case 185 /* FunctionDeclaration */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 129 /* CallSignature */: + case 152 /* FunctionExpression */: + case 126 /* Constructor */: + case 153 /* ArrowFunction */: + case 188 /* InterfaceDeclaration */: + return true; + } + return false; + }; + Rules.IsTypeScriptDeclWithBlockContext = function (context) { + return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode); + }; + Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { + switch (node.kind) { + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: + case 136 /* TypeLiteral */: + case 191 /* ModuleDeclaration */: + return true; + } + return false; + }; + Rules.IsAfterCodeBlockContext = function (context) { + switch (context.currentTokenParent.kind) { + case 187 /* ClassDeclaration */: + case 191 /* ModuleDeclaration */: + case 190 /* EnumDeclaration */: + case 161 /* Block */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 186 /* FunctionBlock */: + case 192 /* ModuleBlock */: + case 174 /* SwitchStatement */: + return true; + } + return false; + }; + Rules.IsControlDeclContext = function (context) { + switch (context.contextNode.kind) { + case 165 /* IfStatement */: + case 174 /* SwitchStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 167 /* WhileStatement */: + case 179 /* TryStatement */: + case 166 /* DoStatement */: + case 173 /* WithStatement */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + return true; + default: + return false; + } + }; + Rules.IsObjectContext = function (context) { + return context.contextNode.kind === 142 /* ObjectLiteral */; + }; + Rules.IsFunctionCallContext = function (context) { + return context.contextNode.kind === 147 /* CallExpression */; + }; + Rules.IsNewContext = function (context) { + return context.contextNode.kind === 148 /* NewExpression */; + }; + Rules.IsFunctionCallOrNewContext = function (context) { + return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); + }; + Rules.IsSameLineTokenContext = function (context) { + return context.TokensAreOnSameLine(); + }; + Rules.IsNotFormatOnEnter = function (context) { + return context.formattingRequestKind != 2 /* FormatOnEnter */; + }; + Rules.IsModuleDeclContext = function (context) { + return context.contextNode.kind === 191 /* ModuleDeclaration */; + }; + Rules.IsObjectTypeContext = function (context) { + return context.contextNode.kind === 136 /* TypeLiteral */; + }; + Rules.IsTypeArgumentOrParameter = function (token, parent) { + if (token.kind !== 23 /* LessThanToken */ && token.kind !== 24 /* GreaterThanToken */) { + return false; + } + switch (parent.kind) { + case 132 /* TypeReference */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + case 125 /* Method */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: + return true; + default: + return false; + } + }; + Rules.IsTypeArgumentOrParameterContext = function (context) { + return Rules.IsTypeArgumentOrParameter(context.currentTokenSpan, context.currentTokenParent) || Rules.IsTypeArgumentOrParameter(context.nextTokenSpan, context.nextTokenParent); + }; + Rules.IsVoidOpContext = function (context) { + return context.currentTokenSpan.kind === 97 /* VoidKeyword */ && context.currentTokenParent.kind === 154 /* PrefixOperator */; + }; + return Rules; + })(); + formatting.Rules = Rules; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var RulesMap = (function () { + function RulesMap() { + this.map = []; + this.mapRowLength = 0; + } + RulesMap.create = function (rules) { + var result = new RulesMap(); + result.Initialize(rules); + return result; + }; + RulesMap.prototype.Initialize = function (rules) { + this.mapRowLength = 119 /* LastToken */ + 1; + this.map = new Array(this.mapRowLength * this.mapRowLength); + var rulesBucketConstructionStateList = new Array(this.map.length); + this.FillRules(rules, rulesBucketConstructionStateList); + return this.map; + }; + RulesMap.prototype.FillRules = function (rules, rulesBucketConstructionStateList) { + var _this = this; + rules.forEach(function (rule) { + _this.FillRule(rule, rulesBucketConstructionStateList); + }); + }; + RulesMap.prototype.GetRuleBucketIndex = function (row, column) { + var rulesBucketIndex = (row * this.mapRowLength) + column; + return rulesBucketIndex; + }; + RulesMap.prototype.FillRule = function (rule, rulesBucketConstructionStateList) { + var _this = this; + var specificRule = rule.Descriptor.LeftTokenRange != formatting.Shared.TokenRange.Any && rule.Descriptor.RightTokenRange != formatting.Shared.TokenRange.Any; + rule.Descriptor.LeftTokenRange.GetTokens().forEach(function (left) { + rule.Descriptor.RightTokenRange.GetTokens().forEach(function (right) { + var rulesBucketIndex = _this.GetRuleBucketIndex(left, right); + var rulesBucket = _this.map[rulesBucketIndex]; + if (rulesBucket == undefined) { + rulesBucket = _this.map[rulesBucketIndex] = new RulesBucket(); + } + rulesBucket.AddRule(rule, specificRule, rulesBucketConstructionStateList, rulesBucketIndex); + }); + }); + }; + RulesMap.prototype.GetRule = function (context) { + var bucketIndex = this.GetRuleBucketIndex(context.currentTokenSpan.kind, context.nextTokenSpan.kind); + var bucket = this.map[bucketIndex]; + if (bucket != null) { + for (var i = 0, len = bucket.Rules().length; i < len; i++) { + var rule = bucket.Rules()[i]; + if (rule.Operation.Context.InContext(context)) + return rule; + } + } + return null; + }; + return RulesMap; + })(); + formatting.RulesMap = RulesMap; + var MaskBitSize = 5; + var Mask = 0x1f; + (function (RulesPosition) { + RulesPosition[RulesPosition["IgnoreRulesSpecific"] = 0] = "IgnoreRulesSpecific"; + RulesPosition[RulesPosition["IgnoreRulesAny"] = MaskBitSize * 1] = "IgnoreRulesAny"; + RulesPosition[RulesPosition["ContextRulesSpecific"] = MaskBitSize * 2] = "ContextRulesSpecific"; + RulesPosition[RulesPosition["ContextRulesAny"] = MaskBitSize * 3] = "ContextRulesAny"; + RulesPosition[RulesPosition["NoContextRulesSpecific"] = MaskBitSize * 4] = "NoContextRulesSpecific"; + RulesPosition[RulesPosition["NoContextRulesAny"] = MaskBitSize * 5] = "NoContextRulesAny"; + })(formatting.RulesPosition || (formatting.RulesPosition = {})); + var RulesPosition = formatting.RulesPosition; + var RulesBucketConstructionState = (function () { + function RulesBucketConstructionState() { + this.rulesInsertionIndexBitmap = 0; + } + RulesBucketConstructionState.prototype.GetInsertionIndex = function (maskPosition) { + var index = 0; + var pos = 0; + var indexBitmap = this.rulesInsertionIndexBitmap; + while (pos <= maskPosition) { + index += (indexBitmap & Mask); + indexBitmap >>= MaskBitSize; + pos += MaskBitSize; + } + return index; + }; + RulesBucketConstructionState.prototype.IncreaseInsertionIndex = function (maskPosition) { + var value = (this.rulesInsertionIndexBitmap >> maskPosition) & Mask; + value++; + ts.Debug.assert((value & Mask) == value, "Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."); + var temp = this.rulesInsertionIndexBitmap & ~(Mask << maskPosition); + temp |= value << maskPosition; + this.rulesInsertionIndexBitmap = temp; + }; + return RulesBucketConstructionState; + })(); + formatting.RulesBucketConstructionState = RulesBucketConstructionState; + var RulesBucket = (function () { + function RulesBucket() { + this.rules = []; + } + RulesBucket.prototype.Rules = function () { + return this.rules; + }; + RulesBucket.prototype.AddRule = function (rule, specificTokens, constructionState, rulesBucketIndex) { + var position; + if (rule.Operation.Action == 1 /* Ignore */) { + position = specificTokens ? 0 /* IgnoreRulesSpecific */ : RulesPosition.IgnoreRulesAny; + } + else if (!rule.Operation.Context.IsAny()) { + position = specificTokens ? RulesPosition.ContextRulesSpecific : RulesPosition.ContextRulesAny; + } + else { + position = specificTokens ? RulesPosition.NoContextRulesSpecific : RulesPosition.NoContextRulesAny; + } + var state = constructionState[rulesBucketIndex]; + if (state === undefined) { + state = constructionState[rulesBucketIndex] = new RulesBucketConstructionState(); + } + var index = state.GetInsertionIndex(position); + this.rules.splice(index, 0, rule); + state.IncreaseInsertionIndex(position); + }; + return RulesBucket; + })(); + formatting.RulesBucket = RulesBucket; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var Shared; + (function (Shared) { + var TokenRangeAccess = (function () { + function TokenRangeAccess(from, to, except) { + this.tokens = []; + for (var token = from; token <= to; token++) { + if (except.indexOf(token) < 0) { + this.tokens.push(token); + } + } + } + TokenRangeAccess.prototype.GetTokens = function () { + return this.tokens; + }; + TokenRangeAccess.prototype.Contains = function (token) { + return this.tokens.indexOf(token) >= 0; + }; + return TokenRangeAccess; + })(); + Shared.TokenRangeAccess = TokenRangeAccess; + var TokenValuesAccess = (function () { + function TokenValuesAccess(tks) { + this.tokens = tks && tks.length ? tks : []; + } + TokenValuesAccess.prototype.GetTokens = function () { + return this.tokens; + }; + TokenValuesAccess.prototype.Contains = function (token) { + return this.tokens.indexOf(token) >= 0; + }; + return TokenValuesAccess; + })(); + Shared.TokenValuesAccess = TokenValuesAccess; + var TokenSingleValueAccess = (function () { + function TokenSingleValueAccess(token) { + this.token = token; + } + TokenSingleValueAccess.prototype.GetTokens = function () { + return [this.token]; + }; + TokenSingleValueAccess.prototype.Contains = function (tokenValue) { + return tokenValue == this.token; + }; + return TokenSingleValueAccess; + })(); + Shared.TokenSingleValueAccess = TokenSingleValueAccess; + var TokenAllAccess = (function () { + function TokenAllAccess() { + } + TokenAllAccess.prototype.GetTokens = function () { + var result = []; + for (var token = 1 /* FirstToken */; token <= 119 /* LastToken */; token++) { + result.push(token); + } + return result; + }; + TokenAllAccess.prototype.Contains = function (tokenValue) { + return true; + }; + TokenAllAccess.prototype.toString = function () { + return "[allTokens]"; + }; + return TokenAllAccess; + })(); + Shared.TokenAllAccess = TokenAllAccess; + var TokenRange = (function () { + function TokenRange(tokenAccess) { + this.tokenAccess = tokenAccess; + } + TokenRange.FromToken = function (token) { + return new TokenRange(new TokenSingleValueAccess(token)); + }; + TokenRange.FromTokens = function (tokens) { + return new TokenRange(new TokenValuesAccess(tokens)); + }; + TokenRange.FromRange = function (f, to, except) { + if (except === void 0) { except = []; } + return new TokenRange(new TokenRangeAccess(f, to, except)); + }; + TokenRange.AllTokens = function () { + return new TokenRange(new TokenAllAccess()); + }; + TokenRange.prototype.GetTokens = function () { + return this.tokenAccess.GetTokens(); + }; + TokenRange.prototype.Contains = function (token) { + return this.tokenAccess.Contains(token); + }; + TokenRange.prototype.toString = function () { + return this.tokenAccess.toString(); + }; + TokenRange.Any = TokenRange.AllTokens(); + TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3 /* MultiLineCommentTrivia */])); + TokenRange.Keywords = TokenRange.FromRange(64 /* FirstKeyword */, 119 /* LastKeyword */); + TokenRange.Operators = TokenRange.FromRange(21 /* FirstOperator */, 62 /* LastOperator */); + TokenRange.BinaryOperators = TokenRange.FromRange(23 /* FirstBinaryOperator */, 62 /* LastBinaryOperator */); + TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([84 /* InKeyword */, 85 /* InstanceOfKeyword */]); + TokenRange.ReservedKeywords = TokenRange.FromRange(100 /* FirstFutureReservedWord */, 108 /* LastFutureReservedWord */); + TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([37 /* PlusPlusToken */, 38 /* MinusMinusToken */, 46 /* TildeToken */, 45 /* ExclamationToken */]); + TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([6 /* NumericLiteral */, 63 /* Identifier */, 15 /* OpenParenToken */, 17 /* OpenBracketToken */, 13 /* OpenBraceToken */, 91 /* ThisKeyword */, 86 /* NewKeyword */]); + TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([63 /* Identifier */, 15 /* OpenParenToken */, 91 /* ThisKeyword */, 86 /* NewKeyword */]); + TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([63 /* Identifier */, 16 /* CloseParenToken */, 18 /* CloseBracketToken */, 86 /* NewKeyword */]); + TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([63 /* Identifier */, 15 /* OpenParenToken */, 91 /* ThisKeyword */, 86 /* NewKeyword */]); + TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([63 /* Identifier */, 16 /* CloseParenToken */, 18 /* CloseBracketToken */, 86 /* NewKeyword */]); + TokenRange.Comments = TokenRange.FromTokens([2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */]); + TokenRange.TypeNames = TokenRange.FromTokens([63 /* Identifier */, 116 /* NumberKeyword */, 118 /* StringKeyword */, 110 /* BooleanKeyword */, 97 /* VoidKeyword */, 109 /* AnyKeyword */]); + return TokenRange; + })(); + Shared.TokenRange = TokenRange; + })(Shared = formatting.Shared || (formatting.Shared = {})); + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var __extends = this.__extends || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + __.prototype = b.prototype; + d.prototype = new __(); +}; +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var TokenSpan = (function (_super) { + __extends(TokenSpan, _super); + function TokenSpan(kind, start, length) { + _super.call(this, start, length); + this.kind = kind; + } + return TokenSpan; + })(ts.TextSpan); + formatting.TokenSpan = TokenSpan; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + var RulesProvider = (function () { + function RulesProvider(logger) { + this.logger = logger; + this.globalRules = new formatting.Rules(); + } + RulesProvider.prototype.getRuleName = function (rule) { + return this.globalRules.getRuleName(rule); + }; + RulesProvider.prototype.getRuleByName = function (name) { + return this.globalRules[name]; + }; + RulesProvider.prototype.getRulesMap = function () { + return this.rulesMap; + }; + RulesProvider.prototype.ensureUpToDate = function (options) { + if (this.options == null || !ts.compareDataObjects(this.options, options)) { + var activeRules = this.createActiveRules(options); + var rulesMap = formatting.RulesMap.create(activeRules); + this.activeRules = activeRules; + this.rulesMap = rulesMap; + this.options = ts.clone(options); + } + }; + RulesProvider.prototype.createActiveRules = function (options) { + var rules = this.globalRules.HighPriorityCommonRules.slice(0); + if (options.InsertSpaceAfterCommaDelimiter) { + rules.push(this.globalRules.SpaceAfterComma); + } + else { + rules.push(this.globalRules.NoSpaceAfterComma); + } + if (options.InsertSpaceAfterFunctionKeywordForAnonymousFunctions) { + rules.push(this.globalRules.SpaceAfterAnonymousFunctionKeyword); + } + else { + rules.push(this.globalRules.NoSpaceAfterAnonymousFunctionKeyword); + } + if (options.InsertSpaceAfterKeywordsInControlFlowStatements) { + rules.push(this.globalRules.SpaceAfterKeywordInControl); + } + else { + rules.push(this.globalRules.NoSpaceAfterKeywordInControl); + } + if (options.InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis) { + rules.push(this.globalRules.SpaceAfterOpenParen); + rules.push(this.globalRules.SpaceBeforeCloseParen); + rules.push(this.globalRules.NoSpaceBetweenParens); + } + else { + rules.push(this.globalRules.NoSpaceAfterOpenParen); + rules.push(this.globalRules.NoSpaceBeforeCloseParen); + rules.push(this.globalRules.NoSpaceBetweenParens); + } + if (options.InsertSpaceAfterSemicolonInForStatements) { + rules.push(this.globalRules.SpaceAfterSemicolonInFor); + } + else { + rules.push(this.globalRules.NoSpaceAfterSemicolonInFor); + } + if (options.InsertSpaceBeforeAndAfterBinaryOperators) { + rules.push(this.globalRules.SpaceBeforeBinaryOperator); + rules.push(this.globalRules.SpaceAfterBinaryOperator); + } + else { + rules.push(this.globalRules.NoSpaceBeforeBinaryOperator); + rules.push(this.globalRules.NoSpaceAfterBinaryOperator); + } + if (options.PlaceOpenBraceOnNewLineForControlBlocks) { + rules.push(this.globalRules.NewLineBeforeOpenBraceInControl); + } + if (options.PlaceOpenBraceOnNewLineForFunctions) { + rules.push(this.globalRules.NewLineBeforeOpenBraceInFunction); + rules.push(this.globalRules.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock); + } + rules = rules.concat(this.globalRules.LowPriorityCommonRules); + return rules; + }; + return RulesProvider; + })(); + formatting.RulesProvider = RulesProvider; + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var formatting; + (function (formatting) { + function formatOnEnter(position, sourceFile, rulesProvider, options) { + var line = sourceFile.getLineAndCharacterFromPosition(position).line; + ts.Debug.assert(line >= 2); + var span = { + pos: ts.getStartPositionOfLine(line - 1, sourceFile), + end: ts.getEndLinePosition(line, sourceFile) + 1 + }; + return formatSpan(span, sourceFile, options, rulesProvider, 2 /* FormatOnEnter */); + } + formatting.formatOnEnter = formatOnEnter; + function formatOnSemicolon(position, sourceFile, rulesProvider, options) { + return formatOutermostParent(position, 21 /* SemicolonToken */, sourceFile, options, rulesProvider, 3 /* FormatOnSemicolon */); + } + formatting.formatOnSemicolon = formatOnSemicolon; + function formatOnClosingCurly(position, sourceFile, rulesProvider, options) { + return formatOutermostParent(position, 14 /* CloseBraceToken */, sourceFile, options, rulesProvider, 4 /* FormatOnClosingCurlyBrace */); + } + formatting.formatOnClosingCurly = formatOnClosingCurly; + function formatDocument(sourceFile, rulesProvider, options) { + var span = { + pos: 0, + end: sourceFile.text.length + }; + return formatSpan(span, sourceFile, options, rulesProvider, 0 /* FormatDocument */); + } + formatting.formatDocument = formatDocument; + function formatSelection(start, end, sourceFile, rulesProvider, options) { + var span = { + pos: ts.getStartLinePositionForPosition(start, sourceFile), + end: end + }; + return formatSpan(span, sourceFile, options, rulesProvider, 1 /* FormatSelection */); + } + formatting.formatSelection = formatSelection; + function formatOutermostParent(position, expectedLastToken, sourceFile, options, rulesProvider, requestKind) { + var parent = findOutermostParent(position, expectedLastToken, sourceFile); + if (!parent) { + return []; + } + var span = { + pos: ts.getStartLinePositionForPosition(parent.getStart(sourceFile), sourceFile), + end: parent.end + }; + return formatSpan(span, sourceFile, options, rulesProvider, requestKind); + } + function findOutermostParent(position, expectedTokenKind, sourceFile) { + var precedingToken = ts.findPrecedingToken(position, sourceFile); + if (!precedingToken || precedingToken.kind !== expectedTokenKind) { + return undefined; + } + var current = precedingToken; + while (current && current.parent && current.parent.end === precedingToken.end && !isListElement(current.parent, current)) { + current = current.parent; + } + return current; + } + function isListElement(parent, node) { + switch (parent.kind) { + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + return ts.rangeContainsRange(parent.members, node); + case 191 /* ModuleDeclaration */: + var body = parent.body; + return body && body.kind === 161 /* Block */ && ts.rangeContainsRange(body.statements, node); + case 196 /* SourceFile */: + case 161 /* Block */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 192 /* ModuleBlock */: + return ts.rangeContainsRange(parent.statements, node); + } + return false; + } + function findEnclosingNode(range, sourceFile) { + return find(sourceFile); + function find(n) { + var candidate = ts.forEachChild(n, function (c) { return ts.startEndContainsRange(c.getStart(sourceFile), c.end, range) && c; }); + if (candidate) { + var result = find(candidate); + if (result) { + return result; + } + } + return n; + } + } + function prepareRangeContainsErrorFunction(errors, originalRange) { + if (!errors.length) { + return rangeHasNoErrors; + } + var sorted = errors.filter(function (d) { return d.isParseError && ts.rangeOverlapsWithStartEnd(originalRange, d.start, d.start + d.length); }).sort(function (e1, e2) { return e1.start - e2.start; }); + if (!sorted.length) { + return rangeHasNoErrors; + } + var index = 0; + return function (r) { + while (true) { + if (index >= sorted.length) { + return false; + } + var error = sorted[index]; + if (r.end <= error.start) { + return false; + } + if (ts.startEndOverlapsWithStartEnd(r.pos, r.end, error.start, error.start + error.length)) { + return true; + } + index++; + } + }; + function rangeHasNoErrors(r) { + return false; + } + } + function getScanStartPosition(enclosingNode, originalRange, sourceFile) { + var start = enclosingNode.getStart(sourceFile); + if (start === originalRange.pos && enclosingNode.end === originalRange.end) { + return start; + } + var precedingToken = ts.findPrecedingToken(originalRange.pos, sourceFile); + return precedingToken ? precedingToken.end : enclosingNode.pos; + } + function formatSpan(originalRange, sourceFile, options, rulesProvider, requestKind) { + var rangeContainsError = prepareRangeContainsErrorFunction(sourceFile.getSyntacticDiagnostics(), originalRange); + var formattingContext = new formatting.FormattingContext(sourceFile, requestKind); + var enclosingNode = findEnclosingNode(originalRange, sourceFile); + var formattingScanner = formatting.getFormattingScanner(sourceFile, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end); + var initialIndentation = formatting.SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, options); + var previousRangeHasError; + var previousRange; + var previousParent; + var previousRangeStartLine; + var edits = []; + formattingScanner.advance(); + if (formattingScanner.isOnToken()) { + var startLine = sourceFile.getLineAndCharacterFromPosition(enclosingNode.getStart(sourceFile)).line; + var delta = formatting.SmartIndenter.shouldIndentChildNode(enclosingNode.kind, 0 /* Unknown */) ? options.IndentSize : 0; + processNode(enclosingNode, enclosingNode, startLine, initialIndentation, delta); + } + formattingScanner.close(); + return edits; + function tryComputeIndentationForListItem(startPos, endPos, parentStartLine, range, inheritedIndentation) { + if (ts.rangeOverlapsWithStartEnd(range, startPos, endPos)) { + if (inheritedIndentation !== -1 /* Unknown */) { + return inheritedIndentation; + } + } + else { + var startLine = sourceFile.getLineAndCharacterFromPosition(startPos).line; + var startLinePosition = ts.getStartLinePositionForPosition(startPos, sourceFile); + var column = formatting.SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, startPos, sourceFile, options); + if (startLine !== parentStartLine || startPos === column) { + return column; + } + } + return -1 /* Unknown */; + } + function computeIndentation(node, startLine, inheritedIndentation, parent, parentDynamicIndentation, effectiveParentStartLine) { + var indentation = inheritedIndentation; + if (indentation === -1 /* Unknown */) { + if (isSomeBlock(node.kind)) { + if (isSomeBlock(parent.kind) || parent.kind === 196 /* SourceFile */ || parent.kind === 175 /* CaseClause */ || parent.kind === 176 /* DefaultClause */) { + indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); + } + else { + indentation = parentDynamicIndentation.getIndentation(); + } + } + else { + if (formatting.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { + indentation = parentDynamicIndentation.getIndentation(); + } + else { + indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); + } + } + } + var delta = formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0 /* Unknown */) ? options.IndentSize : 0; + if (effectiveParentStartLine === startLine) { + indentation = parentDynamicIndentation.getIndentation(); + delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta() + delta); + } + return { + indentation: indentation, + delta: delta + }; + } + function getDynamicIndentation(node, nodeStartLine, indentation, delta) { + return { + getIndentationForComment: function (kind) { + switch (kind) { + case 14 /* CloseBraceToken */: + case 18 /* CloseBracketToken */: + return indentation + delta; + } + return indentation; + }, + getIndentationForToken: function (line, kind) { + switch (kind) { + case 13 /* OpenBraceToken */: + case 14 /* CloseBraceToken */: + case 17 /* OpenBracketToken */: + case 18 /* CloseBracketToken */: + case 74 /* ElseKeyword */: + case 98 /* WhileKeyword */: + return indentation; + default: + return nodeStartLine !== line ? indentation + delta : indentation; + } + }, + getIndentation: function () { return indentation; }, + getDelta: function () { return delta; }, + recomputeIndentation: function (lineAdded) { + if (node.parent && formatting.SmartIndenter.shouldIndentChildNode(node.parent.kind, node.kind)) { + if (lineAdded) { + indentation += options.IndentSize; + } + else { + indentation -= options.IndentSize; + } + if (formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0 /* Unknown */)) { + delta = options.IndentSize; + } + else { + delta = 0; + } + } + } + }; + } + function processNode(node, contextNode, nodeStartLine, indentation, delta) { + if (!ts.rangeOverlapsWithStartEnd(originalRange, node.getStart(sourceFile), node.getEnd())) { + return; + } + var nodeDynamicIndentation = getDynamicIndentation(node, nodeStartLine, indentation, delta); + var childContextNode = contextNode; + ts.forEachChild(node, function (child) { + processChildNode(child, -1 /* Unknown */, node, nodeDynamicIndentation, nodeStartLine, false); + }, function (nodes) { + processChildNodes(nodes, node, nodeStartLine, nodeDynamicIndentation); + }); + while (formattingScanner.isOnToken()) { + var tokenInfo = formattingScanner.readTokenInfo(node); + if (tokenInfo.token.end > node.end) { + break; + } + consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation); + } + function processChildNode(child, inheritedIndentation, parent, parentDynamicIndentation, parentStartLine, isListItem) { + var childStartPos = child.getStart(sourceFile); + var childStart = sourceFile.getLineAndCharacterFromPosition(childStartPos); + var childIndentationAmount = -1 /* Unknown */; + if (isListItem) { + childIndentationAmount = tryComputeIndentationForListItem(childStartPos, child.end, parentStartLine, originalRange, inheritedIndentation); + if (childIndentationAmount !== -1 /* Unknown */) { + inheritedIndentation = childIndentationAmount; + } + } + if (!ts.rangeOverlapsWithStartEnd(originalRange, child.pos, child.end)) { + return inheritedIndentation; + } + if (child.kind === 120 /* Missing */) { + return inheritedIndentation; + } + while (formattingScanner.isOnToken()) { + var tokenInfo = formattingScanner.readTokenInfo(node); + if (tokenInfo.token.end > childStartPos) { + break; + } + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + } + if (!formattingScanner.isOnToken()) { + return inheritedIndentation; + } + if (ts.isToken(child)) { + var tokenInfo = formattingScanner.readTokenInfo(node); + ts.Debug.assert(tokenInfo.token.end === child.end); + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); + return inheritedIndentation; + } + var childIndentation = computeIndentation(child, childStart.line, childIndentationAmount, node, parentDynamicIndentation, parentStartLine); + processNode(child, childContextNode, childStart.line, childIndentation.indentation, childIndentation.delta); + childContextNode = node; + return inheritedIndentation; + } + function processChildNodes(nodes, parent, parentStartLine, parentDynamicIndentation) { + var listStartToken = getOpenTokenForList(parent, nodes); + var listEndToken = getCloseTokenForOpenToken(listStartToken); + var listDynamicIndentation = parentDynamicIndentation; + var startLine = parentStartLine; + if (listStartToken !== 0 /* Unknown */) { + while (formattingScanner.isOnToken()) { + var tokenInfo = formattingScanner.readTokenInfo(parent); + if (tokenInfo.token.end > nodes.pos) { + break; + } + else if (tokenInfo.token.kind === listStartToken) { + startLine = sourceFile.getLineAndCharacterFromPosition(tokenInfo.token.pos).line; + var indentation = computeIndentation(tokenInfo.token, startLine, -1 /* Unknown */, parent, parentDynamicIndentation, startLine); + listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation.indentation, indentation.delta); + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + } + else { + consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation); + } + } + } + var inheritedIndentation = -1 /* Unknown */; + for (var i = 0, len = nodes.length; i < len; ++i) { + inheritedIndentation = processChildNode(nodes[i], inheritedIndentation, node, listDynamicIndentation, startLine, true); + } + if (listEndToken !== 0 /* Unknown */) { + if (formattingScanner.isOnToken()) { + var tokenInfo = formattingScanner.readTokenInfo(parent); + if (tokenInfo.token.kind === listEndToken) { + consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); + } + } + } + } + function consumeTokenAndAdvanceScanner(currentTokenInfo, parent, dynamicIndentation) { + ts.Debug.assert(ts.rangeContainsRange(parent, currentTokenInfo.token)); + var lastTriviaWasNewLine = formattingScanner.lastTrailingTriviaWasNewLine(); + var indentToken = false; + if (currentTokenInfo.leadingTrivia) { + processTrivia(currentTokenInfo.leadingTrivia, parent, childContextNode, dynamicIndentation); + } + var lineAdded; + var isTokenInRange = ts.rangeContainsRange(originalRange, currentTokenInfo.token); + var tokenStart = sourceFile.getLineAndCharacterFromPosition(currentTokenInfo.token.pos); + if (isTokenInRange) { + var prevStartLine = previousRangeStartLine; + lineAdded = processRange(currentTokenInfo.token, tokenStart, parent, childContextNode, dynamicIndentation); + if (lineAdded !== undefined) { + indentToken = lineAdded; + } + else { + indentToken = lastTriviaWasNewLine && tokenStart.line !== prevStartLine; + } + } + if (currentTokenInfo.trailingTrivia) { + processTrivia(currentTokenInfo.trailingTrivia, parent, childContextNode, dynamicIndentation); + } + if (indentToken) { + var indentNextTokenOrTrivia = true; + if (currentTokenInfo.leadingTrivia) { + for (var i = 0, len = currentTokenInfo.leadingTrivia.length; i < len; ++i) { + var triviaItem = currentTokenInfo.leadingTrivia[i]; + if (!ts.rangeContainsRange(originalRange, triviaItem)) { + continue; + } + var triviaStartLine = sourceFile.getLineAndCharacterFromPosition(triviaItem.pos).line; + switch (triviaItem.kind) { + case 3 /* MultiLineCommentTrivia */: + var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); + indentMultilineComment(triviaItem, commentIndentation, !indentNextTokenOrTrivia); + indentNextTokenOrTrivia = false; + break; + case 2 /* SingleLineCommentTrivia */: + if (indentNextTokenOrTrivia) { + var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); + insertIndentation(triviaItem.pos, commentIndentation, false); + indentNextTokenOrTrivia = false; + } + break; + case 4 /* NewLineTrivia */: + indentNextTokenOrTrivia = true; + break; + } + } + } + if (isTokenInRange && !rangeContainsError(currentTokenInfo.token)) { + var tokenIndentation = dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind); + insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAdded); + } + } + formattingScanner.advance(); + childContextNode = parent; + } + } + function processTrivia(trivia, parent, contextNode, dynamicIndentation) { + for (var i = 0, len = trivia.length; i < len; ++i) { + var triviaItem = trivia[i]; + if (ts.isComment(triviaItem.kind) && ts.rangeContainsRange(originalRange, triviaItem)) { + var triviaItemStart = sourceFile.getLineAndCharacterFromPosition(triviaItem.pos); + processRange(triviaItem, triviaItemStart, parent, contextNode, dynamicIndentation); + } + } + } + function processRange(range, rangeStart, parent, contextNode, dynamicIndentation) { + var rangeHasError = rangeContainsError(range); + var lineAdded; + if (!rangeHasError && !previousRangeHasError) { + if (!previousRange) { + var originalStart = sourceFile.getLineAndCharacterFromPosition(originalRange.pos); + trimTrailingWhitespacesForLines(originalStart.line, rangeStart.line); + } + else { + lineAdded = processPair(range, rangeStart.line, parent, previousRange, previousRangeStartLine, previousParent, contextNode, dynamicIndentation); + } + } + previousRange = range; + previousParent = parent; + previousRangeStartLine = rangeStart.line; + previousRangeHasError = rangeHasError; + return lineAdded; + } + function processPair(currentItem, currentStartLine, currentParent, previousItem, previousStartLine, previousParent, contextNode, dynamicIndentation) { + formattingContext.updateContext(previousItem, previousParent, currentItem, currentParent, contextNode); + var rule = rulesProvider.getRulesMap().GetRule(formattingContext); + var trimTrailingWhitespaces; + var lineAdded; + if (rule) { + applyRuleEdits(rule, previousItem, previousStartLine, currentItem, currentStartLine); + if (rule.Operation.Action & (2 /* Space */ | 8 /* Delete */) && currentStartLine !== previousStartLine) { + if (currentParent.getStart(sourceFile) === currentItem.pos) { + lineAdded = false; + } + } + else if (rule.Operation.Action & 4 /* NewLine */ && currentStartLine === previousStartLine) { + if (currentParent.getStart(sourceFile) === currentItem.pos) { + lineAdded = true; + } + } + if (lineAdded !== undefined) { + dynamicIndentation.recomputeIndentation(lineAdded); + } + trimTrailingWhitespaces = (rule.Operation.Action & (4 /* NewLine */ | 2 /* Space */)) && rule.Flag !== 1 /* CanDeleteNewLines */; + } + else { + trimTrailingWhitespaces = true; + } + if (currentStartLine !== previousStartLine && trimTrailingWhitespaces) { + trimTrailingWhitespacesForLines(previousStartLine, currentStartLine, previousItem); + } + return lineAdded; + } + function insertIndentation(pos, indentation, lineAdded) { + var indentationString = formatting.getIndentationString(indentation, options); + if (lineAdded) { + recordReplace(pos, 0, indentationString); + } + else { + var tokenStart = sourceFile.getLineAndCharacterFromPosition(pos); + if (indentation !== tokenStart.character - 1) { + var startLinePosition = ts.getStartPositionOfLine(tokenStart.line, sourceFile); + recordReplace(startLinePosition, tokenStart.character - 1, indentationString); + } + } + } + function indentMultilineComment(commentRange, indentation, firstLineIsIndented) { + var startLine = sourceFile.getLineAndCharacterFromPosition(commentRange.pos).line; + var endLine = sourceFile.getLineAndCharacterFromPosition(commentRange.end).line; + if (startLine === endLine) { + if (!firstLineIsIndented) { + insertIndentation(commentRange.pos, indentation, false); + } + return; + } + else { + var parts = []; + var startPos = commentRange.pos; + for (var line = startLine; line < endLine; ++line) { + var endOfLine = ts.getEndLinePosition(line, sourceFile); + parts.push({ pos: startPos, end: endOfLine }); + startPos = ts.getStartPositionOfLine(line + 1, sourceFile); + } + parts.push({ pos: startPos, end: commentRange.end }); + } + var startLinePos = ts.getStartPositionOfLine(startLine, sourceFile); + var nonWhitespaceColumnInFirstPart = formatting.SmartIndenter.findFirstNonWhitespaceColumn(startLinePos, parts[0].pos, sourceFile, options); + if (indentation === nonWhitespaceColumnInFirstPart) { + return; + } + var startIndex = 0; + if (firstLineIsIndented) { + startIndex = 1; + startLine++; + } + var delta = indentation - nonWhitespaceColumnInFirstPart; + for (var i = startIndex, len = parts.length; i < len; ++i, ++startLine) { + var startLinePos = ts.getStartPositionOfLine(startLine, sourceFile); + var nonWhitespaceColumn = i === 0 ? nonWhitespaceColumnInFirstPart : formatting.SmartIndenter.findFirstNonWhitespaceColumn(parts[i].pos, parts[i].end, sourceFile, options); + var newIndentation = nonWhitespaceColumn + delta; + if (newIndentation > 0) { + var indentationString = formatting.getIndentationString(newIndentation, options); + recordReplace(startLinePos, nonWhitespaceColumn, indentationString); + } + else { + recordDelete(startLinePos, nonWhitespaceColumn); + } + } + } + function trimTrailingWhitespacesForLines(line1, line2, range) { + for (var line = line1; line < line2; ++line) { + var lineStartPosition = ts.getStartPositionOfLine(line, sourceFile); + var lineEndPosition = ts.getEndLinePosition(line, sourceFile); + if (range && ts.isComment(range.kind) && range.pos <= lineEndPosition && range.end > lineEndPosition) { + continue; + } + var pos = lineEndPosition; + while (pos >= lineStartPosition && ts.isWhiteSpace(sourceFile.text.charCodeAt(pos))) { + pos--; + } + if (pos !== lineEndPosition) { + ts.Debug.assert(pos === lineStartPosition || !ts.isWhiteSpace(sourceFile.text.charCodeAt(pos))); + recordDelete(pos + 1, lineEndPosition - pos); + } + } + } + function newTextChange(start, len, newText) { + return { span: new ts.TextSpan(start, len), newText: newText }; + } + function recordDelete(start, len) { + if (len) { + edits.push(newTextChange(start, len, "")); + } + } + function recordReplace(start, len, newText) { + if (len || newText) { + edits.push(newTextChange(start, len, newText)); + } + } + function applyRuleEdits(rule, previousRange, previousStartLine, currentRange, currentStartLine) { + var between; + switch (rule.Operation.Action) { + case 1 /* Ignore */: + return; + case 8 /* Delete */: + if (previousRange.end !== currentRange.pos) { + recordDelete(previousRange.end, currentRange.pos - previousRange.end); + } + break; + case 4 /* NewLine */: + if (rule.Flag !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { + return; + } + var lineDelta = currentStartLine - previousStartLine; + if (lineDelta !== 1) { + recordReplace(previousRange.end, currentRange.pos - previousRange.end, options.NewLineCharacter); + } + break; + case 2 /* Space */: + if (rule.Flag !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { + return; + } + var posDelta = currentRange.pos - previousRange.end; + if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange.end) !== 32 /* space */) { + recordReplace(previousRange.end, currentRange.pos - previousRange.end, " "); + } + break; + } + } + } + function isSomeBlock(kind) { + switch (kind) { + case 161 /* Block */: + case 186 /* FunctionBlock */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 192 /* ModuleBlock */: + return true; + } + return false; + } + function getOpenTokenForList(node, list) { + switch (node.kind) { + case 126 /* Constructor */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 125 /* Method */: + case 153 /* ArrowFunction */: + if (node.typeParameters === list) { + return 23 /* LessThanToken */; + } + else if (node.parameters === list) { + return 15 /* OpenParenToken */; + } + break; + case 147 /* CallExpression */: + case 148 /* NewExpression */: + if (node.typeArguments === list) { + return 23 /* LessThanToken */; + } + else if (node.arguments === list) { + return 15 /* OpenParenToken */; + } + break; + case 132 /* TypeReference */: + if (node.typeArguments === list) { + return 23 /* LessThanToken */; + } + } + return 0 /* Unknown */; + } + function getCloseTokenForOpenToken(kind) { + switch (kind) { + case 15 /* OpenParenToken */: + return 16 /* CloseParenToken */; + case 23 /* LessThanToken */: + return 24 /* GreaterThanToken */; + } + return 0 /* Unknown */; + } + })(formatting = ts.formatting || (ts.formatting = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var ScriptSnapshot; + (function (ScriptSnapshot) { + var StringScriptSnapshot = (function () { + function StringScriptSnapshot(text) { + this.text = text; + this._lineStartPositions = undefined; + } + StringScriptSnapshot.prototype.getText = function (start, end) { + return this.text.substring(start, end); + }; + StringScriptSnapshot.prototype.getLength = function () { + return this.text.length; + }; + StringScriptSnapshot.prototype.getLineStartPositions = function () { + if (!this._lineStartPositions) { + this._lineStartPositions = ts.computeLineStarts(this.text); + } + return this._lineStartPositions; + }; + StringScriptSnapshot.prototype.getChangeRange = function (oldSnapshot) { + throw new Error("not yet implemented"); + }; + return StringScriptSnapshot; + })(); + function fromString(text) { + return new StringScriptSnapshot(text); + } + ScriptSnapshot.fromString = fromString; + })(ScriptSnapshot = ts.ScriptSnapshot || (ts.ScriptSnapshot = {})); var scanner = ts.createScanner(2 /* Latest */, true); var emptyArray = []; function createNode(kind, pos, end, flags, parent) { @@ -31217,13 +19382,13 @@ var ts; while (pos < end) { var token = scanner.scan(); var textPos = scanner.getTextPos(); - var node = nodes.push(createNode(token, pos, textPos, 512 /* Synthetic */, this)); + nodes.push(createNode(token, pos, textPos, 512 /* Synthetic */, this)); pos = textPos; } return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(195 /* SyntaxList */, nodes.pos, nodes.end, 512 /* Synthetic */, this); + var list = createNode(198 /* SyntaxList */, nodes.pos, nodes.end, 512 /* Synthetic */, this); list._children = []; var pos = nodes.pos; for (var i = 0, len = nodes.length; i < len; i++) { @@ -31349,13 +19514,13 @@ var ts; } }); } - if (declaration.kind === 188 /* ModuleDeclaration */ && declaration.body.kind === 188 /* ModuleDeclaration */) { + if (declaration.kind === 191 /* ModuleDeclaration */ && declaration.body.kind === 191 /* ModuleDeclaration */) { return; } - while (declaration.kind === 188 /* ModuleDeclaration */ && declaration.parent.kind === 188 /* ModuleDeclaration */) { + while (declaration.kind === 191 /* ModuleDeclaration */ && declaration.parent.kind === 191 /* ModuleDeclaration */) { declaration = declaration.parent; } - ts.forEach(getJsDocCommentTextRange(declaration.kind === 181 /* VariableDeclaration */ ? declaration.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + ts.forEach(getJsDocCommentTextRange(declaration.kind === 184 /* VariableDeclaration */ ? declaration.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedJsDocComment) { jsDocCommentParts.push.apply(jsDocCommentParts, cleanedJsDocComment); @@ -31390,14 +19555,20 @@ var ts; return pos; } function isName(pos, end, sourceFile, name) { - return pos + name.length < end && sourceFile.text.substr(pos, name.length) === name && ts.isWhiteSpace(sourceFile.text.charCodeAt(pos + name.length)); + return pos + name.length < end && sourceFile.text.substr(pos, name.length) === name && (ts.isWhiteSpace(sourceFile.text.charCodeAt(pos + name.length)) || ts.isLineBreak(sourceFile.text.charCodeAt(pos + name.length))); } function isParamTag(pos, end, sourceFile) { return isName(pos, end, sourceFile, paramTag); } + function pushDocCommentLineText(docComments, text, blankLineCount) { + while (blankLineCount--) + docComments.push(textPart("")); + docComments.push(textPart(text)); + } function getCleanedJsDocComment(pos, end, sourceFile) { var spacesToRemoveAfterAsterisk; var docComments = []; + var blankLineCount = 0; var isInParamTag = false; while (pos < end) { var docCommentTextOfLine = ""; @@ -31431,7 +19602,11 @@ var ts; } pos = consumeLineBreaks(pos, end, sourceFile); if (docCommentTextOfLine) { - docComments.push(textPart(docCommentTextOfLine)); + pushDocCommentLineText(docComments, docCommentTextOfLine, blankLineCount); + blankLineCount = 0; + } + else if (!isInParamTag && docComments.length) { + blankLineCount++; } } return docComments; @@ -31441,6 +19616,8 @@ var ts; var paramDocComments = []; while (pos < end) { if (isParamTag(pos, end, sourceFile)) { + var blankLineCount = 0; + var recordedParamTag = false; pos = consumeWhiteSpaces(pos + paramTag.length); if (pos >= end) { break; @@ -31483,8 +19660,13 @@ var ts; var ch = sourceFile.text.charCodeAt(pos); if (ts.isLineBreak(ch)) { if (paramHelpString) { - paramDocComments.push(textPart(paramHelpString)); + pushDocCommentLineText(paramDocComments, paramHelpString, blankLineCount); paramHelpString = ""; + blankLineCount = 0; + recordedParamTag = true; + } + else if (recordedParamTag) { + blankLineCount++; } setPosForParamHelpStringOnNextLine(firstLineParamHelpStringPos); continue; @@ -31496,7 +19678,7 @@ var ts; pos++; } if (paramHelpString) { - paramDocComments.push(textPart(paramHelpString)); + pushDocCommentLineText(paramDocComments, paramHelpString, blankLineCount); } paramHelpStringMargin = undefined; } @@ -31589,13 +19771,12 @@ var ts; }; SignatureObject.prototype.getDocumentationComment = function () { if (this.documentationComment === undefined) { - this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations([this.declaration], this.declaration.name ? this.declaration.name.text : "", false) : []; + this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations([this.declaration], undefined, false) : []; } return this.documentationComment; }; return SignatureObject; })(); - var incrementalParse = TypeScript.IncrementalParser.parse; var SourceFileObject = (function (_super) { __extends(SourceFileObject, _super); function SourceFileObject() { @@ -31607,6 +19788,12 @@ var ts; SourceFileObject.prototype.getPositionFromLineAndCharacter = function (line, character) { return -1; }; + SourceFileObject.prototype.getLineStarts = function () { + return undefined; + }; + SourceFileObject.prototype.getSyntacticDiagnostics = function () { + return undefined; + }; SourceFileObject.prototype.getScriptSnapshot = function () { return this.scriptSnapshot; }; @@ -31616,7 +19803,7 @@ var ts; var namedDeclarations = []; ts.forEachChild(sourceFile, function visit(node) { switch (node.kind) { - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: case 125 /* Method */: var functionDeclaration = node; if (functionDeclaration.name && functionDeclaration.name.kind !== 120 /* Missing */) { @@ -31632,30 +19819,30 @@ var ts; ts.forEachChild(node, visit); } break; - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: - case 186 /* TypeAliasDeclaration */: - case 187 /* EnumDeclaration */: - case 188 /* ModuleDeclaration */: - case 190 /* ImportDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 190 /* EnumDeclaration */: + case 191 /* ModuleDeclaration */: + case 193 /* ImportDeclaration */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 134 /* TypeLiteral */: + case 136 /* TypeLiteral */: if (node.name) { namedDeclarations.push(node); } case 126 /* Constructor */: - case 159 /* VariableStatement */: - case 189 /* ModuleBlock */: - case 183 /* FunctionBlock */: + case 162 /* VariableStatement */: + case 192 /* ModuleBlock */: + case 186 /* FunctionBlock */: ts.forEachChild(node, visit); break; case 123 /* Parameter */: if (!(node.flags & 112 /* AccessibilityModifier */)) { break; } - case 181 /* VariableDeclaration */: - case 192 /* EnumMember */: + case 184 /* VariableDeclaration */: + case 195 /* EnumMember */: case 124 /* Property */: namedDeclarations.push(node); break; @@ -31665,21 +19852,18 @@ var ts; } return this.namedDeclarations; }; - SourceFileObject.prototype.isDeclareFile = function () { - return TypeScript.isDTSFile(this.filename); - }; SourceFileObject.prototype.update = function (scriptSnapshot, version, isOpen, textChangeRange) { if (textChangeRange && ts.Debug.shouldAssert(1 /* Normal */)) { var oldText = this.scriptSnapshot; var newText = scriptSnapshot; - TypeScript.Debug.assert((oldText.getLength() - textChangeRange.span().length() + textChangeRange.newLength()) === newText.getLength()); + ts.Debug.assert((oldText.getLength() - textChangeRange.span().length() + textChangeRange.newLength()) === newText.getLength()); if (ts.Debug.shouldAssert(3 /* VeryAggressive */)) { var oldTextPrefix = oldText.getText(0, textChangeRange.span().start()); var newTextPrefix = newText.getText(0, textChangeRange.span().start()); - TypeScript.Debug.assert(oldTextPrefix === newTextPrefix); + ts.Debug.assert(oldTextPrefix === newTextPrefix); var oldTextSuffix = oldText.getText(textChangeRange.span().end(), oldText.getLength()); var newTextSuffix = newText.getText(textChangeRange.newSpan().end(), newText.getLength()); - TypeScript.Debug.assert(oldTextSuffix === newTextSuffix); + ts.Debug.assert(oldTextSuffix === newTextSuffix); } } return SourceFileObject.createSourceFileObject(this.filename, scriptSnapshot, this.languageVersion, version, isOpen); @@ -31901,14 +20085,14 @@ var ts; return false; } return ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 149 /* FunctionExpression */) { + if (declaration.kind === 152 /* FunctionExpression */) { return true; } - if (declaration.kind !== 181 /* VariableDeclaration */ && declaration.kind !== 182 /* FunctionDeclaration */) { + if (declaration.kind !== 184 /* VariableDeclaration */ && declaration.kind !== 185 /* FunctionDeclaration */) { return false; } - for (var parent = declaration.parent; parent.kind !== 183 /* FunctionBlock */; parent = parent.parent) { - if (parent.kind === 193 /* SourceFile */ || parent.kind === 189 /* ModuleBlock */) { + for (var parent = declaration.parent; parent.kind !== 186 /* FunctionBlock */; parent = parent.parent) { + if (parent.kind === 196 /* SourceFile */ || parent.kind === 192 /* ModuleBlock */) { return false; } } @@ -32027,7 +20211,7 @@ var ts; var filenames = host.getScriptFileNames(); for (var i = 0, n = filenames.length; i < n; i++) { var filename = filenames[i]; - this.filenameToEntry[TypeScript.switchToForwardSlashes(filename)] = { + this.filenameToEntry[ts.normalizeSlashes(filename)] = { filename: filename, version: host.getScriptVersion(filename), isOpen: host.getScriptIsOpen(filename) @@ -32039,7 +20223,7 @@ var ts; return this._compilationSettings; }; HostCache.prototype.getEntry = function (filename) { - filename = TypeScript.switchToForwardSlashes(filename); + filename = ts.normalizeSlashes(filename); return ts.lookUp(this.filenameToEntry, filename); }; HostCache.prototype.contains = function (filename) { @@ -32077,7 +20261,7 @@ var ts; HostCache.prototype.getChangeRange = function (filename, lastKnownVersion, oldScriptSnapshot) { var currentVersion = this.getVersion(filename); if (lastKnownVersion === currentVersion) { - return TypeScript.TextChangeRange.unchanged; + return ts.TextChangeRange.unchanged; } var scriptSnapshot = this.getScriptSnapshot(filename); return scriptSnapshot.getChangeRange(oldScriptSnapshot); @@ -32090,23 +20274,17 @@ var ts; this.currentFilename = ""; this.currentFileVersion = null; this.currentSourceFile = null; - this.currentFileSyntaxTree = null; this.hostCache = new HostCache(host); } SyntaxTreeCache.prototype.initialize = function (filename) { - ts.Debug.assert(!!this.currentFileSyntaxTree === !!this.currentSourceFile); var start = new Date().getTime(); this.hostCache = new HostCache(this.host); this.host.log("SyntaxTreeCache.Initialize: new HostCache: " + (new Date().getTime() - start)); var version = this.hostCache.getVersion(filename); - var syntaxTree = null; var sourceFile; - if (this.currentFileSyntaxTree === null || this.currentFilename !== filename) { + if (this.currentFilename !== filename) { var scriptSnapshot = this.hostCache.getScriptSnapshot(filename); var start = new Date().getTime(); - syntaxTree = this.createSyntaxTree(filename, scriptSnapshot); - this.host.log("SyntaxTreeCache.Initialize: createSyntaxTree: " + (new Date().getTime() - start)); - var start = new Date().getTime(); sourceFile = createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, true); this.host.log("SyntaxTreeCache.Initialize: createSourceFile: " + (new Date().getTime() - start)); var start = new Date().getTime(); @@ -32115,9 +20293,6 @@ var ts; } else if (this.currentFileVersion !== version) { var scriptSnapshot = this.hostCache.getScriptSnapshot(filename); - var start = new Date().getTime(); - syntaxTree = this.updateSyntaxTree(filename, scriptSnapshot, this.currentSourceFile.getScriptSnapshot(), this.currentFileSyntaxTree, this.currentFileVersion); - this.host.log("SyntaxTreeCache.Initialize: updateSyntaxTree: " + (new Date().getTime() - start)); var editRange = this.hostCache.getChangeRange(filename, this.currentFileVersion, this.currentSourceFile.getScriptSnapshot()); var start = new Date().getTime(); sourceFile = !editRange ? createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, true) : this.currentSourceFile.update(scriptSnapshot, version, true, editRange); @@ -32126,11 +20301,9 @@ var ts; fixupParentReferences(sourceFile); this.host.log("SyntaxTreeCache.Initialize: fixupParentRefs : " + (new Date().getTime() - start)); } - if (syntaxTree !== null) { - ts.Debug.assert(sourceFile !== undefined); + if (sourceFile) { this.currentFileVersion = version; this.currentFilename = filename; - this.currentFileSyntaxTree = syntaxTree; this.currentSourceFile = sourceFile; } function fixupParentReferences(sourceFile) { @@ -32145,61 +20318,13 @@ var ts; ts.forEachChild(sourceFile, walk); } }; - SyntaxTreeCache.prototype.getCurrentFileSyntaxTree = function (filename) { - this.initialize(filename); - return this.currentFileSyntaxTree; - }; SyntaxTreeCache.prototype.getCurrentSourceFile = function (filename) { this.initialize(filename); return this.currentSourceFile; }; SyntaxTreeCache.prototype.getCurrentScriptSnapshot = function (filename) { - this.getCurrentFileSyntaxTree(filename); return this.getCurrentSourceFile(filename).getScriptSnapshot(); }; - SyntaxTreeCache.prototype.createSyntaxTree = function (filename, scriptSnapshot) { - var text = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - var syntaxTree = TypeScript.Parser.parse(filename, text, getDefaultCompilerOptions().target, TypeScript.isDTSFile(filename)); - return syntaxTree; - }; - SyntaxTreeCache.prototype.updateSyntaxTree = function (filename, scriptSnapshot, previousScriptSnapshot, previousSyntaxTree, previousFileVersion) { - var editRange = this.hostCache.getChangeRange(filename, previousFileVersion, previousScriptSnapshot); - if (editRange === null) { - return this.createSyntaxTree(filename, scriptSnapshot); - } - var nextSyntaxTree = TypeScript.IncrementalParser.parse(previousSyntaxTree, editRange, TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot)); - this.ensureInvariants(filename, editRange, nextSyntaxTree, previousScriptSnapshot, scriptSnapshot); - return nextSyntaxTree; - }; - SyntaxTreeCache.prototype.ensureInvariants = function (filename, editRange, incrementalTree, oldScriptSnapshot, newScriptSnapshot) { - var expectedNewLength = oldScriptSnapshot.getLength() - editRange.span().length() + editRange.newLength(); - var actualNewLength = newScriptSnapshot.getLength(); - function provideMoreDebugInfo() { - var debugInformation = ["expected length:", expectedNewLength, "and actual length:", actualNewLength, "are not equal\r\n"]; - var oldSpan = editRange.span(); - function prettyPrintString(s) { - return '"' + s.replace(/\r/g, '\\r').replace(/\n/g, '\\n') + '"'; - } - debugInformation.push('Edit range (old text) (start: ' + oldSpan.start() + ', end: ' + oldSpan.end() + ') \r\n'); - debugInformation.push('Old text edit range contents: ' + prettyPrintString(oldScriptSnapshot.getText(oldSpan.start(), oldSpan.end()))); - var newSpan = editRange.newSpan(); - debugInformation.push('Edit range (new text) (start: ' + newSpan.start() + ', end: ' + newSpan.end() + ') \r\n'); - debugInformation.push('New text edit range contents: ' + prettyPrintString(newScriptSnapshot.getText(newSpan.start(), newSpan.end()))); - return debugInformation.join(' '); - } - ts.Debug.assert(expectedNewLength === actualNewLength, "Expected length is different from actual!", provideMoreDebugInfo); - if (ts.Debug.shouldAssert(3 /* VeryAggressive */)) { - var oldPrefixText = oldScriptSnapshot.getText(0, editRange.span().start()); - var newPrefixText = newScriptSnapshot.getText(0, editRange.span().start()); - ts.Debug.assert(oldPrefixText === newPrefixText, 'Expected equal prefix texts!'); - var oldSuffixText = oldScriptSnapshot.getText(editRange.span().end(), oldScriptSnapshot.getLength()); - var newSuffixText = newScriptSnapshot.getText(editRange.newSpan().end(), newScriptSnapshot.getLength()); - ts.Debug.assert(oldSuffixText === newSuffixText, 'Expected equal suffix texts!'); - var incrementalTreeText = TypeScript.fullText(incrementalTree.sourceUnit()); - var actualSnapshotText = newScriptSnapshot.getText(0, newScriptSnapshot.getLength()); - ts.Debug.assert(incrementalTreeText === actualSnapshotText, 'Expected full texts to be equal'); - } - }; return SyntaxTreeCache; })(); function createSourceFileFromScriptSnapshot(filename, scriptSnapshot, settings, version, isOpen) { @@ -32281,6 +20406,64 @@ var ts; }; } ts.createDocumentRegistry = createDocumentRegistry; + function preProcessFile(sourceText, readImportFiles) { + if (readImportFiles === void 0) { readImportFiles = true; } + var referencedFiles = []; + var importedFiles = []; + var isNoDefaultLib = false; + function processTripleSlashDirectives() { + var commentRanges = ts.getLeadingCommentRanges(sourceText, 0); + ts.forEach(commentRanges, function (commentRange) { + var comment = sourceText.substring(commentRange.pos, commentRange.end); + var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, commentRange); + if (referencePathMatchResult) { + isNoDefaultLib = referencePathMatchResult.isNoDefaultLib; + var fileReference = referencePathMatchResult.fileReference; + if (fileReference) { + referencedFiles.push(fileReference); + } + } + }); + } + function processImport() { + scanner.setText(sourceText); + var token = scanner.scan(); + while (token !== 1 /* EndOfFileToken */) { + if (token === 83 /* ImportKeyword */) { + token = scanner.scan(); + if (token === 63 /* Identifier */) { + token = scanner.scan(); + if (token === 51 /* EqualsToken */) { + token = scanner.scan(); + if (token === 115 /* RequireKeyword */) { + token = scanner.scan(); + if (token === 15 /* OpenParenToken */) { + token = scanner.scan(); + if (token === 7 /* StringLiteral */) { + var importPath = scanner.getTokenValue(); + var pos = scanner.getTokenPos(); + importedFiles.push({ + filename: importPath, + pos: pos, + end: pos + importPath.length + }); + } + } + } + } + } + } + token = scanner.scan(); + } + scanner.setText(undefined); + } + if (readImportFiles) { + processImport(); + } + processTripleSlashDirectives(); + return { referencedFiles: referencedFiles, importedFiles: importedFiles, isLibFile: isNoDefaultLib }; + } + ts.preProcessFile = preProcessFile; function getNodeModifiers(node) { var flags = node.flags; var result = []; @@ -32301,7 +20484,7 @@ var ts; ts.getNodeModifiers = getNodeModifiers; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 174 /* LabeledStatement */ && referenceNode.label.text === labelName) { + if (referenceNode.kind === 177 /* LabeledStatement */ && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -32309,13 +20492,13 @@ var ts; return undefined; } function isJumpStatementTarget(node) { - return node.kind === 63 /* Identifier */ && (node.parent.kind === 168 /* BreakStatement */ || node.parent.kind === 167 /* ContinueStatement */) && node.parent.label === node; + return node.kind === 63 /* Identifier */ && (node.parent.kind === 171 /* BreakStatement */ || node.parent.kind === 170 /* ContinueStatement */) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { - return node.kind === 63 /* Identifier */ && node.parent.kind === 174 /* LabeledStatement */ && node.parent.label === node; + return node.kind === 63 /* Identifier */ && node.parent.kind === 177 /* LabeledStatement */ && node.parent.label === node; } function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 174 /* LabeledStatement */; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 177 /* LabeledStatement */; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -32329,48 +20512,48 @@ var ts; return node.parent.kind === 121 /* QualifiedName */ && node.parent.right === node; } function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 142 /* PropertyAccess */ && node.parent.right === node; + return node && node.parent && node.parent.kind === 145 /* PropertyAccess */ && node.parent.right === node; } function isCallExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 144 /* CallExpression */ && node.parent.func === node; + return node && node.parent && node.parent.kind === 147 /* CallExpression */ && node.parent.func === node; } function isNewExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 145 /* NewExpression */ && node.parent.func === node; + return node && node.parent && node.parent.kind === 148 /* NewExpression */ && node.parent.func === node; } function isNameOfModuleDeclaration(node) { - return node.parent.kind === 188 /* ModuleDeclaration */ && node.parent.name === node; + return node.parent.kind === 191 /* ModuleDeclaration */ && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { return node.kind === 63 /* Identifier */ && ts.isAnyFunction(node.parent) && node.parent.name === node; } function isNameOfPropertyAssignment(node) { - return (node.kind === 63 /* Identifier */ || node.kind === 7 /* StringLiteral */ || node.kind === 6 /* NumericLiteral */) && node.parent.kind === 141 /* PropertyAssignment */ && node.parent.name === node; + return (node.kind === 63 /* Identifier */ || node.kind === 7 /* StringLiteral */ || node.kind === 6 /* NumericLiteral */) && (node.parent.kind === 143 /* PropertyAssignment */ || node.parent.kind === 144 /* ShorthandPropertyAssignment */) && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 7 /* StringLiteral */ || node.kind === 6 /* NumericLiteral */) { switch (node.parent.kind) { case 124 /* Property */: - case 141 /* PropertyAssignment */: - case 192 /* EnumMember */: + case 143 /* PropertyAssignment */: + case 195 /* EnumMember */: case 125 /* Method */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: return node.parent.name === node; - case 143 /* IndexedAccess */: + case 146 /* IndexedAccess */: return node.parent.index === node; } } return false; } function isNameOfExternalModuleImportOrDeclaration(node) { - return node.kind === 7 /* StringLiteral */ && (isNameOfModuleDeclaration(node) || (node.parent.kind === 190 /* ImportDeclaration */ && node.parent.externalModuleName === node)); + return node.kind === 7 /* StringLiteral */ && (isNameOfModuleDeclaration(node) || (node.parent.kind === 193 /* ImportDeclaration */ && node.parent.externalModuleName === node)); } function isInsideComment(sourceFile, token, position) { return position <= token.getStart(sourceFile) && (isInsideCommentRange(ts.getTrailingCommentRanges(sourceFile.text, token.getFullStart())) || isInsideCommentRange(ts.getLeadingCommentRanges(sourceFile.text, token.getFullStart()))); @@ -32403,7 +20586,7 @@ var ts; } function createLanguageService(host, documentRegistry) { var syntaxTreeCache = new SyntaxTreeCache(host); - var formattingRulesProvider; + var ruleProvider; var hostCache; var program; var typeInfoResolver; @@ -32423,6 +20606,13 @@ var ts; function getFullTypeCheckChecker() { return fullTypeCheckChecker_doNotAccessDirectly || (fullTypeCheckChecker_doNotAccessDirectly = program.getTypeChecker(true)); } + function getRuleProvider(options) { + if (!ruleProvider) { + ruleProvider = new ts.formatting.RulesProvider(host); + } + ruleProvider.ensureUpToDate(options); + return ruleProvider; + } function createCompilerHost() { return { getSourceFile: function (filename, languageVersion) { @@ -32524,12 +20714,12 @@ var ts; } function getSyntacticDiagnostics(filename) { synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); + filename = ts.normalizeSlashes(filename); return program.getDiagnostics(getSourceFile(filename).getSourceFile()); } function getSemanticDiagnostics(filename) { synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); + filename = ts.normalizeSlashes(filename); var compilerOptions = program.getCompilerOptions(); var checker = getFullTypeCheckChecker(); var targetSourceFile = getSourceFile(filename); @@ -32538,7 +20728,7 @@ var ts; var savedWriter = writer; writer = function (filename, data, writeByteOrderMark) { }; - allDiagnostics = allDiagnostics.concat(checker.emitFiles(targetSourceFile).errors); + allDiagnostics = allDiagnostics.concat(checker.invokeEmitter(targetSourceFile).diagnostics); writer = savedWriter; } return allDiagnostics; @@ -32562,25 +20752,25 @@ var ts; isValid = ts.isIdentifierPart(displayName.charCodeAt(i), target); } if (isValid) { - return displayName; + return ts.unescapeIdentifier(displayName); } } return undefined; } - function createCompletionEntry(symbol, typeChecker) { + function createCompletionEntry(symbol, typeChecker, location) { var displayName = getValidCompletionEntryDisplayName(symbol, program.getCompilerOptions().target); if (!displayName) { return undefined; } return { name: displayName, - kind: getSymbolKind(symbol, typeChecker), + kind: getSymbolKind(symbol, typeChecker, location), kindModifiers: getSymbolModifiers(symbol) }; } function getCompletionsAtPosition(filename, position, isMemberCompletion) { synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); + filename = ts.normalizeSlashes(filename); var syntacticStart = new Date().getTime(); var sourceFile = getSourceFile(filename); var start = new Date().getTime(); @@ -32607,7 +20797,7 @@ var ts; } var node; var isRightOfDot; - if (previousToken && previousToken.kind === 19 /* DotToken */ && (previousToken.parent.kind === 142 /* PropertyAccess */ || previousToken.parent.kind === 121 /* QualifiedName */)) { + if (previousToken && previousToken.kind === 19 /* DotToken */ && (previousToken.parent.kind === 145 /* PropertyAccess */ || previousToken.parent.kind === 121 /* QualifiedName */)) { node = previousToken.parent.left; isRightOfDot = true; } @@ -32623,11 +20813,12 @@ var ts; typeChecker: typeInfoResolver }; host.log("getCompletionsAtPosition: Syntactic work: " + (new Date().getTime() - syntacticStart)); + var location = ts.getTouchingPropertyName(sourceFile, position); var semanticStart = new Date().getTime(); if (isRightOfDot) { var symbols = []; isMemberCompletion = true; - if (node.kind === 63 /* Identifier */ || node.kind === 121 /* QualifiedName */ || node.kind === 142 /* PropertyAccess */) { + if (node.kind === 63 /* Identifier */ || node.kind === 121 /* QualifiedName */ || node.kind === 145 /* PropertyAccess */) { var symbol = typeInfoResolver.getSymbolInfo(node); if (symbol && symbol.flags & 33554432 /* Import */) { symbol = typeInfoResolver.getAliasedSymbol(symbol); @@ -32682,18 +20873,21 @@ var ts; function getCompletionEntriesFromSymbols(symbols, session) { var start = new Date().getTime(); ts.forEach(symbols, function (symbol) { - var entry = createCompletionEntry(symbol, session.typeChecker); - if (entry && !ts.lookUp(session.symbols, entry.name)) { - session.entries.push(entry); - session.symbols[entry.name] = symbol; + var entry = createCompletionEntry(symbol, session.typeChecker, location); + if (entry) { + var id = ts.escapeIdentifier(entry.name); + if (!ts.lookUp(session.symbols, id)) { + session.entries.push(entry); + session.symbols[id] = symbol; + } } }); - host.log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - semanticStart)); + host.log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - start)); } function isCompletionListBlocker(previousToken) { var start = new Date().getTime(); var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || isIdentifierDefinitionLocation(previousToken) || isRightOfIllegalDot(previousToken); - host.log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - semanticStart)); + host.log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - start)); return result; } function isInStringOrRegularExpressionOrTemplateLiteral(previousToken) { @@ -32733,7 +20927,7 @@ var ts; switch (previousToken.kind) { case 13 /* OpenBraceToken */: case 22 /* CommaToken */: - if (parent && parent.kind === 140 /* ObjectLiteral */) { + if (parent && parent.kind === 142 /* ObjectLiteral */) { return parent; } break; @@ -32743,9 +20937,9 @@ var ts; } function isFunction(kind) { switch (kind) { - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: - case 182 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + case 185 /* FunctionDeclaration */: case 125 /* Method */: case 126 /* Constructor */: case 127 /* GetAccessor */: @@ -32762,13 +20956,13 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 22 /* CommaToken */: - return containingNodeKind === 181 /* VariableDeclaration */ || containingNodeKind === 159 /* VariableStatement */ || containingNodeKind === 187 /* EnumDeclaration */ || isFunction(containingNodeKind); + return containingNodeKind === 184 /* VariableDeclaration */ || containingNodeKind === 162 /* VariableStatement */ || containingNodeKind === 190 /* EnumDeclaration */ || isFunction(containingNodeKind); case 15 /* OpenParenToken */: - return containingNodeKind === 178 /* CatchBlock */ || isFunction(containingNodeKind); + return containingNodeKind === 181 /* CatchBlock */ || isFunction(containingNodeKind); case 13 /* OpenBraceToken */: - return containingNodeKind === 187 /* EnumDeclaration */ || containingNodeKind === 185 /* InterfaceDeclaration */; + return containingNodeKind === 190 /* EnumDeclaration */ || containingNodeKind === 188 /* InterfaceDeclaration */; case 21 /* SemicolonToken */: - return containingNodeKind === 124 /* Property */ && previousToken.parent.parent.kind === 185 /* InterfaceDeclaration */; + return containingNodeKind === 124 /* Property */ && previousToken.parent.parent.kind === 188 /* InterfaceDeclaration */; case 106 /* PublicKeyword */: case 104 /* PrivateKeyword */: case 107 /* StaticKeyword */: @@ -32782,6 +20976,7 @@ var ts; case 96 /* VarKeyword */: case 113 /* GetKeyword */: case 117 /* SetKeyword */: + case 83 /* ImportKeyword */: return true; } switch (previousToken.getText()) { @@ -32809,7 +21004,7 @@ var ts; } var existingMemberNames = {}; ts.forEach(existingMembers, function (m) { - if (m.kind !== 141 /* PropertyAssignment */) { + if (m.kind !== 143 /* PropertyAssignment */ && m.kind !== 144 /* ShorthandPropertyAssignment */) { return; } if (m.getStart() <= position && position <= m.getEnd()) { @@ -32827,18 +21022,17 @@ var ts; } } function getCompletionEntryDetails(filename, position, entryName) { - filename = TypeScript.switchToForwardSlashes(filename); + filename = ts.normalizeSlashes(filename); var sourceFile = getSourceFile(filename); var session = activeCompletionSession; if (!session || session.filename !== filename || session.position !== position) { return undefined; } - var symbol = ts.lookUp(activeCompletionSession.symbols, entryName); + var symbol = ts.lookUp(activeCompletionSession.symbols, ts.escapeIdentifier(entryName)); if (symbol) { - var type = session.typeChecker.getTypeOfSymbol(symbol); - ts.Debug.assert(type !== undefined, "Could not find type for symbol"); - var completionEntry = createCompletionEntry(symbol, session.typeChecker); var location = ts.getTouchingPropertyName(sourceFile, position); + var completionEntry = createCompletionEntry(symbol, session.typeChecker, location); + ts.Debug.assert(session.typeChecker.getNarrowedTypeOfSymbol(symbol, location) !== undefined, "Could not find type for symbol"); var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getSourceFile(filename), location, session.typeChecker, location, 7 /* All */); return { name: entryName, @@ -32862,24 +21056,24 @@ var ts; while (true) { node = node.parent; if (!node) { - return node; + return undefined; } switch (node.kind) { - case 193 /* SourceFile */: + case 196 /* SourceFile */: case 125 /* Method */: - case 182 /* FunctionDeclaration */: - case 149 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 184 /* ClassDeclaration */: - case 185 /* InterfaceDeclaration */: - case 187 /* EnumDeclaration */: - case 188 /* ModuleDeclaration */: + case 187 /* ClassDeclaration */: + case 188 /* InterfaceDeclaration */: + case 190 /* EnumDeclaration */: + case 191 /* ModuleDeclaration */: return node; } } } - function getSymbolKind(symbol, typeResolver) { + function getSymbolKind(symbol, typeResolver, location) { var flags = symbol.getFlags(); if (flags & 32 /* Class */) return ScriptElementKind.classElement; @@ -32891,7 +21085,7 @@ var ts; return ScriptElementKind.interfaceElement; if (flags & 1048576 /* TypeParameter */) return ScriptElementKind.typeParameterElement; - var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver); + var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location); if (result === ScriptElementKind.unknown) { if (flags & 1048576 /* TypeParameter */) return ScriptElementKind.typeParameterElement; @@ -32902,7 +21096,7 @@ var ts; } return result; } - function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver) { + function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location) { if (typeResolver.isUndefinedSymbol(symbol)) { return ScriptElementKind.variableElement; } @@ -32930,17 +21124,21 @@ var ts; return ScriptElementKind.constructorImplementationElement; if (flags & 4 /* Property */) { if (flags & 1073741824 /* UnionProperty */) { - return ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { + var unionPropertyKind = ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { var rootSymbolFlags = rootSymbol.getFlags(); - if (rootSymbolFlags & 4 /* Property */) { + if (rootSymbolFlags & (98308 /* PropertyOrAccessor */ | 3 /* Variable */)) { return ScriptElementKind.memberVariableElement; } - if (rootSymbolFlags & 32768 /* GetAccessor */) - return ScriptElementKind.memberVariableElement; - if (rootSymbolFlags & 65536 /* SetAccessor */) - return ScriptElementKind.memberVariableElement; - ts.Debug.assert((rootSymbolFlags & 8192 /* Method */) !== undefined); - }) || ScriptElementKind.memberFunctionElement; + ts.Debug.assert(!!(rootSymbolFlags & 8192 /* Method */)); + }); + if (!unionPropertyKind) { + var typeOfUnionProperty = typeInfoResolver.getNarrowedTypeOfSymbol(symbol, location); + if (typeOfUnionProperty.getCallSignatures().length) { + return ScriptElementKind.memberFunctionElement; + } + return ScriptElementKind.memberVariableElement; + } + return unionPropertyKind; } return ScriptElementKind.memberVariableElement; } @@ -32964,13 +21162,13 @@ var ts; } function getNodeKind(node) { switch (node.kind) { - case 188 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; - case 184 /* ClassDeclaration */: return ScriptElementKind.classElement; - case 185 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; - case 186 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement; - case 187 /* EnumDeclaration */: return ScriptElementKind.enumElement; - case 181 /* VariableDeclaration */: return node.flags & 4096 /* Const */ ? ScriptElementKind.constantElement : ScriptElementKind.variableElement; - case 182 /* FunctionDeclaration */: return ScriptElementKind.functionElement; + case 191 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; + case 187 /* ClassDeclaration */: return ScriptElementKind.classElement; + case 188 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; + case 189 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement; + case 190 /* EnumDeclaration */: return ScriptElementKind.enumElement; + case 184 /* VariableDeclaration */: return node.flags & 4096 /* Const */ ? ScriptElementKind.constantElement : ScriptElementKind.variableElement; + case 185 /* FunctionDeclaration */: return ScriptElementKind.functionElement; case 127 /* GetAccessor */: return ScriptElementKind.memberGetAccessorElement; case 128 /* SetAccessor */: return ScriptElementKind.memberSetAccessorElement; case 125 /* Method */: return ScriptElementKind.memberFunctionElement; @@ -32980,7 +21178,7 @@ var ts; case 129 /* CallSignature */: return ScriptElementKind.callSignatureElement; case 126 /* Constructor */: return ScriptElementKind.constructorImplementationElement; case 122 /* TypeParameter */: return ScriptElementKind.typeParameterElement; - case 192 /* EnumMember */: return ScriptElementKind.variableElement; + case 195 /* EnumMember */: return ScriptElementKind.variableElement; case 123 /* Parameter */: return (node.flags & 112 /* AccessibilityModifier */) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; } return ScriptElementKind.unknown; @@ -32993,22 +21191,22 @@ var ts; var displayParts = []; var documentation; var symbolFlags = symbol.flags; - var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver); + var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver, location); var hasAddedSymbolInfo; if (symbolKind !== ScriptElementKind.unknown || symbolFlags & 32 /* Class */ || symbolFlags & 33554432 /* Import */) { if (symbolKind === ScriptElementKind.memberGetAccessorElement || symbolKind === ScriptElementKind.memberSetAccessorElement) { symbolKind = ScriptElementKind.memberVariableElement; } - var type = typeResolver.getTypeOfSymbol(symbol); + var type = typeResolver.getNarrowedTypeOfSymbol(symbol, location); if (type) { - if (location.parent && location.parent.kind === 142 /* PropertyAccess */) { + if (location.parent && location.parent.kind === 145 /* PropertyAccess */) { var right = location.parent.right; if (right === location || (right && right.kind === 120 /* Missing */)) { location = location.parent; } } var callExpression; - if (location.kind === 144 /* CallExpression */ || location.kind === 145 /* NewExpression */) { + if (location.kind === 147 /* CallExpression */ || location.kind === 148 /* NewExpression */) { callExpression = location; } else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { @@ -33020,7 +21218,7 @@ var ts; if (!signature && candidateSignatures.length) { signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 145 /* NewExpression */ || callExpression.func.kind === 89 /* SuperKeyword */; + var useConstructSignatures = callExpression.kind === 148 /* NewExpression */ || callExpression.func.kind === 89 /* SuperKeyword */; var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target || signature)) { signature = allSignatures.length ? allSignatures[0] : undefined; @@ -33154,7 +21352,7 @@ var ts; if (symbolFlags & 8 /* EnumMember */) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 192 /* EnumMember */) { + if (declaration.kind === 195 /* EnumMember */) { var constantValue = typeResolver.getEnumMemberValue(declaration); if (constantValue !== undefined) { displayParts.push(spacePart()); @@ -33169,13 +21367,13 @@ var ts; displayParts.push(keywordPart(83 /* ImportKeyword */)); displayParts.push(spacePart()); addFullSymbolName(symbol); - displayParts.push(spacePart()); - displayParts.push(punctuationPart(51 /* EqualsToken */)); - displayParts.push(spacePart()); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 190 /* ImportDeclaration */) { + if (declaration.kind === 193 /* ImportDeclaration */) { var importDeclaration = declaration; if (importDeclaration.externalModuleName) { + displayParts.push(spacePart()); + displayParts.push(punctuationPart(51 /* EqualsToken */)); + displayParts.push(spacePart()); displayParts.push(keywordPart(115 /* RequireKeyword */)); displayParts.push(punctuationPart(15 /* OpenParenToken */)); displayParts.push(displayPart(ts.getTextOfNode(importDeclaration.externalModuleName), 8 /* stringLiteral */)); @@ -33183,7 +21381,12 @@ var ts; } else { var internalAliasSymbol = typeResolver.getSymbolInfo(importDeclaration.entityName); - addFullSymbolName(internalAliasSymbol, enclosingDeclaration); + if (internalAliasSymbol) { + displayParts.push(spacePart()); + displayParts.push(punctuationPart(51 /* EqualsToken */)); + displayParts.push(spacePart()); + addFullSymbolName(internalAliasSymbol, enclosingDeclaration); + } } return true; } @@ -33213,7 +21416,7 @@ var ts; } } else { - symbolKind = getSymbolKind(symbol, typeResolver); + symbolKind = getSymbolKind(symbol, typeResolver, location); } } if (!documentation) { @@ -33261,7 +21464,7 @@ var ts; } function getQuickInfoAtPosition(fileName, position) { synchronizeHostData(); - fileName = TypeScript.switchToForwardSlashes(fileName); + fileName = ts.normalizeSlashes(fileName); var sourceFile = getSourceFile(fileName); var node = ts.getTouchingPropertyName(sourceFile, position); if (!node) { @@ -33271,7 +21474,7 @@ var ts; if (!symbol) { switch (node.kind) { case 63 /* Identifier */: - case 142 /* PropertyAccess */: + case 145 /* PropertyAccess */: case 121 /* QualifiedName */: case 91 /* ThisKeyword */: case 89 /* SuperKeyword */: @@ -33280,7 +21483,7 @@ var ts; return { kind: ScriptElementKind.unknown, kindModifiers: ScriptElementKindModifier.none, - textSpan: new TypeScript.TextSpan(node.getStart(), node.getWidth()), + textSpan: new ts.TextSpan(node.getStart(), node.getWidth()), displayParts: typeToDisplayParts(typeInfoResolver, type, getContainerNode(node)), documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined }; @@ -33292,7 +21495,7 @@ var ts; return { kind: displayPartsDocumentationsAndKind.symbolKind, kindModifiers: getSymbolModifiers(symbol), - textSpan: new TypeScript.TextSpan(node.getStart(), node.getWidth()), + textSpan: new ts.TextSpan(node.getStart(), node.getWidth()), displayParts: displayPartsDocumentationsAndKind.displayParts, documentation: displayPartsDocumentationsAndKind.documentation }; @@ -33301,7 +21504,7 @@ var ts; function getDefinitionInfo(node, symbolKind, symbolName, containerName) { return { fileName: node.getSourceFile().filename, - textSpan: TypeScript.TextSpan.fromBounds(node.getStart(), node.getEnd()), + textSpan: ts.TextSpan.fromBounds(node.getStart(), node.getEnd()), kind: symbolKind, name: symbolName, containerKind: undefined, @@ -33312,7 +21515,7 @@ var ts; var declarations = []; var definition; ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 126 /* Constructor */) || (!selectConstructors && (d.kind === 182 /* FunctionDeclaration */ || d.kind === 125 /* Method */))) { + if ((selectConstructors && d.kind === 126 /* Constructor */) || (!selectConstructors && (d.kind === 185 /* FunctionDeclaration */ || d.kind === 125 /* Method */))) { declarations.push(d); if (d.body) definition = d; @@ -33332,7 +21535,7 @@ var ts; if (isNewExpressionTarget(location) || location.kind === 111 /* ConstructorKeyword */) { if (symbol.flags & 32 /* Class */) { var classDeclaration = symbol.getDeclarations()[0]; - ts.Debug.assert(classDeclaration && classDeclaration.kind === 184 /* ClassDeclaration */); + ts.Debug.assert(classDeclaration && classDeclaration.kind === 187 /* ClassDeclaration */); return tryAddSignature(classDeclaration.members, true, symbolKind, symbolName, containerName, result); } } @@ -33345,7 +21548,7 @@ var ts; return false; } synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); + filename = ts.normalizeSlashes(filename); var sourceFile = getSourceFile(filename); var node = ts.getTouchingPropertyName(sourceFile, position); if (!node) { @@ -33363,7 +21566,7 @@ var ts; if (program.getSourceFile(targetFilename)) { return [{ fileName: targetFilename, - textSpan: TypeScript.TextSpan.fromBounds(0, 0), + textSpan: ts.TextSpan.fromBounds(0, 0), kind: ScriptElementKind.scriptElement, name: comment.filename, containerName: undefined, @@ -33377,6 +21580,17 @@ var ts; return undefined; } var result = []; + if (node.parent.kind === 144 /* ShorthandPropertyAssignment */) { + var shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); + var shorthandDeclarations = shorthandSymbol.getDeclarations(); + var shorthandSymbolKind = getSymbolKind(shorthandSymbol, typeInfoResolver); + var shorthandSymbolName = typeInfoResolver.symbolToString(shorthandSymbol); + var shorthandContainerName = typeInfoResolver.symbolToString(symbol.parent, node); + ts.forEach(shorthandDeclarations, function (declaration) { + result.push(getDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName)); + }); + return result; + } var declarations = symbol.getDeclarations(); var symbolName = typeInfoResolver.symbolToString(symbol); var symbolKind = getSymbolKind(symbol, typeInfoResolver); @@ -33391,7 +21605,7 @@ var ts; } function getOccurrencesAtPosition(filename, position) { synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); + filename = ts.normalizeSlashes(filename); var sourceFile = getSourceFile(filename); var node = ts.getTouchingWord(sourceFile, position); if (!node) { @@ -33403,52 +21617,52 @@ var ts; switch (node.kind) { case 82 /* IfKeyword */: case 74 /* ElseKeyword */: - if (hasKind(node.parent, 162 /* IfStatement */)) { + if (hasKind(node.parent, 165 /* IfStatement */)) { return getIfElseOccurrences(node.parent); } break; case 88 /* ReturnKeyword */: - if (hasKind(node.parent, 169 /* ReturnStatement */)) { + if (hasKind(node.parent, 172 /* ReturnStatement */)) { return getReturnOccurrences(node.parent); } break; case 92 /* ThrowKeyword */: - if (hasKind(node.parent, 175 /* ThrowStatement */)) { + if (hasKind(node.parent, 178 /* ThrowStatement */)) { return getThrowOccurrences(node.parent); } break; case 94 /* TryKeyword */: case 66 /* CatchKeyword */: case 79 /* FinallyKeyword */: - if (hasKind(parent(parent(node)), 176 /* TryStatement */)) { + if (hasKind(parent(parent(node)), 179 /* TryStatement */)) { return getTryCatchFinallyOccurrences(node.parent.parent); } break; case 90 /* SwitchKeyword */: - if (hasKind(node.parent, 171 /* SwitchStatement */)) { + if (hasKind(node.parent, 174 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent); } break; case 65 /* CaseKeyword */: case 71 /* DefaultKeyword */: - if (hasKind(parent(parent(node)), 171 /* SwitchStatement */)) { + if (hasKind(parent(parent(node)), 174 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent.parent); } break; case 64 /* BreakKeyword */: case 69 /* ContinueKeyword */: - if (hasKind(node.parent, 168 /* BreakStatement */) || hasKind(node.parent, 167 /* ContinueStatement */)) { + if (hasKind(node.parent, 171 /* BreakStatement */) || hasKind(node.parent, 170 /* ContinueStatement */)) { return getBreakOrContinueStatementOccurences(node.parent); } break; case 80 /* ForKeyword */: - if (hasKind(node.parent, 165 /* ForStatement */) || hasKind(node.parent, 166 /* ForInStatement */)) { + if (hasKind(node.parent, 168 /* ForStatement */) || hasKind(node.parent, 169 /* ForInStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; case 98 /* WhileKeyword */: case 73 /* DoKeyword */: - if (hasKind(node.parent, 164 /* WhileStatement */) || hasKind(node.parent, 163 /* DoStatement */)) { + if (hasKind(node.parent, 167 /* WhileStatement */) || hasKind(node.parent, 166 /* DoStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; @@ -33466,7 +21680,7 @@ var ts; return undefined; function getIfElseOccurrences(ifStatement) { var keywords = []; - while (hasKind(ifStatement.parent, 162 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { + while (hasKind(ifStatement.parent, 165 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { ifStatement = ifStatement.parent; } while (ifStatement) { @@ -33477,7 +21691,7 @@ var ts; break; } } - if (!hasKind(ifStatement.elseStatement, 162 /* IfStatement */)) { + if (!hasKind(ifStatement.elseStatement, 165 /* IfStatement */)) { break; } ifStatement = ifStatement.elseStatement; @@ -33497,7 +21711,7 @@ var ts; if (shouldHighlightNextKeyword) { result.push({ fileName: filename, - textSpan: TypeScript.TextSpan.fromBounds(elseKeyword.getStart(), ifKeyword.end), + textSpan: ts.TextSpan.fromBounds(elseKeyword.getStart(), ifKeyword.end), isWriteAccess: false }); i++; @@ -33510,7 +21724,7 @@ var ts; } function getReturnOccurrences(returnStatement) { var func = ts.getContainingFunction(returnStatement); - if (!(func && hasKind(func.body, 183 /* FunctionBlock */))) { + if (!(func && hasKind(func.body, 186 /* FunctionBlock */))) { return undefined; } var keywords = []; @@ -33531,7 +21745,7 @@ var ts; ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { pushKeywordIf(keywords, throwStatement.getFirstToken(), 92 /* ThrowKeyword */); }); - if (owner.kind === 183 /* FunctionBlock */) { + if (owner.kind === 186 /* FunctionBlock */) { ts.forEachReturnStatement(owner, function (returnStatement) { pushKeywordIf(keywords, returnStatement.getFirstToken(), 88 /* ReturnKeyword */); }); @@ -33543,10 +21757,10 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 175 /* ThrowStatement */) { + if (node.kind === 178 /* ThrowStatement */) { statementAccumulator.push(node); } - else if (node.kind === 176 /* TryStatement */) { + else if (node.kind === 179 /* TryStatement */) { var tryStatement = node; if (tryStatement.catchBlock) { aggregate(tryStatement.catchBlock); @@ -33568,10 +21782,10 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (parent.kind === 183 /* FunctionBlock */ || parent.kind === 193 /* SourceFile */) { + if (parent.kind === 186 /* FunctionBlock */ || parent.kind === 196 /* SourceFile */) { return parent; } - if (parent.kind === 176 /* TryStatement */) { + if (parent.kind === 179 /* TryStatement */) { var tryStatement = parent; if (tryStatement.tryBlock === child && tryStatement.catchBlock) { return child; @@ -33595,7 +21809,7 @@ var ts; function getLoopBreakContinueOccurrences(loopNode) { var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 80 /* ForKeyword */, 98 /* WhileKeyword */, 73 /* DoKeyword */)) { - if (loopNode.kind === 163 /* DoStatement */) { + if (loopNode.kind === 166 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 98 /* WhileKeyword */)) { @@ -33615,7 +21829,6 @@ var ts; function getSwitchCaseDefaultOccurrences(switchStatement) { var keywords = []; pushKeywordIf(keywords, switchStatement.getFirstToken(), 90 /* SwitchKeyword */); - var breakSearchType = 3 /* All */; ts.forEach(switchStatement.clauses, function (clause) { pushKeywordIf(keywords, clause.getFirstToken(), 65 /* CaseKeyword */, 71 /* DefaultKeyword */); var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); @@ -33631,12 +21844,12 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 165 /* ForStatement */: - case 166 /* ForInStatement */: - case 163 /* DoStatement */: - case 164 /* WhileStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 166 /* DoStatement */: + case 167 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 171 /* SwitchStatement */: + case 174 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -33647,7 +21860,7 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 168 /* BreakStatement */ || node.kind === 167 /* ContinueStatement */) { + if (node.kind === 171 /* BreakStatement */ || node.kind === 170 /* ContinueStatement */) { statementAccumulator.push(node); } else if (!ts.isAnyFunction(node)) { @@ -33663,14 +21876,14 @@ var ts; function getBreakOrContinueOwner(statement) { for (var node = statement.parent; node; node = node.parent) { switch (node.kind) { - case 171 /* SwitchStatement */: - if (statement.kind === 167 /* ContinueStatement */) { + case 174 /* SwitchStatement */: + if (statement.kind === 170 /* ContinueStatement */) { continue; } - case 165 /* ForStatement */: - case 166 /* ForInStatement */: - case 164 /* WhileStatement */: - case 163 /* DoStatement */: + case 168 /* ForStatement */: + case 169 /* ForInStatement */: + case 167 /* WhileStatement */: + case 166 /* DoStatement */: if (!statement.label || isLabeledBy(node, statement.label.text)) { return node; } @@ -33732,7 +21945,7 @@ var ts; } function findReferences(fileName, position, findInStrings, findInComments) { synchronizeHostData(); - fileName = TypeScript.switchToForwardSlashes(fileName); + fileName = ts.normalizeSlashes(fileName); var sourceFile = getSourceFile(fileName); var node = ts.getTouchingPropertyName(sourceFile, position); if (!node) { @@ -33787,7 +22000,7 @@ var ts; } return result; function getNormalizedSymbolName(symbolName, declarations) { - var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 149 /* FunctionExpression */ ? d : undefined; }); + var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 152 /* FunctionExpression */ ? d : undefined; }); if (functionExpression && functionExpression.name) { var name = functionExpression.name.text; } @@ -33805,7 +22018,7 @@ var ts; if (symbol.getFlags() && (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 32 /* Private */) ? d : undefined; }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 184 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 187 /* ClassDeclaration */); } } if (symbol.parent) { @@ -33816,10 +22029,13 @@ var ts; if (declarations) { for (var i = 0, n = declarations.length; i < n; i++) { var container = getContainerNode(declarations[i]); + if (!container) { + return undefined; + } if (scope && scope !== container) { return undefined; } - if (container.kind === 193 /* SourceFile */ && !ts.isExternalModule(container)) { + if (container.kind === 196 /* SourceFile */ && !ts.isExternalModule(container)) { return undefined; } scope = container; @@ -33897,7 +22113,7 @@ var ts; if ((findInStrings && isInString(position)) || (findInComments && isInComment(position))) { result.push({ fileName: sourceFile.filename, - textSpan: new TypeScript.TextSpan(position, searchText.length), + textSpan: new ts.TextSpan(position, searchText.length), isWriteAccess: false }); } @@ -33907,8 +22123,15 @@ var ts; return; } var referenceSymbol = typeInfoResolver.getSymbolInfo(referenceLocation); - if (referenceSymbol && isRelatableToSearchSet(searchSymbols, referenceSymbol, referenceLocation)) { - result.push(getReferenceEntryFromNode(referenceLocation)); + if (referenceSymbol) { + var referenceSymbolDeclaration = referenceSymbol.valueDeclaration; + var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration); + if (isRelatableToSearchSet(searchSymbols, referenceSymbol, referenceLocation)) { + result.push(getReferenceEntryFromNode(referenceLocation)); + } + else if (!(referenceSymbol.flags & 268435456 /* Transient */) && searchSymbols.indexOf(shorthandValueSymbol) >= 0) { + result.push(getReferenceEntryFromNode(referenceSymbolDeclaration.name)); + } } }); } @@ -33978,18 +22201,18 @@ var ts; staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; - case 193 /* SourceFile */: + case 196 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } - case 182 /* FunctionDeclaration */: - case 149 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: break; default: return undefined; } var result = []; - if (searchSpaceNode.kind === 193 /* SourceFile */) { + if (searchSpaceNode.kind === 196 /* SourceFile */) { ts.forEach(sourceFiles, function (sourceFile) { var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, result); @@ -34010,19 +22233,19 @@ var ts; } var container = ts.getThisContainer(node, false); switch (searchSpaceNode.kind) { - case 149 /* FunctionExpression */: - case 182 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: if (searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 128 /* Static */) === staticFlag) { result.push(getReferenceEntryFromNode(node)); } break; - case 193 /* SourceFile */: - if (container.kind === 193 /* SourceFile */ && !ts.isExternalModule(container)) { + case 196 /* SourceFile */: + if (container.kind === 196 /* SourceFile */ && !ts.isExternalModule(container)) { result.push(getReferenceEntryFromNode(node)); } break; @@ -34036,6 +22259,10 @@ var ts; ts.forEach(getPropertySymbolsFromContextualType(location), function (contextualSymbol) { result.push.apply(result, typeInfoResolver.getRootSymbols(contextualSymbol)); }); + var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(location.parent); + if (shorthandValueSymbol) { + result.push(shorthandValueSymbol); + } } ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { if (rootSymbol !== symbol) { @@ -34050,11 +22277,11 @@ var ts; function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { if (symbol && symbol.flags & (32 /* Class */ | 64 /* Interface */)) { ts.forEach(symbol.getDeclarations(), function (declaration) { - if (declaration.kind === 184 /* ClassDeclaration */) { + if (declaration.kind === 187 /* ClassDeclaration */) { getPropertySymbolFromTypeReference(declaration.baseType); ts.forEach(declaration.implementedTypes, getPropertySymbolFromTypeReference); } - else if (declaration.kind === 185 /* InterfaceDeclaration */) { + else if (declaration.kind === 188 /* InterfaceDeclaration */) { ts.forEach(declaration.baseTypes, getPropertySymbolFromTypeReference); } }); @@ -34150,7 +22377,7 @@ var ts; } return { fileName: node.getSourceFile().filename, - textSpan: TypeScript.TextSpan.fromBounds(start, end), + textSpan: ts.TextSpan.fromBounds(start, end), isWriteAccess: isWriteAccess(node) }; } @@ -34160,10 +22387,10 @@ var ts; } var parent = node.parent; if (parent) { - if (parent.kind === 152 /* PostfixOperator */ || parent.kind === 151 /* PrefixOperator */) { + if (parent.kind === 155 /* PostfixOperator */ || parent.kind === 154 /* PrefixOperator */) { return true; } - else if (parent.kind === 153 /* BinaryExpression */ && parent.left === node) { + else if (parent.kind === 156 /* BinaryExpression */ && parent.left === node) { var operator = parent.operator; return 51 /* FirstAssignment */ <= operator && operator <= 62 /* LastAssignment */; } @@ -34191,9 +22418,9 @@ var ts; kindModifiers: getNodeModifiers(declaration), matchKind: MatchKind[matchKind], fileName: filename, - textSpan: TypeScript.TextSpan.fromBounds(declaration.getStart(), declaration.getEnd()), - containerName: container.name ? container.name.text : "", - containerKind: container.name ? getNodeKind(container) : "" + textSpan: ts.TextSpan.fromBounds(declaration.getStart(), declaration.getEnd()), + containerName: container && container.name ? container.name.text : "", + containerKind: container && container.name ? getNodeKind(container) : "" }); } } @@ -34235,11 +22462,10 @@ var ts; } function getEmitOutput(filename) { synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); + filename = ts.normalizeSlashes(filename); var compilerOptions = program.getCompilerOptions(); var targetSourceFile = program.getSourceFile(filename); var shouldEmitToOwnFile = ts.shouldEmitToOwnFile(targetSourceFile, compilerOptions); - var emitDeclaration = compilerOptions.declaration; var emitOutput = { outputFiles: [], emitOutputStatus: undefined @@ -34252,7 +22478,6 @@ var ts; }); } writer = getEmitOutputWriter; - var syntacticDiagnostics = []; var containSyntacticErrors = false; if (shouldEmitToOwnFile) { containSyntacticErrors = containErrors(program.getDiagnostics(targetSourceFile)); @@ -34270,7 +22495,7 @@ var ts; writer = undefined; return emitOutput; } - var emitFilesResult = getFullTypeCheckChecker().emitFiles(targetSourceFile); + var emitFilesResult = getFullTypeCheckChecker().invokeEmitter(targetSourceFile); emitOutput.emitOutputStatus = emitFilesResult.emitResultStatus; writer = undefined; return emitOutput; @@ -34278,28 +22503,29 @@ var ts; function getMeaningFromDeclaration(node) { switch (node.kind) { case 123 /* Parameter */: - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: case 124 /* Property */: - case 141 /* PropertyAssignment */: - case 192 /* EnumMember */: + case 143 /* PropertyAssignment */: + case 144 /* ShorthandPropertyAssignment */: + case 195 /* EnumMember */: case 125 /* Method */: case 126 /* Constructor */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: - case 182 /* FunctionDeclaration */: - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: - case 178 /* CatchBlock */: + case 185 /* FunctionDeclaration */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: + case 181 /* CatchBlock */: return 1 /* Value */; case 122 /* TypeParameter */: - case 185 /* InterfaceDeclaration */: - case 186 /* TypeAliasDeclaration */: - case 134 /* TypeLiteral */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: + case 136 /* TypeLiteral */: return 2 /* Type */; - case 184 /* ClassDeclaration */: - case 187 /* EnumDeclaration */: + case 187 /* ClassDeclaration */: + case 190 /* EnumDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: if (node.name.kind === 7 /* StringLiteral */) { return 4 /* Namespace */ | 1 /* Value */; } @@ -34309,9 +22535,10 @@ var ts; else { return 4 /* Namespace */; } - break; - case 190 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; + case 196 /* SourceFile */: + return 4 /* Namespace */ | 1 /* Value */; } ts.Debug.fail("Unknown declaration type"); } @@ -34335,17 +22562,17 @@ var ts; while (node.parent.kind === 121 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 190 /* ImportDeclaration */ && node.parent.entityName === node; + return node.parent.kind === 193 /* ImportDeclaration */ && node.parent.entityName === node; } function getMeaningFromRightHandSideOfImport(node) { ts.Debug.assert(node.kind === 63 /* Identifier */); - if (node.parent.kind === 121 /* QualifiedName */ && node.parent.right === node && node.parent.parent.kind === 190 /* ImportDeclaration */) { + if (node.parent.kind === 121 /* QualifiedName */ && node.parent.right === node && node.parent.parent.kind === 193 /* ImportDeclaration */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } return 4 /* Namespace */; } function getMeaningFromLocation(node) { - if (node.parent.kind === 191 /* ExportAssignment */) { + if (node.parent.kind === 194 /* ExportAssignment */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } else if (isInRightSideOfImport(node)) { @@ -34366,7 +22593,7 @@ var ts; } function getSignatureHelpItems(fileName, position) { synchronizeHostData(); - fileName = TypeScript.switchToForwardSlashes(fileName); + fileName = ts.normalizeSlashes(fileName); var sourceFile = getSourceFile(fileName); return ts.SignatureHelp.getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken); } @@ -34388,7 +22615,7 @@ var ts; } var start = signatureInfoString.length; signatureInfoString += displayPartsToString(parameter.displayParts); - var end = signatureInfoString.length - 1; + var end = signatureInfoString.length; parameters.push({ name: parameter.name, isVariable: i === n - 1 && signature.isVariadic, @@ -34418,12 +22645,8 @@ var ts; activeFormal: 0 }; } - function getSyntaxTree(filename) { - filename = TypeScript.switchToForwardSlashes(filename); - return syntaxTreeCache.getCurrentFileSyntaxTree(filename); - } function getCurrentSourceFile(filename) { - filename = TypeScript.switchToForwardSlashes(filename); + filename = ts.normalizeSlashes(filename); var currentSourceFile = syntaxTreeCache.getCurrentSourceFile(filename); return currentSourceFile; } @@ -34434,7 +22657,7 @@ var ts; return; } switch (node.kind) { - case 142 /* PropertyAccess */: + case 145 /* PropertyAccess */: case 121 /* QualifiedName */: case 7 /* StringLiteral */: case 78 /* FalseKeyword */: @@ -34453,7 +22676,7 @@ var ts; nodeForStartPos = nodeForStartPos.parent; } else if (isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 188 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { + if (nodeForStartPos.parent.parent.kind === 191 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { nodeForStartPos = nodeForStartPos.parent.parent.name; } else { @@ -34464,19 +22687,19 @@ var ts; break; } } - return TypeScript.TextSpan.fromBounds(nodeForStartPos.getStart(), node.getEnd()); + return ts.TextSpan.fromBounds(nodeForStartPos.getStart(), node.getEnd()); } function getBreakpointStatementAtPosition(filename, position) { filename = ts.normalizeSlashes(filename); return ts.BreakpointResolver.spanInSourceFileAtLocation(getCurrentSourceFile(filename), position); } function getNavigationBarItems(filename) { - filename = TypeScript.switchToForwardSlashes(filename); + filename = ts.normalizeSlashes(filename); return ts.NavigationBar.getNavigationBarItems(getCurrentSourceFile(filename)); } function getSemanticClassifications(fileName, span) { synchronizeHostData(); - fileName = TypeScript.switchToForwardSlashes(fileName); + fileName = ts.normalizeSlashes(fileName); var sourceFile = getSourceFile(fileName); var result = []; processNode(sourceFile); @@ -34505,7 +22728,7 @@ var ts; return undefined; function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 188 /* ModuleDeclaration */ && ts.getModuleInstanceState(declaration) == 1 /* Instantiated */; + return declaration.kind === 191 /* ModuleDeclaration */ && ts.getModuleInstanceState(declaration) == 1 /* Instantiated */; }); } } @@ -34517,7 +22740,7 @@ var ts; var type = classifySymbol(symbol, getMeaningFromLocation(node)); if (type) { result.push({ - textSpan: new TypeScript.TextSpan(node.getStart(), node.getWidth()), + textSpan: new ts.TextSpan(node.getStart(), node.getWidth()), classificationType: type }); } @@ -34528,7 +22751,7 @@ var ts; } } function getSyntacticClassifications(fileName, span) { - fileName = TypeScript.switchToForwardSlashes(fileName); + fileName = ts.normalizeSlashes(fileName); var sourceFile = getCurrentSourceFile(fileName); var result = []; processElement(sourceFile); @@ -34537,7 +22760,7 @@ var ts; var width = comment.end - comment.pos; if (span.intersectsWith(comment.pos, width)) { result.push({ - textSpan: new TypeScript.TextSpan(comment.pos, width), + textSpan: new ts.TextSpan(comment.pos, width), classificationType: ClassificationTypeNames.comment }); } @@ -34548,7 +22771,7 @@ var ts; var type = classifyTokenType(token); if (type) { result.push({ - textSpan: new TypeScript.TextSpan(token.getStart(), token.getWidth()), + textSpan: new ts.TextSpan(token.getStart(), token.getWidth()), classificationType: type }); } @@ -34565,8 +22788,8 @@ var ts; return ClassificationTypeNames.punctuation; } } - if (ts.isPunctuation(token)) { - if (token.parent.kind === 153 /* BinaryExpression */ || token.parent.kind === 181 /* VariableDeclaration */ || token.parent.kind === 151 /* PrefixOperator */ || token.parent.kind === 152 /* PostfixOperator */ || token.parent.kind === 154 /* ConditionalExpression */) { + if (ts.isPunctuation(token.kind)) { + if (token.parent.kind === 156 /* BinaryExpression */ || token.parent.kind === 184 /* VariableDeclaration */ || token.parent.kind === 154 /* PrefixOperator */ || token.parent.kind === 155 /* PostfixOperator */ || token.parent.kind === 157 /* ConditionalExpression */) { return ClassificationTypeNames.operator; } else { @@ -34587,7 +22810,7 @@ var ts; } else if (tokenKind === 63 /* Identifier */) { switch (token.parent.kind) { - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.className; } @@ -34597,17 +22820,17 @@ var ts; return ClassificationTypeNames.typeParameterName; } return; - case 185 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.interfaceName; } return; - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.enumName; } return; - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.moduleName; } @@ -34633,7 +22856,7 @@ var ts; } } function getOutliningSpans(filename) { - filename = TypeScript.switchToForwardSlashes(filename); + filename = ts.normalizeSlashes(filename); var sourceFile = getCurrentSourceFile(filename); return ts.OutliningElementsCollector.collectElements(sourceFile); } @@ -34647,10 +22870,11 @@ var ts; var parentElement = token.parent; var childNodes = parentElement.getChildren(sourceFile); for (var i = 0, n = childNodes.length; i < n; i++) { + 33; var current = childNodes[i]; if (current.kind === matchKind) { - var range1 = new TypeScript.TextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); - var range2 = new TypeScript.TextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); + var range1 = new ts.TextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); + var range2 = new ts.TextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); if (range1.start() < range2.start()) { result.push(range1, range2); } @@ -34678,55 +22902,42 @@ var ts; } } function getIndentationAtPosition(filename, position, editorOptions) { - filename = TypeScript.switchToForwardSlashes(filename); + filename = ts.normalizeSlashes(filename); var start = new Date().getTime(); var sourceFile = getCurrentSourceFile(filename); host.log("getIndentationAtPosition: getCurrentSourceFile: " + (new Date().getTime() - start)); var start = new Date().getTime(); - var options = new TypeScript.FormattingOptions(!editorOptions.ConvertTabsToSpaces, editorOptions.TabSize, editorOptions.IndentSize, editorOptions.NewLineCharacter); - var result = ts.formatting.SmartIndenter.getIndentation(position, sourceFile, options); + var result = ts.formatting.SmartIndenter.getIndentation(position, sourceFile, editorOptions); host.log("getIndentationAtPosition: computeIndentation : " + (new Date().getTime() - start)); return result; } - function getFormattingManager(filename, options) { - if (formattingRulesProvider == null) { - formattingRulesProvider = new TypeScript.Services.Formatting.RulesProvider(host); - } - formattingRulesProvider.ensureUpToDate(options); - var syntaxTree = getSyntaxTree(filename); - var scriptSnapshot = syntaxTreeCache.getCurrentScriptSnapshot(filename); - var scriptText = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - var textSnapshot = new TypeScript.Services.Formatting.TextSnapshot(scriptText); - var manager = new TypeScript.Services.Formatting.FormattingManager(syntaxTree, textSnapshot, formattingRulesProvider, options); - return manager; - } function getFormattingEditsForRange(fileName, start, end, options) { - fileName = TypeScript.switchToForwardSlashes(fileName); - var manager = getFormattingManager(fileName, options); - return manager.formatSelection(start, end); + fileName = ts.normalizeSlashes(fileName); + var sourceFile = getCurrentSourceFile(fileName); + return ts.formatting.formatSelection(start, end, sourceFile, getRuleProvider(options), options); } function getFormattingEditsForDocument(fileName, options) { - fileName = TypeScript.switchToForwardSlashes(fileName); - var manager = getFormattingManager(fileName, options); - return manager.formatDocument(); + fileName = ts.normalizeSlashes(fileName); + var sourceFile = getCurrentSourceFile(fileName); + return ts.formatting.formatDocument(sourceFile, getRuleProvider(options), options); } function getFormattingEditsAfterKeystroke(fileName, position, key, options) { - fileName = TypeScript.switchToForwardSlashes(fileName); - var manager = getFormattingManager(fileName, options); + fileName = ts.normalizeSlashes(fileName); + var sourceFile = getCurrentSourceFile(fileName); if (key === "}") { - return manager.formatOnClosingCurlyBrace(position); + return ts.formatting.formatOnClosingCurly(position, sourceFile, getRuleProvider(options), options); } else if (key === ";") { - return manager.formatOnSemicolon(position); + return ts.formatting.formatOnSemicolon(position, sourceFile, getRuleProvider(options), options); } else if (key === "\n") { - return manager.formatOnEnter(position); + return ts.formatting.formatOnEnter(position, sourceFile, getRuleProvider(options), options); } return []; } function getTodoComments(filename, descriptors) { synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); + filename = ts.normalizeSlashes(filename); var sourceFile = getSourceFile(filename); cancellationToken.throwIfCancellationRequested(); var fileContents = sourceFile.text; @@ -34796,7 +23007,7 @@ var ts; } function getRenameInfo(fileName, position) { synchronizeHostData(); - fileName = TypeScript.switchToForwardSlashes(fileName); + fileName = ts.normalizeSlashes(fileName); var sourceFile = getSourceFile(fileName); var node = ts.getTouchingWord(sourceFile, position); if (node && node.kind === 63 /* Identifier */) { @@ -34804,7 +23015,7 @@ var ts; if (symbol && symbol.getDeclarations() && symbol.getDeclarations().length > 0) { var kind = getSymbolKind(symbol, typeInfoResolver); if (kind) { - return getRenameInfo(symbol.name, typeInfoResolver.getFullyQualifiedName(symbol), kind, getSymbolModifiers(symbol), new TypeScript.TextSpan(node.getStart(), node.getWidth())); + return getRenameInfo(symbol.name, typeInfoResolver.getFullyQualifiedName(symbol), kind, getSymbolModifiers(symbol), new ts.TextSpan(node.getStart(), node.getWidth())); } } } @@ -34847,7 +23058,6 @@ var ts; getDefinitionAtPosition: getDefinitionAtPosition, getReferencesAtPosition: getReferencesAtPosition, getOccurrencesAtPosition: getOccurrencesAtPosition, - getImplementorsAtPosition: function (filename, position) { return []; }, getNameOrDottedNameSpan: getNameOrDottedNameSpan, getBreakpointStatementAtPosition: getBreakpointStatementAtPosition, getNavigateToItems: getNavigateToItems, @@ -34901,7 +23111,6 @@ var ts; } function getClassificationsForLine(text, lexState) { var offset = 0; - var lastTokenOrCommentEnd = 0; var token = 0 /* Unknown */; var lastNonTriviaToken = 0 /* Unknown */; switch (lexState) { @@ -35068,9 +23277,7 @@ var ts; return 5 /* Identifier */; } } - return { - getClassificationsForLine: getClassificationsForLine - }; + return { getClassificationsForLine: getClassificationsForLine }; } ts.createClassifier = createClassifier; function initializeServices() { @@ -35078,7 +23285,7 @@ var ts; getNodeConstructor: function (kind) { function Node() { } - var proto = kind === 193 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); + var proto = kind === 196 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); proto.kind = kind; proto.pos = 0; proto.end = 0; @@ -35115,7 +23322,7 @@ var ts; } return spanInNode(tokenAtLocation); function textSpan(startNode, endNode) { - return TypeScript.TextSpan.fromBounds(startNode.getStart(), (endNode || startNode).getEnd()); + return ts.TextSpan.fromBounds(startNode.getStart(), (endNode || startNode).getEnd()); } function spanInNodeIfStartsOnSameLine(node, otherwiseOnNode) { if (node && lineOfPosition === sourceFile.getLineAndCharacterFromPosition(node.getStart()).line) { @@ -35132,90 +23339,91 @@ var ts; function spanInNode(node) { if (node) { if (ts.isExpression(node)) { - if (node.parent.kind === 163 /* DoStatement */) { + if (node.parent.kind === 166 /* DoStatement */) { return spanInPreviousNode(node); } - if (node.parent.kind === 165 /* ForStatement */) { + if (node.parent.kind === 168 /* ForStatement */) { return textSpan(node); } - if (node.parent.kind === 153 /* BinaryExpression */ && node.parent.operator === 22 /* CommaToken */) { + if (node.parent.kind === 156 /* BinaryExpression */ && node.parent.operator === 22 /* CommaToken */) { return textSpan(node); } - if (node.parent.kind == 150 /* ArrowFunction */ && node.parent.body == node) { + if (node.parent.kind == 153 /* ArrowFunction */ && node.parent.body == node) { return textSpan(node); } } switch (node.kind) { - case 159 /* VariableStatement */: + case 162 /* VariableStatement */: return spanInVariableDeclaration(node.declarations[0]); - case 181 /* VariableDeclaration */: + case 184 /* VariableDeclaration */: case 124 /* Property */: return spanInVariableDeclaration(node); case 123 /* Parameter */: return spanInParameterDeclaration(node); - case 182 /* FunctionDeclaration */: + case 185 /* FunctionDeclaration */: case 125 /* Method */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: case 126 /* Constructor */: - case 149 /* FunctionExpression */: - case 150 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 153 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 183 /* FunctionBlock */: + case 186 /* FunctionBlock */: return spanInFunctionBlock(node); - case 158 /* Block */: - case 177 /* TryBlock */: - case 178 /* CatchBlock */: - case 179 /* FinallyBlock */: - case 189 /* ModuleBlock */: + case 161 /* Block */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: + case 192 /* ModuleBlock */: return spanInBlock(node); - case 161 /* ExpressionStatement */: + case 164 /* ExpressionStatement */: return textSpan(node.expression); - case 169 /* ReturnStatement */: + case 172 /* ReturnStatement */: return textSpan(node.getChildAt(0), node.expression); - case 164 /* WhileStatement */: + case 167 /* WhileStatement */: return textSpan(node, ts.findNextToken(node.expression, node)); - case 163 /* DoStatement */: + case 166 /* DoStatement */: return spanInNode(node.statement); - case 180 /* DebuggerStatement */: + case 183 /* DebuggerStatement */: return textSpan(node.getChildAt(0)); - case 162 /* IfStatement */: + case 165 /* IfStatement */: return textSpan(node, ts.findNextToken(node.expression, node)); - case 174 /* LabeledStatement */: + case 177 /* LabeledStatement */: return spanInNode(node.statement); - case 168 /* BreakStatement */: - case 167 /* ContinueStatement */: + case 171 /* BreakStatement */: + case 170 /* ContinueStatement */: return textSpan(node.getChildAt(0), node.label); - case 165 /* ForStatement */: + case 168 /* ForStatement */: return spanInForStatement(node); - case 166 /* ForInStatement */: + case 169 /* ForInStatement */: return textSpan(node, ts.findNextToken(node.expression, node)); - case 171 /* SwitchStatement */: + case 174 /* SwitchStatement */: return textSpan(node, ts.findNextToken(node.expression, node)); - case 172 /* CaseClause */: - case 173 /* DefaultClause */: + case 175 /* CaseClause */: + case 176 /* DefaultClause */: return spanInNode(node.statements[0]); - case 176 /* TryStatement */: + case 179 /* TryStatement */: return spanInBlock(node.tryBlock); - case 175 /* ThrowStatement */: + case 178 /* ThrowStatement */: return textSpan(node, node.expression); - case 191 /* ExportAssignment */: + case 194 /* ExportAssignment */: return textSpan(node, node.exportName); - case 190 /* ImportDeclaration */: + case 193 /* ImportDeclaration */: return textSpan(node, node.entityName || node.externalModuleName); - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } - case 184 /* ClassDeclaration */: - case 187 /* EnumDeclaration */: - case 192 /* EnumMember */: - case 144 /* CallExpression */: - case 145 /* NewExpression */: + case 187 /* ClassDeclaration */: + case 190 /* EnumDeclaration */: + case 195 /* EnumMember */: + case 147 /* CallExpression */: + case 148 /* NewExpression */: return textSpan(node); - case 170 /* WithStatement */: + case 173 /* WithStatement */: return spanInNode(node.statement); - case 185 /* InterfaceDeclaration */: + case 188 /* InterfaceDeclaration */: + case 189 /* TypeAliasDeclaration */: return undefined; case 21 /* SemicolonToken */: case 1 /* EndOfFileToken */: @@ -35242,10 +23450,10 @@ var ts; case 79 /* FinallyKeyword */: return spanInNextNode(node); default: - if (node.parent.kind === 141 /* PropertyAssignment */ && node.parent.name === node) { + if (node.parent.kind === 143 /* PropertyAssignment */ && node.parent.name === node) { return spanInNode(node.parent.initializer); } - if (node.parent.kind === 147 /* TypeAssertion */ && node.parent.type === node) { + if (node.parent.kind === 150 /* TypeAssertion */ && node.parent.type === node) { return spanInNode(node.parent.operand); } if (ts.isAnyFunction(node.parent) && node.parent.type === node) { @@ -35255,11 +23463,11 @@ var ts; } } function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.kind === 166 /* ForInStatement */) { + if (variableDeclaration.parent.kind === 169 /* ForInStatement */) { return spanInNode(variableDeclaration.parent); } - var isParentVariableStatement = variableDeclaration.parent.kind === 159 /* VariableStatement */; - var isDeclarationOfForStatement = variableDeclaration.parent.kind === 165 /* ForStatement */ && ts.contains(variableDeclaration.parent.declarations, variableDeclaration); + var isParentVariableStatement = variableDeclaration.parent.kind === 162 /* VariableStatement */; + var isDeclarationOfForStatement = variableDeclaration.parent.kind === 168 /* ForStatement */ && ts.contains(variableDeclaration.parent.declarations, variableDeclaration); var declarations = isParentVariableStatement ? variableDeclaration.parent.declarations : isDeclarationOfForStatement ? variableDeclaration.parent.declarations : undefined; if (variableDeclaration.initializer || (variableDeclaration.flags & 1 /* Export */)) { if (declarations && declarations[0] === variableDeclaration) { @@ -35299,7 +23507,7 @@ var ts; } } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { - return !!(functionDeclaration.flags & 1 /* Export */) || (functionDeclaration.parent.kind === 184 /* ClassDeclaration */ && functionDeclaration.kind !== 126 /* Constructor */); + return !!(functionDeclaration.flags & 1 /* Export */) || (functionDeclaration.parent.kind === 187 /* ClassDeclaration */ && functionDeclaration.kind !== 126 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { if (!functionDeclaration.body) { @@ -35319,15 +23527,15 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 188 /* ModuleDeclaration */: + case 191 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } - case 164 /* WhileStatement */: - case 162 /* IfStatement */: - case 166 /* ForInStatement */: + case 167 /* WhileStatement */: + case 165 /* IfStatement */: + case 169 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); - case 165 /* ForStatement */: + case 168 /* ForStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } return spanInNode(block.statements[0]); @@ -35348,34 +23556,34 @@ var ts; } function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 187 /* EnumDeclaration */: + case 190 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 184 /* ClassDeclaration */: + case 187 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 171 /* SwitchStatement */: + case 174 /* SwitchStatement */: return spanInNodeIfStartsOnSameLine(node.parent, node.parent.clauses[0]); } return spanInNode(node.parent); } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 189 /* ModuleBlock */: + case 192 /* ModuleBlock */: if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } - case 183 /* FunctionBlock */: - case 187 /* EnumDeclaration */: - case 184 /* ClassDeclaration */: + case 186 /* FunctionBlock */: + case 190 /* EnumDeclaration */: + case 187 /* ClassDeclaration */: return textSpan(node); - case 158 /* Block */: - case 177 /* TryBlock */: - case 178 /* CatchBlock */: - case 179 /* FinallyBlock */: + case 161 /* Block */: + case 180 /* TryBlock */: + case 181 /* CatchBlock */: + case 182 /* FinallyBlock */: return spanInNode(node.parent.statements[node.parent.statements.length - 1]); ; - case 171 /* SwitchStatement */: + case 174 /* SwitchStatement */: var switchStatement = node.parent; var lastClause = switchStatement.clauses[switchStatement.clauses.length - 1]; if (lastClause) { @@ -35387,23 +23595,23 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 163 /* DoStatement */) { + if (node.parent.kind === 166 /* DoStatement */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInCloseParenToken(node) { switch (node.parent.kind) { - case 149 /* FunctionExpression */: - case 182 /* FunctionDeclaration */: - case 150 /* ArrowFunction */: + case 152 /* FunctionExpression */: + case 185 /* FunctionDeclaration */: + case 153 /* ArrowFunction */: case 125 /* Method */: case 127 /* GetAccessor */: case 128 /* SetAccessor */: case 126 /* Constructor */: - case 164 /* WhileStatement */: - case 163 /* DoStatement */: - case 165 /* ForStatement */: + case 167 /* WhileStatement */: + case 166 /* DoStatement */: + case 168 /* ForStatement */: return spanInPreviousNode(node); default: return spanInNode(node.parent); @@ -35411,19 +23619,19 @@ var ts; return spanInNode(node.parent); } function spanInColonToken(node) { - if (ts.isAnyFunction(node.parent) || node.parent.kind === 141 /* PropertyAssignment */) { + if (ts.isAnyFunction(node.parent) || node.parent.kind === 143 /* PropertyAssignment */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 147 /* TypeAssertion */) { + if (node.parent.kind === 150 /* TypeAssertion */) { return spanInNode(node.parent.operand); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 163 /* DoStatement */) { + if (node.parent.kind === 166 /* DoStatement */) { return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); } return spanInNode(node.parent); @@ -35433,128 +23641,6 @@ var ts; BreakpointResolver.spanInSourceFileAtLocation = spanInSourceFileAtLocation; })(BreakpointResolver = ts.BreakpointResolver || (ts.BreakpointResolver = {})); })(ts || (ts = {})); -var TypeScript; -(function (TypeScript) { - function isNoDefaultLibMatch(comment) { - var isNoDefaultLibRegex = /^(\/\/\/\s*/gim; - return isNoDefaultLibRegex.exec(comment); - } - TypeScript.tripleSlashReferenceRegExp = /^(\/\/\/\s*/; - function getFileReferenceFromReferencePath(fileName, text, position, comment, diagnostics) { - var lineMap = text.lineMap(); - var simpleReferenceRegEx = /^\/\/\/\s*= 7 && fullReference[6] === "true"; - return { - line: 0, - character: 0, - position: 0, - length: 0, - path: TypeScript.switchToForwardSlashes(adjustedPath), - isResident: isResident - }; - } - } - } - return null; - } - var reportDiagnostic = function () { - }; - function processImports(text, scanner, token, importedFiles) { - var lineChar = { line: -1, character: -1 }; - var lineMap = text.lineMap(); - var start = new Date().getTime(); - while (token.kind() !== 8 /* EndOfFileToken */) { - if (token.kind() === 51 /* ImportKeyword */) { - var importToken = token; - token = scanner.scan(false); - if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token)) { - token = scanner.scan(false); - if (token.kind() === 109 /* EqualsToken */) { - token = scanner.scan(false); - if (token.kind() === 67 /* ModuleKeyword */ || token.kind() === 68 /* RequireKeyword */) { - token = scanner.scan(false); - if (token.kind() === 74 /* OpenParenToken */) { - token = scanner.scan(false); - lineMap.fillLineAndCharacterFromPosition(TypeScript.start(importToken, text), lineChar); - if (token.kind() === 12 /* StringLiteral */) { - var ref = { - line: lineChar.line, - character: lineChar.character, - position: TypeScript.start(token, text), - length: TypeScript.width(token), - path: TypeScript.stripStartAndEndQuotes(TypeScript.switchToForwardSlashes(token.text())), - isResident: false - }; - importedFiles.push(ref); - } - } - } - } - } - } - token = scanner.scan(false); - } - var totalTime = new Date().getTime() - start; - } - function processTripleSlashDirectives(fileName, text, firstToken) { - var leadingTrivia = firstToken.leadingTrivia(text); - var position = 0; - var lineChar = { line: -1, character: -1 }; - var noDefaultLib = false; - var diagnostics = []; - var referencedFiles = []; - var lineMap = text.lineMap(); - for (var i = 0, n = leadingTrivia.count(); i < n; i++) { - var trivia = leadingTrivia.syntaxTriviaAt(i); - if (trivia.kind() === 5 /* SingleLineCommentTrivia */) { - var triviaText = trivia.fullText(); - var referencedCode = getFileReferenceFromReferencePath(fileName, text, position, triviaText, diagnostics); - if (referencedCode) { - lineMap.fillLineAndCharacterFromPosition(position, lineChar); - referencedCode.position = position; - referencedCode.length = trivia.fullWidth(); - referencedCode.line = lineChar.line; - referencedCode.character = lineChar.character; - referencedFiles.push(referencedCode); - } - var isNoDefaultLib = isNoDefaultLibMatch(triviaText); - if (isNoDefaultLib) { - noDefaultLib = isNoDefaultLib[3] === "true"; - } - } - position += trivia.fullWidth(); - } - return { noDefaultLib: noDefaultLib, diagnostics: diagnostics, referencedFiles: referencedFiles }; - } - function preProcessFile(fileName, sourceText, readImportFiles) { - if (readImportFiles === void 0) { readImportFiles = true; } - var text = TypeScript.SimpleText.fromScriptSnapshot(sourceText); - var scanner = TypeScript.Scanner.createScanner(2 /* Latest */, text, reportDiagnostic); - var firstToken = scanner.scan(false); - var importedFiles = []; - if (readImportFiles) { - processImports(text, scanner, firstToken, importedFiles); - } - var properties = processTripleSlashDirectives(fileName, text, firstToken); - return { referencedFiles: properties.referencedFiles, importedFiles: importedFiles, isLibFile: properties.noDefaultLib, diagnostics: properties.diagnostics }; - } - TypeScript.preProcessFile = preProcessFile; - function getReferencedFiles(fileName, sourceText) { - return preProcessFile(fileName, sourceText, false).referencedFiles; - } - TypeScript.getReferencedFiles = getReferencedFiles; -})(TypeScript || (TypeScript = {})); var debugObjectHost = this; var ts; (function (ts) { @@ -35661,7 +23747,7 @@ var ts; return null; } var decoded = JSON.parse(encoded); - return new TypeScript.TextChangeRange(new TypeScript.TextSpan(decoded.span.start, decoded.span.length), decoded.newLength); + return new ts.TextChangeRange(new ts.TextSpan(decoded.span.start, decoded.span.length), decoded.newLength); }; return ScriptSnapshotShimAdapter; })(); @@ -35801,26 +23887,17 @@ var ts; code: diagnostic.code }; }; - LanguageServiceShimObject.prototype.realizeDiagnosticWithFileName = function (diagnostic) { - return { - fileName: diagnostic.file.filename, - message: diagnostic.messageText, - start: diagnostic.start, - length: diagnostic.length, - category: ts.DiagnosticCategory[diagnostic.category].toLowerCase() - }; - }; LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) { var _this = this; return this.forwardJSONCall("getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - var classifications = _this.languageService.getSyntacticClassifications(fileName, new TypeScript.TextSpan(start, length)); + var classifications = _this.languageService.getSyntacticClassifications(fileName, new ts.TextSpan(start, length)); return classifications; }); }; LanguageServiceShimObject.prototype.getSemanticClassifications = function (fileName, start, length) { var _this = this; return this.forwardJSONCall("getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - var classifications = _this.languageService.getSemanticClassifications(fileName, new TypeScript.TextSpan(start, length)); + var classifications = _this.languageService.getSemanticClassifications(fileName, new ts.TextSpan(start, length)); return classifications; }); }; @@ -35842,7 +23919,7 @@ var ts; var _this = this; return this.forwardJSONCall("getCompilerOptionsDiagnostics()", function () { var errors = _this.languageService.getCompilerOptionsDiagnostics(); - return errors.map(function (d) { return _this.realizeDiagnosticWithFileName(d); }); + return errors.map(LanguageServiceShimObject.realizeDiagnostic); }); }; LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) { @@ -35923,12 +24000,6 @@ var ts; return _this.languageService.getOccurrencesAtPosition(fileName, position); }); }; - LanguageServiceShimObject.prototype.getImplementorsAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getImplementorsAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getImplementorsAtPosition(fileName, position); - }); - }; LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position, isMemberCompletion) { var _this = this; return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ", " + isMemberCompletion + ")", function () { @@ -36033,10 +24104,29 @@ var ts; CoreServicesShimObject.prototype.forwardJSONCall = function (actionDescription, action) { return forwardJSONCall(this.logger, actionDescription, action); }; - CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceText) { + CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) { return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () { - var result = TypeScript.preProcessFile(fileName, sourceText); - return result; + var result = ts.preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength())); + var convertResult = { + referencedFiles: [], + importedFiles: [], + isLibFile: result.isLibFile + }; + ts.forEach(result.referencedFiles, function (refFile) { + convertResult.referencedFiles.push({ + path: ts.normalizePath(refFile.filename), + position: refFile.pos, + length: refFile.end - refFile.pos + }); + }); + ts.forEach(result.importedFiles, function (importedFile) { + convertResult.importedFiles.push({ + path: ts.normalizeSlashes(importedFile.filename), + position: importedFile.pos, + length: importedFile.end - importedFile.pos + }); + }); + return convertResult; }); }; CoreServicesShimObject.prototype.getDefaultCompilationSettings = function () { @@ -36094,7 +24184,7 @@ var ts; return; } } - throw TypeScript.Errors.invalidOperation(); + throw new Error("Invalid operation"); }; return TypeScriptServicesFactory; })(); diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 18fd8c711b8..1a1075d9d9e 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -18,7 +18,7 @@ module ts { return ModuleInstanceState.NonInstantiated; } // 2. const enum declarations don't make module instantiated - else if (node.kind === SyntaxKind.EnumDeclaration && isConstEnumDeclaration(node)) { + else if (isConstEnumDeclaration(node)) { return ModuleInstanceState.ConstEnumOnly; } // 3. non - exported import declarations @@ -125,9 +125,9 @@ module ts { : Diagnostics.Duplicate_identifier_0; forEach(symbol.declarations, declaration => { - file.semanticErrors.push(createDiagnosticForNode(declaration.name, message, getDisplayName(declaration))); + file.semanticDiagnostics.push(createDiagnosticForNode(declaration.name, message, getDisplayName(declaration))); }); - file.semanticErrors.push(createDiagnosticForNode(node.name, message, getDisplayName(node))); + file.semanticDiagnostics.push(createDiagnosticForNode(node.name, message, getDisplayName(node))); symbol = createSymbol(0, name); } @@ -148,7 +148,7 @@ module ts { if (node.name) { node.name.parent = node; } - file.semanticErrors.push(createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], + file.semanticDiagnostics.push(createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); } symbol.exports[prototypeSymbol.name] = prototypeSymbol; @@ -380,6 +380,7 @@ module ts { break; case SyntaxKind.Property: case SyntaxKind.PropertyAssignment: + case SyntaxKind.ShorthandPropertyAssignment: bindDeclaration(node, SymbolFlags.Property, SymbolFlags.PropertyExcludes, /*isBlockScopeContainer*/ false); break; case SyntaxKind.EnumMember: @@ -438,7 +439,7 @@ module ts { bindDeclaration(node, SymbolFlags.TypeAlias, SymbolFlags.TypeAliasExcludes, /*isBlockScopeContainer*/ false); break; case SyntaxKind.EnumDeclaration: - if (isConstEnumDeclaration(node)) { + if (isConst(node)) { bindDeclaration(node, SymbolFlags.ConstEnum, SymbolFlags.ConstEnumExcludes, /*isBlockScopeContainer*/ false); } else { diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 0e42f2eb4ee..5ee9fa4ab3e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -75,41 +75,44 @@ module ts { var checker: TypeChecker = { getProgram: () => program, - getDiagnostics: getDiagnostics, - getGlobalDiagnostics: getGlobalDiagnostics, getNodeCount: () => sum(program.getSourceFiles(), "nodeCount"), getIdentifierCount: () => sum(program.getSourceFiles(), "identifierCount"), getSymbolCount: () => sum(program.getSourceFiles(), "symbolCount"), getTypeCount: () => typeCount, - checkProgram: checkProgram, - emitFiles: invokeEmitter, - getParentOfSymbol: getParentOfSymbol, - getNarrowedTypeOfSymbol: getNarrowedTypeOfSymbol, - getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, - getPropertiesOfType: getPropertiesOfType, - getPropertyOfType: getPropertyOfType, - getSignaturesOfType: getSignaturesOfType, - getIndexTypeOfType: getIndexTypeOfType, - getReturnTypeOfSignature: getReturnTypeOfSignature, - getSymbolsInScope: getSymbolsInScope, - getSymbolInfo: getSymbolInfo, - getTypeOfNode: getTypeOfNode, - typeToString: typeToString, - getSymbolDisplayBuilder: getSymbolDisplayBuilder, - symbolToString: symbolToString, - getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, - getRootSymbols: getRootSymbols, - getContextualType: getContextualType, - getFullyQualifiedName: getFullyQualifiedName, - getResolvedSignature: getResolvedSignature, - getEnumMemberValue: getEnumMemberValue, - isValidPropertyAccess: isValidPropertyAccess, - getSignatureFromDeclaration: getSignatureFromDeclaration, - isImplementationOfOverload: isImplementationOfOverload, - getAliasedSymbol: resolveImport, isUndefinedSymbol: symbol => symbol === undefinedSymbol, isArgumentsSymbol: symbol => symbol === argumentsSymbol, - isEmitBlocked: isEmitBlocked + emitFiles: invokeEmitter, + getDiagnostics, + getDeclarationDiagnostics, + getGlobalDiagnostics, + checkProgram, + getParentOfSymbol, + getNarrowedTypeOfSymbol, + getDeclaredTypeOfSymbol, + getPropertiesOfType, + getPropertyOfType, + getSignaturesOfType, + getIndexTypeOfType, + getReturnTypeOfSignature, + getSymbolsInScope, + getSymbolInfo, + getShorthandAssignmentValueSymbol, + getTypeOfNode, + typeToString, + getSymbolDisplayBuilder, + symbolToString, + getAugmentedPropertiesOfType, + getRootSymbols, + getContextualType, + getFullyQualifiedName, + getResolvedSignature, + getEnumMemberValue, + isValidPropertyAccess, + getSignatureFromDeclaration, + isImplementationOfOverload, + getAliasedSymbol: resolveImport, + hasEarlyErrors, + isEmitBlocked, }; var undefinedSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, "undefined"); @@ -883,13 +886,13 @@ module ts { if (accessibleSymbolChain) { var hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0]); if (!hasAccessibleDeclarations) { - return { + return { accessibility: SymbolAccessibility.NotAccessible, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, SymbolFlags.Namespace) : undefined, }; } - return { accessibility: SymbolAccessibility.Accessible, aliasesToMakeVisible: hasAccessibleDeclarations.aliasesToMakeVisible }; + return hasAccessibleDeclarations; } // If we haven't got the accessible symbol, it doesn't mean the symbol is actually inaccessible. @@ -946,12 +949,12 @@ module ts { (declaration.kind === SyntaxKind.SourceFile && isExternalModule(declaration)); } - function hasVisibleDeclarations(symbol: Symbol): { aliasesToMakeVisible?: ImportDeclaration[]; } { + function hasVisibleDeclarations(symbol: Symbol): SymbolVisibilityResult { var aliasesToMakeVisible: ImportDeclaration[]; if (forEach(symbol.declarations, declaration => !getIsDeclarationVisible(declaration))) { return undefined; } - return { aliasesToMakeVisible: aliasesToMakeVisible }; + return { accessibility: SymbolAccessibility.Accessible, aliasesToMakeVisible }; function getIsDeclarationVisible(declaration: Declaration) { if (!isDeclarationVisible(declaration)) { @@ -980,14 +983,33 @@ module ts { } } - function isImportDeclarationEntityNameReferenceDeclarationVisibile(entityName: EntityName): SymbolAccessiblityResult { + function isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult { + // get symbol of the first identifier of the entityName + var meaning: SymbolFlags; + if (entityName.parent.kind === SyntaxKind.TypeQuery) { + // Typeof value + meaning = SymbolFlags.Value | SymbolFlags.ExportValue; + } + else if (entityName.kind === SyntaxKind.QualifiedName || + entityName.parent.kind === SyntaxKind.ImportDeclaration) { + // Left identifier from type reference or TypeAlias + // Entity name of the import declaration + meaning = SymbolFlags.Namespace; + } + else { + // Type Reference or TypeAlias entity = Identifier + meaning = SymbolFlags.Type; + } + var firstIdentifier = getFirstIdentifier(entityName); - var symbolOfNameSpace = resolveName(entityName.parent, (firstIdentifier).text, SymbolFlags.Namespace, Diagnostics.Cannot_find_name_0, firstIdentifier); + var symbol = resolveName(enclosingDeclaration, (firstIdentifier).text, meaning, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined); + // Verify if the symbol is accessible - var hasNamespaceDeclarationsVisibile = hasVisibleDeclarations(symbolOfNameSpace); - return hasNamespaceDeclarationsVisibile ? - { accessibility: SymbolAccessibility.Accessible, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : - { accessibility: SymbolAccessibility.NotAccessible, errorSymbolName: declarationNameToString(firstIdentifier) }; + return hasVisibleDeclarations(symbol) || { + accessibility: SymbolAccessibility.NotAccessible, + errorSymbolName: getTextOfNode(firstIdentifier), + errorNode: firstIdentifier + }; } function releaseStringWriter(writer: StringSymbolWriter) { @@ -1599,6 +1621,7 @@ module ts { case SyntaxKind.IndexSignature: case SyntaxKind.Parameter: case SyntaxKind.ModuleBlock: + case SyntaxKind.TypeParameter: return isDeclarationVisible(node.parent); // Source file is always visible @@ -1665,6 +1688,13 @@ module ts { } return type; } + + // If it is a short-hand property assignment; Use the type of the identifier + if (declaration.kind === SyntaxKind.ShorthandPropertyAssignment) { + var type = checkIdentifier(declaration.name); + return type + } + // Rest parameters default to type any[], other parameters default to type any var type = declaration.flags & NodeFlags.Rest ? createArrayType(anyType) : anyType; checkImplicitAny(type); @@ -1775,7 +1805,7 @@ module ts { } else { // If there are no specified types, try to infer it from the body of the get accessor if it exists. - if (getter) { + if (getter && getter.body) { type = getReturnTypeFromBody(getter); } // Otherwise, fall back to 'any'. @@ -2399,7 +2429,7 @@ module ts { } // Return the symbol for the property with the given name in the given type. Creates synthetic union properties when - // necessary, maps primtive types and type parameters are to their apparent types, and augments with properties from + // necessary, maps primitive types and type parameters are to their apparent types, and augments with properties from // Object and Function as appropriate. function getPropertyOfType(type: Type, name: string): Symbol { if (type.flags & TypeFlags.Union) { @@ -2434,7 +2464,7 @@ module ts { } // Return the signatures of the given kind in the given type. Creates synthetic union signatures when necessary and - // maps primtive types and type parameters are to their apparent types. + // maps primitive types and type parameters are to their apparent types. function getSignaturesOfType(type: Type, kind: SignatureKind): Signature[] { return getSignaturesOfObjectOrUnionType(getApparentType(type), kind); } @@ -2447,7 +2477,7 @@ module ts { } // Return the index type of the given kind in the given type. Creates synthetic union index types when necessary and - // maps primtive types and type parameters are to their apparent types. + // maps primitive types and type parameters are to their apparent types. function getIndexTypeOfType(type: Type, kind: IndexKind): Type { return getIndexTypeOfObjectOrUnionType(getApparentType(type), kind); } @@ -3225,9 +3255,9 @@ module ts { // TYPE CHECKING - var subtypeRelation: Map = {}; - var assignableRelation: Map = {}; - var identityRelation: Map = {}; + var subtypeRelation: Map = {}; + var assignableRelation: Map = {}; + var identityRelation: Map = {}; function isTypeIdenticalTo(source: Type, target: Type): boolean { return checkTypeRelatedTo(source, target, identityRelation, /*errorNode*/ undefined); @@ -3262,7 +3292,7 @@ module ts { function checkTypeRelatedTo( source: Type, target: Type, - relation: Map, + relation: Map, errorNode: Node, headMessage?: DiagnosticMessage, containingMessageChain?: DiagnosticMessageChain): boolean { @@ -3270,6 +3300,7 @@ module ts { var errorInfo: DiagnosticMessageChain; var sourceStack: ObjectType[]; var targetStack: ObjectType[]; + var maybeStack: Map[]; var expandingFlags: number; var depth = 0; var overflow = false; @@ -3428,12 +3459,12 @@ module ts { var id = source.id + "," + target.id; var related = relation[id]; if (related !== undefined) { - return related; + return related ? Ternary.True : Ternary.False; } if (depth > 0) { for (var i = 0; i < depth; i++) { // If source and target are already being compared, consider them related with assumptions - if (source === sourceStack[i] && target === targetStack[i]) { + if (maybeStack[i][id]) { return Ternary.Maybe; } } @@ -3445,16 +3476,19 @@ module ts { else { sourceStack = []; targetStack = []; + maybeStack = []; expandingFlags = 0; } sourceStack[depth] = source; targetStack[depth] = target; + maybeStack[depth] = {}; + maybeStack[depth][id] = true; depth++; var saveExpandingFlags = expandingFlags; if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack)) expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; if (expandingFlags === 3) { - var result = Ternary.True; + var result = Ternary.Maybe; } else { var result = propertiesRelatedTo(source, target, reportErrors); @@ -3473,9 +3507,18 @@ module ts { } expandingFlags = saveExpandingFlags; depth--; - // Only cache results that are free of assumptions - if (result !== Ternary.Maybe) { - relation[id] = result; + if (result) { + var maybeCache = maybeStack[depth]; + // If result is definitely true, copy assumptions to global cache, else copy to next level up + var destinationCache = result === Ternary.True || depth === 0 ? relation : maybeStack[depth - 1]; + for (var p in maybeCache) { + destinationCache[p] = maybeCache[p]; + } + } + else { + // A false result goes straight into global cache (when something is false under assumptions it + // will also be false without assumptions) + relation[id] = false; } return result; } @@ -5000,7 +5043,15 @@ module ts { if (hasProperty(members, id)) { var member = members[id]; if (member.flags & SymbolFlags.Property) { - var type = checkExpression((member.declarations[0]).initializer, contextualMapper); + var memberDecl = member.declarations[0]; + var type: Type; + if (memberDecl.kind === SyntaxKind.PropertyAssignment) { + type = checkExpression(memberDecl.initializer, contextualMapper); + } + else { + Debug.assert(memberDecl.kind === SyntaxKind.ShorthandPropertyAssignment); + type = checkExpression(memberDecl.name, contextualMapper); + } var prop = createSymbol(SymbolFlags.Property | SymbolFlags.Transient | member.flags, member.name); prop.declarations = member.declarations; prop.parent = member.parent; @@ -5403,7 +5454,7 @@ module ts { return typeArgumentsAreAssignable; } - function checkApplicableSignature(node: CallLikeExpression, args: Node[], signature: Signature, relation: Map, excludeArgument: boolean[], reportErrors: boolean) { + function checkApplicableSignature(node: CallLikeExpression, args: Node[], signature: Signature, relation: Map, excludeArgument: boolean[], reportErrors: boolean) { for (var i = 0; i < args.length; i++) { var arg = args[i]; var argType: Type; @@ -5597,7 +5648,7 @@ module ts { return resolveErrorCall(node); - function chooseOverload(candidates: Signature[], relation: Map) { + function chooseOverload(candidates: Signature[], relation: Map) { for (var i = 0; i < candidates.length; i++) { if (!hasCorrectArity(node, args, candidates[i])) { continue; @@ -7501,10 +7552,13 @@ module ts { // for (var VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.declaration) { - checkVariableDeclaration(node.declaration); - if (node.declaration.type) { - error(node.declaration, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation); + if (node.declarations) { + if (node.declarations.length >= 1) { + var decl = node.declarations[0]; + checkVariableDeclaration(decl); + if (decl.type) { + error(decl, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation); + } } } @@ -7953,7 +8007,7 @@ module ts { var enumType = getDeclaredTypeOfSymbol(enumSymbol); var autoValue = 0; var ambient = isInAmbientContext(node); - var enumIsConst = isConstEnumDeclaration(node); + var enumIsConst = isConst(node); forEach(node.members, member => { // TODO(jfreeman): Check that it is not a computed name @@ -8124,10 +8178,10 @@ module ts { var firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind); if (node === firstDeclaration) { if (enumSymbol.declarations.length > 1) { - var enumIsConst = isConstEnumDeclaration(node); + var enumIsConst = isConst(node); // check that const is placed\omitted on all enum declarations forEach(enumSymbol.declarations, decl => { - if (isConstEnumDeclaration(decl) !== enumIsConst) { + if (isConstEnumDeclaration(decl) !== enumIsConst) { error(decl.name, Diagnostics.Enum_declarations_must_all_be_const_or_non_const); } }); @@ -8492,6 +8546,12 @@ module ts { return getSortedDiagnostics(); } + function getDeclarationDiagnostics(targetSourceFile: SourceFile): Diagnostic[] { + var resolver = createResolver(); + checkSourceFile(targetSourceFile); + return ts.getDeclarationDiagnostics(program, resolver, targetSourceFile); + } + function getGlobalDiagnostics(): Diagnostic[] { return filter(getSortedDiagnostics(), d => !d.file); } @@ -8816,6 +8876,16 @@ module ts { return undefined; } + function getShorthandAssignmentValueSymbol(location: Node): Symbol { + // The function returns a value symbol of an identifier in the short-hand property assignment. + // This is necessary as an identifier in short-hand property assignment can contains two meaning: + // property name and property value. + if (location && location.kind === SyntaxKind.ShorthandPropertyAssignment) { + return resolveEntityName(location, (location).name, SymbolFlags.Value); + } + return undefined; + } + function getTypeOfNode(node: Node): Type { if (isInsideWithStatementBody(node)) { // We cannot answer semantic questions within a with block, do not proceed any further @@ -9075,26 +9145,30 @@ module ts { getSymbolDisplayBuilder().buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); } - function invokeEmitter(targetSourceFile?: SourceFile) { - var resolver: EmitResolver = { + function createResolver(): EmitResolver { + return { getProgram: () => program, - getLocalNameOfContainer: getLocalNameOfContainer, - getExpressionNamePrefix: getExpressionNamePrefix, - getExportAssignmentName: getExportAssignmentName, - isReferencedImportDeclaration: isReferencedImportDeclaration, - getNodeCheckFlags: getNodeCheckFlags, - getEnumMemberValue: getEnumMemberValue, - isTopLevelValueImportWithEntityName: isTopLevelValueImportWithEntityName, - hasSemanticErrors: hasSemanticErrors, - isEmitBlocked: isEmitBlocked, - isDeclarationVisible: isDeclarationVisible, - isImplementationOfOverload: isImplementationOfOverload, - writeTypeAtLocation: writeTypeAtLocation, - writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, - isSymbolAccessible: isSymbolAccessible, - isImportDeclarationEntityNameReferenceDeclarationVisibile: isImportDeclarationEntityNameReferenceDeclarationVisibile, - getConstantValue: getConstantValue, + getLocalNameOfContainer, + getExpressionNamePrefix, + getExportAssignmentName, + isReferencedImportDeclaration, + getNodeCheckFlags, + getEnumMemberValue, + isTopLevelValueImportWithEntityName, + hasSemanticErrors, + isEmitBlocked, + isDeclarationVisible, + isImplementationOfOverload, + writeTypeAtLocation, + writeReturnTypeOfSignatureDeclaration, + isSymbolAccessible, + isEntityNameVisible, + getConstantValue, }; + } + + function invokeEmitter(targetSourceFile?: SourceFile) { + var resolver = createResolver(); checkProgram(); return emitFiles(resolver, targetSourceFile); } @@ -9103,7 +9177,7 @@ module ts { // Bind all source files and propagate errors forEach(program.getSourceFiles(), file => { bindSourceFile(file); - forEach(file.semanticErrors, addDiagnostic); + forEach(file.semanticDiagnostics, addDiagnostic); }); // Initialize global symbol table forEach(program.getSourceFiles(), file => { diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 5e61e9e1cb7..3fabf6c8588 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -153,9 +153,9 @@ module ts { parseStrings(commandLine); return { - options: options, - filenames: filenames, - errors: errors + options, + filenames, + errors }; function parseStrings(args: string[]) { diff --git a/src/compiler/core.ts b/src/compiler/core.ts index e512688fee2..6bbf9a13d03 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -258,9 +258,9 @@ module ts { } return { - file: file, - start: start, - length: length, + file, + start, + length, messageText: text, category: message.category, @@ -335,12 +335,12 @@ module ts { } return { - file: file, - start: start, - length: length, - code: code, - category: category, - messageText: messageText + file, + start, + length, + code, + category, + messageText }; } @@ -459,6 +459,10 @@ module ts { return normalizedPathComponents(path, rootLength); } + export function getNormalizedAbsolutePath(filename: string, currentDirectory: string) { + return getNormalizedPathFromPathComponents(getNormalizedPathComponents(filename, currentDirectory)); + } + export function getNormalizedPathFromPathComponents(pathComponents: string[]) { if (pathComponents && pathComponents.length) { return pathComponents[0] + pathComponents.slice(1).join(directorySeparator); diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index bae908b2774..c877c6f9773 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -122,6 +122,10 @@ module ts { let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: DiagnosticCategory.Error, key: "'let' declarations can only be declared inside a block." }, Invalid_template_literal_expected: { code: 1158, category: DiagnosticCategory.Error, key: "Invalid template literal; expected '}'" }, Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1159, category: DiagnosticCategory.Error, key: "Tagged templates are only available when targeting ECMAScript 6 and higher." }, + Unterminated_template_literal: { code: 1160, category: DiagnosticCategory.Error, key: "Unterminated template literal." }, + Unterminated_regular_expression_literal: { code: 1161, category: DiagnosticCategory.Error, key: "Unterminated regular expression literal." }, + An_object_member_cannot_be_declared_optional: { code: 1162, category: DiagnosticCategory.Error, key: "An object member cannot be declared optional." }, + yield_expression_must_be_contained_within_a_generator_declaration: { code: 1163, category: DiagnosticCategory.Error, key: "'yield' expression must be contained_within a generator declaration." }, Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, @@ -270,28 +274,18 @@ module ts { Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: DiagnosticCategory.Error, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, Type_alias_0_circularly_references_itself: { code: 2456, category: DiagnosticCategory.Error, key: "Type alias '{0}' circularly references itself." }, Type_alias_name_cannot_be_0: { code: 2457, category: DiagnosticCategory.Error, key: "Type alias name cannot be '{0}'" }, + An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: DiagnosticCategory.Error, key: "An AMD module cannot have multiple name assignments." }, Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4003, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4005, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4007, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4009, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4011, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4013, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4015, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4017, category: DiagnosticCategory.Error, key: "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4018, category: DiagnosticCategory.Error, key: "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: DiagnosticCategory.Error, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: DiagnosticCategory.Error, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2: { code: 4021, category: DiagnosticCategory.Error, key: "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'." }, Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: DiagnosticCategory.Error, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, @@ -349,8 +343,6 @@ module ts { Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, - Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4079, category: DiagnosticCategory.Error, key: "Exported type alias '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, - Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2: { code: 4080, category: DiagnosticCategory.Error, key: "Exported type alias '{0}' has or is using name '{1}' from private module '{2}'." }, Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: DiagnosticCategory.Error, key: "Exported type alias '{0}' has or is using private name '{1}'." }, Enum_declarations_must_all_be_const_or_non_const: { code: 4082, category: DiagnosticCategory.Error, key: "Enum declarations must all be const or non-const." }, In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 4083, category: DiagnosticCategory.Error, key: "In 'const' enum declarations member initializer must be constant expression.", isEarly: true }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 93638b6dade..5ee797482a9 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -479,6 +479,22 @@ "category": "Error", "code": 1159 }, + "Unterminated template literal.": { + "category": "Error", + "code": 1160 + }, + "Unterminated regular expression literal.": { + "category": "Error", + "code": 1161 + }, + "An object member cannot be declared optional.": { + "category": "Error", + "code": 1162 + }, + "'yield' expression must be contained_within a generator declaration.": { + "category": "Error", + "code": 1163 + }, "Duplicate identifier '{0}'.": { "category": "Error", @@ -1076,83 +1092,47 @@ "category": "Error", "code": 2457 }, + "An AMD module cannot have multiple name assignments.": { + "category": "Error", + "code": 2458 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", "code": 4000 }, - "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4001 - }, "Type parameter '{0}' of exported class has or is using private name '{1}'.": { "category": "Error", "code": 4002 }, - "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4003 - }, "Type parameter '{0}' of exported interface has or is using private name '{1}'.": { "category": "Error", "code": 4004 }, - "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4005 - }, "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'.": { "category": "Error", "code": 4006 }, - "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4007 - }, "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.": { "category": "Error", "code": 4008 }, - "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4009 - }, "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'.": { "category": "Error", "code": 4010 }, - "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4011 - }, "Type parameter '{0}' of public method from exported class has or is using private name '{1}'.": { "category": "Error", "code": 4012 }, - "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4013 - }, "Type parameter '{0}' of method from exported interface has or is using private name '{1}'.": { "category": "Error", "code": 4014 }, - "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4015 - }, "Type parameter '{0}' of exported function has or is using private name '{1}'.": { "category": "Error", "code": 4016 }, - "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4017 - }, - "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4018 - }, "Implements clause of exported class '{0}' has or is using private name '{1}'.": { "category": "Error", "code": 4019 @@ -1161,10 +1141,6 @@ "category": "Error", "code": 4020 }, - "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4021 - }, "Extends clause of exported interface '{0}' has or is using private name '{1}'.": { "category": "Error", "code": 4022 @@ -1393,14 +1369,6 @@ "category": "Error", "code": 4078 }, - "Exported type alias '{0}' has or is using name '{1}' from external module {2} but cannot be named.": { - "category": "Error", - "code": 4079 - }, - "Exported type alias '{0}' has or is using name '{1}' from private module '{2}'.": { - "category": "Error", - "code": 4080 - }, "Exported type alias '{0}' has or is using private name '{1}'.": { "category": "Error", "code": 4081 diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 00d958604c7..5cdf98aa63e 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -6,6 +6,7 @@ module ts { interface EmitTextWriter { write(s: string): void; + writeTextOfNode(sourceFile: SourceFile, node: Node): void; writeLine(): void; increaseIndent(): void; decreaseIndent(): void; @@ -18,7 +19,29 @@ module ts { getIndent(): number; } - interface EmitTextWriterWithSymbolWriter extends EmitTextWriter, SymbolWriter{ + interface SymbolAccessibilityDiagnostic { + errorNode: Node; + diagnosticMessage: DiagnosticMessage; + typeName?: DeclarationName; + } + type GetSymbolAccessibilityDiagnostic = (symbolAccesibilityResult: SymbolAccessiblityResult) => SymbolAccessibilityDiagnostic; + + interface EmitTextWriterWithSymbolWriter extends EmitTextWriter, SymbolWriter { + getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic; + } + + interface AliasDeclarationEmitInfo { + declaration: ImportDeclaration; + outputPos: number; + indent: number; + asynchronousOutput?: string; // If the output for alias was written asynchronously, the corresponding output + } + + interface DeclarationEmit { + reportedDeclarationError: boolean; + aliasDeclarationEmitInfo: AliasDeclarationEmitInfo[]; + synchronousDeclarationOutput: string; + referencePathsOutput: string; } var indentStrings: string[] = ["", " "]; @@ -47,6 +70,1381 @@ module ts { return isExternalModule(sourceFile) || isDeclarationFile(sourceFile); } + function createTextWriter(newLine: String): EmitTextWriter { + var output = ""; + var indent = 0; + var lineStart = true; + var lineCount = 0; + var linePos = 0; + + function write(s: string) { + if (s && s.length) { + if (lineStart) { + output += getIndentString(indent); + lineStart = false; + } + output += s; + } + } + + function rawWrite(s: string) { + if (s !== undefined) { + if (lineStart) { + lineStart = false; + } + output += s; + } + } + + function writeLiteral(s: string) { + if (s && s.length) { + write(s); + var lineStartsOfS = computeLineStarts(s); + if (lineStartsOfS.length > 1) { + lineCount = lineCount + lineStartsOfS.length - 1; + linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; + } + } + } + + function writeLine() { + if (!lineStart) { + output += newLine; + lineCount++; + linePos = output.length; + lineStart = true; + } + } + + function writeTextOfNode(sourceFile: SourceFile, node: Node) { + write(getSourceTextOfNodeFromSourceFile(sourceFile, node)); + } + + return { + write, + rawWrite, + writeTextOfNode, + writeLiteral, + writeLine, + increaseIndent: () => indent++, + decreaseIndent: () => indent--, + getIndent: () => indent, + getTextPos: () => output.length, + getLine: () => lineCount + 1, + getColumn: () => lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1, + getText: () => output, + }; + } + + function getLineOfLocalPosition(currentSourceFile: SourceFile, pos: number) { + return currentSourceFile.getLineAndCharacterFromPosition(pos).line; + } + + function emitNewLineBeforeLeadingComments(currentSourceFile: SourceFile, writer: EmitTextWriter, node: TextRange, leadingComments: CommentRange[]) { + // If the leading comments start on different line than the start of node, write new line + if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && + getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { + writer.writeLine(); + } + } + + function emitComments(currentSourceFile: SourceFile, writer: EmitTextWriter, comments: CommentRange[], trailingSeparator: boolean, newLine: string, + writeComment: (currentSourceFile: SourceFile, writer: EmitTextWriter, comment: CommentRange, newLine: string) => void) { + var emitLeadingSpace = !trailingSeparator; + forEach(comments, comment => { + if (emitLeadingSpace) { + writer.write(" "); + emitLeadingSpace = false; + } + writeComment(currentSourceFile, writer, comment, newLine); + if (comment.hasTrailingNewLine) { + writer.writeLine(); + } + else if (trailingSeparator) { + writer.write(" "); + } + else { + // Emit leading space to separate comment during next comment emit + emitLeadingSpace = true; + } + }); + } + + function writeCommentRange(currentSourceFile: SourceFile, writer: EmitTextWriter, comment: CommentRange, newLine: string){ + if (currentSourceFile.text.charCodeAt(comment.pos + 1) === CharacterCodes.asterisk) { + var firstCommentLineAndCharacter = currentSourceFile.getLineAndCharacterFromPosition(comment.pos); + var firstCommentLineIndent: number; + for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { + var nextLineStart = currentSourceFile.getPositionFromLineAndCharacter(currentLine + 1, /*character*/1); + + if (pos !== comment.pos) { + // If we are not emitting first line, we need to write the spaces to adjust the alignment + if (firstCommentLineIndent === undefined) { + firstCommentLineIndent = calculateIndent(currentSourceFile.getPositionFromLineAndCharacter(firstCommentLineAndCharacter.line, /*character*/1), + comment.pos); + } + + // These are number of spaces writer is going to write at current indent + var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); + + // Number of spaces we want to be writing + // eg: Assume writer indent + // module m { + // /* starts at character 9 this is line 1 + // * starts at character pos 4 line --1 = 8 - 8 + 3 + // More left indented comment */ --2 = 8 - 8 + 2 + // class c { } + // } + // module m { + // /* this is line 1 -- Assume current writer indent 8 + // * line --3 = 8 - 4 + 5 + // More right indented comment */ --4 = 8 - 4 + 11 + // class c { } + // } + var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); + if (spacesToEmit > 0) { + var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); + var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); + + // Write indent size string ( in eg 1: = "", 2: "" , 3: string with 8 spaces 4: string with 12 spaces + writer.rawWrite(indentSizeSpaceString); + + // Emit the single spaces (in eg: 1: 3 spaces, 2: 2 spaces, 3: 1 space, 4: 3 spaces) + while (numberOfSingleSpacesToEmit) { + writer.rawWrite(" "); + numberOfSingleSpacesToEmit--; + } + } + else { + // No spaces to emit write empty string + writer.rawWrite(""); + } + } + + // Write the comment line text + writeTrimmedCurrentLine(pos, nextLineStart); + + pos = nextLineStart; + } + } + else { + // Single line comment of style //.... + writer.write(currentSourceFile.text.substring(comment.pos, comment.end)); + } + + function writeTrimmedCurrentLine(pos: number, nextLineStart: number) { + var end = Math.min(comment.end, nextLineStart - 1); + var currentLineText = currentSourceFile.text.substring(pos, end).replace(/^\s+|\s+$/g, ''); + if (currentLineText) { + // trimmed forward and ending spaces text + writer.write(currentLineText); + if (end !== comment.end) { + writer.writeLine(); + } + } + else { + // Empty string - make sure we write empty line + writer.writeLiteral(newLine); + } + } + + function calculateIndent(pos: number, end: number) { + var currentLineIndent = 0; + for (; pos < end && isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { + if (currentSourceFile.text.charCodeAt(pos) === CharacterCodes.tab) { + // Tabs = TabSize = indent size and go to next tabStop + currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); + } + else { + // Single space + currentLineIndent++; + } + } + + return currentLineIndent; + } + } + + function getFirstConstructorWithBody(node: ClassDeclaration): ConstructorDeclaration { + return forEach(node.members, member => { + if (member.kind === SyntaxKind.Constructor && (member).body) { + return member; + } + }); + } + + function getAllAccessorDeclarations(node: ClassDeclaration, accessor: AccessorDeclaration) { + var firstAccessor: AccessorDeclaration; + var getAccessor: AccessorDeclaration; + var setAccessor: AccessorDeclaration; + forEach(node.members, (member: Declaration) => { + // TODO(jfreeman): Handle computed names for accessor matching + if ((member.kind === SyntaxKind.GetAccessor || member.kind === SyntaxKind.SetAccessor) && + (member.name).text === (accessor.name).text && + (member.flags & NodeFlags.Static) === (accessor.flags & NodeFlags.Static)) { + if (!firstAccessor) { + firstAccessor = member; + } + + if (member.kind === SyntaxKind.GetAccessor && !getAccessor) { + getAccessor = member; + } + + if (member.kind === SyntaxKind.SetAccessor && !setAccessor) { + setAccessor = member; + } + } + }); + return { + firstAccessor, + getAccessor, + setAccessor + }; + } + + function getSourceFilePathInNewDir(sourceFile: SourceFile, program: Program, newDirPath: string) { + var compilerHost = program.getCompilerHost(); + var sourceFilePath = getNormalizedAbsolutePath(sourceFile.filename, compilerHost.getCurrentDirectory()); + sourceFilePath = sourceFilePath.replace(program.getCommonSourceDirectory(), ""); + return combinePaths(newDirPath, sourceFilePath); + } + + function getOwnEmitOutputFilePath(sourceFile: SourceFile, program: Program, extension: string){ + var compilerOptions = program.getCompilerOptions(); + if (compilerOptions.outDir) { + var emitOutputFilePathWithoutExtension = removeFileExtension(getSourceFilePathInNewDir(sourceFile, program, compilerOptions.outDir)); + } + else { + var emitOutputFilePathWithoutExtension = removeFileExtension(sourceFile.filename); + } + + return emitOutputFilePathWithoutExtension + extension; + } + + function writeFile(compilerHost: CompilerHost, diagnostics: Diagnostic[], filename: string, data: string, writeByteOrderMark: boolean) { + compilerHost.writeFile(filename, data, writeByteOrderMark, hostErrorMessage => { + diagnostics.push(createCompilerDiagnostic(Diagnostics.Could_not_write_file_0_Colon_1, filename, hostErrorMessage)); + }); + } + + function emitDeclarations(program: Program, resolver: EmitResolver, diagnostics: Diagnostic[], jsFilePath: string, root?: SourceFile): DeclarationEmit { + var newLine = program.getCompilerHost().getNewLine(); + var compilerOptions = program.getCompilerOptions(); + var compilerHost = program.getCompilerHost(); + + var write: (s: string) => void; + var writeLine: () => void; + var increaseIndent: () => void; + var decreaseIndent: () => void; + var writeTextOfNode: (sourceFile: SourceFile, node: Node) => void; + + var writer = createAndSetNewTextWriterWithSymbolWriter(); + + var enclosingDeclaration: Node; + var currentSourceFile: SourceFile; + var reportedDeclarationError = false; + + var emitJsDocComments = compilerOptions.removeComments ? function (declaration: Declaration) { } : writeJsDocComments; + + var aliasDeclarationEmitInfo: AliasDeclarationEmitInfo[] = []; + + function createAndSetNewTextWriterWithSymbolWriter(): EmitTextWriterWithSymbolWriter { + var writer = createTextWriter(newLine); + writer.trackSymbol = trackSymbol; + writer.writeKeyword = writer.write; + writer.writeOperator = writer.write; + writer.writePunctuation = writer.write; + writer.writeSpace = writer.write; + writer.writeStringLiteral = writer.writeLiteral; + writer.writeParameter = writer.write; + writer.writeSymbol = writer.write; + setWriter(writer); + return writer; + } + + function setWriter(newWriter: EmitTextWriterWithSymbolWriter) { + writer = newWriter; + write = newWriter.write; + writeTextOfNode = newWriter.writeTextOfNode; + writeLine = newWriter.writeLine; + increaseIndent = newWriter.increaseIndent; + decreaseIndent = newWriter.decreaseIndent; + } + + function writeAsychronousImportDeclarations(importDeclarations: ImportDeclaration[]) { + var oldWriter = writer; + forEach(importDeclarations, aliasToWrite => { + var aliasEmitInfo = forEach(aliasDeclarationEmitInfo, declEmitInfo => declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined); + // If the alias was marked as not visible when we saw its declaration, we would have saved the aliasEmitInfo, but if we haven't yet visited the alias declaration + // then we don't need to write it at this point. We will write it when we actually see its declaration + // Eg. + // export function bar(a: foo.Foo) { } + // import foo = require("foo"); + // Writing of function bar would mark alias declaration foo as visible but we haven't yet visited that declaration so do nothing, + // we would write alias foo declaration when we visit it since it would now be marked as visible + if (aliasEmitInfo) { + createAndSetNewTextWriterWithSymbolWriter(); + for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) { + increaseIndent(); + } + writeImportDeclaration(aliasToWrite); + aliasEmitInfo.asynchronousOutput = writer.getText(); + } + }); + setWriter(oldWriter); + } + + function handleSymbolAccessibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { + if (symbolAccesibilityResult.accessibility === SymbolAccessibility.Accessible) { + // write the aliases + if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) { + writeAsychronousImportDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); + } + } + else { + // Report error + reportedDeclarationError = true; + var errorInfo = writer.getSymbolAccessibilityDiagnostic(symbolAccesibilityResult); + if (errorInfo) { + if (errorInfo.typeName) { + diagnostics.push(createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, + errorInfo.diagnosticMessage, + getSourceTextOfNodeFromSourceFile(currentSourceFile, errorInfo.typeName), + symbolAccesibilityResult.errorSymbolName, + symbolAccesibilityResult.errorModuleName)); + } + else { + diagnostics.push(createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, + errorInfo.diagnosticMessage, + symbolAccesibilityResult.errorSymbolName, + symbolAccesibilityResult.errorModuleName)); + } + } + } + } + + function trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) { + handleSymbolAccessibilityError(resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning)); + } + + function writeTypeAtLocation(location: Node, type: TypeNode, getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic) { + writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; + write(": "); + if (type) { + // Write the type + emitType(type); + } + else { + resolver.writeTypeAtLocation(location, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); + } + } + + function writeReturnTypeAtSignature(signature: SignatureDeclaration, getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic) { + writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; + write(": "); + if (signature.type) { + // Write the type + emitType(signature.type); + } + else { + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); + } + } + + function emitLines(nodes: Node[]) { + for (var i = 0, n = nodes.length; i < n; i++) { + emitNode(nodes[i]); + } + } + + function emitSeparatedList(nodes: Node[], separator: string, eachNodeEmitFn: (node: Node) => void) { + var currentWriterPos = writer.getTextPos(); + for (var i = 0, n = nodes.length; i < n; i++) { + if (currentWriterPos !== writer.getTextPos()) { + write(separator); + } + currentWriterPos = writer.getTextPos(); + eachNodeEmitFn(nodes[i]); + } + } + + function emitCommaList(nodes: Node[], eachNodeEmitFn: (node: Node) => void) { + emitSeparatedList(nodes, ", ", eachNodeEmitFn); + } + + function writeJsDocComments(declaration: Declaration) { + if (declaration) { + var jsDocComments = getJsDocComments(declaration, currentSourceFile); + emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); + // jsDoc comments are emitted at /*leading comment1 */space/*leading comment*/space + emitComments(currentSourceFile, writer, jsDocComments, /*trailingSeparator*/ true, newLine, writeCommentRange); + } + } + + function emitTypeWithNewGetSymbolAccessibilityDiangostic(type: TypeNode, getSymbolAccessibilityDiagnostic: GetSymbolAccessibilityDiagnostic) { + writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; + emitType(type); + } + + function emitType(type: TypeNode) { + switch (type.kind) { + case SyntaxKind.AnyKeyword: + case SyntaxKind.StringKeyword: + case SyntaxKind.NumberKeyword: + case SyntaxKind.BooleanKeyword: + case SyntaxKind.VoidKeyword: + case SyntaxKind.StringLiteral: + return writeTextOfNode(currentSourceFile, type); + case SyntaxKind.TypeReference: + return emitTypeReference(type); + case SyntaxKind.TypeQuery: + return emitTypeQuery(type); + case SyntaxKind.ArrayType: + return emitArrayType(type); + case SyntaxKind.TupleType: + return emitTupleType(type); + case SyntaxKind.UnionType: + return emitUnionType(type); + case SyntaxKind.ParenType: + return emitParenType(type); + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructorType: + return emitSignatureDeclarationWithJsDocComments(type); + case SyntaxKind.TypeLiteral: + return emitTypeLiteral(type); + case SyntaxKind.Identifier: + return emitEntityName(type); + case SyntaxKind.QualifiedName: + return emitEntityName(type); + default: + Debug.fail("Unknown type annotation: " + type.kind); + } + + function emitEntityName(entityName: EntityName) { + var visibilityResult = resolver.isEntityNameVisible(entityName, + // Aliases can be written asynchronously so use correct enclosing declaration + entityName.parent.kind === SyntaxKind.ImportDeclaration ? entityName.parent : enclosingDeclaration); + + handleSymbolAccessibilityError(visibilityResult); + writeEntityName(entityName); + + function writeEntityName(entityName: EntityName) { + if (entityName.kind === SyntaxKind.Identifier) { + writeTextOfNode(currentSourceFile, entityName); + } + else { + var qualifiedName = entityName; + writeEntityName(qualifiedName.left); + write("."); + writeTextOfNode(currentSourceFile, qualifiedName.right); + } + } + } + + function emitTypeReference(type: TypeReferenceNode) { + emitEntityName(type.typeName); + if (type.typeArguments) { + write("<"); + emitCommaList(type.typeArguments, emitType); + write(">"); + } + } + + function emitTypeQuery(type: TypeQueryNode) { + write("typeof "); + emitEntityName(type.exprName); + } + + function emitArrayType(type: ArrayTypeNode) { + emitType(type.elementType); + write("[]"); + } + + function emitTupleType(type: TupleTypeNode) { + write("["); + emitCommaList(type.elementTypes, emitType); + write("]"); + } + + function emitUnionType(type: UnionTypeNode) { + emitSeparatedList(type.types, " | ", emitType); + } + + function emitParenType(type: ParenTypeNode) { + write("("); + emitType(type.type); + write(")"); + } + + function emitTypeLiteral(type: TypeLiteralNode) { + write("{"); + if (type.members.length) { + writeLine(); + increaseIndent(); + // write members + emitLines(type.members); + decreaseIndent(); + } + write("}"); + } + } + + function emitSourceFile(node: SourceFile) { + currentSourceFile = node; + enclosingDeclaration = node; + emitLines(node.statements); + } + + function emitExportAssignment(node: ExportAssignment) { + write("export = "); + writeTextOfNode(currentSourceFile, node.exportName); + write(";"); + writeLine(); + } + + function emitModuleElementDeclarationFlags(node: Declaration) { + // If the node is parented in the current source file we need to emit export declare or just export + if (node.parent === currentSourceFile) { + // If the node is exported + if (node.flags & NodeFlags.Export) { + write("export "); + } + + if (node.kind !== SyntaxKind.InterfaceDeclaration) { + write("declare "); + } + } + } + + function emitClassMemberDeclarationFlags(node: Declaration) { + if (node.flags & NodeFlags.Private) { + write("private "); + } + else if (node.flags & NodeFlags.Protected) { + write("protected "); + } + + if (node.flags & NodeFlags.Static) { + write("static "); + } + } + + function emitImportDeclaration(node: ImportDeclaration) { + var nodeEmitInfo = { + declaration: node, + outputPos: writer.getTextPos(), + indent: writer.getIndent(), + hasWritten: resolver.isDeclarationVisible(node) + }; + aliasDeclarationEmitInfo.push(nodeEmitInfo); + if (nodeEmitInfo.hasWritten) { + writeImportDeclaration(node); + } + } + + function writeImportDeclaration(node: ImportDeclaration) { + // note usage of writer. methods instead of aliases created, just to make sure we are using + // correct writer especially to handle asynchronous alias writing + emitJsDocComments(node); + if (node.flags & NodeFlags.Export) { + write("export "); + } + write("import "); + writeTextOfNode(currentSourceFile, node.name); + write(" = "); + if (node.entityName) { + emitTypeWithNewGetSymbolAccessibilityDiangostic(node.entityName, getImportEntityNameVisibilityError); + write(";"); + } + else { + write("require("); + writeTextOfNode(currentSourceFile, node.externalModuleName); + write(");"); + } + writer.writeLine(); + + function getImportEntityNameVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { + return { + diagnosticMessage: Diagnostics.Import_declaration_0_is_using_private_name_1, + errorNode: node, + typeName: node.name + }; + } + } + + function emitModuleDeclaration(node: ModuleDeclaration) { + if (resolver.isDeclarationVisible(node)) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("module "); + writeTextOfNode(currentSourceFile, node.name); + while (node.body.kind !== SyntaxKind.ModuleBlock) { + node = node.body; + write("."); + writeTextOfNode(currentSourceFile, node.name); + } + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + write(" {"); + writeLine(); + increaseIndent(); + emitLines((node.body).statements); + decreaseIndent(); + write("}"); + writeLine(); + enclosingDeclaration = prevEnclosingDeclaration; + } + } + + function emitTypeAliasDeclaration(node: TypeAliasDeclaration) { + if (resolver.isDeclarationVisible(node)) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("type "); + writeTextOfNode(currentSourceFile, node.name); + write(" = "); + emitTypeWithNewGetSymbolAccessibilityDiangostic(node.type, getTypeAliasDeclarationVisibilityError); + write(";"); + writeLine(); + } + function getTypeAliasDeclarationVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { + return { + diagnosticMessage: Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1, + errorNode: node.type, + typeName: node.name + }; + } + } + + function emitEnumDeclaration(node: EnumDeclaration) { + if (resolver.isDeclarationVisible(node)) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + if (isConst(node)) { + write("const ") + } + write("enum "); + writeTextOfNode(currentSourceFile, node.name); + write(" {"); + writeLine(); + increaseIndent(); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); + } + } + + function emitEnumMemberDeclaration(node: EnumMember) { + emitJsDocComments(node); + writeTextOfNode(currentSourceFile, node.name); + var enumMemberValue = resolver.getEnumMemberValue(node); + if (enumMemberValue !== undefined) { + write(" = "); + write(enumMemberValue.toString()); + } + write(","); + writeLine(); + } + + function emitTypeParameters(typeParameters: TypeParameterDeclaration[]) { + function emitTypeParameter(node: TypeParameterDeclaration) { + increaseIndent(); + emitJsDocComments(node); + decreaseIndent(); + writeTextOfNode(currentSourceFile, node.name); + // If there is constraint present and this is not a type parameter of the private method emit the constraint + if (node.constraint && (node.parent.kind !== SyntaxKind.Method || !(node.parent.flags & NodeFlags.Private))) { + write(" extends "); + if (node.parent.kind === SyntaxKind.FunctionType || + node.parent.kind === SyntaxKind.ConstructorType || + (node.parent.parent && node.parent.parent.kind === SyntaxKind.TypeLiteral)) { + Debug.assert(node.parent.kind === SyntaxKind.Method || + node.parent.kind === SyntaxKind.FunctionType || + node.parent.kind === SyntaxKind.ConstructorType || + node.parent.kind === SyntaxKind.CallSignature || + node.parent.kind === SyntaxKind.ConstructSignature); + emitType(node.constraint); + } + else { + emitTypeWithNewGetSymbolAccessibilityDiangostic(node.constraint, getTypeParameterConstraintVisibilityError); + } + } + + function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { + // Type parameter constraints are named by user so we should always be able to name it + var diagnosticMessage: DiagnosticMessage; + switch (node.parent.kind) { + case SyntaxKind.ClassDeclaration: + diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; + break; + + case SyntaxKind.InterfaceDeclaration: + diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; + break; + + case SyntaxKind.ConstructSignature: + diagnosticMessage = Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; + break; + + case SyntaxKind.CallSignature: + diagnosticMessage = Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; + break; + + case SyntaxKind.Method: + if (node.parent.flags & NodeFlags.Static) { + diagnosticMessage = Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; + } + else if (node.parent.parent.kind === SyntaxKind.ClassDeclaration) { + diagnosticMessage = Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; + } + else { + diagnosticMessage = Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; + } + break; + + case SyntaxKind.FunctionDeclaration: + diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; + break; + + default: + Debug.fail("This is unknown parent for type parameter: " + node.parent.kind); + } + + return { + diagnosticMessage, + errorNode: node, + typeName: node.name + }; + } + } + + if (typeParameters) { + write("<"); + emitCommaList(typeParameters, emitTypeParameter); + write(">"); + } + } + + function emitHeritageClause(typeReferences: TypeReferenceNode[], isImplementsList: boolean) { + if (typeReferences) { + write(isImplementsList ? " implements " : " extends "); + emitCommaList(typeReferences, emitTypeOfTypeReference); + } + + function emitTypeOfTypeReference(node: Node) { + emitTypeWithNewGetSymbolAccessibilityDiangostic(node, getHeritageClauseVisibilityError); + + function getHeritageClauseVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { + var diagnosticMessage: DiagnosticMessage; + // Heritage clause is written by user so it can always be named + if (node.parent.kind === SyntaxKind.ClassDeclaration) { + // Class or Interface implemented/extended is inaccessible + diagnosticMessage = isImplementsList ? + Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : + Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; + } + else { + // interface is inaccessible + diagnosticMessage = Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; + } + + return { + diagnosticMessage, + errorNode: node, + typeName: (node.parent).name + }; + } + } + } + + function emitClassDeclaration(node: ClassDeclaration) { + function emitParameterProperties(constructorDeclaration: ConstructorDeclaration) { + if (constructorDeclaration) { + forEach(constructorDeclaration.parameters, param => { + if (param.flags & NodeFlags.AccessibilityModifier) { + emitPropertyDeclaration(param); + } + }); + } + } + + if (resolver.isDeclarationVisible(node)) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("class "); + writeTextOfNode(currentSourceFile, node.name); + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + emitTypeParameters(node.typeParameters); + if (node.baseType) { + emitHeritageClause([node.baseType], /*isImplementsList*/ false); + } + emitHeritageClause(node.implementedTypes, /*isImplementsList*/ true); + write(" {"); + writeLine(); + increaseIndent(); + emitParameterProperties(getFirstConstructorWithBody(node)); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); + enclosingDeclaration = prevEnclosingDeclaration; + } + } + + function emitInterfaceDeclaration(node: InterfaceDeclaration) { + if (resolver.isDeclarationVisible(node)) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + write("interface "); + writeTextOfNode(currentSourceFile, node.name); + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + emitTypeParameters(node.typeParameters); + emitHeritageClause(node.baseTypes, /*isImplementsList*/ false); + write(" {"); + writeLine(); + increaseIndent(); + emitLines(node.members); + decreaseIndent(); + write("}"); + writeLine(); + enclosingDeclaration = prevEnclosingDeclaration; + } + } + + function emitPropertyDeclaration(node: PropertyDeclaration) { + emitJsDocComments(node); + emitClassMemberDeclarationFlags(node); + emitVariableDeclaration(node); + write(";"); + writeLine(); + } + + // TODO(jfreeman): Factor out common part of property definition, but treat name differently + function emitVariableDeclaration(node: VariableDeclaration) { + // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted + // so there is no check needed to see if declaration is visible + if (node.kind !== SyntaxKind.VariableDeclaration || resolver.isDeclarationVisible(node)) { + writeTextOfNode(currentSourceFile, node.name); + // If optional property emit ? + if (node.kind === SyntaxKind.Property && (node.flags & NodeFlags.QuestionMark)) { + write("?"); + } + if (node.kind === SyntaxKind.Property && node.parent.kind === SyntaxKind.TypeLiteral) { + emitTypeOfVariableDeclarationFromTypeLiteral(node); + } + else if (!(node.flags & NodeFlags.Private)) { + writeTypeAtLocation(node, node.type, getVariableDeclarationTypeVisibilityError); + } + } + + function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { + var diagnosticMessage: DiagnosticMessage; + if (node.kind === SyntaxKind.VariableDeclaration) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : + Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; + } + // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit + else if (node.kind === SyntaxKind.Property) { + // TODO(jfreeman): Deal with computed properties in error reporting. + if (node.flags & NodeFlags.Static) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : + Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; + } + else if (node.parent.kind === SyntaxKind.ClassDeclaration) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : + Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; + } + else { + // Interfaces cannot have types that cannot be named + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; + } + } + + return diagnosticMessage !== undefined ? { + diagnosticMessage, + errorNode: node, + typeName: node.name + } : undefined; + } + } + + function emitTypeOfVariableDeclarationFromTypeLiteral(node: VariableDeclaration) { + // if this is property of type literal, + // or is parameter of method/call/construct/index signature of type literal + // emit only if type is specified + if (node.type) { + write(": "); + emitType(node.type); + } + } + + function emitVariableStatement(node: VariableStatement) { + var hasDeclarationWithEmit = forEach(node.declarations, varDeclaration => resolver.isDeclarationVisible(varDeclaration)); + if (hasDeclarationWithEmit) { + emitJsDocComments(node); + emitModuleElementDeclarationFlags(node); + if (isLet(node)) { + write("let "); + } + else if (isConst(node)) { + write("const "); + } + else { + write("var "); + } + emitCommaList(node.declarations, emitVariableDeclaration); + write(";"); + writeLine(); + } + } + + function emitAccessorDeclaration(node: AccessorDeclaration) { + var accessors = getAllAccessorDeclarations(node.parent, node); + if (node === accessors.firstAccessor) { + emitJsDocComments(accessors.getAccessor); + emitJsDocComments(accessors.setAccessor); + emitClassMemberDeclarationFlags(node); + writeTextOfNode(currentSourceFile, node.name); + if (!(node.flags & NodeFlags.Private)) { + var accessorWithTypeAnnotation: AccessorDeclaration = node; + var type = getTypeAnnotationFromAccessor(node); + if (!type) { + // couldn't get type for the first accessor, try the another one + var anotherAccessor = node.kind === SyntaxKind.GetAccessor ? accessors.setAccessor : accessors.getAccessor; + type = getTypeAnnotationFromAccessor(anotherAccessor); + if (type) { + accessorWithTypeAnnotation = anotherAccessor; + } + } + writeTypeAtLocation(node, type, getAccessorDeclarationTypeVisibilityError); + } + write(";"); + writeLine(); + } + + function getTypeAnnotationFromAccessor(accessor: AccessorDeclaration): TypeNode { + if (accessor) { + return accessor.kind === SyntaxKind.GetAccessor ? + accessor.type : // Getter - return type + accessor.parameters[0].type; // Setter parameter type + } + } + + function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { + var diagnosticMessage: DiagnosticMessage; + if (accessorWithTypeAnnotation.kind === SyntaxKind.SetAccessor) { + // Setters have to have type named and cannot infer it so, the type should always be named + if (accessorWithTypeAnnotation.parent.flags & NodeFlags.Static) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; + } + else { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1; + } + return { + diagnosticMessage, + errorNode: accessorWithTypeAnnotation.parameters[0], + // TODO(jfreeman): Investigate why we are passing node.name instead of node.parameters[0].name + typeName: accessorWithTypeAnnotation.name + }; + } + else { + if (accessorWithTypeAnnotation.flags & NodeFlags.Static) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : + Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : + Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0; + } + else { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : + Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : + Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0; + } + return { + diagnosticMessage, + errorNode: accessorWithTypeAnnotation.name, + typeName: undefined + }; + } + } + } + + function emitFunctionDeclaration(node: FunctionLikeDeclaration) { + // If we are emitting Method/Constructor it isn't moduleElement and hence already determined to be emitting + // so no need to verify if the declaration is visible + if ((node.kind !== SyntaxKind.FunctionDeclaration || resolver.isDeclarationVisible(node)) && + !resolver.isImplementationOfOverload(node)) { + emitJsDocComments(node); + if (node.kind === SyntaxKind.FunctionDeclaration) { + emitModuleElementDeclarationFlags(node); + } + else if (node.kind === SyntaxKind.Method) { + emitClassMemberDeclarationFlags(node); + } + if (node.kind === SyntaxKind.FunctionDeclaration) { + write("function "); + writeTextOfNode(currentSourceFile, node.name); + } + else if (node.kind === SyntaxKind.Constructor) { + write("constructor"); + } + else { + writeTextOfNode(currentSourceFile, node.name); + if (node.flags & NodeFlags.QuestionMark) { + write("?"); + } + } + emitSignatureDeclaration(node); + } + } + + function emitSignatureDeclarationWithJsDocComments(node: SignatureDeclaration) { + emitJsDocComments(node); + emitSignatureDeclaration(node); + } + + function emitSignatureDeclaration(node: SignatureDeclaration) { + // Construct signature or constructor type write new Signature + if (node.kind === SyntaxKind.ConstructSignature || node.kind === SyntaxKind.ConstructorType) { + write("new "); + } + emitTypeParameters(node.typeParameters); + if (node.kind === SyntaxKind.IndexSignature) { + write("["); + } + else { + write("("); + } + + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + + // Parameters + emitCommaList(node.parameters, emitParameterDeclaration); + + if (node.kind === SyntaxKind.IndexSignature) { + write("]"); + } + else { + write(")"); + } + + // If this is not a constructor and is not private, emit the return type + var isFunctionTypeOrConstructorType = node.kind === SyntaxKind.FunctionType || node.kind === SyntaxKind.ConstructorType; + if (isFunctionTypeOrConstructorType || node.parent.kind === SyntaxKind.TypeLiteral) { + // Emit type literal signature return type only if specified + if (node.type) { + write(isFunctionTypeOrConstructorType ? " => " : ": "); + emitType(node.type); + } + } + else if (node.kind !== SyntaxKind.Constructor && !(node.flags & NodeFlags.Private)) { + writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); + } + + enclosingDeclaration = prevEnclosingDeclaration; + + if (!isFunctionTypeOrConstructorType) { + write(";"); + writeLine(); + } + + function getReturnTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { + var diagnosticMessage: DiagnosticMessage; + switch (node.kind) { + case SyntaxKind.ConstructSignature: + // Interfaces cannot have return types that cannot be named + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : + Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; + break; + + case SyntaxKind.CallSignature: + // Interfaces cannot have return types that cannot be named + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : + Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; + break; + + case SyntaxKind.IndexSignature: + // Interfaces cannot have return types that cannot be named + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : + Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; + break; + + case SyntaxKind.Method: + if (node.flags & NodeFlags.Static) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : + Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : + Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; + } + else if (node.parent.kind === SyntaxKind.ClassDeclaration) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : + Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : + Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; + } + else { + // Interfaces cannot have return types that cannot be named + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : + Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; + } + break; + + case SyntaxKind.FunctionDeclaration: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : + Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : + Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; + break; + + default: + Debug.fail("This is unknown kind for signature: " + node.kind); + } + + return { + diagnosticMessage, + errorNode: node.name || node, + }; + } + } + + function emitParameterDeclaration(node: ParameterDeclaration) { + increaseIndent(); + emitJsDocComments(node); + if (node.flags & NodeFlags.Rest) { + write("..."); + } + writeTextOfNode(currentSourceFile, node.name); + if (node.initializer || (node.flags & NodeFlags.QuestionMark)) { + write("?"); + } + decreaseIndent(); + + if (node.parent.kind === SyntaxKind.FunctionType || + node.parent.kind === SyntaxKind.ConstructorType || + node.parent.parent.kind === SyntaxKind.TypeLiteral) { + emitTypeOfVariableDeclarationFromTypeLiteral(node); + } + else if (!(node.parent.flags & NodeFlags.Private)) { + writeTypeAtLocation(node, node.type, getParameterDeclarationTypeVisibilityError); + } + + function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic { + var diagnosticMessage: DiagnosticMessage; + switch (node.parent.kind) { + case SyntaxKind.Constructor: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : + Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; + break; + + case SyntaxKind.ConstructSignature: + // Interfaces cannot have parameter types that cannot be named + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; + break; + + case SyntaxKind.CallSignature: + // Interfaces cannot have parameter types that cannot be named + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; + break; + + case SyntaxKind.Method: + if (node.parent.flags & NodeFlags.Static) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : + Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; + } + else if (node.parent.parent.kind === SyntaxKind.ClassDeclaration) { + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : + Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; + } + else { + // Interfaces cannot have parameter types that cannot be named + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; + } + break; + + case SyntaxKind.FunctionDeclaration: + diagnosticMessage = symbolAccesibilityResult.errorModuleName ? + symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? + Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : + Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : + Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; + break; + + default: + Debug.fail("This is unknown parent for parameter: " + node.parent.kind); + } + + return { + diagnosticMessage, + errorNode: node, + typeName: node.name + }; + } + } + + function emitNode(node: Node) { + switch (node.kind) { + case SyntaxKind.Constructor: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.Method: + return emitFunctionDeclaration(node); + case SyntaxKind.ConstructSignature: + case SyntaxKind.CallSignature: + case SyntaxKind.IndexSignature: + return emitSignatureDeclarationWithJsDocComments(node); + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + return emitAccessorDeclaration(node); + case SyntaxKind.VariableStatement: + return emitVariableStatement(node); + case SyntaxKind.Property: + return emitPropertyDeclaration(node); + case SyntaxKind.InterfaceDeclaration: + return emitInterfaceDeclaration(node); + case SyntaxKind.ClassDeclaration: + return emitClassDeclaration(node); + case SyntaxKind.TypeAliasDeclaration: + return emitTypeAliasDeclaration(node); + case SyntaxKind.EnumMember: + return emitEnumMemberDeclaration(node); + case SyntaxKind.EnumDeclaration: + return emitEnumDeclaration(node); + case SyntaxKind.ModuleDeclaration: + return emitModuleDeclaration(node); + case SyntaxKind.ImportDeclaration: + return emitImportDeclaration(node); + case SyntaxKind.ExportAssignment: + return emitExportAssignment(node); + case SyntaxKind.SourceFile: + return emitSourceFile(node); + } + } + + // Contains the reference paths that needs to go in the declaration file. + // Collecting this separately because reference paths need to be first thing in the declaration file + // and we could be collecting these paths from multiple files into single one with --out option + var referencePathsOutput = ""; + function writeReferencePath(referencedFile: SourceFile) { + var declFileName = referencedFile.flags & NodeFlags.DeclarationFile + ? referencedFile.filename // Declaration file, use declaration file name + : shouldEmitToOwnFile(referencedFile, compilerOptions) + ? getOwnEmitOutputFilePath(referencedFile, program, ".d.ts") // Own output file so get the .d.ts file + : removeFileExtension(compilerOptions.out) + ".d.ts";// Global out file + + declFileName = getRelativePathToDirectoryOrUrl( + getDirectoryPath(normalizeSlashes(jsFilePath)), + declFileName, + compilerHost.getCurrentDirectory(), + compilerHost.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ false); + + referencePathsOutput += "/// " + newLine; + } + + if (root) { + // Emitting just a single file, so emit references in this file only + if (!compilerOptions.noResolve) { + var addedGlobalFileReference = false; + forEach(root.referencedFiles, fileReference => { + var referencedFile = tryResolveScriptReference(program, root, fileReference); + + // All the references that are not going to be part of same file + if (referencedFile && ((referencedFile.flags & NodeFlags.DeclarationFile) || // This is a declare file reference + shouldEmitToOwnFile(referencedFile, compilerOptions) || // This is referenced file is emitting its own js file + !addedGlobalFileReference)) { // Or the global out file corresponding to this reference was not added + + writeReferencePath(referencedFile); + if (!isExternalModuleOrDeclarationFile(referencedFile)) { + addedGlobalFileReference = true; + } + } + }); + } + + emitNode(root); + } + else { + // Emit references corresponding to this file + var emittedReferencedFiles: SourceFile[] = []; + forEach(program.getSourceFiles(), sourceFile => { + if (!isExternalModuleOrDeclarationFile(sourceFile)) { + // Check what references need to be added + if (!compilerOptions.noResolve) { + forEach(sourceFile.referencedFiles, fileReference => { + var referencedFile = tryResolveScriptReference(program, sourceFile, fileReference); + + // If the reference file is a declaration file or an external module, emit that reference + if (referencedFile && (isExternalModuleOrDeclarationFile(referencedFile) && + !contains(emittedReferencedFiles, referencedFile))) { // If the file reference was not already emitted + + writeReferencePath(referencedFile); + emittedReferencedFiles.push(referencedFile); + } + }); + } + + emitNode(sourceFile); + } + }); + } + + return { + reportedDeclarationError, + aliasDeclarationEmitInfo, + synchronousDeclarationOutput: writer.getText(), + referencePathsOutput, + } + } + + export function getDeclarationDiagnostics(program: Program, resolver: EmitResolver, targetSourceFile: SourceFile): Diagnostic[] { + var diagnostics: Diagnostic[] = []; + var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, program, ".js"); + emitDeclarations(program, resolver, diagnostics, jsFilePath, targetSourceFile); + return diagnostics; + } + // targetSourceFile is when users only want one file in entire project to be emitted. This is used in compilerOnSave feature export function emitFiles(resolver: EmitResolver, targetSourceFile?: SourceFile): EmitResult { var program = resolver.getProgram(); @@ -56,271 +1454,16 @@ module ts { var diagnostics: Diagnostic[] = []; var newLine = program.getCompilerHost().getNewLine(); - function getSourceFilePathInNewDir(newDirPath: string, sourceFile: SourceFile) { - var sourceFilePath = getNormalizedPathFromPathComponents(getNormalizedPathComponents(sourceFile.filename, compilerHost.getCurrentDirectory())); - sourceFilePath = sourceFilePath.replace(program.getCommonSourceDirectory(), ""); - return combinePaths(newDirPath, sourceFilePath); - } - - function getOwnEmitOutputFilePath(sourceFile: SourceFile, extension: string) { - if (compilerOptions.outDir) { - var emitOutputFilePathWithoutExtension = removeFileExtension(getSourceFilePathInNewDir(compilerOptions.outDir, sourceFile)); - } - else { - var emitOutputFilePathWithoutExtension = removeFileExtension(sourceFile.filename); - } - - return emitOutputFilePathWithoutExtension + extension; - } - - function getFirstConstructorWithBody(node: ClassDeclaration): ConstructorDeclaration { - return forEach(node.members, member => { - if (member.kind === SyntaxKind.Constructor && (member).body) { - return member; - } - }); - } - - function getAllAccessorDeclarations(node: ClassDeclaration, accessor: AccessorDeclaration) { - var firstAccessor: AccessorDeclaration; - var getAccessor: AccessorDeclaration; - var setAccessor: AccessorDeclaration; - forEach(node.members, (member: Declaration) => { - // TODO(jfreeman): Handle computed names for accessor matching - if ((member.kind === SyntaxKind.GetAccessor || member.kind === SyntaxKind.SetAccessor) && - (member.name).text === (accessor.name).text && - (member.flags & NodeFlags.Static) === (accessor.flags & NodeFlags.Static)) { - if (!firstAccessor) { - firstAccessor = member; - } - - if (member.kind === SyntaxKind.GetAccessor && !getAccessor) { - getAccessor = member; - } - - if (member.kind === SyntaxKind.SetAccessor && !setAccessor) { - setAccessor = member; - } - } - }); - return { - firstAccessor: firstAccessor, - getAccessor: getAccessor, - setAccessor: setAccessor - }; - } - - function createTextWriter(): EmitTextWriter { - var output = ""; - var indent = 0; - var lineStart = true; - var lineCount = 0; - var linePos = 0; - - function write(s: string) { - if (s && s.length) { - if (lineStart) { - output += getIndentString(indent); - lineStart = false; - } - output += s; - } - } - - function rawWrite(s: string) { - if (s !== undefined) { - if (lineStart) { - lineStart = false; - } - output += s; - } - } - - function writeLiteral(s: string) { - if (s && s.length) { - write(s); - var lineStartsOfS = computeLineStarts(s); - if (lineStartsOfS.length > 1) { - lineCount = lineCount + lineStartsOfS.length - 1; - linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; - } - } - } - - function writeLine() { - if (!lineStart) { - output += newLine; - lineCount++; - linePos = output.length; - lineStart = true; - } - } - - return { - write: write, - rawWrite: rawWrite, - writeLiteral: writeLiteral, - writeLine: writeLine, - increaseIndent: () => indent++, - decreaseIndent: () => indent--, - getIndent: () => indent, - getTextPos: () => output.length, - getLine: () => lineCount + 1, - getColumn: () => lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1, - getText: () => output, - }; - } - - // Get source text of node in the current source file. Unlike getSourceTextOfNode this function - // doesn't walk the parent chain to find the containing source file, rather it assumes the node is - // in the source file currently being processed. - var currentSourceFile: SourceFile; - function getSourceTextOfLocalNode(node: Node): string { - var text = currentSourceFile.text; - return text.substring(skipTrivia(text, node.pos), node.end); - } - - function getLineOfLocalPosition(pos: number) { - return currentSourceFile.getLineAndCharacterFromPosition(pos).line; - } - - function writeFile(filename: string, data: string, writeByteOrderMark: boolean) { - compilerHost.writeFile(filename, data, writeByteOrderMark, hostErrorMessage => { - diagnostics.push(createCompilerDiagnostic(Diagnostics.Could_not_write_file_0_Colon_1, filename, hostErrorMessage)); - }); - } - - function emitComments(comments: CommentRange[], trailingSeparator: boolean, writer: EmitTextWriter, writeComment: (comment: CommentRange, writer: EmitTextWriter) => void) { - var emitLeadingSpace = !trailingSeparator; - forEach(comments, comment => { - if (emitLeadingSpace) { - writer.write(" "); - emitLeadingSpace = false; - } - writeComment(comment, writer); - if (comment.hasTrailingNewLine) { - writer.writeLine(); - } - else if (trailingSeparator) { - writer.write(" "); - } - else { - // Emit leading space to separate comment during next comment emit - emitLeadingSpace = true; - } - }); - } - - function emitNewLineBeforeLeadingComments(node: TextRange, leadingComments: CommentRange[], writer: EmitTextWriter) { - // If the leading comments start on different line than the start of node, write new line - if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && - getLineOfLocalPosition(node.pos) !== getLineOfLocalPosition(leadingComments[0].pos)) { - writer.writeLine(); - } - } - - function writeCommentRange(comment: CommentRange, writer: EmitTextWriter) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === CharacterCodes.asterisk) { - var firstCommentLineAndCharacter = currentSourceFile.getLineAndCharacterFromPosition(comment.pos); - var firstCommentLineIndent: number; - for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { - var nextLineStart = currentSourceFile.getPositionFromLineAndCharacter(currentLine + 1, /*character*/1); - - if (pos !== comment.pos) { - // If we are not emitting first line, we need to write the spaces to adjust the alignment - if (firstCommentLineIndent === undefined) { - firstCommentLineIndent = calculateIndent(currentSourceFile.getPositionFromLineAndCharacter(firstCommentLineAndCharacter.line, /*character*/1), - comment.pos); - } - - // These are number of spaces writer is going to write at current indent - var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); - - // Number of spaces we want to be writing - // eg: Assume writer indent - // module m { - // /* starts at character 9 this is line 1 - // * starts at character pos 4 line --1 = 8 - 8 + 3 - // More left indented comment */ --2 = 8 - 8 + 2 - // class c { } - // } - // module m { - // /* this is line 1 -- Assume current writer indent 8 - // * line --3 = 8 - 4 + 5 - // More right indented comment */ --4 = 8 - 4 + 11 - // class c { } - // } - var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); - if (spacesToEmit > 0) { - var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); - var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); - - // Write indent size string ( in eg 1: = "", 2: "" , 3: string with 8 spaces 4: string with 12 spaces - writer.rawWrite(indentSizeSpaceString); - - // Emit the single spaces (in eg: 1: 3 spaces, 2: 2 spaces, 3: 1 space, 4: 3 spaces) - while (numberOfSingleSpacesToEmit) { - writer.rawWrite(" "); - numberOfSingleSpacesToEmit--; - } - } - else { - // No spaces to emit write empty string - writer.rawWrite(""); - } - } - - // Write the comment line text - writeTrimmedCurrentLine(pos, nextLineStart); - - pos = nextLineStart; - } - } - else { - // Single line comment of style //.... - writer.write(currentSourceFile.text.substring(comment.pos, comment.end)); - } - - function writeTrimmedCurrentLine(pos: number, nextLineStart: number) { - var end = Math.min(comment.end, nextLineStart - 1); - var currentLineText = currentSourceFile.text.substring(pos, end).replace(/^\s+|\s+$/g, ''); - if (currentLineText) { - // trimmed forward and ending spaces text - writer.write(currentLineText); - if (end !== comment.end) { - writer.writeLine(); - } - } - else { - // Empty string - make sure we write empty line - writer.writeLiteral(newLine); - } - } - - function calculateIndent(pos: number, end: number) { - var currentLineIndent = 0; - for (; pos < end && isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { - if (currentSourceFile.text.charCodeAt(pos) === CharacterCodes.tab) { - // Tabs = TabSize = indent size and go to next tabStop - currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); - } - else { - // Single space - currentLineIndent++; - } - } - - return currentLineIndent; - } - } - function emitJavaScript(jsFilePath: string, root?: SourceFile) { - var writer = createTextWriter(); + var writer = createTextWriter(newLine); var write = writer.write; + var writeTextOfNode = writer.writeTextOfNode; var writeLine = writer.writeLine; var increaseIndent = writer.increaseIndent; var decreaseIndent = writer.decreaseIndent; + var currentSourceFile: SourceFile; + var extendsEmitted = false; /** write emitted output to disk*/ @@ -593,9 +1736,9 @@ module ts { sourceMapNameIndices.pop(); }; - function writeCommentRangeWithMap(comment: CommentRange, writer: EmitTextWriter) { + function writeCommentRangeWithMap(curentSourceFile: SourceFile, writer: EmitTextWriter, comment: CommentRange, newLine: string) { recordSourceMapSpan(comment.pos); - writeCommentRange(comment, writer); + writeCommentRange(currentSourceFile, writer, comment, newLine); recordSourceMapSpan(comment.end); } @@ -628,7 +1771,7 @@ module ts { function writeJavaScriptAndSourceMapFile(emitOutput: string, writeByteOrderMark: boolean) { // Write source map file encodeLastRecordedSourceMapSpan(); - writeFile(sourceMapData.sourceMapFilePath, serializeSourceMapContents( + writeFile(compilerHost, diagnostics, sourceMapData.sourceMapFilePath, serializeSourceMapContents( 3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, @@ -667,7 +1810,7 @@ module ts { if (root) { // emitting single module file // For modules or multiple emit files the mapRoot will have directory structure like the sources // So if src\a.ts and src\lib\b.ts are compiled together user would be moving the maps into mapRoot\a.js.map and mapRoot\lib\b.js.map - sourceMapDir = getDirectoryPath(getSourceFilePathInNewDir(sourceMapDir, root)); + sourceMapDir = getDirectoryPath(getSourceFilePathInNewDir(root, program, sourceMapDir)); } if (!isRootedDiskPath(sourceMapDir) && !isUrl(sourceMapDir)) { @@ -713,7 +1856,7 @@ module ts { } function writeJavaScriptFile(emitOutput: string, writeByteOrderMark: boolean) { - writeFile(jsFilePath, emitOutput, writeByteOrderMark); + writeFile(compilerHost, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); } function emitTokenText(tokenKind: SyntaxKind, startPos: number, emitFn?: () => void) { @@ -788,7 +1931,7 @@ module ts { } } - function emitLiteral(node: LiteralExpression): void { + function emitLiteral(node: LiteralExpression) { var text = getLiteralText(); if (compilerOptions.sourceMap && (node.kind === SyntaxKind.StringLiteral || isTemplateLiteralKind(node.kind))) { @@ -803,14 +1946,14 @@ module ts { return getTemplateLiteralAsStringLiteral(node) } - return getSourceTextOfLocalNode(node); + return getSourceTextOfNodeFromSourceFile(currentSourceFile, node); } } function getTemplateLiteralAsStringLiteral(node: LiteralExpression): string { return '"' + escapeString(node.text) + '"'; } - + function emitTemplateExpression(node: TemplateExpression): void { // In ES6 mode and above, we can simply emit each portion of a template in order, but in // ES3 & ES5 we must convert the template expression into a series of string concatenations. @@ -821,11 +1964,10 @@ module ts { Debug.assert(node.parent.kind !== SyntaxKind.TaggedTemplateExpression); - var templateNeedsParens = isExpression(node.parent) - && node.parent.kind !== SyntaxKind.ParenExpression - && comparePrecedenceToBinaryPlus(node.parent) !== Comparison.LessThan; + var emitOuterParens = isExpression(node.parent) + && templateNeedsParens(node, node.parent); - if (templateNeedsParens) { + if (emitOuterParens) { write("("); } @@ -834,7 +1976,7 @@ module ts { forEach(node.templateSpans, templateSpan => { // Check if the expression has operands and binds its operands less closely than binary '+'. // If it does, we need to wrap the expression in parentheses. Otherwise, something like - // `abc${ 1 << 2}` + // `abc${ 1 << 2 }` // becomes // "abc" + 1 << 2 + "" // which is really @@ -855,18 +1997,33 @@ module ts { } // Only emit if the literal is non-empty. - // The binary '+' operator is left-associative, so the first string concatenation will force - // the result up to this point to be a string. Emitting a '+ ""' has no semantic effect. + // The binary '+' operator is left-associative, so the first string concatenation + // with the head will force the result up to this point to be a string. + // Emitting a '+ ""' has no semantic effect for middles and tails. if (templateSpan.literal.text.length !== 0) { write(" + ") emitLiteral(templateSpan.literal); } }); - - if (templateNeedsParens) { + + if (emitOuterParens) { write(")"); } + function templateNeedsParens(template: TemplateExpression, parent: Expression) { + switch (parent.kind) { + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + return (parent).func === template; + case SyntaxKind.ParenExpression: + return false; + case SyntaxKind.TaggedTemplateExpression: + Debug.fail("Path should be unreachable; tagged templates not supported pre-ES6."); + default: + return comparePrecedenceToBinaryPlus(parent) !== Comparison.LessThan; + } + } + /** * Returns whether the expression has lesser, greater, * or equal precedence to the binary '+' operator @@ -899,7 +2056,6 @@ module ts { return Comparison.GreaterThan; } } - } function emitTemplateSpan(span: TemplateSpan) { @@ -920,20 +2076,21 @@ module ts { write((node).text); } else { - write(getSourceTextOfLocalNode(node)); + writeTextOfNode(currentSourceFile, node); } write("\""); } } - function isNonExpressionIdentifier(node: Identifier) { + function isNotExpressionIdentifier(node: Identifier) { var parent = node.parent; switch (parent.kind) { case SyntaxKind.Parameter: case SyntaxKind.VariableDeclaration: case SyntaxKind.Property: case SyntaxKind.PropertyAssignment: + case SyntaxKind.ShorthandPropertyAssignment: case SyntaxKind.EnumMember: case SyntaxKind.Method: case SyntaxKind.FunctionDeclaration: @@ -957,15 +2114,22 @@ module ts { } } - function emitIdentifier(node: Identifier) { - if (!isNonExpressionIdentifier(node)) { - var prefix = resolver.getExpressionNamePrefix(node); - if (prefix) { - write(prefix); - write("."); - } + function emitExpressionIdentifier(node: Identifier) { + var prefix = resolver.getExpressionNamePrefix(node); + if (prefix) { + write(prefix); + write("."); + } + writeTextOfNode(currentSourceFile, node); + } + + function emitIdentifier(node: Identifier) { + if (!isNotExpressionIdentifier(node)) { + emitExpressionIdentifier(node); + } + else { + writeTextOfNode(currentSourceFile, node); } - write(getSourceTextOfLocalNode(node)); } function emitThis(node: Node) { @@ -1033,6 +2197,36 @@ module ts { emitTrailingComments(node); } + function emitShortHandPropertyAssignment(node: ShortHandPropertyDeclaration) { + function emitAsNormalPropertyAssignment() { + emitLeadingComments(node); + // Emit identifier as an identifier + emit(node.name); + write(": "); + // Even though this is stored as identified because it is in short-hand property assignment, + // treated it as expression + emitExpressionIdentifier(node.name); + emitTrailingComments(node); + } + + if (compilerOptions.target < ScriptTarget.ES6) { + emitAsNormalPropertyAssignment(); + } + else if (compilerOptions.target >= ScriptTarget.ES6) { + // If short-hand property has a prefix, then regardless of the target version, we will emit it as normal property assignment + var prefix = resolver.getExpressionNamePrefix(node.name); + if (prefix) { + emitAsNormalPropertyAssignment(); + } + // If short-hand property has no prefix, emit it as short-hand. + else { + emitLeadingComments(node); + emit(node.name); + emitTrailingComments(node); + } + } + } + function tryEmitConstantValue(node: PropertyAccess | IndexedAccess): boolean { var constantValue = resolver.getConstantValue(node); if (constantValue !== undefined) { @@ -1271,10 +2465,10 @@ module ts { write(" "); endPos = emitToken(SyntaxKind.OpenParenToken, endPos); if (node.declarations) { - if (node.declarations[0] && node.declarations[0].flags & NodeFlags.Let) { + if (node.declarations[0] && isLet(node.declarations[0])) { emitToken(SyntaxKind.LetKeyword, endPos); } - else if (node.declarations[0] && node.declarations[0].flags & NodeFlags.Const) { + else if (node.declarations[0] && isConst(node.declarations[0])) { emitToken(SyntaxKind.ConstKeyword, endPos); } else { @@ -1298,15 +2492,18 @@ module ts { var endPos = emitToken(SyntaxKind.ForKeyword, node.pos); write(" "); endPos = emitToken(SyntaxKind.OpenParenToken, endPos); - if (node.declaration) { - if (node.declaration.flags & NodeFlags.Let) { - emitToken(SyntaxKind.LetKeyword, endPos); + if (node.declarations) { + if (node.declarations.length >= 1) { + var decl = node.declarations[0]; + if (isLet(decl)) { + emitToken(SyntaxKind.LetKeyword, endPos); + } + else { + emitToken(SyntaxKind.VarKeyword, endPos); + } + write(" "); + emit(decl); } - else { - emitToken(SyntaxKind.VarKeyword, endPos); - } - write(" "); - emit(node.declaration); } else { emit(node.variable); @@ -1354,7 +2551,8 @@ module ts { } function isOnSameLine(node1: Node, node2: Node) { - return getLineOfLocalPosition(skipTrivia(currentSourceFile.text, node1.pos)) === getLineOfLocalPosition(skipTrivia(currentSourceFile.text, node2.pos)); + return getLineOfLocalPosition(currentSourceFile, skipTrivia(currentSourceFile.text, node1.pos)) === + getLineOfLocalPosition(currentSourceFile, skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node: CaseOrDefaultClause) { @@ -1366,7 +2564,6 @@ module ts { else { write("default:"); } - if (node.statements.length === 1 && isOnSameLine(node, node.statements[0])) { write(" "); emit(node.statements[0]); @@ -1445,10 +2642,10 @@ module ts { function emitVariableStatement(node: VariableStatement) { emitLeadingComments(node); if (!(node.flags & NodeFlags.Export)) { - if (node.flags & NodeFlags.Let) { + if (isLet(node)) { write("let "); } - else if (node.flags & NodeFlags.Const) { + else if (isConst(node)) { write("const "); } else { @@ -1901,7 +3098,7 @@ module ts { function emitEnumDeclaration(node: EnumDeclaration) { // const enums are completely erased during compilation. - var isConstEnum = isConstEnumDeclaration(node); + var isConstEnum = isConst(node); if (isConstEnum && !compilerOptions.preserveConstEnums) { return; } @@ -2096,7 +3293,11 @@ module ts { function emitAMDModule(node: SourceFile, startIndex: number) { var imports = getExternalImportDeclarations(node); writeLine(); - write("define([\"require\", \"exports\""); + write("define("); + if (node.amdModuleName) { + write("\"" + node.amdModuleName + "\", "); + } + write("[\"require\", \"exports\""); forEach(imports, imp => { write(", "); emitLiteral(imp.externalModuleName); @@ -2250,6 +3451,8 @@ module ts { return emitObjectLiteral(node); case SyntaxKind.PropertyAssignment: return emitPropertyAssignment(node); + case SyntaxKind.ShorthandPropertyAssignment: + return emitShortHandPropertyAssignment(node); case SyntaxKind.PropertyAccess: return emitPropertyAccess(node); case SyntaxKind.IndexedAccess: @@ -2355,6 +3558,7 @@ module ts { return leadingComments; } + function getLeadingCommentsToEmit(node: Node) { // Emit the leading comments only if the parent's pos doesn't match because parent should take care of emitting these comments if (node.parent.kind === SyntaxKind.SourceFile || node.pos !== node.parent.pos) { @@ -2373,9 +3577,9 @@ module ts { function emitLeadingDeclarationComments(node: Node) { var leadingComments = getLeadingCommentsToEmit(node); - emitNewLineBeforeLeadingComments(node, leadingComments, writer); + emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - emitComments(leadingComments, /*trailingSeparator*/ true, writer, writeComment); + emitComments(currentSourceFile, writer, leadingComments, /*trailingSeparator*/ true, newLine, writeComment); } function emitTrailingDeclarationComments(node: Node) { @@ -2383,7 +3587,7 @@ module ts { if (node.parent.kind === SyntaxKind.SourceFile || node.end !== node.parent.end) { var trailingComments = getTrailingCommentRanges(currentSourceFile.text, node.end); // trailing comments are emitted at space/*trailing comment1 */space/*trailing comment*/ - emitComments(trailingComments, /*trailingSeparator*/ false, writer, writeComment); + emitComments(currentSourceFile, writer, trailingComments, /*trailingSeparator*/ false, newLine, writeComment); } } @@ -2397,9 +3601,9 @@ module ts { // get the leading comments from the node leadingComments = getLeadingCommentRanges(currentSourceFile.text, pos); } - emitNewLineBeforeLeadingComments({ pos: pos, end: pos }, leadingComments, writer); + emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - emitComments(leadingComments, /*trailingSeparator*/ true, writer, writeComment); + emitComments(currentSourceFile, writer, leadingComments, /*trailingSeparator*/ true, newLine, writeComment); } function emitDetachedCommentsAtPosition(node: TextRange) { @@ -2410,8 +3614,8 @@ module ts { forEach(leadingComments, comment => { if (lastComment) { - var lastCommentLine = getLineOfLocalPosition(lastComment.end); - var commentLine = getLineOfLocalPosition(comment.pos); + var lastCommentLine = getLineOfLocalPosition(currentSourceFile, lastComment.end); + var commentLine = getLineOfLocalPosition(currentSourceFile, comment.pos); if (commentLine >= lastCommentLine + 2) { // There was a blank line between the last comment and this comment. This @@ -2429,12 +3633,12 @@ module ts { // All comments look like they could have been part of the copyright header. Make // sure there is at least one blank line between it and the node. If not, it's not // a copyright header. - var lastCommentLine = getLineOfLocalPosition(detachedComments[detachedComments.length - 1].end); - var astLine = getLineOfLocalPosition(skipTrivia(currentSourceFile.text, node.pos)); + var lastCommentLine = getLineOfLocalPosition(currentSourceFile, detachedComments[detachedComments.length - 1].end); + var astLine = getLineOfLocalPosition(currentSourceFile, skipTrivia(currentSourceFile.text, node.pos)); if (astLine >= lastCommentLine + 2) { // Valid detachedComments - emitNewLineBeforeLeadingComments(node, leadingComments, writer); - emitComments(detachedComments, /*trailingSeparator*/ true, writer, writeComment); + emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); + emitComments(currentSourceFile, writer, detachedComments, /*trailingSeparator*/ true, newLine, writeComment); var currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: detachedComments[detachedComments.length - 1].end }; if (detachedCommentsInfo) { detachedCommentsInfo.push(currentDetachedCommentInfo); @@ -2464,9 +3668,9 @@ module ts { } } - emitNewLineBeforeLeadingComments(node, pinnedComments, writer); + emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, pinnedComments); // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - emitComments(pinnedComments, /*trailingSeparator*/ true, writer, writeComment); + emitComments(currentSourceFile, writer, pinnedComments, /*trailingSeparator*/ true, newLine, writeComment); } if (compilerOptions.sourceMap) { @@ -2488,977 +3692,23 @@ module ts { writeEmittedFiles(writer.getText(), /*writeByteOrderMark*/ compilerOptions.emitBOM); } - function emitDeclarations(jsFilePath: string, root?: SourceFile) { - var writer = createTextWriterWithSymbolWriter(); - var write = writer.write; - var writeLine = writer.writeLine; - var increaseIndent = writer.increaseIndent; - var decreaseIndent = writer.decreaseIndent; - - var enclosingDeclaration: Node; - var reportedDeclarationError = false; - - var emitJsDocComments = compilerOptions.removeComments ? function (declaration: Declaration) { } : writeJsDocComments; - - var aliasDeclarationEmitInfo: { - declaration: ImportDeclaration; - outputPos: number; - indent: number; - asynchronousOutput?: string; // If the output for alias was written asynchronously, the corresponding output - }[] = []; - - var getSymbolVisibilityDiagnosticMessage: (symbolAccesibilityResult: SymbolAccessiblityResult) => { - errorNode: Node; - diagnosticMessage: DiagnosticMessage; - typeName?: DeclarationName - } - - function createTextWriterWithSymbolWriter(): EmitTextWriterWithSymbolWriter { - var writer = createTextWriter(); - writer.trackSymbol = trackSymbol; - writer.writeKeyword = writer.write; - writer.writeOperator = writer.write; - writer.writePunctuation = writer.write; - writer.writeSpace = writer.write; - writer.writeStringLiteral = writer.writeLiteral; - writer.writeParameter = writer.write; - writer.writeSymbol = writer.write; - return writer; - } - - function writeAsychronousImportDeclarations(importDeclarations: ImportDeclaration[]) { - var oldWriter = writer; - forEach(importDeclarations, aliasToWrite => { - var aliasEmitInfo = forEach(aliasDeclarationEmitInfo, declEmitInfo => declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined); - writer = createTextWriterWithSymbolWriter(); - for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) { - writer.increaseIndent(); - } - - writeImportDeclaration(aliasToWrite); - aliasEmitInfo.asynchronousOutput = writer.getText(); - }); - writer = oldWriter; - } - - function trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) { - var symbolAccesibilityResult = resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning); - if (symbolAccesibilityResult.accessibility === SymbolAccessibility.Accessible) { - - // write the aliases - if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) { - writeAsychronousImportDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); - } - } - else { - // Report error - reportedDeclarationError = true; - var errorInfo = getSymbolVisibilityDiagnosticMessage(symbolAccesibilityResult); - if (errorInfo) { - if (errorInfo.typeName) { - diagnostics.push(createDiagnosticForNode(errorInfo.errorNode, - errorInfo.diagnosticMessage, - getSourceTextOfLocalNode(errorInfo.typeName), - symbolAccesibilityResult.errorSymbolName, - symbolAccesibilityResult.errorModuleName)); - } - else { - diagnostics.push(createDiagnosticForNode(errorInfo.errorNode, - errorInfo.diagnosticMessage, - symbolAccesibilityResult.errorSymbolName, - symbolAccesibilityResult.errorModuleName)); - } - } - } - } - - function emitLines(nodes: Node[]) { - for (var i = 0, n = nodes.length; i < n; i++) { - emitNode(nodes[i]); - } - } - - function emitCommaList(nodes: Node[], eachNodeEmitFn: (node: Node) => void) { - var currentWriterPos = writer.getTextPos(); - for (var i = 0, n = nodes.length; i < n; i++) { - if (currentWriterPos !== writer.getTextPos()) { - write(", "); - } - currentWriterPos = writer.getTextPos(); - eachNodeEmitFn(nodes[i]); - } - } - - function writeJsDocComments(declaration: Declaration) { - if (declaration) { - var jsDocComments = getJsDocComments(declaration, currentSourceFile); - emitNewLineBeforeLeadingComments(declaration, jsDocComments, writer); - // jsDoc comments are emitted at /*leading comment1 */space/*leading comment*/space - emitComments(jsDocComments, /*trailingSeparator*/ true, writer, writeCommentRange); - } - } - - function emitSourceTextOfNode(node: Node) { - write(getSourceTextOfLocalNode(node)); - } - - function emitSourceFile(node: SourceFile) { - currentSourceFile = node; - enclosingDeclaration = node; - emitLines(node.statements); - } - - function emitExportAssignment(node: ExportAssignment) { - write("export = "); - emitSourceTextOfNode(node.exportName); - write(";"); - writeLine(); - } - - function emitDeclarationFlags(node: Declaration) { - if (node.flags & NodeFlags.Static) { - if (node.flags & NodeFlags.Private) { - write("private "); - } - else if (node.flags & NodeFlags.Protected) { - write("protected "); - } - write("static "); - } - else { - if (node.flags & NodeFlags.Private) { - write("private "); - } - else if (node.flags & NodeFlags.Protected) { - write("protected "); - } - // If the node is parented in the current source file we need to emit export declare or just export - else if (node.parent === currentSourceFile) { - // If the node is exported - if (node.flags & NodeFlags.Export) { - write("export "); - } - - if (node.kind !== SyntaxKind.InterfaceDeclaration) { - write("declare "); - } - } - } - } - - function emitImportDeclaration(node: ImportDeclaration) { - var nodeEmitInfo = { - declaration: node, - outputPos: writer.getTextPos(), - indent: writer.getIndent(), - hasWritten: resolver.isDeclarationVisible(node) - }; - aliasDeclarationEmitInfo.push(nodeEmitInfo); - if (nodeEmitInfo.hasWritten) { - writeImportDeclaration(node); - } - } - - function writeImportDeclaration(node: ImportDeclaration) { - // note usage of writer. methods instead of aliases created, just to make sure we are using - // correct writer especially to handle asynchronous alias writing - emitJsDocComments(node); - if (node.flags & NodeFlags.Export) { - writer.write("export "); - } - writer.write("import "); - writer.write(getSourceTextOfLocalNode(node.name)); - writer.write(" = "); - if (node.entityName) { - checkEntityNameAccessible(); - writer.write(getSourceTextOfLocalNode(node.entityName)); - writer.write(";"); - } - else { - writer.write("require("); - writer.write(getSourceTextOfLocalNode(node.externalModuleName)); - writer.write(");"); - } - writer.writeLine(); - - function checkEntityNameAccessible() { - var symbolAccesibilityResult = resolver.isImportDeclarationEntityNameReferenceDeclarationVisibile(node.entityName); - if (symbolAccesibilityResult.accessibility === SymbolAccessibility.Accessible) { - // write the aliases - if (symbolAccesibilityResult.aliasesToMakeVisible) { - writeAsychronousImportDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); - } - } - else { - // Report error - reportedDeclarationError = true; - diagnostics.push(createDiagnosticForNode(node, - Diagnostics.Import_declaration_0_is_using_private_name_1, - getSourceTextOfLocalNode(node.name), - symbolAccesibilityResult.errorSymbolName)); - } - } - } - - function emitModuleDeclaration(node: ModuleDeclaration) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - write("module "); - emitSourceTextOfNode(node.name); - while (node.body.kind !== SyntaxKind.ModuleBlock) { - node = node.body; - write("."); - emitSourceTextOfNode(node.name); - } - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - write(" {"); - writeLine(); - increaseIndent(); - emitLines((node.body).statements); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; - } - } - - function emitTypeAliasDeclaration(node: TypeAliasDeclaration) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - write("type "); - emitSourceTextOfNode(node.name); - write(" = "); - getSymbolVisibilityDiagnosticMessage = getTypeAliasDeclarationVisibilityError; - resolver.writeTypeAtLocation(node.type, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); - write(";"); - writeLine(); - } - function getTypeAliasDeclarationVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { - var diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1; - return { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.name - }; - } - } - - function emitEnumDeclaration(node: EnumDeclaration) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - if (isConstEnumDeclaration(node)) { - write("const ") - } - write("enum "); - emitSourceTextOfNode(node.name); - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - } - } - - function emitEnumMemberDeclaration(node: EnumMember) { - emitJsDocComments(node); - emitSourceTextOfNode(node.name); - var enumMemberValue = resolver.getEnumMemberValue(node); - if (enumMemberValue !== undefined) { - write(" = "); - write(enumMemberValue.toString()); - } - write(","); - writeLine(); - } - - function emitTypeParameters(typeParameters: TypeParameterDeclaration[]) { - function emitTypeParameter(node: TypeParameterDeclaration) { - function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { - // Type parameter constraints are named by user so we should always be able to name it - var diagnosticMessage: DiagnosticMessage; - switch (node.parent.kind) { - case SyntaxKind.ClassDeclaration: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; - break; - - case SyntaxKind.InterfaceDeclaration: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; - break; - - case SyntaxKind.ConstructSignature: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - - case SyntaxKind.CallSignature: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - - case SyntaxKind.Method: - if (node.parent.flags & NodeFlags.Static) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; - } - else if (node.parent.parent.kind === SyntaxKind.ClassDeclaration) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; - } - break; - - case SyntaxKind.FunctionDeclaration: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; - break; - - default: - Debug.fail("This is unknown parent for type parameter: " + node.parent.kind); - } - - return { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.name - }; - } - - increaseIndent(); - emitJsDocComments(node); - decreaseIndent(); - emitSourceTextOfNode(node.name); - // If there is constraint present and this is not a type parameter of the private method emit the constraint - if (node.constraint && (node.parent.kind !== SyntaxKind.Method || !(node.parent.flags & NodeFlags.Private))) { - write(" extends "); - getSymbolVisibilityDiagnosticMessage = getTypeParameterConstraintVisibilityError; - resolver.writeTypeAtLocation(node.constraint, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); - } - } - - if (typeParameters) { - write("<"); - emitCommaList(typeParameters, emitTypeParameter); - write(">"); - } - } - - function emitHeritageClause(typeReferences: TypeReferenceNode[], isImplementsList: boolean) { - if (typeReferences) { - write(isImplementsList ? " implements " : " extends "); - emitCommaList(typeReferences, emitTypeOfTypeReference); - } - - function emitTypeOfTypeReference(node: Node) { - getSymbolVisibilityDiagnosticMessage = getHeritageClauseVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, TypeFormatFlags.WriteArrayAsGenericType | TypeFormatFlags.UseTypeOfFunction, writer); - - function getHeritageClauseVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { - var diagnosticMessage: DiagnosticMessage; - // Heritage clause is written by user so it can always be named - if (node.parent.kind === SyntaxKind.ClassDeclaration) { - // Class - if (symbolAccesibilityResult.errorModuleName) { - // Module is inaccessible - diagnosticMessage = isImplementsList ? - Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2; - } - else { - // Class or Interface implemented/extended is inaccessible - diagnosticMessage = isImplementsList ? - Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : - Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; - } - } - else { - if (symbolAccesibilityResult.errorModuleName) { - // Module is inaccessible - diagnosticMessage = Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2; - } - else { - // interface is inaccessible - diagnosticMessage = Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; - } - } - - return { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: (node.parent).name - }; - } - } - } - - function emitClassDeclaration(node: ClassDeclaration) { - function emitParameterProperties(constructorDeclaration: ConstructorDeclaration) { - if (constructorDeclaration) { - forEach(constructorDeclaration.parameters, param => { - if (param.flags & NodeFlags.AccessibilityModifier) { - emitPropertyDeclaration(param); - } - }); - } - } - - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - write("class "); - emitSourceTextOfNode(node.name); - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - emitTypeParameters(node.typeParameters); - if (node.baseType) { - emitHeritageClause([node.baseType], /*isImplementsList*/ false); - } - emitHeritageClause(node.implementedTypes, /*isImplementsList*/ true); - write(" {"); - writeLine(); - increaseIndent(); - emitParameterProperties(getFirstConstructorWithBody(node)); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; - } - } - - function emitInterfaceDeclaration(node: InterfaceDeclaration) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - write("interface "); - emitSourceTextOfNode(node.name); - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - emitTypeParameters(node.typeParameters); - emitHeritageClause(node.baseTypes, /*isImplementsList*/ false); - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; - } - } - - function emitPropertyDeclaration(node: PropertyDeclaration) { - emitJsDocComments(node); - emitDeclarationFlags(node); - emitVariableDeclaration(node); - write(";"); - writeLine(); - } - - // TODO(jfreeman): Factor out common part of property definition, but treat name differently - function emitVariableDeclaration(node: VariableDeclaration) { - // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted - // so there is no check needed to see if declaration is visible - if (node.kind !== SyntaxKind.VariableDeclaration || resolver.isDeclarationVisible(node)) { - emitSourceTextOfNode(node.name); - // If optional property emit ? - if (node.kind === SyntaxKind.Property && (node.flags & NodeFlags.QuestionMark)) { - write("?"); - } - if (!(node.flags & NodeFlags.Private)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getVariableDeclarationTypeVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); - } - } - - function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { - var diagnosticMessage: DiagnosticMessage; - if (node.kind === SyntaxKind.VariableDeclaration) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; - } - // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit - else if (node.kind === SyntaxKind.Property) { - // TODO(jfreeman): Deal with computed properties in error reporting. - if (node.flags & NodeFlags.Static) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; - } - else if (node.parent.kind === SyntaxKind.ClassDeclaration) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; - } - else { - // Interfaces cannot have types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; - } - } - - return diagnosticMessage !== undefined ? { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.name - } : undefined; - } - } - - function emitVariableStatement(node: VariableStatement) { - var hasDeclarationWithEmit = forEach(node.declarations, varDeclaration => resolver.isDeclarationVisible(varDeclaration)); - if (hasDeclarationWithEmit) { - emitJsDocComments(node); - emitDeclarationFlags(node); - if (node.flags & NodeFlags.Let) { - write("let "); - } - else if (node.flags & NodeFlags.Const) { - write("const "); - } - else { - write("var "); - } - emitCommaList(node.declarations, emitVariableDeclaration); - write(";"); - writeLine(); - } - } - - function emitAccessorDeclaration(node: AccessorDeclaration) { - var accessors = getAllAccessorDeclarations(node.parent, node); - if (node === accessors.firstAccessor) { - emitJsDocComments(accessors.getAccessor); - emitJsDocComments(accessors.setAccessor); - emitDeclarationFlags(node); - emitSourceTextOfNode(node.name); - if (!(node.flags & NodeFlags.Private)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getAccessorDeclarationTypeVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); - } - write(";"); - writeLine(); - } - - function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { - var diagnosticMessage: DiagnosticMessage; - if (node.kind === SyntaxKind.SetAccessor) { - // Setters have to have type named and cannot infer it so, the type should always be named - if (node.parent.flags & NodeFlags.Static) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1; - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node.parameters[0], - // TODO(jfreeman): Investigate why we are passing node.name instead of node.parameters[0].name - typeName: node.name - }; - } - else { - if (node.flags & NodeFlags.Static) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0; - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node.name, - typeName: undefined - }; - } - } - } - - function emitFunctionDeclaration(node: FunctionLikeDeclaration) { - // If we are emitting Method/Constructor it isn't moduleElement and hence already determined to be emitting - // so no need to verify if the declaration is visible - if ((node.kind !== SyntaxKind.FunctionDeclaration || resolver.isDeclarationVisible(node)) && - !resolver.isImplementationOfOverload(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - if (node.kind === SyntaxKind.FunctionDeclaration) { - write("function "); - emitSourceTextOfNode(node.name); - } - else if (node.kind === SyntaxKind.Constructor) { - write("constructor"); - } - else { - emitSourceTextOfNode(node.name); - if (node.flags & NodeFlags.QuestionMark) { - write("?"); - } - } - emitSignatureDeclaration(node); - } - } - - function emitConstructSignatureDeclaration(node: SignatureDeclaration) { - emitJsDocComments(node); - write("new "); - emitSignatureDeclaration(node); - } - - function emitSignatureDeclaration(node: SignatureDeclaration) { - if (node.kind === SyntaxKind.CallSignature || node.kind === SyntaxKind.IndexSignature) { - // Only index and call signatures are emitted directly, so emit their js doc comments, rest will do that in their own functions - emitJsDocComments(node); - } - emitTypeParameters(node.typeParameters); - if (node.kind === SyntaxKind.IndexSignature) { - write("["); - } - else { - write("("); - } - - // Parameters - emitCommaList(node.parameters, emitParameterDeclaration); - - if (node.kind === SyntaxKind.IndexSignature) { - write("]"); - } - else { - write(")"); - } - - // If this is not a constructor and is not private, emit the return type - if (node.kind !== SyntaxKind.Constructor && !(node.flags & NodeFlags.Private)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getReturnTypeVisibilityError; - resolver.writeReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); - } - write(";"); - writeLine(); - - function getReturnTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { - var diagnosticMessage: DiagnosticMessage; - switch (node.kind) { - case SyntaxKind.ConstructSignature: - // Interfaces cannot have return types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : - Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; - break; - - case SyntaxKind.CallSignature: - // Interfaces cannot have return types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : - Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; - break; - - case SyntaxKind.IndexSignature: - // Interfaces cannot have return types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : - Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; - break; - - case SyntaxKind.Method: - if (node.flags & NodeFlags.Static) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; - } - else if (node.parent.kind === SyntaxKind.ClassDeclaration) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; - } - else { - // Interfaces cannot have return types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : - Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; - } - break; - - case SyntaxKind.FunctionDeclaration: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : - Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; - break; - - default: - Debug.fail("This is unknown kind for signature: " + node.kind); - } - - return { - diagnosticMessage: diagnosticMessage, - errorNode: node.name || node, - }; - } - } - - function emitParameterDeclaration(node: ParameterDeclaration) { - increaseIndent(); - emitJsDocComments(node); - if (node.flags & NodeFlags.Rest) { - write("..."); - } - emitSourceTextOfNode(node.name); - if (node.initializer || (node.flags & NodeFlags.QuestionMark)) { - write("?"); - } - decreaseIndent(); - - if (!(node.parent.flags & NodeFlags.Private)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getParameterDeclarationTypeVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer); - } - - function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult) { - var diagnosticMessage: DiagnosticMessage; - switch (node.parent.kind) { - case SyntaxKind.Constructor: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - break; - - case SyntaxKind.ConstructSignature: - // Interfaces cannot have parameter types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - - case SyntaxKind.CallSignature: - // Interfaces cannot have parameter types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - - case SyntaxKind.Method: - if (node.parent.flags & NodeFlags.Static) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; - } - else if (node.parent.parent.kind === SyntaxKind.ClassDeclaration) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; - } - else { - // Interfaces cannot have parameter types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; - } - break; - - case SyntaxKind.FunctionDeclaration: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === SymbolAccessibility.CannotBeNamed ? - Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : - Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - break; - - default: - Debug.fail("This is unknown parent for parameter: " + node.parent.kind); - } - - return { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.name - }; - } - } - - function emitNode(node: Node) { - switch (node.kind) { - case SyntaxKind.Constructor: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.Method: - return emitFunctionDeclaration(node); - case SyntaxKind.ConstructSignature: - return emitConstructSignatureDeclaration(node); - case SyntaxKind.CallSignature: - case SyntaxKind.IndexSignature: - return emitSignatureDeclaration(node); - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - return emitAccessorDeclaration(node); - case SyntaxKind.VariableStatement: - return emitVariableStatement(node); - case SyntaxKind.Property: - return emitPropertyDeclaration(node); - case SyntaxKind.InterfaceDeclaration: - return emitInterfaceDeclaration(node); - case SyntaxKind.ClassDeclaration: - return emitClassDeclaration(node); - case SyntaxKind.TypeAliasDeclaration: - return emitTypeAliasDeclaration(node); - case SyntaxKind.EnumMember: - return emitEnumMemberDeclaration(node); - case SyntaxKind.EnumDeclaration: - return emitEnumDeclaration(node); - case SyntaxKind.ModuleDeclaration: - return emitModuleDeclaration(node); - case SyntaxKind.ImportDeclaration: - return emitImportDeclaration(node); - case SyntaxKind.ExportAssignment: - return emitExportAssignment(node); - case SyntaxKind.SourceFile: - return emitSourceFile(node); - } - } - - function tryResolveScriptReference(sourceFile: SourceFile, reference: FileReference) { - var referenceFileName = normalizePath(combinePaths(getDirectoryPath(sourceFile.filename), reference.filename)); - return program.getSourceFile(referenceFileName); - } - - // Contains the reference paths that needs to go in the declaration file. - // Collecting this separately because reference paths need to be first thing in the declaration file - // and we could be collecting these paths from multiple files into single one with --out option - var referencePathsOutput = ""; - function writeReferencePath(referencedFile: SourceFile) { - var declFileName = referencedFile.flags & NodeFlags.DeclarationFile - ? referencedFile.filename // Declaration file, use declaration file name - : shouldEmitToOwnFile(referencedFile, compilerOptions) - ? getOwnEmitOutputFilePath(referencedFile, ".d.ts") // Own output file so get the .d.ts file - : removeFileExtension(compilerOptions.out) + ".d.ts";// Global out file - - declFileName = getRelativePathToDirectoryOrUrl( - getDirectoryPath(normalizeSlashes(jsFilePath)), - declFileName, - compilerHost.getCurrentDirectory(), - compilerHost.getCanonicalFileName, - /*isAbsolutePathAnUrl*/ false); - - referencePathsOutput += "/// " + newLine; - } - - if (root) { - // Emitting just a single file, so emit references in this file only - if (!compilerOptions.noResolve) { - var addedGlobalFileReference = false; - forEach(root.referencedFiles, fileReference => { - var referencedFile = tryResolveScriptReference(root, fileReference); - - // All the references that are not going to be part of same file - if (referencedFile && ((referencedFile.flags & NodeFlags.DeclarationFile) || // This is a declare file reference - shouldEmitToOwnFile(referencedFile, compilerOptions) || // This is referenced file is emitting its own js file - !addedGlobalFileReference)) { // Or the global out file corresponding to this reference was not added - - writeReferencePath(referencedFile); - if (!isExternalModuleOrDeclarationFile(referencedFile)) { - addedGlobalFileReference = true; - } - } - }); - } - - emitNode(root); - } - else { - // Emit references corresponding to this file - var emittedReferencedFiles: SourceFile[] = []; - forEach(program.getSourceFiles(), sourceFile => { - if (!isExternalModuleOrDeclarationFile(sourceFile)) { - // Check what references need to be added - if (!compilerOptions.noResolve) { - forEach(sourceFile.referencedFiles, fileReference => { - var referencedFile = tryResolveScriptReference(sourceFile, fileReference); - - // If the reference file is a declaration file or an external module, emit that reference - if (referencedFile && (isExternalModuleOrDeclarationFile(referencedFile) && - !contains(emittedReferencedFiles, referencedFile))) { // If the file reference was not already emitted - - writeReferencePath(referencedFile); - emittedReferencedFiles.push(referencedFile); - } - }); - } - - emitNode(sourceFile); - } - }); - } - + function writeDeclarationFile(jsFilePath: string, sourceFile: SourceFile) { + var emitDeclarationResult = emitDeclarations(program, resolver, diagnostics, jsFilePath, sourceFile); // TODO(shkamat): Should we not write any declaration file if any of them can produce error, // or should we just not write this file like we are doing now - if (!reportedDeclarationError) { - var declarationOutput = referencePathsOutput; - var synchronousDeclarationOutput = writer.getText(); + if (!emitDeclarationResult.reportedDeclarationError) { + var declarationOutput = emitDeclarationResult.referencePathsOutput; // apply additions var appliedSyncOutputPos = 0; - forEach(aliasDeclarationEmitInfo, aliasEmitInfo => { + forEach(emitDeclarationResult.aliasDeclarationEmitInfo, aliasEmitInfo => { if (aliasEmitInfo.asynchronousOutput) { - declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos, aliasEmitInfo.outputPos); + declarationOutput += emitDeclarationResult.synchronousDeclarationOutput.substring(appliedSyncOutputPos, aliasEmitInfo.outputPos); declarationOutput += aliasEmitInfo.asynchronousOutput; appliedSyncOutputPos = aliasEmitInfo.outputPos; } }); - declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos); - writeFile(removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, compilerOptions.emitBOM); + declarationOutput += emitDeclarationResult.synchronousDeclarationOutput.substring(appliedSyncOutputPos); + writeFile(compilerHost, diagnostics, removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, compilerOptions.emitBOM); } } @@ -3469,7 +3719,7 @@ module ts { if (!isEmitBlocked) { emitJavaScript(jsFilePath, sourceFile); if (!hasSemanticErrors && compilerOptions.declaration) { - emitDeclarations(jsFilePath, sourceFile); + writeDeclarationFile(jsFilePath, sourceFile); } } } @@ -3478,7 +3728,7 @@ module ts { // No targetSourceFile is specified (e.g. calling emitter from batch compiler) forEach(program.getSourceFiles(), sourceFile => { if (shouldEmitToOwnFile(sourceFile, compilerOptions)) { - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, ".js"); + var jsFilePath = getOwnEmitOutputFilePath(sourceFile, program, ".js"); emitFile(jsFilePath, sourceFile); } }); @@ -3491,7 +3741,7 @@ module ts { // targetSourceFile is specified (e.g calling emitter from language service or calling getSemanticDiagnostic from language service) if (shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { // If shouldEmitToOwnFile returns true or targetSourceFile is an external module file, then emit targetSourceFile in its own output file - var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, ".js"); + var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, program, ".js"); emitFile(jsFilePath, targetSourceFile); } else if (!isDeclarationFile(targetSourceFile) && compilerOptions.out) { @@ -3509,22 +3759,22 @@ module ts { var hasEmitterError = forEach(diagnostics, diagnostic => diagnostic.category === DiagnosticCategory.Error); // Check and update returnCode for syntactic and semantic - var returnCode: EmitReturnStatus; + var emitResultStatus: EmitReturnStatus; if (isEmitBlocked) { - returnCode = EmitReturnStatus.AllOutputGenerationSkipped; + emitResultStatus = EmitReturnStatus.AllOutputGenerationSkipped; } else if (hasEmitterError) { - returnCode = EmitReturnStatus.EmitErrorsEncountered; + emitResultStatus = EmitReturnStatus.EmitErrorsEncountered; } else if (hasSemanticErrors && compilerOptions.declaration) { - returnCode = EmitReturnStatus.DeclarationGenerationSkipped; + emitResultStatus = EmitReturnStatus.DeclarationGenerationSkipped; } else if (hasSemanticErrors && !compilerOptions.declaration) { - returnCode = EmitReturnStatus.JSGeneratedWithSemanticErrors; + emitResultStatus = EmitReturnStatus.JSGeneratedWithSemanticErrors; } else { - returnCode = EmitReturnStatus.Succeeded; + emitResultStatus = EmitReturnStatus.Succeeded; } return { - emitResultStatus: returnCode, - errors: diagnostics, + emitResultStatus, + diagnostics, sourceMaps: sourceMapDataList }; } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 036fe6f3b9c..268466efe1c 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -20,6 +20,7 @@ module ts { interface ReferenceComments { referencedFiles: FileReference[]; amdDependencies: string[]; + amdModuleName: string; } export function getSourceFileOfNode(node: Node): SourceFile { @@ -47,13 +48,17 @@ module ts { return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); } + export function getSourceTextOfNodeFromSourceFile(sourceFile: SourceFile, node: Node): string { + var text = sourceFile.text; + return text.substring(skipTrivia(text, node.pos), node.end); + } + export function getTextOfNodeFromSourceText(sourceText: string, node: Node): string { return sourceText.substring(skipTrivia(sourceText, node.pos), node.end); } export function getTextOfNode(node: Node): string { - var text = getSourceFileOfNode(node).text; - return text.substring(skipTrivia(text, node.pos), node.end); + return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(node), node); } // Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' @@ -120,8 +125,16 @@ module ts { return (file.flags & NodeFlags.DeclarationFile) !== 0; } - export function isConstEnumDeclaration(node: EnumDeclaration): boolean { - return (node.flags & NodeFlags.Const) !== 0; + export function isConstEnumDeclaration(node: Declaration): boolean { + return node.kind === SyntaxKind.EnumDeclaration && isConst(node); + } + + export function isConst(node: Declaration): boolean { + return !!(node.flags & NodeFlags.Const); + } + + export function isLet(node: Declaration): boolean { + return !!(node.flags & NodeFlags.Let); } export function isPrologueDirective(node: Node): boolean { @@ -202,6 +215,7 @@ module ts { child((node).initializer); case SyntaxKind.Property: case SyntaxKind.PropertyAssignment: + case SyntaxKind.ShorthandPropertyAssignment: return child((node).name) || child((node).type) || child((node).initializer); @@ -301,7 +315,7 @@ module ts { child((node).iterator) || child((node).statement); case SyntaxKind.ForInStatement: - return child((node).declaration) || + return children((node).declarations) || child((node).variable) || child((node).expression) || child((node).statement); @@ -473,6 +487,15 @@ module ts { } } + export function getInvokedExpression(node: CallLikeExpression): Expression { + if (node.kind === SyntaxKind.TaggedTemplateExpression) { + return (node).tag; + } + + // Will either be a CallExpression or NewExpression. + return (node).func; + } + export function isExpression(node: Node): boolean { switch (node.kind) { case SyntaxKind.ThisKeyword: @@ -580,6 +603,7 @@ module ts { case SyntaxKind.VariableDeclaration: case SyntaxKind.Property: case SyntaxKind.PropertyAssignment: + case SyntaxKind.ShorthandPropertyAssignment: case SyntaxKind.EnumMember: case SyntaxKind.Method: case SyntaxKind.FunctionDeclaration: @@ -640,6 +664,14 @@ module ts { return false; } + export function tryResolveScriptReference(program: Program, sourceFile: SourceFile, reference: FileReference) { + if (!program.getCompilerOptions().noResolve) { + var referenceFileName = isRootedDiskPath(reference.filename) ? reference.filename : combinePaths(getDirectoryPath(sourceFile.filename), reference.filename); + referenceFileName = getNormalizedAbsolutePath(referenceFileName, program.getCompilerHost().getCurrentDirectory()); + return program.getSourceFile(referenceFileName); + } + } + export function getAncestor(node: Node, kind: SyntaxKind): Node { switch (kind) { // special-cases that can be come first @@ -729,29 +761,6 @@ module ts { Error } - const enum ModifierContext { - SourceElements, // Top level elements in a source file - ModuleElements, // Elements in module declaration - ClassMembers, // Members in class declaration - Parameters, // Parameters in parameter list - } - - // Tracks whether we nested (directly or indirectly) in a certain control block. - // Used for validating break and continue statements. - const enum ControlBlockContext { - NotNested, - Nested, - CrossingFunctionBoundary - } - - interface LabelledStatementInfo { - addLabel(label: Identifier): void; - pushCurrentLabelSet(isIterationStatement: boolean): void; - pushFunctionBoundary(): void; - pop(): void; - nodeIsNestedInLabel(label: Identifier, requireIterationStatement: boolean, stopAtFunctionBoundary: boolean): ControlBlockContext; - } - export interface ReferencePathMatchResult { fileReference?: FileReference diagnostic?: DiagnosticMessage @@ -772,13 +781,12 @@ module ts { if (matchResult) { var start = commentRange.pos; var end = commentRange.end; - var fileRef = { - pos: start, - end: end, - filename: matchResult[3] - }; return { - fileReference: fileRef, + fileReference: { + pos: start, + end: end, + filename: matchResult[3] + }, isNoDefaultLib: false }; } @@ -802,7 +810,7 @@ module ts { } export function isUnterminatedTemplateEnd(node: LiteralExpression) { - Debug.assert(node.kind === SyntaxKind.NoSubstitutionTemplateLiteral || node.kind === SyntaxKind.TemplateTail); + Debug.assert(isTemplateLiteralKind(node.kind)); var sourceText = getSourceFileOfNode(node).text; // If we're not at the EOF, we know we must be terminated. @@ -810,6 +818,11 @@ module ts { return false; } + // The literal can only be unterminated if it is a template tail or a no-sub template. + if (node.kind !== SyntaxKind.TemplateTail && node.kind !== SyntaxKind.NoSubstitutionTemplateLiteral) { + return false; + } + // If we didn't end in a backtick, we must still be in the middle of a template. // If we did, make sure that it's not the *initial* backtick. return sourceText.charCodeAt(node.end - 1) !== CharacterCodes.backtick || node.text.length === 0; @@ -828,6 +841,18 @@ module ts { return false; } + function modifierToFlag(token: SyntaxKind): NodeFlags { + switch (token) { + case SyntaxKind.StaticKeyword: return NodeFlags.Static; + case SyntaxKind.PublicKeyword: return NodeFlags.Public; + case SyntaxKind.ProtectedKeyword: return NodeFlags.Protected; + case SyntaxKind.PrivateKeyword: return NodeFlags.Private; + case SyntaxKind.ExportKeyword: return NodeFlags.Export; + case SyntaxKind.DeclareKeyword: return NodeFlags.Ambient; + } + return 0; + } + export function createSourceFile(filename: string, sourceText: string, languageVersion: ScriptTarget, version: string, isOpen: boolean = false): SourceFile { var file: SourceFile; var scanner: Scanner; @@ -838,117 +863,142 @@ module ts { var identifierCount = 0; var nodeCount = 0; var lineStarts: number[]; - var isInStrictMode = false; var lookAheadMode = LookAheadMode.NotLookingAhead; - var inAmbientContext = false; - var inFunctionBody = false; - var inSwitchStatement = ControlBlockContext.NotNested; - var inIterationStatement = ControlBlockContext.NotNested; - // The following is a state machine that tracks what labels are in our current parsing - // context. So if we are parsing a node that is nested (arbitrarily deeply) in a label, - // it will be tracked in this data structure. It is used for checking break/continue - // statements, and checking for duplicate labels. - var labelledStatementInfo: LabelledStatementInfo = (() => { - // These are initialized on demand because labels are rare, so it is usually - // not even necessary to allocate these. - var functionBoundarySentinel: StringSet; - var currentLabelSet: StringSet; - var labelSetStack: StringSet[]; - var isIterationStack: boolean[]; + // Flags that dictate what parsing context we're in. For example: + // Whether or not we are in strict parsing mode. All that changes in strict parsing mode is + // that some tokens that would be considered identifiers may be considered keywords. When + // rewinding, we need to store and restore this as the mode may have changed. + // + // When adding more parser context flags, consider which is the more common case that the + // flag will be in. This should be hte 'false' state for that flag. The reason for this is + // that we don't store data in our nodes unless the value is in the *non-default* state. So, + // for example, more often than code 'allows-in' (or doesn't 'disallow-in'). We opt for + // 'disallow-in' set to 'false'. Otherwise, if we had 'allowsIn' set to 'true', then almost + // all nodes would need extra state on them to store this info. + // + // Note: 'allowIn' and 'allowYield' track 1:1 with the [in] and [yield] concepts in the ES6 + // grammar specification. + // + // An important thing about these context concepts. By default they are effectively inherited + // while parsing through every grammar production. i.e. if you don't change them, then when + // you parse a sub-production, it will have the same context values as hte parent production. + // This is great most of the time. After all, consider all the 'expression' grammar productions + // and how nearly all of them pass along the 'in' and 'yield' context values: + // + // EqualityExpression[In, Yield] : + // RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] == RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] != RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] === RelationalExpression[?In, ?Yield] + // EqualityExpression[?In, ?Yield] !== RelationalExpression[?In, ?Yield] + // + // Where you have to be careful is then understanding what the points are in the grammar + // where the values are *not* passed along. For example: + // + // SingleNameBinding[Yield,GeneratorParameter] + // [+GeneratorParameter]BindingIdentifier[Yield] Initializer[In]opt + // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt + // + // Here this is saying that if the GeneratorParameter context flag is set, that we should + // explicitly set the 'yield' context flag to false before calling into the BindingIdentifier + // and we should explicitly unset the 'yield' context flag before calling into the Initializer. + // production. Conversely, if the GeneratorParameter context flag is not set, then we + // should leave the 'yield' context flag alone. + // + // Getting this all correct is tricky and requires careful reading of the grammar to + // understand when these values should be changed versus when they should be inherited. + var contextFlags: ParserContextFlags = 0; - function addLabel(label: Identifier): void { - if (!currentLabelSet) { - currentLabelSet = {}; - } - currentLabelSet[label.text] = true; + function setContextFlag(val: Boolean, flag: ParserContextFlags) { + if (val) { + contextFlags |= flag; + } + else { + contextFlags &= ~flag; + } + } + + function setStrictModeContext(val: boolean) { + setContextFlag(val, ParserContextFlags.StrictMode); + } + + function setDisallowInContext(val: boolean) { + setContextFlag(val, ParserContextFlags.DisallowIn); + } + + function setYieldContext(val: boolean) { + setContextFlag(val, ParserContextFlags.Yield); + } + + function setGeneratorParameterContext(val: boolean) { + setContextFlag(val, ParserContextFlags.GeneratorParameter); + } + + function allowInAnd(func: () => T): T { + if (contextFlags & ParserContextFlags.DisallowIn) { + setDisallowInContext(false); + var result = func(); + setDisallowInContext(true); + return result; + } + + // no need to do anything special if 'in' is already allowed. + return func(); + } + + function disallowInAnd(func: () => T): T { + if (contextFlags & ParserContextFlags.DisallowIn) { + // no need to do anything special if 'in' is already disallowed. + return func(); } - function pushCurrentLabelSet(isIterationStatement: boolean): void { - if (!labelSetStack && !isIterationStack) { - labelSetStack = []; - isIterationStack = []; - } - Debug.assert(currentLabelSet !== undefined); - labelSetStack.push(currentLabelSet); - isIterationStack.push(isIterationStatement); - currentLabelSet = undefined; + setDisallowInContext(true); + var result = func(); + setDisallowInContext(false); + return result; + } + + function doInYieldContext(func: () => T): T { + if (contextFlags & ParserContextFlags.Yield) { + // no need to do anything special if we're already in the [Yield] context. + return func(); } - function pushFunctionBoundary(): void { - if (!functionBoundarySentinel) { - functionBoundarySentinel = {}; - if (!labelSetStack && !isIterationStack) { - labelSetStack = []; - isIterationStack = []; - } - } - Debug.assert(currentLabelSet === undefined); - labelSetStack.push(functionBoundarySentinel); + setYieldContext(true); + var result = func(); + setYieldContext(false); + return result; + } - // It does not matter what we push here, since we will never ask if a function boundary - // is an iteration statement - isIterationStack.push(false); + function doOutsideOfYieldContext(func: () => T): T { + if (contextFlags & ParserContextFlags.Yield) { + setYieldContext(false); + var result = func(); + setYieldContext(true); + return result; } - function pop(): void { - // Assert that we are in a "pushed" state - Debug.assert(labelSetStack.length && isIterationStack.length && currentLabelSet === undefined); - labelSetStack.pop(); - isIterationStack.pop(); - } + // no need to do anything special if we're not in the [Yield] context. + return func(); + } - function nodeIsNestedInLabel(label: Identifier, requireIterationStatement: boolean, stopAtFunctionBoundary: boolean): ControlBlockContext { - if (!requireIterationStatement && currentLabelSet && hasProperty(currentLabelSet, label.text)) { - return ControlBlockContext.Nested; - } + function inYieldContext() { + return (contextFlags & ParserContextFlags.Yield) !== 0; + } - if (!labelSetStack) { - return ControlBlockContext.NotNested; - } + function inStrictModeContext() { + return (contextFlags & ParserContextFlags.StrictMode) !== 0; + } - // We want to start searching for the label at the lowest point in the tree, - // and climb up from there. So we start at the end of the labelSetStack array. - var crossedFunctionBoundary = false; - for (var i = labelSetStack.length - 1; i >= 0; i--) { - var labelSet = labelSetStack[i]; - // Not allowed to cross function boundaries, so stop if we encounter one - if (labelSet === functionBoundarySentinel) { - if (stopAtFunctionBoundary) { - break; - } - else { - crossedFunctionBoundary = true; - continue; - } - } - - // If we require an iteration statement, only search in the current - // statement if it is an iteration statement - if (requireIterationStatement && isIterationStack[i] === false) { - continue; - } + function inGeneratorParameterContext() { + return (contextFlags & ParserContextFlags.GeneratorParameter) !== 0; + } - if (hasProperty(labelSet, label.text)) { - return crossedFunctionBoundary ? ControlBlockContext.CrossingFunctionBoundary : ControlBlockContext.Nested; - } - } - - // This is a bit of a misnomer. If the caller passed true for stopAtFunctionBoundary, - // there actually may be an enclosing label across a function boundary, but we will - // just return NotNested - return ControlBlockContext.NotNested; - } - - return { - addLabel: addLabel, - pushCurrentLabelSet: pushCurrentLabelSet, - pushFunctionBoundary: pushFunctionBoundary, - pop: pop, - nodeIsNestedInLabel: nodeIsNestedInLabel, - }; - })(); + function inDisallowInContext() { + return (contextFlags & ParserContextFlags.DisallowIn) !== 0; + } function getLineStarts(): number[] { return lineStarts || (lineStarts = computeLineStarts(sourceText)); @@ -969,42 +1019,14 @@ module ts { errorAtPos(start, length, message, arg0, arg1, arg2); } - // This is just like createDiagnosticForNode except that it uses the current file - // being parsed instead of the file containing the node. This is because during - // parse, the nodes do not have parent pointers to get to the file. - // - // It is very intentional that we are not checking or changing the lookAheadMode value - // here. 'grammarErrorOnNode' is called when we are doing extra grammar checks and not - // when we are doing the actual parsing to determine what the user wrote. In other - // words, this function is called once we have already parsed the node, and are just - // applying some stricter checks on that node. - function grammarErrorOnNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): void { - var span = getErrorSpanForNode(node); - var start = span.end > span.pos ? skipTrivia(file.text, span.pos) : span.pos; - var length = span.end - start; - - file.syntacticErrors.push(createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - } - - function reportInvalidUseInStrictMode(node: Identifier): void { - // declarationNameToString cannot be used here since it uses a backreference to 'parent' that is not yet set - var name = sourceText.substring(skipTrivia(sourceText, node.pos), node.end); - grammarErrorOnNode(node, Diagnostics.Invalid_use_of_0_in_strict_mode, name); - } - - - function grammarErrorAtPos(start: number, length: number, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): void { - file.syntacticErrors.push(createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - } - function errorAtPos(start: number, length: number, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): void { - var lastErrorPos = file.syntacticErrors.length - ? file.syntacticErrors[file.syntacticErrors.length - 1].start + var lastErrorPos = file.parseDiagnostics.length + ? file.parseDiagnostics[file.parseDiagnostics.length - 1].start : -1; if (start !== lastErrorPos) { var diagnostic = createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); diagnostic.isParseError = true; - file.syntacticErrors.push(diagnostic); + file.parseDiagnostics.push(diagnostic); } if (lookAheadMode === LookAheadMode.NoErrorYet) { @@ -1053,7 +1075,7 @@ module ts { // Keep track of the state we'll need to rollback to if lookahead fails (or if the // caller asked us to always reset our state). var saveToken = token; - var saveSyntacticErrorsLength = file.syntacticErrors.length; + var saveSyntacticErrorsLength = file.parseDiagnostics.length; // Keep track of the current look ahead mode (this matters if we have nested // speculative parsing). @@ -1075,7 +1097,7 @@ module ts { lookAheadMode = saveLookAheadMode; if (!result || alwaysResetState) { token = saveToken; - file.syntacticErrors.length = saveSyntacticErrorsLength; + file.parseDiagnostics.length = saveSyntacticErrorsLength; } return result; @@ -1103,7 +1125,17 @@ module ts { } function isIdentifier(): boolean { - return token === SyntaxKind.Identifier || (isInStrictMode ? token > SyntaxKind.LastFutureReservedWord : token > SyntaxKind.LastReservedWord); + if (token === SyntaxKind.Identifier) { + return true; + } + + // If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is + // considered a keyword and is not an identifier. + if (token === SyntaxKind.YieldKeyword && inYieldContext()) { + return false; + } + + return inStrictModeContext() ? token > SyntaxKind.LastFutureReservedWord : token > SyntaxKind.LastReservedWord; } function parseExpected(t: SyntaxKind): boolean { @@ -1148,7 +1180,10 @@ module ts { function createNode(kind: SyntaxKind, pos?: number): Node { nodeCount++; var node = new (nodeConstructors[kind] || (nodeConstructors[kind] = objectAllocator.getNodeConstructor(kind)))(); - if (!(pos >= 0)) pos = scanner.getStartPos(); + if (!(pos >= 0)) { + pos = scanner.getStartPos(); + } + node.pos = pos; node.end = pos; return node; @@ -1156,11 +1191,16 @@ module ts { function finishNode(node: T): T { node.end = scanner.getStartPos(); + + if (contextFlags) { + node.parserContextFlags = contextFlags; + } + return node; } - function createMissingNode(): Node { - return createNode(SyntaxKind.Missing); + function createMissingNode(pos?: number): Node { + return createNode(SyntaxKind.Missing, pos); } function internIdentifier(text: string): string { @@ -1216,7 +1256,7 @@ module ts { function parseAnyContextualModifier(): boolean { return isModifier(token) && tryParse(() => { nextToken(); - return token === SyntaxKind.OpenBracketToken || isPropertyName(); + return token === SyntaxKind.OpenBracketToken || token === SyntaxKind.AsteriskToken || isPropertyName(); }); } @@ -1236,8 +1276,9 @@ module ts { case ParsingContext.ClassMembers: return lookAhead(isClassMemberStart); case ParsingContext.EnumMembers: - case ParsingContext.ObjectLiteralMembers: return isPropertyName(); + case ParsingContext.ObjectLiteralMembers: + return token === SyntaxKind.AsteriskToken || isPropertyName(); case ParsingContext.BaseTypeReferences: return isIdentifier() && ((token !== SyntaxKind.ExtendsKeyword && token !== SyntaxKind.ImplementsKeyword) || !lookAhead(() => (nextToken(), isIdentifier()))); case ParsingContext.VariableDeclarations: @@ -1341,16 +1382,16 @@ module ts { parsingContext |= 1 << kind; var result = >[]; result.pos = getNodePos(); - var saveIsInStrictMode = isInStrictMode; + var savedStrictModeContext = inStrictModeContext(); while (!isListTerminator(kind)) { if (isListElement(kind, /* inErrorRecovery */ false)) { var element = parseElement(); result.push(element); // test elements only if we are not already in strict mode - if (!isInStrictMode && checkForStrictMode) { + if (!inStrictModeContext() && checkForStrictMode) { if (isPrologueDirective(element)) { if (isUseStrictPrologueDirective(element)) { - isInStrictMode = true; + setStrictModeContext(true); checkForStrictMode = false; } } @@ -1367,21 +1408,19 @@ module ts { nextToken(); } } - isInStrictMode = saveIsInStrictMode; + setStrictModeContext(savedStrictModeContext); result.end = getNodeEnd(); parsingContext = saveParsingContext; return result; } // Parses a comma-delimited list of elements - function parseDelimitedList(kind: ParsingContext, parseElement: () => T, allowTrailingComma: boolean): NodeArray { + function parseDelimitedList(kind: ParsingContext, parseElement: () => T): NodeArray { var saveParsingContext = parsingContext; parsingContext |= 1 << kind; var result = >[]; result.pos = getNodePos(); - // Keep track of how many errors we had before the list started. If we don't see any new - // errors resulting from the list being malformed, we are free to complain about a trailing comma. - var errorCountBeforeParsingList = file.syntacticErrors.length; + var commaStart = -1; // Meaning the previous token was not a comma while (true) { if (isListElement(kind, /* inErrorRecovery */ false)) { @@ -1414,12 +1453,6 @@ module ts { // was a trailing comma. // Check if the last token was a comma. if (commaStart >= 0) { - if (!allowTrailingComma) { - if (file.syntacticErrors.length === errorCountBeforeParsingList) { - // Report a grammar error so we don't affect lookahead - grammarErrorAtPos(commaStart, scanner.getStartPos() - commaStart, Diagnostics.Trailing_comma_not_allowed); - } - } // Always preserve a trailing comma by marking it on the NodeArray result.hasTrailingComma = true; } @@ -1437,19 +1470,13 @@ module ts { return result; } - function createNodeArray(node: T): NodeArray { - var result = >[node]; - result.pos = node.pos; - result.end = node.end; - return result; - } - - function parseBracketedList(kind: ParsingContext, parseElement: () => T, startToken: SyntaxKind, endToken: SyntaxKind): NodeArray { - if (parseExpected(startToken)) { - var result = parseDelimitedList(kind, parseElement, /*allowTrailingComma*/ false); - parseExpected(endToken); + function parseBracketedList(kind: ParsingContext, parseElement: () => T, open: SyntaxKind, close: SyntaxKind): NodeArray { + if (parseExpected(open)) { + var result = parseDelimitedList(kind, parseElement); + parseExpected(close); return result; } + return createMissingList(); } @@ -1493,7 +1520,7 @@ module ts { function parseTemplateSpan(): TemplateSpan { var span = createNode(SyntaxKind.TemplateSpan); - span.expression = parseExpression(/*noIn*/ false); + span.expression = allowInAnd(parseExpression); var literal: LiteralExpression; @@ -1531,12 +1558,7 @@ module ts { && sourceText.charCodeAt(tokenPos) === CharacterCodes._0 && isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { - if (isInStrictMode) { - grammarErrorOnNode(node, Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); - } - else if (languageVersion >= ScriptTarget.ES5) { - grammarErrorOnNode(node, Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); - } + node.flags |= NodeFlags.OctalLiteral; } return node; @@ -1587,8 +1609,7 @@ module ts { // // // We do *not* want to consume the > as we're consuming the expression for "". - var expr = parseUnaryExpression(); - grammarErrorOnNode(expr, Diagnostics.Type_expected); + node.expression = parseUnaryExpression(); } } @@ -1597,32 +1618,45 @@ module ts { function parseTypeParameters(): NodeArray { if (token === SyntaxKind.LessThanToken) { - var pos = getNodePos(); - var result = parseBracketedList(ParsingContext.TypeParameters, parseTypeParameter, SyntaxKind.LessThanToken, SyntaxKind.GreaterThanToken); - if (!result.length) { - var start = getTokenPos(pos); - var length = getNodePos() - start; - errorAtPos(start, length, Diagnostics.Type_parameter_list_cannot_be_empty); - } - return result; + return parseBracketedList(ParsingContext.TypeParameters, parseTypeParameter, SyntaxKind.LessThanToken, SyntaxKind.GreaterThanToken); } } function parseParameterType(): TypeNode { - return parseOptional(SyntaxKind.ColonToken) ? token === SyntaxKind.StringLiteral ? parseStringLiteral() : parseType() : undefined; + return parseOptional(SyntaxKind.ColonToken) + ? token === SyntaxKind.StringLiteral + ? parseStringLiteral() + : parseType() + : undefined; } function isStartOfParameter(): boolean { return token === SyntaxKind.DotDotDotToken || isIdentifier() || isModifier(token); } - function parseParameter(flags: NodeFlags = 0): ParameterDeclaration { + function setModifiers(node: Node, modifiers: ModifiersArray) { + if (modifiers) { + node.flags |= modifiers.flags; + node.modifiers = modifiers; + } + } + + function parseParameter(): ParameterDeclaration { var node = createNode(SyntaxKind.Parameter); - node.flags |= parseAndCheckModifiers(ModifierContext.Parameters); + var modifiers = parseModifiers(); + setModifiers(node, modifiers); if (parseOptional(SyntaxKind.DotDotDotToken)) { node.flags |= NodeFlags.Rest; } - node.name = parseIdentifier(); + + // SingleNameBinding[Yield,GeneratorParameter] : See 13.2.3 + // [+GeneratorParameter]BindingIdentifier[Yield]Initializer[In]opt + // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt + + node.name = inGeneratorParameterContext() + ? doInYieldContext(parseIdentifier) + : parseIdentifier(); + if (node.name.kind === SyntaxKind.Missing && node.flags === 0 && isModifier(token)) { // in cases like // 'use strict' @@ -1639,7 +1673,9 @@ module ts { node.flags |= NodeFlags.QuestionMark; } node.type = parseParameterType(); - node.initializer = parseInitializer(/*inParameter*/ true); + node.initializer = inGeneratorParameterContext() + ? doOutsideOfYieldContext(parseParameterInitializer) + : parseParameterInitializer(); // Do not check for initializers in an ambient context for parameters. This is not // a grammar error because the grammar allows arbitrary call signatures in @@ -1652,172 +1688,120 @@ module ts { return finishNode(node); } - function parseSignature(kind: SyntaxKind, returnToken: SyntaxKind, returnTokenRequired: boolean): ParsedSignature { + function parseParameterInitializer() { + return parseInitializer(/*inParameter*/ true); + } + + function parseSignature(kind: SyntaxKind, returnToken: SyntaxKind, returnTokenRequired: boolean, yieldAndGeneratorParameterContext: boolean): ParsedSignature { + var signature = {}; + fillSignature(kind, returnToken, returnTokenRequired, yieldAndGeneratorParameterContext, signature); + return signature; + } + + function fillSignature( + kind: SyntaxKind, + returnToken: SyntaxKind, + returnTokenRequired: boolean, + yieldAndGeneratorParameterContext: boolean, + signature: ParsedSignature): void { + if (kind === SyntaxKind.ConstructSignature) { parseExpected(SyntaxKind.NewKeyword); } - var typeParameters = parseTypeParameters(); - var parameters = parseParameterList(SyntaxKind.OpenParenToken, SyntaxKind.CloseParenToken); - checkParameterList(parameters); - - var type: TypeNode; + signature.typeParameters = parseTypeParameters(); + signature.parameters = parseParameterList(yieldAndGeneratorParameterContext); if (returnTokenRequired) { parseExpected(returnToken); - type = parseType(); + signature.type = parseType(); } - else if (parseOptional(returnToken)) - { - type = parseType(); + else if (parseOptional(returnToken)) { + signature.type = parseType(); } - - return { - typeParameters: typeParameters, - parameters: parameters, - type: type - }; } - // Because we use this for index signatures as well, we sometimes use - // parentheses, and sometimes use brackets. - function parseParameterList(startDelimiter: SyntaxKind, endDelimiter: SyntaxKind) { - return parseBracketedList(ParsingContext.Parameters, parseParameter, startDelimiter, endDelimiter); - } + // Note: after careful analysis of the grammar, it does not appear to be possible to + // have 'Yield' And 'GeneratorParameter' not in sync. i.e. any production calling + // this FormalParameters production either always sets both to true, or always sets + // both to false. As such we only have a single parameter to represent both. + function parseParameterList(yieldAndGeneratorParameterContext: boolean) { + // FormalParameters[Yield,GeneratorParameter] : + // ... + // + // FormalParameter[Yield,GeneratorParameter] : + // BindingElement[?Yield, ?GeneratorParameter] + // + // BindingElement[Yield, GeneratorParameter ] : See 13.2.3 + // SingleNameBinding[?Yield, ?GeneratorParameter] + // [+GeneratorParameter]BindingPattern[?Yield, GeneratorParameter]Initializer[In]opt + // [~GeneratorParameter]BindingPattern[?Yield]Initializer[In, ?Yield]opt + // + // SingleNameBinding[Yield, GeneratorParameter] : See 13.2.3 + // [+GeneratorParameter]BindingIdentifier[Yield]Initializer[In]opt + // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt + if (parseExpected(SyntaxKind.OpenParenToken)) { + var savedYieldContext = inYieldContext(); + var savedGeneratorParameterContext = inGeneratorParameterContext(); - function checkParameterList(parameters: NodeArray): void { - var seenOptionalParameter = false; - var parameterCount = parameters.length; + setYieldContext(yieldAndGeneratorParameterContext); + setGeneratorParameterContext(yieldAndGeneratorParameterContext); - for (var i = 0; i < parameterCount; i++) { - var parameter = parameters[i]; - // It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs as the - // Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code - // or if its FunctionBody is strict code(11.1.5). - // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a - // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) - if (isInStrictMode && isEvalOrArgumentsIdentifier(parameter.name)) { - reportInvalidUseInStrictMode(parameter.name); - return; - } - else if (parameter.flags & NodeFlags.Rest) { - if (i !== (parameterCount - 1)) { - grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); - return; - } + var result = parseDelimitedList(ParsingContext.Parameters, parseParameter); + parseExpected(SyntaxKind.CloseParenToken); - if (parameter.flags & NodeFlags.QuestionMark) { - grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_cannot_be_optional); - return; - } + setYieldContext(savedYieldContext); + setGeneratorParameterContext(savedGeneratorParameterContext); - if (parameter.initializer) { - grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_cannot_have_an_initializer); - return; - } - } - else if (parameter.flags & NodeFlags.QuestionMark || parameter.initializer) { - seenOptionalParameter = true; - - if (parameter.flags & NodeFlags.QuestionMark && parameter.initializer) { - grammarErrorOnNode(parameter.name, Diagnostics.Parameter_cannot_have_question_mark_and_initializer); - return; - } - } - else { - if (seenOptionalParameter) { - grammarErrorOnNode(parameter.name, Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); - return; - } - } + return result; } + + return createMissingList(); } function parseSignatureMember(kind: SyntaxKind, returnToken: SyntaxKind): SignatureDeclaration { var node = createNode(kind); - var sig = parseSignature(kind, returnToken, /* returnTokenRequired */ false); - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; + fillSignature(kind, returnToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ false, node); parseSemicolon(); return finishNode(node); } - function parseIndexSignatureMember(): SignatureDeclaration { - var node = createNode(SyntaxKind.IndexSignature); - var errorCountBeforeIndexSignature = file.syntacticErrors.length; - var indexerStart = scanner.getTokenPos(); - node.parameters = parseParameterList(SyntaxKind.OpenBracketToken, SyntaxKind.CloseBracketToken); - var indexerLength = scanner.getStartPos() - indexerStart; + function parseIndexSignatureMember(fullStart: number, modifiers: ModifiersArray): SignatureDeclaration { + var node = createNode(SyntaxKind.IndexSignature, fullStart); + setModifiers(node, modifiers); + node.parameters = parseBracketedList(ParsingContext.Parameters, parseParameter, SyntaxKind.OpenBracketToken, SyntaxKind.CloseBracketToken); node.type = parseTypeAnnotation(); parseSemicolon(); - if (file.syntacticErrors.length === errorCountBeforeIndexSignature) { - checkIndexSignature(node, indexerStart, indexerLength); - } - return finishNode(node); - } - - function checkIndexSignature(node: SignatureDeclaration, indexerStart: number, indexerLength: number): void { - var parameter = node.parameters[0]; - if (node.parameters.length !== 1) { - var arityDiagnostic = Diagnostics.An_index_signature_must_have_exactly_one_parameter; - if (parameter) { - grammarErrorOnNode(parameter.name, arityDiagnostic); - } - else { - grammarErrorAtPos(indexerStart, indexerLength, arityDiagnostic); - } - return; - } - else if (parameter.flags & NodeFlags.Rest) { - grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_cannot_have_a_rest_parameter); - return; - } - else if (parameter.flags & NodeFlags.Modifier) { - grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); - return; - } - else if (parameter.flags & NodeFlags.QuestionMark) { - grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); - return; - } - else if (parameter.initializer) { - grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); - return; - } - else if (!parameter.type) { - grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); - return; - } - else if (parameter.type.kind !== SyntaxKind.StringKeyword && - parameter.type.kind !== SyntaxKind.NumberKeyword) { - grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); - return; - } - else if (!node.type) { - grammarErrorAtPos(indexerStart, indexerLength, Diagnostics.An_index_signature_must_have_a_type_annotation); - return; - } + return finishNode(node) } function parsePropertyOrMethod(): Declaration { - var node = createNode(SyntaxKind.Unknown); - node.name = parsePropertyName(); + var fullStart = scanner.getStartPos(); + var name = parsePropertyName(); + var flags = 0; if (parseOptional(SyntaxKind.QuestionToken)) { - node.flags |= NodeFlags.QuestionMark; + flags = NodeFlags.QuestionMark; } + if (token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { - node.kind = SyntaxKind.Method; - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false); - (node).typeParameters = sig.typeParameters; - (node).parameters = sig.parameters; - (node).type = sig.type; + var method = createNode(SyntaxKind.Method, fullStart); + method.name = name; + method.flags = flags; + + // Method signatues don't exist in expression contexts. So they have neither + // [Yield] nor [GeneratorParameter] + fillSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ false, method); + + parseSemicolon(); + return finishNode(method); } else { - node.kind = SyntaxKind.Property; - (node).type = parseTypeAnnotation(); + var property = createNode(SyntaxKind.Property, fullStart); + property.name = name; + property.flags = flags; + property.type = parseTypeAnnotation(); + parseSemicolon(); + return finishNode(property); } - parseSemicolon(); - return finishNode(node); } function isStartOfTypeMember(): boolean { @@ -1838,7 +1822,7 @@ module ts { case SyntaxKind.LessThanToken: return parseSignatureMember(SyntaxKind.CallSignature, SyntaxKind.ColonToken); case SyntaxKind.OpenBracketToken: - return parseIndexSignatureMember(); + return parseIndexSignatureMember(scanner.getStartPos(), /*modifiers:*/ undefined); case SyntaxKind.NewKeyword: if (lookAhead(() => nextToken() === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken)) { return parseSignatureMember(SyntaxKind.ConstructSignature, SyntaxKind.ColonToken); @@ -1855,24 +1839,26 @@ module ts { function parseTypeLiteral(): TypeLiteralNode { var node = createNode(SyntaxKind.TypeLiteral); + node.members = parseObjectType(); + return finishNode(node); + } + + function parseObjectType(): NodeArray { + var members: NodeArray; if (parseExpected(SyntaxKind.OpenBraceToken)) { - node.members = parseList(ParsingContext.TypeMembers, /*checkForStrictMode*/ false, parseTypeMember); + members = parseList(ParsingContext.TypeMembers, /*checkForStrictMode*/ false, parseTypeMember); parseExpected(SyntaxKind.CloseBraceToken); } else { - node.members = createMissingList(); + members = createMissingList(); } - return finishNode(node); + + return members; } function parseTupleType(): TupleTypeNode { var node = createNode(SyntaxKind.TupleType); - var startTokenPos = scanner.getTokenPos(); - var startErrorCount = file.syntacticErrors.length; node.elementTypes = parseBracketedList(ParsingContext.TupleElementTypes, parseType, SyntaxKind.OpenBracketToken, SyntaxKind.CloseBracketToken); - if (!node.elementTypes.length && file.syntacticErrors.length === startErrorCount) { - grammarErrorAtPos(startTokenPos, scanner.getStartPos() - startTokenPos, Diagnostics.A_tuple_type_element_list_cannot_be_empty); - } return finishNode(node); } @@ -1885,15 +1871,10 @@ module ts { } function parseFunctionType(typeKind: SyntaxKind): SignatureDeclaration { - var member = createNode(typeKind); - var sig = parseSignature(typeKind === SyntaxKind.FunctionType ? SyntaxKind.CallSignature : SyntaxKind.ConstructSignature, - SyntaxKind.EqualsGreaterThanToken, /* returnTokenRequired */ true); - - member.typeParameters = sig.typeParameters; - member.parameters = sig.parameters; - member.type = sig.type; - finishNode(member); - return member; + var node = createNode(typeKind); + fillSignature(typeKind === SyntaxKind.FunctionType ? SyntaxKind.CallSignature : SyntaxKind.ConstructSignature, + SyntaxKind.EqualsGreaterThanToken, /* returnTokenRequired */ true, /*yieldAndGeneratorParameterContext:*/ false, node); + return finishNode(node); } function parseKeywordAndNoDot(): Node { @@ -2012,6 +1993,23 @@ module ts { } function parseType(): TypeNode { + // The rules about 'yield' only apply to actual code/expression contexts. They don't + // apply to 'type' contexts. So we disable these parameters here before moving on. + var savedYieldContext = inYieldContext(); + var savedGeneratorParameterContext = inGeneratorParameterContext(); + + setYieldContext(false); + setGeneratorParameterContext(false); + + var result = parseTypeWorker(); + + setYieldContext(savedYieldContext); + setGeneratorParameterContext(savedGeneratorParameterContext); + + return result; + } + + function parseTypeWorker(): TypeNode { if (isStartOfFunctionType()) { return parseFunctionType(SyntaxKind.FunctionType); } @@ -2056,6 +2054,10 @@ module ts { case SyntaxKind.MinusMinusToken: case SyntaxKind.LessThanToken: case SyntaxKind.Identifier: + case SyntaxKind.YieldKeyword: + // Yield always starts an expression. Either it is an identifier (in which case + // it is definitely an expression). Or it's a keyword (either because we're in + // a generator, or in strict mode (or both)) and it started a yield expression. return true; default: return isIdentifier(); @@ -2067,15 +2069,19 @@ module ts { return token !== SyntaxKind.OpenBraceToken && token !== SyntaxKind.FunctionKeyword && isStartOfExpression(); } - function parseExpression(noIn?: boolean): Expression { - var expr = parseAssignmentExpression(noIn); + function parseExpression(): Expression { + // Expression[in]: + // AssignmentExpression[in] + // Expression[in] , AssignmentExpression[in] + + var expr = parseAssignmentExpression(); while (parseOptional(SyntaxKind.CommaToken)) { - expr = makeBinaryExpression(expr, SyntaxKind.CommaToken, parseAssignmentExpression(noIn)); + expr = makeBinaryExpression(expr, SyntaxKind.CommaToken, parseAssignmentExpression()); } return expr; } - function parseInitializer(inParameter: boolean, noIn?: boolean): Expression { + function parseInitializer(inParameter: boolean): Expression { if (token !== SyntaxKind.EqualsToken) { // It's not uncommon during typing for the user to miss writing the '=' token. Check if // there is no newline after the last token and if we're on an expression. If so, parse @@ -2092,23 +2098,30 @@ module ts { } } + // Initializer[In, Yield] : + // = AssignmentExpression[?In, ?Yield] + parseExpected(SyntaxKind.EqualsToken); - return parseAssignmentExpression(noIn); + return parseAssignmentExpression(); } - function parseAssignmentExpression(noIn?: boolean): Expression { - // Augmented by TypeScript: - // - // AssignmentExpression[in]: - // 1) ConditionalExpression[in] - // 2) LeftHandSideExpression = AssignmentExpression[in] - // 3) LeftHandSideExpression AssignmentOperator AssignmentExpression[in] - // 4) ArrowFunctionExpression <-- added by TypeScript + function parseAssignmentExpression(): Expression { + // AssignmentExpression[in,yield]: + // 1) ConditionalExpression[?in,?yield] + // 2) LeftHandSideExpression = AssignmentExpression[?in,?yield] + // 3) LeftHandSideExpression AssignmentOperator AssignmentExpression[?in,?yield] + // 4) ArrowFunctionExpression[?in,?yield] + // 5) [+Yield] YieldExpression[?In] // // Note: for ease of implementation we treat productions '2' and '3' as the same thing. // (i.e. they're both BinaryExpressions with an assignment operator in it). - // First, check if we have an arrow function (production '4') that starts with a parenthesized + // First, do the simple check if we have a YieldExpression (production '5'). + if (isYieldExpression()) { + return parseYieldExpression(); + } + + // Then, check if we have an arrow function (production '4') that starts with a parenthesized // parameter list. If we do, we must *not* recurse for productions 1, 2 or 3. An ArrowFunction is // not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done // with AssignmentExpression if we see one. @@ -2119,7 +2132,7 @@ module ts { // Now try to handle the rest of the cases. First, see if we can parse out up to and // including a conditional expression. - var expr = parseConditionalExpression(noIn); + var expr = parseConditionalExpression(); // To avoid a look-ahead, we did not handle the case of an arrow function with a single un-parenthesized // parameter ('x => ...') above. We handle it here by checking if the parsed expression was a single @@ -2131,52 +2144,78 @@ module ts { // Now see if we might be in cases '2' or '3'. // If the expression was a LHS expression, and we have an assignment operator, then // we're in '2' or '3'. Consume the assignment and return. - if (isLeftHandSideExpression(expr) && isAssignmentOperator()) { - if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { - // ECMA 262 (Annex C) The identifier eval or arguments may not appear as the LeftHandSideExpression of an - // Assignment operator(11.13) or of a PostfixExpression(11.3) - reportInvalidUseInStrictMode(expr); - } + if (isLeftHandSideExpression(expr) && isAssignmentOperator(token)) { var operator = token; nextToken(); - return makeBinaryExpression(expr, operator, parseAssignmentExpression(noIn)); + return makeBinaryExpression(expr, operator, parseAssignmentExpression()); } // otherwise this was production '1'. Return whatever we parsed so far. return expr; } - function isLeftHandSideExpression(expr: Expression): boolean { - if (expr) { - switch (expr.kind) { - case SyntaxKind.PropertyAccess: - case SyntaxKind.IndexedAccess: - case SyntaxKind.NewExpression: - case SyntaxKind.CallExpression: - case SyntaxKind.TaggedTemplateExpression: - case SyntaxKind.ArrayLiteral: - case SyntaxKind.ParenExpression: - case SyntaxKind.ObjectLiteral: - case SyntaxKind.FunctionExpression: - case SyntaxKind.Identifier: - case SyntaxKind.Missing: - case SyntaxKind.RegularExpressionLiteral: - case SyntaxKind.NumericLiteral: - case SyntaxKind.StringLiteral: - case SyntaxKind.NoSubstitutionTemplateLiteral: - case SyntaxKind.TemplateExpression: - case SyntaxKind.FalseKeyword: - case SyntaxKind.NullKeyword: - case SyntaxKind.ThisKeyword: - case SyntaxKind.TrueKeyword: - case SyntaxKind.SuperKeyword: - return true; + function isYieldExpression(): boolean { + if (token === SyntaxKind.YieldKeyword) { + // If we have a 'yield' keyword, and htis is a context where yield expressions are + // allowed, then definitely parse out a yield expression. + if (inYieldContext()) { + return true; } + + if (inStrictModeContext()) { + // If we're in strict mode, then 'yield' is a keyword, could only ever start + // a yield expression. + return true; + } + + // We're in a context where 'yield expr' is not allowed. However, if we can + // definitely tell that the user was trying to parse a 'yield expr' and not + // just a normal expr that start with a 'yield' identifier, then parse out + // a 'yield expr'. We can then report an error later that they are only + // allowed in generator expressions. + // + // for example, if we see 'yield(foo)', then we'll have to treat that as an + // invocation expression of something called 'yield'. However, if we have + // 'yield foo' then that is not legal as a normal expression, so we can + // definitely recognize this as a yield expression. + // + // for now we just check if the next token is an identifier. More heuristics + // can be added here later as necessary. We just need to make sure that we + // don't accidently consume something legal. + return lookAhead(() => { + nextToken(); + return !scanner.hasPrecedingLineBreak() && isIdentifier(); + }); } return false; } + function parseYieldExpression(): YieldExpression { + var node = createNode(SyntaxKind.YieldExpression); + + // YieldExpression[In] : + // yield + // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] + // yield [no LineTerminator here] * [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] + nextToken(); + + if (!scanner.hasPrecedingLineBreak() && + (token === SyntaxKind.AsteriskToken || isStartOfExpression())) { + if (parseOptional(SyntaxKind.AsteriskToken)) { + node.flags = NodeFlags.YieldStar; + } + + node.expression = parseAssignmentExpression(); + return finishNode(node); + } + else { + // if the next token is not on the same line as yield. or we don't have an '*' or + // the start of an expressin, then this is just a simple "yield" expression. + return finishNode(node); + } + } + function parseSimpleArrowFunctionExpression(identifier: Identifier): Expression { Debug.assert(token === SyntaxKind.EqualsGreaterThanToken, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); parseExpected(SyntaxKind.EqualsGreaterThanToken); @@ -2192,7 +2231,7 @@ module ts { var signature = { parameters: parameters }; - return parseArrowExpressionTail(identifier.pos, signature, /*noIn:*/ false); + return parseArrowExpressionTail(identifier.pos, signature); } function tryParseParenthesizedArrowFunctionExpression(): Expression { @@ -2206,12 +2245,13 @@ module ts { var pos = getNodePos(); if (triState === Tristate.True) { - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false); + // Arrow function are never generators. + var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ false); // If we have an arrow, then try to parse the body. // Even if not, try to parse if we have an opening brace, just in case we're in an error state. if (parseExpected(SyntaxKind.EqualsGreaterThanToken) || token === SyntaxKind.OpenBraceToken) { - return parseArrowExpressionTail(pos, sig, /* noIn: */ false); + return parseArrowExpressionTail(pos, sig); } else { // If not, we're probably better off bailing out and returning a bogus function expression. @@ -2224,7 +2264,7 @@ module ts { var sig = tryParseSignatureIfArrowOrBraceFollows(); if (sig) { parseExpected(SyntaxKind.EqualsGreaterThanToken); - return parseArrowExpressionTail(pos, sig, /*noIn:*/ false); + return parseArrowExpressionTail(pos, sig); } else { return undefined; @@ -2309,7 +2349,8 @@ module ts { function tryParseSignatureIfArrowOrBraceFollows(): ParsedSignature { return tryParse(() => { - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false); + // Arrow functions are never generators. + var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ false); // Parsing a signature isn't enough. // Parenthesized arrow signatures often look like other valid expressions. @@ -2327,11 +2368,11 @@ module ts { }); } - function parseArrowExpressionTail(pos: number, sig: ParsedSignature, noIn: boolean): FunctionExpression { + function parseArrowExpressionTail(pos: number, sig: ParsedSignature): FunctionExpression { var body: Node; if (token === SyntaxKind.OpenBraceToken) { - body = parseBody(/* ignoreMissingOpenBrace */ false); + body = parseFunctionBlock(/*allowYield:*/ false, /* ignoreMissingOpenBrace */ false); } else if (isStatement(/* inErrorRecovery */ true) && !isStartOfExpressionStatement() && token !== SyntaxKind.FunctionKeyword) { // Check if we got a plain statement (i.e. no expression-statements, no functions expressions/declarations) @@ -2348,44 +2389,39 @@ module ts { // up preemptively closing the containing construct. // // Note: even when 'ignoreMissingOpenBrace' is passed as true, parseBody will still error. - body = parseBody(/* ignoreMissingOpenBrace */ true); + body = parseFunctionBlock(/*allowYield:*/ false, /* ignoreMissingOpenBrace */ true); } else { - body = parseAssignmentExpression(noIn); + body = parseAssignmentExpression(); } return makeFunctionExpression(SyntaxKind.ArrowFunction, pos, /* name */ undefined, sig, body); } - function isAssignmentOperator(): boolean { - return token >= SyntaxKind.FirstAssignment && token <= SyntaxKind.LastAssignment; - } + function parseConditionalExpression(): Expression { + // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and + // we do not that for the 'whenFalse' part. - function parseConditionalExpression(noIn?: boolean): Expression { - var expr = parseBinaryExpression(noIn); + var expr = parseBinaryOperators(parseUnaryExpression(), /*minPrecedence:*/ 0); while (parseOptional(SyntaxKind.QuestionToken)) { var node = createNode(SyntaxKind.ConditionalExpression, expr.pos); node.condition = expr; - node.whenTrue = parseAssignmentExpression(false); + node.whenTrue = allowInAnd(parseAssignmentExpression); parseExpected(SyntaxKind.ColonToken); - node.whenFalse = parseAssignmentExpression(noIn); + node.whenFalse = parseAssignmentExpression(); expr = finishNode(node); } return expr; } - function parseBinaryExpression(noIn?: boolean): Expression { - return parseBinaryOperators(parseUnaryExpression(), 0, noIn); - } - - function parseBinaryOperators(expr: Expression, minPrecedence: number, noIn?: boolean): Expression { + function parseBinaryOperators(expr: Expression, minPrecedence: number): Expression { while (true) { reScanGreaterToken(); var precedence = getOperatorPrecedence(); - if (precedence && precedence > minPrecedence && (!noIn || token !== SyntaxKind.InKeyword)) { + if (precedence && precedence > minPrecedence && (!inDisallowInContext() || token !== SyntaxKind.InKeyword)) { var operator = token; nextToken(); - expr = makeBinaryExpression(expr, operator, parseBinaryOperators(parseUnaryExpression(), precedence, noIn)); + expr = makeBinaryExpression(expr, operator, parseBinaryOperators(parseUnaryExpression(), precedence)); continue; } return expr; @@ -2453,21 +2489,7 @@ module ts { case SyntaxKind.MinusMinusToken: var operator = token; nextToken(); - var operand = parseUnaryExpression(); - if (isInStrictMode) { - // The identifier eval or arguments may not appear as the LeftHandSideExpression of an - // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression - // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator - if ((operator === SyntaxKind.PlusPlusToken || operator === SyntaxKind.MinusMinusToken) && isEvalOrArgumentsIdentifier(operand)) { - reportInvalidUseInStrictMode(operand); - } - else if (operator === SyntaxKind.DeleteKeyword && operand.kind === SyntaxKind.Identifier) { - // When a delete operator occurs within strict mode code, a SyntaxError is thrown if its - // UnaryExpression is a direct reference to a variable, function argument, or function name - grammarErrorOnNode(operand, Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); - } - } - return makeUnaryExpression(SyntaxKind.PrefixOperator, pos, operator, operand); + return makeUnaryExpression(SyntaxKind.PrefixOperator, pos, operator, parseUnaryExpression()); case SyntaxKind.LessThanToken: return parseTypeAssertion(); } @@ -2488,12 +2510,6 @@ module ts { Debug.assert(isLeftHandSideExpression(expr)); if ((token === SyntaxKind.PlusPlusToken || token === SyntaxKind.MinusMinusToken) && !scanner.hasPrecedingLineBreak()) { - // The identifier eval or arguments may not appear as the LeftHandSideExpression of an - // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression - // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator. - if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { - reportInvalidUseInStrictMode(expr); - } var operator = token; nextToken(); expr = makeUnaryExpression(SyntaxKind.PostfixOperator, expr.pos, operator, expr); @@ -2542,22 +2558,26 @@ module ts { // the code would be implicitly: "name.keyword; identifierNameOrKeyword". // In the first case though, ASI will not take effect because there is not a // line terminator after the keyword. - if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord() && lookAhead(() => scanner.isReservedWord())) { - grammarErrorAtPos(dotOrBracketStart, scanner.getStartPos() - dotOrBracketStart, Diagnostics.Identifier_expected); - var id = createMissingNode(); - } - else { - var id = parseIdentifierName(); + var id: Identifier; + if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord()) { + var matchesPattern = lookAhead(() => { + nextToken(); + return !scanner.hasPrecedingLineBreak() && (scanner.isIdentifier() || scanner.isReservedWord); + }); + + if (matchesPattern) { + errorAtPos(dotOrBracketStart + 1, 0, Diagnostics.Identifier_expected); + id = createMissingNode(); + } } propertyAccess.left = expr; - propertyAccess.right = id; + propertyAccess.right = id || parseIdentifierName(); expr = finishNode(propertyAccess); continue; } if (parseOptional(SyntaxKind.OpenBracketToken)) { - var indexedAccess = createNode(SyntaxKind.IndexedAccess, expr.pos); indexedAccess.object = expr; @@ -2565,10 +2585,9 @@ module ts { // Check for that common pattern and report a better error message. if (inNewExpression && parseOptional(SyntaxKind.CloseBracketToken)) { indexedAccess.index = createMissingNode(); - grammarErrorAtPos(dotOrBracketStart, scanner.getStartPos() - dotOrBracketStart, Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); } else { - indexedAccess.index = parseExpression(); + indexedAccess.index = allowInAnd(parseExpression); if (indexedAccess.index.kind === SyntaxKind.StringLiteral || indexedAccess.index.kind === SyntaxKind.NumericLiteral) { var literal = indexedAccess.index; literal.text = internIdentifier(literal.text); @@ -2592,8 +2611,7 @@ module ts { else { parseExpected(SyntaxKind.OpenParenToken); } - callExpr.arguments = parseDelimitedList(ParsingContext.ArgumentExpressions, - parseArgumentExpression, /*allowTrailingComma*/ false); + callExpr.arguments = parseDelimitedList(ParsingContext.ArgumentExpressions, parseArgumentExpression); parseExpected(SyntaxKind.CloseParenToken); expr = finishNode(callExpr); continue; @@ -2606,11 +2624,6 @@ module ts { ? parseLiteralNode() : parseTemplateExpression(); expr = finishNode(tagExpression); - - if (languageVersion < ScriptTarget.ES6) { - grammarErrorOnNode(expr, Diagnostics.Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher); - } - continue; } @@ -2625,25 +2638,20 @@ module ts { } function parseTypeArguments(): NodeArray { - var typeArgumentListStart = scanner.getTokenPos(); - var errorCountBeforeTypeParameterList = file.syntacticErrors.length; // We pass parseSingleTypeArgument instead of parseType as the element parser // because parseSingleTypeArgument knows how to parse a missing type argument. // This is useful for signature help. parseType has the disadvantage that when // it sees a missing type, it changes the LookAheadMode to Error, and the result // is a broken binary expression, which breaks signature help. - var result = parseBracketedList(ParsingContext.TypeArguments, parseSingleTypeArgument, SyntaxKind.LessThanToken, SyntaxKind.GreaterThanToken); - if (!result.length && file.syntacticErrors.length === errorCountBeforeTypeParameterList) { - grammarErrorAtPos(typeArgumentListStart, scanner.getStartPos() - typeArgumentListStart, Diagnostics.Type_argument_list_cannot_be_empty); - } - return result; + return parseBracketedList(ParsingContext.TypeArguments, parseSingleTypeArgument, SyntaxKind.LessThanToken, SyntaxKind.GreaterThanToken); } function parseSingleTypeArgument(): TypeNode { + // Be resilient to something like: Foo<,,>(); + // We want to parse this out as a type argument list (esp. for signature help), and we + // don't want to rollback just because we were missing a type arg. The grammar checker + // will report the actual error later on. if (token === SyntaxKind.CommaToken) { - var errorStart = scanner.getTokenPos(); - var errorLength = scanner.getTextPos() - errorStart; - grammarErrorAtPos(errorStart, errorLength, Diagnostics.Type_expected); return createNode(SyntaxKind.Missing); } @@ -2693,59 +2701,80 @@ module ts { function parseParenExpression(): ParenExpression { var node = createNode(SyntaxKind.ParenExpression); parseExpected(SyntaxKind.OpenParenToken); - node.expression = parseExpression(); + node.expression = allowInAnd(parseExpression); parseExpected(SyntaxKind.CloseParenToken); return finishNode(node); } - function parseAssignmentExpressionOrOmittedExpression(omittedExpressionDiagnostic: DiagnosticMessage): Expression { - if (token === SyntaxKind.CommaToken) { - if (omittedExpressionDiagnostic) { - var errorStart = scanner.getTokenPos(); - var errorLength = scanner.getTextPos() - errorStart; - grammarErrorAtPos(errorStart, errorLength, omittedExpressionDiagnostic); - } - return createNode(SyntaxKind.OmittedExpression); - } - - return parseAssignmentExpression(); + function parseAssignmentExpressionOrOmittedExpression(): Expression { + return token === SyntaxKind.CommaToken + ? createNode(SyntaxKind.OmittedExpression) + : parseAssignmentExpression(); } function parseArrayLiteralElement(): Expression { - return parseAssignmentExpressionOrOmittedExpression(/*omittedExpressionDiagnostic*/ undefined); + return parseAssignmentExpressionOrOmittedExpression(); } function parseArgumentExpression(): Expression { - return parseAssignmentExpressionOrOmittedExpression(Diagnostics.Argument_expression_expected); + return allowInAnd(parseAssignmentExpressionOrOmittedExpression); } function parseArrayLiteral(): ArrayLiteral { var node = createNode(SyntaxKind.ArrayLiteral); parseExpected(SyntaxKind.OpenBracketToken); if (scanner.hasPrecedingLineBreak()) node.flags |= NodeFlags.MultiLine; - node.elements = parseDelimitedList(ParsingContext.ArrayLiteralMembers, - parseArrayLiteralElement, /*allowTrailingComma*/ true); + node.elements = parseDelimitedList(ParsingContext.ArrayLiteralMembers, parseArrayLiteralElement); parseExpected(SyntaxKind.CloseBracketToken); return finishNode(node); } - function parsePropertyAssignment(): PropertyDeclaration { - var node = createNode(SyntaxKind.PropertyAssignment); - node.name = parsePropertyName(); - if (token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false); - var body = parseBody(/* ignoreMissingOpenBrace */ false); + function parsePropertyAssignment(): Declaration { + var nodePos = scanner.getStartPos(); + var isGenerator = parseOptional(SyntaxKind.AsteriskToken); + var tokenIsIdentifier = isIdentifier(); + var nameToken = token; + var propertyName = parsePropertyName(); + var node: Declaration; + if (isGenerator || token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { + node = createNode(SyntaxKind.PropertyAssignment, nodePos); + node.name = propertyName; + if (isGenerator) { + node.flags |= NodeFlags.Generator; + } + var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ isGenerator); + + var body = parseFunctionBlock(isGenerator, /* ignoreMissingOpenBrace */ false); // do not propagate property name as name for function expression // for scenarios like // var x = 1; // var y = { x() { } } // otherwise this will bring y.x into the scope of x which is incorrect - node.initializer = makeFunctionExpression(SyntaxKind.FunctionExpression, node.pos, undefined, sig, body); + (node).initializer = makeFunctionExpression(SyntaxKind.FunctionExpression, node.pos, undefined, sig, body); + return finishNode(node); + } + + var flags: NodeFlags = 0; + + // Disallowing of optional property assignments happens in the grammar checker. + if (token === SyntaxKind.QuestionToken) { + flags |= NodeFlags.QuestionMark; + nextToken(); + } + + // Parse to check if it is short-hand property assignment or normal property assignment + if ((token === SyntaxKind.CommaToken || token === SyntaxKind.CloseBraceToken) && tokenIsIdentifier) { + node = createNode(SyntaxKind.ShorthandPropertyAssignment, nodePos); + node.name = propertyName; } else { + node = createNode(SyntaxKind.PropertyAssignment, nodePos); + node.name = propertyName; parseExpected(SyntaxKind.ColonToken); - node.initializer = parseAssignmentExpression(false); + (node).initializer = allowInAnd(parseAssignmentExpression); } + + node.flags = flags; return finishNode(node); } @@ -2754,7 +2783,7 @@ module ts { var initialToken = token; if (parseContextualModifier(SyntaxKind.GetKeyword) || parseContextualModifier(SyntaxKind.SetKeyword)) { var kind = initialToken === SyntaxKind.GetKeyword ? SyntaxKind.GetAccessor : SyntaxKind.SetAccessor; - return parseAndCheckMemberAccessorDeclaration(kind, initialPos, 0); + return parseMemberAccessorDeclaration(kind, initialPos, /*modifiers*/ undefined); } return parsePropertyAssignment(); } @@ -2766,86 +2795,37 @@ module ts { node.flags |= NodeFlags.MultiLine; } - node.properties = parseDelimitedList(ParsingContext.ObjectLiteralMembers, parseObjectLiteralMember, /*allowTrailingComma*/ true); + node.properties = parseDelimitedList(ParsingContext.ObjectLiteralMembers, parseObjectLiteralMember); parseExpected(SyntaxKind.CloseBraceToken); - - var seen: Map = {}; - var Property = 1; - var GetAccessor = 2; - var SetAccesor = 4; - var GetOrSetAccessor = GetAccessor | SetAccesor; - forEach(node.properties, (p: Declaration) => { - // TODO(jfreeman): continue if we have a computed property - if (p.kind === SyntaxKind.OmittedExpression) { - return; - } - - var name = p.name; - - // ECMA-262 11.1.5 Object Initialiser - // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true - // a.This production is contained in strict code and IsDataDescriptor(previous) is true and - // IsDataDescriptor(propId.descriptor) is true. - // b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true. - // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. - // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true - // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind: number; - if (p.kind === SyntaxKind.PropertyAssignment) { - currentKind = Property; - } - else if (p.kind === SyntaxKind.GetAccessor) { - currentKind = GetAccessor; - } - else if (p.kind === SyntaxKind.SetAccessor) { - currentKind = SetAccesor; - } - else { - Debug.fail("Unexpected syntax kind:" + p.kind); - } - - if (!hasProperty(seen, name.text)) { - seen[name.text] = currentKind; - } - else { - var existingKind = seen[name.text]; - if (currentKind === Property && existingKind === Property) { - if (isInStrictMode) { - grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); - } - } - else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { - if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[name.text] = currentKind | existingKind; - } - else { - grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); - } - } - else { - grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); - } - } - }); return finishNode(node); } function parseFunctionExpression(): FunctionExpression { + // GeneratorExpression : + // function * BindingIdentifier[Yield]opt (FormalParameters[Yield, GeneratorParameter]) { GeneratorBody[Yield] } + // FunctionExpression: + // function BindingIdentifieropt(FormalParameters) { FunctionBody } + var pos = getNodePos(); parseExpected(SyntaxKind.FunctionKeyword); - var name = isIdentifier() ? parseIdentifier() : undefined; - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false); - var body = parseBody(/* ignoreMissingOpenBrace */ false); - if (name && isInStrictMode && isEvalOrArgumentsIdentifier(name)) { - // It is a SyntaxError to use within strict mode code the identifiers eval or arguments as the - // Identifier of a FunctionLikeDeclaration or FunctionExpression or as a formal parameter name(13.1) - reportInvalidUseInStrictMode(name); - } - return makeFunctionExpression(SyntaxKind.FunctionExpression, pos, name, sig, body); + var isGenerator = parseOptional(SyntaxKind.AsteriskToken); + var name = isGenerator ? doInYieldContext(parseOptionalIdentifier) : parseOptionalIdentifier(); + var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ isGenerator); + + var body = parseFunctionBlock(/*allowYield:*/ isGenerator, /* ignoreMissingOpenBrace */ false); + return makeFunctionExpression(SyntaxKind.FunctionExpression, pos, name, sig, body, isGenerator ? NodeFlags.Generator : undefined); } - function makeFunctionExpression(kind: SyntaxKind, pos: number, name: Identifier, sig: ParsedSignature, body: Node): FunctionExpression { + function parseOptionalIdentifier() { + return isIdentifier() ? parseIdentifier() : undefined; + } + + function makeFunctionExpression(kind: SyntaxKind, pos: number, name: Identifier, sig: ParsedSignature, body: Node, flags?: NodeFlags): FunctionExpression { var node = createNode(kind, pos); + if (flags) { + node.flags = flags; + } + node.name = name; node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; @@ -2859,22 +2839,17 @@ module ts { parseExpected(SyntaxKind.NewKeyword); node.func = parseCallAndAccess(parsePrimaryExpression(), /* inNewExpression */ true); if (parseOptional(SyntaxKind.OpenParenToken) || token === SyntaxKind.LessThanToken && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { - node.arguments = parseDelimitedList(ParsingContext.ArgumentExpressions, - parseArgumentExpression, /*allowTrailingComma*/ false); + node.arguments = parseDelimitedList(ParsingContext.ArgumentExpressions, parseArgumentExpression); parseExpected(SyntaxKind.CloseParenToken); } return finishNode(node); } // STATEMENTS - function parseStatementAllowingLetDeclaration() { - return parseStatement(/*allowLetAndConstDeclarations*/ true); - } - function parseBlock(ignoreMissingOpenBrace: boolean, checkForStrictMode: boolean): Block { var node = createNode(SyntaxKind.Block); if (parseExpected(SyntaxKind.OpenBraceToken) || ignoreMissingOpenBrace) { - node.statements = parseList(ParsingContext.BlockStatements, checkForStrictMode, parseStatementAllowingLetDeclaration); + node.statements = parseList(ParsingContext.BlockStatements, checkForStrictMode, parseStatement); parseExpected(SyntaxKind.CloseBraceToken); } else { @@ -2883,27 +2858,14 @@ module ts { return finishNode(node); } - function parseBody(ignoreMissingOpenBrace: boolean): Block { - var saveInFunctionBody = inFunctionBody; - var saveInSwitchStatement = inSwitchStatement; - var saveInIterationStatement = inIterationStatement; - - inFunctionBody = true; - if (inSwitchStatement === ControlBlockContext.Nested) { - inSwitchStatement = ControlBlockContext.CrossingFunctionBoundary; - } - if (inIterationStatement === ControlBlockContext.Nested) { - inIterationStatement = ControlBlockContext.CrossingFunctionBoundary; - } - labelledStatementInfo.pushFunctionBoundary(); + function parseFunctionBlock(allowYield: boolean, ignoreMissingOpenBrace: boolean): Block { + var savedYieldContext = inYieldContext(); + setYieldContext(allowYield); var block = parseBlock(ignoreMissingOpenBrace, /*checkForStrictMode*/ true); block.kind = SyntaxKind.FunctionBlock; - labelledStatementInfo.pop(); - inFunctionBody = saveInFunctionBody; - inSwitchStatement = saveInSwitchStatement; - inIterationStatement = saveInIterationStatement; + setYieldContext(savedYieldContext); return block; } @@ -2918,10 +2880,10 @@ module ts { var node = createNode(SyntaxKind.IfStatement); parseExpected(SyntaxKind.IfKeyword); parseExpected(SyntaxKind.OpenParenToken); - node.expression = parseExpression(); + node.expression = allowInAnd(parseExpression); parseExpected(SyntaxKind.CloseParenToken); - node.thenStatement = parseStatement(/*allowLetAndConstDeclarations*/ false); - node.elseStatement = parseOptional(SyntaxKind.ElseKeyword) ? parseStatement(/*allowLetAndConstDeclarations*/ false) : undefined; + node.thenStatement = parseStatement(); + node.elseStatement = parseOptional(SyntaxKind.ElseKeyword) ? parseStatement() : undefined; return finishNode(node); } @@ -2929,14 +2891,11 @@ module ts { var node = createNode(SyntaxKind.DoStatement); parseExpected(SyntaxKind.DoKeyword); - var saveInIterationStatement = inIterationStatement; - inIterationStatement = ControlBlockContext.Nested; - node.statement = parseStatement(/*allowLetAndConstDeclarations*/ false); - inIterationStatement = saveInIterationStatement; + node.statement = parseStatement(); parseExpected(SyntaxKind.WhileKeyword); parseExpected(SyntaxKind.OpenParenToken); - node.expression = parseExpression(); + node.expression = allowInAnd(parseExpression); parseExpected(SyntaxKind.CloseParenToken); // From: https://mail.mozilla.org/pipermail/es-discuss/2011-August/016188.html @@ -2951,13 +2910,10 @@ module ts { var node = createNode(SyntaxKind.WhileStatement); parseExpected(SyntaxKind.WhileKeyword); parseExpected(SyntaxKind.OpenParenToken); - node.expression = parseExpression(); + node.expression = allowInAnd(parseExpression); parseExpected(SyntaxKind.CloseParenToken); - var saveInIterationStatement = inIterationStatement; - inIterationStatement = ControlBlockContext.Nested; - node.statement = parseStatement(/*allowLetAndConstDeclarations*/ false); - inIterationStatement = saveInIterationStatement; + node.statement = parseStatement(); return finishNode(node); } @@ -2968,194 +2924,97 @@ module ts { parseExpected(SyntaxKind.OpenParenToken); if (token !== SyntaxKind.SemicolonToken) { if (parseOptional(SyntaxKind.VarKeyword)) { - var declarations = parseVariableDeclarationList(0, /*noIn*/ true); - if (!declarations.length) { - error(Diagnostics.Variable_declaration_list_cannot_be_empty); - } + var declarations = disallowInAnd(parseVariableDeclarationList); } else if (parseOptional(SyntaxKind.LetKeyword)) { - var declarations = parseVariableDeclarationList(NodeFlags.Let, /*noIn*/ true); - if (!declarations.length) { - error(Diagnostics.Variable_declaration_list_cannot_be_empty); - } - if (languageVersion < ScriptTarget.ES6) { - grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); - } + var declarations = setFlag(disallowInAnd(parseVariableDeclarationList), NodeFlags.Let); } else if (parseOptional(SyntaxKind.ConstKeyword)) { - var declarations = parseVariableDeclarationList(NodeFlags.Const, /*noIn*/ true); - if (!declarations.length) { - error(Diagnostics.Variable_declaration_list_cannot_be_empty); - } - if (languageVersion < ScriptTarget.ES6) { - grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); - } + var declarations = setFlag(disallowInAnd(parseVariableDeclarationList), NodeFlags.Const); } else { - var varOrInit = parseExpression(true); + var varOrInit = disallowInAnd(parseExpression); } } var forOrForInStatement: IterationStatement; if (parseOptional(SyntaxKind.InKeyword)) { var forInStatement = createNode(SyntaxKind.ForInStatement, pos); if (declarations) { - if (declarations.length > 1) { - error(Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); - } - forInStatement.declaration = declarations[0]; + forInStatement.declarations = declarations; } else { forInStatement.variable = varOrInit; } - forInStatement.expression = parseExpression(); + forInStatement.expression = allowInAnd(parseExpression); parseExpected(SyntaxKind.CloseParenToken); forOrForInStatement = forInStatement; } else { var forStatement = createNode(SyntaxKind.ForStatement, pos); - if (declarations) forStatement.declarations = declarations; - if (varOrInit) forStatement.initializer = varOrInit; + if (declarations) { + forStatement.declarations = declarations; + } + if (varOrInit) { + forStatement.initializer = varOrInit; + } + parseExpected(SyntaxKind.SemicolonToken); if (token !== SyntaxKind.SemicolonToken && token !== SyntaxKind.CloseParenToken) { - forStatement.condition = parseExpression(); + forStatement.condition = allowInAnd(parseExpression); } parseExpected(SyntaxKind.SemicolonToken); if (token !== SyntaxKind.CloseParenToken) { - forStatement.iterator = parseExpression(); + forStatement.iterator = allowInAnd(parseExpression); } parseExpected(SyntaxKind.CloseParenToken); forOrForInStatement = forStatement; } - var saveInIterationStatement = inIterationStatement; - inIterationStatement = ControlBlockContext.Nested; - forOrForInStatement.statement = parseStatement(/*allowLetAndConstDeclarations*/ false); - inIterationStatement = saveInIterationStatement; + forOrForInStatement.statement = parseStatement(); return finishNode(forOrForInStatement); } function parseBreakOrContinueStatement(kind: SyntaxKind): BreakOrContinueStatement { var node = createNode(kind); - var errorCountBeforeStatement = file.syntacticErrors.length; + parseExpected(kind === SyntaxKind.BreakStatement ? SyntaxKind.BreakKeyword : SyntaxKind.ContinueKeyword); - if (!canParseSemicolon()) node.label = parseIdentifier(); + if (!canParseSemicolon()) { + node.label = parseIdentifier(); + } + parseSemicolon(); - finishNode(node); - - // In an ambient context, we will already give an error for having a statement. - if (!inAmbientContext && errorCountBeforeStatement === file.syntacticErrors.length) { - if (node.label) { - checkBreakOrContinueStatementWithLabel(node); - } - else { - checkBareBreakOrContinueStatement(node); - } - } - return node; - } - - function checkBareBreakOrContinueStatement(node: BreakOrContinueStatement): void { - if (node.kind === SyntaxKind.BreakStatement) { - if (inIterationStatement === ControlBlockContext.Nested - || inSwitchStatement === ControlBlockContext.Nested) { - return; - } - else if (inIterationStatement === ControlBlockContext.NotNested - && inSwitchStatement === ControlBlockContext.NotNested) { - grammarErrorOnNode(node, Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement); - return; - } - // Fall through - } - else if (node.kind === SyntaxKind.ContinueStatement) { - if (inIterationStatement === ControlBlockContext.Nested) { - return; - } - else if (inIterationStatement === ControlBlockContext.NotNested) { - grammarErrorOnNode(node, Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement); - return; - } - // Fall through - } - else { - Debug.fail("checkAnonymousBreakOrContinueStatement"); - } - - Debug.assert(inIterationStatement === ControlBlockContext.CrossingFunctionBoundary - || inSwitchStatement === ControlBlockContext.CrossingFunctionBoundary); - grammarErrorOnNode(node, Diagnostics.Jump_target_cannot_cross_function_boundary); - } - - function checkBreakOrContinueStatementWithLabel(node: BreakOrContinueStatement): void { - // For error specificity, if the label is not found, we want to distinguish whether it is because - // it crossed a function boundary or it was simply not found. To do this, we pass false for - // stopAtFunctionBoundary. - var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, - /*requireIterationStatement*/ node.kind === SyntaxKind.ContinueStatement, - /*stopAtFunctionBoundary*/ false); - if (nodeIsNestedInLabel === ControlBlockContext.Nested) { - return; - } - - if (nodeIsNestedInLabel === ControlBlockContext.CrossingFunctionBoundary) { - grammarErrorOnNode(node, Diagnostics.Jump_target_cannot_cross_function_boundary); - return; - } - - // It is NotNested - if (node.kind === SyntaxKind.ContinueStatement) { - grammarErrorOnNode(node, Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); - } - else if (node.kind === SyntaxKind.BreakStatement) { - grammarErrorOnNode(node, Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement); - } - else { - Debug.fail("checkBreakOrContinueStatementWithLabel"); - } + return finishNode(node); } function parseReturnStatement(): ReturnStatement { var node = createNode(SyntaxKind.ReturnStatement); - var errorCountBeforeReturnStatement = file.syntacticErrors.length; - var returnTokenStart = scanner.getTokenPos(); - var returnTokenLength = scanner.getTextPos() - returnTokenStart; parseExpected(SyntaxKind.ReturnKeyword); - if (!canParseSemicolon()) node.expression = parseExpression(); - parseSemicolon(); - - // In an ambient context, we will already give an error for having a statement. - if (!inFunctionBody && !inAmbientContext && errorCountBeforeReturnStatement === file.syntacticErrors.length) { - grammarErrorAtPos(returnTokenStart, returnTokenLength, Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); + if (!canParseSemicolon()) { + node.expression = allowInAnd(parseExpression); } + + parseSemicolon(); return finishNode(node); } function parseWithStatement(): WithStatement { var node = createNode(SyntaxKind.WithStatement); - var startPos = scanner.getTokenPos(); parseExpected(SyntaxKind.WithKeyword); - var endPos = scanner.getStartPos(); parseExpected(SyntaxKind.OpenParenToken); - node.expression = parseExpression(); + node.expression = allowInAnd(parseExpression); parseExpected(SyntaxKind.CloseParenToken); - node.statement = parseStatement(/*allowLetAndConstDeclarations*/ false); - node = finishNode(node); - if (isInStrictMode) { - // Strict mode code may not include a WithStatement. The occurrence of a WithStatement in such - // a context is an - grammarErrorAtPos(startPos, endPos - startPos, Diagnostics.with_statements_are_not_allowed_in_strict_mode); - } - return node; + node.statement = parseStatement(); + return finishNode(node); } function parseCaseClause(): CaseOrDefaultClause { var node = createNode(SyntaxKind.CaseClause); parseExpected(SyntaxKind.CaseKeyword); - node.expression = parseExpression(); + node.expression = allowInAnd(parseExpression); parseExpected(SyntaxKind.ColonToken); - node.statements = parseList(ParsingContext.SwitchClauseStatements, /*checkForStrictMode*/ false, parseStatementAllowingLetDeclaration); + node.statements = parseList(ParsingContext.SwitchClauseStatements, /*checkForStrictMode*/ false, parseStatement); return finishNode(node); } @@ -3163,7 +3022,7 @@ module ts { var node = createNode(SyntaxKind.DefaultClause); parseExpected(SyntaxKind.DefaultKeyword); parseExpected(SyntaxKind.ColonToken); - node.statements = parseList(ParsingContext.SwitchClauseStatements, /*checkForStrictMode*/ false, parseStatementAllowingLetDeclaration); + node.statements = parseList(ParsingContext.SwitchClauseStatements, /*checkForStrictMode*/ false, parseStatement); return finishNode(node); } @@ -3175,26 +3034,13 @@ module ts { var node = createNode(SyntaxKind.SwitchStatement); parseExpected(SyntaxKind.SwitchKeyword); parseExpected(SyntaxKind.OpenParenToken); - node.expression = parseExpression(); + node.expression = allowInAnd(parseExpression); parseExpected(SyntaxKind.CloseParenToken); parseExpected(SyntaxKind.OpenBraceToken); - var saveInSwitchStatement = inSwitchStatement; - inSwitchStatement = ControlBlockContext.Nested; node.clauses = parseList(ParsingContext.SwitchClauses, /*checkForStrictMode*/ false, parseCaseOrDefaultClause); - inSwitchStatement = saveInSwitchStatement; parseExpected(SyntaxKind.CloseBraceToken); - - // Error on duplicate 'default' clauses. - var defaultClauses: CaseOrDefaultClause[] = filter(node.clauses, clause => clause.kind === SyntaxKind.DefaultClause); - for (var i = 1, n = defaultClauses.length; i < n; i++) { - var clause = defaultClauses[i]; - var start = skipTrivia(file.text, clause.pos); - var end = clause.statements.length > 0 ? clause.statements[0].pos : clause.end; - grammarErrorAtPos(start, end - start, Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); - } - return finishNode(node); } @@ -3204,7 +3050,7 @@ module ts { if (scanner.hasPrecedingLineBreak()) { error(Diagnostics.Line_break_not_permitted_here); } - node.expression = parseExpression(); + node.expression = allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } @@ -3239,23 +3085,14 @@ module ts { parseExpected(SyntaxKind.CatchKeyword); parseExpected(SyntaxKind.OpenParenToken); var variable = parseIdentifier(); - var typeAnnotationColonStart = scanner.getTokenPos(); - var typeAnnotationColonLength = scanner.getTextPos() - typeAnnotationColonStart; var typeAnnotation = parseTypeAnnotation(); parseExpected(SyntaxKind.CloseParenToken); var result = parseBlock(/* ignoreMissingOpenBrace */ false, /*checkForStrictMode*/ false); result.kind = SyntaxKind.CatchBlock; result.pos = pos; result.variable = variable; + result.type = typeAnnotation; - if (typeAnnotation) { - errorAtPos(typeAnnotationColonStart, typeAnnotationColonLength, Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation); - } - if (isInStrictMode && isEvalOrArgumentsIdentifier(variable)) { - // It is a SyntaxError if a TryStatement with a Catch occurs within strict code and the Identifier of the - // Catch production is eval or arguments - reportInvalidUseInStrictMode(variable); - } return result; } @@ -3266,40 +3103,21 @@ module ts { return finishNode(node); } - function isIterationStatementStart(): boolean { - return token === SyntaxKind.WhileKeyword || token === SyntaxKind.DoKeyword || token === SyntaxKind.ForKeyword; - } - - function parseStatementWithLabelSet(allowLetAndConstDeclarations: boolean): Statement { - labelledStatementInfo.pushCurrentLabelSet(isIterationStatementStart()); - var statement = parseStatement(allowLetAndConstDeclarations); - labelledStatementInfo.pop(); - return statement; - } - function isLabel(): boolean { return isIdentifier() && lookAhead(() => nextToken() === SyntaxKind.ColonToken); } - function parseLabeledStatement(allowLetAndConstDeclarations: boolean): LabeledStatement { + function parseLabeledStatement(): LabeledStatement { var node = createNode(SyntaxKind.LabeledStatement); node.label = parseIdentifier(); parseExpected(SyntaxKind.ColonToken); - - if (labelledStatementInfo.nodeIsNestedInLabel(node.label, /*requireIterationStatement*/ false, /*stopAtFunctionBoundary*/ true)) { - grammarErrorOnNode(node.label, Diagnostics.Duplicate_label_0, getTextOfNodeFromSourceText(sourceText, node.label)); - } - labelledStatementInfo.addLabel(node.label); - - // We only want to call parseStatementWithLabelSet when the label set is complete - // Therefore, keep parsing labels until we know we're done. - node.statement = isLabel() ? parseLabeledStatement(allowLetAndConstDeclarations) : parseStatementWithLabelSet(allowLetAndConstDeclarations); + node.statement = parseStatement(); return finishNode(node); } function parseExpressionStatement(): ExpressionStatement { var node = createNode(SyntaxKind.ExpressionStatement); - node.expression = parseExpression(); + node.expression = allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } @@ -3366,7 +3184,7 @@ module ts { } } - function parseStatement(allowLetAndConstDeclarations: boolean): Statement { + function parseStatement(): Statement { switch (token) { case SyntaxKind.OpenBraceToken: return parseBlock(/* ignoreMissingOpenBrace */ false, /*checkForStrictMode*/ false); @@ -3374,9 +3192,9 @@ module ts { case SyntaxKind.LetKeyword: case SyntaxKind.ConstKeyword: // const here should always be parsed as const declaration because of check in 'isStatement' - return parseVariableStatement(allowLetAndConstDeclarations); + return parseVariableStatement(scanner.getStartPos(), /*modifiers:*/ undefined); case SyntaxKind.FunctionKeyword: - return parseFunctionDeclaration(); + return parseFunctionDeclaration(scanner.getStartPos(), /*modifiers:*/ undefined); case SyntaxKind.SemicolonToken: return parseEmptyStatement(); case SyntaxKind.IfKeyword: @@ -3407,239 +3225,138 @@ module ts { case SyntaxKind.DebuggerKeyword: return parseDebuggerStatement(); default: - if (isLabel()) { - return parseLabeledStatement(allowLetAndConstDeclarations); - } - return parseExpressionStatement(); + return isLabel() + ? parseLabeledStatement() + : parseExpressionStatement(); } } - function parseAndCheckFunctionBody(isConstructor: boolean): Block { - var initialPosition = scanner.getTokenPos(); - var errorCountBeforeBody = file.syntacticErrors.length; + function parseFunctionBlockOrSemicolon(isGenerator: boolean): Block { if (token === SyntaxKind.OpenBraceToken) { - var body = parseBody(/* ignoreMissingOpenBrace */ false); - if (body && inAmbientContext && file.syntacticErrors.length === errorCountBeforeBody) { - var diagnostic = isConstructor ? Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context : Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; - grammarErrorAtPos(initialPosition, 1, diagnostic); - } - return body; + return parseFunctionBlock(isGenerator, /* ignoreMissingOpenBrace */ false); } + if (canParseSemicolon()) { parseSemicolon(); return undefined; } + error(Diagnostics.Block_or_expected); // block or ';' expected } // DECLARATIONS - function parseVariableDeclaration(flags: NodeFlags, noIn?: boolean): VariableDeclaration { + function parseVariableDeclaration(): VariableDeclaration { var node = createNode(SyntaxKind.VariableDeclaration); - node.flags = flags; - var errorCountBeforeVariableDeclaration = file.syntacticErrors.length; node.name = parseIdentifier(); node.type = parseTypeAnnotation(); - - // Issue any initializer-related errors on the equals token - var initializerStart = scanner.getTokenPos(); - var initializerFirstTokenLength = scanner.getTextPos() - initializerStart; - node.initializer = parseInitializer(/*inParameter*/ false, noIn); - - if (inAmbientContext && node.initializer && errorCountBeforeVariableDeclaration === file.syntacticErrors.length) { - grammarErrorAtPos(initializerStart, initializerFirstTokenLength, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } - if (!inAmbientContext && !node.initializer && flags & NodeFlags.Const) { - grammarErrorOnNode(node, Diagnostics.const_declarations_must_be_initialized); - } - if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { - // It is a SyntaxError if a VariableDeclaration or VariableDeclarationNoIn occurs within strict code - // and its Identifier is eval or arguments - reportInvalidUseInStrictMode(node.name); - } + node.initializer = parseInitializer(/*inParameter*/ false); return finishNode(node); } - function parseVariableDeclarationList(flags: NodeFlags, noIn?: boolean): NodeArray { - return parseDelimitedList(ParsingContext.VariableDeclarations, - () => parseVariableDeclaration(flags, noIn), /*allowTrailingComma*/ false); + function setFlag(array: NodeArray, flag: NodeFlags): NodeArray { + for (var i = 0, n = array.length; i < n; i++) { + array[i].flags |= flag; + } + + return array; } - function parseVariableStatement(allowLetAndConstDeclarations: boolean, pos?: number, flags?: NodeFlags): VariableStatement { - var node = createNode(SyntaxKind.VariableStatement, pos); - if (flags) node.flags = flags; - var errorCountBeforeVarStatement = file.syntacticErrors.length; + function parseVariableDeclarationList(): NodeArray { + return parseDelimitedList(ParsingContext.VariableDeclarations, parseVariableDeclaration); + } + + function parseVariableStatement(fullStart: number, modifiers: ModifiersArray): VariableStatement { + var node = createNode(SyntaxKind.VariableStatement, fullStart); + setModifiers(node, modifiers); + if (token === SyntaxKind.LetKeyword) { node.flags |= NodeFlags.Let; } else if (token === SyntaxKind.ConstKeyword) { node.flags |= NodeFlags.Const; } - else if (token !== SyntaxKind.VarKeyword) { - error(Diagnostics.var_let_or_const_expected); + else { + Debug.assert(token === SyntaxKind.VarKeyword); } + nextToken(); - node.declarations = parseVariableDeclarationList(node.flags, /*noIn*/false); + node.declarations = allowInAnd(parseVariableDeclarationList); + setFlag(node.declarations, node.flags); + parseSemicolon(); - finishNode(node); - if (!node.declarations.length && file.syntacticErrors.length === errorCountBeforeVarStatement) { - grammarErrorOnNode(node, Diagnostics.Variable_declaration_list_cannot_be_empty); - } - if (languageVersion < ScriptTarget.ES6) { - if (node.flags & NodeFlags.Let) { - grammarErrorOnNode(node, Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); - } - else if (node.flags & NodeFlags.Const) { - grammarErrorOnNode(node, Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); - } - } - else if (!allowLetAndConstDeclarations) { - if (node.flags & NodeFlags.Let) { - grammarErrorOnNode(node, Diagnostics.let_declarations_can_only_be_declared_inside_a_block); - } - else if (node.flags & NodeFlags.Const) { - grammarErrorOnNode(node, Diagnostics.const_declarations_can_only_be_declared_inside_a_block); - } - } - return node; + return finishNode(node); } - function parseFunctionDeclaration(pos?: number, flags?: NodeFlags): FunctionLikeDeclaration { - var node = createNode(SyntaxKind.FunctionDeclaration, pos); - if (flags) node.flags = flags; + function parseFunctionDeclaration(fullStart: number, modifiers: ModifiersArray): FunctionLikeDeclaration { + var node = createNode(SyntaxKind.FunctionDeclaration, fullStart); + setModifiers(node, modifiers); parseExpected(SyntaxKind.FunctionKeyword); + var isGenerator = parseOptional(SyntaxKind.AsteriskToken); + if (isGenerator) { + node.flags |= NodeFlags.Generator; + } + node.name = parseIdentifier(); - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false); - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; - node.body = parseAndCheckFunctionBody(/*isConstructor*/ false); - if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name) && node.name.kind === SyntaxKind.Identifier) { - // It is a SyntaxError to use within strict mode code the identifiers eval or arguments as the - // Identifier of a FunctionLikeDeclaration or FunctionExpression or as a formal parameter name(13.1) - reportInvalidUseInStrictMode(node.name); - } + fillSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ isGenerator, node); + node.body = parseFunctionBlockOrSemicolon(isGenerator); return finishNode(node); } - function parseConstructorDeclaration(pos: number, flags: NodeFlags): ConstructorDeclaration { + function parseConstructorDeclaration(pos: number, modifiers: ModifiersArray): ConstructorDeclaration { var node = createNode(SyntaxKind.Constructor, pos); - node.flags = flags; + setModifiers(node, modifiers); parseExpected(SyntaxKind.ConstructorKeyword); - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false); - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; - node.body = parseAndCheckFunctionBody(/*isConstructor*/ true); - if (node.typeParameters) { - grammarErrorAtPos(node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); - } - if (node.type) { - grammarErrorOnNode(node.type, Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); - } + fillSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ false, node); + node.body = parseFunctionBlockOrSemicolon(/*isGenerator:*/ false); return finishNode(node); } - function parsePropertyMemberDeclaration(pos: number, flags: NodeFlags): Declaration { - var errorCountBeforePropertyDeclaration = file.syntacticErrors.length; - var name = parsePropertyName(); - - var questionStart = scanner.getTokenPos(); - if (parseOptional(SyntaxKind.QuestionToken)) { - errorAtPos(questionStart, scanner.getStartPos() - questionStart, Diagnostics.A_class_member_cannot_be_declared_optional); + function parsePropertyMemberDeclaration(fullStart: number, modifiers: ModifiersArray): Declaration { + var flags = modifiers ? modifiers.flags : 0; + var isGenerator = parseOptional(SyntaxKind.AsteriskToken); + if (isGenerator) { + flags |= NodeFlags.Generator; } - if (token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { - var method = createNode(SyntaxKind.Method, pos); - method.flags = flags; + var name = parsePropertyName(); + if (parseOptional(SyntaxKind.QuestionToken)) { + // Note: this is not legal as per the grammar. But we allow it in the parser and + // report an error in the grammar checker. + flags |= NodeFlags.QuestionMark; + } + + if (isGenerator || token === SyntaxKind.OpenParenToken || token === SyntaxKind.LessThanToken) { + var method = createNode(SyntaxKind.Method, fullStart); + setModifiers(method, modifiers); + if (flags) { + method.flags = flags; + } method.name = name; - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false); - method.typeParameters = sig.typeParameters; - method.parameters = sig.parameters; - method.type = sig.type; - method.body = parseAndCheckFunctionBody(/*isConstructor*/ false); + fillSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ isGenerator, method); + method.body = parseFunctionBlockOrSemicolon(isGenerator); return finishNode(method); } else { - var property = createNode(SyntaxKind.Property, pos); - property.flags = flags; + var property = createNode(SyntaxKind.Property, fullStart); + setModifiers(property, modifiers); + if (flags) { + property.flags = flags; + } property.name = name; property.type = parseTypeAnnotation(); - - var initializerStart = scanner.getTokenPos(); - var initializerFirstTokenLength = scanner.getTextPos() - initializerStart; - property.initializer = parseInitializer(/*inParameter*/ false); + property.initializer = allowInAnd(() => parseInitializer(/*inParameter*/ false)); parseSemicolon(); - - if (inAmbientContext && property.initializer && errorCountBeforePropertyDeclaration === file.syntacticErrors.length) { - grammarErrorAtPos(initializerStart, initializerFirstTokenLength, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } return finishNode(property); } } - function parseAndCheckMemberAccessorDeclaration(kind: SyntaxKind, pos: number, flags: NodeFlags): MethodDeclaration { - var errorCountBeforeAccessor = file.syntacticErrors.length; - var accessor = parseMemberAccessorDeclaration(kind, pos, flags); - - if (errorCountBeforeAccessor === file.syntacticErrors.length) { - if (languageVersion < ScriptTarget.ES5) { - grammarErrorOnNode(accessor.name, Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); - } - else if (inAmbientContext) { - grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); - } - else if (accessor.typeParameters) { - grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_have_type_parameters); - } - else if (kind === SyntaxKind.GetAccessor && accessor.parameters.length) { - grammarErrorOnNode(accessor.name, Diagnostics.A_get_accessor_cannot_have_parameters); - } - else if (kind === SyntaxKind.SetAccessor) { - if (accessor.type) { - grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); - } - else if (accessor.parameters.length !== 1) { - grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_must_have_exactly_one_parameter); - } - else { - var parameter = accessor.parameters[0]; - if (parameter.flags & NodeFlags.Rest) { - grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_rest_parameter); - } - else if (parameter.flags & NodeFlags.Modifier) { - grammarErrorOnNode(accessor.name, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); - } - else if (parameter.flags & NodeFlags.QuestionMark) { - grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); - } - else if (parameter.initializer) { - grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); - } - } - } - } - return accessor; - } - - function parseMemberAccessorDeclaration(kind: SyntaxKind, pos: number, flags: NodeFlags): MethodDeclaration { - var node = createNode(kind, pos); - node.flags = flags; + function parseMemberAccessorDeclaration(kind: SyntaxKind, fullStart: number, modifiers: ModifiersArray): MethodDeclaration { + var node = createNode(kind, fullStart); + setModifiers(node, modifiers); node.name = parsePropertyName(); - var sig = parseSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false); - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; - - // A common error is to try to declare an accessor in an ambient class. - if (inAmbientContext && canParseSemicolon()) { - parseSemicolon(); - node.body = createMissingNode(); - } - else { - node.body = parseBody(/* ignoreMissingOpenBrace */ false); - } - + fillSignature(SyntaxKind.CallSignature, SyntaxKind.ColonToken, /* returnTokenRequired */ false, /*yieldAndGeneratorParameterContext:*/ false, node); + node.body = parseFunctionBlockOrSemicolon(/*isGenerator:*/ false); return finishNode(node); } @@ -3652,6 +3369,10 @@ module ts { nextToken(); } + if (token === SyntaxKind.AsteriskToken) { + return true; + } + // Try to get the first property-like token following all modifiers. // This can either be an identifier or the 'get' or 'set' keywords. if (isPropertyName()) { @@ -3693,242 +3414,113 @@ module ts { return false; } - function parseAndCheckModifiers(context: ModifierContext): number { + function parseModifiers(): ModifiersArray { var flags = 0; - var lastStaticModifierStart: number; - var lastStaticModifierLength: number; - var lastDeclareModifierStart: number; - var lastDeclareModifierLength: number; - var lastPrivateModifierStart: number; - var lastPrivateModifierLength: number; - var lastProtectedModifierStart: number; - var lastProtectedModifierLength: number; - + var modifiers: ModifiersArray; while (true) { var modifierStart = scanner.getTokenPos(); - var modifierToken = token; + var modifierKind = token; - // Try to parse the modifier - if (!parseAnyContextualModifier()) break; - - var modifierLength = scanner.getStartPos() - modifierStart; - - switch (modifierToken) { - case SyntaxKind.PublicKeyword: - if (flags & NodeFlags.AccessibilityModifier) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & NodeFlags.Static) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_must_precede_1_modifier, "public", "static"); - } - else if (context === ModifierContext.ModuleElements || context === ModifierContext.SourceElements) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_module_element, "public"); - } - flags |= NodeFlags.Public; - break; - - case SyntaxKind.PrivateKeyword: - if (flags & NodeFlags.AccessibilityModifier) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & NodeFlags.Static) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_must_precede_1_modifier, "private", "static"); - } - else if (context === ModifierContext.ModuleElements || context === ModifierContext.SourceElements) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_module_element, "private"); - } - lastPrivateModifierStart = modifierStart; - lastPrivateModifierLength = modifierLength; - flags |= NodeFlags.Private; - break; - - case SyntaxKind.ProtectedKeyword: - if (flags & NodeFlags.Public || flags & NodeFlags.Private || flags & NodeFlags.Protected) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & NodeFlags.Static) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_must_precede_1_modifier, "protected", "static"); - } - else if (context === ModifierContext.ModuleElements || context === ModifierContext.SourceElements) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_module_element, "protected"); - } - lastProtectedModifierStart = modifierStart; - lastProtectedModifierLength = modifierLength; - flags |= NodeFlags.Protected; - break; - - case SyntaxKind.StaticKeyword: - if (flags & NodeFlags.Static) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_already_seen, "static"); - } - else if (context === ModifierContext.ModuleElements || context === ModifierContext.SourceElements) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); - } - else if (context === ModifierContext.Parameters) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); - } - lastStaticModifierStart = modifierStart; - lastStaticModifierLength = modifierLength; - flags |= NodeFlags.Static; - break; - - case SyntaxKind.ExportKeyword: - if (flags & NodeFlags.Export) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_already_seen, "export"); - } - else if (flags & NodeFlags.Ambient) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); - } - else if (context === ModifierContext.ClassMembers) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); - } - else if (context === ModifierContext.Parameters) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); - } - flags |= NodeFlags.Export; - break; - - case SyntaxKind.DeclareKeyword: - if (flags & NodeFlags.Ambient) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_already_seen, "declare"); - } - else if (context === ModifierContext.ClassMembers) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); - } - else if (context === ModifierContext.Parameters) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); - } - else if (inAmbientContext && context === ModifierContext.ModuleElements) { - grammarErrorAtPos(modifierStart, modifierLength, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); - } - lastDeclareModifierStart = modifierStart; - lastDeclareModifierLength = modifierLength; - flags |= NodeFlags.Ambient; - break; + if (!parseAnyContextualModifier()) { + break; } - } - if (token === SyntaxKind.ConstructorKeyword && flags & NodeFlags.Static) { - grammarErrorAtPos(lastStaticModifierStart, lastStaticModifierLength, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); - } - else if (token === SyntaxKind.ConstructorKeyword && flags & NodeFlags.Private) { - grammarErrorAtPos(lastPrivateModifierStart, lastPrivateModifierLength, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); - } - else if (token === SyntaxKind.ConstructorKeyword && flags & NodeFlags.Protected) { - grammarErrorAtPos(lastProtectedModifierStart, lastProtectedModifierLength, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "protected"); - } - else if (token === SyntaxKind.ImportKeyword) { - if (flags & NodeFlags.Ambient) { - grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); + if (!modifiers) { + modifiers = []; } + flags |= modifierToFlag(modifierKind); + modifiers.push(finishNode(createNode(modifierKind, modifierStart))); } - else if (token === SyntaxKind.InterfaceKeyword) { - if (flags & NodeFlags.Ambient) { - grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); - } + if (modifiers) { + modifiers.flags = flags; } - else if (token !== SyntaxKind.ExportKeyword && !(flags & NodeFlags.Ambient) && inAmbientContext && context === ModifierContext.SourceElements) { - // A declare modifier is required for any top level .d.ts declaration except export=, interfaces and imports: - // categories: - // - // DeclarationElement: - // ExportAssignment - // export_opt InterfaceDeclaration - // export_opt ImportDeclaration - // export_opt ExternalImportDeclaration - // export_opt AmbientDeclaration - // - var declarationStart = scanner.getTokenPos(); - var declarationFirstTokenLength = scanner.getTextPos() - declarationStart; - grammarErrorAtPos(declarationStart, declarationFirstTokenLength, Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); - } - return flags; + return modifiers; } function parseClassMemberDeclaration(): Declaration { - var pos = getNodePos(); - var flags = parseAndCheckModifiers(ModifierContext.ClassMembers); + var fullStart = getNodePos(); + var modifiers = parseModifiers(); if (parseContextualModifier(SyntaxKind.GetKeyword)) { - return parseAndCheckMemberAccessorDeclaration(SyntaxKind.GetAccessor, pos, flags); + return parseMemberAccessorDeclaration(SyntaxKind.GetAccessor, fullStart, modifiers); } if (parseContextualModifier(SyntaxKind.SetKeyword)) { - return parseAndCheckMemberAccessorDeclaration(SyntaxKind.SetAccessor, pos, flags); + return parseMemberAccessorDeclaration(SyntaxKind.SetAccessor, fullStart, modifiers); } if (token === SyntaxKind.ConstructorKeyword) { - return parseConstructorDeclaration(pos, flags); + return parseConstructorDeclaration(fullStart, modifiers); } - if (token >= SyntaxKind.Identifier || token === SyntaxKind.StringLiteral || token === SyntaxKind.NumericLiteral) { - return parsePropertyMemberDeclaration(pos, flags); + if (token >= SyntaxKind.Identifier || token === SyntaxKind.StringLiteral || token === SyntaxKind.NumericLiteral || token === SyntaxKind.AsteriskToken) { + return parsePropertyMemberDeclaration(fullStart, modifiers); } if (token === SyntaxKind.OpenBracketToken) { - if (flags) { - var start = getTokenPos(pos); - var length = getNodePos() - start; - errorAtPos(start, length, Diagnostics.Modifiers_not_permitted_on_index_signature_members); - } - return parseIndexSignatureMember(); + return parseIndexSignatureMember(fullStart, modifiers); } // 'isClassMemberStart' should have hinted not to attempt parsing. Debug.fail("Should not have attempted to parse class member declaration."); } - function parseClassDeclaration(pos: number, flags: NodeFlags): ClassDeclaration { - var node = createNode(SyntaxKind.ClassDeclaration, pos); - node.flags = flags; - var errorCountBeforeClassDeclaration = file.syntacticErrors.length; + function parseClassDeclaration(fullStart: number, modifiers: ModifiersArray): ClassDeclaration { + var node = createNode(SyntaxKind.ClassDeclaration, fullStart); + setModifiers(node, modifiers); parseExpected(SyntaxKind.ClassKeyword); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); + // TODO(jfreeman): Parse arbitrary sequence of heritage clauses and error for order and duplicates - node.baseType = parseOptional(SyntaxKind.ExtendsKeyword) ? parseTypeReference() : undefined; - var implementsKeywordStart = scanner.getTokenPos(); - var implementsKeywordLength: number; + + // ClassTail[Yield,GeneratorParameter] : See 14.5 + // [~GeneratorParameter]ClassHeritage[?Yield]opt { ClassBody[?Yield]opt } + // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } + + node.baseType = inGeneratorParameterContext() + ? doOutsideOfYieldContext(parseClassBaseType) + : parseClassBaseType(); + if (parseOptional(SyntaxKind.ImplementsKeyword)) { - implementsKeywordLength = scanner.getStartPos() - implementsKeywordStart; - node.implementedTypes = parseDelimitedList(ParsingContext.BaseTypeReferences, - parseTypeReference, /*allowTrailingComma*/ false); + node.implementedTypes = parseDelimitedList(ParsingContext.BaseTypeReferences, parseTypeReference); } - var errorCountBeforeClassBody = file.syntacticErrors.length; if (parseExpected(SyntaxKind.OpenBraceToken)) { - node.members = parseList(ParsingContext.ClassMembers, /*checkForStrictMode*/ false, parseClassMemberDeclaration); + // ClassTail[Yield,GeneratorParameter] : See 14.5 + // [~GeneratorParameter]ClassHeritage[?Yield]opt { ClassBody[?Yield]opt } + // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } + + node.members = inGeneratorParameterContext() + ? doOutsideOfYieldContext(parseClassMembers) + : parseClassMembers(); parseExpected(SyntaxKind.CloseBraceToken); } else { node.members = createMissingList(); } - if (node.implementedTypes && !node.implementedTypes.length && errorCountBeforeClassBody === errorCountBeforeClassDeclaration) { - grammarErrorAtPos(implementsKeywordStart, implementsKeywordLength, Diagnostics._0_list_cannot_be_empty, "implements"); - } return finishNode(node); } - function parseInterfaceDeclaration(pos: number, flags: NodeFlags): InterfaceDeclaration { - var node = createNode(SyntaxKind.InterfaceDeclaration, pos); - node.flags = flags; - var errorCountBeforeInterfaceDeclaration = file.syntacticErrors.length; + function parseClassMembers() { + return parseList(ParsingContext.ClassMembers, /*checkForStrictMode*/ false, parseClassMemberDeclaration); + } + + function parseClassBaseType(): TypeReferenceNode { + return parseOptional(SyntaxKind.ExtendsKeyword) ? parseTypeReference() : undefined; + } + + function parseInterfaceDeclaration(fullStart: number, modifiers: ModifiersArray): InterfaceDeclaration { + var node = createNode(SyntaxKind.InterfaceDeclaration, fullStart); + setModifiers(node, modifiers); parseExpected(SyntaxKind.InterfaceKeyword); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); // TODO(jfreeman): Parse arbitrary sequence of heritage clauses and error for order and duplicates - var extendsKeywordStart = scanner.getTokenPos(); - var extendsKeywordLength: number; if (parseOptional(SyntaxKind.ExtendsKeyword)) { - extendsKeywordLength = scanner.getStartPos() - extendsKeywordStart; - node.baseTypes = parseDelimitedList(ParsingContext.BaseTypeReferences, - parseTypeReference, /*allowTrailingComma*/ false); - } - var errorCountBeforeInterfaceBody = file.syntacticErrors.length; - node.members = parseTypeLiteral().members; - if (node.baseTypes && !node.baseTypes.length && errorCountBeforeInterfaceBody === errorCountBeforeInterfaceDeclaration) { - grammarErrorAtPos(extendsKeywordStart, extendsKeywordLength, Diagnostics._0_list_cannot_be_empty, "extends"); + node.baseTypes = parseDelimitedList(ParsingContext.BaseTypeReferences, parseTypeReference); } + node.members = parseObjectType(); return finishNode(node); } - function parseTypeAliasDeclaration(pos: number, flags: NodeFlags): TypeAliasDeclaration { - var node = createNode(SyntaxKind.TypeAliasDeclaration, pos); - node.flags = flags; + function parseTypeAliasDeclaration(fullStart: number, modifiers: ModifiersArray): TypeAliasDeclaration { + var node = createNode(SyntaxKind.TypeAliasDeclaration, fullStart); + setModifiers(node, modifiers); parseExpected(SyntaxKind.TypeKeyword); node.name = parseIdentifier(); parseExpected(SyntaxKind.EqualsToken); @@ -3937,70 +3529,27 @@ module ts { return finishNode(node); } - function parseAndCheckEnumDeclaration(pos: number, flags: NodeFlags): EnumDeclaration { - var enumIsConst = flags & NodeFlags.Const; - function isIntegerLiteral(expression: Expression): boolean { - function isInteger(literalExpression: LiteralExpression): boolean { - // Allows for scientific notation since literalExpression.text was formed by - // coercing a number to a string. Sometimes this coercion can yield a string - // in scientific notation. - // We also don't need special logic for hex because a hex integer is converted - // to decimal when it is coerced. - return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); - } + // In an ambient declaration, the grammar only allows integer literals as initializers. + // In a non-ambient declaration, the grammar allows uninitialized members only in a + // ConstantEnumMemberSection, which starts at the beginning of an enum declaration + // or any time an integer literal initializer is encountered. + function parseEnumMember(): EnumMember { + var node = createNode(SyntaxKind.EnumMember, scanner.getStartPos()); + node.name = parsePropertyName(); + node.initializer = allowInAnd(() => parseInitializer(/*inParameter*/ false)); + return finishNode(node); + } - if (expression.kind === SyntaxKind.PrefixOperator) { - var unaryExpression = expression; - if (unaryExpression.operator === SyntaxKind.PlusToken || unaryExpression.operator === SyntaxKind.MinusToken) { - expression = unaryExpression.operand; - } - } - if (expression.kind === SyntaxKind.NumericLiteral) { - return isInteger(expression); - } - - return false; - } - - var inConstantEnumMemberSection = true; - // In an ambient declaration, the grammar only allows integer literals as initializers. - // In a non-ambient declaration, the grammar allows uninitialized members only in a - // ConstantEnumMemberSection, which starts at the beginning of an enum declaration - // or any time an integer literal initializer is encountered. - function parseAndCheckEnumMember(): EnumMember { - var node = createNode(SyntaxKind.EnumMember); - var errorCountBeforeEnumMember = file.syntacticErrors.length; - node.name = parsePropertyName(); - node.initializer = parseInitializer(/*inParameter*/ false); - - // skip checks below for const enums - they allow arbitrary initializers as long as they can be evaluated to constant expressions. - // since all values are known in compile time - it is not necessary to check that constant enum section precedes computed enum members. - if (!enumIsConst) { - if (inAmbientContext) { - if (node.initializer && !isIntegerLiteral(node.initializer) && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers); - } - } - else if (node.initializer) { - inConstantEnumMemberSection = isIntegerLiteral(node.initializer); - } - else if (!inConstantEnumMemberSection && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, Diagnostics.Enum_member_must_have_initializer); - } - } - return finishNode(node); - } - - var node = createNode(SyntaxKind.EnumDeclaration, pos); + function parseAndCheckEnumDeclaration(fullStart: number, flags: NodeFlags): EnumDeclaration { + var node = createNode(SyntaxKind.EnumDeclaration, fullStart); node.flags = flags; - if (enumIsConst) { + if (flags & NodeFlags.Const) { parseExpected(SyntaxKind.ConstKeyword); } parseExpected(SyntaxKind.EnumKeyword); node.name = parseIdentifier(); if (parseExpected(SyntaxKind.OpenBraceToken)) { - node.members = parseDelimitedList(ParsingContext.EnumMembers, - parseAndCheckEnumMember, /*allowTrailingComma*/ true); + node.members = parseDelimitedList(ParsingContext.EnumMembers, parseEnumMember); parseExpected(SyntaxKind.CloseBraceToken); } else { @@ -4010,7 +3559,7 @@ module ts { } function parseModuleBody(): Block { - var node = createNode(SyntaxKind.ModuleBlock); + var node = createNode(SyntaxKind.ModuleBlock, scanner.getStartPos()); if (parseExpected(SyntaxKind.OpenBraceToken)) { node.statements = parseList(ParsingContext.ModuleElements, /*checkForStrictMode*/ false, parseModuleElement); parseExpected(SyntaxKind.CloseBraceToken); @@ -4021,58 +3570,34 @@ module ts { return finishNode(node); } - function parseInternalModuleTail(pos: number, flags: NodeFlags): ModuleDeclaration { - var node = createNode(SyntaxKind.ModuleDeclaration, pos); + function parseInternalModuleTail(fullStart: number, flags: NodeFlags): ModuleDeclaration { + var node = createNode(SyntaxKind.ModuleDeclaration, fullStart); node.flags = flags; node.name = parseIdentifier(); - if (parseOptional(SyntaxKind.DotToken)) { - node.body = parseInternalModuleTail(getNodePos(), NodeFlags.Export); - } - else { - node.body = parseModuleBody(); - forEach((node.body).statements, s => { - if (s.kind === SyntaxKind.ExportAssignment) { - // Export assignments are not allowed in an internal module - grammarErrorOnNode(s, Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); - } - else if (s.kind === SyntaxKind.ImportDeclaration && (s).externalModuleName) { - grammarErrorOnNode(s, Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); - } - }); - } + node.body = parseOptional(SyntaxKind.DotToken) + ? parseInternalModuleTail(getNodePos(), NodeFlags.Export) + : parseModuleBody(); return finishNode(node); } - function parseAmbientExternalModuleDeclaration(pos: number, flags: NodeFlags): ModuleDeclaration { - var node = createNode(SyntaxKind.ModuleDeclaration, pos); + function parseAmbientExternalModuleDeclaration(fullStart: number, flags: NodeFlags): ModuleDeclaration { + var node = createNode(SyntaxKind.ModuleDeclaration, fullStart); node.flags = flags; node.name = parseStringLiteral(); - if (!inAmbientContext) { - var errorCount = file.syntacticErrors.length; - // Only report this error if we have not already errored about a missing declare modifier, - // which would have been at or after pos - if (!errorCount || file.syntacticErrors[errorCount - 1].start < getTokenPos(pos)) { - grammarErrorOnNode(node.name, Diagnostics.Only_ambient_modules_can_use_quoted_names); - } - } - - // For error recovery, just in case the user forgot the declare modifier on this ambient - // external module, treat it as ambient anyway. - var saveInAmbientContext = inAmbientContext; - inAmbientContext = true; node.body = parseModuleBody(); - inAmbientContext = saveInAmbientContext; return finishNode(node); } - function parseModuleDeclaration(pos: number, flags: NodeFlags): ModuleDeclaration { + function parseModuleDeclaration(fullStart: number, flags: NodeFlags): ModuleDeclaration { parseExpected(SyntaxKind.ModuleKeyword); - return token === SyntaxKind.StringLiteral ? parseAmbientExternalModuleDeclaration(pos, flags) : parseInternalModuleTail(pos, flags); + return token === SyntaxKind.StringLiteral + ? parseAmbientExternalModuleDeclaration(fullStart, flags) + : parseInternalModuleTail(fullStart, flags); } - function parseImportDeclaration(pos: number, flags: NodeFlags): ImportDeclaration { - var node = createNode(SyntaxKind.ImportDeclaration, pos); - node.flags = flags; + function parseImportDeclaration(fullStart: number, modifiers: ModifiersArray): ImportDeclaration { + var node = createNode(SyntaxKind.ImportDeclaration, fullStart); + setModifiers(node, modifiers); parseExpected(SyntaxKind.ImportKeyword); node.name = parseIdentifier(); parseExpected(SyntaxKind.EqualsToken); @@ -4088,8 +3613,9 @@ module ts { return finishNode(node); } - function parseExportAssignmentTail(pos: number): ExportAssignment { - var node = createNode(SyntaxKind.ExportAssignment, pos); + function parseExportAssignmentTail(fullStart: number, modifiers: ModifiersArray): ExportAssignment { + var node = createNode(SyntaxKind.ExportAssignment, fullStart); + setModifiers(node, modifiers); node.exportName = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -4125,70 +3651,61 @@ module ts { } } - function parseDeclaration(modifierContext: ModifierContext): Statement { - var pos = getNodePos(); - var errorCountBeforeModifiers = file.syntacticErrors.length; - var flags = parseAndCheckModifiers(modifierContext); - + function parseDeclaration(): Statement { + var fullStart = getNodePos(); + var modifiers = parseModifiers(); if (token === SyntaxKind.ExportKeyword) { - var modifiersEnd = scanner.getStartPos(); nextToken(); if (parseOptional(SyntaxKind.EqualsToken)) { - var exportAssignmentTail = parseExportAssignmentTail(pos); - if (flags !== 0 && errorCountBeforeModifiers === file.syntacticErrors.length) { - var modifiersStart = skipTrivia(sourceText, pos); - grammarErrorAtPos(modifiersStart, modifiersEnd - modifiersStart, Diagnostics.An_export_assignment_cannot_have_modifiers); - } - return exportAssignmentTail; + return parseExportAssignmentTail(fullStart, modifiers); } } - var saveInAmbientContext = inAmbientContext; - if (flags & NodeFlags.Ambient) { - inAmbientContext = true; - } - + var flags = modifiers ? modifiers.flags : 0; var result: Declaration; switch (token) { case SyntaxKind.VarKeyword: case SyntaxKind.LetKeyword: - result = parseVariableStatement(/*allowLetAndConstDeclarations*/ true, pos, flags); + result = parseVariableStatement(fullStart, modifiers); break; case SyntaxKind.ConstKeyword: var isConstEnum = lookAhead(() => nextToken() === SyntaxKind.EnumKeyword); if (isConstEnum) { - result = parseAndCheckEnumDeclaration(pos, flags | NodeFlags.Const); + result = parseAndCheckEnumDeclaration(fullStart, flags | NodeFlags.Const); } else { - result = parseVariableStatement(/*allowLetAndConstDeclarations*/ true, pos, flags); + result = parseVariableStatement(fullStart, modifiers); } break; case SyntaxKind.FunctionKeyword: - result = parseFunctionDeclaration(pos, flags); + result = parseFunctionDeclaration(fullStart, modifiers); break; case SyntaxKind.ClassKeyword: - result = parseClassDeclaration(pos, flags); + result = parseClassDeclaration(fullStart, modifiers); break; case SyntaxKind.InterfaceKeyword: - result = parseInterfaceDeclaration(pos, flags); + result = parseInterfaceDeclaration(fullStart, modifiers); break; case SyntaxKind.TypeKeyword: - result = parseTypeAliasDeclaration(pos, flags); + result = parseTypeAliasDeclaration(fullStart, modifiers); break; case SyntaxKind.EnumKeyword: - result = parseAndCheckEnumDeclaration(pos, flags); + result = parseAndCheckEnumDeclaration(fullStart, flags); break; case SyntaxKind.ModuleKeyword: - result = parseModuleDeclaration(pos, flags); + result = parseModuleDeclaration(fullStart, flags); break; case SyntaxKind.ImportKeyword: - result = parseImportDeclaration(pos, flags); + result = parseImportDeclaration(fullStart, modifiers); break; default: error(Diagnostics.Declaration_expected); } - inAmbientContext = saveInAmbientContext; + if (modifiers) { + result.modifiers = modifiers; + } + return result; } @@ -4197,33 +3714,23 @@ module ts { } function parseSourceElement() { - return parseSourceElementOrModuleElement(ModifierContext.SourceElements); + return parseSourceElementOrModuleElement(); } function parseModuleElement() { - return parseSourceElementOrModuleElement(ModifierContext.ModuleElements); + return parseSourceElementOrModuleElement(); } - function parseSourceElementOrModuleElement(modifierContext: ModifierContext): Statement { - if (isDeclarationStart()) { - return parseDeclaration(modifierContext); - } - - var statementStart = scanner.getTokenPos(); - var statementFirstTokenLength = scanner.getTextPos() - statementStart; - var errorCountBeforeStatement = file.syntacticErrors.length; - var statement = parseStatement(/*allowLetAndConstDeclarations*/ true); - - if (inAmbientContext && file.syntacticErrors.length === errorCountBeforeStatement) { - grammarErrorAtPos(statementStart, statementFirstTokenLength, Diagnostics.Statements_are_not_allowed_in_ambient_contexts); - } - - return statement; + function parseSourceElementOrModuleElement(): Statement { + return isDeclarationStart() + ? parseDeclaration() + : parseStatement(); } function processReferenceComments(): ReferenceComments { var referencedFiles: FileReference[] = []; var amdDependencies: string[] = []; + var amdModuleName: string; commentRanges = []; token = scanner.scan(); @@ -4243,6 +3750,15 @@ module ts { } } else { + var amdModuleNameRegEx = /^\/\/\/\s* 0) { + // Don't bother doing any grammar checks if there are already parser errors. + // Otherwise we may end up with too many cascading errors. + syntacticDiagnostics = file.parseDiagnostics; + } + else { + // No parser errors were reported. Perform our stricter grammar checks. + syntacticDiagnostics = file.grammarDiagnostics; + checkGrammar(sourceText, languageVersion, file); + } + } + + Debug.assert(syntacticDiagnostics !== undefined); + return syntacticDiagnostics; + } + scanner = createScanner(languageVersion, /*skipTrivia*/ true, sourceText, scanError, onComment); var rootNodeFlags: NodeFlags = 0; if (fileExtensionIs(filename, ".d.ts")) { rootNodeFlags = NodeFlags.DeclarationFile; - inAmbientContext = true; } file = createRootNode(SyntaxKind.SourceFile, 0, sourceText.length, rootNodeFlags); file.filename = normalizePath(filename); @@ -4278,13 +3813,18 @@ module ts { file.getLineAndCharacterFromPosition = getLineAndCharacterFromSourcePosition; file.getPositionFromLineAndCharacter = getPositionFromSourceLineAndCharacter; file.getLineStarts = getLineStarts; - file.syntacticErrors = []; - file.semanticErrors = []; + file.getSyntacticDiagnostics = getSyntacticDiagnostics; + file.parseDiagnostics = []; + file.grammarDiagnostics = []; + file.semanticDiagnostics = []; var referenceComments = processReferenceComments(); file.referencedFiles = referenceComments.referencedFiles; file.amdDependencies = referenceComments.amdDependencies; + file.amdModuleName = referenceComments.amdModuleName; + file.statements = parseList(ParsingContext.SourceElements, /*checkForStrictMode*/ true, parseSourceElement); file.externalModuleIndicator = getExternalModuleIndicator(); + file.nodeCount = nodeCount; file.identifierCount = identifierCount; file.version = version; @@ -4294,6 +3834,1138 @@ module ts { return file; } + function isLeftHandSideExpression(expr: Expression): boolean { + if (expr) { + switch (expr.kind) { + case SyntaxKind.PropertyAccess: + case SyntaxKind.IndexedAccess: + case SyntaxKind.NewExpression: + case SyntaxKind.CallExpression: + case SyntaxKind.TaggedTemplateExpression: + case SyntaxKind.ArrayLiteral: + case SyntaxKind.ParenExpression: + case SyntaxKind.ObjectLiteral: + case SyntaxKind.FunctionExpression: + case SyntaxKind.Identifier: + case SyntaxKind.Missing: + case SyntaxKind.RegularExpressionLiteral: + case SyntaxKind.NumericLiteral: + case SyntaxKind.StringLiteral: + case SyntaxKind.NoSubstitutionTemplateLiteral: + case SyntaxKind.TemplateExpression: + case SyntaxKind.FalseKeyword: + case SyntaxKind.NullKeyword: + case SyntaxKind.ThisKeyword: + case SyntaxKind.TrueKeyword: + case SyntaxKind.SuperKeyword: + return true; + } + } + + return false; + } + + function isAssignmentOperator(token: SyntaxKind): boolean { + return token >= SyntaxKind.FirstAssignment && token <= SyntaxKind.LastAssignment; + } + + function checkGrammar(sourceText: string, languageVersion: ScriptTarget, file: SourceFile) { + var grammarDiagnostics = file.grammarDiagnostics; + + // Create a scanner so we can find the start of tokens to report errors on. + var scanner = createScanner(languageVersion, /*skipTrivia*/ true, sourceText); + + // We're automatically in an ambient context if this is a .d.ts file. + var inAmbientContext = fileExtensionIs(file.filename, ".d.ts"); + var inFunctionBlock = false; + var parent: Node; + visitNode(file); + + function visitNode(node: Node): void { + // Store and restore our recursive state here. + var savedParent = parent; + node.parent = parent; + parent = node; + + if (!checkModifiers(node)) { + var savedInFunctionBlock = inFunctionBlock; + if (node.kind === SyntaxKind.FunctionBlock) { + inFunctionBlock = true; + } + + var savedInAmbientContext = inAmbientContext + if (node.flags & NodeFlags.Ambient) { + inAmbientContext = true; + } + + checkNodeAndChildren(node); + + inAmbientContext = savedInAmbientContext; + inFunctionBlock = savedInFunctionBlock; + } + + parent = savedParent; + } + + function checkNodeAndChildren(node: Node) { + var nodeKind = node.kind; + // First, check if you have a statement in a place where it is not allowed. We want + // to do this before recursing, because we'd prefer to report these errors at the top + // level instead of at some nested level. + if (inAmbientContext && checkForStatementInAmbientContext(node, nodeKind)) { + return; + } + + // if we got any errors, just stop performing any more checks on this node or higher. + if (checkNode(node, nodeKind)) { + return; + } + + // Otherwise, recurse and see if we have any errors below us. + forEachChild(node, visitNode); + } + + function checkNode(node: Node, nodeKind: SyntaxKind): boolean { + // Now do node specific checks. + switch (nodeKind) { + case SyntaxKind.ArrowFunction: + case SyntaxKind.CallSignature: + case SyntaxKind.ConstructorType: + case SyntaxKind.ConstructSignature: + case SyntaxKind.FunctionType: + return checkAnyParsedSignature(node); + case SyntaxKind.BreakStatement: + case SyntaxKind.ContinueStatement: + return checkBreakOrContinueStatement(node); + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + return checkCallOrNewExpression(node); + + case SyntaxKind.EnumDeclaration: return checkEnumDeclaration(node); + case SyntaxKind.BinaryExpression: return checkBinaryExpression(node); + case SyntaxKind.CatchBlock: return checkCatchBlock(node); + case SyntaxKind.ClassDeclaration: return checkClassDeclaration(node); + case SyntaxKind.Constructor: return checkConstructor(node); + case SyntaxKind.ExportAssignment: return checkExportAssignment(node); + case SyntaxKind.ForInStatement: return checkForInStatement(node); + case SyntaxKind.ForStatement: return checkForStatement(node); + case SyntaxKind.FunctionDeclaration: return checkFunctionDeclaration(node); + case SyntaxKind.FunctionExpression: return checkFunctionExpression(node); + case SyntaxKind.GetAccessor: return checkGetAccessor(node); + case SyntaxKind.IndexedAccess: return checkIndexedAccess(node); + case SyntaxKind.IndexSignature: return checkIndexSignature(node); + case SyntaxKind.InterfaceDeclaration: return checkInterfaceDeclaration(node); + case SyntaxKind.LabeledStatement: return checkLabeledStatement(node); + case SyntaxKind.Method: return checkMethod(node); + case SyntaxKind.ModuleDeclaration: return checkModuleDeclaration(node); + case SyntaxKind.ObjectLiteral: return checkObjectLiteral(node); + case SyntaxKind.NumericLiteral: return checkNumericLiteral(node); + case SyntaxKind.Parameter: return checkParameter(node); + case SyntaxKind.PostfixOperator: return checkPostfixOperator(node); + case SyntaxKind.PrefixOperator: return checkPrefixOperator(node); + case SyntaxKind.Property: return checkProperty(node); + case SyntaxKind.PropertyAssignment: return checkPropertyAssignment(node); + case SyntaxKind.ReturnStatement: return checkReturnStatement(node); + case SyntaxKind.SetAccessor: return checkSetAccessor(node); + case SyntaxKind.SourceFile: return checkSourceFile(node); + case SyntaxKind.ShorthandPropertyAssignment: return checkShorthandPropertyAssignment(node); + case SyntaxKind.SwitchStatement: return checkSwitchStatement(node); + case SyntaxKind.TaggedTemplateExpression: return checkTaggedTemplateExpression(node); + case SyntaxKind.TupleType: return checkTupleType(node); + case SyntaxKind.TypeParameter: return checkTypeParameter(node); + case SyntaxKind.TypeReference: return checkTypeReference(node); + case SyntaxKind.VariableDeclaration: return checkVariableDeclaration(node); + case SyntaxKind.VariableStatement: return checkVariableStatement(node); + case SyntaxKind.WithStatement: return checkWithStatement(node); + case SyntaxKind.YieldExpression: return checkYieldExpression(node); + } + } + + function grammarErrorOnFirstToken(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { + var start = skipTrivia(sourceText, node.pos); + scanner.setTextPos(start); + scanner.scan(); + var end = scanner.getTextPos(); + grammarDiagnostics.push(createFileDiagnostic(file, start, end - start, message, arg0, arg1, arg2)); + return true; + } + + function grammarErrorOnNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { + var span = getErrorSpanForNode(node); + var start = span.end > span.pos ? skipTrivia(file.text, span.pos) : span.pos; + var length = span.end - start; + + grammarDiagnostics.push(createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + return true; + } + + function grammarErrorAtPos(start: number, length: number, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean { + grammarDiagnostics.push(createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); + return true; + } + + function reportInvalidUseInStrictMode(node: Identifier): boolean { + // declarationNameToString cannot be used here since it uses a backreference to 'parent' that is not yet set + var name = sourceText.substring(skipTrivia(sourceText, node.pos), node.end); + return grammarErrorOnNode(node, Diagnostics.Invalid_use_of_0_in_strict_mode, name); + } + + function checkForStatementInAmbientContext(node: Node, kind: SyntaxKind): boolean { + switch (kind) { + case SyntaxKind.Block: + case SyntaxKind.EmptyStatement: + case SyntaxKind.IfStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + case SyntaxKind.ForStatement: + case SyntaxKind.ForInStatement: + case SyntaxKind.ContinueStatement: + case SyntaxKind.BreakStatement: + case SyntaxKind.ReturnStatement: + case SyntaxKind.WithStatement: + case SyntaxKind.SwitchStatement: + case SyntaxKind.ThrowStatement: + case SyntaxKind.TryStatement: + case SyntaxKind.DebuggerStatement: + case SyntaxKind.LabeledStatement: + case SyntaxKind.ExpressionStatement: + return grammarErrorOnFirstToken(node, Diagnostics.Statements_are_not_allowed_in_ambient_contexts); + } + } + + function checkAnyParsedSignature(node: ParsedSignature): boolean { + return checkTypeParameterList(node.typeParameters) || + checkParameterList(node.parameters); + } + + function checkBinaryExpression(node: BinaryExpression) { + if (node.parserContextFlags & ParserContextFlags.StrictMode) { + if (isLeftHandSideExpression(node.left) && isAssignmentOperator(node.operator)) { + if (isEvalOrArgumentsIdentifier(node.left)) { + // ECMA 262 (Annex C) The identifier eval or arguments may not appear as the LeftHandSideExpression of an + // Assignment operator(11.13) or of a PostfixExpression(11.3) + return reportInvalidUseInStrictMode(node.left); + } + } + } + } + + function isIterationStatement(node: Node, lookInLabeledStatements: boolean): boolean { + switch (node.kind) { + case SyntaxKind.ForStatement: + case SyntaxKind.ForInStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + return true; + case SyntaxKind.LabeledStatement: + return lookInLabeledStatements && isIterationStatement((node).statement, lookInLabeledStatements); + } + + return false; + } + + function checkLabeledStatement(node: LabeledStatement): boolean { + // ensure that label is unique + var current = node.parent; + while (current) { + if (isAnyFunction(current)) { + break; + } + if (current.kind === SyntaxKind.LabeledStatement && (current).label.text === node.label.text) { + return grammarErrorOnNode(node.label, Diagnostics.Duplicate_label_0, getTextOfNodeFromSourceText(sourceText, node.label)); + } + current = current.parent; + } + } + + function checkBreakOrContinueStatement(node: BreakOrContinueStatement): boolean { + var current = node; + while (current) { + if (isAnyFunction(current)) { + return grammarErrorOnNode(node, Diagnostics.Jump_target_cannot_cross_function_boundary); + } + + switch (current.kind) { + case SyntaxKind.LabeledStatement: + if (node.label && (current).label.text === node.label.text) { + // found matching label - verify that label usage is correct + // continue can only target labels that are on iteration statements + var isMisplacedContinueLabel = node.kind === SyntaxKind.ContinueStatement + && !isIterationStatement((current).statement, /*lookInLabeledStatement*/ true); + + if (isMisplacedContinueLabel) { + return grammarErrorOnNode(node, Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); + } + + return false; + } + break; + case SyntaxKind.SwitchStatement: + if (node.kind === SyntaxKind.BreakStatement && !node.label) { + // unlabeled break within switch statement - ok + return false; + } + break; + default: + if (isIterationStatement(current, /*lookInLabeledStatement*/ false) && !node.label) { + // unlabeled break or continue within iteration statement - ok + return false; + } + break; + } + + current = current.parent; + } + + if (node.label) { + var message = node.kind === SyntaxKind.BreakStatement + ? Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement + : Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; + + return grammarErrorOnNode(node, message) + } + else { + var message = node.kind === SyntaxKind.BreakStatement + ? Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement + : Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; + return grammarErrorOnNode(node, message) + } + } + + function checkCallOrNewExpression(node: CallExpression) { + return checkTypeArguments(node.typeArguments) || + checkArguments(node.arguments); + } + + function checkArguments(arguments: NodeArray) { + return checkForDisallowedTrailingComma(arguments) || + checkForOmittedArgument(arguments); + } + + function checkTypeArguments(typeArguments: NodeArray) { + return checkForDisallowedTrailingComma(typeArguments) || + checkForAtLeastOneTypeArgument(typeArguments) || + checkForMissingTypeArgument(typeArguments); + } + + function checkForOmittedArgument(arguments: NodeArray) { + if (arguments) { + for (var i = 0, n = arguments.length; i < n; i++) { + var arg = arguments[i]; + if (arg.kind === SyntaxKind.OmittedExpression) { + return grammarErrorAtPos(arg.pos, 0, Diagnostics.Argument_expression_expected); + } + } + } + } + + function checkForMissingTypeArgument(typeArguments: NodeArray) { + if (typeArguments) { + for (var i = 0, n = typeArguments.length; i < n; i++) { + var arg = typeArguments[i]; + if (arg.kind === SyntaxKind.Missing) { + return grammarErrorAtPos(arg.pos, 0, Diagnostics.Type_expected); + } + } + } + } + + function checkForAtLeastOneTypeArgument(typeArguments: NodeArray) { + if (typeArguments && typeArguments.length === 0) { + var start = typeArguments.pos - "<".length; + var end = skipTrivia(sourceText, typeArguments.end) + ">".length; + return grammarErrorAtPos(start, end - start, Diagnostics.Type_argument_list_cannot_be_empty); + } + } + + function checkForDisallowedTrailingComma(list: NodeArray): boolean { + if (list && list.hasTrailingComma) { + var start = list.end - ",".length; + var end = list.end; + return grammarErrorAtPos(start, end - start, Diagnostics.Trailing_comma_not_allowed); + } + } + + function checkCatchBlock(node: CatchBlock) { + if (node.type) { + var colonStart = skipTrivia(sourceText, node.variable.end); + return grammarErrorAtPos(colonStart, ":".length, Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation); + } + if (node.parserContextFlags & ParserContextFlags.StrictMode && isEvalOrArgumentsIdentifier(node.variable)) { + // It is a SyntaxError if a TryStatement with a Catch occurs within strict code and the Identifier of the + // Catch production is eval or arguments + return reportInvalidUseInStrictMode(node.variable); + } + } + + function checkClassDeclaration(node: ClassDeclaration) { + return checkForDisallowedTrailingComma(node.implementedTypes) || + checkForAtLeastOneHeritageClause(node.implementedTypes, "implements"); + } + + function checkForAtLeastOneHeritageClause(types: NodeArray, listType: string): boolean { + if (types && types.length === 0) { + return grammarErrorAtPos(types.pos, 0, Diagnostics._0_list_cannot_be_empty, listType) + } + } + + function checkConstructor(node: ConstructorDeclaration) { + return checkAnyParsedSignature(node) || + checkConstructorTypeParameters(node) || + checkConstructorTypeAnnotation(node) || + checkForBodyInAmbientContext(node.body, /*isConstructor:*/ true); + } + + function checkConstructorTypeParameters(node: ConstructorDeclaration) { + if (node.typeParameters) { + return grammarErrorAtPos(node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); + } + } + + function checkConstructorTypeAnnotation(node: ConstructorDeclaration) { + if (node.type) { + return grammarErrorOnNode(node.type, Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); + } + } + + function checkEnumDeclaration(enumDecl: EnumDeclaration): boolean { + var enumIsConst = (enumDecl.flags & NodeFlags.Const) !== 0; + + var hasError = false; + // skip checks below for const enums - they allow arbitrary initializers as long as they can be evaluated to constant expressions. + // since all values are known in compile time - it is not necessary to check that constant enum section precedes computed enum members. + if (!enumIsConst) { + var inConstantEnumMemberSection = true; + for (var i = 0, n = enumDecl.members.length; i < n; i++) { + var node = enumDecl.members[i]; + if (inAmbientContext) { + if (node.initializer && !isIntegerLiteral(node.initializer)) { + hasError = grammarErrorOnNode(node.name, Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers) || hasError; + } + } + else if (node.initializer) { + inConstantEnumMemberSection = isIntegerLiteral(node.initializer); + } + else if (!inConstantEnumMemberSection) { + hasError = grammarErrorOnNode(node.name, Diagnostics.Enum_member_must_have_initializer) || hasError; + } + } + } + + return hasError; + } + + function isIntegerLiteral(expression: Expression): boolean { + function isInteger(literalExpression: LiteralExpression): boolean { + // Allows for scientific notation since literalExpression.text was formed by + // coercing a number to a string. Sometimes this coercion can yield a string + // in scientific notation. + // We also don't need special logic for hex because a hex integer is converted + // to decimal when it is coerced. + return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); + } + + if (expression.kind === SyntaxKind.PrefixOperator) { + var unaryExpression = expression; + if (unaryExpression.operator === SyntaxKind.PlusToken || unaryExpression.operator === SyntaxKind.MinusToken) { + expression = unaryExpression.operand; + } + } + if (expression.kind === SyntaxKind.NumericLiteral) { + return isInteger(expression); + } + + return false; + } + + function checkExportAssignment(node: ExportAssignment) { + if (node.flags & NodeFlags.Modifier) { + return grammarErrorOnFirstToken(node, Diagnostics.An_export_assignment_cannot_have_modifiers); + } + } + + function checkForInStatement(node: ForInStatement) { + return checkVariableDeclarations(node.declarations) || + checkForMoreThanOneDeclaration(node.declarations); + } + + function checkForStatement(node: ForStatement) { + return checkVariableDeclarations(node.declarations); + } + + function checkForMoreThanOneDeclaration(declarations: NodeArray) { + if (declarations && declarations.length > 1) { + return grammarErrorOnFirstToken(declarations[1], Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); + } + } + + function checkFunctionDeclaration(node: FunctionLikeDeclaration) { + return checkAnyParsedSignature(node) || + checkFunctionName(node.name) || + checkForBodyInAmbientContext(node.body, /*isConstructor:*/ false); + } + + function checkFunctionExpression(node: FunctionExpression) { + return checkAnyParsedSignature(node) || + checkFunctionName(node.name); + } + + function checkFunctionName(name: Node) { + if (name && name.parserContextFlags & ParserContextFlags.StrictMode && isEvalOrArgumentsIdentifier(name)) { + // It is a SyntaxError to use within strict mode code the identifiers eval or arguments as the + // Identifier of a FunctionLikeDeclaration or FunctionExpression or as a formal parameter name(13.1) + return reportInvalidUseInStrictMode(name); + } + } + + function checkGetAccessor(node: MethodDeclaration) { + return checkAnyParsedSignature(node) || + checkAccessor(node); + } + + function checkIndexedAccess(node: IndexedAccess) { + if (node.index.kind === SyntaxKind.Missing && + node.parent.kind === SyntaxKind.NewExpression && + (node.parent).func === node) { + + var start = skipTrivia(sourceText, node.parent.pos); + var end = node.end; + return grammarErrorAtPos(start, end - start, Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); + } + } + + function checkIndexSignature(node: SignatureDeclaration): boolean { + return checkIndexSignatureParameters(node) || + checkForIndexSignatureModifiers(node); + } + + function checkForIndexSignatureModifiers(node: SignatureDeclaration): boolean { + if (node.flags & NodeFlags.Modifier) { + return grammarErrorOnFirstToken(node, Diagnostics.Modifiers_not_permitted_on_index_signature_members); + } + } + + function checkIndexSignatureParameters(node: SignatureDeclaration): boolean { + var parameter = node.parameters[0]; + if (node.parameters.length !== 1) { + if (parameter) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_must_have_exactly_one_parameter); + } + else { + return grammarErrorOnNode(node, Diagnostics.An_index_signature_must_have_exactly_one_parameter); + } + } + else if (parameter.flags & NodeFlags.Rest) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_cannot_have_a_rest_parameter); + } + else if (parameter.flags & NodeFlags.Modifier) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); + } + else if (parameter.flags & NodeFlags.QuestionMark) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); + } + else if (parameter.initializer) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); + } + else if (!parameter.type) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); + } + else if (parameter.type.kind !== SyntaxKind.StringKeyword && parameter.type.kind !== SyntaxKind.NumberKeyword) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); + } + else if (!node.type) { + return grammarErrorOnNode(node, Diagnostics.An_index_signature_must_have_a_type_annotation); + } + } + + function checkInterfaceDeclaration(node: InterfaceDeclaration) { + return checkForDisallowedTrailingComma(node.baseTypes) || + checkForAtLeastOneHeritageClause(node.baseTypes, "extends"); + } + + function checkMethod(node: MethodDeclaration) { + return checkAnyParsedSignature(node) || + checkForBodyInAmbientContext(node.body, /*isConstructor:*/ false) || + (node.parent.kind === SyntaxKind.ClassDeclaration && checkForInvalidQuestionMark(node, Diagnostics.A_class_member_cannot_be_declared_optional)); + } + + function checkForBodyInAmbientContext(body: Block | Expression, isConstructor: boolean): boolean { + if (inAmbientContext && body && body.kind === SyntaxKind.FunctionBlock) { + var diagnostic = isConstructor + ? Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context + : Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; + return grammarErrorOnFirstToken(body, diagnostic); + } + } + + function checkModuleDeclaration(node: ModuleDeclaration): boolean { + return checkModuleDeclarationName(node) || + checkModuleDeclarationStatements(node); + } + + function checkModuleDeclarationName(node: ModuleDeclaration) { + if (!inAmbientContext && node.name.kind === SyntaxKind.StringLiteral) { + return grammarErrorOnNode(node.name, Diagnostics.Only_ambient_modules_can_use_quoted_names); + } + } + + function checkModuleDeclarationStatements(node: ModuleDeclaration): boolean { + if (node.name.kind === SyntaxKind.Identifier && node.body.kind === SyntaxKind.ModuleBlock) { + var statements = (node.body).statements; + for (var i = 0, n = statements.length; i < n; i++) { + var statement = statements[i]; + + if (statement.kind === SyntaxKind.ExportAssignment) { + // Export assignments are not allowed in an internal module + return grammarErrorOnNode(statement, Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); + } + else if (statement.kind === SyntaxKind.ImportDeclaration && (statement).externalModuleName) { + return grammarErrorOnNode((statement).externalModuleName, Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); + } + } + } + } + + function checkObjectLiteral(node: ObjectLiteral): boolean { + var seen: Map = {}; + var Property = 1; + var GetAccessor = 2; + var SetAccesor = 4; + var GetOrSetAccessor = GetAccessor | SetAccesor; + var inStrictMode = (node.parserContextFlags & ParserContextFlags.StrictMode) !== 0; + + for (var i = 0, n = node.properties.length; i < n; i++) { + var prop = node.properties[i]; + // TODO(jfreeman): continue if we have a computed property + if (prop.kind === SyntaxKind.OmittedExpression) { + continue; + } + + var p = prop; + var name = p.name; + + // ECMA-262 11.1.5 Object Initialiser + // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true + // a.This production is contained in strict code and IsDataDescriptor(previous) is true and + // IsDataDescriptor(propId.descriptor) is true. + // b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true. + // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. + // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true + // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields + var currentKind: number; + if (p.kind === SyntaxKind.PropertyAssignment) { + currentKind = Property; + } + else if (p.kind === SyntaxKind.ShorthandPropertyAssignment) { + currentKind = Property; + } + else if (p.kind === SyntaxKind.GetAccessor) { + currentKind = GetAccessor; + } + else if (p.kind === SyntaxKind.SetAccessor) { + currentKind = SetAccesor; + } + else { + Debug.fail("Unexpected syntax kind:" + p.kind); + } + + if (!hasProperty(seen, name.text)) { + seen[name.text] = currentKind; + } + else { + var existingKind = seen[name.text]; + if (currentKind === Property && existingKind === Property) { + if (inStrictMode) { + grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + } + } + else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { + if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { + seen[name.text] = currentKind | existingKind; + } + else { + return grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + } + } + else { + return grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + } + } + } + } + + function checkNumericLiteral(node: LiteralExpression): boolean { + if (node.flags & NodeFlags.OctalLiteral) { + if (node.parserContextFlags & ParserContextFlags.StrictMode) { + return grammarErrorOnNode(node, Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); + } + else if (languageVersion >= ScriptTarget.ES5) { + return grammarErrorOnNode(node, Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); + } + } + } + + function checkModifiers(node: Node): boolean { + switch (node.kind) { + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.Constructor: + case SyntaxKind.Property: + case SyntaxKind.Method: + case SyntaxKind.IndexSignature: + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.ModuleDeclaration: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.ExportAssignment: + case SyntaxKind.VariableStatement: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.TypeAliasDeclaration: + case SyntaxKind.ImportDeclaration: + case SyntaxKind.Parameter: + break; + default: + return false; + } + + if (!node.modifiers) { + return; + } + + var lastStatic: Node, lastPrivate: Node, lastProtected: Node, lastDeclare: Node; + var flags = 0; + for (var i = 0, n = node.modifiers.length; i < n; i++) { + var modifier = node.modifiers[i]; + + switch (modifier.kind) { + case SyntaxKind.PublicKeyword: + case SyntaxKind.ProtectedKeyword: + case SyntaxKind.PrivateKeyword: + var text: string; + if (modifier.kind === SyntaxKind.PublicKeyword) { + text = "public"; + } + else if (modifier.kind === SyntaxKind.ProtectedKeyword) { + text = "protected"; + lastProtected = modifier; + } + else { + text = "private"; + lastPrivate = modifier; + } + + if (flags & NodeFlags.AccessibilityModifier) { + return grammarErrorOnNode(modifier, Diagnostics.Accessibility_modifier_already_seen); + } + else if (flags & NodeFlags.Static) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); + } + else if (node.parent.kind === SyntaxKind.ModuleBlock || node.parent.kind === SyntaxKind.SourceFile) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); + } + flags |= modifierToFlag(modifier.kind); + break; + + case SyntaxKind.StaticKeyword: + if (flags & NodeFlags.Static) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "static"); + } + else if (node.parent.kind === SyntaxKind.ModuleBlock || node.parent.kind === SyntaxKind.SourceFile) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); + } + else if (node.kind === SyntaxKind.Parameter) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); + } + flags |= NodeFlags.Static; + lastStatic = modifier; + break; + + case SyntaxKind.ExportKeyword: + if (flags & NodeFlags.Export) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "export"); + } + else if (flags & NodeFlags.Ambient) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); + } + else if (node.parent.kind === SyntaxKind.ClassDeclaration) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); + } + else if (node.kind === SyntaxKind.Parameter) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); + } + flags |= NodeFlags.Export; + break; + + case SyntaxKind.DeclareKeyword: + if (flags & NodeFlags.Ambient) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "declare"); + } + else if (node.parent.kind === SyntaxKind.ClassDeclaration) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); + } + else if (node.kind === SyntaxKind.Parameter) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); + } + else if (inAmbientContext && node.parent.kind === SyntaxKind.ModuleBlock) { + return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); + } + flags |= NodeFlags.Ambient; + lastDeclare = modifier; + break; + } + } + + if (node.kind === SyntaxKind.Constructor) { + if (flags & NodeFlags.Static) { + return grammarErrorOnNode(lastStatic, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); + } + else if (flags & NodeFlags.Protected) { + return grammarErrorOnNode(lastProtected, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "protected"); + } + else if (flags & NodeFlags.Private) { + return grammarErrorOnNode(lastPrivate, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); + } + } + else if (node.kind === SyntaxKind.ImportDeclaration && flags & NodeFlags.Ambient) { + return grammarErrorOnNode(lastDeclare, Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); + } + else if (node.kind === SyntaxKind.InterfaceDeclaration && flags & NodeFlags.Ambient) { + return grammarErrorOnNode(lastDeclare, Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); + } + } + + function checkParameter(node: ParameterDeclaration): boolean { + // It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs as the + // Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code + // or if its FunctionBody is strict code(11.1.5). + // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a + // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) + if (node.parserContextFlags & ParserContextFlags.StrictMode && isEvalOrArgumentsIdentifier(node.name)) { + return reportInvalidUseInStrictMode(node.name); + } + } + + function checkTypeParameterList(typeParameters: NodeArray): boolean { + if (checkForDisallowedTrailingComma(typeParameters)) { + return true; + } + + if (typeParameters && typeParameters.length === 0) { + var start = typeParameters.pos - "<".length; + var end = skipTrivia(sourceText, typeParameters.end) + ">".length; + return grammarErrorAtPos(start, end - start, Diagnostics.Type_parameter_list_cannot_be_empty); + } + } + + function checkParameterList(parameters: NodeArray): boolean { + if (checkForDisallowedTrailingComma(parameters)) { + return true; + } + + var seenOptionalParameter = false; + var parameterCount = parameters.length; + + for (var i = 0; i < parameterCount; i++) { + var parameter = parameters[i]; + if (parameter.flags & NodeFlags.Rest) { + if (i !== (parameterCount - 1)) { + return grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); + } + + if (parameter.flags & NodeFlags.QuestionMark) { + return grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_cannot_be_optional); + } + + if (parameter.initializer) { + return grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_cannot_have_an_initializer); + } + } + else if (parameter.flags & NodeFlags.QuestionMark || parameter.initializer) { + seenOptionalParameter = true; + + if (parameter.flags & NodeFlags.QuestionMark && parameter.initializer) { + return grammarErrorOnNode(parameter.name, Diagnostics.Parameter_cannot_have_question_mark_and_initializer); + } + } + else { + if (seenOptionalParameter) { + return grammarErrorOnNode(parameter.name, Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); + } + } + } + } + + function checkPostfixOperator(node: UnaryExpression) { + // The identifier eval or arguments may not appear as the LeftHandSideExpression of an + // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression + // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator. + if (node.parserContextFlags & ParserContextFlags.StrictMode && isEvalOrArgumentsIdentifier(node.operand)) { + return reportInvalidUseInStrictMode(node.operand); + } + } + + function checkPrefixOperator(node: UnaryExpression) { + if (node.parserContextFlags & ParserContextFlags.StrictMode) { + // The identifier eval or arguments may not appear as the LeftHandSideExpression of an + // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression + // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator + if ((node.operator === SyntaxKind.PlusPlusToken || node.operator === SyntaxKind.MinusMinusToken) && isEvalOrArgumentsIdentifier(node.operand)) { + return reportInvalidUseInStrictMode(node.operand); + } + else if (node.operator === SyntaxKind.DeleteKeyword && node.operand.kind === SyntaxKind.Identifier) { + // When a delete operator occurs within strict mode code, a SyntaxError is thrown if its + // UnaryExpression is a direct reference to a variable, function argument, or function name + return grammarErrorOnNode(node.operand, Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); + } + } + } + + function checkProperty(node: PropertyDeclaration) { + return (node.parent.kind === SyntaxKind.ClassDeclaration && checkForInvalidQuestionMark(node, Diagnostics.A_class_member_cannot_be_declared_optional)) || + checkForInitializerInAmbientContext(node); + } + + function checkForInitializerInAmbientContext(node: PropertyDeclaration) { + if (inAmbientContext && node.initializer) { + return grammarErrorOnFirstToken(node.initializer, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + } + } + + function checkPropertyAssignment(node: PropertyDeclaration) { + return checkForInvalidQuestionMark(node, Diagnostics.An_object_member_cannot_be_declared_optional); + } + + function checkForInvalidQuestionMark(node: Declaration, message: DiagnosticMessage) { + if (node.flags & NodeFlags.QuestionMark) { + var pos = skipTrivia(sourceText, node.name.end); + return grammarErrorAtPos(pos, "?".length, message); + } + } + + function checkReturnStatement(node: ReturnStatement) { + if (!inFunctionBlock) { + return grammarErrorOnFirstToken(node, Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); + } + } + + function checkSetAccessor(node: MethodDeclaration) { + return checkAnyParsedSignature(node) || + checkAccessor(node); + } + + function checkAccessor(accessor: MethodDeclaration): boolean { + var kind = accessor.kind; + if (languageVersion < ScriptTarget.ES5) { + return grammarErrorOnNode(accessor.name, Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); + } + else if (inAmbientContext) { + return grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); + } + else if (accessor.body === undefined) { + return grammarErrorAtPos(accessor.end - 1, ";".length, Diagnostics._0_expected, "{"); + } + else if (accessor.typeParameters) { + return grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_have_type_parameters); + } + else if (kind === SyntaxKind.GetAccessor && accessor.parameters.length) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_get_accessor_cannot_have_parameters); + } + else if (kind === SyntaxKind.SetAccessor) { + if (accessor.type) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); + } + else if (accessor.parameters.length !== 1) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_must_have_exactly_one_parameter); + } + else { + var parameter = accessor.parameters[0]; + if (parameter.flags & NodeFlags.Rest) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_rest_parameter); + } + else if (parameter.flags & NodeFlags.Modifier) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); + } + else if (parameter.flags & NodeFlags.QuestionMark) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); + } + else if (parameter.initializer) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); + } + } + } + } + + function checkSourceFile(node: SourceFile): boolean { + return inAmbientContext && checkTopLevelElementsForRequiredDeclareModifier(file); + } + + function checkTopLevelElementsForRequiredDeclareModifier(file: SourceFile): boolean { + for (var i = 0, n = file.statements.length; i < n; i++) { + var decl = file.statements[i]; + if (isDeclaration(decl) || decl.kind === SyntaxKind.VariableStatement) { + if (checkTopLevelElementForRequiredDeclareModifier(decl)) { + return true; + } + } + } + } + + function checkTopLevelElementForRequiredDeclareModifier(node: Node): boolean { + // A declare modifier is required for any top level .d.ts declaration except export=, interfaces and imports: + // categories: + // + // DeclarationElement: + // ExportAssignment + // export_opt InterfaceDeclaration + // export_opt ImportDeclaration + // export_opt ExternalImportDeclaration + // export_opt AmbientDeclaration + // + if (node.kind === SyntaxKind.InterfaceDeclaration || + node.kind === SyntaxKind.ImportDeclaration || + node.kind === SyntaxKind.ExportAssignment || + (node.flags & NodeFlags.Ambient)) { + + return false; + } + + return grammarErrorOnFirstToken(node, Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); + } + + function checkShorthandPropertyAssignment(node: ShortHandPropertyDeclaration): boolean { + return checkForInvalidQuestionMark(node, Diagnostics.An_object_member_cannot_be_declared_optional); + } + + function checkSwitchStatement(node: SwitchStatement) { + var firstDefaultClause: CaseOrDefaultClause; + + // Error on duplicate 'default' clauses. + for (var i = 0, n = node.clauses.length; i < n; i++) { + var clause = node.clauses[i]; + if (clause.kind === SyntaxKind.DefaultClause) { + if (firstDefaultClause === undefined) { + firstDefaultClause = clause; + } + else { + var start = skipTrivia(file.text, clause.pos); + var end = clause.statements.length > 0 ? clause.statements[0].pos : clause.end; + return grammarErrorAtPos(start, end - start, Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); + } + } + } + } + + function checkTaggedTemplateExpression(node: TaggedTemplateExpression) { + if (languageVersion < ScriptTarget.ES6) { + return grammarErrorOnFirstToken(node.template, Diagnostics.Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + + function checkTupleType(node: TupleTypeNode) { + return checkForDisallowedTrailingComma(node.elementTypes) || + checkForAtLeastOneType(node); + } + + function checkForAtLeastOneType(node: TupleTypeNode): boolean { + if (node.elementTypes.length === 0) { + return grammarErrorOnNode(node, Diagnostics.A_tuple_type_element_list_cannot_be_empty) + } + } + + function checkTypeParameter(node: TypeParameterDeclaration) { + if (node.expression) { + return grammarErrorOnFirstToken(node.expression, Diagnostics.Type_expected); + } + } + + function checkTypeReference(node: TypeReferenceNode) { + return checkTypeArguments(node.typeArguments); + } + + function checkVariableDeclaration(node: VariableDeclaration) { + if (inAmbientContext && node.initializer) { + var equalsPos = node.type ? skipTrivia(sourceText, node.type.end) : skipTrivia(sourceText, node.name.end); + return grammarErrorAtPos(equalsPos, "=".length, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + } + if (!inAmbientContext && !node.initializer && isConst(node)) { + return grammarErrorOnNode(node, Diagnostics.const_declarations_must_be_initialized); + } + if (node.parserContextFlags & ParserContextFlags.StrictMode && isEvalOrArgumentsIdentifier(node.name)) { + // It is a SyntaxError if a VariableDeclaration or VariableDeclarationNoIn occurs within strict code + // and its Identifier is eval or arguments + return reportInvalidUseInStrictMode(node.name); + } + } + + function checkVariableDeclarations(declarations: NodeArray): boolean { + if (declarations) { + if (checkForDisallowedTrailingComma(declarations)) { + return true; + } + + if (!declarations.length) { + return grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, Diagnostics.Variable_declaration_list_cannot_be_empty); + } + + var decl = declarations[0]; + if (languageVersion < ScriptTarget.ES6) { + if (isLet(decl)) { + return grammarErrorOnFirstToken(decl, Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + else if (isConst(decl)) { + return grammarErrorOnFirstToken(decl, Diagnostics.const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); + } + } + } + } + + function checkVariableStatement(node: VariableStatement) { + return checkVariableDeclarations(node.declarations) || + checkForDisallowedLetOrConstStatement(node); + } + + function checkForDisallowedLetOrConstStatement(node: VariableStatement) { + if (!allowLetAndConstDeclarations(node.parent)) { + if (isLet(node)) { + return grammarErrorOnNode(node, Diagnostics.let_declarations_can_only_be_declared_inside_a_block); + } + else if (isConst(node)) { + return grammarErrorOnNode(node, Diagnostics.const_declarations_can_only_be_declared_inside_a_block); + } + } + } + + function allowLetAndConstDeclarations(parent: Node): boolean { + switch (parent.kind) { + case SyntaxKind.IfStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + case SyntaxKind.WithStatement: + case SyntaxKind.ForStatement: + case SyntaxKind.ForInStatement: + return false; + case SyntaxKind.LabeledStatement: + return allowLetAndConstDeclarations(parent.parent); + } + + return true; + } + + function checkWithStatement(node: WithStatement): boolean { + if (node.parserContextFlags & ParserContextFlags.StrictMode) { + // Strict mode code may not include a WithStatement. The occurrence of a WithStatement in such + // a context is an + return grammarErrorOnFirstToken(node, Diagnostics.with_statements_are_not_allowed_in_strict_mode); + } + } + + function checkYieldExpression(node: YieldExpression): boolean { + if (!(node.parserContextFlags & ParserContextFlags.Yield)) { + return grammarErrorOnFirstToken(node, Diagnostics.yield_expression_must_be_contained_within_a_generator_declaration); + } + } + } + export function createProgram(rootNames: string[], options: CompilerOptions, host: CompilerHost): Program { var program: Program; var files: SourceFile[] = []; @@ -4380,13 +5052,15 @@ module ts { var canonicalName = host.getCanonicalFileName(filename); if (hasProperty(filesByName, canonicalName)) { // We've already looked for this file, use cached result - var file = filesByName[canonicalName]; - if (file && host.useCaseSensitiveFileNames() && canonicalName !== file.filename) { - errors.push(createFileDiagnostic(refFile, refStart, refLength, - Diagnostics.Filename_0_differs_from_already_included_filename_1_only_in_casing, filename, file.filename)); - } + return getSourceFileFromCache(filename, canonicalName, /*useAbsolutePath*/ false); } else { + var normalizedAbsolutePath = getNormalizedAbsolutePath(filename, host.getCurrentDirectory()); + var canonicalAbsolutePath = host.getCanonicalFileName(normalizedAbsolutePath); + if (hasProperty(filesByName, canonicalAbsolutePath)) { + return getSourceFileFromCache(normalizedAbsolutePath, canonicalAbsolutePath, /*useAbsolutePath*/ true); + } + // We haven't looked for this file, do so now and cache result var file = filesByName[canonicalName] = host.getSourceFile(filename, options.target, hostErrorMessage => { errors.push(createFileDiagnostic(refFile, refStart, refLength, @@ -4394,6 +5068,10 @@ module ts { }); if (file) { seenNoDefaultLib = seenNoDefaultLib || file.hasNoDefaultLib; + + // Set the source file for normalized absolute path + filesByName[canonicalAbsolutePath] = file; + if (!options.noResolve) { var basePath = getDirectoryPath(filename); processReferencedFiles(file, basePath); @@ -4405,12 +5083,24 @@ module ts { else { files.push(file); } - forEach(file.syntacticErrors, e => { + forEach(file.getSyntacticDiagnostics(), e => { errors.push(e); }); } } return file; + + function getSourceFileFromCache(filename: string, canonicalName: string, useAbsolutePath: boolean): SourceFile { + var file = filesByName[canonicalName]; + if (file && host.useCaseSensitiveFileNames()) { + var sourceFileName = useAbsolutePath ? getNormalizedAbsolutePath(file.filename, host.getCurrentDirectory()) : file.filename; + if (canonicalName !== sourceFileName) { + errors.push(createFileDiagnostic(refFile, refStart, refLength, + Diagnostics.Filename_0_differs_from_already_included_filename_1_only_in_casing, filename, sourceFileName)); + } + } + return file; + } } function processReferencedFiles(file: SourceFile, basePath: string) { diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 24ff3378d59..4858265932e 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -553,7 +553,7 @@ module ts { while (true) { if (pos >= len) { result += text.substring(start, pos); - error(Diagnostics.Unexpected_end_of_text); + error(Diagnostics.Unterminated_string_literal); break; } var ch = text.charCodeAt(pos); @@ -593,7 +593,7 @@ module ts { while (true) { if (pos >= len) { contents += text.substring(start, pos); - error(Diagnostics.Unexpected_end_of_text); + error(Diagnostics.Unterminated_template_literal); resultingToken = startedWithBacktick ? SyntaxKind.NoSubstitutionTemplateLiteral : SyntaxKind.TemplateTail; break; } @@ -931,12 +931,12 @@ module ts { value = 0; } tokenValue = "" + value; - return SyntaxKind.NumericLiteral; + return token = SyntaxKind.NumericLiteral; } // Try to parse as an octal if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { tokenValue = "" + scanOctalDigits(); - return SyntaxKind.NumericLiteral; + return token = SyntaxKind.NumericLiteral; } // This fall-through is a deviation from the EcmaScript grammar. The grammar says that a leading zero // can only be followed by an octal digit, a dot, or the end of the number literal. However, we are being @@ -1066,19 +1066,19 @@ module ts { var inEscape = false; var inCharacterClass = false; while (true) { - // If we've hit EOF without closing off the regex, - // simply return the token we originally parsed. + // If we reach the end of a file, or hit a newline, then this is an unterminated + // regex. Report error and return what we have so far. if (p >= len) { - return token; + error(Diagnostics.Unterminated_regular_expression_literal) + break; } var ch = text.charCodeAt(p); - - // Line breaks are not permissible in the middle of a RegExp. if (isLineBreak(ch)) { - return token; + error(Diagnostics.Unterminated_regular_expression_literal) + break; } - + if (inEscape) { // Parsing an escape character; // reset the flag and just advance to the next char. @@ -1087,6 +1087,7 @@ module ts { else if (ch === CharacterCodes.slash && !inCharacterClass) { // A slash within a character class is permissible, // but in general it signals the end of the regexp literal. + p++; break; } else if (ch === CharacterCodes.openBracket) { @@ -1100,8 +1101,8 @@ module ts { } p++; } - p++; - while (isIdentifierPart(text.charCodeAt(p))) { + + while (p < len && isIdentifierPart(text.charCodeAt(p))) { p++; } pos = p; @@ -1166,13 +1167,13 @@ module ts { hasPrecedingLineBreak: () => precedingLineBreak, isIdentifier: () => token === SyntaxKind.Identifier || token > SyntaxKind.LastReservedWord, isReservedWord: () => token >= SyntaxKind.FirstReservedWord && token <= SyntaxKind.LastReservedWord, - reScanGreaterToken: reScanGreaterToken, - reScanSlashToken: reScanSlashToken, - reScanTemplateToken: reScanTemplateToken, - scan: scan, - setText: setText, - setTextPos: setTextPos, - tryScan: tryScan, + reScanGreaterToken, + reScanSlashToken, + reScanTemplateToken, + scan, + setText, + setTextPos, + tryScan, }; } } diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index d685a30d959..e58d08589ba 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -99,14 +99,14 @@ var sys: System = (function () { } return { - args: args, + args, newLine: "\r\n", useCaseSensitiveFileNames: false, write(s: string): void { WScript.StdOut.Write(s); }, - readFile: readFile, - writeFile: writeFile, + readFile, + writeFile, resolvePath(path: string): string { return fso.GetAbsolutePathName(path); }, @@ -191,8 +191,8 @@ var sys: System = (function () { // 1 is a standard descriptor for stdout _fs.writeSync(1, s); }, - readFile: readFile, - writeFile: writeFile, + readFile, + writeFile, watchFile: (fileName, callback) => { // watchFile polls a file every 250ms, picking up file notifications. _fs.watchFile(fileName, { persistent: true, interval: 250 }, fileChanged); diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index 1c8a696dd0d..333f80a663e 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -192,12 +192,12 @@ module ts { } return { - getSourceFile: getSourceFile, + getSourceFile, getDefaultLibFilename: options => combinePaths(getDirectoryPath(normalizePath(sys.getExecutingFilePath())), options.target === ScriptTarget.ES6 ? "lib.es6.d.ts" : "lib.d.ts"), - writeFile: writeFile, + writeFile, getCurrentDirectory: () => currentDirectory || (currentDirectory = sys.getCurrentDirectory()), useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames, - getCanonicalFileName: getCanonicalFileName, + getCanonicalFileName, getNewLine: () => sys.newLine }; } @@ -368,7 +368,7 @@ module ts { else { var emitStart = new Date().getTime(); var emitOutput = checker.emitFiles(); - var emitErrors = emitOutput.errors; + var emitErrors = emitOutput.diagnostics; exitStatus = emitOutput.emitResultStatus; var reportStart = new Date().getTime(); errors = concatenate(errors, emitErrors); @@ -394,7 +394,7 @@ module ts { reportTimeStatistic("Total time", reportStart - parseStart); } - return { program: program, exitStatus: exitStatus } + return { program, exitStatus }; } function printVersion() { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 2dcb0cf4b45..e8709d04c28 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -167,6 +167,7 @@ module ts { ArrayLiteral, ObjectLiteral, PropertyAssignment, + ShorthandPropertyAssignment, PropertyAccess, IndexedAccess, CallExpression, @@ -182,6 +183,7 @@ module ts { ConditionalExpression, TemplateExpression, TemplateSpan, + YieldExpression, OmittedExpression, // Element Block, @@ -255,40 +257,60 @@ module ts { } export const enum NodeFlags { - Export = 0x00000001, // Declarations - Ambient = 0x00000002, // Declarations - QuestionMark = 0x00000004, // Parameter/Property/Method - Rest = 0x00000008, // Parameter - Public = 0x00000010, // Property/Method - Private = 0x00000020, // Property/Method - Protected = 0x00000040, // Property/Method - Static = 0x00000080, // Property/Method - MultiLine = 0x00000100, // Multi-line array or object literal - Synthetic = 0x00000200, // Synthetic node (for full fidelity) - DeclarationFile = 0x00000400, // Node is a .d.ts file - Let = 0x00000800, // Variable declaration - Const = 0x00001000, // Variable declaration + Export = 0x00000001, // Declarations + Ambient = 0x00000002, // Declarations + QuestionMark = 0x00000004, // Parameter/Property/Method + Rest = 0x00000008, // Parameter + Public = 0x00000010, // Property/Method + Private = 0x00000020, // Property/Method + Protected = 0x00000040, // Property/Method + Static = 0x00000080, // Property/Method + MultiLine = 0x00000100, // Multi-line array or object literal + Synthetic = 0x00000200, // Synthetic node (for full fidelity) + DeclarationFile = 0x00000400, // Node is a .d.ts file + Let = 0x00000800, // Variable declaration + Const = 0x00001000, // Variable declaration + OctalLiteral = 0x00002000, + Generator = 0x00004000, + YieldStar = 0x00008000, Modifier = Export | Ambient | Public | Private | Protected | Static, AccessibilityModifier = Public | Private | Protected, BlockScoped = Let | Const } + export const enum ParserContextFlags { + // Set if this node was parsed in strict mode. Used for grammar error checks, as well as + // checking if the node can be reused in incremental settings. + StrictMode = 1 << 0, + DisallowIn = 1 << 1, + Yield = 1 << 2, + GeneratorParameter = 1 << 3, + } + export interface Node extends TextRange { kind: SyntaxKind; flags: NodeFlags; + // Specific context the parser was in when this node was created. Normally undefined. + // Only set when the parser was in some interesting context (like async/yield). + parserContextFlags?: ParserContextFlags; id?: number; // Unique id (used to look up NodeLinks) parent?: Node; // Parent node (initialized by binding) symbol?: Symbol; // Symbol declared by node (initialized by binding) locals?: SymbolTable; // Locals associated with node (initialized by binding) nextContainer?: Node; // Next container in declaration order (initialized by binding) localSymbol?: Symbol; // Local symbol declared by node (initialized by binding only for exported nodes) + modifiers?: ModifiersArray; // Array of modifiers } export interface NodeArray extends Array, TextRange { hasTrailingComma?: boolean; } + export interface ModifiersArray extends Array { + flags: number; + } + export interface Identifier extends Node { text: string; // Text of identifier (with escapes converted to characters) } @@ -320,6 +342,9 @@ module ts { export interface TypeParameterDeclaration extends Declaration { name: Identifier; constraint?: TypeNode; + + // For error recovery purposes. + expression?: Expression; } export interface SignatureDeclaration extends Declaration, ParsedSignature { } @@ -335,6 +360,10 @@ module ts { initializer?: Expression; } + export interface ShortHandPropertyDeclaration extends Declaration { + name: Identifier; + } + export interface ParameterDeclaration extends VariableDeclaration { } /** @@ -411,6 +440,10 @@ module ts { operator: SyntaxKind; operand: Expression; } + + export interface YieldExpression extends Expression { + expression: Expression; + } export interface BinaryExpression extends Expression { left: Expression; @@ -530,7 +563,7 @@ module ts { } export interface ForInStatement extends IterationStatement { - declaration?: VariableDeclaration; + declarations?: NodeArray; variable?: Expression; expression: Expression; } @@ -575,6 +608,7 @@ module ts { export interface CatchBlock extends Block { variable: Identifier; + type?: TypeNode; } export interface ClassDeclaration extends Declaration { @@ -637,9 +671,19 @@ module ts { getPositionFromLineAndCharacter(line: number, character: number): number; getLineStarts(): number[]; amdDependencies: string[]; + amdModuleName: string; referencedFiles: FileReference[]; - syntacticErrors: Diagnostic[]; - semanticErrors: Diagnostic[]; + semanticDiagnostics: Diagnostic[]; + + // Parse errors refer specifically to things the parser could not understand at all (like + // missing tokens, or tokens it didn't know how to deal with). Grammar errors are for + // things the parser understood, but either the ES6 or TS grammars do not allow (like + // putting an 'public' modifier on a 'class declaration'). + parseDiagnostics: Diagnostic[]; + grammarDiagnostics: Diagnostic[]; + + // Returns all + getSyntacticDiagnostics(): Diagnostic[]; hasNoDefaultLib: boolean; externalModuleIndicator: Node; // The first node that causes this file to be an external module nodeCount: number; @@ -695,13 +739,14 @@ module ts { export interface EmitResult { emitResultStatus: EmitReturnStatus; - errors: Diagnostic[]; + diagnostics: Diagnostic[]; sourceMaps: SourceMapData[]; // Array of sourceMapData if compiler emitted sourcemaps } export interface TypeChecker { getProgram(): Program; getDiagnostics(sourceFile?: SourceFile): Diagnostic[]; + getDeclarationDiagnostics(sourceFile: SourceFile): Diagnostic[]; getGlobalDiagnostics(): Diagnostic[]; getNodeCount(): number; getIdentifierCount(): number; @@ -719,6 +764,7 @@ module ts { getReturnTypeOfSignature(signature: Signature): Type; getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; getSymbolInfo(node: Node): Symbol; + getShorthandAssignmentValueSymbol(location: Node): Symbol; getTypeOfNode(node: Node): Type; typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; @@ -727,11 +773,11 @@ module ts { getAugmentedPropertiesOfType(type: Type): Symbol[]; getRootSymbols(symbol: Symbol): Symbol[]; getContextualType(node: Node): Type; - getResolvedSignature(node: CallExpression, candidatesOutArray?: Signature[]): Signature; + getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; isUndefinedSymbol(symbol: Symbol): boolean; - isArgumentsSymbol(symbol: Symbol): boolean; + isArgumentsSymbol(symbol: Symbol): boolean; isEmitBlocked(sourceFile?: SourceFile): boolean; // Returns the constant value of this enum member, or 'undefined' if the enum member has a computed value. getEnumMemberValue(node: EnumMember): number; @@ -798,11 +844,15 @@ module ts { CannotBeNamed } - export interface SymbolAccessiblityResult { + export interface SymbolVisibilityResult { accessibility: SymbolAccessibility; - errorSymbolName?: string // Optional symbol name that results in error - errorModuleName?: string // If the symbol is not visible from module, module's name aliasesToMakeVisible?: ImportDeclaration[]; // aliases that need to have this symbol visible + errorSymbolName?: string; // Optional symbol name that results in error + errorNode?: Node; // optional node that results in error + } + + export interface SymbolAccessiblityResult extends SymbolVisibilityResult { + errorModuleName?: string // If the symbol is not visible from module, module's name } export interface EmitResolver { @@ -820,7 +870,7 @@ module ts { writeTypeAtLocation(location: Node, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void; isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult; - isImportDeclarationEntityNameReferenceDeclarationVisibile(entityName: EntityName): SymbolAccessiblityResult; + isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult; // Returns the constant value this property access resolves to, or 'undefined' for a non-constant getConstantValue(node: PropertyAccess | IndexedAccess): number; isEmitBlocked(sourceFile?: SourceFile): boolean; diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index ffb0ed16cb8..05e65f5648f 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -215,7 +215,7 @@ module FourSlash { } public setCancelled(numberOfCalls: number = 0): void { - TypeScript.Debug.assert(numberOfCalls >= 0); + ts.Debug.assert(numberOfCalls >= 0); this.numberOfCallsBeforeCancellation = numberOfCalls; } @@ -239,7 +239,7 @@ module FourSlash { // This function creates IScriptSnapshot object for testing getPreProcessedFileInfo // Return object may lack some functionalities for other purposes. - function createScriptSnapShot(sourceText: string): TypeScript.IScriptSnapshot { + function createScriptSnapShot(sourceText: string): ts.IScriptSnapshot { return { getText: (start: number, end: number) => { return sourceText.substr(start, end - start); @@ -250,8 +250,8 @@ module FourSlash { getLineStartPositions: () => { return []; }, - getChangeRange: (oldSnapshot: TypeScript.IScriptSnapshot) => { - return undefined; + getChangeRange: (oldSnapshot: ts.IScriptSnapshot) => { + return undefined; } }; } @@ -262,7 +262,7 @@ module FourSlash { private languageService: ts.LanguageService; // A reference to the language service's compiler state's compiler instance - private compiler: () => { getSyntaxTree(fileName: string): TypeScript.SyntaxTree; getSourceUnit(fileName: string): TypeScript.SourceUnitSyntax; }; + private compiler: () => { getSyntaxTree(fileName: string): ts.SourceFile }; // The current caret position in the active file public currentCaretPosition = 0; @@ -403,8 +403,9 @@ module FourSlash { public goToPosition(pos: number) { this.currentCaretPosition = pos; - var lineCharPos = TypeScript.LineMap1.fromString(this.getCurrentFileContent()).getLineAndCharacterFromPosition(pos); - this.scenarioActions.push(''); + var lineStarts = ts.computeLineStarts(this.getCurrentFileContent()); + var lineCharPos = ts.getLineAndCharacterOfPosition(lineStarts, pos); + this.scenarioActions.push(''); } public moveCaretRight(count = 1) { @@ -748,29 +749,6 @@ module FourSlash { } } - public verifyImplementorsCountIs(count: number, localFilesOnly: boolean = true) { - var implementors = this.getImplementorsAtCaret(); - var implementorsCount = 0; - - if (localFilesOnly) { - var localFiles = this.testData.files.map(file => file.fileName); - // Count only the references in local files. Filter the ones in lib and other files. - implementors.forEach((entry) => { - if (localFiles.some((filename) => filename === entry.fileName)) { - ++implementorsCount; - } - }); - } - else { - implementorsCount = implementors.length; - } - - if (implementorsCount !== count) { - var condition = localFilesOnly ? "excluding libs" : "including libs"; - this.raiseError("Expected implementors count (" + condition + ") to be " + count + ", but is actually " + implementors.length); - } - } - private getMemberListAtCaret() { return this.languageService.getCompletionsAtPosition(this.activeFile.fileName, this.currentCaretPosition, true); } @@ -787,10 +765,6 @@ module FourSlash { return this.languageService.getReferencesAtPosition(this.activeFile.fileName, this.currentCaretPosition); } - private getImplementorsAtCaret() { - return this.languageService.getImplementorsAtPosition(this.activeFile.fileName, this.currentCaretPosition); - } - private assertionMessage(name: string, actualValue: any, expectedValue: any) { return "\nActual " + name + ":\n\t" + actualValue + "\nExpected value:\n\t" + expectedValue; } @@ -1017,7 +991,7 @@ module FourSlash { private alignmentForExtraInfo = 50; - private spanInfoToString(pos: number, spanInfo: TypeScript.TextSpan, prefixString: string) { + private spanInfoToString(pos: number, spanInfo: ts.TextSpan, prefixString: string) { var resultString = "SpanInfo: " + JSON.stringify(spanInfo); if (spanInfo) { var spanString = this.activeFile.content.substr(spanInfo.start(), spanInfo.length()); @@ -1034,7 +1008,7 @@ module FourSlash { return resultString; } - private baselineCurrentFileLocations(getSpanAtPos: (pos: number) => TypeScript.TextSpan): string { + private baselineCurrentFileLocations(getSpanAtPos: (pos: number) => ts.TextSpan): string { var fileLineMap = ts.computeLineStarts(this.activeFile.content); var nextLine = 0; var resultString = ""; @@ -1748,14 +1722,14 @@ module FourSlash { public verifySemanticClassifications(expected: { classificationType: string; text: string }[]) { var actual = this.languageService.getSemanticClassifications(this.activeFile.fileName, - new TypeScript.TextSpan(0, this.activeFile.content.length)); + new ts.TextSpan(0, this.activeFile.content.length)); this.verifyClassifications(expected, actual); } public verifySyntacticClassifications(expected: { classificationType: string; text: string }[]) { var actual = this.languageService.getSyntacticClassifications(this.activeFile.fileName, - new TypeScript.TextSpan(0, this.activeFile.content.length)); + new ts.TextSpan(0, this.activeFile.content.length)); this.verifyClassifications(expected, actual); } @@ -1789,7 +1763,7 @@ module FourSlash { for (var i = 0; i < spans.length; i++) { var expectedSpan = spans[i]; var actualComment = actual[i]; - var actualCommentSpan = new TypeScript.TextSpan(actualComment.position, actualComment.message.length); + var actualCommentSpan = new ts.TextSpan(actualComment.position, actualComment.message.length); if (expectedSpan.start !== actualCommentSpan.start() || expectedSpan.end !== actualCommentSpan.end()) { this.raiseError('verifyOutliningSpans failed - span ' + (i + 1) + ' expected: (' + expectedSpan.start + ',' + expectedSpan.end + '), actual: (' + actualCommentSpan.start() + ',' + actualCommentSpan.end() + ')'); @@ -2240,11 +2214,12 @@ module FourSlash { (fn, contents) => result = contents, ts.ScriptTarget.Latest, sys.useCaseSensitiveFileNames); - var program = ts.createProgram([Harness.Compiler.fourslashFilename, fileName], { out: "fourslashTestOutput.js" }, host); + // TODO (drosen): We need to enforce checking on these tests. + var program = ts.createProgram([Harness.Compiler.fourslashFilename, fileName], { out: "fourslashTestOutput.js", noResolve: true }, host); var checker = ts.createTypeChecker(program, /*fullTypeCheckMode*/ true); checker.checkProgram(); - var errs = checker.getDiagnostics(program.getSourceFile(fileName)); + var errs = program.getDiagnostics().concat(checker.getDiagnostics()); if (errs.length > 0) { throw new Error('Error compiling ' + fileName + ': ' + errs.map(e => e.messageText).join('\r\n')); } @@ -2282,7 +2257,7 @@ module FourSlash { // List of all the subfiles we've parsed out var files: FourSlashFile[] = []; // Global options - var opts: { [s: string]: string; } = {}; + var globalOptions: { [s: string]: string; } = {}; // Marker positions // Split up the input file by line @@ -2290,7 +2265,7 @@ module FourSlash { // we have to string-based splitting instead and try to figure out the delimiting chars var lines = contents.split('\n'); - var markerMap: MarkerMap = {}; + var markerPositions: MarkerMap = {}; var markers: Marker[] = []; var ranges: Range[] = []; @@ -2331,7 +2306,7 @@ module FourSlash { } else if (fileMetadataNamesIndex === fileMetadataNames.indexOf(testOptMetadataNames.filename)) { // Found an @Filename directive, if this is not the first then create a new subfile if (currentFileContent) { - var file = parseFileContent(currentFileContent, currentFileName, markerMap, markers, ranges); + var file = parseFileContent(currentFileContent, currentFileName, markerPositions, markers, ranges); file.fileOptions = currentFileOptions; // Store result file @@ -2351,10 +2326,10 @@ module FourSlash { } } else { // Check if the match is already existed in the global options - if (opts[match[1]] !== undefined) { + if (globalOptions[match[1]] !== undefined) { throw new Error("Global Option : '" + match[1] + "' is already existed"); } - opts[match[1]] = match[2]; + globalOptions[match[1]] = match[2]; } } } else if (line == '' || lineLength === 0) { @@ -2363,7 +2338,7 @@ module FourSlash { } else { // Empty line or code line, terminate current subfile if there is one if (currentFileContent) { - var file = parseFileContent(currentFileContent, currentFileName, markerMap, markers, ranges); + var file = parseFileContent(currentFileContent, currentFileName, markerPositions, markers, ranges); file.fileOptions = currentFileOptions; // Store result file @@ -2378,11 +2353,11 @@ module FourSlash { } return { - markerPositions: markerMap, - markers: markers, - globalOptions: opts, - files: files, - ranges: ranges + markerPositions, + markers, + globalOptions, + files, + ranges }; } diff --git a/src/harness/harness.ts b/src/harness/harness.ts index a2cc84b2a48..791231dabaf 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -587,12 +587,12 @@ module Harness { return languageVersion === ts.ScriptTarget.ES6 ? defaultES6LibSourceFile : defaultLibSourceFile; } // Don't throw here -- the compiler might be looking for a test that actually doesn't exist as part of the TC - return null; + return undefined; } }, - getDefaultLibFilename: (options) => defaultLibFileName, - writeFile: writeFile, - getCanonicalFileName: getCanonicalFileName, + getDefaultLibFilename: options => defaultLibFileName, + writeFile, + getCanonicalFileName, useCaseSensitiveFileNames: () => useCaseSensitiveFileNames, getNewLine: ()=> sys.newLine }; @@ -812,7 +812,7 @@ module Harness { } var errors: HarnessDiagnostic[] = []; - program.getDiagnostics().concat(checker.getDiagnostics()).concat(emitResult ? emitResult.errors : []).forEach(err => { + program.getDiagnostics().concat(checker.getDiagnostics()).concat(emitResult ? emitResult.diagnostics : []).forEach(err => { // TODO: new compiler formats errors after this point to add . and newlines so we'll just do it manually for now errors.push(getMinimalDiagnostic(err)); }); @@ -847,7 +847,7 @@ module Harness { declResult = compileResult; }, settingsCallback, options); - return { declInputFiles: declInputFiles, declOtherFiles: declOtherFiles, declResult: declResult }; + return { declInputFiles, declOtherFiles, declResult }; } function addDtsFile(file: { unitName: string; content: string }, dtsFiles: { unitName: string; content: string }[]) { @@ -868,7 +868,7 @@ module Harness { var sourceFileName: string; if (ts.isExternalModule(sourceFile) || !options.out) { if (options.outDir) { - var sourceFilePath = ts.getNormalizedPathFromPathComponents(ts.getNormalizedPathComponents(sourceFile.filename, result.currentDirectoryForProgram)); + var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.filename, result.currentDirectoryForProgram); sourceFilePath = sourceFilePath.replace(result.program.getCommonSourceDirectory(), ""); sourceFileName = ts.combinePaths(options.outDir, sourceFilePath); } @@ -1157,7 +1157,7 @@ module Harness { var settings = extractCompilerSettings(code); // List of all the subfiles we've parsed out - var files: TestUnitData[] = []; + var testUnitData: TestUnitData[] = []; var lines = Utils.splitContentByNewlines(code); @@ -1193,7 +1193,7 @@ module Harness { originalFilePath: fileName, references: refs }; - files.push(newTestFile); + testUnitData.push(newTestFile); // Reset local data currentFileContent = null; @@ -1218,7 +1218,7 @@ module Harness { } // normalize the fileName for the single file case - currentFileName = files.length > 0 ? currentFileName : Path.getFileName(fileName); + currentFileName = testUnitData.length > 0 ? currentFileName : Path.getFileName(fileName); // EOF, push whatever remains var newTestFile2 = { @@ -1228,9 +1228,9 @@ module Harness { originalFilePath: fileName, references: refs }; - files.push(newTestFile2); + testUnitData.push(newTestFile2); - return { settings: settings, testUnitData: files }; + return { settings, testUnitData }; } } @@ -1326,7 +1326,7 @@ module Harness { actual = actual.replace(/\r\n?/g, '\n'); } - return { expected: expected, actual: actual }; + return { expected, actual }; } function writeComparison(expected: string, actual: string, relativeFilename: string, actualFilename: string, descriptionForDescribe: string) { diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 6163dfd0e79..d3082a17ba2 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -4,8 +4,8 @@ module Harness.LanguageService { export class ScriptInfo { public version: number = 1; - public editRanges: { length: number; textChangeRange: TypeScript.TextChangeRange; }[] = []; - public lineMap: TypeScript.LineMap = null; + public editRanges: { length: number; textChangeRange: ts.TextChangeRange; }[] = []; + public lineMap: number[] = null; constructor(public fileName: string, public content: string, public isOpen = true) { this.setContent(content); @@ -13,7 +13,7 @@ module Harness.LanguageService { private setContent(content: string): void { this.content = content; - this.lineMap = TypeScript.LineMap1.fromString(content); + this.lineMap = ts.computeLineStarts(content); } public updateContent(content: string): void { @@ -32,30 +32,30 @@ module Harness.LanguageService { // Store edit range + new length of script this.editRanges.push({ length: this.content.length, - textChangeRange: new TypeScript.TextChangeRange( - TypeScript.TextSpan.fromBounds(minChar, limChar), newText.length) + textChangeRange: new ts.TextChangeRange( + ts.TextSpan.fromBounds(minChar, limChar), newText.length) }); // Update version # this.version++; } - public getTextChangeRangeBetweenVersions(startVersion: number, endVersion: number): TypeScript.TextChangeRange { + public getTextChangeRangeBetweenVersions(startVersion: number, endVersion: number): ts.TextChangeRange { if (startVersion === endVersion) { // No edits! - return TypeScript.TextChangeRange.unchanged; + return ts.TextChangeRange.unchanged; } var initialEditRangeIndex = this.editRanges.length - (this.version - startVersion); var lastEditRangeIndex = this.editRanges.length - (this.version - endVersion); var entries = this.editRanges.slice(initialEditRangeIndex, lastEditRangeIndex); - return TypeScript.TextChangeRange.collapseChangesAcrossMultipleVersions(entries.map(e => e.textChangeRange)); + return ts.TextChangeRange.collapseChangesAcrossMultipleVersions(entries.map(e => e.textChangeRange)); } } class ScriptSnapshotShim implements ts.ScriptSnapshotShim { - private lineMap: TypeScript.LineMap = null; + private lineMap: number[] = null; private textSnapshot: string; private version: number; @@ -74,10 +74,10 @@ module Harness.LanguageService { public getLineStartPositions(): string { if (this.lineMap === null) { - this.lineMap = TypeScript.LineMap1.fromString(this.textSnapshot); + this.lineMap = ts.computeLineStarts(this.textSnapshot); } - return JSON.stringify(this.lineMap.lineStarts()); + return JSON.stringify(this.lineMap); } public getChangeRange(oldScript: ts.ScriptSnapshotShim): string { @@ -108,7 +108,7 @@ module Harness.LanguageService { public acquireDocument( fileName: string, compilationSettings: ts.CompilerOptions, - scriptSnapshot: TypeScript.IScriptSnapshot, + scriptSnapshot: ts.IScriptSnapshot, version: string, isOpen: boolean): ts.SourceFile { return ts.createSourceFile(fileName, scriptSnapshot.getText(0, scriptSnapshot.getLength()), compilationSettings.target, version, isOpen); @@ -118,10 +118,10 @@ module Harness.LanguageService { document: ts.SourceFile, fileName: string, compilationSettings: ts.CompilerOptions, - scriptSnapshot: TypeScript.IScriptSnapshot, + scriptSnapshot: ts.IScriptSnapshot, version: string, isOpen: boolean, - textChangeRange: TypeScript.TextChangeRange + textChangeRange: ts.TextChangeRange ): ts.SourceFile { return document.update(scriptSnapshot, version, isOpen, textChangeRange); } @@ -263,13 +263,13 @@ module Harness.LanguageService { } /** Parse file given its source text */ - public parseSourceText(fileName: string, sourceText: TypeScript.IScriptSnapshot): TypeScript.SourceUnitSyntax { - return TypeScript.Parser.parse(fileName, TypeScript.SimpleText.fromScriptSnapshot(sourceText), ts.ScriptTarget.Latest, TypeScript.isDTSFile(fileName)).sourceUnit(); + public parseSourceText(fileName: string, sourceText: ts.IScriptSnapshot): ts.SourceFile { + return ts.createSourceFile(fileName, sourceText.getText(0, sourceText.getLength()), ts.ScriptTarget.Latest, "1", true); } /** Parse a file on disk given its fileName */ public parseFile(fileName: string) { - var sourceText = TypeScript.ScriptSnapshot.fromString(Harness.IO.readFile(fileName)); + var sourceText = ts.ScriptSnapshot.fromString(Harness.IO.readFile(fileName)); return this.parseSourceText(fileName, sourceText); } @@ -283,22 +283,22 @@ module Harness.LanguageService { assert.isTrue(line >= 1); assert.isTrue(col >= 1); - return script.lineMap.getPosition(line - 1, col - 1); + return ts.getPositionFromLineAndCharacter(script.lineMap, line, col); } /** * @param line 0 based index * @param col 0 based index */ - public positionToZeroBasedLineCol(fileName: string, position: number): TypeScript.ILineAndCharacter { + public positionToZeroBasedLineCol(fileName: string, position: number): ts.LineAndCharacter { var script: ScriptInfo = this.fileNameToScript[fileName]; assert.isNotNull(script); - var result = script.lineMap.getLineAndCharacterFromPosition(position); + var result = ts.getLineAndCharacterOfPosition(script.lineMap, position); - assert.isTrue(result.line() >= 0); - assert.isTrue(result.character() >= 0); - return { line: result.line(), character: result.character() }; + assert.isTrue(result.line >= 1); + assert.isTrue(result.character >= 1); + return { line: result.line - 1, character: result.character - 1 }; } /** Verify that applying edits to sourceFileName result in the content of the file baselineFileName */ diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index 592dce5c2ea..f46f9ae3698 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -17,6 +17,7 @@ interface ProjectRunnerTestCase { baselineCheck?: boolean; // Verify the baselines of output files, if this is false, we will write to output to the disk but there is no verification of baselines runTest?: boolean; // Run the resulting test bug?: string; // If there is any bug associated with this test case + noResolve?: boolean; } interface ProjectRunnerTestCaseResolutionInfo extends ProjectRunnerTestCase { @@ -132,7 +133,7 @@ class ProjectRunner extends RunnerBase { var checker = program.getTypeChecker(/*fullTypeCheck*/ true); errors = checker.getDiagnostics(); var emitResult = checker.emitFiles(); - errors = ts.concatenate(errors, emitResult.errors); + errors = ts.concatenate(errors, emitResult.diagnostics); sourceMapData = emitResult.sourceMaps; // Clean up source map data that will be used in baselining @@ -148,10 +149,10 @@ class ProjectRunner extends RunnerBase { } return { - moduleKind: moduleKind, - program: program, - errors: errors, - sourceMapData: sourceMapData + moduleKind, + program, + errors, + sourceMapData }; function createCompilerOptions(): ts.CompilerOptions { @@ -162,7 +163,8 @@ class ProjectRunner extends RunnerBase { outDir: testCase.outDir, mapRoot: testCase.resolveMapRoot && testCase.mapRoot ? sys.resolvePath(testCase.mapRoot) : testCase.mapRoot, sourceRoot: testCase.resolveSourceRoot && testCase.sourceRoot ? sys.resolvePath(testCase.sourceRoot) : testCase.sourceRoot, - module: moduleKind + module: moduleKind, + noResolve: testCase.noResolve }; } @@ -183,10 +185,10 @@ class ProjectRunner extends RunnerBase { function createCompilerHost(): ts.CompilerHost { return { - getSourceFile: getSourceFile, + getSourceFile, getDefaultLibFilename: options => options.target === ts.ScriptTarget.ES6 ? "lib.es6.d.ts" : "lib.d.ts", - writeFile: writeFile, - getCurrentDirectory: getCurrentDirectory, + writeFile, + getCurrentDirectory, getCanonicalFileName: Harness.Compiler.getCanonicalFileName, useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames, getNewLine: () => sys.newLine @@ -201,12 +203,12 @@ class ProjectRunner extends RunnerBase { var projectCompilerResult = compileProjectFiles(moduleKind, () => testCase.inputFiles, getSourceFileText, writeFile); return { - moduleKind: moduleKind, + moduleKind, program: projectCompilerResult.program, sourceMapData: projectCompilerResult.sourceMapData, - outputFiles: outputFiles, + outputFiles, errors: projectCompilerResult.errors, - nonSubfolderDiskFiles: nonSubfolderDiskFiles, + nonSubfolderDiskFiles, }; function getSourceFileText(filename: string): string { @@ -272,16 +274,40 @@ class ProjectRunner extends RunnerBase { } function compileCompileDTsFiles(compilerResult: BatchCompileProjectTestCaseResult) { - var inputDtsSourceFiles = ts.map(ts.filter(compilerResult.program.getSourceFiles(), - sourceFile => Harness.Compiler.isDTS(sourceFile.filename)), - sourceFile => { - return { emittedFileName: sourceFile.filename, code: sourceFile.text }; - }); + var allInputFiles: { emittedFileName: string; code: string; }[] = []; + var compilerOptions = compilerResult.program.getCompilerOptions(); + var compilerHost = compilerResult.program.getCompilerHost(); + ts.forEach(compilerResult.program.getSourceFiles(), sourceFile => { + if (Harness.Compiler.isDTS(sourceFile.filename)) { + allInputFiles.unshift({ emittedFileName: sourceFile.filename, code: sourceFile.text }); + } + else if (ts.shouldEmitToOwnFile(sourceFile, compilerResult.program.getCompilerOptions())) { + if (compilerOptions.outDir) { + var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.filename, compilerHost.getCurrentDirectory()); + sourceFilePath = sourceFilePath.replace(compilerResult.program.getCommonSourceDirectory(), ""); + var emitOutputFilePathWithoutExtension = ts.removeFileExtension(ts.combinePaths(compilerOptions.outDir, sourceFilePath)); + } + else { + var emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.filename); + } + + var outputDtsFileName = emitOutputFilePathWithoutExtension + ".d.ts"; + allInputFiles.unshift(findOutpuDtsFile(outputDtsFileName)); + } + else { + var outputDtsFileName = ts.removeFileExtension(compilerOptions.out) + ".d.ts"; + var outputDtsFile = findOutpuDtsFile(outputDtsFileName); + if (!ts.contains(allInputFiles, outputDtsFile)) { + allInputFiles.unshift(outputDtsFile); + } + } + }); - var ouputDtsFiles = ts.filter(compilerResult.outputFiles, ouputFile => Harness.Compiler.isDTS(ouputFile.emittedFileName)); - var allInputFiles = inputDtsSourceFiles.concat(ouputDtsFiles); return compileProjectFiles(compilerResult.moduleKind,getInputFiles, getSourceFileText, writeFile); + function findOutpuDtsFile(fileName: string) { + return ts.forEach(compilerResult.outputFiles, outputFile => outputFile.emittedFileName === fileName ? outputFile : undefined); + } function getInputFiles() { return ts.map(allInputFiles, outputFile => outputFile.emittedFileName); } diff --git a/src/harness/rwcRunner.ts b/src/harness/rwcRunner.ts index df843ccf885..3843a1e28b9 100644 --- a/src/harness/rwcRunner.ts +++ b/src/harness/rwcRunner.ts @@ -117,14 +117,14 @@ module RWC { }); function getHarnessCompilerInputUnit(fileName: string) { - var resolvedPath = ts.normalizeSlashes(sys.resolvePath(fileName)); + var unitName = ts.normalizeSlashes(sys.resolvePath(fileName)); try { - var content = sys.readFile(resolvedPath); + var content = sys.readFile(unitName); } catch (e) { // Leave content undefined. } - return { unitName: resolvedPath, content: content }; + return { unitName, content }; } }); diff --git a/src/services/breakpoints.ts b/src/services/breakpoints.ts index f8688b3c479..7867751a96f 100644 --- a/src/services/breakpoints.ts +++ b/src/services/breakpoints.ts @@ -38,25 +38,25 @@ module ts.BreakpointResolver { return spanInNode(tokenAtLocation); function textSpan(startNode: Node, endNode?: Node) { - return TypeScript.TextSpan.fromBounds(startNode.getStart(), (endNode || startNode).getEnd()); + return TextSpan.fromBounds(startNode.getStart(), (endNode || startNode).getEnd()); } - function spanInNodeIfStartsOnSameLine(node: Node, otherwiseOnNode?: Node): TypeScript.TextSpan { + function spanInNodeIfStartsOnSameLine(node: Node, otherwiseOnNode?: Node): TextSpan { if (node && lineOfPosition === sourceFile.getLineAndCharacterFromPosition(node.getStart()).line) { return spanInNode(node); } return spanInNode(otherwiseOnNode); } - function spanInPreviousNode(node: Node): TypeScript.TextSpan { + function spanInPreviousNode(node: Node): TextSpan { return spanInNode(findPrecedingToken(node.pos, sourceFile)); } - function spanInNextNode(node: Node): TypeScript.TextSpan { + function spanInNextNode(node: Node): TextSpan { return spanInNode(findNextToken(node, node.parent)); } - function spanInNode(node: Node): TypeScript.TextSpan { + function spanInNode(node: Node): TextSpan { if (node) { if (isExpression(node)) { if (node.parent.kind === SyntaxKind.DoStatement) { @@ -256,7 +256,7 @@ module ts.BreakpointResolver { } } - function spanInVariableDeclaration(variableDeclaration: VariableDeclaration): TypeScript.TextSpan { + function spanInVariableDeclaration(variableDeclaration: VariableDeclaration): TextSpan { // If declaration of for in statement, just set the span in parent if (variableDeclaration.parent.kind === SyntaxKind.ForInStatement) { return spanInNode(variableDeclaration.parent); @@ -301,7 +301,7 @@ module ts.BreakpointResolver { !!(parameter.flags & NodeFlags.Public) || !!(parameter.flags & NodeFlags.Private); } - function spanInParameterDeclaration(parameter: ParameterDeclaration): TypeScript.TextSpan { + function spanInParameterDeclaration(parameter: ParameterDeclaration): TextSpan { if (canHaveSpanInParameterDeclaration(parameter)) { return textSpan(parameter); } @@ -324,7 +324,7 @@ module ts.BreakpointResolver { (functionDeclaration.parent.kind === SyntaxKind.ClassDeclaration && functionDeclaration.kind !== SyntaxKind.Constructor); } - function spanInFunctionDeclaration(functionDeclaration: FunctionLikeDeclaration): TypeScript.TextSpan { + function spanInFunctionDeclaration(functionDeclaration: FunctionLikeDeclaration): TextSpan { // No breakpoints in the function signature if (!functionDeclaration.body) { return undefined; @@ -339,7 +339,7 @@ module ts.BreakpointResolver { return spanInNode(functionDeclaration.body); } - function spanInFunctionBlock(block: Block): TypeScript.TextSpan { + function spanInFunctionBlock(block: Block): TextSpan { var nodeForSpanInBlock = block.statements.length ? block.statements[0] : block.getLastToken(); if (canFunctionHaveSpanInWholeDeclaration(block.parent)) { return spanInNodeIfStartsOnSameLine(block.parent, nodeForSpanInBlock); @@ -348,7 +348,7 @@ module ts.BreakpointResolver { return spanInNode(nodeForSpanInBlock); } - function spanInBlock(block: Block): TypeScript.TextSpan { + function spanInBlock(block: Block): TextSpan { switch (block.parent.kind) { case SyntaxKind.ModuleDeclaration: if (getModuleInstanceState(block.parent) !== ModuleInstanceState.Instantiated) { @@ -370,7 +370,7 @@ module ts.BreakpointResolver { return spanInNode(block.statements[0]); } - function spanInForStatement(forStatement: ForStatement): TypeScript.TextSpan { + function spanInForStatement(forStatement: ForStatement): TextSpan { if (forStatement.declarations) { return spanInNode(forStatement.declarations[0]); } @@ -386,7 +386,7 @@ module ts.BreakpointResolver { } // Tokens: - function spanInOpenBraceToken(node: Node): TypeScript.TextSpan { + function spanInOpenBraceToken(node: Node): TextSpan { switch (node.parent.kind) { case SyntaxKind.EnumDeclaration: var enumDeclaration = node.parent; @@ -404,7 +404,7 @@ module ts.BreakpointResolver { return spanInNode(node.parent); } - function spanInCloseBraceToken(node: Node): TypeScript.TextSpan { + function spanInCloseBraceToken(node: Node): TextSpan { switch (node.parent.kind) { case SyntaxKind.ModuleBlock: // If this is not instantiated module block no bp span @@ -439,7 +439,7 @@ module ts.BreakpointResolver { } } - function spanInOpenParenToken(node: Node): TypeScript.TextSpan { + function spanInOpenParenToken(node: Node): TextSpan { if (node.parent.kind === SyntaxKind.DoStatement) { // Go to while keyword and do action instead return spanInPreviousNode(node); @@ -449,7 +449,7 @@ module ts.BreakpointResolver { return spanInNode(node.parent); } - function spanInCloseParenToken(node: Node): TypeScript.TextSpan { + function spanInCloseParenToken(node: Node): TextSpan { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { case SyntaxKind.FunctionExpression: @@ -473,7 +473,7 @@ module ts.BreakpointResolver { return spanInNode(node.parent); } - function spanInColonToken(node: Node): TypeScript.TextSpan { + function spanInColonToken(node: Node): TextSpan { // Is this : specifying return annotation of the function declaration if (isAnyFunction(node.parent) || node.parent.kind === SyntaxKind.PropertyAssignment) { return spanInPreviousNode(node); @@ -482,7 +482,7 @@ module ts.BreakpointResolver { return spanInNode(node.parent); } - function spanInGreaterThanOrLessThanToken(node: Node): TypeScript.TextSpan { + function spanInGreaterThanOrLessThanToken(node: Node): TextSpan { if (node.parent.kind === SyntaxKind.TypeAssertion) { return spanInNode((node.parent).operand); } @@ -490,7 +490,7 @@ module ts.BreakpointResolver { return spanInNode(node.parent); } - function spanInWhileKeyword(node: Node): TypeScript.TextSpan { + function spanInWhileKeyword(node: Node): TextSpan { if (node.parent.kind === SyntaxKind.DoStatement) { // Set span on while expression return textSpan(node, findNextToken((node.parent).expression, node.parent)); diff --git a/src/services/formatting.ts b/src/services/formatting.ts index dbe85fc4c64..2fdbebad79c 100644 --- a/src/services/formatting.ts +++ b/src/services/formatting.ts @@ -252,7 +252,7 @@ module ts.formatting { rulesProvider: RulesProvider, requestKind: FormattingRequestKind): TextChange[] { - var rangeContainsError = prepareRangeContainsErrorFunction(sourceFile.syntacticErrors, originalRange); + var rangeContainsError = prepareRangeContainsErrorFunction(sourceFile.getSyntacticDiagnostics(), originalRange); // formatting context is used by rules provider var formattingContext = new FormattingContext(sourceFile, requestKind); @@ -361,8 +361,8 @@ module ts.formatting { delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta() + delta); } return { - indentation: indentation, - delta: delta + indentation, + delta } } @@ -834,7 +834,7 @@ module ts.formatting { } function newTextChange(start: number, len: number, newText: string): TextChange { - return { span: new TypeScript.TextSpan(start, len), newText: newText } + return { span: new TextSpan(start, len), newText } } function recordDelete(start: number, len: number) { diff --git a/src/services/formatting/references.ts b/src/services/formatting/references.ts index 3d19b33d821..9f4b7e37436 100644 --- a/src/services/formatting/references.ts +++ b/src/services/formatting/references.ts @@ -13,6 +13,7 @@ // limitations under the License. // +/// /// /// /// diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index 4b42591936e..2485945df0b 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -24,7 +24,7 @@ module ts.formatting { return name; } } - throw new Error(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Unknown_rule, null)); + throw new Error("Unknown rule"); } [name: string]: any; diff --git a/src/services/formatting/rulesProvider.ts b/src/services/formatting/rulesProvider.ts index 1469e86971b..7ad1b65400c 100644 --- a/src/services/formatting/rulesProvider.ts +++ b/src/services/formatting/rulesProvider.ts @@ -22,7 +22,7 @@ module ts.formatting { private activeRules: Rule[]; private rulesMap: RulesMap; - constructor(private logger: TypeScript.Logger) { + constructor(private logger: Logger) { this.globalRules = new Rules(); } diff --git a/src/services/formatting/tokenSpan.ts b/src/services/formatting/tokenSpan.ts index 95f9bab3eee..1d8173a8227 100644 --- a/src/services/formatting/tokenSpan.ts +++ b/src/services/formatting/tokenSpan.ts @@ -16,7 +16,7 @@ /// module ts.formatting { - export class TokenSpan extends TypeScript.TextSpan { + export class TokenSpan extends TextSpan { constructor(public kind: SyntaxKind, start: number, length: number) { super(start, length); } diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index ca06d40fa88..6e4303d0cd8 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -1,5 +1,4 @@ /// -/// module ts.NavigationBar { export function getNavigationBarItems(sourceFile: SourceFile): ts.NavigationBarItem[] { @@ -235,8 +234,11 @@ module ts.NavigationBar { return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.functionElement); case SyntaxKind.VariableDeclaration: - if (node.flags & NodeFlags.Const) { - return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.constantElement); + if (isConst(node)) { + return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.constElement); + } + else if (isLet(node)) { + return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.letElement); } else { return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.variableElement); @@ -257,18 +259,18 @@ module ts.NavigationBar { return !text || text.trim() === ""; } - function getNavigationBarItem(text: string, kind: string, kindModifiers: string, spans: TypeScript.TextSpan[], childItems: ts.NavigationBarItem[] = [], indent: number = 0): ts.NavigationBarItem { + function getNavigationBarItem(text: string, kind: string, kindModifiers: string, spans: TextSpan[], childItems: NavigationBarItem[] = [], indent: number = 0): NavigationBarItem { if (isEmpty(text)) { return undefined; } return { - text: text, - kind: kind, - kindModifiers: kindModifiers, - spans: spans, - childItems: childItems, - indent: indent, + text, + kind, + kindModifiers, + spans, + childItems, + indent, bolded: false, grayed: false }; @@ -424,8 +426,8 @@ module ts.NavigationBar { function getNodeSpan(node: Node) { return node.kind === SyntaxKind.SourceFile - ? TypeScript.TextSpan.fromBounds(node.getFullStart(), node.getEnd()) - : TypeScript.TextSpan.fromBounds(node.getStart(), node.getEnd()); + ? TextSpan.fromBounds(node.getFullStart(), node.getEnd()) + : TextSpan.fromBounds(node.getStart(), node.getEnd()); } function getTextOfNode(node: Node): string { diff --git a/src/services/outliningElementsCollector.ts b/src/services/outliningElementsCollector.ts index aaaedb735ea..27f75b8d20e 100644 --- a/src/services/outliningElementsCollector.ts +++ b/src/services/outliningElementsCollector.ts @@ -24,8 +24,8 @@ module ts { * @param autoCollapse Whether or not this region should be automatically collapsed when * the 'Collapse to Definitions' command is invoked. */ - textSpan: TypeScript.TextSpan; - hintSpan: TypeScript.TextSpan; + textSpan: TextSpan; + hintSpan: TextSpan; bannerText: string; autoCollapse: boolean; } @@ -38,8 +38,8 @@ module ts { function addOutliningSpan(hintSpanNode: Node, startElement: Node, endElement: Node, autoCollapse: boolean) { if (hintSpanNode && startElement && endElement) { var span: OutliningSpan = { - textSpan: TypeScript.TextSpan.fromBounds(startElement.pos, endElement.end), - hintSpan: TypeScript.TextSpan.fromBounds(hintSpanNode.getStart(), hintSpanNode.end), + textSpan: TextSpan.fromBounds(startElement.pos, endElement.end), + hintSpan: TextSpan.fromBounds(hintSpanNode.getStart(), hintSpanNode.end), bannerText: collapseText, autoCollapse: autoCollapse }; @@ -86,7 +86,7 @@ module ts { else { // Block was a standalone block. In this case we want to only collapse // the span of the block, independent of any parent span. - var span = TypeScript.TextSpan.fromBounds(n.getStart(), n.end); + var span = TextSpan.fromBounds(n.getStart(), n.end); elements.push({ textSpan: span, hintSpan: span, diff --git a/src/services/resources/diagnosticCode.generated.ts b/src/services/resources/diagnosticCode.generated.ts index 1b140105b16..e5878978fcc 100644 --- a/src/services/resources/diagnosticCode.generated.ts +++ b/src/services/resources/diagnosticCode.generated.ts @@ -5,7 +5,7 @@ module TypeScript { warning_TS_0_1: "warning TS{0}: {1}", Unrecognized_escape_sequence: "Unrecognized escape sequence.", Unexpected_character_0: "Unexpected character {0}.", - Missing_close_quote_character: "Missing close quote character.", + Unterminated_string_literal: "Unterminated string literal.", Identifier_expected: "Identifier expected.", _0_keyword_expected: "'{0}' keyword expected.", _0_expected: "'{0}' expected.", @@ -97,6 +97,8 @@ module TypeScript { Template_literal_cannot_be_used_as_an_element_name: "Template literal cannot be used as an element name.", Computed_property_names_cannot_be_used_here: "Computed property names cannot be used here.", yield_expression_must_be_contained_within_a_generator_declaration: "'yield' expression must be contained within a generator declaration.", + Unterminated_regular_expression_literal: "Unterminated regular expression literal.", + Unterminated_template_literal: "Unterminated template literal.", Duplicate_identifier_0: "Duplicate identifier '{0}'.", The_name_0_does_not_exist_in_the_current_scope: "The name '{0}' does not exist in the current scope.", The_name_0_does_not_refer_to_a_value: "The name '{0}' does not refer to a value.", diff --git a/src/services/resources/diagnosticInformationMap.generated.ts b/src/services/resources/diagnosticInformationMap.generated.ts index 8e911f469ef..d6597a008df 100644 --- a/src/services/resources/diagnosticInformationMap.generated.ts +++ b/src/services/resources/diagnosticInformationMap.generated.ts @@ -6,7 +6,7 @@ module TypeScript { "warning TS{0}: {1}": { "code": 1, "category": DiagnosticCategory.NoPrefix }, "Unrecognized escape sequence.": { "code": 1000, "category": DiagnosticCategory.Error }, "Unexpected character {0}.": { "code": 1001, "category": DiagnosticCategory.Error }, - "Missing close quote character.": { "code": 1002, "category": DiagnosticCategory.Error }, + "Unterminated string literal.": { "code": 1002, "category": DiagnosticCategory.Error }, "Identifier expected.": { "code": 1003, "category": DiagnosticCategory.Error }, "'{0}' keyword expected.": { "code": 1004, "category": DiagnosticCategory.Error }, "'{0}' expected.": { "code": 1005, "category": DiagnosticCategory.Error }, @@ -99,6 +99,8 @@ module TypeScript { "Template literal cannot be used as an element name.": { "code": 1111, "category": DiagnosticCategory.Error }, "Computed property names cannot be used here.": { "code": 1112, "category": DiagnosticCategory.Error }, "'yield' expression must be contained within a generator declaration.": { "code": 1113, "category": DiagnosticCategory.Error }, + "Unterminated regular expression literal.": { "code": 1114, "category": DiagnosticCategory.Error }, + "Unterminated template literal.": { "code": 1115, "category": DiagnosticCategory.Error }, "Duplicate identifier '{0}'.": { "code": 2000, "category": DiagnosticCategory.Error }, "The name '{0}' does not exist in the current scope.": { "code": 2001, "category": DiagnosticCategory.Error }, "The name '{0}' does not refer to a value.": { "code": 2002, "category": DiagnosticCategory.Error }, diff --git a/src/services/resources/diagnosticMessages.json b/src/services/resources/diagnosticMessages.json index c238568eac6..724edbd8f3b 100644 --- a/src/services/resources/diagnosticMessages.json +++ b/src/services/resources/diagnosticMessages.json @@ -15,7 +15,7 @@ "category": "Error", "code": 1001 }, - "Missing close quote character.": { + "Unterminated string literal.": { "category": "Error", "code": 1002 }, @@ -383,6 +383,14 @@ "category": "Error", "code": 1113 }, + "Unterminated regular expression literal.": { + "category": "Error", + "code": 1114 + }, + "Unterminated template literal.": { + "category": "Error", + "code": 1115 + }, "Duplicate identifier '{0}'.": { "category": "Error", "code": 2000 diff --git a/src/services/services.ts b/src/services/services.ts index 25e4e9c8862..07123eee001 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -4,7 +4,7 @@ /// /// -/// +/// /// /// /// @@ -13,17 +13,6 @@ /// /// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// - module ts { export interface Node { getSourceFile(): SourceFile; @@ -70,11 +59,72 @@ module ts { } export interface SourceFile { - getScriptSnapshot(): TypeScript.IScriptSnapshot; + getScriptSnapshot(): IScriptSnapshot; getNamedDeclarations(): Declaration[]; - update(scriptSnapshot: TypeScript.IScriptSnapshot, version: string, isOpen: boolean, textChangeRange: TypeScript.TextChangeRange): SourceFile; + update(scriptSnapshot: IScriptSnapshot, version: string, isOpen: boolean, textChangeRange: TextChangeRange): SourceFile; } + /** + * Represents an immutable snapshot of a script at a specified time.Once acquired, the + * snapshot is observably immutable. i.e. the same calls with the same parameters will return + * the same values. + */ + export interface IScriptSnapshot { + /** Gets a portion of the script snapshot specified by [start, end). */ + getText(start: number, end: number): string; + + /** Gets the length of this script snapshot. */ + getLength(): number; + + /** + * This call returns the array containing the start position of every line. + * i.e."[0, 10, 55]". TODO: consider making this optional. The language service could + * always determine this (albeit in a more expensive manner). + */ + getLineStartPositions(): number[]; + + /** + * Gets the TextChangeRange that describe how the text changed between this text and + * an older version. This information is used by the incremental parser to determine + * what sections of the script need to be re-parsed. 'undefined' can be returned if the + * change range cannot be determined. However, in that case, incremental parsing will + * not happen and the entire document will be re - parsed. + */ + getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; + } + + export module ScriptSnapshot { + class StringScriptSnapshot implements IScriptSnapshot { + private _lineStartPositions: number[] = undefined; + + constructor(private text: string) { + } + + public getText(start: number, end: number): string { + return this.text.substring(start, end); + } + + public getLength(): number { + return this.text.length; + } + + public getLineStartPositions(): number[] { + if (!this._lineStartPositions) { + this._lineStartPositions = computeLineStarts(this.text); + } + + return this._lineStartPositions; + } + + public getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange { + throw new Error("not yet implemented"); + } + } + + export function fromString(text: string): IScriptSnapshot { + return new StringScriptSnapshot(text); + } + } export interface PreProcessedFileInfo { referencedFiles: FileReference[]; importedFiles: FileReference[]; @@ -664,13 +714,20 @@ module ts { class SourceFileObject extends NodeObject implements SourceFile { public filename: string; public text: string; - public getLineAndCharacterFromPosition(position: number): { line: number; character: number } { return null; } - public getPositionFromLineAndCharacter(line: number, character: number): number { return -1; } - public getLineStarts(): number[] { return undefined; } + + // These methods will have their implementation provided by the implementation the + // compiler actually exports off of SourceFile. + public getLineAndCharacterFromPosition: (position: number) => LineAndCharacter; + public getPositionFromLineAndCharacter: (line: number, character: number) => number; + public getLineStarts: () => number[]; + public getSyntacticDiagnostics: () => Diagnostic[]; + public amdDependencies: string[]; + public amdModuleName: string; public referencedFiles: FileReference[]; - public syntacticErrors: Diagnostic[]; - public semanticErrors: Diagnostic[]; + public parseDiagnostics: Diagnostic[]; + public grammarDiagnostics: Diagnostic[]; + public semanticDiagnostics: Diagnostic[]; public hasNoDefaultLib: boolean; public externalModuleIndicator: Node; // The first node that causes this file to be an external module public nodeCount: number; @@ -682,10 +739,10 @@ module ts { public languageVersion: ScriptTarget; public identifiers: Map; - private scriptSnapshot: TypeScript.IScriptSnapshot; + private scriptSnapshot: IScriptSnapshot; private namedDeclarations: Declaration[]; - public getScriptSnapshot(): TypeScript.IScriptSnapshot { + public getScriptSnapshot(): IScriptSnapshot { return this.scriptSnapshot; } @@ -761,28 +818,28 @@ module ts { return this.namedDeclarations; } - public update(scriptSnapshot: TypeScript.IScriptSnapshot, version: string, isOpen: boolean, textChangeRange: TypeScript.TextChangeRange): SourceFile { + public update(scriptSnapshot: IScriptSnapshot, version: string, isOpen: boolean, textChangeRange: TextChangeRange): SourceFile { if (textChangeRange && Debug.shouldAssert(AssertionLevel.Normal)) { var oldText = this.scriptSnapshot; var newText = scriptSnapshot; - TypeScript.Debug.assert((oldText.getLength() - textChangeRange.span().length() + textChangeRange.newLength()) === newText.getLength()); + Debug.assert((oldText.getLength() - textChangeRange.span().length() + textChangeRange.newLength()) === newText.getLength()); if (Debug.shouldAssert(AssertionLevel.VeryAggressive)) { var oldTextPrefix = oldText.getText(0, textChangeRange.span().start()); var newTextPrefix = newText.getText(0, textChangeRange.span().start()); - TypeScript.Debug.assert(oldTextPrefix === newTextPrefix); + Debug.assert(oldTextPrefix === newTextPrefix); var oldTextSuffix = oldText.getText(textChangeRange.span().end(), oldText.getLength()); var newTextSuffix = newText.getText(textChangeRange.newSpan().end(), newText.getLength()); - TypeScript.Debug.assert(oldTextSuffix === newTextSuffix); + Debug.assert(oldTextSuffix === newTextSuffix); } } return SourceFileObject.createSourceFileObject(this.filename, scriptSnapshot, this.languageVersion, version, isOpen); } - public static createSourceFileObject(filename: string, scriptSnapshot: TypeScript.IScriptSnapshot, languageVersion: ScriptTarget, version: string, isOpen: boolean) { + public static createSourceFileObject(filename: string, scriptSnapshot: IScriptSnapshot, languageVersion: ScriptTarget, version: string, isOpen: boolean) { var newSourceFile = createSourceFile(filename, scriptSnapshot.getText(0, scriptSnapshot.getLength()), languageVersion, version, isOpen); newSourceFile.scriptSnapshot = scriptSnapshot; return newSourceFile; @@ -801,7 +858,7 @@ module ts { getScriptFileNames(): string[]; getScriptVersion(fileName: string): string; getScriptIsOpen(fileName: string): boolean; - getScriptSnapshot(fileName: string): TypeScript.IScriptSnapshot; + getScriptSnapshot(fileName: string): IScriptSnapshot; getLocalizedDiagnosticMessages(): any; getCancellationToken(): CancellationToken; getCurrentDirectory(): string; @@ -819,37 +876,33 @@ module ts { getSemanticDiagnostics(fileName: string): Diagnostic[]; getCompilerOptionsDiagnostics(): Diagnostic[]; - getSyntacticClassifications(fileName: string, span: TypeScript.TextSpan): ClassifiedSpan[]; - getSemanticClassifications(fileName: string, span: TypeScript.TextSpan): ClassifiedSpan[]; + getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; + getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; getCompletionsAtPosition(fileName: string, position: number, isMemberCompletion: boolean): CompletionInfo; getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TypeScript.TextSpan; + getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; - getBreakpointStatementAtPosition(fileName: string, position: number): TypeScript.TextSpan; + getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; - // Obsolete. Use getSignatureHelpItems instead. - getSignatureAtPosition(fileName: string, position: number): SignatureInfo; - getRenameInfo(fileName: string, position: number): RenameInfo; findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - getImplementorsAtPosition(fileName: string, position: number): ReferenceEntry[]; getNavigateToItems(searchValue: string): NavigateToItem[]; getNavigationBarItems(fileName: string): NavigationBarItem[]; getOutliningSpans(fileName: string): OutliningSpan[]; getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; - getBraceMatchingAtPosition(fileName: string, position: number): TypeScript.TextSpan[]; + getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; @@ -858,48 +911,13 @@ module ts { getEmitOutput(fileName: string): EmitOutput; - //getSyntaxTree(fileName: string): TypeScript.SyntaxTree; + getSourceFile(filename: string): SourceFile; dispose(): void; } - export interface SignatureInfo { - actual: ActualSignatureInfo; - formal: FormalSignatureItemInfo[]; // Formal signatures - activeFormal: number; // Index of the "best match" formal signature - } - - export interface FormalSignatureItemInfo { - signatureInfo: string; - typeParameters: FormalTypeParameterInfo[]; - parameters: FormalParameterInfo[]; // Array of parameters - docComment: string; // Help for the signature - } - - export interface FormalTypeParameterInfo { - name: string; // Type parameter name - docComment: string; // Comments that contain help for the parameter - minChar: number; // minChar for parameter info in the formal signature info string - limChar: number; // lim char for parameter info in the formal signature info string - } - - export interface FormalParameterInfo { - name: string; // Parameter name - isVariable: boolean; // true if parameter is var args - docComment: string; // Comments that contain help for the parameter - minChar: number; // minChar for parameter info in the formal signature info string - limChar: number; // lim char for parameter info in the formal signature info string - } - - export interface ActualSignatureInfo { - parameterMinChar: number; - parameterLimChar: number; - currentParameterIsTypeParameter: boolean; // current parameter is a type argument or a normal argument - currentParameter: number; // Index of active parameter in "parameters" or "typeParamters" array - } - export interface ClassifiedSpan { - textSpan: TypeScript.TextSpan; + textSpan: TextSpan; classificationType: string; // ClassificationTypeNames } @@ -907,7 +925,7 @@ module ts { text: string; kind: string; kindModifiers: string; - spans: TypeScript.TextSpan[]; + spans: TextSpan[]; childItems: NavigationBarItem[]; indent: number; bolded: boolean; @@ -926,17 +944,17 @@ module ts { } export class TextChange { - span: TypeScript.TextSpan; + span: TextSpan; newText: string; } export interface RenameLocation { - textSpan: TypeScript.TextSpan; + textSpan: TextSpan; fileName: string; } export interface ReferenceEntry { - textSpan: TypeScript.TextSpan; + textSpan: TextSpan; fileName: string; isWriteAccess: boolean; } @@ -947,7 +965,7 @@ module ts { kindModifiers: string; matchKind: string; fileName: string; - textSpan: TypeScript.TextSpan; + textSpan: TextSpan; containerName: string; containerKind: string; } @@ -972,7 +990,7 @@ module ts { export interface DefinitionInfo { fileName: string; - textSpan: TypeScript.TextSpan; + textSpan: TextSpan; kind: string; name: string; containerKind: string; @@ -1012,7 +1030,7 @@ module ts { export interface QuickInfo { kind: string; kindModifiers: string; - textSpan: TypeScript.TextSpan; + textSpan: TextSpan; displayParts: SymbolDisplayPart[]; documentation: SymbolDisplayPart[]; } @@ -1024,7 +1042,7 @@ module ts { fullDisplayName: string; kind: string; kindModifiers: string; - triggerSpan: TypeScript.TextSpan; + triggerSpan: TextSpan; } export interface SignatureHelpParameter { @@ -1055,7 +1073,7 @@ module ts { */ export interface SignatureHelpItems { items: SignatureHelpItem[]; - applicableSpan: TypeScript.TextSpan; + applicableSpan: TextSpan; selectedItemIndex: number; argumentIndex: number; argumentCount: number; @@ -1127,14 +1145,14 @@ module ts { } export interface Classifier { - getClassificationsForLine(text: string, lexState: EndOfLineState): ClassificationResult; + getClassificationsForLine(text: string, lexState: EndOfLineState, classifyKeywordsInGenerics?: boolean): ClassificationResult; } export interface DocumentRegistry { acquireDocument( filename: string, compilationSettings: CompilerOptions, - scriptSnapshot: TypeScript.IScriptSnapshot, + scriptSnapshot: IScriptSnapshot, version: string, isOpen: boolean): SourceFile; @@ -1142,10 +1160,10 @@ module ts { sourceFile: SourceFile, filename: string, compilationSettings: CompilerOptions, - scriptSnapshot: TypeScript.IScriptSnapshot, + scriptSnapshot: IScriptSnapshot, version: string, isOpen: boolean, - textChangeRange: TypeScript.TextChangeRange + textChangeRange: TextChangeRange ): SourceFile; releaseDocument(filename: string, compilationSettings: CompilerOptions): void @@ -1224,7 +1242,9 @@ module ts { static alias = "alias"; - static constantElement = "constant"; + static constElement = "const"; + + static letElement = "let"; } export class ScriptElementKindModifier { @@ -1263,10 +1283,6 @@ module ts { prefix = 3 } - interface IncrementalParse { - (oldSyntaxTree: TypeScript.SyntaxTree, textChangeRange: TypeScript.TextChangeRange, newText: TypeScript.ISimpleText): TypeScript.SyntaxTree - } - /// Language Service interface CompletionSession { @@ -1289,7 +1305,7 @@ module ts { filename: string; version: string; isOpen: boolean; - sourceText?: TypeScript.IScriptSnapshot; + sourceText?: IScriptSnapshot; } interface DocumentRegistryEntry { @@ -1325,8 +1341,8 @@ module ts { writeSpace: text => writeKind(text, SymbolDisplayPartKind.space), writeStringLiteral: text => writeKind(text, SymbolDisplayPartKind.stringLiteral), writeParameter: text => writeKind(text, SymbolDisplayPartKind.parameterName), - writeSymbol: writeSymbol, - writeLine: writeLine, + writeSymbol, + writeLine, increaseIndent: () => { indent++; }, decreaseIndent: () => { indent--; }, clear: resetWriter, @@ -1579,7 +1595,7 @@ module ts { return this.getEntry(filename).isOpen; } - public getScriptSnapshot(filename: string): TypeScript.IScriptSnapshot { + public getScriptSnapshot(filename: string): IScriptSnapshot { var file = this.getEntry(filename); if (!file.sourceText) { file.sourceText = this.host.getScriptSnapshot(file.filename); @@ -1587,10 +1603,10 @@ module ts { return file.sourceText; } - public getChangeRange(filename: string, lastKnownVersion: string, oldScriptSnapshot: TypeScript.IScriptSnapshot): TypeScript.TextChangeRange { + public getChangeRange(filename: string, lastKnownVersion: string, oldScriptSnapshot: IScriptSnapshot): TextChangeRange { var currentVersion = this.getVersion(filename); if (lastKnownVersion === currentVersion) { - return TypeScript.TextChangeRange.unchanged; // "No changes" + return TextChangeRange.unchanged; // "No changes" } var scriptSnapshot = this.getScriptSnapshot(filename); @@ -1606,7 +1622,6 @@ module ts { private currentFilename: string = ""; private currentFileVersion: string = null; private currentSourceFile: SourceFile = null; - private currentFileSyntaxTree: TypeScript.SyntaxTree = null; constructor(private host: LanguageServiceHost) { this.hostCache = new HostCache(host); @@ -1614,20 +1629,15 @@ module ts { private initialize(filename: string) { // ensure that both source file and syntax tree are either initialized or not initialized - Debug.assert(!!this.currentFileSyntaxTree === !!this.currentSourceFile); var start = new Date().getTime(); this.hostCache = new HostCache(this.host); this.host.log("SyntaxTreeCache.Initialize: new HostCache: " + (new Date().getTime() - start)); var version = this.hostCache.getVersion(filename); - var syntaxTree: TypeScript.SyntaxTree = null; var sourceFile: SourceFile; - if (this.currentFileSyntaxTree === null || this.currentFilename !== filename) { + if (this.currentFilename !== filename) { var scriptSnapshot = this.hostCache.getScriptSnapshot(filename); - var start = new Date().getTime(); - syntaxTree = this.createSyntaxTree(filename, scriptSnapshot); - this.host.log("SyntaxTreeCache.Initialize: createSyntaxTree: " + (new Date().getTime() - start)); var start = new Date().getTime(); sourceFile = createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, /*isOpen*/ true); @@ -1640,11 +1650,6 @@ module ts { else if (this.currentFileVersion !== version) { var scriptSnapshot = this.hostCache.getScriptSnapshot(filename); - var start = new Date().getTime(); - syntaxTree = this.updateSyntaxTree(filename, scriptSnapshot, - this.currentSourceFile.getScriptSnapshot(), this.currentFileSyntaxTree, this.currentFileVersion); - this.host.log("SyntaxTreeCache.Initialize: updateSyntaxTree: " + (new Date().getTime() - start)); - var editRange = this.hostCache.getChangeRange(filename, this.currentFileVersion, this.currentSourceFile.getScriptSnapshot()); var start = new Date().getTime(); @@ -1658,12 +1663,10 @@ module ts { this.host.log("SyntaxTreeCache.Initialize: fixupParentRefs : " + (new Date().getTime() - start)); } - if (syntaxTree !== null) { - Debug.assert(sourceFile !== undefined); + if (sourceFile) { // All done, ensure state is up to date this.currentFileVersion = version; this.currentFilename = filename; - this.currentFileSyntaxTree = syntaxTree; this.currentSourceFile = sourceFile; } @@ -1684,115 +1687,17 @@ module ts { } } - public getCurrentFileSyntaxTree(filename: string): TypeScript.SyntaxTree { - this.initialize(filename); - return this.currentFileSyntaxTree; - } - public getCurrentSourceFile(filename: string): SourceFile { this.initialize(filename); return this.currentSourceFile; } - public getCurrentScriptSnapshot(filename: string): TypeScript.IScriptSnapshot { - // update currentFileScriptSnapshot as a part of 'getCurrentFileSyntaxTree' call - this.getCurrentFileSyntaxTree(filename); + public getCurrentScriptSnapshot(filename: string): IScriptSnapshot { return this.getCurrentSourceFile(filename).getScriptSnapshot(); } - - private createSyntaxTree(filename: string, scriptSnapshot: TypeScript.IScriptSnapshot): TypeScript.SyntaxTree { - var text = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - - // For the purposes of features that use this syntax tree, we can just use the default - // compilation settings. The features only use the syntax (and not the diagnostics), - // and the syntax isn't affected by the compilation settings. - var syntaxTree = TypeScript.Parser.parse(filename, text, getDefaultCompilerOptions().target, TypeScript.isDTSFile(filename)); - - return syntaxTree; - } - - private updateSyntaxTree(filename: string, scriptSnapshot: TypeScript.IScriptSnapshot, previousScriptSnapshot: TypeScript.IScriptSnapshot, previousSyntaxTree: TypeScript.SyntaxTree, previousFileVersion: string): TypeScript.SyntaxTree { - var editRange = this.hostCache.getChangeRange(filename, previousFileVersion, previousScriptSnapshot); - - // Debug.assert(newLength >= 0); - - // The host considers the entire buffer changed. So parse a completely new tree. - if (editRange === null) { - return this.createSyntaxTree(filename, scriptSnapshot); - } - - var nextSyntaxTree = TypeScript.IncrementalParser.parse( - previousSyntaxTree, editRange, TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot)); - - this.ensureInvariants(filename, editRange, nextSyntaxTree, previousScriptSnapshot, scriptSnapshot); - - return nextSyntaxTree; - } - - private ensureInvariants(filename: string, editRange: TypeScript.TextChangeRange, incrementalTree: TypeScript.SyntaxTree, oldScriptSnapshot: TypeScript.IScriptSnapshot, newScriptSnapshot: TypeScript.IScriptSnapshot) { - // First, verify that the edit range and the script snapshots make sense. - - // If this fires, then the edit range is completely bogus. Somehow the lengths of the - // old snapshot, the change range and the new snapshot aren't in sync. This is very - // bad. - var expectedNewLength = oldScriptSnapshot.getLength() - editRange.span().length() + editRange.newLength(); - var actualNewLength = newScriptSnapshot.getLength(); - - function provideMoreDebugInfo() { - - var debugInformation = ["expected length:", expectedNewLength, "and actual length:", actualNewLength, "are not equal\r\n"]; - - var oldSpan = editRange.span(); - - function prettyPrintString(s: string): string { - return '"' + s.replace(/\r/g, '\\r').replace(/\n/g, '\\n') + '"'; - } - - debugInformation.push('Edit range (old text) (start: ' + oldSpan.start() + ', end: ' + oldSpan.end() + ') \r\n'); - debugInformation.push('Old text edit range contents: ' + prettyPrintString(oldScriptSnapshot.getText(oldSpan.start(), oldSpan.end()))); - - var newSpan = editRange.newSpan(); - - debugInformation.push('Edit range (new text) (start: ' + newSpan.start() + ', end: ' + newSpan.end() + ') \r\n'); - debugInformation.push('New text edit range contents: ' + prettyPrintString(newScriptSnapshot.getText(newSpan.start(), newSpan.end()))); - - return debugInformation.join(' '); - } - - Debug.assert( - expectedNewLength === actualNewLength, - "Expected length is different from actual!", - provideMoreDebugInfo); - - if (Debug.shouldAssert(AssertionLevel.VeryAggressive)) { - // If this fires, the text change range is bogus. It says the change starts at point - // 'X', but we can see a text difference *before* that point. - var oldPrefixText = oldScriptSnapshot.getText(0, editRange.span().start()); - var newPrefixText = newScriptSnapshot.getText(0, editRange.span().start()); - Debug.assert(oldPrefixText === newPrefixText, 'Expected equal prefix texts!'); - - // If this fires, the text change range is bogus. It says the change goes only up to - // point 'X', but we can see a text difference *after* that point. - var oldSuffixText = oldScriptSnapshot.getText(editRange.span().end(), oldScriptSnapshot.getLength()); - var newSuffixText = newScriptSnapshot.getText(editRange.newSpan().end(), newScriptSnapshot.getLength()); - Debug.assert(oldSuffixText === newSuffixText, 'Expected equal suffix texts!'); - - // Ok, text change range and script snapshots look ok. Let's verify that our - // incremental parsing worked properly. - //var normalTree = this.createSyntaxTree(filename, newScriptSnapshot); - //Debug.assert(normalTree.structuralEquals(incrementalTree), 'Expected equal incremental and normal trees'); - - // Ok, the trees looked good. So at least our incremental parser agrees with the - // normal parser. Now, verify that the incremental tree matches the contents of the - // script snapshot. - var incrementalTreeText = TypeScript.fullText(incrementalTree.sourceUnit()); - var actualSnapshotText = newScriptSnapshot.getText(0, newScriptSnapshot.getLength()); - Debug.assert(incrementalTreeText === actualSnapshotText, 'Expected full texts to be equal'); - } - } } - function createSourceFileFromScriptSnapshot(filename: string, scriptSnapshot: TypeScript.IScriptSnapshot, settings: CompilerOptions, version: string, isOpen: boolean) { + function createSourceFileFromScriptSnapshot(filename: string, scriptSnapshot: IScriptSnapshot, settings: CompilerOptions, version: string, isOpen: boolean) { return SourceFileObject.createSourceFileObject(filename, scriptSnapshot, settings.target, version, isOpen); } @@ -1827,7 +1732,7 @@ module ts { sourceFiles.sort((x, y) => y.refCount - x.refCount); return { bucket: name, - sourceFiles: sourceFiles + sourceFiles }; }); return JSON.stringify(bucketInfoArray, null, 2); @@ -1836,7 +1741,7 @@ module ts { function acquireDocument( filename: string, compilationSettings: CompilerOptions, - scriptSnapshot: TypeScript.IScriptSnapshot, + scriptSnapshot: IScriptSnapshot, version: string, isOpen: boolean): SourceFile { @@ -1860,10 +1765,10 @@ module ts { sourceFile: SourceFile, filename: string, compilationSettings: CompilerOptions, - scriptSnapshot: TypeScript.IScriptSnapshot, + scriptSnapshot: IScriptSnapshot, version: string, isOpen: boolean, - textChangeRange: TypeScript.TextChangeRange + textChangeRange: TextChangeRange ): SourceFile { var bucket = getBucketForCompilationSettings(compilationSettings, /*createIfMissing*/ false); @@ -1893,10 +1798,10 @@ module ts { } return { - acquireDocument: acquireDocument, - updateDocument: updateDocument, - releaseDocument: releaseDocument, - reportStats: reportStats + acquireDocument, + updateDocument, + releaseDocument, + reportStats }; } @@ -1959,7 +1864,7 @@ module ts { processImport(); } processTripleSlashDirectives(); - return { referencedFiles: referencedFiles, importedFiles: importedFiles, isLibFile: isNoDefaultLib }; + return { referencedFiles, importedFiles, isLibFile: isNoDefaultLib }; } /// Helpers @@ -2051,7 +1956,7 @@ module ts { /** Returns true if node is a name of an object literal property, e.g. "a" in x = { "a": 1 } */ function isNameOfPropertyAssignment(node: Node): boolean { return (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NumericLiteral) && - node.parent.kind === SyntaxKind.PropertyAssignment && (node.parent).name === node; + (node.parent.kind === SyntaxKind.PropertyAssignment || node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) && (node.parent).name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node: Node): boolean { @@ -2137,7 +2042,7 @@ module ts { export function createLanguageService(host: LanguageServiceHost, documentRegistry: DocumentRegistry): LanguageService { var syntaxTreeCache: SyntaxTreeCache = new SyntaxTreeCache(host); - var ruleProvider: ts.formatting.RulesProvider; + var ruleProvider: formatting.RulesProvider; var hostCache: HostCache; // A cache of all the information about the files on the host side. var program: Program; @@ -2160,8 +2065,12 @@ module ts { localizedDiagnosticMessages = host.getLocalizedDiagnosticMessages(); } + function getCanonicalFileName(filename: string) { + return useCaseSensitivefilenames ? filename : filename.toLowerCase(); + } + function getSourceFile(filename: string): SourceFile { - return lookUp(sourceFilesByName, filename); + return lookUp(sourceFilesByName, getCanonicalFileName(filename)); } function getFullTypeCheckChecker() { @@ -2171,7 +2080,7 @@ module ts { function getRuleProvider(options: FormatCodeOptions) { // Ensure rules are initialized and up to date wrt to formatting options if (!ruleProvider) { - ruleProvider = new ts.formatting.RulesProvider(host); + ruleProvider = new formatting.RulesProvider(host); } ruleProvider.ensureUpToDate(options); @@ -2257,7 +2166,7 @@ module ts { var filename = oldSourceFiles[i].filename; if (!hostCache.contains(filename) || changesInCompilationSettingsAffectSyntax) { documentRegistry.releaseDocument(filename, oldSettings); - delete sourceFilesByName[filename]; + delete sourceFilesByName[getCanonicalFileName(filename)]; } } } @@ -2288,7 +2197,7 @@ module ts { // file was closed, then we always want to re-parse. This is so our tree doesn't keep // the old buffer alive that represented the file on disk (as the host has moved to a // new text buffer). - var textChangeRange: TypeScript.TextChangeRange = null; + var textChangeRange: TextChangeRange = null; if (sourceFile.isOpen && isOpen) { textChangeRange = hostCache.getChangeRange(filename, sourceFile.version, sourceFile.getScriptSnapshot()); } @@ -2300,7 +2209,7 @@ module ts { } // Remember the new sourceFile - sourceFilesByName[filename] = sourceFile; + sourceFilesByName[getCanonicalFileName(filename)] = sourceFile; } // Now create a new compiler @@ -2355,11 +2264,7 @@ module ts { var allDiagnostics = checker.getDiagnostics(targetSourceFile); if (compilerOptions.declaration) { // If '-d' is enabled, check for emitter error. One example of emitter error is export class implements non-export interface - // Get emitter-diagnostics requires calling TypeChecker.emitFiles so we have to define CompilerHost.writer which does nothing because emitFiles function has side effects defined by CompilerHost.writer - var savedWriter = writer; - writer = (filename: string, data: string, writeByteOrderMark: boolean) => { }; - allDiagnostics = allDiagnostics.concat(checker.emitFiles(targetSourceFile).errors); - writer = savedWriter; + allDiagnostics = allDiagnostics.concat(checker.getDeclarationDiagnostics(targetSourceFile)); } return allDiagnostics } @@ -2563,7 +2468,7 @@ module ts { host.log("getCompletionsAtPosition: Semantic work: " + (new Date().getTime() - semanticStart)); return { - isMemberCompletion: isMemberCompletion, + isMemberCompletion, entries: activeCompletionSession.entries }; @@ -2745,7 +2650,7 @@ module ts { var existingMemberNames: Map = {}; forEach(existingMembers, m => { - if (m.kind !== SyntaxKind.PropertyAssignment) { + if (m.kind !== SyntaxKind.PropertyAssignment && m.kind !== SyntaxKind.ShorthandPropertyAssignment) { // Ignore omitted expressions for missing members in the object literal return; } @@ -2818,7 +2723,7 @@ module ts { while (true) { node = node.parent; if (!node) { - return node; + return undefined; } switch (node.kind) { case SyntaxKind.SourceFile: @@ -2867,8 +2772,11 @@ module ts { if (isFirstDeclarationOfSymbolParameter(symbol)) { return ScriptElementKind.parameterElement; } - else if(symbol.valueDeclaration && symbol.valueDeclaration.flags & NodeFlags.Const) { - return ScriptElementKind.constantElement; + else if (symbol.valueDeclaration && isConst(symbol.valueDeclaration)) { + return ScriptElementKind.constElement; + } + else if (forEach(symbol.declarations, declaration => isLet(declaration))) { + return ScriptElementKind.letElement; } return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localVariableElement : ScriptElementKind.variableElement; } @@ -2925,7 +2833,11 @@ module ts { case SyntaxKind.InterfaceDeclaration: return ScriptElementKind.interfaceElement; case SyntaxKind.TypeAliasDeclaration: return ScriptElementKind.typeElement; case SyntaxKind.EnumDeclaration: return ScriptElementKind.enumElement; - case SyntaxKind.VariableDeclaration: return node.flags & NodeFlags.Const ? ScriptElementKind.constantElement: ScriptElementKind.variableElement; + case SyntaxKind.VariableDeclaration: return isConst(node) + ? ScriptElementKind.constElement + : node.flags & NodeFlags.Let + ? ScriptElementKind.letElement + : ScriptElementKind.variableElement; case SyntaxKind.FunctionDeclaration: return ScriptElementKind.functionElement; case SyntaxKind.GetAccessor: return ScriptElementKind.memberGetAccessorElement; case SyntaxKind.SetAccessor: return ScriptElementKind.memberSetAccessorElement; @@ -3024,7 +2936,7 @@ module ts { switch (symbolKind) { case ScriptElementKind.memberVariableElement: case ScriptElementKind.variableElement: - case ScriptElementKind.constantElement: + case ScriptElementKind.constElement: case ScriptElementKind.parameterElement: case ScriptElementKind.localVariableElement: // If it is call or construct signature of lambda's write type name @@ -3100,6 +3012,10 @@ module ts { } if (symbolFlags & SymbolFlags.Enum) { addNewLineIfDisplayPartsExist(); + if (forEach(symbol.declarations, declaration => isConstEnumDeclaration(declaration))) { + displayParts.push(keywordPart(SyntaxKind.ConstKeyword)); + displayParts.push(spacePart()); + } displayParts.push(keywordPart(SyntaxKind.EnumKeyword)); displayParts.push(spacePart()); addFullSymbolName(symbol); @@ -3223,7 +3139,7 @@ module ts { documentation = symbol.getDocumentationComment(); } - return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind }; + return { displayParts, documentation, symbolKind }; function addNewLineIfDisplayPartsExist() { if (displayParts.length) { @@ -3295,7 +3211,7 @@ module ts { return { kind: ScriptElementKind.unknown, kindModifiers: ScriptElementKindModifier.none, - textSpan: new TypeScript.TextSpan(node.getStart(), node.getWidth()), + textSpan: new TextSpan(node.getStart(), node.getWidth()), displayParts: typeToDisplayParts(typeInfoResolver, type, getContainerNode(node)), documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined }; @@ -3309,7 +3225,7 @@ module ts { return { kind: displayPartsDocumentationsAndKind.symbolKind, kindModifiers: getSymbolModifiers(symbol), - textSpan: new TypeScript.TextSpan(node.getStart(), node.getWidth()), + textSpan: new TextSpan(node.getStart(), node.getWidth()), displayParts: displayPartsDocumentationsAndKind.displayParts, documentation: displayPartsDocumentationsAndKind.documentation }; @@ -3320,11 +3236,11 @@ module ts { function getDefinitionInfo(node: Node, symbolKind: string, symbolName: string, containerName: string): DefinitionInfo { return { fileName: node.getSourceFile().filename, - textSpan: TypeScript.TextSpan.fromBounds(node.getStart(), node.getEnd()), + textSpan: TextSpan.fromBounds(node.getStart(), node.getEnd()), kind: symbolKind, name: symbolName, containerKind: undefined, - containerName: containerName + containerName }; } @@ -3393,12 +3309,11 @@ module ts { /// Triple slash reference comments var comment = forEach(sourceFile.referencedFiles, r => (r.pos <= position && position < r.end) ? r : undefined); if (comment) { - var targetFilename = isRootedDiskPath(comment.filename) ? comment.filename : combinePaths(getDirectoryPath(filename), comment.filename); - targetFilename = normalizePath(targetFilename); - if (program.getSourceFile(targetFilename)) { + var referenceFile = tryResolveScriptReference(program, sourceFile, comment); + if (referenceFile) { return [{ - fileName: targetFilename, - textSpan: TypeScript.TextSpan.fromBounds(0, 0), + fileName: referenceFile.filename, + textSpan: TextSpan.fromBounds(0, 0), kind: ScriptElementKind.scriptElement, name: comment.filename, containerName: undefined, @@ -3418,6 +3333,23 @@ module ts { var result: DefinitionInfo[] = []; + // Because name in short-hand property assignment has two different meanings: property name and property value, + // using go-to-definition at such position should go to the variable declaration of the property value rather than + // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition + // is performed at the location of property access, we would like to go to definition of the property in the short-hand + // assignment. This case and others are handled by the following code. + if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) { + var shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); + var shorthandDeclarations = shorthandSymbol.getDeclarations(); + var shorthandSymbolKind = getSymbolKind(shorthandSymbol, typeInfoResolver); + var shorthandSymbolName = typeInfoResolver.symbolToString(shorthandSymbol); + var shorthandContainerName = typeInfoResolver.symbolToString(symbol.parent, node); + forEach(shorthandDeclarations, declaration => { + result.push(getDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName)); + }); + return result + } + var declarations = symbol.getDeclarations(); var symbolName = typeInfoResolver.symbolToString(symbol); // Do not get scoped name, just the name of the symbol var symbolKind = getSymbolKind(symbol, typeInfoResolver); @@ -3567,7 +3499,7 @@ module ts { if (shouldHighlightNextKeyword) { result.push({ fileName: filename, - textSpan: TypeScript.TextSpan.fromBounds(elseKeyword.getStart(), ifKeyword.end), + textSpan: TextSpan.fromBounds(elseKeyword.getStart(), ifKeyword.end), isWriteAccess: false }); i++; // skip the next keyword @@ -3955,39 +3887,56 @@ module ts { var searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), declarations); // Get the text to search for, we need to normalize it as external module names will have quote - var symbolName = getNormalizedSymbolName(symbol.name, declarations); + var declaredName = getDeclaredName(symbol); - // Get syntactic diagnostics + // Try to get the smallest valid scope that we can limit our search to; + // otherwise we'll need to search globally (i.e. include each file). var scope = getSymbolScope(symbol); if (scope) { result = []; - getReferencesInNode(scope, symbol, symbolName, node, searchMeaning, findInStrings, findInComments, result); + getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result); } else { + var internedName = getInternedName(symbol, declarations) forEach(sourceFiles, sourceFile => { cancellationToken.throwIfCancellationRequested(); - if (lookUp(sourceFile.identifiers, symbolName)) { + if (lookUp(sourceFile.identifiers, internedName)) { result = result || []; - getReferencesInNode(sourceFile, symbol, symbolName, node, searchMeaning, findInStrings, findInComments, result); + getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result); } }); } return result; - function getNormalizedSymbolName(symbolName: string, declarations: Declaration[]): string { + function getDeclaredName(symbol: Symbol) { + var name = typeInfoResolver.symbolToString(symbol); + + return stripQuotes(name); + } + + function getInternedName(symbol: Symbol, declarations: Declaration[]): string { // Special case for function expressions, whose names are solely local to their bodies. var functionExpression = forEach(declarations, d => d.kind === SyntaxKind.FunctionExpression ? d : undefined); + // When a name gets interned into a SourceFile's 'identifiers' Map, + // its name is escaped and stored in the same way its symbol name/identifier + // name should be stored. Function expressions, however, are a special case, + // because despite sometimes having a name, the binder unconditionally binds them + // to a symbol with the name "__function". if (functionExpression && functionExpression.name) { var name = functionExpression.name.text; } else { - var name = symbolName; + var name = symbol.name; } + return stripQuotes(name); + } + + function stripQuotes(name: string) { var length = name.length; if (length >= 2 && name.charCodeAt(0) === CharacterCodes.doubleQuote && name.charCodeAt(length - 1) === CharacterCodes.doubleQuote) { return name.substring(1, length - 1); @@ -4016,6 +3965,10 @@ module ts { for (var i = 0, n = declarations.length; i < n; i++) { var container = getContainerNode(declarations[i]); + if (!container) { + return undefined; + } + if (scope && scope !== container) { // Different declarations have different containers, bail out return undefined; @@ -4153,7 +4106,7 @@ module ts { (findInComments && isInComment(position))) { result.push({ fileName: sourceFile.filename, - textSpan: new TypeScript.TextSpan(position, searchText.length), + textSpan: new TextSpan(position, searchText.length), isWriteAccess: false }); } @@ -4165,8 +4118,21 @@ module ts { } var referenceSymbol = typeInfoResolver.getSymbolInfo(referenceLocation); - if (referenceSymbol && isRelatableToSearchSet(searchSymbols, referenceSymbol, referenceLocation)) { - result.push(getReferenceEntryFromNode(referenceLocation)); + if (referenceSymbol) { + var referenceSymbolDeclaration = referenceSymbol.valueDeclaration; + var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration); + if (isRelatableToSearchSet(searchSymbols, referenceSymbol, referenceLocation)) { + result.push(getReferenceEntryFromNode(referenceLocation)); + } + /* Because in short-hand property assignment, an identifier which stored as name of the short-hand property assignment + * has two meaning : property name and property value. Therefore when we do findAllReference at the position where + * an identifier is declared, the language service should return the position of the variable declaration as well as + * the position in short-hand property assignment excluding property accessing. However, if we do findAllReference at the + * position of property accessing, the referenceEntry of such position will be handled in the first case. + */ + else if (!(referenceSymbol.flags & SymbolFlags.Transient) && searchSymbols.indexOf(shorthandValueSymbol) >= 0) { + result.push(getReferenceEntryFromNode(referenceSymbolDeclaration.name)); + } } }); } @@ -4334,6 +4300,22 @@ module ts { forEach(getPropertySymbolsFromContextualType(location), contextualSymbol => { result.push.apply(result, typeInfoResolver.getRootSymbols(contextualSymbol)); }); + + /* Because in short-hand property assignment, location has two meaning : property name and as value of the property + * When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of + * property name and variable declaration of the identifier. + * Like in below example, when querying for all references for an identifier 'name', of the property assignment, the language service + * should show both 'name' in 'obj' and 'name' in variable declaration + * var name = "Foo"; + * var obj = { name }; + * In order to do that, we will populate the search set with the value symbol of the identifier as a value of the property assignment + * so that when matching with potential reference symbol, both symbols from property declaration and variable declaration + * will be included correctly. + */ + var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(location.parent); + if (shorthandValueSymbol) { + result.push(shorthandValueSymbol); + } } // If this is a union property, add all the symbols from all its source symbols in all unioned types. @@ -4493,7 +4475,7 @@ module ts { return { fileName: node.getSourceFile().filename, - textSpan: TypeScript.TextSpan.fromBounds(start, end), + textSpan: TextSpan.fromBounds(start, end), isWriteAccess: isWriteAccess(node) }; } @@ -4549,10 +4531,10 @@ module ts { kindModifiers: getNodeModifiers(declaration), matchKind: MatchKind[matchKind], fileName: filename, - textSpan: TypeScript.TextSpan.fromBounds(declaration.getStart(), declaration.getEnd()), + textSpan: TextSpan.fromBounds(declaration.getStart(), declaration.getEnd()), // TODO(jfreeman): What should be the containerName when the container has a computed name? - containerName: container.name ? (container.name).text : "", - containerKind: container.name ? getNodeKind(container) : "" + containerName: container && container.name ? (container.name).text : "", + containerKind: container && container.name ? getNodeKind(container) : "" }); } } @@ -4674,6 +4656,7 @@ module ts { case SyntaxKind.VariableDeclaration: case SyntaxKind.Property: case SyntaxKind.PropertyAssignment: + case SyntaxKind.ShorthandPropertyAssignment: case SyntaxKind.EnumMember: case SyntaxKind.Method: case SyntaxKind.Constructor: @@ -4705,10 +4688,13 @@ module ts { else { return SemanticMeaning.Namespace; } - break; case SyntaxKind.ImportDeclaration: return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace; + + // An external module can be a Value + case SyntaxKind.SourceFile: + return SemanticMeaning.Namespace | SemanticMeaning.Value; } Debug.fail("Unknown declaration type"); } @@ -4790,81 +4776,14 @@ module ts { return SignatureHelp.getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken); } - function getSignatureAtPosition(filename: string, position: number): SignatureInfo { - var signatureHelpItems = getSignatureHelpItems(filename, position); - - if (!signatureHelpItems) { - return undefined; - } - - var currentArgumentState = { argumentIndex: signatureHelpItems.argumentIndex, argumentCount: signatureHelpItems.argumentCount }; - - var formalSignatures: FormalSignatureItemInfo[] = []; - forEach(signatureHelpItems.items, signature => { - var signatureInfoString = displayPartsToString(signature.prefixDisplayParts); - - var parameters: FormalParameterInfo[] = []; - if (signature.parameters) { - for (var i = 0, n = signature.parameters.length; i < n; i++) { - var parameter = signature.parameters[i]; - - // add the parameter to the string - if (i) { - signatureInfoString += displayPartsToString(signature.separatorDisplayParts); - } - - var start = signatureInfoString.length; - signatureInfoString += displayPartsToString(parameter.displayParts); - var end = signatureInfoString.length; - - // add the parameter to the list - parameters.push({ - name: parameter.name, - isVariable: i === n - 1 && signature.isVariadic, - docComment: displayPartsToString(parameter.documentation), - minChar: start, - limChar: end - }); - } - } - - signatureInfoString += displayPartsToString(signature.suffixDisplayParts); - - formalSignatures.push({ - signatureInfo: signatureInfoString, - docComment: displayPartsToString(signature.documentation), - parameters: parameters, - typeParameters: [], - }); - }); - - var actualSignature: ActualSignatureInfo = { - parameterMinChar: signatureHelpItems.applicableSpan.start(), - parameterLimChar: signatureHelpItems.applicableSpan.end(), - currentParameterIsTypeParameter: false, - currentParameter: currentArgumentState.argumentIndex - }; - - return { - actual: actualSignature, - formal: formalSignatures, - activeFormal: 0 - }; - } - /// Syntactic features - function getSyntaxTree(filename: string): TypeScript.SyntaxTree { - filename = normalizeSlashes(filename); - return syntaxTreeCache.getCurrentFileSyntaxTree(filename); - } - function getCurrentSourceFile(filename: string): SourceFile { filename = normalizeSlashes(filename); var currentSourceFile = syntaxTreeCache.getCurrentSourceFile(filename); return currentSourceFile; } - function getNameOrDottedNameSpan(filename: string, startPos: number, endPos: number): TypeScript.TextSpan { + function getNameOrDottedNameSpan(filename: string, startPos: number, endPos: number): TextSpan { filename = ts.normalizeSlashes(filename); // Get node at the location var node = getTouchingPropertyName(getCurrentSourceFile(filename), startPos); @@ -4916,7 +4835,7 @@ module ts { } } - return TypeScript.TextSpan.fromBounds(nodeForStartPos.getStart(), node.getEnd()); + return TextSpan.fromBounds(nodeForStartPos.getStart(), node.getEnd()); } function getBreakpointStatementAtPosition(filename: string, position: number) { @@ -4931,7 +4850,7 @@ module ts { return NavigationBar.getNavigationBarItems(getCurrentSourceFile(filename)); } - function getSemanticClassifications(fileName: string, span: TypeScript.TextSpan): ClassifiedSpan[] { + function getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[] { synchronizeHostData(); fileName = normalizeSlashes(fileName); @@ -4990,7 +4909,7 @@ module ts { var type = classifySymbol(symbol, getMeaningFromLocation(node)); if (type) { result.push({ - textSpan: new TypeScript.TextSpan(node.getStart(), node.getWidth()), + textSpan: new TextSpan(node.getStart(), node.getWidth()), classificationType: type }); } @@ -5002,7 +4921,7 @@ module ts { } } - function getSyntacticClassifications(fileName: string, span: TypeScript.TextSpan): ClassifiedSpan[] { + function getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[] { // doesn't use compiler - no need to synchronize with host fileName = normalizeSlashes(fileName); var sourceFile = getCurrentSourceFile(fileName); @@ -5016,7 +4935,7 @@ module ts { var width = comment.end - comment.pos; if (span.intersectsWith(comment.pos, width)) { result.push({ - textSpan: new TypeScript.TextSpan(comment.pos, width), + textSpan: new TextSpan(comment.pos, width), classificationType: ClassificationTypeNames.comment }); } @@ -5029,7 +4948,7 @@ module ts { var type = classifyTokenType(token); if (type) { result.push({ - textSpan: new TypeScript.TextSpan(token.getStart(), token.getWidth()), + textSpan: new TextSpan(token.getStart(), token.getWidth()), classificationType: type }); } @@ -5141,7 +5060,7 @@ module ts { function getBraceMatchingAtPosition(filename: string, position: number) { var sourceFile = getCurrentSourceFile(filename); - var result: TypeScript.TextSpan[] = []; + var result: TextSpan[] = []; var token = getTouchingToken(sourceFile, position); @@ -5153,12 +5072,12 @@ module ts { var parentElement = token.parent; var childNodes = parentElement.getChildren(sourceFile); - for (var i = 0, n = childNodes.length; i < n; i++) { + for (var i = 0, n = childNodes.length; i < n; i++) {33 var current = childNodes[i]; if (current.kind === matchKind) { - var range1 = new TypeScript.TextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); - var range2 = new TypeScript.TextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); + var range1 = new TextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); + var range2 = new TextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); // We want to order the braces when we return the result. if (range1.start() < range2.start()) { @@ -5397,9 +5316,9 @@ module ts { } function isLetterOrDigit(char: number): boolean { - return (char >= TypeScript.CharacterCodes.a && char <= TypeScript.CharacterCodes.z) || - (char >= TypeScript.CharacterCodes.A && char <= TypeScript.CharacterCodes.Z) || - (char >= TypeScript.CharacterCodes._0 && char <= TypeScript.CharacterCodes._9); + return (char >= CharacterCodes.a && char <= CharacterCodes.z) || + (char >= CharacterCodes.A && char <= CharacterCodes.Z) || + (char >= CharacterCodes._0 && char <= CharacterCodes._9); } } @@ -5422,7 +5341,7 @@ module ts { if (kind) { return getRenameInfo(symbol.name, typeInfoResolver.getFullyQualifiedName(symbol), kind, getSymbolModifiers(symbol), - new TypeScript.TextSpan(node.getStart(), node.getWidth())); + new TextSpan(node.getStart(), node.getWidth())); } } } @@ -5441,50 +5360,49 @@ module ts { }; } - function getRenameInfo(displayName: string, fullDisplayName: string, kind: string, kindModifiers: string, triggerSpan: TypeScript.TextSpan): RenameInfo { + function getRenameInfo(displayName: string, fullDisplayName: string, kind: string, kindModifiers: string, triggerSpan: TextSpan): RenameInfo { return { canRename: true, localizedErrorMessage: undefined, - displayName: displayName, - fullDisplayName: fullDisplayName, - kind: kind, - kindModifiers: kindModifiers, - triggerSpan: triggerSpan + displayName, + fullDisplayName, + kind, + kindModifiers, + triggerSpan }; } } return { - dispose: dispose, - cleanupSemanticCache: cleanupSemanticCache, - getSyntacticDiagnostics: getSyntacticDiagnostics, - getSemanticDiagnostics: getSemanticDiagnostics, - getCompilerOptionsDiagnostics: getCompilerOptionsDiagnostics, - getSyntacticClassifications: getSyntacticClassifications, - getSemanticClassifications: getSemanticClassifications, - getCompletionsAtPosition: getCompletionsAtPosition, - getCompletionEntryDetails: getCompletionEntryDetails, - getSignatureHelpItems: getSignatureHelpItems, - getQuickInfoAtPosition: getQuickInfoAtPosition, - getDefinitionAtPosition: getDefinitionAtPosition, - getReferencesAtPosition: getReferencesAtPosition, - getOccurrencesAtPosition: getOccurrencesAtPosition, - getImplementorsAtPosition: (filename, position) => [], - getNameOrDottedNameSpan: getNameOrDottedNameSpan, - getBreakpointStatementAtPosition: getBreakpointStatementAtPosition, - getNavigateToItems: getNavigateToItems, - getRenameInfo: getRenameInfo, - findRenameLocations: findRenameLocations, - getNavigationBarItems: getNavigationBarItems, - getOutliningSpans: getOutliningSpans, - getTodoComments: getTodoComments, - getBraceMatchingAtPosition: getBraceMatchingAtPosition, - getIndentationAtPosition: getIndentationAtPosition, - getFormattingEditsForRange: getFormattingEditsForRange, - getFormattingEditsForDocument: getFormattingEditsForDocument, - getFormattingEditsAfterKeystroke: getFormattingEditsAfterKeystroke, - getEmitOutput: getEmitOutput, - getSignatureAtPosition: getSignatureAtPosition, + dispose, + cleanupSemanticCache, + getSyntacticDiagnostics, + getSemanticDiagnostics, + getCompilerOptionsDiagnostics, + getSyntacticClassifications, + getSemanticClassifications, + getCompletionsAtPosition, + getCompletionEntryDetails, + getSignatureHelpItems, + getQuickInfoAtPosition, + getDefinitionAtPosition, + getReferencesAtPosition, + getOccurrencesAtPosition, + getNameOrDottedNameSpan, + getBreakpointStatementAtPosition, + getNavigateToItems, + getRenameInfo, + findRenameLocations, + getNavigationBarItems, + getOutliningSpans, + getTodoComments, + getBraceMatchingAtPosition, + getIndentationAtPosition, + getFormattingEditsForRange, + getFormattingEditsForDocument, + getFormattingEditsAfterKeystroke, + getEmitOutput, + getSourceFile: getCurrentSourceFile, }; } @@ -5544,7 +5462,8 @@ module ts { return true; } - function getClassificationsForLine(text: string, lexState: EndOfLineState): ClassificationResult { + // 'classifyKeywordsInGenerics' should be 'true' when a syntactic classifier is not present. + function getClassificationsForLine(text: string, lexState: EndOfLineState, classifyKeywordsInGenerics?: boolean): ClassificationResult { var offset = 0; var token = SyntaxKind.Unknown; var lastNonTriviaToken = SyntaxKind.Unknown; @@ -5631,7 +5550,7 @@ module ts { token === SyntaxKind.StringKeyword || token === SyntaxKind.NumberKeyword || token === SyntaxKind.BooleanKeyword) { - if (angleBracketStack > 0) { + if (angleBracketStack > 0 && !classifyKeywordsInGenerics) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, // causing a noisy experience for the user. @@ -5782,9 +5701,7 @@ module ts { } } - return { - getClassificationsForLine: getClassificationsForLine - }; + return { getClassificationsForLine }; } function initializeServices() { diff --git a/src/services/shims.ts b/src/services/shims.ts index 78e47de22b4..e1e95c1332c 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -15,8 +15,6 @@ /// -/// - var debugObjectHost = (this); module ts { @@ -100,9 +98,6 @@ module ts { getSignatureHelpItems(fileName: string, position: number): string; - // Obsolete. Use getSignatureHelpItems instead. - getSignatureAtPosition(fileName: string, position: number): string; - /** * Returns a JSON-encoded value of the type: * { canRename: boolean, localizedErrorMessage: string, displayName: string, fullDisplayName: string, kind: string, kindModifiers: string, triggerSpan: { start; length } } @@ -135,12 +130,6 @@ module ts { */ getOccurrencesAtPosition(fileName: string, position: number): string; - /** - * Returns a JSON-encoded value of the type: - * { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[] - */ - getImplementorsAtPosition(fileName: string, position: number): string; - /** * Returns a JSON-encoded value of the type: * { name: string; kind: string; kindModifiers: string; containerName: string; containerKind: string; matchKind: string; fileName: string; textSpan: { start: number; length: number}; } [] = []; @@ -172,11 +161,11 @@ module ts { } export interface ClassifierShim extends Shim { - getClassificationsForLine(text: string, lexState: EndOfLineState): string; + getClassificationsForLine(text: string, lexState: EndOfLineState, classifyKeywordsInGenerics?: boolean): string; } export interface CoreServicesShim extends Shim { - getPreProcessedFileInfo(fileName: string, sourceText: TypeScript.IScriptSnapshot): string; + getPreProcessedFileInfo(fileName: string, sourceText: IScriptSnapshot): string; getDefaultCompilationSettings(): string; } @@ -309,7 +298,7 @@ module ts { logger.log("*INTERNAL ERROR* - Exception in typescript services: " + err.message); } - class ScriptSnapshotShimAdapter implements TypeScript.IScriptSnapshot { + class ScriptSnapshotShimAdapter implements IScriptSnapshot { private lineStartPositions: number[] = null; constructor(private scriptSnapshotShim: ScriptSnapshotShim) { @@ -331,7 +320,7 @@ module ts { return this.lineStartPositions; } - public getChangeRange(oldSnapshot: TypeScript.IScriptSnapshot): TypeScript.TextChangeRange { + public getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange { var oldSnapshotShim = oldSnapshot; var encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim); if (encoded == null) { @@ -339,8 +328,8 @@ module ts { } var decoded: { span: { start: number; length: number; }; newLength: number; } = JSON.parse(encoded); - return new TypeScript.TextChangeRange( - new TypeScript.TextSpan(decoded.span.start, decoded.span.length), decoded.newLength); + return new TextChangeRange( + new TextSpan(decoded.span.start, decoded.span.length), decoded.newLength); } } @@ -368,7 +357,7 @@ module ts { return JSON.parse(encoded); } - public getScriptSnapshot(fileName: string): TypeScript.IScriptSnapshot { + public getScriptSnapshot(fileName: string): IScriptSnapshot { return new ScriptSnapshotShimAdapter(this.shimHost.getScriptSnapshot(fileName)); } @@ -521,7 +510,7 @@ module ts { return this.forwardJSONCall( "getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", () => { - var classifications = this.languageService.getSyntacticClassifications(fileName, new TypeScript.TextSpan(start, length)); + var classifications = this.languageService.getSyntacticClassifications(fileName, new TextSpan(start, length)); return classifications; }); } @@ -530,7 +519,7 @@ module ts { return this.forwardJSONCall( "getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", () => { - var classifications = this.languageService.getSemanticClassifications(fileName, new TypeScript.TextSpan(start, length)); + var classifications = this.languageService.getSemanticClassifications(fileName, new TextSpan(start, length)); return classifications; }); } @@ -617,14 +606,6 @@ module ts { }); } - public getSignatureAtPosition(fileName: string, position: number): string { - return this.forwardJSONCall( - "getSignatureAtPosition('" + fileName + "', " + position + ")", - () => { - return this.languageService.getSignatureAtPosition(fileName, position); - }); - } - /// GOTO DEFINITION /** @@ -698,16 +679,6 @@ module ts { }); } - /// GET IMPLEMENTORS - public getImplementorsAtPosition(fileName: string, position: number): string { - return this.forwardJSONCall( - "getImplementorsAtPosition('" + fileName + "', " + position + ")", - () => { - return this.languageService.getImplementorsAtPosition(fileName, position); - }); - } - - /// COMPLETION LISTS /** @@ -823,8 +794,8 @@ module ts { } /// COLORIZATION - public getClassificationsForLine(text: string, lexState: EndOfLineState): string { - var classification = this.classifier.getClassificationsForLine(text, lexState); + public getClassificationsForLine(text: string, lexState: EndOfLineState, classifyKeywordsInGenerics?: boolean): string { + var classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics); var items = classification.entries; var result = ""; for (var i = 0; i < items.length; i++) { @@ -845,7 +816,7 @@ module ts { return forwardJSONCall(this.logger, actionDescription, action); } - public getPreProcessedFileInfo(fileName: string, sourceTextSnapshot: TypeScript.IScriptSnapshot): string { + public getPreProcessedFileInfo(fileName: string, sourceTextSnapshot: IScriptSnapshot): string { return this.forwardJSONCall( "getPreProcessedFileInfo('" + fileName + "')", () => { @@ -938,7 +909,7 @@ module ts { } } - throw TypeScript.Errors.invalidOperation(); + throw new Error("Invalid operation"); } } } diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts index 41f64c1b8db..e2b65e3c6e1 100644 --- a/src/services/signatureHelp.ts +++ b/src/services/signatureHelp.ts @@ -164,6 +164,20 @@ module ts.SignatureHelp { //} var emptyArray: any[] = []; + const enum ArgumentListKind { + TypeArguments, + CallArguments, + TaggedTemplateArguments + } + + interface ArgumentListInfo { + kind: ArgumentListKind; + invocation: CallLikeExpression; + argumentsSpan: TextSpan; + argumentIndex?: number; + argumentCount: number; + } + export function getSignatureHelpItems(sourceFile: SourceFile, position: number, typeInfoResolver: TypeChecker, cancellationToken: CancellationTokenObject): SignatureHelpItems { // Decide whether to show signature help var startingToken = findTokenOnLeftOfPosition(sourceFile, position); @@ -180,7 +194,7 @@ module ts.SignatureHelp { return undefined; } - var call = argumentInfo.list.parent; + var call = argumentInfo.invocation; var candidates = []; var resolvedSignature = typeInfoResolver.getResolvedSignature(call, candidates); cancellationToken.throwIfCancellationRequested(); @@ -192,50 +206,195 @@ module ts.SignatureHelp { return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); /** - * If node is an argument, returns its index in the argument list. - * If not, returns -1. + * Returns relevant information for the argument list and the current argument if we are + * in the argument of an invocation; returns undefined otherwise. */ - function getImmediatelyContainingArgumentInfo(node: Node): ListItemInfo { - if (node.parent.kind !== SyntaxKind.CallExpression && node.parent.kind !== SyntaxKind.NewExpression) { - return undefined; - } + function getImmediatelyContainingArgumentInfo(node: Node): ArgumentListInfo { + if (node.parent.kind === SyntaxKind.CallExpression || node.parent.kind === SyntaxKind.NewExpression) { + var callExpression = node.parent; + // There are 3 cases to handle: + // 1. The token introduces a list, and should begin a sig help session + // 2. The token is either not associated with a list, or ends a list, so the session should end + // 3. The token is buried inside a list, and should give sig help + // + // The following are examples of each: + // + // Case 1: + // foo<#T, U>(#a, b) -> The token introduces a list, and should begin a sig help session + // Case 2: + // fo#o#(a, b)# -> The token is either not associated with a list, or ends a list, so the session should end + // Case 3: + // foo(a#, #b#) -> The token is buried inside a list, and should give sig help + // Find out if 'node' is an argument, a type argument, or neither + if (node.kind === SyntaxKind.LessThanToken || + node.kind === SyntaxKind.OpenParenToken) { + // Find the list that starts right *after* the < or ( token. + // If the user has just opened a list, consider this item 0. + var list = getChildListThatStartsWithOpenerToken(callExpression, node, sourceFile); + var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; + Debug.assert(list !== undefined); + return { + kind: isTypeArgList ? ArgumentListKind.TypeArguments : ArgumentListKind.CallArguments, + invocation: callExpression, + argumentsSpan: getApplicableSpanForArguments(list), + argumentIndex: 0, + argumentCount: getCommaBasedArgCount(list) + }; + } - // There are 3 cases to handle: - // 1. The token introduces a list, and should begin a sig help session - // 2. The token is either not associated with a list, or ends a list, so the session should end - // 3. The token is buried inside a list, and should give sig help - // - // The following are examples of each: - // - // Case 1: - // foo<$T, U>($a, b) -> The token introduces a list, and should begin a sig help session - // Case 2: - // fo$o$(a, b)$ -> The token is either not associated with a list, or ends a list, so the session should end - // Case 3: - // foo(a$, $b$) -> The token is buried inside a list, and should give sig help - var parent = node.parent; - // Find out if 'node' is an argument, a type argument, or neither - if (node.kind === SyntaxKind.LessThanToken || node.kind === SyntaxKind.OpenParenToken) { - // Find the list that starts right *after* the < or ( token. - // If the user has just opened a list, consider this item 0. - var list = getChildListThatStartsWithOpenerToken(parent, node, sourceFile); - Debug.assert(list !== undefined); - return { - list: list, - listItemIndex: 0 - }; - } + // findListItemInfo can return undefined if we are not in parent's argument list + // or type argument list. This includes cases where the cursor is: + // - To the right of the closing paren, non-substitution template, or template tail. + // - Between the type arguments and the arguments (greater than token) + // - On the target of the call (parent.func) + // - On the 'new' keyword in a 'new' expression + var listItemInfo = findListItemInfo(node); + if (listItemInfo) { + var list = listItemInfo.list; + var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; - // findListItemInfo can return undefined if we are not in parent's argument list - // or type argument list. This includes cases where the cursor is: - // - To the right of the closing paren - // - Between the type arguments and the arguments (greater than token) - // - On the target of the call (parent.func) - // - On the 'new' keyword in a 'new' expression - return findListItemInfo(node); + // The listItemIndex we got back includes commas. Our goal is to return the index of the proper + // item (not including commas). Here are some examples: + // 1. foo(a, b, c #) -> the listItemIndex is 4, we want to return 2 + // 2. foo(a, b, # c) -> listItemIndex is 3, we want to return 2 + // 3. foo(#a) -> listItemIndex is 0, we want to return 0 + // + // In general, we want to subtract the number of commas before the current index. + // But if we are on a comma, we also want to pretend we are on the argument *following* + // the comma. That amounts to taking the ceiling of half the index. + var argumentIndex = (listItemInfo.listItemIndex + 1) >> 1; + + return { + kind: isTypeArgList ? ArgumentListKind.TypeArguments : ArgumentListKind.CallArguments, + invocation: callExpression, + argumentsSpan: getApplicableSpanForArguments(list), + argumentIndex: argumentIndex, + argumentCount: getCommaBasedArgCount(list) + }; + } + } + else if (node.kind === SyntaxKind.NoSubstitutionTemplateLiteral && node.parent.kind === SyntaxKind.TaggedTemplateExpression) { + // Check if we're actually inside the template; + // otherwise we'll fall out and return undefined. + if (isInsideTemplateLiteral(node, position)) { + return getArgumentListInfoForTemplate(node.parent, /*argumentIndex*/ 0); + } + } + else if (node.kind === SyntaxKind.TemplateHead && node.parent.parent.kind === SyntaxKind.TaggedTemplateExpression) { + var templateExpression = node.parent; + var tagExpression = templateExpression.parent; + Debug.assert(templateExpression.kind === SyntaxKind.TemplateExpression); + + var argumentIndex = isInsideTemplateLiteral(node, position) ? 0 : 1; + + return getArgumentListInfoForTemplate(tagExpression, argumentIndex); + } + else if (node.parent.kind === SyntaxKind.TemplateSpan && node.parent.parent.parent.kind === SyntaxKind.TaggedTemplateExpression) { + var templateSpan = node.parent; + var templateExpression = templateSpan.parent; + var tagExpression = templateExpression.parent; + Debug.assert(templateExpression.kind === SyntaxKind.TemplateExpression); + + // If we're just after a template tail, don't show signature help. + if (node.kind === SyntaxKind.TemplateTail && position >= node.getEnd() && !isUnterminatedTemplateEnd(node)) { + return undefined; + } + + var spanIndex = templateExpression.templateSpans.indexOf(templateSpan); + var argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node); + + return getArgumentListInfoForTemplate(tagExpression, argumentIndex); + } + + return undefined; } - function getContainingArgumentInfo(node: Node): ListItemInfo { + function getCommaBasedArgCount(argumentsList: Node) { + // The number of arguments is the number of commas plus one, unless the list + // is completely empty, in which case there are 0 arguments. + return argumentsList.getChildCount() === 0 + ? 0 + : 1 + countWhere(argumentsList.getChildren(), arg => arg.kind === SyntaxKind.CommaToken); + } + + // spanIndex is either the index for a given template span. + // This does not give appropriate results for a NoSubstitutionTemplateLiteral + function getArgumentIndexForTemplatePiece(spanIndex: number, node: Node): number { + // Because the TemplateStringsArray is the first argument, we have to offset each substitution expression by 1. + // There are three cases we can encounter: + // 1. We are precisely in the template literal (argIndex = 0). + // 2. We are in or to the right of the substitution expression (argIndex = spanIndex + 1). + // 3. We are directly to the right of the template literal, but because we look for the token on the left, + // not enough to put us in the substitution expression; we should consider ourselves part of + // the *next* span's expression by offsetting the index (argIndex = (spanIndex + 1) + 1). + // + // Example: f `# abcd $#{# 1 + 1# }# efghi ${ #"#hello"# } # ` + // ^ ^ ^ ^ ^ ^ ^ ^ ^ + // Case: 1 1 3 2 1 3 2 2 1 + Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node."); + if (isTemplateLiteralKind(node.kind)) { + if (isInsideTemplateLiteral(node, position)) { + return 0; + } + return spanIndex + 2; + } + return spanIndex + 1; + } + + function getArgumentListInfoForTemplate(tagExpression: TaggedTemplateExpression, argumentIndex: number): ArgumentListInfo { + // argumentCount is either 1 or (numSpans + 1) to account for the template strings array argument. + var argumentCount = tagExpression.template.kind === SyntaxKind.NoSubstitutionTemplateLiteral + ? 1 + : (tagExpression.template).templateSpans.length + 1; + + return { + kind: ArgumentListKind.TaggedTemplateArguments, + invocation: tagExpression, + argumentsSpan: getApplicableSpanForTaggedTemplate(tagExpression), + argumentIndex: argumentIndex, + argumentCount: argumentCount + }; + } + + function getApplicableSpanForArguments(argumentsList: Node): TextSpan { + // We use full start and skip trivia on the end because we want to include trivia on + // both sides. For example, + // + // foo( /*comment */ a, b, c /*comment*/ ) + // | | + // + // The applicable span is from the first bar to the second bar (inclusive, + // but not including parentheses) + var applicableSpanStart = argumentsList.getFullStart(); + var applicableSpanEnd = skipTrivia(sourceFile.text, argumentsList.getEnd(), /*stopAfterLineBreak*/ false); + return new TextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); + } + + function getApplicableSpanForTaggedTemplate(taggedTemplate: TaggedTemplateExpression): TextSpan { + var template = taggedTemplate.template; + var applicableSpanStart = template.getStart(); + var applicableSpanEnd = template.getEnd(); + + // We need to adjust the end position for the case where the template does not have a tail. + // Otherwise, we will not show signature help past the expression. + // For example, + // + // ` ${ 1 + 1 foo(10) + // | | + // + // This is because a Missing node has no width. However, what we actually want is to include trivia + // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. + if (template.kind === SyntaxKind.TemplateExpression) { + var lastSpan = lastOrUndefined((template).templateSpans); + if (lastSpan.literal.kind === SyntaxKind.Missing) { + applicableSpanEnd = skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); + } + } + + return new TextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); + } + + function getContainingArgumentInfo(node: Node): ArgumentListInfo { for (var n = node; n.kind !== SyntaxKind.SourceFile; n = n.parent) { if (n.kind === SyntaxKind.FunctionBlock) { return undefined; @@ -292,85 +451,61 @@ module ts.SignatureHelp { return maxParamsSignatureIndex; } - function createSignatureHelpItems(candidates: Signature[], bestSignature: Signature, argumentInfoOrTypeArgumentInfo: ListItemInfo): SignatureHelpItems { - var argumentListOrTypeArgumentList = argumentInfoOrTypeArgumentInfo.list; - var parent = argumentListOrTypeArgumentList.parent; - var isTypeParameterHelp = parent.typeArguments && parent.typeArguments.pos === argumentListOrTypeArgumentList.pos; - Debug.assert(isTypeParameterHelp || parent.arguments.pos === argumentListOrTypeArgumentList.pos); + function createSignatureHelpItems(candidates: Signature[], bestSignature: Signature, argumentListInfo: ArgumentListInfo): SignatureHelpItems { + var applicableSpan = argumentListInfo.argumentsSpan; + var isTypeParameterList = argumentListInfo.kind === ArgumentListKind.TypeArguments; - var callTargetNode = (argumentListOrTypeArgumentList.parent).func; - var callTargetSymbol = typeInfoResolver.getSymbolInfo(callTargetNode); + var invocation = argumentListInfo.invocation; + var callTarget = getInvokedExpression(invocation) + var callTargetSymbol = typeInfoResolver.getSymbolInfo(callTarget); var callTargetDisplayParts = callTargetSymbol && symbolToDisplayParts(typeInfoResolver, callTargetSymbol, /*enclosingDeclaration*/ undefined, /*meaning*/ undefined); var items: SignatureHelpItem[] = map(candidates, candidateSignature => { var signatureHelpParameters: SignatureHelpParameter[]; - var prefixParts: SymbolDisplayPart[] = []; - var suffixParts: SymbolDisplayPart[] = []; + var prefixDisplayParts: SymbolDisplayPart[] = []; + var suffixDisplayParts: SymbolDisplayPart[] = []; if (callTargetDisplayParts) { - prefixParts.push.apply(prefixParts, callTargetDisplayParts); + prefixDisplayParts.push.apply(prefixDisplayParts, callTargetDisplayParts); } - if (isTypeParameterHelp) { - prefixParts.push(punctuationPart(SyntaxKind.LessThanToken)); + if (isTypeParameterList) { + prefixDisplayParts.push(punctuationPart(SyntaxKind.LessThanToken)); var typeParameters = candidateSignature.typeParameters; signatureHelpParameters = typeParameters && typeParameters.length > 0 ? map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray; - suffixParts.push(punctuationPart(SyntaxKind.GreaterThanToken)); + suffixDisplayParts.push(punctuationPart(SyntaxKind.GreaterThanToken)); var parameterParts = mapToDisplayParts(writer => - typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, argumentListOrTypeArgumentList)); - suffixParts.push.apply(suffixParts, parameterParts); + typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation)); + suffixDisplayParts.push.apply(suffixDisplayParts, parameterParts); } else { var typeParameterParts = mapToDisplayParts(writer => - typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, argumentListOrTypeArgumentList)); - prefixParts.push.apply(prefixParts, typeParameterParts); - prefixParts.push(punctuationPart(SyntaxKind.OpenParenToken)); + typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation)); + prefixDisplayParts.push.apply(prefixDisplayParts, typeParameterParts); + prefixDisplayParts.push(punctuationPart(SyntaxKind.OpenParenToken)); + var parameters = candidateSignature.parameters; signatureHelpParameters = parameters.length > 0 ? map(parameters, createSignatureHelpParameterForParameter) : emptyArray; - suffixParts.push(punctuationPart(SyntaxKind.CloseParenToken)); + suffixDisplayParts.push(punctuationPart(SyntaxKind.CloseParenToken)); } var returnTypeParts = mapToDisplayParts(writer => - typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, argumentListOrTypeArgumentList)); - suffixParts.push.apply(suffixParts, returnTypeParts); + typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation)); + suffixDisplayParts.push.apply(suffixDisplayParts, returnTypeParts); return { isVariadic: candidateSignature.hasRestParameter, - prefixDisplayParts: prefixParts, - suffixDisplayParts: suffixParts, + prefixDisplayParts, + suffixDisplayParts, separatorDisplayParts: [punctuationPart(SyntaxKind.CommaToken), spacePart()], parameters: signatureHelpParameters, documentation: candidateSignature.getDocumentationComment() }; }); - // We use full start and skip trivia on the end because we want to include trivia on - // both sides. For example, - // - // foo( /*comment */ a, b, c /*comment*/ ) - // | | - // - // The applicable span is from the first bar to the second bar (inclusive, - // but not including parentheses) - var applicableSpanStart = argumentListOrTypeArgumentList.getFullStart(); - var applicableSpanEnd = skipTrivia(sourceFile.text, argumentListOrTypeArgumentList.end, /*stopAfterLineBreak*/ false); - var applicableSpan = new TypeScript.TextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); + var argumentIndex = argumentListInfo.argumentIndex; - // The listItemIndex we got back includes commas. Our goal is to return the index of the proper - // item (not including commas). Here are some examples: - // 1. foo(a, b, c $) -> the listItemIndex is 4, we want to return 2 - // 2. foo(a, b, $ c) -> listItemIndex is 3, we want to return 2 - // 3. foo($a) -> listItemIndex is 0, we want to return 0 - // - // In general, we want to subtract the number of commas before the current index. - // But if we are on a comma, we also want to pretend we are on the argument *following* - // the comma. That amounts to taking the ceiling of half the index. - var argumentIndex = (argumentInfoOrTypeArgumentInfo.listItemIndex + 1) >> 1; - - // argumentCount is the number of commas plus one, unless the list is completely empty, - // in which case there are 0. - var argumentCount = argumentListOrTypeArgumentList.getChildCount() === 0 - ? 0 - : 1 + countWhere(argumentListOrTypeArgumentList.getChildren(), arg => arg.kind === SyntaxKind.CommaToken); + // argumentCount is the *apparent* number of arguments. + var argumentCount = argumentListInfo.argumentCount; var selectedItemIndex = candidates.indexOf(bestSignature); if (selectedItemIndex < 0) { @@ -378,35 +513,35 @@ module ts.SignatureHelp { } return { - items: items, - applicableSpan: applicableSpan, - selectedItemIndex: selectedItemIndex, - argumentIndex: argumentIndex, - argumentCount: argumentCount + items, + applicableSpan, + selectedItemIndex, + argumentIndex, + argumentCount }; function createSignatureHelpParameterForParameter(parameter: Symbol): SignatureHelpParameter { var displayParts = mapToDisplayParts(writer => - typeInfoResolver.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, argumentListOrTypeArgumentList)); + typeInfoResolver.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation)); var isOptional = !!(parameter.valueDeclaration.flags & NodeFlags.QuestionMark); return { name: parameter.name, documentation: parameter.getDocumentationComment(), - displayParts: displayParts, - isOptional: isOptional + displayParts, + isOptional }; } function createSignatureHelpParameterForTypeParameter(typeParameter: TypeParameter): SignatureHelpParameter { var displayParts = mapToDisplayParts(writer => - typeInfoResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, argumentListOrTypeArgumentList)); + typeInfoResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation)); return { name: typeParameter.symbol.name, documentation: emptyArray, - displayParts: displayParts, + displayParts, isOptional: false }; } diff --git a/src/services/smartIndenter.ts b/src/services/smartIndenter.ts index 7a56ea07be3..e593c6cfd66 100644 --- a/src/services/smartIndenter.ts +++ b/src/services/smartIndenter.ts @@ -222,7 +222,8 @@ module ts.formatting { if (node.parent) { switch (node.parent.kind) { case SyntaxKind.TypeReference: - if ((node.parent).typeArguments) { + if ((node.parent).typeArguments && + rangeContainsStartEnd((node.parent).typeArguments, node.getStart(sourceFile), node.getEnd())) { return (node.parent).typeArguments; } break; @@ -236,21 +237,28 @@ module ts.formatting { case SyntaxKind.Method: case SyntaxKind.CallSignature: case SyntaxKind.ConstructSignature: - if ((node.parent).typeParameters && node.end < (node.parent).typeParameters.end) { + var start = node.getStart(sourceFile); + if ((node.parent).typeParameters && + rangeContainsStartEnd((node.parent).typeParameters, start, node.getEnd())) { return (node.parent).typeParameters; } - - return (node.parent).parameters; + if (rangeContainsStartEnd((node.parent).parameters, start, node.getEnd())) { + return (node.parent).parameters; + } + break; case SyntaxKind.NewExpression: case SyntaxKind.CallExpression: - if ((node.parent).typeArguments && node.end < (node.parent).typeArguments.end) { + var start = node.getStart(sourceFile); + if ((node.parent).typeArguments && + rangeContainsStartEnd((node.parent).typeArguments, start, node.getEnd())) { return (node.parent).typeArguments; } - - return (node.parent).arguments; + if (rangeContainsStartEnd((node.parent).arguments, start, node.getEnd())) { + return (node.parent).arguments; + } + break; } } - return undefined; } diff --git a/src/services/syntax/SyntaxGenerator.js b/src/services/syntax/SyntaxGenerator.js index 0937947c80f..6e1039cb8b0 100644 --- a/src/services/syntax/SyntaxGenerator.js +++ b/src/services/syntax/SyntaxGenerator.js @@ -621,9 +621,10 @@ var TypeScript; SyntaxKind[SyntaxKind["Parameter"] = 209] = "Parameter"; SyntaxKind[SyntaxKind["EnumElement"] = 210] = "EnumElement"; SyntaxKind[SyntaxKind["TypeAnnotation"] = 211] = "TypeAnnotation"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 212] = "ComputedPropertyName"; - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 213] = "ExternalModuleReference"; - SyntaxKind[SyntaxKind["ModuleNameModuleReference"] = 214] = "ModuleNameModuleReference"; + SyntaxKind[SyntaxKind["ExpressionBody"] = 212] = "ExpressionBody"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 213] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 214] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ModuleNameModuleReference"] = 215] = "ModuleNameModuleReference"; SyntaxKind[SyntaxKind["FirstStandardKeyword"] = SyntaxKind.BreakKeyword] = "FirstStandardKeyword"; SyntaxKind[SyntaxKind["LastStandardKeyword"] = SyntaxKind.WithKeyword] = "LastStandardKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedKeyword"] = SyntaxKind.ClassKeyword] = "FirstFutureReservedKeyword"; @@ -1016,7 +1017,15 @@ var definitions = [ { name: 'asterixToken', isToken: true, isOptional: true }, { name: 'identifier', isToken: true }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'body', type: 'BlockSyntax | ISyntaxToken', isOptional: true } + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } + ] + }, + { + name: 'ExpressionBody', + baseType: 'ISyntaxNode', + children: [ + { name: 'equalsGreaterThanToken', isToken: true }, + { name: 'expression', type: 'IExpressionSyntax' } ] }, { @@ -1246,6 +1255,7 @@ var definitions = [ baseType: 'ISyntaxNode', interfaces: ['IStatementSyntax'], children: [ + { name: 'equalsGreaterThanToken', isToken: true, isOptional: 'true' }, { name: 'openBraceToken', isToken: true }, { name: 'statements', isList: true, elementType: 'IStatementSyntax' }, { name: 'closeBraceToken', isToken: true, excludeFromAST: true } @@ -1289,7 +1299,7 @@ var definitions = [ children: [ { name: 'expression', type: 'ILeftHandSideExpressionSyntax' }, { name: 'openBracketToken', isToken: true, excludeFromAST: true }, - { name: 'argumentExpression', type: 'IExpressionSyntax' }, + { name: 'argumentExpression', type: 'IExpressionSyntax', isOptional: true }, { name: 'closeBracketToken', isToken: true, excludeFromAST: true } ] }, @@ -1488,7 +1498,7 @@ var definitions = [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, { name: 'constructorKeyword', isToken: true }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'body', type: 'BlockSyntax | ISyntaxToken', isOptional: true } + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } ], isTypeScriptSpecific: true }, @@ -1501,7 +1511,7 @@ var definitions = [ { name: 'asterixToken', isToken: true, isOptional: true }, { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'body', type: 'BlockSyntax | ISyntaxToken', isOptional: true } + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } ], isTypeScriptSpecific: true }, @@ -1514,7 +1524,7 @@ var definitions = [ { name: 'getKeyword', isToken: true, excludeFromAST: true }, { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'block', type: 'BlockSyntax' } + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } ] }, { @@ -1526,7 +1536,7 @@ var definitions = [ { name: 'setKeyword', isToken: true, excludeFromAST: true }, { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'block', type: 'BlockSyntax' } + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } ], isTypeScriptSpecific: true }, @@ -1558,7 +1568,7 @@ var definitions = [ interfaces: ['IStatementSyntax'], children: [ { name: 'throwKeyword', isToken: true, excludeFromAST: true }, - { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'expression', type: 'IExpressionSyntax', isOptional: true }, { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } ] }, @@ -1763,7 +1773,7 @@ var definitions = [ { name: 'asterixToken', isToken: true, isOptional: true }, { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'block', type: 'BlockSyntax' } + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } ] }, { @@ -1775,7 +1785,7 @@ var definitions = [ { name: 'asterixToken', isToken: true, isOptional: true }, { name: 'identifier', isToken: true, isOptional: true }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'block', type: 'BlockSyntax' } + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } ] }, { diff --git a/src/services/syntax/SyntaxGenerator.js.map b/src/services/syntax/SyntaxGenerator.js.map index bd5d7bd6cb3..662350f9032 100644 --- a/src/services/syntax/SyntaxGenerator.js.map +++ b/src/services/syntax/SyntaxGenerator.js.map @@ -6,6 +6,10 @@ <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD +<<<<<<< HEAD <<<<<<< Updated upstream {"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAAC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A,CAACA,MAAMA,CAACA;AAClBA,CAACA;AAED,IAAI,mBAAmB,GAAG,aAAa,EAAE,CAAC;AAC1C,IAAI,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,MAAM,GAAG,cAAc,EAAE,CAAC;AAC9B,IAAI,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,OAAO,GAAG,eAAe,EAAE,CAAC;AAChC,IAAI,SAAS,GAAG,iBAAiB,EAAE,CAAC;AAEpC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,4DAA4D,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACpI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,oDAAoD,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} ======= @@ -35,3 +39,15 @@ ======= {"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChDA,IAAIA,CAACA,CAACA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACxCA,CAACA;QAEDA,SAASA,QAAQA,CAACA,QAAgBA,EAAEA,QAAiBA;YACjDC,EAAEA,CAACA,CAACA,CAACA,GAAGA,CAACA,UAAUA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA;gBAC5BA,MAAMA,CAACA,SAASA,CAACA;YACrBA,CAACA;YACDA,UAAUA,CAACA,IAAIA,EAAEA,CAACA;YAClBA,IAAAA,CAACA;gBACGA,EAAEA,CAACA,CAACA,QAAQA,CAACA,CAACA,CAACA;oBACXA,UAAUA,CAACA,OAAOA,GAAGA,QAAQA,CAACA;oBAC9BA,UAAUA,CAACA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AACA,CAACA,CAACA;gBAGvDA,GAAGA,IAAIA,CAACA,CAACA,CAACA;gBACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA;oBAC9BA,IAAIA,IAAIA,GAAGA,MAAMA,CAACA,CAACA,CAACA,CAACA;oBACrBA,MAAMA,CAACA,CAACA,CAACA,GAAGA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;oBAC1BA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA;gBACzBA,CAACA;gBACDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAEvDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAE7EA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,MAAMA,EAAEA,CAACA,CAACA,CAACA;YACtCA,CAACA;YAEDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,MAAMA,CAACA,CAACA;QACnCA,CAACA;QAEDD,SAASA,SAASA,CAACA,QAAgBA,EAAEA,IAAYA,EAAEA,kBAA4BA;YAE3EE,EAAEA,CAACA,CAACA,k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AACA;IAElBA,MAAMA,IAAIA,OAAOA,CAACA;IAElBA,MAAMA,CAACA,MAAMA,CAACA;AAClBA,CAACA;AAED,IAAI,mBAAmB,GAAG,aAAa,EAAE,CAAC;AAC1C,IAAI,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,MAAM,GAAG,cAAc,EAAE,CAAC;AAC9B,IAAI,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,OAAO,GAAG,eAAe,EAAE,CAAC;AAChC,IAAI,SAAS,GAAG,iBAAiB,EAAE,CAAC;AAEpC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,4DAA4D,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACpI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,oDAAoD,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} >>>>>>> 99981aa... Add support for parsing yield expressions. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChDA,IAAIA,CAACA,CAACA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACxCA,CAACA;QAEDA,SAASA,QAAQA,CAACA,QAAgBA,EAAEA,QAAiBA;YACjDC,EAAEA,CAACA,CAACA,CAACA,GAAGA,CAACA,UAAUA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA;gBAC5BA,MAAMA,CAACA,SAASA,CAACA;YACrBA,CAACA;YACDA,UAAUA,CAACA,IAAIA,EAAEA,CAACA;YAClBA,IAAAA,CAACA;gBACGA,EAAEA,CAACA,CAACA,QAAQA,CAACA,CAACA,CAACA;oBACXA,U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AMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAGvDA,GAAGA,IAAIA,CAACA,CAACA,CAACA;gBACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA;oBAC9BA,IAAIA,IAAIA,GAAGA,MAAMA,CAACA,CAACA,CAACA,CAACA;oBACrBA,MAAMA,CAACA,CAACA,CAACA,GAAGA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;oBAC1BA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA;gBACzBA,CAACA;gBACDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAEvDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAE7EA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,MAAMA,EAAEA,CAACA,CAACA,CAACA;YACtCA,CAACA;YAEDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,MAAMA,CAACA,CAACA;QACnCA,CAACA;QAEDD,SAASA,SAASA,CAACA,QAAgBA,EAAEA,IAAYA,EAAEA,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A;IAC/GA,CAACA;IAEDA,MAAMA,IAAIA,OAAOA,CAACA;IAElBA,MAAMA,IAAIA,OAAOA,CAACA;IAElBA,MAAMA,CAACA,MAAMA,CAACA;AAClBA,CAACA;AAED,IAAI,mBAAmB,GAAG,aAAa,EAAE,CAAC;AAC1C,IAAI,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,MAAM,GAAG,cAAc,EAAE,CAAC;AAC9B,IAAI,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,OAAO,GAAG,eAAe,EAAE,CAAC;AAChC,IAAI,SAAS,GAAG,iBAAiB,EAAE,CAAC;AAEpC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,4DAA4D,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACpI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,oDAAoD,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> 8097afa... Move parser error to grammar check phase. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChDA,IAAIA,CAACA,CAACA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACxCA,CAACA;QAEDA,SAASA,QAAQA,CAACA,QAAgBA,EAAEA,QAAiBA;YACjDC,EAAEA,CAACA,CAACA,CAACA,GAAGA,CAACA,UAAUA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA;gBAC5BA,MAAMA,CAACA,SAASA,CAACA;YACrBA,CAACA;YACDA,UAAUA,CAACA,IAAIA,EAAEA,CAACA;YAClBA,IAAAA,CAACA;gBACGA,EAAE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AAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAGvDA,GAAGA,IAAIA,CAACA,CAACA,CAACA;gBACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA;oBAC9BA,IAAIA,IAAIA,GAAGA,MAAMA,CAACA,CAACA,CAACA,CAACA;oBACrBA,MAAMA,CAACA,CAACA,CAACA,GAAGA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;oBAC1BA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA;gBACzBA,CAACA;gBACDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAEvDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAE7EA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,MAAMA,EAAEA,CAACA,CAACA,CAACA;YACtCA,CAACA;YAEDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,MAAMA,CAACA,CAACA;QACnCA,CAACA;QAEDD,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,UAAUA,CAACA,GAAGA,SAASA,GAAGA,UAAUA,CAACA,IAAIA,GAAGA,aAAaA,CAACA;IAC/GA,CAACA;IAEDA,MAAMA,IAAIA,OAAOA,CAACA;IAElBA,MAAMA,IAAIA,OAAOA,CAACA;IAElBA,MAAMA,CAACA,MAAMA,CAACA;AAClBA,CAACA;AAED,IAAI,mBAAmB,GAAG,aAAa,EAAE,CAAC;AAC1C,IAAI,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,MAAM,GAAG,cAAc,EAAE,CAAC;AAC9B,IAAI,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,OAAO,GAAG,eAAe,EAAE,CAAC;AAChC,IAAI,SAAS,GAAG,iBAAiB,EAAE,CAAC;AAEpC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,4DAA4D,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACpI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,oDAAoD,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> 67123d7... Move parser error to the grammar checker. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA,CAAYA;QAEjCA,IAAIA,IAAIA,GAAaA,EAAEA,CAACA;QACxBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChDA,IAAIA,CAACA,CAACA,CAACA,GAAGA,OAAOA,CAACA,SAASA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACxCA,CAACA;QAEDA,SAASA,QAAQA,CAACA,QAAgBA,EAAEA,QAAiBA;YACjDC,EAAEA,CAACA,CAACA,CAACA,GAAGA,CAACA,UAAUA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA;gBAC5BA,MAAMA,CAACA,SAASA,CAACA;YACrBA,CAACA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AACA,MAAMA,CAACA;YACxBA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAGvDA,GAAGA,IAAIA,CAACA,CAACA,CAACA;gBACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA;oBAC9BA,IAAIA,IAAIA,GAAGA,MAAMA,CAACA,CAACA,CAACA,CAACA;oBACrBA,MAAMA,CAACA,CAACA,CAACA,GAAGA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;oBAC1BA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA;gBACzBA,CAACA;gBACDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAEvDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;YACzCA,CAACA;YACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;gBAE7EA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,MAAMA,EAAEA,CAACA,CAACA,CAACA;YACtCA,CAACA;YAEDA,MAAMA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,EAAE,GAAG,oDAAoD,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> e97cba0... Make parser more lenient with what it allows as the body of a function. +======= +{"version":3,"file":"SyntaxGenerator.js","sourceRoot":"","sources":["file:///C:/VSPro_1/src/typescript/public_cyrusn/src/compiler/sys.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/errors.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/arrayUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/core/stringUtilities.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxKind.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/syntaxFacts.ts","file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.ts"],"names":["getWScriptSystem","getWScriptSystem.readFile","getWScriptSystem.writeFile","getNodeSystem","getNodeSystem.readFile","getNodeSystem.writeFile","getNodeSystem.fileChanged","TypeScript","TypeScript.Errors","TypeScript.Errors.constructor","TypeScript.Errors.argument","TypeScript.Errors.argumentOutOfRange","TypeScript.Errors.argumentNull","TypeScript.Errors.abstract","TypeScript.Errors.notYetImplemented","TypeScript.Errors.invalidOperation","TypeScript.ArrayUtilities","TypeScript.ArrayUtilities.constructor","TypeScript.ArrayUtilities.sequenceEquals","TypeScript.ArrayUtilities.contains","TypeScript.ArrayUtilities.distinct","TypeScript.ArrayUtilities.last","TypeScript.ArrayUtilities.lastOrDefault","TypeScript.ArrayUtilities.firstOrDefault","TypeScript.ArrayUtilities.first","TypeScript.ArrayUtilities.sum","TypeScript.ArrayUtilities.select","TypeScript.ArrayUtilities.where","TypeScript.ArrayUtilities.any","TypeScript.ArrayUtilities.all","TypeScript.ArrayUtilities.binarySearch","TypeScript.ArrayUtilities.createArray","TypeScript.ArrayUtilities.grow","TypeScript.ArrayUtilities.copy","TypeScript.ArrayUtilities.indexOf","TypeScript.StringUtilities","TypeScript.StringUtilities.constructor","TypeScript.StringUtilities.isString","TypeScript.StringUtilities.endsWith","TypeScript.StringUtilities.startsWith","TypeScript.StringUtilities.repeat","TypeScript.SyntaxKind","TypeScript.SyntaxFacts","TypeScript.SyntaxFacts.getTokenKind","TypeScript.SyntaxFacts.getText","TypeScript.SyntaxFacts.isAnyKeyword","TypeScript.SyntaxFacts.isAnyPunctuation","TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken","TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken","TypeScript.SyntaxFacts.isAssignmentOperatorToken","TypeScript.SyntaxFacts.isType","firstKind","getStringWithoutSuffix","getNameWithoutSuffix","getType","camelCase","getSafeName","generateConstructorFunction","generateSyntaxInterfaces","generateSyntaxInterface","generateNodes","isInterface","generateWalker","firstEnumName","groupBy","generateKeywordCondition","min","max","generateUtilities","generateScannerUtilities","syntaxKindName","generateVisitor"],"mappings":"AA4BA,IAAI,GAAG,GAAW,CAAC;IAEf,SAAS,gBAAgB;QAErBA,IAAIA,GAAGA,GAAGA,IAAIA,aAAaA,CAACA,4BAA4BA,CAACA,CAACA;QAE1DA,IAAIA,UAAUA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACnDA,UAAUA,CAACA,IAAIA,GAAGA,CAACA,CAAUA;QAE7BA,IAAIA,YAAYA,GAAGA,IAAIA,aAAaA,CAACA,cAAcA,CAACA,CAACA;QACrDA,YAAYA,CAACA,IAAIA,GAAGA,CAACA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AC1C,IAAI,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,MAAM,GAAG,cAAc,EAAE,CAAC;AAC9B,IAAI,gBAAgB,GAAG,wBAAwB,EAAE,CAAC;AAClD,IAAI,OAAO,GAAG,eAAe,EAAE,CAAC;AAChC,IAAI,SAAS,GAAG,iBAAiB,EAAE,CAAC;AAEpC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,4DAA4D,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;AACpI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,oDAAoD,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/G,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,wDAAwD,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC7H,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,qDAAqD,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjH,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,iDAAiD,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC"} +>>>>>>> f41e8c3... Rename 'block' to 'body'. diff --git a/src/services/syntax/constants.ts b/src/services/syntax/constants.ts index 8845af18af6..87d4a6a2c77 100644 --- a/src/services/syntax/constants.ts +++ b/src/services/syntax/constants.ts @@ -1,29 +1,24 @@ /// module TypeScript { + export const enum ParserContextFlags { + StrictMode = 1 << 0, + DisallowIn = 1 << 1, + Yield = 1 << 2, + GeneratorParameter = 1 << 3, + + Mask = 0xF + } + export enum SyntaxNodeConstants { None = 0, - // Masks that we use to place information about a node into a single int. The first bit tells - // us if we've computed the data for a node. - // - // The second bit tells us if the node is incrementally reusable if it does not - // containe any skipped tokens, zero width tokens, regex tokens in it ("/", "/=" or "/.../"), - // and contains no tokens that were parser generated. - // - // The next bit lets us know if the nodes was parsed in a strict context or node. A node can - // only be used by the incremental parser if it is parsed in the same strict context as before. - // last masks off the part of the int - // + // The first four bit of the flags are used to store parser context flags. // The width of the node is stored in the remainder of the int. This allows us up to 128MB // for a node by using all 27 bits. However, in the common case, we'll use less than 27 bits // for the width. Thus, the info will be stored in a single int in chakra. - DataComputed = 0x00000001, // 0000 0000 0000 0000 0000 0000 0000 0001 - IncrementallyUnusableMask = 0x00000002, // 0000 0000 0000 0000 0000 0000 0000 0010 - ParsedInStrictModeContext = 0x00000004, // 0000 0000 0000 0000 0000 0000 0000 0100 - ParsedInDisallowInContext = 0x00000008, // 0000 0000 0000 0000 0000 0000 0000 1000 - ParsedInYieldContext = 0x00000010, // 0000 0000 0000 0000 0000 0000 0001 0000 - ParsedInGeneratorParameterContext = 0x00000020, // 0000 0000 0000 0000 0000 0000 0010 0000 - FullWidthShift = 1 << 6, // 1111 1111 1111 1111 1111 1111 1100 0000 + DataComputed = 1 << 4, // 0000 0000 0000 0000 0000 0000 0001 0000 + IncrementallyUnusableMask = 1 << 5, // 0000 0000 0000 0000 0000 0000 0010 0000 + FullWidthShift = 1 << 6, // 1111 1111 1111 1111 1111 1111 1100 0000 } } \ No newline at end of file diff --git a/src/services/syntax/incrementalParser.ts b/src/services/syntax/incrementalParser.ts index b234b77e03f..273b3eec5fe 100644 --- a/src/services/syntax/incrementalParser.ts +++ b/src/services/syntax/incrementalParser.ts @@ -4,8 +4,10 @@ module TypeScript.IncrementalParser { interface IParserRewindPoint { // Information used by the incremental parser source. oldSourceUnitCursor: SyntaxCursor; - changeDelta: number; - changeRange: TextChangeRange; + } + + interface ISyntaxElementInternal extends ISyntaxElement { + intersectsChange: boolean; } // Parser source used in incremental scenarios. This parser source wraps an old tree, text @@ -21,9 +23,6 @@ module TypeScript.IncrementalParser { // prevent this level of reuse include substantially destructive operations like introducing // "/*" without a "*/" nearby to terminate the comment. function createParserSource(oldSyntaxTree: SyntaxTree, textChangeRange: TextChangeRange, text: ISimpleText): Parser.IParserSource { - var fileName = oldSyntaxTree.fileName(); - var languageVersion = oldSyntaxTree.languageVersion(); - // The underlying source that we will use to scan tokens from any new text, or any tokens // from the old tree that we decide we can't use for any reason. We will also continue // scanning tokens from this source until we've decided that we're resynchronized and can @@ -31,40 +30,15 @@ module TypeScript.IncrementalParser { // // This parser source also keeps track of the absolute position in the text that we're in, // and any token diagnostics produced. That way we dont' have to track that ourselves. - var _scannerParserSource: Scanner.IScannerParserSource; - - // The range of text in the *original* text that was changed, and the new length of it after - // the change. - var _changeRange: TextChangeRange; - - // Cached value of _changeRange.newSpan(). Cached for performance. - var _changeRangeNewSpan: TextSpan; - - // This number represents how our position in the old tree relates to the position we're - // pointing at in the new text. If it is 0 then our positions are in sync and we can read - // nodes or tokens from the old tree. If it is non-zero, then our positions are not in - // sync and we cannot use nodes or tokens from the old tree. - // - // Now, changeDelta could be negative or positive. Negative means 'the position we're at - // in the original tree is behind the position we're at in the text'. In this case we - // keep throwing out old nodes or tokens (and thus move forward in the original tree) until - // changeDelta becomes 0 again or positive. If it becomes 0 then we are resynched and can - // read nodes or tokesn from the tree. - // - // If changeDelta is positive, that means the current node or token we're pointing at in - // the old tree is at a further ahead position than the position we're pointing at in the - // new text. In this case we have no choice but to scan tokens from teh new text. We will - // continue to do so until, again, changeDelta becomes 0 and we've resynced, or change delta - // becomes negative and we need to skip nodes or tokes in the original tree. - var _changeDelta: number = 0; + var _scannerParserSource = Scanner.createParserSource(oldSyntaxTree.fileName(), text, oldSyntaxTree.languageVersion()); // The cursor we use to navigate through and retrieve nodes and tokens from the old tree. - var _oldSourceUnitCursor = getSyntaxCursor(); var oldSourceUnit = oldSyntaxTree.sourceUnit(); var _outstandingRewindPointCount = 0; // Start the cursor pointing at the first element in the source unit (if it exists). + var _oldSourceUnitCursor = getSyntaxCursor(); if (oldSourceUnit.moduleElements.length > 0) { _oldSourceUnitCursor.pushElement(childAt(oldSourceUnit.moduleElements, 0), /*indexInParent:*/ 0); } @@ -74,8 +48,10 @@ module TypeScript.IncrementalParser { // time this could be problematic would be if the user made a ton of discontinuous edits. // For example, doing a column select on a *large* section of a code. If this is a // problem, we can always update this code to handle multiple changes. - _changeRange = extendToAffectedRange(textChangeRange, oldSourceUnit); - _changeRangeNewSpan = _changeRange.newSpan(); + var _changeRange = extendToAffectedRange(textChangeRange, oldSourceUnit); + + // Cached value of _changeRange.newSpan(). Cached for performance. + var _changeRangeNewSpan = _changeRange.newSpan(); // The old tree's length, plus whatever length change was caused by the edit // Had better equal the new text's length! @@ -83,8 +59,23 @@ module TypeScript.IncrementalParser { Debug.assert((fullWidth(oldSourceUnit) - _changeRange.span().length() + _changeRange.newLength()) === text.length()); } - // Set up a scanner so that we can scan tokens out of the new text. - _scannerParserSource = Scanner.createParserSource(oldSyntaxTree.fileName(), text, oldSyntaxTree.languageVersion()); + var delta = _changeRange.newSpan().length() - _changeRange.span().length(); + // If we added or removed characters during the edit, then we need to go and adjust all + // the nodes after the edit. Those nodes may move forward down (if we inserted chars) + // or they may move backward (if we deleted chars). + // + // Doing this helps us out in two ways. First, it means that any nodes/tokens we want + // to reuse are already at the appropriate position in the new text. That way when we + // reuse them, we don't have to figure out if they need to be adjusted. Second, it makes + // it very easy to determine if we can reuse a node. If the node's position is at where + // we are in the text, then we can reuse it. Otherwise we can't. If hte node's position + // is ahead of us, then we'll need to rescan tokens. If the node's position is behind + // us, then we'll need to skip it or crumble it as appropriate + // + // Also, mark any syntax elements that intersect the changed span. We know, up front, + // that we cannot reuse these elements. + updateTokenPositionsAndMarkElements(oldSourceUnit, + _changeRange.span().start(), _changeRange.span().end(), delta, /*fullStart:*/ 0); function release() { _scannerParserSource.release(); @@ -93,8 +84,7 @@ module TypeScript.IncrementalParser { _outstandingRewindPointCount = 0; } - function extendToAffectedRange(changeRange: TextChangeRange, - sourceUnit: SourceUnitSyntax): TextChangeRange { + function extendToAffectedRange(changeRange: TextChangeRange, sourceUnit: SourceUnitSyntax): TextChangeRange { // Consider the following code: // void foo() { /; } // @@ -105,14 +95,6 @@ module TypeScript.IncrementalParser { // (as it does not intersect the actual original change range). Because an edit may // change the token touching it, we actually need to look back *at least* one token so // that the prior token sees that change. - // - // Note: i believe (outside of regex tokens) max lookahead is just one token for - // TypeScript. However, if this turns out to be wrong, we may have to increase how much - // futher we look back. - // - // Note: lookahead handling for regex characters is handled specially in during - // incremental parsing, and does not need to be handled here. - var maxLookahead = 1; var start = changeRange.span().start(); @@ -122,10 +104,6 @@ module TypeScript.IncrementalParser { // start of the tree. for (var i = 0; start > 0 && i <= maxLookahead; i++) { var token = findToken(sourceUnit, start); - - // Debug.assert(token.kind !== SyntaxKind.None); - // Debug.assert(token.kind() === SyntaxKind.EndOfFileToken || token.fullWidth() > 0); - var position = token.fullStart(); start = Math.max(0, position - 1); @@ -149,17 +127,8 @@ module TypeScript.IncrementalParser { // Get a rewind point for our new text reader and for our old source unit cursor. var rewindPoint = _scannerParserSource.getRewindPoint(); - // Clone our cursor. That way we can restore to that point if hte parser needs to rewind. - var oldSourceUnitCursorClone = cloneSyntaxCursor(_oldSourceUnitCursor); - - // Store where we were when the rewind point was created. - rewindPoint.changeDelta = _changeDelta; - rewindPoint.changeRange = _changeRange; - rewindPoint.oldSourceUnitCursor = _oldSourceUnitCursor; - - _oldSourceUnitCursor = oldSourceUnitCursorClone; - - // Debug.assert(rewindPoint.pinCount === _oldSourceUnitCursor.pinCount()); + // Clone our cursor. That way we can restore to that point if the parser needs to rewind. + rewindPoint.oldSourceUnitCursor = cloneSyntaxCursor(_oldSourceUnitCursor); _outstandingRewindPointCount++; return rewindPoint; @@ -167,15 +136,13 @@ module TypeScript.IncrementalParser { function rewind(rewindPoint: IParserRewindPoint): void { // Restore our state to the values when the rewind point was created. - _changeRange = rewindPoint.changeRange; - _changeDelta = rewindPoint.changeDelta; // Reset the cursor to what it was when we got the rewind point. Make sure to return // our existing cursor to the pool so it can be reused. returnSyntaxCursor(_oldSourceUnitCursor); _oldSourceUnitCursor = rewindPoint.oldSourceUnitCursor; - // Null out the cursor that the rewind point points to. This way we don't try + // Clear the cursor that the rewind point points to. This way we don't try // to return it in 'releaseRewindPoint'. rewindPoint.oldSourceUnitCursor = undefined; @@ -196,7 +163,7 @@ module TypeScript.IncrementalParser { return _outstandingRewindPointCount > 0; } - function canReadFromOldSourceUnit() { + function trySynchronizeCursorToPosition() { // If we're currently pinned, then do not want to touch the cursor. Here's why. First, // recall that we're 'pinned' when we're speculatively parsing. So say we were to allow // returning old nodes/tokens while speculatively parsing. Then, the parser might start @@ -218,81 +185,72 @@ module TypeScript.IncrementalParser { return false; } - // If our current absolute position is in the middle of the changed range in the new text - // then we definitely can't read from the old source unit right now. - if (_changeRange && _changeRangeNewSpan.intersectsWithPosition(absolutePosition())) { - return false; - } + var absolutePos = absolutePosition(); + while (true) { + if (_oldSourceUnitCursor.isFinished()) { + // Can't synchronize the cursor to the current position if the cursor is finished. + return false; + } - // First, try to sync up with the new text if we're behind. - syncCursorToNewTextIfBehind(); + // Start with the current node or token the cursor is pointing at. + var currentNodeOrToken = _oldSourceUnitCursor.currentNodeOrToken(); - // Now, if we're synced up *and* we're not currently pinned in the new text scanner, - // then we can read a node from the cursor. If we're pinned in the scanner then we - // can't read a node from the cursor because we will mess up the pinned scanner when - // we try to move it forward past this node. - return _changeDelta === 0 && - !_oldSourceUnitCursor.isFinished(); - } + // Node, move the cursor past any nodes or tokens that intersect the change range + // 1) they are never reusable. + // 2) their positions are wacky as they refer to the original text. + // + // We consider these nodes and tokens essentially invisible to all further parts + // of the incremental algorithm. + if ((currentNodeOrToken).intersectsChange) { + if (isNode(currentNodeOrToken)) { + _oldSourceUnitCursor.moveToFirstChild(); + } + else { + _oldSourceUnitCursor.moveToNextSibling(); + } + continue; + } - function updateTokenPosition(token: ISyntaxToken): void { - // If we got a node or token, and we're past the range of edited text, then walk its - // constituent tokens, making sure all their positions are correct. We don't need to - // do this for the tokens before the edited range (since their positions couldn't have - // been affected by the edit), and we don't need to do this for the tokens in the - // edited range, as their positions will be correct when the underlying parser source - // creates them. + var currentNodeOrTokenFullStart = fullStart(currentNodeOrToken); + if (currentNodeOrTokenFullStart === absolutePos) { + // We were able to synchronize the cursor to the current position. We can + // read from the cursor + return true; + } - if (isPastChangeRange()) { - token.setFullStart(absolutePosition()); - } - } + if (currentNodeOrTokenFullStart > absolutePos) { + // The node or token is ahead of the current position. We'll need to rescan + // tokens until we catch up. + return false; + } - function updateNodePosition(node: ISyntaxNode): void { - // If we got a node or token, and we're past the range of edited text, then walk its - // constituent tokens, making sure all their positions are correct. We don't need to - // do this for the tokens before the edited range (since their positions couldn't have - // been affected by the edit), and we don't need to do this for the tokens in the - // edited range, as their positions will be correct when the underlying parser source - // creates them. + // The node or is behind the current position we're at in the text. - if (isPastChangeRange()) { - var position = absolutePosition(); + var currentNodeOrTokenFullWidth = fullWidth(currentNodeOrToken); + var currentNodeOrTokenFullEnd = currentNodeOrTokenFullStart + currentNodeOrTokenFullWidth; - var tokens = getTokens(node); - - for (var i = 0, n = tokens.length; i < n; i++) { - var token = tokens[i]; - token.setFullStart(position); - - position += token.fullWidth(); + // If we're pointing at a node, and that node ends before our current position, we + // can just skip the node entirely. Or, if we're pointing at a token, we won't be + // able to break up that token any further and we should just move to the next + // token. + if (currentNodeOrTokenFullEnd <= absolutePos || isToken(currentNodeOrToken)) { + _oldSourceUnitCursor.moveToNextSibling(); + } + else { + // We have a node, and it started before our absolute pos, and ended after our + // pos. Try to crumble this node to see if we'll be able to skip the first node + // or token contained within. + _oldSourceUnitCursor.moveToFirstChild(); } } } - function getTokens(node: ISyntaxNode): ISyntaxToken[] { - var tokens = node.__cachedTokens; - if (!tokens) { - tokens = []; - tokenCollectorWalker.tokens = tokens; - - visitNodeOrToken(tokenCollectorWalker, node); - - node.__cachedTokens = tokens; - tokenCollectorWalker.tokens = undefined; - } - - return tokens; - } - function currentNode(): ISyntaxNode { - if (canReadFromOldSourceUnit()) { + if (trySynchronizeCursorToPosition()) { // Try to read a node. If we can't then our caller will call back in and just try // to get a token. var node = tryGetNodeFromOldSourceUnit(); if (node) { - // Make sure the positions for the tokens in this node are correct. - updateNodePosition(node); return node; } } @@ -302,11 +260,9 @@ module TypeScript.IncrementalParser { } function currentToken(): ISyntaxToken { - if (canReadFromOldSourceUnit()) { + if (trySynchronizeCursorToPosition()) { var token = tryGetTokenFromOldSourceUnit(); if (token) { - // Make sure the token's position/text is correct. - updateTokenPosition(token); return token; } } @@ -321,69 +277,13 @@ module TypeScript.IncrementalParser { return _scannerParserSource.currentContextualToken(); } - function syncCursorToNewTextIfBehind() { - while (true) { - if (_oldSourceUnitCursor.isFinished()) { - // Can't sync up if the cursor is finished. - break; - } - - if (_changeDelta >= 0) { - // Nothing to do if we're synced up or ahead of the text. - break; - } - - // We're behind in the original tree. Throw out a node or token in an attempt to - // catch up to the position we're at in the new text. - - var currentNodeOrToken = _oldSourceUnitCursor.currentNodeOrToken(); - - // If we're pointing at a node, and that node's width is less than our delta, - // then we can just skip that node. Otherwise, if we're pointing at a node - // whose width is greater than the delta, then crumble it and try again. - // Otherwise, we must be pointing at a token. Just skip it and try again. - - if (isNode(currentNodeOrToken) && (fullWidth(currentNodeOrToken) > Math.abs(_changeDelta))) { - // We were pointing at a node whose width was more than changeDelta. Crumble the - // node and try again. Note: we haven't changed changeDelta. So the callers loop - // will just repeat this until we get to a node or token that we can skip over. - _oldSourceUnitCursor.moveToFirstChild(); - } - else { - _oldSourceUnitCursor.moveToNextSibling(); - - // Get our change delta closer to 0 as we skip past this item. - _changeDelta += fullWidth(currentNodeOrToken); - - // If this was a node, then our changeDelta is 0 or negative. If this was a - // token, then we could still be negative (and we have to read another token), - // we could be zero (we're done), or we could be positive (we've moved ahead - // of the new text). Only if we're negative will we continue looping. - } - } - - // At this point, we must be either: - // a) done with the cursor - // b) (ideally) caught up to the new text position. - // c) ahead of the new text position. - // In case 'b' we can try to reuse a node from teh old tree. - // Debug.assert(_oldSourceUnitCursor.isFinished() || _changeDelta >= 0); - } - - function intersectsWithChangeRangeSpanInOriginalText(start: number, length: number) { - return !isPastChangeRange() && _changeRange.span().intersectsWith(start, length); - } - function tryGetNodeFromOldSourceUnit(): ISyntaxNode { - // Debug.assert(canReadFromOldSourceUnit()); - // Keep moving the cursor down to the first node that is safe to return. A node is // safe to return if: - // a) it does not intersect the changed text. - // b) it does not contain skipped text. - // c) it does not have any zero width tokens in it. - // d) it does not have a regex token in it. - // e) we are still in the same strict or non-strict state that the node was originally parsed in. + // a) it does not contain skipped text. + // b) it does not have any zero width tokens in it. + // c) it does not have a regex token in it. + // d) we are still in the same strict or non-strict state that the node was originally parsed in. while (true) { var node = _oldSourceUnitCursor.currentNode(); if (node === undefined) { @@ -391,15 +291,10 @@ module TypeScript.IncrementalParser { return undefined; } - if (!intersectsWithChangeRangeSpanInOriginalText(absolutePosition(), fullWidth(node))) { - // Didn't intersect with the change range. - var isIncrementallyUnusuable = TypeScript.isIncrementallyUnusable(node); - if (!isIncrementallyUnusuable) { - - // Didn't contain anything that would make it unusable. Awesome. This is - // a node we can reuse. - return node; - } + if (!TypeScript.isIncrementallyUnusable(node)) { + // Didn't contain anything that would make it unusable. Awesome. This is + // a node we can reuse. + return node; } // We couldn't use currentNode. Try to move to its first child (in case that's a @@ -409,9 +304,9 @@ module TypeScript.IncrementalParser { } } - function canReuseTokenFromOldSourceUnit(position: number, token: ISyntaxToken): boolean { + function canReuseTokenFromOldSourceUnit(token: ISyntaxToken): boolean { // A token is safe to return if: - // a) it does not intersect the changed text. + // a) it did not intersect the change range. // b) it does not contain skipped text. // c) it is not zero width. // d) it is not a contextual parser token. @@ -427,33 +322,21 @@ module TypeScript.IncrementalParser { // need to make sure that if that the parser asks for a *token* we don't return it. // Converted identifiers can't ever be created by the scanner, and as such, should not // be returned by this source. - if (token) { - if (!intersectsWithChangeRangeSpanInOriginalText(position, token.fullWidth())) { - // Didn't intersect with the change range. - if (!token.isIncrementallyUnusable() && !Scanner.isContextualToken(token)) { - - // Didn't contain anything that would make it unusable. Awesome. This is - // a token we can reuse. - return true; - } - } - } - - return false; + return token && + !(token).intersectsChange && + !token.isIncrementallyUnusable() && + !Scanner.isContextualToken(token); } function tryGetTokenFromOldSourceUnit(): ISyntaxToken { - // Debug.assert(canReadFromOldSourceUnit()); - // get the current token that the cursor is pointing at. var token = _oldSourceUnitCursor.currentToken(); - return canReuseTokenFromOldSourceUnit(absolutePosition(), token) - ? token : undefined; + return canReuseTokenFromOldSourceUnit(token) ? token : undefined; } function peekToken(n: number): ISyntaxToken { - if (canReadFromOldSourceUnit()) { + if (trySynchronizeCursorToPosition()) { var token = tryPeekTokenFromOldSourceUnit(n); if (token) { return token; @@ -465,8 +348,6 @@ module TypeScript.IncrementalParser { } function tryPeekTokenFromOldSourceUnit(n: number): ISyntaxToken { - // Debug.assert(canReadFromOldSourceUnit()); - // clone the existing cursor so we can move it forward and then restore ourselves back // to where we started from. @@ -481,11 +362,6 @@ module TypeScript.IncrementalParser { } function tryPeekTokenFromOldSourceUnitWorker(n: number): ISyntaxToken { - // In order to peek the 'nth' token we need all the tokens up to that point. That way - // we know we know position that the nth token is at. The position is necessary so - // that we can test if this token (or any that precede it cross the change range). - var currentPosition = absolutePosition(); - // First, make sure the cursor is pointing at a token. _oldSourceUnitCursor.moveToFirstToken(); @@ -493,111 +369,31 @@ module TypeScript.IncrementalParser { for (var i = 0; i < n; i++) { var interimToken = _oldSourceUnitCursor.currentToken(); - if (!canReuseTokenFromOldSourceUnit(currentPosition, interimToken)) { + if (!canReuseTokenFromOldSourceUnit(interimToken)) { return undefined; } - currentPosition += interimToken.fullWidth(); _oldSourceUnitCursor.moveToNextSibling(); } var token = _oldSourceUnitCursor.currentToken(); - return canReuseTokenFromOldSourceUnit(currentPosition, token) - ? token : undefined; + return canReuseTokenFromOldSourceUnit(token) ? token : undefined; } - function consumeNode(node: ISyntaxNode): void { - // A node could have only come from the old source unit cursor. Update it and our - // current state. - // Debug.assert(_changeDelta === 0); - // Debug.assert(currentNode() === node); - - _oldSourceUnitCursor.moveToNextSibling(); - - // Update the underlying source with where it should now be currently pointin. - var _absolutePosition = absolutePosition() + fullWidth(node); - _scannerParserSource.resetToPosition(_absolutePosition); - - // Debug.assert(previousToken !== undefined); - // Debug.assert(previousToken.width() > 0); - - //if (!isPastChangeRange()) { - // // If we still have a change range, then this node must have ended before the - // // change range starts. Thus, we don't need to call 'skipPastChanges'. - // Debug.assert(absolutePosition() < _changeRange.span().start()); - //} - } - - function consumeToken(currentToken: ISyntaxToken): void { - // Debug.assert(currentToken.fullWidth() > 0 || currentToken.kind === SyntaxKind.EndOfFileToken); - - // This token may have come from the old source unit, or from the new text. Handle - // both accordingly. - - if (_oldSourceUnitCursor.currentToken() === currentToken) { - // The token came from the old source unit. So our tree and text must be in sync. - // Debug.assert(_changeDelta === 0); - - // Move the cursor past this token. - _oldSourceUnitCursor.moveToNextSibling(); - - // Debug.assert(!_normalParserSource.isPinned()); - - // Update the underlying source with where it should now be currently pointing. We - // don't need to do this when the token came from the new text as the source will - // automatically be placed in the right position. - var _absolutePosition = absolutePosition() + currentToken.fullWidth(); - _scannerParserSource.resetToPosition(_absolutePosition); - - // Debug.assert(previousToken !== undefined); - // Debug.assert(previousToken.width() > 0); - - //if (!isPastChangeRange()) { - // // If we still have a change range, then this token must have ended before the - // // change range starts. Thus, we don't need to call 'skipPastChanges'. - // Debug.assert(absolutePosition() < _changeRange.span().start()); - //} - } - else { - // the token came from the new text. That means the normal source moved forward, - // while the syntax cursor stayed in the same place. Thus our delta moves even - // further back. - _changeDelta -= currentToken.fullWidth(); - - // Move our underlying source forward. - _scannerParserSource.consumeToken(currentToken); - - // Because we read a token from the new text, we may have moved ourselves past the - // change range. If we did, then we may also have to update our change delta to - // compensate for the length change between the old and new text. - if (!isPastChangeRange()) { - // var changeEndInNewText = _changeRange.span().start() + _changeRange.newLength(); - if (absolutePosition() >= _changeRangeNewSpan.end()) { - _changeDelta += _changeRange.newLength() - _changeRange.span().length(); - - // Once we're past the change range, we no longer need it. Null it out. - // From now on we can check if we're past the change range just by seeing - // if this is undefined. - _changeRange = undefined; - } - } - } - } - - function isPastChangeRange(): boolean { - return _changeRange === undefined; + function consumeNodeOrToken(nodeOrToken: ISyntaxNodeOrToken): void { + _scannerParserSource.consumeNodeOrToken(nodeOrToken); } return { text: text, - fileName: fileName, - languageVersion: languageVersion, + fileName: oldSyntaxTree.fileName(), + languageVersion: oldSyntaxTree.languageVersion(), + absolutePosition: absolutePosition, currentNode: currentNode, currentToken: currentToken, currentContextualToken: currentContextualToken, peekToken: peekToken, - consumeNode: consumeNode, - consumeToken: consumeToken, + consumeNodeOrToken: consumeNodeOrToken, getRewindPoint: getRewindPoint, rewind: rewind, releaseRewindPoint: releaseRewindPoint, @@ -699,7 +495,6 @@ module TypeScript.IncrementalParser { // Makes this cursor into a deep copy of the cursor passed in. function deepCopyFrom(other: SyntaxCursor): void { - // Debug.assert(currentPieceIndex === -1); for (var i = 0, n = other.pieces.length; i < n; i++) { var piece = other.pieces[i]; @@ -709,8 +504,6 @@ module TypeScript.IncrementalParser { pushElement(piece.element, piece.indexInParent); } - - // Debug.assert(currentPieceIndex === other.currentPieceIndex); } function isFinished(): boolean { @@ -725,9 +518,6 @@ module TypeScript.IncrementalParser { var result = pieces[currentPieceIndex].element; // The current element must always be a node or a token. - // Debug.assert(result !== undefined); - // Debug.assert(result.isNode() || result.isToken()); - return result; } @@ -751,9 +541,6 @@ module TypeScript.IncrementalParser { return; } - // The last element must be a token or a node. - // Debug.assert(isNode(nodeOrToken)); - // Either the node has some existent child, then move to it. if it doesn't, then it's // an empty node. Conceptually the first child of an empty node is really just the // next sibling of the empty node. @@ -772,8 +559,6 @@ module TypeScript.IncrementalParser { // This element must have been an empty node. Moving to its 'first child' is equivalent to just // moving to the next sibling. - - // Debug.assert(fullWidth(nodeOrToken) === 0); moveToNextSibling(); } @@ -817,15 +602,11 @@ module TypeScript.IncrementalParser { if (isList(element)) { // We cannot ever get an empty list in our piece path. Empty lists are 'shared' and // we make sure to filter that out before pushing any children. - // Debug.assert(childCount(element) > 0); - pushElement(childAt(element, 0), /*indexInParent:*/ 0); } } function pushElement(element: ISyntaxElement, indexInParent: number): void { - // Debug.assert(element !== undefined); - // Debug.assert(indexInParent >= 0); currentPieceIndex++; // Reuse an existing piece if we have one. Otherwise, push a new piece to our list. @@ -847,7 +628,6 @@ module TypeScript.IncrementalParser { continue; } - // Debug.assert(isToken(element)); return; } } @@ -856,7 +636,6 @@ module TypeScript.IncrementalParser { moveToFirstToken(); var element = currentNodeOrToken(); - // Debug.assert(element === undefined || element.isToken()); return element; } @@ -887,6 +666,94 @@ module TypeScript.IncrementalParser { } var tokenCollectorWalker = new TokenCollectorWalker(); + function updateTokenPositionsAndMarkElements(element: ISyntaxElement, changeStart: number, changeRangeOldEnd: number, delta: number, fullStart: number): void { + // First, try to skip past any elements that we dont' need to move. We don't need to + // move any elements that don't start after the end of the change range. + if (fullStart > changeRangeOldEnd) { + // Note, we only move elements that are truly after the end of the change range. + // We consider elements that are touching the end of the change range to be unusable. + forceUpdateTokenPositionsForElement(element, delta); + } + else { + // Check if the element intersects the change range. If it does, then it is not + // reusable. Also, we'll need to recurse to see what constituent portions we may + // be able to use. + var fullEnd = fullStart + fullWidth(element); + if (fullEnd >= changeStart) { + (element).intersectsChange = true; + + if (isList(element)) { + var list = element; + for (var i = 0, n = list.length; i < n; i++) { + var child: ISyntaxElement = list[i]; + updateTokenPositionsAndMarkElements(child, changeStart, changeRangeOldEnd, delta, fullStart); + fullStart += fullWidth(child); + } + } + else if (isNode(element)) { + var node = element; + for (var i = 0, n = node.childCount; i < n; i++) { + var child = node.childAt(i); + if (child) { + updateTokenPositionsAndMarkElements(child, changeStart, changeRangeOldEnd, delta, fullStart); + fullStart += fullWidth(child); + } + } + } + } + // else { + // This element ended strictly before the edited range. We don't need to do anything + // with it. + // } + } + } + + function forceUpdateTokenPositionsForElement(element: ISyntaxElement, delta: number) { + // No need to move anything if the delta is 0. + if (delta !== 0) { + if (isList(element)) { + var list = element; + for (var i = 0, n = list.length; i < n; i++) { + forceUpdateTokenPositionForNodeOrToken(list[i], delta); + } + } + else { + forceUpdateTokenPositionForNodeOrToken(element, delta); + } + } + } + + function forceUpdateTokenPosition(token: ISyntaxToken, delta: number) { + token.setFullStart(token.fullStart() + delta); + } + + function forceUpdateTokenPositionForNodeOrToken(nodeOrToken: ISyntaxNodeOrToken, delta: number) { + if (isToken(nodeOrToken)) { + forceUpdateTokenPosition(nodeOrToken, delta); + } + else { + var node = nodeOrToken; + var tokens = getTokens(node); + for (var i = 0, n = tokens.length; i < n; i++) { + forceUpdateTokenPosition(tokens[i], delta); + } + } + } + + function getTokens(node: ISyntaxNode): ISyntaxToken[] { + var tokens = node.__cachedTokens; + if (!tokens) { + tokens = []; + tokenCollectorWalker.tokens = tokens; + + visitNodeOrToken(tokenCollectorWalker, node); + + node.__cachedTokens = tokens; + tokenCollectorWalker.tokens = undefined; + } + + return tokens; + } export function parse(oldSyntaxTree: SyntaxTree, textChangeRange: TextChangeRange, newText: ISimpleText): SyntaxTree { if (textChangeRange.isUnchanged()) { diff --git a/src/services/syntax/parser.ts b/src/services/syntax/parser.ts index 8f8bae4e549..53f4608ff57 100644 --- a/src/services/syntax/parser.ts +++ b/src/services/syntax/parser.ts @@ -45,6 +45,9 @@ module TypeScript.Parser { // but can affect the diagnostics produced while parsing. languageVersion: ts.ScriptTarget; + // The place in the source text that we're currently pointing at. + absolutePosition(): number; + // The current syntax node the source is pointing at. Only available in incremental settings. // The source can point at a node if that node doesn't intersect any of the text changes in // the file, and doesn't contain certain unacceptable constructs. For example, if the node @@ -67,8 +70,7 @@ module TypeScript.Parser { // Called to move the source to the next node or token once the parser has consumed the // current one. - consumeNode(node: ISyntaxNode): void; - consumeToken(token: ISyntaxToken): void; + consumeNodeOrToken(node: ISyntaxNodeOrToken): void; // Gets a rewind point that the parser can use to move back to after it speculatively // parses something. The source guarantees that if the parser calls 'rewind' with that @@ -193,10 +195,7 @@ module TypeScript.Parser { // // Getting this all correct is tricky and requires careful reading of the grammar to // understand when these values should be changed versus when they should be inherited. - var strictModeContext: boolean = false; - var disallowInContext: boolean = false; - var yieldContext: boolean = false; - var generatorParameterContext: boolean = false; + var contextFlags: ParserContextFlags = 0; // Current state of the parser. If we need to rewind we will store and reset these values as // appropriate. @@ -207,8 +206,6 @@ module TypeScript.Parser { // started at. var diagnostics: Diagnostic[] = []; - var parseNodeData: number = 0; - var _skippedTokens: ISyntaxToken[] = undefined; function parseSyntaxTree(_source: IParserSource, isDeclaration: boolean): SyntaxTree { @@ -222,7 +219,7 @@ module TypeScript.Parser { // Now, clear out our state so that our singleton parser doesn't keep things alive. diagnostics = []; - parseNodeData = SyntaxNodeConstants.None; + contextFlags = 0; fileName = undefined; source.release(); source = undefined; @@ -283,10 +280,7 @@ module TypeScript.Parser { // are unaffected by strict mode. It's just the parser will decide what to do with it // differently depending on what mode it is in. if (node && - parsedInStrictModeContext(node) === strictModeContext && - parsedInDisallowInContext(node) === disallowInContext && - parsedInYieldContext(node) === yieldContext && - parsedInGeneratorParameterContext(node) === generatorParameterContext) { + parserContextFlags(node) === contextFlags) { return node; } @@ -317,14 +311,14 @@ module TypeScript.Parser { // call 'consumeToken'. Doing so would attempt to add any previous skipped tokens // to this token we're skipping. We don't want to do that. Instead, we want to add // all the skipped tokens when we finally eat the next good token. - source.consumeToken(token) + source.consumeNodeOrToken(token) } function consumeToken(token: ISyntaxToken): ISyntaxToken { // Debug.assert(token.fullWidth() > 0 || token.kind === SyntaxKind.EndOfFileToken); // First, tell our source that the token has been consumed. - source.consumeToken(token); + source.consumeNodeOrToken(token); // Now, if we had any skipped tokens, we want to add them to the start of this token // we're consuming. @@ -382,7 +376,7 @@ module TypeScript.Parser { function consumeNode(node: ISyntaxNode): void { Debug.assert(_skippedTokens === undefined); - source.consumeNode(node); + source.consumeNodeOrToken(node); } //this method is called very frequently @@ -420,7 +414,7 @@ module TypeScript.Parser { // If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is // considered a keyword and is not an identifier. - if (tokenKind === SyntaxKind.YieldKeyword && yieldContext) { + if (tokenKind === SyntaxKind.YieldKeyword && inYieldContext()) { return false; } @@ -430,7 +424,7 @@ module TypeScript.Parser { if (tokenKind <= SyntaxKind.LastFutureReservedStrictKeyword) { // Could be a keyword or identifier. It's an identifier if we're not in strict // mode. - return !strictModeContext; + return !inStrictModeContext(); } // If it's typescript keyword, then it's actually a javascript identifier. @@ -541,19 +535,37 @@ module TypeScript.Parser { return eatToken(SyntaxKind.SemicolonToken); } - function createMissingToken(expectedKind: SyntaxKind, actual: ISyntaxToken, diagnosticCode?: string): ISyntaxToken { - var diagnostic = getExpectedTokenDiagnostic(expectedKind, actual, diagnosticCode); + function createEmptyToken(kind: SyntaxKind): ISyntaxToken { + // The position of the empty token we're creating is not necessarily the position that + // the parser is at now. This is because we may have seen some existing missing tokens + // before finally deciding we needed a missing token. For example, if you have: + // + // Foo(a, # + // + // We will need to create a empty token for the missing ")". However, we will have + // skipped the "#" token, and thus will be right after the "#". Because the "#" token + // will actually become *skipped* trivia on the *next* token we see, the close paren + // should not be considered to be after #, and should instead be after the ",". + // + // So, if we have any skipped tokens, then the position of the empty token should be + // the position of the first skipped token we have. Otherwise it's just at the position + // of the parser. + var fullStart = _skippedTokens ? _skippedTokens[0].fullStart() : source.absolutePosition(); + return Syntax.emptyToken(kind, fullStart); + } + + function createMissingToken(expectedKind: SyntaxKind, actual: ISyntaxToken, diagnosticCode?: string, args?: any[]): ISyntaxToken { + var diagnostic = getExpectedTokenDiagnostic(expectedKind, actual, diagnosticCode, args); addDiagnostic(diagnostic); // The missing token will be at the full start of the current token. That way empty tokens // will always be between real tokens and not inside an actual token. - return Syntax.emptyToken(expectedKind); + return createEmptyToken(expectedKind); } - function getExpectedTokenDiagnostic(expectedKind: SyntaxKind, actual?: ISyntaxToken, diagnosticCode?: string): Diagnostic { + function getExpectedTokenDiagnostic(expectedKind: SyntaxKind, actual?: ISyntaxToken, diagnosticCode?: string, args?: any[]): Diagnostic { var token = currentToken(); - var args: any[] = undefined; // If a specialized diagnostic message was provided, just use that. if (!diagnosticCode) { // They wanted something specific, just report that that token was missing. @@ -614,39 +626,52 @@ module TypeScript.Parser { throw Errors.invalidOperation(); } - function updateParseNodeData() { - parseNodeData = - (strictModeContext ? SyntaxNodeConstants.ParsedInStrictModeContext : 0) | - (disallowInContext ? SyntaxNodeConstants.ParsedInDisallowInContext : 0) | - (yieldContext ? SyntaxNodeConstants.ParsedInYieldContext : 0) | - (generatorParameterContext ? SyntaxNodeConstants.ParsedInGeneratorParameterContext : 0); + function setContextFlag(val: boolean, flag: ParserContextFlags) { + if (val) { + contextFlags |= flag; + } + else { + contextFlags &= ~flag; + } } function setStrictModeContext(val: boolean) { - strictModeContext = val; - updateParseNodeData(); + setContextFlag(val, ParserContextFlags.StrictMode); } function setDisallowInContext(val: boolean) { - disallowInContext = val; - updateParseNodeData(); + setContextFlag(val, ParserContextFlags.DisallowIn); } function setYieldContext(val: boolean) { - yieldContext = val; - updateParseNodeData(); + setContextFlag(val, ParserContextFlags.Yield); } function setGeneratorParameterContext(val: boolean) { - generatorParameterContext = val; - updateParseNodeData(); + setContextFlag(val, ParserContextFlags.GeneratorParameter); + } + + function inStrictModeContext() { + return (contextFlags & ParserContextFlags.StrictMode) !== 0; + } + + function inDisallowInContext() { + return (contextFlags & ParserContextFlags.DisallowIn) !== 0; + } + + function inYieldContext() { + return (contextFlags & ParserContextFlags.Yield) !== 0; + } + + function inGeneratorParameterContext() { + return (contextFlags & ParserContextFlags.GeneratorParameter) !== 0; } function parseSourceUnit(): SourceUnitSyntax { // Note: saving and restoring the 'isInStrictMode' state is not really necessary here // (as it will never be read afterwards). However, for symmetry with the rest of the // parsing code, we do the same here. - var savedIsInStrictMode = strictModeContext + var savedIsInStrictMode = inStrictModeContext() // Note: any skipped tokens produced after the end of all the module elements will be // added as skipped trivia to the start of the EOF token. @@ -654,7 +679,7 @@ module TypeScript.Parser { setStrictModeContext(savedIsInStrictMode); - var sourceUnit = new SourceUnitSyntax(parseNodeData, moduleElements, consumeToken(currentToken())); + var sourceUnit = new SourceUnitSyntax(contextFlags, moduleElements, consumeToken(currentToken())); if (Debug.shouldAssert(AssertionLevel.Aggressive)) { Debug.assert(fullWidth(sourceUnit) === source.text.length()); @@ -673,7 +698,7 @@ module TypeScript.Parser { } function updateStrictModeState(items: any[]): void { - if (!strictModeContext) { + if (!inStrictModeContext()) { // Check if all the items are directive prologue elements. for (var i = 0, n = items.length; i < n; i++) { if (!isDirectivePrologueElement(items[i])) { @@ -769,12 +794,12 @@ module TypeScript.Parser { } function parseImportDeclaration(): ImportDeclarationSyntax { - return new ImportDeclarationSyntax(parseNodeData, + return new ImportDeclarationSyntax(contextFlags, parseModifiers(), eatToken(SyntaxKind.ImportKeyword), eatIdentifierToken(), eatToken(SyntaxKind.EqualsToken), parseModuleReference(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } function parseExportAssignment(): ExportAssignmentSyntax { - return new ExportAssignmentSyntax(parseNodeData, + return new ExportAssignmentSyntax(contextFlags, eatToken(SyntaxKind.ExportKeyword), eatToken(SyntaxKind.EqualsToken), eatIdentifierToken(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } @@ -788,12 +813,12 @@ module TypeScript.Parser { } function parseExternalModuleReference(): ExternalModuleReferenceSyntax { - return new ExternalModuleReferenceSyntax(parseNodeData, + return new ExternalModuleReferenceSyntax(contextFlags, eatToken(SyntaxKind.RequireKeyword), eatToken(SyntaxKind.OpenParenToken), eatToken(SyntaxKind.StringLiteral), eatToken(SyntaxKind.CloseParenToken)); } function parseModuleNameModuleReference(): ModuleNameModuleReferenceSyntax { - return new ModuleNameModuleReferenceSyntax(parseNodeData, parseName(/*allowIdentifierNames:*/ false)); + return new ModuleNameModuleReferenceSyntax(contextFlags, parseName(/*allowIdentifierNames:*/ false)); } function tryParseTypeArgumentList(inExpression: boolean): TypeArgumentListSyntax { @@ -805,7 +830,7 @@ module TypeScript.Parser { if (!inExpression) { // if we're not in an expression, this must be a type argument list. Just parse // it out as such. - return new TypeArgumentListSyntax(parseNodeData, + return new TypeArgumentListSyntax(contextFlags, consumeToken(_currentToken), parseSeparatedSyntaxList(ListParsingState.TypeArgumentList_Types), eatToken(SyntaxKind.GreaterThanToken)); @@ -831,7 +856,7 @@ module TypeScript.Parser { } else { releaseRewindPoint(rewindPoint); - return new TypeArgumentListSyntax(parseNodeData, lessThanToken, typeArguments, greaterThanToken); + return new TypeArgumentListSyntax(contextFlags, lessThanToken, typeArguments, greaterThanToken); } } @@ -924,7 +949,7 @@ module TypeScript.Parser { var dotToken = consumeToken(currentToken()); var identifierName = eatRightSideOfName(allowIdentifierNames); - current = new QualifiedNameSyntax(parseNodeData, current, dotToken, identifierName); + current = new QualifiedNameSyntax(contextFlags, current, dotToken, identifierName); shouldContinue = identifierName.fullWidth() > 0; } @@ -934,7 +959,7 @@ module TypeScript.Parser { function parseEnumDeclaration(): EnumDeclarationSyntax { var openBraceToken: ISyntaxToken; - return new EnumDeclarationSyntax(parseNodeData, + return new EnumDeclarationSyntax(contextFlags, parseModifiers(), eatToken(SyntaxKind.EnumKeyword), eatIdentifierToken(), @@ -953,7 +978,7 @@ module TypeScript.Parser { } function allowInAnd(func: () => T): T { - if (disallowInContext) { + if (inDisallowInContext()) { setDisallowInContext(false); var result = func(); setDisallowInContext(true); @@ -965,7 +990,7 @@ module TypeScript.Parser { } function disallowInAnd(func: () => T): T { - if (disallowInContext) { + if (inDisallowInContext()) { // no need to do anything special if 'in' is already disallowed. return func(); } @@ -977,7 +1002,7 @@ module TypeScript.Parser { } function enterYieldContextAnd(func: () => T): T { - if (yieldContext) { + if (inYieldContext()) { // no need to do anything special if we're already in the [Yield] context. return func(); } @@ -989,7 +1014,7 @@ module TypeScript.Parser { } function exitYieldContextAnd(func: () => T): T { - if (yieldContext) { + if (inYieldContext()) { setYieldContext(false); var result = func(); setYieldContext(true); @@ -999,30 +1024,6 @@ module TypeScript.Parser { // no need to do anything special if we're not in the [Yield] context. return func(); } - - function enterGeneratorParameterContextAnd(func: () => T): T { - if (generatorParameterContext) { - // no need to do anything special if we're already in the [GeneratorParameter] context - return func(); - } - - setGeneratorParameterContext(true); - var result = func(); - setGeneratorParameterContext(false); - return result; - } - - function exitGeneratorParameterContextAnd(func: () => T): T { - if (generatorParameterContext) { - setGeneratorParameterContext(false); - var result = func(); - setGeneratorParameterContext(true); - return result; - } - - // no need to do anything special if we're not in the [GeneratorParameter] context - return func(); - } function tryParseEnumElementEqualsValueClause(): EqualsValueClauseSyntax { return isEqualsValueClause(/*inParameter*/ false) ? allowInAnd(parseEqualsValueClause) : undefined; @@ -1039,7 +1040,7 @@ module TypeScript.Parser { return undefined; } - return new EnumElementSyntax(parseNodeData, parsePropertyName(), tryParseEnumElementEqualsValueClause()); + return new EnumElementSyntax(contextFlags, parsePropertyName(), tryParseEnumElementEqualsValueClause()); } function isModifierKind(kind: SyntaxKind): boolean { @@ -1113,7 +1114,7 @@ module TypeScript.Parser { // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } if (isHeritageClause()) { - return isClassHeritageClause && generatorParameterContext + return isClassHeritageClause && inGeneratorParameterContext() ? exitYieldContextAnd(parseHeritageClausesWorker) : parseHeritageClausesWorker(); } @@ -1131,7 +1132,7 @@ module TypeScript.Parser { function parseClassDeclaration(): ClassDeclarationSyntax { var openBraceToken: ISyntaxToken; - return new ClassDeclarationSyntax(parseNodeData, + return new ClassDeclarationSyntax(contextFlags, parseModifiers(), eatToken(SyntaxKind.ClassKeyword), eatIdentifierToken(), @@ -1148,7 +1149,7 @@ module TypeScript.Parser { // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } if (openBraceToken.fullWidth() > 0) { - return generatorParameterContext + return inGeneratorParameterContext() ? exitYieldContextAnd(parseClassElements) : parseClassElements(); } @@ -1187,17 +1188,17 @@ module TypeScript.Parser { } function parseGetAccessor(modifiers: ISyntaxToken[], getKeyword: ISyntaxToken): GetAccessorSyntax { - return new GetAccessorSyntax(parseNodeData, + return new GetAccessorSyntax(contextFlags, modifiers, consumeToken(getKeyword), parsePropertyName(), - parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldContext:*/ false, /*generatorParameter:*/ false), - parseFunctionBlock(/*allowYield:*/ false)); + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ false), + parseFunctionBody(/*isGenerator:*/ false)); } function parseSetAccessor(modifiers: ISyntaxToken[], setKeyword: ISyntaxToken): SetAccessorSyntax { - return new SetAccessorSyntax(parseNodeData, + return new SetAccessorSyntax(contextFlags, modifiers, consumeToken(setKeyword), parsePropertyName(), - parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldContext:*/ false, /*generatorParameterContext:*/ false), - parseFunctionBlock(/*allowYield:*/ false)); + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ false), + parseFunctionBody(/*isGenerator:*/ false)); } function isClassElement(inErrorRecovery: boolean): boolean { @@ -1322,32 +1323,30 @@ module TypeScript.Parser { // Note: if we see an arrow after the close paren, then try to parse out a function // block anyways. It's likely the user just though '=> expr' was legal anywhere a // block was legal. - return new ConstructorDeclarationSyntax(parseNodeData, + return new ConstructorDeclarationSyntax(contextFlags, parseModifiers(), eatToken(SyntaxKind.ConstructorKeyword), - parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldContext:*/ false, /*generatorParameterContext:*/ false), - isBlockOrArrow() ? parseFunctionBlock(/*allowYield:*/ false) : eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ false), + parseFunctionBody(/*isGenerator:*/ false)); } function parseMemberFunctionDeclaration(modifiers: ISyntaxToken[], asteriskToken: ISyntaxToken, propertyName: IPropertyNameSyntax): MemberFunctionDeclarationSyntax { // Note: if we see an arrow after the close paren, then try to parse out a function // block anyways. It's likely the user just though '=> expr' was legal anywhere a // block was legal. - var isGeneratorFunction = asteriskToken !== undefined; - return new MemberFunctionDeclarationSyntax(parseNodeData, + var isGenerator = asteriskToken !== undefined; + return new MemberFunctionDeclarationSyntax(contextFlags, modifiers, asteriskToken, propertyName, - parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldContext:*/ isGeneratorFunction, /*generatorParameterContext:*/ isGeneratorFunction), - isBlockOrArrow() - ? parseFunctionBlock(/*yieldContext:*/ isGeneratorFunction) - : eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ isGenerator), + parseFunctionBody(isGenerator)); } function parseMemberVariableDeclaration(modifiers: ISyntaxToken[], propertyName: IPropertyNameSyntax): MemberVariableDeclarationSyntax { - return new MemberVariableDeclarationSyntax(parseNodeData, + return new MemberVariableDeclarationSyntax(contextFlags, modifiers, - new VariableDeclaratorSyntax(parseNodeData, propertyName, + new VariableDeclaratorSyntax(contextFlags, propertyName, parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false), isEqualsValueClause(/*inParameter*/ false) ? allowInAnd(parseEqualsValueClause) : undefined), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); @@ -1358,7 +1357,7 @@ module TypeScript.Parser { } function parseIndexMemberDeclaration(): IndexMemberDeclarationSyntax { - return new IndexMemberDeclarationSyntax(parseNodeData, + return new IndexMemberDeclarationSyntax(contextFlags, parseModifiers(), parseIndexSignature(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewLine:*/ false)); } @@ -1372,18 +1371,24 @@ module TypeScript.Parser { } function parseFunctionDeclarationWorker(modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, asteriskToken: ISyntaxToken): FunctionDeclarationSyntax { + // FunctionDeclaration[Yield, Default] : // function BindingIdentifier[?Yield] ( FormalParameters ) { FunctionBody } // GeneratorDeclaration[Yield, Default] : - // function * BindingIdentifier[?Yield](FormalParameters[Yield, GeneratorParameter]) { GeneratorBody[Yield] } + // function * BindingIdentifier[?Yield](FormalParameters[Yield, GeneratorParameter]) { GeneratorBody[Yield] } + var isGenerator = asteriskToken !== undefined; - return new FunctionDeclarationSyntax(parseNodeData, + return new FunctionDeclarationSyntax(contextFlags, modifiers, functionKeyword, asteriskToken, eatIdentifierToken(), - parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldContext:*/ isGenerator, /*generatorParameterContext:*/ isGenerator), - isBlockOrArrow() - ? parseFunctionBlock(/*yieldContext:*/ isGenerator) - : eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ isGenerator), + parseFunctionBody(isGenerator)); + } + + function parseFunctionBody(isGenerator: boolean): BlockSyntax | ExpressionBody | ISyntaxToken { + return isBlockOrArrow() + ? parseFunctionBlockOrExpressionBody(/*yieldContext:*/ isGenerator) + : eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false); } function parseModuleName(): INameSyntax { @@ -1394,7 +1399,7 @@ module TypeScript.Parser { function parseModuleDeclaration(): ModuleDeclarationSyntax { var openBraceToken: ISyntaxToken; - return new ModuleDeclarationSyntax(parseNodeData, + return new ModuleDeclarationSyntax(contextFlags, parseModifiers(), eatToken(SyntaxKind.ModuleKeyword), parseModuleName(), @@ -1404,7 +1409,7 @@ module TypeScript.Parser { } function parseInterfaceDeclaration(): InterfaceDeclarationSyntax { - return new InterfaceDeclarationSyntax(parseNodeData, + return new InterfaceDeclarationSyntax(contextFlags, parseModifiers(), eatToken(SyntaxKind.InterfaceKeyword), eatIdentifierToken(), @@ -1416,14 +1421,14 @@ module TypeScript.Parser { function parseObjectType(): ObjectTypeSyntax { var openBraceToken: ISyntaxToken; - return new ObjectTypeSyntax(parseNodeData, + return new ObjectTypeSyntax(contextFlags, openBraceToken = eatToken(SyntaxKind.OpenBraceToken), openBraceToken.fullWidth() > 0 ? parseSeparatedSyntaxList(ListParsingState.ObjectType_TypeMembers) : [], eatToken(SyntaxKind.CloseBraceToken)); } function parseTupleType(currentToken: ISyntaxToken): TupleTypeSyntax { - return new TupleTypeSyntax(parseNodeData, + return new TupleTypeSyntax(contextFlags, consumeToken(currentToken), parseSeparatedSyntaxList(ListParsingState.TupleType_Types), eatToken(SyntaxKind.CloseBracketToken)); @@ -1480,7 +1485,7 @@ module TypeScript.Parser { // A call signature for a type member can both use 'yield' as a parameter name, and // does not have parameter initializers. So we can pass 'false' for both [Yield] // and [GeneratorParameter]. - return parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldContext:*/ false, /*generatorParameterContext:*/ false); + return parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ false); } else if (isConstructSignature()) { return parseConstructSignature(); @@ -1506,13 +1511,13 @@ module TypeScript.Parser { function parseConstructSignature(): ConstructSignatureSyntax { // Construct signatures have no [Yield] or [GeneratorParameter] restrictions. - return new ConstructSignatureSyntax(parseNodeData, + return new ConstructSignatureSyntax(contextFlags, eatToken(SyntaxKind.NewKeyword), - parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldContext:*/ false, /*generatorParameterContext:*/ false)); + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ false)); } function parseIndexSignature(): IndexSignatureSyntax { - return new IndexSignatureSyntax(parseNodeData, + return new IndexSignatureSyntax(contextFlags, eatToken(SyntaxKind.OpenBracketToken), parseSeparatedSyntaxList(ListParsingState.IndexSignature_Parameters), eatToken(SyntaxKind.CloseBracketToken), parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false)); @@ -1521,14 +1526,14 @@ module TypeScript.Parser { function parseMethodSignature(propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken): MethodSignatureSyntax { // Method signatues don't exist in expression contexts. So they have neither // [Yield] nor [GeneratorParameter] - return new MethodSignatureSyntax(parseNodeData, + return new MethodSignatureSyntax(contextFlags, propertyName, questionToken, - parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldContext:*/ false, /*generatorParameterContext:*/ false)); + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ false)); } function parsePropertySignature(propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken): PropertySignatureSyntax { - return new PropertySignatureSyntax(parseNodeData, + return new PropertySignatureSyntax(contextFlags, propertyName, questionToken, parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false)); } @@ -1609,7 +1614,7 @@ module TypeScript.Parser { return undefined; } - return new HeritageClauseSyntax(parseNodeData, + return new HeritageClauseSyntax(contextFlags, consumeToken(extendsOrImplementsKeyword), parseSeparatedSyntaxList(ListParsingState.HeritageClause_TypeNameList)); } @@ -1790,7 +1795,7 @@ module TypeScript.Parser { } function parseDebuggerStatement(debuggerKeyword: ISyntaxToken): DebuggerStatementSyntax { - return new DebuggerStatementSyntax(parseNodeData, consumeToken(debuggerKeyword), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); + return new DebuggerStatementSyntax(contextFlags, consumeToken(debuggerKeyword), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } function parseDoStatement(doKeyword: ISyntaxToken): DoStatementSyntax { @@ -1801,7 +1806,7 @@ module TypeScript.Parser { // 157 min --- All allen at wirfs-brock.com CONF --- "do{;}while(false)false" prohibited in // spec but allowed in consensus reality. Approved -- this is the de-facto standard whereby // do;while(0)x will have a semicolon inserted before x. - return new DoStatementSyntax(parseNodeData, + return new DoStatementSyntax(contextFlags, consumeToken(doKeyword), parseStatement(/*inErrorRecovery:*/ false), eatToken(SyntaxKind.WhileKeyword), eatToken(SyntaxKind.OpenParenToken), allowInAnd(parseExpression), eatToken(SyntaxKind.CloseParenToken), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ true)); } @@ -1811,7 +1816,7 @@ module TypeScript.Parser { } function parseLabeledStatement(identifierToken: ISyntaxToken): LabeledStatementSyntax { - return new LabeledStatementSyntax(parseNodeData, + return new LabeledStatementSyntax(contextFlags, consumeToken(identifierToken), eatToken(SyntaxKind.ColonToken), parseStatement(/*inErrorRecovery:*/ false)); } @@ -1835,7 +1840,7 @@ module TypeScript.Parser { finallyClause = parseFinallyClause(); } - return new TryStatementSyntax(parseNodeData, tryKeyword, block, catchClause, finallyClause); + return new TryStatementSyntax(contextFlags, tryKeyword, block, catchClause, finallyClause); } function parseCatchClauseBlock(): BlockSyntax { @@ -1848,13 +1853,13 @@ module TypeScript.Parser { } function parseCatchClause(): CatchClauseSyntax { - return new CatchClauseSyntax(parseNodeData, + return new CatchClauseSyntax(contextFlags, eatToken(SyntaxKind.CatchKeyword), eatToken(SyntaxKind.OpenParenToken), eatIdentifierToken(), parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false), eatToken(SyntaxKind.CloseParenToken), parseCatchClauseBlock()); } function parseFinallyClause(): FinallyClauseSyntax { - return new FinallyClauseSyntax(parseNodeData, + return new FinallyClauseSyntax(contextFlags, eatToken(SyntaxKind.FinallyKeyword), parseStatementBlock()); } @@ -1863,7 +1868,7 @@ module TypeScript.Parser { // WithStatement[Yield, Return] : // with (Expression[In, ?Yield]) Statement[?Yield, ?Return] - return new WithStatementSyntax(parseNodeData, + return new WithStatementSyntax(contextFlags, consumeToken(withKeyword), eatToken(SyntaxKind.OpenParenToken), allowInAnd(parseExpression), @@ -1875,7 +1880,7 @@ module TypeScript.Parser { // IterationStatement[Yield, Return] : // while (Expression[In, ?Yield]) Statement[?Yield, ?Return] - return new WhileStatementSyntax(parseNodeData, + return new WhileStatementSyntax(contextFlags, consumeToken(whileKeyword), eatToken(SyntaxKind.OpenParenToken), allowInAnd(parseExpression), @@ -1898,7 +1903,7 @@ module TypeScript.Parser { } function parseEmptyStatement(semicolonToken: ISyntaxToken): EmptyStatementSyntax { - return new EmptyStatementSyntax(parseNodeData, consumeToken(semicolonToken)); + return new EmptyStatementSyntax(contextFlags, consumeToken(semicolonToken)); } function parseForOrForInStatement(forKeyword: ISyntaxToken): IStatementSyntax { @@ -1934,7 +1939,7 @@ module TypeScript.Parser { // for ( var ForBinding[?Yield] in Expression[In, ?Yield] ) Statement[?Yield, ?Return] // for ( ForDeclaration[?Yield] in Expression[In, ?Yield] ) Statement[?Yield, ?Return] - return new ForInStatementSyntax(parseNodeData, + return new ForInStatementSyntax(contextFlags, forKeyword, openParenToken, initializer, eatToken(SyntaxKind.InKeyword), allowInAnd(parseExpression), eatToken(SyntaxKind.CloseParenToken), parseStatement(/*inErrorRecovery:*/ false)); } @@ -1945,7 +1950,7 @@ module TypeScript.Parser { // for (ExpressionNoInopt; Expressionopt ; Expressionopt ) Statement // for (var VariableDeclarationListNoIn; Expressionopt; Expressionopt) Statement - return new ForStatementSyntax(parseNodeData, + return new ForStatementSyntax(contextFlags, forKeyword, openParenToken, initializer, eatToken(SyntaxKind.SemicolonToken), tryParseForStatementCondition(), eatToken(SyntaxKind.SemicolonToken), tryParseForStatementIncrementor(), @@ -1991,12 +1996,12 @@ module TypeScript.Parser { } function parseBreakStatement(breakKeyword: ISyntaxToken): BreakStatementSyntax { - return new BreakStatementSyntax(parseNodeData, + return new BreakStatementSyntax(contextFlags, consumeToken(breakKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } function parseContinueStatement(continueKeyword: ISyntaxToken): ContinueStatementSyntax { - return new ContinueStatementSyntax(parseNodeData, + return new ContinueStatementSyntax(contextFlags, consumeToken(continueKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } @@ -2014,7 +2019,7 @@ module TypeScript.Parser { var openParenToken: ISyntaxToken; var openBraceToken: ISyntaxToken; - return new SwitchStatementSyntax(parseNodeData, + return new SwitchStatementSyntax(contextFlags, consumeToken(switchKeyword), openParenToken = eatToken(SyntaxKind.OpenParenToken), parseSwitchExpression(openParenToken), @@ -2059,7 +2064,7 @@ module TypeScript.Parser { // CaseClause[Yield, Return] : // case Expression[In, ?Yield] : StatementList[?Yield, ?Return]opt - return new CaseSwitchClauseSyntax(parseNodeData, + return new CaseSwitchClauseSyntax(contextFlags, consumeToken(caseKeyword), allowInAnd(parseExpression), eatToken(SyntaxKind.ColonToken), @@ -2069,39 +2074,39 @@ module TypeScript.Parser { function parseDefaultSwitchClause(defaultKeyword: ISyntaxToken): DefaultSwitchClauseSyntax { // Debug.assert(isDefaultSwitchClause()); - return new DefaultSwitchClauseSyntax(parseNodeData, + return new DefaultSwitchClauseSyntax(contextFlags, consumeToken(defaultKeyword), eatToken(SyntaxKind.ColonToken), parseSyntaxList(ListParsingState.SwitchClause_Statements)); } - function parseThrowStatementExpression(): IExpressionSyntax { + function parseThrowStatement(throwKeyword: ISyntaxToken): ThrowStatementSyntax { + return new ThrowStatementSyntax(contextFlags, + consumeToken(throwKeyword), tryParseThrowStatementExpression(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); + } + + function tryParseThrowStatementExpression(): IExpressionSyntax { // ThrowStatement[Yield] : // throw [no LineTerminator here]Expression[In, ?Yield]; // Because of automatic semicolon insertion, we need to report error if this // throw could be terminated with a semicolon. Note: we can't call 'parseExpression' // directly as that might consume an expression on the following line. - return canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) - ? createMissingToken(SyntaxKind.IdentifierName, undefined) - : allowInAnd(parseExpression); + // We just return 'undefined' in that case. The actual error will be reported in the + // grammar walker. + return canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) ? undefined : allowInAnd(parseExpression); } - function parseThrowStatement(throwKeyword: ISyntaxToken): ThrowStatementSyntax { - return new ThrowStatementSyntax(parseNodeData, - consumeToken(throwKeyword), parseThrowStatementExpression(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); + function parseReturnStatement(returnKeyword: ISyntaxToken): ReturnStatementSyntax { + return new ReturnStatementSyntax(contextFlags, + consumeToken(returnKeyword), tryParseReturnStatementExpression(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } function tryParseReturnStatementExpression(): IExpressionSyntax { // ReturnStatement[Yield] : // return [no LineTerminator here]Expression[In, ?Yield]; - return !canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) ? allowInAnd(parseExpression) : undefined; - } - - function parseReturnStatement(returnKeyword: ISyntaxToken): ReturnStatementSyntax { - return new ReturnStatementSyntax(parseNodeData, - consumeToken(returnKeyword), tryParseReturnStatementExpression(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); + return canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) ? undefined : allowInAnd(parseExpression); } function isExpressionStatement(currentToken: ISyntaxToken): boolean { @@ -2122,7 +2127,7 @@ module TypeScript.Parser { // Elisionopt AssignmentExpression[In, ?Yield] if (currentToken().kind === SyntaxKind.CommaToken) { - return new OmittedExpressionSyntax(parseNodeData); + return new OmittedExpressionSyntax(contextFlags); } return allowInAnd(tryParseAssignmentExpressionOrHigher); @@ -2167,14 +2172,9 @@ module TypeScript.Parser { case SyntaxKind.SlashToken: case SyntaxKind.SlashEqualsToken: - // Note: if we see a / or /= token then we always consider this an expression. Why? - // Well, either that / or /= is actually a regular expression, in which case we're - // definitely an expression. Or, it's actually a divide. In which case, we *still* - // want to think of ourself as an expression. "But wait", you say. '/' doesn't - // start an expression. That's true. BUt like the above check for =>, for error - // tolerance, we will consider ourselves in an expression. We'll then parse out an - // missing identifier and then will consume the / token naturally as a binary - // expression. + // Note: if we see a / or /= token then we always consider this an expression. + // The / or /= will actually be the start of a regex that we will contextually + // rescan. // Simple epxressions. case SyntaxKind.SuperKeyword: @@ -2209,7 +2209,7 @@ module TypeScript.Parser { // ExpressionStatement[Yield] : // [lookahead not-in {{, function, class, let [ }] Expression[In, ?Yield]; - return new ExpressionStatementSyntax(parseNodeData, + return new ExpressionStatementSyntax(contextFlags, allowInAnd(parseExpression), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } @@ -2219,7 +2219,7 @@ module TypeScript.Parser { // if (Expression[In, ?Yield]) Statement[?Yield, ?Return] else Statement[?Yield, ?Return] // if (Expression[In, ?Yield]) Statement[?Yield, ?Return] - return new IfStatementSyntax(parseNodeData, + return new IfStatementSyntax(contextFlags, consumeToken(ifKeyword), eatToken(SyntaxKind.OpenParenToken), allowInAnd(parseExpression), @@ -2232,7 +2232,7 @@ module TypeScript.Parser { } function parseElseClause(): ElseClauseSyntax { - return new ElseClauseSyntax(parseNodeData, eatToken(SyntaxKind.ElseKeyword), parseStatement(/*inErrorRecovery:*/ false)); + return new ElseClauseSyntax(contextFlags, eatToken(SyntaxKind.ElseKeyword), parseStatement(/*inErrorRecovery:*/ false)); } function isVariableStatement(modifierCount: number): boolean { @@ -2243,14 +2243,14 @@ module TypeScript.Parser { // VariableStatement[Yield] : // var VariableDeclarationList[In, ?Yield]; - return new VariableStatementSyntax(parseNodeData, + return new VariableStatementSyntax(contextFlags, parseModifiers(), allowInAnd(parseVariableDeclaration), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } function parseVariableDeclaration(): VariableDeclarationSyntax { // Debug.assert(currentToken().kind === SyntaxKind.VarKeyword); - return new VariableDeclarationSyntax(parseNodeData, + return new VariableDeclarationSyntax(contextFlags, eatToken(SyntaxKind.VarKeyword), parseSeparatedSyntaxList(ListParsingState.VariableDeclaration_VariableDeclarators)); } @@ -2310,7 +2310,7 @@ module TypeScript.Parser { } } - return new VariableDeclaratorSyntax(parseNodeData, propertyName, typeAnnotation, equalsValueClause); + return new VariableDeclaratorSyntax(contextFlags, propertyName, typeAnnotation, equalsValueClause); } function isEqualsValueClause(inParameter: boolean): boolean { @@ -2354,7 +2354,7 @@ module TypeScript.Parser { // Initializer[In, Yield] : // = AssignmentExpression[?In, ?Yield] - return new EqualsValueClauseSyntax(parseNodeData, + return new EqualsValueClauseSyntax(contextFlags, eatToken(SyntaxKind.EqualsToken), parseAssignmentExpressionOrHigher()); } @@ -2371,7 +2371,7 @@ module TypeScript.Parser { break; } - leftOperand = new BinaryExpressionSyntax(parseNodeData, + leftOperand = new BinaryExpressionSyntax(contextFlags, leftOperand, consumeToken(_currentToken), parseAssignmentExpressionOrHigher()); @@ -2393,8 +2393,6 @@ module TypeScript.Parser { // precedence than 'comma'. Otherwise we'll get: "var a = (1, (b = 2))", instead of // "var a = (1), b = (2)"); function tryParseAssignmentExpressionOrHigherWorker(force: boolean): IExpressionSyntax { - // Augmented by TypeScript: - // // AssignmentExpression[in,yield]: // 1) ConditionalExpression[?in,?yield] // 2) LeftHandSideExpression = AssignmentExpression[?in,?yield] @@ -2440,7 +2438,7 @@ module TypeScript.Parser { // Check for recursive assignment expressions. if (SyntaxFacts.isAssignmentOperatorToken(operatorToken.kind)) { - return new BinaryExpressionSyntax(parseNodeData, + return new BinaryExpressionSyntax(contextFlags, leftOperand, consumeToken(operatorToken), parseAssignmentExpressionOrHigher()); @@ -2455,11 +2453,11 @@ module TypeScript.Parser { if (_currentToken.kind === SyntaxKind.YieldKeyword) { // If we have a 'yield' keyword, and htis is a context where yield expressions are // allowed, then definitely parse out a yield expression. - if (yieldContext) { + if (inYieldContext()) { return true; } - if (strictModeContext) { + if (inStrictModeContext()) { // If we're in strict mode, then 'yield' is a keyword, could only ever start // a yield expression. return true; @@ -2500,12 +2498,12 @@ module TypeScript.Parser { if (!isOnDifferentLineThanPreviousToken(_currentToken) && (_currentToken.kind === SyntaxKind.AsteriskToken || isExpression(_currentToken))) { - return new YieldExpressionSyntax(parseNodeData, yieldKeyword, tryEatToken(SyntaxKind.AsteriskToken), parseAssignmentExpressionOrHigher()); + return new YieldExpressionSyntax(contextFlags, yieldKeyword, tryEatToken(SyntaxKind.AsteriskToken), parseAssignmentExpressionOrHigher()); } else { // if the next token is not on the same line as yield. or we don't have an '*' or // the start of an expressin, then this is just a simple "yield" expression. - return new YieldExpressionSyntax(parseNodeData, yieldKeyword, /*asterixToken:*/ undefined, /*expression;*/ undefined); + return new YieldExpressionSyntax(contextFlags, yieldKeyword, /*asterixToken:*/ undefined, /*expression;*/ undefined); } } @@ -2525,7 +2523,7 @@ module TypeScript.Parser { case SyntaxKind.ExclamationToken: case SyntaxKind.PlusPlusToken: case SyntaxKind.MinusMinusToken: - return new PrefixUnaryExpressionSyntax(parseNodeData, consumeToken(_currentToken), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); + return new PrefixUnaryExpressionSyntax(contextFlags, consumeToken(_currentToken), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); case SyntaxKind.TypeOfKeyword: return parseTypeOfExpression(_currentToken); case SyntaxKind.VoidKeyword: return parseVoidExpression(_currentToken); case SyntaxKind.DeleteKeyword: return parseDeleteExpression(_currentToken); @@ -2565,7 +2563,7 @@ module TypeScript.Parser { // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - return new ConditionalExpressionSyntax(parseNodeData, + return new ConditionalExpressionSyntax(contextFlags, leftOperand, consumeToken(_currentToken), allowInAnd(parseAssignmentExpressionOrHigher), @@ -2592,7 +2590,7 @@ module TypeScript.Parser { } // also, if it's the 'in' operator, only allow if our caller allows it. - if (tokenKind === SyntaxKind.InKeyword && disallowInContext) { + if (tokenKind === SyntaxKind.InKeyword && inDisallowInContext()) { break; } @@ -2609,7 +2607,7 @@ module TypeScript.Parser { // Precedence is okay, so we'll "take" this operator. // Now skip the operator token we're on. - leftOperand = new BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), + leftOperand = new BinaryExpressionSyntax(contextFlags, leftOperand, consumeToken(operatorToken), tryParseBinaryExpressionOrHigher(currentToken(), /*force:*/ true, newPrecedence)); } @@ -2632,7 +2630,7 @@ module TypeScript.Parser { return token0; } - function tryParseMemberExpressionOrHigher(_currentToken: ISyntaxToken, force: boolean, inObjectCreation: boolean): IMemberExpressionSyntax { + function tryParseMemberExpressionOrHigher(_currentToken: ISyntaxToken, force: boolean): IMemberExpressionSyntax { // Note: to make our lives simpler, we decompose the the NewExpression productions and // place ObjectCreationExpression and FunctionExpression into PrimaryExpression. // like so: @@ -2685,7 +2683,7 @@ module TypeScript.Parser { return undefined; } - return parseMemberExpressionRest(expression, inObjectCreation); + return parseMemberExpressionRest(expression); } function parseCallExpressionRest(expression: ILeftHandSideExpressionSyntax): ILeftHandSideExpressionSyntax { @@ -2695,7 +2693,7 @@ module TypeScript.Parser { switch (currentTokenKind) { case SyntaxKind.OpenParenToken: - expression = new InvocationExpressionSyntax(parseNodeData, expression, parseArgumentList(/*typeArgumentList:*/ undefined, _currentToken)); + expression = new InvocationExpressionSyntax(contextFlags, expression, parseArgumentList(/*typeArgumentList:*/ undefined, _currentToken)); continue; case SyntaxKind.LessThanToken: @@ -2708,20 +2706,20 @@ module TypeScript.Parser { break; } - expression = new InvocationExpressionSyntax(parseNodeData, expression, argumentList); + expression = new InvocationExpressionSyntax(contextFlags, expression, argumentList); continue; case SyntaxKind.OpenBracketToken: - expression = parseElementAccessExpression(expression, _currentToken, /*inObjectCreation:*/ false); + expression = parseElementAccessExpression(expression, _currentToken); continue; case SyntaxKind.DotToken: - expression = new MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); + expression = new MemberAccessExpressionSyntax(contextFlags, expression, consumeToken(_currentToken), eatIdentifierNameToken()); continue; case SyntaxKind.NoSubstitutionTemplateToken: case SyntaxKind.TemplateStartToken: - expression = new TemplateAccessExpressionSyntax(parseNodeData, expression, parseTemplateExpression(_currentToken)); + expression = new TemplateAccessExpressionSyntax(contextFlags, expression, parseTemplateExpression(_currentToken)); continue; } @@ -2729,23 +2727,23 @@ module TypeScript.Parser { } } - function parseMemberExpressionRest(expression: IMemberExpressionSyntax, inObjectCreation: boolean): IMemberExpressionSyntax { + function parseMemberExpressionRest(expression: IMemberExpressionSyntax): IMemberExpressionSyntax { while (true) { var _currentToken = currentToken(); var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { case SyntaxKind.OpenBracketToken: - expression = parseElementAccessExpression(expression, _currentToken, inObjectCreation); + expression = parseElementAccessExpression(expression, _currentToken); continue; case SyntaxKind.DotToken: - expression = new MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); + expression = new MemberAccessExpressionSyntax(contextFlags, expression, consumeToken(_currentToken), eatIdentifierNameToken()); continue; case SyntaxKind.NoSubstitutionTemplateToken: case SyntaxKind.TemplateStartToken: - expression = new TemplateAccessExpressionSyntax(parseNodeData, expression, parseTemplateExpression(_currentToken)); + expression = new TemplateAccessExpressionSyntax(contextFlags, expression, parseTemplateExpression(_currentToken)); continue; } @@ -2790,7 +2788,7 @@ module TypeScript.Parser { expression = parseSuperExpression(_currentToken); } else { - expression = tryParseMemberExpressionOrHigher(_currentToken, force, /*inObjectCreation:*/ false); + expression = tryParseMemberExpressionOrHigher(_currentToken, force); if (expression === undefined) { return undefined; } @@ -2809,7 +2807,7 @@ module TypeScript.Parser { var currentTokenKind = currentToken().kind; return currentTokenKind === SyntaxKind.OpenParenToken || currentTokenKind === SyntaxKind.DotToken ? expression - : new MemberAccessExpressionSyntax(parseNodeData, expression, eatToken(SyntaxKind.DotToken), eatIdentifierNameToken()); + : new MemberAccessExpressionSyntax(contextFlags, expression, eatToken(SyntaxKind.DotToken), eatIdentifierNameToken()); } function tryParsePostfixExpressionOrHigher(_currentToken: ISyntaxToken, force: boolean): IPostfixExpressionSyntax { @@ -2830,7 +2828,7 @@ module TypeScript.Parser { break; } - return new PostfixUnaryExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken)); + return new PostfixUnaryExpressionSyntax(contextFlags, expression, consumeToken(_currentToken)); } return expression; @@ -2869,13 +2867,10 @@ module TypeScript.Parser { // we'll bail out here and give a poor error message when we try to parse this // as an arithmetic expression. if (isDot) { - // A parameter list must follow a generic type argument list. - var diagnostic = new Diagnostic(fileName, source.text.lineMap(), start(token0, source.text), width(token0), - DiagnosticCode.A_parameter_list_must_follow_a_generic_type_argument_list_expected, undefined); - addDiagnostic(diagnostic); - - return new ArgumentListSyntax(parseNodeData, typeArgumentList, - Syntax.emptyToken(SyntaxKind.OpenParenToken), [], Syntax.emptyToken(SyntaxKind.CloseParenToken)); + return new ArgumentListSyntax(contextFlags, typeArgumentList, + createMissingToken(SyntaxKind.OpenParenToken, undefined, DiagnosticCode.A_parameter_list_must_follow_a_generic_type_argument_list_expected), + [], + eatToken(SyntaxKind.CloseParenToken)); } else { Debug.assert(token0.kind === SyntaxKind.OpenParenToken); @@ -2901,7 +2896,7 @@ module TypeScript.Parser { function parseArgumentList(typeArgumentList: TypeArgumentListSyntax, openParenToken: ISyntaxToken): ArgumentListSyntax { Debug.assert(openParenToken.kind === SyntaxKind.OpenParenToken && openParenToken.fullWidth() > 0); - return new ArgumentListSyntax(parseNodeData, + return new ArgumentListSyntax(contextFlags, typeArgumentList, consumeToken(openParenToken), parseSeparatedSyntaxList(ListParsingState.ArgumentList_AssignmentExpressions), @@ -2923,29 +2918,18 @@ module TypeScript.Parser { return allowInAnd(force ? parseAssignmentExpressionOrHigher : tryParseAssignmentExpressionOrHigher); } - function parseElementAccessArgumentExpression(openBracketToken: ISyntaxToken, inObjectCreation: boolean) { + function parseElementAccessArgumentExpression(openBracketToken: ISyntaxToken) { // MemberExpression[?Yield] [ Expression[In, ?Yield] ] - // It's not uncommon for a user to write: "new Type[]". Check for that common pattern - // and report a better error message. - if (inObjectCreation && currentToken().kind === SyntaxKind.CloseBracketToken) { - var errorStart = start(openBracketToken, source.text); - var errorEnd = fullEnd(currentToken()); - var diagnostic = new Diagnostic(fileName, source.text.lineMap(), errorStart, errorEnd - errorStart, - DiagnosticCode.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead, undefined); - addDiagnostic(diagnostic); - - return Syntax.emptyToken(SyntaxKind.IdentifierName); - } - else { - return allowInAnd(parseExpression); - } + // For error recovery purposes. Allow a missing expression here. We'll report the + // appropriate message in the grammar checker. + return currentToken().kind === SyntaxKind.CloseBracketToken ? undefined : allowInAnd(parseExpression); } - function parseElementAccessExpression(expression: ILeftHandSideExpressionSyntax, openBracketToken: ISyntaxToken, inObjectCreation: boolean): ElementAccessExpressionSyntax { + function parseElementAccessExpression(expression: ILeftHandSideExpressionSyntax, openBracketToken: ISyntaxToken): ElementAccessExpressionSyntax { // Debug.assert(currentToken().kind === SyntaxKind.OpenBracketToken); - return new ElementAccessExpressionSyntax(parseNodeData, expression, consumeToken(openBracketToken), - parseElementAccessArgumentExpression(openBracketToken, inObjectCreation), eatToken(SyntaxKind.CloseBracketToken)); + return new ElementAccessExpressionSyntax(contextFlags, expression, consumeToken(openBracketToken), + parseElementAccessArgumentExpression(openBracketToken), eatToken(SyntaxKind.CloseBracketToken)); } function tryParsePrimaryExpression(_currentToken: ISyntaxToken, force: boolean): IPrimaryExpressionSyntax { @@ -2976,15 +2960,9 @@ module TypeScript.Parser { case SyntaxKind.SlashToken: case SyntaxKind.SlashEqualsToken: - // If we see a standalone / or /= and we're expecting a term, then try to reparse + // If we see a standalone / or /= and we're expecting an expression, then reparse // it as a regular expression. - var result = tryReparseDivideAsRegularExpression(); - - // If we get a result, then use it. Otherwise, create a missing identifier so - // that parsing can continue. Note: we do this even if 'force' is false. That's - // because we *do* want to consider a standalone / as an expression that should be - // returned from tryParseExpression even when 'force' is set to false. - return result || eatIdentifierToken(DiagnosticCode.Expression_expected); + return reparseDivideAsRegularExpression(); } if (!force) { @@ -2995,7 +2973,7 @@ module TypeScript.Parser { return eatIdentifierToken(DiagnosticCode.Expression_expected); } - function tryReparseDivideAsRegularExpression(): IPrimaryExpressionSyntax { + function reparseDivideAsRegularExpression(): IPrimaryExpressionSyntax { // If we see a / or /= token, then that may actually be the start of a regex in certain // contexts. @@ -3012,30 +2990,21 @@ module TypeScript.Parser { // Debug.assert(SyntaxFacts.isAnyDivideOrRegularExpressionToken(currentToken.kind)); var tokenKind = currentToken.kind; - if (tokenKind === SyntaxKind.SlashToken || tokenKind === SyntaxKind.SlashEqualsToken) { - // Still came back as a / or /=. This is not a regular expression literal. - return undefined; - } - else if (tokenKind === SyntaxKind.RegularExpressionLiteral) { - return consumeToken(currentToken); - } - else { - // Something *very* wrong happened. This is an internal parser fault that we need - // to figure out and fix. - throw Errors.invalidOperation(); - } + Debug.assert(tokenKind === SyntaxKind.RegularExpressionLiteral); + + return consumeToken(currentToken); } function parseTypeOfExpression(typeOfKeyword: ISyntaxToken): TypeOfExpressionSyntax { - return new TypeOfExpressionSyntax(parseNodeData, consumeToken(typeOfKeyword), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); + return new TypeOfExpressionSyntax(contextFlags, consumeToken(typeOfKeyword), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); } function parseDeleteExpression(deleteKeyword: ISyntaxToken): DeleteExpressionSyntax { - return new DeleteExpressionSyntax(parseNodeData, consumeToken(deleteKeyword), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); + return new DeleteExpressionSyntax(contextFlags, consumeToken(deleteKeyword), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); } function parseVoidExpression(voidKeyword: ISyntaxToken): VoidExpressionSyntax { - return new VoidExpressionSyntax(parseNodeData, consumeToken(voidKeyword), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); + return new VoidExpressionSyntax(contextFlags, consumeToken(voidKeyword), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); } function parseFunctionExpression(functionKeyword: ISyntaxToken): FunctionExpressionSyntax { @@ -3045,14 +3014,16 @@ module TypeScript.Parser { function parseFunctionExpressionWorker(functionKeyword: ISyntaxToken, asteriskToken: ISyntaxToken) { // GeneratorExpression : // function * BindingIdentifier[Yield]opt (FormalParameters[Yield, GeneratorParameter]) { GeneratorBody[Yield] } + // FunctionExpression: + // function BindingIdentifieropt(FormalParameters) { FunctionBody } var isGenerator = asteriskToken !== undefined; - return new FunctionExpressionSyntax(parseNodeData, + return new FunctionExpressionSyntax(contextFlags, functionKeyword, asteriskToken, - enterYieldContextAnd(eatOptionalIdentifierToken), - parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yield:*/ isGenerator, /*generatorParameter:*/ isGenerator), - parseFunctionBlock(/*yield:*/ isGenerator)); + asteriskToken ? enterYieldContextAnd(eatOptionalIdentifierToken) : eatOptionalIdentifierToken(), + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ isGenerator), + parseFunctionBody(isGenerator)); } function parseObjectCreationExpression(newKeyword: ISyntaxToken): ObjectCreationExpressionSyntax { @@ -3065,8 +3036,8 @@ module TypeScript.Parser { // See comment in tryParseMemberExpressionOrHigher for a more complete explanation of // this decision. - return new ObjectCreationExpressionSyntax(parseNodeData, - consumeToken(newKeyword), tryParseMemberExpressionOrHigher(currentToken(), /*force:*/ true, /*inObjectCreation:*/ true), tryParseArgumentList()); + return new ObjectCreationExpressionSyntax(contextFlags, + consumeToken(newKeyword), tryParseMemberExpressionOrHigher(currentToken(), /*force:*/ true), tryParseArgumentList()); } function parseTemplateExpression(startToken: ISyntaxToken): IPrimaryExpressionSyntax { @@ -3085,7 +3056,7 @@ module TypeScript.Parser { } while (templateClauses[templateClauses.length - 1].templateMiddleOrEndToken.kind === SyntaxKind.TemplateMiddleToken); - return new TemplateExpressionSyntax(parseNodeData, startToken, Syntax.list(templateClauses)); + return new TemplateExpressionSyntax(contextFlags, startToken, Syntax.list(templateClauses)); } function parseTemplateClause(): TemplateClauseSyntax { @@ -3103,23 +3074,21 @@ module TypeScript.Parser { token = consumeToken(token); } else { - var diagnostic = getExpectedTokenDiagnostic(SyntaxKind.CloseBraceToken); - addDiagnostic(diagnostic); - token = Syntax.emptyToken(SyntaxKind.TemplateEndToken); + token = createMissingToken(SyntaxKind.TemplateEndToken, undefined, DiagnosticCode._0_expected, ["{"]); } - return new TemplateClauseSyntax(parseNodeData, expression, token); + return new TemplateClauseSyntax(contextFlags, expression, token); } function parseCastExpression(lessThanToken: ISyntaxToken): CastExpressionSyntax { - return new CastExpressionSyntax(parseNodeData, + return new CastExpressionSyntax(contextFlags, consumeToken(lessThanToken), parseType(), eatToken(SyntaxKind.GreaterThanToken), tryParseUnaryExpressionOrHigher(currentToken(), /*force:*/ true)); } function parseParenthesizedExpression(openParenToken: ISyntaxToken): ParenthesizedExpressionSyntax { // ( Expression[In, ?Yield] ) - return new ParenthesizedExpressionSyntax(parseNodeData, + return new ParenthesizedExpressionSyntax(contextFlags, consumeToken(openParenToken), allowInAnd(parseExpression), eatToken(SyntaxKind.CloseParenToken)); @@ -3168,23 +3137,20 @@ module TypeScript.Parser { var _currentToken = currentToken(); // Debug.assert(currentToken.kind === SyntaxKind.OpenParenToken || currentToken.kind === SyntaxKind.LessThanToken); - // Note: ES6 specifies the formal parametes of an arrow function like this: - // - // ArrowFormalParameters[Yield, GeneratorParameter] : - // (StrictFormalParameters[?Yield, ?GeneratorParameter]) - // - // However, the 'GeneratorParameter' portion appears to be a spec bug. There does not - // appear to be any way for that value to be passed in through any grammar constructs. - // - // [Yield], on the other hand, is available, and is passed through. - - var callSignature = parseCallSignature(/*requireCompleteTypeParameterList:*/ true, /*yield:*/ yieldContext, /*generatorParameter:*/ false); + // From the static semantic section: + // 1.If the [Yield] grammar parameter is present for CoverParenthesizedExpressionAndArrowParameterList[Yield] + // return the result of parsing the lexical token stream matched by CoverParenthesizedExpressionAndArrowParameterList[Yield] + // using ArrowFormalParameters[Yield, GeneratorParameter] as the goal symbol. + // 2.If the [Yield] grammar parameter is not present for CoverParenthesizedExpressionAndArrowParameterList[Yield] + // return the result of parsing the lexical token stream matched by CoverParenthesizedExpressionAndArrowParameterList + // using ArrowFormalParameters as the goal symbol. + var callSignature = parseCallSignature(/*requireCompleteTypeParameterList:*/ true, /*yieldAndGeneratorParameterContext:*/ inYieldContext()); if (requireArrow && currentToken().kind !== SyntaxKind.EqualsGreaterThanToken) { return undefined; } - return new ParenthesizedArrowFunctionExpressionSyntax(parseNodeData, + return new ParenthesizedArrowFunctionExpressionSyntax(contextFlags, callSignature, eatToken(SyntaxKind.EqualsGreaterThanToken), parseArrowFunctionBody()); @@ -3195,8 +3161,8 @@ module TypeScript.Parser { // [lookahead not in {] AssignmentExpression[?In] // { FunctionBody } - if (isBlock()) { - return parseFunctionBlock(/*allowYield:*/ false); + if (currentToken().kind === SyntaxKind.OpenBraceToken) { + return parseFunctionBlock(/*allowYield:*/ false, /*equalsGreaterThanToken:*/ undefined); } // We didn't have a block. However, we may be in an error situation. For example, @@ -3215,7 +3181,8 @@ module TypeScript.Parser { // We've seen a statement (and it isn't an expressionStatement like 'foo()'), so // treat this like a block with a missing open brace. - return new BlockSyntax(parseNodeData, + return new BlockSyntax(contextFlags, + /*equalsGreaterThanToken*/ undefined, eatToken(SyntaxKind.OpenBraceToken), parseFunctionBlockStatements(), eatToken(SyntaxKind.CloseBraceToken)); @@ -3238,14 +3205,15 @@ module TypeScript.Parser { function parseSimpleArrowFunctionExpression(): SimpleArrowFunctionExpressionSyntax { // Debug.assert(isSimpleArrowFunctionExpression()); - return new SimpleArrowFunctionExpressionSyntax(parseNodeData, + return new SimpleArrowFunctionExpressionSyntax(contextFlags, eatSimpleParameter(), eatToken(SyntaxKind.EqualsGreaterThanToken), parseArrowFunctionBody()); } - function isBlock(): boolean { - return currentToken().kind === SyntaxKind.OpenBraceToken; + function isFunctionBlock(): boolean { + var currentTokenKind = currentToken().kind; + return currentTokenKind === SyntaxKind.OpenBraceToken || currentTokenKind === SyntaxKind.EqualsGreaterThanToken; } function isBlockOrArrow(): boolean { @@ -3414,7 +3382,7 @@ module TypeScript.Parser { function parseObjectLiteralExpression(openBraceToken: ISyntaxToken): ObjectLiteralExpressionSyntax { // Debug.assert(currentToken().kind === SyntaxKind.OpenBraceToken); - return new ObjectLiteralExpressionSyntax(parseNodeData, + return new ObjectLiteralExpressionSyntax(contextFlags, consumeToken(openBraceToken), parseSeparatedSyntaxList(ListParsingState.ObjectLiteralExpression_PropertyAssignments), eatToken(SyntaxKind.CloseBraceToken)); @@ -3474,7 +3442,7 @@ module TypeScript.Parser { // // Also, if we have an identifier and it is followed by a colon then this is // definitely a simple property assignment. - return new SimplePropertyAssignmentSyntax(parseNodeData, + return new SimplePropertyAssignmentSyntax(contextFlags, propertyName, eatToken(SyntaxKind.ColonToken), allowInAnd(parseAssignmentExpressionOrHigher)); @@ -3538,7 +3506,7 @@ module TypeScript.Parser { var _currentToken = currentToken(); if (_currentToken.kind === SyntaxKind.OpenBracketToken) { - return generatorParameterContext + return inGeneratorParameterContext() ? exitYieldContextAnd(parseComputedPropertyName) : parseComputedPropertyName(); } @@ -3559,7 +3527,7 @@ module TypeScript.Parser { // ComputedPropertyName[Yield] : // [AssignmentExpression[In, ?Yield]] - return new ComputedPropertyNameSyntax(parseNodeData, + return new ComputedPropertyNameSyntax(contextFlags, eatToken(SyntaxKind.OpenBracketToken), allowInAnd(parseAssignmentExpressionOrHigher), eatToken(SyntaxKind.CloseBracketToken)); @@ -3567,16 +3535,16 @@ module TypeScript.Parser { function parseFunctionPropertyAssignment(asteriskToken: ISyntaxToken, propertyName: IPropertyNameSyntax): FunctionPropertyAssignmentSyntax { var isGenerator = asteriskToken !== undefined; - return new FunctionPropertyAssignmentSyntax(parseNodeData, + return new FunctionPropertyAssignmentSyntax(contextFlags, asteriskToken, propertyName, - parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yield:*/ isGenerator, /*generatorParameter:*/ isGenerator), - parseFunctionBlock(/*yield:*/ isGenerator)); + parseCallSignature(/*requireCompleteTypeParameterList:*/ false, /*yieldAndGeneratorParameterContext:*/ isGenerator), + parseFunctionBody(isGenerator)); } function parseArrayLiteralExpression(openBracketToken: ISyntaxToken): ArrayLiteralExpressionSyntax { // Debug.assert(currentToken().kind === SyntaxKind.OpenBracketToken); - return new ArrayLiteralExpressionSyntax(parseNodeData, + return new ArrayLiteralExpressionSyntax(contextFlags, consumeToken(openBracketToken), parseSeparatedSyntaxList(ListParsingState.ArrayLiteralExpression_AssignmentExpressions), eatToken(SyntaxKind.CloseBracketToken)); @@ -3586,49 +3554,52 @@ module TypeScript.Parser { // Different from function blocks in that we don't check for strict mode, nor do accept // a block without an open curly. var openBraceToken: ISyntaxToken; - return new BlockSyntax(parseNodeData, + return new BlockSyntax(contextFlags, + tryEatToken(SyntaxKind.EqualsGreaterThanToken), openBraceToken = eatToken(SyntaxKind.OpenBraceToken), openBraceToken.fullWidth() > 0 ? parseSyntaxList(ListParsingState.Block_Statements) : [], eatToken(SyntaxKind.CloseBraceToken)); } - function parseFunctionBlock(_allowYield: boolean): BlockSyntax { + function parseFunctionBlockOrExpressionBody(_allowYield: boolean): BlockSyntax | ExpressionBody { // If we got an errant => then we want to parse what's coming up without requiring an - // open brace. ItWe do this because it's not uncommon for people to get confused as to + // open brace. We do this because it's not uncommon for people to get confused as to // where/when they can use an => and we want to have good error recovery here. - var token0 = currentToken(); - - var hasEqualsGreaterThanToken = token0.kind === SyntaxKind.EqualsGreaterThanToken; - if (hasEqualsGreaterThanToken) { - addDiagnostic(new Diagnostic(fileName, source.text.lineMap(), - start(token0, source.text), width(token0), DiagnosticCode.Unexpected_token_0_expected, [SyntaxFacts.getText(SyntaxKind.OpenBraceToken)])); - - // Skip over the => It will get attached to whatever comes next. - skipToken(token0); + var equalsGreaterThanToken = tryEatToken(SyntaxKind.EqualsGreaterThanToken); + if (equalsGreaterThanToken) { + // check if they wrote something like: => expr + // or if it was more like : => statement + if (isExpression(currentToken())) { + return new ExpressionBody(contextFlags, equalsGreaterThanToken, parseExpression()); + } } - var openBraceToken = eatToken(SyntaxKind.OpenBraceToken); - var statements: IStatementSyntax[]; + return parseFunctionBlock(_allowYield, equalsGreaterThanToken); + } - if (hasEqualsGreaterThanToken || openBraceToken.fullWidth() > 0) { - statements = _allowYield ? enterYieldContextAnd(parseFunctionBlockStatements) : exitYieldContextAnd(parseFunctionBlockStatements); - } - - return new BlockSyntax(parseNodeData, openBraceToken, statements || [], eatToken(SyntaxKind.CloseBraceToken)); + function parseFunctionBlock(_allowYield: boolean, equalsGreaterThanToken: ISyntaxToken): BlockSyntax { + var openBraceToken: ISyntaxToken; + return new BlockSyntax(contextFlags, + equalsGreaterThanToken, + openBraceToken = eatToken(SyntaxKind.OpenBraceToken), + equalsGreaterThanToken || openBraceToken.fullWidth() > 0 + ? _allowYield ? enterYieldContextAnd(parseFunctionBlockStatements) : exitYieldContextAnd(parseFunctionBlockStatements) + : [], + eatToken(SyntaxKind.CloseBraceToken)); } function parseFunctionBlockStatements() { - var savedIsInStrictMode = strictModeContext; + var savedIsInStrictMode = inStrictModeContext(); var statements = parseSyntaxList(ListParsingState.Block_Statements, updateStrictModeState); setStrictModeContext(savedIsInStrictMode); return statements; } - function parseCallSignature(requireCompleteTypeParameterList: boolean, _yieldContext: boolean, _generatorParameterContext: boolean): CallSignatureSyntax { - return new CallSignatureSyntax(parseNodeData, + function parseCallSignature(requireCompleteTypeParameterList: boolean, yieldAndGeneratorParameterContext: boolean): CallSignatureSyntax { + return new CallSignatureSyntax(contextFlags, tryParseTypeParameterList(requireCompleteTypeParameterList), - parseParameterList(_yieldContext, _generatorParameterContext), + parseParameterList(yieldAndGeneratorParameterContext), parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false)); } @@ -3653,7 +3624,7 @@ module TypeScript.Parser { } else { releaseRewindPoint(rewindPoint); - return new TypeParameterListSyntax(parseNodeData, lessThanToken, typeParameters, greaterThanToken); + return new TypeParameterListSyntax(contextFlags, lessThanToken, typeParameters, greaterThanToken); } } @@ -3667,7 +3638,7 @@ module TypeScript.Parser { return undefined; } - return new TypeParameterSyntax(parseNodeData, eatIdentifierToken(), tryParseConstraint()); + return new TypeParameterSyntax(contextFlags, eatIdentifierToken(), tryParseConstraint()); } function tryParseConstraint(): ConstraintSyntax { @@ -3675,10 +3646,14 @@ module TypeScript.Parser { return undefined; } - return new ConstraintSyntax(parseNodeData, eatToken(SyntaxKind.ExtendsKeyword), parseTypeOrExpression()); + return new ConstraintSyntax(contextFlags, eatToken(SyntaxKind.ExtendsKeyword), parseTypeOrExpression()); } - function parseParameterList(_yieldContext: boolean, _generatorParameterContext: boolean): ParameterListSyntax { + // Note: after careful analysis of the grammar, it does not appear to be possible to + // have 'Yield' And 'GeneratorParameter' not in sync. i.e. any production calling + // this FormalParameters production either always sets both to true, or always sets + // both to false. As such we only have a single parameter to represent both. + function parseParameterList(yieldAndGeneratorParameterContext: boolean): ParameterListSyntax { // FormalParameters[Yield,GeneratorParameter] : // ... // @@ -3694,14 +3669,15 @@ module TypeScript.Parser { // [+GeneratorParameter]BindingIdentifier[Yield]Initializer[In]opt // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt - var savedYieldContext = yieldContext; - var savedGeneratorParameterContext = generatorParameterContext; - setYieldContext(_yieldContext); - setGeneratorParameterContext(_generatorParameterContext); + var savedYieldContext = inYieldContext(); + var savedGeneratorParameterContext = inGeneratorParameterContext(); + + setYieldContext(yieldAndGeneratorParameterContext); + setGeneratorParameterContext(yieldAndGeneratorParameterContext); var openParenToken: ISyntaxToken; - var result = new ParameterListSyntax(parseNodeData, + var result = new ParameterListSyntax(contextFlags, openParenToken = eatToken(SyntaxKind.OpenParenToken), openParenToken.fullWidth() > 0 ? parseSeparatedSyntaxList(ListParsingState.ParameterList_Parameters) : [], eatToken(SyntaxKind.CloseParenToken)); @@ -3728,7 +3704,7 @@ module TypeScript.Parser { } function parseTypeAnnotation(allowStringLiteral: boolean): TypeAnnotationSyntax { - return new TypeAnnotationSyntax(parseNodeData, consumeToken(currentToken()), parseTypeAnnotationType(allowStringLiteral)); + return new TypeAnnotationSyntax(contextFlags, consumeToken(currentToken()), parseTypeAnnotationType(allowStringLiteral)); } function isType(): boolean { @@ -3780,8 +3756,8 @@ module TypeScript.Parser { function tryParseType(): ITypeSyntax { // The rules about 'yield' only apply to actual code/expression contexts. They don't // apply to 'type' contexts. So we disable these parameters here before moving on. - var savedYieldContext = yieldContext; - var savedGeneratorParameterContext = generatorParameterContext; + var savedYieldContext = inYieldContext(); + var savedGeneratorParameterContext = inGeneratorParameterContext(); setYieldContext(false); setGeneratorParameterContext(false); @@ -3812,7 +3788,7 @@ module TypeScript.Parser { if (type) { var barToken: ISyntaxToken; while ((barToken = currentToken()).kind === SyntaxKind.BarToken) { - type = new UnionTypeSyntax(parseNodeData, type, consumeToken(barToken), parsePrimaryType()); + type = new UnionTypeSyntax(contextFlags, type, consumeToken(barToken), parsePrimaryType()); } } @@ -3840,14 +3816,14 @@ module TypeScript.Parser { break; } - type = new ArrayTypeSyntax(parseNodeData, type, consumeToken(_currentToken), eatToken(SyntaxKind.CloseBracketToken)); + type = new ArrayTypeSyntax(contextFlags, type, consumeToken(_currentToken), eatToken(SyntaxKind.CloseBracketToken)); } return type; } function parseTypeQuery(typeOfKeyword: ISyntaxToken): TypeQuerySyntax { - return new TypeQuerySyntax(parseNodeData, consumeToken(typeOfKeyword), parseName(/*allowIdentifierNames:*/ true)); + return new TypeQuerySyntax(contextFlags, consumeToken(typeOfKeyword), parseName(/*allowIdentifierNames:*/ true)); } function tryParseNonArrayType(): ITypeSyntax { @@ -3875,7 +3851,7 @@ module TypeScript.Parser { } function parseParenthesizedType(openParenToken: ISyntaxToken): ParenthesizedTypeSyntax { - return new ParenthesizedTypeSyntax(parseNodeData, consumeToken(openParenToken), parseType(), eatToken(SyntaxKind.CloseParenToken)); + return new ParenthesizedTypeSyntax(contextFlags, consumeToken(openParenToken), parseType(), eatToken(SyntaxKind.CloseParenToken)); } function tryParseNameOrGenericType(): ITypeSyntax { @@ -3895,7 +3871,7 @@ module TypeScript.Parser { var typeArgumentList = tryParseTypeArgumentList(/*inExpression:*/ false); return !typeArgumentList ? name - : new GenericTypeSyntax(parseNodeData, name, typeArgumentList); + : new GenericTypeSyntax(contextFlags, name, typeArgumentList); } function isFunctionType(): boolean { @@ -3963,19 +3939,19 @@ module TypeScript.Parser { function parseFunctionType(): FunctionTypeSyntax { // Function types only exist in the type space and not the expression space. So they // aren't in the [Yield] or [GeneratorParameter] context. - return new FunctionTypeSyntax(parseNodeData, + return new FunctionTypeSyntax(contextFlags, tryParseTypeParameterList(/*requireCompleteTypeParameterList:*/ false), - parseParameterList(/*yield:*/ false, /*generatorParameter:*/ false), + parseParameterList(/*yieldAndGeneratorParameterContext:*/ false), eatToken(SyntaxKind.EqualsGreaterThanToken), parseType()); } function parseConstructorType(): ConstructorTypeSyntax { // Constructor types only exist in the type space and not the expression space. So they // aren't in the [Yield] or [GeneratorParameter] context. - return new ConstructorTypeSyntax(parseNodeData, + return new ConstructorTypeSyntax(contextFlags, eatToken(SyntaxKind.NewKeyword), tryParseTypeParameterList(/*requireCompleteTypeParameterList:*/ false), - parseParameterList(/*yield:*/ false, /*generatorParameter:*/ false), + parseParameterList(/*yieldAndGeneratorParameterContext:*/ false), eatToken(SyntaxKind.EqualsGreaterThanToken), parseType()); } @@ -3995,7 +3971,7 @@ module TypeScript.Parser { } function eatSimpleParameter() { - return new ParameterSyntax(parseNodeData, + return new ParameterSyntax(contextFlags, /*dotDotDotToken:*/ undefined, /*modifiers:*/ [], eatIdentifierToken(), /*questionToken:*/ undefined, /*typeAnnotation:*/ undefined, /*equalsValueClause:*/ undefined); } @@ -4030,7 +4006,7 @@ module TypeScript.Parser { // [+GeneratorParameter]BindingIdentifier[Yield]Initializer[In]opt // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt - var identifier = generatorParameterContext + var identifier = inGeneratorParameterContext() ? enterYieldContextAnd(eatIdentifierToken) : eatIdentifierToken(); @@ -4039,12 +4015,12 @@ module TypeScript.Parser { var equalsValueClause: EqualsValueClauseSyntax = undefined; if (isEqualsValueClause(/*inParameter*/ true)) { - equalsValueClause = generatorParameterContext + equalsValueClause = inGeneratorParameterContext() ? exitYieldContextAnd(parseEqualsValueClause) : parseEqualsValueClause(); } - return new ParameterSyntax(parseNodeData, dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause); + return new ParameterSyntax(contextFlags, dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause); } function parseSyntaxList(currentListType: ListParsingState, processItems?: (items: any[]) => void): T[] { @@ -4238,7 +4214,7 @@ module TypeScript.Parser { // consume the '}' just fine. So ASI doesn't apply. if (allowAutomaticSemicolonInsertion && canEatAutomaticSemicolon(/*allowWithoutNewline:*/ false)) { - var semicolonToken = eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) || Syntax.emptyToken(SyntaxKind.SemicolonToken); + var semicolonToken = eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) || createEmptyToken(SyntaxKind.SemicolonToken); nodesAndSeparators.push(semicolonToken); // Debug.assert(items.length % 2 === 0); continue; @@ -4421,7 +4397,7 @@ module TypeScript.Parser { } function isExpectedVariableDeclaration_VariableDeclaratorsTerminator(): boolean { - if (disallowInContext) { + if (inDisallowInContext()) { // This is the case when we're parsing variable declarations in a for/for-in statement. var tokenKind = currentToken().kind; diff --git a/src/services/syntax/prettyPrinter.ts b/src/services/syntax/prettyPrinter.ts index 4bd57ffb62f..c75136e89f9 100644 --- a/src/services/syntax/prettyPrinter.ts +++ b/src/services/syntax/prettyPrinter.ts @@ -316,8 +316,8 @@ module TypeScript.PrettyPrinter { this.appendToken(node.closeBraceToken); } - private appendBlockOrSemicolon(body: BlockSyntax | ISyntaxToken) { - if (body.kind === SyntaxKind.Block) { + private appendBody(body: BlockSyntax | ExpressionBody | ISyntaxToken) { + if (body.kind === SyntaxKind.Block || body.kind === SyntaxKind.ExpressionBody) { this.ensureSpace(); visitNodeOrToken(this, body); } @@ -326,6 +326,12 @@ module TypeScript.PrettyPrinter { } } + public visitExpressionBody(node: ExpressionBody): void { + this.appendToken(node.equalsGreaterThanToken); + this.ensureSpace(); + visitNodeOrToken(this, node.expression); + } + public visitFunctionDeclaration(node: FunctionDeclarationSyntax): void { this.appendSpaceList(node.modifiers); this.ensureSpace(); @@ -333,7 +339,7 @@ module TypeScript.PrettyPrinter { this.ensureSpace(); this.appendToken(node.identifier); this.appendNode(node.callSignature); - this.appendBlockOrSemicolon(node.body); + this.appendBody(node.body); } public visitVariableStatement(node: VariableStatementSyntax): void { @@ -666,7 +672,7 @@ module TypeScript.PrettyPrinter { public visitConstructorDeclaration(node: ConstructorDeclarationSyntax): void { this.appendToken(node.constructorKeyword); visitNodeOrToken(this, node.callSignature); - this.appendBlockOrSemicolon(node.body); + this.appendBody(node.body); } public visitIndexMemberDeclaration(node: IndexMemberDeclarationSyntax): void { @@ -681,7 +687,7 @@ module TypeScript.PrettyPrinter { this.ensureSpace(); visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature); - this.appendBlockOrSemicolon(node.body); + this.appendBody(node.body); } public visitGetAccessor(node: GetAccessorSyntax): void { @@ -692,7 +698,7 @@ module TypeScript.PrettyPrinter { visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature); this.ensureSpace(); - visitNodeOrToken(this, node.block); + visitNodeOrToken(this, node.body); } public visitSetAccessor(node: SetAccessorSyntax): void { @@ -703,7 +709,7 @@ module TypeScript.PrettyPrinter { visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature) this.ensureSpace(); - visitNodeOrToken(this, node.block); + visitNodeOrToken(this, node.body); } public visitMemberVariableDeclaration(node: MemberVariableDeclarationSyntax): void { @@ -936,7 +942,7 @@ module TypeScript.PrettyPrinter { visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature); this.ensureSpace(); - visitNodeOrToken(this, node.block); + visitNodeOrToken(this, node.body); } public visitFunctionExpression(node: FunctionExpressionSyntax): void { @@ -949,7 +955,7 @@ module TypeScript.PrettyPrinter { visitNodeOrToken(this, node.callSignature); this.ensureSpace(); - visitNodeOrToken(this, node.block); + visitNodeOrToken(this, node.body); } public visitEmptyStatement(node: EmptyStatementSyntax): void { diff --git a/src/services/syntax/scanner.ts b/src/services/syntax/scanner.ts index 54f05890e3e..14c73f2c6b4 100644 --- a/src/services/syntax/scanner.ts +++ b/src/services/syntax/scanner.ts @@ -281,7 +281,7 @@ module TypeScript.Scanner { LargeScannerToken.prototype.childCount = 0; export interface DiagnosticCallback { - (position: number, width: number, key: string, arguments: any[]): void; + (position: number, width: number, key: string, arguments?: any[]): void; } interface TokenInfo { @@ -1008,7 +1008,7 @@ module TypeScript.Scanner { while (true) { if (index === end) { // Hit the end of the file. - reportDiagnostic(end, 0, DiagnosticCode._0_expected, ["`"]); + reportDiagnostic(end, 0, DiagnosticCode.Unterminated_template_literal); break; } @@ -1144,10 +1144,7 @@ module TypeScript.Scanner { // term, and it sees one of these then it may restart us asking specifically if we could // scan out a regex. if (allowContextualToken) { - var result = tryScanRegularExpressionToken(); - if (result !== SyntaxKind.None) { - return result; - } + return scanRegularExpressionToken(); } if (str.charCodeAt(index) === CharacterCodes.equals) { @@ -1159,7 +1156,7 @@ module TypeScript.Scanner { } } - function tryScanRegularExpressionToken(): SyntaxKind { + function scanRegularExpressionToken(): SyntaxKind { var startIndex = index; var inEscape = false; @@ -1168,8 +1165,9 @@ module TypeScript.Scanner { var ch = str.charCodeAt(index); if (isNaN(ch) || isNewLineCharacter(ch)) { - index = startIndex; - return SyntaxKind.None; + // Hit the end of line, or end of the file. This is not a legal regex. + reportDiagnostic(index, 0, DiagnosticCode.Unterminated_regular_expression_literal); + break; } index++; @@ -1193,7 +1191,7 @@ module TypeScript.Scanner { continue; case CharacterCodes.closeBracket: - // If we ever hit a cloe bracket then we're now no longer in a character + // If we ever hit a close bracket then we're now no longer in a character // class. If we weren't in a character class to begin with, then this has // no effect. inCharacterClass = false; @@ -1219,7 +1217,7 @@ module TypeScript.Scanner { // TODO: The grammar says any identifier part is allowed here. Do we need to support // \u identifiers here? The existing typescript parser does not. - while (isIdentifierPartCharacter[str.charCodeAt(index)]) { + while (index < end && isIdentifierPartCharacter[str.charCodeAt(index)]) { index++; } @@ -1322,7 +1320,7 @@ module TypeScript.Scanner { break; } else if (isNaN(ch) || isNewLineCharacter(ch)) { - reportDiagnostic(Math.min(index, end), 1, DiagnosticCode.Missing_close_quote_character, undefined); + reportDiagnostic(index, 0, DiagnosticCode.Unterminated_string_literal); break; } else { @@ -1432,16 +1430,6 @@ module TypeScript.Scanner { return !hadError && SyntaxFacts.isIdentifierNameOrAnyKeyword(token) && width(token) === text.length(); } - // A parser source that gets its data from an underlying scanner. - export interface IScannerParserSource extends Parser.IParserSource { - // The position that the scanner is currently at. - absolutePosition(): number; - - // Resets the source to this position. Any diagnostics produced after this point will be - // removed. - resetToPosition(absolutePosition: number): void; - } - interface IScannerRewindPoint extends Parser.IRewindPoint { // Information used by normal parser source. absolutePosition: number; @@ -1451,7 +1439,7 @@ module TypeScript.Scanner { // Parser source used in batch scenarios. Directly calls into an underlying text scanner and // supports none of the functionality to reuse nodes. Good for when you just want want to do // a single parse of a file. - export function createParserSource(fileName: string, text: ISimpleText, languageVersion: ts.ScriptTarget): IScannerParserSource { + export function createParserSource(fileName: string, text: ISimpleText, languageVersion: ts.ScriptTarget): Parser.IParserSource { // The absolute position we're at in the text we're reading from. var _absolutePosition: number = 0; @@ -1491,11 +1479,6 @@ module TypeScript.Scanner { return undefined; } - function consumeNode(node: ISyntaxNode): void { - // Should never get called. - throw Errors.invalidOperation(); - } - function absolutePosition() { return _absolutePosition; } @@ -1563,13 +1546,20 @@ module TypeScript.Scanner { return slidingWindow.peekItemN(n); } - function consumeToken(token: ISyntaxToken): void { - // Debug.assert(token.fullWidth() > 0 || token.kind === SyntaxKind.EndOfFileToken); - - // Debug.assert(currentToken() === token); - _absolutePosition += token.fullWidth(); - - slidingWindow.moveToNextItem(); + function consumeNodeOrToken(nodeOrToken: ISyntaxNodeOrToken): void { + if (nodeOrToken === slidingWindow.currentItemWithoutFetching()) { + // We're consuming the token that was just fetched from us by the parser. We just + // need to move ourselves forward and ditch this token from the sliding window. + _absolutePosition += (nodeOrToken).fullWidth(); + slidingWindow.moveToNextItem(); + } + else { + // We're either consuming a node, or we're consuming a token that wasn't from our + // sliding window. Both cases happen in incremental scenarios when the incremental + // parser uses a node or token from an older tree. In that case, we simply want to + // point ourselves at the end of the element that the parser just consumed. + resetToPosition(fullEnd(nodeOrToken)); + } } function currentToken(): ISyntaxToken { @@ -1646,15 +1636,13 @@ module TypeScript.Scanner { currentToken: currentToken, currentContextualToken: currentContextualToken, peekToken: peekToken, - consumeNode: consumeNode, - consumeToken: consumeToken, + consumeNodeOrToken: consumeNodeOrToken, getRewindPoint: getRewindPoint, rewind: rewind, releaseRewindPoint: releaseRewindPoint, tokenDiagnostics: tokenDiagnostics, release: release, absolutePosition: absolutePosition, - resetToPosition: resetToPosition, }; } diff --git a/src/services/syntax/slidingWindow.ts b/src/services/syntax/slidingWindow.ts index 4bb79023f2f..39502be24f3 100644 --- a/src/services/syntax/slidingWindow.ts +++ b/src/services/syntax/slidingWindow.ts @@ -163,6 +163,14 @@ module TypeScript { return this.window[this.currentRelativeItemIndex]; } + public currentItemWithoutFetching(): any { + if (this.currentRelativeItemIndex >= this.windowCount) { + return undefined; + } + + return this.window[this.currentRelativeItemIndex]; + } + public peekItemN(n: number): any { // Assert disabled because it is actually expensive enugh to affect perf. // Debug.assert(n >= 0); diff --git a/src/services/syntax/syntaxElement.ts b/src/services/syntax/syntaxElement.ts index fe582db6b57..e14ecf33b69 100644 --- a/src/services/syntax/syntaxElement.ts +++ b/src/services/syntax/syntaxElement.ts @@ -17,40 +17,29 @@ module TypeScript { return undefined; } - export function parsedInStrictModeContext(node: ISyntaxNode): boolean { + export function parserContextFlags(node: ISyntaxNode): ParserContextFlags { var info = node.__data; if (info === undefined) { - return false; + return 0; } - return (info & SyntaxNodeConstants.ParsedInStrictModeContext) !== 0; + return info & ParserContextFlags.Mask; + } + + export function parsedInStrictModeContext(node: ISyntaxNode): boolean { + return (parserContextFlags(node) & ParserContextFlags.StrictMode) !== 0; } export function parsedInDisallowInContext(node: ISyntaxNode): boolean { - var info = node.__data; - if (info === undefined) { - return false; - } - - return (info & SyntaxNodeConstants.ParsedInDisallowInContext) !== 0; + return (parserContextFlags(node) & ParserContextFlags.DisallowIn) !== 0; } export function parsedInYieldContext(node: ISyntaxNode): boolean { - var info = node.__data; - if (info === undefined) { - return false; - } - - return (info & SyntaxNodeConstants.ParsedInYieldContext) !== 0; + return (parserContextFlags(node) & ParserContextFlags.Yield) !== 0; } export function parsedInGeneratorParameterContext(node: ISyntaxNode): boolean { - var info = node.__data; - if (info === undefined) { - return false; - } - - return (info & SyntaxNodeConstants.ParsedInGeneratorParameterContext) !== 0; + return (parserContextFlags(node) & ParserContextFlags.GeneratorParameter) !== 0; } export function previousToken(token: ISyntaxToken): ISyntaxToken { @@ -435,7 +424,7 @@ module TypeScript { modifiers: ISyntaxToken[]; propertyName: IPropertyNameSyntax; callSignature: CallSignatureSyntax; - block: BlockSyntax; + body: BlockSyntax | ExpressionBody | ISyntaxToken; } export interface ISwitchClauseSyntax extends ISyntaxNode { diff --git a/src/services/syntax/syntaxGenerator.ts b/src/services/syntax/syntaxGenerator.ts index 99218a04920..514a3220ab6 100644 --- a/src/services/syntax/syntaxGenerator.ts +++ b/src/services/syntax/syntaxGenerator.ts @@ -160,7 +160,15 @@ var definitions:ITypeDefinition[] = [ { name: 'asterixToken', isToken: true, isOptional: true }, { name: 'identifier', isToken: true }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'body', type: 'BlockSyntax | ISyntaxToken', isOptional: true } + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } + ] + }, + { + name: 'ExpressionBody', + baseType: 'ISyntaxNode', + children: [ + { name: 'equalsGreaterThanToken', isToken: true, }, + { name: 'expression', type: 'IExpressionSyntax' } ] }, { @@ -392,7 +400,8 @@ var definitions:ITypeDefinition[] = [ baseType: 'ISyntaxNode', interfaces: ['IStatementSyntax'], children: [ - { name: 'openBraceToken', isToken: true }, + { name: 'equalsGreaterThanToken', isToken: true, isOptional: 'true' }, + { name: 'openBraceToken', isToken: true, }, { name: 'statements', isList: true, elementType: 'IStatementSyntax' }, { name: 'closeBraceToken', isToken: true, excludeFromAST: true } ] @@ -435,7 +444,7 @@ var definitions:ITypeDefinition[] = [ children: [ { name: 'expression', type: 'ILeftHandSideExpressionSyntax' }, { name: 'openBracketToken', isToken: true, excludeFromAST: true }, - { name: 'argumentExpression', type: 'IExpressionSyntax' }, + { name: 'argumentExpression', type: 'IExpressionSyntax', isOptional: true }, { name: 'closeBracketToken', isToken: true, excludeFromAST: true } ] }, @@ -635,7 +644,7 @@ var definitions:ITypeDefinition[] = [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, { name: 'constructorKeyword', isToken: true }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'body', type: 'BlockSyntax | ISyntaxToken', isOptional: true } + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } ], isTypeScriptSpecific: true }, @@ -648,7 +657,7 @@ var definitions:ITypeDefinition[] = [ { name: 'asterixToken', isToken: true, isOptional: true }, { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'body', type: 'BlockSyntax | ISyntaxToken', isOptional: true } + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } ], isTypeScriptSpecific: true }, @@ -661,7 +670,7 @@ var definitions:ITypeDefinition[] = [ { name: 'getKeyword', isToken: true, excludeFromAST: true }, { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'block', type: 'BlockSyntax' } + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } ] }, { @@ -673,7 +682,7 @@ var definitions:ITypeDefinition[] = [ { name: 'setKeyword', isToken: true, excludeFromAST: true }, { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'block', type: 'BlockSyntax' } + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } ], isTypeScriptSpecific: true }, @@ -705,7 +714,7 @@ var definitions:ITypeDefinition[] = [ interfaces: ['IStatementSyntax'], children: [ { name: 'throwKeyword', isToken: true, excludeFromAST: true }, - { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'expression', type: 'IExpressionSyntax', isOptional: true }, { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } ] }, @@ -910,7 +919,7 @@ var definitions:ITypeDefinition[] = [ { name: 'asterixToken', isToken: true, isOptional: true }, { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'block', type: 'BlockSyntax' } + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true } ] }, { @@ -922,7 +931,7 @@ var definitions:ITypeDefinition[] = [ { name: 'asterixToken', isToken: true, isOptional: true }, { name: 'identifier', isToken: true, isOptional: true }, { name: 'callSignature', type: 'CallSignatureSyntax' }, - { name: 'block', type: 'BlockSyntax' }] + { name: 'body', type: 'BlockSyntax | ExpressionBody | ISyntaxToken', isOptional: true }] }, { name: 'EmptyStatementSyntax', diff --git a/src/services/syntax/syntaxInterfaces.generated.ts b/src/services/syntax/syntaxInterfaces.generated.ts index acb2f283902..6ca28f1b819 100644 --- a/src/services/syntax/syntaxInterfaces.generated.ts +++ b/src/services/syntax/syntaxInterfaces.generated.ts @@ -95,9 +95,9 @@ module TypeScript { asterixToken: ISyntaxToken; identifier: ISyntaxToken; callSignature: CallSignatureSyntax; - body: BlockSyntax | ISyntaxToken; + body: BlockSyntax | ExpressionBody | ISyntaxToken; } - export interface FunctionDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ISyntaxToken): FunctionDeclarationSyntax } + export interface FunctionDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): FunctionDeclarationSyntax } export interface ModuleDeclarationSyntax extends ISyntaxNode, IModuleElementSyntax { modifiers: ISyntaxToken[]; @@ -154,9 +154,9 @@ module TypeScript { asterixToken: ISyntaxToken; propertyName: IPropertyNameSyntax; callSignature: CallSignatureSyntax; - body: BlockSyntax | ISyntaxToken; + body: BlockSyntax | ExpressionBody | ISyntaxToken; } - export interface MemberFunctionDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ISyntaxToken): MemberFunctionDeclarationSyntax } + export interface MemberFunctionDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): MemberFunctionDeclarationSyntax } export interface MemberVariableDeclarationSyntax extends ISyntaxNode, IMemberDeclarationSyntax { modifiers: ISyntaxToken[]; @@ -169,9 +169,9 @@ module TypeScript { modifiers: ISyntaxToken[]; constructorKeyword: ISyntaxToken; callSignature: CallSignatureSyntax; - body: BlockSyntax | ISyntaxToken; + body: BlockSyntax | ExpressionBody | ISyntaxToken; } - export interface ConstructorDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ISyntaxToken): ConstructorDeclarationSyntax } + export interface ConstructorDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): ConstructorDeclarationSyntax } export interface IndexMemberDeclarationSyntax extends ISyntaxNode, IClassElementSyntax { modifiers: ISyntaxToken[]; @@ -185,18 +185,18 @@ module TypeScript { getKeyword: ISyntaxToken; propertyName: IPropertyNameSyntax; callSignature: CallSignatureSyntax; - block: BlockSyntax; + body: BlockSyntax | ExpressionBody | ISyntaxToken; } - export interface GetAccessorConstructor { new (data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax): GetAccessorSyntax } + export interface GetAccessorConstructor { new (data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): GetAccessorSyntax } export interface SetAccessorSyntax extends ISyntaxNode, IAccessorSyntax { modifiers: ISyntaxToken[]; setKeyword: ISyntaxToken; propertyName: IPropertyNameSyntax; callSignature: CallSignatureSyntax; - block: BlockSyntax; + body: BlockSyntax | ExpressionBody | ISyntaxToken; } - export interface SetAccessorConstructor { new (data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax): SetAccessorSyntax } + export interface SetAccessorConstructor { new (data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): SetAccessorSyntax } export interface PropertySignatureSyntax extends ISyntaxNode, ITypeMemberSyntax { propertyName: IPropertyNameSyntax; @@ -234,11 +234,12 @@ module TypeScript { export interface MethodSignatureConstructor { new (data: number, propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax): MethodSignatureSyntax } export interface BlockSyntax extends ISyntaxNode, IStatementSyntax { + equalsGreaterThanToken: ISyntaxToken; openBraceToken: ISyntaxToken; statements: IStatementSyntax[]; closeBraceToken: ISyntaxToken; } - export interface BlockConstructor { new (data: number, openBraceToken: ISyntaxToken, statements: IStatementSyntax[], closeBraceToken: ISyntaxToken): BlockSyntax } + export interface BlockConstructor { new (data: number, equalsGreaterThanToken: ISyntaxToken, openBraceToken: ISyntaxToken, statements: IStatementSyntax[], closeBraceToken: ISyntaxToken): BlockSyntax } export interface IfStatementSyntax extends ISyntaxNode, IStatementSyntax { ifKeyword: ISyntaxToken; @@ -503,9 +504,9 @@ module TypeScript { asterixToken: ISyntaxToken; identifier: ISyntaxToken; callSignature: CallSignatureSyntax; - block: BlockSyntax; + body: BlockSyntax | ExpressionBody | ISyntaxToken; } - export interface FunctionExpressionConstructor { new (data: number, functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): FunctionExpressionSyntax } + export interface FunctionExpressionConstructor { new (data: number, functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): FunctionExpressionSyntax } export interface OmittedExpressionSyntax extends ISyntaxNode, IExpressionSyntax { } @@ -650,9 +651,9 @@ module TypeScript { asterixToken: ISyntaxToken; propertyName: IPropertyNameSyntax; callSignature: CallSignatureSyntax; - block: BlockSyntax; + body: BlockSyntax | ExpressionBody | ISyntaxToken; } - export interface FunctionPropertyAssignmentConstructor { new (data: number, asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax): FunctionPropertyAssignmentSyntax } + export interface FunctionPropertyAssignmentConstructor { new (data: number, asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): FunctionPropertyAssignmentSyntax } export interface ParameterSyntax extends ISyntaxNode { dotDotDotToken: ISyntaxToken; @@ -676,6 +677,12 @@ module TypeScript { } export interface TypeAnnotationConstructor { new (data: number, colonToken: ISyntaxToken, type: ITypeSyntax): TypeAnnotationSyntax } + export interface ExpressionBody extends ISyntaxNode { + equalsGreaterThanToken: ISyntaxToken; + expression: IExpressionSyntax; + } + export interface ExpressionBodyConstructor { new (data: number, equalsGreaterThanToken: ISyntaxToken, expression: IExpressionSyntax): ExpressionBody } + export interface ComputedPropertyNameSyntax extends ISyntaxNode, IPropertyNameSyntax { openBracketToken: ISyntaxToken; expression: IExpressionSyntax; diff --git a/src/services/syntax/syntaxKind.ts b/src/services/syntax/syntaxKind.ts index 947f23b137f..896a3239146 100644 --- a/src/services/syntax/syntaxKind.ts +++ b/src/services/syntax/syntaxKind.ts @@ -268,6 +268,7 @@ module TypeScript { Parameter, EnumElement, TypeAnnotation, + ExpressionBody, ComputedPropertyName, ExternalModuleReference, ModuleNameModuleReference, diff --git a/src/services/syntax/syntaxList.ts b/src/services/syntax/syntaxList.ts index 4b11518c239..aa6d8112952 100644 --- a/src/services/syntax/syntaxList.ts +++ b/src/services/syntax/syntaxList.ts @@ -38,7 +38,7 @@ module TypeScript { module TypeScript.Syntax { function addArrayPrototypeValue(name: string, val: any) { if (Object.defineProperty && (Array.prototype)[name] === undefined) { - Object.defineProperty(Array.prototype, name, { value: val, writable: false }); + Object.defineProperty(Array.prototype, name, { value: val, writable: false, enumerable: false }); } else { (Array.prototype)[name] = val; diff --git a/src/services/syntax/syntaxNodes.concrete.generated.ts b/src/services/syntax/syntaxNodes.concrete.generated.ts index e87e7e1e2b7..7e35716659d 100644 --- a/src/services/syntax/syntaxNodes.concrete.generated.ts +++ b/src/services/syntax/syntaxNodes.concrete.generated.ts @@ -238,7 +238,7 @@ module TypeScript { } } - export var FunctionDeclarationSyntax: FunctionDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ISyntaxToken) { + export var FunctionDeclarationSyntax: FunctionDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) { if (data) { this.__data = data; } this.modifiers = modifiers, this.functionKeyword = functionKeyword, @@ -406,7 +406,7 @@ module TypeScript { } } - export var MemberFunctionDeclarationSyntax: MemberFunctionDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ISyntaxToken) { + export var MemberFunctionDeclarationSyntax: MemberFunctionDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) { if (data) { this.__data = data; } this.modifiers = modifiers, this.asterixToken = asterixToken, @@ -450,7 +450,7 @@ module TypeScript { } } - export var ConstructorDeclarationSyntax: ConstructorDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ISyntaxToken) { + export var ConstructorDeclarationSyntax: ConstructorDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) { if (data) { this.__data = data; } this.modifiers = modifiers, this.constructorKeyword = constructorKeyword, @@ -491,18 +491,18 @@ module TypeScript { } } - export var GetAccessorSyntax: GetAccessorConstructor = function(data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax) { + export var GetAccessorSyntax: GetAccessorConstructor = function(data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) { if (data) { this.__data = data; } this.modifiers = modifiers, this.getKeyword = getKeyword, this.propertyName = propertyName, this.callSignature = callSignature, - this.block = block, + this.body = body, modifiers.parent = this, getKeyword.parent = this, propertyName.parent = this, callSignature.parent = this, - block.parent = this; + body && (body.parent = this); }; GetAccessorSyntax.prototype.kind = SyntaxKind.GetAccessor; GetAccessorSyntax.prototype.childCount = 5; @@ -512,22 +512,22 @@ module TypeScript { case 1: return this.getKeyword; case 2: return this.propertyName; case 3: return this.callSignature; - case 4: return this.block; + case 4: return this.body; } } - export var SetAccessorSyntax: SetAccessorConstructor = function(data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax) { + export var SetAccessorSyntax: SetAccessorConstructor = function(data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) { if (data) { this.__data = data; } this.modifiers = modifiers, this.setKeyword = setKeyword, this.propertyName = propertyName, this.callSignature = callSignature, - this.block = block, + this.body = body, modifiers.parent = this, setKeyword.parent = this, propertyName.parent = this, callSignature.parent = this, - block.parent = this; + body && (body.parent = this); }; SetAccessorSyntax.prototype.kind = SyntaxKind.SetAccessor; SetAccessorSyntax.prototype.childCount = 5; @@ -537,7 +537,7 @@ module TypeScript { case 1: return this.setKeyword; case 2: return this.propertyName; case 3: return this.callSignature; - case 4: return this.block; + case 4: return this.body; } } @@ -636,22 +636,25 @@ module TypeScript { } } - export var BlockSyntax: BlockConstructor = function(data: number, openBraceToken: ISyntaxToken, statements: IStatementSyntax[], closeBraceToken: ISyntaxToken) { + export var BlockSyntax: BlockConstructor = function(data: number, equalsGreaterThanToken: ISyntaxToken, openBraceToken: ISyntaxToken, statements: IStatementSyntax[], closeBraceToken: ISyntaxToken) { if (data) { this.__data = data; } + this.equalsGreaterThanToken = equalsGreaterThanToken, this.openBraceToken = openBraceToken, this.statements = statements, this.closeBraceToken = closeBraceToken, + equalsGreaterThanToken && (equalsGreaterThanToken.parent = this), openBraceToken.parent = this, statements.parent = this, closeBraceToken.parent = this; }; BlockSyntax.prototype.kind = SyntaxKind.Block; - BlockSyntax.prototype.childCount = 3; + BlockSyntax.prototype.childCount = 4; BlockSyntax.prototype.childAt = function(index: number): ISyntaxElement { switch (index) { - case 0: return this.openBraceToken; - case 1: return this.statements; - case 2: return this.closeBraceToken; + case 0: return this.equalsGreaterThanToken; + case 1: return this.openBraceToken; + case 2: return this.statements; + case 3: return this.closeBraceToken; } } @@ -893,7 +896,7 @@ module TypeScript { this.expression = expression, this.semicolonToken = semicolonToken, throwKeyword.parent = this, - expression.parent = this, + expression && (expression.parent = this), semicolonToken && (semicolonToken.parent = this); }; ThrowStatementSyntax.prototype.kind = SyntaxKind.ThrowStatement; @@ -1347,7 +1350,7 @@ module TypeScript { this.closeBracketToken = closeBracketToken, expression.parent = this, openBracketToken.parent = this, - argumentExpression.parent = this, + argumentExpression && (argumentExpression.parent = this), closeBracketToken.parent = this; }; ElementAccessExpressionSyntax.prototype.kind = SyntaxKind.ElementAccessExpression; @@ -1361,18 +1364,18 @@ module TypeScript { } } - export var FunctionExpressionSyntax: FunctionExpressionConstructor = function(data: number, functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { + export var FunctionExpressionSyntax: FunctionExpressionConstructor = function(data: number, functionKeyword: ISyntaxToken, asterixToken: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) { if (data) { this.__data = data; } this.functionKeyword = functionKeyword, this.asterixToken = asterixToken, this.identifier = identifier, this.callSignature = callSignature, - this.block = block, + this.body = body, functionKeyword.parent = this, asterixToken && (asterixToken.parent = this), identifier && (identifier.parent = this), callSignature.parent = this, - block.parent = this; + body && (body.parent = this); }; FunctionExpressionSyntax.prototype.kind = SyntaxKind.FunctionExpression; FunctionExpressionSyntax.prototype.childCount = 5; @@ -1382,7 +1385,7 @@ module TypeScript { case 1: return this.asterixToken; case 2: return this.identifier; case 3: return this.callSignature; - case 4: return this.block; + case 4: return this.body; } } @@ -1760,16 +1763,16 @@ module TypeScript { } } - export var FunctionPropertyAssignmentSyntax: FunctionPropertyAssignmentConstructor = function(data: number, asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax) { + export var FunctionPropertyAssignmentSyntax: FunctionPropertyAssignmentConstructor = function(data: number, asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) { if (data) { this.__data = data; } this.asterixToken = asterixToken, this.propertyName = propertyName, this.callSignature = callSignature, - this.block = block, + this.body = body, asterixToken && (asterixToken.parent = this), propertyName.parent = this, callSignature.parent = this, - block.parent = this; + body && (body.parent = this); }; FunctionPropertyAssignmentSyntax.prototype.kind = SyntaxKind.FunctionPropertyAssignment; FunctionPropertyAssignmentSyntax.prototype.childCount = 4; @@ -1778,7 +1781,7 @@ module TypeScript { case 0: return this.asterixToken; case 1: return this.propertyName; case 2: return this.callSignature; - case 3: return this.block; + case 3: return this.body; } } @@ -1842,6 +1845,22 @@ module TypeScript { } } + export var ExpressionBody: ExpressionBodyConstructor = function(data: number, equalsGreaterThanToken: ISyntaxToken, expression: IExpressionSyntax) { + if (data) { this.__data = data; } + this.equalsGreaterThanToken = equalsGreaterThanToken, + this.expression = expression, + equalsGreaterThanToken.parent = this, + expression.parent = this; + }; + ExpressionBody.prototype.kind = SyntaxKind.ExpressionBody; + ExpressionBody.prototype.childCount = 2; + ExpressionBody.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.equalsGreaterThanToken; + case 1: return this.expression; + } + } + export var ComputedPropertyNameSyntax: ComputedPropertyNameConstructor = function(data: number, openBracketToken: ISyntaxToken, expression: IExpressionSyntax, closeBracketToken: ISyntaxToken) { if (data) { this.__data = data; } this.openBracketToken = openBracketToken, diff --git a/src/services/syntax/syntaxToken.ts b/src/services/syntax/syntaxToken.ts index 6b6854cd08e..9ddbc3a800c 100644 --- a/src/services/syntax/syntaxToken.ts +++ b/src/services/syntax/syntaxToken.ts @@ -290,8 +290,8 @@ module TypeScript.Syntax { return new RealizedToken(token.fullStart(), token.kind, token.isKeywordConvertedToIdentifier(), leadingTrivia, token.text()); } - export function emptyToken(kind: SyntaxKind): ISyntaxToken { - return new EmptyToken(kind); + export function emptyToken(kind: SyntaxKind, fullStart: number): ISyntaxToken { + return new EmptyToken(kind, fullStart); } class EmptyToken implements ISyntaxToken { @@ -300,17 +300,17 @@ module TypeScript.Syntax { public parent: ISyntaxElement; public childCount: number; - constructor(public kind: SyntaxKind) { + constructor(public kind: SyntaxKind, private _fullStart: number) { } public setFullStart(fullStart: number): void { - // An empty token is always at the -1 position. + this._fullStart = fullStart; } public childAt(index: number): ISyntaxElement { throw Errors.invalidOperation() } public clone(): ISyntaxToken { - return new EmptyToken(this.kind); + return new EmptyToken(this.kind, this._fullStart); } // Empty tokens are never incrementally reusable. @@ -321,75 +321,7 @@ module TypeScript.Syntax { } public fullWidth() { return 0; } - - private position(): number { - // It's hard for us to tell the position of an empty token at the eact time we create - // it. For example, we may have: - // - // a / finally - // - // There will be a missing token detected after the forward slash, so it would be - // tempting to set its position as the full-end of hte slash token. However, - // immediately after that, the 'finally' token will be skipped and will be attached - // as skipped text to the forward slash. This means the 'full-end' of the forward - // slash will change, and thus the empty token will now appear to be embedded inside - // another token. This violates are rule that all tokens must only touch at the end, - // and makes enforcing invariants much harder. - // - // To address this we create the empty token with no known position, and then we - // determine what it's position should be based on where it lies in the tree. - // Specifically, we find the previous non-zero-width syntax element, and we consider - // the full-start of this token to be at the full-end of that element. - - var previousElement = this.previousNonZeroWidthElement(); - return !previousElement ? 0 : fullStart(previousElement) + fullWidth(previousElement); - } - - private previousNonZeroWidthElement(): ISyntaxElement { - var current: ISyntaxElement = this; - while (true) { - var parent = current.parent; - if (parent === undefined) { - Debug.assert(current.kind === SyntaxKind.SourceUnit, "We had a node without a parent that was not the root node!"); - - // We walked all the way to the top, and never found a previous element. This - // can happen with code like: - // - // / b; - // - // We will have an empty identifier token as the first token in the tree. In - // this case, return undefined so that the position of the empty token will be - // considered to be 0. - return undefined; - } - - // Ok. We have a parent. First, find out which slot we're at in the parent. - for (var i = 0, n = childCount(parent); i < n; i++) { - if (childAt(parent, i) === current) { - break; - } - } - - Debug.assert(i !== n, "Could not find current element in parent's child list!"); - - // Walk backward from this element, looking for a non-zero-width sibling. - for (var j = i - 1; j >= 0; j--) { - var sibling = childAt(parent, j); - if (sibling && fullWidth(sibling) > 0) { - return sibling; - } - } - - // We couldn't find a non-zero-width sibling. We were either the first element, or - // all preceding elements are empty. So, move up to our parent so we we can find - // its preceding sibling. - current = current.parent; - } - } - - public fullStart(): number { - return this.position(); - } + public fullStart(): number { return this._fullStart; } public text() { return ""; } public fullText(): string { return ""; } diff --git a/src/services/syntax/syntaxTree.ts b/src/services/syntax/syntaxTree.ts index c21b741025d..cf20d2b1c75 100644 --- a/src/services/syntax/syntaxTree.ts +++ b/src/services/syntax/syntaxTree.ts @@ -138,8 +138,12 @@ module TypeScript { } private pushDiagnostic(element: ISyntaxElement, diagnosticKey: string, args?: any[]): void { + this.pushDiagnosticAt(start(element, this.text), width(element), diagnosticKey, args); + } + + private pushDiagnosticAt(start: number, length: number, diagnosticKey: string, args?: any[]): void { this.diagnostics.push(new Diagnostic( - this.syntaxTree.fileName(), this.syntaxTree.lineMap(), start(element, this.text), width(element), diagnosticKey, args)); + this.syntaxTree.fileName(), this.syntaxTree.lineMap(), start, length, diagnosticKey, args)); } public visitCatchClause(node: CatchClauseSyntax): void { @@ -631,13 +635,27 @@ module TypeScript { this.checkClassElementModifiers(node.modifiers) || this.checkForDisallowedAccessorTypeParameters(node.callSignature) || this.checkGetAccessorParameter(node) || - this.checkForDisallowedTemplatePropertyName(node.propertyName)) { + this.checkForDisallowedTemplatePropertyName(node.propertyName) || + this.checkForSemicolonInsteadOfBlock(node, node.body)) { return; } super.visitGetAccessor(node); } + private checkForSemicolonInsteadOfBlock(parent: ISyntaxNode, node: BlockSyntax | ExpressionBody | ISyntaxToken): boolean { + if (node === undefined) { + this.pushDiagnosticAt(fullEnd(parent), 0, DiagnosticCode._0_expected, ["{"]); + return true; + } + else if (node.kind === SyntaxKind.SemicolonToken) { + this.pushDiagnostic(node, DiagnosticCode._0_expected, ["{"]); + return true; + } + + return false; + } + private checkForDisallowedSetAccessorTypeAnnotation(accessor: SetAccessorSyntax): boolean { if (accessor.callSignature.typeAnnotation) { this.pushDiagnostic(accessor.callSignature.typeAnnotation, DiagnosticCode.Type_annotation_cannot_appear_on_a_set_accessor); @@ -708,13 +726,41 @@ module TypeScript { this.checkForDisallowedAccessorTypeParameters(node.callSignature) || this.checkForDisallowedSetAccessorTypeAnnotation(node) || this.checkSetAccessorParameter(node) || - this.checkForDisallowedTemplatePropertyName(node.propertyName)) { + this.checkForDisallowedTemplatePropertyName(node.propertyName) || + this.checkForSemicolonInsteadOfBlock(node, node.body)) { return; } super.visitSetAccessor(node); } + public visitElementAccessExpression(node: ElementAccessExpressionSyntax): void { + if (this.checkForMissingArgumentExpression(node)) { + return; + } + + super.visitElementAccessExpression(node); + } + + public checkForMissingArgumentExpression(node: ElementAccessExpressionSyntax): boolean { + if (node.argumentExpression === undefined) { + if (node.parent.kind === SyntaxKind.ObjectCreationExpression && (node.parent).expression === node) { + // Provide a specialized message for the very common case where someone writes: + // new Foo[] + var start = TypeScript.start(node.openBracketToken); + var end = TypeScript.fullEnd(node.closeBracketToken); + this.pushDiagnosticAt(start, end - start, DiagnosticCode.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); + } + else { + this.pushDiagnostic(node.closeBracketToken, DiagnosticCode.Expression_expected); + } + + return true; + } + + return false; + } + public visitEnumDeclaration(node: EnumDeclarationSyntax): void { if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.identifier, node.modifiers) || @@ -887,7 +933,8 @@ module TypeScript { } public visitBlock(node: BlockSyntax): void { - if (this.checkForBlockInAmbientContext(node)) { + if (this.checkForBlockInAmbientContext(node) || + this.checkForMalformedBlock(node)) { return; } @@ -897,6 +944,15 @@ module TypeScript { this.inBlock = savedInBlock; } + public checkForMalformedBlock(node: BlockSyntax): boolean { + if (node.equalsGreaterThanToken || node.openBraceToken === undefined) { + this.pushDiagnostic(firstToken(node), DiagnosticCode._0_expected, ["{"]); + return true; + } + + return false; + } + private checkForBlockInAmbientContext(node: BlockSyntax): boolean { if (this.inAmbientDeclaration || this.syntaxTree.isDeclaration()) { // Provide a specialized message for a block as a statement versus the block as a @@ -923,6 +979,11 @@ module TypeScript { return false; } + public visitExpressionBody(node: ExpressionBody): void { + // These are always errors. So no need to ever recurse on them. + this.pushDiagnostic(node.equalsGreaterThanToken, DiagnosticCode._0_expected, ["{"]); + } + public visitBreakStatement(node: BreakStatementSyntax): void { if (this.checkForStatementInAmbientContxt(node) || this.checkBreakStatementTarget(node)) { @@ -1264,13 +1325,23 @@ module TypeScript { } public visitThrowStatement(node: ThrowStatementSyntax): void { - if (this.checkForStatementInAmbientContxt(node)) { + if (this.checkForStatementInAmbientContxt(node) || + this.checkForMissingThrowStatementExpression(node)) { return; } super.visitThrowStatement(node); } + public checkForMissingThrowStatementExpression(node: ThrowStatementSyntax): boolean { + if (node.expression === undefined) { + this.pushDiagnosticAt(fullEnd(node.throwKeyword), 0, DiagnosticCode.Expression_expected); + return true; + } + + return false; + } + public visitTryStatement(node: TryStatementSyntax): void { if (this.checkForStatementInAmbientContxt(node)) { return; @@ -1333,7 +1404,8 @@ module TypeScript { } public visitFunctionExpression(node: FunctionExpressionSyntax): void { - if (this.checkForDisallowedEvalOrArguments(node, node.identifier)) { + if (this.checkForDisallowedEvalOrArguments(node, node.identifier) || + this.checkForSemicolonInsteadOfBlock(node, node.body)) { return; } @@ -1341,7 +1413,8 @@ module TypeScript { } public visitFunctionPropertyAssignment(node: FunctionPropertyAssignmentSyntax): void { - if (this.checkForDisallowedTemplatePropertyName(node.propertyName)) { + if (this.checkForDisallowedTemplatePropertyName(node.propertyName) || + this.checkForSemicolonInsteadOfBlock(node, node.body)) { return; } diff --git a/src/services/syntax/syntaxVisitor.generated.ts b/src/services/syntax/syntaxVisitor.generated.ts index 57cea0cbe95..2fbc2ccd0b8 100644 --- a/src/services/syntax/syntaxVisitor.generated.ts +++ b/src/services/syntax/syntaxVisitor.generated.ts @@ -94,6 +94,7 @@ module TypeScript { case SyntaxKind.Parameter: return visitor.visitParameter(element); case SyntaxKind.EnumElement: return visitor.visitEnumElement(element); case SyntaxKind.TypeAnnotation: return visitor.visitTypeAnnotation(element); + case SyntaxKind.ExpressionBody: return visitor.visitExpressionBody(element); case SyntaxKind.ComputedPropertyName: return visitor.visitComputedPropertyName(element); case SyntaxKind.ExternalModuleReference: return visitor.visitExternalModuleReference(element); case SyntaxKind.ModuleNameModuleReference: return visitor.visitModuleNameModuleReference(element); @@ -193,6 +194,7 @@ module TypeScript { visitParameter(node: ParameterSyntax): any; visitEnumElement(node: EnumElementSyntax): any; visitTypeAnnotation(node: TypeAnnotationSyntax): any; + visitExpressionBody(node: ExpressionBody): any; visitComputedPropertyName(node: ComputedPropertyNameSyntax): any; visitExternalModuleReference(node: ExternalModuleReferenceSyntax): any; visitModuleNameModuleReference(node: ModuleNameModuleReferenceSyntax): any; diff --git a/src/services/syntax/syntaxWalker.generated.ts b/src/services/syntax/syntaxWalker.generated.ts index 7a095aec157..a9b03349102 100644 --- a/src/services/syntax/syntaxWalker.generated.ts +++ b/src/services/syntax/syntaxWalker.generated.ts @@ -180,7 +180,7 @@ module TypeScript { this.visitToken(node.getKeyword); visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature); - visitNodeOrToken(this, node.block); + visitNodeOrToken(this, node.body); } public visitSetAccessor(node: SetAccessorSyntax): void { @@ -188,7 +188,7 @@ module TypeScript { this.visitToken(node.setKeyword); visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature); - visitNodeOrToken(this, node.block); + visitNodeOrToken(this, node.body); } public visitPropertySignature(node: PropertySignatureSyntax): void { @@ -222,6 +222,7 @@ module TypeScript { } public visitBlock(node: BlockSyntax): void { + this.visitOptionalToken(node.equalsGreaterThanToken); this.visitToken(node.openBraceToken); this.visitList(node.statements); this.visitToken(node.closeBraceToken); @@ -456,7 +457,7 @@ module TypeScript { this.visitOptionalToken(node.asterixToken); this.visitOptionalToken(node.identifier); visitNodeOrToken(this, node.callSignature); - visitNodeOrToken(this, node.block); + visitNodeOrToken(this, node.body); } public visitOmittedExpression(node: OmittedExpressionSyntax): void { @@ -581,7 +582,7 @@ module TypeScript { this.visitOptionalToken(node.asterixToken); visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature); - visitNodeOrToken(this, node.block); + visitNodeOrToken(this, node.body); } public visitParameter(node: ParameterSyntax): void { @@ -603,6 +604,11 @@ module TypeScript { visitNodeOrToken(this, node.type); } + public visitExpressionBody(node: ExpressionBody): void { + this.visitToken(node.equalsGreaterThanToken); + visitNodeOrToken(this, node.expression); + } + public visitComputedPropertyName(node: ComputedPropertyNameSyntax): void { this.visitToken(node.openBracketToken); visitNodeOrToken(this, node.expression); diff --git a/src/services/text.ts b/src/services/text.ts new file mode 100644 index 00000000000..fd768785dea --- /dev/null +++ b/src/services/text.ts @@ -0,0 +1,296 @@ +module ts { + export class TextSpan { + private _start: number; + private _length: number; + + /** + * Creates a TextSpan instance beginning with the position Start and having the Length + * specified with length. + */ + constructor(start: number, length: number) { + Debug.assert(start >= 0, "start"); + Debug.assert(length >= 0, "length"); + + this._start = start; + this._length = length; + } + + public toJSON(key: any): any { + return { start: this._start, length: this._length }; + } + + public start(): number { + return this._start; + } + + public length(): number { + return this._length; + } + + public end(): number { + return this._start + this._length; + } + + public isEmpty(): boolean { + return this._length === 0; + } + + /** + * Determines whether the position lies within the span. Returns true if the position is greater than or equal to Start and strictly less + * than End, otherwise false. + * @param position The position to check. + */ + public containsPosition(position: number): boolean { + return position >= this._start && position < this.end(); + } + + /** + * Determines whether span falls completely within this span. Returns true if the specified span falls completely within this span, otherwise false. + * @param span The span to check. + */ + public containsTextSpan(span: TextSpan): boolean { + return span._start >= this._start && span.end() <= this.end(); + } + + /** + * Determines whether the given span overlaps this span. Two spans are considered to overlap + * if they have positions in common and neither is empty. Empty spans do not overlap with any + * other span. Returns true if the spans overlap, false otherwise. + * @param span The span to check. + */ + public overlapsWith(span: TextSpan): boolean { + var overlapStart = Math.max(this._start, span._start); + var overlapEnd = Math.min(this.end(), span.end()); + + return overlapStart < overlapEnd; + } + + /** + * Returns the overlap with the given span, or undefined if there is no overlap. + * @param span The span to check. + */ + public overlap(span: TextSpan): TextSpan { + var overlapStart = Math.max(this._start, span._start); + var overlapEnd = Math.min(this.end(), span.end()); + + if (overlapStart < overlapEnd) { + return TextSpan.fromBounds(overlapStart, overlapEnd); + } + + return undefined; + } + + /** + * Determines whether span intersects this span. Two spans are considered to + * intersect if they have positions in common or the end of one span + * coincides with the start of the other span. Returns true if the spans intersect, false otherwise. + * @param The span to check. + */ + public intersectsWithTextSpan(span: TextSpan): boolean { + return span._start <= this.end() && span.end() >= this._start; + } + + public intersectsWith(start: number, length: number): boolean { + var end = start + length; + return start <= this.end() && end >= this._start; + } + + /** + * Determines whether the given position intersects this span. + * A position is considered to intersect if it is between the start and + * end positions (inclusive) of this span. Returns true if the position intersects, false otherwise. + * @param position The position to check. + */ + public intersectsWithPosition(position: number): boolean { + return position <= this.end() && position >= this._start; + } + + /** + * Returns the intersection with the given span, or undefined if there is no intersection. + * @param span The span to check. + */ + public intersection(span: TextSpan): TextSpan { + var intersectStart = Math.max(this._start, span._start); + var intersectEnd = Math.min(this.end(), span.end()); + + if (intersectStart <= intersectEnd) { + return TextSpan.fromBounds(intersectStart, intersectEnd); + } + + return undefined; + } + + /** + * Creates a new TextSpan from the given start and end positions + * as opposed to a position and length. + */ + public static fromBounds(start: number, end: number): TextSpan { + Debug.assert(start >= 0); + Debug.assert(end - start >= 0); + return new TextSpan(start, end - start); + } + } + + export class TextChangeRange { + public static unchanged = new TextChangeRange(new TextSpan(0, 0), 0); + + private _span: TextSpan; + private _newLength: number; + + /** + * Initializes a new instance of TextChangeRange. + */ + constructor(span: TextSpan, newLength: number) { + Debug.assert(newLength >= 0, "newLength"); + + this._span = span; + this._newLength = newLength; + } + + /** + * The span of text before the edit which is being changed + */ + public span(): TextSpan { + return this._span; + } + + /** + * Width of the span after the edit. A 0 here would represent a delete + */ + public newLength(): number { + return this._newLength; + } + + public newSpan(): TextSpan { + return new TextSpan(this.span().start(), this.newLength()); + } + + public isUnchanged(): boolean { + return this.span().isEmpty() && this.newLength() === 0; + } + + /** + * Called to merge all the changes that occurred across several versions of a script snapshot + * into a single change. i.e. if a user keeps making successive edits to a script we will + * have a text change from V1 to V2, V2 to V3, ..., Vn. + * + * This function will then merge those changes into a single change range valid between V1 and + * Vn. + */ + public static collapseChangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange { + if (changes.length === 0) { + return TextChangeRange.unchanged; + } + + if (changes.length === 1) { + return changes[0]; + } + + // We change from talking about { { oldStart, oldLength }, newLength } to { oldStart, oldEnd, newEnd } + // as it makes things much easier to reason about. + var change0 = changes[0]; + + var oldStartN = change0.span().start(); + var oldEndN = change0.span().end(); + var newEndN = oldStartN + change0.newLength(); + + for (var i = 1; i < changes.length; i++) { + var nextChange = changes[i]; + + // Consider the following case: + // i.e. two edits. The first represents the text change range { { 10, 50 }, 30 }. i.e. The span starting + // at 10, with length 50 is reduced to length 30. The second represents the text change range { { 30, 30 }, 40 }. + // i.e. the span starting at 30 with length 30 is increased to length 40. + // + // 0 10 20 30 40 50 60 70 80 90 100 + // ------------------------------------------------------------------------------------------------------- + // | / + // | /---- + // T1 | /---- + // | /---- + // | /---- + // ------------------------------------------------------------------------------------------------------- + // | \ + // | \ + // T2 | \ + // | \ + // | \ + // ------------------------------------------------------------------------------------------------------- + // + // Merging these turns out to not be too difficult. First, determining the new start of the change is trivial + // it's just the min of the old and new starts. i.e.: + // + // 0 10 20 30 40 50 60 70 80 90 100 + // ------------------------------------------------------------*------------------------------------------ + // | / + // | /---- + // T1 | /---- + // | /---- + // | /---- + // ----------------------------------------$-------------------$------------------------------------------ + // . | \ + // . | \ + // T2 . | \ + // . | \ + // . | \ + // ----------------------------------------------------------------------*-------------------------------- + // + // (Note the dots represent the newly inferrred start. + // Determining the new and old end is also pretty simple. Basically it boils down to paying attention to the + // absolute positions at the asterixes, and the relative change between the dollar signs. Basically, we see + // which if the two $'s precedes the other, and we move that one forward until they line up. in this case that + // means: + // + // 0 10 20 30 40 50 60 70 80 90 100 + // --------------------------------------------------------------------------------*---------------------- + // | / + // | /---- + // T1 | /---- + // | /---- + // | /---- + // ------------------------------------------------------------$------------------------------------------ + // . | \ + // . | \ + // T2 . | \ + // . | \ + // . | \ + // ----------------------------------------------------------------------*-------------------------------- + // + // In other words (in this case), we're recognizing that the second edit happened after where the first edit + // ended with a delta of 20 characters (60 - 40). Thus, if we go back in time to where the first edit started + // that's the same as if we started at char 80 instead of 60. + // + // As it so happens, the same logic applies if the second edit precedes the first edit. In that case rahter + // than pusing the first edit forward to match the second, we'll push the second edit forward to match the + // first. + // + // In this case that means we have { oldStart: 10, oldEnd: 80, newEnd: 70 } or, in TextChangeRange + // semantics: { { start: 10, length: 70 }, newLength: 60 } + // + // The math then works out as follows. + // If we have { oldStart1, oldEnd1, newEnd1 } and { oldStart2, oldEnd2, newEnd2 } then we can compute the + // final result like so: + // + // { + // oldStart3: Min(oldStart1, oldStart2), + // oldEnd3 : Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)), + // newEnd3 : Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)) + // } + + var oldStart1 = oldStartN; + var oldEnd1 = oldEndN; + var newEnd1 = newEndN; + + var oldStart2 = nextChange.span().start(); + var oldEnd2 = nextChange.span().end(); + var newEnd2 = oldStart2 + nextChange.newLength(); + + oldStartN = Math.min(oldStart1, oldStart2); + oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); + newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); + } + + return new TextChangeRange(TextSpan.fromBounds(oldStartN, oldEndN), /*newLength: */newEndN - oldStartN); + } + } +} \ No newline at end of file diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 8620f8d1920..75bea36bf3a 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -66,22 +66,22 @@ module ts { } export function findListItemInfo(node: Node): ListItemInfo { - var syntaxList = findContainingList(node); + var list = findContainingList(node); // It is possible at this point for syntaxList to be undefined, either if // node.parent had no list child, or if none of its list children contained // the span of node. If this happens, return undefined. The caller should // handle this case. - if (!syntaxList) { + if (!list) { return undefined; } - var children = syntaxList.getChildren(); - var index = indexOf(children, node); + var children = list.getChildren(); + var listItemIndex = indexOf(children, node); return { - listItemIndex: index, - list: syntaxList + listItemIndex, + list }; } @@ -320,4 +320,9 @@ module ts { export function isPunctuation(kind: SyntaxKind): boolean { return SyntaxKind.FirstPunctuation <= kind && kind <= SyntaxKind.LastPunctuation; } + + export function isInsideTemplateLiteral(node: LiteralExpression, position: number) { + return (node.getStart() < position && position < node.getEnd()) + || (isUnterminatedTemplateEnd(node) && position === node.getEnd()); + } } \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName10_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName10_es6.errors.txt new file mode 100644 index 00000000000..ba7154a9298 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName10_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName10_es6.ts(2,8): error TS1005: ';' expected. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName10_es6.ts (1 errors) ==== + class C { + [e] = 1 + ~ +!!! error TS1005: ';' expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName11_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName11_es6.errors.txt new file mode 100644 index 00000000000..3f96913c1d5 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName11_es6.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName11_es6.ts(2,7): error TS1005: ';' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName11_es6.ts(2,8): error TS1109: Expression expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName11_es6.ts(3,1): error TS1128: Declaration or statement expected. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName11_es6.ts (3 errors) ==== + class C { + [e](); + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1109: Expression expected. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName12_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName12_es6.errors.txt new file mode 100644 index 00000000000..fefff058fe1 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName12_es6.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName12_es6.ts(2,7): error TS1005: ';' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName12_es6.ts(2,10): error TS1005: '=>' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName12_es6.ts(3,1): error TS1128: Declaration or statement expected. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName12_es6.ts (3 errors) ==== + class C { + [e]() { } + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1005: '=>' expected. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName13_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName13_es6.errors.txt new file mode 100644 index 00000000000..3f8c10fc643 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName13_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName13_es6.ts(1,11): error TS1022: An index signature parameter must have a type annotation. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName13_es6.ts (1 errors) ==== + var v: { [e]: number }; + ~ +!!! error TS1022: An index signature parameter must have a type annotation. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName14_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName14_es6.errors.txt new file mode 100644 index 00000000000..7d6052b4179 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName14_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName14_es6.ts(1,13): error TS1005: ';' expected. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName14_es6.ts (1 errors) ==== + var v: { [e](): number }; + ~ +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName15_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName15_es6.errors.txt new file mode 100644 index 00000000000..689df40f985 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName15_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName15_es6.ts(1,32): error TS1022: An index signature parameter must have a type annotation. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName15_es6.ts (1 errors) ==== + var v: { [e: number]: string; [e]: number }; + ~ +!!! error TS1022: An index signature parameter must have a type annotation. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName16_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName16_es6.errors.txt new file mode 100644 index 00000000000..c3de61ddf07 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName16_es6.errors.txt @@ -0,0 +1,18 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName16_es6.ts(2,3): error TS1132: Enum member expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName16_es6.ts(3,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName16_es6.ts(2,3): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName16_es6.ts(2,4): error TS2304: Cannot find name 'e'. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName16_es6.ts (4 errors) ==== + enum E { + [e] = 1 + ~ +!!! error TS1132: Enum member expected. + ~~~ +!!! error TS2364: Invalid left-hand side of assignment expression. + ~ +!!! error TS2304: Cannot find name 'e'. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName17_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName17_es6.errors.txt new file mode 100644 index 00000000000..4b8caf1e62d --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName17_es6.errors.txt @@ -0,0 +1,16 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName17_es6.ts(1,15): error TS1003: Identifier expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName17_es6.ts(1,22): error TS1005: ',' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName17_es6.ts(1,26): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName17_es6.ts(1,16): error TS2304: Cannot find name 'e'. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName17_es6.ts (4 errors) ==== + var v = { set [e](v) { } } + ~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName18_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName18_es6.errors.txt new file mode 100644 index 00000000000..8e409750b5c --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName18_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName18_es6.ts(1,13): error TS1005: ';' expected. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName18_es6.ts (1 errors) ==== + var v: { [e]?(): number }; + ~ +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName19_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName19_es6.errors.txt new file mode 100644 index 00000000000..1833deef789 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName19_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName19_es6.ts(1,13): error TS1005: ';' expected. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName19_es6.ts (1 errors) ==== + var v: { [e]? }; + ~ +!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName1_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName1_es6.errors.txt new file mode 100644 index 00000000000..260ff20dc36 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName1_es6.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName1_es6.ts(1,11): error TS1136: Property assignment expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName1_es6.ts(1,15): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName1_es6.ts(1,12): error TS2304: Cannot find name 'e'. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName1_es6.ts (3 errors) ==== + var v = { [e] }; + ~ +!!! error TS1136: Property assignment expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName2_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName2_es6.errors.txt new file mode 100644 index 00000000000..f0a06ef84bc --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName2_es6.errors.txt @@ -0,0 +1,19 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts(1,11): error TS1136: Property assignment expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts(1,14): error TS1005: ',' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts(1,16): error TS1134: Variable declaration expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts(1,18): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts(1,12): error TS2304: Cannot find name 'e'. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts (5 errors) ==== + var v = { [e]: 1 }; + ~ +!!! error TS1136: Property assignment expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1134: Variable declaration expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName3_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName3_es6.errors.txt new file mode 100644 index 00000000000..3f1e5d707a8 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName3_es6.errors.txt @@ -0,0 +1,16 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName3_es6.ts(1,11): error TS1136: Property assignment expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName3_es6.ts(1,17): error TS1005: ',' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName3_es6.ts(1,21): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName3_es6.ts(1,12): error TS2304: Cannot find name 'e'. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName3_es6.ts (4 errors) ==== + var v = { [e]() { } }; + ~ +!!! error TS1136: Property assignment expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName4_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName4_es6.errors.txt new file mode 100644 index 00000000000..a1f22f611f9 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName4_es6.errors.txt @@ -0,0 +1,16 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName4_es6.ts(1,15): error TS1003: Identifier expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName4_es6.ts(1,21): error TS1005: ',' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName4_es6.ts(1,25): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName4_es6.ts(1,16): error TS2304: Cannot find name 'e'. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName4_es6.ts (4 errors) ==== + var v = { get [e]() { } }; + ~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName5_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName5_es6.errors.txt new file mode 100644 index 00000000000..2ce2faaee62 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName5_es6.errors.txt @@ -0,0 +1,19 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts(1,18): error TS1005: ':' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts(1,28): error TS1005: ',' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts(1,32): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts(1,18): error TS2304: Cannot find name 'get'. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts(1,23): error TS2304: Cannot find name 'e'. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts (5 errors) ==== + var v = { public get [e]() { } }; + ~~~ +!!! error TS1005: ':' expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~ +!!! error TS2304: Cannot find name 'get'. + ~ +!!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName6_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName6_es6.errors.txt new file mode 100644 index 00000000000..ca6bce48295 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName6_es6.errors.txt @@ -0,0 +1,28 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,11): error TS1136: Property assignment expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,14): error TS1005: ',' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,16): error TS1134: Variable declaration expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,26): error TS1005: ';' expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,30): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,12): error TS2304: Cannot find name 'e'. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,20): error TS2304: Cannot find name 'e'. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,24): error TS2304: Cannot find name 'e'. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts (8 errors) ==== + var v = { [e]: 1, [e + e]: 2 }; + ~ +!!! error TS1136: Property assignment expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1134: Variable declaration expected. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS2304: Cannot find name 'e'. + ~ +!!! error TS2304: Cannot find name 'e'. + ~ +!!! error TS2304: Cannot find name 'e'. \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName7_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName7_es6.errors.txt new file mode 100644 index 00000000000..00be8f610e0 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName7_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName7_es6.ts(2,5): error TS1022: An index signature parameter must have a type annotation. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName7_es6.ts (1 errors) ==== + class C { + [e] + ~ +!!! error TS1022: An index signature parameter must have a type annotation. + } \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName8_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName8_es6.errors.txt new file mode 100644 index 00000000000..58386bbe177 --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName8_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName8_es6.ts(2,12): error TS1022: An index signature parameter must have a type annotation. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName8_es6.ts (1 errors) ==== + class C { + public [e] + ~ +!!! error TS1022: An index signature parameter must have a type annotation. + } \ No newline at end of file diff --git a/tests/baselines/reference/ComputedPropertyName9_es6.errors.txt b/tests/baselines/reference/ComputedPropertyName9_es6.errors.txt new file mode 100644 index 00000000000..0872f69aebe --- /dev/null +++ b/tests/baselines/reference/ComputedPropertyName9_es6.errors.txt @@ -0,0 +1,12 @@ +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName9_es6.ts(2,5): error TS1022: An index signature parameter must have a type annotation. +tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName9_es6.ts(2,9): error TS2304: Cannot find name 'Type'. + + +==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName9_es6.ts (2 errors) ==== + class C { + [e]: Type + ~ +!!! error TS1022: An index signature parameter must have a type annotation. + ~~~~ +!!! error TS2304: Cannot find name 'Type'. + } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration10_es6.js b/tests/baselines/reference/FunctionDeclaration10_es6.js new file mode 100644 index 00000000000..51694533964 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration10_es6.js @@ -0,0 +1,8 @@ +//// [FunctionDeclaration10_es6.ts] +function * foo(a = yield => yield) { +} + +//// [FunctionDeclaration10_es6.js] +function foo(a) { + if (a === void 0) { a = function (yield) { return yield; }; } +} diff --git a/tests/baselines/reference/FunctionDeclaration10_es6.types b/tests/baselines/reference/FunctionDeclaration10_es6.types new file mode 100644 index 00000000000..973de97fab1 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration10_es6.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts === +function * foo(a = yield => yield) { +>foo : (a?: (yield: any) => any) => void +>a : (yield: any) => any +>yield => yield : (yield: any) => any +>yield : any +>yield : any +} diff --git a/tests/baselines/reference/FunctionDeclaration11_es6.js b/tests/baselines/reference/FunctionDeclaration11_es6.js new file mode 100644 index 00000000000..ba497b3e529 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration11_es6.js @@ -0,0 +1,7 @@ +//// [FunctionDeclaration11_es6.ts] +function * yield() { +} + +//// [FunctionDeclaration11_es6.js] +function yield() { +} diff --git a/tests/baselines/reference/FunctionDeclaration11_es6.types b/tests/baselines/reference/FunctionDeclaration11_es6.types new file mode 100644 index 00000000000..f57a385c359 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration11_es6.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts === +function * yield() { +>yield : () => void +} diff --git a/tests/baselines/reference/FunctionDeclaration12_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration12_es6.errors.txt new file mode 100644 index 00000000000..358ec5ea041 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration12_es6.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration12_es6.ts(1,20): error TS1005: '(' expected. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration12_es6.ts(1,25): error TS1005: '=' expected. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration12_es6.ts(1,28): error TS1005: '=>' expected. + + +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration12_es6.ts (3 errors) ==== + var v = function * yield() { } + ~~~~~ +!!! error TS1005: '(' expected. + ~ +!!! error TS1005: '=' expected. + ~ +!!! error TS1005: '=>' expected. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt new file mode 100644 index 00000000000..1f921475fd3 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(3,11): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts (1 errors) ==== + function * foo() { + // Legal to use 'yield' in a type context. + var v: yield; + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration13_es6.js b/tests/baselines/reference/FunctionDeclaration13_es6.js new file mode 100644 index 00000000000..4c82b037569 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration13_es6.js @@ -0,0 +1,12 @@ +//// [FunctionDeclaration13_es6.ts] +function * foo() { + // Legal to use 'yield' in a type context. + var v: yield; +} + + +//// [FunctionDeclaration13_es6.js] +function foo() { + // Legal to use 'yield' in a type context. + var v; +} diff --git a/tests/baselines/reference/FunctionDeclaration1_es6.js b/tests/baselines/reference/FunctionDeclaration1_es6.js new file mode 100644 index 00000000000..262c7ea02fb --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration1_es6.js @@ -0,0 +1,7 @@ +//// [FunctionDeclaration1_es6.ts] +function * foo() { +} + +//// [FunctionDeclaration1_es6.js] +function foo() { +} diff --git a/tests/baselines/reference/FunctionDeclaration1_es6.types b/tests/baselines/reference/FunctionDeclaration1_es6.types new file mode 100644 index 00000000000..69b26e5dd10 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration1_es6.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts === +function * foo() { +>foo : () => void +} diff --git a/tests/baselines/reference/FunctionDeclaration2_es6.js b/tests/baselines/reference/FunctionDeclaration2_es6.js new file mode 100644 index 00000000000..dc73cad330f --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration2_es6.js @@ -0,0 +1,7 @@ +//// [FunctionDeclaration2_es6.ts] +function f(yield) { +} + +//// [FunctionDeclaration2_es6.js] +function f(yield) { +} diff --git a/tests/baselines/reference/FunctionDeclaration2_es6.types b/tests/baselines/reference/FunctionDeclaration2_es6.types new file mode 100644 index 00000000000..f23d9cf6840 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration2_es6.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration2_es6.ts === +function f(yield) { +>f : (yield: any) => void +>yield : any +} diff --git a/tests/baselines/reference/FunctionDeclaration3_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration3_es6.errors.txt new file mode 100644 index 00000000000..409baef3a50 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration3_es6.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration3_es6.ts(1,20): error TS2372: Parameter 'yield' cannot be referenced in its initializer. + + +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration3_es6.ts (1 errors) ==== + function f(yield = yield) { + ~~~~~ +!!! error TS2372: Parameter 'yield' cannot be referenced in its initializer. + } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration3_es6.js b/tests/baselines/reference/FunctionDeclaration3_es6.js new file mode 100644 index 00000000000..e1df936dd21 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration3_es6.js @@ -0,0 +1,8 @@ +//// [FunctionDeclaration3_es6.ts] +function f(yield = yield) { +} + +//// [FunctionDeclaration3_es6.js] +function f(yield) { + if (yield === void 0) { yield = yield; } +} diff --git a/tests/baselines/reference/FunctionDeclaration4_es6.js b/tests/baselines/reference/FunctionDeclaration4_es6.js new file mode 100644 index 00000000000..da6c695fcb9 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration4_es6.js @@ -0,0 +1,7 @@ +//// [FunctionDeclaration4_es6.ts] +function yield() { +} + +//// [FunctionDeclaration4_es6.js] +function yield() { +} diff --git a/tests/baselines/reference/FunctionDeclaration4_es6.types b/tests/baselines/reference/FunctionDeclaration4_es6.types new file mode 100644 index 00000000000..e4f102a8f70 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration4_es6.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration4_es6.ts === +function yield() { +>yield : () => void +} diff --git a/tests/baselines/reference/FunctionDeclaration5_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration5_es6.errors.txt new file mode 100644 index 00000000000..9a8be921795 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration5_es6.errors.txt @@ -0,0 +1,17 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts(1,14): error TS1138: Parameter declaration expected. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts(1,19): error TS1005: ';' expected. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts(1,10): error TS2391: Function implementation is missing or not immediately following the declaration. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts(1,14): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts (4 errors) ==== + function*foo(yield) { + ~~~~~ +!!! error TS1138: Parameter declaration expected. + ~ +!!! error TS1005: ';' expected. + ~~~ +!!! error TS2391: Function implementation is missing or not immediately following the declaration. + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt new file mode 100644 index 00000000000..7d5eb768be6 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,18): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts (1 errors) ==== + function*foo(a = yield) { + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration6_es6.js b/tests/baselines/reference/FunctionDeclaration6_es6.js new file mode 100644 index 00000000000..07b3ff52212 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration6_es6.js @@ -0,0 +1,8 @@ +//// [FunctionDeclaration6_es6.ts] +function*foo(a = yield) { +} + +//// [FunctionDeclaration6_es6.js] +function foo(a) { + if (a === void 0) { a = yield; } +} diff --git a/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt new file mode 100644 index 00000000000..95ad904bdd9 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(3,20): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts (1 errors) ==== + function*bar() { + // 'yield' here is an identifier, and not a yield expression. + function*foo(a = yield) { + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration7_es6.js b/tests/baselines/reference/FunctionDeclaration7_es6.js new file mode 100644 index 00000000000..661e1668e0f --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration7_es6.js @@ -0,0 +1,14 @@ +//// [FunctionDeclaration7_es6.ts] +function*bar() { + // 'yield' here is an identifier, and not a yield expression. + function*foo(a = yield) { + } +} + +//// [FunctionDeclaration7_es6.js] +function bar() { + // 'yield' here is an identifier, and not a yield expression. + function foo(a) { + if (a === void 0) { a = yield; } + } +} diff --git a/tests/baselines/reference/FunctionDeclaration8_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration8_es6.errors.txt new file mode 100644 index 00000000000..a30b8d80310 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration8_es6.errors.txt @@ -0,0 +1,16 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts(1,11): error TS1136: Property assignment expected. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts(1,18): error TS1005: ',' expected. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts(1,24): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts(1,12): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts (4 errors) ==== + var v = { [yield]: foo } + ~ +!!! error TS1136: Property assignment expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration9_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration9_es6.errors.txt new file mode 100644 index 00000000000..b4cf83a7b6c --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration9_es6.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(2,13): error TS1136: Property assignment expected. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(2,20): error TS1005: ',' expected. +tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(3,1): error TS1128: Declaration or statement expected. + + +==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts (3 errors) ==== + function * foo() { + var v = { [yield]: foo } + ~ +!!! error TS1136: Property assignment expected. + ~ +!!! error TS1005: ',' expected. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionExpression1_es6.js b/tests/baselines/reference/FunctionExpression1_es6.js new file mode 100644 index 00000000000..7c8d82f4ca8 --- /dev/null +++ b/tests/baselines/reference/FunctionExpression1_es6.js @@ -0,0 +1,6 @@ +//// [FunctionExpression1_es6.ts] +var v = function * () { } + +//// [FunctionExpression1_es6.js] +var v = function () { +}; diff --git a/tests/baselines/reference/FunctionExpression1_es6.types b/tests/baselines/reference/FunctionExpression1_es6.types new file mode 100644 index 00000000000..c857d53baba --- /dev/null +++ b/tests/baselines/reference/FunctionExpression1_es6.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts === +var v = function * () { } +>v : () => void +>function * () { } : () => void + diff --git a/tests/baselines/reference/FunctionExpression2_es6.js b/tests/baselines/reference/FunctionExpression2_es6.js new file mode 100644 index 00000000000..0a2468bcb8c --- /dev/null +++ b/tests/baselines/reference/FunctionExpression2_es6.js @@ -0,0 +1,6 @@ +//// [FunctionExpression2_es6.ts] +var v = function * foo() { } + +//// [FunctionExpression2_es6.js] +var v = function foo() { +}; diff --git a/tests/baselines/reference/FunctionExpression2_es6.types b/tests/baselines/reference/FunctionExpression2_es6.types new file mode 100644 index 00000000000..7bd9f090435 --- /dev/null +++ b/tests/baselines/reference/FunctionExpression2_es6.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts === +var v = function * foo() { } +>v : () => void +>function * foo() { } : () => void +>foo : () => void + diff --git a/tests/baselines/reference/FunctionPropertyAssignments1_es6.js b/tests/baselines/reference/FunctionPropertyAssignments1_es6.js new file mode 100644 index 00000000000..a451dcfb363 --- /dev/null +++ b/tests/baselines/reference/FunctionPropertyAssignments1_es6.js @@ -0,0 +1,6 @@ +//// [FunctionPropertyAssignments1_es6.ts] +var v = { *foo() { } } + +//// [FunctionPropertyAssignments1_es6.js] +var v = { foo: function () { +} }; diff --git a/tests/baselines/reference/FunctionPropertyAssignments1_es6.types b/tests/baselines/reference/FunctionPropertyAssignments1_es6.types new file mode 100644 index 00000000000..2dfbf5cb657 --- /dev/null +++ b/tests/baselines/reference/FunctionPropertyAssignments1_es6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts === +var v = { *foo() { } } +>v : { foo: () => void; } +>{ *foo() { } } : { foo: () => void; } +>foo : () => void +>*foo() { } : () => void + diff --git a/tests/baselines/reference/FunctionPropertyAssignments2_es6.errors.txt b/tests/baselines/reference/FunctionPropertyAssignments2_es6.errors.txt new file mode 100644 index 00000000000..f0287f12696 --- /dev/null +++ b/tests/baselines/reference/FunctionPropertyAssignments2_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments2_es6.ts(1,12): error TS1003: Identifier expected. + + +==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments2_es6.ts (1 errors) ==== + var v = { *() { } } + ~ +!!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionPropertyAssignments3_es6.errors.txt b/tests/baselines/reference/FunctionPropertyAssignments3_es6.errors.txt new file mode 100644 index 00000000000..b5873e80796 --- /dev/null +++ b/tests/baselines/reference/FunctionPropertyAssignments3_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments3_es6.ts(1,12): error TS1003: Identifier expected. + + +==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments3_es6.ts (1 errors) ==== + var v = { *{ } } + ~ +!!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionPropertyAssignments4_es6.errors.txt b/tests/baselines/reference/FunctionPropertyAssignments4_es6.errors.txt new file mode 100644 index 00000000000..285341f04dc --- /dev/null +++ b/tests/baselines/reference/FunctionPropertyAssignments4_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments4_es6.ts(1,13): error TS1003: Identifier expected. + + +==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments4_es6.ts (1 errors) ==== + var v = { * } + ~ +!!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionPropertyAssignments5_es6.errors.txt b/tests/baselines/reference/FunctionPropertyAssignments5_es6.errors.txt new file mode 100644 index 00000000000..961dabaa996 --- /dev/null +++ b/tests/baselines/reference/FunctionPropertyAssignments5_es6.errors.txt @@ -0,0 +1,16 @@ +tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,12): error TS1003: Identifier expected. +tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,22): error TS1005: ',' expected. +tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,26): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,13): error TS2304: Cannot find name 'foo'. + + +==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts (4 errors) ==== + var v = { *[foo()]() { } } + ~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~ +!!! error TS2304: Cannot find name 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionPropertyAssignments6_es6.errors.txt b/tests/baselines/reference/FunctionPropertyAssignments6_es6.errors.txt new file mode 100644 index 00000000000..a4e8450bd73 --- /dev/null +++ b/tests/baselines/reference/FunctionPropertyAssignments6_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments6_es6.ts(1,12): error TS1003: Identifier expected. + + +==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments6_es6.ts (1 errors) ==== + var v = { *() { } } + ~ +!!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration1_es6.js b/tests/baselines/reference/MemberFunctionDeclaration1_es6.js new file mode 100644 index 00000000000..86e7c9d418a --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration1_es6.js @@ -0,0 +1,13 @@ +//// [MemberFunctionDeclaration1_es6.ts] +class C { + *foo() { } +} + +//// [MemberFunctionDeclaration1_es6.js] +var C = (function () { + function C() { + } + C.prototype.foo = function () { + }; + return C; +})(); diff --git a/tests/baselines/reference/MemberFunctionDeclaration1_es6.types b/tests/baselines/reference/MemberFunctionDeclaration1_es6.types new file mode 100644 index 00000000000..265d3fdb291 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration1_es6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts === +class C { +>C : C + + *foo() { } +>foo : () => void +} diff --git a/tests/baselines/reference/MemberFunctionDeclaration2_es6.js b/tests/baselines/reference/MemberFunctionDeclaration2_es6.js new file mode 100644 index 00000000000..efd60844dc7 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration2_es6.js @@ -0,0 +1,13 @@ +//// [MemberFunctionDeclaration2_es6.ts] +class C { + public * foo() { } +} + +//// [MemberFunctionDeclaration2_es6.js] +var C = (function () { + function C() { + } + C.prototype.foo = function () { + }; + return C; +})(); diff --git a/tests/baselines/reference/MemberFunctionDeclaration2_es6.types b/tests/baselines/reference/MemberFunctionDeclaration2_es6.types new file mode 100644 index 00000000000..e1e3f9d17e5 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration2_es6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts === +class C { +>C : C + + public * foo() { } +>foo : () => void +} diff --git a/tests/baselines/reference/MemberFunctionDeclaration3_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration3_es6.errors.txt new file mode 100644 index 00000000000..b3a2de4eec6 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration3_es6.errors.txt @@ -0,0 +1,18 @@ +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,5): error TS1003: Identifier expected. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,10): error TS1005: ';' expected. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,13): error TS1005: '=>' expected. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(3,1): error TS1128: Declaration or statement expected. + + +==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts (4 errors) ==== + class C { + *[foo]() { } + ~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1005: '=>' expected. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration4_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration4_es6.errors.txt new file mode 100644 index 00000000000..988527ccfd7 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration4_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration4_es6.ts(2,5): error TS1003: Identifier expected. + + +==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration4_es6.ts (1 errors) ==== + class C { + *() { } + ~ +!!! error TS1003: Identifier expected. + } \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration5_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration5_es6.errors.txt new file mode 100644 index 00000000000..e27d6198104 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration5_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration5_es6.ts(3,1): error TS1003: Identifier expected. + + +==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration5_es6.ts (1 errors) ==== + class C { + * + } + ~ +!!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration6_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration6_es6.errors.txt new file mode 100644 index 00000000000..b79a61c8866 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration6_es6.errors.txt @@ -0,0 +1,12 @@ +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration6_es6.ts(3,1): error TS1005: '(' expected. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration6_es6.ts(2,5): error TS2391: Function implementation is missing or not immediately following the declaration. + + +==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration6_es6.ts (2 errors) ==== + class C { + *foo + ~~~ +!!! error TS2391: Function implementation is missing or not immediately following the declaration. + } + ~ +!!! error TS1005: '(' expected. \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration7_es6.js b/tests/baselines/reference/MemberFunctionDeclaration7_es6.js new file mode 100644 index 00000000000..211713c6e14 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration7_es6.js @@ -0,0 +1,13 @@ +//// [MemberFunctionDeclaration7_es6.ts] +class C { + *foo() { } +} + +//// [MemberFunctionDeclaration7_es6.js] +var C = (function () { + function C() { + } + C.prototype.foo = function () { + }; + return C; +})(); diff --git a/tests/baselines/reference/MemberFunctionDeclaration7_es6.types b/tests/baselines/reference/MemberFunctionDeclaration7_es6.types new file mode 100644 index 00000000000..e4c864b9422 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration7_es6.types @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts === +class C { +>C : C + + *foo() { } +>foo : () => void +>T : T +} diff --git a/tests/baselines/reference/MemberFunctionDeclaration8_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration8_es6.errors.txt new file mode 100644 index 00000000000..1b216b72c89 --- /dev/null +++ b/tests/baselines/reference/MemberFunctionDeclaration8_es6.errors.txt @@ -0,0 +1,34 @@ +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,12): error TS1127: Invalid character. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,14): error TS1129: Statement expected. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,19): error TS1005: '(' expected. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(5,5): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(6,3): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(7,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,9): error TS2304: Cannot find name 'a'. +tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts(4,16): error TS2391: Function implementation is missing or not immediately following the declaration. + + +==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts (8 errors) ==== + class C { + foo() { + // Make sure we don't think of *bar as the start of a generator method. + if (a) # * bar; + +!!! error TS1127: Invalid character. + ~ +!!! error TS1129: Statement expected. + ~ +!!! error TS1005: '(' expected. + ~ +!!! error TS2304: Cannot find name 'a'. + ~~~ +!!! error TS2391: Function implementation is missing or not immediately following the declaration. + return bar; + ~~~~~~ +!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. + } + ~ +!!! error TS1128: Declaration or statement expected. + } + ~ +!!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/TemplateExpression1.errors.txt b/tests/baselines/reference/TemplateExpression1.errors.txt new file mode 100644 index 00000000000..bf57f5ef24e --- /dev/null +++ b/tests/baselines/reference/TemplateExpression1.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/templates/TemplateExpression1.ts(1,19): error TS1158: Invalid template literal; expected '}' +tests/cases/conformance/es6/templates/TemplateExpression1.ts(1,17): error TS2304: Cannot find name 'a'. + + +==== tests/cases/conformance/es6/templates/TemplateExpression1.ts (2 errors) ==== + var v = `foo ${ a + +!!! error TS1158: Invalid template literal; expected '}' + ~ +!!! error TS2304: Cannot find name 'a'. \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression10_es6.js b/tests/baselines/reference/YieldExpression10_es6.js new file mode 100644 index 00000000000..f111e6e1bdf --- /dev/null +++ b/tests/baselines/reference/YieldExpression10_es6.js @@ -0,0 +1,11 @@ +//// [YieldExpression10_es6.ts] +var v = { * foo() { + yield(foo); + } +} + + +//// [YieldExpression10_es6.js] +var v = { foo: function () { + ; +} }; diff --git a/tests/baselines/reference/YieldExpression10_es6.types b/tests/baselines/reference/YieldExpression10_es6.types new file mode 100644 index 00000000000..e0d3f84c6c8 --- /dev/null +++ b/tests/baselines/reference/YieldExpression10_es6.types @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts === +var v = { * foo() { +>v : { foo: () => void; } +>{ * foo() { yield(foo); }} : { foo: () => void; } +>foo : () => void +>* foo() { yield(foo); } : () => void + + yield(foo); + } +} + diff --git a/tests/baselines/reference/YieldExpression11_es6.js b/tests/baselines/reference/YieldExpression11_es6.js new file mode 100644 index 00000000000..306cef3051e --- /dev/null +++ b/tests/baselines/reference/YieldExpression11_es6.js @@ -0,0 +1,16 @@ +//// [YieldExpression11_es6.ts] +class C { + *foo() { + yield(foo); + } +} + +//// [YieldExpression11_es6.js] +var C = (function () { + function C() { + } + C.prototype.foo = function () { + ; + }; + return C; +})(); diff --git a/tests/baselines/reference/YieldExpression11_es6.types b/tests/baselines/reference/YieldExpression11_es6.types new file mode 100644 index 00000000000..cdb70b3af0d --- /dev/null +++ b/tests/baselines/reference/YieldExpression11_es6.types @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts === +class C { +>C : C + + *foo() { +>foo : () => void + + yield(foo); + } +} diff --git a/tests/baselines/reference/YieldExpression12_es6.errors.txt b/tests/baselines/reference/YieldExpression12_es6.errors.txt new file mode 100644 index 00000000000..10843421a3f --- /dev/null +++ b/tests/baselines/reference/YieldExpression12_es6.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression12_es6.ts(3,6): error TS1163: 'yield' expression must be contained_within a generator declaration. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression12_es6.ts (1 errors) ==== + class C { + constructor() { + yield foo + ~~~~~ +!!! error TS1163: 'yield' expression must be contained_within a generator declaration. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression13_es6.js b/tests/baselines/reference/YieldExpression13_es6.js new file mode 100644 index 00000000000..328fc80dbdd --- /dev/null +++ b/tests/baselines/reference/YieldExpression13_es6.js @@ -0,0 +1,7 @@ +//// [YieldExpression13_es6.ts] +function* foo() { yield } + +//// [YieldExpression13_es6.js] +function foo() { + ; +} diff --git a/tests/baselines/reference/YieldExpression13_es6.types b/tests/baselines/reference/YieldExpression13_es6.types new file mode 100644 index 00000000000..23a9fe6299a --- /dev/null +++ b/tests/baselines/reference/YieldExpression13_es6.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts === +function* foo() { yield } +>foo : () => void + diff --git a/tests/baselines/reference/YieldExpression14_es6.errors.txt b/tests/baselines/reference/YieldExpression14_es6.errors.txt new file mode 100644 index 00000000000..baeaf3ba30e --- /dev/null +++ b/tests/baselines/reference/YieldExpression14_es6.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression14_es6.ts(3,6): error TS1163: 'yield' expression must be contained_within a generator declaration. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression14_es6.ts (1 errors) ==== + class C { + foo() { + yield foo + ~~~~~ +!!! error TS1163: 'yield' expression must be contained_within a generator declaration. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression15_es6.errors.txt b/tests/baselines/reference/YieldExpression15_es6.errors.txt new file mode 100644 index 00000000000..5e548799f5d --- /dev/null +++ b/tests/baselines/reference/YieldExpression15_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression15_es6.ts(2,6): error TS1163: 'yield' expression must be contained_within a generator declaration. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression15_es6.ts (1 errors) ==== + var v = () => { + yield foo + ~~~~~ +!!! error TS1163: 'yield' expression must be contained_within a generator declaration. + } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression16_es6.errors.txt b/tests/baselines/reference/YieldExpression16_es6.errors.txt new file mode 100644 index 00000000000..e5a9b93eece --- /dev/null +++ b/tests/baselines/reference/YieldExpression16_es6.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(3,5): error TS1163: 'yield' expression must be contained_within a generator declaration. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts (1 errors) ==== + function* foo() { + function bar() { + yield foo; + ~~~~~ +!!! error TS1163: 'yield' expression must be contained_within a generator declaration. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression17_es6.errors.txt b/tests/baselines/reference/YieldExpression17_es6.errors.txt new file mode 100644 index 00000000000..38969a9c6fb --- /dev/null +++ b/tests/baselines/reference/YieldExpression17_es6.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts(1,15): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts(1,15): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts (2 errors) ==== + var v = { get foo() { yield foo; } } + ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ +!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression18_es6.errors.txt b/tests/baselines/reference/YieldExpression18_es6.errors.txt new file mode 100644 index 00000000000..3a67acdebcd --- /dev/null +++ b/tests/baselines/reference/YieldExpression18_es6.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts(2,1): error TS1163: 'yield' expression must be contained_within a generator declaration. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts (1 errors) ==== + "use strict"; + yield(foo); + ~~~~~ +!!! error TS1163: 'yield' expression must be contained_within a generator declaration. \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression19_es6.js b/tests/baselines/reference/YieldExpression19_es6.js new file mode 100644 index 00000000000..91643e09b0e --- /dev/null +++ b/tests/baselines/reference/YieldExpression19_es6.js @@ -0,0 +1,17 @@ +//// [YieldExpression19_es6.ts] +function*foo() { + function bar() { + function* quux() { + yield(foo); + } + } +} + +//// [YieldExpression19_es6.js] +function foo() { + function bar() { + function quux() { + ; + } + } +} diff --git a/tests/baselines/reference/YieldExpression19_es6.types b/tests/baselines/reference/YieldExpression19_es6.types new file mode 100644 index 00000000000..a8af884c98f --- /dev/null +++ b/tests/baselines/reference/YieldExpression19_es6.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts === +function*foo() { +>foo : () => void + + function bar() { +>bar : () => void + + function* quux() { +>quux : () => void + + yield(foo); + } + } +} diff --git a/tests/baselines/reference/YieldExpression1_es6.errors.txt b/tests/baselines/reference/YieldExpression1_es6.errors.txt new file mode 100644 index 00000000000..f8a13fe5409 --- /dev/null +++ b/tests/baselines/reference/YieldExpression1_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression1_es6.ts(1,1): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression1_es6.ts (1 errors) ==== + yield; + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression1_es6.js b/tests/baselines/reference/YieldExpression1_es6.js new file mode 100644 index 00000000000..cb5c097df2c --- /dev/null +++ b/tests/baselines/reference/YieldExpression1_es6.js @@ -0,0 +1,5 @@ +//// [YieldExpression1_es6.ts] +yield; + +//// [YieldExpression1_es6.js] +yield; diff --git a/tests/baselines/reference/YieldExpression2_es6.errors.txt b/tests/baselines/reference/YieldExpression2_es6.errors.txt new file mode 100644 index 00000000000..553dab51fc2 --- /dev/null +++ b/tests/baselines/reference/YieldExpression2_es6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression2_es6.ts(1,1): error TS1163: 'yield' expression must be contained_within a generator declaration. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression2_es6.ts (1 errors) ==== + yield foo; + ~~~~~ +!!! error TS1163: 'yield' expression must be contained_within a generator declaration. \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression3_es6.js b/tests/baselines/reference/YieldExpression3_es6.js new file mode 100644 index 00000000000..cc3716587ea --- /dev/null +++ b/tests/baselines/reference/YieldExpression3_es6.js @@ -0,0 +1,11 @@ +//// [YieldExpression3_es6.ts] +function* foo() { + yield + yield +} + +//// [YieldExpression3_es6.js] +function foo() { + ; + ; +} diff --git a/tests/baselines/reference/YieldExpression3_es6.types b/tests/baselines/reference/YieldExpression3_es6.types new file mode 100644 index 00000000000..f9ad4faffdb --- /dev/null +++ b/tests/baselines/reference/YieldExpression3_es6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts === +function* foo() { +>foo : () => void + + yield + yield +} diff --git a/tests/baselines/reference/YieldExpression4_es6.js b/tests/baselines/reference/YieldExpression4_es6.js new file mode 100644 index 00000000000..84b11a03a2c --- /dev/null +++ b/tests/baselines/reference/YieldExpression4_es6.js @@ -0,0 +1,11 @@ +//// [YieldExpression4_es6.ts] +function* foo() { + yield; + yield; +} + +//// [YieldExpression4_es6.js] +function foo() { + ; + ; +} diff --git a/tests/baselines/reference/YieldExpression4_es6.types b/tests/baselines/reference/YieldExpression4_es6.types new file mode 100644 index 00000000000..083d145d06f --- /dev/null +++ b/tests/baselines/reference/YieldExpression4_es6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts === +function* foo() { +>foo : () => void + + yield; + yield; +} diff --git a/tests/baselines/reference/YieldExpression5_es6.errors.txt b/tests/baselines/reference/YieldExpression5_es6.errors.txt new file mode 100644 index 00000000000..3ce8f20c985 --- /dev/null +++ b/tests/baselines/reference/YieldExpression5_es6.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression5_es6.ts(3,1): error TS1109: Expression expected. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression5_es6.ts (1 errors) ==== + function* foo() { + yield* + } + ~ +!!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression6_es6.js b/tests/baselines/reference/YieldExpression6_es6.js new file mode 100644 index 00000000000..5024e9bbd40 --- /dev/null +++ b/tests/baselines/reference/YieldExpression6_es6.js @@ -0,0 +1,9 @@ +//// [YieldExpression6_es6.ts] +function* foo() { + yield*foo +} + +//// [YieldExpression6_es6.js] +function foo() { + ; +} diff --git a/tests/baselines/reference/YieldExpression6_es6.types b/tests/baselines/reference/YieldExpression6_es6.types new file mode 100644 index 00000000000..fd410d2c959 --- /dev/null +++ b/tests/baselines/reference/YieldExpression6_es6.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts === +function* foo() { +>foo : () => void + + yield*foo +} diff --git a/tests/baselines/reference/YieldExpression7_es6.js b/tests/baselines/reference/YieldExpression7_es6.js new file mode 100644 index 00000000000..96ef5af107e --- /dev/null +++ b/tests/baselines/reference/YieldExpression7_es6.js @@ -0,0 +1,9 @@ +//// [YieldExpression7_es6.ts] +function* foo() { + yield foo +} + +//// [YieldExpression7_es6.js] +function foo() { + ; +} diff --git a/tests/baselines/reference/YieldExpression7_es6.types b/tests/baselines/reference/YieldExpression7_es6.types new file mode 100644 index 00000000000..17e1a3b2bfb --- /dev/null +++ b/tests/baselines/reference/YieldExpression7_es6.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts === +function* foo() { +>foo : () => void + + yield foo +} diff --git a/tests/baselines/reference/YieldExpression8_es6.errors.txt b/tests/baselines/reference/YieldExpression8_es6.errors.txt new file mode 100644 index 00000000000..f4dd30b1a19 --- /dev/null +++ b/tests/baselines/reference/YieldExpression8_es6.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(1,1): error TS2304: Cannot find name 'yield'. + + +==== tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts (1 errors) ==== + yield(foo); + ~~~~~ +!!! error TS2304: Cannot find name 'yield'. + function* foo() { + yield(foo); + } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression8_es6.js b/tests/baselines/reference/YieldExpression8_es6.js new file mode 100644 index 00000000000..190c2cc3da5 --- /dev/null +++ b/tests/baselines/reference/YieldExpression8_es6.js @@ -0,0 +1,11 @@ +//// [YieldExpression8_es6.ts] +yield(foo); +function* foo() { + yield(foo); +} + +//// [YieldExpression8_es6.js] +yield(foo); +function foo() { + ; +} diff --git a/tests/baselines/reference/YieldExpression9_es6.js b/tests/baselines/reference/YieldExpression9_es6.js new file mode 100644 index 00000000000..978e0d455bd --- /dev/null +++ b/tests/baselines/reference/YieldExpression9_es6.js @@ -0,0 +1,9 @@ +//// [YieldExpression9_es6.ts] +var v = function*() { + yield(foo); +} + +//// [YieldExpression9_es6.js] +var v = function () { + ; +}; diff --git a/tests/baselines/reference/YieldExpression9_es6.types b/tests/baselines/reference/YieldExpression9_es6.types new file mode 100644 index 00000000000..a570d2f09a0 --- /dev/null +++ b/tests/baselines/reference/YieldExpression9_es6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts === +var v = function*() { +>v : () => void +>function*() { yield(foo);} : () => void + + yield(foo); +} diff --git a/tests/baselines/reference/accessibilityModifiers.errors.txt b/tests/baselines/reference/accessibilityModifiers.errors.txt index 137da7f982c..1bf92139761 100644 --- a/tests/baselines/reference/accessibilityModifiers.errors.txt +++ b/tests/baselines/reference/accessibilityModifiers.errors.txt @@ -11,13 +11,12 @@ tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifier tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(34,12): error TS1029: 'public' modifier must precede 'static' modifier. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(35,12): error TS1029: 'public' modifier must precede 'static' modifier. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(40,13): error TS1028: Accessibility modifier already seen. -tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(40,20): error TS1028: Accessibility modifier already seen. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(41,12): error TS1028: Accessibility modifier already seen. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(42,13): error TS1028: Accessibility modifier already seen. tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(43,12): error TS1028: Accessibility modifier already seen. -==== tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts (17 errors) ==== +==== tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts (16 errors) ==== // No errors class C { @@ -83,8 +82,6 @@ tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifier class E { private public protected property; ~~~~~~ -!!! error TS1028: Accessibility modifier already seen. - ~~~~~~~~~ !!! error TS1028: Accessibility modifier already seen. public protected method() { } ~~~~~~~~~ diff --git a/tests/baselines/reference/aliasInaccessibleModule.errors.txt b/tests/baselines/reference/aliasInaccessibleModule.errors.txt index 9967979442a..3a9c64e50ab 100644 --- a/tests/baselines/reference/aliasInaccessibleModule.errors.txt +++ b/tests/baselines/reference/aliasInaccessibleModule.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/aliasInaccessibleModule.ts(4,5): error TS4000: Import declaration 'X' is using private name 'N'. +tests/cases/compiler/aliasInaccessibleModule.ts(4,23): error TS4000: Import declaration 'X' is using private name 'N'. ==== tests/cases/compiler/aliasInaccessibleModule.ts (1 errors) ==== @@ -6,6 +6,6 @@ tests/cases/compiler/aliasInaccessibleModule.ts(4,5): error TS4000: Import decla module N { } export import X = N; - ~~~~~~~~~~~~~~~~~~~~ + ~ !!! error TS4000: Import declaration 'X' is using private name 'N'. } \ No newline at end of file diff --git a/tests/baselines/reference/aliasInaccessibleModule2.errors.txt b/tests/baselines/reference/aliasInaccessibleModule2.errors.txt index ffeb4ff86dd..03a37147aba 100644 --- a/tests/baselines/reference/aliasInaccessibleModule2.errors.txt +++ b/tests/baselines/reference/aliasInaccessibleModule2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/aliasInaccessibleModule2.ts(7,5): error TS4000: Import declaration 'R' is using private name 'N'. +tests/cases/compiler/aliasInaccessibleModule2.ts(7,16): error TS4000: Import declaration 'R' is using private name 'N'. ==== tests/cases/compiler/aliasInaccessibleModule2.ts (1 errors) ==== @@ -9,7 +9,7 @@ tests/cases/compiler/aliasInaccessibleModule2.ts(7,5): error TS4000: Import decl } import R = N; - ~~~~~~~~~~~~~ + ~ !!! error TS4000: Import declaration 'R' is using private name 'N'. export import X = R; } \ No newline at end of file diff --git a/tests/baselines/reference/ambientEnum1.errors.txt b/tests/baselines/reference/ambientEnum1.errors.txt new file mode 100644 index 00000000000..b4bb534f5dd --- /dev/null +++ b/tests/baselines/reference/ambientEnum1.errors.txt @@ -0,0 +1,17 @@ +tests/cases/compiler/ambientEnum1.ts(2,9): error TS1066: Ambient enum elements can only have integer literal initializers. +tests/cases/compiler/ambientEnum1.ts(7,9): error TS1066: Ambient enum elements can only have integer literal initializers. + + +==== tests/cases/compiler/ambientEnum1.ts (2 errors) ==== + declare enum E1 { + y = 4.23 + ~ +!!! error TS1066: Ambient enum elements can only have integer literal initializers. + } + + // Ambient enum with computer member + declare enum E2 { + x = 'foo'.length + ~ +!!! error TS1066: Ambient enum elements can only have integer literal initializers. + } \ No newline at end of file diff --git a/tests/baselines/reference/ambientErrors.errors.txt b/tests/baselines/reference/ambientErrors.errors.txt index 975dc9ad63a..6fe7a25dfe9 100644 --- a/tests/baselines/reference/ambientErrors.errors.txt +++ b/tests/baselines/reference/ambientErrors.errors.txt @@ -4,8 +4,8 @@ tests/cases/conformance/ambient/ambientErrors.ts(24,5): error TS1066: Ambient en tests/cases/conformance/ambient/ambientErrors.ts(29,5): error TS1066: Ambient enum elements can only have integer literal initializers. tests/cases/conformance/ambient/ambientErrors.ts(34,11): error TS1039: Initializers are not allowed in ambient contexts. tests/cases/conformance/ambient/ambientErrors.ts(35,19): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/conformance/ambient/ambientErrors.ts(37,18): error TS1039: Initializers are not allowed in ambient contexts. -tests/cases/conformance/ambient/ambientErrors.ts(38,11): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/conformance/ambient/ambientErrors.ts(37,20): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/conformance/ambient/ambientErrors.ts(38,13): error TS1039: Initializers are not allowed in ambient contexts. tests/cases/conformance/ambient/ambientErrors.ts(39,23): error TS1111: A constructor implementation cannot be declared in an ambient context. tests/cases/conformance/ambient/ambientErrors.ts(40,14): error TS1037: A function implementation cannot be declared in an ambient context. tests/cases/conformance/ambient/ambientErrors.ts(41,22): error TS1037: A function implementation cannot be declared in an ambient context. @@ -70,10 +70,10 @@ tests/cases/conformance/ambient/ambientErrors.ts(57,5): error TS2309: An export !!! error TS1037: A function implementation cannot be declared in an ambient context. class C { static x = 3; - ~ + ~ !!! error TS1039: Initializers are not allowed in ambient contexts. y = 4; - ~ + ~ !!! error TS1039: Initializers are not allowed in ambient contexts. constructor() { } ~ diff --git a/tests/baselines/reference/ambientErrors1.errors.txt b/tests/baselines/reference/ambientErrors1.errors.txt new file mode 100644 index 00000000000..db7a155cc3f --- /dev/null +++ b/tests/baselines/reference/ambientErrors1.errors.txt @@ -0,0 +1,7 @@ +tests/cases/compiler/ambientErrors1.ts(1,15): error TS1039: Initializers are not allowed in ambient contexts. + + +==== tests/cases/compiler/ambientErrors1.ts (1 errors) ==== + declare var x = 4; + ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. \ No newline at end of file diff --git a/tests/baselines/reference/ambientStatement1.errors.txt b/tests/baselines/reference/ambientStatement1.errors.txt new file mode 100644 index 00000000000..be7c7bb750c --- /dev/null +++ b/tests/baselines/reference/ambientStatement1.errors.txt @@ -0,0 +1,14 @@ +tests/cases/compiler/ambientStatement1.ts(2,6): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/compiler/ambientStatement1.ts(4,20): error TS1039: Initializers are not allowed in ambient contexts. + + +==== tests/cases/compiler/ambientStatement1.ts (2 errors) ==== + declare module M1 { + while(true); + ~~~~~ +!!! error TS1036: Statements are not allowed in ambient contexts. + + export var v1 = () => false; + ~ +!!! error TS1039: Initializers are not allowed in ambient contexts. + } \ No newline at end of file diff --git a/tests/baselines/reference/amdModuleName1.js b/tests/baselines/reference/amdModuleName1.js new file mode 100644 index 00000000000..e3505a007e3 --- /dev/null +++ b/tests/baselines/reference/amdModuleName1.js @@ -0,0 +1,22 @@ +//// [amdModuleName1.ts] +/// +class Foo { + x: number; + constructor() { + this.x = 5; + } +} +export = Foo; + + +//// [amdModuleName1.js] +define("NamedModule", ["require", "exports"], function (require, exports) { + /// + var Foo = (function () { + function Foo() { + this.x = 5; + } + return Foo; + })(); + return Foo; +}); diff --git a/tests/baselines/reference/amdModuleName1.types b/tests/baselines/reference/amdModuleName1.types new file mode 100644 index 00000000000..02ad9472354 --- /dev/null +++ b/tests/baselines/reference/amdModuleName1.types @@ -0,0 +1,19 @@ +=== tests/cases/compiler/amdModuleName1.ts === +/// +class Foo { +>Foo : Foo + + x: number; +>x : number + + constructor() { + this.x = 5; +>this.x = 5 : number +>this.x : number +>this : Foo +>x : number + } +} +export = Foo; +>Foo : Foo + diff --git a/tests/baselines/reference/amdModuleName2.errors.txt b/tests/baselines/reference/amdModuleName2.errors.txt new file mode 100644 index 00000000000..cf7fb82ae10 --- /dev/null +++ b/tests/baselines/reference/amdModuleName2.errors.txt @@ -0,0 +1,16 @@ +tests/cases/compiler/amdModuleName2.ts(2,1): error TS2458: An AMD module cannot have multiple name assignments. + + +==== tests/cases/compiler/amdModuleName2.ts (1 errors) ==== + /// + /// + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2458: An AMD module cannot have multiple name assignments. + class Foo { + x: number; + constructor() { + this.x = 5; + } + } + export = Foo; + \ No newline at end of file diff --git a/tests/baselines/reference/badArraySyntax.errors.txt b/tests/baselines/reference/badArraySyntax.errors.txt index 8c9bd45fba1..500a89d85a9 100644 --- a/tests/baselines/reference/badArraySyntax.errors.txt +++ b/tests/baselines/reference/badArraySyntax.errors.txt @@ -1,32 +1,29 @@ -tests/cases/compiler/badArraySyntax.ts(6,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/compiler/badArraySyntax.ts(7,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/compiler/badArraySyntax.ts(8,20): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/compiler/badArraySyntax.ts(9,20): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/compiler/badArraySyntax.ts(10,29): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/compiler/badArraySyntax.ts(10,40): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/badArraySyntax.ts(6,10): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/badArraySyntax.ts(7,10): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/badArraySyntax.ts(8,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/badArraySyntax.ts(9,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/badArraySyntax.ts(10,17): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -==== tests/cases/compiler/badArraySyntax.ts (6 errors) ==== +==== tests/cases/compiler/badArraySyntax.ts (5 errors) ==== class Z { public x = ""; } var a1: Z[] = []; var a2 = new Z[]; - ~~ + ~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var a3 = new Z[](); - ~~ + ~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var a4: Z[] = new Z[]; - ~~ + ~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var a5: Z[] = new Z[](); - ~~ + ~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var a6: Z[][] = new Z [ ] [ ]; - ~~~~~~~~ -!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. - ~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. \ No newline at end of file diff --git a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt index cfb9287cdbc..f0397f5ee60 100644 --- a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt +++ b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts(5,21): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts(5,9): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts(5,15): error TS2339: Property 'ClassA' does not exist on type 'typeof M'. @@ -8,7 +8,7 @@ tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts(5,15): error TS2339: Pr class ClassA {} } var t = new M.ClassA[]; - ~~ + ~~~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~ !!! error TS2339: Property 'ClassA' does not exist on type 'typeof M'. \ No newline at end of file diff --git a/tests/baselines/reference/commentsInterface.js b/tests/baselines/reference/commentsInterface.js index 1951137b048..bff79a02aa5 100644 --- a/tests/baselines/reference/commentsInterface.js +++ b/tests/baselines/reference/commentsInterface.js @@ -116,7 +116,7 @@ interface i2 { /** this is x*/ x: number; /** this is foo*/ - foo: (b: number) => string; + foo: (/**param help*/ b: number) => string; /** this is indexer*/ [/**string param*/ i: string]: any; /**new method*/ @@ -152,7 +152,7 @@ interface i3 { /** Function i3 f*/ f(/**number parameter*/ a: number): string; /** i3 l*/ - l: (b: number) => string; + l: (/**comment i3 l b*/ b: number) => string; nc_x: number; nc_f(a: number): string; nc_l: (b: number) => string; diff --git a/tests/baselines/reference/complicatedPrivacy.errors.txt b/tests/baselines/reference/complicatedPrivacy.errors.txt index e4867f0d2f5..fd47927f883 100644 --- a/tests/baselines/reference/complicatedPrivacy.errors.txt +++ b/tests/baselines/reference/complicatedPrivacy.errors.txt @@ -1,10 +1,8 @@ -tests/cases/compiler/complicatedPrivacy.ts(11,24): error TS1054: A 'get' accessor cannot have parameters. tests/cases/compiler/complicatedPrivacy.ts(24,38): error TS1005: ';' expected. -tests/cases/compiler/complicatedPrivacy.ts(35,6): error TS1022: An index signature parameter must have a type annotation. tests/cases/compiler/complicatedPrivacy.ts(73,49): error TS2305: Module 'mglo5' has no exported member 'i6'. -==== tests/cases/compiler/complicatedPrivacy.ts (4 errors) ==== +==== tests/cases/compiler/complicatedPrivacy.ts (2 errors) ==== module m1 { export module m2 { @@ -16,8 +14,6 @@ tests/cases/compiler/complicatedPrivacy.ts(73,49): error TS2305: Module 'mglo5' export class C2 implements m3.i3 { public get p1(arg) { - ~~ -!!! error TS1054: A 'get' accessor cannot have parameters. return new C1(); } @@ -44,8 +40,6 @@ tests/cases/compiler/complicatedPrivacy.ts(73,49): error TS2305: Module 'mglo5' export function f4(arg1: { [number]: C1; - ~~~~~~ -!!! error TS1022: An index signature parameter must have a type annotation. }) { } diff --git a/tests/baselines/reference/constDeclarations-es5.errors.txt b/tests/baselines/reference/constDeclarations-es5.errors.txt index 0b830eab05a..c928e6ae48e 100644 --- a/tests/baselines/reference/constDeclarations-es5.errors.txt +++ b/tests/baselines/reference/constDeclarations-es5.errors.txt @@ -1,17 +1,17 @@ -tests/cases/compiler/constDeclarations-es5.ts(2,1): error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. -tests/cases/compiler/constDeclarations-es5.ts(3,1): error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. -tests/cases/compiler/constDeclarations-es5.ts(4,1): error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/constDeclarations-es5.ts(2,7): error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/constDeclarations-es5.ts(3,7): error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/constDeclarations-es5.ts(4,7): error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. ==== tests/cases/compiler/constDeclarations-es5.ts (3 errors) ==== const z7 = false; - ~~~~~~~~~~~~~~~~~ + ~~ !!! error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. const z8: number = 23; - ~~~~~~~~~~~~~~~~~~~~~~ + ~~ !!! error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. const z9 = 0, z10 :string = "", z11 = null; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~ !!! error TS1154: 'const' declarations are only available when targeting ECMAScript 6 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/constructorTypeWithTypeParameters.js b/tests/baselines/reference/constructorTypeWithTypeParameters.js index 195536d5b15..9b93d54ba89 100644 --- a/tests/baselines/reference/constructorTypeWithTypeParameters.js +++ b/tests/baselines/reference/constructorTypeWithTypeParameters.js @@ -12,6 +12,10 @@ var anotherVar; //// [constructorTypeWithTypeParameters.d.ts] -declare var X: new () => number; -declare var Y: new () => number; +declare var X: { + new (): number; +}; +declare var Y: { + new (): number; +}; declare var anotherVar: new () => number; diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt index 0e91d11b280..53d24b3d0f8 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -7,14 +7,11 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,30): error TS tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,33): error TS1138: Parameter declaration expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,34): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(28,36): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(30,21): error TS1108: A 'return' statement can only be used within a function body. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(31,18): error TS1129: Statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(38,17): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,41): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,45): error TS1002: Unterminated string literal. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(43,21): error TS1108: A 'return' statement can only be used within a function body. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(46,13): error TS1005: 'try' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(55,13): error TS1108: A 'return' statement can only be used within a function body. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(58,5): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(69,13): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(72,37): error TS1127: Invalid character. @@ -30,18 +27,14 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,30): error T tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(205,28): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,10): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,36): error TS1005: ';' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(219,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(227,13): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(234,14): error TS1005: '{' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,9): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,27): error TS1005: ',' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(235,36): error TS1005: ';' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(236,13): error TS1108: A 'return' statement can only be used within a function body. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,9): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(238,26): error TS1005: ';' expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(239,13): error TS1108: A 'return' statement can only be used within a function body. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(241,5): error TS1128: Declaration or statement expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,67): error TS1093: Type annotation cannot appear on a constructor declaration. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(254,69): error TS1110: Type expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,9): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(256,31): error TS1005: ',' expected. @@ -95,7 +88,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,29): error T tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error TS2304: Cannot find name 'string'. -==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (95 errors) ==== +==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (88 errors) ==== declare module "fs" { export class File { constructor(filename: string); @@ -155,8 +148,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T !!! error TS2391: Function implementation is missing or not immediately following the declaration. return 1; - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. ^ ~ !!! error TS1129: Statement expected. @@ -190,8 +181,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T !!! error TS2304: Cannot find name 'retValue'. return 1; - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. } } catch (e) { @@ -210,8 +199,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T !!! error TS2304: Cannot find name 'console'. return 0; - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. } } @@ -420,8 +407,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T ~~~~~ !!! error TS2304: Cannot find name 'yield'. public get Property() { return 0; } - ~~~~~~~~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. public Member() { return 0; } @@ -457,8 +442,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T ~~~~~~ !!! error TS2304: Cannot find name 'number'. return val; - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. } public method2() { ~~~~~~ @@ -468,8 +451,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T ~~~~~~~ !!! error TS2304: Cannot find name 'method2'. return 2 * this.method1(2); - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. } } ~ @@ -489,8 +470,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T private otherValue = 42; constructor(private value: number, public name: string) : } - -!!! error TS1093: Type annotation cannot appear on a constructor declaration. ~ !!! error TS1110: Type expected. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/createArray.errors.txt b/tests/baselines/reference/createArray.errors.txt index 6f79c4b47d2..2e2b4567567 100644 --- a/tests/baselines/reference/createArray.errors.txt +++ b/tests/baselines/reference/createArray.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/createArray.ts(1,18): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/compiler/createArray.ts(6,6): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/compiler/createArray.ts(7,19): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/compiler/createArray.ts(8,18): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/createArray.ts(1,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/createArray.ts(6,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/createArray.ts(7,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/createArray.ts(8,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/compiler/createArray.ts(1,12): error TS2304: Cannot find name 'number'. tests/cases/compiler/createArray.ts(7,12): error TS2304: Cannot find name 'boolean'. tests/cases/compiler/createArray.ts(8,12): error TS2304: Cannot find name 'string'. @@ -9,7 +9,7 @@ tests/cases/compiler/createArray.ts(8,12): error TS2304: Cannot find name 'strin ==== tests/cases/compiler/createArray.ts (7 errors) ==== var na=new number[]; - ~~ + ~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~ !!! error TS2304: Cannot find name 'number'. @@ -18,15 +18,15 @@ tests/cases/compiler/createArray.ts(8,12): error TS2304: Cannot find name 'strin } new C[]; - ~~ + ~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. var ba=new boolean[]; - ~~ + ~~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~~ !!! error TS2304: Cannot find name 'boolean'. var sa=new string[]; - ~~ + ~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~ !!! error TS2304: Cannot find name 'string'. diff --git a/tests/baselines/reference/declFileAliasUseBeforeDeclaration.js b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.js new file mode 100644 index 00000000000..30ba24ed405 --- /dev/null +++ b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.js @@ -0,0 +1,29 @@ +//// [tests/cases/compiler/declFileAliasUseBeforeDeclaration.ts] //// + +//// [declFileAliasUseBeforeDeclaration_foo.ts] + +export class Foo { } + +//// [declFileAliasUseBeforeDeclaration_test.ts] +export function bar(a: foo.Foo) { } +import foo = require("declFileAliasUseBeforeDeclaration_foo"); + +//// [declFileAliasUseBeforeDeclaration_foo.js] +var Foo = (function () { + function Foo() { + } + return Foo; +})(); +exports.Foo = Foo; +//// [declFileAliasUseBeforeDeclaration_test.js] +function bar(a) { +} +exports.bar = bar; + + +//// [declFileAliasUseBeforeDeclaration_foo.d.ts] +export declare class Foo { +} +//// [declFileAliasUseBeforeDeclaration_test.d.ts] +export declare function bar(a: foo.Foo): void; +import foo = require("declFileAliasUseBeforeDeclaration_foo"); diff --git a/tests/baselines/reference/declFileAliasUseBeforeDeclaration.types b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.types new file mode 100644 index 00000000000..800df4ada49 --- /dev/null +++ b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.types @@ -0,0 +1,15 @@ +=== tests/cases/compiler/declFileAliasUseBeforeDeclaration_test.ts === +export function bar(a: foo.Foo) { } +>bar : (a: foo.Foo) => void +>a : foo.Foo +>foo : unknown +>Foo : foo.Foo + +import foo = require("declFileAliasUseBeforeDeclaration_foo"); +>foo : typeof foo + +=== tests/cases/compiler/declFileAliasUseBeforeDeclaration_foo.ts === + +export class Foo { } +>Foo : Foo + diff --git a/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.js b/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.js new file mode 100644 index 00000000000..905a298bd32 --- /dev/null +++ b/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.js @@ -0,0 +1,25 @@ +//// [declFileAliasUseBeforeDeclaration2.ts] + +declare module "test" { + module A { + class C { + } + } + class B extends E { + } + import E = A.C; +} + +//// [declFileAliasUseBeforeDeclaration2.js] + + +//// [declFileAliasUseBeforeDeclaration2.d.ts] +declare module "test" { + module A { + class C { + } + } + class B extends E { + } + import E = A.C; +} diff --git a/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.types b/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.types new file mode 100644 index 00000000000..362dd031e09 --- /dev/null +++ b/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.types @@ -0,0 +1,19 @@ +=== tests/cases/compiler/declFileAliasUseBeforeDeclaration2.ts === + +declare module "test" { + module A { +>A : typeof A + + class C { +>C : C + } + } + class B extends E { +>B : B +>E : E + } + import E = A.C; +>E : typeof E +>A : typeof A +>C : E +} diff --git a/tests/baselines/reference/declFileForInterfaceWithRestParams.js b/tests/baselines/reference/declFileForInterfaceWithRestParams.js index b2da71ba208..8979f7df6da 100644 --- a/tests/baselines/reference/declFileForInterfaceWithRestParams.js +++ b/tests/baselines/reference/declFileForInterfaceWithRestParams.js @@ -11,7 +11,7 @@ interface I { //// [declFileForInterfaceWithRestParams.d.ts] interface I { - foo(...x: any[]): any[]; - foo2(a: number, ...x: any[]): any[]; - foo3(b: string, ...x: string[]): string[]; + foo(...x: any[]): typeof x; + foo2(a: number, ...x: any[]): typeof x; + foo3(b: string, ...x: string[]): typeof x; } diff --git a/tests/baselines/reference/declFileGenericType.js b/tests/baselines/reference/declFileGenericType.js index ef8d6d453af..3c8120e8db9 100644 --- a/tests/baselines/reference/declFileGenericType.js +++ b/tests/baselines/reference/declFileGenericType.js @@ -120,9 +120,9 @@ export declare module C { class B { } function F(x: T): A; - function F2(x: T): A; - function F3(x: T): A[]; - function F4>(x: T): A[]; + function F2(x: T): C.A; + function F3(x: T): C.A[]; + function F4>(x: T): Array>; function F5(): T; function F6>(x: T): T; class D { diff --git a/tests/baselines/reference/declFileGenericType2.js b/tests/baselines/reference/declFileGenericType2.js index 0e0381cd87d..db1399e64d3 100644 --- a/tests/baselines/reference/declFileGenericType2.js +++ b/tests/baselines/reference/declFileGenericType2.js @@ -97,16 +97,16 @@ declare module templa.mvc { } } declare module templa.mvc { - interface IController { + interface IController { } } declare module templa.mvc { - class AbstractController implements IController { + class AbstractController implements mvc.IController { } } declare module templa.mvc.composite { - interface ICompositeControllerModel extends IModel { - getControllers(): IController[]; + interface ICompositeControllerModel extends mvc.IModel { + getControllers(): mvc.IController[]; } } declare module templa.dom.mvc { @@ -119,7 +119,7 @@ declare module templa.dom.mvc { } } declare module templa.dom.mvc.composite { - class AbstractCompositeElementController extends AbstractElementController { + class AbstractCompositeElementController extends templa.dom.mvc.AbstractElementController { _controllers: templa.mvc.IController[]; constructor(); } diff --git a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.js b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.js index 5ff631c6aad..2d071c80de9 100644 --- a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.js +++ b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.js @@ -32,8 +32,12 @@ var f6 = function () { //// [declFileRestParametersOfFunctionAndFunctionType.d.ts] declare function f1(...args: any[]): void; -declare function f2(x: (...args: any[]) => void): void; -declare function f3(x: (...args: any[]) => void): void; -declare function f4 void>(): void; -declare function f5 void>(): void; +declare function f2(x: (...args) => void): void; +declare function f3(x: { + (...args): void; +}): void; +declare function f4 void>(): void; +declare function f5(): void; declare var f6: () => any[]; diff --git a/tests/baselines/reference/declFileTypeAnnotationArrayType.js b/tests/baselines/reference/declFileTypeAnnotationArrayType.js new file mode 100644 index 00000000000..0a9d04d6bc7 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationArrayType.js @@ -0,0 +1,137 @@ +//// [declFileTypeAnnotationArrayType.ts] + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +function foo(): c[] { + return [new c()]; +} +function foo2() { + return [new c()]; +} + +// Qualified name +function foo3(): m.c[] { + return [new m.c()]; +} +function foo4() { + return m.c; +} + +// Just the name with type arguments +function foo5(): g[] { + return [new g()]; +} +function foo6() { + return [new g()]; +} + +// Qualified name with type arguments +function foo7(): m.g[] { + return [new m.g()]; +} +function foo8() { + return [new m.g()]; +} + +// Array of function types +function foo9(): (()=>c)[] { + return [() => new c()]; +} +function foo10() { + return [() => new c()]; +} + +//// [declFileTypeAnnotationArrayType.js] +var c = (function () { + function c() { + } + return c; +})(); +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; + var g = (function () { + function g() { + } + return g; + })(); + m.g = g; +})(m || (m = {})); +var g = (function () { + function g() { + } + return g; +})(); +// Just the name +function foo() { + return [new c()]; +} +function foo2() { + return [new c()]; +} +// Qualified name +function foo3() { + return [new m.c()]; +} +function foo4() { + return m.c; +} +// Just the name with type arguments +function foo5() { + return [new g()]; +} +function foo6() { + return [new g()]; +} +// Qualified name with type arguments +function foo7() { + return [new m.g()]; +} +function foo8() { + return [new m.g()]; +} +// Array of function types +function foo9() { + return [function () { return new c(); }]; +} +function foo10() { + return [function () { return new c(); }]; +} + + +//// [declFileTypeAnnotationArrayType.d.ts] +declare class c { +} +declare module m { + class c { + } + class g { + } +} +declare class g { +} +declare function foo(): c[]; +declare function foo2(): c[]; +declare function foo3(): m.c[]; +declare function foo4(): typeof m.c; +declare function foo5(): g[]; +declare function foo6(): g[]; +declare function foo7(): m.g[]; +declare function foo8(): m.g[]; +declare function foo9(): (() => c)[]; +declare function foo10(): (() => c)[]; diff --git a/tests/baselines/reference/declFileTypeAnnotationArrayType.types b/tests/baselines/reference/declFileTypeAnnotationArrayType.types new file mode 100644 index 00000000000..860d13af47c --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationArrayType.types @@ -0,0 +1,125 @@ +=== tests/cases/compiler/declFileTypeAnnotationArrayType.ts === + +class c { +>c : c +} +module m { +>m : typeof m + + export class c { +>c : c + } + export class g { +>g : g +>T : T + } +} +class g { +>g : g +>T : T +} + +// Just the name +function foo(): c[] { +>foo : () => c[] +>c : c + + return [new c()]; +>[new c()] : c[] +>new c() : c +>c : typeof c +} +function foo2() { +>foo2 : () => c[] + + return [new c()]; +>[new c()] : c[] +>new c() : c +>c : typeof c +} + +// Qualified name +function foo3(): m.c[] { +>foo3 : () => m.c[] +>m : unknown +>c : m.c + + return [new m.c()]; +>[new m.c()] : m.c[] +>new m.c() : m.c +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c +} +function foo4() { +>foo4 : () => typeof m.c + + return m.c; +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c +} + +// Just the name with type arguments +function foo5(): g[] { +>foo5 : () => g[] +>g : g + + return [new g()]; +>[new g()] : g[] +>new g() : g +>g : typeof g +} +function foo6() { +>foo6 : () => g[] + + return [new g()]; +>[new g()] : g[] +>new g() : g +>g : typeof g +} + +// Qualified name with type arguments +function foo7(): m.g[] { +>foo7 : () => m.g[] +>m : unknown +>g : m.g + + return [new m.g()]; +>[new m.g()] : m.g[] +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +} +function foo8() { +>foo8 : () => m.g[] + + return [new m.g()]; +>[new m.g()] : m.g[] +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +} + +// Array of function types +function foo9(): (()=>c)[] { +>foo9 : () => (() => c)[] +>c : c + + return [() => new c()]; +>[() => new c()] : (() => c)[] +>() => new c() : () => c +>new c() : c +>c : typeof c +} +function foo10() { +>foo10 : () => (() => c)[] + + return [() => new c()]; +>[() => new c()] : (() => c)[] +>() => new c() : () => c +>new c() : c +>c : typeof c +} diff --git a/tests/baselines/reference/declFileTypeAnnotationBuiltInType.js b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.js new file mode 100644 index 00000000000..fc877ab4b32 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.js @@ -0,0 +1,91 @@ +//// [declFileTypeAnnotationBuiltInType.ts] + +// string +function foo(): string { + return ""; +} +function foo2() { + return ""; +} + +// number +function foo3(): number { + return 10; +} +function foo4() { + return 10; +} + +// boolean +function foo5(): boolean { + return true; +} +function foo6() { + return false; +} + +// void +function foo7(): void { + return; +} +function foo8() { + return; +} + +// any +function foo9(): any { + return undefined; +} +function foo10() { + return undefined; +} + +//// [declFileTypeAnnotationBuiltInType.js] +// string +function foo() { + return ""; +} +function foo2() { + return ""; +} +// number +function foo3() { + return 10; +} +function foo4() { + return 10; +} +// boolean +function foo5() { + return true; +} +function foo6() { + return false; +} +// void +function foo7() { + return; +} +function foo8() { + return; +} +// any +function foo9() { + return undefined; +} +function foo10() { + return undefined; +} + + +//// [declFileTypeAnnotationBuiltInType.d.ts] +declare function foo(): string; +declare function foo2(): string; +declare function foo3(): number; +declare function foo4(): number; +declare function foo5(): boolean; +declare function foo6(): boolean; +declare function foo7(): void; +declare function foo8(): void; +declare function foo9(): any; +declare function foo10(): any; diff --git a/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types new file mode 100644 index 00000000000..ce4f5654a89 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types @@ -0,0 +1,63 @@ +=== tests/cases/compiler/declFileTypeAnnotationBuiltInType.ts === + +// string +function foo(): string { +>foo : () => string + + return ""; +} +function foo2() { +>foo2 : () => string + + return ""; +} + +// number +function foo3(): number { +>foo3 : () => number + + return 10; +} +function foo4() { +>foo4 : () => number + + return 10; +} + +// boolean +function foo5(): boolean { +>foo5 : () => boolean + + return true; +} +function foo6() { +>foo6 : () => boolean + + return false; +} + +// void +function foo7(): void { +>foo7 : () => void + + return; +} +function foo8() { +>foo8 : () => void + + return; +} + +// any +function foo9(): any { +>foo9 : () => any + + return undefined; +>undefined : undefined +} +function foo10() { +>foo10 : () => any + + return undefined; +>undefined : undefined +} diff --git a/tests/baselines/reference/declFileTypeAnnotationParenType.js b/tests/baselines/reference/declFileTypeAnnotationParenType.js new file mode 100644 index 00000000000..c61517c7339 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationParenType.js @@ -0,0 +1,32 @@ +//// [declFileTypeAnnotationParenType.ts] + +class c { + private p: string; +} + +var x: (() => c)[] = [() => new c()]; +var y = [() => new c()]; + +var k: (() => c) | string = (() => new c()) || ""; +var l = (() => new c()) || ""; + +//// [declFileTypeAnnotationParenType.js] +var c = (function () { + function c() { + } + return c; +})(); +var x = [function () { return new c(); }]; +var y = [function () { return new c(); }]; +var k = (function () { return new c(); }) || ""; +var l = (function () { return new c(); }) || ""; + + +//// [declFileTypeAnnotationParenType.d.ts] +declare class c { + private p; +} +declare var x: (() => c)[]; +declare var y: (() => c)[]; +declare var k: (() => c) | string; +declare var l: string | (() => c); diff --git a/tests/baselines/reference/declFileTypeAnnotationParenType.types b/tests/baselines/reference/declFileTypeAnnotationParenType.types new file mode 100644 index 00000000000..c904f1b3e5a --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationParenType.types @@ -0,0 +1,41 @@ +=== tests/cases/compiler/declFileTypeAnnotationParenType.ts === + +class c { +>c : c + + private p: string; +>p : string +} + +var x: (() => c)[] = [() => new c()]; +>x : (() => c)[] +>c : c +>[() => new c()] : (() => c)[] +>() => new c() : () => c +>new c() : c +>c : typeof c + +var y = [() => new c()]; +>y : (() => c)[] +>[() => new c()] : (() => c)[] +>() => new c() : () => c +>new c() : c +>c : typeof c + +var k: (() => c) | string = (() => new c()) || ""; +>k : string | (() => c) +>c : c +>(() => new c()) || "" : string | (() => c) +>(() => new c()) : () => c +>() => new c() : () => c +>new c() : c +>c : typeof c + +var l = (() => new c()) || ""; +>l : string | (() => c) +>(() => new c()) || "" : string | (() => c) +>(() => new c()) : () => c +>() => new c() : () => c +>new c() : c +>c : typeof c + diff --git a/tests/baselines/reference/declFileTypeAnnotationStringLiteral.js b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.js new file mode 100644 index 00000000000..faa76cc869c --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.js @@ -0,0 +1,26 @@ +//// [declFileTypeAnnotationStringLiteral.ts] + +function foo(a: "hello"): number; +function foo(a: "name"): string; +function foo(a: string): string | number; +function foo(a: string): string | number { + if (a === "hello") { + return a.length; + } + + return a; +} + +//// [declFileTypeAnnotationStringLiteral.js] +function foo(a) { + if (a === "hello") { + return a.length; + } + return a; +} + + +//// [declFileTypeAnnotationStringLiteral.d.ts] +declare function foo(a: "hello"): number; +declare function foo(a: "name"): string; +declare function foo(a: string): string | number; diff --git a/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types new file mode 100644 index 00000000000..d50d95f988b --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types @@ -0,0 +1,31 @@ +=== tests/cases/compiler/declFileTypeAnnotationStringLiteral.ts === + +function foo(a: "hello"): number; +>foo : { (a: "hello"): number; (a: "name"): string; (a: string): string | number; } +>a : "hello" + +function foo(a: "name"): string; +>foo : { (a: "hello"): number; (a: "name"): string; (a: string): string | number; } +>a : "name" + +function foo(a: string): string | number; +>foo : { (a: "hello"): number; (a: "name"): string; (a: string): string | number; } +>a : string + +function foo(a: string): string | number { +>foo : { (a: "hello"): number; (a: "name"): string; (a: string): string | number; } +>a : string + + if (a === "hello") { +>a === "hello" : boolean +>a : string + + return a.length; +>a.length : number +>a : string +>length : number + } + + return a; +>a : string +} diff --git a/tests/baselines/reference/declFileTypeAnnotationTupleType.js b/tests/baselines/reference/declFileTypeAnnotationTupleType.js new file mode 100644 index 00000000000..91d44c2b07f --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTupleType.js @@ -0,0 +1,68 @@ +//// [declFileTypeAnnotationTupleType.ts] + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +var k: [c, m.c] = [new c(), new m.c()]; +var l = k; + +var x: [g, m.g, () => c] = [new g(), new m.g(), () => new c()]; +var y = x; + +//// [declFileTypeAnnotationTupleType.js] +var c = (function () { + function c() { + } + return c; +})(); +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; + var g = (function () { + function g() { + } + return g; + })(); + m.g = g; +})(m || (m = {})); +var g = (function () { + function g() { + } + return g; +})(); +// Just the name +var k = [new c(), new m.c()]; +var l = k; +var x = [new g(), new m.g(), function () { return new c(); }]; +var y = x; + + +//// [declFileTypeAnnotationTupleType.d.ts] +declare class c { +} +declare module m { + class c { + } + class g { + } +} +declare class g { +} +declare var k: [c, m.c]; +declare var l: [c, m.c]; +declare var x: [g, m.g, () => c]; +declare var y: [g, m.g, () => c]; diff --git a/tests/baselines/reference/declFileTypeAnnotationTupleType.types b/tests/baselines/reference/declFileTypeAnnotationTupleType.types new file mode 100644 index 00000000000..88cf5a0c743 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTupleType.types @@ -0,0 +1,60 @@ +=== tests/cases/compiler/declFileTypeAnnotationTupleType.ts === + +class c { +>c : c +} +module m { +>m : typeof m + + export class c { +>c : c + } + export class g { +>g : g +>T : T + } +} +class g { +>g : g +>T : T +} + +// Just the name +var k: [c, m.c] = [new c(), new m.c()]; +>k : [c, m.c] +>c : c +>m : unknown +>c : m.c +>[new c(), new m.c()] : [c, m.c] +>new c() : c +>c : typeof c +>new m.c() : m.c +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c + +var l = k; +>l : [c, m.c] +>k : [c, m.c] + +var x: [g, m.g, () => c] = [new g(), new m.g(), () => new c()]; +>x : [g, m.g, () => c] +>g : g +>m : unknown +>g : m.g +>c : c +>[new g(), new m.g(), () => new c()] : [g, m.g, () => c] +>new g() : g +>g : typeof g +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +>() => new c() : () => c +>new c() : c +>c : typeof c + +var y = x; +>y : [g, m.g, () => c] +>x : [g, m.g, () => c] + diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeAlias.js b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.js new file mode 100644 index 00000000000..494603e286a --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.js @@ -0,0 +1,93 @@ +//// [declFileTypeAnnotationTypeAlias.ts] + +module M { + export type Value = string | number | boolean; + export var x: Value; + + export class c { + } + + export type C = c; + + export module m { + export class c { + } + } + + export type MC = m.c; + + export type fc = () => c; +} + +interface Window { + someMethod(); +} + +module M { + export type W = Window | string; + export module N { + export class Window { } + export var p: W; + } +} + +//// [declFileTypeAnnotationTypeAlias.js] +var M; +(function (M) { + M.x; + var c = (function () { + function c() { + } + return c; + })(); + M.c = c; + var m; + (function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; + })(m = M.m || (M.m = {})); +})(M || (M = {})); +var M; +(function (M) { + var N; + (function (N) { + var Window = (function () { + function Window() { + } + return Window; + })(); + N.Window = Window; + N.p; + })(N = M.N || (M.N = {})); +})(M || (M = {})); + + +//// [declFileTypeAnnotationTypeAlias.d.ts] +declare module M { + type Value = string | number | boolean; + var x: Value; + class c { + } + type C = c; + module m { + class c { + } + } + type MC = m.c; + type fc = () => c; +} +interface Window { + someMethod(): any; +} +declare module M { + type W = Window | string; + module N { + class Window { + } + var p: W; + } +} diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeAlias.types b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.types new file mode 100644 index 00000000000..aa475068bf0 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.types @@ -0,0 +1,63 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeAlias.ts === + +module M { +>M : typeof M + + export type Value = string | number | boolean; +>Value : string | number | boolean + + export var x: Value; +>x : string | number | boolean +>Value : string | number | boolean + + export class c { +>c : c + } + + export type C = c; +>C : c +>c : c + + export module m { +>m : typeof m + + export class c { +>c : c + } + } + + export type MC = m.c; +>MC : m.c +>m : unknown +>c : m.c + + export type fc = () => c; +>fc : () => c +>c : c +} + +interface Window { +>Window : Window + + someMethod(); +>someMethod : () => any +} + +module M { +>M : typeof M + + export type W = Window | string; +>W : string | Window +>Window : Window + + export module N { +>N : typeof N + + export class Window { } +>Window : Window + + export var p: W; +>p : string | Window +>W : string | Window + } +} diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.js b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.js new file mode 100644 index 00000000000..5e4a8ea714b --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.js @@ -0,0 +1,92 @@ +//// [declFileTypeAnnotationTypeLiteral.ts] + +class c { +} +class g { +} +module m { + export class c { + } +} + +// Object literal with everything +var x: { + // Call signatures + (a: number): c; + (a: string): g; + + // Construct signatures + new (a: number): c; + new (a: string): m.c; + + // Indexers + [n: number]: c; + [n: string]: c; + + // Properties + a: c; + b: g; + + // methods + m1(): g; + m2(a: string, b?: number, ...c: c[]): string; +}; + + +// Function type +var y: (a: string) => string; + +// constructor type +var z: new (a: string) => m.c; + +//// [declFileTypeAnnotationTypeLiteral.js] +var c = (function () { + function c() { + } + return c; +})(); +var g = (function () { + function g() { + } + return g; +})(); +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; +})(m || (m = {})); +// Object literal with everything +var x; +// Function type +var y; +// constructor type +var z; + + +//// [declFileTypeAnnotationTypeLiteral.d.ts] +declare class c { +} +declare class g { +} +declare module m { + class c { + } +} +declare var x: { + (a: number): c; + (a: string): g; + new (a: number): c; + new (a: string): m.c; + [n: number]: c; + [n: string]: c; + a: c; + b: g; + m1(): g; + m2(a: string, b?: number, ...c: c[]): string; +}; +declare var y: (a: string) => string; +declare var z: new (a: string) => m.c; diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.types b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.types new file mode 100644 index 00000000000..432ee1506fa --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.types @@ -0,0 +1,85 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeLiteral.ts === + +class c { +>c : c +} +class g { +>g : g +>T : T +} +module m { +>m : typeof m + + export class c { +>c : c + } +} + +// Object literal with everything +var x: { +>x : { (a: number): c; (a: string): g; new (a: number): c; new (a: string): m.c; [x: string]: c; [x: number]: c; a: c; b: g; m1(): g; m2(a: string, b?: number, ...c: c[]): string; } + + // Call signatures + (a: number): c; +>a : number +>c : c + + (a: string): g; +>a : string +>g : g + + // Construct signatures + new (a: number): c; +>a : number +>c : c + + new (a: string): m.c; +>a : string +>m : unknown +>c : m.c + + // Indexers + [n: number]: c; +>n : number +>c : c + + [n: string]: c; +>n : string +>c : c + + // Properties + a: c; +>a : c +>c : c + + b: g; +>b : g +>g : g + + // methods + m1(): g; +>m1 : () => g +>g : g + + m2(a: string, b?: number, ...c: c[]): string; +>m2 : (a: string, b?: number, ...c: c[]) => string +>a : string +>b : number +>c : c[] +>c : c + +}; + + +// Function type +var y: (a: string) => string; +>y : (a: string) => string +>a : string + +// constructor type +var z: new (a: string) => m.c; +>z : new (a: string) => m.c +>a : string +>m : unknown +>c : m.c + diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeQuery.js b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.js new file mode 100644 index 00000000000..28443bc04ad --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.js @@ -0,0 +1,120 @@ +//// [declFileTypeAnnotationTypeQuery.ts] + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +function foo(): typeof c { + return c; +} +function foo2() { + return c; +} + +// Qualified name +function foo3(): typeof m.c { + return m.c; +} +function foo4() { + return m.c; +} + +// Just the name with type arguments +function foo5(): typeof g { + return g; +} +function foo6() { + return g; +} + +// Qualified name with type arguments +function foo7(): typeof m.g { + return m.g +} +function foo8() { + return m.g +} + +//// [declFileTypeAnnotationTypeQuery.js] +var c = (function () { + function c() { + } + return c; +})(); +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; + var g = (function () { + function g() { + } + return g; + })(); + m.g = g; +})(m || (m = {})); +var g = (function () { + function g() { + } + return g; +})(); +// Just the name +function foo() { + return c; +} +function foo2() { + return c; +} +// Qualified name +function foo3() { + return m.c; +} +function foo4() { + return m.c; +} +// Just the name with type arguments +function foo5() { + return g; +} +function foo6() { + return g; +} +// Qualified name with type arguments +function foo7() { + return m.g; +} +function foo8() { + return m.g; +} + + +//// [declFileTypeAnnotationTypeQuery.d.ts] +declare class c { +} +declare module m { + class c { + } + class g { + } +} +declare class g { +} +declare function foo(): typeof c; +declare function foo2(): typeof c; +declare function foo3(): typeof m.c; +declare function foo4(): typeof m.c; +declare function foo5(): typeof g; +declare function foo6(): typeof g; +declare function foo7(): typeof m.g; +declare function foo8(): typeof m.g; diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeQuery.types b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.types new file mode 100644 index 00000000000..c7b5c421de1 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.types @@ -0,0 +1,90 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeQuery.ts === + +class c { +>c : c +} +module m { +>m : typeof m + + export class c { +>c : c + } + export class g { +>g : g +>T : T + } +} +class g { +>g : g +>T : T +} + +// Just the name +function foo(): typeof c { +>foo : () => typeof c +>c : typeof c + + return c; +>c : typeof c +} +function foo2() { +>foo2 : () => typeof c + + return c; +>c : typeof c +} + +// Qualified name +function foo3(): typeof m.c { +>foo3 : () => typeof m.c +>m : typeof m +>c : typeof m.c + + return m.c; +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c +} +function foo4() { +>foo4 : () => typeof m.c + + return m.c; +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c +} + +// Just the name with type arguments +function foo5(): typeof g { +>foo5 : () => typeof g +>g : typeof g + + return g; +>g : typeof g +} +function foo6() { +>foo6 : () => typeof g + + return g; +>g : typeof g +} + +// Qualified name with type arguments +function foo7(): typeof m.g { +>foo7 : () => typeof m.g +>m : typeof m +>g : typeof m.g + + return m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +} +function foo8() { +>foo8 : () => typeof m.g + + return m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +} diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeReference.js b/tests/baselines/reference/declFileTypeAnnotationTypeReference.js new file mode 100644 index 00000000000..3818f38d2c1 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeReference.js @@ -0,0 +1,120 @@ +//// [declFileTypeAnnotationTypeReference.ts] + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +function foo(): c { + return new c(); +} +function foo2() { + return new c(); +} + +// Qualified name +function foo3(): m.c { + return new m.c(); +} +function foo4() { + return new m.c(); +} + +// Just the name with type arguments +function foo5(): g { + return new g(); +} +function foo6() { + return new g(); +} + +// Qualified name with type arguments +function foo7(): m.g { + return new m.g(); +} +function foo8() { + return new m.g(); +} + +//// [declFileTypeAnnotationTypeReference.js] +var c = (function () { + function c() { + } + return c; +})(); +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; + var g = (function () { + function g() { + } + return g; + })(); + m.g = g; +})(m || (m = {})); +var g = (function () { + function g() { + } + return g; +})(); +// Just the name +function foo() { + return new c(); +} +function foo2() { + return new c(); +} +// Qualified name +function foo3() { + return new m.c(); +} +function foo4() { + return new m.c(); +} +// Just the name with type arguments +function foo5() { + return new g(); +} +function foo6() { + return new g(); +} +// Qualified name with type arguments +function foo7() { + return new m.g(); +} +function foo8() { + return new m.g(); +} + + +//// [declFileTypeAnnotationTypeReference.d.ts] +declare class c { +} +declare module m { + class c { + } + class g { + } +} +declare class g { +} +declare function foo(): c; +declare function foo2(): c; +declare function foo3(): m.c; +declare function foo4(): m.c; +declare function foo5(): g; +declare function foo6(): g; +declare function foo7(): m.g; +declare function foo8(): m.g; diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeReference.types b/tests/baselines/reference/declFileTypeAnnotationTypeReference.types new file mode 100644 index 00000000000..765c86c3415 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeReference.types @@ -0,0 +1,98 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeReference.ts === + +class c { +>c : c +} +module m { +>m : typeof m + + export class c { +>c : c + } + export class g { +>g : g +>T : T + } +} +class g { +>g : g +>T : T +} + +// Just the name +function foo(): c { +>foo : () => c +>c : c + + return new c(); +>new c() : c +>c : typeof c +} +function foo2() { +>foo2 : () => c + + return new c(); +>new c() : c +>c : typeof c +} + +// Qualified name +function foo3(): m.c { +>foo3 : () => m.c +>m : unknown +>c : m.c + + return new m.c(); +>new m.c() : m.c +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c +} +function foo4() { +>foo4 : () => m.c + + return new m.c(); +>new m.c() : m.c +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c +} + +// Just the name with type arguments +function foo5(): g { +>foo5 : () => g +>g : g + + return new g(); +>new g() : g +>g : typeof g +} +function foo6() { +>foo6 : () => g + + return new g(); +>new g() : g +>g : typeof g +} + +// Qualified name with type arguments +function foo7(): m.g { +>foo7 : () => m.g +>m : unknown +>g : m.g + + return new m.g(); +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +} +function foo8() { +>foo8 : () => m.g + + return new m.g(); +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +} diff --git a/tests/baselines/reference/declFileTypeAnnotationUnionType.js b/tests/baselines/reference/declFileTypeAnnotationUnionType.js new file mode 100644 index 00000000000..0a8e256ef28 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationUnionType.js @@ -0,0 +1,76 @@ +//// [declFileTypeAnnotationUnionType.ts] + +class c { + private p: string; +} +module m { + export class c { + private q: string; + } + export class g { + private r: string; + } +} +class g { + private s: string; +} + +// Just the name +var k: c | m.c = new c() || new m.c(); +var l = new c() || new m.c(); + +var x: g | m.g | (() => c) = new g() || new m.g() || (() => new c()); +var y = new g() || new m.g() || (() => new c()); + +//// [declFileTypeAnnotationUnionType.js] +var c = (function () { + function c() { + } + return c; +})(); +var m; +(function (m) { + var c = (function () { + function c() { + } + return c; + })(); + m.c = c; + var g = (function () { + function g() { + } + return g; + })(); + m.g = g; +})(m || (m = {})); +var g = (function () { + function g() { + } + return g; +})(); +// Just the name +var k = new c() || new m.c(); +var l = new c() || new m.c(); +var x = new g() || new m.g() || (function () { return new c(); }); +var y = new g() || new m.g() || (function () { return new c(); }); + + +//// [declFileTypeAnnotationUnionType.d.ts] +declare class c { + private p; +} +declare module m { + class c { + private q; + } + class g { + private r; + } +} +declare class g { + private s; +} +declare var k: c | m.c; +declare var l: c | m.c; +declare var x: g | m.g | (() => c); +declare var y: g | m.g | (() => c); diff --git a/tests/baselines/reference/declFileTypeAnnotationUnionType.types b/tests/baselines/reference/declFileTypeAnnotationUnionType.types new file mode 100644 index 00000000000..1dce3690bf8 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationUnionType.types @@ -0,0 +1,91 @@ +=== tests/cases/compiler/declFileTypeAnnotationUnionType.ts === + +class c { +>c : c + + private p: string; +>p : string +} +module m { +>m : typeof m + + export class c { +>c : c + + private q: string; +>q : string + } + export class g { +>g : g +>T : T + + private r: string; +>r : string + } +} +class g { +>g : g +>T : T + + private s: string; +>s : string +} + +// Just the name +var k: c | m.c = new c() || new m.c(); +>k : c | m.c +>c : c +>m : unknown +>c : m.c +>new c() || new m.c() : c | m.c +>new c() : c +>c : typeof c +>new m.c() : m.c +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c + +var l = new c() || new m.c(); +>l : c | m.c +>new c() || new m.c() : c | m.c +>new c() : c +>c : typeof c +>new m.c() : m.c +>m.c : typeof m.c +>m : typeof m +>c : typeof m.c + +var x: g | m.g | (() => c) = new g() || new m.g() || (() => new c()); +>x : g | m.g | (() => c) +>g : g +>m : unknown +>g : m.g +>c : c +>new g() || new m.g() || (() => new c()) : g | m.g | (() => c) +>new g() || new m.g() : g | m.g +>new g() : g +>g : typeof g +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +>(() => new c()) : () => c +>() => new c() : () => c +>new c() : c +>c : typeof c + +var y = new g() || new m.g() || (() => new c()); +>y : g | m.g | (() => c) +>new g() || new m.g() || (() => new c()) : g | m.g | (() => c) +>new g() || new m.g() : g | m.g +>new g() : g +>g : typeof g +>new m.g() : m.g +>m.g : typeof m.g +>m : typeof m +>g : typeof m.g +>(() => new c()) : () => c +>() => new c() : () => c +>new c() : c +>c : typeof c + diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt new file mode 100644 index 00000000000..b6130864d8b --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.errors.txt @@ -0,0 +1,133 @@ +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(16,21): error TS4043: Return type of public property getter from exported class has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(21,13): error TS4043: Return type of public property getter from exported class has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(26,25): error TS4037: Parameter 'foo3' of public property setter from exported class has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(33,25): error TS4037: Parameter 'foo4' of public property setter from exported class has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(37,21): error TS4043: Return type of public property getter from exported class has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(72,23): error TS4043: Return type of public property getter from exported class has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(77,13): error TS4042: Return type of public property getter from exported class has or is using name 'm2.public2' from private module 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(82,27): error TS4037: Parameter 'foo113' of public property setter from exported class has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(89,27): error TS4037: Parameter 'foo114' of public property setter from exported class has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts(93,23): error TS4043: Return type of public property getter from exported class has or is using private name 'm2'. + + +==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts (10 errors) ==== + + module m { + class private1 { + } + + export class public1 { + } + + module m2 { + export class public2 { + } + } + + export class c { + // getter with annotation + get foo1(): private1 { + ~~~~~~~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'private1'. + return; + } + + // getter without annotation + get foo2() { + ~~~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'private1'. + return new private1(); + } + + // setter with annotation + set foo3(param: private1) { + ~~~~~~~~ +!!! error TS4037: Parameter 'foo3' of public property setter from exported class has or is using private name 'private1'. + } + + // Both - getter without annotation, setter with annotation + get foo4() { + return new private1(); + } + set foo4(param: private1) { + ~~~~~~~~ +!!! error TS4037: Parameter 'foo4' of public property setter from exported class has or is using private name 'private1'. + } + + // Both - with annotation + get foo5(): private1 { + ~~~~~~~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'private1'. + return; + } + set foo5(param: private1) { + } + + // getter with annotation + get foo11(): public1 { + return; + } + + // getter without annotation + get foo12() { + return new public1(); + } + + // setter with annotation + set foo13(param: public1) { + } + + // Both - getter without annotation, setter with annotation + get foo14() { + return new public1(); + } + set foo14(param: public1) { + } + + // Both - with annotation + get foo15(): public1 { + return; + } + set foo15(param: public1) { + } + + // getter with annotation + get foo111(): m2.public2 { + ~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'm2'. + return; + } + + // getter without annotation + get foo112() { + ~~~~~~ +!!! error TS4042: Return type of public property getter from exported class has or is using name 'm2.public2' from private module 'm2'. + return new m2.public2(); + } + + // setter with annotation + set foo113(param: m2.public2) { + ~~ +!!! error TS4037: Parameter 'foo113' of public property setter from exported class has or is using private name 'm2'. + } + + // Both - getter without annotation, setter with annotation + get foo114() { + return new m2.public2(); + } + set foo114(param: m2.public2) { + ~~ +!!! error TS4037: Parameter 'foo114' of public property setter from exported class has or is using private name 'm2'. + } + + // Both - with annotation + get foo115(): m2.public2 { + ~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'm2'. + return; + } + set foo115(param: m2.public2) { + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.js new file mode 100644 index 00000000000..f7dc7a18260 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorAccessors.js @@ -0,0 +1,261 @@ +//// [declFileTypeAnnotationVisibilityErrorAccessors.ts] + +module m { + class private1 { + } + + export class public1 { + } + + module m2 { + export class public2 { + } + } + + export class c { + // getter with annotation + get foo1(): private1 { + return; + } + + // getter without annotation + get foo2() { + return new private1(); + } + + // setter with annotation + set foo3(param: private1) { + } + + // Both - getter without annotation, setter with annotation + get foo4() { + return new private1(); + } + set foo4(param: private1) { + } + + // Both - with annotation + get foo5(): private1 { + return; + } + set foo5(param: private1) { + } + + // getter with annotation + get foo11(): public1 { + return; + } + + // getter without annotation + get foo12() { + return new public1(); + } + + // setter with annotation + set foo13(param: public1) { + } + + // Both - getter without annotation, setter with annotation + get foo14() { + return new public1(); + } + set foo14(param: public1) { + } + + // Both - with annotation + get foo15(): public1 { + return; + } + set foo15(param: public1) { + } + + // getter with annotation + get foo111(): m2.public2 { + return; + } + + // getter without annotation + get foo112() { + return new m2.public2(); + } + + // setter with annotation + set foo113(param: m2.public2) { + } + + // Both - getter without annotation, setter with annotation + get foo114() { + return new m2.public2(); + } + set foo114(param: m2.public2) { + } + + // Both - with annotation + get foo115(): m2.public2 { + return; + } + set foo115(param: m2.public2) { + } + } +} + + +//// [declFileTypeAnnotationVisibilityErrorAccessors.js] +var m; +(function (m) { + var private1 = (function () { + function private1() { + } + return private1; + })(); + var public1 = (function () { + function public1() { + } + return public1; + })(); + m.public1 = public1; + var m2; + (function (m2) { + var public2 = (function () { + function public2() { + } + return public2; + })(); + m2.public2 = public2; + })(m2 || (m2 = {})); + var c = (function () { + function c() { + } + Object.defineProperty(c.prototype, "foo1", { + // getter with annotation + get: function () { + return; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo2", { + // getter without annotation + get: function () { + return new private1(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo3", { + // setter with annotation + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo4", { + // Both - getter without annotation, setter with annotation + get: function () { + return new private1(); + }, + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo5", { + // Both - with annotation + get: function () { + return; + }, + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo11", { + // getter with annotation + get: function () { + return; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo12", { + // getter without annotation + get: function () { + return new public1(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo13", { + // setter with annotation + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo14", { + // Both - getter without annotation, setter with annotation + get: function () { + return new public1(); + }, + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo15", { + // Both - with annotation + get: function () { + return; + }, + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo111", { + // getter with annotation + get: function () { + return; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo112", { + // getter without annotation + get: function () { + return new m2.public2(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo113", { + // setter with annotation + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo114", { + // Both - getter without annotation, setter with annotation + get: function () { + return new m2.public2(); + }, + set: function (param) { + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(c.prototype, "foo115", { + // Both - with annotation + get: function () { + return; + }, + set: function (param) { + }, + enumerable: true, + configurable: true + }); + return c; + })(); + m.c = c; +})(m || (m = {})); diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.errors.txt new file mode 100644 index 00000000000..7dbe3617de9 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.errors.txt @@ -0,0 +1,60 @@ +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts(15,34): error TS4078: Parameter 'param' of exported function has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts(17,26): error TS4078: Parameter 'param' of exported function has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts(40,35): error TS4078: Parameter 'param' of exported function has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts(42,28): error TS4077: Parameter 'param' of exported function has or is using name 'm2.public2' from private module 'm2'. + + +==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts (4 errors) ==== + + module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + function foo1(param: private1) { + } + function foo2(param = new private1()) { + } + + export function foo3(param : private1) { + ~~~~~~~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'private1'. + } + export function foo4(param = new private1()) { + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'private1'. + } + + function foo11(param: public1) { + } + function foo12(param = new public1()) { + } + + export function foo13(param: public1) { + } + export function foo14(param = new public1()) { + } + + module m2 { + export class public2 { + } + } + + function foo111(param: m2.public2) { + } + function foo112(param = new m2.public2()) { + } + + export function foo113(param: m2.public2) { + ~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'm2'. + } + export function foo114(param = new m2.public2()) { + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4077: Parameter 'param' of exported function has or is using name 'm2.public2' from private module 'm2'. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.js new file mode 100644 index 00000000000..4f66f0c8c7f --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorParameterOfFunction.js @@ -0,0 +1,108 @@ +//// [declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts] + +module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + function foo1(param: private1) { + } + function foo2(param = new private1()) { + } + + export function foo3(param : private1) { + } + export function foo4(param = new private1()) { + } + + function foo11(param: public1) { + } + function foo12(param = new public1()) { + } + + export function foo13(param: public1) { + } + export function foo14(param = new public1()) { + } + + module m2 { + export class public2 { + } + } + + function foo111(param: m2.public2) { + } + function foo112(param = new m2.public2()) { + } + + export function foo113(param: m2.public2) { + } + export function foo114(param = new m2.public2()) { + } +} + + +//// [declFileTypeAnnotationVisibilityErrorParameterOfFunction.js] +var m; +(function (m) { + var private1 = (function () { + function private1() { + } + return private1; + })(); + var public1 = (function () { + function public1() { + } + return public1; + })(); + m.public1 = public1; + // Directly using names from this module + function foo1(param) { + } + function foo2(param) { + if (param === void 0) { param = new private1(); } + } + function foo3(param) { + } + m.foo3 = foo3; + function foo4(param) { + if (param === void 0) { param = new private1(); } + } + m.foo4 = foo4; + function foo11(param) { + } + function foo12(param) { + if (param === void 0) { param = new public1(); } + } + function foo13(param) { + } + m.foo13 = foo13; + function foo14(param) { + if (param === void 0) { param = new public1(); } + } + m.foo14 = foo14; + var m2; + (function (m2) { + var public2 = (function () { + function public2() { + } + return public2; + })(); + m2.public2 = public2; + })(m2 || (m2 = {})); + function foo111(param) { + } + function foo112(param) { + if (param === void 0) { param = new m2.public2(); } + } + function foo113(param) { + } + m.foo113 = foo113; + function foo114(param) { + if (param === void 0) { param = new m2.public2(); } + } + m.foo114 = foo114; +})(m || (m = {})); diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.errors.txt new file mode 100644 index 00000000000..449af75bf61 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.errors.txt @@ -0,0 +1,72 @@ +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts(17,29): error TS4060: Return type of exported function has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts(20,21): error TS4060: Return type of exported function has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts(50,31): error TS4060: Return type of exported function has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts(53,21): error TS4059: Return type of exported function has or is using name 'm2.public2' from private module 'm2'. + + +==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts (4 errors) ==== + + module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + function foo1(): private1 { + return; + } + function foo2() { + return new private1(); + } + + export function foo3(): private1 { + ~~~~~~~~ +!!! error TS4060: Return type of exported function has or is using private name 'private1'. + return; + } + export function foo4() { + ~~~~ +!!! error TS4060: Return type of exported function has or is using private name 'private1'. + return new private1(); + } + + function foo11(): public1 { + return; + } + function foo12() { + return new public1(); + } + + export function foo13(): public1 { + return; + } + export function foo14() { + return new public1(); + } + + module m2 { + export class public2 { + } + } + + function foo111(): m2.public2 { + return; + } + function foo112() { + return new m2.public2(); + } + + export function foo113(): m2.public2 { + ~~ +!!! error TS4060: Return type of exported function has or is using private name 'm2'. + return; + } + export function foo114() { + ~~~~~~ +!!! error TS4059: Return type of exported function has or is using name 'm2.public2' from private module 'm2'. + return new m2.public2(); + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.js new file mode 100644 index 00000000000..e12d9ebca63 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.js @@ -0,0 +1,126 @@ +//// [declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts] + +module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + function foo1(): private1 { + return; + } + function foo2() { + return new private1(); + } + + export function foo3(): private1 { + return; + } + export function foo4() { + return new private1(); + } + + function foo11(): public1 { + return; + } + function foo12() { + return new public1(); + } + + export function foo13(): public1 { + return; + } + export function foo14() { + return new public1(); + } + + module m2 { + export class public2 { + } + } + + function foo111(): m2.public2 { + return; + } + function foo112() { + return new m2.public2(); + } + + export function foo113(): m2.public2 { + return; + } + export function foo114() { + return new m2.public2(); + } +} + + +//// [declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.js] +var m; +(function (m) { + var private1 = (function () { + function private1() { + } + return private1; + })(); + var public1 = (function () { + function public1() { + } + return public1; + })(); + m.public1 = public1; + // Directly using names from this module + function foo1() { + return; + } + function foo2() { + return new private1(); + } + function foo3() { + return; + } + m.foo3 = foo3; + function foo4() { + return new private1(); + } + m.foo4 = foo4; + function foo11() { + return; + } + function foo12() { + return new public1(); + } + function foo13() { + return; + } + m.foo13 = foo13; + function foo14() { + return new public1(); + } + m.foo14 = foo14; + var m2; + (function (m2) { + var public2 = (function () { + function public2() { + } + return public2; + })(); + m2.public2 = public2; + })(m2 || (m2 = {})); + function foo111() { + return; + } + function foo112() { + return new m2.public2(); + } + function foo113() { + return; + } + m.foo113 = foo113; + function foo114() { + return new m2.public2(); + } + m.foo114 = foo114; +})(m || (m = {})); diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.errors.txt new file mode 100644 index 00000000000..a9fd72ae569 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.errors.txt @@ -0,0 +1,56 @@ +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts(10,23): error TS4025: Exported variable 'p' has or is using private name 'W'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts(33,22): error TS4081: Exported type alias 't2' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts(36,23): error TS4081: Exported type alias 't12' has or is using private name 'public1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts(39,24): error TS4081: Exported type alias 't112' has or is using private name 'm3'. + + +==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts (4 errors) ==== + + interface Window { + someMethod(); + } + + module M { + type W = Window | string; + export module N { + export class Window { } + export var p: W; // Should report error that W is private + ~ +!!! error TS4025: Exported variable 'p' has or is using private name 'W'. + } + } + + module M1 { + export type W = Window | string; + export module N { + export class Window { } + export var p: W; // No error + } + } + + module M2 { + class private1 { + } + class public1 { + } + module m3 { + export class public1 { + } + } + + type t1 = private1; + export type t2 = private1; // error + ~~~~~~~~ +!!! error TS4081: Exported type alias 't2' has or is using private name 'private1'. + + type t11 = public1; + export type t12 = public1; + ~~~~~~~ +!!! error TS4081: Exported type alias 't12' has or is using private name 'public1'. + + type t111 = m3.public1; + export type t112 = m3.public1; // error + ~~ +!!! error TS4081: Exported type alias 't112' has or is using private name 'm3'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.js new file mode 100644 index 00000000000..ec653c84dc9 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.js @@ -0,0 +1,92 @@ +//// [declFileTypeAnnotationVisibilityErrorTypeAlias.ts] + +interface Window { + someMethod(); +} + +module M { + type W = Window | string; + export module N { + export class Window { } + export var p: W; // Should report error that W is private + } +} + +module M1 { + export type W = Window | string; + export module N { + export class Window { } + export var p: W; // No error + } +} + +module M2 { + class private1 { + } + class public1 { + } + module m3 { + export class public1 { + } + } + + type t1 = private1; + export type t2 = private1; // error + + type t11 = public1; + export type t12 = public1; + + type t111 = m3.public1; + export type t112 = m3.public1; // error +} + + +//// [declFileTypeAnnotationVisibilityErrorTypeAlias.js] +var M; +(function (M) { + var N; + (function (N) { + var Window = (function () { + function Window() { + } + return Window; + })(); + N.Window = Window; + N.p; // Should report error that W is private + })(N = M.N || (M.N = {})); +})(M || (M = {})); +var M1; +(function (M1) { + var N; + (function (N) { + var Window = (function () { + function Window() { + } + return Window; + })(); + N.Window = Window; + N.p; // No error + })(N = M1.N || (M1.N = {})); +})(M1 || (M1 = {})); +var M2; +(function (M2) { + var private1 = (function () { + function private1() { + } + return private1; + })(); + var public1 = (function () { + function public1() { + } + return public1; + })(); + var m3; + (function (m3) { + var public1 = (function () { + function public1() { + } + return public1; + })(); + m3.public1 = public1; + })(m3 || (m3 = {})); +})(M2 || (M2 = {})); diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.errors.txt new file mode 100644 index 00000000000..8cba0d12464 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.errors.txt @@ -0,0 +1,91 @@ +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(11,12): error TS4025: Exported variable 'x' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(12,12): error TS4025: Exported variable 'x' has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(13,13): error TS4025: Exported variable 'x' has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(14,19): error TS4025: Exported variable 'x' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(15,22): error TS4025: Exported variable 'x' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(16,22): error TS4025: Exported variable 'x' has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(18,16): error TS4024: Exported variable 'x2' has or is using name 'm2.public1' from private module 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(18,16): error TS4025: Exported variable 'x2' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(25,16): error TS4024: Exported variable 'x3' has or is using name 'm2.public1' from private module 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(25,16): error TS4025: Exported variable 'x3' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(28,23): error TS4025: Exported variable 'y' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(28,36): error TS4025: Exported variable 'y' has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(29,16): error TS4024: Exported variable 'y2' has or is using name 'm2.public1' from private module 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(29,16): error TS4025: Exported variable 'y2' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(32,27): error TS4025: Exported variable 'z' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(32,40): error TS4025: Exported variable 'z' has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(33,16): error TS4024: Exported variable 'z2' has or is using name 'm2.public1' from private module 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts(33,16): error TS4025: Exported variable 'z2' has or is using private name 'private1'. + + +==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts (18 errors) ==== + + module m { + class private1 { + } + module m2 { + export class public1 { + } + } + + export var x: { + x: private1; + ~~~~~~~~ +!!! error TS4025: Exported variable 'x' has or is using private name 'private1'. + y: m2.public1; + ~~ +!!! error TS4025: Exported variable 'x' has or is using private name 'm2'. + (): m2.public1[]; + ~~ +!!! error TS4025: Exported variable 'x' has or is using private name 'm2'. + method(): private1; + ~~~~~~~~ +!!! error TS4025: Exported variable 'x' has or is using private name 'private1'. + [n: number]: private1; + ~~~~~~~~ +!!! error TS4025: Exported variable 'x' has or is using private name 'private1'. + [s: string]: m2.public1; + ~~ +!!! error TS4025: Exported variable 'x' has or is using private name 'm2'. + }; + export var x2 = { + ~~ +!!! error TS4024: Exported variable 'x2' has or is using name 'm2.public1' from private module 'm2'. + ~~ +!!! error TS4025: Exported variable 'x2' has or is using private name 'private1'. + x: new private1(), + y: new m2.public1(), + method() { + return new private1(); + } + }; + export var x3 = x; + ~~ +!!! error TS4024: Exported variable 'x3' has or is using name 'm2.public1' from private module 'm2'. + ~~ +!!! error TS4025: Exported variable 'x3' has or is using private name 'private1'. + + // Function type + export var y: (a: private1) => m2.public1; + ~~~~~~~~ +!!! error TS4025: Exported variable 'y' has or is using private name 'private1'. + ~~ +!!! error TS4025: Exported variable 'y' has or is using private name 'm2'. + export var y2 = y; + ~~ +!!! error TS4024: Exported variable 'y2' has or is using name 'm2.public1' from private module 'm2'. + ~~ +!!! error TS4025: Exported variable 'y2' has or is using private name 'private1'. + + // constructor type + export var z: new (a: private1) => m2.public1; + ~~~~~~~~ +!!! error TS4025: Exported variable 'z' has or is using private name 'private1'. + ~~ +!!! error TS4025: Exported variable 'z' has or is using private name 'm2'. + export var z2 = z; + ~~ +!!! error TS4024: Exported variable 'z2' has or is using name 'm2.public1' from private module 'm2'. + ~~ +!!! error TS4025: Exported variable 'z2' has or is using private name 'private1'. + } \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.js new file mode 100644 index 00000000000..f6bd1689e60 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeLiteral.js @@ -0,0 +1,69 @@ +//// [declFileTypeAnnotationVisibilityErrorTypeLiteral.ts] + +module m { + class private1 { + } + module m2 { + export class public1 { + } + } + + export var x: { + x: private1; + y: m2.public1; + (): m2.public1[]; + method(): private1; + [n: number]: private1; + [s: string]: m2.public1; + }; + export var x2 = { + x: new private1(), + y: new m2.public1(), + method() { + return new private1(); + } + }; + export var x3 = x; + + // Function type + export var y: (a: private1) => m2.public1; + export var y2 = y; + + // constructor type + export var z: new (a: private1) => m2.public1; + export var z2 = z; +} + +//// [declFileTypeAnnotationVisibilityErrorTypeLiteral.js] +var m; +(function (m) { + var private1 = (function () { + function private1() { + } + return private1; + })(); + var m2; + (function (m2) { + var public1 = (function () { + function public1() { + } + return public1; + })(); + m2.public1 = public1; + })(m2 || (m2 = {})); + m.x; + m.x2 = { + x: new private1(), + y: new m2.public1(), + method: function () { + return new private1(); + } + }; + m.x3 = m.x; + // Function type + m.y; + m.y2 = m.y; + // constructor type + m.z; + m.z2 = m.z; +})(m || (m = {})); diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.errors.txt b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.errors.txt new file mode 100644 index 00000000000..33771b85dd4 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.errors.txt @@ -0,0 +1,48 @@ +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts(13,19): error TS4025: Exported variable 'k' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts(14,16): error TS4025: Exported variable 'l' has or is using private name 'private1'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts(30,20): error TS4025: Exported variable 'k3' has or is using private name 'm2'. +tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts(31,16): error TS4024: Exported variable 'l3' has or is using name 'm2.public2' from private module 'm2'. + + +==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts (4 errors) ==== + + module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + var x: private1; + var y = new private1(); + + export var k: private1; + ~~~~~~~~ +!!! error TS4025: Exported variable 'k' has or is using private name 'private1'. + export var l = new private1(); + ~ +!!! error TS4025: Exported variable 'l' has or is using private name 'private1'. + + var x2: public1; + var y2 = new public1(); + + export var k2: public1; + export var l2 = new public1(); + + module m2 { + export class public2 { + } + } + + var x3: m2.public2; + var y3 = new m2.public2(); + + export var k3: m2.public2; + ~~ +!!! error TS4025: Exported variable 'k3' has or is using private name 'm2'. + export var l3 = new m2.public2(); + ~~ +!!! error TS4024: Exported variable 'l3' has or is using name 'm2.public2' from private module 'm2'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.js b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.js new file mode 100644 index 00000000000..a097ac159db --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorVariableDeclaration.js @@ -0,0 +1,72 @@ +//// [declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts] + +module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + var x: private1; + var y = new private1(); + + export var k: private1; + export var l = new private1(); + + var x2: public1; + var y2 = new public1(); + + export var k2: public1; + export var l2 = new public1(); + + module m2 { + export class public2 { + } + } + + var x3: m2.public2; + var y3 = new m2.public2(); + + export var k3: m2.public2; + export var l3 = new m2.public2(); +} + + +//// [declFileTypeAnnotationVisibilityErrorVariableDeclaration.js] +var m; +(function (m) { + var private1 = (function () { + function private1() { + } + return private1; + })(); + var public1 = (function () { + function public1() { + } + return public1; + })(); + m.public1 = public1; + // Directly using names from this module + var x; + var y = new private1(); + m.k; + m.l = new private1(); + var x2; + var y2 = new public1(); + m.k2; + m.l2 = new public1(); + var m2; + (function (m2) { + var public2 = (function () { + function public2() { + } + return public2; + })(); + m2.public2 = public2; + })(m2 || (m2 = {})); + var x3; + var y3 = new m2.public2(); + m.k3; + m.l3 = new m2.public2(); +})(m || (m = {})); diff --git a/tests/baselines/reference/declFileTypeofFunction.js b/tests/baselines/reference/declFileTypeofFunction.js index ea876e6dad8..2af519f411d 100644 --- a/tests/baselines/reference/declFileTypeofFunction.js +++ b/tests/baselines/reference/declFileTypeofFunction.js @@ -68,7 +68,7 @@ declare function f(n: typeof f): string; declare function f(n: typeof g): string; declare function g(n: typeof g): number; declare function g(n: typeof f): number; -declare var b: () => any; +declare var b: () => typeof b; declare function b1(): typeof b1; declare function foo(): typeof foo; declare var foo1: typeof foo; diff --git a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js index 0bcbf2fff68..7da7dd8716a 100644 --- a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js +++ b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js @@ -78,7 +78,7 @@ declare module X.Y.base { } } declare module X.Y.base.Z { - class W extends base.W { + class W extends X.Y.base.W { value: boolean; } } diff --git a/tests/baselines/reference/declInput-2.errors.txt b/tests/baselines/reference/declInput-2.errors.txt index ed0be8f64e5..f151f3e7122 100644 --- a/tests/baselines/reference/declInput-2.errors.txt +++ b/tests/baselines/reference/declInput-2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/declInput-2.ts(10,9): error TS4031: Public property 'm22' of exported class has or is using private name 'C'. -tests/cases/compiler/declInput-2.ts(13,9): error TS4031: Public property 'm25' of exported class has or is using private name 'I2'. -tests/cases/compiler/declInput-2.ts(16,16): error TS4055: Return type of public method from exported class has or is using private name 'I2'. -tests/cases/compiler/declInput-2.ts(18,21): error TS4073: Parameter 'i' of public method from exported class has or is using private name 'I2'. -tests/cases/compiler/declInput-2.ts(19,16): error TS4055: Return type of public method from exported class has or is using private name 'C'. +tests/cases/compiler/declInput-2.ts(10,21): error TS4031: Public property 'm22' of exported class has or is using private name 'C'. +tests/cases/compiler/declInput-2.ts(13,21): error TS4031: Public property 'm25' of exported class has or is using private name 'I2'. +tests/cases/compiler/declInput-2.ts(16,24): error TS4055: Return type of public method from exported class has or is using private name 'I2'. +tests/cases/compiler/declInput-2.ts(18,23): error TS4073: Parameter 'i' of public method from exported class has or is using private name 'I2'. +tests/cases/compiler/declInput-2.ts(19,21): error TS4055: Return type of public method from exported class has or is using private name 'C'. ==== tests/cases/compiler/declInput-2.ts (5 errors) ==== @@ -16,24 +16,24 @@ tests/cases/compiler/declInput-2.ts(19,16): error TS4055: Return type of public public m1: number; public m2: string; public m22: C; // don't generate - ~~~~~~~~~~~~~~ + ~ !!! error TS4031: Public property 'm22' of exported class has or is using private name 'C'. public m23: E; public m24: I1; public m25: I2; // don't generate - ~~~~~~~~~~~~~~~ + ~~ !!! error TS4031: Public property 'm25' of exported class has or is using private name 'I2'. public m232(): E { return null;} public m242(): I1 { return null; } public m252(): I2 { return null; } // don't generate - ~~~~ + ~~ !!! error TS4055: Return type of public method from exported class has or is using private name 'I2'. public m26(i:I1) {} public m262(i:I2) {} - ~~~~ + ~~ !!! error TS4073: Parameter 'i' of public method from exported class has or is using private name 'I2'. public m3():C { return new C(); } - ~~ + ~ !!! error TS4055: Return type of public method from exported class has or is using private name 'C'. } } \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmit_nameConflicts.js b/tests/baselines/reference/declarationEmit_nameConflicts.js index ab2e5fce42a..161224659f1 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts.js +++ b/tests/baselines/reference/declarationEmit_nameConflicts.js @@ -184,7 +184,7 @@ export declare module M.Q { interface I { } } - interface b extends M.C { + interface b extends M.b { } interface I extends M.c.I { } diff --git a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.errors.txt b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.errors.txt index b58d5ad8ffe..ca589fb13ed 100644 --- a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.errors.txt +++ b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.errors.txt @@ -1,9 +1,5 @@ tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(8,8): error TS1110: Type expected. -tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(16,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(20,15): error TS1110: Type expected. -tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(24,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(28,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(8,8): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(10,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(13,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors @@ -14,7 +10,7 @@ tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassS tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts(29,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors -==== tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts (14 errors) ==== +==== tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassSuperCallsInNonConstructorMembers.ts (10 errors) ==== // error to use super calls outside a constructor class Base { @@ -33,16 +29,12 @@ tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassS !!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors } get C() { - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ !!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors return 1; } set C(v) { - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ !!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors @@ -59,16 +51,12 @@ tests/cases/conformance/classes/constructorDeclarations/superCalls/derivedClassS !!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors } static get C() { - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ !!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors return 1; } static set C(v) { - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ !!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors diff --git a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt index cd2402161c3..5f6f15791f6 100644 --- a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt +++ b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt @@ -1,22 +1,16 @@ -tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(3,5): error TS1098: Type parameter list cannot be empty. -tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(3,6): error TS1005: '(' expected. tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(3,6): error TS1139: Type parameter declaration expected. tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(4,1): error TS1109: Expression expected. tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(1,5): error TS2322: Type 'number' is not assignable to type '{ (): any; x: number; }'. Property 'x' is missing in type 'Number'. -==== tests/cases/compiler/dontShowCompilerGeneratedMembers.ts (5 errors) ==== +==== tests/cases/compiler/dontShowCompilerGeneratedMembers.ts (3 errors) ==== var f: { ~ !!! error TS2322: Type 'number' is not assignable to type '{ (): any; x: number; }'. !!! error TS2322: Property 'x' is missing in type 'Number'. x: number; <- - ~ -!!! error TS1098: Type parameter list cannot be empty. - ~ -!!! error TS1005: '(' expected. ~ !!! error TS1139: Type parameter declaration expected. }; diff --git a/tests/baselines/reference/duplicateObjectLiteralProperty.errors.txt b/tests/baselines/reference/duplicateObjectLiteralProperty.errors.txt index 4c3f6d1eb7e..05dfdc82404 100644 --- a/tests/baselines/reference/duplicateObjectLiteralProperty.errors.txt +++ b/tests/baselines/reference/duplicateObjectLiteralProperty.errors.txt @@ -1,6 +1,3 @@ -tests/cases/compiler/duplicateObjectLiteralProperty.ts(14,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/duplicateObjectLiteralProperty.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/duplicateObjectLiteralProperty.ts(16,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/duplicateObjectLiteralProperty.ts(16,9): error TS1118: An object literal cannot have multiple get/set accessors with the same name. tests/cases/compiler/duplicateObjectLiteralProperty.ts(2,5): error TS2300: Duplicate identifier 'a'. tests/cases/compiler/duplicateObjectLiteralProperty.ts(4,5): error TS2300: Duplicate identifier 'a'. @@ -13,7 +10,7 @@ tests/cases/compiler/duplicateObjectLiteralProperty.ts(15,9): error TS2300: Dupl tests/cases/compiler/duplicateObjectLiteralProperty.ts(16,9): error TS2300: Duplicate identifier 'a'. -==== tests/cases/compiler/duplicateObjectLiteralProperty.ts (13 errors) ==== +==== tests/cases/compiler/duplicateObjectLiteralProperty.ts (10 errors) ==== var x = { a: 1, ~ @@ -41,18 +38,12 @@ tests/cases/compiler/duplicateObjectLiteralProperty.ts(16,9): error TS2300: Dupl var y = { get a() { return 0; }, ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - ~ !!! error TS2300: Duplicate identifier 'a'. set a(v: number) { }, ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - ~ !!! error TS2300: Duplicate identifier 'a'. get a() { return 0; } ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - ~ !!! error TS1118: An object literal cannot have multiple get/set accessors with the same name. ~ !!! error TS2300: Duplicate identifier 'a'. diff --git a/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt b/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt index 235b665cdc0..e6859558f74 100644 --- a/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt +++ b/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,28): error TS1003: Identifier expected. +tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,29): error TS1003: Identifier expected. tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,9): error TS2304: Cannot find name 'IgnoreRulesSpecific'. @@ -7,7 +7,7 @@ tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,9): error TS2304: Ca IgnoreRulesSpecific = 0, } var x = IgnoreRulesSpecific. - ~ + !!! error TS1003: Identifier expected. ~~~~~~~~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'IgnoreRulesSpecific'. diff --git a/tests/baselines/reference/enumMemberResolution.errors.txt b/tests/baselines/reference/enumMemberResolution.errors.txt index 5c84c08d984..f446c0d7909 100644 --- a/tests/baselines/reference/enumMemberResolution.errors.txt +++ b/tests/baselines/reference/enumMemberResolution.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/enumMemberResolution.ts(4,28): error TS1003: Identifier expected. +tests/cases/compiler/enumMemberResolution.ts(4,29): error TS1003: Identifier expected. tests/cases/compiler/enumMemberResolution.ts(4,9): error TS2304: Cannot find name 'IgnoreRulesSpecific'. @@ -7,7 +7,7 @@ tests/cases/compiler/enumMemberResolution.ts(4,9): error TS2304: Cannot find nam IgnoreRulesSpecific = 0 } var x = IgnoreRulesSpecific. // error - ~ + !!! error TS1003: Identifier expected. ~~~~~~~~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'IgnoreRulesSpecific'. diff --git a/tests/baselines/reference/errorSuperCalls.errors.txt b/tests/baselines/reference/errorSuperCalls.errors.txt index 4369b4b4ab2..82c0a4e8279 100644 --- a/tests/baselines/reference/errorSuperCalls.errors.txt +++ b/tests/baselines/reference/errorSuperCalls.errors.txt @@ -1,10 +1,4 @@ -tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(13,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(17,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(33,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(37,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(46,14): error TS1034: 'super' must be followed by an argument list or member access. -tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(66,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(70,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(4,9): error TS2335: 'super' can only be referenced in a derived class. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(9,9): error TS2335: 'super' can only be referenced in a derived class. tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(14,9): error TS2335: 'super' can only be referenced in a derived class. @@ -20,7 +14,7 @@ tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(67,9): error T tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(71,9): error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors -==== tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts (20 errors) ==== +==== tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts (14 errors) ==== //super call in class constructor with no base type class NoBase { constructor() { @@ -38,16 +32,12 @@ tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(71,9): error T //super call in class accessor (get and set) with no base type get foo() { - ~~~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ !!! error TS2335: 'super' can only be referenced in a derived class. return null; } set foo(v) { - ~~~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ !!! error TS2335: 'super' can only be referenced in a derived class. @@ -72,16 +62,12 @@ tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(71,9): error T //super call in static class accessor (get and set) with no base type static get q() { - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ !!! error TS2335: 'super' can only be referenced in a derived class. return null; } static set q(n) { - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ !!! error TS2335: 'super' can only be referenced in a derived class. @@ -119,16 +105,12 @@ tests/cases/conformance/expressions/superCalls/errorSuperCalls.ts(71,9): error T //super call in class accessor (get and set) of derived type get foo() { - ~~~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ !!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors return null; } set foo(n) { - ~~~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. super(); ~~~~~ !!! error TS2337: Super calls are not permitted outside constructors or in nested functions inside constructors diff --git a/tests/baselines/reference/exportAlreadySeen.errors.txt b/tests/baselines/reference/exportAlreadySeen.errors.txt index eb9f0ce1a95..707b34c8d25 100644 --- a/tests/baselines/reference/exportAlreadySeen.errors.txt +++ b/tests/baselines/reference/exportAlreadySeen.errors.txt @@ -1,16 +1,12 @@ tests/cases/compiler/exportAlreadySeen.ts(2,12): error TS1030: 'export' modifier already seen. tests/cases/compiler/exportAlreadySeen.ts(3,12): error TS1030: 'export' modifier already seen. tests/cases/compiler/exportAlreadySeen.ts(5,12): error TS1030: 'export' modifier already seen. -tests/cases/compiler/exportAlreadySeen.ts(6,16): error TS1030: 'export' modifier already seen. -tests/cases/compiler/exportAlreadySeen.ts(7,16): error TS1030: 'export' modifier already seen. tests/cases/compiler/exportAlreadySeen.ts(12,12): error TS1030: 'export' modifier already seen. tests/cases/compiler/exportAlreadySeen.ts(13,12): error TS1030: 'export' modifier already seen. tests/cases/compiler/exportAlreadySeen.ts(15,12): error TS1030: 'export' modifier already seen. -tests/cases/compiler/exportAlreadySeen.ts(16,16): error TS1030: 'export' modifier already seen. -tests/cases/compiler/exportAlreadySeen.ts(17,16): error TS1030: 'export' modifier already seen. -==== tests/cases/compiler/exportAlreadySeen.ts (10 errors) ==== +==== tests/cases/compiler/exportAlreadySeen.ts (6 errors) ==== module M { export export var x = 1; ~~~~~~ @@ -23,11 +19,7 @@ tests/cases/compiler/exportAlreadySeen.ts(17,16): error TS1030: 'export' modifie ~~~~~~ !!! error TS1030: 'export' modifier already seen. export export class C { } - ~~~~~~ -!!! error TS1030: 'export' modifier already seen. export export interface I { } - ~~~~~~ -!!! error TS1030: 'export' modifier already seen. } } @@ -43,10 +35,6 @@ tests/cases/compiler/exportAlreadySeen.ts(17,16): error TS1030: 'export' modifie ~~~~~~ !!! error TS1030: 'export' modifier already seen. export export class C { } - ~~~~~~ -!!! error TS1030: 'export' modifier already seen. export export interface I { } - ~~~~~~ -!!! error TS1030: 'export' modifier already seen. } } \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentWithDeclareAndExportModifiers.errors.txt b/tests/baselines/reference/exportAssignmentWithDeclareAndExportModifiers.errors.txt index 20355aec05c..f8dc0114593 100644 --- a/tests/baselines/reference/exportAssignmentWithDeclareAndExportModifiers.errors.txt +++ b/tests/baselines/reference/exportAssignmentWithDeclareAndExportModifiers.errors.txt @@ -1,11 +1,8 @@ tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts(2,1): error TS1120: An export assignment cannot have modifiers. -tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts(2,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. -==== tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts (2 errors) ==== +==== tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts (1 errors) ==== var x; export declare export = x; - ~~~~~~~~~~~~~~ -!!! error TS1120: An export assignment cannot have modifiers. - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file + ~~~~~~ +!!! error TS1120: An export assignment cannot have modifiers. \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentWithDeclareModifier.errors.txt b/tests/baselines/reference/exportAssignmentWithDeclareModifier.errors.txt index 1d2f2e265d3..2f9d8d801af 100644 --- a/tests/baselines/reference/exportAssignmentWithDeclareModifier.errors.txt +++ b/tests/baselines/reference/exportAssignmentWithDeclareModifier.errors.txt @@ -1,11 +1,8 @@ tests/cases/compiler/exportAssignmentWithDeclareModifier.ts(2,1): error TS1120: An export assignment cannot have modifiers. -tests/cases/compiler/exportAssignmentWithDeclareModifier.ts(2,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. -==== tests/cases/compiler/exportAssignmentWithDeclareModifier.ts (2 errors) ==== +==== tests/cases/compiler/exportAssignmentWithDeclareModifier.ts (1 errors) ==== var x; declare export = x; ~~~~~~~ -!!! error TS1120: An export assignment cannot have modifiers. - ~~~~~~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file +!!! error TS1120: An export assignment cannot have modifiers. \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentWithExportModifier.errors.txt b/tests/baselines/reference/exportAssignmentWithExportModifier.errors.txt index e19ce5bc856..275f4b0ba1f 100644 --- a/tests/baselines/reference/exportAssignmentWithExportModifier.errors.txt +++ b/tests/baselines/reference/exportAssignmentWithExportModifier.errors.txt @@ -1,11 +1,8 @@ tests/cases/compiler/exportAssignmentWithExportModifier.ts(2,1): error TS1120: An export assignment cannot have modifiers. -tests/cases/compiler/exportAssignmentWithExportModifier.ts(2,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. -==== tests/cases/compiler/exportAssignmentWithExportModifier.ts (2 errors) ==== +==== tests/cases/compiler/exportAssignmentWithExportModifier.ts (1 errors) ==== var x; export export = x; ~~~~~~ -!!! error TS1120: An export assignment cannot have modifiers. - ~~~~~~~~~~~~~~~~~~ -!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file +!!! error TS1120: An export assignment cannot have modifiers. \ No newline at end of file diff --git a/tests/baselines/reference/exportDeclareClass1.errors.txt b/tests/baselines/reference/exportDeclareClass1.errors.txt index 36103269f83..c93dc5d0b01 100644 --- a/tests/baselines/reference/exportDeclareClass1.errors.txt +++ b/tests/baselines/reference/exportDeclareClass1.errors.txt @@ -1,19 +1,13 @@ -tests/cases/compiler/exportDeclareClass1.ts(2,21): error TS1037: A function implementation cannot be declared in an ambient context. tests/cases/compiler/exportDeclareClass1.ts(2,24): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/compiler/exportDeclareClass1.ts(3,31): error TS1037: A function implementation cannot be declared in an ambient context. tests/cases/compiler/exportDeclareClass1.ts(3,34): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -==== tests/cases/compiler/exportDeclareClass1.ts (4 errors) ==== +==== tests/cases/compiler/exportDeclareClass1.ts (2 errors) ==== export declare class eaC { static tF() { }; - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~ !!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. static tsF(param:any) { }; - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~ !!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. }; diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgs.errors.txt b/tests/baselines/reference/fatarrowfunctionsOptionalArgs.errors.txt index e445a1460f5..db0721c62af 100644 --- a/tests/baselines/reference/fatarrowfunctionsOptionalArgs.errors.txt +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgs.errors.txt @@ -1,15 +1,8 @@ -tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts(60,10): error TS1015: Parameter cannot have question mark and initializer. -tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts(70,11): error TS1015: Parameter cannot have question mark and initializer. -tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts(80,17): error TS1015: Parameter cannot have question mark and initializer. tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts(88,23): error TS1005: ';' expected. tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts(88,38): error TS1005: ';' expected. -tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts(106,3): error TS1015: Parameter cannot have question mark and initializer. -tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts(106,35): error TS1015: Parameter cannot have question mark and initializer. -tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts(126,6): error TS1015: Parameter cannot have question mark and initializer. -tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts(128,9): error TS1015: Parameter cannot have question mark and initializer. -==== tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts (9 errors) ==== +==== tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts (2 errors) ==== // valid // no params @@ -70,8 +63,6 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts(128,9): error TS1015: Para false ? (arg: number) => 45 : null; false ? (arg?: number) => 46 : null; false ? (arg?: number = 0) => 47 : null; - ~~~ -!!! error TS1015: Parameter cannot have question mark and initializer. false ? (...arg: number[]) => 48 : null; // in ternary exression within paren @@ -82,8 +73,6 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts(128,9): error TS1015: Para false ? ((arg: number) => 55) : null; false ? ((arg?: number) => 56) : null; false ? ((arg?: number = 0) => 57) : null; - ~~~ -!!! error TS1015: Parameter cannot have question mark and initializer. false ? ((...arg: number[]) => 58) : null; // ternary exression's else clause @@ -94,8 +83,6 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts(128,9): error TS1015: Para false ? null : (arg: number) => 65; false ? null : (arg?: number) => 66; false ? null : (arg?: number = 0) => 67; - ~~~ -!!! error TS1015: Parameter cannot have question mark and initializer. false ? null : (...arg: number[]) => 68; @@ -126,10 +113,6 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts(128,9): error TS1015: Para ((arg:number) => 0) + '' + ((arg:number) => 104); ((arg:number = 1) => 0) + '' + ((arg:number = 2) => 105); ((arg?:number = 1) => 0) + '' + ((arg?:number = 2) => 106); - ~~~ -!!! error TS1015: Parameter cannot have question mark and initializer. - ~~~ -!!! error TS1015: Parameter cannot have question mark and initializer. ((...arg:number[]) => 0) + '' + ((...arg:number[]) => 107); ((arg1, arg2?) => 0) + '' + ((arg1,arg2?) => 108); ((arg1, ...arg2:number[]) => 0) + '' + ((arg1, ...arg2:number[]) => 108); @@ -150,12 +133,8 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgs.ts(128,9): error TS1015: Para (a: number = 0) => 116, (a = 0) => 117, (a?: number = 0) => 118, - ~ -!!! error TS1015: Parameter cannot have question mark and initializer. (...a: number[]) => 119, (a, b? = 0, ...c: number[]) => 120, - ~ -!!! error TS1015: Parameter cannot have question mark and initializer. (a) => (b) => (c) => 121, false? (a) => 0 : (b) => 122 ); \ No newline at end of file diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.errors.txt b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.errors.txt index ce937dd55dc..309e731e54f 100644 --- a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.errors.txt +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.errors.txt @@ -1,11 +1,10 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts(1,9): error TS1016: A required parameter cannot follow an optional parameter. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts(2,5): error TS1047: A rest parameter cannot be optional. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts(4,5): error TS1048: A rest parameter cannot have an initializer. -tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts(5,5): error TS1003: Identifier expected. -tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts(8,12): error TS1016: A required parameter cannot follow an optional parameter. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts(7,12): error TS1016: A required parameter cannot follow an optional parameter. -==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts (5 errors) ==== +==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts (4 errors) ==== (arg1?, arg2) => 101; ~~~~ !!! error TS1016: A required parameter cannot follow an optional parameter. @@ -16,9 +15,6 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts(8,12): error TS1016 (...arg:number [] = []) => 104; ~~~ !!! error TS1048: A rest parameter cannot have an initializer. - (...) => 105; - ~ -!!! error TS1003: Identifier expected. // Non optional parameter following an optional one (arg1 = 1, arg2) => 1; diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors3.errors.txt b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors3.errors.txt new file mode 100644 index 00000000000..631ccc2e221 --- /dev/null +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors3.errors.txt @@ -0,0 +1,8 @@ +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors3.ts(1,5): error TS1003: Identifier expected. + + +==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors3.ts (1 errors) ==== + (...) => 105; + ~ +!!! error TS1003: Identifier expected. + \ No newline at end of file diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors4.errors.txt b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors4.errors.txt new file mode 100644 index 00000000000..8de0eb92a02 --- /dev/null +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors4.errors.txt @@ -0,0 +1,49 @@ +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(1,14): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(2,15): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(3,21): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(4,7): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(4,39): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(17,10): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(19,13): error TS1015: Parameter cannot have question mark and initializer. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts(6,5): error TS2304: Cannot find name 'foo'. + + +==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts (8 errors) ==== + false ? (arg?: number = 0) => 47 : null; + ~~~ +!!! error TS1015: Parameter cannot have question mark and initializer. + false ? ((arg?: number = 0) => 57) : null; + ~~~ +!!! error TS1015: Parameter cannot have question mark and initializer. + false ? null : (arg?: number = 0) => 67; + ~~~ +!!! error TS1015: Parameter cannot have question mark and initializer. + ((arg?:number = 1) => 0) + '' + ((arg?:number = 2) => 106); + ~~~ +!!! error TS1015: Parameter cannot have question mark and initializer. + ~~~ +!!! error TS1015: Parameter cannot have question mark and initializer. + + foo( + ~~~ +!!! error TS2304: Cannot find name 'foo'. + (a) => 110, + ((a) => 111), + (a) => { + return 112; + }, + (a? ) => 113, + (a, b? ) => 114, + (a: number) => 115, + (a: number = 0) => 116, + (a = 0) => 117, + (a?: number = 0) => 118, + ~ +!!! error TS1015: Parameter cannot have question mark and initializer. + (...a: number[]) => 119, + (a, b? = 0, ...c: number[]) => 120, + ~ +!!! error TS1015: Parameter cannot have question mark and initializer. + (a) => (b) => (c) => 121, + false? (a) => 0 : (b) => 122 + ); \ No newline at end of file diff --git a/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.js b/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.js index f58b1047b8f..a959e52bdae 100644 --- a/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.js +++ b/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.js @@ -11,4 +11,6 @@ function foo(args) { //// [functionDeclarationWithArgumentOfTypeFunctionTypeArray.d.ts] -declare function foo(args: ((x: any) => number)[]): number; +declare function foo(args: { + (x): number; +}[]): number; diff --git a/tests/baselines/reference/giant.errors.txt b/tests/baselines/reference/giant.errors.txt index 5ef1393915d..767c419952c 100644 --- a/tests/baselines/reference/giant.errors.txt +++ b/tests/baselines/reference/giant.errors.txt @@ -1,28 +1,28 @@ -tests/cases/compiler/giant.ts(25,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(27,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(29,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(31,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(35,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(37,1): error TS1005: '{' expected. +tests/cases/compiler/giant.ts(24,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(26,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(28,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(30,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(34,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(36,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(61,6): error TS1022: An index signature parameter must have a type annotation. tests/cases/compiler/giant.ts(62,5): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(63,6): error TS1096: An index signature must have exactly one parameter. -tests/cases/compiler/giant.ts(89,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(91,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(93,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(95,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(99,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(101,5): error TS1005: '{' expected. +tests/cases/compiler/giant.ts(88,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(90,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(92,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(94,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(98,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(100,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(125,10): error TS1022: An index signature parameter must have a type annotation. tests/cases/compiler/giant.ts(126,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(127,10): error TS1096: An index signature must have exactly one parameter. tests/cases/compiler/giant.ts(154,39): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(168,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(170,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(172,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(174,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(178,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(180,5): error TS1005: '{' expected. +tests/cases/compiler/giant.ts(167,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(169,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(171,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(173,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(177,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(179,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(204,10): error TS1022: An index signature parameter must have a type annotation. tests/cases/compiler/giant.ts(205,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(206,10): error TS1096: An index signature must have exactly one parameter. @@ -48,31 +48,31 @@ tests/cases/compiler/giant.ts(262,22): error TS1037: A function implementation c tests/cases/compiler/giant.ts(262,25): error TS1036: Statements are not allowed in ambient contexts. tests/cases/compiler/giant.ts(267,30): error TS1037: A function implementation cannot be declared in an ambient context. tests/cases/compiler/giant.ts(267,33): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/compiler/giant.ts(283,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(285,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(287,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(289,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(293,5): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(295,1): error TS1005: '{' expected. +tests/cases/compiler/giant.ts(282,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(284,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(286,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(288,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(292,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(294,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(319,6): error TS1022: An index signature parameter must have a type annotation. tests/cases/compiler/giant.ts(320,5): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(321,6): error TS1096: An index signature must have exactly one parameter. -tests/cases/compiler/giant.ts(347,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(349,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(351,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(353,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(357,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(359,5): error TS1005: '{' expected. +tests/cases/compiler/giant.ts(346,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(348,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(350,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(352,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(356,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(358,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(383,10): error TS1022: An index signature parameter must have a type annotation. tests/cases/compiler/giant.ts(384,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(385,10): error TS1096: An index signature must have exactly one parameter. tests/cases/compiler/giant.ts(412,39): error TS1037: A function implementation cannot be declared in an ambient context. -tests/cases/compiler/giant.ts(426,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(428,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(430,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(432,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(436,9): error TS1005: '{' expected. -tests/cases/compiler/giant.ts(438,5): error TS1005: '{' expected. +tests/cases/compiler/giant.ts(425,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(427,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(429,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(431,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(435,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. +tests/cases/compiler/giant.ts(437,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/giant.ts(462,10): error TS1022: An index signature parameter must have a type annotation. tests/cases/compiler/giant.ts(463,9): error TS1021: An index signature must have a type annotation. tests/cases/compiler/giant.ts(464,10): error TS1096: An index signature must have exactly one parameter. @@ -129,7 +129,6 @@ tests/cases/compiler/giant.ts(611,30): error TS1037: A function implementation c tests/cases/compiler/giant.ts(611,33): error TS1036: Statements are not allowed in ambient contexts. tests/cases/compiler/giant.ts(615,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. tests/cases/compiler/giant.ts(616,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. -tests/cases/compiler/giant.ts(616,39): error TS1037: A function implementation cannot be declared in an ambient context. tests/cases/compiler/giant.ts(616,42): error TS1036: Statements are not allowed in ambient contexts. tests/cases/compiler/giant.ts(617,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. tests/cases/compiler/giant.ts(618,16): error TS1038: A 'declare' modifier cannot be used in an already ambient context. @@ -147,51 +146,42 @@ tests/cases/compiler/giant.ts(676,30): error TS1037: A function implementation c tests/cases/compiler/giant.ts(676,33): error TS1036: Statements are not allowed in ambient contexts. tests/cases/compiler/giant.ts(23,12): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(24,16): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(24,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(25,12): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(26,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(27,13): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(28,17): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(28,17): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(29,13): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(30,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(33,12): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(34,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(35,12): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(36,16): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(36,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(76,5): error TS2386: Overload signatures must all be optional or required. tests/cases/compiler/giant.ts(87,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(88,20): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(88,20): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(89,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(90,20): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(91,17): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(92,21): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(92,21): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(93,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(94,21): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(97,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(98,20): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(99,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(100,20): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(100,20): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(140,9): error TS2386: Overload signatures must all be optional or required. tests/cases/compiler/giant.ts(166,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(167,20): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(167,20): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(168,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(169,20): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(170,17): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(171,21): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(171,21): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(172,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(173,21): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(176,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(177,20): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(178,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(179,20): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(179,20): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(219,9): error TS2386: Overload signatures must all be optional or required. tests/cases/compiler/giant.ts(245,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(246,20): error TS2300: Duplicate identifier 'pgF'. @@ -207,51 +197,42 @@ tests/cases/compiler/giant.ts(257,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(258,20): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(281,12): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(282,16): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(282,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(283,12): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(284,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(285,13): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(286,17): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(286,17): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(287,13): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(288,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(291,12): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(292,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(293,12): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(294,16): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(294,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(334,5): error TS2386: Overload signatures must all be optional or required. tests/cases/compiler/giant.ts(345,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(346,20): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(346,20): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(347,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(348,20): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(349,17): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(350,21): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(350,21): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(351,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(352,21): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(355,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(356,20): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(357,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(358,20): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(358,20): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(398,9): error TS2386: Overload signatures must all be optional or required. tests/cases/compiler/giant.ts(424,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(425,20): error TS2300: Duplicate identifier 'pgF'. -tests/cases/compiler/giant.ts(425,20): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(426,16): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(427,20): error TS2300: Duplicate identifier 'psF'. tests/cases/compiler/giant.ts(428,17): error TS2300: Duplicate identifier 'rgF'. tests/cases/compiler/giant.ts(429,21): error TS2300: Duplicate identifier 'rgF'. -tests/cases/compiler/giant.ts(429,21): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(430,17): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(431,21): error TS2300: Duplicate identifier 'rsF'. tests/cases/compiler/giant.ts(434,16): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(435,20): error TS2300: Duplicate identifier 'tsF'. tests/cases/compiler/giant.ts(436,16): error TS2300: Duplicate identifier 'tgF'. tests/cases/compiler/giant.ts(437,20): error TS2300: Duplicate identifier 'tgF'. -tests/cases/compiler/giant.ts(437,20): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/compiler/giant.ts(477,9): error TS2386: Overload signatures must all be optional or required. tests/cases/compiler/giant.ts(503,16): error TS2300: Duplicate identifier 'pgF'. tests/cases/compiler/giant.ts(504,20): error TS2300: Duplicate identifier 'pgF'. @@ -281,7 +262,7 @@ tests/cases/compiler/giant.ts(602,9): error TS2386: Overload signatures must all tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all be optional or required. -==== tests/cases/compiler/giant.ts (281 errors) ==== +==== tests/cases/compiler/giant.ts (262 errors) ==== /* Prefixes @@ -309,58 +290,52 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all !!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! error TS2300: Duplicate identifier 'pgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! error TS2300: Duplicate identifier 'rgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'rsF'. static tV; - ~~~~~~ -!!! error TS1005: '{' expected. static tF() { } static tsF(param:any) { } ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! error TS2300: Duplicate identifier 'tgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'tgF'. } - ~ -!!! error TS1005: '{' expected. interface I { //Call Signature (); @@ -388,7 +363,7 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all ~ !!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; ~~ @@ -423,58 +398,52 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all !!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! error TS2300: Duplicate identifier 'pgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! error TS2300: Duplicate identifier 'rgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'rsF'. static tV; - ~~~~~~ -!!! error TS1005: '{' expected. static tF() { } static tsF(param:any) { } ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! error TS2300: Duplicate identifier 'tgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'tgF'. } - ~ -!!! error TS1005: '{' expected. interface I { //Call Signature (); @@ -502,7 +471,7 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all ~ !!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; ~~ @@ -554,58 +523,52 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all !!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! error TS2300: Duplicate identifier 'pgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! error TS2300: Duplicate identifier 'rgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'rsF'. static tV; - ~~~~~~ -!!! error TS1005: '{' expected. static tF() { } static tsF(param:any) { } ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! error TS2300: Duplicate identifier 'tgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'tgF'. } - ~ -!!! error TS1005: '{' expected. export interface eI { //Call Signature (); @@ -633,7 +596,7 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all ~ !!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; ~~ @@ -787,58 +750,52 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all !!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! error TS2300: Duplicate identifier 'pgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! error TS2300: Duplicate identifier 'rgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'rsF'. static tV; - ~~~~~~ -!!! error TS1005: '{' expected. static tF() { } static tsF(param:any) { } ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! error TS2300: Duplicate identifier 'tgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'tgF'. } - ~ -!!! error TS1005: '{' expected. export interface eI { //Call Signature (); @@ -866,7 +823,7 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all ~ !!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; ~~ @@ -901,58 +858,52 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all !!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! error TS2300: Duplicate identifier 'pgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! error TS2300: Duplicate identifier 'rgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'rsF'. static tV; - ~~~~~~ -!!! error TS1005: '{' expected. static tF() { } static tsF(param:any) { } ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! error TS2300: Duplicate identifier 'tgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'tgF'. } - ~ -!!! error TS1005: '{' expected. interface I { //Call Signature (); @@ -980,7 +931,7 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all ~ !!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; ~~ @@ -1032,58 +983,52 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all !!! error TS2300: Duplicate identifier 'pgF'. public get pgF() ~~~ -!!! error TS2300: Duplicate identifier 'pgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'pgF'. public psF(param:any) { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'psF'. public set psF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'psF'. private rgF() { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rgF'. private get rgF() ~~~ -!!! error TS2300: Duplicate identifier 'rgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'rgF'. private rsF(param:any) { } - ~~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'rsF'. private set rsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'rsF'. static tV; - ~~~~~~ -!!! error TS1005: '{' expected. static tF() { } static tsF(param:any) { } ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static set tsF(param:any) ~~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! error TS2300: Duplicate identifier 'tsF'. static tgF() { } - ~~~~~~ -!!! error TS1005: '{' expected. ~~~ !!! error TS2300: Duplicate identifier 'tgF'. static get tgF() ~~~ -!!! error TS2300: Duplicate identifier 'tgF'. +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~ -!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. +!!! error TS2300: Duplicate identifier 'tgF'. } - ~ -!!! error TS1005: '{' expected. export interface eI { //Call Signature (); @@ -1111,7 +1056,7 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all ~ !!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; ~~ @@ -1380,7 +1325,7 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all ~ !!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; ~~ @@ -1426,8 +1371,6 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all export declare function eaF() { }; ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. ~ !!! error TS1036: Statements are not allowed in ambient contexts. export declare class eaC { } @@ -1484,7 +1427,7 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all ~ !!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; ~~ diff --git a/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt b/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt index 8aeb64291a6..35c91e38dc5 100644 --- a/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt +++ b/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt @@ -1,17 +1,14 @@ -tests/cases/compiler/importDeclWithDeclareModifier.ts(5,1): error TS1079: A 'declare' modifier cannot be used with an import declaration. tests/cases/compiler/importDeclWithDeclareModifier.ts(5,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided. tests/cases/compiler/importDeclWithDeclareModifier.ts(5,9): error TS1029: 'export' modifier must precede 'declare' modifier. tests/cases/compiler/importDeclWithDeclareModifier.ts(5,1): error TS2305: Module 'x' has no exported member 'c'. -==== tests/cases/compiler/importDeclWithDeclareModifier.ts (4 errors) ==== +==== tests/cases/compiler/importDeclWithDeclareModifier.ts (3 errors) ==== module x { interface c { } } declare export import a = x.c; - ~~~~~~~ -!!! error TS1079: A 'declare' modifier cannot be used with an import declaration. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1148: Cannot compile external modules unless the '--module' flag is provided. ~~~~~~ diff --git a/tests/baselines/reference/importDeclWithDeclareModifierInAmbientContext.errors.txt b/tests/baselines/reference/importDeclWithDeclareModifierInAmbientContext.errors.txt index 9773b293037..47d9eb1eec3 100644 --- a/tests/baselines/reference/importDeclWithDeclareModifierInAmbientContext.errors.txt +++ b/tests/baselines/reference/importDeclWithDeclareModifierInAmbientContext.errors.txt @@ -1,9 +1,7 @@ tests/cases/compiler/importDeclWithDeclareModifierInAmbientContext.ts(6,5): error TS1038: A 'declare' modifier cannot be used in an already ambient context. -tests/cases/compiler/importDeclWithDeclareModifierInAmbientContext.ts(6,5): error TS1079: A 'declare' modifier cannot be used with an import declaration. -tests/cases/compiler/importDeclWithDeclareModifierInAmbientContext.ts(6,13): error TS1029: 'export' modifier must precede 'declare' modifier. -==== tests/cases/compiler/importDeclWithDeclareModifierInAmbientContext.ts (3 errors) ==== +==== tests/cases/compiler/importDeclWithDeclareModifierInAmbientContext.ts (1 errors) ==== declare module "m" { module x { interface c { @@ -12,10 +10,6 @@ tests/cases/compiler/importDeclWithDeclareModifierInAmbientContext.ts(6,13): err declare export import a = x.c; ~~~~~~~ !!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. - ~~~~~~~ -!!! error TS1079: A 'declare' modifier cannot be used with an import declaration. - ~~~~~~ -!!! error TS1029: 'export' modifier must precede 'declare' modifier. var b: a; } \ No newline at end of file diff --git a/tests/baselines/reference/importDeclarationInModuleDeclaration1.errors.txt b/tests/baselines/reference/importDeclarationInModuleDeclaration1.errors.txt new file mode 100644 index 00000000000..e8e9de076ad --- /dev/null +++ b/tests/baselines/reference/importDeclarationInModuleDeclaration1.errors.txt @@ -0,0 +1,9 @@ +tests/cases/compiler/importDeclarationInModuleDeclaration1.ts(2,25): error TS1147: Import declarations in an internal module cannot reference an external module. + + +==== tests/cases/compiler/importDeclarationInModuleDeclaration1.ts (1 errors) ==== + module m2 { + import m3 = require("use_glo_M1_public"); + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1147: Import declarations in an internal module cannot reference an external module. + } \ No newline at end of file diff --git a/tests/baselines/reference/importInsideModule.errors.txt b/tests/baselines/reference/importInsideModule.errors.txt index dc89bb5e9ca..efe9b78125f 100644 --- a/tests/baselines/reference/importInsideModule.errors.txt +++ b/tests/baselines/reference/importInsideModule.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/importInsideModule_file2.ts(2,5): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/importInsideModule_file2.ts(2,26): error TS1147: Import declarations in an internal module cannot reference an external module. tests/cases/compiler/importInsideModule_file2.ts(2,26): error TS2307: Cannot find external module 'importInsideModule_file1'. ==== tests/cases/compiler/importInsideModule_file2.ts (2 errors) ==== export module myModule { import foo = require("importInsideModule_file1"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2307: Cannot find external module 'importInsideModule_file1'. diff --git a/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt b/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt index 52934b7ae9e..e7437fcb056 100644 --- a/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt +++ b/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.errors.txt @@ -10,7 +10,7 @@ tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(12,5): error TS1021 ~ !!! error TS1022: An index signature parameter must have a type annotation. [x: string]; - ~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. } diff --git a/tests/baselines/reference/indexTypeCheck.errors.txt b/tests/baselines/reference/indexTypeCheck.errors.txt index 71bc03eca96..efa02c3ff1f 100644 --- a/tests/baselines/reference/indexTypeCheck.errors.txt +++ b/tests/baselines/reference/indexTypeCheck.errors.txt @@ -11,10 +11,10 @@ tests/cases/compiler/indexTypeCheck.ts(51,1): error TS2342: An index expression ==== tests/cases/compiler/indexTypeCheck.ts (8 errors) ==== interface Red { [n:number]; // ok - ~~~~~~~~~~ + ~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. [s:string]; // ok - ~~~~~~~~~~ + ~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. } diff --git a/tests/baselines/reference/indexWithoutParamType.errors.txt b/tests/baselines/reference/indexWithoutParamType.errors.txt index 292583302a0..01a5b44a2e0 100644 --- a/tests/baselines/reference/indexWithoutParamType.errors.txt +++ b/tests/baselines/reference/indexWithoutParamType.errors.txt @@ -3,5 +3,5 @@ tests/cases/compiler/indexWithoutParamType.ts(1,10): error TS1096: An index sign ==== tests/cases/compiler/indexWithoutParamType.ts (1 errors) ==== var y: { []; } // Error - ~~ + ~~~ !!! error TS1096: An index signature must have exactly one parameter. \ No newline at end of file diff --git a/tests/baselines/reference/initializersInDeclarations.errors.txt b/tests/baselines/reference/initializersInDeclarations.errors.txt index 94736957365..5ab9ae5d2bc 100644 --- a/tests/baselines/reference/initializersInDeclarations.errors.txt +++ b/tests/baselines/reference/initializersInDeclarations.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/externalModules/initializersInDeclarations.ts(5,7): error TS1039: Initializers are not allowed in ambient contexts. -tests/cases/conformance/externalModules/initializersInDeclarations.ts(6,14): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/conformance/externalModules/initializersInDeclarations.ts(5,9): error TS1039: Initializers are not allowed in ambient contexts. +tests/cases/conformance/externalModules/initializersInDeclarations.ts(6,16): error TS1039: Initializers are not allowed in ambient contexts. tests/cases/conformance/externalModules/initializersInDeclarations.ts(7,16): error TS1037: A function implementation cannot be declared in an ambient context. tests/cases/conformance/externalModules/initializersInDeclarations.ts(12,15): error TS1039: Initializers are not allowed in ambient contexts. tests/cases/conformance/externalModules/initializersInDeclarations.ts(13,15): error TS1039: Initializers are not allowed in ambient contexts. @@ -13,10 +13,10 @@ tests/cases/conformance/externalModules/initializersInDeclarations.ts(18,16): er declare class Foo { name = "test"; - ~ + ~~~~~~ !!! error TS1039: Initializers are not allowed in ambient contexts. "some prop" = 42; - ~ + ~~ !!! error TS1039: Initializers are not allowed in ambient contexts. fn(): boolean { ~ diff --git a/tests/baselines/reference/instantiateTypeParameter.errors.txt b/tests/baselines/reference/instantiateTypeParameter.errors.txt index 40967ba586f..f56f8a761dd 100644 --- a/tests/baselines/reference/instantiateTypeParameter.errors.txt +++ b/tests/baselines/reference/instantiateTypeParameter.errors.txt @@ -1,16 +1,13 @@ tests/cases/compiler/instantiateTypeParameter.ts(2,5): error TS1131: Property or signature expected. -tests/cases/compiler/instantiateTypeParameter.ts(2,13): error TS1099: Type argument list cannot be empty. tests/cases/compiler/instantiateTypeParameter.ts(3,1): error TS1128: Declaration or statement expected. tests/cases/compiler/instantiateTypeParameter.ts(2,12): error TS2304: Cannot find name 'T'. -==== tests/cases/compiler/instantiateTypeParameter.ts (4 errors) ==== +==== tests/cases/compiler/instantiateTypeParameter.ts (3 errors) ==== interface Foo { var x: T<>; ~~~ !!! error TS1131: Property or signature expected. - ~~ -!!! error TS1099: Type argument list cannot be empty. ~~~ !!! error TS2304: Cannot find name 'T'. } diff --git a/tests/baselines/reference/intTypeCheck.errors.txt b/tests/baselines/reference/intTypeCheck.errors.txt index e6cfc73230a..64655f1bd35 100644 --- a/tests/baselines/reference/intTypeCheck.errors.txt +++ b/tests/baselines/reference/intTypeCheck.errors.txt @@ -1,9 +1,3 @@ -tests/cases/compiler/intTypeCheck.ts(35,6): error TS1022: An index signature parameter must have a type annotation. -tests/cases/compiler/intTypeCheck.ts(36,5): error TS1021: An index signature must have a type annotation. -tests/cases/compiler/intTypeCheck.ts(37,6): error TS1096: An index signature must have exactly one parameter. -tests/cases/compiler/intTypeCheck.ts(70,6): error TS1022: An index signature parameter must have a type annotation. -tests/cases/compiler/intTypeCheck.ts(71,5): error TS1021: An index signature must have a type annotation. -tests/cases/compiler/intTypeCheck.ts(72,6): error TS1096: An index signature must have exactly one parameter. tests/cases/compiler/intTypeCheck.ts(104,20): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(118,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(132,21): error TS1109: Expression expected. @@ -91,7 +85,7 @@ tests/cases/compiler/intTypeCheck.ts(202,22): error TS2304: Cannot find name 'i8 tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -==== tests/cases/compiler/intTypeCheck.ts (73 errors) ==== +==== tests/cases/compiler/intTypeCheck.ts (67 errors) ==== interface i1 { //Property Signatures p; @@ -127,14 +121,8 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit interface i4 { //Index Signatures [p]; - ~ -!!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ -!!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; - ~~ -!!! error TS1096: An index signature must have exactly one parameter. } interface i5 extends i1 { } interface i6 extends i2 { } @@ -168,14 +156,8 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit //Index Signatures [p]; - ~ -!!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ -!!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; - ~~ -!!! error TS1096: An index signature must have exactly one parameter. //Property Signatures p; diff --git a/tests/baselines/reference/interfaceExtendingClass2.errors.txt b/tests/baselines/reference/interfaceExtendingClass2.errors.txt index bff97f4c088..1e07199686b 100644 --- a/tests/baselines/reference/interfaceExtendingClass2.errors.txt +++ b/tests/baselines/reference/interfaceExtendingClass2.errors.txt @@ -1,18 +1,14 @@ -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(4,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(13,13): error TS1108: A 'return' statement can only be used within a function body. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(13,13): error TS1131: Property or signature expected. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(14,9): error TS1128: Declaration or statement expected. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(15,5): error TS1128: Declaration or statement expected. tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts(11,5): error TS2411: Property 'a' of type '{ toString: () => {}; }' is not assignable to string index type 'Object'. -==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts (6 errors) ==== +==== tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClass2.ts (4 errors) ==== class Foo { x: string; y() { } get Z() { - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 1; } [x: string]: Object; @@ -26,8 +22,6 @@ tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtending !!! error TS2411: Property 'a' of type '{ toString: () => {}; }' is not assignable to string index type 'Object'. return 1; ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. - ~~~~~~ !!! error TS1131: Property or signature expected. }; ~ diff --git a/tests/baselines/reference/letDeclarations-es5-1.errors.txt b/tests/baselines/reference/letDeclarations-es5-1.errors.txt new file mode 100644 index 00000000000..f0430585a3b --- /dev/null +++ b/tests/baselines/reference/letDeclarations-es5-1.errors.txt @@ -0,0 +1,27 @@ +tests/cases/compiler/letDeclarations-es5-1.ts(1,9): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/letDeclarations-es5-1.ts(2,9): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/letDeclarations-es5-1.ts(3,9): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/letDeclarations-es5-1.ts(4,9): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/letDeclarations-es5-1.ts(5,9): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/letDeclarations-es5-1.ts(6,9): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. + + +==== tests/cases/compiler/letDeclarations-es5-1.ts (6 errors) ==== + let l1; + ~~ +!!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. + let l2: number; + ~~ +!!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. + let l3, l4, l5 :string, l6; + ~~ +!!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. + let l7 = false; + ~~ +!!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. + let l8: number = 23; + ~~ +!!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. + let l9 = 0, l10 :string = "", l11 = null; + ~~ +!!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/letDeclarations-es5.errors.txt b/tests/baselines/reference/letDeclarations-es5.errors.txt index be1a56a8b7f..34bd93dba3c 100644 --- a/tests/baselines/reference/letDeclarations-es5.errors.txt +++ b/tests/baselines/reference/letDeclarations-es5.errors.txt @@ -1,40 +1,40 @@ -tests/cases/compiler/letDeclarations-es5.ts(2,1): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. -tests/cases/compiler/letDeclarations-es5.ts(3,1): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. -tests/cases/compiler/letDeclarations-es5.ts(4,1): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. -tests/cases/compiler/letDeclarations-es5.ts(6,1): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. -tests/cases/compiler/letDeclarations-es5.ts(7,1): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. -tests/cases/compiler/letDeclarations-es5.ts(8,1): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. -tests/cases/compiler/letDeclarations-es5.ts(10,8): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. -tests/cases/compiler/letDeclarations-es5.ts(12,8): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/letDeclarations-es5.ts(2,5): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/letDeclarations-es5.ts(3,5): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/letDeclarations-es5.ts(4,5): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/letDeclarations-es5.ts(6,5): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/letDeclarations-es5.ts(7,5): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/letDeclarations-es5.ts(8,5): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/letDeclarations-es5.ts(10,9): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/letDeclarations-es5.ts(12,9): error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. ==== tests/cases/compiler/letDeclarations-es5.ts (8 errors) ==== let l1; - ~~~~~~~ + ~~ !!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. let l2: number; - ~~~~~~~~~~~~~~~ + ~~ !!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. let l3, l4, l5 :string, l6; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~ !!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. let l7 = false; - ~~~~~~~~~~~~~~~ + ~~ !!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. let l8: number = 23; - ~~~~~~~~~~~~~~~~~~~~ + ~~ !!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. let l9 = 0, l10 :string = "", l11 = null; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~ !!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. for(let l11 in {}) { } - ~~~~ + ~~~ !!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. for(let l12 = 0; l12 < 9; l12++) { } - ~~~~~~~~ + ~~~ !!! error TS1153: 'let' declarations are only available when targeting ECMAScript 6 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/libMembers.errors.txt b/tests/baselines/reference/libMembers.errors.txt index a6af67821b3..73f5c945f70 100644 --- a/tests/baselines/reference/libMembers.errors.txt +++ b/tests/baselines/reference/libMembers.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/libMembers.ts(9,16): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/libMembers.ts(9,11): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/compiler/libMembers.ts(4,3): error TS2339: Property 'subby' does not exist on type 'string'. tests/cases/compiler/libMembers.ts(12,15): error TS2339: Property 'prototype' does not exist on type 'C'. @@ -15,7 +15,7 @@ tests/cases/compiler/libMembers.ts(12,15): error TS2339: Property 'prototype' do export class C { } var a=new C[]; - ~~ + ~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. a.length; a.push(new C()); diff --git a/tests/baselines/reference/methodInAmbientClass1.errors.txt b/tests/baselines/reference/methodInAmbientClass1.errors.txt new file mode 100644 index 00000000000..3bf8f8af12a --- /dev/null +++ b/tests/baselines/reference/methodInAmbientClass1.errors.txt @@ -0,0 +1,13 @@ +tests/cases/compiler/methodInAmbientClass1.ts(2,20): error TS1037: A function implementation cannot be declared in an ambient context. +tests/cases/compiler/methodInAmbientClass1.ts(2,12): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. + + +==== tests/cases/compiler/methodInAmbientClass1.ts (2 errors) ==== + declare class Foo { + fn(): boolean { + ~ +!!! error TS1037: A function implementation cannot be declared in an ambient context. + ~~~~~~~ +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/missingArgument1.errors.txt b/tests/baselines/reference/missingArgument1.errors.txt new file mode 100644 index 00000000000..02911e3c9b5 --- /dev/null +++ b/tests/baselines/reference/missingArgument1.errors.txt @@ -0,0 +1,16 @@ +tests/cases/compiler/missingArgument1.ts(1,7): error TS1135: Argument expression expected. +tests/cases/compiler/missingArgument1.ts(1,1): error TS2304: Cannot find name 'foo'. +tests/cases/compiler/missingArgument1.ts(1,5): error TS2304: Cannot find name 'a'. +tests/cases/compiler/missingArgument1.ts(1,8): error TS2304: Cannot find name 'b'. + + +==== tests/cases/compiler/missingArgument1.ts (4 errors) ==== + foo(a,,b); + +!!! error TS1135: Argument expression expected. + ~~~ +!!! error TS2304: Cannot find name 'foo'. + ~ +!!! error TS2304: Cannot find name 'a'. + ~ +!!! error TS2304: Cannot find name 'b'. \ No newline at end of file diff --git a/tests/baselines/reference/missingRequiredDeclare.d.errors.txt b/tests/baselines/reference/missingRequiredDeclare.d.errors.txt index dc713c86d89..1e52fa92fe5 100644 --- a/tests/baselines/reference/missingRequiredDeclare.d.errors.txt +++ b/tests/baselines/reference/missingRequiredDeclare.d.errors.txt @@ -1,10 +1,7 @@ tests/cases/compiler/missingRequiredDeclare.d.ts(1,1): error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. -tests/cases/compiler/missingRequiredDeclare.d.ts(1,7): error TS1039: Initializers are not allowed in ambient contexts. -==== tests/cases/compiler/missingRequiredDeclare.d.ts (2 errors) ==== +==== tests/cases/compiler/missingRequiredDeclare.d.ts (1 errors) ==== var x = 1; ~~~ -!!! error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. - ~ -!!! error TS1039: Initializers are not allowed in ambient contexts. \ No newline at end of file +!!! error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. \ No newline at end of file diff --git a/tests/baselines/reference/newOperator.errors.txt b/tests/baselines/reference/newOperator.errors.txt index 2d3fd005448..9232b865648 100644 --- a/tests/baselines/reference/newOperator.errors.txt +++ b/tests/baselines/reference/newOperator.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/newOperator.ts(18,20): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/compiler/newOperator.ts(22,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/compiler/newOperator.ts(45,23): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/newOperator.ts(18,10): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/newOperator.ts(20,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/compiler/newOperator.ts(44,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/newOperator.ts(3,13): error TS2304: Cannot find name 'ifc'. tests/cases/compiler/newOperator.ts(10,10): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/newOperator.ts(11,10): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -38,14 +38,16 @@ tests/cases/compiler/newOperator.ts(31,10): error TS2351: Cannot use 'new' with // Various spacing var t3 = new string[]( ); - ~~ + ~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~ !!! error TS2304: Cannot find name 'string'. var t4 = new + ~~~ string ~~~~~~ + ~~~~~~ !!! error TS2304: Cannot find name 'string'. [ ~ @@ -77,9 +79,9 @@ tests/cases/compiler/newOperator.ts(31,10): error TS2351: Cannot use 'new' with class S { public get xs(): M.T[] { + ~~ +!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return new M.T[]; - ~~ -!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. } } \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralErrors.errors.txt b/tests/baselines/reference/objectLiteralErrors.errors.txt index 91b9aaeecdc..97cbdc32266 100644 --- a/tests/baselines/reference/objectLiteralErrors.errors.txt +++ b/tests/baselines/reference/objectLiteralErrors.errors.txt @@ -13,7 +13,6 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(33,25) tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(34,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(35,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(36,23): error TS1119: An object literal cannot have property and accessor with the same name. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,23): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(37,23): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(38,27): error TS1119: An object literal cannot have property and accessor with the same name. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(39,26): error TS1119: An object literal cannot have property and accessor with the same name. @@ -97,7 +96,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,12) tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,51): error TS2380: 'get' and 'set' accessor must have the same type. -==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts (97 errors) ==== +==== tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts (96 errors) ==== // Multiple properties with the same name var e1 = { a: 0, a: 0 }; @@ -294,8 +293,6 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,51) !!! error TS2300: Duplicate identifier '0x0'. var f14 = { 0: 0, get 000() { return 0; } }; ~~~ -!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. - ~~~ !!! error TS1119: An object literal cannot have property and accessor with the same name. ~ !!! error TS2300: Duplicate identifier '0'. diff --git a/tests/baselines/reference/objectLiteralShorthandProperties.js b/tests/baselines/reference/objectLiteralShorthandProperties.js new file mode 100644 index 00000000000..776b2bbe454 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandProperties.js @@ -0,0 +1,39 @@ +//// [objectLiteralShorthandProperties.ts] +var a, b, c; + +var x1 = { + a +}; + +var x2 = { + a, +} + +var x3 = { + a: 0, + b, + c, + d() { }, + x3, + parent: x3 +}; + + + +//// [objectLiteralShorthandProperties.js] +var a, b, c; +var x1 = { + a: a +}; +var x2 = { + a: a, +}; +var x3 = { + a: 0, + b: b, + c: c, + d: function () { + }, + x3: x3, + parent: x3 +}; diff --git a/tests/baselines/reference/objectLiteralShorthandProperties.types b/tests/baselines/reference/objectLiteralShorthandProperties.types new file mode 100644 index 00000000000..f28f25e815c --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandProperties.types @@ -0,0 +1,50 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandProperties.ts === +var a, b, c; +>a : any +>b : any +>c : any + +var x1 = { +>x1 : { a: any; } +>{ a} : { a: any; } + + a +>a : any + +}; + +var x2 = { +>x2 : { a: any; } +>{ a,} : { a: any; } + + a, +>a : any +} + +var x3 = { +>x3 : any +>{ a: 0, b, c, d() { }, x3, parent: x3} : { a: number; b: any; c: any; d: () => void; x3: any; parent: any; } + + a: 0, +>a : number + + b, +>b : any + + c, +>c : any + + d() { }, +>d : () => void +>d() { } : () => void + + x3, +>x3 : any + + parent: x3 +>parent : any +>x3 : any + +}; + + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.js b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.js new file mode 100644 index 00000000000..2ef29a37084 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.js @@ -0,0 +1,36 @@ +//// [objectLiteralShorthandPropertiesAssignment.ts] +var id: number = 10000; +var name: string = "my name"; + +var person: { name: string; id: number } = { name, id }; +function foo( obj:{ name: string }): void { }; +function bar(name: string, id: number) { return { name, id }; } +function bar1(name: string, id: number) { return { name }; } +function baz(name: string, id: number): { name: string; id: number } { return { name, id }; } + +foo(person); +var person1 = bar("Hello", 5); +var person2: { name: string } = bar("Hello", 5); +var person3: { name: string; id:number } = bar("Hello", 5); + + +//// [objectLiteralShorthandPropertiesAssignment.js] +var id = 10000; +var name = "my name"; +var person = { name: name, id: id }; +function foo(obj) { +} +; +function bar(name, id) { + return { name: name, id: id }; +} +function bar1(name, id) { + return { name: name }; +} +function baz(name, id) { + return { name: name, id: id }; +} +foo(person); +var person1 = bar("Hello", 5); +var person2 = bar("Hello", 5); +var person3 = bar("Hello", 5); diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types new file mode 100644 index 00000000000..91d9e528d63 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types @@ -0,0 +1,68 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignment.ts === +var id: number = 10000; +>id : number + +var name: string = "my name"; +>name : string + +var person: { name: string; id: number } = { name, id }; +>person : { name: string; id: number; } +>name : string +>id : number +>{ name, id } : { name: string; id: number; } +>name : string +>id : number + +function foo( obj:{ name: string }): void { }; +>foo : (obj: { name: string; }) => void +>obj : { name: string; } +>name : string + +function bar(name: string, id: number) { return { name, id }; } +>bar : (name: string, id: number) => { name: string; id: number; } +>name : string +>id : number +>{ name, id } : { name: string; id: number; } +>name : string +>id : number + +function bar1(name: string, id: number) { return { name }; } +>bar1 : (name: string, id: number) => { name: string; } +>name : string +>id : number +>{ name } : { name: string; } +>name : string + +function baz(name: string, id: number): { name: string; id: number } { return { name, id }; } +>baz : (name: string, id: number) => { name: string; id: number; } +>name : string +>id : number +>name : string +>id : number +>{ name, id } : { name: string; id: number; } +>name : string +>id : number + +foo(person); +>foo(person) : void +>foo : (obj: { name: string; }) => void +>person : { name: string; id: number; } + +var person1 = bar("Hello", 5); +>person1 : { name: string; id: number; } +>bar("Hello", 5) : { name: string; id: number; } +>bar : (name: string, id: number) => { name: string; id: number; } + +var person2: { name: string } = bar("Hello", 5); +>person2 : { name: string; } +>name : string +>bar("Hello", 5) : { name: string; id: number; } +>bar : (name: string, id: number) => { name: string; id: number; } + +var person3: { name: string; id:number } = bar("Hello", 5); +>person3 : { name: string; id: number; } +>name : string +>id : number +>bar("Hello", 5) : { name: string; id: number; } +>bar : (name: string, id: number) => { name: string; id: number; } + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.js b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.js new file mode 100644 index 00000000000..b2f9004b076 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.js @@ -0,0 +1,36 @@ +//// [objectLiteralShorthandPropertiesAssignmentES6.ts] +var id: number = 10000; +var name: string = "my name"; + +var person: { name: string; id: number } = { name, id }; +function foo(obj: { name: string }): void { }; +function bar(name: string, id: number) { return { name, id }; } +function bar1(name: string, id: number) { return { name }; } +function baz(name: string, id: number): { name: string; id: number } { return { name, id }; } + +foo(person); +var person1 = bar("Hello", 5); +var person2: { name: string } = bar("Hello", 5); +var person3: { name: string; id: number } = bar("Hello", 5); + + +//// [objectLiteralShorthandPropertiesAssignmentES6.js] +var id = 10000; +var name = "my name"; +var person = { name, id }; +function foo(obj) { +} +; +function bar(name, id) { + return { name, id }; +} +function bar1(name, id) { + return { name }; +} +function baz(name, id) { + return { name, id }; +} +foo(person); +var person1 = bar("Hello", 5); +var person2 = bar("Hello", 5); +var person3 = bar("Hello", 5); diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types new file mode 100644 index 00000000000..38791fc1beb --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types @@ -0,0 +1,68 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentES6.ts === +var id: number = 10000; +>id : number + +var name: string = "my name"; +>name : string + +var person: { name: string; id: number } = { name, id }; +>person : { name: string; id: number; } +>name : string +>id : number +>{ name, id } : { name: string; id: number; } +>name : string +>id : number + +function foo(obj: { name: string }): void { }; +>foo : (obj: { name: string; }) => void +>obj : { name: string; } +>name : string + +function bar(name: string, id: number) { return { name, id }; } +>bar : (name: string, id: number) => { name: string; id: number; } +>name : string +>id : number +>{ name, id } : { name: string; id: number; } +>name : string +>id : number + +function bar1(name: string, id: number) { return { name }; } +>bar1 : (name: string, id: number) => { name: string; } +>name : string +>id : number +>{ name } : { name: string; } +>name : string + +function baz(name: string, id: number): { name: string; id: number } { return { name, id }; } +>baz : (name: string, id: number) => { name: string; id: number; } +>name : string +>id : number +>name : string +>id : number +>{ name, id } : { name: string; id: number; } +>name : string +>id : number + +foo(person); +>foo(person) : void +>foo : (obj: { name: string; }) => void +>person : { name: string; id: number; } + +var person1 = bar("Hello", 5); +>person1 : { name: string; id: number; } +>bar("Hello", 5) : { name: string; id: number; } +>bar : (name: string, id: number) => { name: string; id: number; } + +var person2: { name: string } = bar("Hello", 5); +>person2 : { name: string; } +>name : string +>bar("Hello", 5) : { name: string; id: number; } +>bar : (name: string, id: number) => { name: string; id: number; } + +var person3: { name: string; id: number } = bar("Hello", 5); +>person3 : { name: string; id: number; } +>name : string +>id : number +>bar("Hello", 5) : { name: string; id: number; } +>bar : (name: string, id: number) => { name: string; id: number; } + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.errors.txt new file mode 100644 index 00000000000..2db47d0f7ae --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentError.errors.txt @@ -0,0 +1,44 @@ +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(5,16): error TS1131: Property or signature expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(5,25): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(6,53): error TS1005: ';' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(4,5): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'. + Property 'b' is missing in type '{ name: string; id: number; }'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(5,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'id' must be of type 'number', but here has type 'any'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(6,79): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ id: string; name: number; }'. + Types of property 'id' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts(8,5): error TS2345: Argument of type '{ name: string; id: number; }' is not assignable to parameter of type '{ name: string; id: boolean; }'. + Types of property 'id' are incompatible. + Type 'number' is not assignable to type 'boolean'. + + +==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts (7 errors) ==== + var id: number = 10000; + var name: string = "my name"; + + var person: { b: string; id: number } = { name, id }; // error + ~~~~~~ +!!! error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'. +!!! error TS2322: Property 'b' is missing in type '{ name: string; id: number; }'. + var person1: { name, id }; // error: can't use short-hand property assignment in type position + ~~~~ +!!! error TS1131: Property or signature expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'id' must be of type 'number', but here has type 'any'. + function foo(name: string, id: number): { id: string, name: number } { return { name, id }; } // error + ~ +!!! error TS1005: ';' expected. + ~~~~~~~~~~~~ +!!! error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ id: string; name: number; }'. +!!! error TS2322: Types of property 'id' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. + function bar(obj: { name: string; id: boolean }) { } + bar({ name, id }); // error + ~~~~~~~~~~~~ +!!! error TS2345: Argument of type '{ name: string; id: number; }' is not assignable to parameter of type '{ name: string; id: boolean; }'. +!!! error TS2345: Types of property 'id' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'boolean'. + + \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.errors.txt new file mode 100644 index 00000000000..708bbb0935f --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.errors.txt @@ -0,0 +1,48 @@ +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(5,55): error TS1005: ';' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(6,55): error TS1005: ';' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(7,16): error TS1131: Property or signature expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(7,25): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(8,28): error TS1005: ';' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(4,5): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'. + Property 'b' is missing in type '{ name: string; id: number; }'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(5,79): error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ name: number; id: string; }'. + Types of property 'name' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(7,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'id' must be of type 'number', but here has type 'any'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts(8,5): error TS2322: Type '{ name: number; id: string; }' is not assignable to type '{ name: string; id: number; }'. + Types of property 'name' are incompatible. + Type 'number' is not assignable to type 'string'. + + +==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts (9 errors) ==== + var id: number = 10000; + var name: string = "my name"; + + var person: { b: string; id: number } = { name, id }; // error + ~~~~~~ +!!! error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ b: string; id: number; }'. +!!! error TS2322: Property 'b' is missing in type '{ name: string; id: number; }'. + function bar(name: string, id: number): { name: number, id: string } { return { name, id }; } // error + ~ +!!! error TS1005: ';' expected. + ~~~~~~~~~~~~ +!!! error TS2322: Type '{ name: string; id: number; }' is not assignable to type '{ name: number; id: string; }'. +!!! error TS2322: Types of property 'name' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. + function foo(name: string, id: number): { name: string, id: number } { return { name, id }; } // error + ~ +!!! error TS1005: ';' expected. + var person1: { name, id }; // error : Can't use shorthand in the type position + ~~~~ +!!! error TS1131: Property or signature expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'id' must be of type 'number', but here has type 'any'. + var person2: { name: string, id: number } = bar("hello", 5); + ~ +!!! error TS1005: ';' expected. + ~~~~~~~ +!!! error TS2322: Type '{ name: number; id: string; }' is not assignable to type '{ name: string; id: number; }'. +!!! error TS2322: Types of property 'name' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesES6.js b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.js new file mode 100644 index 00000000000..b398a231351 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.js @@ -0,0 +1,39 @@ +//// [objectLiteralShorthandPropertiesES6.ts] +var a, b, c; + +var x1 = { + a +}; + +var x2 = { + a, +} + +var x3 = { + a: 0, + b, + c, + d() { }, + x3, + parent: x3 +}; + + + +//// [objectLiteralShorthandPropertiesES6.js] +var a, b, c; +var x1 = { + a +}; +var x2 = { + a, +}; +var x3 = { + a: 0, + b, + c, + d: function () { + }, + x3, + parent: x3 +}; diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types new file mode 100644 index 00000000000..0383a3f5d2e --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types @@ -0,0 +1,50 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesES6.ts === +var a, b, c; +>a : any +>b : any +>c : any + +var x1 = { +>x1 : { a: any; } +>{ a} : { a: any; } + + a +>a : any + +}; + +var x2 = { +>x2 : { a: any; } +>{ a,} : { a: any; } + + a, +>a : any +} + +var x3 = { +>x3 : any +>{ a: 0, b, c, d() { }, x3, parent: x3} : { a: number; b: any; c: any; d: () => void; x3: any; parent: any; } + + a: 0, +>a : number + + b, +>b : any + + c, +>c : any + + d() { }, +>d : () => void +>d() { } : () => void + + x3, +>x3 : any + + parent: x3 +>parent : any +>x3 : any + +}; + + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.errors.txt new file mode 100644 index 00000000000..fcd04b27754 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.ts(3,5): error TS2304: Cannot find name 'undefinedVariable'. + + +==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.ts (1 errors) ==== + var x = { + x, // OK + undefinedVariable // Error + ~~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'undefinedVariable'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.js b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.js new file mode 100644 index 00000000000..6050e5b756f --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.js @@ -0,0 +1,12 @@ +//// [objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.ts] +var x = { + x, // OK + undefinedVariable // Error +} + + +//// [objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.js] +var x = { + x: x, + undefinedVariable: undefinedVariable // Error +}; diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt new file mode 100644 index 00000000000..cc92b9a0381 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt @@ -0,0 +1,71 @@ +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(3,20): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(4,7): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(5,10): error TS1005: '(' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(6,10): error TS1005: '(' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(7,9): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(8,10): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(9,8): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(10,10): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(12,1): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(15,6): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(16,6): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(17,6): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(20,17): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(15,5): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(16,5): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(17,5): error TS2300: Duplicate identifier 'a'. + + +==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts (16 errors) ==== + // errors + var y = { + "stringLiteral", + ~ +!!! error TS1005: ':' expected. + 42, + ~ +!!! error TS1005: ':' expected. + get e, + ~ +!!! error TS1005: '(' expected. + set f, + ~ +!!! error TS1005: '(' expected. + this, + ~ +!!! error TS1005: ':' expected. + super, + ~ +!!! error TS1005: ':' expected. + var, + ~ +!!! error TS1005: ':' expected. + class, + ~ +!!! error TS1005: ':' expected. + typeof + }; + ~ +!!! error TS1005: ':' expected. + + var x = { + a.b, + ~ +!!! error TS1005: ':' expected. + ~ +!!! error TS2300: Duplicate identifier 'a'. + a["ss"], + ~ +!!! error TS1005: ':' expected. + ~ +!!! error TS2300: Duplicate identifier 'a'. + a[1], + ~ +!!! error TS1005: ':' expected. + ~ +!!! error TS2300: Duplicate identifier 'a'. + }; + + var v = { class }; // error + ~ +!!! error TS1005: ':' expected. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorWithModule.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorWithModule.errors.txt new file mode 100644 index 00000000000..15bac99436f --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorWithModule.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorWithModule.ts(10,10): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorWithModule.ts(14,3): error TS2339: Property 'y' does not exist on type 'typeof m'. + + +==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorWithModule.ts (2 errors) ==== + // module export + var x = "Foo"; + module m { + export var x; + } + + module n { + var z = 10000; + export var y = { + m.x // error + ~ +!!! error TS1005: ':' expected. + }; + } + + m.y.x; + ~ +!!! error TS2339: Property 'y' does not exist on type 'typeof m'. + \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.js b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.js new file mode 100644 index 00000000000..f6e20b605b6 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.js @@ -0,0 +1,20 @@ +//// [objectLiteralShorthandPropertiesFunctionArgument.ts] +var id: number = 10000; +var name: string = "my name"; + +var person = { name, id }; + +function foo(p: { name: string; id: number }) { } +foo(person); + + +var obj = { name: name, id: id }; + +//// [objectLiteralShorthandPropertiesFunctionArgument.js] +var id = 10000; +var name = "my name"; +var person = { name: name, id: id }; +function foo(p) { +} +foo(person); +var obj = { name: name, id: id }; diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types new file mode 100644 index 00000000000..9b4261a74be --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types @@ -0,0 +1,33 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument.ts === +var id: number = 10000; +>id : number + +var name: string = "my name"; +>name : string + +var person = { name, id }; +>person : { name: string; id: number; } +>{ name, id } : { name: string; id: number; } +>name : string +>id : number + +function foo(p: { name: string; id: number }) { } +>foo : (p: { name: string; id: number; }) => void +>p : { name: string; id: number; } +>name : string +>id : number + +foo(person); +>foo(person) : void +>foo : (p: { name: string; id: number; }) => void +>person : { name: string; id: number; } + + +var obj = { name: name, id: id }; +>obj : { name: string; id: number; } +>{ name: name, id: id } : { name: string; id: number; } +>name : string +>name : string +>id : number +>id : number + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument2.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument2.errors.txt new file mode 100644 index 00000000000..44426a8afb0 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument2.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument2.ts(7,5): error TS2345: Argument of type '{ name: string; id: number; }' is not assignable to parameter of type '{ a: string; id: number; }'. + + +==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument2.ts (1 errors) ==== + var id: number = 10000; + var name: string = "my name"; + + var person = { name, id }; + + function foo(p: { a: string; id: number }) { } + foo(person); // error + ~~~~~~ +!!! error TS2345: Argument of type '{ name: string; id: number; }' is not assignable to parameter of type '{ a: string; id: number; }'. + \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument2.js b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument2.js new file mode 100644 index 00000000000..2f3535ef78a --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument2.js @@ -0,0 +1,17 @@ +//// [objectLiteralShorthandPropertiesFunctionArgument2.ts] +var id: number = 10000; +var name: string = "my name"; + +var person = { name, id }; + +function foo(p: { a: string; id: number }) { } +foo(person); // error + + +//// [objectLiteralShorthandPropertiesFunctionArgument2.js] +var id = 10000; +var name = "my name"; +var person = { name: name, id: id }; +function foo(p) { +} +foo(person); // error diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.js b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.js new file mode 100644 index 00000000000..e2eb1fc128c --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.js @@ -0,0 +1,30 @@ +//// [objectLiteralShorthandPropertiesWithModule.ts] +// module export + +module m { + export var x; +} + +module m { + var z = x; + var y = { + a: x, + x + }; +} + + +//// [objectLiteralShorthandPropertiesWithModule.js] +// module export +var m; +(function (m) { + m.x; +})(m || (m = {})); +var m; +(function (m) { + var z = m.x; + var y = { + a: m.x, + x: m.x + }; +})(m || (m = {})); diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.types b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.types new file mode 100644 index 00000000000..77e139a3426 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.types @@ -0,0 +1,31 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModule.ts === +// module export + +module m { +>m : typeof m + + export var x; +>x : any +} + +module m { +>m : typeof m + + var z = x; +>z : any +>x : any + + var y = { +>y : { a: any; x: any; } +>{ a: x, x } : { a: any; x: any; } + + a: x, +>a : any +>x : any + + x +>x : any + + }; +} + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.js b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.js new file mode 100644 index 00000000000..edb4e6c2953 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.js @@ -0,0 +1,28 @@ +//// [objectLiteralShorthandPropertiesWithModuleES6.ts] + +module m { + export var x; +} + +module m { + var z = x; + var y = { + a: x, + x + }; +} + + +//// [objectLiteralShorthandPropertiesWithModuleES6.js] +var m; +(function (m) { + m.x; +})(m || (m = {})); +var m; +(function (m) { + var z = m.x; + var y = { + a: m.x, + x: m.x + }; +})(m || (m = {})); diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.types b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.types new file mode 100644 index 00000000000..1030010d6c6 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.types @@ -0,0 +1,30 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModuleES6.ts === + +module m { +>m : typeof m + + export var x; +>x : any +} + +module m { +>m : typeof m + + var z = x; +>z : any +>x : any + + var y = { +>y : { a: any; x: any; } +>{ a: x, x } : { a: any; x: any; } + + a: x, +>a : any +>x : any + + x +>x : any + + }; +} + diff --git a/tests/baselines/reference/objectTypeWithOptionalProperty1.errors.txt b/tests/baselines/reference/objectTypeWithOptionalProperty1.errors.txt new file mode 100644 index 00000000000..e2e1c05ea1e --- /dev/null +++ b/tests/baselines/reference/objectTypeWithOptionalProperty1.errors.txt @@ -0,0 +1,9 @@ +tests/cases/compiler/objectTypeWithOptionalProperty1.ts(2,10): error TS1162: An object member cannot be declared optional. + + +==== tests/cases/compiler/objectTypeWithOptionalProperty1.ts (1 errors) ==== + var b = { + x?: 1 // error + ~ +!!! error TS1162: An object member cannot be declared optional. + } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt b/tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt index 0622b7badb0..a2269c29d11 100644 --- a/tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt +++ b/tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt @@ -1,10 +1,9 @@ tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts(12,6): error TS1112: A class member cannot be declared optional. tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts(20,6): error TS1112: A class member cannot be declared optional. -tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts(24,6): error TS1005: ':' expected. -tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts(24,7): error TS1109: Expression expected. +tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts(24,6): error TS1162: An object member cannot be declared optional. -==== tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts (4 errors) ==== +==== tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts (3 errors) ==== // Basic uses of optional properties var a: { @@ -34,7 +33,5 @@ tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWith var b = { x?: 1 // error ~ -!!! error TS1005: ':' expected. - ~ -!!! error TS1109: Expression expected. +!!! error TS1162: An object member cannot be declared optional. } \ No newline at end of file diff --git a/tests/baselines/reference/optionalPropertiesSyntax.errors.txt b/tests/baselines/reference/optionalPropertiesSyntax.errors.txt index 66c1cae2a7e..daeb7c7a268 100644 --- a/tests/baselines/reference/optionalPropertiesSyntax.errors.txt +++ b/tests/baselines/reference/optionalPropertiesSyntax.errors.txt @@ -6,7 +6,6 @@ tests/cases/compiler/optionalPropertiesSyntax.ts(18,12): error TS1131: Property tests/cases/compiler/optionalPropertiesSyntax.ts(32,18): error TS1005: ';' expected. tests/cases/compiler/optionalPropertiesSyntax.ts(32,19): error TS1131: Property or signature expected. tests/cases/compiler/optionalPropertiesSyntax.ts(33,5): error TS1131: Property or signature expected. -tests/cases/compiler/optionalPropertiesSyntax.ts(34,6): error TS1019: An index signature parameter cannot have a question mark. tests/cases/compiler/optionalPropertiesSyntax.ts(4,5): error TS2386: Overload signatures must all be optional or required. tests/cases/compiler/optionalPropertiesSyntax.ts(24,5): error TS2300: Duplicate identifier 'prop'. tests/cases/compiler/optionalPropertiesSyntax.ts(25,5): error TS2300: Duplicate identifier 'prop'. @@ -15,7 +14,7 @@ tests/cases/compiler/optionalPropertiesSyntax.ts(33,7): error TS2375: Duplicate tests/cases/compiler/optionalPropertiesSyntax.ts(34,5): error TS2375: Duplicate number index signature. -==== tests/cases/compiler/optionalPropertiesSyntax.ts (15 errors) ==== +==== tests/cases/compiler/optionalPropertiesSyntax.ts (14 errors) ==== interface fnSigs { //functions signatures can be optional fn(): void; @@ -76,8 +75,6 @@ tests/cases/compiler/optionalPropertiesSyntax.ts(34,5): error TS2375: Duplicate ~~~~~~~~~~~~~~~~~~~ !!! error TS2375: Duplicate number index signature. [idx?: number]: any; //err - ~~~ -!!! error TS1019: An index signature parameter cannot have a question mark. ~~~~~~~~~~~~~~~~~~~~ !!! error TS2375: Duplicate number index signature. } \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt index 0d4cd775c56..70530d409b3 100644 --- a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt +++ b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.errors.txt @@ -1,13 +1,10 @@ tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts(1,37): error TS1005: ';' expected. -tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts(1,42): error TS1108: A 'return' statement can only be used within a function body. tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts(1,8): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. -==== tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts (3 errors) ==== +==== tests/cases/compiler/overloadOnConstAsTypeAnnotation.ts (2 errors) ==== var f: (x: 'hi') => number = ('hi') => { return 1; }; ~~ !!! error TS1005: ';' expected. - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. ~~~~~~~~~~~~~~~~~~~ !!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature. \ No newline at end of file diff --git a/tests/baselines/reference/parser645086_1.errors.txt b/tests/baselines/reference/parser645086_1.errors.txt index 71e6b31a547..d326fa23973 100644 --- a/tests/baselines/reference/parser645086_1.errors.txt +++ b/tests/baselines/reference/parser645086_1.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,13): error TS1005: ',' expected. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,14): error TS1134: Variable declaration expected. -tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,15): error TS1109: Expression expected. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,15): error TS1161: Unterminated regular expression literal. ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts (3 errors) ==== @@ -10,4 +10,4 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,1 ~ !!! error TS1134: Variable declaration expected. -!!! error TS1109: Expression expected. \ No newline at end of file +!!! error TS1161: Unterminated regular expression literal. \ No newline at end of file diff --git a/tests/baselines/reference/parser645086_2.errors.txt b/tests/baselines/reference/parser645086_2.errors.txt index b3b5805ab8c..2d40b3c8f78 100644 --- a/tests/baselines/reference/parser645086_2.errors.txt +++ b/tests/baselines/reference/parser645086_2.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,14): error TS1005: ',' expected. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,15): error TS1134: Variable declaration expected. -tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,16): error TS1109: Expression expected. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,16): error TS1161: Unterminated regular expression literal. ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts (3 errors) ==== @@ -10,4 +10,4 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,1 ~ !!! error TS1134: Variable declaration expected. -!!! error TS1109: Expression expected. \ No newline at end of file +!!! error TS1161: Unterminated regular expression literal. \ No newline at end of file diff --git a/tests/baselines/reference/parserConstructorDeclaration11.errors.txt b/tests/baselines/reference/parserConstructorDeclaration11.errors.txt index e8a799fc36a..7e5c305fb80 100644 --- a/tests/baselines/reference/parserConstructorDeclaration11.errors.txt +++ b/tests/baselines/reference/parserConstructorDeclaration11.errors.txt @@ -1,12 +1,9 @@ tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration11.ts(2,14): error TS1098: Type parameter list cannot be empty. -tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration11.ts(2,15): error TS1092: Type parameters cannot appear on a constructor declaration. -==== tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration11.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration11.ts (1 errors) ==== class C { constructor<>() { } ~~ !!! error TS1098: Type parameter list cannot be empty. - -!!! error TS1092: Type parameters cannot appear on a constructor declaration. } \ No newline at end of file diff --git a/tests/baselines/reference/parserConstructorDeclaration12.errors.txt b/tests/baselines/reference/parserConstructorDeclaration12.errors.txt new file mode 100644 index 00000000000..949098e91da --- /dev/null +++ b/tests/baselines/reference/parserConstructorDeclaration12.errors.txt @@ -0,0 +1,61 @@ +tests/cases/compiler/parserConstructorDeclaration12.ts(2,14): error TS1098: Type parameter list cannot be empty. +tests/cases/compiler/parserConstructorDeclaration12.ts(3,14): error TS1098: Type parameter list cannot be empty. +tests/cases/compiler/parserConstructorDeclaration12.ts(4,15): error TS1098: Type parameter list cannot be empty. +tests/cases/compiler/parserConstructorDeclaration12.ts(5,15): error TS1098: Type parameter list cannot be empty. +tests/cases/compiler/parserConstructorDeclaration12.ts(6,14): error TS1098: Type parameter list cannot be empty. +tests/cases/compiler/parserConstructorDeclaration12.ts(7,14): error TS1098: Type parameter list cannot be empty. +tests/cases/compiler/parserConstructorDeclaration12.ts(8,15): error TS1098: Type parameter list cannot be empty. +tests/cases/compiler/parserConstructorDeclaration12.ts(9,15): error TS1098: Type parameter list cannot be empty. +tests/cases/compiler/parserConstructorDeclaration12.ts(2,3): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/parserConstructorDeclaration12.ts(3,3): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/parserConstructorDeclaration12.ts(4,3): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/parserConstructorDeclaration12.ts(5,3): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/parserConstructorDeclaration12.ts(6,3): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/parserConstructorDeclaration12.ts(7,3): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/parserConstructorDeclaration12.ts(8,3): error TS2392: Multiple constructor implementations are not allowed. +tests/cases/compiler/parserConstructorDeclaration12.ts(9,3): error TS2392: Multiple constructor implementations are not allowed. + + +==== tests/cases/compiler/parserConstructorDeclaration12.ts (16 errors) ==== + class C { + constructor<>() { } + ~~ +!!! error TS1098: Type parameter list cannot be empty. + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2392: Multiple constructor implementations are not allowed. + constructor<> () { } + ~~ +!!! error TS1098: Type parameter list cannot be empty. + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2392: Multiple constructor implementations are not allowed. + constructor <>() { } + ~~ +!!! error TS1098: Type parameter list cannot be empty. + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2392: Multiple constructor implementations are not allowed. + constructor <> () { } + ~~ +!!! error TS1098: Type parameter list cannot be empty. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2392: Multiple constructor implementations are not allowed. + constructor< >() { } + ~~~ +!!! error TS1098: Type parameter list cannot be empty. + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2392: Multiple constructor implementations are not allowed. + constructor< > () { } + ~~~ +!!! error TS1098: Type parameter list cannot be empty. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2392: Multiple constructor implementations are not allowed. + constructor < >() { } + ~~~ +!!! error TS1098: Type parameter list cannot be empty. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2392: Multiple constructor implementations are not allowed. + constructor < > () { } + ~~~ +!!! error TS1098: Type parameter list cannot be empty. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2392: Multiple constructor implementations are not allowed. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserConstructorDeclaration7.errors.txt b/tests/baselines/reference/parserConstructorDeclaration7.errors.txt index 49645ac1239..7b3f033e3cd 100644 --- a/tests/baselines/reference/parserConstructorDeclaration7.errors.txt +++ b/tests/baselines/reference/parserConstructorDeclaration7.errors.txt @@ -1,12 +1,9 @@ tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration7.ts(2,10): error TS1028: Accessibility modifier already seen. -tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration7.ts(2,10): error TS1089: 'private' modifier cannot appear on a constructor declaration. -==== tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration7.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration7.ts (1 errors) ==== class C { public private constructor() { } ~~~~~~~ !!! error TS1028: Accessibility modifier already seen. - ~~~~~~~ -!!! error TS1089: 'private' modifier cannot appear on a constructor declaration. } \ No newline at end of file diff --git a/tests/baselines/reference/parserErrantSemicolonInClass1.errors.txt b/tests/baselines/reference/parserErrantSemicolonInClass1.errors.txt index cdbb4dbe9b8..7e71ec8fc61 100644 --- a/tests/baselines/reference/parserErrantSemicolonInClass1.errors.txt +++ b/tests/baselines/reference/parserErrantSemicolonInClass1.errors.txt @@ -1,11 +1,7 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts(9,21): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts(15,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts(18,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts(24,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts (5 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonInClass1.ts (1 errors) ==== class a { //constructor (); constructor (n: number); @@ -20,26 +16,18 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserErrantSemicolonIn public pv; public get d() { - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 30; } public set d() { - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } public static get p2() { - ~~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return { x: 30, y: 40 }; } private static d2() { } private static get p3() { - ~~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return "string"; } private pv3; diff --git a/tests/baselines/reference/parserErrorRecovery_ArgumentList6.errors.txt b/tests/baselines/reference/parserErrorRecovery_ArgumentList6.errors.txt index 799c67593e0..cf6f7b10938 100644 --- a/tests/baselines/reference/parserErrorRecovery_ArgumentList6.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_ArgumentList6.errors.txt @@ -1,12 +1,9 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList6.ts(1,5): error TS1135: Argument expression expected. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList6.ts(1,6): error TS1005: ')' expected. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList6.ts(1,1): error TS2304: Cannot find name 'Foo'. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList6.ts (3 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList6.ts (2 errors) ==== Foo(, - ~ -!!! error TS1135: Argument expression expected. !!! error TS1005: ')' expected. ~~~ diff --git a/tests/baselines/reference/parserErrorRecovery_ArgumentList7.errors.txt b/tests/baselines/reference/parserErrorRecovery_ArgumentList7.errors.txt index 95f4febf447..67602cb11af 100644 --- a/tests/baselines/reference/parserErrorRecovery_ArgumentList7.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_ArgumentList7.errors.txt @@ -1,13 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList7.ts(1,7): error TS1135: Argument expression expected. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList7.ts(1,8): error TS1005: ')' expected. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList7.ts(1,1): error TS2304: Cannot find name 'Foo'. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList7.ts(1,5): error TS2304: Cannot find name 'a'. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList7.ts (4 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArgumentLists/parserErrorRecovery_ArgumentList7.ts (3 errors) ==== Foo(a,, - ~ -!!! error TS1135: Argument expression expected. !!! error TS1005: ')' expected. ~~~ diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.errors.txt b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.errors.txt index 6ec231b9336..6d637831c45 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause4.ts(1,19): error TS1097: 'implements' list cannot be empty. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause4.ts(1,29): error TS1097: 'implements' list cannot be empty. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause4.ts(1,17): error TS2304: Cannot find name 'A'. ==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause4.ts (2 errors) ==== class C extends A implements { - ~~~~~~~~~~ + !!! error TS1097: 'implements' list cannot be empty. ~ !!! error TS2304: Cannot find name 'A'. diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause6.errors.txt b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause6.errors.txt index 1f235691df8..2f7ca3d99ae 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause6.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause6.ts(1,13): error TS1097: 'extends' list cannot be empty. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause6.ts(1,20): error TS1097: 'extends' list cannot be empty. ==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause6.ts (1 errors) ==== interface I extends { } - ~~~~~~~ + !!! error TS1097: 'extends' list cannot be empty. \ No newline at end of file diff --git a/tests/baselines/reference/parserErrorRecovery_ModuleElement1.errors.txt b/tests/baselines/reference/parserErrorRecovery_ModuleElement1.errors.txt index ad23c21ec1b..4b8be3e17ad 100644 --- a/tests/baselines/reference/parserErrorRecovery_ModuleElement1.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_ModuleElement1.errors.txt @@ -1,19 +1,13 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ModuleElements/parserErrorRecovery_ModuleElement1.ts(1,1): error TS1108: A 'return' statement can only be used within a function body. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ModuleElements/parserErrorRecovery_ModuleElement1.ts(2,1): error TS1128: Declaration or statement expected. -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ModuleElements/parserErrorRecovery_ModuleElement1.ts(3,1): error TS1108: A 'return' statement can only be used within a function body. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ModuleElements/parserErrorRecovery_ModuleElement1.ts(4,1): error TS1128: Declaration or statement expected. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ModuleElements/parserErrorRecovery_ModuleElement1.ts (4 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ModuleElements/parserErrorRecovery_ModuleElement1.ts (2 errors) ==== return foo; - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. } ~ !!! error TS1128: Declaration or statement expected. return bar; - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. } ~ !!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserErrorRecovery_ParameterList2.errors.txt b/tests/baselines/reference/parserErrorRecovery_ParameterList2.errors.txt index fd4c286f356..48cd83147d7 100644 --- a/tests/baselines/reference/parserErrorRecovery_ParameterList2.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_ParameterList2.errors.txt @@ -1,11 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ParameterLists/parserErrorRecovery_ParameterList2.ts(1,13): error TS1009: Trailing comma not allowed. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ParameterLists/parserErrorRecovery_ParameterList2.ts(1,15): error TS1005: ')' expected. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ParameterLists/parserErrorRecovery_ParameterList2.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ParameterLists/parserErrorRecovery_ParameterList2.ts (1 errors) ==== function f(a, { - ~ -!!! error TS1009: Trailing comma not allowed. ~ !!! error TS1005: ')' expected. } \ No newline at end of file diff --git a/tests/baselines/reference/parserForInStatement2.errors.txt b/tests/baselines/reference/parserForInStatement2.errors.txt index 30c20036029..1399a323da0 100644 --- a/tests/baselines/reference/parserForInStatement2.errors.txt +++ b/tests/baselines/reference/parserForInStatement2.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement2.ts(1,10): error TS1123: Variable declaration list cannot be empty. +tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement2.ts(1,9): error TS1123: Variable declaration list cannot be empty. tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement2.ts(1,13): error TS2304: Cannot find name 'X'. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement2.ts (2 errors) ==== for (var in X) { - ~~ + !!! error TS1123: Variable declaration list cannot be empty. ~ !!! error TS2304: Cannot find name 'X'. diff --git a/tests/baselines/reference/parserForInStatement3.errors.txt b/tests/baselines/reference/parserForInStatement3.errors.txt index b3e02edf9f7..aa6eea4397b 100644 --- a/tests/baselines/reference/parserForInStatement3.errors.txt +++ b/tests/baselines/reference/parserForInStatement3.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement3.ts(1,18): error TS1091: Only a single variable declaration is allowed in a 'for...in' statement. +tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement3.ts(1,13): error TS1091: Only a single variable declaration is allowed in a 'for...in' statement. tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement3.ts(1,18): error TS2304: Cannot find name 'X'. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement3.ts (2 errors) ==== for (var a, b in X) { - ~ + ~ !!! error TS1091: Only a single variable declaration is allowed in a 'for...in' statement. ~ !!! error TS2304: Cannot find name 'X'. diff --git a/tests/baselines/reference/parserForInStatement6.errors.txt b/tests/baselines/reference/parserForInStatement6.errors.txt index cb04fa4d6f9..a4eaeb12410 100644 --- a/tests/baselines/reference/parserForInStatement6.errors.txt +++ b/tests/baselines/reference/parserForInStatement6.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement6.ts(1,26): error TS1091: Only a single variable declaration is allowed in a 'for...in' statement. +tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement6.ts(1,17): error TS1091: Only a single variable declaration is allowed in a 'for...in' statement. tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement6.ts(1,26): error TS2304: Cannot find name 'X'. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement6.ts (2 errors) ==== for (var a = 1, b = 2 in X) { - ~ + ~ !!! error TS1091: Only a single variable declaration is allowed in a 'for...in' statement. ~ !!! error TS2304: Cannot find name 'X'. diff --git a/tests/baselines/reference/parserForInStatement7.errors.txt b/tests/baselines/reference/parserForInStatement7.errors.txt index b351afc8ec5..2371b3453c3 100644 --- a/tests/baselines/reference/parserForInStatement7.errors.txt +++ b/tests/baselines/reference/parserForInStatement7.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement7.ts(1,43): error TS1091: Only a single variable declaration is allowed in a 'for...in' statement. +tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement7.ts(1,25): error TS1091: Only a single variable declaration is allowed in a 'for...in' statement. tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement7.ts(1,10): error TS2404: The left-hand side of a 'for...in' statement cannot use a type annotation. tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement7.ts(1,43): error TS2304: Cannot find name 'X'. ==== tests/cases/conformance/parser/ecmascript5/Statements/parserForInStatement7.ts (3 errors) ==== for (var a: number = 1, b: string = "" in X) { - ~ + ~ !!! error TS1091: Only a single variable declaration is allowed in a 'for...in' statement. ~ !!! error TS2404: The left-hand side of a 'for...in' statement cannot use a type annotation. diff --git a/tests/baselines/reference/parserFunctionDeclaration2.d.errors.txt b/tests/baselines/reference/parserFunctionDeclaration2.d.errors.txt index 76d47a0a9d4..f623642e827 100644 --- a/tests/baselines/reference/parserFunctionDeclaration2.d.errors.txt +++ b/tests/baselines/reference/parserFunctionDeclaration2.d.errors.txt @@ -1,11 +1,8 @@ tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration2.d.ts(1,1): error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. -tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration2.d.ts(1,14): error TS1037: A function implementation cannot be declared in an ambient context. -==== tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration2.d.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration2.d.ts (1 errors) ==== function F() { ~~~~~~~~ !!! error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. - ~ -!!! error TS1037: A function implementation cannot be declared in an ambient context. } \ No newline at end of file diff --git a/tests/baselines/reference/parserIndexMemberDeclaration10.errors.txt b/tests/baselines/reference/parserIndexMemberDeclaration10.errors.txt index e85a4817d85..d448aaa3f29 100644 --- a/tests/baselines/reference/parserIndexMemberDeclaration10.errors.txt +++ b/tests/baselines/reference/parserIndexMemberDeclaration10.errors.txt @@ -1,12 +1,9 @@ -tests/cases/conformance/parser/ecmascript5/IndexMemberDeclarations/parserIndexMemberDeclaration10.ts(2,4): error TS1145: Modifiers not permitted on index signature members. tests/cases/conformance/parser/ecmascript5/IndexMemberDeclarations/parserIndexMemberDeclaration10.ts(2,11): error TS1030: 'static' modifier already seen. -==== tests/cases/conformance/parser/ecmascript5/IndexMemberDeclarations/parserIndexMemberDeclaration10.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/IndexMemberDeclarations/parserIndexMemberDeclaration10.ts (1 errors) ==== class C { static static [x: string]: string; - ~~~~~~~~~~~~~ -!!! error TS1145: Modifiers not permitted on index signature members. ~~~~~~ !!! error TS1030: 'static' modifier already seen. } \ No newline at end of file diff --git a/tests/baselines/reference/parserIndexSignature11.errors.txt b/tests/baselines/reference/parserIndexSignature11.errors.txt index 1aa23b64514..585e72a3516 100644 --- a/tests/baselines/reference/parserIndexSignature11.errors.txt +++ b/tests/baselines/reference/parserIndexSignature11.errors.txt @@ -9,7 +9,7 @@ tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature1 ~ !!! error TS1022: An index signature parameter must have a type annotation. [p1: string]; - ~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS1021: An index signature must have a type annotation. [p2: string, p3: number]; ~~ diff --git a/tests/baselines/reference/parserIndexSignature9.errors.txt b/tests/baselines/reference/parserIndexSignature9.errors.txt index e7686c22474..1a7034c4f14 100644 --- a/tests/baselines/reference/parserIndexSignature9.errors.txt +++ b/tests/baselines/reference/parserIndexSignature9.errors.txt @@ -4,6 +4,6 @@ tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature9 ==== tests/cases/conformance/parser/ecmascript5/IndexSignatures/parserIndexSignature9.ts (1 errors) ==== interface I { []: number - ~~ + ~~~~~~~~~~ !!! error TS1096: An index signature must have exactly one parameter. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMissingToken2.errors.txt b/tests/baselines/reference/parserMissingToken2.errors.txt index abb62f83e70..31012c0865e 100644 --- a/tests/baselines/reference/parserMissingToken2.errors.txt +++ b/tests/baselines/reference/parserMissingToken2.errors.txt @@ -1,10 +1,7 @@ -tests/cases/conformance/parser/ecmascript5/MissingTokens/parserMissingToken2.ts(1,1): error TS1109: Expression expected. -tests/cases/conformance/parser/ecmascript5/MissingTokens/parserMissingToken2.ts(1,3): error TS2304: Cannot find name 'b'. +tests/cases/conformance/parser/ecmascript5/MissingTokens/parserMissingToken2.ts(1,2): error TS1161: Unterminated regular expression literal. -==== tests/cases/conformance/parser/ecmascript5/MissingTokens/parserMissingToken2.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/MissingTokens/parserMissingToken2.ts (1 errors) ==== / b; - ~ -!!! error TS1109: Expression expected. - ~ -!!! error TS2304: Cannot find name 'b'. \ No newline at end of file + +!!! error TS1161: Unterminated regular expression literal. \ No newline at end of file diff --git a/tests/baselines/reference/parserModuleDeclaration4.d.errors.txt b/tests/baselines/reference/parserModuleDeclaration4.d.errors.txt index 2e75c6cbc50..3f7cc9c53d3 100644 --- a/tests/baselines/reference/parserModuleDeclaration4.d.errors.txt +++ b/tests/baselines/reference/parserModuleDeclaration4.d.errors.txt @@ -1,13 +1,10 @@ tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration4.d.ts(1,1): error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. -tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration4.d.ts(2,3): error TS1038: A 'declare' modifier cannot be used in an already ambient context. -==== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration4.d.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration4.d.ts (1 errors) ==== module M { ~~~~~~ !!! error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. declare module M1 { - ~~~~~~~ -!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. } } \ No newline at end of file diff --git a/tests/baselines/reference/parserObjectCreationArrayLiteral1.errors.txt b/tests/baselines/reference/parserObjectCreationArrayLiteral1.errors.txt index 04be3a6d041..f0ca8d45b7a 100644 --- a/tests/baselines/reference/parserObjectCreationArrayLiteral1.errors.txt +++ b/tests/baselines/reference/parserObjectCreationArrayLiteral1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral1.ts(1,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral1.ts(1,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral1.ts(1,5): error TS2304: Cannot find name 'Foo'. ==== tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral1.ts (2 errors) ==== new Foo[]; - ~~ + ~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~ !!! error TS2304: Cannot find name 'Foo'. \ No newline at end of file diff --git a/tests/baselines/reference/parserObjectCreationArrayLiteral3.errors.txt b/tests/baselines/reference/parserObjectCreationArrayLiteral3.errors.txt index 89f861cfcdb..3187d985cc2 100644 --- a/tests/baselines/reference/parserObjectCreationArrayLiteral3.errors.txt +++ b/tests/baselines/reference/parserObjectCreationArrayLiteral3.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral3.ts(1,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral3.ts(1,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral3.ts(1,5): error TS2304: Cannot find name 'Foo'. ==== tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral3.ts (2 errors) ==== new Foo[](); - ~~ + ~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~ !!! error TS2304: Cannot find name 'Foo'. \ No newline at end of file diff --git a/tests/baselines/reference/parserObjectType6.errors.txt b/tests/baselines/reference/parserObjectType6.errors.txt index 5ad8f5e0053..afdc6b8f4d8 100644 --- a/tests/baselines/reference/parserObjectType6.errors.txt +++ b/tests/baselines/reference/parserObjectType6.errors.txt @@ -8,6 +8,6 @@ tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType6.ts(2,7) ~ !!! error TS2304: Cannot find name 'B'. []; - ~~ + ~~~ !!! error TS1096: An index signature must have exactly one parameter. }; \ No newline at end of file diff --git a/tests/baselines/reference/parserPublicBreak1.errors.txt b/tests/baselines/reference/parserPublicBreak1.errors.txt index b96046d8e21..429a63ace4b 100644 --- a/tests/baselines/reference/parserPublicBreak1.errors.txt +++ b/tests/baselines/reference/parserPublicBreak1.errors.txt @@ -1,11 +1,8 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserPublicBreak1.ts(1,1): error TS1128: Declaration or statement expected. -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserPublicBreak1.ts(1,8): error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserPublicBreak1.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserPublicBreak1.ts (1 errors) ==== public break; ~~~~~~ !!! error TS1128: Declaration or statement expected. - ~~~~~~ -!!! error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. \ No newline at end of file diff --git a/tests/baselines/reference/parserRealSource10.errors.txt b/tests/baselines/reference/parserRealSource10.errors.txt index aabafd751e7..4184d9ac23e 100644 --- a/tests/baselines/reference/parserRealSource10.errors.txt +++ b/tests/baselines/reference/parserRealSource10.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. -tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(127,42): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(128,42): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(129,47): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(130,42): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(449,40): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(127,29): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(128,32): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(129,37): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(130,31): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(449,31): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(128,36): error TS2304: Cannot find name 'string'. tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(129,41): error TS2304: Cannot find name 'number'. tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(130,35): error TS2304: Cannot find name 'boolean'. @@ -472,20 +472,20 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(356,53): error } export var tokenTable = new TokenInfo[]; - ~~ + ~~~~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. export var nodeTypeTable = new string[]; - ~~ + ~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~ !!! error TS2304: Cannot find name 'string'. export var nodeTypeToTokTable = new number[]; - ~~ + ~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~ !!! error TS2304: Cannot find name 'number'. export var noRegexTable = new boolean[]; - ~~ + ~~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~~ !!! error TS2304: Cannot find name 'boolean'. @@ -1474,7 +1474,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(356,53): error // TODO: new with length TokenID.LimFixed export var staticTokens = new Token[]; - ~~ + ~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. export function initializeStaticTokens() { for (var i = 0; i <= TokenID.LimFixed; i++) { diff --git a/tests/baselines/reference/parserRealSource11.errors.txt b/tests/baselines/reference/parserRealSource11.errors.txt index 966da980097..c76206b821f 100644 --- a/tests/baselines/reference/parserRealSource11.errors.txt +++ b/tests/baselines/reference/parserRealSource11.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. -tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(193,40): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(193,33): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(867,29): error TS1015: Parameter cannot have question mark and initializer. -tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1009,45): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. -tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1024,47): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1009,31): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1024,33): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(13,22): error TS2304: Cannot find name 'Type'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(14,24): error TS2304: Cannot find name 'ASTFlags'. tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(17,38): error TS2304: Cannot find name 'CompilerDiagnostics'. @@ -793,7 +793,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error ~~~~~~~~~~~ !!! error TS2304: Cannot find name 'SymbolScope'. public members: AST[] = new AST[]; - ~~ + ~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. constructor () { @@ -2029,7 +2029,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error !!! error TS2304: Cannot find name 'Symbol'. if (this.envids == null) { this.envids = new Identifier[]; - ~~ + ~~~~~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. } this.envids[this.envids.length] = id; @@ -2048,7 +2048,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error !!! error TS2304: Cannot find name 'Symbol'. if (this.jumpRefs == null) { this.jumpRefs = new Identifier[]; - ~~ + ~~~~~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. } var id = new Identifier(sym.name); diff --git a/tests/baselines/reference/parserRealSource4.errors.txt b/tests/baselines/reference/parserRealSource4.errors.txt index e0ae0d2221e..5974d62df47 100644 --- a/tests/baselines/reference/parserRealSource4.errors.txt +++ b/tests/baselines/reference/parserRealSource4.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. -tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts(195,37): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts(195,24): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ==== tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts (2 errors) ==== @@ -200,7 +200,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts(195,37): error T export class HashTable { public itemCount: number = 0; public table = new HashEntry[]; - ~~ + ~~~~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. constructor (public size: number, public hashFn: (key) =>number, diff --git a/tests/baselines/reference/parserRealSource7.errors.txt b/tests/baselines/reference/parserRealSource7.errors.txt index 7fddac2c467..773dd499425 100644 --- a/tests/baselines/reference/parserRealSource7.errors.txt +++ b/tests/baselines/reference/parserRealSource7.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. -tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(16,45): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(16,33): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(12,38): error TS2304: Cannot find name 'ASTList'. tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(12,62): error TS2304: Cannot find name 'TypeLink'. tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(16,37): error TS2304: Cannot find name 'TypeLink'. @@ -326,7 +326,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(828,13): error T var len = bases.members.length; if (baseTypeLinks == null) { baseTypeLinks = new TypeLink[]; - ~~ + ~~~~~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~~~~~ !!! error TS2304: Cannot find name 'TypeLink'. diff --git a/tests/baselines/reference/parserRealSource9.errors.txt b/tests/baselines/reference/parserRealSource9.errors.txt index 1880a72f189..0dc0de6c12c 100644 --- a/tests/baselines/reference/parserRealSource9.errors.txt +++ b/tests/baselines/reference/parserRealSource9.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. -tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(12,39): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. +tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(12,31): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(8,38): error TS2304: Cannot find name 'TypeChecker'. tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(9,48): error TS2304: Cannot find name 'TypeLink'. tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(9,67): error TS2304: Cannot find name 'SymbolScope'. @@ -56,7 +56,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(200,48): error T !!! error TS2304: Cannot find name 'Type'. if (typeLinks) { extendsList = new Type[]; - ~~ + ~~~~~~~~~~ !!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array()' instead. ~~~~ !!! error TS2304: Cannot find name 'Type'. diff --git a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.errors.txt b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.errors.txt index f53b77abbd9..7ea76fc24d1 100644 --- a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.errors.txt +++ b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.errors.txt @@ -1,13 +1,13 @@ -tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts(1,5): error TS1109: Expression expected. +tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts(1,6): error TS1161: Unterminated regular expression literal. +tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts(1,17): error TS1005: ')' expected. tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts(1,1): error TS2304: Cannot find name 'foo'. -tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts(1,6): error TS2304: Cannot find name 'notregexp'. ==== tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts (3 errors) ==== foo(/notregexp); - ~ -!!! error TS1109: Expression expected. + +!!! error TS1161: Unterminated regular expression literal. + +!!! error TS1005: ')' expected. ~~~ -!!! error TS2304: Cannot find name 'foo'. - ~~~~~~~~~ -!!! error TS2304: Cannot find name 'notregexp'. \ No newline at end of file +!!! error TS2304: Cannot find name 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/parserVariableDeclaration6.errors.txt b/tests/baselines/reference/parserVariableDeclaration6.errors.txt index 1dee8ef6820..699f4188c7f 100644 --- a/tests/baselines/reference/parserVariableDeclaration6.errors.txt +++ b/tests/baselines/reference/parserVariableDeclaration6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/parser/ecmascript5/VariableDeclarations/parserVariableDeclaration6.ts(1,1): error TS1123: Variable declaration list cannot be empty. +tests/cases/conformance/parser/ecmascript5/VariableDeclarations/parserVariableDeclaration6.ts(1,4): error TS1123: Variable declaration list cannot be empty. ==== tests/cases/conformance/parser/ecmascript5/VariableDeclarations/parserVariableDeclaration6.ts (1 errors) ==== var - ~~~ + !!! error TS1123: Variable declaration list cannot be empty. \ No newline at end of file diff --git a/tests/baselines/reference/parserVariableDeclaration8.errors.txt b/tests/baselines/reference/parserVariableDeclaration8.errors.txt index 77350f226c2..7f14785c1ca 100644 --- a/tests/baselines/reference/parserVariableDeclaration8.errors.txt +++ b/tests/baselines/reference/parserVariableDeclaration8.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/parser/ecmascript5/VariableDeclarations/parserVariableDeclaration8.ts(1,1): error TS1123: Variable declaration list cannot be empty. +tests/cases/conformance/parser/ecmascript5/VariableDeclarations/parserVariableDeclaration8.ts(1,4): error TS1123: Variable declaration list cannot be empty. ==== tests/cases/conformance/parser/ecmascript5/VariableDeclarations/parserVariableDeclaration8.ts (1 errors) ==== var ; - ~~~~~ + !!! error TS1123: Variable declaration list cannot be empty. \ No newline at end of file diff --git a/tests/baselines/reference/parserVariableStatement1.d.errors.txt b/tests/baselines/reference/parserVariableStatement1.d.errors.txt index de0bef5288c..7176e5ed69f 100644 --- a/tests/baselines/reference/parserVariableStatement1.d.errors.txt +++ b/tests/baselines/reference/parserVariableStatement1.d.errors.txt @@ -1,10 +1,7 @@ tests/cases/conformance/parser/ecmascript5/Statements/parserVariableStatement1.d.ts(1,1): error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. -tests/cases/conformance/parser/ecmascript5/Statements/parserVariableStatement1.d.ts(1,7): error TS1039: Initializers are not allowed in ambient contexts. -==== tests/cases/conformance/parser/ecmascript5/Statements/parserVariableStatement1.d.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Statements/parserVariableStatement1.d.ts (1 errors) ==== var v = 1; ~~~ -!!! error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. - ~ -!!! error TS1039: Initializers are not allowed in ambient contexts. \ No newline at end of file +!!! error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. \ No newline at end of file diff --git a/tests/baselines/reference/parserharness.errors.txt b/tests/baselines/reference/parserharness.errors.txt index 01104e61ea2..4de6566054c 100644 --- a/tests/baselines/reference/parserharness.errors.txt +++ b/tests/baselines/reference/parserharness.errors.txt @@ -3,7 +3,6 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(17,1): err tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(18,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/services/typescriptServices.ts' not found. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(19,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/RealWorld/diff.ts' not found. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1430,9): error TS1128: Declaration or statement expected. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2047,13): error TS1015: Parameter cannot have question mark and initializer. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(21,21): error TS2305: Module 'Harness' has no exported member 'Assert'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(25,17): error TS2304: Cannot find name 'IIO'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(41,12): error TS2304: Cannot find name 'ActiveXObject'. @@ -111,7 +110,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(1787,68): tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): error TS2304: Cannot find name 'Diff'. -==== tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts (111 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts (110 errors) ==== // // Copyright (c) Microsoft Corporation. All rights reserved. // @@ -2379,8 +2378,6 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): relativeFilename: string, generateContent: () => string, runImmediately? = false, - ~~~~~~~~~~~~~~ -!!! error TS1015: Parameter cannot have question mark and initializer. opts?: BaselineOptions) { var actual = undefined; diff --git a/tests/baselines/reference/privacyAccessorDeclFile.errors.txt b/tests/baselines/reference/privacyAccessorDeclFile.errors.txt index 59c460d4800..debb5808493 100644 --- a/tests/baselines/reference/privacyAccessorDeclFile.errors.txt +++ b/tests/baselines/reference/privacyAccessorDeclFile.errors.txt @@ -1,39 +1,39 @@ -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(253,20): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(259,13): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(253,44): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(259,31): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(265,20): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(271,13): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(361,41): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(365,28): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(405,20): error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(408,13): error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(361,48): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(365,35): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(405,44): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(408,31): error TS4043: Return type of public property getter from exported class has or is using private name 'privateModule'. tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(411,20): error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(414,13): error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(420,41): error TS4036: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(422,28): error TS4036: Parameter 'myPublicMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(9,16): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(15,9): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(420,48): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(422,35): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(9,40): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(15,27): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(21,16): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(27,9): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(117,37): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(121,24): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(161,16): error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(164,9): error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(117,44): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(121,31): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(161,40): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(164,27): error TS4043: Return type of public property getter from exported class has or is using private name 'privateModule'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(167,16): error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(170,9): error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(176,37): error TS4036: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(178,24): error TS4036: Parameter 'myPublicMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(211,20): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(217,13): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(176,44): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(178,31): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(211,44): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(217,31): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(223,20): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(229,13): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(319,41): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(323,28): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(363,20): error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(366,13): error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(319,48): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(323,35): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(363,44): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(366,31): error TS4043: Return type of public property getter from exported class has or is using private name 'privateModule'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(369,20): error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(372,13): error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(378,41): error TS4036: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS4036: Parameter 'myPublicMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(378,48): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,35): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts (24 errors) ==== @@ -46,7 +46,7 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithWithPrivateGetAccessorTypes { static get myPublicStaticMethod(): privateClass { // Error - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. return null; } @@ -54,7 +54,7 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS return null; } get myPublicMethod(): privateClass { // Error - ~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. return null; } @@ -162,13 +162,13 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithWithPrivateSetAccessorTypes { static set myPublicStaticMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. } private static set myPrivateStaticMethod(param: privateClass) { } set myPublicMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. } private set myPrivateMethod(param: privateClass) { @@ -210,13 +210,13 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithPrivateModuleGetAccessorTypes { static get myPublicStaticMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4040: Return type of public static property getter from exported class has or is using private name 'privateModule'. return null; } get myPublicMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~ -!!! error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'privateModule'. return null; } static get myPublicStaticMethod1() { // Error @@ -233,12 +233,12 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithPrivateModuleSetAccessorTypes { static set myPublicStaticMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4036: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateModule'. } set myPublicMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4036: Parameter 'myPublicMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateModule'. } } @@ -272,7 +272,7 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS } export class publicClassWithWithPrivateGetAccessorTypes { static get myPublicStaticMethod(): privateClass { // Error - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. return null; } @@ -280,7 +280,7 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS return null; } get myPublicMethod(): privateClass { // Error - ~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. return null; } @@ -388,13 +388,13 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithWithPrivateSetAccessorTypes { static set myPublicStaticMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. } private static set myPrivateStaticMethod(param: privateClass) { } set myPublicMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. } private set myPrivateMethod(param: privateClass) { @@ -436,13 +436,13 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithPrivateModuleGetAccessorTypes { static get myPublicStaticMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4040: Return type of public static property getter from exported class has or is using private name 'privateModule'. return null; } get myPublicMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~ -!!! error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'privateModule'. return null; } static get myPublicStaticMethod1() { // Error @@ -459,12 +459,12 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithPrivateModuleSetAccessorTypes { static set myPublicStaticMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4036: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateModule'. } set myPublicMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4036: Parameter 'myPublicMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateModule'. } } @@ -948,7 +948,7 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithWithPrivateGetAccessorTypes { static get myPublicStaticMethod(): privateClass { // Error - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. return null; } @@ -956,7 +956,7 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS return null; } get myPublicMethod(): privateClass { // Error - ~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. return null; } @@ -1064,13 +1064,13 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithWithPrivateSetAccessorTypes { static set myPublicStaticMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. } private static set myPrivateStaticMethod(param: privateClass) { } set myPublicMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. } private set myPrivateMethod(param: privateClass) { @@ -1112,13 +1112,13 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithPrivateModuleGetAccessorTypes { static get myPublicStaticMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4040: Return type of public static property getter from exported class has or is using private name 'privateModule'. return null; } get myPublicMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~ -!!! error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4043: Return type of public property getter from exported class has or is using private name 'privateModule'. return null; } static get myPublicStaticMethod1() { // Error @@ -1135,12 +1135,12 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(380,28): error TS export class publicClassWithPrivateModuleSetAccessorTypes { static set myPublicStaticMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4036: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateModule'. } set myPublicMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4036: Parameter 'myPublicMethod' of public property setter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateModule'. } } diff --git a/tests/baselines/reference/privacyCheckTypeOfFunction.errors.txt b/tests/baselines/reference/privacyCheckTypeOfFunction.errors.txt index 5f2a0adc9e0..88801e06dfd 100644 --- a/tests/baselines/reference/privacyCheckTypeOfFunction.errors.txt +++ b/tests/baselines/reference/privacyCheckTypeOfFunction.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/privacyCheckTypeOfFunction.ts(3,12): error TS4025: Exported variable 'x' has or is using private name 'foo'. +tests/cases/compiler/privacyCheckTypeOfFunction.ts(3,22): error TS4025: Exported variable 'x' has or is using private name 'foo'. tests/cases/compiler/privacyCheckTypeOfFunction.ts(4,12): error TS4025: Exported variable 'b' has or is using private name 'foo'. @@ -6,7 +6,7 @@ tests/cases/compiler/privacyCheckTypeOfFunction.ts(4,12): error TS4025: Exported function foo() { } export var x: typeof foo; - ~ + ~~~ !!! error TS4025: Exported variable 'x' has or is using private name 'foo'. export var b = foo; ~ diff --git a/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleError.errors.txt b/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleError.errors.txt index fa8de5499db..e8accf360dc 100644 --- a/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleError.errors.txt +++ b/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleError.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/privacyCheckTypeOfInvisibleModuleError.ts(6,16): error TS4025: Exported variable 'f' has or is using private name 'Inner'. +tests/cases/compiler/privacyCheckTypeOfInvisibleModuleError.ts(6,26): error TS4025: Exported variable 'f' has or is using private name 'Inner'. ==== tests/cases/compiler/privacyCheckTypeOfInvisibleModuleError.ts (1 errors) ==== @@ -8,7 +8,7 @@ tests/cases/compiler/privacyCheckTypeOfInvisibleModuleError.ts(6,16): error TS40 } export var f: typeof Inner; - ~ + ~~~~~ !!! error TS4025: Exported variable 'f' has or is using private name 'Inner'. } \ No newline at end of file diff --git a/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleNoError.errors.txt b/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleNoError.errors.txt index 917e4e62e83..bbc8954cff1 100644 --- a/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleNoError.errors.txt +++ b/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleNoError.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/privacyCheckTypeOfInvisibleModuleNoError.ts(6,16): error TS4025: Exported variable 'f' has or is using private name 'Inner'. +tests/cases/compiler/privacyCheckTypeOfInvisibleModuleNoError.ts(6,26): error TS4025: Exported variable 'f' has or is using private name 'Inner'. ==== tests/cases/compiler/privacyCheckTypeOfInvisibleModuleNoError.ts (1 errors) ==== @@ -8,7 +8,7 @@ tests/cases/compiler/privacyCheckTypeOfInvisibleModuleNoError.ts(6,16): error TS } export var f: typeof Inner; // Since we dont unwind inner any more, it is error here - ~ + ~~~~~ !!! error TS4025: Exported variable 'f' has or is using private name 'Inner'. } \ No newline at end of file diff --git a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt index 4ec739d6ce6..f3c21baed3c 100644 --- a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt +++ b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/privacyClassExtendsClauseDeclFile_GlobalFile.ts(16,67): error TS4020: Extends clause of exported class 'publicClassExtendingPrivateClassInModule' has or is using private name 'privateClassInPublicModule'. tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(17,67): error TS4020: Extends clause of exported class 'publicClassExtendingPrivateClassInModule' has or is using private name 'privateClassInPublicModule'. -tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(22,69): error TS4018: Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. +tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(22,69): error TS4020: Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using private name 'privateModule'. tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(64,55): error TS4020: Extends clause of exported class 'publicClassExtendingPrivateClass' has or is using private name 'privateClass'. -tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(69,65): error TS4018: Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. +tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(69,65): error TS4020: Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts (4 errors) ==== @@ -30,8 +30,8 @@ tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(69,65): class privateClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule { } export class publicClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule { // Should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4018: Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4020: Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using private name 'privateModule'. } } @@ -81,8 +81,8 @@ tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(69,65): class privateClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule { } export class publicClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule { // Should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4018: Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4020: Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using private name 'privateModule'. } ==== tests/cases/compiler/privacyClassExtendsClauseDeclFile_GlobalFile.ts (1 errors) ==== diff --git a/tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt b/tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt index 07a1c6a357b..2681ee0e20e 100644 --- a/tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt +++ b/tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/privacyClassImplementsClauseDeclFile_GlobalFile.ts(14,77): error TS4019: Implements clause of exported class 'publicClassImplementingPrivateInterfaceInModule' has or is using private name 'privateInterfaceInPublicModule'. tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(15,77): error TS4019: Implements clause of exported class 'publicClassImplementingPrivateInterfaceInModule' has or is using private name 'privateInterfaceInPublicModule'. -tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(20,79): error TS4017: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using name 'privateModule.publicInterfaceInPrivateModule' from private module 'privateModule'. +tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(20,79): error TS4019: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(23,78): error TS4019: Implements clause of exported class 'publicClassImplementingPrivateAndPublicInterface' has or is using private name 'privateInterfaceInPublicModule'. tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(63,65): error TS4019: Implements clause of exported class 'publicClassImplementingPrivateInterface' has or is using private name 'privateInterface'. -tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(68,75): error TS4017: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using name 'privateModule.publicInterfaceInPrivateModule' from private module 'privateModule'. +tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(68,75): error TS4019: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts (5 errors) ==== @@ -29,8 +29,8 @@ tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(68,7 class privateClassImplementingFromPrivateModuleInterface implements privateModule.publicInterfaceInPrivateModule { } export class publicClassImplementingFromPrivateModuleInterface implements privateModule.publicInterfaceInPrivateModule { // Should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4017: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using name 'privateModule.publicInterfaceInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4019: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. } export class publicClassImplementingPrivateAndPublicInterface implements privateInterfaceInPublicModule, publicInterfaceInPublicModule { // Should error @@ -83,8 +83,8 @@ tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(68,7 class privateClassImplementingFromPrivateModuleInterface implements privateModule.publicInterfaceInPrivateModule { } export class publicClassImplementingFromPrivateModuleInterface implements privateModule.publicInterfaceInPrivateModule { // Should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4017: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using name 'privateModule.publicInterfaceInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4019: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. } ==== tests/cases/compiler/privacyClassImplementsClauseDeclFile_GlobalFile.ts (1 errors) ==== diff --git a/tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt b/tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt index ce0ff604570..0e88e08e645 100644 --- a/tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt +++ b/tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt @@ -1,63 +1,63 @@ -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(164,14): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(165,10): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(166,18): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(188,37): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(192,24): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(196,21): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(196,42): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(196,72): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(239,60): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(248,75): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(254,14): error TS4064: Parameter 'param' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(255,10): error TS4066: Parameter 'param' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(256,18): error TS4074: Parameter 'param' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(259,37): error TS4069: Parameter 'param' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(261,24): error TS4072: Parameter 'param' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(263,21): error TS4062: Parameter 'param' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(263,55): error TS4062: Parameter 'param1' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(263,98): error TS4062: Parameter 'param2' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(266,67): error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(268,82): error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(9,10): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(10,6): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(11,14): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(33,33): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(37,20): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(41,17): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(41,38): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(41,68): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(84,56): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(93,71): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(99,10): error TS4064: Parameter 'param' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(100,6): error TS4066: Parameter 'param' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(101,14): error TS4074: Parameter 'param' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(104,33): error TS4069: Parameter 'param' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(106,20): error TS4072: Parameter 'param' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(108,17): error TS4062: Parameter 'param' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(108,51): error TS4062: Parameter 'param1' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(108,94): error TS4062: Parameter 'param2' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(111,63): error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(113,78): error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(141,14): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(142,10): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(143,18): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(165,37): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(169,24): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(173,21): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(173,42): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(173,72): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(216,60): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(225,75): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(231,14): error TS4064: Parameter 'param' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(232,10): error TS4066: Parameter 'param' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(233,18): error TS4074: Parameter 'param' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(236,37): error TS4069: Parameter 'param' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(238,24): error TS4072: Parameter 'param' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(240,21): error TS4062: Parameter 'param' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(240,55): error TS4062: Parameter 'param1' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(240,98): error TS4062: Parameter 'param2' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(243,67): error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(164,21): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(165,17): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(166,25): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(188,44): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(192,31): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(196,28): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(196,58): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(196,87): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(239,67): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(248,82): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(254,21): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(255,17): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(256,25): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(259,44): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(261,31): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(263,28): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(263,71): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(263,113): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(266,74): error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(268,89): error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(9,17): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(10,13): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(11,21): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(33,40): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(37,27): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(41,24): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(41,54): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(41,83): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(84,63): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(93,78): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(99,17): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(100,13): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(101,21): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(104,40): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(106,27): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(108,24): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(108,67): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(108,109): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(111,70): error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(113,85): error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(141,21): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(142,17): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(143,25): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(165,44): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(169,31): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(173,28): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(173,58): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(173,87): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(216,67): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(225,82): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(231,21): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(232,17): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(233,25): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(236,44): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(238,31): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(240,28): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(240,71): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(240,113): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(243,74): error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,89): error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts (40 errors) ==== @@ -70,13 +70,13 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): export interface publicInterfaceWithPrivateParmeterTypes { new (param: privateClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. (param: privateClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. myMethod(param: privateClass): void; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. } @@ -100,23 +100,23 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): export class publicClassWithWithPrivateParmeterTypes { static myPublicStaticMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. } private static myPrivateStaticMethod(param: privateClass) { } myPublicMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. } private myPrivateMethod(param: privateClass) { } constructor(param: privateClass, private param1: privateClass, public param2: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. } } @@ -161,7 +161,7 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): } export function publicFunctionWithPrivateParmeterTypes(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. } export function publicFunctionWithPublicParmeterTypes(param: publicClass) { @@ -172,7 +172,7 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): } export declare function publicAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. export declare function publicAmbientFunctionWithPublicParmeterTypes(param: publicClass): void; declare function privateAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; @@ -180,40 +180,40 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): export interface publicInterfaceWithPrivateModuleParameterTypes { new (param: privateModule.publicClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4064: Parameter 'param' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateModule'. (param: privateModule.publicClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4066: Parameter 'param' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateModule'. myMethod(param: privateModule.publicClass): void; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4074: Parameter 'param' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModuleParameterTypes { static myPublicStaticMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4069: Parameter 'param' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateModule'. } myPublicMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4072: Parameter 'param' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateModule'. } constructor(param: privateModule.publicClass, private param1: privateModule.publicClass, public param2: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4062: Parameter 'param' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4062: Parameter 'param1' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4062: Parameter 'param2' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateModule'. } } export function publicFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. } export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass): void; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModuleParameterTypes { new (param: privateModule.publicClass): publicClass; @@ -242,13 +242,13 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): export interface publicInterfaceWithPrivateParmeterTypes { new (param: privateClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. (param: privateClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. myMethod(param: privateClass): void; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. } @@ -272,23 +272,23 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): export class publicClassWithWithPrivateParmeterTypes { static myPublicStaticMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. } private static myPrivateStaticMethod(param: privateClass) { } myPublicMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. } private myPrivateMethod(param: privateClass) { } constructor(param: privateClass, private param1: privateClass, public param2: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. } } @@ -333,7 +333,7 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): } export function publicFunctionWithPrivateParmeterTypes(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. } export function publicFunctionWithPublicParmeterTypes(param: publicClass) { @@ -344,7 +344,7 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): } export declare function publicAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. export declare function publicAmbientFunctionWithPublicParmeterTypes(param: publicClass): void; declare function privateAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; @@ -352,40 +352,40 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): export interface publicInterfaceWithPrivateModuleParameterTypes { new (param: privateModule.publicClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4064: Parameter 'param' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateModule'. (param: privateModule.publicClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4066: Parameter 'param' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateModule'. myMethod(param: privateModule.publicClass): void; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4074: Parameter 'param' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModuleParameterTypes { static myPublicStaticMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4069: Parameter 'param' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateModule'. } myPublicMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4072: Parameter 'param' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateModule'. } constructor(param: privateModule.publicClass, private param1: privateModule.publicClass, public param2: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4062: Parameter 'param' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4062: Parameter 'param1' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4062: Parameter 'param2' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateModule'. } } export function publicFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. } export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass): void; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModuleParameterTypes { new (param: privateModule.publicClass): publicClass; @@ -703,13 +703,13 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): export interface publicInterfaceWithPrivateParmeterTypes { new (param: privateClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. (param: privateClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. myMethod(param: privateClass): void; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. } @@ -733,23 +733,23 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): export class publicClassWithWithPrivateParmeterTypes { static myPublicStaticMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. } private static myPrivateStaticMethod(param: privateClass) { } myPublicMethod(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. } private myPrivateMethod(param: privateClass) { } constructor(param: privateClass, private param1: privateClass, public param2: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. } } @@ -794,7 +794,7 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): } export function publicFunctionWithPrivateParmeterTypes(param: privateClass) { // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. } export function publicFunctionWithPublicParmeterTypes(param: publicClass) { @@ -805,7 +805,7 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): } export declare function publicAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; // Error - ~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. export declare function publicAmbientFunctionWithPublicParmeterTypes(param: publicClass): void; declare function privateAmbientFunctionWithPrivateParmeterTypes(param: privateClass): void; @@ -813,40 +813,40 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(245,82): export interface publicInterfaceWithPrivateModuleParameterTypes { new (param: privateModule.publicClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4064: Parameter 'param' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateModule'. (param: privateModule.publicClass): publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4066: Parameter 'param' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateModule'. myMethod(param: privateModule.publicClass): void; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4074: Parameter 'param' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModuleParameterTypes { static myPublicStaticMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4069: Parameter 'param' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateModule'. } myPublicMethod(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4072: Parameter 'param' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateModule'. } constructor(param: privateModule.publicClass, private param1: privateModule.publicClass, public param2: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4062: Parameter 'param' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4062: Parameter 'param1' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4062: Parameter 'param2' of constructor from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateModule'. } } export function publicFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass) { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. } export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(param: privateModule.publicClass): void; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4077: Parameter 'param' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModuleParameterTypes { new (param: privateModule.publicClass): publicClass; diff --git a/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt b/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt index 2efd3d3323a..0156c7241f7 100644 --- a/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt +++ b/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt @@ -1,69 +1,69 @@ -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(281,9): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(282,9): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(283,9): error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(284,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(309,16): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(315,9): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(281,17): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(282,13): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(283,22): error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(284,21): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(309,40): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(315,27): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(321,16): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(327,9): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(416,21): error TS4060: Return type of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(416,63): error TS4060: Return type of exported function has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(428,21): error TS4060: Return type of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(441,29): error TS4060: Return type of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(447,9): error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(448,9): error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(449,9): error TS4048: Return type of index signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(450,9): error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(453,16): error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(456,9): error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(441,78): error TS4060: Return type of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(447,17): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(448,13): error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(449,22): error TS4049: Return type of index signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(450,21): error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(453,40): error TS4052: Return type of public static method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(456,27): error TS4055: Return type of public method from exported class has or is using private name 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(459,16): error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(462,9): error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(466,21): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(466,70): error TS4060: Return type of exported function has or is using private name 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(469,21): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(472,29): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(9,5): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(10,5): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(11,5): error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(12,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(37,12): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(43,5): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(472,85): error TS4060: Return type of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(9,13): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(10,9): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(11,18): error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(12,17): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(37,36): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(43,23): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(49,12): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(55,5): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(144,17): error TS4060: Return type of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(144,59): error TS4060: Return type of exported function has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(156,17): error TS4060: Return type of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(169,25): error TS4060: Return type of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(175,5): error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(176,5): error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(177,5): error TS4048: Return type of index signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(178,5): error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(181,12): error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(184,5): error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(169,74): error TS4060: Return type of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(175,13): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(176,9): error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(177,18): error TS4049: Return type of index signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(178,17): error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(181,36): error TS4052: Return type of public static method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(184,23): error TS4055: Return type of public method from exported class has or is using private name 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(187,12): error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(190,5): error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(194,17): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(194,66): error TS4060: Return type of exported function has or is using private name 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(197,17): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(200,25): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(238,9): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(239,9): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(240,9): error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(241,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(266,16): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(272,9): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(200,81): error TS4060: Return type of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(238,17): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(239,13): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(240,22): error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(241,21): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(266,40): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(272,27): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(278,16): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(284,9): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(373,21): error TS4060: Return type of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(373,63): error TS4060: Return type of exported function has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(385,21): error TS4060: Return type of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(398,29): error TS4060: Return type of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(404,9): error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(405,9): error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(406,9): error TS4048: Return type of index signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(407,9): error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(410,16): error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(413,9): error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(398,78): error TS4060: Return type of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(404,17): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(405,13): error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(406,22): error TS4049: Return type of index signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(407,21): error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(410,40): error TS4052: Return type of public static method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(413,27): error TS4055: Return type of public method from exported class has or is using private name 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(416,16): error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(419,9): error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(423,21): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(423,70): error TS4060: Return type of exported function has or is using private name 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(426,21): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,85): error TS4060: Return type of exported function has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts (44 errors) ==== @@ -76,16 +76,16 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) export interface publicInterfaceWithPrivateParmeterTypes { new (): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. (): privateClass; // Error - ~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. [x: number]: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. myMethod(): privateClass; // Error - ~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. } @@ -112,7 +112,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) export class publicClassWithWithPrivateParmeterTypes { static myPublicStaticMethod(): privateClass { // Error - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. return null; } @@ -120,7 +120,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) return null; } myPublicMethod(): privateClass { // Error - ~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. return null; } @@ -227,7 +227,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) } export function publicFunctionWithPrivateParmeterTypes(): privateClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4060: Return type of exported function has or is using private name 'privateClass'. return null; } @@ -256,7 +256,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) } export declare function publicAmbientFunctionWithPrivateParmeterTypes(): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4060: Return type of exported function has or is using private name 'privateClass'. export declare function publicAmbientFunctionWithPublicParmeterTypes(): publicClass; declare function privateAmbientFunctionWithPrivateParmeterTypes(): privateClass; @@ -264,27 +264,27 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) export interface publicInterfaceWithPrivateModuleParameterTypes { new (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. [x: number]: privateModule.publicClass // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4048: Return type of index signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4049: Return type of index signature from exported interface has or is using private name 'privateModule'. myMethod(): privateModule.publicClass; // Error - ~~~~~~~~ -!!! error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModuleParameterTypes { static myPublicStaticMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4052: Return type of public static method from exported class has or is using private name 'privateModule'. return null; } myPublicMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~ -!!! error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4055: Return type of public method from exported class has or is using private name 'privateModule'. return null; } static myPublicStaticMethod1() { // Error @@ -299,8 +299,8 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) } } export function publicFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4060: Return type of exported function has or is using private name 'privateModule'. return null; } export function publicFunctionWithPrivateModuleParameterTypes1() { // Error @@ -309,8 +309,8 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) return new privateModule.publicClass(); } export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4060: Return type of exported function has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModuleParameterTypes { new (): privateModule.publicClass; @@ -349,16 +349,16 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) export interface publicInterfaceWithPrivateParmeterTypes { new (): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. (): privateClass; // Error - ~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. [x: number]: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. myMethod(): privateClass; // Error - ~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. } @@ -385,7 +385,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) export class publicClassWithWithPrivateParmeterTypes { static myPublicStaticMethod(): privateClass { // Error - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. return null; } @@ -393,7 +393,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) return null; } myPublicMethod(): privateClass { // Error - ~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. return null; } @@ -500,7 +500,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) } export function publicFunctionWithPrivateParmeterTypes(): privateClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4060: Return type of exported function has or is using private name 'privateClass'. return null; } @@ -529,7 +529,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) } export declare function publicAmbientFunctionWithPrivateParmeterTypes(): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4060: Return type of exported function has or is using private name 'privateClass'. export declare function publicAmbientFunctionWithPublicParmeterTypes(): publicClass; declare function privateAmbientFunctionWithPrivateParmeterTypes(): privateClass; @@ -537,27 +537,27 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) export interface publicInterfaceWithPrivateModuleParameterTypes { new (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. [x: number]: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4048: Return type of index signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4049: Return type of index signature from exported interface has or is using private name 'privateModule'. myMethod(): privateModule.publicClass; // Error - ~~~~~~~~ -!!! error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModuleParameterTypes { static myPublicStaticMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4052: Return type of public static method from exported class has or is using private name 'privateModule'. return null; } myPublicMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~ -!!! error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4055: Return type of public method from exported class has or is using private name 'privateModule'. return null; } static myPublicStaticMethod1() { // Error @@ -572,8 +572,8 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) } } export function publicFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4060: Return type of exported function has or is using private name 'privateModule'. return null; } export function publicFunctionWithPrivateModuleParameterTypes1() { // Error @@ -582,8 +582,8 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) return new privateModule.publicClass(); } export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4060: Return type of exported function has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModuleParameterTypes { new (): privateModule.publicClass; @@ -1126,16 +1126,16 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) export interface publicInterfaceWithPrivateParmeterTypes { new (): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. (): privateClass; // Error - ~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. [x: number]: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. myMethod(): privateClass; // Error - ~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. } @@ -1162,7 +1162,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) export class publicClassWithWithPrivateParmeterTypes { static myPublicStaticMethod(): privateClass { // Error - ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. return null; } @@ -1170,7 +1170,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) return null; } myPublicMethod(): privateClass { // Error - ~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. return null; } @@ -1277,7 +1277,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) } export function publicFunctionWithPrivateParmeterTypes(): privateClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4060: Return type of exported function has or is using private name 'privateClass'. return null; } @@ -1306,7 +1306,7 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) } export declare function publicAmbientFunctionWithPrivateParmeterTypes(): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4060: Return type of exported function has or is using private name 'privateClass'. export declare function publicAmbientFunctionWithPublicParmeterTypes(): publicClass; declare function privateAmbientFunctionWithPrivateParmeterTypes(): privateClass; @@ -1314,27 +1314,27 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) export interface publicInterfaceWithPrivateModuleParameterTypes { new (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. [x: number]: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4048: Return type of index signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4049: Return type of index signature from exported interface has or is using private name 'privateModule'. myMethod(): privateModule.publicClass; // Error - ~~~~~~~~ -!!! error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModuleParameterTypes { static myPublicStaticMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4052: Return type of public static method from exported class has or is using private name 'privateModule'. return null; } myPublicMethod(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~ -!!! error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4055: Return type of public method from exported class has or is using private name 'privateModule'. return null; } static myPublicStaticMethod1() { // Error @@ -1349,8 +1349,8 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) } } export function publicFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4060: Return type of exported function has or is using private name 'privateModule'. return null; } export function publicFunctionWithPrivateModuleParameterTypes1() { // Error @@ -1359,8 +1359,8 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(429,29) return new privateModule.publicClass(); } export declare function publicAmbientFunctionWithPrivateModuleParameterTypes(): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4060: Return type of exported function has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModuleParameterTypes { new (): privateModule.publicClass; diff --git a/tests/baselines/reference/privacyGloImport.errors.txt b/tests/baselines/reference/privacyGloImport.errors.txt index b5578216980..933af3315a7 100644 --- a/tests/baselines/reference/privacyGloImport.errors.txt +++ b/tests/baselines/reference/privacyGloImport.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/privacyGloImport.ts(49,5): error TS4000: Import declaration 'm1_im2_private' is using private name 'm1_M2_private'. -tests/cases/compiler/privacyGloImport.ts(80,5): error TS4000: Import declaration 'm1_im2_public' is using private name 'm1_M2_private'. +tests/cases/compiler/privacyGloImport.ts(49,29): error TS4000: Import declaration 'm1_im2_private' is using private name 'm1_M2_private'. +tests/cases/compiler/privacyGloImport.ts(80,35): error TS4000: Import declaration 'm1_im2_public' is using private name 'm1_M2_private'. ==== tests/cases/compiler/privacyGloImport.ts (2 errors) ==== @@ -52,7 +52,7 @@ tests/cases/compiler/privacyGloImport.ts(80,5): error TS4000: Import declaration import m1_im2_private = m1_M2_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4000: Import declaration 'm1_im2_private' is using private name 'm1_M2_private'. export var m1_im2_private_v1_public = m1_im2_private.c1; export var m1_im2_private_v2_public = new m1_im2_private.c1(); @@ -85,7 +85,7 @@ tests/cases/compiler/privacyGloImport.ts(80,5): error TS4000: Import declaration export import m1_im1_public = m1_M1_public; export import m1_im2_public = m1_M2_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4000: Import declaration 'm1_im2_public' is using private name 'm1_M2_private'. //export import m1_im3_public = require("m1_M3_public"); //export import m1_im4_public = require("m1_M4_private"); diff --git a/tests/baselines/reference/privacyGloImportParseErrors.errors.txt b/tests/baselines/reference/privacyGloImportParseErrors.errors.txt index b87e6867a8f..14bdd82dd0c 100644 --- a/tests/baselines/reference/privacyGloImportParseErrors.errors.txt +++ b/tests/baselines/reference/privacyGloImportParseErrors.errors.txt @@ -1,12 +1,7 @@ -tests/cases/compiler/privacyGloImportParseErrors.ts(59,5): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyGloImportParseErrors.ts(69,5): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyGloImportParseErrors.ts(81,5): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyGloImportParseErrors.ts(82,5): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyGloImportParseErrors.ts(121,9): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyGloImportParseErrors.ts(125,13): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/privacyGloImportParseErrors.ts(59,37): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/privacyGloImportParseErrors.ts(121,38): error TS1147: Import declarations in an internal module cannot reference an external module. tests/cases/compiler/privacyGloImportParseErrors.ts(133,9): error TS1038: A 'declare' modifier cannot be used in an already ambient context. -tests/cases/compiler/privacyGloImportParseErrors.ts(146,5): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyGloImportParseErrors.ts(149,9): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/privacyGloImportParseErrors.ts(146,25): error TS1147: Import declarations in an internal module cannot reference an external module. tests/cases/compiler/privacyGloImportParseErrors.ts(22,27): error TS2435: Ambient external modules cannot be nested in other modules. tests/cases/compiler/privacyGloImportParseErrors.ts(30,20): error TS2435: Ambient external modules cannot be nested in other modules. tests/cases/compiler/privacyGloImportParseErrors.ts(59,37): error TS2307: Cannot find external module 'm1_M3_public'. @@ -16,7 +11,7 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(138,16): error TS2435: Ambie tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2435: Ambient external modules cannot be nested in other modules. -==== tests/cases/compiler/privacyGloImportParseErrors.ts (16 errors) ==== +==== tests/cases/compiler/privacyGloImportParseErrors.ts (11 errors) ==== module m1 { export module m1_M1_public { export class c1 { @@ -80,7 +75,7 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2435: Ambie var m1_im2_private_v4_private = m1_im2_private.f1(); import m1_im3_private = require("m1_M3_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. ~~~~~~~~~~~~~~ !!! error TS2307: Cannot find external module 'm1_M3_public'. @@ -94,8 +89,6 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2435: Ambie var m1_im3_private_v4_private = m1_im3_private.f1(); import m1_im4_private = require("m1_M4_private"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. ~~~~~~~~~~~~~~~ !!! error TS2307: Cannot find external module 'm1_M4_private'. export var m1_im4_private_v1_public = m1_im4_private.c1; @@ -110,11 +103,7 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2435: Ambie export import m1_im1_public = m1_M1_public; export import m1_im2_public = m1_M2_private; export import m1_im3_public = require("m1_M3_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. export import m1_im4_public = require("m1_M4_private"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. } module glo_M1_public { @@ -154,14 +143,12 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2435: Ambie module m2 { import errorImport = require("glo_M2_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. import nonerrorImport = glo_M1_public; module m5 { import m5_errorImport = require("glo_M2_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. import m5_nonerrorImport = glo_M1_public; } } @@ -191,13 +178,11 @@ tests/cases/compiler/privacyGloImportParseErrors.ts(141,12): error TS2435: Ambie module m2 { import m3 = require("use_glo_M1_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. module m4 { var a = 10; import m2 = require("use_glo_M1_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. } } \ No newline at end of file diff --git a/tests/baselines/reference/privacyImport.errors.txt b/tests/baselines/reference/privacyImport.errors.txt index 931bbf13ff0..d5cb61d99b5 100644 --- a/tests/baselines/reference/privacyImport.errors.txt +++ b/tests/baselines/reference/privacyImport.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/privacyImport.ts(49,5): error TS4000: Import declaration 'm1_im2_private' is using private name 'm1_M2_private'. -tests/cases/compiler/privacyImport.ts(80,5): error TS4000: Import declaration 'm1_im2_public' is using private name 'm1_M2_private'. +tests/cases/compiler/privacyImport.ts(49,29): error TS4000: Import declaration 'm1_im2_private' is using private name 'm1_M2_private'. +tests/cases/compiler/privacyImport.ts(80,35): error TS4000: Import declaration 'm1_im2_public' is using private name 'm1_M2_private'. ==== tests/cases/compiler/privacyImport.ts (2 errors) ==== @@ -52,7 +52,7 @@ tests/cases/compiler/privacyImport.ts(80,5): error TS4000: Import declaration 'm import m1_im2_private = m1_M2_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4000: Import declaration 'm1_im2_private' is using private name 'm1_M2_private'. export var m1_im2_private_v1_public = m1_im2_private.c1; export var m1_im2_private_v2_public = new m1_im2_private.c1(); @@ -85,7 +85,7 @@ tests/cases/compiler/privacyImport.ts(80,5): error TS4000: Import declaration 'm export import m1_im1_public = m1_M1_public; export import m1_im2_public = m1_M2_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4000: Import declaration 'm1_im2_public' is using private name 'm1_M2_private'. //export import m1_im3_public = require("m1_M3_public"); //export import m1_im4_public = require("m1_M4_private"); diff --git a/tests/baselines/reference/privacyImportParseErrors.errors.txt b/tests/baselines/reference/privacyImportParseErrors.errors.txt index 3388cdc3b9c..6ef7298aad2 100644 --- a/tests/baselines/reference/privacyImportParseErrors.errors.txt +++ b/tests/baselines/reference/privacyImportParseErrors.errors.txt @@ -1,22 +1,11 @@ -tests/cases/compiler/privacyImportParseErrors.ts(59,5): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(69,5): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(81,5): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(82,5): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(143,5): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(153,5): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(166,5): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(167,5): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(273,9): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(277,13): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(302,9): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(306,13): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/privacyImportParseErrors.ts(59,37): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/privacyImportParseErrors.ts(143,37): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/privacyImportParseErrors.ts(273,38): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/privacyImportParseErrors.ts(302,38): error TS1147: Import declarations in an internal module cannot reference an external module. tests/cases/compiler/privacyImportParseErrors.ts(314,9): error TS1038: A 'declare' modifier cannot be used in an already ambient context. tests/cases/compiler/privacyImportParseErrors.ts(326,9): error TS1029: 'export' modifier must precede 'declare' modifier. -tests/cases/compiler/privacyImportParseErrors.ts(328,9): error TS1038: A 'declare' modifier cannot be used in an already ambient context. -tests/cases/compiler/privacyImportParseErrors.ts(341,5): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(344,9): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(350,5): error TS1147: Import declarations in an internal module cannot reference an external module. -tests/cases/compiler/privacyImportParseErrors.ts(353,9): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/privacyImportParseErrors.ts(341,25): error TS1147: Import declarations in an internal module cannot reference an external module. +tests/cases/compiler/privacyImportParseErrors.ts(350,25): error TS1147: Import declarations in an internal module cannot reference an external module. tests/cases/compiler/privacyImportParseErrors.ts(22,27): error TS2435: Ambient external modules cannot be nested in other modules. tests/cases/compiler/privacyImportParseErrors.ts(30,20): error TS2435: Ambient external modules cannot be nested in other modules. tests/cases/compiler/privacyImportParseErrors.ts(59,37): error TS2307: Cannot find external module 'm1_M3_public'. @@ -49,7 +38,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(333,16): error TS2435: Ambient tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient external modules cannot be nested in other modules. -==== tests/cases/compiler/privacyImportParseErrors.ts (49 errors) ==== +==== tests/cases/compiler/privacyImportParseErrors.ts (38 errors) ==== export module m1 { export module m1_M1_public { export class c1 { @@ -113,7 +102,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient var m1_im2_private_v4_private = m1_im2_private.f1(); import m1_im3_private = require("m1_M3_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. ~~~~~~~~~~~~~~ !!! error TS2307: Cannot find external module 'm1_M3_public'. @@ -127,8 +116,6 @@ tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient var m1_im3_private_v4_private = m1_im3_private.f1(); import m1_im4_private = require("m1_M4_private"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. ~~~~~~~~~~~~~~~ !!! error TS2307: Cannot find external module 'm1_M4_private'. export var m1_im4_private_v1_public = m1_im4_private.c1; @@ -143,11 +130,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient export import m1_im1_public = m1_M1_public; export import m1_im2_public = m1_M2_private; export import m1_im3_public = require("m1_M3_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. export import m1_im4_public = require("m1_M4_private"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. } module m2 { @@ -213,7 +196,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient var m1_im2_private_v4_private = m1_im2_private.f1(); import m1_im3_private = require("m2_M3_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. ~~~~~~~~~~~~~~ !!! error TS2307: Cannot find external module 'm2_M3_public'. @@ -227,8 +210,6 @@ tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient var m1_im3_private_v4_private = m1_im3_private.f1(); import m1_im4_private = require("m2_M4_private"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. ~~~~~~~~~~~~~~~ !!! error TS2307: Cannot find external module 'm2_M4_private'. export var m1_im4_private_v1_public = m1_im4_private.c1; @@ -244,11 +225,7 @@ tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient export import m1_im1_public = m2_M1_public; export import m1_im2_public = m2_M2_private; export import m1_im3_public = require("m2_M3_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. export import m1_im4_public = require("m2_M4_private"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. } export module glo_M1_public { @@ -375,14 +352,12 @@ tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient module m2 { import errorImport = require("glo_M2_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. import nonerrorImport = glo_M1_public; module m5 { import m5_errorImport = require("glo_M2_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. import m5_nonerrorImport = glo_M1_public; } } @@ -416,14 +391,12 @@ tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient module m2 { import errorImport = require("glo_M4_private"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. import nonerrorImport = glo_M3_private; module m5 { import m5_errorImport = require("glo_M4_private"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. import m5_nonerrorImport = glo_M3_private; } } @@ -460,8 +433,6 @@ tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient !!! error TS2435: Ambient external modules cannot be nested in other modules. module m2 { declare module "abc" { - ~~~~~~~ -!!! error TS1038: A 'declare' modifier cannot be used in an already ambient context. ~~~~~ !!! error TS2435: Ambient external modules cannot be nested in other modules. } @@ -481,26 +452,22 @@ tests/cases/compiler/privacyImportParseErrors.ts(336,12): error TS2435: Ambient module m2 { import m3 = require("use_glo_M1_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. module m4 { var a = 10; import m2 = require("use_glo_M1_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. } } export module m3 { import m3 = require("use_glo_M1_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. module m4 { var a = 10; import m2 = require("use_glo_M1_public"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. } } \ No newline at end of file diff --git a/tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt b/tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt index 64cbd76763f..41c53ffd19b 100644 --- a/tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt +++ b/tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_GlobalFile.ts(14,82): error TS4022: Extends clause of exported interface 'publicInterfaceImplementingPrivateInterfaceInModule' has or is using private name 'privateInterfaceInPublicModule'. tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(15,82): error TS4022: Extends clause of exported interface 'publicInterfaceImplementingPrivateInterfaceInModule' has or is using private name 'privateInterfaceInPublicModule'. -tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(20,84): error TS4021: Extends clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using name 'privateModule.publicInterfaceInPrivateModule' from private module 'privateModule'. +tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(20,84): error TS4022: Extends clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(23,83): error TS4022: Extends clause of exported interface 'publicInterfaceImplementingPrivateAndPublicInterface' has or is using private name 'privateInterfaceInPublicModule'. tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(63,70): error TS4022: Extends clause of exported interface 'publicInterfaceImplementingPrivateInterface' has or is using private name 'privateInterface'. -tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(68,80): error TS4021: Extends clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using name 'privateModule.publicInterfaceInPrivateModule' from private module 'privateModule'. +tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(68,80): error TS4022: Extends clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts (5 errors) ==== @@ -29,8 +29,8 @@ tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(68, interface privateInterfaceImplementingFromPrivateModuleInterface extends privateModule.publicInterfaceInPrivateModule { } export interface publicInterfaceImplementingFromPrivateModuleInterface extends privateModule.publicInterfaceInPrivateModule { // Should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4021: Extends clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using name 'privateModule.publicInterfaceInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4022: Extends clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. } export interface publicInterfaceImplementingPrivateAndPublicInterface extends privateInterfaceInPublicModule, publicInterfaceInPublicModule { // Should error @@ -83,8 +83,8 @@ tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(68, interface privateInterfaceImplementingFromPrivateModuleInterface extends privateModule.publicInterfaceInPrivateModule { } export interface publicInterfaceImplementingFromPrivateModuleInterface extends privateModule.publicInterfaceInPrivateModule { // Should error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4021: Extends clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using name 'privateModule.publicInterfaceInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4022: Extends clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. } ==== tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_GlobalFile.ts (1 errors) ==== diff --git a/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.errors.txt b/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.errors.txt index 77eef3f32a5..45dbc77e7a0 100644 --- a/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.errors.txt +++ b/tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(51,5): error TS4000: Import declaration 'im_public_c_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(52,5): error TS4000: Import declaration 'im_public_e_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(53,5): error TS4000: Import declaration 'im_public_f_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(54,5): error TS4000: Import declaration 'im_public_v_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(55,5): error TS4000: Import declaration 'im_public_i_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(56,5): error TS4000: Import declaration 'im_public_mi_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(57,5): error TS4000: Import declaration 'im_public_mu_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(51,41): error TS4000: Import declaration 'im_public_c_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(52,41): error TS4000: Import declaration 'im_public_e_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(53,41): error TS4000: Import declaration 'im_public_f_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(54,41): error TS4000: Import declaration 'im_public_v_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(55,41): error TS4000: Import declaration 'im_public_i_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(56,42): error TS4000: Import declaration 'im_public_mi_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(57,42): error TS4000: Import declaration 'im_public_mu_private' is using private name 'm_private'. ==== tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts (7 errors) ==== @@ -59,25 +59,25 @@ tests/cases/compiler/privacyLocalInternalReferenceImportWithExport.ts(57,5): err export module import_public { // Privacy errors - importing private elements export import im_public_c_private = m_private.c_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_c_private' is using private name 'm_private'. export import im_public_e_private = m_private.e_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_e_private' is using private name 'm_private'. export import im_public_f_private = m_private.f_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_f_private' is using private name 'm_private'. export import im_public_v_private = m_private.v_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_v_private' is using private name 'm_private'. export import im_public_i_private = m_private.i_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_i_private' is using private name 'm_private'. export import im_public_mi_private = m_private.mi_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_mi_private' is using private name 'm_private'. export import im_public_mu_private = m_private.mu_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_mu_private' is using private name 'm_private'. // Usage of privacy error imports diff --git a/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.errors.txt b/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.errors.txt index c5b18127129..12fd1927660 100644 --- a/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.errors.txt +++ b/tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(51,5): error TS4000: Import declaration 'im_private_c_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(52,5): error TS4000: Import declaration 'im_private_e_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(55,5): error TS4000: Import declaration 'im_private_i_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(56,5): error TS4000: Import declaration 'im_private_mi_private' is using private name 'm_private'. -tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(57,5): error TS4000: Import declaration 'im_private_mu_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(51,35): error TS4000: Import declaration 'im_private_c_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(52,35): error TS4000: Import declaration 'im_private_e_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(55,35): error TS4000: Import declaration 'im_private_i_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(56,36): error TS4000: Import declaration 'im_private_mi_private' is using private name 'm_private'. +tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(57,36): error TS4000: Import declaration 'im_private_mu_private' is using private name 'm_private'. ==== tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts (5 errors) ==== @@ -57,21 +57,21 @@ tests/cases/compiler/privacyLocalInternalReferenceImportWithoutExport.ts(57,5): export module import_public { // No Privacy errors - importing private elements import im_private_c_private = m_private.c_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_c_private' is using private name 'm_private'. import im_private_e_private = m_private.e_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_e_private' is using private name 'm_private'. import im_private_f_private = m_private.f_private; import im_private_v_private = m_private.v_private; import im_private_i_private = m_private.i_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_i_private' is using private name 'm_private'. import im_private_mi_private = m_private.mi_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_mi_private' is using private name 'm_private'. import im_private_mu_private = m_private.mu_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_mu_private' is using private name 'm_private'. // Usage of above decls diff --git a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.errors.txt b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.errors.txt index e601feabe91..d3715af1d54 100644 --- a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.errors.txt +++ b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(50,1): error TS4000: Import declaration 'im_public_c_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(51,1): error TS4000: Import declaration 'im_public_e_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(52,1): error TS4000: Import declaration 'im_public_f_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(53,1): error TS4000: Import declaration 'im_public_v_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(54,1): error TS4000: Import declaration 'im_public_i_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(55,1): error TS4000: Import declaration 'im_public_mi_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(56,1): error TS4000: Import declaration 'im_public_mu_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(50,37): error TS4000: Import declaration 'im_public_c_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(51,37): error TS4000: Import declaration 'im_public_e_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(52,37): error TS4000: Import declaration 'im_public_f_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(53,37): error TS4000: Import declaration 'im_public_v_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(54,37): error TS4000: Import declaration 'im_public_i_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(55,38): error TS4000: Import declaration 'im_public_mi_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(56,38): error TS4000: Import declaration 'im_public_mu_private' is using private name 'm_private'. ==== tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts (7 errors) ==== @@ -58,25 +58,25 @@ tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts(56,1): // Privacy errors - importing private elements export import im_public_c_private = m_private.c_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_c_private' is using private name 'm_private'. export import im_public_e_private = m_private.e_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_e_private' is using private name 'm_private'. export import im_public_f_private = m_private.f_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_f_private' is using private name 'm_private'. export import im_public_v_private = m_private.v_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_v_private' is using private name 'm_private'. export import im_public_i_private = m_private.i_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_i_private' is using private name 'm_private'. export import im_public_mi_private = m_private.mi_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_mi_private' is using private name 'm_private'. export import im_public_mu_private = m_private.mu_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_public_mu_private' is using private name 'm_private'. // Usage of privacy error imports diff --git a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.errors.txt b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.errors.txt index 739f2fafaea..1fbf8f7bac9 100644 --- a/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.errors.txt +++ b/tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(51,1): error TS4000: Import declaration 'im_private_c_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(52,1): error TS4000: Import declaration 'im_private_e_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(55,1): error TS4000: Import declaration 'im_private_i_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(56,1): error TS4000: Import declaration 'im_private_mi_private' is using private name 'm_private'. -tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(57,1): error TS4000: Import declaration 'im_private_mu_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(51,31): error TS4000: Import declaration 'im_private_c_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(52,31): error TS4000: Import declaration 'im_private_e_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(55,31): error TS4000: Import declaration 'im_private_i_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(56,32): error TS4000: Import declaration 'im_private_mi_private' is using private name 'm_private'. +tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(57,32): error TS4000: Import declaration 'im_private_mu_private' is using private name 'm_private'. ==== tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts (5 errors) ==== @@ -57,21 +57,21 @@ tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts(57,1 // No Privacy errors - importing private elements import im_private_c_private = m_private.c_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_c_private' is using private name 'm_private'. import im_private_e_private = m_private.e_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_e_private' is using private name 'm_private'. import im_private_f_private = m_private.f_private; import im_private_v_private = m_private.v_private; import im_private_i_private = m_private.i_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_i_private' is using private name 'm_private'. import im_private_mi_private = m_private.mi_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_mi_private' is using private name 'm_private'. import im_private_mu_private = m_private.mu_private; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS4000: Import declaration 'im_private_mu_private' is using private name 'm_private'. // Usage of above decls diff --git a/tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.errors.txt b/tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.errors.txt index eef4c3be375..663025ee722 100644 --- a/tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.errors.txt +++ b/tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.errors.txt @@ -1,39 +1,39 @@ -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(8,5): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(8,10): error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(9,5): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(9,6): error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(10,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(10,14): error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(32,33): error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(36,20): error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(75,57): error TS4016: Type parameter 'T' of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(127,5): error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(127,10): error TS4005: Type parameter 'T' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(128,5): error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(128,6): error TS4007: Type parameter 'T' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(129,5): error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(129,14): error TS4013: Type parameter 'T' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(132,33): error TS4009: Type parameter 'T' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(134,20): error TS4011: Type parameter 'T' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(137,64): error TS4015: Type parameter 'T' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(164,9): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(164,14): error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(165,9): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(165,10): error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(166,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(166,18): error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(188,37): error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(192,24): error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(231,61): error TS4016: Type parameter 'T' of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(283,9): error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(283,14): error TS4005: Type parameter 'T' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(284,9): error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(284,10): error TS4007: Type parameter 'T' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(285,9): error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(285,18): error TS4013: Type parameter 'T' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(288,37): error TS4009: Type parameter 'T' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(290,24): error TS4011: Type parameter 'T' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,68): error TS4015: Type parameter 'T' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(8,20): error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(8,37): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(9,16): error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(9,33): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(10,24): error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(10,41): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(32,43): error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(36,30): error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(75,67): error TS4016: Type parameter 'T' of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(127,20): error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(127,50): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(128,16): error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(128,46): error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(129,24): error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(129,54): error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(132,43): error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(134,30): error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(137,74): error TS4016: Type parameter 'T' of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(164,24): error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(164,41): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(165,20): error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(165,37): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(166,28): error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(166,45): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(188,47): error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(192,34): error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(231,71): error TS4016: Type parameter 'T' of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(283,24): error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(283,54): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(284,20): error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(284,50): error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(285,28): error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(285,58): error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(288,47): error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(290,34): error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,78): error TS4016: Type parameter 'T' of exported function has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts (36 errors) ==== @@ -45,20 +45,20 @@ tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,68): error TS export interface publicInterfaceWithPrivateTypeParameters { new (): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateClass'. + ~~~~~~~~~~~~ +!!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. (): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateClass'. + ~~~~~~~~~~~~ +!!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. myMethod(): privateClass; // Error - ~~~~~~~~ -!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateClass'. + ~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. } export interface publicInterfaceWithPublicTypeParameters { @@ -81,13 +81,13 @@ tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,68): error TS export class publicClassWithWithPrivateTypeParameters { static myPublicStaticMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateClass'. } private static myPrivateStaticMethod() { } myPublicMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateClass'. } private myPrivateMethod() { @@ -128,7 +128,7 @@ tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,68): error TS } export function publicFunctionWithPrivateTypeParameters() { // Error - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4016: Type parameter 'T' of exported function has or is using private name 'privateClass'. } @@ -182,34 +182,34 @@ tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,68): error TS export interface publicInterfaceWithPrivatModuleTypeParameters { new (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4005: Type parameter 'T' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4007: Type parameter 'T' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. myMethod(): privateModule.publicClass; // Error - ~~~~~~~~ -!!! error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4013: Type parameter 'T' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithWithPrivateModuleTypeParameters { static myPublicStaticMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4009: Type parameter 'T' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateModule'. } myPublicMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4011: Type parameter 'T' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateModule'. } } export function publicFunctionWithPrivateMopduleTypeParameters() { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4015: Type parameter 'T' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4016: Type parameter 'T' of exported function has or is using private name 'privateModule'. } @@ -237,20 +237,20 @@ tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,68): error TS export interface publicInterfaceWithPrivateTypeParameters { new (): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateClass'. + ~~~~~~~~~~~~ +!!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. (): privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateClass'. + ~~~~~~~~~~~~ +!!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. myMethod(): privateClass; // Error - ~~~~~~~~ -!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateClass'. + ~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. } export interface publicInterfaceWithPublicTypeParameters { @@ -273,13 +273,13 @@ tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,68): error TS export class publicClassWithWithPrivateTypeParameters { static myPublicStaticMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateClass'. } private static myPrivateStaticMethod() { } myPublicMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateClass'. } private myPrivateMethod() { @@ -320,7 +320,7 @@ tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,68): error TS } export function publicFunctionWithPrivateTypeParameters() { // Error - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4016: Type parameter 'T' of exported function has or is using private name 'privateClass'. } @@ -374,34 +374,34 @@ tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts(293,68): error TS export interface publicInterfaceWithPrivatModuleTypeParameters { new (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4044: Return type of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4005: Type parameter 'T' of constructor signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4006: Type parameter 'T' of constructor signature from exported interface has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. (): privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4046: Return type of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4007: Type parameter 'T' of call signature from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4008: Type parameter 'T' of call signature from exported interface has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. myMethod(): privateModule.publicClass; // Error - ~~~~~~~~ -!!! error TS4056: Return type of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4013: Type parameter 'T' of method from exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4014: Type parameter 'T' of method from exported interface has or is using private name 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. } export class publicClassWithWithPrivateModuleTypeParameters { static myPublicStaticMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4009: Type parameter 'T' of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4010: Type parameter 'T' of public static method from exported class has or is using private name 'privateModule'. } myPublicMethod() { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4011: Type parameter 'T' of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4012: Type parameter 'T' of public method from exported class has or is using private name 'privateModule'. } } export function publicFunctionWithPrivateMopduleTypeParameters() { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4015: Type parameter 'T' of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4016: Type parameter 'T' of exported function has or is using private name 'privateModule'. } diff --git a/tests/baselines/reference/privacyTypeParametersOfClassDeclFile.errors.txt b/tests/baselines/reference/privacyTypeParametersOfClassDeclFile.errors.txt index bc47d164759..a6ae0fdcc01 100644 --- a/tests/baselines/reference/privacyTypeParametersOfClassDeclFile.errors.txt +++ b/tests/baselines/reference/privacyTypeParametersOfClassDeclFile.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(7,51): error TS4002: Type parameter 'T' of exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(43,61): error TS4001: Type parameter 'T' of exported class has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(62,55): error TS4002: Type parameter 'T' of exported class has or is using private name 'privateClassInPublicModule'. -tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(98,65): error TS4001: Type parameter 'T' of exported class has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. +tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(7,61): error TS4002: Type parameter 'T' of exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(43,71): error TS4002: Type parameter 'T' of exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(62,65): error TS4002: Type parameter 'T' of exported class has or is using private name 'privateClassInPublicModule'. +tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(98,75): error TS4002: Type parameter 'T' of exported class has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts (4 errors) ==== @@ -12,7 +12,7 @@ tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(98,65): error TS400 } export class publicClassWithPrivateTypeParameters { // Error - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4002: Type parameter 'T' of exported class has or is using private name 'privateClass'. myMethod(val: T): T { return val; @@ -50,8 +50,8 @@ tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(98,65): error TS400 } export class publicClassWithTypeParametersFromPrivateModule { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4001: Type parameter 'T' of exported class has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4002: Type parameter 'T' of exported class has or is using private name 'privateModule'. myMethod(val: T): T { return val; } @@ -71,7 +71,7 @@ tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(98,65): error TS400 } export class publicClassWithPrivateTypeParameters { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS4002: Type parameter 'T' of exported class has or is using private name 'privateClassInPublicModule'. myMethod(val: T): T { return val; @@ -109,8 +109,8 @@ tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts(98,65): error TS400 } export class publicClassWithTypeParametersFromPrivateModule { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4001: Type parameter 'T' of exported class has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4002: Type parameter 'T' of exported class has or is using private name 'privateModule'. myMethod(val: T): T { return val; } diff --git a/tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.errors.txt b/tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.errors.txt index f4ea800e792..eb6bb3ea734 100644 --- a/tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.errors.txt +++ b/tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.errors.txt @@ -1,23 +1,23 @@ -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(13,59): error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(16,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(16,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(17,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(18,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(25,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(25,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(26,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(27,5): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(60,75): error TS4003: Type parameter 'T' of exported interface has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(79,63): error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateClassInPublicModule'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(82,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(82,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(83,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(84,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(91,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(91,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(92,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(93,9): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. -tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(125,79): error TS4003: Type parameter 'T' of exported interface has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(13,69): error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(16,18): error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(16,32): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(17,18): error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(18,31): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(25,18): error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(25,32): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(26,18): error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(27,31): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(60,85): error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(79,73): error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateClassInPublicModule'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(82,22): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(82,50): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(83,22): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(84,49): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(91,22): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(91,50): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(92,22): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(93,49): error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. +tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(125,89): error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts (20 errors) ==== @@ -34,20 +34,20 @@ tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(125,79): error } export interface publicInterfaceWithPrivateTypeParameters { // Error - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateClass'. myMethod(val: T): T; myMethod0(): publicClassT; myMethod1(): privateClassT; - ~~~~~~~~~ -!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. - ~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. + ~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. myMethod2(): privateClassT; - ~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. myMethod3(): publicClassT; - ~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. myMethod4(): publicClassT; } @@ -56,15 +56,15 @@ tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(125,79): error myMethod(val: T): T; myMethod0(): publicClassT myMethod1(): privateClassT; - ~~~~~~~~~ -!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. - ~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. + ~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. myMethod2(): privateClassT; - ~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassT'. myMethod3(): publicClassT; - ~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. myMethod4(): publicClassT; } @@ -99,8 +99,8 @@ tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(125,79): error export interface publicInterfaceWithPrivateModuleTypeParameterConstraints { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4003: Type parameter 'T' of exported interface has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateModule'. } interface privateInterfaceWithPrivateModuleTypeParameterConstraints { // Error @@ -120,20 +120,20 @@ tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(125,79): error } export interface publicInterfaceWithPrivateTypeParameters { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateClassInPublicModule'. myMethod(val: T): T; myMethod0(): publicClassInPublicModuleT; myMethod1(): privateClassInPublicModuleT; - ~~~~~~~~~ -!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. - ~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. myMethod2(): privateClassInPublicModuleT; - ~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. myMethod3(): publicClassInPublicModuleT; - ~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. myMethod4(): publicClassInPublicModuleT; } @@ -142,15 +142,15 @@ tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(125,79): error myMethod(val: T): T; myMethod0(): publicClassInPublicModuleT myMethod1(): privateClassInPublicModuleT; - ~~~~~~~~~ -!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. - ~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. myMethod2(): privateClassInPublicModuleT; - ~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModuleT'. myMethod3(): publicClassInPublicModuleT; - ~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS4057: Return type of method from exported interface has or is using private name 'privateClassInPublicModule'. myMethod4(): publicClassInPublicModuleT; } @@ -184,8 +184,8 @@ tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts(125,79): error } export interface publicInterfaceWithPrivateModuleTypeParameterConstraints { // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4003: Type parameter 'T' of exported interface has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4004: Type parameter 'T' of exported interface has or is using private name 'privateModule'. } interface privateInterfaceWithPrivateModuleTypeParameterConstraints { // Error diff --git a/tests/baselines/reference/privacyVarDeclFile.errors.txt b/tests/baselines/reference/privacyVarDeclFile.errors.txt index 03e5f951a9d..6ae5373e0c7 100644 --- a/tests/baselines/reference/privacyVarDeclFile.errors.txt +++ b/tests/baselines/reference/privacyVarDeclFile.errors.txt @@ -1,33 +1,33 @@ -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(105,9): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(121,9): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(123,9): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(148,16): error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(153,24): error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(159,9): error TS4032: Property 'myProperty' of exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(162,9): error TS4027: Public static property 'myPublicStaticProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(163,9): error TS4030: Public property 'myPublicProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(165,16): error TS4024: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(166,24): error TS4024: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(9,5): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(25,5): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(27,5): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(52,12): error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(57,20): error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(63,5): error TS4032: Property 'myProperty' of exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(66,5): error TS4027: Public static property 'myPublicStaticProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(67,5): error TS4030: Public property 'myPublicProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(69,12): error TS4024: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(70,20): error TS4024: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(90,9): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(106,9): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(108,9): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(133,16): error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(138,24): error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(144,9): error TS4032: Property 'myProperty' of exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(147,9): error TS4027: Public static property 'myPublicStaticProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(148,9): error TS4030: Public property 'myPublicProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(150,16): error TS4024: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(105,21): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(121,40): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(123,27): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(148,51): error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(153,66): error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(159,21): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(162,40): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(163,27): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(165,57): error TS4025: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(166,72): error TS4025: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(9,17): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(25,36): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(27,23): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(52,47): error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(57,62): error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(63,17): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(66,36): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(67,23): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(69,53): error TS4025: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(70,68): error TS4025: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(90,21): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(106,40): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(108,27): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(133,51): error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(138,66): error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(144,21): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(147,40): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(148,27): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(150,57): error TS4025: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,72): error TS4025: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyVarDeclFile_externalModule.ts (20 errors) ==== @@ -40,7 +40,7 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: export interface publicInterfaceWithPrivatePropertyTypes { myProperty: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. } @@ -58,11 +58,11 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: export class publicClassWithWithPrivatePropertyTypes { static myPublicStaticProperty: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. private static myPrivateStaticProperty: privateClass; myPublicProperty: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. private myPrivateProperty: privateClass; } @@ -89,14 +89,14 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: } export var publicVarWithPrivatePropertyTypes: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. export var publicVarWithPublicPropertyTypes: publicClass; var privateVarWithPrivatePropertyTypes: privateClass; var privateVarWithPublicPropertyTypes: publicClass; export declare var publicAmbientVarWithPrivatePropertyTypes: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. export declare var publicAmbientVarWithPublicPropertyTypes: publicClass; declare var privateAmbientVarWithPrivatePropertyTypes: privateClass; @@ -104,23 +104,23 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: export interface publicInterfaceWithPrivateModulePropertyTypes { myProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4032: Property 'myProperty' of exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModulePropertyTypes { static myPublicStaticProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4027: Public static property 'myPublicStaticProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateModule'. myPublicProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4030: Public property 'myPublicProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateModule'. } export var publicVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4024: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4025: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. export declare var publicAmbientVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4024: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4025: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModulePropertyTypes { myProperty: privateModule.publicClass; @@ -141,7 +141,7 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: export interface publicInterfaceWithPrivatePropertyTypes { myProperty: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. } @@ -159,11 +159,11 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: export class publicClassWithWithPrivatePropertyTypes { static myPublicStaticProperty: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. private static myPrivateStaticProperty: privateClass; myPublicProperty: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. private myPrivateProperty: privateClass; } @@ -190,14 +190,14 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: } export var publicVarWithPrivatePropertyTypes: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. export var publicVarWithPublicPropertyTypes: publicClass; var privateVarWithPrivatePropertyTypes: privateClass; var privateVarWithPublicPropertyTypes: publicClass; export declare var publicAmbientVarWithPrivatePropertyTypes: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. export declare var publicAmbientVarWithPublicPropertyTypes: publicClass; declare var privateAmbientVarWithPrivatePropertyTypes: privateClass; @@ -205,23 +205,23 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: export interface publicInterfaceWithPrivateModulePropertyTypes { myProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4032: Property 'myProperty' of exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModulePropertyTypes { static myPublicStaticProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4027: Public static property 'myPublicStaticProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateModule'. myPublicProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4030: Public property 'myPublicProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateModule'. } export var publicVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4024: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4025: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. export declare var publicAmbientVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4024: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4025: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModulePropertyTypes { myProperty: privateModule.publicClass; @@ -422,7 +422,7 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: export interface publicInterfaceWithPrivatePropertyTypes { myProperty: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. } @@ -440,11 +440,11 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: export class publicClassWithWithPrivatePropertyTypes { static myPublicStaticProperty: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. private static myPrivateStaticProperty: privateClass; myPublicProperty: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. private myPrivateProperty: privateClass; } @@ -471,14 +471,14 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: } export var publicVarWithPrivatePropertyTypes: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. export var publicVarWithPublicPropertyTypes: publicClass; var privateVarWithPrivatePropertyTypes: privateClass; var privateVarWithPublicPropertyTypes: publicClass; export declare var publicAmbientVarWithPrivatePropertyTypes: privateClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~ !!! error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. export declare var publicAmbientVarWithPublicPropertyTypes: publicClass; declare var privateAmbientVarWithPrivatePropertyTypes: privateClass; @@ -486,23 +486,23 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(151,24): error TS4024: export interface publicInterfaceWithPrivateModulePropertyTypes { myProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4032: Property 'myProperty' of exported interface has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateModule'. } export class publicClassWithPrivateModulePropertyTypes { static myPublicStaticProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4027: Public static property 'myPublicStaticProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateModule'. myPublicProperty: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4030: Public property 'myPublicProperty' of exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateModule'. } export var publicVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4024: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4025: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. export declare var publicAmbientVarWithPrivateModulePropertyTypes: privateModule.publicClass; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS4024: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using name 'privateModule.publicClass' from private module 'privateModule'. + ~~~~~~~~~~~~~ +!!! error TS4025: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. interface privateInterfaceWithPrivateModulePropertyTypes { myProperty: privateModule.publicClass; diff --git a/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.errors.txt b/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.errors.txt index 29925d22556..fd808bc1443 100644 --- a/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.errors.txt +++ b/tests/baselines/reference/project/intReferencingExtAndInt/amd/intReferencingExtAndInt.errors.txt @@ -1,10 +1,10 @@ -internal2.ts(2,2): error TS1147: Import declarations in an internal module cannot reference an external module. +internal2.ts(2,21): error TS1147: Import declarations in an internal module cannot reference an external module. ==== internal2.ts (1 errors) ==== module outer { import g = require("external2") - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. export var a = g.square(5); export var b = "foo"; diff --git a/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.errors.txt b/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.errors.txt index 29925d22556..fd808bc1443 100644 --- a/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.errors.txt +++ b/tests/baselines/reference/project/intReferencingExtAndInt/node/intReferencingExtAndInt.errors.txt @@ -1,10 +1,10 @@ -internal2.ts(2,2): error TS1147: Import declarations in an internal module cannot reference an external module. +internal2.ts(2,21): error TS1147: Import declarations in an internal module cannot reference an external module. ==== internal2.ts (1 errors) ==== module outer { import g = require("external2") - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. export var a = g.square(5); export var b = "foo"; diff --git a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.errors.txt b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.errors.txt index b2bc48b4543..d8a57865c22 100644 --- a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.errors.txt +++ b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/amd/nestedLocalModuleSimpleCase.errors.txt @@ -1,10 +1,10 @@ -test1.ts(2,2): error TS1147: Import declarations in an internal module cannot reference an external module. +test1.ts(2,23): error TS1147: Import declarations in an internal module cannot reference an external module. ==== test1.ts (1 errors) ==== export module myModule { import foo = require("test2"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. //console.log(foo.$); } diff --git a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.errors.txt b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.errors.txt index b2bc48b4543..d8a57865c22 100644 --- a/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.errors.txt +++ b/tests/baselines/reference/project/nestedLocalModuleSimpleCase/node/nestedLocalModuleSimpleCase.errors.txt @@ -1,10 +1,10 @@ -test1.ts(2,2): error TS1147: Import declarations in an internal module cannot reference an external module. +test1.ts(2,23): error TS1147: Import declarations in an internal module cannot reference an external module. ==== test1.ts (1 errors) ==== export module myModule { import foo = require("test2"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. //console.log(foo.$); } diff --git a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.errors.txt b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.errors.txt index d40bca73971..9d1540829fc 100644 --- a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.errors.txt +++ b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/amd/nestedLocalModuleWithRecursiveTypecheck.errors.txt @@ -1,11 +1,11 @@ -test1.ts(3,2): error TS1147: Import declarations in an internal module cannot reference an external module. +test1.ts(3,23): error TS1147: Import declarations in an internal module cannot reference an external module. ==== test1.ts (1 errors) ==== module myModule { import foo = require("test2"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. //console.log(foo.$); diff --git a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.errors.txt b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.errors.txt index d40bca73971..9d1540829fc 100644 --- a/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.errors.txt +++ b/tests/baselines/reference/project/nestedLocalModuleWithRecursiveTypecheck/node/nestedLocalModuleWithRecursiveTypecheck.errors.txt @@ -1,11 +1,11 @@ -test1.ts(3,2): error TS1147: Import declarations in an internal module cannot reference an external module. +test1.ts(3,23): error TS1147: Import declarations in an internal module cannot reference an external module. ==== test1.ts (1 errors) ==== module myModule { import foo = require("test2"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. //console.log(foo.$); diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt index b92bb48308d..f15b4d3379b 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt @@ -1,11 +1,10 @@ -testGlo.ts(2,5): error TS1147: Import declarations in an internal module cannot reference an external module. -testGlo.ts(21,5): error TS1147: Import declarations in an internal module cannot reference an external module. +testGlo.ts(2,39): error TS1147: Import declarations in an internal module cannot reference an external module. -==== testGlo.ts (2 errors) ==== +==== testGlo.ts (1 errors) ==== module m2 { export import mExported = require("mExported"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. export var c1 = new mExported.me.class1; export function f1() { @@ -26,8 +25,6 @@ testGlo.ts(21,5): error TS1147: Import declarations in an internal module cannot } import mNonExported = require("mNonExported"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. export var c3 = new mNonExported.mne.class1; export function f3() { return new mNonExported.mne.class1(); diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt index b92bb48308d..f15b4d3379b 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/privacyCheckOnImportedModuleDeclarationsInsideModule.errors.txt @@ -1,11 +1,10 @@ -testGlo.ts(2,5): error TS1147: Import declarations in an internal module cannot reference an external module. -testGlo.ts(21,5): error TS1147: Import declarations in an internal module cannot reference an external module. +testGlo.ts(2,39): error TS1147: Import declarations in an internal module cannot reference an external module. -==== testGlo.ts (2 errors) ==== +==== testGlo.ts (1 errors) ==== module m2 { export import mExported = require("mExported"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. export var c1 = new mExported.me.class1; export function f1() { @@ -26,8 +25,6 @@ testGlo.ts(21,5): error TS1147: Import declarations in an internal module cannot } import mNonExported = require("mNonExported"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. export var c3 = new mNonExported.mne.class1; export function f3() { return new mNonExported.mne.class1(); diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt index bbf4831914b..8589da5c54d 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/amd/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt @@ -1,14 +1,13 @@ -test.ts(5,5): error TS1147: Import declarations in an internal module cannot reference an external module. -test.ts(24,5): error TS1147: Import declarations in an internal module cannot reference an external module. +test.ts(5,39): error TS1147: Import declarations in an internal module cannot reference an external module. -==== test.ts (2 errors) ==== +==== test.ts (1 errors) ==== export module m1 { } module m2 { export import mExported = require("mExported"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. export var c1 = new mExported.me.class1; export function f1() { @@ -29,8 +28,6 @@ test.ts(24,5): error TS1147: Import declarations in an internal module cannot re } import mNonExported = require("mNonExported"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. export var c3 = new mNonExported.mne.class1; export function f3() { return new mNonExported.mne.class1(); diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt index bbf4831914b..8589da5c54d 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule/node/privacyCheckOnImportedModuleDeclarationsInsideNonExportedModule.errors.txt @@ -1,14 +1,13 @@ -test.ts(5,5): error TS1147: Import declarations in an internal module cannot reference an external module. -test.ts(24,5): error TS1147: Import declarations in an internal module cannot reference an external module. +test.ts(5,39): error TS1147: Import declarations in an internal module cannot reference an external module. -==== test.ts (2 errors) ==== +==== test.ts (1 errors) ==== export module m1 { } module m2 { export import mExported = require("mExported"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. export var c1 = new mExported.me.class1; export function f1() { @@ -29,8 +28,6 @@ test.ts(24,5): error TS1147: Import declarations in an internal module cannot re } import mNonExported = require("mNonExported"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. export var c3 = new mNonExported.mne.class1; export function f3() { return new mNonExported.mne.class1(); diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt index ff9a9f604a3..c3c3a11c8b2 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/amd/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt @@ -1,11 +1,10 @@ -test.ts(2,5): error TS1147: Import declarations in an internal module cannot reference an external module. -test.ts(42,5): error TS1147: Import declarations in an internal module cannot reference an external module. +test.ts(2,39): error TS1147: Import declarations in an internal module cannot reference an external module. -==== test.ts (2 errors) ==== +==== test.ts (1 errors) ==== export module m2 { export import mExported = require("mExported"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. module Internal_M1 { @@ -47,8 +46,6 @@ test.ts(42,5): error TS1147: Import declarations in an internal module cannot re } import mNonExported = require("mNonExported"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. module Internal_M3 { export var c3 = new mNonExported.mne.class1; export function f3() { diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt index ff9a9f604a3..c3c3a11c8b2 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleImportStatementInParentModule/node/privacyCheckOnImportedModuleImportStatementInParentModule.errors.txt @@ -1,11 +1,10 @@ -test.ts(2,5): error TS1147: Import declarations in an internal module cannot reference an external module. -test.ts(42,5): error TS1147: Import declarations in an internal module cannot reference an external module. +test.ts(2,39): error TS1147: Import declarations in an internal module cannot reference an external module. -==== test.ts (2 errors) ==== +==== test.ts (1 errors) ==== export module m2 { export import mExported = require("mExported"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~ !!! error TS1147: Import declarations in an internal module cannot reference an external module. module Internal_M1 { @@ -47,8 +46,6 @@ test.ts(42,5): error TS1147: Import declarations in an internal module cannot re } import mNonExported = require("mNonExported"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1147: Import declarations in an internal module cannot reference an external module. module Internal_M3 { export var c3 = new mNonExported.mne.class1; export function f3() { diff --git a/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/diskFile0.js b/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/diskFile0.js new file mode 100644 index 00000000000..ae9742b492f --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/diskFile0.js @@ -0,0 +1,7 @@ +/// +// This is bar.ts +var bar = (function () { + function bar() { + } + return bar; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/diskFile1.d.ts b/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/diskFile1.d.ts new file mode 100644 index 00000000000..a21b762e1fc --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/diskFile1.d.ts @@ -0,0 +1,3 @@ +/// +declare class bar { +} diff --git a/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/foo.d.ts b/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/foo.d.ts new file mode 100644 index 00000000000..7f80d14325a --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/foo.d.ts @@ -0,0 +1,3 @@ +/// +declare class foo { +} diff --git a/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/foo.js b/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/foo.js new file mode 100644 index 00000000000..20440d5c62b --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/foo.js @@ -0,0 +1,6 @@ +/// +var foo = (function () { + function foo() { + } + return foo; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/referenceResolutionRelativePaths.json b/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/referenceResolutionRelativePaths.json new file mode 100644 index 00000000000..fe07bb38b92 --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePaths/amd/referenceResolutionRelativePaths.json @@ -0,0 +1,20 @@ +{ + "scenario": "referenceResolution1_FromFooFolder", + "projectRoot": "tests/cases/projects/ReferenceResolution/src/ts/foo", + "inputFiles": [ + "foo.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "lib.d.ts", + "../../../bar/bar.ts", + "foo.ts" + ], + "emittedFiles": [ + "../../../bar/bar.js", + "../../../bar/bar.d.ts", + "foo.js", + "foo.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/referenceResolutionRelativePaths/node/diskFile0.js b/tests/baselines/reference/project/referenceResolutionRelativePaths/node/diskFile0.js new file mode 100644 index 00000000000..ae9742b492f --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePaths/node/diskFile0.js @@ -0,0 +1,7 @@ +/// +// This is bar.ts +var bar = (function () { + function bar() { + } + return bar; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionRelativePaths/node/diskFile1.d.ts b/tests/baselines/reference/project/referenceResolutionRelativePaths/node/diskFile1.d.ts new file mode 100644 index 00000000000..a21b762e1fc --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePaths/node/diskFile1.d.ts @@ -0,0 +1,3 @@ +/// +declare class bar { +} diff --git a/tests/baselines/reference/project/referenceResolutionRelativePaths/node/foo.d.ts b/tests/baselines/reference/project/referenceResolutionRelativePaths/node/foo.d.ts new file mode 100644 index 00000000000..7f80d14325a --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePaths/node/foo.d.ts @@ -0,0 +1,3 @@ +/// +declare class foo { +} diff --git a/tests/baselines/reference/project/referenceResolutionRelativePaths/node/foo.js b/tests/baselines/reference/project/referenceResolutionRelativePaths/node/foo.js new file mode 100644 index 00000000000..20440d5c62b --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePaths/node/foo.js @@ -0,0 +1,6 @@ +/// +var foo = (function () { + function foo() { + } + return foo; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionRelativePaths/node/referenceResolutionRelativePaths.json b/tests/baselines/reference/project/referenceResolutionRelativePaths/node/referenceResolutionRelativePaths.json new file mode 100644 index 00000000000..fe07bb38b92 --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePaths/node/referenceResolutionRelativePaths.json @@ -0,0 +1,20 @@ +{ + "scenario": "referenceResolution1_FromFooFolder", + "projectRoot": "tests/cases/projects/ReferenceResolution/src/ts/foo", + "inputFiles": [ + "foo.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "lib.d.ts", + "../../../bar/bar.ts", + "foo.ts" + ], + "emittedFiles": [ + "../../../bar/bar.js", + "../../../bar/bar.d.ts", + "foo.js", + "foo.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/bar/bar.d.ts b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/bar/bar.d.ts new file mode 100644 index 00000000000..a21b762e1fc --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/bar/bar.d.ts @@ -0,0 +1,3 @@ +/// +declare class bar { +} diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/bar/bar.js b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/bar/bar.js new file mode 100644 index 00000000000..ae9742b492f --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/bar/bar.js @@ -0,0 +1,7 @@ +/// +// This is bar.ts +var bar = (function () { + function bar() { + } + return bar; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/referenceResolutionRelativePathsFromRootDirectory.json b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/referenceResolutionRelativePathsFromRootDirectory.json new file mode 100644 index 00000000000..b24993bcf8f --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/referenceResolutionRelativePathsFromRootDirectory.json @@ -0,0 +1,20 @@ +{ + "scenario": "referenceResolution1_FromRootDirectory", + "projectRoot": "tests/cases/projects/ReferenceResolution", + "inputFiles": [ + "src/ts/foo/foo.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "lib.d.ts", + "bar/bar.ts", + "src/ts/foo/foo.ts" + ], + "emittedFiles": [ + "bar/bar.js", + "bar/bar.d.ts", + "src/ts/foo/foo.js", + "src/ts/foo/foo.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/src/ts/foo/foo.d.ts b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/src/ts/foo/foo.d.ts new file mode 100644 index 00000000000..7f80d14325a --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/src/ts/foo/foo.d.ts @@ -0,0 +1,3 @@ +/// +declare class foo { +} diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/src/ts/foo/foo.js b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/src/ts/foo/foo.js new file mode 100644 index 00000000000..20440d5c62b --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/amd/src/ts/foo/foo.js @@ -0,0 +1,6 @@ +/// +var foo = (function () { + function foo() { + } + return foo; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/bar/bar.d.ts b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/bar/bar.d.ts new file mode 100644 index 00000000000..a21b762e1fc --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/bar/bar.d.ts @@ -0,0 +1,3 @@ +/// +declare class bar { +} diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/bar/bar.js b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/bar/bar.js new file mode 100644 index 00000000000..ae9742b492f --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/bar/bar.js @@ -0,0 +1,7 @@ +/// +// This is bar.ts +var bar = (function () { + function bar() { + } + return bar; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/referenceResolutionRelativePathsFromRootDirectory.json b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/referenceResolutionRelativePathsFromRootDirectory.json new file mode 100644 index 00000000000..b24993bcf8f --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/referenceResolutionRelativePathsFromRootDirectory.json @@ -0,0 +1,20 @@ +{ + "scenario": "referenceResolution1_FromRootDirectory", + "projectRoot": "tests/cases/projects/ReferenceResolution", + "inputFiles": [ + "src/ts/foo/foo.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "lib.d.ts", + "bar/bar.ts", + "src/ts/foo/foo.ts" + ], + "emittedFiles": [ + "bar/bar.js", + "bar/bar.d.ts", + "src/ts/foo/foo.js", + "src/ts/foo/foo.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/src/ts/foo/foo.d.ts b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/src/ts/foo/foo.d.ts new file mode 100644 index 00000000000..7f80d14325a --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/src/ts/foo/foo.d.ts @@ -0,0 +1,3 @@ +/// +declare class foo { +} diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/src/ts/foo/foo.js b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/src/ts/foo/foo.js new file mode 100644 index 00000000000..20440d5c62b --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsFromRootDirectory/node/src/ts/foo/foo.js @@ -0,0 +1,6 @@ +/// +var foo = (function () { + function foo() { + } + return foo; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/diskFile0.js b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/diskFile0.js new file mode 100644 index 00000000000..ae9742b492f --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/diskFile0.js @@ -0,0 +1,7 @@ +/// +// This is bar.ts +var bar = (function () { + function bar() { + } + return bar; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/diskFile1.d.ts b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/diskFile1.d.ts new file mode 100644 index 00000000000..1e341d97853 --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/diskFile1.d.ts @@ -0,0 +1,2 @@ +declare class bar { +} diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/foo.d.ts b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/foo.d.ts new file mode 100644 index 00000000000..0e91525d82e --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/foo.d.ts @@ -0,0 +1,2 @@ +declare class foo { +} diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/foo.js b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/foo.js new file mode 100644 index 00000000000..20440d5c62b --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/foo.js @@ -0,0 +1,6 @@ +/// +var foo = (function () { + function foo() { + } + return foo; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/referenceResolutionRelativePathsNoResolve.json b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/referenceResolutionRelativePathsNoResolve.json new file mode 100644 index 00000000000..16831b328e9 --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/amd/referenceResolutionRelativePathsNoResolve.json @@ -0,0 +1,21 @@ +{ + "scenario": "referenceResolution1_FromFooFolder_NoResolve", + "projectRoot": "tests/cases/projects/ReferenceResolution/src/ts/foo", + "inputFiles": [ + "foo.ts", + "../../../bar/bar.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "lib.d.ts", + "foo.ts", + "../../../bar/bar.ts" + ], + "emittedFiles": [ + "foo.js", + "foo.d.ts", + "../../../bar/bar.js", + "../../../bar/bar.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/diskFile0.js b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/diskFile0.js new file mode 100644 index 00000000000..ae9742b492f --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/diskFile0.js @@ -0,0 +1,7 @@ +/// +// This is bar.ts +var bar = (function () { + function bar() { + } + return bar; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/diskFile1.d.ts b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/diskFile1.d.ts new file mode 100644 index 00000000000..1e341d97853 --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/diskFile1.d.ts @@ -0,0 +1,2 @@ +declare class bar { +} diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/foo.d.ts b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/foo.d.ts new file mode 100644 index 00000000000..0e91525d82e --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/foo.d.ts @@ -0,0 +1,2 @@ +declare class foo { +} diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/foo.js b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/foo.js new file mode 100644 index 00000000000..20440d5c62b --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/foo.js @@ -0,0 +1,6 @@ +/// +var foo = (function () { + function foo() { + } + return foo; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/referenceResolutionRelativePathsNoResolve.json b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/referenceResolutionRelativePathsNoResolve.json new file mode 100644 index 00000000000..16831b328e9 --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsNoResolve/node/referenceResolutionRelativePathsNoResolve.json @@ -0,0 +1,21 @@ +{ + "scenario": "referenceResolution1_FromFooFolder_NoResolve", + "projectRoot": "tests/cases/projects/ReferenceResolution/src/ts/foo", + "inputFiles": [ + "foo.ts", + "../../../bar/bar.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "lib.d.ts", + "foo.ts", + "../../../bar/bar.ts" + ], + "emittedFiles": [ + "foo.js", + "foo.d.ts", + "../../../bar/bar.js", + "../../../bar/bar.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/diskFile0.js b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/diskFile0.js new file mode 100644 index 00000000000..ae9742b492f --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/diskFile0.js @@ -0,0 +1,7 @@ +/// +// This is bar.ts +var bar = (function () { + function bar() { + } + return bar; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/diskFile1.d.ts b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/diskFile1.d.ts new file mode 100644 index 00000000000..a21b762e1fc --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/diskFile1.d.ts @@ -0,0 +1,3 @@ +/// +declare class bar { +} diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/foo.d.ts b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/foo.d.ts new file mode 100644 index 00000000000..7f80d14325a --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/foo.d.ts @@ -0,0 +1,3 @@ +/// +declare class foo { +} diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/foo.js b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/foo.js new file mode 100644 index 00000000000..20440d5c62b --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/foo.js @@ -0,0 +1,6 @@ +/// +var foo = (function () { + function foo() { + } + return foo; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/referenceResolutionRelativePathsRelativeToRootDirectory.json b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/referenceResolutionRelativePathsRelativeToRootDirectory.json new file mode 100644 index 00000000000..79b73ec775b --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/amd/referenceResolutionRelativePathsRelativeToRootDirectory.json @@ -0,0 +1,20 @@ +{ + "scenario": "referenceResolution1_FromFooFolder_RelativepathToFoo", + "projectRoot": "tests/cases/projects/ReferenceResolution/src/ts/foo", + "inputFiles": [ + "../../../src/ts/foo/foo.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "lib.d.ts", + "../../../bar/bar.ts", + "../../../src/ts/foo/foo.ts" + ], + "emittedFiles": [ + "../../../bar/bar.js", + "../../../bar/bar.d.ts", + "../../../src/ts/foo/foo.js", + "../../../src/ts/foo/foo.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/diskFile0.js b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/diskFile0.js new file mode 100644 index 00000000000..ae9742b492f --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/diskFile0.js @@ -0,0 +1,7 @@ +/// +// This is bar.ts +var bar = (function () { + function bar() { + } + return bar; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/diskFile1.d.ts b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/diskFile1.d.ts new file mode 100644 index 00000000000..a21b762e1fc --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/diskFile1.d.ts @@ -0,0 +1,3 @@ +/// +declare class bar { +} diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/foo.d.ts b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/foo.d.ts new file mode 100644 index 00000000000..7f80d14325a --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/foo.d.ts @@ -0,0 +1,3 @@ +/// +declare class foo { +} diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/foo.js b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/foo.js new file mode 100644 index 00000000000..20440d5c62b --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/foo.js @@ -0,0 +1,6 @@ +/// +var foo = (function () { + function foo() { + } + return foo; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/referenceResolutionRelativePathsRelativeToRootDirectory.json b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/referenceResolutionRelativePathsRelativeToRootDirectory.json new file mode 100644 index 00000000000..79b73ec775b --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionRelativePathsRelativeToRootDirectory/node/referenceResolutionRelativePathsRelativeToRootDirectory.json @@ -0,0 +1,20 @@ +{ + "scenario": "referenceResolution1_FromFooFolder_RelativepathToFoo", + "projectRoot": "tests/cases/projects/ReferenceResolution/src/ts/foo", + "inputFiles": [ + "../../../src/ts/foo/foo.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "lib.d.ts", + "../../../bar/bar.ts", + "../../../src/ts/foo/foo.ts" + ], + "emittedFiles": [ + "../../../bar/bar.js", + "../../../bar/bar.d.ts", + "../../../src/ts/foo/foo.js", + "../../../src/ts/foo/foo.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/referenceResolutionSameFileTwice/amd/diskFile0.js b/tests/baselines/reference/project/referenceResolutionSameFileTwice/amd/diskFile0.js new file mode 100644 index 00000000000..c82f04ec515 --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionSameFileTwice/amd/diskFile0.js @@ -0,0 +1,5 @@ +var test = (function () { + function test() { + } + return test; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionSameFileTwice/amd/diskFile1.d.ts b/tests/baselines/reference/project/referenceResolutionSameFileTwice/amd/diskFile1.d.ts new file mode 100644 index 00000000000..be748d27cfd --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionSameFileTwice/amd/diskFile1.d.ts @@ -0,0 +1,2 @@ +declare class test { +} diff --git a/tests/baselines/reference/project/referenceResolutionSameFileTwice/amd/referenceResolutionSameFileTwice.json b/tests/baselines/reference/project/referenceResolutionSameFileTwice/amd/referenceResolutionSameFileTwice.json new file mode 100644 index 00000000000..9334271f8eb --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionSameFileTwice/amd/referenceResolutionSameFileTwice.json @@ -0,0 +1,18 @@ +{ + "scenario": "referenceResolutionSameFileTwice", + "projectRoot": "tests/cases/projects/ReferenceResolution/", + "inputFiles": [ + "test.ts", + "../ReferenceResolution/test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "lib.d.ts", + "test.ts" + ], + "emittedFiles": [ + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/referenceResolutionSameFileTwice/node/diskFile0.js b/tests/baselines/reference/project/referenceResolutionSameFileTwice/node/diskFile0.js new file mode 100644 index 00000000000..c82f04ec515 --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionSameFileTwice/node/diskFile0.js @@ -0,0 +1,5 @@ +var test = (function () { + function test() { + } + return test; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionSameFileTwice/node/diskFile1.d.ts b/tests/baselines/reference/project/referenceResolutionSameFileTwice/node/diskFile1.d.ts new file mode 100644 index 00000000000..be748d27cfd --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionSameFileTwice/node/diskFile1.d.ts @@ -0,0 +1,2 @@ +declare class test { +} diff --git a/tests/baselines/reference/project/referenceResolutionSameFileTwice/node/referenceResolutionSameFileTwice.json b/tests/baselines/reference/project/referenceResolutionSameFileTwice/node/referenceResolutionSameFileTwice.json new file mode 100644 index 00000000000..9334271f8eb --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionSameFileTwice/node/referenceResolutionSameFileTwice.json @@ -0,0 +1,18 @@ +{ + "scenario": "referenceResolutionSameFileTwice", + "projectRoot": "tests/cases/projects/ReferenceResolution/", + "inputFiles": [ + "test.ts", + "../ReferenceResolution/test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "lib.d.ts", + "test.ts" + ], + "emittedFiles": [ + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/amd/diskFile0.js b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/amd/diskFile0.js new file mode 100644 index 00000000000..c82f04ec515 --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/amd/diskFile0.js @@ -0,0 +1,5 @@ +var test = (function () { + function test() { + } + return test; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/amd/diskFile1.d.ts b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/amd/diskFile1.d.ts new file mode 100644 index 00000000000..be748d27cfd --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/amd/diskFile1.d.ts @@ -0,0 +1,2 @@ +declare class test { +} diff --git a/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/amd/referenceResolutionSameFileTwiceNoResolve.json b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/amd/referenceResolutionSameFileTwiceNoResolve.json new file mode 100644 index 00000000000..b22aefac3ef --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/amd/referenceResolutionSameFileTwiceNoResolve.json @@ -0,0 +1,18 @@ +{ + "scenario": "referenceResolutionSameFileTwice_NoResolve", + "projectRoot": "tests/cases/projects/ReferenceResolution/", + "inputFiles": [ + "test.ts", + "../ReferenceResolution/test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "lib.d.ts", + "test.ts" + ], + "emittedFiles": [ + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/node/diskFile0.js b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/node/diskFile0.js new file mode 100644 index 00000000000..c82f04ec515 --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/node/diskFile0.js @@ -0,0 +1,5 @@ +var test = (function () { + function test() { + } + return test; +})(); diff --git a/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/node/diskFile1.d.ts b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/node/diskFile1.d.ts new file mode 100644 index 00000000000..be748d27cfd --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/node/diskFile1.d.ts @@ -0,0 +1,2 @@ +declare class test { +} diff --git a/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/node/referenceResolutionSameFileTwiceNoResolve.json b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/node/referenceResolutionSameFileTwiceNoResolve.json new file mode 100644 index 00000000000..b22aefac3ef --- /dev/null +++ b/tests/baselines/reference/project/referenceResolutionSameFileTwiceNoResolve/node/referenceResolutionSameFileTwiceNoResolve.json @@ -0,0 +1,18 @@ +{ + "scenario": "referenceResolutionSameFileTwice_NoResolve", + "projectRoot": "tests/cases/projects/ReferenceResolution/", + "inputFiles": [ + "test.ts", + "../ReferenceResolution/test.ts" + ], + "declaration": true, + "baselineCheck": true, + "resolvedInputFiles": [ + "lib.d.ts", + "test.ts" + ], + "emittedFiles": [ + "test.js", + "test.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/propertyWrappedInTry.errors.txt b/tests/baselines/reference/propertyWrappedInTry.errors.txt index 36608ca7d86..0809067b33b 100644 --- a/tests/baselines/reference/propertyWrappedInTry.errors.txt +++ b/tests/baselines/reference/propertyWrappedInTry.errors.txt @@ -2,14 +2,13 @@ tests/cases/compiler/propertyWrappedInTry.ts(3,5): error TS1068: Unexpected toke tests/cases/compiler/propertyWrappedInTry.ts(5,9): error TS1129: Statement expected. tests/cases/compiler/propertyWrappedInTry.ts(11,5): error TS1128: Declaration or statement expected. tests/cases/compiler/propertyWrappedInTry.ts(11,18): error TS1005: ';' expected. -tests/cases/compiler/propertyWrappedInTry.ts(13,9): error TS1108: A 'return' statement can only be used within a function body. tests/cases/compiler/propertyWrappedInTry.ts(17,1): error TS1128: Declaration or statement expected. tests/cases/compiler/propertyWrappedInTry.ts(5,16): error TS2304: Cannot find name 'bar'. tests/cases/compiler/propertyWrappedInTry.ts(5,22): error TS2304: Cannot find name 'someInitThatMightFail'. tests/cases/compiler/propertyWrappedInTry.ts(11,12): error TS2304: Cannot find name 'baz'. -==== tests/cases/compiler/propertyWrappedInTry.ts (9 errors) ==== +==== tests/cases/compiler/propertyWrappedInTry.ts (8 errors) ==== class Foo { try { @@ -37,8 +36,6 @@ tests/cases/compiler/propertyWrappedInTry.ts(11,12): error TS2304: Cannot find n !!! error TS2304: Cannot find name 'baz'. return this.bar; // doesn't get rewritten to Foo.bar. - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. } diff --git a/tests/baselines/reference/recursiveTypeComparison.js b/tests/baselines/reference/recursiveTypeComparison.js new file mode 100644 index 00000000000..8195360de17 --- /dev/null +++ b/tests/baselines/reference/recursiveTypeComparison.js @@ -0,0 +1,21 @@ +//// [recursiveTypeComparison.ts] +// Before fix this would take an exceeding long time to complete (#1170) + +interface Observable { + // This member can't be of type T, Property, or Observable + needThisOne: Observable; + // Add more to make it slower + expo1: Property; // 0.31 seconds in check + expo2: Property; // 3.11 seconds + expo3: Property; // 82.28 seconds +} +interface Property extends Observable { } + +var p: Observable<{}>; +var stuck: Property = p; + + +//// [recursiveTypeComparison.js] +// Before fix this would take an exceeding long time to complete (#1170) +var p; +var stuck = p; diff --git a/tests/baselines/reference/recursiveTypeComparison.types b/tests/baselines/reference/recursiveTypeComparison.types new file mode 100644 index 00000000000..5504de74d85 --- /dev/null +++ b/tests/baselines/reference/recursiveTypeComparison.types @@ -0,0 +1,44 @@ +=== tests/cases/compiler/recursiveTypeComparison.ts === +// Before fix this would take an exceeding long time to complete (#1170) + +interface Observable { +>Observable : Observable +>T : T + + // This member can't be of type T, Property, or Observable + needThisOne: Observable; +>needThisOne : Observable +>Observable : Observable +>T : T + + // Add more to make it slower + expo1: Property; // 0.31 seconds in check +>expo1 : Property +>Property : Property +>T : T + + expo2: Property; // 3.11 seconds +>expo2 : Property +>Property : Property +>T : T + + expo3: Property; // 82.28 seconds +>expo3 : Property +>Property : Property +>T : T +} +interface Property extends Observable { } +>Property : Property +>T : T +>Observable : Observable +>T : T + +var p: Observable<{}>; +>p : Observable<{}> +>Observable : Observable + +var stuck: Property = p; +>stuck : Property +>Property : Property +>p : Observable<{}> + diff --git a/tests/baselines/reference/recursiveTypeComparison2.errors.txt b/tests/baselines/reference/recursiveTypeComparison2.errors.txt new file mode 100644 index 00000000000..ce6311c0089 --- /dev/null +++ b/tests/baselines/reference/recursiveTypeComparison2.errors.txt @@ -0,0 +1,36 @@ +tests/cases/compiler/recursiveTypeComparison2.ts(13,80): error TS2304: Cannot find name 'StateValue'. + + +==== tests/cases/compiler/recursiveTypeComparison2.ts (1 errors) ==== + // Before fix this would cause compiler to hang (#1170) + + declare module Bacon { + interface Event { + } + interface Error extends Event { + } + interface Observable { + zip(other: EventStream, f: (a: T, b: U) => V): EventStream; + slidingWindow(max: number, min?: number): Property; + log(): Observable; + combine(other: Observable, f: (a: T, b: U) => V): Property; + withStateMachine(initState: U, f: (state: U, event: Event) => StateValue): EventStream; + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'StateValue'. + decode(mapping: Object): Property; + awaiting(other: Observable): Property; + endOnError(f?: (value: T) => boolean): Observable; + withHandler(f: (event: Event) => any): Observable; + name(name: string): Observable; + withDescription(...args: any[]): Observable; + } + interface Property extends Observable { + } + interface EventStream extends Observable { + } + interface Bus extends EventStream { + } + var Bus: new () => Bus; + } + + var stuck: Bacon.Bus = new Bacon.Bus(); \ No newline at end of file diff --git a/tests/baselines/reference/recursiveTypeComparison2.js b/tests/baselines/reference/recursiveTypeComparison2.js new file mode 100644 index 00000000000..5844ff3be44 --- /dev/null +++ b/tests/baselines/reference/recursiveTypeComparison2.js @@ -0,0 +1,35 @@ +//// [recursiveTypeComparison2.ts] +// Before fix this would cause compiler to hang (#1170) + +declare module Bacon { + interface Event { + } + interface Error extends Event { + } + interface Observable { + zip(other: EventStream, f: (a: T, b: U) => V): EventStream; + slidingWindow(max: number, min?: number): Property; + log(): Observable; + combine(other: Observable, f: (a: T, b: U) => V): Property; + withStateMachine(initState: U, f: (state: U, event: Event) => StateValue): EventStream; + decode(mapping: Object): Property; + awaiting(other: Observable): Property; + endOnError(f?: (value: T) => boolean): Observable; + withHandler(f: (event: Event) => any): Observable; + name(name: string): Observable; + withDescription(...args: any[]): Observable; + } + interface Property extends Observable { + } + interface EventStream extends Observable { + } + interface Bus extends EventStream { + } + var Bus: new () => Bus; +} + +var stuck: Bacon.Bus = new Bacon.Bus(); + +//// [recursiveTypeComparison2.js] +// Before fix this would cause compiler to hang (#1170) +var stuck = new Bacon.Bus(); diff --git a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js index b514fb088e9..608090e8722 100644 --- a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js +++ b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js @@ -7510,7 +7510,7 @@ declare module julianae { declare module ruatanica { class hector { humulis(): julianae.steerii; - eurycerus(): panamensis.linulus, lavali.wilsoni>; + eurycerus(): panamensis.linulus, lavali.wilsoni>; } } declare module Lanthanum { @@ -7648,7 +7648,7 @@ declare module quasiater { crassicaudatus(): samarensis.cahirinus; mulatta(): argurus.oreas; ansorgei(): rendalli.moojeni, gabriellae.echinatus>; - Copper(): argurus.netscheri; + Copper(): argurus.netscheri; } } declare module ruatanica { @@ -7769,10 +7769,10 @@ declare module lutreolus { culionensis(): argurus.dauricus; scrofa(): petrophilus.sodyi; fernandoni(): quasiater.carolinensis; - Tin(): sagitta.leptoceros>; - marmorata(): panamensis.setulosus>; + Tin(): sagitta.leptoceros>; + marmorata(): panamensis.setulosus>; tavaratra(): Lanthanum.nitidus; - peregrina(): daubentonii.nesiotes; + peregrina(): daubentonii.nesiotes; frontalis(): macrorhinos.marmosurus>, samarensis.pallidus>; cuniculus(): patas.uralensis; magdalenae(): julianae.gerbillus>; @@ -7789,9 +7789,9 @@ declare module argurus { darienensis(): trivirgatus.oconnelli; hardwickii(): macrorhinos.daphaenodon; albifrons(): rionegrensis.veraecrucis; - jacobitus(): caurinus.johorensis>>; - guentheri(): rendalli.moojeni; - mahomet(): imperfecta.ciliolabrum; + jacobitus(): caurinus.johorensis>>; + guentheri(): rendalli.moojeni; + mahomet(): imperfecta.ciliolabrum; misionensis(): macrorhinos.marmosurus, gabriellae.echinatus>; } } @@ -7799,7 +7799,7 @@ declare module nigra { class dolichurus { solomonis(): panglima.abidi, argurus.netscheri, julianae.oralis>>>; alfredi(): caurinus.psilurus; - morrisi(): ruatanica.hector, quasiater.wattsi>>>; + morrisi(): ruatanica.hector, quasiater.wattsi>>>; lekaguli(): Lanthanum.nitidus; dimissus(): imperfecta.subspinosus; phaeotis(): julianae.sumatrana; @@ -7847,7 +7847,7 @@ declare module minutus { rusticus(): dogramacii.aurata; latona(): daubentonii.nesiotes; famulus(): patas.uralensis; - flaviceps(): inez>; + flaviceps(): minutus.inez>; paradoxolophus(): nigra.dolichurus>; Osmium(): lavali.wilsoni; vulgaris(): Lanthanum.nitidus; @@ -7858,12 +7858,12 @@ declare module minutus { } declare module caurinus { class mahaganus extends panglima.fundatus { - martiniquensis(): ruatanica.hector>>; + martiniquensis(): ruatanica.hector>>; devius(): samarensis.pelurus, trivirgatus.falconeri>>; masalai(): argurus.oreas; - kathleenae(): nigra.dolichurus; + kathleenae(): nigra.dolichurus; simulus(): gabriellae.echinatus; - nigrovittatus(): mahaganus>>; + nigrovittatus(): caurinus.mahaganus>>; senegalensis(): gabriellae.klossii, dammermani.melanops>; acticola(): argurus.luctuosa; } @@ -7875,7 +7875,7 @@ declare module macrorhinos { } declare module howi { class angulatus extends sagitta.stolzmanni { - pennatus(): marcanoi; + pennatus(): howi.marcanoi; } } declare module daubentonii { @@ -7923,13 +7923,13 @@ declare module panamensis { } declare module nigra { class gracilis { - weddellii(): dolichurus; + weddellii(): nigra.dolichurus; echinothrix(): Lanthanum.nitidus, argurus.oreas>; garridoi(): dogramacii.koepckeae; - rouxii(): gracilis, thalia>; + rouxii(): nigra.gracilis, nigra.thalia>; aurita(): sagitta.stolzmanni; geoffrensis(): rionegrensis.caniventer; - theresa(): macrorhinos.marmosurus, argurus.luctuosa>, dolichurus>; + theresa(): macrorhinos.marmosurus, argurus.luctuosa>, nigra.dolichurus>; melanocarpus(): julianae.albidens, julianae.sumatrana>; dubiaquercus(): dogramacii.robustulus; pectoralis(): julianae.sumatrana; @@ -7985,7 +7985,7 @@ declare module samarensis { } } declare module sagitta { - class leptoceros extends caurinus.johorensis> { + class leptoceros extends caurinus.johorensis> { victus(): rionegrensis.caniventer; hoplomyoides(): panglima.fundatus, nigra.gracilis>; gratiosus(): lavali.lepturus; @@ -8025,7 +8025,7 @@ declare module argurus { leucoptera(): petrophilus.rosalia; ochraventer(): sagitta.walkeri; tephromelas(): Lanthanum.jugularis; - cracens(): gilbertii; + cracens(): argurus.gilbertii; jamaicensis(): nigra.thalia>; gymnocaudus(): dogramacii.aurata; mayori(): sagitta.stolzmanni; @@ -8038,9 +8038,9 @@ declare module argurus { fagani(): trivirgatus.oconnelli; papuanus(): panglima.fundatus; timidus(): dammermani.melanops; - nghetinhensis(): gabriellae.klossii; + nghetinhensis(): gabriellae.klossii; barbei(): samarensis.cahirinus; - univittatus(): peninsulae; + univittatus(): argurus.peninsulae; } } declare module daubentonii { @@ -8085,7 +8085,7 @@ declare module provocax { declare module sagitta { class sicarius { Chlorine(): samarensis.cahirinus, dogramacii.robustulus>; - simulator(): macrorhinos.marmosurus, macrorhinos.marmosurus, gabriellae.echinatus>, stolzmanni>>; + simulator(): macrorhinos.marmosurus, macrorhinos.marmosurus, gabriellae.echinatus>, sagitta.stolzmanni>>; } } declare module howi { @@ -8096,7 +8096,7 @@ declare module howi { martinsi(): dogramacii.aurata; beatrix(): imperfecta.ciliolabrum, gabriellae.echinatus>, dogramacii.aurata>, imperfecta.ciliolabrum>>; griseoventer(): argurus.oreas; - zerda(): quasiater.wattsi, coludo>>; + zerda(): quasiater.wattsi, howi.coludo>>; yucatanicus(): julianae.nudicaudus; nigrita(): argurus.peninsulae; jouvenetae(): argurus.dauricus; @@ -8110,9 +8110,9 @@ declare module argurus { class gilbertii { nasutus(): lavali.lepturus; poecilops(): julianae.steerii; - sondaicus(): samarensis.fuscus; + sondaicus(): samarensis.fuscus; auriventer(): petrophilus.rosalia; - cherriei(): ruatanica.Praseodymium; + cherriei(): ruatanica.Praseodymium; lindberghi(): minutus.inez; pipistrellus(): quasiater.carolinensis; paranus(): lutreolus.punicus; @@ -8132,12 +8132,12 @@ declare module lutreolus { lar(): caurinus.mahaganus; erica(): dogramacii.koepckeae; trichura(): macrorhinos.konganensis; - lemniscatus(): panglima.fundatus; + lemniscatus(): panglima.fundatus; aspalax(): panamensis.linulus; marshalli(): julianae.nudicaudus; Zinc(): julianae.galapagoensis; - monochromos(): howi.coludo; - purinus(): ruatanica.hector; + monochromos(): howi.coludo; + purinus(): ruatanica.hector; ischyrus(): lavali.lepturus; tenuis(): macrorhinos.daphaenodon; Helium(): julianae.acariensis; @@ -8165,8 +8165,8 @@ declare module sagitta { dorsalis(): petrophilus.sodyi; fimbriatus(): provocax.melanoleuca; sara(): nigra.gracilis; - epimelas(): stolzmanni; - pittieri(): samarensis.fuscus; + epimelas(): sagitta.stolzmanni; + pittieri(): samarensis.fuscus; } } declare module nigra { @@ -8264,7 +8264,7 @@ declare module minutus { } declare module lutreolus { class foina { - tarfayensis(): punicus; + tarfayensis(): lutreolus.punicus; Promethium(): samarensis.pelurus; salinae(): gabriellae.klossii; kerri(): howi.coludo; @@ -8276,7 +8276,7 @@ declare module lutreolus { layardi(): julianae.albidens; bishopi(): dogramacii.aurata; apodemoides(): caurinus.psilurus; - argentiventer(): trivirgatus.mixtus; + argentiventer(): trivirgatus.mixtus; } } declare module lutreolus { @@ -8284,7 +8284,7 @@ declare module lutreolus { antinorii(): petrophilus.sodyi; voi(): caurinus.johorensis; mussoi(): quasiater.carolinensis; - truncatus(): trivirgatus.lotor; + truncatus(): trivirgatus.lotor; achates(): provocax.melanoleuca; praedatrix(): howi.angulatus; mzabi(): quasiater.wattsi, minutus.inez>; @@ -8321,8 +8321,8 @@ declare module sagitta { } } declare module dammermani { - class melanops extends minutus.inez { - blarina(): melanops; + class melanops extends minutus.inez { + blarina(): dammermani.melanops; harwoodi(): rionegrensis.veraecrucis, lavali.wilsoni>; ashaninka(): julianae.nudicaudus; wiedii(): julianae.steerii; @@ -8339,14 +8339,14 @@ declare module dammermani { } declare module argurus { class peninsulae extends patas.uralensis { - aitkeni(): trivirgatus.mixtus, panglima.amphibius>; + aitkeni(): trivirgatus.mixtus, panglima.amphibius>; novaeangliae(): lavali.xanthognathus; olallae(): julianae.sumatrana; anselli(): dogramacii.aurata; timminsi(): macrorhinos.konganensis; sordidus(): rendalli.moojeni; telfordi(): trivirgatus.oconnelli; - cavernarum(): minutus.inez; + cavernarum(): minutus.inez; } } declare module argurus { @@ -8354,21 +8354,21 @@ declare module argurus { gravis(): nigra.caucasica, dogramacii.kaiseri>; ruschii(): imperfecta.lasiurus>; tricuspidatus(): lavali.wilsoni; - fernandezi(): dammermani.siberu, panglima.abidi>; + fernandezi(): dammermani.siberu, panglima.abidi>; colletti(): samarensis.pallidus; microbullatus(): lutreolus.schlegeli; eburneae(): chrysaeolus.sarasinorum; - tatei(): pygmaea>; + tatei(): argurus.pygmaea>; millardi(): sagitta.walkeri; pruinosus(): trivirgatus.falconeri; - delator(): netscheri; + delator(): argurus.netscheri; nyikae(): trivirgatus.tumidifrons, petrophilus.minutilla>, julianae.acariensis>; ruemmleri(): panglima.amphibius, gabriellae.echinatus>, dogramacii.aurata>, imperfecta.ciliolabrum>; } } declare module ruatanica { - class Praseodymium extends hector { - clara(): panglima.amphibius, argurus.dauricus>; + class Praseodymium extends ruatanica.hector { + clara(): panglima.amphibius, argurus.dauricus>; spectabilis(): petrophilus.sodyi; kamensis(): trivirgatus.lotor, lavali.lepturus>; ruddi(): lutreolus.foina; @@ -8416,7 +8416,7 @@ declare module petrophilus { } declare module caurinus { class psilurus extends lutreolus.punicus { - socialis(): panglima.amphibius; + socialis(): panglima.amphibius; lundi(): petrophilus.sodyi; araeum(): imperfecta.ciliolabrum; calamianensis(): julianae.gerbillus; diff --git a/tests/baselines/reference/scannerNumericLiteral3.errors.txt b/tests/baselines/reference/scannerNumericLiteral3.errors.txt index 4bfbbd3b42a..894eb391f60 100644 --- a/tests/baselines/reference/scannerNumericLiteral3.errors.txt +++ b/tests/baselines/reference/scannerNumericLiteral3.errors.txt @@ -1,10 +1,7 @@ -tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral3.ts(1,1): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral3.ts(1,3): error TS1005: ';' expected. -==== tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral3.ts (2 errors) ==== +==== tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral3.ts (1 errors) ==== 01.0 - ~~ -!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. ~~ !!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/scannerNumericLiteral9.errors.txt b/tests/baselines/reference/scannerNumericLiteral9.errors.txt index 3bcf3a34d80..7f53ca111d9 100644 --- a/tests/baselines/reference/scannerNumericLiteral9.errors.txt +++ b/tests/baselines/reference/scannerNumericLiteral9.errors.txt @@ -1,10 +1,7 @@ -tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral9.ts(1,1): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral9.ts(1,3): error TS1005: ';' expected. -==== tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral9.ts (2 errors) ==== +==== tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral9.ts (1 errors) ==== 009 - ~~ -!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. ~ !!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/scannerStringLiterals.errors.txt b/tests/baselines/reference/scannerStringLiterals.errors.txt index 1b4ad1cd7e5..adcae9dbf93 100644 --- a/tests/baselines/reference/scannerStringLiterals.errors.txt +++ b/tests/baselines/reference/scannerStringLiterals.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/scanner/ecmascript5/scannerStringLiterals.ts(10,34): error TS1002: Unterminated string literal. -tests/cases/conformance/scanner/ecmascript5/scannerStringLiterals.ts(11,38): error TS1126: Unexpected end of text. +tests/cases/conformance/scanner/ecmascript5/scannerStringLiterals.ts(11,38): error TS1002: Unterminated string literal. ==== tests/cases/conformance/scanner/ecmascript5/scannerStringLiterals.ts (2 errors) ==== @@ -17,4 +17,4 @@ tests/cases/conformance/scanner/ecmascript5/scannerStringLiterals.ts(11,38): err !!! error TS1002: Unterminated string literal. "Should error because of end of file. -!!! error TS1126: Unexpected end of text. \ No newline at end of file +!!! error TS1002: Unterminated string literal. \ No newline at end of file diff --git a/tests/baselines/reference/spaceBeforeQuestionMarkInPropertyAssignment.errors.txt b/tests/baselines/reference/spaceBeforeQuestionMarkInPropertyAssignment.errors.txt new file mode 100644 index 00000000000..d51b97546d4 --- /dev/null +++ b/tests/baselines/reference/spaceBeforeQuestionMarkInPropertyAssignment.errors.txt @@ -0,0 +1,7 @@ +tests/cases/compiler/spaceBeforeQuestionMarkInPropertyAssignment.ts(1,12): error TS1162: An object member cannot be declared optional. + + +==== tests/cases/compiler/spaceBeforeQuestionMarkInPropertyAssignment.ts (1 errors) ==== + var x = {x ?: 1} // should not crash + ~ +!!! error TS1162: An object member cannot be declared optional. \ No newline at end of file diff --git a/tests/baselines/reference/standaloneBreak.errors.txt b/tests/baselines/reference/standaloneBreak.errors.txt new file mode 100644 index 00000000000..86e5d719a94 --- /dev/null +++ b/tests/baselines/reference/standaloneBreak.errors.txt @@ -0,0 +1,7 @@ +tests/cases/compiler/standaloneBreak.ts(1,1): error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. + + +==== tests/cases/compiler/standaloneBreak.ts (1 errors) ==== + break; + ~~~~~~ +!!! error TS1105: A 'break' statement can only be used within an enclosing iteration or switch statement. \ No newline at end of file diff --git a/tests/baselines/reference/staticAsIdentifier.errors.txt b/tests/baselines/reference/staticAsIdentifier.errors.txt new file mode 100644 index 00000000000..52108a5a221 --- /dev/null +++ b/tests/baselines/reference/staticAsIdentifier.errors.txt @@ -0,0 +1,10 @@ +tests/cases/compiler/staticAsIdentifier.ts(2,12): error TS1030: 'static' modifier already seen. + + +==== tests/cases/compiler/staticAsIdentifier.ts (1 errors) ==== + class C { + static static + ~~~~~~ +!!! error TS1030: 'static' modifier already seen. + [x: string]: string; + } \ No newline at end of file diff --git a/tests/baselines/reference/staticIndexers.errors.txt b/tests/baselines/reference/staticIndexers.errors.txt index 708c505841a..29c46d0ce8c 100644 --- a/tests/baselines/reference/staticIndexers.errors.txt +++ b/tests/baselines/reference/staticIndexers.errors.txt @@ -1,9 +1,10 @@ tests/cases/conformance/classes/indexMemberDeclarations/staticIndexers.ts(4,5): error TS1145: Modifiers not permitted on index signature members. tests/cases/conformance/classes/indexMemberDeclarations/staticIndexers.ts(8,5): error TS1145: Modifiers not permitted on index signature members. tests/cases/conformance/classes/indexMemberDeclarations/staticIndexers.ts(12,5): error TS1145: Modifiers not permitted on index signature members. +tests/cases/conformance/classes/indexMemberDeclarations/staticIndexers.ts(12,25): error TS2302: Static members cannot reference class type parameters. -==== tests/cases/conformance/classes/indexMemberDeclarations/staticIndexers.ts (3 errors) ==== +==== tests/cases/conformance/classes/indexMemberDeclarations/staticIndexers.ts (4 errors) ==== // static indexers not allowed class C { @@ -22,4 +23,6 @@ tests/cases/conformance/classes/indexMemberDeclarations/staticIndexers.ts(12,5): static [x: string]: T; ~~~~~~ !!! error TS1145: Modifiers not permitted on index signature members. + ~ +!!! error TS2302: Static members cannot reference class type parameters. } \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralsErrors.errors.txt b/tests/baselines/reference/stringLiteralsErrors.errors.txt index e29707d4f84..1440739ae92 100644 --- a/tests/baselines/reference/stringLiteralsErrors.errors.txt +++ b/tests/baselines/reference/stringLiteralsErrors.errors.txt @@ -14,7 +14,7 @@ tests/cases/compiler/stringLiteralsErrors.ts(22,16): error TS1125: Hexadecimal d tests/cases/compiler/stringLiteralsErrors.ts(23,17): error TS1125: Hexadecimal digit expected. tests/cases/compiler/stringLiteralsErrors.ts(24,16): error TS1125: Hexadecimal digit expected. tests/cases/compiler/stringLiteralsErrors.ts(25,15): error TS1125: Hexadecimal digit expected. -tests/cases/compiler/stringLiteralsErrors.ts(28,14): error TS1126: Unexpected end of text. +tests/cases/compiler/stringLiteralsErrors.ts(28,14): error TS1002: Unterminated string literal. ==== tests/cases/compiler/stringLiteralsErrors.ts (17 errors) ==== @@ -79,4 +79,4 @@ tests/cases/compiler/stringLiteralsErrors.ts(28,14): error TS1126: Unexpected en // End of file var es13 = " -!!! error TS1126: Unexpected end of text. \ No newline at end of file +!!! error TS1002: Unterminated string literal. \ No newline at end of file diff --git a/tests/baselines/reference/switchStatementsWithMultipleDefaults.errors.txt b/tests/baselines/reference/switchStatementsWithMultipleDefaults.errors.txt index 28c86a7f0f2..10568608a79 100644 --- a/tests/baselines/reference/switchStatementsWithMultipleDefaults.errors.txt +++ b/tests/baselines/reference/switchStatementsWithMultipleDefaults.errors.txt @@ -1,15 +1,8 @@ tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(9,5): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. -tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(10,5): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(21,13): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. -tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(25,13): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. -tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(26,13): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. -tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(28,13): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. -tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(28,22): error TS1108: A 'return' statement can only be used within a function body. -tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(29,13): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. -tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(29,22): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. -==== tests/cases/compiler/switchStatementsWithMultipleDefaults.ts (9 errors) ==== +==== tests/cases/compiler/switchStatementsWithMultipleDefaults.ts (2 errors) ==== var x = 10; @@ -22,8 +15,6 @@ tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(29,22): error TS111 ~~~~~~~~ !!! error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. default: // Error; third 'default' clause. - ~~~~~~~~ -!!! error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. case 3: x *= x; } @@ -41,21 +32,9 @@ tests/cases/compiler/switchStatementsWithMultipleDefaults.ts(29,22): error TS111 case 10000: x /= x; default: // Error, third 'default' clause - ~~~~~~~~ -!!! error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. def\u0061ult: // Error, fourth 'default' clause. - ~~~~~~~~~~~~~ -!!! error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. // Errors on fifth-seventh default: return; - ~~~~~~~~ -!!! error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. default: default: - ~~~~~~~~ -!!! error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. - ~~~~~~~~ -!!! error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. } } \ No newline at end of file diff --git a/tests/baselines/reference/switchStatementsWithMultipleDefaults1.errors.txt b/tests/baselines/reference/switchStatementsWithMultipleDefaults1.errors.txt new file mode 100644 index 00000000000..c20bfd22af1 --- /dev/null +++ b/tests/baselines/reference/switchStatementsWithMultipleDefaults1.errors.txt @@ -0,0 +1,18 @@ +tests/cases/compiler/switchStatementsWithMultipleDefaults1.ts(8,9): error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. + + +==== tests/cases/compiler/switchStatementsWithMultipleDefaults1.ts (1 errors) ==== + var x = 10; + + switch (x) { + case 1: + case 2: + default: // No issues. + break; + default: // Error; second 'default' clause. + ~~~~~~~~ +!!! error TS1113: A 'default' clause cannot appear more than once in a 'switch' statement. + default: // Error; third 'default' clause. + case 3: + x *= x; + } \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt index c4a34fccd95..ac184e9489f 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt @@ -1,31 +1,31 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(5,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(9,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(13,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(16,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(20,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(23,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(27,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(28,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(29,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(33,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(34,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(35,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(39,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(40,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(41,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(45,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(46,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(47,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(51,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(52,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(53,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(57,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(58,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(64,11): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(77,11): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(81,11): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(86,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(90,11): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(5,10): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(9,17): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(13,16): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(16,16): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(20,16): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(23,16): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(27,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(28,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(29,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(33,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(34,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(35,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(39,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(40,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(41,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(45,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(46,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(47,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(51,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(52,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(53,15): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(57,23): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(58,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(64,25): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(77,25): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(81,25): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(86,23): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(90,25): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(64,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(77,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. @@ -38,104 +38,104 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference // Generic tag with one parameter function noParams(n: T) { } noParams ``; - ~~~~~~~~~~~ + ~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic tag with parameter which does not use type parameter function noGenericParams(n: string[]) { } noGenericParams ``; - ~~~~~~~~~~~~~~~~~~ + ~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic tag with multiple type parameters and only one used in parameter type annotation function someGenerics1a(n: T, m: number) { } someGenerics1a `${3}`; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. function someGenerics1b(n: string[], m: U) { } someGenerics1b `${3}`; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic tag with argument of function type whose parameter is of type parameter type function someGenerics2a(strs: string[], n: (x: T) => void) { } someGenerics2a `${(n: string) => n}`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. function someGenerics2b(strs: string[], n: (x: T, y: U) => void) { } someGenerics2b `${ (n: string, x: number) => n }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter function someGenerics3(strs: string[], producer: () => T) { } someGenerics3 `${() => ''}`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics3 `${() => undefined}`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics3 `${() => 3}`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type function someGenerics4(strs: string[], n: T, f: (x: U) => void) { } someGenerics4 `${4}${ () => null }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics4 `${''}${ () => 3 }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics4 `${ null }${ null }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type function someGenerics5(strs: string[], n: T, f: (x: U) => void) { } someGenerics5 `${ 4 } ${ () => null }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics5 `${ '' }${ () => 3 }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics5 `${null}${null}`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic tag with multiple arguments of function types that each have parameters of the same generic type function someGenerics6(strs: string[], a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { } someGenerics6 `${ n => n }${ n => n}${ n => n}`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics6 `${ n => n }${ n => n}${ n => n}`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics6 `${ (n: number) => n }${ (n: number) => n }${ (n: number) => n }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic tag with multiple arguments of function types that each have parameters of different generic type function someGenerics7(strs: string[], a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { } someGenerics7 `${ n => n }${ n => n }${ n => n }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics7 `${ n => n }${ n => n }${ n => n }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. someGenerics7 `${(n: number) => n}${ (n: string) => n}${ (n: number) => n}`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic tag with argument of generic function type function someGenerics8(strs: string[], n: T): T { return n; } var x = someGenerics8 `${ someGenerics7 }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. x `${null}${null}${null}`; - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic tag with multiple parameters of generic type passed arguments with no best common type @@ -143,7 +143,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference return null; } var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. @@ -161,7 +161,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference } var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. @@ -170,20 +170,20 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference // Generic tag with multiple parameters of generic type passed arguments with a single best common type var a9d = someGenerics9 `${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var a9d: { x: number; }; // Generic tag with multiple parameters of generic type where one argument is of type 'any' var anyVar: any; var a = someGenerics9 `${ 7 }${ anyVar }${ 4 }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var a: any; // Generic tag with multiple parameters of generic type where one argument is [] and the other is not 'any' var arr = someGenerics9 `${ [] }${ null }${ undefined }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var arr: any[]; diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt index cf915f36dd8..910e1ce8c27 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt @@ -1,15 +1,12 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(12,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(14,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(16,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(18,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(20,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(22,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(24,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(24,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(28,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(28,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(12,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(14,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(16,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(18,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(20,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(22,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(24,19): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,40): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(28,50): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(14,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(18,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(22,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. @@ -18,7 +15,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTyped tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(28,57): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts (18 errors) ==== +==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts (15 errors) ==== interface I { (stringParts: string[], ...rest: boolean[]): I; g: I; @@ -31,55 +28,49 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTyped var f: I; f `abc` - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. f `abc`.member - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`.member; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. f `abc`["member"]; - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`["member"]; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. f `abc`[0].member `abc${1}def${2}ghi`; - ~~~~~~~ -!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. diff --git a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.errors.txt index f6300855a1c..17c0b330dbb 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressions.ts(13,21): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressions.ts(13,23): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressions.ts (1 errors) ==== @@ -15,7 +15,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMember var f: I; var x = new new new f `abc${ 0 }def`.member("hello")(42) === true; - ~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt index d49ec4b716d..bb5b56578df 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(16,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(17,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(18,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(20,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(21,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(16,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(17,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(18,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(20,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(21,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(14,9): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. @@ -31,24 +31,24 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio !!! error TS2346: Supplied parameters do not match any signature of call target. var u = foo ``; // number - ~~~~~~ + ~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var v = foo `${1}`; // string - ~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var w = foo `${1}${2}`; // boolean - ~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var x = foo `${1}${true}`; // boolean (with error) - ~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~ !!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. var y = foo `${1}${"2"}`; // {} - ~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var z = foo `${1}${2}${3}`; // any (with error) - ~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.errors.txt index fcde15afc27..3bf4af39779 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts(8,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts(17,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts(8,14): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts(17,14): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts (2 errors) ==== @@ -11,7 +11,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio } var a = foo1 `${1}`; // string - ~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var b = foo1([], 1); // number @@ -22,6 +22,6 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio } var c = foo2 `${1}`; // number - ~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var d = foo2([], 1); // number \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt index dd943e518f3..3ffe3d5820d 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt @@ -1,25 +1,25 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(7,17): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(10,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(16,16): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(17,16): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(23,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(26,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(34,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(35,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(36,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(40,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(41,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(42,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(45,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(54,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(55,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(56,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(57,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(60,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(64,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(70,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(71,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(7,21): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(10,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(16,20): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(17,20): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(23,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(26,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(34,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(35,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(36,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(40,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(41,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(42,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(45,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(54,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(55,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(56,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(57,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(60,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(64,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(70,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(71,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(10,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(19,4): error TS2339: Property 'foo' does not exist on type 'Date'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(45,1): error TS2346: Supplied parameters do not match any signature of call target. @@ -36,12 +36,12 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio function fn1() { return null; } var s: string = fn1 `${ undefined }`; - ~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // No candidate overloads found fn1 `${ {} }`; // Error - ~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~ !!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. @@ -51,10 +51,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio function fn2() { return undefined; } var d1: Date = fn2 `${ 0 }${ undefined }`; // contextually typed - ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var d2 = fn2 `${ 0 }${ undefined }`; // any - ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. d1.foo(); // error @@ -64,12 +64,12 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // Generic and non-generic overload where generic overload is the only candidate fn2 `${ 0 }${ '' }`; // OK - ~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic and non-generic overload where non-generic overload is the only candidate fn2 `${ '' }${ 0 }`; // OK - ~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic overloads with differing arity @@ -79,30 +79,30 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio function fn3() { return null; } var s = fn3 `${ 3 }`; - ~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var s = fn3 `${'' }${ 3 }${ '' }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var n = fn3 `${ 5 }${ 5 }${ 5 }`; - ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var n: number; // Generic overloads with differing arity tagging with arguments matching each overload type parameter count var s = fn3 `${ 4 }` - ~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var s = fn3 `${ '' }${ '' }${ '' }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var n = fn3 `${ '' }${ '' }${ 3 }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic overloads with differing arity tagging with argument count that doesn't match any overload fn3 ``; // Error - ~~~~~~ + ~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. @@ -115,31 +115,31 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // Generic overloads with constraints tagged with types that satisfy the constraints fn4 `${ '' }${ 3 }`; - ~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. fn4 `${ 3 }${ '' }`; - ~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. fn4 `${ 3 }${ undefined }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. fn4 `${ '' }${ null }`; - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic overloads with constraints called with type arguments that do not satisfy the constraints fn4 `${ null }${ null }`; // Error - ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4 `${ true }${ null }`; - ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~ !!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; - ~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~ !!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. @@ -149,12 +149,12 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio function fn5(strs: TemplateStringsArray, f: (n: number) => void): number; function fn5() { return undefined; } fn5 `${ (n) => n.toFixed() }`; // will error; 'n' should have type 'string'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~~ !!! error TS2339: Property 'toFixed' does not exist on type 'string'. fn5 `${ (n) => n.substr(0) }`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.errors.txt index a15e0cbb49b..4ea0304f421 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.errors.txt @@ -1,62 +1,56 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(3,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(5,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(7,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(9,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(11,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(13,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(15,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(17,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(19,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(19,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(21,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(21,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(3,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(5,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(7,7): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(9,7): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(11,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(13,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(15,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(17,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(19,32): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts(21,46): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts (12 errors) ==== +==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagsTypedAsAny.ts (10 errors) ==== var f: any; f `abc` - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f.g.h `abc` - ~~~~~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f.g.h `abc${1}def${2}ghi`; - ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`.member - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`.member; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`["member"]; - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`["member"]; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; - ~~~~~~~ -!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi`; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f.thisIsNotATag(`abc`); diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypedTags.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.errors.txt index 0e4f7a63223..173d3a6b741 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypedTags.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.errors.txt @@ -1,16 +1,14 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(12,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(14,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(16,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(18,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(20,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(22,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(24,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(24,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(26,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(26,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(12,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(14,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(16,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(18,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(20,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(22,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(24,19): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(26,40): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts (10 errors) ==== +==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts (8 errors) ==== interface I { (stringParts: string[], ...rest: number[]): I; g: I; @@ -23,39 +21,35 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts(26,1 var f: I; f `abc` - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`.member - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`.member; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`["member"]; - ~~~~~~~ + ~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`["member"]; - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc`[0].member `abc${1}def${2}ghi`; - ~~~~~~~ -!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. f.thisIsNotATag(`abc`); diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.errors.txt b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.errors.txt index 51e362deb5d..a64f5379e47 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.errors.txt +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts(6,15): error TS1126: Unexpected end of text. +tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts(6,15): error TS1160: Unterminated template literal. ==== tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts (1 errors) ==== @@ -9,4 +9,4 @@ tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts(6,1 // Incomplete call, not enough parameters. f `123qdawdrqw -!!! error TS1126: Unexpected end of text. \ No newline at end of file +!!! error TS1160: Unterminated template literal. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.errors.txt b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.errors.txt index 1aa00658d80..fab10f8a888 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.errors.txt +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts(6,4): error TS1126: Unexpected end of text. +tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts(6,4): error TS1160: Unterminated template literal. ==== tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts (1 errors) ==== @@ -9,4 +9,4 @@ tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts(6,4 // Incomplete call, not enough parameters, at EOF. f ` -!!! error TS1126: Unexpected end of text. \ No newline at end of file +!!! error TS1160: Unterminated template literal. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInCallExpression.errors.txt b/tests/baselines/reference/templateStringInCallExpression.errors.txt new file mode 100644 index 00000000000..c483fd9d4c0 --- /dev/null +++ b/tests/baselines/reference/templateStringInCallExpression.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/templates/templateStringInCallExpression.ts(1,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. + + +==== tests/cases/conformance/es6/templates/templateStringInCallExpression.ts (1 errors) ==== + `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInCallExpression.js b/tests/baselines/reference/templateStringInCallExpression.js new file mode 100644 index 00000000000..aa0671a1862 --- /dev/null +++ b/tests/baselines/reference/templateStringInCallExpression.js @@ -0,0 +1,5 @@ +//// [templateStringInCallExpression.ts] +`abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); + +//// [templateStringInCallExpression.js] +("abc" + 0 + "abc")("hello " + 0 + " world", " ", "1" + 2 + "3"); diff --git a/tests/baselines/reference/templateStringInCallExpressionES6.errors.txt b/tests/baselines/reference/templateStringInCallExpressionES6.errors.txt new file mode 100644 index 00000000000..7a391b6afe7 --- /dev/null +++ b/tests/baselines/reference/templateStringInCallExpressionES6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/templates/templateStringInCallExpressionES6.ts(1,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. + + +==== tests/cases/conformance/es6/templates/templateStringInCallExpressionES6.ts (1 errors) ==== + `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInCallExpressionES6.js b/tests/baselines/reference/templateStringInCallExpressionES6.js new file mode 100644 index 00000000000..a9f5f9153cd --- /dev/null +++ b/tests/baselines/reference/templateStringInCallExpressionES6.js @@ -0,0 +1,5 @@ +//// [templateStringInCallExpressionES6.ts] +`abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); + +//// [templateStringInCallExpressionES6.js] +`abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); diff --git a/tests/baselines/reference/templateStringInModuleName.errors.txt b/tests/baselines/reference/templateStringInModuleName.errors.txt index fb6188d9d9a..858bd893164 100644 --- a/tests/baselines/reference/templateStringInModuleName.errors.txt +++ b/tests/baselines/reference/templateStringInModuleName.errors.txt @@ -1,8 +1,6 @@ tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,9): error TS1005: ';' expected. -tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,21): error TS1005: ';' expected. tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,9): error TS1005: ';' expected. -tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,24): error TS1005: ';' expected. tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,1): error TS2304: Cannot find name 'declare'. tests/cases/conformance/es6/templates/templateStringInModuleName.ts(1,9): error TS2304: Cannot find name 'module'. @@ -10,12 +8,10 @@ tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,1): error tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,9): error TS2304: Cannot find name 'module'. -==== tests/cases/conformance/es6/templates/templateStringInModuleName.ts (10 errors) ==== +==== tests/cases/conformance/es6/templates/templateStringInModuleName.ts (8 errors) ==== declare module `M1` { ~~~~~~ !!! error TS1005: ';' expected. - ~~~~~~~~~~~ -!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~ !!! error TS1005: ';' expected. ~~~~~~~ @@ -27,8 +23,6 @@ tests/cases/conformance/es6/templates/templateStringInModuleName.ts(4,9): error declare module `M${2}` { ~~~~~~ !!! error TS1005: ';' expected. - ~~~~~~~~~~~~~~ -!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~ !!! error TS1005: ';' expected. ~~~~~~~ diff --git a/tests/baselines/reference/templateStringInNewExpression.errors.txt b/tests/baselines/reference/templateStringInNewExpression.errors.txt new file mode 100644 index 00000000000..00ae3a6e4a2 --- /dev/null +++ b/tests/baselines/reference/templateStringInNewExpression.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/templates/templateStringInNewExpression.ts(1,1): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. + + +==== tests/cases/conformance/es6/templates/templateStringInNewExpression.ts (1 errors) ==== + new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInNewExpression.js b/tests/baselines/reference/templateStringInNewExpression.js new file mode 100644 index 00000000000..1b1770c6197 --- /dev/null +++ b/tests/baselines/reference/templateStringInNewExpression.js @@ -0,0 +1,5 @@ +//// [templateStringInNewExpression.ts] +new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); + +//// [templateStringInNewExpression.js] +new ("abc" + 0 + "abc")("hello " + 0 + " world", " ", "1" + 2 + "3"); diff --git a/tests/baselines/reference/templateStringInNewExpressionES6.errors.txt b/tests/baselines/reference/templateStringInNewExpressionES6.errors.txt new file mode 100644 index 00000000000..3170afc98bf --- /dev/null +++ b/tests/baselines/reference/templateStringInNewExpressionES6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/templates/templateStringInNewExpressionES6.ts(1,1): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. + + +==== tests/cases/conformance/es6/templates/templateStringInNewExpressionES6.ts (1 errors) ==== + new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInNewExpressionES6.js b/tests/baselines/reference/templateStringInNewExpressionES6.js new file mode 100644 index 00000000000..f970c11167e --- /dev/null +++ b/tests/baselines/reference/templateStringInNewExpressionES6.js @@ -0,0 +1,5 @@ +//// [templateStringInNewExpressionES6.ts] +new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); + +//// [templateStringInNewExpressionES6.js] +new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); diff --git a/tests/baselines/reference/templateStringInObjectLiteral.errors.txt b/tests/baselines/reference/templateStringInObjectLiteral.errors.txt index b510e46ba6a..5406914163e 100644 --- a/tests/baselines/reference/templateStringInObjectLiteral.errors.txt +++ b/tests/baselines/reference/templateStringInObjectLiteral.errors.txt @@ -1,4 +1,3 @@ -tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(1,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(3,5): error TS1136: Property assignment expected. tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(3,8): error TS1005: ',' expected. tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(3,10): error TS1134: Variable declaration expected. @@ -6,16 +5,12 @@ tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(4,1): err tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. -==== tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts (6 errors) ==== +==== tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts (5 errors) ==== var x = { ~ - ~ a: `abc${ 123 }def`, - ~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~ `b`: 321 - ~~~~~~~ -!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~ !!! error TS1136: Property assignment expected. ~ diff --git a/tests/baselines/reference/templateStringInPropertyName1.errors.txt b/tests/baselines/reference/templateStringInPropertyName1.errors.txt index c0b89e02d68..04f53976e65 100644 --- a/tests/baselines/reference/templateStringInPropertyName1.errors.txt +++ b/tests/baselines/reference/templateStringInPropertyName1.errors.txt @@ -1,4 +1,3 @@ -tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(1,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(2,5): error TS1136: Property assignment expected. tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(2,8): error TS1005: ',' expected. tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(2,10): error TS1134: Variable declaration expected. @@ -6,13 +5,10 @@ tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(3,1): err tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. -==== tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts (6 errors) ==== +==== tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts (5 errors) ==== var x = { ~ - ~ `a`: 321 - ~~~~~~~ -!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~ !!! error TS1136: Property assignment expected. ~ diff --git a/tests/baselines/reference/templateStringInPropertyName2.errors.txt b/tests/baselines/reference/templateStringInPropertyName2.errors.txt index d9302d25fa9..7faa04c3240 100644 --- a/tests/baselines/reference/templateStringInPropertyName2.errors.txt +++ b/tests/baselines/reference/templateStringInPropertyName2.errors.txt @@ -1,4 +1,3 @@ -tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(1,9): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(2,5): error TS1136: Property assignment expected. tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(2,32): error TS1005: ',' expected. tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(2,34): error TS1134: Variable declaration expected. @@ -6,13 +5,10 @@ tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(3,1): err tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. -==== tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts (6 errors) ==== +==== tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts (5 errors) ==== var x = { ~ - ~ `abc${ 123 }def${ 456 }ghi`: 321 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~ !!! error TS1136: Property assignment expected. ~ diff --git a/tests/baselines/reference/templateStringInTaggedTemplate.errors.txt b/tests/baselines/reference/templateStringInTaggedTemplate.errors.txt new file mode 100644 index 00000000000..45f860bc9a3 --- /dev/null +++ b/tests/baselines/reference/templateStringInTaggedTemplate.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/templates/templateStringInTaggedTemplate.ts(1,42): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/conformance/es6/templates/templateStringInTaggedTemplate.ts(1,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. + + +==== tests/cases/conformance/es6/templates/templateStringInTaggedTemplate.ts (2 errors) ==== + `I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION` + ~~~~~ +!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInTaggedTemplateES6.errors.txt b/tests/baselines/reference/templateStringInTaggedTemplateES6.errors.txt new file mode 100644 index 00000000000..fd30d7f4074 --- /dev/null +++ b/tests/baselines/reference/templateStringInTaggedTemplateES6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/templates/templateStringInTaggedTemplateES6.ts(1,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. + + +==== tests/cases/conformance/es6/templates/templateStringInTaggedTemplateES6.ts (1 errors) ==== + `I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION` + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInTaggedTemplateES6.js b/tests/baselines/reference/templateStringInTaggedTemplateES6.js new file mode 100644 index 00000000000..419471a052e --- /dev/null +++ b/tests/baselines/reference/templateStringInTaggedTemplateES6.js @@ -0,0 +1,5 @@ +//// [templateStringInTaggedTemplateES6.ts] +`I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION` + +//// [templateStringInTaggedTemplateES6.js] +`I AM THE ${`${`TAG`} `} PORTION` `I ${"AM"} THE TEMPLATE PORTION`; diff --git a/tests/baselines/reference/templateStringInYieldKeyword.errors.txt b/tests/baselines/reference/templateStringInYieldKeyword.errors.txt deleted file mode 100644 index b70af797c5c..00000000000 --- a/tests/baselines/reference/templateStringInYieldKeyword.errors.txt +++ /dev/null @@ -1,23 +0,0 @@ -tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(1,9): error TS1003: Identifier expected. -tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(1,15): error TS1005: ';' expected. -tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(3,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(1,11): error TS2304: Cannot find name 'gen'. -tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(3,13): error TS2304: Cannot find name 'yield'. - - -==== tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts (5 errors) ==== - function* gen { - ~ -!!! error TS1003: Identifier expected. - ~ -!!! error TS1005: ';' expected. - ~~~ -!!! error TS2304: Cannot find name 'gen'. - // Once this is supported, the inner expression does not need to be parenthesized. - var x = yield `abc${ x }def`; - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. - ~~~~~ -!!! error TS2304: Cannot find name 'yield'. - } - \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInYieldKeyword.js b/tests/baselines/reference/templateStringInYieldKeyword.js new file mode 100644 index 00000000000..8e98b269cd0 --- /dev/null +++ b/tests/baselines/reference/templateStringInYieldKeyword.js @@ -0,0 +1,12 @@ +//// [templateStringInYieldKeyword.ts] +function* gen() { + // Once this is supported, the inner expression does not need to be parenthesized. + var x = yield `abc${ x }def`; +} + + +//// [templateStringInYieldKeyword.js] +function gen() { + // Once this is supported, the inner expression does not need to be parenthesized. + var x = ; +} diff --git a/tests/baselines/reference/templateStringInYieldKeyword.types b/tests/baselines/reference/templateStringInYieldKeyword.types new file mode 100644 index 00000000000..c3d49ddffb7 --- /dev/null +++ b/tests/baselines/reference/templateStringInYieldKeyword.types @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts === +function* gen() { +>gen : () => void + + // Once this is supported, the inner expression does not need to be parenthesized. + var x = yield `abc${ x }def`; +>x : unknown +} + diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt b/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt index b9e803a8a14..28f33943732 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt @@ -1,34 +1,11 @@ -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,9): error TS1003: Identifier expected. -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,15): error TS1005: ';' expected. -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,26): error TS1158: Invalid template literal; expected '}' -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,30): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(5,1): error TS1126: Unexpected end of text. -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,11): error TS2304: Cannot find name 'gen'. -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,20): error TS2304: Cannot find name 'yield'. -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,30): error TS2304: Cannot find name 'def'. +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,15): error TS1005: '(' expected. -==== tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts (8 errors) ==== +==== tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts (1 errors) ==== function* gen { - ~ -!!! error TS1003: Identifier expected. ~ -!!! error TS1005: ';' expected. - ~~~ -!!! error TS2304: Cannot find name 'gen'. +!!! error TS1005: '(' expected. // Once this is supported, yield *must* be parenthesized. var x = `abc${ yield 10 }def`; - ~~ -!!! error TS1158: Invalid template literal; expected '}' - ~~~~~ - ~~~~~ -!!! error TS2304: Cannot find name 'yield'. - ~~~ -!!! error TS2304: Cannot find name 'def'. } - ~ - - -!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. - -!!! error TS1126: Unexpected end of text. \ No newline at end of file + \ No newline at end of file diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt deleted file mode 100644 index 6cae5332517..00000000000 --- a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt +++ /dev/null @@ -1,29 +0,0 @@ -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,9): error TS1003: Identifier expected. -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,17): error TS1005: ';' expected. -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(3,26): error TS1158: Invalid template literal; expected '}' -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(5,1): error TS1126: Unexpected end of text. -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,11): error TS2304: Cannot find name 'gen'. -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(3,20): error TS2304: Cannot find name 'yield'. -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(3,30): error TS2304: Cannot find name 'def'. - - -==== tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts (7 errors) ==== - function* gen() { - ~ -!!! error TS1003: Identifier expected. - ~ -!!! error TS1005: ';' expected. - ~~~ -!!! error TS2304: Cannot find name 'gen'. - // Once this is supported, yield *must* be parenthesized. - var x = `abc${ yield 10 }def`; - ~~ -!!! error TS1158: Invalid template literal; expected '}' - ~~~~~ -!!! error TS2304: Cannot find name 'yield'. - ~~~ -!!! error TS2304: Cannot find name 'def'. - } - - -!!! error TS1126: Unexpected end of text. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.js b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.js new file mode 100644 index 00000000000..80021ecae2e --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.js @@ -0,0 +1,12 @@ +//// [templateStringWithEmbeddedYieldKeywordES6.ts] +function* gen() { + // Once this is supported, yield *must* be parenthesized. + var x = `abc${ yield 10 }def`; +} + + +//// [templateStringWithEmbeddedYieldKeywordES6.js] +function gen() { + // Once this is supported, yield *must* be parenthesized. + var x = `abc${}def`; +} diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types new file mode 100644 index 00000000000..c55b40148b1 --- /dev/null +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts === +function* gen() { +>gen : () => void + + // Once this is supported, yield *must* be parenthesized. + var x = `abc${ yield 10 }def`; +>x : string +} + diff --git a/tests/baselines/reference/templateStringsArrayTypeDefinedInES5Mode.errors.txt b/tests/baselines/reference/templateStringsArrayTypeDefinedInES5Mode.errors.txt index 4044539b133..b15a867a79e 100644 --- a/tests/baselines/reference/templateStringsArrayTypeDefinedInES5Mode.errors.txt +++ b/tests/baselines/reference/templateStringsArrayTypeDefinedInES5Mode.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/templateStringsArrayTypeDefinedInES5Mode.ts(10,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/templateStringsArrayTypeDefinedInES5Mode.ts(10,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. lib.d.ts(513,11): error TS2300: Duplicate identifier 'TemplateStringsArray'. tests/cases/compiler/templateStringsArrayTypeDefinedInES5Mode.ts(2,7): error TS2300: Duplicate identifier 'TemplateStringsArray'. tests/cases/compiler/templateStringsArrayTypeDefinedInES5Mode.ts(8,3): error TS2345: Argument of type '{ [x: number]: undefined; }' is not assignable to parameter of type 'TemplateStringsArray'. @@ -21,5 +21,5 @@ tests/cases/compiler/templateStringsArrayTypeDefinedInES5Mode.ts(8,3): error TS2 !!! error TS2345: Property 'raw' is missing in type '{ [x: number]: undefined; }'. f `abcdef${ 1234 }${ 5678 }ghijkl`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringsArrayTypeNotDefinedES5Mode.errors.txt b/tests/baselines/reference/templateStringsArrayTypeNotDefinedES5Mode.errors.txt index 6b2d29139ed..56793bf95ad 100644 --- a/tests/baselines/reference/templateStringsArrayTypeNotDefinedES5Mode.errors.txt +++ b/tests/baselines/reference/templateStringsArrayTypeNotDefinedES5Mode.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/templateStringsArrayTypeNotDefinedES5Mode.ts(7,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. +tests/cases/compiler/templateStringsArrayTypeNotDefinedES5Mode.ts(7,3): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/compiler/templateStringsArrayTypeNotDefinedES5Mode.ts(5,3): error TS2345: Argument of type '{ [x: number]: undefined; }' is not assignable to parameter of type 'TemplateStringsArray'. Property 'raw' is missing in type '{ [x: number]: undefined; }'. @@ -14,5 +14,5 @@ tests/cases/compiler/templateStringsArrayTypeNotDefinedES5Mode.ts(5,3): error TS !!! error TS2345: Property 'raw' is missing in type '{ [x: number]: undefined; }'. f `abcdef${ 1234 }${ 5678 }ghijkl`; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/twoAccessorsWithSameName.errors.txt b/tests/baselines/reference/twoAccessorsWithSameName.errors.txt index 81da707c566..73261bfa072 100644 --- a/tests/baselines/reference/twoAccessorsWithSameName.errors.txt +++ b/tests/baselines/reference/twoAccessorsWithSameName.errors.txt @@ -1,14 +1,4 @@ -tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(3,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(7,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(19,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(24,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(24,9): error TS1118: An object literal cannot have multiple get/set accessors with the same name. -tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(30,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(33,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(2,9): error TS2300: Duplicate identifier 'x'. tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(3,9): error TS2300: Duplicate identifier 'x'. tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(7,9): error TS2300: Duplicate identifier 'x'. @@ -17,49 +7,35 @@ tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameN tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(24,9): error TS2300: Duplicate identifier 'x'. -==== tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts (17 errors) ==== +==== tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts (7 errors) ==== class C { get x() { return 1; } ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - ~ !!! error TS2300: Duplicate identifier 'x'. get x() { return 1; } // error ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - ~ !!! error TS2300: Duplicate identifier 'x'. } class D { set x(v) { } ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - ~ !!! error TS2300: Duplicate identifier 'x'. set x(v) { } // error ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - ~ !!! error TS2300: Duplicate identifier 'x'. } class E { get x() { - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 1; } set x(v) { } - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } var x = { get x() { ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - ~ !!! error TS2300: Duplicate identifier 'x'. return 1; }, @@ -67,8 +43,6 @@ tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameN // error get x() { ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. - ~ !!! error TS1118: An object literal cannot have multiple get/set accessors with the same name. ~ !!! error TS2300: Duplicate identifier 'x'. @@ -78,11 +52,7 @@ tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameN var y = { get x() { - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 1; }, set x(v) { } - ~ -!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterConstraints1.errors.txt b/tests/baselines/reference/typeParameterConstraints1.errors.txt index e081f3c6ce6..d2e1f505c83 100644 --- a/tests/baselines/reference/typeParameterConstraints1.errors.txt +++ b/tests/baselines/reference/typeParameterConstraints1.errors.txt @@ -23,7 +23,7 @@ tests/cases/compiler/typeParameterConstraints1.ts(12,26): error TS2304: Cannot f ~ !!! error TS1110: Type expected. function foo10 (test: T) { } - ~~~ + ~ !!! error TS1110: Type expected. function foo11 (test: T) { } ~~~~ diff --git a/tests/baselines/reference/typeofUndefined.js b/tests/baselines/reference/typeofUndefined.js index f21bc529f9e..5d9d4681eb9 100644 --- a/tests/baselines/reference/typeofUndefined.js +++ b/tests/baselines/reference/typeofUndefined.js @@ -9,5 +9,5 @@ var x; // shouldn't be an error since type is the same as the first declaration //// [typeofUndefined.d.ts] -declare var x: any; +declare var x: typeof undefined; declare var x: any; diff --git a/tests/baselines/reference/unterminatedRegexAtEndOfSource1.errors.txt b/tests/baselines/reference/unterminatedRegexAtEndOfSource1.errors.txt index 2ee2e27c047..fa8959e90bf 100644 --- a/tests/baselines/reference/unterminatedRegexAtEndOfSource1.errors.txt +++ b/tests/baselines/reference/unterminatedRegexAtEndOfSource1.errors.txt @@ -1,10 +1,7 @@ -tests/cases/compiler/unterminatedRegexAtEndOfSource1.ts(1,9): error TS1109: Expression expected. -tests/cases/compiler/unterminatedRegexAtEndOfSource1.ts(1,10): error TS1109: Expression expected. +tests/cases/compiler/unterminatedRegexAtEndOfSource1.ts(1,10): error TS1161: Unterminated regular expression literal. -==== tests/cases/compiler/unterminatedRegexAtEndOfSource1.ts (2 errors) ==== +==== tests/cases/compiler/unterminatedRegexAtEndOfSource1.ts (1 errors) ==== var a = / - ~ -!!! error TS1109: Expression expected. -!!! error TS1109: Expression expected. \ No newline at end of file +!!! error TS1161: Unterminated regular expression literal. \ No newline at end of file diff --git a/tests/baselines/reference/vardecl.js b/tests/baselines/reference/vardecl.js index 5ce8e095020..3ff8f4e8ab3 100644 --- a/tests/baselines/reference/vardecl.js +++ b/tests/baselines/reference/vardecl.js @@ -191,7 +191,7 @@ declare var complicatedArrayVar: { y: string; }[]; declare var n1: { - [x: string]: number; + [s: string]: number; }; declare var c: { new?(): any; @@ -212,8 +212,12 @@ declare var d2: { x: number; }; }; -declare var n2: () => void; -declare var n4: (() => void)[]; +declare var n2: { + (): void; +}; +declare var n4: { + (): void; +}[]; declare var d4: { foo(n: string, x: { x: number; diff --git a/tests/cases/compiler/ambientEnum1.ts b/tests/cases/compiler/ambientEnum1.ts new file mode 100644 index 00000000000..05b0cdd3a47 --- /dev/null +++ b/tests/cases/compiler/ambientEnum1.ts @@ -0,0 +1,8 @@ + declare enum E1 { + y = 4.23 + } + + // Ambient enum with computer member + declare enum E2 { + x = 'foo'.length + } \ No newline at end of file diff --git a/tests/cases/compiler/ambientErrors1.ts b/tests/cases/compiler/ambientErrors1.ts new file mode 100644 index 00000000000..ef249266498 --- /dev/null +++ b/tests/cases/compiler/ambientErrors1.ts @@ -0,0 +1 @@ +declare var x = 4; \ No newline at end of file diff --git a/tests/cases/compiler/ambientStatement1.ts b/tests/cases/compiler/ambientStatement1.ts new file mode 100644 index 00000000000..b2d1bb9d499 --- /dev/null +++ b/tests/cases/compiler/ambientStatement1.ts @@ -0,0 +1,5 @@ + declare module M1 { + while(true); + + export var v1 = () => false; + } \ No newline at end of file diff --git a/tests/cases/compiler/amdModuleName1.ts b/tests/cases/compiler/amdModuleName1.ts new file mode 100644 index 00000000000..fef7956e332 --- /dev/null +++ b/tests/cases/compiler/amdModuleName1.ts @@ -0,0 +1,9 @@ +//@module: amd +/// +class Foo { + x: number; + constructor() { + this.x = 5; + } +} +export = Foo; diff --git a/tests/cases/compiler/amdModuleName2.ts b/tests/cases/compiler/amdModuleName2.ts new file mode 100644 index 00000000000..cca02a22650 --- /dev/null +++ b/tests/cases/compiler/amdModuleName2.ts @@ -0,0 +1,10 @@ +//@module: amd +/// +/// +class Foo { + x: number; + constructor() { + this.x = 5; + } +} +export = Foo; diff --git a/tests/cases/compiler/declFileAliasUseBeforeDeclaration.ts b/tests/cases/compiler/declFileAliasUseBeforeDeclaration.ts new file mode 100644 index 00000000000..c803f65cf7c --- /dev/null +++ b/tests/cases/compiler/declFileAliasUseBeforeDeclaration.ts @@ -0,0 +1,9 @@ +//@module: commonjs +//@declaration: true + +// @Filename: declFileAliasUseBeforeDeclaration_foo.ts +export class Foo { } + +// @Filename: declFileAliasUseBeforeDeclaration_test.ts +export function bar(a: foo.Foo) { } +import foo = require("declFileAliasUseBeforeDeclaration_foo"); \ No newline at end of file diff --git a/tests/cases/compiler/declFileAliasUseBeforeDeclaration2.ts b/tests/cases/compiler/declFileAliasUseBeforeDeclaration2.ts new file mode 100644 index 00000000000..25f19ec276e --- /dev/null +++ b/tests/cases/compiler/declFileAliasUseBeforeDeclaration2.ts @@ -0,0 +1,12 @@ +//@module: commonjs +//@declaration: true + +declare module "test" { + module A { + class C { + } + } + class B extends E { + } + import E = A.C; +} \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationArrayType.ts b/tests/cases/compiler/declFileTypeAnnotationArrayType.ts new file mode 100644 index 00000000000..4bb99032a60 --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationArrayType.ts @@ -0,0 +1,53 @@ +// @target: ES5 +// @declaration: true + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +function foo(): c[] { + return [new c()]; +} +function foo2() { + return [new c()]; +} + +// Qualified name +function foo3(): m.c[] { + return [new m.c()]; +} +function foo4() { + return m.c; +} + +// Just the name with type arguments +function foo5(): g[] { + return [new g()]; +} +function foo6() { + return [new g()]; +} + +// Qualified name with type arguments +function foo7(): m.g[] { + return [new m.g()]; +} +function foo8() { + return [new m.g()]; +} + +// Array of function types +function foo9(): (()=>c)[] { + return [() => new c()]; +} +function foo10() { + return [() => new c()]; +} \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationBuiltInType.ts b/tests/cases/compiler/declFileTypeAnnotationBuiltInType.ts new file mode 100644 index 00000000000..3b234476579 --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationBuiltInType.ts @@ -0,0 +1,42 @@ +// @target: ES5 +// @declaration: true + +// string +function foo(): string { + return ""; +} +function foo2() { + return ""; +} + +// number +function foo3(): number { + return 10; +} +function foo4() { + return 10; +} + +// boolean +function foo5(): boolean { + return true; +} +function foo6() { + return false; +} + +// void +function foo7(): void { + return; +} +function foo8() { + return; +} + +// any +function foo9(): any { + return undefined; +} +function foo10() { + return undefined; +} \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationParenType.ts b/tests/cases/compiler/declFileTypeAnnotationParenType.ts new file mode 100644 index 00000000000..3ac20836c77 --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationParenType.ts @@ -0,0 +1,12 @@ +// @target: ES5 +// @declaration: true + +class c { + private p: string; +} + +var x: (() => c)[] = [() => new c()]; +var y = [() => new c()]; + +var k: (() => c) | string = (() => new c()) || ""; +var l = (() => new c()) || ""; \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationStringLiteral.ts b/tests/cases/compiler/declFileTypeAnnotationStringLiteral.ts new file mode 100644 index 00000000000..0cdd27fd626 --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationStringLiteral.ts @@ -0,0 +1,13 @@ +// @target: ES5 +// @declaration: true + +function foo(a: "hello"): number; +function foo(a: "name"): string; +function foo(a: string): string | number; +function foo(a: string): string | number { + if (a === "hello") { + return a.length; + } + + return a; +} \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationTupleType.ts b/tests/cases/compiler/declFileTypeAnnotationTupleType.ts new file mode 100644 index 00000000000..aafbfd02eae --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationTupleType.ts @@ -0,0 +1,20 @@ +// @target: ES5 +// @declaration: true + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +var k: [c, m.c] = [new c(), new m.c()]; +var l = k; + +var x: [g, m.g, () => c] = [new g(), new m.g(), () => new c()]; +var y = x; \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationTypeAlias.ts b/tests/cases/compiler/declFileTypeAnnotationTypeAlias.ts new file mode 100644 index 00000000000..447921f3f4a --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationTypeAlias.ts @@ -0,0 +1,34 @@ +// @target: ES5 +// @module: commonjs +// @declaration: true + +module M { + export type Value = string | number | boolean; + export var x: Value; + + export class c { + } + + export type C = c; + + export module m { + export class c { + } + } + + export type MC = m.c; + + export type fc = () => c; +} + +interface Window { + someMethod(); +} + +module M { + export type W = Window | string; + export module N { + export class Window { } + export var p: W; + } +} \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationTypeLiteral.ts b/tests/cases/compiler/declFileTypeAnnotationTypeLiteral.ts new file mode 100644 index 00000000000..e41495b68de --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationTypeLiteral.ts @@ -0,0 +1,41 @@ +// @target: ES5 +// @declaration: true + +class c { +} +class g { +} +module m { + export class c { + } +} + +// Object literal with everything +var x: { + // Call signatures + (a: number): c; + (a: string): g; + + // Construct signatures + new (a: number): c; + new (a: string): m.c; + + // Indexers + [n: number]: c; + [n: string]: c; + + // Properties + a: c; + b: g; + + // methods + m1(): g; + m2(a: string, b?: number, ...c: c[]): string; +}; + + +// Function type +var y: (a: string) => string; + +// constructor type +var z: new (a: string) => m.c; \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationTypeQuery.ts b/tests/cases/compiler/declFileTypeAnnotationTypeQuery.ts new file mode 100644 index 00000000000..d3cde6a1faa --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationTypeQuery.ts @@ -0,0 +1,45 @@ +// @target: ES5 +// @declaration: true + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +function foo(): typeof c { + return c; +} +function foo2() { + return c; +} + +// Qualified name +function foo3(): typeof m.c { + return m.c; +} +function foo4() { + return m.c; +} + +// Just the name with type arguments +function foo5(): typeof g { + return g; +} +function foo6() { + return g; +} + +// Qualified name with type arguments +function foo7(): typeof m.g { + return m.g +} +function foo8() { + return m.g +} \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationTypeReference.ts b/tests/cases/compiler/declFileTypeAnnotationTypeReference.ts new file mode 100644 index 00000000000..e20ecff32f0 --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationTypeReference.ts @@ -0,0 +1,45 @@ +// @target: ES5 +// @declaration: true + +class c { +} +module m { + export class c { + } + export class g { + } +} +class g { +} + +// Just the name +function foo(): c { + return new c(); +} +function foo2() { + return new c(); +} + +// Qualified name +function foo3(): m.c { + return new m.c(); +} +function foo4() { + return new m.c(); +} + +// Just the name with type arguments +function foo5(): g { + return new g(); +} +function foo6() { + return new g(); +} + +// Qualified name with type arguments +function foo7(): m.g { + return new m.g(); +} +function foo8() { + return new m.g(); +} \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationUnionType.ts b/tests/cases/compiler/declFileTypeAnnotationUnionType.ts new file mode 100644 index 00000000000..4a973834915 --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationUnionType.ts @@ -0,0 +1,24 @@ +// @target: ES5 +// @declaration: true + +class c { + private p: string; +} +module m { + export class c { + private q: string; + } + export class g { + private r: string; + } +} +class g { + private s: string; +} + +// Just the name +var k: c | m.c = new c() || new m.c(); +var l = new c() || new m.c(); + +var x: g | m.g | (() => c) = new g() || new m.g() || (() => new c()); +var y = new g() || new m.g() || (() => new c()); \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts new file mode 100644 index 00000000000..8dced33083b --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorAccessors.ts @@ -0,0 +1,102 @@ +// @target: ES5 +// @module: commonjs +// @declaration: true + +module m { + class private1 { + } + + export class public1 { + } + + module m2 { + export class public2 { + } + } + + export class c { + // getter with annotation + get foo1(): private1 { + return; + } + + // getter without annotation + get foo2() { + return new private1(); + } + + // setter with annotation + set foo3(param: private1) { + } + + // Both - getter without annotation, setter with annotation + get foo4() { + return new private1(); + } + set foo4(param: private1) { + } + + // Both - with annotation + get foo5(): private1 { + return; + } + set foo5(param: private1) { + } + + // getter with annotation + get foo11(): public1 { + return; + } + + // getter without annotation + get foo12() { + return new public1(); + } + + // setter with annotation + set foo13(param: public1) { + } + + // Both - getter without annotation, setter with annotation + get foo14() { + return new public1(); + } + set foo14(param: public1) { + } + + // Both - with annotation + get foo15(): public1 { + return; + } + set foo15(param: public1) { + } + + // getter with annotation + get foo111(): m2.public2 { + return; + } + + // getter without annotation + get foo112() { + return new m2.public2(); + } + + // setter with annotation + set foo113(param: m2.public2) { + } + + // Both - getter without annotation, setter with annotation + get foo114() { + return new m2.public2(); + } + set foo114(param: m2.public2) { + } + + // Both - with annotation + get foo115(): m2.public2 { + return; + } + set foo115(param: m2.public2) { + } + } +} diff --git a/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts new file mode 100644 index 00000000000..8ae9d5bcf3f --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorParameterOfFunction.ts @@ -0,0 +1,47 @@ +// @target: ES5 +// @module: commonjs +// @declaration: true + +module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + function foo1(param: private1) { + } + function foo2(param = new private1()) { + } + + export function foo3(param : private1) { + } + export function foo4(param = new private1()) { + } + + function foo11(param: public1) { + } + function foo12(param = new public1()) { + } + + export function foo13(param: public1) { + } + export function foo14(param = new public1()) { + } + + module m2 { + export class public2 { + } + } + + function foo111(param: m2.public2) { + } + function foo112(param = new m2.public2()) { + } + + export function foo113(param: m2.public2) { + } + export function foo114(param = new m2.public2()) { + } +} diff --git a/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts new file mode 100644 index 00000000000..880cba6d0cb --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorReturnTypeOfFunction.ts @@ -0,0 +1,59 @@ +// @target: ES5 +// @module: commonjs +// @declaration: true + +module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + function foo1(): private1 { + return; + } + function foo2() { + return new private1(); + } + + export function foo3(): private1 { + return; + } + export function foo4() { + return new private1(); + } + + function foo11(): public1 { + return; + } + function foo12() { + return new public1(); + } + + export function foo13(): public1 { + return; + } + export function foo14() { + return new public1(); + } + + module m2 { + export class public2 { + } + } + + function foo111(): m2.public2 { + return; + } + function foo112() { + return new m2.public2(); + } + + export function foo113(): m2.public2 { + return; + } + export function foo114() { + return new m2.public2(); + } +} diff --git a/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts new file mode 100644 index 00000000000..6431dffd20f --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts @@ -0,0 +1,43 @@ +// @target: ES5 +// @module: commonjs +// @declaration: true + +interface Window { + someMethod(); +} + +module M { + type W = Window | string; + export module N { + export class Window { } + export var p: W; // Should report error that W is private + } +} + +module M1 { + export type W = Window | string; + export module N { + export class Window { } + export var p: W; // No error + } +} + +module M2 { + class private1 { + } + class public1 { + } + module m3 { + export class public1 { + } + } + + type t1 = private1; + export type t2 = private1; // error + + type t11 = public1; + export type t12 = public1; + + type t111 = m3.public1; + export type t112 = m3.public1; // error +} diff --git a/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts new file mode 100644 index 00000000000..65af116c193 --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeLiteral.ts @@ -0,0 +1,37 @@ +// @target: ES5 +// @module: commonjs +// @declaration: true + +module m { + class private1 { + } + module m2 { + export class public1 { + } + } + + export var x: { + x: private1; + y: m2.public1; + (): m2.public1[]; + method(): private1; + [n: number]: private1; + [s: string]: m2.public1; + }; + export var x2 = { + x: new private1(), + y: new m2.public1(), + method() { + return new private1(); + } + }; + export var x3 = x; + + // Function type + export var y: (a: private1) => m2.public1; + export var y2 = y; + + // constructor type + export var z: new (a: private1) => m2.public1; + export var z2 = z; +} \ No newline at end of file diff --git a/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts new file mode 100644 index 00000000000..fa2558f5a15 --- /dev/null +++ b/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts @@ -0,0 +1,35 @@ +// @target: ES5 +// @module: commonjs +// @declaration: true + +module m { + class private1 { + } + + export class public1 { + } + + // Directly using names from this module + var x: private1; + var y = new private1(); + + export var k: private1; + export var l = new private1(); + + var x2: public1; + var y2 = new public1(); + + export var k2: public1; + export var l2 = new public1(); + + module m2 { + export class public2 { + } + } + + var x3: m2.public2; + var y3 = new m2.public2(); + + export var k3: m2.public2; + export var l3 = new m2.public2(); +} diff --git a/tests/cases/compiler/duplicateObjectLiteralProperty.ts b/tests/cases/compiler/duplicateObjectLiteralProperty.ts index 1ceb9c3c5dd..2591e6dd78a 100644 --- a/tests/cases/compiler/duplicateObjectLiteralProperty.ts +++ b/tests/cases/compiler/duplicateObjectLiteralProperty.ts @@ -1,3 +1,4 @@ +// @target: ES5 var x = { a: 1, b: true, // OK diff --git a/tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts b/tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts index 02e40fd3645..c3295440986 100644 --- a/tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts +++ b/tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts @@ -1,2 +1,3 @@ -var x; +// @module: commonjs +var x; export declare export = x; \ No newline at end of file diff --git a/tests/cases/compiler/exportAssignmentWithDeclareModifier.ts b/tests/cases/compiler/exportAssignmentWithDeclareModifier.ts index e38f7fa8d38..0cd0625e120 100644 --- a/tests/cases/compiler/exportAssignmentWithDeclareModifier.ts +++ b/tests/cases/compiler/exportAssignmentWithDeclareModifier.ts @@ -1,2 +1,3 @@ -var x; +// @module: commonjs +var x; declare export = x; \ No newline at end of file diff --git a/tests/cases/compiler/exportAssignmentWithExportModifier.ts b/tests/cases/compiler/exportAssignmentWithExportModifier.ts index c6b543caeec..9d940eb2789 100644 --- a/tests/cases/compiler/exportAssignmentWithExportModifier.ts +++ b/tests/cases/compiler/exportAssignmentWithExportModifier.ts @@ -1,2 +1,3 @@ -var x; +// @module: commonjs +var x; export export = x; \ No newline at end of file diff --git a/tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts b/tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts index c684aeca5b3..d8ddcf4bb8f 100644 --- a/tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts +++ b/tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors1.ts @@ -2,7 +2,6 @@ (...arg?) => 102; (...arg) => 103; (...arg:number [] = []) => 104; -(...) => 105; // Non optional parameter following an optional one (arg1 = 1, arg2) => 1; \ No newline at end of file diff --git a/tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors3.ts b/tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors3.ts new file mode 100644 index 00000000000..77949419711 --- /dev/null +++ b/tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors3.ts @@ -0,0 +1 @@ +(...) => 105; diff --git a/tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts b/tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts new file mode 100644 index 00000000000..b4daf2cc3ab --- /dev/null +++ b/tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors4.ts @@ -0,0 +1,22 @@ + false ? (arg?: number = 0) => 47 : null; + false ? ((arg?: number = 0) => 57) : null; + false ? null : (arg?: number = 0) => 67; + ((arg?:number = 1) => 0) + '' + ((arg?:number = 2) => 106); + + foo( + (a) => 110, + ((a) => 111), + (a) => { + return 112; + }, + (a? ) => 113, + (a, b? ) => 114, + (a: number) => 115, + (a: number = 0) => 116, + (a = 0) => 117, + (a?: number = 0) => 118, + (...a: number[]) => 119, + (a, b? = 0, ...c: number[]) => 120, + (a) => (b) => (c) => 121, + false? (a) => 0 : (b) => 122 + ); \ No newline at end of file diff --git a/tests/cases/compiler/importDeclarationInModuleDeclaration1.ts b/tests/cases/compiler/importDeclarationInModuleDeclaration1.ts new file mode 100644 index 00000000000..9f7f9ed7ccd --- /dev/null +++ b/tests/cases/compiler/importDeclarationInModuleDeclaration1.ts @@ -0,0 +1,3 @@ +module m2 { + import m3 = require("use_glo_M1_public"); +} \ No newline at end of file diff --git a/tests/cases/compiler/letDeclarations-es5-1.ts b/tests/cases/compiler/letDeclarations-es5-1.ts new file mode 100644 index 00000000000..cd93feeda0d --- /dev/null +++ b/tests/cases/compiler/letDeclarations-es5-1.ts @@ -0,0 +1,7 @@ +// @target: ES5 + let l1; + let l2: number; + let l3, l4, l5 :string, l6; + let l7 = false; + let l8: number = 23; + let l9 = 0, l10 :string = "", l11 = null; \ No newline at end of file diff --git a/tests/cases/compiler/methodInAmbientClass1.ts b/tests/cases/compiler/methodInAmbientClass1.ts new file mode 100644 index 00000000000..8590977f89b --- /dev/null +++ b/tests/cases/compiler/methodInAmbientClass1.ts @@ -0,0 +1,4 @@ + declare class Foo { + fn(): boolean { + } + } \ No newline at end of file diff --git a/tests/cases/compiler/missingArgument1.ts b/tests/cases/compiler/missingArgument1.ts new file mode 100644 index 00000000000..27408bc2cd8 --- /dev/null +++ b/tests/cases/compiler/missingArgument1.ts @@ -0,0 +1 @@ +foo(a,,b); \ No newline at end of file diff --git a/tests/cases/compiler/objectTypeWithOptionalProperty1.ts b/tests/cases/compiler/objectTypeWithOptionalProperty1.ts new file mode 100644 index 00000000000..69f6e1f51ec --- /dev/null +++ b/tests/cases/compiler/objectTypeWithOptionalProperty1.ts @@ -0,0 +1,3 @@ + var b = { + x?: 1 // error + } \ No newline at end of file diff --git a/tests/cases/compiler/parserConstructorDeclaration12.ts b/tests/cases/compiler/parserConstructorDeclaration12.ts new file mode 100644 index 00000000000..27d7daff1ef --- /dev/null +++ b/tests/cases/compiler/parserConstructorDeclaration12.ts @@ -0,0 +1,10 @@ +class C { + constructor<>() { } + constructor<> () { } + constructor <>() { } + constructor <> () { } + constructor< >() { } + constructor< > () { } + constructor < >() { } + constructor < > () { } +} \ No newline at end of file diff --git a/tests/cases/compiler/recursiveTypeComparison.ts b/tests/cases/compiler/recursiveTypeComparison.ts new file mode 100644 index 00000000000..6ba96cb3aad --- /dev/null +++ b/tests/cases/compiler/recursiveTypeComparison.ts @@ -0,0 +1,14 @@ +// Before fix this would take an exceeding long time to complete (#1170) + +interface Observable { + // This member can't be of type T, Property, or Observable + needThisOne: Observable; + // Add more to make it slower + expo1: Property; // 0.31 seconds in check + expo2: Property; // 3.11 seconds + expo3: Property; // 82.28 seconds +} +interface Property extends Observable { } + +var p: Observable<{}>; +var stuck: Property = p; diff --git a/tests/cases/compiler/recursiveTypeComparison2.ts b/tests/cases/compiler/recursiveTypeComparison2.ts new file mode 100644 index 00000000000..6a781437abe --- /dev/null +++ b/tests/cases/compiler/recursiveTypeComparison2.ts @@ -0,0 +1,30 @@ +// Before fix this would cause compiler to hang (#1170) + +declare module Bacon { + interface Event { + } + interface Error extends Event { + } + interface Observable { + zip(other: EventStream, f: (a: T, b: U) => V): EventStream; + slidingWindow(max: number, min?: number): Property; + log(): Observable; + combine(other: Observable, f: (a: T, b: U) => V): Property; + withStateMachine(initState: U, f: (state: U, event: Event) => StateValue): EventStream; + decode(mapping: Object): Property; + awaiting(other: Observable): Property; + endOnError(f?: (value: T) => boolean): Observable; + withHandler(f: (event: Event) => any): Observable; + name(name: string): Observable; + withDescription(...args: any[]): Observable; + } + interface Property extends Observable { + } + interface EventStream extends Observable { + } + interface Bus extends EventStream { + } + var Bus: new () => Bus; +} + +var stuck: Bacon.Bus = new Bacon.Bus(); \ No newline at end of file diff --git a/tests/cases/compiler/spaceBeforeQuestionMarkInPropertyAssignment.ts b/tests/cases/compiler/spaceBeforeQuestionMarkInPropertyAssignment.ts new file mode 100644 index 00000000000..3a1492037e3 --- /dev/null +++ b/tests/cases/compiler/spaceBeforeQuestionMarkInPropertyAssignment.ts @@ -0,0 +1 @@ +var x = {x ?: 1} // should not crash \ No newline at end of file diff --git a/tests/cases/compiler/standaloneBreak.ts b/tests/cases/compiler/standaloneBreak.ts new file mode 100644 index 00000000000..8cb76cf02d7 --- /dev/null +++ b/tests/cases/compiler/standaloneBreak.ts @@ -0,0 +1 @@ +break; \ No newline at end of file diff --git a/tests/cases/compiler/staticAsIdentifier.ts b/tests/cases/compiler/staticAsIdentifier.ts new file mode 100644 index 00000000000..3cccca3bf88 --- /dev/null +++ b/tests/cases/compiler/staticAsIdentifier.ts @@ -0,0 +1,4 @@ +class C { + static static + [x: string]: string; +} \ No newline at end of file diff --git a/tests/cases/compiler/switchStatementsWithMultipleDefaults1.ts b/tests/cases/compiler/switchStatementsWithMultipleDefaults1.ts new file mode 100644 index 00000000000..f449cf9beb7 --- /dev/null +++ b/tests/cases/compiler/switchStatementsWithMultipleDefaults1.ts @@ -0,0 +1,12 @@ + var x = 10; + + switch (x) { + case 1: + case 2: + default: // No issues. + break; + default: // Error; second 'default' clause. + default: // Error; third 'default' clause. + case 3: + x *= x; + } \ No newline at end of file diff --git a/tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts b/tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts index 2d802f244d0..5c098643712 100644 --- a/tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts +++ b/tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts @@ -1,3 +1,4 @@ +// @target: ES5 class C { get x() { return 1; } get x() { return 1; } // error diff --git a/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName10_es6.ts b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName10_es6.ts new file mode 100644 index 00000000000..64f8b999003 --- /dev/null +++ b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName10_es6.ts @@ -0,0 +1,3 @@ +class C { + [e] = 1 +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName11_es6.ts b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName11_es6.ts new file mode 100644 index 00000000000..cfb1c736b40 --- /dev/null +++ b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName11_es6.ts @@ -0,0 +1,3 @@ +class C { + [e](); +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName12_es6.ts b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName12_es6.ts new file mode 100644 index 00000000000..7e030263fcc --- /dev/null +++ b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName12_es6.ts @@ -0,0 +1,3 @@ +class C { + [e]() { } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName13_es6.ts b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName13_es6.ts new file mode 100644 index 00000000000..2783955e804 --- /dev/null +++ b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName13_es6.ts @@ -0,0 +1 @@ +var v: { [e]: number }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName14_es6.ts b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName14_es6.ts new file mode 100644 index 00000000000..534b418854b --- /dev/null +++ b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName14_es6.ts @@ -0,0 +1 @@ +var v: { [e](): number }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName15_es6.ts b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName15_es6.ts new file mode 100644 index 00000000000..7b9965e8177 --- /dev/null +++ b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName15_es6.ts @@ -0,0 +1 @@ +var v: { [e: number]: string; [e]: number }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName16_es6.ts b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName16_es6.ts new file mode 100644 index 00000000000..a088319bf94 --- /dev/null +++ b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName16_es6.ts @@ -0,0 +1,3 @@ +enum E { + [e] = 1 +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName17_es6.ts b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName17_es6.ts new file mode 100644 index 00000000000..2d002e9ca43 --- /dev/null +++ b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName17_es6.ts @@ -0,0 +1 @@ +var v = { set [e](v) { } } \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName18_es6.ts b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName18_es6.ts new file mode 100644 index 00000000000..0659070d643 --- /dev/null +++ b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName18_es6.ts @@ -0,0 +1 @@ +var v: { [e]?(): number }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName19_es6.ts b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName19_es6.ts new file mode 100644 index 00000000000..b6c1756d097 --- /dev/null +++ b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName19_es6.ts @@ -0,0 +1 @@ +var v: { [e]? }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName1_es6.ts b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName1_es6.ts new file mode 100644 index 00000000000..0703648cf0b --- /dev/null +++ b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName1_es6.ts @@ -0,0 +1 @@ +var v = { [e] }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts new file mode 100644 index 00000000000..34c9d6d918a --- /dev/null +++ b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts @@ -0,0 +1 @@ +var v = { [e]: 1 }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName3_es6.ts b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName3_es6.ts new file mode 100644 index 00000000000..08ad781e2ba --- /dev/null +++ b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName3_es6.ts @@ -0,0 +1 @@ +var v = { [e]() { } }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName4_es6.ts b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName4_es6.ts new file mode 100644 index 00000000000..d5a331ebb4c --- /dev/null +++ b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName4_es6.ts @@ -0,0 +1 @@ +var v = { get [e]() { } }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts new file mode 100644 index 00000000000..a254f65ee67 --- /dev/null +++ b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts @@ -0,0 +1 @@ +var v = { public get [e]() { } }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts new file mode 100644 index 00000000000..c09627a0d46 --- /dev/null +++ b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts @@ -0,0 +1 @@ +var v = { [e]: 1, [e + e]: 2 }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName7_es6.ts b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName7_es6.ts new file mode 100644 index 00000000000..b23944da796 --- /dev/null +++ b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName7_es6.ts @@ -0,0 +1,3 @@ +class C { + [e] +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName8_es6.ts b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName8_es6.ts new file mode 100644 index 00000000000..18f1fd61276 --- /dev/null +++ b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName8_es6.ts @@ -0,0 +1,3 @@ +class C { + public [e] +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName9_es6.ts b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName9_es6.ts new file mode 100644 index 00000000000..18e290722aa --- /dev/null +++ b/tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName9_es6.ts @@ -0,0 +1,3 @@ +class C { + [e]: Type +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts new file mode 100644 index 00000000000..fa7a20f78ba --- /dev/null +++ b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts @@ -0,0 +1,2 @@ +function * foo(a = yield => yield) { +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts new file mode 100644 index 00000000000..07b452678eb --- /dev/null +++ b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts @@ -0,0 +1,2 @@ +function * yield() { +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration12_es6.ts b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration12_es6.ts new file mode 100644 index 00000000000..ff08bd514af --- /dev/null +++ b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration12_es6.ts @@ -0,0 +1 @@ +var v = function * yield() { } \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts new file mode 100644 index 00000000000..e5e30dc4b0e --- /dev/null +++ b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts @@ -0,0 +1,4 @@ +function * foo() { + // Legal to use 'yield' in a type context. + var v: yield; +} diff --git a/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts new file mode 100644 index 00000000000..650e619fc00 --- /dev/null +++ b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts @@ -0,0 +1,2 @@ +function * foo() { +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration2_es6.ts b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration2_es6.ts new file mode 100644 index 00000000000..136dd1f9b43 --- /dev/null +++ b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration2_es6.ts @@ -0,0 +1,2 @@ +function f(yield) { +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration3_es6.ts b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration3_es6.ts new file mode 100644 index 00000000000..33324d88158 --- /dev/null +++ b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration3_es6.ts @@ -0,0 +1,2 @@ +function f(yield = yield) { +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration4_es6.ts b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration4_es6.ts new file mode 100644 index 00000000000..fd9170a726a --- /dev/null +++ b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration4_es6.ts @@ -0,0 +1,2 @@ +function yield() { +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts new file mode 100644 index 00000000000..3e97edf26a6 --- /dev/null +++ b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts @@ -0,0 +1,2 @@ +function*foo(yield) { +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts new file mode 100644 index 00000000000..144aae6b63c --- /dev/null +++ b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts @@ -0,0 +1,2 @@ +function*foo(a = yield) { +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts new file mode 100644 index 00000000000..3cc50e85592 --- /dev/null +++ b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts @@ -0,0 +1,5 @@ +function*bar() { + // 'yield' here is an identifier, and not a yield expression. + function*foo(a = yield) { + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts new file mode 100644 index 00000000000..4b65f204bab --- /dev/null +++ b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts @@ -0,0 +1 @@ +var v = { [yield]: foo } \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts new file mode 100644 index 00000000000..d30d6535d4b --- /dev/null +++ b/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts @@ -0,0 +1,3 @@ +function * foo() { + var v = { [yield]: foo } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts b/tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts new file mode 100644 index 00000000000..42ff543edf7 --- /dev/null +++ b/tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts @@ -0,0 +1 @@ +var v = function * () { } \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts b/tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts new file mode 100644 index 00000000000..2669a3e386f --- /dev/null +++ b/tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts @@ -0,0 +1 @@ +var v = function * foo() { } \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts b/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts new file mode 100644 index 00000000000..1d6cb9f92fb --- /dev/null +++ b/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts @@ -0,0 +1 @@ +var v = { *foo() { } } \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments2_es6.ts b/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments2_es6.ts new file mode 100644 index 00000000000..e58c7077a49 --- /dev/null +++ b/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments2_es6.ts @@ -0,0 +1 @@ +var v = { *() { } } \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments3_es6.ts b/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments3_es6.ts new file mode 100644 index 00000000000..ebcd542a2a0 --- /dev/null +++ b/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments3_es6.ts @@ -0,0 +1 @@ +var v = { *{ } } \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments4_es6.ts b/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments4_es6.ts new file mode 100644 index 00000000000..3b23ea4fc97 --- /dev/null +++ b/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments4_es6.ts @@ -0,0 +1 @@ +var v = { * } \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts b/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts new file mode 100644 index 00000000000..b1628dd2f2c --- /dev/null +++ b/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts @@ -0,0 +1 @@ +var v = { *[foo()]() { } } \ No newline at end of file diff --git a/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments6_es6.ts b/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments6_es6.ts new file mode 100644 index 00000000000..6bfae9ec77c --- /dev/null +++ b/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments6_es6.ts @@ -0,0 +1 @@ +var v = { *() { } } \ No newline at end of file diff --git a/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts b/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts new file mode 100644 index 00000000000..3bb832ccf49 --- /dev/null +++ b/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts @@ -0,0 +1,3 @@ +class C { + *foo() { } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts b/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts new file mode 100644 index 00000000000..2174110723d --- /dev/null +++ b/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts @@ -0,0 +1,3 @@ +class C { + public * foo() { } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts b/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts new file mode 100644 index 00000000000..8db736f99bb --- /dev/null +++ b/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts @@ -0,0 +1,3 @@ +class C { + *[foo]() { } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration4_es6.ts b/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration4_es6.ts new file mode 100644 index 00000000000..0fa98ce98c4 --- /dev/null +++ b/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration4_es6.ts @@ -0,0 +1,3 @@ +class C { + *() { } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration5_es6.ts b/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration5_es6.ts new file mode 100644 index 00000000000..474316195f0 --- /dev/null +++ b/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration5_es6.ts @@ -0,0 +1,3 @@ +class C { + * +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration6_es6.ts b/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration6_es6.ts new file mode 100644 index 00000000000..1efad0a7842 --- /dev/null +++ b/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration6_es6.ts @@ -0,0 +1,3 @@ +class C { + *foo +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts b/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts new file mode 100644 index 00000000000..93f05494107 --- /dev/null +++ b/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts @@ -0,0 +1,3 @@ +class C { + *foo() { } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts b/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts new file mode 100644 index 00000000000..069d7339869 --- /dev/null +++ b/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration8_es6.ts @@ -0,0 +1,7 @@ +class C { + foo() { + // Make sure we don't think of *bar as the start of a generator method. + if (a) # * bar; + return bar; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandProperties.ts b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandProperties.ts new file mode 100644 index 00000000000..ffeab289584 --- /dev/null +++ b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandProperties.ts @@ -0,0 +1,20 @@ +// @target: es5 +var a, b, c; + +var x1 = { + a +}; + +var x2 = { + a, +} + +var x3 = { + a: 0, + b, + c, + d() { }, + x3, + parent: x3 +}; + diff --git a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignment.ts b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignment.ts new file mode 100644 index 00000000000..38782100166 --- /dev/null +++ b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignment.ts @@ -0,0 +1,13 @@ +var id: number = 10000; +var name: string = "my name"; + +var person: { name: string; id: number } = { name, id }; +function foo( obj:{ name: string }): void { }; +function bar(name: string, id: number) { return { name, id }; } +function bar1(name: string, id: number) { return { name }; } +function baz(name: string, id: number): { name: string; id: number } { return { name, id }; } + +foo(person); +var person1 = bar("Hello", 5); +var person2: { name: string } = bar("Hello", 5); +var person3: { name: string; id:number } = bar("Hello", 5); diff --git a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentES6.ts b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentES6.ts new file mode 100644 index 00000000000..19fd21b47b5 --- /dev/null +++ b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentES6.ts @@ -0,0 +1,14 @@ +// @target: es6 +var id: number = 10000; +var name: string = "my name"; + +var person: { name: string; id: number } = { name, id }; +function foo(obj: { name: string }): void { }; +function bar(name: string, id: number) { return { name, id }; } +function bar1(name: string, id: number) { return { name }; } +function baz(name: string, id: number): { name: string; id: number } { return { name, id }; } + +foo(person); +var person1 = bar("Hello", 5); +var person2: { name: string } = bar("Hello", 5); +var person3: { name: string; id: number } = bar("Hello", 5); diff --git a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts new file mode 100644 index 00000000000..b745b93b3ca --- /dev/null +++ b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts @@ -0,0 +1,9 @@ +var id: number = 10000; +var name: string = "my name"; + +var person: { b: string; id: number } = { name, id }; // error +var person1: { name, id }; // error: can't use short-hand property assignment in type position +function foo(name: string, id: number): { id: string, name: number } { return { name, id }; } // error +function bar(obj: { name: string; id: boolean }) { } +bar({ name, id }); // error + diff --git a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts new file mode 100644 index 00000000000..6b0943a8d77 --- /dev/null +++ b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts @@ -0,0 +1,8 @@ +var id: number = 10000; +var name: string = "my name"; + +var person: { b: string; id: number } = { name, id }; // error +function bar(name: string, id: number): { name: number, id: string } { return { name, id }; } // error +function foo(name: string, id: number): { name: string, id: number } { return { name, id }; } // error +var person1: { name, id }; // error : Can't use shorthand in the type position +var person2: { name: string, id: number } = bar("hello", 5); \ No newline at end of file diff --git a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesES6.ts b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesES6.ts new file mode 100644 index 00000000000..bf4c2583c07 --- /dev/null +++ b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesES6.ts @@ -0,0 +1,20 @@ +// @target: es6 +var a, b, c; + +var x1 = { + a +}; + +var x2 = { + a, +} + +var x3 = { + a: 0, + b, + c, + d() { }, + x3, + parent: x3 +}; + diff --git a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.ts b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.ts new file mode 100644 index 00000000000..1f44dc18ae8 --- /dev/null +++ b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.ts @@ -0,0 +1,4 @@ +var x = { + x, // OK + undefinedVariable // Error +} diff --git a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts new file mode 100644 index 00000000000..527154c66bd --- /dev/null +++ b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts @@ -0,0 +1,20 @@ +// errors +var y = { + "stringLiteral", + 42, + get e, + set f, + this, + super, + var, + class, + typeof +}; + +var x = { + a.b, + a["ss"], + a[1], +}; + +var v = { class }; // error \ No newline at end of file diff --git a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorWithModule.ts b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorWithModule.ts new file mode 100644 index 00000000000..7da6e7b0c70 --- /dev/null +++ b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorWithModule.ts @@ -0,0 +1,14 @@ +// module export +var x = "Foo"; +module m { + export var x; +} + +module n { + var z = 10000; + export var y = { + m.x // error + }; +} + +m.y.x; diff --git a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument.ts b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument.ts new file mode 100644 index 00000000000..c50c4e3fbdf --- /dev/null +++ b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument.ts @@ -0,0 +1,10 @@ +var id: number = 10000; +var name: string = "my name"; + +var person = { name, id }; + +function foo(p: { name: string; id: number }) { } +foo(person); + + +var obj = { name: name, id: id }; \ No newline at end of file diff --git a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument2.ts b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument2.ts new file mode 100644 index 00000000000..45c248a5911 --- /dev/null +++ b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument2.ts @@ -0,0 +1,7 @@ +var id: number = 10000; +var name: string = "my name"; + +var person = { name, id }; + +function foo(p: { a: string; id: number }) { } +foo(person); // error diff --git a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModule.ts b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModule.ts new file mode 100644 index 00000000000..005885bb901 --- /dev/null +++ b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModule.ts @@ -0,0 +1,13 @@ +// module export + +module m { + export var x; +} + +module m { + var z = x; + var y = { + a: x, + x + }; +} diff --git a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModuleES6.ts b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModuleES6.ts new file mode 100644 index 00000000000..f8937625afe --- /dev/null +++ b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModuleES6.ts @@ -0,0 +1,13 @@ +// @target: es6 + +module m { + export var x; +} + +module m { + var z = x; + var y = { + a: x, + x + }; +} diff --git a/tests/cases/conformance/es6/templates/TemplateExpression1.ts b/tests/cases/conformance/es6/templates/TemplateExpression1.ts new file mode 100644 index 00000000000..e6980c4c8e2 --- /dev/null +++ b/tests/cases/conformance/es6/templates/TemplateExpression1.ts @@ -0,0 +1 @@ +var v = `foo ${ a \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInCallExpression.ts b/tests/cases/conformance/es6/templates/templateStringInCallExpression.ts new file mode 100644 index 00000000000..04597a4c120 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInCallExpression.ts @@ -0,0 +1 @@ +`abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInCallExpressionES6.ts b/tests/cases/conformance/es6/templates/templateStringInCallExpressionES6.ts new file mode 100644 index 00000000000..d1cf67787e4 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInCallExpressionES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +`abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInNewExpression.ts b/tests/cases/conformance/es6/templates/templateStringInNewExpression.ts new file mode 100644 index 00000000000..cac8571553f --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInNewExpression.ts @@ -0,0 +1 @@ +new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInNewExpressionES6.ts b/tests/cases/conformance/es6/templates/templateStringInNewExpressionES6.ts new file mode 100644 index 00000000000..6d069f7004e --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInNewExpressionES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInTaggedTemplate.ts b/tests/cases/conformance/es6/templates/templateStringInTaggedTemplate.ts new file mode 100644 index 00000000000..79a0d770bee --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInTaggedTemplate.ts @@ -0,0 +1 @@ +`I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION` \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInTaggedTemplateES6.ts b/tests/cases/conformance/es6/templates/templateStringInTaggedTemplateES6.ts new file mode 100644 index 00000000000..dfb2de1f4b7 --- /dev/null +++ b/tests/cases/conformance/es6/templates/templateStringInTaggedTemplateES6.ts @@ -0,0 +1,2 @@ +// @target: ES6 +`I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION` \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts b/tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts index 4a80e452251..d020d7c7607 100644 --- a/tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts +++ b/tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts @@ -1,4 +1,4 @@ -function* gen { +function* gen() { // Once this is supported, the inner expression does not need to be parenthesized. var x = yield `abc${ x }def`; } diff --git a/tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts b/tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts new file mode 100644 index 00000000000..b95174babdf --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts @@ -0,0 +1,4 @@ +var v = { * foo() { + yield(foo); + } +} diff --git a/tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts b/tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts new file mode 100644 index 00000000000..7577e5ce46b --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts @@ -0,0 +1,5 @@ +class C { + *foo() { + yield(foo); + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/yieldExpressions/YieldExpression12_es6.ts b/tests/cases/conformance/es6/yieldExpressions/YieldExpression12_es6.ts new file mode 100644 index 00000000000..3ee6a464049 --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/YieldExpression12_es6.ts @@ -0,0 +1,5 @@ +class C { + constructor() { + yield foo + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts b/tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts new file mode 100644 index 00000000000..2ac6f631465 --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts @@ -0,0 +1 @@ +function* foo() { yield } \ No newline at end of file diff --git a/tests/cases/conformance/es6/yieldExpressions/YieldExpression14_es6.ts b/tests/cases/conformance/es6/yieldExpressions/YieldExpression14_es6.ts new file mode 100644 index 00000000000..d545175c94a --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/YieldExpression14_es6.ts @@ -0,0 +1,5 @@ +class C { + foo() { + yield foo + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/yieldExpressions/YieldExpression15_es6.ts b/tests/cases/conformance/es6/yieldExpressions/YieldExpression15_es6.ts new file mode 100644 index 00000000000..b2793208aaa --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/YieldExpression15_es6.ts @@ -0,0 +1,3 @@ +var v = () => { + yield foo + } \ No newline at end of file diff --git a/tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts b/tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts new file mode 100644 index 00000000000..1933df26ecf --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts @@ -0,0 +1,5 @@ +function* foo() { + function bar() { + yield foo; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts b/tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts new file mode 100644 index 00000000000..7ef3a1fe350 --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts @@ -0,0 +1 @@ +var v = { get foo() { yield foo; } } \ No newline at end of file diff --git a/tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts b/tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts new file mode 100644 index 00000000000..f91016aabf0 --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts @@ -0,0 +1,2 @@ +"use strict"; +yield(foo); \ No newline at end of file diff --git a/tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts b/tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts new file mode 100644 index 00000000000..0183d72ea61 --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts @@ -0,0 +1,7 @@ +function*foo() { + function bar() { + function* quux() { + yield(foo); + } + } +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/yieldExpressions/YieldExpression1_es6.ts b/tests/cases/conformance/es6/yieldExpressions/YieldExpression1_es6.ts new file mode 100644 index 00000000000..bdbfe1e27a7 --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/YieldExpression1_es6.ts @@ -0,0 +1 @@ +yield; \ No newline at end of file diff --git a/tests/cases/conformance/es6/yieldExpressions/YieldExpression2_es6.ts b/tests/cases/conformance/es6/yieldExpressions/YieldExpression2_es6.ts new file mode 100644 index 00000000000..39bbe4e7eb0 --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/YieldExpression2_es6.ts @@ -0,0 +1 @@ +yield foo; \ No newline at end of file diff --git a/tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts b/tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts new file mode 100644 index 00000000000..04ae4b8d223 --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts @@ -0,0 +1,4 @@ +function* foo() { + yield + yield +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts b/tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts new file mode 100644 index 00000000000..cd2f9708048 --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts @@ -0,0 +1,4 @@ +function* foo() { + yield; + yield; +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/yieldExpressions/YieldExpression5_es6.ts b/tests/cases/conformance/es6/yieldExpressions/YieldExpression5_es6.ts new file mode 100644 index 00000000000..af4b3a84d2f --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/YieldExpression5_es6.ts @@ -0,0 +1,3 @@ +function* foo() { + yield* +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts b/tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts new file mode 100644 index 00000000000..87d307dcda0 --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts @@ -0,0 +1,3 @@ +function* foo() { + yield*foo +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts b/tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts new file mode 100644 index 00000000000..0db38fd498b --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts @@ -0,0 +1,3 @@ +function* foo() { + yield foo +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts b/tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts new file mode 100644 index 00000000000..b6b08301239 --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts @@ -0,0 +1,4 @@ +yield(foo); +function* foo() { + yield(foo); +} \ No newline at end of file diff --git a/tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts b/tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts new file mode 100644 index 00000000000..9119deae832 --- /dev/null +++ b/tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts @@ -0,0 +1,3 @@ +var v = function*() { + yield(foo); +} \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode12.ts b/tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode12.ts index 5d89dfc3b71..e8374347196 100644 --- a/tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode12.ts +++ b/tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode12.ts @@ -1,2 +1,3 @@ +// @target: ES5 "use strict"; var v = { set foo(eval) { } } \ No newline at end of file diff --git a/tests/cases/fourslash/completionEntryForConst.ts b/tests/cases/fourslash/completionEntryForConst.ts index f6b7cc42d63..dc2b2358b0a 100644 --- a/tests/cases/fourslash/completionEntryForConst.ts +++ b/tests/cases/fourslash/completionEntryForConst.ts @@ -4,4 +4,4 @@ /////**/ goTo.marker(); -verify.completionListContains("c", /*text*/ undefined, /*documentation*/ undefined, "constant"); \ No newline at end of file +verify.completionListContains("c", "(const) c: string", /*documentation*/ undefined, "const"); \ No newline at end of file diff --git a/tests/cases/fourslash/completionEntryForShorthandPropertyAssignment.ts b/tests/cases/fourslash/completionEntryForShorthandPropertyAssignment.ts new file mode 100644 index 00000000000..dae5762d92c --- /dev/null +++ b/tests/cases/fourslash/completionEntryForShorthandPropertyAssignment.ts @@ -0,0 +1,6 @@ +/// + +//// var person: {name:string; id:number} = {n/**/ + +goTo.marker(); +verify.completionListContains("name", /*text*/ undefined, /*documentation*/ undefined, "property"); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListForShorthandPropertyAssignment.ts b/tests/cases/fourslash/completionListForShorthandPropertyAssignment.ts new file mode 100644 index 00000000000..d8262d71047 --- /dev/null +++ b/tests/cases/fourslash/completionListForShorthandPropertyAssignment.ts @@ -0,0 +1,7 @@ +/// + +//// var person: {name:string; id: number} = { n/**/ + +goTo.marker(); +verify.memberListContains('name'); +verify.memberListContains('id'); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListForShorthandPropertyAssignment2.ts b/tests/cases/fourslash/completionListForShorthandPropertyAssignment2.ts new file mode 100644 index 00000000000..d8262d71047 --- /dev/null +++ b/tests/cases/fourslash/completionListForShorthandPropertyAssignment2.ts @@ -0,0 +1,7 @@ +/// + +//// var person: {name:string; id: number} = { n/**/ + +goTo.marker(); +verify.memberListContains('name'); +verify.memberListContains('id'); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListInTemplateLiteralParts1.ts b/tests/cases/fourslash/completionListInTemplateLiteralParts1.ts index a71584bdbdd..0166546f63e 100644 --- a/tests/cases/fourslash/completionListInTemplateLiteralParts1.ts +++ b/tests/cases/fourslash/completionListInTemplateLiteralParts1.ts @@ -8,4 +8,4 @@ test.markers().forEach(marker => { goTo.position(marker.position); verify.completionListItemsCountIsGreaterThan(0) -}} \ No newline at end of file +}); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListInTemplateLiteralPartsNegatives1.ts b/tests/cases/fourslash/completionListInTemplateLiteralPartsNegatives1.ts index 1624192057b..ac64a41fb56 100644 --- a/tests/cases/fourslash/completionListInTemplateLiteralPartsNegatives1.ts +++ b/tests/cases/fourslash/completionListInTemplateLiteralPartsNegatives1.ts @@ -8,4 +8,4 @@ test.markers().forEach(marker => { goTo.position(marker.position); verify.completionListIsEmpty() -} \ No newline at end of file +}); \ No newline at end of file diff --git a/tests/cases/fourslash/constEnumQuickInfoAndCompletionList.ts b/tests/cases/fourslash/constEnumQuickInfoAndCompletionList.ts new file mode 100644 index 00000000000..aa90fd2e187 --- /dev/null +++ b/tests/cases/fourslash/constEnumQuickInfoAndCompletionList.ts @@ -0,0 +1,15 @@ +/// + +////const enum /*1*/e { +//// a, +//// b, +//// c +////} +/////*2*/e.a; + +goTo.marker('1'); +verify.quickInfoIs("const enum e"); + +goTo.marker('2'); +verify.completionListContains("e", "const enum e"); +verify.quickInfoIs("const enum e"); \ No newline at end of file diff --git a/tests/cases/fourslash/constQuickInfoAndCompletionList.ts b/tests/cases/fourslash/constQuickInfoAndCompletionList.ts new file mode 100644 index 00000000000..59a793df40b --- /dev/null +++ b/tests/cases/fourslash/constQuickInfoAndCompletionList.ts @@ -0,0 +1,37 @@ +/// + +////const /*1*/a = 10; +////var x = /*2*/a; +/////*3*/ +////function foo() { +//// const /*4*/b = 20; +//// var y = /*5*/b; +//// var z = /*6*/a; +//// /*7*/ +////} +goTo.marker('1'); +verify.quickInfoIs("(const) a: number"); + +goTo.marker('2'); +verify.completionListContains("a", "(const) a: number"); +verify.quickInfoIs("(const) a: number"); + +goTo.marker('3'); +verify.completionListContains("a", "(const) a: number"); + +goTo.marker('4'); +verify.quickInfoIs("(const) b: number"); + +goTo.marker('5'); +verify.completionListContains("a", "(const) a: number"); +verify.completionListContains("b", "(const) b: number"); +verify.quickInfoIs("(const) b: number"); + +goTo.marker('6'); +verify.completionListContains("a", "(const) a: number"); +verify.completionListContains("b", "(const) b: number"); +verify.quickInfoIs("(const) a: number"); + +goTo.marker('7'); +verify.completionListContains("a", "(const) a: number"); +verify.completionListContains("b", "(const) b: number"); \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsInsideTemplates1.ts b/tests/cases/fourslash/findAllRefsInsideTemplates1.ts index e4501219265..dd4461751de 100644 --- a/tests/cases/fourslash/findAllRefsInsideTemplates1.ts +++ b/tests/cases/fourslash/findAllRefsInsideTemplates1.ts @@ -8,5 +8,5 @@ test.ranges().forEach(targetRange => { test.ranges().forEach(range => { verify.referencesAtPositionContains(range); - } -} \ No newline at end of file + }); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsInsideTemplates2.ts b/tests/cases/fourslash/findAllRefsInsideTemplates2.ts index cafddd4f45b..7f585234082 100644 --- a/tests/cases/fourslash/findAllRefsInsideTemplates2.ts +++ b/tests/cases/fourslash/findAllRefsInsideTemplates2.ts @@ -8,5 +8,5 @@ test.ranges().forEach(targetRange => { test.ranges().forEach(range => { verify.referencesAtPositionContains(range); - } -} \ No newline at end of file + }); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames1.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames1.ts new file mode 100644 index 00000000000..369258832a9 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames1.ts @@ -0,0 +1,18 @@ +/// + +////class Foo { +//// public [|_bar|]() { return 0; } +////} +//// +////var x: Foo; +////x.[|_bar|]; + + +test.ranges().forEach(r1 => { + goTo.position(r1.start); + verify.referencesCountIs(2); + + test.ranges().forEach(r2 => { + verify.referencesAtPositionContains(r2); + }); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames2.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames2.ts new file mode 100644 index 00000000000..53adb8236a4 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames2.ts @@ -0,0 +1,18 @@ +/// + +////class Foo { +//// public [|__bar|]() { return 0; } +////} +//// +////var x: Foo; +////x.[|__bar|]; + + +test.ranges().forEach(r1 => { + goTo.position(r1.start); + verify.referencesCountIs(2); + + test.ranges().forEach(r2 => { + verify.referencesAtPositionContains(r2); + }); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames3.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames3.ts new file mode 100644 index 00000000000..1793ec6ddc4 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames3.ts @@ -0,0 +1,18 @@ +/// + +////class Foo { +//// public [|___bar|]() { return 0; } +////} +//// +////var x: Foo; +////x.[|___bar|]; + + +test.ranges().forEach(r1 => { + goTo.position(r1.start); + verify.referencesCountIs(2); + + test.ranges().forEach(r2 => { + verify.referencesAtPositionContains(r2); + }); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames4.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames4.ts new file mode 100644 index 00000000000..694ecdc79ab --- /dev/null +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames4.ts @@ -0,0 +1,18 @@ +/// + +////class Foo { +//// public [|____bar|]() { return 0; } +////} +//// +////var x: Foo; +////x.[|____bar|]; + + +test.ranges().forEach(r1 => { + goTo.position(r1.start); + verify.referencesCountIs(2); + + test.ranges().forEach(r2 => { + verify.referencesAtPositionContains(r2); + }); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames5.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames5.ts new file mode 100644 index 00000000000..a110597f4b7 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames5.ts @@ -0,0 +1,24 @@ +/// + +////class Foo { +//// public _bar; +//// public __bar; +//// public [|___bar|]; +//// public ____bar; +////} +//// +////var x: Foo; +////x._bar; +////x.__bar; +////x.[|___bar|]; +////x.____bar; + + +test.ranges().forEach(r1 => { + goTo.position(r1.start); + verify.referencesCountIs(2); + + test.ranges().forEach(r2 => { + verify.referencesAtPositionContains(r2); + }); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames6.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames6.ts new file mode 100644 index 00000000000..97ed29eb178 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames6.ts @@ -0,0 +1,24 @@ +/// + +////class Foo { +//// public _bar; +//// public [|__bar|]; +//// public ___bar; +//// public ____bar; +////} +//// +////var x: Foo; +////x._bar; +////x.[|__bar|]; +////x.___bar; +////x.____bar; + + +test.ranges().forEach(r1 => { + goTo.position(r1.start); + verify.referencesCountIs(2); + + test.ranges().forEach(r2 => { + verify.referencesAtPositionContains(r2); + }); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames7.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames7.ts new file mode 100644 index 00000000000..76adc714b2c --- /dev/null +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames7.ts @@ -0,0 +1,14 @@ +/// + +////function [|__foo|]() { +//// [|__foo|](); +////} + +test.ranges().forEach(r => { + goTo.position(r.start); + verify.referencesCountIs(2); + + test.ranges().forEach(range => { + verify.referencesAtPositionContains(range); + }); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames8.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames8.ts new file mode 100644 index 00000000000..d25d6335f2b --- /dev/null +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames8.ts @@ -0,0 +1,14 @@ +/// + +////(function [|__foo|]() { +//// [|__foo|](); +////}) + +test.ranges().forEach(r => { + goTo.position(r.start); + verify.referencesCountIs(2); + + test.ranges().forEach(range => { + verify.referencesAtPositionContains(range); + }); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames9.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames9.ts new file mode 100644 index 00000000000..295344d23f9 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames9.ts @@ -0,0 +1,14 @@ +/// + +////(function [|___foo|]() { +//// [|___foo|](); +////}) + +test.ranges().forEach(r => { + goTo.position(r.start); + verify.referencesCountIs(2); + + test.ranges().forEach(range => { + verify.referencesAtPositionContains(range); + }); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment.ts b/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment.ts new file mode 100644 index 00000000000..7a1f7a0225f --- /dev/null +++ b/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment.ts @@ -0,0 +1,19 @@ +/// + +//// var /*1*/name = "Foo"; +//// +//// var obj = { /*2*/name }; +//// var obj1 = { /*3*/name:name }; +//// obj./*4*/name; + +goTo.marker('1'); +verify.referencesCountIs(3); + +goTo.marker('2'); +verify.referencesCountIs(4); + +goTo.marker('3'); +verify.referencesCountIs(1); + +goTo.marker('4'); +verify.referencesCountIs(2); diff --git a/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment2.ts b/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment2.ts new file mode 100644 index 00000000000..e9bb7bf02a8 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment2.ts @@ -0,0 +1,23 @@ +/// + +//// var /*1*/dx = "Foo"; +//// +//// module M { export var /*2*/dx; } +//// module M { +//// var z = 100; +//// export var y = { /*3*/dx, z }; +//// } +//// M.y./*4*/dx; + +goTo.marker('1'); +debugger; +verify.referencesCountIs(1); + +goTo.marker('2'); +verify.referencesCountIs(2); + +goTo.marker('3'); +verify.referencesCountIs(3); + +goTo.marker('4'); +verify.referencesCountIs(2); diff --git a/tests/cases/fourslash/formattingHexLiteral.ts b/tests/cases/fourslash/formattingHexLiteral.ts new file mode 100644 index 00000000000..a3cb1a3e16c --- /dev/null +++ b/tests/cases/fourslash/formattingHexLiteral.ts @@ -0,0 +1,5 @@ +/// + +////var x = 0x1,y; + +format.document(); // should not crash diff --git a/tests/cases/fourslash/formattingInMultilineComments.ts b/tests/cases/fourslash/formattingInMultilineComments.ts new file mode 100644 index 00000000000..7c58aa957ac --- /dev/null +++ b/tests/cases/fourslash/formattingInMultilineComments.ts @@ -0,0 +1,14 @@ +/// + +////var x = function() { +//// if (true) { +//// /*1*/} else {/*2*/ +////} +//// +////// newline at the end of the file + +goTo.marker("2"); +edit.insertLine(""); +goTo.marker("1"); +// else formating should not be affected +verify.currentLineContentIs(' } else {'); diff --git a/tests/cases/fourslash/formattingNestedScopes.ts b/tests/cases/fourslash/formattingNestedScopes.ts new file mode 100644 index 00000000000..269a67dcaaf --- /dev/null +++ b/tests/cases/fourslash/formattingNestedScopes.ts @@ -0,0 +1,27 @@ +/// + +/////*1*/ module My.App { +/////*2*/export var appModule = angular.module("app", [ +/////*3*/ ]).config([() => { +/////*4*/ configureStates +/////*5*/($stateProvider); +/////*6*/}]).run(My.App.setup); +/////*7*/ } + + +format.document() + +goTo.marker("1"); +verify.currentLineContentIs("module My.App {"); +goTo.marker("2"); +verify.currentLineContentIs(" export var appModule = angular.module(\"app\", ["); +goTo.marker("3"); +verify.currentLineContentIs(" ]).config([() => {"); +goTo.marker("4"); +verify.currentLineContentIs(" configureStates"); +goTo.marker("5"); +verify.currentLineContentIs(" ($stateProvider);"); +goTo.marker("6"); +verify.currentLineContentIs(" }]).run(My.App.setup);"); +goTo.marker("7"); +verify.currentLineContentIs("}"); \ No newline at end of file diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index c71f8987bdf..c0372d46063 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -301,11 +301,11 @@ module FourSlashInterface { FourSlash.currentTestState.verifySignatureHelpArgumentCount(expected); } - public currentSignatureParamterCountIs(expected: number) { + public currentSignatureParameterCountIs(expected: number) { FourSlash.currentTestState.verifyCurrentSignatureHelpParameterCount(expected); } - public currentSignatureTypeParamterCountIs(expected: number) { + public currentSignatureTypeParameterCountIs(expected: number) { FourSlash.currentTestState.verifyCurrentSignatureHelpTypeParameterCount(expected); } diff --git a/tests/cases/fourslash/genericParameterHelp.ts b/tests/cases/fourslash/genericParameterHelp.ts index 17882485fd7..6bbb957f0f9 100644 --- a/tests/cases/fourslash/genericParameterHelp.ts +++ b/tests/cases/fourslash/genericParameterHelp.ts @@ -14,7 +14,7 @@ ////testFunction<, ,/*5*/>(null, null, null); // goTo.marker("1"); -// verify.currentSignatureParamterCountIs(3); +// verify.currentSignatureParameterCountIs(3); // verify.currentSignatureHelpIs("testFunction(a: T, b: U, c: M): M"); // verify.currentParameterHelpArgumentNameIs("T"); diff --git a/tests/cases/fourslash/getDeclarationDiagnostics.ts b/tests/cases/fourslash/getDeclarationDiagnostics.ts new file mode 100644 index 00000000000..693261d62b4 --- /dev/null +++ b/tests/cases/fourslash/getDeclarationDiagnostics.ts @@ -0,0 +1,19 @@ +/// + +// @declaration: true +// @out: true + +// @Filename: inputFile1.ts +//// module m { +//// export class C implements I { } +//// interface I { } +//// } /*1*/ + +// @Filename: input2.ts +//// var x = "hello world"; /*2*/ + +goTo.marker("1"); +verify.numberOfErrorsInCurrentFile(1); + +goTo.marker("2"); +verify.numberOfErrorsInCurrentFile(0); diff --git a/tests/cases/fourslash/getImplementors1.ts b/tests/cases/fourslash/getImplementors1.ts deleted file mode 100644 index c67e246002c..00000000000 --- a/tests/cases/fourslash/getImplementors1.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// - -////class C { -//// /**/p; -////} - -goTo.marker(); -verify.implementorsCountIs(0); \ No newline at end of file diff --git a/tests/cases/fourslash/getImplementorsForFunction.ts b/tests/cases/fourslash/getImplementorsForFunction.ts deleted file mode 100644 index d2df60dc14d..00000000000 --- a/tests/cases/fourslash/getImplementorsForFunction.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -////function fo/**/o() { -////} - -goTo.marker(); -verify.implementorsCountIs(0); diff --git a/tests/cases/fourslash/getOccurrencesOfAnonymousFunction.ts b/tests/cases/fourslash/getOccurrencesOfAnonymousFunction.ts index 9e32b9c0357..96354df6b05 100644 --- a/tests/cases/fourslash/getOccurrencesOfAnonymousFunction.ts +++ b/tests/cases/fourslash/getOccurrencesOfAnonymousFunction.ts @@ -1,9 +1,16 @@ /// -////(function f/**/oo(): number { +////(function [|foo|](): number { +//// var x = [|foo|]; //// return 0; ////}) -goTo.marker(); -verify.occurrencesAtPositionCount(1); +test.ranges().forEach(r => { + goTo.position(r.start); + verify.occurrencesAtPositionCount(2); + + test.ranges().forEach(range => { + verify.occurrencesAtPositionContains(range); + }); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/getOccurrencesReturnBroken.ts b/tests/cases/fourslash/getOccurrencesReturnBroken.ts index e740e7f2bb3..08ec794f7e8 100644 --- a/tests/cases/fourslash/getOccurrencesReturnBroken.ts +++ b/tests/cases/fourslash/getOccurrencesReturnBroken.ts @@ -51,4 +51,4 @@ for (var i = 1; i <= test.markers().length; i++) { verify.occurrencesAtPositionCount(1); // 'return' is an instance member break; } -}); \ No newline at end of file +} \ No newline at end of file diff --git a/tests/cases/fourslash/goToDefinitionShorthandProperty.ts b/tests/cases/fourslash/goToDefinitionShorthandProperty.ts new file mode 100644 index 00000000000..07ea82c03e1 --- /dev/null +++ b/tests/cases/fourslash/goToDefinitionShorthandProperty.ts @@ -0,0 +1,25 @@ +/// + +//// var /*valueDeclaration1*/name = "hello"; +//// var /*valueDeclaration2*/id = 100000; +//// declare var /*valueDeclaration3*/id; +//// var obj = {/*valueDefinition1*/name, /*valueDefinition2*/id}; +//// obj./*valueReference1*/name; +//// obj./*valueReference2*/id; + +goTo.marker("valueDefinition1"); +goTo.definition(); +verify.caretAtMarker("valueDeclaration1"); + +goTo.marker("valueDefinition2"); +goTo.definition(0); +verify.caretAtMarker("valueDeclaration2"); +goTo.definition(1); +verify.caretAtMarker("valueDeclaration3"); + +goTo.marker("valueReference1"); +goTo.definition(); +verify.caretAtMarker("valueDefinition1"); +goTo.marker("valueReference2"); +goTo.definition(); +verify.caretAtMarker("valueDefinition2"); diff --git a/tests/cases/fourslash/letQuickInfoAndCompletionList.ts b/tests/cases/fourslash/letQuickInfoAndCompletionList.ts new file mode 100644 index 00000000000..127b4d626fd --- /dev/null +++ b/tests/cases/fourslash/letQuickInfoAndCompletionList.ts @@ -0,0 +1,28 @@ +/// + +////let /*1*/a = 10; +/////*2*/a = 30; +////function foo() { +//// let /*3*/b = 20; +//// /*4*/b = /*5*/a; +////} + +goTo.marker('1'); +verify.quickInfoIs("(let) a: number"); + +goTo.marker('2'); +verify.completionListContains("a", "(let) a: number"); +verify.quickInfoIs("(let) a: number"); + +goTo.marker('3'); +verify.quickInfoIs("(let) b: number"); + +goTo.marker('4'); +verify.completionListContains("a", "(let) a: number"); +verify.completionListContains("b", "(let) b: number"); +verify.quickInfoIs("(let) b: number"); + +goTo.marker('5'); +verify.completionListContains("a", "(let) a: number"); +verify.completionListContains("b", "(let) b: number"); +verify.quickInfoIs("(let) a: number"); \ No newline at end of file diff --git a/tests/cases/fourslash/navbar_const.ts b/tests/cases/fourslash/navbar_const.ts index ede2a9cd1d8..6c0738747f3 100644 --- a/tests/cases/fourslash/navbar_const.ts +++ b/tests/cases/fourslash/navbar_const.ts @@ -1,6 +1,6 @@ /// -//// {| "itemName": "c", "kind": "constant", "parentName": "" |}const c = 0; +//// {| "itemName": "c", "kind": "const", "parentName": "" |}const c = 0; test.markers().forEach(marker => { verify.getScriptLexicalStructureListContains( diff --git a/tests/cases/fourslash/navbar_let.ts b/tests/cases/fourslash/navbar_let.ts new file mode 100644 index 00000000000..841382abc53 --- /dev/null +++ b/tests/cases/fourslash/navbar_let.ts @@ -0,0 +1,13 @@ +/// + +//// {| "itemName": "c", "kind": "let", "parentName": "" |}let c = 0; + +test.markers().forEach(marker => { + verify.getScriptLexicalStructureListContains( + marker.data.itemName, + marker.data.kind, + marker.fileName, + marker.data.parentName, + marker.data.isAdditionalRange, + marker.position); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/navigateItemsConst.ts b/tests/cases/fourslash/navigateItemsConst.ts new file mode 100644 index 00000000000..d5ccb31066d --- /dev/null +++ b/tests/cases/fourslash/navigateItemsConst.ts @@ -0,0 +1,16 @@ +/// + +////{| "itemName": "c", "kind": "const", "parentName": "" |}const c = 10; +////function foo() { +//// {| "itemName": "d", "kind": "const", "parentName": "foo" |}const d = 10; +////} + +test.markers().forEach(marker => { + verify.navigationItemsListContains( + marker.data.itemName, + marker.data.kind, + marker.data.itemName, + "exact", + marker.fileName, + marker.data.parentName); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/navigateItemsLet.ts b/tests/cases/fourslash/navigateItemsLet.ts new file mode 100644 index 00000000000..dc399522703 --- /dev/null +++ b/tests/cases/fourslash/navigateItemsLet.ts @@ -0,0 +1,16 @@ +/// + +////{| "itemName": "c", "kind": "let", "parentName": "" |}let c = 10; +////function foo() { +//// {| "itemName": "d", "kind": "let", "parentName": "foo" |}let d = 10; +////} + +test.markers().forEach(marker => { + verify.navigationItemsListContains( + marker.data.itemName, + marker.data.kind, + marker.data.itemName, + "exact", + marker.fileName, + marker.data.parentName); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/quickInfoForConstDeclaration.ts b/tests/cases/fourslash/quickInfoForConstDeclaration.ts index dc234b04050..2b1f108c579 100644 --- a/tests/cases/fourslash/quickInfoForConstDeclaration.ts +++ b/tests/cases/fourslash/quickInfoForConstDeclaration.ts @@ -3,4 +3,4 @@ ////const /**/c = 0 ; goTo.marker(); -verify.quickInfoIs("(constant) c: number"); \ No newline at end of file +verify.quickInfoIs("(const) c: number"); \ No newline at end of file diff --git a/tests/cases/fourslash/quickInfoForRequire.ts b/tests/cases/fourslash/quickInfoForRequire.ts new file mode 100644 index 00000000000..91d59cb4318 --- /dev/null +++ b/tests/cases/fourslash/quickInfoForRequire.ts @@ -0,0 +1,11 @@ +/// + +//@Filename: AA/BB.ts +////export class a{} + +//@Filename: quickInfoForRequire_input.ts +////import a = require("AA/B/*1*/B"); + +goTo.marker('1'); +verify.quickInfoIs('module a'); +verify.referencesCountIs(0); \ No newline at end of file diff --git a/tests/cases/fourslash/quickInfoForShorthandProperty.ts b/tests/cases/fourslash/quickInfoForShorthandProperty.ts new file mode 100644 index 00000000000..21ba9db683d --- /dev/null +++ b/tests/cases/fourslash/quickInfoForShorthandProperty.ts @@ -0,0 +1,21 @@ +/// + +//// var name1 = undefined, id1 = undefined; +//// var /*obj1*/obj1 = {/*name1*/name1, /*id1*/id1}; +//// var name2 = "Hello"; +//// var id2 = 10000; +//// var /*obj2*/obj2 = {/*name2*/name2, /*id2*/id2}; + +goTo.marker("obj1"); +verify.quickInfoIs("(var) obj1: {\n name1: any;\n id1: any;\n}"); +goTo.marker("name1"); +verify.quickInfoIs("(property) name1: any"); +goTo.marker("id1"); +verify.quickInfoIs("(property) id1: any"); + +goTo.marker("obj2"); +verify.quickInfoIs("(var) obj2: {\n name2: string;\n id2: number;\n}"); +goTo.marker("name2"); +verify.quickInfoIs("(property) name2: string"); +goTo.marker("id2"); +verify.quickInfoIs("(property) id2: number"); diff --git a/tests/cases/fourslash/signatureHelpAnonymousFunction.ts b/tests/cases/fourslash/signatureHelpAnonymousFunction.ts index cc723c713d6..ba812a2f8d3 100644 --- a/tests/cases/fourslash/signatureHelpAnonymousFunction.ts +++ b/tests/cases/fourslash/signatureHelpAnonymousFunction.ts @@ -7,7 +7,7 @@ goTo.marker('anonymousFunction1'); verify.signatureHelpCountIs(1); -verify.currentSignatureParamterCountIs(2); +verify.currentSignatureParameterCountIs(2); verify.currentSignatureHelpIs('(a: number, b: string): string'); verify.currentParameterHelpArgumentNameIs("a"); verify.currentParameterSpanIs("a: number"); diff --git a/tests/cases/fourslash/signatureHelpAtEOF.ts b/tests/cases/fourslash/signatureHelpAtEOF.ts index 64c4aaeeb2c..d2e1fa0418d 100644 --- a/tests/cases/fourslash/signatureHelpAtEOF.ts +++ b/tests/cases/fourslash/signatureHelpAtEOF.ts @@ -10,6 +10,6 @@ verify.signatureHelpPresent(); verify.signatureHelpCountIs(1); verify.currentSignatureHelpIs("Foo(arg1: string, arg2: string): void"); -verify.currentSignatureParamterCountIs(2); +verify.currentSignatureParameterCountIs(2); verify.currentParameterHelpArgumentNameIs("arg1"); verify.currentParameterSpanIs("arg1: string"); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpBeforeSemicolon1.ts b/tests/cases/fourslash/signatureHelpBeforeSemicolon1.ts index 2b0b07056bf..d3bdd42ef1a 100644 --- a/tests/cases/fourslash/signatureHelpBeforeSemicolon1.ts +++ b/tests/cases/fourslash/signatureHelpBeforeSemicolon1.ts @@ -10,6 +10,6 @@ verify.signatureHelpPresent(); verify.signatureHelpCountIs(1); verify.currentSignatureHelpIs("Foo(arg1: string, arg2: string): void"); -verify.currentSignatureParamterCountIs(2); +verify.currentSignatureParameterCountIs(2); verify.currentParameterHelpArgumentNameIs("arg1"); verify.currentParameterSpanIs("arg1: string"); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpCallExpression.ts b/tests/cases/fourslash/signatureHelpCallExpression.ts index 50d89aaae4e..fd9758cfa54 100644 --- a/tests/cases/fourslash/signatureHelpCallExpression.ts +++ b/tests/cases/fourslash/signatureHelpCallExpression.ts @@ -5,7 +5,7 @@ goTo.marker('1'); verify.signatureHelpCountIs(1); -verify.currentSignatureParamterCountIs(2); +verify.currentSignatureParameterCountIs(2); verify.currentSignatureHelpIs('fnTest(str: string, num: number): void'); verify.currentParameterHelpArgumentNameIs('str'); diff --git a/tests/cases/fourslash/signatureHelpConstructExpression.ts b/tests/cases/fourslash/signatureHelpConstructExpression.ts index a88cb3fce68..00efee0a479 100644 --- a/tests/cases/fourslash/signatureHelpConstructExpression.ts +++ b/tests/cases/fourslash/signatureHelpConstructExpression.ts @@ -6,7 +6,7 @@ goTo.marker('1'); verify.signatureHelpCountIs(1); -verify.currentSignatureParamterCountIs(2); +verify.currentSignatureParameterCountIs(2); verify.currentSignatureHelpIs('sampleCls(str: string, num: number): sampleCls'); verify.currentParameterHelpArgumentNameIs('str'); diff --git a/tests/cases/fourslash/signatureHelpConstructorInheritance.ts b/tests/cases/fourslash/signatureHelpConstructorInheritance.ts index b066eab3fd4..a2e683d69bb 100644 --- a/tests/cases/fourslash/signatureHelpConstructorInheritance.ts +++ b/tests/cases/fourslash/signatureHelpConstructorInheritance.ts @@ -16,7 +16,7 @@ goTo.marker('indirectSuperCall'); verify.signatureHelpCountIs(2); -verify.currentSignatureParamterCountIs(1); +verify.currentSignatureParameterCountIs(1); verify.currentSignatureHelpIs('B2(n: number): B2'); verify.currentParameterHelpArgumentNameIs("n"); verify.currentParameterSpanIs("n: number"); diff --git a/tests/cases/fourslash/signatureHelpConstructorOverload.ts b/tests/cases/fourslash/signatureHelpConstructorOverload.ts index ce276e09d8f..9aab48f71ae 100644 --- a/tests/cases/fourslash/signatureHelpConstructorOverload.ts +++ b/tests/cases/fourslash/signatureHelpConstructorOverload.ts @@ -6,11 +6,11 @@ goTo.marker('1'); verify.signatureHelpCountIs(2); -verify.currentSignatureParamterCountIs(0); +verify.currentSignatureParameterCountIs(0); verify.currentSignatureHelpIs('clsOverload(): clsOverload'); goTo.marker('2'); -verify.currentSignatureParamterCountIs(1); +verify.currentSignatureParameterCountIs(1); verify.currentSignatureHelpIs('clsOverload(test: string): clsOverload'); verify.currentParameterHelpArgumentNameIs('test'); verify.currentParameterSpanIs("test: string"); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpEmptyList.ts b/tests/cases/fourslash/signatureHelpEmptyList.ts index 6ea70159dcc..b6318656f4f 100644 --- a/tests/cases/fourslash/signatureHelpEmptyList.ts +++ b/tests/cases/fourslash/signatureHelpEmptyList.ts @@ -12,7 +12,7 @@ verify.signatureHelpPresent(); verify.signatureHelpCountIs(1); verify.currentSignatureHelpIs("Foo(arg1: string, arg2: string): void"); -verify.currentSignatureParamterCountIs(2); +verify.currentSignatureParameterCountIs(2); verify.currentParameterHelpArgumentNameIs("arg1"); verify.currentParameterSpanIs("arg1: string"); diff --git a/tests/cases/fourslash/signatureHelpFunctionOverload.ts b/tests/cases/fourslash/signatureHelpFunctionOverload.ts index 2c1cdb51291..cc02ba12570 100644 --- a/tests/cases/fourslash/signatureHelpFunctionOverload.ts +++ b/tests/cases/fourslash/signatureHelpFunctionOverload.ts @@ -8,11 +8,11 @@ goTo.marker('functionOverload1'); verify.signatureHelpCountIs(2); -verify.currentSignatureParamterCountIs(0); +verify.currentSignatureParameterCountIs(0); verify.currentSignatureHelpIs('functionOverload(): any'); goTo.marker('functionOverload2'); -verify.currentSignatureParamterCountIs(1); +verify.currentSignatureParameterCountIs(1); verify.currentSignatureHelpIs('functionOverload(test: string): any'); verify.currentParameterHelpArgumentNameIs("test"); verify.currentParameterSpanIs("test: string"); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpFunctionParameter.ts b/tests/cases/fourslash/signatureHelpFunctionParameter.ts index cb2264f2c42..b61e56dedcb 100644 --- a/tests/cases/fourslash/signatureHelpFunctionParameter.ts +++ b/tests/cases/fourslash/signatureHelpFunctionParameter.ts @@ -6,7 +6,7 @@ goTo.marker('parameterFunction1'); verify.signatureHelpCountIs(1); -verify.currentSignatureParamterCountIs(2); +verify.currentSignatureParameterCountIs(2); verify.currentSignatureHelpIs('callback(a: number, b: string): void'); verify.currentParameterHelpArgumentNameIs("a"); verify.currentParameterSpanIs("a: number"); diff --git a/tests/cases/fourslash/signatureHelpImplicitConstructor.ts b/tests/cases/fourslash/signatureHelpImplicitConstructor.ts index 9e42d25dbe9..4324767d00a 100644 --- a/tests/cases/fourslash/signatureHelpImplicitConstructor.ts +++ b/tests/cases/fourslash/signatureHelpImplicitConstructor.ts @@ -7,4 +7,4 @@ goTo.marker(); verify.signatureHelpCountIs(1); verify.currentSignatureHelpIs("ImplicitConstructor(): ImplicitConstructor"); -verify.currentSignatureParamterCountIs(0); +verify.currentSignatureParameterCountIs(0); diff --git a/tests/cases/fourslash/signatureHelpIncompleteCalls.ts b/tests/cases/fourslash/signatureHelpIncompleteCalls.ts index e73217b1d8c..ec4fcccc0fe 100644 --- a/tests/cases/fourslash/signatureHelpIncompleteCalls.ts +++ b/tests/cases/fourslash/signatureHelpIncompleteCalls.ts @@ -17,13 +17,13 @@ goTo.marker('incompleteCalls1'); verify.currentSignatureHelpIs("f1(): void"); -verify.currentSignatureParamterCountIs(0); +verify.currentSignatureParameterCountIs(0); goTo.marker('incompleteCalls2'); -verify.currentSignatureParamterCountIs(1); +verify.currentSignatureParameterCountIs(1); verify.currentSignatureHelpIs("f2(n: number): number"); goTo.marker('incompleteCalls3'); -verify.currentSignatureParamterCountIs(2); +verify.currentSignatureParameterCountIs(2); verify.currentSignatureHelpIs("f3(n: number, s: string): string"); verify.currentParameterHelpArgumentNameIs("s"); diff --git a/tests/cases/fourslash/signatureHelpObjectLiteral.ts b/tests/cases/fourslash/signatureHelpObjectLiteral.ts index cbc5df697b9..6853c3fee36 100644 --- a/tests/cases/fourslash/signatureHelpObjectLiteral.ts +++ b/tests/cases/fourslash/signatureHelpObjectLiteral.ts @@ -1,17 +1,17 @@ /// ////var objectLiteral = { n: 5, s: "", f: (a: number, b: string) => "" }; -////objectLiteral.f(/*objectLiteral1*/4, /*objectLiteral2*/""); - -goTo.marker('objectLiteral1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureParamterCountIs(2); -verify.currentSignatureHelpIs('f(a: number, b: string): string'); - -verify.currentParameterHelpArgumentNameIs("a"); -verify.currentParameterSpanIs("a: number"); - -goTo.marker('objectLiteral2'); -verify.currentSignatureHelpIs('f(a: number, b: string): string'); +////objectLiteral.f(/*objectLiteral1*/4, /*objectLiteral2*/""); + +goTo.marker('objectLiteral1'); +verify.signatureHelpCountIs(1); +verify.currentSignatureParameterCountIs(2); +verify.currentSignatureHelpIs('f(a: number, b: string): string'); + +verify.currentParameterHelpArgumentNameIs("a"); +verify.currentParameterSpanIs("a: number"); + +goTo.marker('objectLiteral2'); +verify.currentSignatureHelpIs('f(a: number, b: string): string'); verify.currentParameterHelpArgumentNameIs("b"); verify.currentParameterSpanIs("b: string"); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpOnOverloadsDifferentArity3.ts b/tests/cases/fourslash/signatureHelpOnOverloadsDifferentArity3.ts index c217a12ef58..f9754c7d1fd 100644 --- a/tests/cases/fourslash/signatureHelpOnOverloadsDifferentArity3.ts +++ b/tests/cases/fourslash/signatureHelpOnOverloadsDifferentArity3.ts @@ -10,17 +10,17 @@ goTo.marker(); verify.signatureHelpCountIs(4); verify.currentSignatureHelpIs("f(): any"); -verify.currentSignatureParamterCountIs(0); +verify.currentSignatureParameterCountIs(0); verify.signatureHelpArgumentCountIs(0); edit.insert(", "); verify.signatureHelpCountIs(4); verify.currentSignatureHelpIs("f(s: string, b: boolean): any"); -verify.currentSignatureParamterCountIs(2); +verify.currentSignatureParameterCountIs(2); verify.currentParameterHelpArgumentNameIs("b"); verify.currentParameterSpanIs("b: boolean"); edit.insert(", "); verify.signatureHelpCountIs(4); verify.currentSignatureHelpIs("f(s: string, b: boolean): any"); -verify.currentSignatureParamterCountIs(2); \ No newline at end of file +verify.currentSignatureParameterCountIs(2); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpSuperConstructorOverload.ts b/tests/cases/fourslash/signatureHelpSuperConstructorOverload.ts index 1be8c3202a1..aa2e3e4856c 100644 --- a/tests/cases/fourslash/signatureHelpSuperConstructorOverload.ts +++ b/tests/cases/fourslash/signatureHelpSuperConstructorOverload.ts @@ -20,9 +20,9 @@ goTo.marker('superOverload1'); verify.signatureHelpCountIs(2); verify.currentSignatureHelpIs("SuperOverloadlBase(): SuperOverloadlBase"); -verify.currentSignatureParamterCountIs(0); +verify.currentSignatureParameterCountIs(0); goTo.marker('superOverload2'); -verify.currentSignatureParamterCountIs(1); +verify.currentSignatureParameterCountIs(1); verify.currentSignatureHelpIs("SuperOverloadlBase(test: string): SuperOverloadlBase"); verify.currentParameterHelpArgumentNameIs("test"); verify.currentParameterSpanIs("test: string"); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplates1.ts b/tests/cases/fourslash/signatureHelpTaggedTemplates1.ts new file mode 100644 index 00000000000..39644ba8c24 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplates1.ts @@ -0,0 +1,18 @@ +/// + +//// function f(templateStrings, x, y, z) { return 10; } +//// function g(templateStrings, x, y, z) { return ""; } +//// +//// f `/*1*/ qwe/*2*/rty /*3*/$/*4*/{ 123 }/*5*/ as/*6*/df /*7*/$/*8*/{ 41234 }/*9*/ zxc/*10*/vb /*11*/$/*12*/{ g ` ` }/*13*/ /*14*/ /*15*/` + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(1); + verify.signatureHelpArgumentCountIs(4); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number'); + verify.currentParameterHelpArgumentNameIs("templateStrings"); + verify.currentParameterSpanIs("templateStrings: any"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplates2.ts b/tests/cases/fourslash/signatureHelpTaggedTemplates2.ts new file mode 100644 index 00000000000..123a6cc4c2c --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplates2.ts @@ -0,0 +1,18 @@ +/// + +//// function f(templateStrings, x, y, z) { return 10; } +//// function g(templateStrings, x, y, z) { return ""; } +//// +//// f `/*1*/ qwe/*2*/rty /*3*/$/*4*/{ 123 }/*5*/ as/*6*/df /*7*/$/*8*/{ 41234 }/*9*/ zxc/*10*/vb /*11*/$/*12*/{ g ` ` }/*13*/ /*14*/ /*15*/ + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(1); + verify.signatureHelpArgumentCountIs(4); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number'); + verify.currentParameterHelpArgumentNameIs("templateStrings"); + verify.currentParameterSpanIs("templateStrings: any"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplates3.ts b/tests/cases/fourslash/signatureHelpTaggedTemplates3.ts new file mode 100644 index 00000000000..f203468ca04 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplates3.ts @@ -0,0 +1,18 @@ +/// + +//// function f(templateStrings, x, y, z) { return 10; } +//// function g(templateStrings, x, y, z) { return ""; } +//// +//// f ` qwerty ${/*1*/ /*2*/123/*3*/ /*4*/} asdf ${ 41234 } zxcvb ${ g ` ` } ` + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(1); + verify.signatureHelpArgumentCountIs(4); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number'); + verify.currentParameterHelpArgumentNameIs("x"); + verify.currentParameterSpanIs("x: any"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplates4.ts b/tests/cases/fourslash/signatureHelpTaggedTemplates4.ts new file mode 100644 index 00000000000..13ee47a3309 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplates4.ts @@ -0,0 +1,18 @@ +/// + +//// function f(templateStrings, x, y, z) { return 10; } +//// function g(templateStrings, x, y, z) { return ""; } +//// +//// f ` qwerty ${ 123 } asdf ${/*1*/ /*2*/ /*3*/41/*4*/234/*5*/ /*6*/} zxcvb ${ g ` ` } ` + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(1); + verify.signatureHelpArgumentCountIs(4); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number'); + verify.currentParameterHelpArgumentNameIs("y"); + verify.currentParameterSpanIs("y: any"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplates5.ts b/tests/cases/fourslash/signatureHelpTaggedTemplates5.ts new file mode 100644 index 00000000000..7cd2affd675 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplates5.ts @@ -0,0 +1,18 @@ +/// + +//// function f(templateStrings, x, y, z) { return 10; } +//// function g(templateStrings, x, y, z) { return ""; } +//// +//// f ` qwerty ${ 123 } asdf ${ 41234 } zxcvb ${/*1*/ /*2*/g/*3*/ /*4*/` `/*5*/ /*6*/} ` + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(1); + verify.signatureHelpArgumentCountIs(4); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number'); + verify.currentParameterHelpArgumentNameIs("z"); + verify.currentParameterSpanIs("z: any"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplates6.ts b/tests/cases/fourslash/signatureHelpTaggedTemplates6.ts new file mode 100644 index 00000000000..7671666bb54 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplates6.ts @@ -0,0 +1,18 @@ +/// + +//// function f(templateStrings, x, y, z) { return 10; } +//// function g(templateStrings, x, y, z) { return ""; } +//// +//// f ` qwerty ${ 123 } asdf ${ 41234 } zxcvb ${ g `/*1*/ /*2*/ /*3*/` } ` + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(1); + verify.signatureHelpArgumentCountIs(1); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('g(templateStrings: any, x: any, y: any, z: any): string'); + verify.currentParameterHelpArgumentNameIs("templateStrings"); + verify.currentParameterSpanIs("templateStrings: any"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplates7.ts b/tests/cases/fourslash/signatureHelpTaggedTemplates7.ts new file mode 100644 index 00000000000..35bed336f39 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplates7.ts @@ -0,0 +1,18 @@ +/// + +//// function f(templateStrings, x, y, z) { return 10; } +//// function g(templateStrings, x, y, z) { return ""; } +//// +//// f `/*1*/ /*2*/ + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(1); + verify.signatureHelpArgumentCountIs(1); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number'); + verify.currentParameterHelpArgumentNameIs("templateStrings"); + verify.currentParameterSpanIs("templateStrings: any"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesIncomplete1.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesIncomplete1.ts new file mode 100644 index 00000000000..1da96ea5c1b --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesIncomplete1.ts @@ -0,0 +1,18 @@ +/// + +//// function f(templateStrings, x, y, z) { return 10; } +//// function g(templateStrings, x, y, z) { return ""; } +//// +//// f `/*1*/ /*2*/${ + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(1); + verify.signatureHelpArgumentCountIs(2); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number'); + verify.currentParameterHelpArgumentNameIs("templateStrings"); + verify.currentParameterSpanIs("templateStrings: any"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesIncomplete2.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesIncomplete2.ts new file mode 100644 index 00000000000..68ff7202f01 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesIncomplete2.ts @@ -0,0 +1,18 @@ +/// + +//// function f(templateStrings, x, y, z) { return 10; } +//// function g(templateStrings, x, y, z) { return ""; } +//// +//// f ` ${/*1*/ /*2*/ + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(1); + verify.signatureHelpArgumentCountIs(2); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number'); + verify.currentParameterHelpArgumentNameIs("x"); + verify.currentParameterSpanIs("x: any"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesIncomplete3.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesIncomplete3.ts new file mode 100644 index 00000000000..8165da7f67b --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesIncomplete3.ts @@ -0,0 +1,18 @@ +/// + +//// function f(templateStrings, x, y, z) { return 10; } +//// function g(templateStrings, x, y, z) { return ""; } +//// +//// f ` ${ }/*1*/ /*2*/ + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(1); + verify.signatureHelpArgumentCountIs(2); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number'); + verify.currentParameterHelpArgumentNameIs("templateStrings"); + verify.currentParameterSpanIs("templateStrings: any"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesIncomplete4.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesIncomplete4.ts new file mode 100644 index 00000000000..8c970b60c77 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesIncomplete4.ts @@ -0,0 +1,18 @@ +/// + +//// function f(templateStrings, x, y, z) { return 10; } +//// function g(templateStrings, x, y, z) { return ""; } +//// +//// f ` ${ } ${/*1*/ /*2*/ + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(1); + verify.signatureHelpArgumentCountIs(3); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number'); + verify.currentParameterHelpArgumentNameIs("y"); + verify.currentParameterSpanIs("y: any"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesIncomplete5.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesIncomplete5.ts new file mode 100644 index 00000000000..f93da36ce5c --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesIncomplete5.ts @@ -0,0 +1,18 @@ +/// + +//// function f(templateStrings, x, y, z) { return 10; } +//// function g(templateStrings, x, y, z) { return ""; } +//// +//// f ` ${ } ${ }/*1*/ /*2*/ + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(1); + verify.signatureHelpArgumentCountIs(3); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number'); + verify.currentParameterHelpArgumentNameIs("templateStrings"); + verify.currentParameterSpanIs("templateStrings: any"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesIncomplete6.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesIncomplete6.ts new file mode 100644 index 00000000000..10d81eb80f4 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesIncomplete6.ts @@ -0,0 +1,18 @@ +/// + +//// function f(templateStrings, x, y, z) { return 10; } +//// function g(templateStrings, x, y, z) { return ""; } +//// +//// f ` ${ 123 } ${/*1*/ } ` + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(1); + verify.signatureHelpArgumentCountIs(3); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number'); + verify.currentParameterHelpArgumentNameIs("y"); + verify.currentParameterSpanIs("y: any"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesNegatives1.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesNegatives1.ts new file mode 100644 index 00000000000..c61f1a871e4 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesNegatives1.ts @@ -0,0 +1,11 @@ +/// + +//// function f(templateStrings, x, y, z) { return 10; } +//// function g(templateStrings, x, y, z) { return ""; } +//// +//// /*1*/f/*2*/ /*3*/` qwerty ${ 123 } asdf ${ 41234 } zxcvb ${ g ` ` } `/*4*/ + +test.markers().forEach(m => { + goTo.position(m.position); + verify.not.signatureHelpPresent(); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesNested1.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesNested1.ts new file mode 100644 index 00000000000..a3c9f7ccce4 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesNested1.ts @@ -0,0 +1,15 @@ +/// + +//// function f(templateStrings, x, y, z) { return 10; } +//// function g(templateStrings, x, y, z) { return ""; } +//// +//// f `a ${ g `/*1*/alpha/*2*/ ${/*3*/ 12/*4*/3 /*5*/} beta /*6*/${ /*7*/456 /*8*/} gamma/*9*/` } b ${ g `/*10*/txt/*11*/` } c ${ g `/*12*/aleph /*13*/$/*14*/{ 12/*15*/3 } beit/*16*/` } d`; + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(1); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('g(templateStrings: any, x: any, y: any, z: any): string'); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesNested2.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesNested2.ts new file mode 100644 index 00000000000..d72fa74d985 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesNested2.ts @@ -0,0 +1,15 @@ +/// + +//// function f(templateStrings, x, y, z) { return 10; } +//// function g(templateStrings, x, y, z) { return ""; } +//// +//// f `/*1*/a $/*2*/{ /*3*/g /*4*/`alpha ${ 123 } beta ${ 456 } gamma`/*5*/ }/*6*/ b $/*7*/{ /*8*/g /*9*/`txt`/*10*/ } /*11*/c ${ /*12*/g /*13*/`aleph ${ 123 } beit`/*14*/ } d/*15*/`; + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(1); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number'); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags1.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags1.ts new file mode 100644 index 00000000000..6850b1bc54f --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags1.ts @@ -0,0 +1,20 @@ +/// + +//// function f(templateStrings: string[], p1_o1: string): number; +//// function f(templateStrings: string[], p1_o2: number, p2_o2: number, p3_o2: number): string; +//// function f(templateStrings: string[], p1_o3: string, p2_o3: boolean, p3_o3: number): boolean; +//// function f(...foo[]: any) { return ""; } +//// +//// f `/*1*/ /*2*/$/*3*/{ + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(3); + verify.signatureHelpArgumentCountIs(2); + + verify.currentSignatureParameterCountIs(2); + verify.currentSignatureHelpIs('f(templateStrings: string[], p1_o1: string): number'); + verify.currentParameterHelpArgumentNameIs("templateStrings"); + verify.currentParameterSpanIs("templateStrings: string[]"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags2.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags2.ts new file mode 100644 index 00000000000..8466c6b05f2 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags2.ts @@ -0,0 +1,20 @@ +/// + +//// function f(templateStrings: string[], p1_o1: string): number; +//// function f(templateStrings: string[], p1_o2: number, p2_o2: number, p3_o2: number): string; +//// function f(templateStrings: string[], p1_o3: string, p2_o3: boolean, p3_o3: number): boolean; +//// function f(...foo[]: any) { return ""; } +//// +//// f `${/*1*/ /*2*/ /*3*/ + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(3); + verify.signatureHelpArgumentCountIs(2); + + verify.currentSignatureParameterCountIs(2); + verify.currentSignatureHelpIs('f(templateStrings: string[], p1_o1: string): number'); + verify.currentParameterHelpArgumentNameIs("p1_o1"); + verify.currentParameterSpanIs("p1_o1: string"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags3.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags3.ts new file mode 100644 index 00000000000..3843ed34b16 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags3.ts @@ -0,0 +1,20 @@ +/// + +//// function f(templateStrings: string[], p1_o1: string): number; +//// function f(templateStrings: string[], p1_o2: number, p2_o2: number, p3_o2: number): string; +//// function f(templateStrings: string[], p1_o3: string, p2_o3: boolean, p3_o3: number): boolean; +//// function f(...foo[]: any) { return ""; } +//// +//// f `${/*1*/ "s/*2*/tring" /*3*/ } ${ + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(3); + verify.signatureHelpArgumentCountIs(3); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: string[], p1_o3: string, p2_o3: boolean, p3_o3: number): boolean'); + verify.currentParameterHelpArgumentNameIs("p1_o3"); + verify.currentParameterSpanIs("p1_o3: string"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags4.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags4.ts new file mode 100644 index 00000000000..a1072366a98 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags4.ts @@ -0,0 +1,20 @@ +/// + +//// function f(templateStrings: string[], p1_o1: string): number; +//// function f(templateStrings: string[], p1_o2: number, p2_o2: number, p3_o2: number): string; +//// function f(templateStrings: string[], p1_o3: string, p2_o3: boolean, p3_o3: number): boolean; +//// function f(...foo[]: any) { return ""; } +//// +//// f `${/*1*/ 123.456/*2*/ /*3*/ } ${ + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(3); + verify.signatureHelpArgumentCountIs(3); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: string[], p1_o2: number, p2_o2: number, p3_o2: number): string'); + verify.currentParameterHelpArgumentNameIs("p1_o2"); + verify.currentParameterSpanIs("p1_o2: number"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags5.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags5.ts new file mode 100644 index 00000000000..2646e70b39c --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags5.ts @@ -0,0 +1,20 @@ +/// + +//// function f(templateStrings: string[], p1_o1: string): number; +//// function f(templateStrings: string[], p1_o2: number, p2_o2: number, p3_o2: number): string; +//// function f(templateStrings: string[], p1_o3: string, p2_o3: boolean, p3_o3: number): boolean; +//// function f(...foo[]: any) { return ""; } +//// +//// f `${ } ${/*1*/ /*2*/ /*3*/ + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(3); + verify.signatureHelpArgumentCountIs(3); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: string[], p1_o2: number, p2_o2: number, p3_o2: number): string'); + verify.currentParameterHelpArgumentNameIs("p2_o2"); + verify.currentParameterSpanIs("p2_o2: number"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags6.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags6.ts new file mode 100644 index 00000000000..62410a5fda3 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags6.ts @@ -0,0 +1,20 @@ +/// + +//// function f(templateStrings: string[], p1_o1: string): number; +//// function f(templateStrings: string[], p1_o2: number, p2_o2: number, p3_o2: number): string; +//// function f(templateStrings: string[], p1_o3: string, p2_o3: boolean, p3_o3: number): boolean; +//// function f(...foo[]: any) { return ""; } +//// +//// f `${ } ${/*1*/ /*2*/ /*3*/} + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(3); + verify.signatureHelpArgumentCountIs(3); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: string[], p1_o2: number, p2_o2: number, p3_o2: number): string'); + verify.currentParameterHelpArgumentNameIs("p2_o2"); + verify.currentParameterSpanIs("p2_o2: number"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags7.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags7.ts new file mode 100644 index 00000000000..9a24aacf86b --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags7.ts @@ -0,0 +1,20 @@ +/// + +//// function f(templateStrings: string[], p1_o1: string): number; +//// function f(templateStrings: string[], p1_o2: number, p2_o2: number, p3_o2: number): string; +//// function f(templateStrings: string[], p1_o3: string, p2_o3: boolean, p3_o3: number): boolean; +//// function f(...foo[]: any) { return ""; } +//// +//// f `${ } ${/*1*/ fa/*2*/lse /*3*/} + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(3); + verify.signatureHelpArgumentCountIs(3); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: string[], p1_o3: string, p2_o3: boolean, p3_o3: number): boolean'); + verify.currentParameterHelpArgumentNameIs("p2_o3"); + verify.currentParameterSpanIs("p2_o3: boolean"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags8.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags8.ts new file mode 100644 index 00000000000..8000f15d3c6 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags8.ts @@ -0,0 +1,20 @@ +/// + +//// function f(templateStrings: string[], p1_o1: string): number; +//// function f(templateStrings: string[], p1_o2: number, p2_o2: number, p3_o2: number): string; +//// function f(templateStrings: string[], p1_o3: string, p2_o3: boolean, p3_o3: number): boolean; +//// function f(...foo[]: any) { return ""; } +//// +//// f `${ undefined } ${ undefined } ${/*1*/ 10/*2*/./*3*/01 /*4*/} ` + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(3); + verify.signatureHelpArgumentCountIs(4); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: string[], p1_o2: number, p2_o2: number, p3_o2: number): string'); + verify.currentParameterHelpArgumentNameIs("p3_o2"); + verify.currentParameterSpanIs("p3_o2: number"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags9.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags9.ts new file mode 100644 index 00000000000..aee06c1df53 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags9.ts @@ -0,0 +1,20 @@ +/// + +//// function f(templateStrings: string[], p1_o1: string): number; +//// function f(templateStrings: string[], p1_o2: number, p2_o2: number, p3_o2: number): string; +//// function f(templateStrings: string[], p1_o3: string, p2_o3: boolean, p3_o3: number): boolean; +//// function f(...foo[]: any) { return ""; } +//// +//// f `${/*1*/ /*2*/ /*3*/} ${ + +test.markers().forEach(m => { + goTo.position(m.position); + + verify.signatureHelpCountIs(3); + verify.signatureHelpArgumentCountIs(3); + + verify.currentSignatureParameterCountIs(4); + verify.currentSignatureHelpIs('f(templateStrings: string[], p1_o2: number, p2_o2: number, p3_o2: number): string'); + verify.currentParameterHelpArgumentNameIs("p1_o2"); + verify.currentParameterSpanIs("p1_o2: number"); +}); \ No newline at end of file diff --git a/tests/cases/fourslash/smartIndentInCallExpressions.ts b/tests/cases/fourslash/smartIndentInCallExpressions.ts new file mode 100644 index 00000000000..1e28932678b --- /dev/null +++ b/tests/cases/fourslash/smartIndentInCallExpressions.ts @@ -0,0 +1,12 @@ +/// + +////module My.App { +//// export var appModule = angular.module("app", [ +//// ]).config([() => { +//// configureStates/*1*/($stateProvider); +//// }]).run(My.App.setup); +////} + +goTo.marker("1") +edit.insert("\n"); +verify.indentationIs(12); // 4 (module block) + 4 (function block) + 4 (call expression) \ No newline at end of file diff --git a/tests/cases/fourslash_old/callSignatureHelp.ts b/tests/cases/fourslash_old/callSignatureHelp.ts deleted file mode 100644 index 4e813dd17c4..00000000000 --- a/tests/cases/fourslash_old/callSignatureHelp.ts +++ /dev/null @@ -1,10 +0,0 @@ -/// - -////interface C { -//// (): number; -////} -////var c: C; -////c(/**/ - -goTo.marker(); -verify.currentSignatureHelpIs('c(): number'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/classExtendsInterfaceSigHelp1.ts b/tests/cases/fourslash_old/classExtendsInterfaceSigHelp1.ts deleted file mode 100644 index ebdccef485f..00000000000 --- a/tests/cases/fourslash_old/classExtendsInterfaceSigHelp1.ts +++ /dev/null @@ -1,18 +0,0 @@ -/// - -////class C { -//// public foo(x: string); -//// public foo(x: number); -//// public foo(x: any) { return x; } -////} - -////interface I extends C { -//// other(x: any): any; -////} - -////var i: I; -////i.foo(/**/ - -goTo.marker(); -verify.signatureHelpCountIs(2); -verify.currentParameterSpanIs('x: string'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/completionListInObjectLiteralThatIsParameterOfFunctionCall.ts b/tests/cases/fourslash_old/completionListInObjectLiteralThatIsParameterOfFunctionCall.ts deleted file mode 100644 index bb04cd2ce68..00000000000 --- a/tests/cases/fourslash_old/completionListInObjectLiteralThatIsParameterOfFunctionCall.ts +++ /dev/null @@ -1,10 +0,0 @@ -/// - -////class C { x: string; } -////class D { x: string; y: string; } -////function foo(t: T, t2: U) { return null; } -////var r3 = foo(new C(), { x: '', z/*1*/ - -goTo.marker('1') -verify.not.completionListContains('z'); -verify.not.completionListContains('x'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/functionOverloadCount.ts b/tests/cases/fourslash_old/functionOverloadCount.ts deleted file mode 100644 index 00856dcb24a..00000000000 --- a/tests/cases/fourslash_old/functionOverloadCount.ts +++ /dev/null @@ -1,15 +0,0 @@ -/// - -////class C1 { -//// public attr(): string; -//// public attr(i: number): string; -//// public attr(i: number, x: boolean): string; -//// public attr(i?: any, x?: any) { -//// return "hi"; -//// } -////} -////var i = new C1; -////i.attr(/*1*/ - -goTo.marker('1'); -verify.signatureHelpCountIs(3); \ No newline at end of file diff --git a/tests/cases/fourslash_old/genericFunctionSignatureHelp1.ts b/tests/cases/fourslash_old/genericFunctionSignatureHelp1.ts deleted file mode 100644 index fc1e45d7e6b..00000000000 --- a/tests/cases/fourslash_old/genericFunctionSignatureHelp1.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -////function f(a: T): T { return null; } -////f(/**/ - -goTo.marker(); -verify.currentSignatureHelpIs('f(a: T): T'); diff --git a/tests/cases/fourslash_old/genericFunctionSignatureHelp2.ts b/tests/cases/fourslash_old/genericFunctionSignatureHelp2.ts deleted file mode 100644 index 77511677588..00000000000 --- a/tests/cases/fourslash_old/genericFunctionSignatureHelp2.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -////var f = (a: T) => a; -////f(/**/ - -goTo.marker(); -verify.currentSignatureHelpIs('f(a: T): T'); diff --git a/tests/cases/fourslash_old/genericFunctionSignatureHelp3.ts b/tests/cases/fourslash_old/genericFunctionSignatureHelp3.ts deleted file mode 100644 index 5f3adc60258..00000000000 --- a/tests/cases/fourslash_old/genericFunctionSignatureHelp3.ts +++ /dev/null @@ -1,39 +0,0 @@ -/// - -////function foo1(x: number, callback: (y1: T) => number) { } -////function foo2(x: number, callback: (y2: T) => number) { } -////function foo3(x: number, callback: (y3: T) => number) { } -////function foo4(x: number, callback: (y4: T) => number) { } -////function foo5(x: number, callback: (y5: T) => number) { } -////function foo6(x: number, callback: (y6: T) => number) { } -////function foo7(x: number, callback: (y7: T) => number) { } -//// IDE shows the results on the right of each line, fourslash says different -////foo1(/*1*/ // signature help shows y as T -////foo2(1,/*2*/ // signature help shows y as {} -////foo3(1, (/*3*/ // signature help shows y as T -////foo4(1,/*4*/ // signature help shows y as string -////foo5(1, (/*5*/ // signature help shows y as T -////foo6(1, (/*7*/ // signature help shows y as T - -goTo.marker('1'); -verify.currentSignatureHelpIs('foo1(x: number, callback: (y1: T) => number): void'); - -goTo.marker('2'); -verify.currentSignatureHelpIs('foo2(x: number, callback: (y2: {}) => number): void'); - -goTo.marker('3'); -verify.currentSignatureHelpIs('foo3(x: number, callback: (y3: T) => number): void'); - -goTo.marker('4'); -verify.currentSignatureHelpIs('foo4(x: number, callback: (y4: string) => number): void'); - -goTo.marker('5'); -verify.currentSignatureHelpIs('foo5(x: number, callback: (y5: T) => number): void'); - -goTo.marker('6'); -verify.currentSignatureHelpIs('foo6(x: number, callback: (y6: {}) => number): void'); -edit.insert('string>(null,null);'); // need to make this line parse so we can get reasonable LS answers to later tests - -goTo.marker('7'); -verify.currentSignatureHelpIs('foo7(x: number, callback: (y7: T) => number): void'); diff --git a/tests/cases/fourslash_old/genericFunctionSignatureHelp3MultiFile.ts b/tests/cases/fourslash_old/genericFunctionSignatureHelp3MultiFile.ts deleted file mode 100644 index dbb0a9fe83e..00000000000 --- a/tests/cases/fourslash_old/genericFunctionSignatureHelp3MultiFile.ts +++ /dev/null @@ -1,46 +0,0 @@ -/// - -// @Filename: genericFunctionSignatureHelp_0.ts -////function foo1(x: number, callback: (y1: T) => number) { } -// @Filename: genericFunctionSignatureHelp_1.ts -////function foo2(x: number, callback: (y2: T) => number) { } -// @Filename: genericFunctionSignatureHelp_2.ts -////function foo3(x: number, callback: (y3: T) => number) { } -// @Filename: genericFunctionSignatureHelp_3.ts -////function foo4(x: number, callback: (y4: T) => number) { } -// @Filename: genericFunctionSignatureHelp_4.ts -////function foo5(x: number, callback: (y5: T) => number) { } -// @Filename: genericFunctionSignatureHelp_5.ts -////function foo6(x: number, callback: (y6: T) => number) { } -// @Filename: genericFunctionSignatureHelp_6.ts -////function foo7(x: number, callback: (y7: T) => number) { } -// @Filename: genericFunctionSignatureHelp_7.ts -////foo1(/*1*/ // signature help shows y as T -////foo2(1,/*2*/ // signature help shows y as {} -////foo3(1, (/*3*/ // signature help shows y as T -////foo4(1,/*4*/ // signature help shows y as string -////foo5(1, (/*5*/ // signature help shows y as T -////foo6(1, (/*7*/ // signature help shows y as T - -goTo.marker('1'); -verify.currentSignatureHelpIs('foo1(x: number, callback: (y1: T) => number): void'); - -goTo.marker('2'); -verify.currentSignatureHelpIs('foo2(x: number, callback: (y2: {}) => number): void'); - -goTo.marker('3'); -verify.currentSignatureHelpIs('foo3(x: number, callback: (y3: T) => number): void'); - -goTo.marker('4'); -verify.currentSignatureHelpIs('foo4(x: number, callback: (y4: string) => number): void'); - -goTo.marker('5'); -verify.currentSignatureHelpIs('foo5(x: number, callback: (y5: T) => number): void'); - -goTo.marker('6'); -verify.currentSignatureHelpIs('foo6(x: number, callback: (y6: {}) => number): void'); -edit.insert('string>(null,null);'); // need to make this line parse so we can get reasonable LS answers to later tests - -goTo.marker('7'); -verify.currentSignatureHelpIs('foo7(x: number, callback: (y7: T) => number): void'); diff --git a/tests/cases/fourslash_old/getOutliningSpans.ts b/tests/cases/fourslash_old/getOutliningSpans.ts deleted file mode 100644 index 56a4aa7120c..00000000000 --- a/tests/cases/fourslash_old/getOutliningSpans.ts +++ /dev/null @@ -1,97 +0,0 @@ -/// - -////// interface -////interface IFoo[| { -//// getDist(): number; -////}|] -//// -////// class members -////class Foo[| { -//// constructor()[| { -//// }|] -//// -//// public foo(): number[| { -//// return 0; -//// }|] -//// -//// public get X()[| { -//// return 1; -//// }|] -//// -//// public set X(v: number)[| { -//// }|] -//// -//// public member = function f()[| { -//// -//// }|] -////}|] -//// -////// modules -////module m1[| { -//// module m2[| { }|] -//// module m3[| { -//// function foo()[| { -//// -//// }|] -//// -//// interface IFoo2[| { -//// -//// }|] -//// -//// class foo2 implements IFoo2[| { -//// -//// }|] -//// }|] -////}|] -//// -////// function declaration -////function foo(): number[| { -//// return 0; -////}|] -//// -////// function expressions -////(function f()[| { -//// -////}|]) -//// -////// trivia handeling -////class ClassFooWithTrivia[| /* some comments */ -//// /* more trivia */ { -//// -//// -//// /*some trailing trivia */ -////}|] /* even more */ -//// -//////outline with deep nesting -////module m1[|{ -//// module m2[| { -//// module m3[| { -//// module m4[| { -//// module m5[| { -//// module m6[| { -//// module m7[| { -//// module m8[| { -//// module m9[| { -//// module m10[| { -//// module m11 { -//// module m12 { -//// export interface IFoo { -//// } -//// } -//// } -//// }|] -//// }|] -//// }|] -//// }|] -//// }|] -//// }|] -//// }|] -//// }|] -//// }|] -////}|] -//// -//////outline after a deeply nested node -////class AfterNestedNodes[| { -////}|] - -verify.outliningSpansInCurrentFile(test.ranges()); diff --git a/tests/cases/fourslash_old/incrementalEditInvocationExpressionAboveInterfaceDeclaration.ts b/tests/cases/fourslash_old/incrementalEditInvocationExpressionAboveInterfaceDeclaration.ts deleted file mode 100644 index 8a06efbaa44..00000000000 --- a/tests/cases/fourslash_old/incrementalEditInvocationExpressionAboveInterfaceDeclaration.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////declare function alert(message?: any): void; -/////*1*/ -////interface Foo { -//// setISO8601(dString): Date; -////} - -diagnostics.setEditValidation(IncrementalEditValidation.None); - -// Do resolve without typeCheck -goTo.marker('1'); -edit.insert("alert("); -verify.currentSignatureHelpIs("alert(message?: any): void"); - -// TypeCheck -verify.errorExistsAfterMarker('1'); diff --git a/tests/cases/fourslash_old/paramHelpOnCommaInString.ts b/tests/cases/fourslash_old/paramHelpOnCommaInString.ts deleted file mode 100644 index 00271781582..00000000000 --- a/tests/cases/fourslash_old/paramHelpOnCommaInString.ts +++ /dev/null @@ -1,11 +0,0 @@ -/// - -////function blah(foo: string, bar: number) { -////} -////blah('hola/*1*/,/*2*/') - -// making sure the comma in a string literal doesn't trigger param help on the second function param -goTo.marker('1'); -verify.currentParameterHelpArgumentNameIs('foo'); -goTo.marker('2'); -verify.currentParameterHelpArgumentNameIs('foo'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/parameterInfoOnParameterType.ts b/tests/cases/fourslash_old/parameterInfoOnParameterType.ts deleted file mode 100644 index d28e675e24f..00000000000 --- a/tests/cases/fourslash_old/parameterInfoOnParameterType.ts +++ /dev/null @@ -1,11 +0,0 @@ -/// - -////function foo(a: string) { }; -////var b = "test"; -////foo("test"/*1*/); -////foo(b/*2*/); - -goTo.marker("1"); -verify.currentParameterHelpArgumentNameIs("a"); -goTo.marker("2"); -verify.currentParameterHelpArgumentNameIs("a"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/restArgSignatureHelp.ts b/tests/cases/fourslash_old/restArgSignatureHelp.ts deleted file mode 100644 index baa8702a5f6..00000000000 --- a/tests/cases/fourslash_old/restArgSignatureHelp.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -////function f(...x: any[]) { } -////f(/**/); - -goTo.marker(); -verify.currentParameterHelpArgumentNameIs('x'); diff --git a/tests/cases/fourslash_old/signatureHelpAnonymousFunction.ts b/tests/cases/fourslash_old/signatureHelpAnonymousFunction.ts deleted file mode 100644 index cc723c713d6..00000000000 --- a/tests/cases/fourslash_old/signatureHelpAnonymousFunction.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////var anonymousFunctionTest = function(n: number, s: string): (a: number, b: string) => string { -//// return null; -////} -////anonymousFunctionTest(5, "")(/*anonymousFunction1*/1, /*anonymousFunction2*/""); - -goTo.marker('anonymousFunction1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureParamterCountIs(2); -verify.currentSignatureHelpIs('(a: number, b: string): string'); -verify.currentParameterHelpArgumentNameIs("a"); -verify.currentParameterSpanIs("a: number"); - -goTo.marker('anonymousFunction2'); -verify.currentParameterHelpArgumentNameIs("b"); -verify.currentParameterSpanIs("b: string"); diff --git a/tests/cases/fourslash_old/signatureHelpAtEOF.ts b/tests/cases/fourslash_old/signatureHelpAtEOF.ts deleted file mode 100644 index 64c4aaeeb2c..00000000000 --- a/tests/cases/fourslash_old/signatureHelpAtEOF.ts +++ /dev/null @@ -1,15 +0,0 @@ -/// - -////function Foo(arg1: string, arg2: string) { -////} -//// -////Foo(/**/ - -goTo.marker(); -verify.signatureHelpPresent(); -verify.signatureHelpCountIs(1); - -verify.currentSignatureHelpIs("Foo(arg1: string, arg2: string): void"); -verify.currentSignatureParamterCountIs(2); -verify.currentParameterHelpArgumentNameIs("arg1"); -verify.currentParameterSpanIs("arg1: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpBeforeSemicolon1.ts b/tests/cases/fourslash_old/signatureHelpBeforeSemicolon1.ts deleted file mode 100644 index 2b0b07056bf..00000000000 --- a/tests/cases/fourslash_old/signatureHelpBeforeSemicolon1.ts +++ /dev/null @@ -1,15 +0,0 @@ -/// - -////function Foo(arg1: string, arg2: string) { -////} -//// -////Foo(/**/; - -goTo.marker(); -verify.signatureHelpPresent(); -verify.signatureHelpCountIs(1); - -verify.currentSignatureHelpIs("Foo(arg1: string, arg2: string): void"); -verify.currentSignatureParamterCountIs(2); -verify.currentParameterHelpArgumentNameIs("arg1"); -verify.currentParameterSpanIs("arg1: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpCallExpression.ts b/tests/cases/fourslash_old/signatureHelpCallExpression.ts deleted file mode 100644 index 50d89aaae4e..00000000000 --- a/tests/cases/fourslash_old/signatureHelpCallExpression.ts +++ /dev/null @@ -1,16 +0,0 @@ -/// - -////function fnTest(str: string, num: number) { } -////fnTest(/*1*/'', /*2*/5); - -goTo.marker('1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureParamterCountIs(2); -verify.currentSignatureHelpIs('fnTest(str: string, num: number): void'); - -verify.currentParameterHelpArgumentNameIs('str'); -verify.currentParameterSpanIs("str: string"); - -goTo.marker('2'); -verify.currentParameterHelpArgumentNameIs('num'); -verify.currentParameterSpanIs("num: number"); diff --git a/tests/cases/fourslash_old/signatureHelpConstructExpression.ts b/tests/cases/fourslash_old/signatureHelpConstructExpression.ts deleted file mode 100644 index a88cb3fce68..00000000000 --- a/tests/cases/fourslash_old/signatureHelpConstructExpression.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////class sampleCls { constructor(str: string, num: number) { } } -////var x = new sampleCls(/*1*/"", /*2*/5); - -goTo.marker('1'); -verify.signatureHelpCountIs(1); - -verify.currentSignatureParamterCountIs(2); -verify.currentSignatureHelpIs('sampleCls(str: string, num: number): sampleCls'); - -verify.currentParameterHelpArgumentNameIs('str'); -verify.currentParameterSpanIs("str: string"); - -goTo.marker('2'); -verify.currentParameterHelpArgumentNameIs('num'); -verify.currentParameterSpanIs("num: number"); diff --git a/tests/cases/fourslash_old/signatureHelpConstructorInheritance.ts b/tests/cases/fourslash_old/signatureHelpConstructorInheritance.ts deleted file mode 100644 index b066eab3fd4..00000000000 --- a/tests/cases/fourslash_old/signatureHelpConstructorInheritance.ts +++ /dev/null @@ -1,22 +0,0 @@ -/// - -////class base { -//// constructor(s: string); -//// constructor(n: number); -//// constructor(a: any) { } -////} -////class B1 extends base { } -////class B2 extends B1 { } -////class B3 extends B2 { -//// constructor() { -//// super(/*indirectSuperCall*/3); -//// } -////} - - -goTo.marker('indirectSuperCall'); -verify.signatureHelpCountIs(2); -verify.currentSignatureParamterCountIs(1); -verify.currentSignatureHelpIs('B2(n: number): B2'); -verify.currentParameterHelpArgumentNameIs("n"); -verify.currentParameterSpanIs("n: number"); diff --git a/tests/cases/fourslash_old/signatureHelpConstructorOverload.ts b/tests/cases/fourslash_old/signatureHelpConstructorOverload.ts deleted file mode 100644 index ce276e09d8f..00000000000 --- a/tests/cases/fourslash_old/signatureHelpConstructorOverload.ts +++ /dev/null @@ -1,16 +0,0 @@ -/// - -////class clsOverload { constructor(); constructor(test: string); constructor(test?: string) { } } -////var x = new clsOverload(/*1*/); -////var y = new clsOverload(/*2*/''); - -goTo.marker('1'); -verify.signatureHelpCountIs(2); -verify.currentSignatureParamterCountIs(0); -verify.currentSignatureHelpIs('clsOverload(): clsOverload'); - -goTo.marker('2'); -verify.currentSignatureParamterCountIs(1); -verify.currentSignatureHelpIs('clsOverload(test: string): clsOverload'); -verify.currentParameterHelpArgumentNameIs('test'); -verify.currentParameterSpanIs("test: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpForSuperCalls1.ts b/tests/cases/fourslash_old/signatureHelpForSuperCalls1.ts deleted file mode 100644 index 58e083ea2ed..00000000000 --- a/tests/cases/fourslash_old/signatureHelpForSuperCalls1.ts +++ /dev/null @@ -1,28 +0,0 @@ -/// - -////class A { } -////class B extends A { } -////class C extends B { -//// constructor() { -//// super(/*1*/ // sig help here? -//// } -////} -////class A2 { } -////class B2 extends A2 { -//// constructor(x:number) {} -//// } -////class C2 extends B2 { -//// constructor() { -//// super(/*2*/ // sig help here? -//// } -////} - -// this line triggers a semantic/syntactic error check, remove line when 788570 is fixed -edit.insert(''); - -goTo.marker('1'); -verify.signatureHelpPresent(); -verify.currentSignatureHelpIs('B(): B'); - -goTo.marker('2'); -verify.currentSignatureHelpIs('B2(x: number): B2'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpFunctionOverload.ts b/tests/cases/fourslash_old/signatureHelpFunctionOverload.ts deleted file mode 100644 index 2c1cdb51291..00000000000 --- a/tests/cases/fourslash_old/signatureHelpFunctionOverload.ts +++ /dev/null @@ -1,18 +0,0 @@ -/// - -////function functionOverload(); -////function functionOverload(test: string); -////function functionOverload(test?: string) { } -////functionOverload(/*functionOverload1*/); -////functionOverload(""/*functionOverload2*/); - -goTo.marker('functionOverload1'); -verify.signatureHelpCountIs(2); -verify.currentSignatureParamterCountIs(0); -verify.currentSignatureHelpIs('functionOverload(): any'); - -goTo.marker('functionOverload2'); -verify.currentSignatureParamterCountIs(1); -verify.currentSignatureHelpIs('functionOverload(test: string): any'); -verify.currentParameterHelpArgumentNameIs("test"); -verify.currentParameterSpanIs("test: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpFunctionParameter.ts b/tests/cases/fourslash_old/signatureHelpFunctionParameter.ts deleted file mode 100644 index cb2264f2c42..00000000000 --- a/tests/cases/fourslash_old/signatureHelpFunctionParameter.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////function parameterFunction(callback: (a: number, b: string) => void) { -//// callback(/*parameterFunction1*/5, /*parameterFunction2*/""); -////} - -goTo.marker('parameterFunction1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureParamterCountIs(2); -verify.currentSignatureHelpIs('callback(a: number, b: string): void'); -verify.currentParameterHelpArgumentNameIs("a"); -verify.currentParameterSpanIs("a: number"); - -goTo.marker('parameterFunction2'); -verify.currentSignatureHelpIs('callback(a: number, b: string): void'); -verify.currentParameterHelpArgumentNameIs("b"); -verify.currentParameterSpanIs("b: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpImplicitConstructor.ts b/tests/cases/fourslash_old/signatureHelpImplicitConstructor.ts deleted file mode 100644 index 9e42d25dbe9..00000000000 --- a/tests/cases/fourslash_old/signatureHelpImplicitConstructor.ts +++ /dev/null @@ -1,10 +0,0 @@ -/// - -////class ImplicitConstructor { -////} -////var implicitConstructor = new ImplicitConstructor(/**/); - -goTo.marker(); -verify.signatureHelpCountIs(1); -verify.currentSignatureHelpIs("ImplicitConstructor(): ImplicitConstructor"); -verify.currentSignatureParamterCountIs(0); diff --git a/tests/cases/fourslash_old/signatureHelpInCallback.ts b/tests/cases/fourslash_old/signatureHelpInCallback.ts deleted file mode 100644 index dd4856b48ef..00000000000 --- a/tests/cases/fourslash_old/signatureHelpInCallback.ts +++ /dev/null @@ -1,11 +0,0 @@ -/// - -////declare function forEach(f: () => void); -////forEach(/*1*/() => { -//// /*2*/ -////}); - -goTo.marker('1'); -verify.signatureHelpPresent(); -goTo.marker('2'); -verify.not.signatureHelpPresent(); diff --git a/tests/cases/fourslash_old/signatureHelpInCompleteGenericsCall.ts b/tests/cases/fourslash_old/signatureHelpInCompleteGenericsCall.ts deleted file mode 100644 index 12036cd6db6..00000000000 --- a/tests/cases/fourslash_old/signatureHelpInCompleteGenericsCall.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// - -////function foo(x: number, callback: (x: T) => number) { -////} -////foo(/*1*/ - -goTo.marker('1'); -verify.currentSignatureHelpIs("foo(x: number, callback: (x: T) => number): void"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles.ts b/tests/cases/fourslash_old/signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles.ts deleted file mode 100644 index 2339af02529..00000000000 --- a/tests/cases/fourslash_old/signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles.ts +++ /dev/null @@ -1,14 +0,0 @@ -/// - -// @Filename: signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles_file0.ts -////declare function fn(x: string, y: number); - -// @Filename: signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles_file1.ts -////declare function fn(x: string); - -// @Filename: signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles_file2.ts -////fn(/*1*/ - -diagnostics.setEditValidation(IncrementalEditValidation.None); -goTo.marker('1'); -verify.signatureHelpCountIs(2); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpInIncompleteInvocationExpression.ts b/tests/cases/fourslash_old/signatureHelpInIncompleteInvocationExpression.ts deleted file mode 100644 index 2e097b2a76a..00000000000 --- a/tests/cases/fourslash_old/signatureHelpInIncompleteInvocationExpression.ts +++ /dev/null @@ -1,19 +0,0 @@ -/// - -/////** -//// * Returns the substring at the specified location within a String object. -//// * @param start The zero-based index integer indicating the beginning of the substring. -//// * @param end Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. -//// * If end is omitted, the characters from start through the end of the original string are returned. -//// */ -////function foo(start: number, end?: number) { -//// return ""; -////} -//// -////foo(/*1*/ -goTo.marker('1'); -verify.currentParameterHelpArgumentDocCommentIs("The zero-based index integer indicating the beginning of the substring."); -edit.insert("10,"); -verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned."); -edit.insert(" "); -verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned."); diff --git a/tests/cases/fourslash_old/signatureHelpInParenthetical.ts b/tests/cases/fourslash_old/signatureHelpInParenthetical.ts deleted file mode 100644 index 0628d904fdc..00000000000 --- a/tests/cases/fourslash_old/signatureHelpInParenthetical.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// - -//// class base { constructor (public n: number, public y: string) { } } -//// (new base(/**/ - -goTo.marker(); -verify.currentParameterHelpArgumentNameIs('n'); -edit.insert('0, '); -verify.currentParameterHelpArgumentNameIs('y'); diff --git a/tests/cases/fourslash_old/signatureHelpIncompleteCalls.ts b/tests/cases/fourslash_old/signatureHelpIncompleteCalls.ts deleted file mode 100644 index e73217b1d8c..00000000000 --- a/tests/cases/fourslash_old/signatureHelpIncompleteCalls.ts +++ /dev/null @@ -1,31 +0,0 @@ -/// - -////module IncompleteCalls { -//// class Foo { -//// public f1() { } -//// public f2(n: number): number { return 0; } -//// public f3(n: number, s: string) : string { return ""; } -//// } -//// var x = new Foo(); -//// x.f1(); -//// x.f2(5); -//// x.f3(5, ""); -//// x.f1(/*incompleteCalls1*/ -//// x.f2(5,/*incompleteCalls2*/ -//// x.f3(5,/*incompleteCalls3*/ -////} - -goTo.marker('incompleteCalls1'); -verify.currentSignatureHelpIs("f1(): void"); -verify.currentSignatureParamterCountIs(0); - -goTo.marker('incompleteCalls2'); -verify.currentSignatureParamterCountIs(1); -verify.currentSignatureHelpIs("f2(n: number): number"); -goTo.marker('incompleteCalls3'); -verify.currentSignatureParamterCountIs(2); -verify.currentSignatureHelpIs("f3(n: number, s: string): string"); - -verify.currentParameterHelpArgumentNameIs("s"); -verify.currentParameterSpanIs("s: string"); - diff --git a/tests/cases/fourslash_old/signatureHelpNoArguments.ts b/tests/cases/fourslash_old/signatureHelpNoArguments.ts deleted file mode 100644 index 16a1896a741..00000000000 --- a/tests/cases/fourslash_old/signatureHelpNoArguments.ts +++ /dev/null @@ -1,12 +0,0 @@ -/// - - -////function foo(n: number): string { -////} -//// -////foo(/**/ - -goTo.marker(); -verify.currentSignatureHelpIs("foo(n: number): string"); -verify.currentParameterHelpArgumentNameIs("n"); -verify.currentParameterSpanIs("n: number"); diff --git a/tests/cases/fourslash_old/signatureHelpObjectLiteral.ts b/tests/cases/fourslash_old/signatureHelpObjectLiteral.ts deleted file mode 100644 index cbc5df697b9..00000000000 --- a/tests/cases/fourslash_old/signatureHelpObjectLiteral.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////var objectLiteral = { n: 5, s: "", f: (a: number, b: string) => "" }; -////objectLiteral.f(/*objectLiteral1*/4, /*objectLiteral2*/""); - -goTo.marker('objectLiteral1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureParamterCountIs(2); -verify.currentSignatureHelpIs('f(a: number, b: string): string'); - -verify.currentParameterHelpArgumentNameIs("a"); -verify.currentParameterSpanIs("a: number"); - -goTo.marker('objectLiteral2'); -verify.currentSignatureHelpIs('f(a: number, b: string): string'); -verify.currentParameterHelpArgumentNameIs("b"); -verify.currentParameterSpanIs("b: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpOnOverloadOnConst.ts b/tests/cases/fourslash_old/signatureHelpOnOverloadOnConst.ts deleted file mode 100644 index 8edd0617d70..00000000000 --- a/tests/cases/fourslash_old/signatureHelpOnOverloadOnConst.ts +++ /dev/null @@ -1,26 +0,0 @@ -/// - -////function x1(x: 'hi'); -////function x1(y: 'bye'); -////function x1(z: string); -////function x1(a: any) { -////} -//// -////x1(''/*1*/); -////x1('hi'/*2*/); -////x1('bye'/*3*/); - -goTo.marker('1'); -verify.signatureHelpCountIs(3); -verify.currentParameterHelpArgumentNameIs("z"); -verify.currentParameterSpanIs("z: string"); - -goTo.marker('2'); -verify.signatureHelpCountIs(3); -verify.currentParameterHelpArgumentNameIs("x"); -verify.currentParameterSpanIs("x: 'hi'"); - -goTo.marker('3'); -verify.signatureHelpCountIs(3); -verify.currentParameterHelpArgumentNameIs("y"); -verify.currentParameterSpanIs("y: 'bye'"); diff --git a/tests/cases/fourslash_old/signatureHelpOnOverloads.ts b/tests/cases/fourslash_old/signatureHelpOnOverloads.ts deleted file mode 100644 index 9712c9dc301..00000000000 --- a/tests/cases/fourslash_old/signatureHelpOnOverloads.ts +++ /dev/null @@ -1,18 +0,0 @@ -/// - -////declare function fn(x: string); -////declare function fn(x: string, y: number); -////fn(/*1*/ - -goTo.marker('1'); -verify.signatureHelpCountIs(2); -verify.currentSignatureHelpIs("fn(x: string): any"); -verify.currentParameterHelpArgumentNameIs("x"); -verify.currentParameterSpanIs("x: string"); - -edit.insert("'',"); - -verify.signatureHelpCountIs(2); -verify.currentSignatureHelpIs("fn(x: string, y: number): any"); -verify.currentParameterHelpArgumentNameIs("y"); -verify.currentParameterSpanIs("y: number"); diff --git a/tests/cases/fourslash_old/signatureHelpOnSuperWhenMembersAreNotResolved.ts b/tests/cases/fourslash_old/signatureHelpOnSuperWhenMembersAreNotResolved.ts deleted file mode 100644 index 5613ca71a70..00000000000 --- a/tests/cases/fourslash_old/signatureHelpOnSuperWhenMembersAreNotResolved.ts +++ /dev/null @@ -1,14 +0,0 @@ -/// - -////class A { } -////class B extends A { constructor(public x: string) { } } -////class C extends B { -//// constructor() { -//// /*1*/ -//// } -////} - -diagnostics.setEditValidation(IncrementalEditValidation.None); -goTo.marker("1"); -edit.insert("super("); -verify.currentSignatureHelpIs("B(x: string): B"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpSimpleConstructorCall.ts b/tests/cases/fourslash_old/signatureHelpSimpleConstructorCall.ts deleted file mode 100644 index 81af0422f9a..00000000000 --- a/tests/cases/fourslash_old/signatureHelpSimpleConstructorCall.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////class ConstructorCall { -//// constructor(str: string, num: number) { -//// } -////} -////var x = new ConstructorCall(/*constructorCall1*/1,/*constructorCall2*/2); - -goTo.marker('constructorCall1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureHelpIs("ConstructorCall(str: string, num: number): ConstructorCall"); -verify.currentParameterHelpArgumentNameIs("str"); -verify.currentParameterSpanIs("str: string"); -goTo.marker('constructorCall2'); -verify.currentSignatureHelpIs("ConstructorCall(str: string, num: number): ConstructorCall"); -verify.currentParameterHelpArgumentNameIs("num"); -verify.currentParameterSpanIs("num: number"); diff --git a/tests/cases/fourslash_old/signatureHelpSimpleFunctionCall.ts b/tests/cases/fourslash_old/signatureHelpSimpleFunctionCall.ts deleted file mode 100644 index 6e5817ad90d..00000000000 --- a/tests/cases/fourslash_old/signatureHelpSimpleFunctionCall.ts +++ /dev/null @@ -1,19 +0,0 @@ -/// - -////// Simple function test -////function functionCall(str: string, num: number) { -////} -////functionCall(/*functionCall1*/); -////functionCall("", /*functionCall2*/1); - - -goTo.marker('functionCall1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureHelpIs("functionCall(str: string, num: number): void"); -verify.currentParameterHelpArgumentNameIs("str"); -verify.currentParameterSpanIs("str: string"); -goTo.marker('functionCall2'); -verify.currentSignatureHelpIs("functionCall(str: string, num: number): void"); -verify.currentParameterHelpArgumentNameIs("num"); -verify.currentParameterSpanIs("num: number"); - diff --git a/tests/cases/fourslash_old/signatureHelpSimpleSuperCall.ts b/tests/cases/fourslash_old/signatureHelpSimpleSuperCall.ts deleted file mode 100644 index ff8913a6b04..00000000000 --- a/tests/cases/fourslash_old/signatureHelpSimpleSuperCall.ts +++ /dev/null @@ -1,20 +0,0 @@ -/// - -////class SuperCallBase { -//// constructor(b: boolean) { -//// } -////} -////class SuperCall extends SuperCallBase { -//// constructor() { -//// super(/*superCall*/); -//// } -////} - -// this line triggers a semantic/syntactic error check, remove line when 788570 is fixed -edit.insert(''); - -goTo.marker('superCall'); -verify.signatureHelpCountIs(1); -verify.currentSignatureHelpIs("SuperCallBase(b: boolean): SuperCallBase"); -verify.currentParameterHelpArgumentNameIs("b"); -verify.currentParameterSpanIs("b: boolean"); diff --git a/tests/cases/fourslash_old/signatureHelpSuperConstructorOverload.ts b/tests/cases/fourslash_old/signatureHelpSuperConstructorOverload.ts deleted file mode 100644 index 1be8c3202a1..00000000000 --- a/tests/cases/fourslash_old/signatureHelpSuperConstructorOverload.ts +++ /dev/null @@ -1,28 +0,0 @@ -/// - -////class SuperOverloadlBase { -//// constructor(); -//// constructor(test: string); -//// constructor(test?: string) { -//// } -////} -////class SuperOverLoad1 extends SuperOverloadlBase { -//// constructor() { -//// super(/*superOverload1*/); -//// } -////} -////class SuperOverLoad2 extends SuperOverloadlBase { -//// constructor() { -//// super(""/*superOverload2*/); -//// } -////} - -goTo.marker('superOverload1'); -verify.signatureHelpCountIs(2); -verify.currentSignatureHelpIs("SuperOverloadlBase(): SuperOverloadlBase"); -verify.currentSignatureParamterCountIs(0); -goTo.marker('superOverload2'); -verify.currentSignatureParamterCountIs(1); -verify.currentSignatureHelpIs("SuperOverloadlBase(test: string): SuperOverloadlBase"); -verify.currentParameterHelpArgumentNameIs("test"); -verify.currentParameterSpanIs("test: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpWhenEditingCallExpression.ts b/tests/cases/fourslash_old/signatureHelpWhenEditingCallExpression.ts deleted file mode 100644 index 61e51d0a4e7..00000000000 --- a/tests/cases/fourslash_old/signatureHelpWhenEditingCallExpression.ts +++ /dev/null @@ -1,30 +0,0 @@ -/// - -/////** -//// * Returns the substring at the specified location within a String object. -//// * @param start The zero-based index integer indicating the beginning of the substring. -//// * @param end Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. -//// * If end is omitted, the characters from start through the end of the original string are returned. -//// */ -////function foo(start: number, end?: number) { -//// return ""; -////} -//// -////fo/*1*/ -goTo.marker('1'); -verify.not.signatureHelpPresent(); -edit.insert("o"); -verify.not.signatureHelpPresent(); -edit.insert("("); -verify.currentParameterHelpArgumentDocCommentIs("The zero-based index integer indicating the beginning of the substring."); -edit.insert("10,"); -verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned."); -edit.insert(" "); -verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned."); -edit.insert(", "); -edit.backspace(3); -verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned."); -edit.insert("12"); -verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned."); -edit.insert(")"); -verify.not.signatureHelpPresent(); diff --git a/tests/cases/fourslash_old/staticGenericOverloads1.ts b/tests/cases/fourslash_old/staticGenericOverloads1.ts deleted file mode 100644 index 141d88eed4a..00000000000 --- a/tests/cases/fourslash_old/staticGenericOverloads1.ts +++ /dev/null @@ -1,22 +0,0 @@ -/// - -////class A { -//// static B(v: A): A; -//// static B(v: S): A; -//// static B(v: any): A { -//// return null; -//// } -////} - -////var a = new A(); -////A.B(/**/ - -goTo.marker(); -verify.signatureHelpCountIs(2); -edit.insert('a'); -verify.signatureHelpCountIs(2); -verify.currentSignatureHelpIs('B(v: A): A') -edit.insert('); A.B('); -verify.currentSignatureHelpIs('B(v: A): A'); -edit.insert('a'); -verify.currentSignatureHelpIs('B(v: A): A') diff --git a/tests/cases/fourslash_old/todoComments1.ts b/tests/cases/fourslash_old/todoComments1.ts deleted file mode 100644 index 900b4694c6b..00000000000 --- a/tests/cases/fourslash_old/todoComments1.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// // [|TODO|] -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments10.ts b/tests/cases/fourslash_old/todoComments10.ts deleted file mode 100644 index 26ee7a40141..00000000000 --- a/tests/cases/fourslash_old/todoComments10.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|todo 1|] -//// [|hack 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments11.ts b/tests/cases/fourslash_old/todoComments11.ts deleted file mode 100644 index 976368315d4..00000000000 --- a/tests/cases/fourslash_old/todoComments11.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|TODO(jason) 1|] -//// [|HACK 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO(jason)", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments12.ts b/tests/cases/fourslash_old/todoComments12.ts deleted file mode 100644 index d9cd3dea4db..00000000000 --- a/tests/cases/fourslash_old/todoComments12.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|TODO(jason) 1|] -//// [|HACK 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["HACK", "TODO(jason)"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments13.ts b/tests/cases/fourslash_old/todoComments13.ts deleted file mode 100644 index 93147b30e47..00000000000 --- a/tests/cases/fourslash_old/todoComments13.ts +++ /dev/null @@ -1,4 +0,0 @@ -//// TODO - -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments14.ts b/tests/cases/fourslash_old/todoComments14.ts deleted file mode 100644 index 46f8f48fe30..00000000000 --- a/tests/cases/fourslash_old/todoComments14.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// BAR // [|TODO|] -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments15.ts b/tests/cases/fourslash_old/todoComments15.ts deleted file mode 100644 index 22cee54d0fc..00000000000 --- a/tests/cases/fourslash_old/todoComments15.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// "// HACK 1"; -debugger; -verify.todoCommentsInCurrentFile(["TODO(jason)", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments16.ts b/tests/cases/fourslash_old/todoComments16.ts deleted file mode 100644 index bbdeac0c5e8..00000000000 --- a/tests/cases/fourslash_old/todoComments16.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// //// [|HACK 1|] -debugger; -verify.todoCommentsInCurrentFile(["TODO(jason)", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments17.ts b/tests/cases/fourslash_old/todoComments17.ts deleted file mode 100644 index 52316941602..00000000000 --- a/tests/cases/fourslash_old/todoComments17.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// /**** [|HACK 1 |]*/ a -debugger; -verify.todoCommentsInCurrentFile(["TODO(jason)", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments2.ts b/tests/cases/fourslash_old/todoComments2.ts deleted file mode 100644 index b58b0fda7a7..00000000000 --- a/tests/cases/fourslash_old/todoComments2.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// // not TODO -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments3.ts b/tests/cases/fourslash_old/todoComments3.ts deleted file mode 100644 index 62eb02642e9..00000000000 --- a/tests/cases/fourslash_old/todoComments3.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// // [|TODO with stuff|] -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments4.ts b/tests/cases/fourslash_old/todoComments4.ts deleted file mode 100644 index c9ec94785f8..00000000000 --- a/tests/cases/fourslash_old/todoComments4.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// // TODOnomatch -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments5.ts b/tests/cases/fourslash_old/todoComments5.ts deleted file mode 100644 index 157ac162a8c..00000000000 --- a/tests/cases/fourslash_old/todoComments5.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|TODO 1|] -//// [|TODO 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments6.ts b/tests/cases/fourslash_old/todoComments6.ts deleted file mode 100644 index 0d2692511cb..00000000000 --- a/tests/cases/fourslash_old/todoComments6.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// * [|TODO 1|] -//// * [|TODO 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments7.ts b/tests/cases/fourslash_old/todoComments7.ts deleted file mode 100644 index ffb5bcf6603..00000000000 --- a/tests/cases/fourslash_old/todoComments7.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|TODO 1|] -//// [|HACK 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments8.ts b/tests/cases/fourslash_old/todoComments8.ts deleted file mode 100644 index 5d53b7b57c2..00000000000 --- a/tests/cases/fourslash_old/todoComments8.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|HACK 1|] -//// [|TODO 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments9.ts b/tests/cases/fourslash_old/todoComments9.ts deleted file mode 100644 index 36cba71cecf..00000000000 --- a/tests/cases/fourslash_old/todoComments9.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|TODO HACK|] -//// [|HACK TODO|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO", "HACK"]); \ No newline at end of file diff --git a/tests/cases/project/referenceResolutionRelativePaths.json b/tests/cases/project/referenceResolutionRelativePaths.json new file mode 100644 index 00000000000..f49fd03b224 --- /dev/null +++ b/tests/cases/project/referenceResolutionRelativePaths.json @@ -0,0 +1,9 @@ +{ + "scenario": "referenceResolution1_FromFooFolder", + "projectRoot": "tests/cases/projects/ReferenceResolution/src/ts/foo", + "inputFiles": [ + "foo.ts" + ], + "declaration": true, + "baselineCheck": true +} \ No newline at end of file diff --git a/tests/cases/project/referenceResolutionRelativePathsFromRootDirectory.json b/tests/cases/project/referenceResolutionRelativePathsFromRootDirectory.json new file mode 100644 index 00000000000..392d34a67ad --- /dev/null +++ b/tests/cases/project/referenceResolutionRelativePathsFromRootDirectory.json @@ -0,0 +1,9 @@ +{ + "scenario": "referenceResolution1_FromRootDirectory", + "projectRoot": "tests/cases/projects/ReferenceResolution", + "inputFiles": [ + "src/ts/foo/foo.ts" + ], + "declaration": true, + "baselineCheck": true +} \ No newline at end of file diff --git a/tests/cases/project/referenceResolutionRelativePathsNoResolve.json b/tests/cases/project/referenceResolutionRelativePathsNoResolve.json new file mode 100644 index 00000000000..962f9d1a098 --- /dev/null +++ b/tests/cases/project/referenceResolutionRelativePathsNoResolve.json @@ -0,0 +1,11 @@ +{ + "scenario": "referenceResolution1_FromFooFolder_NoResolve", + "projectRoot": "tests/cases/projects/ReferenceResolution/src/ts/foo", + "inputFiles": [ + "foo.ts", + "../../../bar/bar.ts" + ], + "noResolve": true, + "declaration": true, + "baselineCheck": true +} \ No newline at end of file diff --git a/tests/cases/project/referenceResolutionRelativePathsRelativeToRootDirectory.json b/tests/cases/project/referenceResolutionRelativePathsRelativeToRootDirectory.json new file mode 100644 index 00000000000..ba8f2da83e3 --- /dev/null +++ b/tests/cases/project/referenceResolutionRelativePathsRelativeToRootDirectory.json @@ -0,0 +1,9 @@ +{ + "scenario": "referenceResolution1_FromFooFolder_RelativepathToFoo", + "projectRoot": "tests/cases/projects/ReferenceResolution/src/ts/foo", + "inputFiles": [ + "../../../src/ts/foo/foo.ts" + ], + "declaration": true, + "baselineCheck": true +} \ No newline at end of file diff --git a/tests/cases/project/referenceResolutionSameFileTwice.json b/tests/cases/project/referenceResolutionSameFileTwice.json new file mode 100644 index 00000000000..00a8f6e103e --- /dev/null +++ b/tests/cases/project/referenceResolutionSameFileTwice.json @@ -0,0 +1,10 @@ +{ + "scenario": "referenceResolutionSameFileTwice", + "projectRoot": "tests/cases/projects/ReferenceResolution/", + "inputFiles": [ + "test.ts", + "../ReferenceResolution/test.ts" + ], + "declaration": true, + "baselineCheck": true +} \ No newline at end of file diff --git a/tests/cases/project/referenceResolutionSameFileTwiceNoResolve.json b/tests/cases/project/referenceResolutionSameFileTwiceNoResolve.json new file mode 100644 index 00000000000..8c77bd038cf --- /dev/null +++ b/tests/cases/project/referenceResolutionSameFileTwiceNoResolve.json @@ -0,0 +1,11 @@ +{ + "scenario": "referenceResolutionSameFileTwice_NoResolve", + "projectRoot": "tests/cases/projects/ReferenceResolution/", + "inputFiles": [ + "test.ts", + "../ReferenceResolution/test.ts" + ], + "noResolve": true, + "declaration": true, + "baselineCheck": true +} \ No newline at end of file diff --git a/tests/cases/projects/ReferenceResolution/bar/bar.ts b/tests/cases/projects/ReferenceResolution/bar/bar.ts new file mode 100644 index 00000000000..9fd38a32d64 --- /dev/null +++ b/tests/cases/projects/ReferenceResolution/bar/bar.ts @@ -0,0 +1,4 @@ +/// +// This is bar.ts +class bar { +} \ No newline at end of file diff --git a/tests/cases/projects/ReferenceResolution/src/ts/foo/foo.ts b/tests/cases/projects/ReferenceResolution/src/ts/foo/foo.ts new file mode 100644 index 00000000000..2ea78e70fa4 --- /dev/null +++ b/tests/cases/projects/ReferenceResolution/src/ts/foo/foo.ts @@ -0,0 +1,4 @@ +/// + +class foo { +} \ No newline at end of file diff --git a/tests/cases/projects/ReferenceResolution/test.ts b/tests/cases/projects/ReferenceResolution/test.ts new file mode 100644 index 00000000000..212b620415e --- /dev/null +++ b/tests/cases/projects/ReferenceResolution/test.ts @@ -0,0 +1,2 @@ +class test { +} \ No newline at end of file diff --git a/tests/cases/unittests/services/documentRegistry.ts b/tests/cases/unittests/services/documentRegistry.ts index 88503149715..044aea0095d 100644 --- a/tests/cases/unittests/services/documentRegistry.ts +++ b/tests/cases/unittests/services/documentRegistry.ts @@ -5,8 +5,8 @@ describe("DocumentRegistry", () => { var documentRegistry = ts.createDocumentRegistry(); var defaultCompilerOptions = ts.getDefaultCompilerOptions(); - var f1 = documentRegistry.acquireDocument("file1.ts", defaultCompilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), "1", false); - var f2 = documentRegistry.acquireDocument("file1.ts", defaultCompilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), "1", false); + var f1 = documentRegistry.acquireDocument("file1.ts", defaultCompilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), "1", false); + var f2 = documentRegistry.acquireDocument("file1.ts", defaultCompilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), "1", false); assert(f1 === f2, "DocumentRegistry should return the same document for the same name"); }); @@ -17,21 +17,21 @@ describe("DocumentRegistry", () => { // change compilation setting that doesn't affect parsing - should have the same document compilerOptions.declaration = true; - var f1 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), "1", false); + var f1 = documentRegistry.acquireDocument("file1.ts", compilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), "1", false); compilerOptions.declaration = false; - var f2 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), "1", false); + var f2 = documentRegistry.acquireDocument("file1.ts", compilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), "1", false); assert(f1 === f2, "Expected to have the same document instance"); // change value of compilation setting that is used during production of AST - new document is required compilerOptions.target = ts.ScriptTarget.ES3; - var f3 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), "1", false); + var f3 = documentRegistry.acquireDocument("file1.ts", compilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), "1", false); assert(f1 !== f3, "Changed target: Expected to have different instances of document"); compilerOptions.module = ts.ModuleKind.CommonJS; - var f4 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), "1", false); + var f4 = documentRegistry.acquireDocument("file1.ts", compilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), "1", false); assert(f1 !== f4, "Changed module: Expected to have different instances of document"); });