diff --git a/Jakefile b/Jakefile index 64394c2d60e..109398b8852 100644 --- a/Jakefile +++ b/Jakefile @@ -133,7 +133,7 @@ function concatenateFiles(destinationFile, sourceFiles) { fs.renameSync(temp, destinationFile); } -var useDebugMode = false; +var useDebugMode = true; var generateDeclarations = false; var host = (process.env.host || process.env.TYPESCRIPT_HOST || "node"); var compilerFilename = "tsc.js"; @@ -148,15 +148,16 @@ var compilerFilename = "tsc.js"; function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOutFile) { file(outFile, prereqs, function() { var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory; - var options = "-removeComments --module commonjs -noImplicitAny "; //" -propagateEnumConstants " + var options = "-removeComments --module commonjs -noImplicitAny "; if (generateDeclarations) { options += "--declaration "; } + + if (useDebugMode) { + options += "--preserveConstEnums "; + } var cmd = host + " " + dir + compilerFilename + " " + options + " "; - if (useDebugMode) { - cmd = cmd + " " + path.join(harnessDirectory, "external/es5compat.ts") + " " + path.join(harnessDirectory, "external/json2.ts") + " "; - } cmd = cmd + sources.join(" ") + (!noOutFile ? " -out " + outFile : ""); if (useDebugMode) { cmd = cmd + " -sourcemap -mapRoot file:///" + path.resolve(path.dirname(outFile)); @@ -258,12 +259,11 @@ task("local", ["generate-diagnostics", "lib", tscFile, servicesFile]); // Local target to build the compiler and services -desc("Emit debug mode files with sourcemaps"); -task("debug", function() { - useDebugMode = true; +desc("Sets release mode flag"); +task("release", function() { + useDebugMode = false; }); - // Set the default task to "local" task("default", ["local"]); @@ -312,7 +312,7 @@ task("generate-spec", [specMd]) // Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory desc("Makes a new LKG out of the built js files"); -task("LKG", libraryTargets, function() { +task("LKG", ["clean", "release", "local"].concat(libraryTargets), function() { var expectedFiles = [tscFile, servicesFile].concat(libraryTargets); var missingFiles = expectedFiles.filter(function (f) { return !fs.existsSync(f); diff --git a/bin/tsc.js b/bin/tsc.js index 0b8dd882716..53e1047e852 100644 --- a/bin/tsc.js +++ b/bin/tsc.js @@ -134,7 +134,8 @@ var ts; 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." }, - Aliased_type_cannot_be_an_object_type_literal_Use_an_interface_declaration_instead: { code: 1158, category: 1 /* Error */, key: "Aliased type cannot be an object type literal. Use an interface declaration instead." }, + 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." }, @@ -282,6 +283,7 @@ var ts; 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}'." }, @@ -364,6 +366,12 @@ var ts; 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}" }, @@ -378,6 +386,7 @@ var ts; 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'" }, @@ -431,112 +440,112 @@ var ts; var ts; (function (ts) { var textToToken = { - "any": 105 /* AnyKeyword */, - "boolean": 106 /* BooleanKeyword */, - "break": 60 /* BreakKeyword */, - "case": 61 /* CaseKeyword */, - "catch": 62 /* CatchKeyword */, - "class": 63 /* ClassKeyword */, - "continue": 65 /* ContinueKeyword */, - "const": 64 /* ConstKeyword */, - "constructor": 107 /* ConstructorKeyword */, - "debugger": 66 /* DebuggerKeyword */, - "declare": 108 /* DeclareKeyword */, - "default": 67 /* DefaultKeyword */, - "delete": 68 /* DeleteKeyword */, - "do": 69 /* DoKeyword */, - "else": 70 /* ElseKeyword */, - "enum": 71 /* EnumKeyword */, - "export": 72 /* ExportKeyword */, - "extends": 73 /* ExtendsKeyword */, - "false": 74 /* FalseKeyword */, - "finally": 75 /* FinallyKeyword */, - "for": 76 /* ForKeyword */, - "function": 77 /* FunctionKeyword */, - "get": 109 /* GetKeyword */, - "if": 78 /* IfKeyword */, - "implements": 96 /* ImplementsKeyword */, - "import": 79 /* ImportKeyword */, - "in": 80 /* InKeyword */, - "instanceof": 81 /* InstanceOfKeyword */, - "interface": 97 /* InterfaceKeyword */, - "let": 98 /* LetKeyword */, - "module": 110 /* ModuleKeyword */, - "new": 82 /* NewKeyword */, - "null": 83 /* NullKeyword */, - "number": 112 /* NumberKeyword */, - "package": 99 /* PackageKeyword */, - "private": 100 /* PrivateKeyword */, - "protected": 101 /* ProtectedKeyword */, - "public": 102 /* PublicKeyword */, - "require": 111 /* RequireKeyword */, - "return": 84 /* ReturnKeyword */, - "set": 113 /* SetKeyword */, - "static": 103 /* StaticKeyword */, - "string": 114 /* StringKeyword */, - "super": 85 /* SuperKeyword */, - "switch": 86 /* SwitchKeyword */, - "this": 87 /* ThisKeyword */, - "throw": 88 /* ThrowKeyword */, - "true": 89 /* TrueKeyword */, - "try": 90 /* TryKeyword */, - "type": 115 /* TypeKeyword */, - "typeof": 91 /* TypeOfKeyword */, - "var": 92 /* VarKeyword */, - "void": 93 /* VoidKeyword */, - "while": 94 /* WhileKeyword */, - "with": 95 /* WithKeyword */, - "yield": 104 /* YieldKeyword */, - "{": 9 /* OpenBraceToken */, - "}": 10 /* CloseBraceToken */, - "(": 11 /* OpenParenToken */, - ")": 12 /* CloseParenToken */, - "[": 13 /* OpenBracketToken */, - "]": 14 /* CloseBracketToken */, - ".": 15 /* DotToken */, - "...": 16 /* DotDotDotToken */, - ";": 17 /* SemicolonToken */, - ",": 18 /* CommaToken */, - "<": 19 /* LessThanToken */, - ">": 20 /* GreaterThanToken */, - "<=": 21 /* LessThanEqualsToken */, - ">=": 22 /* GreaterThanEqualsToken */, - "==": 23 /* EqualsEqualsToken */, - "!=": 24 /* ExclamationEqualsToken */, - "===": 25 /* EqualsEqualsEqualsToken */, - "!==": 26 /* ExclamationEqualsEqualsToken */, - "=>": 27 /* EqualsGreaterThanToken */, - "+": 28 /* PlusToken */, - "-": 29 /* MinusToken */, - "*": 30 /* AsteriskToken */, - "/": 31 /* SlashToken */, - "%": 32 /* PercentToken */, - "++": 33 /* PlusPlusToken */, - "--": 34 /* MinusMinusToken */, - "<<": 35 /* LessThanLessThanToken */, - ">>": 36 /* GreaterThanGreaterThanToken */, - ">>>": 37 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 38 /* AmpersandToken */, - "|": 39 /* BarToken */, - "^": 40 /* CaretToken */, - "!": 41 /* ExclamationToken */, - "~": 42 /* TildeToken */, - "&&": 43 /* AmpersandAmpersandToken */, - "||": 44 /* BarBarToken */, - "?": 45 /* QuestionToken */, - ":": 46 /* ColonToken */, - "=": 47 /* EqualsToken */, - "+=": 48 /* PlusEqualsToken */, - "-=": 49 /* MinusEqualsToken */, - "*=": 50 /* AsteriskEqualsToken */, - "/=": 51 /* SlashEqualsToken */, - "%=": 52 /* PercentEqualsToken */, - "<<=": 53 /* LessThanLessThanEqualsToken */, - ">>=": 54 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 56 /* AmpersandEqualsToken */, - "|=": 57 /* BarEqualsToken */, - "^=": 58 /* CaretEqualsToken */ + "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,]; @@ -838,10 +847,10 @@ var ts; } return +(text.substring(start, pos)); } - function scanHexDigits(count, exact) { + function scanHexDigits(count, mustMatchCount) { var digits = 0; var value = 0; - while (digits < count || !exact) { + while (digits < count || !mustMatchCount) { var ch = text.charCodeAt(pos); if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { value = value * 16 + ch - 48 /* _0 */; @@ -881,61 +890,7 @@ var ts; } if (ch === 92 /* backslash */) { result += text.substring(start, pos); - pos++; - if (pos >= len) { - error(ts.Diagnostics.Unexpected_end_of_text); - break; - } - ch = text.charCodeAt(pos++); - switch (ch) { - case 48 /* _0 */: - result += "\0"; - break; - case 98 /* b */: - result += "\b"; - break; - case 116 /* t */: - result += "\t"; - break; - case 110 /* n */: - result += "\n"; - break; - case 118 /* v */: - result += "\v"; - break; - case 102 /* f */: - result += "\f"; - break; - case 114 /* r */: - result += "\r"; - break; - case 39 /* singleQuote */: - result += "\'"; - break; - case 34 /* doubleQuote */: - result += "\""; - break; - case 120 /* x */: - case 117 /* u */: - var ch = scanHexDigits(ch === 120 /* x */ ? 2 : 4, true); - if (ch >= 0) { - result += String.fromCharCode(ch); - } - else { - error(ts.Diagnostics.Hexadecimal_digit_expected); - } - break; - case 13 /* carriageReturn */: - if (pos < len && text.charCodeAt(pos) === 10 /* lineFeed */) - pos++; - break; - case 10 /* lineFeed */: - case 8232 /* lineSeparator */: - case 8233 /* paragraphSeparator */: - break; - default: - result += String.fromCharCode(ch); - } + result += scanEscapeSequence(); start = pos; continue; } @@ -948,6 +903,102 @@ var ts; } 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; @@ -991,7 +1042,7 @@ var ts; return token = textToToken[tokenValue]; } } - return token = 59 /* Identifier */; + return token = 63 /* Identifier */; } function scan() { startPos = pos; @@ -1036,64 +1087,66 @@ var ts; case 33 /* exclamation */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 26 /* ExclamationEqualsEqualsToken */; + return pos += 3, token = 30 /* ExclamationEqualsEqualsToken */; } - return pos += 2, token = 24 /* ExclamationEqualsToken */; + return pos += 2, token = 28 /* ExclamationEqualsToken */; } - return pos++, token = 41 /* ExclamationToken */; + 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 = 52 /* PercentEqualsToken */; + return pos += 2, token = 56 /* PercentEqualsToken */; } - return pos++, token = 32 /* PercentToken */; + return pos++, token = 36 /* PercentToken */; case 38 /* ampersand */: if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { - return pos += 2, token = 43 /* AmpersandAmpersandToken */; + return pos += 2, token = 47 /* AmpersandAmpersandToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 56 /* AmpersandEqualsToken */; + return pos += 2, token = 60 /* AmpersandEqualsToken */; } - return pos++, token = 38 /* AmpersandToken */; + return pos++, token = 42 /* AmpersandToken */; case 40 /* openParen */: - return pos++, token = 11 /* OpenParenToken */; + return pos++, token = 15 /* OpenParenToken */; case 41 /* closeParen */: - return pos++, token = 12 /* CloseParenToken */; + return pos++, token = 16 /* CloseParenToken */; case 42 /* asterisk */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 50 /* AsteriskEqualsToken */; + return pos += 2, token = 54 /* AsteriskEqualsToken */; } - return pos++, token = 30 /* AsteriskToken */; + return pos++, token = 34 /* AsteriskToken */; case 43 /* plus */: if (text.charCodeAt(pos + 1) === 43 /* plus */) { - return pos += 2, token = 33 /* PlusPlusToken */; + return pos += 2, token = 37 /* PlusPlusToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 48 /* PlusEqualsToken */; + return pos += 2, token = 52 /* PlusEqualsToken */; } - return pos++, token = 28 /* PlusToken */; + return pos++, token = 32 /* PlusToken */; case 44 /* comma */: - return pos++, token = 18 /* CommaToken */; + return pos++, token = 22 /* CommaToken */; case 45 /* minus */: if (text.charCodeAt(pos + 1) === 45 /* minus */) { - return pos += 2, token = 34 /* MinusMinusToken */; + return pos += 2, token = 38 /* MinusMinusToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 49 /* MinusEqualsToken */; + return pos += 2, token = 53 /* MinusEqualsToken */; } - return pos++, token = 29 /* MinusToken */; + 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 = 16 /* DotDotDotToken */; + return pos += 3, token = 20 /* DotDotDotToken */; } - return pos++, token = 15 /* DotToken */; + return pos++, token = 19 /* DotToken */; case 47 /* slash */: if (text.charCodeAt(pos + 1) === 47 /* slash */) { pos += 2; @@ -1142,9 +1195,9 @@ var ts; } } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 51 /* SlashEqualsToken */; + return pos += 2, token = 55 /* SlashEqualsToken */; } - return pos++, token = 31 /* SlashToken */; + 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; @@ -1172,58 +1225,58 @@ var ts; tokenValue = "" + scanNumber(); return token = 6 /* NumericLiteral */; case 58 /* colon */: - return pos++, token = 46 /* ColonToken */; + return pos++, token = 50 /* ColonToken */; case 59 /* semicolon */: - return pos++, token = 17 /* SemicolonToken */; + 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 = 53 /* LessThanLessThanEqualsToken */; + return pos += 3, token = 57 /* LessThanLessThanEqualsToken */; } - return pos += 2, token = 35 /* LessThanLessThanToken */; + return pos += 2, token = 39 /* LessThanLessThanToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 21 /* LessThanEqualsToken */; + return pos += 2, token = 25 /* LessThanEqualsToken */; } - return pos++, token = 19 /* LessThanToken */; + 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 = 25 /* EqualsEqualsEqualsToken */; + return pos += 3, token = 29 /* EqualsEqualsEqualsToken */; } - return pos += 2, token = 23 /* EqualsEqualsToken */; + return pos += 2, token = 27 /* EqualsEqualsToken */; } if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { - return pos += 2, token = 27 /* EqualsGreaterThanToken */; + return pos += 2, token = 31 /* EqualsGreaterThanToken */; } - return pos++, token = 47 /* EqualsToken */; + return pos++, token = 51 /* EqualsToken */; case 62 /* greaterThan */: - return pos++, token = 20 /* GreaterThanToken */; + return pos++, token = 24 /* GreaterThanToken */; case 63 /* question */: - return pos++, token = 45 /* QuestionToken */; + return pos++, token = 49 /* QuestionToken */; case 91 /* openBracket */: - return pos++, token = 13 /* OpenBracketToken */; + return pos++, token = 17 /* OpenBracketToken */; case 93 /* closeBracket */: - return pos++, token = 14 /* CloseBracketToken */; + return pos++, token = 18 /* CloseBracketToken */; case 94 /* caret */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 58 /* CaretEqualsToken */; + return pos += 2, token = 62 /* CaretEqualsToken */; } - return pos++, token = 40 /* CaretToken */; + return pos++, token = 44 /* CaretToken */; case 123 /* openBrace */: - return pos++, token = 9 /* OpenBraceToken */; + return pos++, token = 13 /* OpenBraceToken */; case 124 /* bar */: if (text.charCodeAt(pos + 1) === 124 /* bar */) { - return pos += 2, token = 44 /* BarBarToken */; + return pos += 2, token = 48 /* BarBarToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 57 /* BarEqualsToken */; + return pos += 2, token = 61 /* BarEqualsToken */; } - return pos++, token = 39 /* BarToken */; + return pos++, token = 43 /* BarToken */; case 125 /* closeBrace */: - return pos++, token = 10 /* CloseBraceToken */; + return pos++, token = 14 /* CloseBraceToken */; case 126 /* tilde */: - return pos++, token = 42 /* TildeToken */; + return pos++, token = 46 /* TildeToken */; case 92 /* backslash */: var ch = peekUnicodeEscape(); if (ch >= 0 && isIdentifierStart(ch)) { @@ -1259,27 +1312,27 @@ var ts; } } function reScanGreaterToken() { - if (token === 20 /* GreaterThanToken */) { + 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 = 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */; + return pos += 3, token = 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */; } - return pos += 2, token = 37 /* GreaterThanGreaterThanGreaterThanToken */; + return pos += 2, token = 41 /* GreaterThanGreaterThanGreaterThanToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 54 /* GreaterThanGreaterThanEqualsToken */; + return pos += 2, token = 58 /* GreaterThanGreaterThanEqualsToken */; } - return pos++, token = 36 /* GreaterThanGreaterThanToken */; + return pos++, token = 40 /* GreaterThanGreaterThanToken */; } if (text.charCodeAt(pos) === 61 /* equals */) { - return pos++, token = 22 /* GreaterThanEqualsToken */; + return pos++, token = 26 /* GreaterThanEqualsToken */; } } return token; } function reScanSlashToken() { - if (token === 31 /* SlashToken */ || token === 51 /* SlashEqualsToken */) { + if (token === 35 /* SlashToken */ || token === 55 /* SlashEqualsToken */) { var p = tokenPos + 1; var inEscape = false; var inCharacterClass = false; @@ -1318,6 +1371,11 @@ var ts; } 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; @@ -1357,10 +1415,11 @@ var ts; getTokenText: function () { return text.substring(tokenPos, pos); }, getTokenValue: function () { return tokenValue; }, hasPrecedingLineBreak: function () { return precedingLineBreak; }, - isIdentifier: function () { return token === 59 /* Identifier */ || token > ts.SyntaxKind.LastReservedWord; }, - isReservedWord: function () { return token >= ts.SyntaxKind.FirstReservedWord && token <= ts.SyntaxKind.LastReservedWord; }, + 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, @@ -1371,234 +1430,6 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - (function (SyntaxKind) { - SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown"; - SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken"; - SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia"; - SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia"; - SyntaxKind[SyntaxKind["NewLineTrivia"] = 4] = "NewLineTrivia"; - SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 5] = "WhitespaceTrivia"; - SyntaxKind[SyntaxKind["NumericLiteral"] = 6] = "NumericLiteral"; - SyntaxKind[SyntaxKind["StringLiteral"] = 7] = "StringLiteral"; - SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 8] = "RegularExpressionLiteral"; - SyntaxKind[SyntaxKind["OpenBraceToken"] = 9] = "OpenBraceToken"; - SyntaxKind[SyntaxKind["CloseBraceToken"] = 10] = "CloseBraceToken"; - SyntaxKind[SyntaxKind["OpenParenToken"] = 11] = "OpenParenToken"; - SyntaxKind[SyntaxKind["CloseParenToken"] = 12] = "CloseParenToken"; - SyntaxKind[SyntaxKind["OpenBracketToken"] = 13] = "OpenBracketToken"; - SyntaxKind[SyntaxKind["CloseBracketToken"] = 14] = "CloseBracketToken"; - SyntaxKind[SyntaxKind["DotToken"] = 15] = "DotToken"; - SyntaxKind[SyntaxKind["DotDotDotToken"] = 16] = "DotDotDotToken"; - SyntaxKind[SyntaxKind["SemicolonToken"] = 17] = "SemicolonToken"; - SyntaxKind[SyntaxKind["CommaToken"] = 18] = "CommaToken"; - SyntaxKind[SyntaxKind["LessThanToken"] = 19] = "LessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanToken"] = 20] = "GreaterThanToken"; - SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 21] = "LessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 22] = "GreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 23] = "EqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 24] = "ExclamationEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 25] = "EqualsEqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 26] = "ExclamationEqualsEqualsToken"; - SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 27] = "EqualsGreaterThanToken"; - SyntaxKind[SyntaxKind["PlusToken"] = 28] = "PlusToken"; - SyntaxKind[SyntaxKind["MinusToken"] = 29] = "MinusToken"; - SyntaxKind[SyntaxKind["AsteriskToken"] = 30] = "AsteriskToken"; - SyntaxKind[SyntaxKind["SlashToken"] = 31] = "SlashToken"; - SyntaxKind[SyntaxKind["PercentToken"] = 32] = "PercentToken"; - SyntaxKind[SyntaxKind["PlusPlusToken"] = 33] = "PlusPlusToken"; - SyntaxKind[SyntaxKind["MinusMinusToken"] = 34] = "MinusMinusToken"; - SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 35] = "LessThanLessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 36] = "GreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 37] = "GreaterThanGreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["AmpersandToken"] = 38] = "AmpersandToken"; - SyntaxKind[SyntaxKind["BarToken"] = 39] = "BarToken"; - SyntaxKind[SyntaxKind["CaretToken"] = 40] = "CaretToken"; - SyntaxKind[SyntaxKind["ExclamationToken"] = 41] = "ExclamationToken"; - SyntaxKind[SyntaxKind["TildeToken"] = 42] = "TildeToken"; - SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 43] = "AmpersandAmpersandToken"; - SyntaxKind[SyntaxKind["BarBarToken"] = 44] = "BarBarToken"; - SyntaxKind[SyntaxKind["QuestionToken"] = 45] = "QuestionToken"; - SyntaxKind[SyntaxKind["ColonToken"] = 46] = "ColonToken"; - SyntaxKind[SyntaxKind["EqualsToken"] = 47] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 48] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 49] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 50] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 51] = "SlashEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 52] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 53] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 54] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 55] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 56] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 57] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 58] = "CaretEqualsToken"; - SyntaxKind[SyntaxKind["Identifier"] = 59] = "Identifier"; - SyntaxKind[SyntaxKind["BreakKeyword"] = 60] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 61] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 62] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ClassKeyword"] = 63] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 64] = "ConstKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 65] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 66] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 67] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 68] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 69] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 70] = "ElseKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 71] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 72] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 73] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 74] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 75] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 76] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 77] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 78] = "IfKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 79] = "ImportKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 80] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 81] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 82] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 83] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 84] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 85] = "SuperKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 86] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 87] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 88] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 89] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 90] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 91] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 92] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 93] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 94] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 95] = "WithKeyword"; - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 96] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 97] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 98] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 99] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 100] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 101] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 102] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 103] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 104] = "YieldKeyword"; - SyntaxKind[SyntaxKind["AnyKeyword"] = 105] = "AnyKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 106] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 107] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 108] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 109] = "GetKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 110] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 111] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 112] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 113] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 114] = "StringKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 115] = "TypeKeyword"; - SyntaxKind[SyntaxKind["Missing"] = 116] = "Missing"; - SyntaxKind[SyntaxKind["QualifiedName"] = 117] = "QualifiedName"; - SyntaxKind[SyntaxKind["TypeParameter"] = 118] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 119] = "Parameter"; - SyntaxKind[SyntaxKind["Property"] = 120] = "Property"; - SyntaxKind[SyntaxKind["Method"] = 121] = "Method"; - SyntaxKind[SyntaxKind["Constructor"] = 122] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 123] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 124] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 125] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 126] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 127] = "IndexSignature"; - SyntaxKind[SyntaxKind["TypeReference"] = 128] = "TypeReference"; - SyntaxKind[SyntaxKind["TypeQuery"] = 129] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 130] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 131] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 132] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 133] = "UnionType"; - SyntaxKind[SyntaxKind["ParenType"] = 134] = "ParenType"; - SyntaxKind[SyntaxKind["ArrayLiteral"] = 135] = "ArrayLiteral"; - SyntaxKind[SyntaxKind["ObjectLiteral"] = 136] = "ObjectLiteral"; - SyntaxKind[SyntaxKind["PropertyAssignment"] = 137] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["PropertyAccess"] = 138] = "PropertyAccess"; - SyntaxKind[SyntaxKind["IndexedAccess"] = 139] = "IndexedAccess"; - SyntaxKind[SyntaxKind["CallExpression"] = 140] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 141] = "NewExpression"; - SyntaxKind[SyntaxKind["TypeAssertion"] = 142] = "TypeAssertion"; - SyntaxKind[SyntaxKind["ParenExpression"] = 143] = "ParenExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 144] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 145] = "ArrowFunction"; - SyntaxKind[SyntaxKind["PrefixOperator"] = 146] = "PrefixOperator"; - SyntaxKind[SyntaxKind["PostfixOperator"] = 147] = "PostfixOperator"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 148] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 149] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 150] = "OmittedExpression"; - SyntaxKind[SyntaxKind["Block"] = 151] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 152] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 153] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 154] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 155] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 156] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 157] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 158] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 159] = "ForInStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 160] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 161] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 162] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 163] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 164] = "SwitchStatement"; - SyntaxKind[SyntaxKind["CaseClause"] = 165] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 166] = "DefaultClause"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 167] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 168] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 169] = "TryStatement"; - SyntaxKind[SyntaxKind["TryBlock"] = 170] = "TryBlock"; - SyntaxKind[SyntaxKind["CatchBlock"] = 171] = "CatchBlock"; - SyntaxKind[SyntaxKind["FinallyBlock"] = 172] = "FinallyBlock"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 173] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 174] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 175] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["FunctionBlock"] = 176] = "FunctionBlock"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 177] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 178] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 179] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 180] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 181] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 182] = "ModuleBlock"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 183] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 184] = "ExportAssignment"; - SyntaxKind[SyntaxKind["EnumMember"] = 185] = "EnumMember"; - SyntaxKind[SyntaxKind["SourceFile"] = 186] = "SourceFile"; - SyntaxKind[SyntaxKind["Program"] = 187] = "Program"; - SyntaxKind[SyntaxKind["SyntaxList"] = 188] = "SyntaxList"; - SyntaxKind[SyntaxKind["Count"] = 189] = "Count"; - SyntaxKind[SyntaxKind["FirstAssignment"] = SyntaxKind.EqualsToken] = "FirstAssignment"; - SyntaxKind[SyntaxKind["LastAssignment"] = SyntaxKind.CaretEqualsToken] = "LastAssignment"; - SyntaxKind[SyntaxKind["FirstReservedWord"] = SyntaxKind.BreakKeyword] = "FirstReservedWord"; - SyntaxKind[SyntaxKind["LastReservedWord"] = SyntaxKind.WithKeyword] = "LastReservedWord"; - SyntaxKind[SyntaxKind["FirstKeyword"] = SyntaxKind.BreakKeyword] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.TypeKeyword] = "LastKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = SyntaxKind.ImplementsKeyword] = "FirstFutureReservedWord"; - SyntaxKind[SyntaxKind["LastFutureReservedWord"] = SyntaxKind.YieldKeyword] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = SyntaxKind.TypeReference] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = SyntaxKind.ParenType] = "LastTypeNode"; - SyntaxKind[SyntaxKind["FirstPunctuation"] = SyntaxKind.OpenBraceToken] = "FirstPunctuation"; - SyntaxKind[SyntaxKind["LastPunctuation"] = SyntaxKind.CaretEqualsToken] = "LastPunctuation"; - SyntaxKind[SyntaxKind["FirstToken"] = SyntaxKind.EndOfFileToken] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = SyntaxKind.TypeKeyword] = "LastToken"; - SyntaxKind[SyntaxKind["FirstTriviaToken"] = SyntaxKind.SingleLineCommentTrivia] = "FirstTriviaToken"; - SyntaxKind[SyntaxKind["LastTriviaToken"] = SyntaxKind.WhitespaceTrivia] = "LastTriviaToken"; - })(ts.SyntaxKind || (ts.SyntaxKind = {})); - var SyntaxKind = ts.SyntaxKind; - (function (NodeFlags) { - NodeFlags[NodeFlags["Export"] = 0x00000001] = "Export"; - NodeFlags[NodeFlags["Ambient"] = 0x00000002] = "Ambient"; - NodeFlags[NodeFlags["QuestionMark"] = 0x00000004] = "QuestionMark"; - NodeFlags[NodeFlags["Rest"] = 0x00000008] = "Rest"; - NodeFlags[NodeFlags["Public"] = 0x00000010] = "Public"; - NodeFlags[NodeFlags["Private"] = 0x00000020] = "Private"; - NodeFlags[NodeFlags["Protected"] = 0x00000040] = "Protected"; - NodeFlags[NodeFlags["Static"] = 0x00000080] = "Static"; - NodeFlags[NodeFlags["MultiLine"] = 0x00000100] = "MultiLine"; - NodeFlags[NodeFlags["Synthetic"] = 0x00000200] = "Synthetic"; - NodeFlags[NodeFlags["DeclarationFile"] = 0x00000400] = "DeclarationFile"; - NodeFlags[NodeFlags["Let"] = 0x00000800] = "Let"; - NodeFlags[NodeFlags["Const"] = 0x00001000] = "Const"; - NodeFlags[NodeFlags["Modifier"] = NodeFlags.Export | NodeFlags.Ambient | NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected | NodeFlags.Static] = "Modifier"; - NodeFlags[NodeFlags["AccessibilityModifier"] = NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected] = "AccessibilityModifier"; - NodeFlags[NodeFlags["BlockScoped"] = NodeFlags.Let | NodeFlags.Const] = "BlockScoped"; - })(ts.NodeFlags || (ts.NodeFlags = {})); - var NodeFlags = ts.NodeFlags; (function (EmitReturnStatus) { EmitReturnStatus[EmitReturnStatus["Succeeded"] = 0] = "Succeeded"; EmitReturnStatus[EmitReturnStatus["AllOutputGenerationSkipped"] = 1] = "AllOutputGenerationSkipped"; @@ -1608,284 +1439,12 @@ var ts; EmitReturnStatus[EmitReturnStatus["CompilerOptionsErrors"] = 5] = "CompilerOptionsErrors"; })(ts.EmitReturnStatus || (ts.EmitReturnStatus = {})); var EmitReturnStatus = ts.EmitReturnStatus; - (function (TypeFormatFlags) { - TypeFormatFlags[TypeFormatFlags["None"] = 0x00000000] = "None"; - TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 0x00000001] = "WriteArrayAsGenericType"; - TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 0x00000002] = "UseTypeOfFunction"; - TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 0x00000004] = "NoTruncation"; - TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 0x00000008] = "WriteArrowStyleSignature"; - TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 0x00000010] = "WriteOwnNameForAnyLike"; - TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 0x00000020] = "WriteTypeArgumentsOfSignature"; - TypeFormatFlags[TypeFormatFlags["InElementType"] = 0x00000040] = "InElementType"; - })(ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); - var TypeFormatFlags = ts.TypeFormatFlags; - (function (SymbolFormatFlags) { - SymbolFormatFlags[SymbolFormatFlags["None"] = 0x00000000] = "None"; - SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 0x00000001] = "WriteTypeParametersOrArguments"; - SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 0x00000002] = "UseOnlyExternalAliasing"; - })(ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {})); - var SymbolFormatFlags = ts.SymbolFormatFlags; - (function (SymbolAccessibility) { - SymbolAccessibility[SymbolAccessibility["Accessible"] = 0] = "Accessible"; - SymbolAccessibility[SymbolAccessibility["NotAccessible"] = 1] = "NotAccessible"; - SymbolAccessibility[SymbolAccessibility["CannotBeNamed"] = 2] = "CannotBeNamed"; - })(ts.SymbolAccessibility || (ts.SymbolAccessibility = {})); - var SymbolAccessibility = ts.SymbolAccessibility; - (function (SymbolFlags) { - SymbolFlags[SymbolFlags["FunctionScopedVariable"] = 0x00000001] = "FunctionScopedVariable"; - SymbolFlags[SymbolFlags["BlockScopedVariable"] = 0x00000002] = "BlockScopedVariable"; - SymbolFlags[SymbolFlags["Property"] = 0x00000004] = "Property"; - SymbolFlags[SymbolFlags["EnumMember"] = 0x00000008] = "EnumMember"; - SymbolFlags[SymbolFlags["Function"] = 0x00000010] = "Function"; - SymbolFlags[SymbolFlags["Class"] = 0x00000020] = "Class"; - SymbolFlags[SymbolFlags["Interface"] = 0x00000040] = "Interface"; - SymbolFlags[SymbolFlags["Enum"] = 0x00000080] = "Enum"; - SymbolFlags[SymbolFlags["ValueModule"] = 0x00000100] = "ValueModule"; - SymbolFlags[SymbolFlags["NamespaceModule"] = 0x00000200] = "NamespaceModule"; - SymbolFlags[SymbolFlags["TypeLiteral"] = 0x00000400] = "TypeLiteral"; - SymbolFlags[SymbolFlags["ObjectLiteral"] = 0x00000800] = "ObjectLiteral"; - SymbolFlags[SymbolFlags["Method"] = 0x00001000] = "Method"; - SymbolFlags[SymbolFlags["Constructor"] = 0x00002000] = "Constructor"; - SymbolFlags[SymbolFlags["GetAccessor"] = 0x00004000] = "GetAccessor"; - SymbolFlags[SymbolFlags["SetAccessor"] = 0x00008000] = "SetAccessor"; - SymbolFlags[SymbolFlags["CallSignature"] = 0x00010000] = "CallSignature"; - SymbolFlags[SymbolFlags["ConstructSignature"] = 0x00020000] = "ConstructSignature"; - SymbolFlags[SymbolFlags["IndexSignature"] = 0x00040000] = "IndexSignature"; - SymbolFlags[SymbolFlags["TypeParameter"] = 0x00080000] = "TypeParameter"; - SymbolFlags[SymbolFlags["TypeAlias"] = 0x00100000] = "TypeAlias"; - SymbolFlags[SymbolFlags["ExportValue"] = 0x00200000] = "ExportValue"; - SymbolFlags[SymbolFlags["ExportType"] = 0x00400000] = "ExportType"; - SymbolFlags[SymbolFlags["ExportNamespace"] = 0x00800000] = "ExportNamespace"; - SymbolFlags[SymbolFlags["Import"] = 0x01000000] = "Import"; - SymbolFlags[SymbolFlags["Instantiated"] = 0x02000000] = "Instantiated"; - SymbolFlags[SymbolFlags["Merged"] = 0x04000000] = "Merged"; - SymbolFlags[SymbolFlags["Transient"] = 0x08000000] = "Transient"; - SymbolFlags[SymbolFlags["Prototype"] = 0x10000000] = "Prototype"; - SymbolFlags[SymbolFlags["UnionProperty"] = 0x20000000] = "UnionProperty"; - SymbolFlags[SymbolFlags["Variable"] = SymbolFlags.FunctionScopedVariable | SymbolFlags.BlockScopedVariable] = "Variable"; - SymbolFlags[SymbolFlags["Value"] = SymbolFlags.Variable | SymbolFlags.Property | SymbolFlags.EnumMember | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule | SymbolFlags.Method | SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Value"; - SymbolFlags[SymbolFlags["Type"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral | SymbolFlags.TypeParameter | SymbolFlags.TypeAlias] = "Type"; - SymbolFlags[SymbolFlags["Namespace"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Namespace"; - SymbolFlags[SymbolFlags["Module"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Module"; - SymbolFlags[SymbolFlags["Accessor"] = SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Accessor"; - SymbolFlags[SymbolFlags["Signature"] = SymbolFlags.CallSignature | SymbolFlags.ConstructSignature | SymbolFlags.IndexSignature] = "Signature"; - SymbolFlags[SymbolFlags["FunctionScopedVariableExcludes"] = SymbolFlags.Value & ~SymbolFlags.FunctionScopedVariable] = "FunctionScopedVariableExcludes"; - SymbolFlags[SymbolFlags["BlockScopedVariableExcludes"] = SymbolFlags.Value] = "BlockScopedVariableExcludes"; - SymbolFlags[SymbolFlags["ParameterExcludes"] = SymbolFlags.Value] = "ParameterExcludes"; - SymbolFlags[SymbolFlags["PropertyExcludes"] = SymbolFlags.Value] = "PropertyExcludes"; - SymbolFlags[SymbolFlags["EnumMemberExcludes"] = SymbolFlags.Value] = "EnumMemberExcludes"; - SymbolFlags[SymbolFlags["FunctionExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.ValueModule)] = "FunctionExcludes"; - SymbolFlags[SymbolFlags["ClassExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~SymbolFlags.ValueModule] = "ClassExcludes"; - SymbolFlags[SymbolFlags["InterfaceExcludes"] = SymbolFlags.Type & ~SymbolFlags.Interface] = "InterfaceExcludes"; - SymbolFlags[SymbolFlags["EnumExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~(SymbolFlags.Enum | SymbolFlags.ValueModule)] = "EnumExcludes"; - SymbolFlags[SymbolFlags["ValueModuleExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)] = "ValueModuleExcludes"; - SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; - SymbolFlags[SymbolFlags["MethodExcludes"] = SymbolFlags.Value & ~SymbolFlags.Method] = "MethodExcludes"; - SymbolFlags[SymbolFlags["GetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.SetAccessor] = "GetAccessorExcludes"; - SymbolFlags[SymbolFlags["SetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.GetAccessor] = "SetAccessorExcludes"; - SymbolFlags[SymbolFlags["TypeParameterExcludes"] = SymbolFlags.Type & ~SymbolFlags.TypeParameter] = "TypeParameterExcludes"; - SymbolFlags[SymbolFlags["TypeAliasExcludes"] = SymbolFlags.Type] = "TypeAliasExcludes"; - SymbolFlags[SymbolFlags["ImportExcludes"] = SymbolFlags.Import] = "ImportExcludes"; - SymbolFlags[SymbolFlags["ModuleMember"] = SymbolFlags.Variable | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.Module | SymbolFlags.TypeAlias | SymbolFlags.Import] = "ModuleMember"; - SymbolFlags[SymbolFlags["ExportHasLocal"] = SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule] = "ExportHasLocal"; - SymbolFlags[SymbolFlags["HasLocals"] = SymbolFlags.Function | SymbolFlags.Module | SymbolFlags.Method | SymbolFlags.Constructor | SymbolFlags.Accessor | SymbolFlags.Signature] = "HasLocals"; - SymbolFlags[SymbolFlags["HasExports"] = SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.Module] = "HasExports"; - SymbolFlags[SymbolFlags["HasMembers"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral] = "HasMembers"; - SymbolFlags[SymbolFlags["IsContainer"] = SymbolFlags.HasLocals | SymbolFlags.HasExports | SymbolFlags.HasMembers] = "IsContainer"; - SymbolFlags[SymbolFlags["PropertyOrAccessor"] = SymbolFlags.Property | SymbolFlags.Accessor] = "PropertyOrAccessor"; - SymbolFlags[SymbolFlags["Export"] = SymbolFlags.ExportNamespace | SymbolFlags.ExportType | SymbolFlags.ExportValue] = "Export"; - })(ts.SymbolFlags || (ts.SymbolFlags = {})); - var SymbolFlags = ts.SymbolFlags; - (function (NodeCheckFlags) { - NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 0x00000001] = "TypeChecked"; - NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 0x00000002] = "LexicalThis"; - NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 0x00000004] = "CaptureThis"; - NodeCheckFlags[NodeCheckFlags["EmitExtends"] = 0x00000008] = "EmitExtends"; - NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 0x00000010] = "SuperInstance"; - NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 0x00000020] = "SuperStatic"; - NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 0x00000040] = "ContextChecked"; - NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 0x00000080] = "EnumValuesComputed"; - })(ts.NodeCheckFlags || (ts.NodeCheckFlags = {})); - var NodeCheckFlags = ts.NodeCheckFlags; - (function (TypeFlags) { - TypeFlags[TypeFlags["Any"] = 0x00000001] = "Any"; - TypeFlags[TypeFlags["String"] = 0x00000002] = "String"; - TypeFlags[TypeFlags["Number"] = 0x00000004] = "Number"; - TypeFlags[TypeFlags["Boolean"] = 0x00000008] = "Boolean"; - TypeFlags[TypeFlags["Void"] = 0x00000010] = "Void"; - TypeFlags[TypeFlags["Undefined"] = 0x00000020] = "Undefined"; - TypeFlags[TypeFlags["Null"] = 0x00000040] = "Null"; - TypeFlags[TypeFlags["Enum"] = 0x00000080] = "Enum"; - TypeFlags[TypeFlags["StringLiteral"] = 0x00000100] = "StringLiteral"; - TypeFlags[TypeFlags["TypeParameter"] = 0x00000200] = "TypeParameter"; - TypeFlags[TypeFlags["Class"] = 0x00000400] = "Class"; - TypeFlags[TypeFlags["Interface"] = 0x00000800] = "Interface"; - TypeFlags[TypeFlags["Reference"] = 0x00001000] = "Reference"; - TypeFlags[TypeFlags["Tuple"] = 0x00002000] = "Tuple"; - TypeFlags[TypeFlags["Union"] = 0x00004000] = "Union"; - TypeFlags[TypeFlags["Anonymous"] = 0x00008000] = "Anonymous"; - TypeFlags[TypeFlags["FromSignature"] = 0x00010000] = "FromSignature"; - TypeFlags[TypeFlags["Intrinsic"] = TypeFlags.Any | TypeFlags.String | TypeFlags.Number | TypeFlags.Boolean | TypeFlags.Void | TypeFlags.Undefined | TypeFlags.Null] = "Intrinsic"; - TypeFlags[TypeFlags["StringLike"] = TypeFlags.String | TypeFlags.StringLiteral] = "StringLike"; - TypeFlags[TypeFlags["NumberLike"] = TypeFlags.Number | TypeFlags.Enum] = "NumberLike"; - TypeFlags[TypeFlags["ObjectType"] = TypeFlags.Class | TypeFlags.Interface | TypeFlags.Reference | TypeFlags.Tuple | TypeFlags.Anonymous] = "ObjectType"; - TypeFlags[TypeFlags["Structured"] = TypeFlags.Any | TypeFlags.ObjectType | TypeFlags.Union | TypeFlags.TypeParameter] = "Structured"; - })(ts.TypeFlags || (ts.TypeFlags = {})); - var TypeFlags = ts.TypeFlags; - (function (SignatureKind) { - SignatureKind[SignatureKind["Call"] = 0] = "Call"; - SignatureKind[SignatureKind["Construct"] = 1] = "Construct"; - })(ts.SignatureKind || (ts.SignatureKind = {})); - var SignatureKind = ts.SignatureKind; - (function (IndexKind) { - IndexKind[IndexKind["String"] = 0] = "String"; - IndexKind[IndexKind["Number"] = 1] = "Number"; - })(ts.IndexKind || (ts.IndexKind = {})); - var IndexKind = ts.IndexKind; (function (DiagnosticCategory) { DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; })(ts.DiagnosticCategory || (ts.DiagnosticCategory = {})); var DiagnosticCategory = ts.DiagnosticCategory; - (function (ModuleKind) { - ModuleKind[ModuleKind["None"] = 0] = "None"; - ModuleKind[ModuleKind["CommonJS"] = 1] = "CommonJS"; - ModuleKind[ModuleKind["AMD"] = 2] = "AMD"; - })(ts.ModuleKind || (ts.ModuleKind = {})); - var ModuleKind = ts.ModuleKind; - (function (ScriptTarget) { - ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; - ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; - ScriptTarget[ScriptTarget["ES6"] = 2] = "ES6"; - ScriptTarget[ScriptTarget["Latest"] = ScriptTarget.ES6] = "Latest"; - })(ts.ScriptTarget || (ts.ScriptTarget = {})); - var ScriptTarget = ts.ScriptTarget; - (function (CharacterCodes) { - CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; - CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 0x7F] = "maxAsciiCharacter"; - CharacterCodes[CharacterCodes["lineFeed"] = 0x0A] = "lineFeed"; - CharacterCodes[CharacterCodes["carriageReturn"] = 0x0D] = "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["mathematicalSpace"] = 0x205F] = "mathematicalSpace"; - CharacterCodes[CharacterCodes["ogham"] = 0x1680] = "ogham"; - CharacterCodes[CharacterCodes["_"] = 0x5F] = "_"; - CharacterCodes[CharacterCodes["$"] = 0x24] = "$"; - CharacterCodes[CharacterCodes["_0"] = 0x30] = "_0"; - CharacterCodes[CharacterCodes["_1"] = 0x31] = "_1"; - CharacterCodes[CharacterCodes["_2"] = 0x32] = "_2"; - CharacterCodes[CharacterCodes["_3"] = 0x33] = "_3"; - CharacterCodes[CharacterCodes["_4"] = 0x34] = "_4"; - CharacterCodes[CharacterCodes["_5"] = 0x35] = "_5"; - CharacterCodes[CharacterCodes["_6"] = 0x36] = "_6"; - CharacterCodes[CharacterCodes["_7"] = 0x37] = "_7"; - CharacterCodes[CharacterCodes["_8"] = 0x38] = "_8"; - CharacterCodes[CharacterCodes["_9"] = 0x39] = "_9"; - CharacterCodes[CharacterCodes["a"] = 0x61] = "a"; - CharacterCodes[CharacterCodes["b"] = 0x62] = "b"; - CharacterCodes[CharacterCodes["c"] = 0x63] = "c"; - CharacterCodes[CharacterCodes["d"] = 0x64] = "d"; - CharacterCodes[CharacterCodes["e"] = 0x65] = "e"; - CharacterCodes[CharacterCodes["f"] = 0x66] = "f"; - CharacterCodes[CharacterCodes["g"] = 0x67] = "g"; - CharacterCodes[CharacterCodes["h"] = 0x68] = "h"; - CharacterCodes[CharacterCodes["i"] = 0x69] = "i"; - CharacterCodes[CharacterCodes["j"] = 0x6A] = "j"; - CharacterCodes[CharacterCodes["k"] = 0x6B] = "k"; - CharacterCodes[CharacterCodes["l"] = 0x6C] = "l"; - CharacterCodes[CharacterCodes["m"] = 0x6D] = "m"; - CharacterCodes[CharacterCodes["n"] = 0x6E] = "n"; - CharacterCodes[CharacterCodes["o"] = 0x6F] = "o"; - CharacterCodes[CharacterCodes["p"] = 0x70] = "p"; - CharacterCodes[CharacterCodes["q"] = 0x71] = "q"; - CharacterCodes[CharacterCodes["r"] = 0x72] = "r"; - CharacterCodes[CharacterCodes["s"] = 0x73] = "s"; - CharacterCodes[CharacterCodes["t"] = 0x74] = "t"; - CharacterCodes[CharacterCodes["u"] = 0x75] = "u"; - CharacterCodes[CharacterCodes["v"] = 0x76] = "v"; - CharacterCodes[CharacterCodes["w"] = 0x77] = "w"; - CharacterCodes[CharacterCodes["x"] = 0x78] = "x"; - CharacterCodes[CharacterCodes["y"] = 0x79] = "y"; - CharacterCodes[CharacterCodes["z"] = 0x7A] = "z"; - CharacterCodes[CharacterCodes["A"] = 0x41] = "A"; - CharacterCodes[CharacterCodes["B"] = 0x42] = "B"; - CharacterCodes[CharacterCodes["C"] = 0x43] = "C"; - CharacterCodes[CharacterCodes["D"] = 0x44] = "D"; - CharacterCodes[CharacterCodes["E"] = 0x45] = "E"; - CharacterCodes[CharacterCodes["F"] = 0x46] = "F"; - CharacterCodes[CharacterCodes["G"] = 0x47] = "G"; - CharacterCodes[CharacterCodes["H"] = 0x48] = "H"; - CharacterCodes[CharacterCodes["I"] = 0x49] = "I"; - CharacterCodes[CharacterCodes["J"] = 0x4A] = "J"; - CharacterCodes[CharacterCodes["K"] = 0x4B] = "K"; - CharacterCodes[CharacterCodes["L"] = 0x4C] = "L"; - CharacterCodes[CharacterCodes["M"] = 0x4D] = "M"; - CharacterCodes[CharacterCodes["N"] = 0x4E] = "N"; - CharacterCodes[CharacterCodes["O"] = 0x4F] = "O"; - CharacterCodes[CharacterCodes["P"] = 0x50] = "P"; - CharacterCodes[CharacterCodes["Q"] = 0x51] = "Q"; - CharacterCodes[CharacterCodes["R"] = 0x52] = "R"; - CharacterCodes[CharacterCodes["S"] = 0x53] = "S"; - CharacterCodes[CharacterCodes["T"] = 0x54] = "T"; - CharacterCodes[CharacterCodes["U"] = 0x55] = "U"; - CharacterCodes[CharacterCodes["V"] = 0x56] = "V"; - CharacterCodes[CharacterCodes["W"] = 0x57] = "W"; - CharacterCodes[CharacterCodes["X"] = 0x58] = "X"; - CharacterCodes[CharacterCodes["Y"] = 0x59] = "Y"; - CharacterCodes[CharacterCodes["Z"] = 0x5a] = "Z"; - CharacterCodes[CharacterCodes["ampersand"] = 0x26] = "ampersand"; - CharacterCodes[CharacterCodes["asterisk"] = 0x2A] = "asterisk"; - CharacterCodes[CharacterCodes["at"] = 0x40] = "at"; - CharacterCodes[CharacterCodes["backslash"] = 0x5C] = "backslash"; - CharacterCodes[CharacterCodes["bar"] = 0x7C] = "bar"; - CharacterCodes[CharacterCodes["caret"] = 0x5E] = "caret"; - CharacterCodes[CharacterCodes["closeBrace"] = 0x7D] = "closeBrace"; - CharacterCodes[CharacterCodes["closeBracket"] = 0x5D] = "closeBracket"; - CharacterCodes[CharacterCodes["closeParen"] = 0x29] = "closeParen"; - CharacterCodes[CharacterCodes["colon"] = 0x3A] = "colon"; - CharacterCodes[CharacterCodes["comma"] = 0x2C] = "comma"; - CharacterCodes[CharacterCodes["dot"] = 0x2E] = "dot"; - CharacterCodes[CharacterCodes["doubleQuote"] = 0x22] = "doubleQuote"; - CharacterCodes[CharacterCodes["equals"] = 0x3D] = "equals"; - CharacterCodes[CharacterCodes["exclamation"] = 0x21] = "exclamation"; - CharacterCodes[CharacterCodes["greaterThan"] = 0x3E] = "greaterThan"; - CharacterCodes[CharacterCodes["lessThan"] = 0x3C] = "lessThan"; - CharacterCodes[CharacterCodes["minus"] = 0x2D] = "minus"; - CharacterCodes[CharacterCodes["openBrace"] = 0x7B] = "openBrace"; - CharacterCodes[CharacterCodes["openBracket"] = 0x5B] = "openBracket"; - CharacterCodes[CharacterCodes["openParen"] = 0x28] = "openParen"; - CharacterCodes[CharacterCodes["percent"] = 0x25] = "percent"; - CharacterCodes[CharacterCodes["plus"] = 0x2B] = "plus"; - CharacterCodes[CharacterCodes["question"] = 0x3F] = "question"; - CharacterCodes[CharacterCodes["semicolon"] = 0x3B] = "semicolon"; - CharacterCodes[CharacterCodes["singleQuote"] = 0x27] = "singleQuote"; - CharacterCodes[CharacterCodes["slash"] = 0x2F] = "slash"; - CharacterCodes[CharacterCodes["tilde"] = 0x7E] = "tilde"; - CharacterCodes[CharacterCodes["backspace"] = 0x08] = "backspace"; - CharacterCodes[CharacterCodes["formFeed"] = 0x0C] = "formFeed"; - CharacterCodes[CharacterCodes["byteOrderMark"] = 0xFEFF] = "byteOrderMark"; - CharacterCodes[CharacterCodes["tab"] = 0x09] = "tab"; - CharacterCodes[CharacterCodes["verticalTab"] = 0x0B] = "verticalTab"; - })(ts.CharacterCodes || (ts.CharacterCodes = {})); - var CharacterCodes = ts.CharacterCodes; })(ts || (ts = {})); var ts; (function (ts) { @@ -2161,12 +1720,12 @@ var ts; ts.flattenDiagnosticChain = flattenDiagnosticChain; function compareValues(a, b) { if (a === b) - return 0; + return 0 /* EqualTo */; if (a === undefined) - return -1; + return -1 /* LessThan */; if (b === undefined) - return 1; - return a < b ? -1 : 1; + return 1 /* GreaterThan */; + return a < b ? -1 /* LessThan */ : 1 /* GreaterThan */; } ts.compareValues = compareValues; function getDiagnosticFilename(diagnostic) { @@ -2184,7 +1743,7 @@ var ts; var previousDiagnostic = diagnostics[0]; for (var i = 1; i < diagnostics.length; i++) { var currentDiagnostic = diagnostics[i]; - var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0; + var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0 /* EqualTo */; if (!isDupe) { newDiagnostics.push(currentDiagnostic); previousDiagnostic = currentDiagnostic; @@ -2413,13 +1972,6 @@ var ts; getTypeConstructor: function () { return Type; }, getSignatureConstructor: function () { return Signature; } }; - (function (AssertionLevel) { - AssertionLevel[AssertionLevel["None"] = 0] = "None"; - AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; - AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; - AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; - })(ts.AssertionLevel || (ts.AssertionLevel = {})); - var AssertionLevel = ts.AssertionLevel; var Debug; (function (Debug) { var currentAssertionLevel = 0 /* None */; @@ -2640,7 +2192,7 @@ var sys = (function () { })(); var ts; (function (ts) { - var nodeConstructors = new Array(189 /* Count */); + var nodeConstructors = new Array(196 /* Count */); function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); } @@ -2653,7 +2205,7 @@ var ts; return node; } function getSourceFileOfNode(node) { - while (node && node.kind !== 186 /* SourceFile */) + while (node && node.kind !== 193 /* SourceFile */) node = node.parent; return node; } @@ -2690,81 +2242,13 @@ var ts; } ts.unescapeIdentifier = unescapeIdentifier; function identifierToString(identifier) { - return identifier.kind === 116 /* Missing */ ? "(Missing)" : getTextOfNode(identifier); + return identifier.kind === 120 /* Missing */ ? "(Missing)" : getTextOfNode(identifier); } ts.identifierToString = identifierToString; - function isExpression(node) { - switch (node.kind) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: - case 8 /* RegularExpressionLiteral */: - case 135 /* ArrayLiteral */: - case 136 /* ObjectLiteral */: - case 138 /* PropertyAccess */: - case 139 /* IndexedAccess */: - case 140 /* CallExpression */: - case 141 /* NewExpression */: - case 142 /* TypeAssertion */: - case 143 /* ParenExpression */: - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: - case 146 /* PrefixOperator */: - case 147 /* PostfixOperator */: - case 148 /* BinaryExpression */: - case 149 /* ConditionalExpression */: - case 150 /* OmittedExpression */: - return true; - case 117 /* QualifiedName */: - while (node.parent.kind === 117 /* QualifiedName */) - node = node.parent; - return node.parent.kind === 129 /* TypeQuery */; - case 59 /* Identifier */: - if (node.parent.kind === 129 /* TypeQuery */) { - return true; - } - case 6 /* NumericLiteral */: - case 7 /* StringLiteral */: - var parent = node.parent; - switch (parent.kind) { - case 174 /* VariableDeclaration */: - case 119 /* Parameter */: - case 120 /* Property */: - case 185 /* EnumMember */: - case 137 /* PropertyAssignment */: - return parent.initializer === node; - case 154 /* ExpressionStatement */: - case 155 /* IfStatement */: - case 156 /* DoStatement */: - case 157 /* WhileStatement */: - case 162 /* ReturnStatement */: - case 163 /* WithStatement */: - case 164 /* SwitchStatement */: - case 165 /* CaseClause */: - case 168 /* ThrowStatement */: - case 164 /* SwitchStatement */: - return parent.expression === node; - case 158 /* ForStatement */: - return parent.initializer === node || parent.condition === node || parent.iterator === node; - case 159 /* ForInStatement */: - return parent.variable === node || parent.expression === node; - case 142 /* TypeAssertion */: - return node === parent.operand; - default: - if (isExpression(parent)) { - return true; - } - } - } - return false; - } - ts.isExpression = isExpression; function createDiagnosticForNode(node, message, arg0, arg1, arg2) { node = getErrorSpanForNode(node); var file = getSourceFileOfNode(node); - var start = node.kind === 116 /* Missing */ ? node.pos : ts.skipTrivia(file.text, node.pos); + var start = node.kind === 120 /* Missing */ ? node.pos : ts.skipTrivia(file.text, node.pos); var length = node.end - start; return ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); } @@ -2780,12 +2264,12 @@ var ts; function getErrorSpanForNode(node) { var errorSpan; switch (node.kind) { - case 174 /* VariableDeclaration */: - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - case 181 /* ModuleDeclaration */: - case 180 /* EnumDeclaration */: - case 185 /* EnumMember */: + case 181 /* VariableDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 188 /* ModuleDeclaration */: + case 187 /* EnumDeclaration */: + case 192 /* EnumMember */: errorSpan = node.name; break; } @@ -2800,12 +2284,16 @@ var ts; return (file.flags & 1024 /* DeclarationFile */) !== 0; } ts.isDeclarationFile = isDeclarationFile; + function isConstEnumDeclaration(node) { + return (node.flags & 4096 /* Const */) !== 0; + } + ts.isConstEnumDeclaration = isConstEnumDeclaration; function isPrologueDirective(node) { - return node.kind === 154 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; + return node.kind === 161 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; function isEvalOrArgumentsIdentifier(node) { - return node.kind === 59 /* Identifier */ && node.text && (node.text === "eval" || node.text === "arguments"); + return node.kind === 63 /* Identifier */ && node.text && (node.text === "eval" || node.text === "arguments"); } function isUseStrictPrologueDirective(node) { ts.Debug.assert(isPrologueDirective(node)); @@ -2813,7 +2301,7 @@ var ts; } function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { sourceFileOfNode = sourceFileOfNode || getSourceFileOfNode(node); - if (node.kind === 119 /* Parameter */ || node.kind === 118 /* TypeParameter */) { + if (node.kind === 123 /* Parameter */ || node.kind === 122 /* TypeParameter */) { return ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); } else { @@ -2849,122 +2337,128 @@ var ts; if (!node) return; switch (node.kind) { - case 117 /* QualifiedName */: + case 121 /* QualifiedName */: return child(node.left) || child(node.right); - case 118 /* TypeParameter */: + case 122 /* TypeParameter */: return child(node.name) || child(node.constraint); - case 119 /* Parameter */: + case 123 /* Parameter */: return child(node.name) || child(node.type) || child(node.initializer); - case 120 /* Property */: - case 137 /* PropertyAssignment */: + case 124 /* Property */: + case 141 /* PropertyAssignment */: return child(node.name) || child(node.type) || child(node.initializer); - case 125 /* CallSignature */: - case 126 /* ConstructSignature */: - case 127 /* IndexSignature */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: return children(node.typeParameters) || children(node.parameters) || child(node.type); - case 121 /* Method */: - case 122 /* Constructor */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 144 /* FunctionExpression */: - case 175 /* FunctionDeclaration */: - case 145 /* ArrowFunction */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 149 /* FunctionExpression */: + case 182 /* FunctionDeclaration */: + case 150 /* ArrowFunction */: return child(node.name) || children(node.typeParameters) || children(node.parameters) || child(node.type) || child(node.body); - case 128 /* TypeReference */: + case 132 /* TypeReference */: return child(node.typeName) || children(node.typeArguments); - case 129 /* TypeQuery */: + case 133 /* TypeQuery */: return child(node.exprName); - case 130 /* TypeLiteral */: + case 134 /* TypeLiteral */: return children(node.members); - case 131 /* ArrayType */: + case 135 /* ArrayType */: return child(node.elementType); - case 132 /* TupleType */: + case 136 /* TupleType */: return children(node.elementTypes); - case 133 /* UnionType */: + case 137 /* UnionType */: return children(node.types); - case 134 /* ParenType */: + case 138 /* ParenType */: return child(node.type); - case 135 /* ArrayLiteral */: + case 139 /* ArrayLiteral */: return children(node.elements); - case 136 /* ObjectLiteral */: + case 140 /* ObjectLiteral */: return children(node.properties); - case 138 /* PropertyAccess */: + case 142 /* PropertyAccess */: return child(node.left) || child(node.right); - case 139 /* IndexedAccess */: + case 143 /* IndexedAccess */: return child(node.object) || child(node.index); - case 140 /* CallExpression */: - case 141 /* NewExpression */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: return child(node.func) || children(node.typeArguments) || children(node.arguments); - case 142 /* TypeAssertion */: + case 146 /* TaggedTemplateExpression */: + return child(node.tag) || child(node.template); + case 147 /* TypeAssertion */: return child(node.type) || child(node.operand); - case 143 /* ParenExpression */: + case 148 /* ParenExpression */: return child(node.expression); - case 146 /* PrefixOperator */: - case 147 /* PostfixOperator */: + case 151 /* PrefixOperator */: + case 152 /* PostfixOperator */: return child(node.operand); - case 148 /* BinaryExpression */: + case 153 /* BinaryExpression */: return child(node.left) || child(node.right); - case 149 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return child(node.condition) || child(node.whenTrue) || child(node.whenFalse); - case 151 /* Block */: - case 170 /* TryBlock */: - case 172 /* FinallyBlock */: - case 176 /* FunctionBlock */: - case 182 /* ModuleBlock */: - case 186 /* SourceFile */: + case 158 /* Block */: + case 177 /* TryBlock */: + case 179 /* FinallyBlock */: + case 183 /* FunctionBlock */: + case 189 /* ModuleBlock */: + case 193 /* SourceFile */: return children(node.statements); - case 152 /* VariableStatement */: + case 159 /* VariableStatement */: return children(node.declarations); - case 154 /* ExpressionStatement */: + case 161 /* ExpressionStatement */: return child(node.expression); - case 155 /* IfStatement */: + case 162 /* IfStatement */: return child(node.expression) || child(node.thenStatement) || child(node.elseStatement); - case 156 /* DoStatement */: + case 163 /* DoStatement */: return child(node.statement) || child(node.expression); - case 157 /* WhileStatement */: + case 164 /* WhileStatement */: return child(node.expression) || child(node.statement); - case 158 /* ForStatement */: + case 165 /* ForStatement */: return children(node.declarations) || child(node.initializer) || child(node.condition) || child(node.iterator) || child(node.statement); - case 159 /* ForInStatement */: + case 166 /* ForInStatement */: return child(node.declaration) || child(node.variable) || child(node.expression) || child(node.statement); - case 160 /* ContinueStatement */: - case 161 /* BreakStatement */: + case 167 /* ContinueStatement */: + case 168 /* BreakStatement */: return child(node.label); - case 162 /* ReturnStatement */: + case 169 /* ReturnStatement */: return child(node.expression); - case 163 /* WithStatement */: + case 170 /* WithStatement */: return child(node.expression) || child(node.statement); - case 164 /* SwitchStatement */: + case 171 /* SwitchStatement */: return child(node.expression) || children(node.clauses); - case 165 /* CaseClause */: - case 166 /* DefaultClause */: + case 172 /* CaseClause */: + case 173 /* DefaultClause */: return child(node.expression) || children(node.statements); - case 167 /* LabeledStatement */: + case 174 /* LabeledStatement */: return child(node.label) || child(node.statement); - case 168 /* ThrowStatement */: + case 175 /* ThrowStatement */: return child(node.expression); - case 169 /* TryStatement */: + case 176 /* TryStatement */: return child(node.tryBlock) || child(node.catchBlock) || child(node.finallyBlock); - case 171 /* CatchBlock */: + case 178 /* CatchBlock */: return child(node.variable) || children(node.statements); - case 174 /* VariableDeclaration */: + case 181 /* VariableDeclaration */: return child(node.name) || child(node.type) || child(node.initializer); - case 177 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return child(node.name) || children(node.typeParameters) || child(node.baseType) || children(node.implementedTypes) || children(node.members); - case 178 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: return child(node.name) || children(node.typeParameters) || children(node.baseTypes) || children(node.members); - case 179 /* TypeAliasDeclaration */: + case 186 /* TypeAliasDeclaration */: return child(node.name) || child(node.type); - case 180 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: return child(node.name) || children(node.members); - case 185 /* EnumMember */: + case 192 /* EnumMember */: return child(node.name) || child(node.initializer); - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return child(node.name) || child(node.body); - case 183 /* ImportDeclaration */: + case 190 /* ImportDeclaration */: return child(node.name) || child(node.entityName) || child(node.externalModuleName); - case 184 /* ExportAssignment */: + case 191 /* ExportAssignment */: return child(node.exportName); + case 155 /* TemplateExpression */: + return child(node.head) || children(node.templateSpans); + case 156 /* TemplateSpan */: + return child(node.expression) || child(node.literal); } } ts.forEachChild = forEachChild; @@ -2972,24 +2466,24 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 162 /* ReturnStatement */: + case 169 /* ReturnStatement */: return visitor(node); - case 151 /* Block */: - case 176 /* FunctionBlock */: - case 155 /* IfStatement */: - case 156 /* DoStatement */: - case 157 /* WhileStatement */: - case 158 /* ForStatement */: - case 159 /* ForInStatement */: - case 163 /* WithStatement */: - case 164 /* SwitchStatement */: - case 165 /* CaseClause */: - case 166 /* DefaultClause */: - case 167 /* LabeledStatement */: - case 169 /* TryStatement */: - case 170 /* TryBlock */: - case 171 /* CatchBlock */: - case 172 /* FinallyBlock */: + 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 */: return forEachChild(node, traverse); } } @@ -2998,13 +2492,13 @@ var ts; function isAnyFunction(node) { if (node) { switch (node.kind) { - case 144 /* FunctionExpression */: - case 175 /* FunctionDeclaration */: - case 145 /* ArrowFunction */: - case 121 /* Method */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 122 /* Constructor */: + case 149 /* FunctionExpression */: + case 182 /* FunctionDeclaration */: + case 150 /* ArrowFunction */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: return true; } } @@ -3027,20 +2521,20 @@ var ts; return undefined; } switch (node.kind) { - case 145 /* ArrowFunction */: + case 150 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } - case 175 /* FunctionDeclaration */: - case 144 /* FunctionExpression */: - case 181 /* ModuleDeclaration */: - case 120 /* Property */: - case 121 /* Method */: - case 122 /* Constructor */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 180 /* EnumDeclaration */: - case 186 /* SourceFile */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 188 /* ModuleDeclaration */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 187 /* EnumDeclaration */: + case 193 /* SourceFile */: return node; } } @@ -3053,20 +2547,103 @@ var ts; return undefined; } switch (node.kind) { - case 120 /* Property */: - case 121 /* Method */: - case 122 /* Constructor */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return node; } } } ts.getSuperContainer = getSuperContainer; + function isExpression(node) { + switch (node.kind) { + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: + case 87 /* NullKeyword */: + 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 */: + return true; + case 121 /* QualifiedName */: + while (node.parent.kind === 121 /* QualifiedName */) + node = node.parent; + return node.parent.kind === 133 /* TypeQuery */; + case 63 /* Identifier */: + if (node.parent.kind === 133 /* TypeQuery */) { + return true; + } + case 6 /* NumericLiteral */: + case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: + var parent = node.parent; + switch (parent.kind) { + case 181 /* VariableDeclaration */: + case 123 /* Parameter */: + case 124 /* Property */: + case 192 /* EnumMember */: + case 141 /* 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 */: + return parent.expression === node; + case 165 /* ForStatement */: + return parent.initializer === node || parent.condition === node || parent.iterator === node; + case 166 /* ForInStatement */: + return parent.variable === node || parent.expression === node; + case 147 /* TypeAssertion */: + return node === parent.operand; + default: + if (isExpression(parent)) { + return true; + } + } + } + return false; + } + ts.isExpression = isExpression; function hasRestParameters(s) { return s.parameters.length > 0 && (s.parameters[s.parameters.length - 1].flags & 8 /* Rest */) !== 0; } ts.hasRestParameters = hasRestParameters; + function isLiteralKind(kind) { + return 6 /* FirstLiteralToken */ <= kind && kind <= 9 /* LastLiteralToken */; + } + ts.isLiteralKind = isLiteralKind; + function isTextualLiteralKind(kind) { + return kind === 7 /* StringLiteral */ || kind === 9 /* NoSubstitutionTemplateLiteral */; + } + ts.isTextualLiteralKind = isTextualLiteralKind; + function isTemplateLiteralKind(kind) { + return 9 /* FirstTemplateToken */ <= kind && kind <= 12 /* LastTemplateToken */; + } + ts.isTemplateLiteralKind = isTemplateLiteralKind; function isInAmbientContext(node) { while (node) { if (node.flags & (2 /* Ambient */ | 1024 /* DeclarationFile */)) @@ -3078,22 +2655,22 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 118 /* TypeParameter */: - case 119 /* Parameter */: - case 174 /* VariableDeclaration */: - case 120 /* Property */: - case 137 /* PropertyAssignment */: - case 185 /* EnumMember */: - case 121 /* Method */: - case 175 /* FunctionDeclaration */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - case 179 /* TypeAliasDeclaration */: - case 180 /* EnumDeclaration */: - case 181 /* ModuleDeclaration */: - case 183 /* ImportDeclaration */: + case 122 /* TypeParameter */: + case 123 /* Parameter */: + case 181 /* VariableDeclaration */: + case 124 /* Property */: + case 141 /* PropertyAssignment */: + case 192 /* EnumMember */: + case 125 /* Method */: + case 182 /* 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 */: return true; } return false; @@ -3101,24 +2678,24 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 161 /* BreakStatement */: - case 160 /* ContinueStatement */: - case 173 /* DebuggerStatement */: - case 156 /* DoStatement */: - case 154 /* ExpressionStatement */: - case 153 /* EmptyStatement */: - case 159 /* ForInStatement */: - case 158 /* ForStatement */: - case 155 /* IfStatement */: - case 167 /* LabeledStatement */: - case 162 /* ReturnStatement */: - case 164 /* SwitchStatement */: - case 88 /* ThrowKeyword */: - case 169 /* TryStatement */: - case 152 /* VariableStatement */: - case 157 /* WhileStatement */: - case 163 /* WithStatement */: - case 184 /* ExportAssignment */: + 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 92 /* ThrowKeyword */: + case 176 /* TryStatement */: + case 159 /* VariableStatement */: + case 164 /* WhileStatement */: + case 170 /* WithStatement */: + case 191 /* ExportAssignment */: return true; default: return false; @@ -3126,14 +2703,14 @@ var ts; } ts.isStatement = isStatement; function isDeclarationOrFunctionExpressionOrCatchVariableName(name) { - if (name.kind !== 59 /* Identifier */ && name.kind !== 7 /* StringLiteral */ && name.kind !== 6 /* NumericLiteral */) { + if (name.kind !== 63 /* Identifier */ && name.kind !== 7 /* StringLiteral */ && name.kind !== 6 /* NumericLiteral */) { return false; } var parent = name.parent; - if (isDeclaration(parent) || parent.kind === 144 /* FunctionExpression */) { + if (isDeclaration(parent) || parent.kind === 149 /* FunctionExpression */) { return parent.name === name; } - if (parent.kind === 171 /* CatchBlock */) { + if (parent.kind === 178 /* CatchBlock */) { return parent.variable === name; } return false; @@ -3141,16 +2718,16 @@ var ts; ts.isDeclarationOrFunctionExpressionOrCatchVariableName = isDeclarationOrFunctionExpressionOrCatchVariableName; function getAncestor(node, kind) { switch (kind) { - case 177 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: while (node) { switch (node.kind) { - case 177 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return node; - case 180 /* EnumDeclaration */: - case 178 /* InterfaceDeclaration */: - case 179 /* TypeAliasDeclaration */: - case 181 /* ModuleDeclaration */: - case 183 /* ImportDeclaration */: + case 187 /* EnumDeclaration */: + case 185 /* InterfaceDeclaration */: + case 186 /* TypeAliasDeclaration */: + case 188 /* ModuleDeclaration */: + case 190 /* ImportDeclaration */: return undefined; default: node = node.parent; @@ -3170,107 +2747,44 @@ var ts; return undefined; } ts.getAncestor = getAncestor; - var ParsingContext; - (function (ParsingContext) { - ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements"; - ParsingContext[ParsingContext["ModuleElements"] = 1] = "ModuleElements"; - ParsingContext[ParsingContext["BlockStatements"] = 2] = "BlockStatements"; - ParsingContext[ParsingContext["SwitchClauses"] = 3] = "SwitchClauses"; - ParsingContext[ParsingContext["SwitchClauseStatements"] = 4] = "SwitchClauseStatements"; - ParsingContext[ParsingContext["TypeMembers"] = 5] = "TypeMembers"; - ParsingContext[ParsingContext["ClassMembers"] = 6] = "ClassMembers"; - ParsingContext[ParsingContext["EnumMembers"] = 7] = "EnumMembers"; - ParsingContext[ParsingContext["BaseTypeReferences"] = 8] = "BaseTypeReferences"; - ParsingContext[ParsingContext["VariableDeclarations"] = 9] = "VariableDeclarations"; - ParsingContext[ParsingContext["ArgumentExpressions"] = 10] = "ArgumentExpressions"; - ParsingContext[ParsingContext["ObjectLiteralMembers"] = 11] = "ObjectLiteralMembers"; - ParsingContext[ParsingContext["ArrayLiteralMembers"] = 12] = "ArrayLiteralMembers"; - ParsingContext[ParsingContext["Parameters"] = 13] = "Parameters"; - ParsingContext[ParsingContext["TypeParameters"] = 14] = "TypeParameters"; - ParsingContext[ParsingContext["TypeArguments"] = 15] = "TypeArguments"; - ParsingContext[ParsingContext["TupleElementTypes"] = 16] = "TupleElementTypes"; - ParsingContext[ParsingContext["Count"] = 17] = "Count"; - })(ParsingContext || (ParsingContext = {})); - var Tristate; - (function (Tristate) { - Tristate[Tristate["False"] = 0] = "False"; - Tristate[Tristate["True"] = 1] = "True"; - Tristate[Tristate["Unknown"] = 2] = "Unknown"; - })(Tristate || (Tristate = {})); function parsingContextErrors(context) { switch (context) { - case 0 /* SourceElements */: - return ts.Diagnostics.Declaration_or_statement_expected; - case 1 /* ModuleElements */: - return ts.Diagnostics.Declaration_or_statement_expected; - case 2 /* BlockStatements */: - return ts.Diagnostics.Statement_expected; - case 3 /* SwitchClauses */: - return ts.Diagnostics.case_or_default_expected; - case 4 /* SwitchClauseStatements */: - return ts.Diagnostics.Statement_expected; - case 5 /* TypeMembers */: - return ts.Diagnostics.Property_or_signature_expected; - case 6 /* ClassMembers */: - return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; - case 7 /* EnumMembers */: - return ts.Diagnostics.Enum_member_expected; - case 8 /* BaseTypeReferences */: - return ts.Diagnostics.Type_reference_expected; - case 9 /* VariableDeclarations */: - return ts.Diagnostics.Variable_declaration_expected; - case 10 /* ArgumentExpressions */: - return ts.Diagnostics.Argument_expression_expected; - case 11 /* ObjectLiteralMembers */: - return ts.Diagnostics.Property_assignment_expected; - case 12 /* ArrayLiteralMembers */: - return ts.Diagnostics.Expression_or_comma_expected; - case 13 /* Parameters */: - return ts.Diagnostics.Parameter_declaration_expected; - case 14 /* TypeParameters */: - return ts.Diagnostics.Type_parameter_declaration_expected; - case 15 /* TypeArguments */: - return ts.Diagnostics.Type_argument_expected; - case 16 /* TupleElementTypes */: - return ts.Diagnostics.Type_expected; + case 0 /* SourceElements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 1 /* ModuleElements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 2 /* BlockStatements */: return ts.Diagnostics.Statement_expected; + case 3 /* SwitchClauses */: return ts.Diagnostics.case_or_default_expected; + case 4 /* SwitchClauseStatements */: return ts.Diagnostics.Statement_expected; + case 5 /* TypeMembers */: return ts.Diagnostics.Property_or_signature_expected; + case 6 /* ClassMembers */: return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; + case 7 /* EnumMembers */: return ts.Diagnostics.Enum_member_expected; + case 8 /* BaseTypeReferences */: return ts.Diagnostics.Type_reference_expected; + case 9 /* VariableDeclarations */: return ts.Diagnostics.Variable_declaration_expected; + case 10 /* ArgumentExpressions */: return ts.Diagnostics.Argument_expression_expected; + case 11 /* ObjectLiteralMembers */: return ts.Diagnostics.Property_assignment_expected; + case 12 /* ArrayLiteralMembers */: return ts.Diagnostics.Expression_or_comma_expected; + case 13 /* Parameters */: return ts.Diagnostics.Parameter_declaration_expected; + case 14 /* TypeParameters */: return ts.Diagnostics.Type_parameter_declaration_expected; + case 15 /* TypeArguments */: return ts.Diagnostics.Type_argument_expected; + case 16 /* TupleElementTypes */: return ts.Diagnostics.Type_expected; } } ; - var LookAheadMode; - (function (LookAheadMode) { - LookAheadMode[LookAheadMode["NotLookingAhead"] = 0] = "NotLookingAhead"; - LookAheadMode[LookAheadMode["NoErrorYet"] = 1] = "NoErrorYet"; - LookAheadMode[LookAheadMode["Error"] = 2] = "Error"; - })(LookAheadMode || (LookAheadMode = {})); - var ModifierContext; - (function (ModifierContext) { - ModifierContext[ModifierContext["SourceElements"] = 0] = "SourceElements"; - ModifierContext[ModifierContext["ModuleElements"] = 1] = "ModuleElements"; - ModifierContext[ModifierContext["ClassMembers"] = 2] = "ClassMembers"; - ModifierContext[ModifierContext["Parameters"] = 3] = "Parameters"; - })(ModifierContext || (ModifierContext = {})); - var ControlBlockContext; - (function (ControlBlockContext) { - ControlBlockContext[ControlBlockContext["NotNested"] = 0] = "NotNested"; - ControlBlockContext[ControlBlockContext["Nested"] = 1] = "Nested"; - ControlBlockContext[ControlBlockContext["CrossingFunctionBoundary"] = 2] = "CrossingFunctionBoundary"; - })(ControlBlockContext || (ControlBlockContext = {})); function isKeyword(token) { - return ts.SyntaxKind.FirstKeyword <= token && token <= ts.SyntaxKind.LastKeyword; + return 64 /* FirstKeyword */ <= token && token <= 119 /* LastKeyword */; } ts.isKeyword = isKeyword; function isTrivia(token) { - return ts.SyntaxKind.FirstTriviaToken <= token && token <= ts.SyntaxKind.LastTriviaToken; + return 2 /* FirstTriviaToken */ <= token && token <= 5 /* LastTriviaToken */; } ts.isTrivia = isTrivia; function isModifier(token) { switch (token) { - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: - case 103 /* StaticKeyword */: - case 72 /* ExportKeyword */: - case 108 /* DeclareKeyword */: + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: + case 107 /* StaticKeyword */: + case 76 /* ExportKeyword */: + case 112 /* DeclareKeyword */: return true; } return false; @@ -3432,6 +2946,9 @@ var ts; function reScanSlashToken() { return token = scanner.reScanSlashToken(); } + function reScanTemplateToken() { + return token = scanner.reScanTemplateToken(); + } function lookAheadHelper(callback, alwaysResetState) { var saveToken = token; var saveSyntacticErrorsLength = file.syntacticErrors.length; @@ -3461,7 +2978,7 @@ var ts; return scanner.tryScan(function () { return lookAheadHelper(callback, false); }); } function isIdentifier() { - return token === 59 /* Identifier */ || (isInStrictMode ? token > ts.SyntaxKind.LastFutureReservedWord : token > ts.SyntaxKind.LastReservedWord); + return token === 63 /* Identifier */ || (isInStrictMode ? token > 108 /* LastFutureReservedWord */ : token > 99 /* LastReservedWord */); } function parseExpected(t) { if (token === t) { @@ -3479,14 +2996,14 @@ var ts; return false; } function canParseSemicolon() { - if (token === 17 /* SemicolonToken */) { + if (token === 21 /* SemicolonToken */) { return true; } - return token === 10 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); + return token === 14 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); } function parseSemicolon() { if (canParseSemicolon()) { - if (token === 17 /* SemicolonToken */) { + if (token === 21 /* SemicolonToken */) { nextToken(); } } @@ -3508,7 +3025,7 @@ var ts; return node; } function createMissingNode() { - return createNode(116 /* Missing */); + return createNode(120 /* Missing */); } function internIdentifier(text) { return ts.hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); @@ -3516,7 +3033,7 @@ var ts; function createIdentifier(isIdentifier) { identifierCount++; if (isIdentifier) { - var node = createNode(59 /* Identifier */); + var node = createNode(63 /* Identifier */); var text = escapeIdentifier(scanner.getTokenValue()); node.text = internIdentifier(text); nextToken(); @@ -3531,10 +3048,10 @@ var ts; return createIdentifier(isIdentifier()); } function parseIdentifierName() { - return createIdentifier(token >= 59 /* Identifier */); + return createIdentifier(token >= 63 /* Identifier */); } function isPropertyName() { - return token >= 59 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */; + return token >= 63 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */; } function parsePropertyName() { if (token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { @@ -3545,13 +3062,13 @@ var ts; function parseContextualModifier(t) { return token === t && tryParse(function () { nextToken(); - return token === 13 /* OpenBracketToken */ || isPropertyName(); + return token === 17 /* OpenBracketToken */ || isPropertyName(); }); } function parseAnyContextualModifier() { return isModifier(token) && tryParse(function () { nextToken(); - return token === 13 /* OpenBracketToken */ || isPropertyName(); + return token === 17 /* OpenBracketToken */ || isPropertyName(); }); } function isListElement(kind, inErrorRecovery) { @@ -3563,28 +3080,28 @@ var ts; case 4 /* SwitchClauseStatements */: return isStatement(inErrorRecovery); case 3 /* SwitchClauses */: - return token === 61 /* CaseKeyword */ || token === 67 /* DefaultKeyword */; + return token === 65 /* CaseKeyword */ || token === 71 /* DefaultKeyword */; case 5 /* TypeMembers */: - return isTypeMember(); + return isStartOfTypeMember(); case 6 /* ClassMembers */: return lookAhead(isClassMemberStart); case 7 /* EnumMembers */: case 11 /* ObjectLiteralMembers */: return isPropertyName(); case 8 /* BaseTypeReferences */: - return isIdentifier() && ((token !== 73 /* ExtendsKeyword */ && token !== 96 /* ImplementsKeyword */) || !lookAhead(function () { return (nextToken(), isIdentifier()); })); + return isIdentifier() && ((token !== 77 /* ExtendsKeyword */ && token !== 100 /* ImplementsKeyword */) || !lookAhead(function () { return (nextToken(), isIdentifier()); })); case 9 /* VariableDeclarations */: case 14 /* TypeParameters */: return isIdentifier(); case 10 /* ArgumentExpressions */: - return token === 18 /* CommaToken */ || isExpression(); + return token === 22 /* CommaToken */ || isStartOfExpression(); case 12 /* ArrayLiteralMembers */: - return token === 18 /* CommaToken */ || isExpression(); + return token === 22 /* CommaToken */ || isStartOfExpression(); case 13 /* Parameters */: - return isParameter(); + return isStartOfParameter(); case 15 /* TypeArguments */: case 16 /* TupleElementTypes */: - return token === 18 /* CommaToken */ || isType(); + return token === 22 /* CommaToken */ || isStartOfType(); } ts.Debug.fail("Non-exhaustive case in 'isListElement'."); } @@ -3600,34 +3117,34 @@ var ts; case 6 /* ClassMembers */: case 7 /* EnumMembers */: case 11 /* ObjectLiteralMembers */: - return token === 10 /* CloseBraceToken */; + return token === 14 /* CloseBraceToken */; case 4 /* SwitchClauseStatements */: - return token === 10 /* CloseBraceToken */ || token === 61 /* CaseKeyword */ || token === 67 /* DefaultKeyword */; + return token === 14 /* CloseBraceToken */ || token === 65 /* CaseKeyword */ || token === 71 /* DefaultKeyword */; case 8 /* BaseTypeReferences */: - return token === 9 /* OpenBraceToken */ || token === 73 /* ExtendsKeyword */ || token === 96 /* ImplementsKeyword */; + return token === 13 /* OpenBraceToken */ || token === 77 /* ExtendsKeyword */ || token === 100 /* ImplementsKeyword */; case 9 /* VariableDeclarations */: return isVariableDeclaratorListTerminator(); case 14 /* TypeParameters */: - return token === 20 /* GreaterThanToken */ || token === 11 /* OpenParenToken */ || token === 9 /* OpenBraceToken */ || token === 73 /* ExtendsKeyword */ || token === 96 /* ImplementsKeyword */; + return token === 24 /* GreaterThanToken */ || token === 15 /* OpenParenToken */ || token === 13 /* OpenBraceToken */ || token === 77 /* ExtendsKeyword */ || token === 100 /* ImplementsKeyword */; case 10 /* ArgumentExpressions */: - return token === 12 /* CloseParenToken */ || token === 17 /* SemicolonToken */; + return token === 16 /* CloseParenToken */ || token === 21 /* SemicolonToken */; case 12 /* ArrayLiteralMembers */: case 16 /* TupleElementTypes */: - return token === 14 /* CloseBracketToken */; + return token === 18 /* CloseBracketToken */; case 13 /* Parameters */: - return token === 12 /* CloseParenToken */ || token === 14 /* CloseBracketToken */ || token === 9 /* OpenBraceToken */; + return token === 16 /* CloseParenToken */ || token === 18 /* CloseBracketToken */ || token === 13 /* OpenBraceToken */; case 15 /* TypeArguments */: - return token === 20 /* GreaterThanToken */ || token === 11 /* OpenParenToken */; + return token === 24 /* GreaterThanToken */ || token === 15 /* OpenParenToken */; } } function isVariableDeclaratorListTerminator() { if (canParseSemicolon()) { return true; } - if (token === 80 /* InKeyword */) { + if (token === 84 /* InKeyword */) { return true; } - if (token === 27 /* EqualsGreaterThanToken */) { + if (token === 31 /* EqualsGreaterThanToken */) { return true; } return false; @@ -3688,7 +3205,7 @@ var ts; if (isListElement(kind, false)) { result.push(parseElement()); commaStart = scanner.getTokenPos(); - if (parseOptional(18 /* CommaToken */)) { + if (parseOptional(22 /* CommaToken */)) { continue; } commaStart = -1; @@ -3743,8 +3260,8 @@ var ts; } function parseEntityName(allowReservedWords) { var entity = parseIdentifier(); - while (parseOptional(15 /* DotToken */)) { - var node = createNode(117 /* QualifiedName */, entity.pos); + while (parseOptional(19 /* DotToken */)) { + var node = createNode(121 /* QualifiedName */, entity.pos); node.left = entity; node.right = allowReservedWords ? parseIdentifierName() : parseIdentifier(); entity = finishNode(node); @@ -3756,6 +3273,35 @@ var ts; nextToken(); return finishNode(node); } + function parseTemplateExpression() { + var template = createNode(155 /* TemplateExpression */); + template.head = parseLiteralNode(); + ts.Debug.assert(template.head.kind === 10 /* TemplateHead */, "Template head has wrong token kind"); + var templateSpans = []; + templateSpans.pos = getNodePos(); + do { + templateSpans.push(parseTemplateSpan()); + } while (templateSpans[templateSpans.length - 1].literal.kind === 11 /* TemplateMiddle */); + templateSpans.end = getNodeEnd(); + template.templateSpans = templateSpans; + return finishNode(template); + } + function parseTemplateSpan() { + var span = createNode(156 /* TemplateSpan */); + span.expression = parseExpression(false); + var literal; + if (token === 14 /* CloseBraceToken */) { + reScanTemplateToken(); + literal = parseLiteralNode(); + } + else { + error(ts.Diagnostics.Invalid_template_literal_expected); + literal = createMissingNode(); + literal.text = ""; + } + span.literal = literal; + return finishNode(span); + } function parseLiteralNode(internName) { var node = createNode(token); var text = scanner.getTokenValue(); @@ -3774,30 +3320,31 @@ var ts; return node; } function parseStringLiteral() { - if (token === 7 /* StringLiteral */) + if (token === 7 /* StringLiteral */) { return parseLiteralNode(true); + } error(ts.Diagnostics.String_literal_expected); return createMissingNode(); } function parseTypeReference() { - var node = createNode(128 /* TypeReference */); + var node = createNode(132 /* TypeReference */); node.typeName = parseEntityName(false); - if (!scanner.hasPrecedingLineBreak() && token === 19 /* LessThanToken */) { + if (!scanner.hasPrecedingLineBreak() && token === 23 /* LessThanToken */) { node.typeArguments = parseTypeArguments(); } return finishNode(node); } function parseTypeQuery() { - var node = createNode(129 /* TypeQuery */); - parseExpected(91 /* TypeOfKeyword */); + var node = createNode(133 /* TypeQuery */); + parseExpected(95 /* TypeOfKeyword */); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(118 /* TypeParameter */); + var node = createNode(122 /* TypeParameter */); node.name = parseIdentifier(); - if (parseOptional(73 /* ExtendsKeyword */)) { - if (isType() || !isExpression()) { + if (parseOptional(77 /* ExtendsKeyword */)) { + if (isStartOfType() || !isStartOfExpression()) { node.constraint = parseType(); } else { @@ -3808,9 +3355,9 @@ var ts; return finishNode(node); } function parseTypeParameters() { - if (token === 19 /* LessThanToken */) { + if (token === 23 /* LessThanToken */) { var pos = getNodePos(); - var result = parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 19 /* LessThanToken */, 20 /* GreaterThanToken */); + var result = parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 23 /* LessThanToken */, 24 /* GreaterThanToken */); if (!result.length) { var start = getTokenPos(pos); var length = getNodePos() - start; @@ -3820,23 +3367,23 @@ var ts; } } function parseParameterType() { - return parseOptional(46 /* ColonToken */) ? token === 7 /* StringLiteral */ ? parseStringLiteral() : parseType() : undefined; + return parseOptional(50 /* ColonToken */) ? token === 7 /* StringLiteral */ ? parseStringLiteral() : parseType() : undefined; } - function isParameter() { - return token === 16 /* DotDotDotToken */ || isIdentifier() || isModifier(token); + function isStartOfParameter() { + return token === 20 /* DotDotDotToken */ || isIdentifier() || isModifier(token); } function parseParameter(flags) { if (flags === void 0) { flags = 0; } - var node = createNode(119 /* Parameter */); + var node = createNode(123 /* Parameter */); node.flags |= parseAndCheckModifiers(3 /* Parameters */); - if (parseOptional(16 /* DotDotDotToken */)) { + if (parseOptional(20 /* DotDotDotToken */)) { node.flags |= 8 /* Rest */; } node.name = parseIdentifier(); - if (node.name.kind === 116 /* Missing */ && node.flags === 0 && isModifier(token)) { + if (node.name.kind === 120 /* Missing */ && node.flags === 0 && isModifier(token)) { nextToken(); } - if (parseOptional(45 /* QuestionToken */)) { + if (parseOptional(49 /* QuestionToken */)) { node.flags |= 4 /* QuestionMark */; } node.type = parseParameterType(); @@ -3844,11 +3391,11 @@ var ts; return finishNode(node); } function parseSignature(kind, returnToken, returnTokenRequired) { - if (kind === 126 /* ConstructSignature */) { - parseExpected(82 /* NewKeyword */); + if (kind === 130 /* ConstructSignature */) { + parseExpected(86 /* NewKeyword */); } var typeParameters = parseTypeParameters(); - var parameters = parseParameterList(11 /* OpenParenToken */, 12 /* CloseParenToken */); + var parameters = parseParameterList(15 /* OpenParenToken */, 16 /* CloseParenToken */); checkParameterList(parameters); var type; if (returnTokenRequired) { @@ -3915,10 +3462,10 @@ var ts; return finishNode(node); } function parseIndexSignatureMember() { - var node = createNode(127 /* IndexSignature */); + var node = createNode(131 /* IndexSignature */); var errorCountBeforeIndexSignature = file.syntacticErrors.length; var indexerStart = scanner.getTokenPos(); - node.parameters = parseParameterList(13 /* OpenBracketToken */, 14 /* CloseBracketToken */); + node.parameters = parseParameterList(17 /* OpenBracketToken */, 18 /* CloseBracketToken */); var indexerLength = scanner.getStartPos() - indexerStart; node.type = parseTypeAnnotation(); parseSemicolon(); @@ -3943,7 +3490,7 @@ var ts; grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); return; } - else if (parameter.flags & ts.NodeFlags.Modifier) { + else if (parameter.flags & 243 /* Modifier */) { grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); return; } @@ -3959,7 +3506,7 @@ var ts; grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); return; } - else if (parameter.type.kind !== 114 /* StringKeyword */ && parameter.type.kind !== 112 /* NumberKeyword */) { + 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; } @@ -3971,58 +3518,58 @@ var ts; function parsePropertyOrMethod() { var node = createNode(0 /* Unknown */); node.name = parsePropertyName(); - if (parseOptional(45 /* QuestionToken */)) { + if (parseOptional(49 /* QuestionToken */)) { node.flags |= 4 /* QuestionMark */; } - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - node.kind = 121 /* Method */; - var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + node.kind = 125 /* Method */; + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; } else { - node.kind = 120 /* Property */; + node.kind = 124 /* Property */; node.type = parseTypeAnnotation(); } parseSemicolon(); return finishNode(node); } - function isTypeMember() { + function isStartOfTypeMember() { switch (token) { - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - case 13 /* OpenBracketToken */: + case 15 /* OpenParenToken */: + case 23 /* LessThanToken */: + case 17 /* OpenBracketToken */: return true; default: - return isPropertyName() && lookAhead(function () { return nextToken() === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */ || token === 45 /* QuestionToken */ || token === 46 /* ColonToken */ || canParseSemicolon(); }); + return isPropertyName() && lookAhead(function () { return nextToken() === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */ || token === 49 /* QuestionToken */ || token === 50 /* ColonToken */ || canParseSemicolon(); }); } } function parseTypeMember() { switch (token) { - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - return parseSignatureMember(125 /* CallSignature */, 46 /* ColonToken */); - case 13 /* OpenBracketToken */: + case 15 /* OpenParenToken */: + case 23 /* LessThanToken */: + return parseSignatureMember(129 /* CallSignature */, 50 /* ColonToken */); + case 17 /* OpenBracketToken */: return parseIndexSignatureMember(); - case 82 /* NewKeyword */: - if (lookAhead(function () { return nextToken() === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */; })) { - return parseSignatureMember(126 /* ConstructSignature */, 46 /* ColonToken */); + case 86 /* NewKeyword */: + if (lookAhead(function () { return nextToken() === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */; })) { + return parseSignatureMember(130 /* ConstructSignature */, 50 /* ColonToken */); } case 7 /* StringLiteral */: case 6 /* NumericLiteral */: return parsePropertyOrMethod(); default: - if (token >= 59 /* Identifier */) { + if (token >= 63 /* Identifier */) { return parsePropertyOrMethod(); } } } function parseTypeLiteral() { - var node = createNode(130 /* TypeLiteral */); - if (parseExpected(9 /* OpenBraceToken */)) { + var node = createNode(134 /* TypeLiteral */); + if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseList(5 /* TypeMembers */, false, parseTypeMember); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -4030,26 +3577,26 @@ var ts; return finishNode(node); } function parseTupleType() { - var node = createNode(132 /* TupleType */); + var node = createNode(136 /* TupleType */); var startTokenPos = scanner.getTokenPos(); var startErrorCount = file.syntacticErrors.length; - node.elementTypes = parseBracketedList(16 /* TupleElementTypes */, parseType, 13 /* OpenBracketToken */, 14 /* CloseBracketToken */); + 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(134 /* ParenType */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(138 /* ParenType */); + parseExpected(15 /* OpenParenToken */); node.type = parseType(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); return finishNode(node); } function parseFunctionType(signatureKind) { - var node = createNode(130 /* TypeLiteral */); + var node = createNode(134 /* TypeLiteral */); var member = createNode(signatureKind); - var sig = parseSignature(signatureKind, 27 /* EqualsGreaterThanToken */, true); + var sig = parseSignature(signatureKind, 31 /* EqualsGreaterThanToken */, true); member.typeParameters = sig.typeParameters; member.parameters = sig.parameters; member.type = sig.type; @@ -4059,24 +3606,24 @@ var ts; } function parseKeywordAndNoDot() { var node = parseTokenNode(); - return token === 15 /* DotToken */ ? undefined : node; + return token === 19 /* DotToken */ ? undefined : node; } function parseNonArrayType() { switch (token) { - case 105 /* AnyKeyword */: - case 114 /* StringKeyword */: - case 112 /* NumberKeyword */: - case 106 /* BooleanKeyword */: - case 93 /* VoidKeyword */: + case 109 /* AnyKeyword */: + case 118 /* StringKeyword */: + case 116 /* NumberKeyword */: + case 110 /* BooleanKeyword */: + case 97 /* VoidKeyword */: var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); - case 91 /* TypeOfKeyword */: + case 95 /* TypeOfKeyword */: return parseTypeQuery(); - case 9 /* OpenBraceToken */: + case 13 /* OpenBraceToken */: return parseTypeLiteral(); - case 13 /* OpenBracketToken */: + case 17 /* OpenBracketToken */: return parseTupleType(); - case 11 /* OpenParenToken */: + case 15 /* OpenParenToken */: return parseParenType(); default: if (isIdentifier()) { @@ -4086,23 +3633,23 @@ var ts; error(ts.Diagnostics.Type_expected); return createMissingNode(); } - function isType() { + function isStartOfType() { switch (token) { - case 105 /* AnyKeyword */: - case 114 /* StringKeyword */: - case 112 /* NumberKeyword */: - case 106 /* BooleanKeyword */: - case 93 /* VoidKeyword */: - case 91 /* TypeOfKeyword */: - case 9 /* OpenBraceToken */: - case 13 /* OpenBracketToken */: - case 19 /* LessThanToken */: - case 82 /* NewKeyword */: + case 109 /* AnyKeyword */: + case 118 /* StringKeyword */: + case 116 /* NumberKeyword */: + case 110 /* BooleanKeyword */: + case 97 /* VoidKeyword */: + case 95 /* TypeOfKeyword */: + case 13 /* OpenBraceToken */: + case 17 /* OpenBracketToken */: + case 23 /* LessThanToken */: + case 86 /* NewKeyword */: return true; - case 11 /* OpenParenToken */: + case 15 /* OpenParenToken */: return lookAhead(function () { nextToken(); - return token === 12 /* CloseParenToken */ || isParameter() || isType(); + return token === 16 /* CloseParenToken */ || isStartOfParameter() || isStartOfType(); }); default: return isIdentifier(); @@ -4110,9 +3657,9 @@ var ts; } function parsePrimaryType() { var type = parseNonArrayType(); - while (!scanner.hasPrecedingLineBreak() && parseOptional(13 /* OpenBracketToken */)) { - parseExpected(14 /* CloseBracketToken */); - var node = createNode(131 /* ArrayType */, type.pos); + while (!scanner.hasPrecedingLineBreak() && parseOptional(17 /* OpenBracketToken */)) { + parseExpected(18 /* CloseBracketToken */); + var node = createNode(135 /* ArrayType */, type.pos); node.elementType = type; type = finishNode(node); } @@ -4120,33 +3667,33 @@ var ts; } function parseUnionType() { var type = parsePrimaryType(); - if (token === 39 /* BarToken */) { + if (token === 43 /* BarToken */) { var types = [type]; types.pos = type.pos; - while (parseOptional(39 /* BarToken */)) { + while (parseOptional(43 /* BarToken */)) { types.push(parsePrimaryType()); } types.end = getNodeEnd(); - var node = createNode(133 /* UnionType */, type.pos); + var node = createNode(137 /* UnionType */, type.pos); node.types = types; type = finishNode(node); } return type; } - function isFunctionType() { - return token === 19 /* LessThanToken */ || token === 11 /* OpenParenToken */ && lookAhead(function () { + function isStartOfFunctionType() { + return token === 23 /* LessThanToken */ || token === 15 /* OpenParenToken */ && lookAhead(function () { nextToken(); - if (token === 12 /* CloseParenToken */ || token === 16 /* DotDotDotToken */) { + if (token === 16 /* CloseParenToken */ || token === 20 /* DotDotDotToken */) { return true; } if (isIdentifier() || isModifier(token)) { nextToken(); - if (token === 46 /* ColonToken */ || token === 18 /* CommaToken */ || token === 45 /* QuestionToken */ || token === 47 /* EqualsToken */ || isIdentifier() || isModifier(token)) { + if (token === 50 /* ColonToken */ || token === 22 /* CommaToken */ || token === 49 /* QuestionToken */ || token === 51 /* EqualsToken */ || isIdentifier() || isModifier(token)) { return true; } - if (token === 12 /* CloseParenToken */) { + if (token === 16 /* CloseParenToken */) { nextToken(); - if (token === 27 /* EqualsGreaterThanToken */) { + if (token === 31 /* EqualsGreaterThanToken */) { return true; } } @@ -4155,66 +3702,68 @@ var ts; }); } function parseType() { - if (isFunctionType()) { - return parseFunctionType(125 /* CallSignature */); + if (isStartOfFunctionType()) { + return parseFunctionType(129 /* CallSignature */); } - if (token === 82 /* NewKeyword */) { - return parseFunctionType(126 /* ConstructSignature */); + if (token === 86 /* NewKeyword */) { + return parseFunctionType(130 /* ConstructSignature */); } return parseUnionType(); } function parseTypeAnnotation() { - return parseOptional(46 /* ColonToken */) ? parseType() : undefined; + return parseOptional(50 /* ColonToken */) ? parseType() : undefined; } - function isExpression() { + function isStartOfExpression() { switch (token) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: + case 87 /* NullKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: case 6 /* NumericLiteral */: case 7 /* StringLiteral */: - case 11 /* OpenParenToken */: - case 13 /* OpenBracketToken */: - case 9 /* OpenBraceToken */: - case 77 /* FunctionKeyword */: - case 82 /* NewKeyword */: - case 31 /* SlashToken */: - case 51 /* SlashEqualsToken */: - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: - case 41 /* ExclamationToken */: - case 68 /* DeleteKeyword */: - case 91 /* TypeOfKeyword */: - case 93 /* VoidKeyword */: - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: - case 19 /* LessThanToken */: - case 59 /* Identifier */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 10 /* TemplateHead */: + case 15 /* OpenParenToken */: + case 17 /* OpenBracketToken */: + case 13 /* OpenBraceToken */: + case 81 /* FunctionKeyword */: + case 86 /* NewKeyword */: + case 35 /* SlashToken */: + case 55 /* SlashEqualsToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: + case 45 /* ExclamationToken */: + case 72 /* DeleteKeyword */: + case 95 /* TypeOfKeyword */: + case 97 /* VoidKeyword */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: + case 23 /* LessThanToken */: + case 63 /* Identifier */: return true; default: return isIdentifier(); } } - function isExpressionStatement() { - return token !== 9 /* OpenBraceToken */ && token !== 77 /* FunctionKeyword */ && isExpression(); + function isStartOfExpressionStatement() { + return token !== 13 /* OpenBraceToken */ && token !== 81 /* FunctionKeyword */ && isStartOfExpression(); } function parseExpression(noIn) { var expr = parseAssignmentExpression(noIn); - while (parseOptional(18 /* CommaToken */)) { - expr = makeBinaryExpression(expr, 18 /* CommaToken */, parseAssignmentExpression(noIn)); + while (parseOptional(22 /* CommaToken */)) { + expr = makeBinaryExpression(expr, 22 /* CommaToken */, parseAssignmentExpression(noIn)); } return expr; } function parseInitializer(inParameter, noIn) { - if (token !== 47 /* EqualsToken */) { - if (scanner.hasPrecedingLineBreak() || (inParameter && token === 9 /* OpenBraceToken */) || !isExpression()) { + if (token !== 51 /* EqualsToken */) { + if (scanner.hasPrecedingLineBreak() || (inParameter && token === 13 /* OpenBraceToken */) || !isStartOfExpression()) { return undefined; } } - parseExpected(47 /* EqualsToken */); + parseExpected(51 /* EqualsToken */); return parseAssignmentExpression(noIn); } function parseAssignmentExpression(noIn) { @@ -4223,7 +3772,7 @@ var ts; return arrowExpression; } var expr = parseConditionalExpression(noIn); - if (expr.kind === 59 /* Identifier */ && token === 27 /* EqualsGreaterThanToken */) { + if (expr.kind === 63 /* Identifier */ && token === 31 /* EqualsGreaterThanToken */) { return parseSimpleArrowFunctionExpression(expr); } if (isLeftHandSideExpression(expr) && isAssignmentOperator()) { @@ -4239,33 +3788,36 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 138 /* PropertyAccess */: - case 139 /* IndexedAccess */: - case 141 /* NewExpression */: - case 140 /* CallExpression */: - case 135 /* ArrayLiteral */: - case 143 /* ParenExpression */: - case 136 /* ObjectLiteral */: - case 144 /* FunctionExpression */: - case 59 /* Identifier */: - case 116 /* Missing */: + 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 74 /* FalseKeyword */: - case 83 /* NullKeyword */: - case 87 /* ThisKeyword */: - case 89 /* TrueKeyword */: - case 85 /* SuperKeyword */: + 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 === 27 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - parseExpected(27 /* EqualsGreaterThanToken */); - var parameter = createNode(119 /* Parameter */, identifier.pos); + ts.Debug.assert(token === 31 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); + parseExpected(31 /* EqualsGreaterThanToken */); + var parameter = createNode(123 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); var parameters = []; @@ -4282,17 +3834,17 @@ var ts; } var pos = getNodePos(); if (triState === 1 /* True */) { - var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); - if (parseExpected(27 /* EqualsGreaterThanToken */) || token === 9 /* OpenBraceToken */) { + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); + if (parseExpected(31 /* EqualsGreaterThanToken */) || token === 13 /* OpenBraceToken */) { return parseArrowExpressionTail(pos, sig, false); } else { - return makeFunctionExpression(145 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); + return makeFunctionExpression(150 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); } } var sig = tryParseSignatureIfArrowOrBraceFollows(); if (sig) { - parseExpected(27 /* EqualsGreaterThanToken */); + parseExpected(31 /* EqualsGreaterThanToken */); return parseArrowExpressionTail(pos, sig, false); } else { @@ -4300,35 +3852,35 @@ var ts; } } function isParenthesizedArrowFunctionExpression() { - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { return lookAhead(function () { var first = token; var second = nextToken(); - if (first === 11 /* OpenParenToken */) { - if (second === 12 /* CloseParenToken */) { + if (first === 15 /* OpenParenToken */) { + if (second === 16 /* CloseParenToken */) { var third = nextToken(); switch (third) { - case 27 /* EqualsGreaterThanToken */: - case 46 /* ColonToken */: - case 9 /* OpenBraceToken */: + case 31 /* EqualsGreaterThanToken */: + case 50 /* ColonToken */: + case 13 /* OpenBraceToken */: return 1 /* True */; default: return 0 /* False */; } } - if (second === 16 /* DotDotDotToken */) { + if (second === 20 /* DotDotDotToken */) { return 1 /* True */; } if (!isIdentifier()) { return 0 /* False */; } - if (nextToken() === 46 /* ColonToken */) { + if (nextToken() === 50 /* ColonToken */) { return 1 /* True */; } return 2 /* Unknown */; } else { - ts.Debug.assert(first === 19 /* LessThanToken */); + ts.Debug.assert(first === 23 /* LessThanToken */); if (!isIdentifier()) { return 0 /* False */; } @@ -4336,15 +3888,15 @@ var ts; } }); } - if (token === 27 /* EqualsGreaterThanToken */) { + if (token === 31 /* EqualsGreaterThanToken */) { return 1 /* True */; } return 0 /* False */; } function tryParseSignatureIfArrowOrBraceFollows() { return tryParse(function () { - var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); - if (token === 27 /* EqualsGreaterThanToken */ || token === 9 /* OpenBraceToken */) { + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); + if (token === 31 /* EqualsGreaterThanToken */ || token === 13 /* OpenBraceToken */) { return sig; } return undefined; @@ -4352,27 +3904,27 @@ var ts; } function parseArrowExpressionTail(pos, sig, noIn) { var body; - if (token === 9 /* OpenBraceToken */) { + if (token === 13 /* OpenBraceToken */) { body = parseBody(false); } - else if (isStatement(true) && !isExpressionStatement() && token !== 77 /* FunctionKeyword */) { + else if (isStatement(true) && !isStartOfExpressionStatement() && token !== 81 /* FunctionKeyword */) { body = parseBody(true); } else { body = parseAssignmentExpression(noIn); } - return makeFunctionExpression(145 /* ArrowFunction */, pos, undefined, sig, body); + return makeFunctionExpression(150 /* ArrowFunction */, pos, undefined, sig, body); } function isAssignmentOperator() { - return token >= ts.SyntaxKind.FirstAssignment && token <= ts.SyntaxKind.LastAssignment; + return token >= 51 /* FirstAssignment */ && token <= 62 /* LastAssignment */; } function parseConditionalExpression(noIn) { var expr = parseBinaryExpression(noIn); - while (parseOptional(45 /* QuestionToken */)) { - var node = createNode(149 /* ConditionalExpression */, expr.pos); + while (parseOptional(49 /* QuestionToken */)) { + var node = createNode(154 /* ConditionalExpression */, expr.pos); node.condition = expr; node.whenTrue = parseAssignmentExpression(false); - parseExpected(46 /* ColonToken */); + parseExpected(50 /* ColonToken */); node.whenFalse = parseAssignmentExpression(noIn); expr = finishNode(node); } @@ -4385,7 +3937,7 @@ var ts; while (true) { reScanGreaterToken(); var precedence = getOperatorPrecedence(); - if (precedence && precedence > minPrecedence && (!noIn || token !== 80 /* InKeyword */)) { + if (precedence && precedence > minPrecedence && (!noIn || token !== 84 /* InKeyword */)) { var operator = token; nextToken(); expr = makeBinaryExpression(expr, operator, parseBinaryOperators(parseUnaryExpression(), precedence, noIn)); @@ -4396,44 +3948,44 @@ var ts; } function getOperatorPrecedence() { switch (token) { - case 44 /* BarBarToken */: + case 48 /* BarBarToken */: return 1; - case 43 /* AmpersandAmpersandToken */: + case 47 /* AmpersandAmpersandToken */: return 2; - case 39 /* BarToken */: + case 43 /* BarToken */: return 3; - case 40 /* CaretToken */: + case 44 /* CaretToken */: return 4; - case 38 /* AmpersandToken */: + case 42 /* AmpersandToken */: return 5; - case 23 /* EqualsEqualsToken */: - case 24 /* ExclamationEqualsToken */: - case 25 /* EqualsEqualsEqualsToken */: - case 26 /* ExclamationEqualsEqualsToken */: + case 27 /* EqualsEqualsToken */: + case 28 /* ExclamationEqualsToken */: + case 29 /* EqualsEqualsEqualsToken */: + case 30 /* ExclamationEqualsEqualsToken */: return 6; - case 19 /* LessThanToken */: - case 20 /* GreaterThanToken */: - case 21 /* LessThanEqualsToken */: - case 22 /* GreaterThanEqualsToken */: - case 81 /* InstanceOfKeyword */: - case 80 /* InKeyword */: + case 23 /* LessThanToken */: + case 24 /* GreaterThanToken */: + case 25 /* LessThanEqualsToken */: + case 26 /* GreaterThanEqualsToken */: + case 85 /* InstanceOfKeyword */: + case 84 /* InKeyword */: return 7; - case 35 /* LessThanLessThanToken */: - case 36 /* GreaterThanGreaterThanToken */: - case 37 /* GreaterThanGreaterThanGreaterThanToken */: + case 39 /* LessThanLessThanToken */: + case 40 /* GreaterThanGreaterThanToken */: + case 41 /* GreaterThanGreaterThanGreaterThanToken */: return 8; - case 28 /* PlusToken */: - case 29 /* MinusToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: return 9; - case 30 /* AsteriskToken */: - case 31 /* SlashToken */: - case 32 /* PercentToken */: + case 34 /* AsteriskToken */: + case 35 /* SlashToken */: + case 36 /* PercentToken */: return 10; } return undefined; } function makeBinaryExpression(left, operator, right) { - var node = createNode(148 /* BinaryExpression */, left.pos); + var node = createNode(153 /* BinaryExpression */, left.pos); node.left = left; node.operator = operator; node.right = right; @@ -4442,52 +3994,52 @@ var ts; function parseUnaryExpression() { var pos = getNodePos(); switch (token) { - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: - case 41 /* ExclamationToken */: - case 68 /* DeleteKeyword */: - case 91 /* TypeOfKeyword */: - case 93 /* VoidKeyword */: - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: + case 45 /* ExclamationToken */: + case 72 /* DeleteKeyword */: + case 95 /* TypeOfKeyword */: + case 97 /* VoidKeyword */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: var operator = token; nextToken(); var operand = parseUnaryExpression(); if (isInStrictMode) { - if ((operator === 33 /* PlusPlusToken */ || operator === 34 /* MinusMinusToken */) && isEvalOrArgumentsIdentifier(operand)) { + if ((operator === 37 /* PlusPlusToken */ || operator === 38 /* MinusMinusToken */) && isEvalOrArgumentsIdentifier(operand)) { reportInvalidUseInStrictMode(operand); } - else if (operator === 68 /* DeleteKeyword */ && operand.kind === 59 /* Identifier */) { + 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(146 /* PrefixOperator */, pos, operator, operand); - case 19 /* LessThanToken */: + return makeUnaryExpression(151 /* PrefixOperator */, pos, operator, operand); + case 23 /* LessThanToken */: return parseTypeAssertion(); } var primaryExpression = parsePrimaryExpression(); - var illegalUsageOfSuperKeyword = primaryExpression.kind === 85 /* SuperKeyword */ && token !== 11 /* OpenParenToken */ && token !== 15 /* DotToken */; + var illegalUsageOfSuperKeyword = primaryExpression.kind === 89 /* SuperKeyword */ && token !== 15 /* OpenParenToken */ && token !== 19 /* DotToken */; if (illegalUsageOfSuperKeyword) { error(ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); } var expr = parseCallAndAccess(primaryExpression, false); ts.Debug.assert(isLeftHandSideExpression(expr)); - if ((token === 33 /* PlusPlusToken */ || token === 34 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { + if ((token === 37 /* PlusPlusToken */ || token === 38 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { reportInvalidUseInStrictMode(expr); } var operator = token; nextToken(); - expr = makeUnaryExpression(147 /* PostfixOperator */, expr.pos, operator, expr); + expr = makeUnaryExpression(152 /* PostfixOperator */, expr.pos, operator, expr); } return expr; } function parseTypeAssertion() { - var node = createNode(142 /* TypeAssertion */); - parseExpected(19 /* LessThanToken */); + var node = createNode(147 /* TypeAssertion */); + parseExpected(23 /* LessThanToken */); node.type = parseType(); - parseExpected(20 /* GreaterThanToken */); + parseExpected(24 /* GreaterThanToken */); node.operand = parseUnaryExpression(); return finishNode(node); } @@ -4499,11 +4051,11 @@ var ts; } function parseCallAndAccess(expr, inNewExpression) { while (true) { - var dotStart = scanner.getTokenPos(); - if (parseOptional(15 /* DotToken */)) { - var propertyAccess = createNode(138 /* PropertyAccess */, expr.pos); + 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(dotStart, scanner.getStartPos() - dotStart, ts.Diagnostics.Identifier_expected); + grammarErrorAtPos(dotOrBracketStart, scanner.getStartPos() - dotOrBracketStart, ts.Diagnostics.Identifier_expected); var id = createMissingNode(); } else { @@ -4514,13 +4066,12 @@ var ts; expr = finishNode(propertyAccess); continue; } - var bracketStart = scanner.getTokenPos(); - if (parseOptional(13 /* OpenBracketToken */)) { - var indexedAccess = createNode(139 /* IndexedAccess */, expr.pos); + if (parseOptional(17 /* OpenBracketToken */)) { + var indexedAccess = createNode(143 /* IndexedAccess */, expr.pos); indexedAccess.object = expr; - if (inNewExpression && parseOptional(14 /* CloseBracketToken */)) { + if (inNewExpression && parseOptional(18 /* CloseBracketToken */)) { indexedAccess.index = createMissingNode(); - grammarErrorAtPos(bracketStart, scanner.getStartPos() - bracketStart, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); + 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(); @@ -4528,79 +4079,92 @@ var ts; var literal = indexedAccess.index; literal.text = internIdentifier(literal.text); } - parseExpected(14 /* CloseBracketToken */); + parseExpected(18 /* CloseBracketToken */); } expr = finishNode(indexedAccess); continue; } - if ((token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) && !inNewExpression) { - var callExpr = createNode(140 /* CallExpression */, expr.pos); + if ((token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) && !inNewExpression) { + var callExpr = createNode(144 /* CallExpression */, expr.pos); callExpr.func = expr; - if (token === 19 /* LessThanToken */) { + if (token === 23 /* LessThanToken */) { if (!(callExpr.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) return expr; } else { - parseExpected(11 /* OpenParenToken */); + parseExpected(15 /* OpenParenToken */); } callExpr.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression, false); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); expr = finishNode(callExpr); continue; } + if (token === 9 /* NoSubstitutionTemplateLiteral */ || token === 10 /* TemplateHead */) { + var tagExpression = createNode(146 /* 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; } } function parseTypeArgumentsAndOpenParen() { var result = parseTypeArguments(); - parseExpected(11 /* OpenParenToken */); + parseExpected(15 /* OpenParenToken */); return result; } function parseTypeArguments() { var typeArgumentListStart = scanner.getTokenPos(); var errorCountBeforeTypeParameterList = file.syntacticErrors.length; - var result = parseBracketedList(15 /* TypeArguments */, parseSingleTypeArgument, 19 /* LessThanToken */, 20 /* GreaterThanToken */); + 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; } function parseSingleTypeArgument() { - if (token === 18 /* CommaToken */) { + if (token === 22 /* CommaToken */) { var errorStart = scanner.getTokenPos(); var errorLength = scanner.getTextPos() - errorStart; grammarErrorAtPos(errorStart, errorLength, ts.Diagnostics.Type_expected); - return createNode(116 /* Missing */); + return createNode(120 /* Missing */); } return parseType(); } function parsePrimaryExpression() { switch (token) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: + case 87 /* NullKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: return parseTokenNode(); case 6 /* NumericLiteral */: case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: return parseLiteralNode(); - case 11 /* OpenParenToken */: + case 15 /* OpenParenToken */: return parseParenExpression(); - case 13 /* OpenBracketToken */: + case 17 /* OpenBracketToken */: return parseArrayLiteral(); - case 9 /* OpenBraceToken */: + case 13 /* OpenBraceToken */: return parseObjectLiteral(); - case 77 /* FunctionKeyword */: + case 81 /* FunctionKeyword */: return parseFunctionExpression(); - case 82 /* NewKeyword */: + case 86 /* NewKeyword */: return parseNewExpression(); - case 31 /* SlashToken */: - case 51 /* SlashEqualsToken */: + case 35 /* SlashToken */: + case 55 /* SlashEqualsToken */: if (reScanSlashToken() === 8 /* RegularExpressionLiteral */) { return parseLiteralNode(); } break; + case 10 /* TemplateHead */: + return parseTemplateExpression(); default: if (isIdentifier()) { return parseIdentifier(); @@ -4610,20 +4174,20 @@ var ts; return createMissingNode(); } function parseParenExpression() { - var node = createNode(143 /* ParenExpression */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(148 /* ParenExpression */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); return finishNode(node); } function parseAssignmentExpressionOrOmittedExpression(omittedExpressionDiagnostic) { - if (token === 18 /* CommaToken */) { + if (token === 22 /* CommaToken */) { if (omittedExpressionDiagnostic) { var errorStart = scanner.getTokenPos(); var errorLength = scanner.getTextPos() - errorStart; grammarErrorAtPos(errorStart, errorLength, omittedExpressionDiagnostic); } - return createNode(150 /* OmittedExpression */); + return createNode(157 /* OmittedExpression */); } return parseAssignmentExpression(); } @@ -4634,24 +4198,24 @@ var ts; return parseAssignmentExpressionOrOmittedExpression(ts.Diagnostics.Argument_expression_expected); } function parseArrayLiteral() { - var node = createNode(135 /* ArrayLiteral */); - parseExpected(13 /* OpenBracketToken */); + var node = createNode(139 /* ArrayLiteral */); + parseExpected(17 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) node.flags |= 256 /* MultiLine */; node.elements = parseDelimitedList(12 /* ArrayLiteralMembers */, parseArrayLiteralElement, true); - parseExpected(14 /* CloseBracketToken */); + parseExpected(18 /* CloseBracketToken */); return finishNode(node); } function parsePropertyAssignment() { - var node = createNode(137 /* PropertyAssignment */); + var node = createNode(141 /* PropertyAssignment */); node.name = parsePropertyName(); - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); var body = parseBody(false); - node.initializer = makeFunctionExpression(144 /* FunctionExpression */, node.pos, undefined, sig, body); + node.initializer = makeFunctionExpression(149 /* FunctionExpression */, node.pos, undefined, sig, body); } else { - parseExpected(46 /* ColonToken */); + parseExpected(50 /* ColonToken */); node.initializer = parseAssignmentExpression(false); } return finishNode(node); @@ -4659,41 +4223,41 @@ var ts; function parseObjectLiteralMember() { var initialPos = getNodePos(); var initialToken = token; - if (parseContextualModifier(109 /* GetKeyword */) || parseContextualModifier(113 /* SetKeyword */)) { - var kind = initialToken === 109 /* GetKeyword */ ? 123 /* GetAccessor */ : 124 /* SetAccessor */; + if (parseContextualModifier(113 /* GetKeyword */) || parseContextualModifier(117 /* SetKeyword */)) { + var kind = initialToken === 113 /* GetKeyword */ ? 127 /* GetAccessor */ : 128 /* SetAccessor */; return parseAndCheckMemberAccessorDeclaration(kind, initialPos, 0); } return parsePropertyAssignment(); } function parseObjectLiteral() { - var node = createNode(136 /* ObjectLiteral */); - parseExpected(9 /* OpenBraceToken */); + var node = createNode(140 /* ObjectLiteral */); + parseExpected(13 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.flags |= 256 /* MultiLine */; } node.properties = parseDelimitedList(11 /* ObjectLiteralMembers */, parseObjectLiteralMember, true); - parseExpected(10 /* CloseBraceToken */); + 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 === 150 /* OmittedExpression */) { + if (p.kind === 157 /* OmittedExpression */) { return; } var currentKind; - if (p.kind === 137 /* PropertyAssignment */) { + if (p.kind === 141 /* PropertyAssignment */) { currentKind = Property; } - else if (p.kind === 123 /* GetAccessor */) { + else if (p.kind === 127 /* GetAccessor */) { currentKind = GetAccessor; } - else if (p.kind === 124 /* SetAccessor */) { + else if (p.kind === 128 /* SetAccessor */) { currentKind = SetAccesor; } else { - ts.Debug.fail("Unexpected syntax kind:" + ts.SyntaxKind[p.kind]); + ts.Debug.fail("Unexpected syntax kind:" + p.kind); } if (!ts.hasProperty(seen, p.name.text)) { seen[p.name.text] = currentKind; @@ -4722,14 +4286,14 @@ var ts; } function parseFunctionExpression() { var pos = getNodePos(); - parseExpected(77 /* FunctionKeyword */); + parseExpected(81 /* FunctionKeyword */); var name = isIdentifier() ? parseIdentifier() : undefined; - var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); var body = parseBody(false); if (name && isInStrictMode && isEvalOrArgumentsIdentifier(name)) { reportInvalidUseInStrictMode(name); } - return makeFunctionExpression(144 /* FunctionExpression */, pos, name, sig, body); + return makeFunctionExpression(149 /* FunctionExpression */, pos, name, sig, body); } function makeFunctionExpression(kind, pos, name, sig, body) { var node = createNode(kind, pos); @@ -4741,12 +4305,12 @@ var ts; return finishNode(node); } function parseNewExpression() { - var node = createNode(141 /* NewExpression */); - parseExpected(82 /* NewKeyword */); + var node = createNode(145 /* NewExpression */); + parseExpected(86 /* NewKeyword */); node.func = parseCallAndAccess(parsePrimaryExpression(), true); - if (parseOptional(11 /* OpenParenToken */) || token === 19 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { + if (parseOptional(15 /* OpenParenToken */) || token === 23 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { node.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression, false); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); } return finishNode(node); } @@ -4754,10 +4318,10 @@ var ts; return parseStatement(true); } function parseBlock(ignoreMissingOpenBrace, checkForStrictMode) { - var node = createNode(151 /* Block */); - if (parseExpected(9 /* OpenBraceToken */) || ignoreMissingOpenBrace) { + var node = createNode(158 /* Block */); + if (parseExpected(13 /* OpenBraceToken */) || ignoreMissingOpenBrace) { node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatementAllowingLetDeclaration); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.statements = createMissingList(); @@ -4777,7 +4341,7 @@ var ts; } labelledStatementInfo.pushFunctionBoundary(); var block = parseBlock(ignoreMissingOpenBrace, true); - block.kind = 176 /* FunctionBlock */; + block.kind = 183 /* FunctionBlock */; labelledStatementInfo.pop(); inFunctionBody = saveInFunctionBody; inSwitchStatement = saveInSwitchStatement; @@ -4785,40 +4349,40 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(153 /* EmptyStatement */); - parseExpected(17 /* SemicolonToken */); + var node = createNode(160 /* EmptyStatement */); + parseExpected(21 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(155 /* IfStatement */); - parseExpected(78 /* IfKeyword */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(162 /* IfStatement */); + parseExpected(82 /* IfKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); node.thenStatement = parseStatement(false); - node.elseStatement = parseOptional(70 /* ElseKeyword */) ? parseStatement(false) : undefined; + node.elseStatement = parseOptional(74 /* ElseKeyword */) ? parseStatement(false) : undefined; return finishNode(node); } function parseDoStatement() { - var node = createNode(156 /* DoStatement */); - parseExpected(69 /* DoKeyword */); + var node = createNode(163 /* DoStatement */); + parseExpected(73 /* DoKeyword */); var saveInIterationStatement = inIterationStatement; inIterationStatement = 1 /* Nested */; node.statement = parseStatement(false); inIterationStatement = saveInIterationStatement; - parseExpected(94 /* WhileKeyword */); - parseExpected(11 /* OpenParenToken */); + parseExpected(98 /* WhileKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - parseOptional(17 /* SemicolonToken */); + parseExpected(16 /* CloseParenToken */); + parseOptional(21 /* SemicolonToken */); return finishNode(node); } function parseWhileStatement() { - var node = createNode(157 /* WhileStatement */); - parseExpected(94 /* WhileKeyword */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(164 /* WhileStatement */); + parseExpected(98 /* WhileKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); var saveInIterationStatement = inIterationStatement; inIterationStatement = 1 /* Nested */; node.statement = parseStatement(false); @@ -4827,16 +4391,16 @@ var ts; } function parseForOrForInStatement() { var pos = getNodePos(); - parseExpected(76 /* ForKeyword */); - parseExpected(11 /* OpenParenToken */); - if (token !== 17 /* SemicolonToken */) { - if (parseOptional(92 /* VarKeyword */)) { + parseExpected(80 /* ForKeyword */); + parseExpected(15 /* OpenParenToken */); + 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(98 /* LetKeyword */)) { + else if (parseOptional(102 /* LetKeyword */)) { var declarations = parseVariableDeclarationList(2048 /* Let */, true); if (!declarations.length) { error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); @@ -4845,7 +4409,7 @@ var ts; grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); } } - else if (parseOptional(64 /* ConstKeyword */)) { + else if (parseOptional(68 /* ConstKeyword */)) { var declarations = parseVariableDeclarationList(4096 /* Const */, true); if (!declarations.length) { error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); @@ -4859,8 +4423,8 @@ var ts; } } var forOrForInStatement; - if (parseOptional(80 /* InKeyword */)) { - var forInStatement = createNode(159 /* ForInStatement */, pos); + if (parseOptional(84 /* InKeyword */)) { + var forInStatement = createNode(166 /* ForInStatement */, pos); if (declarations) { if (declarations.length > 1) { error(ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); @@ -4871,24 +4435,24 @@ var ts; forInStatement.variable = varOrInit; } forInStatement.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); forOrForInStatement = forInStatement; } else { - var forStatement = createNode(158 /* ForStatement */, pos); + var forStatement = createNode(165 /* ForStatement */, pos); if (declarations) forStatement.declarations = declarations; if (varOrInit) forStatement.initializer = varOrInit; - parseExpected(17 /* SemicolonToken */); - if (token !== 17 /* SemicolonToken */ && token !== 12 /* CloseParenToken */) { + parseExpected(21 /* SemicolonToken */); + if (token !== 21 /* SemicolonToken */ && token !== 16 /* CloseParenToken */) { forStatement.condition = parseExpression(); } - parseExpected(17 /* SemicolonToken */); - if (token !== 12 /* CloseParenToken */) { + parseExpected(21 /* SemicolonToken */); + if (token !== 16 /* CloseParenToken */) { forStatement.iterator = parseExpression(); } - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); forOrForInStatement = forStatement; } var saveInIterationStatement = inIterationStatement; @@ -4900,7 +4464,7 @@ var ts; function parseBreakOrContinueStatement(kind) { var node = createNode(kind); var errorCountBeforeStatement = file.syntacticErrors.length; - parseExpected(kind === 161 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */); + parseExpected(kind === 168 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */); if (!canParseSemicolon()) node.label = parseIdentifier(); parseSemicolon(); @@ -4916,7 +4480,7 @@ var ts; return node; } function checkBareBreakOrContinueStatement(node) { - if (node.kind === 161 /* BreakStatement */) { + if (node.kind === 168 /* BreakStatement */) { if (inIterationStatement === 1 /* Nested */ || inSwitchStatement === 1 /* Nested */) { return; } @@ -4925,7 +4489,7 @@ var ts; return; } } - else if (node.kind === 160 /* ContinueStatement */) { + else if (node.kind === 167 /* ContinueStatement */) { if (inIterationStatement === 1 /* Nested */) { return; } @@ -4941,7 +4505,7 @@ var ts; grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } function checkBreakOrContinueStatementWithLabel(node) { - var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, node.kind === 160 /* ContinueStatement */, false); + var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, node.kind === 167 /* ContinueStatement */, false); if (nodeIsNestedInLabel === 1 /* Nested */) { return; } @@ -4949,10 +4513,10 @@ var ts; grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); return; } - if (node.kind === 160 /* ContinueStatement */) { + 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 === 161 /* BreakStatement */) { + else if (node.kind === 168 /* BreakStatement */) { grammarErrorOnNode(node, ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement); } else { @@ -4960,11 +4524,11 @@ var ts; } } function parseReturnStatement() { - var node = createNode(162 /* ReturnStatement */); + var node = createNode(169 /* ReturnStatement */); var errorCountBeforeReturnStatement = file.syntacticErrors.length; var returnTokenStart = scanner.getTokenPos(); var returnTokenLength = scanner.getTextPos() - returnTokenStart; - parseExpected(84 /* ReturnKeyword */); + parseExpected(88 /* ReturnKeyword */); if (!canParseSemicolon()) node.expression = parseExpression(); parseSemicolon(); @@ -4974,13 +4538,13 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(163 /* WithStatement */); + var node = createNode(170 /* WithStatement */); var startPos = scanner.getTokenPos(); - parseExpected(95 /* WithKeyword */); + parseExpected(99 /* WithKeyword */); var endPos = scanner.getStartPos(); - parseExpected(11 /* OpenParenToken */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); node.statement = parseStatement(false); node = finishNode(node); if (isInStrictMode) { @@ -4989,36 +4553,36 @@ var ts; return node; } function parseCaseClause() { - var node = createNode(165 /* CaseClause */); - parseExpected(61 /* CaseKeyword */); + var node = createNode(172 /* CaseClause */); + parseExpected(65 /* CaseKeyword */); node.expression = parseExpression(); - parseExpected(46 /* ColonToken */); + parseExpected(50 /* ColonToken */); node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatementAllowingLetDeclaration); return finishNode(node); } function parseDefaultClause() { - var node = createNode(166 /* DefaultClause */); - parseExpected(67 /* DefaultKeyword */); - parseExpected(46 /* ColonToken */); + var node = createNode(173 /* DefaultClause */); + parseExpected(71 /* DefaultKeyword */); + parseExpected(50 /* ColonToken */); node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatementAllowingLetDeclaration); return finishNode(node); } function parseCaseOrDefaultClause() { - return token === 61 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); + return token === 65 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(164 /* SwitchStatement */); - parseExpected(86 /* SwitchKeyword */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(171 /* SwitchStatement */); + parseExpected(90 /* SwitchKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - parseExpected(9 /* OpenBraceToken */); + parseExpected(16 /* CloseParenToken */); + parseExpected(13 /* OpenBraceToken */); var saveInSwitchStatement = inSwitchStatement; inSwitchStatement = 1 /* Nested */; node.clauses = parseList(3 /* SwitchClauses */, false, parseCaseOrDefaultClause); inSwitchStatement = saveInSwitchStatement; - parseExpected(10 /* CloseBraceToken */); - var defaultClauses = ts.filter(node.clauses, function (clause) { return clause.kind === 166 /* DefaultClause */; }); + 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); @@ -5028,8 +4592,8 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(168 /* ThrowStatement */); - parseExpected(88 /* ThrowKeyword */); + var node = createNode(175 /* ThrowStatement */); + parseExpected(92 /* ThrowKeyword */); if (scanner.hasPrecedingLineBreak()) { error(ts.Diagnostics.Line_break_not_permitted_here); } @@ -5038,13 +4602,13 @@ var ts; return finishNode(node); } function parseTryStatement() { - var node = createNode(169 /* TryStatement */); - node.tryBlock = parseTokenAndBlock(90 /* TryKeyword */, 170 /* TryBlock */); - if (token === 62 /* CatchKeyword */) { + var node = createNode(176 /* TryStatement */); + node.tryBlock = parseTokenAndBlock(94 /* TryKeyword */, 177 /* TryBlock */); + if (token === 66 /* CatchKeyword */) { node.catchBlock = parseCatchBlock(); } - if (token === 75 /* FinallyKeyword */) { - node.finallyBlock = parseTokenAndBlock(75 /* FinallyKeyword */, 172 /* FinallyBlock */); + if (token === 79 /* FinallyKeyword */) { + node.finallyBlock = parseTokenAndBlock(79 /* FinallyKeyword */, 179 /* FinallyBlock */); } if (!(node.catchBlock || node.finallyBlock)) { error(ts.Diagnostics.catch_or_finally_expected); @@ -5061,15 +4625,15 @@ var ts; } function parseCatchBlock() { var pos = getNodePos(); - parseExpected(62 /* CatchKeyword */); - parseExpected(11 /* OpenParenToken */); + parseExpected(66 /* CatchKeyword */); + parseExpected(15 /* OpenParenToken */); var variable = parseIdentifier(); var typeAnnotationColonStart = scanner.getTokenPos(); var typeAnnotationColonLength = scanner.getTextPos() - typeAnnotationColonStart; var typeAnnotation = parseTypeAnnotation(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); var result = parseBlock(false, false); - result.kind = 171 /* CatchBlock */; + result.kind = 178 /* CatchBlock */; result.pos = pos; result.variable = variable; if (typeAnnotation) { @@ -5081,13 +4645,13 @@ var ts; return result; } function parseDebuggerStatement() { - var node = createNode(173 /* DebuggerStatement */); - parseExpected(66 /* DebuggerKeyword */); + var node = createNode(180 /* DebuggerStatement */); + parseExpected(70 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); } function isIterationStatementStart() { - return token === 94 /* WhileKeyword */ || token === 69 /* DoKeyword */ || token === 76 /* ForKeyword */; + return token === 98 /* WhileKeyword */ || token === 73 /* DoKeyword */ || token === 80 /* ForKeyword */; } function parseStatementWithLabelSet(allowLetAndConstDeclarations) { labelledStatementInfo.pushCurrentLabelSet(isIterationStatementStart()); @@ -5096,12 +4660,12 @@ var ts; return statement; } function isLabel() { - return isIdentifier() && lookAhead(function () { return nextToken() === 46 /* ColonToken */; }); + return isIdentifier() && lookAhead(function () { return nextToken() === 50 /* ColonToken */; }); } function parseLabeledStatement(allowLetAndConstDeclarations) { - var node = createNode(167 /* LabeledStatement */); + var node = createNode(174 /* LabeledStatement */); node.label = parseIdentifier(); - parseExpected(46 /* ColonToken */); + parseExpected(50 /* ColonToken */); if (labelledStatementInfo.nodeIsNestedInLabel(node.label, false, true)) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, getTextOfNodeFromSourceText(sourceText, node.label)); } @@ -5110,91 +4674,93 @@ var ts; return finishNode(node); } function parseExpressionStatement() { - var node = createNode(154 /* ExpressionStatement */); + var node = createNode(161 /* ExpressionStatement */); node.expression = parseExpression(); parseSemicolon(); return finishNode(node); } function isStatement(inErrorRecovery) { switch (token) { - case 17 /* SemicolonToken */: + case 21 /* SemicolonToken */: return !inErrorRecovery; - case 9 /* OpenBraceToken */: - case 92 /* VarKeyword */: - case 98 /* LetKeyword */: - case 64 /* ConstKeyword */: - case 77 /* FunctionKeyword */: - case 78 /* IfKeyword */: - case 69 /* DoKeyword */: - case 94 /* WhileKeyword */: - case 76 /* ForKeyword */: - case 65 /* ContinueKeyword */: - case 60 /* BreakKeyword */: - case 84 /* ReturnKeyword */: - case 95 /* WithKeyword */: - case 86 /* SwitchKeyword */: - case 88 /* ThrowKeyword */: - case 90 /* TryKeyword */: - case 66 /* DebuggerKeyword */: - case 62 /* CatchKeyword */: - case 75 /* FinallyKeyword */: + case 13 /* OpenBraceToken */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + case 81 /* FunctionKeyword */: + case 82 /* IfKeyword */: + case 73 /* DoKeyword */: + case 98 /* WhileKeyword */: + case 80 /* ForKeyword */: + case 69 /* ContinueKeyword */: + case 64 /* BreakKeyword */: + case 88 /* ReturnKeyword */: + case 99 /* WithKeyword */: + case 90 /* SwitchKeyword */: + case 92 /* ThrowKeyword */: + case 94 /* TryKeyword */: + case 70 /* DebuggerKeyword */: + case 66 /* CatchKeyword */: + case 79 /* FinallyKeyword */: return true; - case 97 /* InterfaceKeyword */: - case 63 /* ClassKeyword */: - case 110 /* ModuleKeyword */: - case 71 /* EnumKeyword */: - case 115 /* TypeKeyword */: - if (isDeclaration()) { + case 68 /* ConstKeyword */: + var isConstEnum = lookAhead(function () { return nextToken() === 75 /* EnumKeyword */; }); + return !isConstEnum; + case 101 /* InterfaceKeyword */: + case 67 /* ClassKeyword */: + case 114 /* ModuleKeyword */: + case 75 /* EnumKeyword */: + case 119 /* TypeKeyword */: + if (isDeclarationStart()) { return false; } - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: - case 103 /* StaticKeyword */: - if (lookAhead(function () { return nextToken() >= 59 /* Identifier */; })) { + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: + case 107 /* StaticKeyword */: + if (lookAhead(function () { return nextToken() >= 63 /* Identifier */; })) { return false; } default: - return isExpression(); + return isStartOfExpression(); } } function parseStatement(allowLetAndConstDeclarations) { switch (token) { - case 9 /* OpenBraceToken */: + case 13 /* OpenBraceToken */: return parseBlock(false, false); - case 92 /* VarKeyword */: - case 98 /* LetKeyword */: - case 64 /* ConstKeyword */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + case 68 /* ConstKeyword */: return parseVariableStatement(allowLetAndConstDeclarations); - case 77 /* FunctionKeyword */: + case 81 /* FunctionKeyword */: return parseFunctionDeclaration(); - case 17 /* SemicolonToken */: + case 21 /* SemicolonToken */: return parseEmptyStatement(); - case 78 /* IfKeyword */: + case 82 /* IfKeyword */: return parseIfStatement(); - case 69 /* DoKeyword */: + case 73 /* DoKeyword */: return parseDoStatement(); - case 94 /* WhileKeyword */: + case 98 /* WhileKeyword */: return parseWhileStatement(); - case 76 /* ForKeyword */: + case 80 /* ForKeyword */: return parseForOrForInStatement(); - case 65 /* ContinueKeyword */: - return parseBreakOrContinueStatement(160 /* ContinueStatement */); - case 60 /* BreakKeyword */: - return parseBreakOrContinueStatement(161 /* BreakStatement */); - case 84 /* ReturnKeyword */: + case 69 /* ContinueKeyword */: + return parseBreakOrContinueStatement(167 /* ContinueStatement */); + case 64 /* BreakKeyword */: + return parseBreakOrContinueStatement(168 /* BreakStatement */); + case 88 /* ReturnKeyword */: return parseReturnStatement(); - case 95 /* WithKeyword */: + case 99 /* WithKeyword */: return parseWithStatement(); - case 86 /* SwitchKeyword */: + case 90 /* SwitchKeyword */: return parseSwitchStatement(); - case 88 /* ThrowKeyword */: + case 92 /* ThrowKeyword */: return parseThrowStatement(); - case 90 /* TryKeyword */: - case 62 /* CatchKeyword */: - case 75 /* FinallyKeyword */: + case 94 /* TryKeyword */: + case 66 /* CatchKeyword */: + case 79 /* FinallyKeyword */: return parseTryStatement(); - case 66 /* DebuggerKeyword */: + case 70 /* DebuggerKeyword */: return parseDebuggerStatement(); default: if (isLabel()) { @@ -5206,7 +4772,7 @@ var ts; function parseAndCheckFunctionBody(isConstructor) { var initialPosition = scanner.getTokenPos(); var errorCountBeforeBody = file.syntacticErrors.length; - if (token === 9 /* OpenBraceToken */) { + 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; @@ -5221,7 +4787,7 @@ var ts; error(ts.Diagnostics.Block_or_expected); } function parseVariableDeclaration(flags, noIn) { - var node = createNode(174 /* VariableDeclaration */); + var node = createNode(181 /* VariableDeclaration */); node.flags = flags; var errorCountBeforeVariableDeclaration = file.syntacticErrors.length; node.name = parseIdentifier(); @@ -5244,17 +4810,17 @@ var ts; return parseDelimitedList(9 /* VariableDeclarations */, function () { return parseVariableDeclaration(flags, noIn); }, false); } function parseVariableStatement(allowLetAndConstDeclarations, pos, flags) { - var node = createNode(152 /* VariableStatement */, pos); + var node = createNode(159 /* VariableStatement */, pos); if (flags) node.flags = flags; var errorCountBeforeVarStatement = file.syntacticErrors.length; - if (token === 98 /* LetKeyword */) { + if (token === 102 /* LetKeyword */) { node.flags |= 2048 /* Let */; } - else if (token === 64 /* ConstKeyword */) { + else if (token === 68 /* ConstKeyword */) { node.flags |= 4096 /* Const */; } - else if (token !== 92 /* VarKeyword */) { + else if (token !== 96 /* VarKeyword */) { error(ts.Diagnostics.var_let_or_const_expected); } nextToken(); @@ -5283,12 +4849,12 @@ var ts; return node; } function parseFunctionDeclaration(pos, flags) { - var node = createNode(175 /* FunctionDeclaration */, pos); + var node = createNode(182 /* FunctionDeclaration */, pos); if (flags) node.flags = flags; - parseExpected(77 /* FunctionKeyword */); + parseExpected(81 /* FunctionKeyword */); node.name = parseIdentifier(); - var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; @@ -5299,10 +4865,10 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(pos, flags) { - var node = createNode(122 /* Constructor */, pos); + var node = createNode(126 /* Constructor */, pos); node.flags = flags; - parseExpected(107 /* ConstructorKeyword */); - var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); + parseExpected(111 /* ConstructorKeyword */); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; @@ -5319,14 +4885,14 @@ var ts; var errorCountBeforePropertyDeclaration = file.syntacticErrors.length; var name = parsePropertyName(); var questionStart = scanner.getTokenPos(); - if (parseOptional(45 /* QuestionToken */)) { + if (parseOptional(49 /* QuestionToken */)) { errorAtPos(questionStart, scanner.getStartPos() - questionStart, ts.Diagnostics.A_class_member_cannot_be_declared_optional); } - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - var method = createNode(121 /* Method */, pos); + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + var method = createNode(125 /* Method */, pos); method.flags = flags; method.name = name; - var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); method.typeParameters = sig.typeParameters; method.parameters = sig.parameters; method.type = sig.type; @@ -5334,7 +4900,7 @@ var ts; return finishNode(method); } else { - var property = createNode(120 /* Property */, pos); + var property = createNode(124 /* Property */, pos); property.flags = flags; property.name = name; property.type = parseTypeAnnotation(); @@ -5361,10 +4927,10 @@ var ts; else if (accessor.typeParameters) { grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 123 /* GetAccessor */ && accessor.parameters.length) { + else if (kind === 127 /* GetAccessor */ && accessor.parameters.length) { grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 124 /* SetAccessor */) { + else if (kind === 128 /* SetAccessor */) { if (accessor.type) { grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -5376,7 +4942,7 @@ var ts; if (parameter.flags & 8 /* Rest */) { grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter); } - else if (parameter.flags & ts.NodeFlags.Modifier) { + 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 */) { @@ -5394,7 +4960,7 @@ var ts; var node = createNode(kind, pos); node.flags = flags; node.name = parsePropertyName(); - var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; @@ -5417,19 +4983,19 @@ var ts; idToken = token; nextToken(); } - if (token === 13 /* OpenBracketToken */) { + if (token === 17 /* OpenBracketToken */) { return true; } if (idToken !== undefined) { - if (!isKeyword(idToken) || idToken === 113 /* SetKeyword */ || idToken === 109 /* GetKeyword */) { + if (!isKeyword(idToken) || idToken === 117 /* SetKeyword */ || idToken === 113 /* GetKeyword */) { return true; } switch (token) { - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - case 46 /* ColonToken */: - case 47 /* EqualsToken */: - case 45 /* QuestionToken */: + case 15 /* OpenParenToken */: + case 23 /* LessThanToken */: + case 50 /* ColonToken */: + case 51 /* EqualsToken */: + case 49 /* QuestionToken */: return true; default: return canParseSemicolon(); @@ -5454,8 +5020,8 @@ var ts; break; var modifierLength = scanner.getStartPos() - modifierStart; switch (modifierToken) { - case 102 /* PublicKeyword */: - if (flags & ts.NodeFlags.AccessibilityModifier) { + case 106 /* PublicKeyword */: + if (flags & 112 /* AccessibilityModifier */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); } else if (flags & 128 /* Static */) { @@ -5466,8 +5032,8 @@ var ts; } flags |= 16 /* Public */; break; - case 100 /* PrivateKeyword */: - if (flags & ts.NodeFlags.AccessibilityModifier) { + case 104 /* PrivateKeyword */: + if (flags & 112 /* AccessibilityModifier */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); } else if (flags & 128 /* Static */) { @@ -5480,7 +5046,7 @@ var ts; lastPrivateModifierLength = modifierLength; flags |= 32 /* Private */; break; - case 101 /* ProtectedKeyword */: + case 105 /* ProtectedKeyword */: if (flags & 16 /* Public */ || flags & 32 /* Private */ || flags & 64 /* Protected */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); } @@ -5494,7 +5060,7 @@ var ts; lastProtectedModifierLength = modifierLength; flags |= 64 /* Protected */; break; - case 103 /* StaticKeyword */: + case 107 /* StaticKeyword */: if (flags & 128 /* Static */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "static"); } @@ -5508,7 +5074,7 @@ var ts; lastStaticModifierLength = modifierLength; flags |= 128 /* Static */; break; - case 72 /* ExportKeyword */: + case 76 /* ExportKeyword */: if (flags & 1 /* Export */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "export"); } @@ -5523,7 +5089,7 @@ var ts; } flags |= 1 /* Export */; break; - case 108 /* DeclareKeyword */: + case 112 /* DeclareKeyword */: if (flags & 2 /* Ambient */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "declare"); } @@ -5542,26 +5108,26 @@ var ts; break; } } - if (token === 107 /* ConstructorKeyword */ && flags & 128 /* Static */) { + if (token === 111 /* ConstructorKeyword */ && flags & 128 /* Static */) { grammarErrorAtPos(lastStaticModifierStart, lastStaticModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } - else if (token === 107 /* ConstructorKeyword */ && flags & 32 /* Private */) { + 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 === 107 /* ConstructorKeyword */ && flags & 64 /* Protected */) { + 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 === 79 /* ImportKeyword */) { + 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 === 97 /* InterfaceKeyword */) { + 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 !== 72 /* ExportKeyword */ && !(flags & 2 /* Ambient */) && inAmbientContext && context === 0 /* SourceElements */) { + 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); @@ -5571,19 +5137,19 @@ var ts; function parseClassMemberDeclaration() { var pos = getNodePos(); var flags = parseAndCheckModifiers(2 /* ClassMembers */); - if (parseContextualModifier(109 /* GetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(123 /* GetAccessor */, pos, flags); + if (parseContextualModifier(113 /* GetKeyword */)) { + return parseAndCheckMemberAccessorDeclaration(127 /* GetAccessor */, pos, flags); } - if (parseContextualModifier(113 /* SetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(124 /* SetAccessor */, pos, flags); + if (parseContextualModifier(117 /* SetKeyword */)) { + return parseAndCheckMemberAccessorDeclaration(128 /* SetAccessor */, pos, flags); } - if (token === 107 /* ConstructorKeyword */) { + if (token === 111 /* ConstructorKeyword */) { return parseConstructorDeclaration(pos, flags); } - if (token >= 59 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { + if (token >= 63 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { return parsePropertyMemberDeclaration(pos, flags); } - if (token === 13 /* OpenBracketToken */) { + if (token === 17 /* OpenBracketToken */) { if (flags) { var start = getTokenPos(pos); var length = getNodePos() - start; @@ -5594,23 +5160,23 @@ var ts; ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassDeclaration(pos, flags) { - var node = createNode(177 /* ClassDeclaration */, pos); + var node = createNode(184 /* ClassDeclaration */, pos); node.flags = flags; var errorCountBeforeClassDeclaration = file.syntacticErrors.length; - parseExpected(63 /* ClassKeyword */); + parseExpected(67 /* ClassKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); - node.baseType = parseOptional(73 /* ExtendsKeyword */) ? parseTypeReference() : undefined; + node.baseType = parseOptional(77 /* ExtendsKeyword */) ? parseTypeReference() : undefined; var implementsKeywordStart = scanner.getTokenPos(); var implementsKeywordLength; - if (parseOptional(96 /* ImplementsKeyword */)) { + if (parseOptional(100 /* ImplementsKeyword */)) { implementsKeywordLength = scanner.getStartPos() - implementsKeywordStart; node.implementedTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); } var errorCountBeforeClassBody = file.syntacticErrors.length; - if (parseExpected(9 /* OpenBraceToken */)) { + if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseList(6 /* ClassMembers */, false, parseClassMemberDeclaration); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -5621,15 +5187,15 @@ var ts; return finishNode(node); } function parseInterfaceDeclaration(pos, flags) { - var node = createNode(178 /* InterfaceDeclaration */, pos); + var node = createNode(185 /* InterfaceDeclaration */, pos); node.flags = flags; var errorCountBeforeInterfaceDeclaration = file.syntacticErrors.length; - parseExpected(97 /* InterfaceKeyword */); + parseExpected(101 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); var extendsKeywordStart = scanner.getTokenPos(); var extendsKeywordLength; - if (parseOptional(73 /* ExtendsKeyword */)) { + if (parseOptional(77 /* ExtendsKeyword */)) { extendsKeywordLength = scanner.getStartPos() - extendsKeywordStart; node.baseTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); } @@ -5641,30 +5207,24 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(pos, flags) { - var node = createNode(179 /* TypeAliasDeclaration */, pos); + var node = createNode(186 /* TypeAliasDeclaration */, pos); node.flags = flags; - parseExpected(115 /* TypeKeyword */); + parseExpected(119 /* TypeKeyword */); node.name = parseIdentifier(); - parseExpected(47 /* EqualsToken */); + parseExpected(51 /* EqualsToken */); node.type = parseType(); parseSemicolon(); - var n = node.type; - while (n.kind === 134 /* ParenType */) { - n = n.type; - } - if (n.kind === 130 /* TypeLiteral */ && (n.pos !== n.members.pos || n.end !== n.members.end)) { - grammarErrorOnNode(node.type, ts.Diagnostics.Aliased_type_cannot_be_an_object_type_literal_Use_an_interface_declaration_instead); - } return finishNode(node); } 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 === 146 /* PrefixOperator */) { + if (expression.kind === 151 /* PrefixOperator */) { var unaryExpression = expression; - if (unaryExpression.operator === 28 /* PlusToken */ || unaryExpression.operator === 29 /* MinusToken */) { + if (unaryExpression.operator === 32 /* PlusToken */ || unaryExpression.operator === 33 /* MinusToken */) { expression = unaryExpression.operand; } } @@ -5675,30 +5235,35 @@ var ts; } var inConstantEnumMemberSection = true; function parseAndCheckEnumMember() { - var node = createNode(185 /* EnumMember */); + var node = createNode(192 /* EnumMember */); var errorCountBeforeEnumMember = file.syntacticErrors.length; node.name = parsePropertyName(); node.initializer = parseInitializer(false); - 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); + 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); } - } - 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(180 /* EnumDeclaration */, pos); + var node = createNode(187 /* EnumDeclaration */, pos); node.flags = flags; - parseExpected(71 /* EnumKeyword */); + if (enumIsConst) { + parseExpected(68 /* ConstKeyword */); + } + parseExpected(75 /* EnumKeyword */); node.name = parseIdentifier(); - if (parseExpected(9 /* OpenBraceToken */)) { + if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseDelimitedList(7 /* EnumMembers */, parseAndCheckEnumMember, true); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -5706,10 +5271,10 @@ var ts; return finishNode(node); } function parseModuleBody() { - var node = createNode(182 /* ModuleBlock */); - if (parseExpected(9 /* OpenBraceToken */)) { + var node = createNode(189 /* ModuleBlock */); + if (parseExpected(13 /* OpenBraceToken */)) { node.statements = parseList(1 /* ModuleElements */, false, parseModuleElement); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.statements = createMissingList(); @@ -5717,19 +5282,19 @@ var ts; return finishNode(node); } function parseInternalModuleTail(pos, flags) { - var node = createNode(181 /* ModuleDeclaration */, pos); + var node = createNode(188 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseIdentifier(); - if (parseOptional(15 /* DotToken */)) { + if (parseOptional(19 /* DotToken */)) { node.body = parseInternalModuleTail(getNodePos(), 1 /* Export */); } else { node.body = parseModuleBody(); ts.forEach(node.body.statements, function (s) { - if (s.kind === 184 /* ExportAssignment */) { + if (s.kind === 191 /* ExportAssignment */) { grammarErrorOnNode(s, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); } - else if (s.kind === 183 /* ImportDeclaration */ && s.externalModuleName) { + else if (s.kind === 190 /* ImportDeclaration */ && s.externalModuleName) { grammarErrorOnNode(s, ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); } }); @@ -5737,7 +5302,7 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(pos, flags) { - var node = createNode(181 /* ModuleDeclaration */, pos); + var node = createNode(188 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseStringLiteral(); if (!inAmbientContext) { @@ -5753,19 +5318,19 @@ var ts; return finishNode(node); } function parseModuleDeclaration(pos, flags) { - parseExpected(110 /* ModuleKeyword */); + parseExpected(114 /* ModuleKeyword */); return token === 7 /* StringLiteral */ ? parseAmbientExternalModuleDeclaration(pos, flags) : parseInternalModuleTail(pos, flags); } function parseImportDeclaration(pos, flags) { - var node = createNode(183 /* ImportDeclaration */, pos); + var node = createNode(190 /* ImportDeclaration */, pos); node.flags = flags; - parseExpected(79 /* ImportKeyword */); + parseExpected(83 /* ImportKeyword */); node.name = parseIdentifier(); - parseExpected(47 /* EqualsToken */); + parseExpected(51 /* EqualsToken */); var entityName = parseEntityName(false); - if (entityName.kind === 59 /* Identifier */ && entityName.text === "require" && parseOptional(11 /* OpenParenToken */)) { + if (entityName.kind === 63 /* Identifier */ && entityName.text === "require" && parseOptional(15 /* OpenParenToken */)) { node.externalModuleName = parseStringLiteral(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); } else { node.entityName = entityName; @@ -5774,36 +5339,36 @@ var ts; return finishNode(node); } function parseExportAssignmentTail(pos) { - var node = createNode(184 /* ExportAssignment */, pos); + var node = createNode(191 /* ExportAssignment */, pos); node.exportName = parseIdentifier(); parseSemicolon(); return finishNode(node); } - function isDeclaration() { + function isDeclarationStart() { switch (token) { - case 92 /* VarKeyword */: - case 98 /* LetKeyword */: - case 64 /* ConstKeyword */: - case 77 /* FunctionKeyword */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + case 68 /* ConstKeyword */: + case 81 /* FunctionKeyword */: return true; - case 63 /* ClassKeyword */: - case 97 /* InterfaceKeyword */: - case 71 /* EnumKeyword */: - case 79 /* ImportKeyword */: - case 115 /* TypeKeyword */: - return lookAhead(function () { return nextToken() >= 59 /* Identifier */; }); - case 110 /* ModuleKeyword */: - return lookAhead(function () { return nextToken() >= 59 /* Identifier */ || token === 7 /* StringLiteral */; }); - case 72 /* ExportKeyword */: - return lookAhead(function () { return nextToken() === 47 /* EqualsToken */ || isDeclaration(); }); - case 108 /* DeclareKeyword */: - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: - case 103 /* StaticKeyword */: + case 67 /* ClassKeyword */: + case 101 /* InterfaceKeyword */: + case 75 /* EnumKeyword */: + case 83 /* ImportKeyword */: + case 119 /* TypeKeyword */: + return lookAhead(function () { return nextToken() >= 63 /* Identifier */; }); + case 114 /* ModuleKeyword */: + return lookAhead(function () { return nextToken() >= 63 /* Identifier */ || token === 7 /* StringLiteral */; }); + case 76 /* ExportKeyword */: + return lookAhead(function () { return nextToken() === 51 /* EqualsToken */ || isDeclarationStart(); }); + case 112 /* DeclareKeyword */: + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: + case 107 /* StaticKeyword */: return lookAhead(function () { nextToken(); - return isDeclaration(); + return isDeclarationStart(); }); } } @@ -5811,10 +5376,10 @@ var ts; var pos = getNodePos(); var errorCountBeforeModifiers = file.syntacticErrors.length; var flags = parseAndCheckModifiers(modifierContext); - if (token === 72 /* ExportKeyword */) { + if (token === 76 /* ExportKeyword */) { var modifiersEnd = scanner.getStartPos(); nextToken(); - if (parseOptional(47 /* EqualsToken */)) { + if (parseOptional(51 /* EqualsToken */)) { var exportAssignmentTail = parseExportAssignmentTail(pos); if (flags !== 0 && errorCountBeforeModifiers === file.syntacticErrors.length) { var modifiersStart = ts.skipTrivia(sourceText, pos); @@ -5829,30 +5394,38 @@ var ts; } var result; switch (token) { - case 92 /* VarKeyword */: - case 98 /* LetKeyword */: - case 64 /* ConstKeyword */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: result = parseVariableStatement(true, pos, flags); break; - case 77 /* FunctionKeyword */: + case 68 /* ConstKeyword */: + var isConstEnum = lookAhead(function () { return nextToken() === 75 /* EnumKeyword */; }); + if (isConstEnum) { + result = parseAndCheckEnumDeclaration(pos, flags | 4096 /* Const */); + } + else { + result = parseVariableStatement(true, pos, flags); + } + break; + case 81 /* FunctionKeyword */: result = parseFunctionDeclaration(pos, flags); break; - case 63 /* ClassKeyword */: + case 67 /* ClassKeyword */: result = parseClassDeclaration(pos, flags); break; - case 97 /* InterfaceKeyword */: + case 101 /* InterfaceKeyword */: result = parseInterfaceDeclaration(pos, flags); break; - case 115 /* TypeKeyword */: + case 119 /* TypeKeyword */: result = parseTypeAliasDeclaration(pos, flags); break; - case 71 /* EnumKeyword */: + case 75 /* EnumKeyword */: result = parseAndCheckEnumDeclaration(pos, flags); break; - case 110 /* ModuleKeyword */: + case 114 /* ModuleKeyword */: result = parseModuleDeclaration(pos, flags); break; - case 79 /* ImportKeyword */: + case 83 /* ImportKeyword */: result = parseImportDeclaration(pos, flags); break; default: @@ -5862,7 +5435,7 @@ var ts; return result; } function isSourceElement(inErrorRecovery) { - return isDeclaration() || isStatement(inErrorRecovery); + return isDeclarationStart() || isStatement(inErrorRecovery); } function parseSourceElement() { return parseSourceElementOrModuleElement(0 /* SourceElements */); @@ -5871,7 +5444,7 @@ var ts; return parseSourceElementOrModuleElement(1 /* ModuleElements */); } function parseSourceElementOrModuleElement(modifierContext) { - if (isDeclaration()) { + if (isDeclarationStart()) { return parseDeclaration(modifierContext); } var statementStart = scanner.getTokenPos(); @@ -5929,7 +5502,7 @@ var ts; }; } function getExternalModuleIndicator() { - return ts.forEach(file.statements, function (node) { return node.flags & 1 /* Export */ || node.kind === 183 /* ImportDeclaration */ && node.externalModuleName || node.kind === 184 /* ExportAssignment */ ? node : undefined; }); + return ts.forEach(file.statements, function (node) { return node.flags & 1 /* Export */ || node.kind === 190 /* ImportDeclaration */ && node.externalModuleName || node.kind === 191 /* ExportAssignment */ ? node : undefined; }); } scanner = ts.createScanner(languageVersion, true, sourceText, scanError, onComment); var rootNodeFlags = 0; @@ -5937,7 +5510,7 @@ var ts; rootNodeFlags = 1024 /* DeclarationFile */; inAmbientContext = true; } - file = createRootNode(186 /* SourceFile */, 0, sourceText.length, rootNodeFlags); + file = createRootNode(193 /* SourceFile */, 0, sourceText.length, rootNodeFlags); file.filename = ts.normalizePath(filename); file.text = sourceText; file.getLineAndCharacterFromPosition = getLineAndCharacterlFromSourcePosition; @@ -6070,7 +5643,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 183 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 190 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -6088,9 +5661,9 @@ var ts; } } } - else if (node.kind === 181 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { + else if (node.kind === 188 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { forEachChild(node.body, function (node) { - if (node.kind === 183 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 190 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -6162,24 +5735,40 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - function isInstantiated(node) { - if (node.kind === 178 /* InterfaceDeclaration */) { - return false; + function getModuleInstanceState(node) { + if (node.kind === 185 /* InterfaceDeclaration */) { + return 0 /* NonInstantiated */; } - else if (node.kind === 183 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { - return false; + else if (node.kind === 187 /* EnumDeclaration */ && ts.isConstEnumDeclaration(node)) { + return 2 /* ConstEnumOnly */; } - else if (node.kind === 182 /* ModuleBlock */ && !ts.forEachChild(node, isInstantiated)) { - return false; + else if (node.kind === 190 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { + return 0 /* NonInstantiated */; } - else if (node.kind === 181 /* ModuleDeclaration */ && !isInstantiated(node.body)) { - return false; + else if (node.kind === 189 /* ModuleBlock */) { + var state = 0 /* NonInstantiated */; + ts.forEachChild(node, function (n) { + switch (getModuleInstanceState(n)) { + case 0 /* NonInstantiated */: + return false; + case 2 /* ConstEnumOnly */: + state = 2 /* ConstEnumOnly */; + return false; + case 1 /* Instantiated */: + state = 1 /* Instantiated */; + return true; + } + }); + return state; + } + else if (node.kind === 188 /* ModuleDeclaration */) { + return getModuleInstanceState(node.body); } else { - return true; + return 1 /* Instantiated */; } } - ts.isInstantiated = isInstantiated; + ts.getModuleInstanceState = getModuleInstanceState; function bindSourceFile(file) { var parent; var container; @@ -6202,30 +5791,26 @@ var ts; if (!symbol.declarations) symbol.declarations = []; symbol.declarations.push(node); - if (symbolKind & ts.SymbolFlags.HasExports && !symbol.exports) + if (symbolKind & 1952 /* HasExports */ && !symbol.exports) symbol.exports = {}; - if (symbolKind & ts.SymbolFlags.HasMembers && !symbol.members) + if (symbolKind & 6240 /* HasMembers */ && !symbol.members) symbol.members = {}; node.symbol = symbol; - if (symbolKind & ts.SymbolFlags.Value && !symbol.valueDeclaration) + if (symbolKind & 107455 /* Value */ && !symbol.valueDeclaration) symbol.valueDeclaration = node; } function getDeclarationName(node) { if (node.name) { - if (node.kind === 181 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { + if (node.kind === 188 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { return '"' + node.name.text + '"'; } return node.name.text; } switch (node.kind) { - case 122 /* Constructor */: - return "__constructor"; - case 125 /* CallSignature */: - return "__call"; - case 126 /* ConstructSignature */: - return "__new"; - case 127 /* IndexSignature */: - return "__index"; + case 126 /* Constructor */: return "__constructor"; + case 129 /* CallSignature */: return "__call"; + case 130 /* ConstructSignature */: return "__new"; + case 131 /* IndexSignature */: return "__index"; } } function getDisplayName(node) { @@ -6252,8 +5837,8 @@ var ts; } addDeclarationToSymbol(symbol, node, includes); symbol.parent = parent; - if (node.kind === 177 /* ClassDeclaration */ && symbol.exports) { - var prototypeSymbol = createSymbol(4 /* Property */ | 268435456 /* Prototype */, "prototype"); + if (node.kind === 184 /* 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; @@ -6275,16 +5860,16 @@ var ts; } function declareModuleMember(node, symbolKind, symbolExcludes) { var exportKind = 0; - if (symbolKind & ts.SymbolFlags.Value) { - exportKind |= 2097152 /* ExportValue */; + if (symbolKind & 107455 /* Value */) { + exportKind |= 4194304 /* ExportValue */; } - if (symbolKind & ts.SymbolFlags.Type) { - exportKind |= 4194304 /* ExportType */; + if (symbolKind & 3152352 /* Type */) { + exportKind |= 8388608 /* ExportType */; } - if (symbolKind & ts.SymbolFlags.Namespace) { - exportKind |= 8388608 /* ExportNamespace */; + if (symbolKind & 1536 /* Namespace */) { + exportKind |= 16777216 /* ExportNamespace */; } - if (node.flags & 1 /* Export */ || (node.kind !== 183 /* ImportDeclaration */ && isAmbientContext(container))) { + if (node.flags & 1 /* Export */ || (node.kind !== 190 /* 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); @@ -6299,14 +5884,14 @@ var ts; } } function bindChildren(node, symbolKind, isBlockScopeContainer) { - if (symbolKind & ts.SymbolFlags.HasLocals) { + if (symbolKind & 1041936 /* HasLocals */) { node.locals = {}; } var saveParent = parent; var saveContainer = container; var savedBlockScopeContainer = blockScopeContainer; parent = node; - if (symbolKind & ts.SymbolFlags.IsContainer) { + if (symbolKind & 1048560 /* IsContainer */) { container = node; if (lastContainer !== container && !container.nextContainer) { if (lastContainer) { @@ -6325,59 +5910,68 @@ var ts; } function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { switch (container.kind) { - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 186 /* SourceFile */: + case 193 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; } - case 125 /* CallSignature */: - case 126 /* ConstructSignature */: - case 127 /* IndexSignature */: - case 121 /* Method */: - case 122 /* Constructor */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 175 /* FunctionDeclaration */: - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); break; - case 177 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: if (node.flags & 128 /* Static */) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - case 130 /* TypeLiteral */: - case 136 /* ObjectLiteral */: - case 178 /* InterfaceDeclaration */: + case 134 /* TypeLiteral */: + case 140 /* ObjectLiteral */: + case 185 /* InterfaceDeclaration */: declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); break; - case 180 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } bindChildren(node, symbolKind, isBlockScopeContainer); } function bindConstructorDeclaration(node) { - bindDeclaration(node, 8192 /* Constructor */, 0, true); + bindDeclaration(node, 16384 /* Constructor */, 0, true); ts.forEach(node.parameters, function (p) { if (p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */)) { - bindDeclaration(p, 4 /* Property */, ts.SymbolFlags.PropertyExcludes, false); + bindDeclaration(p, 4 /* Property */, 107455 /* PropertyExcludes */, false); } }); } function bindModuleDeclaration(node) { if (node.name.kind === 7 /* StringLiteral */) { - bindDeclaration(node, 256 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes, true); - } - else if (isInstantiated(node)) { - bindDeclaration(node, 256 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes, true); + bindDeclaration(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */, true); } else { - bindDeclaration(node, 512 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */, true); + var state = getModuleInstanceState(node); + if (state === 0 /* NonInstantiated */) { + bindDeclaration(node, 1024 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */, true); + } + else { + bindDeclaration(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */, true); + if (state === 2 /* ConstEnumOnly */) { + node.symbol.constEnumOnlyModule = true; + } + else if (node.symbol.constEnumOnlyModule) { + node.symbol.constEnumOnlyModule = false; + } + } } } function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { @@ -6397,113 +5991,118 @@ var ts; } function bindBlockScopedVariableDeclaration(node) { switch (blockScopeContainer.kind) { - case 181 /* ModuleDeclaration */: - declareModuleMember(node, 2 /* BlockScopedVariable */, ts.SymbolFlags.BlockScopedVariableExcludes); + case 188 /* ModuleDeclaration */: + declareModuleMember(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); break; - case 186 /* SourceFile */: + case 193 /* SourceFile */: if (ts.isExternalModule(container)) { - declareModuleMember(node, 2 /* BlockScopedVariable */, ts.SymbolFlags.BlockScopedVariableExcludes); + declareModuleMember(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); break; } default: if (!blockScopeContainer.locals) { blockScopeContainer.locals = {}; } - declareSymbol(blockScopeContainer.locals, undefined, node, 2 /* BlockScopedVariable */, ts.SymbolFlags.BlockScopedVariableExcludes); + declareSymbol(blockScopeContainer.locals, undefined, node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); } bindChildren(node, 2 /* BlockScopedVariable */, false); } function bind(node) { node.parent = parent; switch (node.kind) { - case 118 /* TypeParameter */: - bindDeclaration(node, 524288 /* TypeParameter */, ts.SymbolFlags.TypeParameterExcludes, false); + case 122 /* TypeParameter */: + bindDeclaration(node, 1048576 /* TypeParameter */, 2103776 /* TypeParameterExcludes */, false); break; - case 119 /* Parameter */: - bindDeclaration(node, 1 /* FunctionScopedVariable */, ts.SymbolFlags.ParameterExcludes, false); + case 123 /* Parameter */: + bindDeclaration(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */, false); break; - case 174 /* VariableDeclaration */: - if (node.flags & ts.NodeFlags.BlockScoped) { + case 181 /* VariableDeclaration */: + if (node.flags & 6144 /* BlockScoped */) { bindBlockScopedVariableDeclaration(node); } else { - bindDeclaration(node, 1 /* FunctionScopedVariable */, ts.SymbolFlags.FunctionScopedVariableExcludes, false); + bindDeclaration(node, 1 /* FunctionScopedVariable */, 107454 /* FunctionScopedVariableExcludes */, false); } break; - case 120 /* Property */: - case 137 /* PropertyAssignment */: - bindDeclaration(node, 4 /* Property */, ts.SymbolFlags.PropertyExcludes, false); + case 124 /* Property */: + case 141 /* PropertyAssignment */: + bindDeclaration(node, 4 /* Property */, 107455 /* PropertyExcludes */, false); break; - case 185 /* EnumMember */: - bindDeclaration(node, 8 /* EnumMember */, ts.SymbolFlags.EnumMemberExcludes, false); + case 192 /* EnumMember */: + bindDeclaration(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */, false); break; - case 125 /* CallSignature */: - bindDeclaration(node, 65536 /* CallSignature */, 0, false); + case 129 /* CallSignature */: + bindDeclaration(node, 131072 /* CallSignature */, 0, false); break; - case 121 /* Method */: - bindDeclaration(node, 4096 /* Method */, ts.SymbolFlags.MethodExcludes, true); + case 125 /* Method */: + bindDeclaration(node, 8192 /* Method */, 99263 /* MethodExcludes */, true); break; - case 126 /* ConstructSignature */: - bindDeclaration(node, 131072 /* ConstructSignature */, 0, true); + case 130 /* ConstructSignature */: + bindDeclaration(node, 262144 /* ConstructSignature */, 0, true); break; - case 127 /* IndexSignature */: - bindDeclaration(node, 262144 /* IndexSignature */, 0, false); + case 131 /* IndexSignature */: + bindDeclaration(node, 524288 /* IndexSignature */, 0, false); break; - case 175 /* FunctionDeclaration */: - bindDeclaration(node, 16 /* Function */, ts.SymbolFlags.FunctionExcludes, true); + case 182 /* FunctionDeclaration */: + bindDeclaration(node, 16 /* Function */, 106927 /* FunctionExcludes */, true); break; - case 122 /* Constructor */: + case 126 /* Constructor */: bindConstructorDeclaration(node); break; - case 123 /* GetAccessor */: - bindDeclaration(node, 16384 /* GetAccessor */, ts.SymbolFlags.GetAccessorExcludes, true); + case 127 /* GetAccessor */: + bindDeclaration(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */, true); break; - case 124 /* SetAccessor */: - bindDeclaration(node, 32768 /* SetAccessor */, ts.SymbolFlags.SetAccessorExcludes, true); + case 128 /* SetAccessor */: + bindDeclaration(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */, true); break; - case 130 /* TypeLiteral */: - bindAnonymousDeclaration(node, 1024 /* TypeLiteral */, "__type", false); + case 134 /* TypeLiteral */: + bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type", false); break; - case 136 /* ObjectLiteral */: - bindAnonymousDeclaration(node, 2048 /* ObjectLiteral */, "__object", false); + case 140 /* ObjectLiteral */: + bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object", false); break; - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: bindAnonymousDeclaration(node, 16 /* Function */, "__function", true); break; - case 171 /* CatchBlock */: + case 178 /* CatchBlock */: bindCatchVariableDeclaration(node); break; - case 177 /* ClassDeclaration */: - bindDeclaration(node, 32 /* Class */, ts.SymbolFlags.ClassExcludes, false); + case 184 /* ClassDeclaration */: + bindDeclaration(node, 32 /* Class */, 3258879 /* ClassExcludes */, false); break; - case 178 /* InterfaceDeclaration */: - bindDeclaration(node, 64 /* Interface */, ts.SymbolFlags.InterfaceExcludes, false); + case 185 /* InterfaceDeclaration */: + bindDeclaration(node, 64 /* Interface */, 3152288 /* InterfaceExcludes */, false); break; - case 179 /* TypeAliasDeclaration */: - bindDeclaration(node, 1048576 /* TypeAlias */, ts.SymbolFlags.TypeAliasExcludes, false); + case 186 /* TypeAliasDeclaration */: + bindDeclaration(node, 2097152 /* TypeAlias */, 3152352 /* TypeAliasExcludes */, false); break; - case 180 /* EnumDeclaration */: - bindDeclaration(node, 128 /* Enum */, ts.SymbolFlags.EnumExcludes, false); + case 187 /* EnumDeclaration */: + if (ts.isConstEnumDeclaration(node)) { + bindDeclaration(node, 128 /* ConstEnum */, 3259263 /* ConstEnumExcludes */, false); + } + else { + bindDeclaration(node, 256 /* RegularEnum */, 3258623 /* RegularEnumExcludes */, false); + } break; - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: bindModuleDeclaration(node); break; - case 183 /* ImportDeclaration */: - bindDeclaration(node, 16777216 /* Import */, ts.SymbolFlags.ImportExcludes, false); + case 190 /* ImportDeclaration */: + bindDeclaration(node, 33554432 /* Import */, 33554432 /* ImportExcludes */, false); break; - case 186 /* SourceFile */: + case 193 /* SourceFile */: if (ts.isExternalModule(node)) { - bindAnonymousDeclaration(node, 256 /* ValueModule */, '"' + ts.removeFileExtension(node.filename) + '"', true); + bindAnonymousDeclaration(node, 512 /* ValueModule */, '"' + ts.removeFileExtension(node.filename) + '"', true); break; } - case 151 /* Block */: - case 170 /* TryBlock */: - case 171 /* CatchBlock */: - case 172 /* FinallyBlock */: - case 158 /* ForStatement */: - case 159 /* ForInStatement */: - case 164 /* SwitchStatement */: + case 158 /* Block */: + case 177 /* TryBlock */: + case 178 /* CatchBlock */: + case 179 /* FinallyBlock */: + case 165 /* ForStatement */: + case 166 /* ForInStatement */: + case 171 /* SwitchStatement */: bindChildren(node, 0, true); break; default: @@ -6566,7 +6165,7 @@ var ts; } function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 122 /* Constructor */ && member.body) { + if (member.kind === 126 /* Constructor */ && member.body) { return member; } }); @@ -6576,14 +6175,14 @@ var ts; var getAccessor; var setAccessor; ts.forEach(node.members, function (member) { - if ((member.kind === 123 /* GetAccessor */ || member.kind === 124 /* SetAccessor */) && member.name.text === accessor.name.text && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { + if ((member.kind === 127 /* GetAccessor */ || member.kind === 128 /* SetAccessor */) && member.name.text === accessor.name.text && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { if (!firstAccessor) { firstAccessor = member; } - if (member.kind === 123 /* GetAccessor */ && !getAccessor) { + if (member.kind === 127 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 124 /* SetAccessor */ && !setAccessor) { + if (member.kind === 128 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -6906,7 +6505,7 @@ var ts; if (scopeName) { recordScopeNameStart(scopeName); } - else if (node.kind === 175 /* FunctionDeclaration */ || node.kind === 144 /* FunctionExpression */ || node.kind === 121 /* Method */ || node.kind === 123 /* GetAccessor */ || node.kind === 124 /* SetAccessor */ || node.kind === 181 /* ModuleDeclaration */ || node.kind === 177 /* ClassDeclaration */ || node.kind === 180 /* EnumDeclaration */) { + 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 */) { if (node.name) { scopeName = node.name.text; } @@ -6988,7 +6587,7 @@ var ts; } function emitNodeWithMap(node) { if (node) { - if (node.kind != 186 /* SourceFile */) { + if (node.kind != 193 /* SourceFile */) { recordEmitNodeStartSpan(node); emitNode(node); recordEmitNodeEndSpan(node); @@ -7075,13 +6674,76 @@ var ts; } } function emitLiteral(node) { - var text = getSourceTextOfLocalNode(node); - if (node.kind === 7 /* StringLiteral */ && compilerOptions.sourceMap) { + var text = getLiteralText(); + if (compilerOptions.sourceMap && (node.kind === 7 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } else { write(text); } + function getLiteralText() { + if (compilerOptions.target < 2 /* ES6 */ && ts.isTemplateLiteralKind(node.kind)) { + return getTemplateLiteralAsStringLiteral(node); + } + return getSourceTextOfLocalNode(node); + } + } + function getTemplateLiteralAsStringLiteral(node) { + return '"' + ts.escapeString(node.text) + '"'; + } + function emitTemplateExpression(node) { + if (compilerOptions.target >= 2 /* ES6 */) { + 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) { + write("("); + } + emitLiteral(node.head); + ts.forEach(node.templateSpans, function (templateSpan) { + var needsParens = templateSpan.expression.kind !== 148 /* ParenExpression */ && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1 /* GreaterThan */; + write(" + "); + if (needsParens) { + write("("); + } + emit(templateSpan.expression); + if (needsParens) { + write(")"); + } + if (templateSpan.literal.text.length !== 0) { + write(" + "); + emitLiteral(templateSpan.literal); + } + }); + if (templateNeedsParens) { + write(")"); + } + function comparePrecedenceToBinaryPlus(expression) { + ts.Debug.assert(compilerOptions.target <= 1 /* ES5 */); + switch (expression.kind) { + case 153 /* BinaryExpression */: + switch (expression.operator) { + case 34 /* AsteriskToken */: + case 35 /* SlashToken */: + case 36 /* PercentToken */: + return 1 /* GreaterThan */; + case 32 /* PlusToken */: + return 0 /* EqualTo */; + default: + return -1 /* LessThan */; + } + case 154 /* ConditionalExpression */: + return -1 /* LessThan */; + default: + return 1 /* GreaterThan */; + } + } + } + function emitTemplateSpan(span) { + emit(span.expression); + emit(span.literal); } function emitQuotedIdentifier(node) { if (node.kind === 7 /* StringLiteral */) { @@ -7101,29 +6763,29 @@ var ts; function isNonExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 119 /* Parameter */: - case 174 /* VariableDeclaration */: - case 120 /* Property */: - case 137 /* PropertyAssignment */: - case 185 /* EnumMember */: - case 121 /* Method */: - case 175 /* FunctionDeclaration */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 144 /* FunctionExpression */: - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - case 180 /* EnumDeclaration */: - case 181 /* ModuleDeclaration */: - case 183 /* ImportDeclaration */: + case 123 /* Parameter */: + case 181 /* VariableDeclaration */: + case 124 /* Property */: + case 141 /* PropertyAssignment */: + case 192 /* EnumMember */: + case 125 /* Method */: + case 182 /* 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 */: return parent.name === node; - case 161 /* BreakStatement */: - case 160 /* ContinueStatement */: - case 184 /* ExportAssignment */: + case 168 /* BreakStatement */: + case 167 /* ContinueStatement */: + case 191 /* ExportAssignment */: return false; - case 167 /* LabeledStatement */: + case 174 /* LabeledStatement */: return node.parent.label === node; - case 171 /* CatchBlock */: + case 178 /* CatchBlock */: return node.parent.variable === node; } } @@ -7197,18 +6859,27 @@ var ts; emit(node.initializer); emitTrailingComments(node); } - function emitPropertyAccess(node) { + function tryEmitConstantValue(node) { var constantValue = resolver.getConstantValue(node); if (constantValue !== undefined) { - write(constantValue.toString() + " /* " + ts.identifierToString(node.right) + " */"); + var propertyName = node.kind === 142 /* PropertyAccess */ ? ts.identifierToString(node.right) : ts.getTextOfNode(node.index); + write(constantValue.toString() + " /* " + propertyName + " */"); + return true; } - else { - emit(node.left); - write("."); - emit(node.right); + return false; + } + function emitPropertyAccess(node) { + if (tryEmitConstantValue(node)) { + return; } + emit(node.left); + write("."); + emit(node.right); } function emitIndexedAccess(node) { + if (tryEmitConstantValue(node)) { + return; + } emit(node.object); write("["); emit(node.index); @@ -7216,13 +6887,13 @@ var ts; } function emitCallExpression(node) { var superCall = false; - if (node.func.kind === 85 /* SuperKeyword */) { + if (node.func.kind === 89 /* SuperKeyword */) { write("_super"); superCall = true; } else { emit(node.func); - superCall = node.func.kind === 138 /* PropertyAccess */ && node.func.left.kind === 85 /* SuperKeyword */; + superCall = node.func.kind === 142 /* PropertyAccess */ && node.func.left.kind === 89 /* SuperKeyword */; } if (superCall) { write(".call("); @@ -7248,13 +6919,19 @@ var ts; write(")"); } } + function emitTaggedTemplateExpression(node) { + ts.Debug.assert(compilerOptions.target >= 2 /* ES6 */, "Trying to emit a tagged template in pre-ES6 mode."); + emit(node.tag); + write(" "); + emit(node.template); + } function emitParenExpression(node) { - if (node.expression.kind === 142 /* TypeAssertion */) { + if (node.expression.kind === 147 /* TypeAssertion */) { var operand = node.expression.operand; - while (operand.kind == 142 /* TypeAssertion */) { + while (operand.kind == 147 /* TypeAssertion */) { operand = operand.operand; } - if (operand.kind !== 146 /* PrefixOperator */ && operand.kind !== 147 /* PostfixOperator */ && operand.kind !== 141 /* NewExpression */ && !(operand.kind === 140 /* CallExpression */ && node.parent.kind === 141 /* NewExpression */) && !(operand.kind === 144 /* FunctionExpression */ && node.parent.kind === 140 /* CallExpression */)) { + 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 */)) { emit(operand); return; } @@ -7264,29 +6941,29 @@ var ts; write(")"); } function emitUnaryExpression(node) { - if (node.kind === 146 /* PrefixOperator */) { + if (node.kind === 151 /* PrefixOperator */) { write(ts.tokenToString(node.operator)); } - if (node.operator >= 59 /* Identifier */) { + if (node.operator >= 63 /* Identifier */) { write(" "); } - else if (node.kind === 146 /* PrefixOperator */ && node.operand.kind === 146 /* PrefixOperator */) { + else if (node.kind === 151 /* PrefixOperator */ && node.operand.kind === 151 /* PrefixOperator */) { var operand = node.operand; - if (node.operator === 28 /* PlusToken */ && (operand.operator === 28 /* PlusToken */ || operand.operator === 33 /* PlusPlusToken */)) { + if (node.operator === 32 /* PlusToken */ && (operand.operator === 32 /* PlusToken */ || operand.operator === 37 /* PlusPlusToken */)) { write(" "); } - else if (node.operator === 29 /* MinusToken */ && (operand.operator === 29 /* MinusToken */ || operand.operator === 34 /* MinusMinusToken */)) { + else if (node.operator === 33 /* MinusToken */ && (operand.operator === 33 /* MinusToken */ || operand.operator === 38 /* MinusMinusToken */)) { write(" "); } } emit(node.operand); - if (node.kind === 147 /* PostfixOperator */) { + if (node.kind === 152 /* PostfixOperator */) { write(ts.tokenToString(node.operator)); } } function emitBinaryExpression(node) { emit(node.left); - if (node.operator !== 18 /* CommaToken */) + if (node.operator !== 22 /* CommaToken */) write(" "); write(ts.tokenToString(node.operator)); write(" "); @@ -7300,21 +6977,21 @@ var ts; emit(node.whenFalse); } function emitBlock(node) { - emitToken(9 /* OpenBraceToken */, node.pos); + emitToken(13 /* OpenBraceToken */, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 182 /* ModuleBlock */) { - ts.Debug.assert(node.parent.kind === 181 /* ModuleDeclaration */); + if (node.kind === 189 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 188 /* ModuleDeclaration */); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); decreaseIndent(); writeLine(); - emitToken(10 /* CloseBraceToken */, node.statements.end); + emitToken(14 /* CloseBraceToken */, node.statements.end); scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 151 /* Block */) { + if (node.kind === 158 /* Block */) { write(" "); emit(node); } @@ -7326,7 +7003,7 @@ var ts; } } function emitExpressionStatement(node) { - var isArrowExpression = node.expression.kind === 145 /* ArrowFunction */; + var isArrowExpression = node.expression.kind === 150 /* ArrowFunction */; emitLeadingComments(node); if (isArrowExpression) write("("); @@ -7338,16 +7015,16 @@ var ts; } function emitIfStatement(node) { emitLeadingComments(node); - var endPos = emitToken(78 /* IfKeyword */, node.pos); + var endPos = emitToken(82 /* IfKeyword */, node.pos); write(" "); - endPos = emitToken(11 /* OpenParenToken */, endPos); + endPos = emitToken(15 /* OpenParenToken */, endPos); emit(node.expression); - emitToken(12 /* CloseParenToken */, node.expression.end); + emitToken(16 /* CloseParenToken */, node.expression.end); emitEmbeddedStatement(node.thenStatement); if (node.elseStatement) { writeLine(); - emitToken(70 /* ElseKeyword */, node.thenStatement.end); - if (node.elseStatement.kind === 155 /* IfStatement */) { + emitToken(74 /* ElseKeyword */, node.thenStatement.end); + if (node.elseStatement.kind === 162 /* IfStatement */) { write(" "); emit(node.elseStatement); } @@ -7360,7 +7037,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 151 /* Block */) { + if (node.statement.kind === 158 /* Block */) { write(" "); } else { @@ -7377,18 +7054,18 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForStatement(node) { - var endPos = emitToken(76 /* ForKeyword */, node.pos); + var endPos = emitToken(80 /* ForKeyword */, node.pos); write(" "); - endPos = emitToken(11 /* OpenParenToken */, endPos); + endPos = emitToken(15 /* OpenParenToken */, endPos); if (node.declarations) { if (node.declarations[0] && node.declarations[0].flags & 2048 /* Let */) { - emitToken(98 /* LetKeyword */, endPos); + emitToken(102 /* LetKeyword */, endPos); } else if (node.declarations[0] && node.declarations[0].flags & 4096 /* Const */) { - emitToken(64 /* ConstKeyword */, endPos); + emitToken(68 /* ConstKeyword */, endPos); } else { - emitToken(92 /* VarKeyword */, endPos); + emitToken(96 /* VarKeyword */, endPos); } write(" "); emitCommaList(node.declarations, false); @@ -7404,15 +7081,15 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForInStatement(node) { - var endPos = emitToken(76 /* ForKeyword */, node.pos); + var endPos = emitToken(80 /* ForKeyword */, node.pos); write(" "); - endPos = emitToken(11 /* OpenParenToken */, endPos); + endPos = emitToken(15 /* OpenParenToken */, endPos); if (node.declaration) { if (node.declaration.flags & 2048 /* Let */) { - emitToken(98 /* LetKeyword */, endPos); + emitToken(102 /* LetKeyword */, endPos); } else { - emitToken(92 /* VarKeyword */, endPos); + emitToken(96 /* VarKeyword */, endPos); } write(" "); emit(node.declaration); @@ -7422,17 +7099,17 @@ var ts; } write(" in "); emit(node.expression); - emitToken(12 /* CloseParenToken */, node.expression.end); + emitToken(16 /* CloseParenToken */, node.expression.end); emitEmbeddedStatement(node.statement); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 161 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */, node.pos); + emitToken(node.kind === 168 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */, node.pos); emitOptional(" ", node.label); write(";"); } function emitReturnStatement(node) { emitLeadingComments(node); - emitToken(84 /* ReturnKeyword */, node.pos); + emitToken(88 /* ReturnKeyword */, node.pos); emitOptional(" ", node.expression); write(";"); emitTrailingComments(node); @@ -7444,21 +7121,24 @@ var ts; emitEmbeddedStatement(node.statement); } function emitSwitchStatement(node) { - var endPos = emitToken(86 /* SwitchKeyword */, node.pos); + var endPos = emitToken(90 /* SwitchKeyword */, node.pos); write(" "); - emitToken(11 /* OpenParenToken */, endPos); + emitToken(15 /* OpenParenToken */, endPos); emit(node.expression); - endPos = emitToken(12 /* CloseParenToken */, node.expression.end); + endPos = emitToken(16 /* CloseParenToken */, node.expression.end); write(" "); - emitToken(9 /* OpenBraceToken */, endPos); + emitToken(13 /* OpenBraceToken */, endPos); increaseIndent(); emitLines(node.clauses); decreaseIndent(); writeLine(); - emitToken(10 /* CloseBraceToken */, node.clauses.end); + emitToken(14 /* CloseBraceToken */, node.clauses.end); + } + function isOnSameLine(node1, node2) { + return getLineOfLocalPosition(ts.skipTrivia(currentSourceFile.text, node1.pos)) === getLineOfLocalPosition(ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 165 /* CaseClause */) { + if (node.kind === 172 /* CaseClause */) { write("case "); emit(node.expression); write(":"); @@ -7466,9 +7146,15 @@ var ts; else { write("default:"); } - increaseIndent(); - emitLines(node.statements); - decreaseIndent(); + if (node.statements.length === 1 && isOnSameLine(node, node.statements[0])) { + write(" "); + emit(node.statements[0]); + } + else { + increaseIndent(); + emitLines(node.statements); + decreaseIndent(); + } } function emitThrowStatement(node) { write("throw "); @@ -7487,16 +7173,16 @@ var ts; } function emitCatchBlock(node) { writeLine(); - var endPos = emitToken(62 /* CatchKeyword */, node.pos); + var endPos = emitToken(66 /* CatchKeyword */, node.pos); write(" "); - emitToken(11 /* OpenParenToken */, endPos); + emitToken(15 /* OpenParenToken */, endPos); emit(node.variable); - emitToken(12 /* CloseParenToken */, node.variable.end); + emitToken(16 /* CloseParenToken */, node.variable.end); write(" "); emitBlock(node); } function emitDebuggerStatement(node) { - emitToken(66 /* DebuggerKeyword */, node.pos); + emitToken(70 /* DebuggerKeyword */, node.pos); write(";"); } function emitLabelledStatement(node) { @@ -7507,7 +7193,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 181 /* ModuleDeclaration */); + } while (node && node.kind !== 188 /* ModuleDeclaration */); return node; } function emitModuleMemberName(node) { @@ -7606,7 +7292,7 @@ var ts; } function emitAccessor(node) { emitLeadingComments(node); - write(node.kind === 123 /* GetAccessor */ ? "get " : "set "); + write(node.kind === 127 /* GetAccessor */ ? "get " : "set "); emit(node.name); emitSignatureAndBody(node); emitTrailingComments(node); @@ -7615,15 +7301,15 @@ var ts; if (!node.body) { return emitPinnedOrTripleSlashComments(node); } - if (node.kind !== 121 /* Method */) { + if (node.kind !== 125 /* Method */) { emitLeadingComments(node); } write("function "); - if (node.kind === 175 /* FunctionDeclaration */ || (node.kind === 144 /* FunctionExpression */ && node.name)) { + if (node.kind === 182 /* FunctionDeclaration */ || (node.kind === 149 /* FunctionExpression */ && node.name)) { emit(node.name); } emitSignatureAndBody(node); - if (node.kind !== 121 /* Method */) { + if (node.kind !== 125 /* Method */) { emitTrailingComments(node); } } @@ -7649,16 +7335,16 @@ var ts; write(" {"); scopeEmitStart(node); increaseIndent(); - emitDetachedComments(node.body.kind === 176 /* FunctionBlock */ ? node.body.statements : node.body); + emitDetachedComments(node.body.kind === 183 /* FunctionBlock */ ? node.body.statements : node.body); var startIndex = 0; - if (node.body.kind === 176 /* FunctionBlock */) { + if (node.body.kind === 183 /* FunctionBlock */) { startIndex = emitDirectivePrologues(node.body.statements, true); } var outPos = writer.getTextPos(); emitCaptureThisForNodeIfNecessary(node); emitDefaultValueAssignments(node); emitRestParameter(node); - if (node.body.kind !== 176 /* FunctionBlock */ && outPos === writer.getTextPos()) { + if (node.body.kind !== 183 /* FunctionBlock */ && outPos === writer.getTextPos()) { decreaseIndent(); write(" "); emitStart(node.body); @@ -7671,7 +7357,7 @@ var ts; emitEnd(node.body); } else { - if (node.body.kind === 176 /* FunctionBlock */) { + if (node.body.kind === 183 /* FunctionBlock */) { emitLinesStartingAt(node.body.statements, startIndex); } else { @@ -7683,10 +7369,10 @@ var ts; emitTrailingComments(node.body); } writeLine(); - if (node.body.kind === 176 /* FunctionBlock */) { + if (node.body.kind === 183 /* FunctionBlock */) { emitLeadingCommentsOfPosition(node.body.statements.end); decreaseIndent(); - emitToken(10 /* CloseBraceToken */, node.body.statements.end); + emitToken(14 /* CloseBraceToken */, node.body.statements.end); } else { decreaseIndent(); @@ -7709,11 +7395,11 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 154 /* ExpressionStatement */) { + if (statement && statement.kind === 161 /* ExpressionStatement */) { var expr = statement.expression; - if (expr && expr.kind === 140 /* CallExpression */) { + if (expr && expr.kind === 144 /* CallExpression */) { var func = expr.func; - if (func && func.kind === 85 /* SuperKeyword */) { + if (func && func.kind === 89 /* SuperKeyword */) { return statement; } } @@ -7722,7 +7408,7 @@ var ts; } function emitParameterPropertyAssignments(node) { ts.forEach(node.parameters, function (param) { - if (param.flags & ts.NodeFlags.AccessibilityModifier) { + if (param.flags & 112 /* AccessibilityModifier */) { writeLine(); emitStart(param); emitStart(param.name); @@ -7749,7 +7435,7 @@ var ts; } function emitMemberAssignments(node, staticFlag) { ts.forEach(node.members, function (member) { - if (member.kind === 120 /* Property */ && (member.flags & 128 /* Static */) === staticFlag && member.initializer) { + if (member.kind === 124 /* Property */ && (member.flags & 128 /* Static */) === staticFlag && member.initializer) { writeLine(); emitLeadingComments(member); emitStart(member); @@ -7772,7 +7458,7 @@ var ts; } function emitMemberFunctions(node) { ts.forEach(node.members, function (member) { - if (member.kind === 121 /* Method */) { + if (member.kind === 125 /* Method */) { if (!member.body) { return emitPinnedOrTripleSlashComments(member); } @@ -7794,7 +7480,7 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 123 /* GetAccessor */ || member.kind === 124 /* SetAccessor */) { + else if (member.kind === 127 /* GetAccessor */ || member.kind === 128 /* SetAccessor */) { var accessors = getAllAccessorDeclarations(node, member); if (member === accessors.firstAccessor) { writeLine(); @@ -7872,11 +7558,11 @@ var ts; write("return "); emitNode(node.name); } - emitToken(10 /* CloseBraceToken */, node.members.end, emitClassReturnStatement); + emitToken(14 /* CloseBraceToken */, node.members.end, emitClassReturnStatement); write(";"); decreaseIndent(); writeLine(); - emitToken(10 /* CloseBraceToken */, node.members.end); + emitToken(14 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); emitStart(node); write(")("); @@ -7897,7 +7583,7 @@ var ts; emitTrailingComments(node); function emitConstructorOfClass() { ts.forEach(node.members, function (member) { - if (member.kind === 122 /* Constructor */ && !member.body) { + if (member.kind === 126 /* Constructor */ && !member.body) { emitPinnedOrTripleSlashComments(member); } }); @@ -7948,7 +7634,7 @@ var ts; emitLeadingCommentsOfPosition(ctor.body.statements.end); } decreaseIndent(); - emitToken(10 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end); + emitToken(14 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end); scopeEmitEnd(); emitEnd(ctor || node); if (ctor) { @@ -7960,6 +7646,10 @@ var ts; emitPinnedOrTripleSlashComments(node); } function emitEnumDeclaration(node) { + var isConstEnum = ts.isConstEnumDeclaration(node); + if (isConstEnum && !compilerOptions.preserveConstEnums) { + return; + } emitLeadingComments(node); if (!(node.flags & 1 /* Export */)) { emitStart(node); @@ -7977,10 +7667,10 @@ var ts; write(") {"); increaseIndent(); scopeEmitStart(node); - emitEnumMemberDeclarations(); + emitEnumMemberDeclarations(isConstEnum); decreaseIndent(); writeLine(); - emitToken(10 /* CloseBraceToken */, node.members.end); + emitToken(14 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); write(")("); emitModuleMemberName(node); @@ -7999,7 +7689,7 @@ var ts; write(";"); } emitTrailingComments(node); - function emitEnumMemberDeclarations() { + function emitEnumMemberDeclarations(isConstEnum) { ts.forEach(node.members, function (member) { writeLine(); emitLeadingComments(member); @@ -8010,7 +7700,7 @@ var ts; write("["); emitQuotedIdentifier(member.name); write("] = "); - if (member.initializer) { + if (member.initializer && !isConstEnum) { emit(member.initializer); } else { @@ -8025,13 +7715,13 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 181 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 188 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } } function emitModuleDeclaration(node) { - if (!ts.isInstantiated(node)) { + if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return emitPinnedOrTripleSlashComments(node); } emitLeadingComments(node); @@ -8047,7 +7737,7 @@ var ts; write(resolver.getLocalNameOfContainer(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 182 /* ModuleBlock */) { + if (node.body.kind === 189 /* ModuleBlock */) { emit(node.body); } else { @@ -8060,7 +7750,7 @@ var ts; decreaseIndent(); writeLine(); var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; - emitToken(10 /* CloseBraceToken */, moduleBlock.statements.end); + emitToken(14 /* CloseBraceToken */, moduleBlock.statements.end); scopeEmitEnd(); } write(")("); @@ -8078,10 +7768,10 @@ var ts; function emitImportDeclaration(node) { var emitImportDeclaration = resolver.isReferencedImportDeclaration(node); if (!emitImportDeclaration) { - emitImportDeclaration = !ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportedViaEntityName(node); + emitImportDeclaration = !ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportWithEntityName(node); } if (emitImportDeclaration) { - if (node.externalModuleName && node.parent.kind === 186 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { + if (node.externalModuleName && node.parent.kind === 193 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { if (node.flags & 1 /* Export */) { writeLine(); emitLeadingComments(node); @@ -8110,7 +7800,7 @@ var ts; emitStart(node.externalModuleName); emitLiteral(node.externalModuleName); emitEnd(node.externalModuleName); - emitToken(12 /* CloseParenToken */, node.externalModuleName.end); + emitToken(16 /* CloseParenToken */, node.externalModuleName.end); } write(";"); emitEnd(node); @@ -8121,7 +7811,7 @@ var ts; function getExternalImportDeclarations(node) { var result = []; ts.forEach(node.statements, function (stat) { - if (stat.kind === 183 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { + if (stat.kind === 190 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { result.push(stat); } }); @@ -8129,7 +7819,7 @@ var ts; } function getFirstExportAssignment(sourceFile) { return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 184 /* ExportAssignment */) { + if (node.kind === 191 /* ExportAssignment */) { return node; } }); @@ -8245,117 +7935,127 @@ var ts; return emitPinnedOrTripleSlashComments(node); } switch (node.kind) { - case 59 /* Identifier */: + case 63 /* Identifier */: return emitIdentifier(node); - case 119 /* Parameter */: + case 123 /* Parameter */: return emitParameter(node); - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return emitAccessor(node); - case 87 /* ThisKeyword */: + case 91 /* ThisKeyword */: return emitThis(node); - case 85 /* SuperKeyword */: + case 89 /* SuperKeyword */: return emitSuper(node); - case 83 /* NullKeyword */: + case 87 /* NullKeyword */: return write("null"); - case 89 /* TrueKeyword */: + case 93 /* TrueKeyword */: return write("true"); - case 74 /* FalseKeyword */: + case 78 /* FalseKeyword */: return write("false"); case 6 /* NumericLiteral */: case 7 /* StringLiteral */: case 8 /* RegularExpressionLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 10 /* TemplateHead */: + case 11 /* TemplateMiddle */: + case 12 /* TemplateTail */: return emitLiteral(node); - case 117 /* QualifiedName */: + case 155 /* TemplateExpression */: + return emitTemplateExpression(node); + case 156 /* TemplateSpan */: + return emitTemplateSpan(node); + case 121 /* QualifiedName */: return emitPropertyAccess(node); - case 135 /* ArrayLiteral */: + case 139 /* ArrayLiteral */: return emitArrayLiteral(node); - case 136 /* ObjectLiteral */: + case 140 /* ObjectLiteral */: return emitObjectLiteral(node); - case 137 /* PropertyAssignment */: + case 141 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 138 /* PropertyAccess */: + case 142 /* PropertyAccess */: return emitPropertyAccess(node); - case 139 /* IndexedAccess */: + case 143 /* IndexedAccess */: return emitIndexedAccess(node); - case 140 /* CallExpression */: + case 144 /* CallExpression */: return emitCallExpression(node); - case 141 /* NewExpression */: + case 145 /* NewExpression */: return emitNewExpression(node); - case 142 /* TypeAssertion */: + case 146 /* TaggedTemplateExpression */: + return emitTaggedTemplateExpression(node); + case 147 /* TypeAssertion */: return emit(node.operand); - case 143 /* ParenExpression */: + case 148 /* ParenExpression */: return emitParenExpression(node); - case 175 /* FunctionDeclaration */: - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: return emitFunctionDeclaration(node); - case 146 /* PrefixOperator */: - case 147 /* PostfixOperator */: + case 151 /* PrefixOperator */: + case 152 /* PostfixOperator */: return emitUnaryExpression(node); - case 148 /* BinaryExpression */: + case 153 /* BinaryExpression */: return emitBinaryExpression(node); - case 149 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return emitConditionalExpression(node); - case 150 /* OmittedExpression */: + case 157 /* OmittedExpression */: return; - case 151 /* Block */: - case 170 /* TryBlock */: - case 172 /* FinallyBlock */: - case 176 /* FunctionBlock */: - case 182 /* ModuleBlock */: + case 158 /* Block */: + case 177 /* TryBlock */: + case 179 /* FinallyBlock */: + case 183 /* FunctionBlock */: + case 189 /* ModuleBlock */: return emitBlock(node); - case 152 /* VariableStatement */: + case 159 /* VariableStatement */: return emitVariableStatement(node); - case 153 /* EmptyStatement */: + case 160 /* EmptyStatement */: return write(";"); - case 154 /* ExpressionStatement */: + case 161 /* ExpressionStatement */: return emitExpressionStatement(node); - case 155 /* IfStatement */: + case 162 /* IfStatement */: return emitIfStatement(node); - case 156 /* DoStatement */: + case 163 /* DoStatement */: return emitDoStatement(node); - case 157 /* WhileStatement */: + case 164 /* WhileStatement */: return emitWhileStatement(node); - case 158 /* ForStatement */: + case 165 /* ForStatement */: return emitForStatement(node); - case 159 /* ForInStatement */: + case 166 /* ForInStatement */: return emitForInStatement(node); - case 160 /* ContinueStatement */: - case 161 /* BreakStatement */: + case 167 /* ContinueStatement */: + case 168 /* BreakStatement */: return emitBreakOrContinueStatement(node); - case 162 /* ReturnStatement */: + case 169 /* ReturnStatement */: return emitReturnStatement(node); - case 163 /* WithStatement */: + case 170 /* WithStatement */: return emitWithStatement(node); - case 164 /* SwitchStatement */: + case 171 /* SwitchStatement */: return emitSwitchStatement(node); - case 165 /* CaseClause */: - case 166 /* DefaultClause */: + case 172 /* CaseClause */: + case 173 /* DefaultClause */: return emitCaseOrDefaultClause(node); - case 167 /* LabeledStatement */: + case 174 /* LabeledStatement */: return emitLabelledStatement(node); - case 168 /* ThrowStatement */: + case 175 /* ThrowStatement */: return emitThrowStatement(node); - case 169 /* TryStatement */: + case 176 /* TryStatement */: return emitTryStatement(node); - case 171 /* CatchBlock */: + case 178 /* CatchBlock */: return emitCatchBlock(node); - case 173 /* DebuggerStatement */: + case 180 /* DebuggerStatement */: return emitDebuggerStatement(node); - case 174 /* VariableDeclaration */: + case 181 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 177 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return emitClassDeclaration(node); - case 178 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 180 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 183 /* ImportDeclaration */: + case 190 /* ImportDeclaration */: return emitImportDeclaration(node); - case 186 /* SourceFile */: + case 193 /* SourceFile */: return emitSourceFile(node); } } @@ -8373,7 +8073,7 @@ var ts; return leadingComments; } function getLeadingCommentsToEmit(node) { - if (node.parent.kind === 186 /* SourceFile */ || node.pos !== node.parent.pos) { + if (node.parent.kind === 193 /* SourceFile */ || node.pos !== node.parent.pos) { var leadingComments; if (hasDetachedComments(node.pos)) { leadingComments = getLeadingCommentsWithoutDetachedComments(); @@ -8390,7 +8090,7 @@ var ts; emitComments(leadingComments, true, writer, writeComment); } function emitTrailingDeclarationComments(node) { - if (node.parent.kind === 186 /* SourceFile */ || node.end !== node.parent.end) { + if (node.parent.kind === 193 /* SourceFile */ || node.end !== node.parent.end) { var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); emitComments(trailingComments, false, writer, writeComment); } @@ -8582,7 +8282,7 @@ var ts; if (node.flags & 1 /* Export */) { write("export "); } - if (node.kind !== 178 /* InterfaceDeclaration */) { + if (node.kind !== 185 /* InterfaceDeclaration */) { write("declare "); } } @@ -8638,7 +8338,7 @@ var ts; emitDeclarationFlags(node); write("module "); emitSourceTextOfNode(node.name); - while (node.body.kind !== 182 /* ModuleBlock */) { + while (node.body.kind !== 189 /* ModuleBlock */) { node = node.body; write("."); emitSourceTextOfNode(node.name); @@ -8680,6 +8380,9 @@ var ts; if (resolver.isDeclarationVisible(node)) { emitJsDocComments(node); emitDeclarationFlags(node); + if (ts.isConstEnumDeclaration(node)) { + write("const "); + } write("enum "); emitSourceTextOfNode(node.name); write(" {"); @@ -8707,34 +8410,34 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 177 /* ClassDeclaration */: + case 184 /* 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 178 /* InterfaceDeclaration */: + case 185 /* 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 126 /* ConstructSignature */: + case 130 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 125 /* CallSignature */: + case 129 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 121 /* Method */: + case 125 /* Method */: 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 === 177 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 184 /* 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 175 /* FunctionDeclaration */: + case 182 /* 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: - ts.Debug.fail("This is unknown parent for type parameter: " + ts.SyntaxKind[node.parent.kind]); + ts.Debug.fail("This is unknown parent for type parameter: " + node.parent.kind); } return { diagnosticMessage: diagnosticMessage, @@ -8746,7 +8449,7 @@ var ts; emitJsDocComments(node); decreaseIndent(); emitSourceTextOfNode(node.name); - if (node.constraint && (node.parent.kind !== 121 /* Method */ || !(node.parent.flags & 32 /* Private */))) { + if (node.constraint && (node.parent.kind !== 125 /* Method */ || !(node.parent.flags & 32 /* Private */))) { write(" extends "); getSymbolVisibilityDiagnosticMessage = getTypeParameterConstraintVisibilityError; resolver.writeTypeAtLocation(node.constraint, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); @@ -8768,7 +8471,7 @@ var ts; resolver.writeTypeAtLocation(node, enclosingDeclaration, 1 /* WriteArrayAsGenericType */ | 2 /* UseTypeOfFunction */, writer); function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.kind === 177 /* ClassDeclaration */) { + if (node.parent.kind === 184 /* 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; } @@ -8796,7 +8499,7 @@ var ts; function emitParameterProperties(constructorDeclaration) { if (constructorDeclaration) { ts.forEach(constructorDeclaration.parameters, function (param) { - if (param.flags & ts.NodeFlags.AccessibilityModifier) { + if (param.flags & 112 /* AccessibilityModifier */) { emitPropertyDeclaration(param); } }); @@ -8853,9 +8556,9 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 174 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { + if (node.kind !== 181 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { emitSourceTextOfNode(node.name); - if (node.kind === 120 /* Property */ && (node.flags & 4 /* QuestionMark */)) { + if (node.kind === 124 /* Property */ && (node.flags & 4 /* QuestionMark */)) { write("?"); } if (!(node.flags & 32 /* Private */)) { @@ -8866,14 +8569,14 @@ var ts; } function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.kind === 174 /* VariableDeclaration */) { + if (node.kind === 181 /* 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 === 120 /* Property */) { + 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 === 177 /* ClassDeclaration */) { + else if (node.parent.kind === 184 /* 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 { @@ -8923,7 +8626,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.kind === 124 /* SetAccessor */) { + if (node.kind === 128 /* SetAccessor */) { if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; } @@ -8952,14 +8655,14 @@ var ts; } } function emitFunctionDeclaration(node) { - if ((node.kind !== 175 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { + if ((node.kind !== 182 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); emitDeclarationFlags(node); - if (node.kind === 175 /* FunctionDeclaration */) { + if (node.kind === 182 /* FunctionDeclaration */) { write("function "); emitSourceTextOfNode(node.name); } - else if (node.kind === 122 /* Constructor */) { + else if (node.kind === 126 /* Constructor */) { write("constructor"); } else { @@ -8977,24 +8680,24 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { - if (node.kind === 125 /* CallSignature */ || node.kind === 127 /* IndexSignature */) { + if (node.kind === 129 /* CallSignature */ || node.kind === 131 /* IndexSignature */) { emitJsDocComments(node); } emitTypeParameters(node.typeParameters); - if (node.kind === 127 /* IndexSignature */) { + if (node.kind === 131 /* IndexSignature */) { write("["); } else { write("("); } emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 127 /* IndexSignature */) { + if (node.kind === 131 /* IndexSignature */) { write("]"); } else { write(")"); } - if (node.kind !== 122 /* Constructor */ && !(node.flags & 32 /* Private */)) { + if (node.kind !== 126 /* Constructor */ && !(node.flags & 32 /* Private */)) { write(": "); getSymbolVisibilityDiagnosticMessage = getReturnTypeVisibilityError; resolver.writeReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); @@ -9004,31 +8707,31 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 126 /* ConstructSignature */: + case 130 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 125 /* CallSignature */: + case 129 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 127 /* IndexSignature */: + case 131 /* IndexSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 121 /* Method */: + case 125 /* Method */: 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 === 177 /* ClassDeclaration */) { + else if (node.parent.kind === 184 /* 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 175 /* FunctionDeclaration */: + case 182 /* 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: - ts.Debug.fail("This is unknown kind for signature: " + ts.SyntaxKind[node.kind]); + ts.Debug.fail("This is unknown kind for signature: " + node.kind); } return { diagnosticMessage: diagnosticMessage, @@ -9055,31 +8758,31 @@ var ts; function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 122 /* Constructor */: + case 126 /* Constructor */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; break; - case 126 /* ConstructSignature */: + case 130 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 125 /* CallSignature */: + case 129 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 121 /* Method */: + case 125 /* Method */: 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 === 177 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 184 /* 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 175 /* FunctionDeclaration */: + case 182 /* 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: - ts.Debug.fail("This is unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]); + ts.Debug.fail("This is unknown parent for parameter: " + node.parent.kind); } return { diagnosticMessage: diagnosticMessage, @@ -9090,39 +8793,39 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 122 /* Constructor */: - case 175 /* FunctionDeclaration */: - case 121 /* Method */: + case 126 /* Constructor */: + case 182 /* FunctionDeclaration */: + case 125 /* Method */: return emitFunctionDeclaration(node); - case 126 /* ConstructSignature */: + case 130 /* ConstructSignature */: return emitConstructSignatureDeclaration(node); - case 125 /* CallSignature */: - case 127 /* IndexSignature */: + case 129 /* CallSignature */: + case 131 /* IndexSignature */: return emitSignatureDeclaration(node); - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return emitAccessorDeclaration(node); - case 152 /* VariableStatement */: + case 159 /* VariableStatement */: return emitVariableStatement(node); - case 120 /* Property */: + case 124 /* Property */: return emitPropertyDeclaration(node); - case 178 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 177 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return emitClassDeclaration(node); - case 179 /* TypeAliasDeclaration */: + case 186 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 185 /* EnumMember */: + case 192 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 180 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 183 /* ImportDeclaration */: + case 190 /* ImportDeclaration */: return emitImportDeclaration(node); - case 184 /* ExportAssignment */: + case 191 /* ExportAssignment */: return emitExportAssignment(node); - case 186 /* SourceFile */: + case 193 /* SourceFile */: return emitSourceFile(node); } } @@ -9329,10 +9032,10 @@ var ts; isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, hasEarlyErrors: hasEarlyErrors }; - var undefinedSymbol = createSymbol(4 /* Property */ | 134217728 /* Transient */, "undefined"); - var argumentsSymbol = createSymbol(4 /* Property */ | 134217728 /* Transient */, "arguments"); - var unknownSymbol = createSymbol(4 /* Property */ | 134217728 /* Transient */, "unknown"); - var resolvingSymbol = createSymbol(134217728 /* Transient */, "__resolving__"); + var undefinedSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "undefined"); + var argumentsSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "arguments"); + var unknownSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "unknown"); + var resolvingSymbol = createSymbol(268435456 /* Transient */, "__resolving__"); var anyType = createIntrinsicType(1 /* Any */, "any"); var stringType = createIntrinsicType(2 /* String */, "string"); var numberType = createIntrinsicType(4 /* Number */, "number"); @@ -9381,35 +9084,37 @@ var ts; function getExcludedSymbolFlags(flags) { var result = 0; if (flags & 2 /* BlockScopedVariable */) - result |= ts.SymbolFlags.BlockScopedVariableExcludes; + result |= 107455 /* BlockScopedVariableExcludes */; if (flags & 1 /* FunctionScopedVariable */) - result |= ts.SymbolFlags.FunctionScopedVariableExcludes; + result |= 107454 /* FunctionScopedVariableExcludes */; if (flags & 4 /* Property */) - result |= ts.SymbolFlags.PropertyExcludes; + result |= 107455 /* PropertyExcludes */; if (flags & 8 /* EnumMember */) - result |= ts.SymbolFlags.EnumMemberExcludes; + result |= 107455 /* EnumMemberExcludes */; if (flags & 16 /* Function */) - result |= ts.SymbolFlags.FunctionExcludes; + result |= 106927 /* FunctionExcludes */; if (flags & 32 /* Class */) - result |= ts.SymbolFlags.ClassExcludes; + result |= 3258879 /* ClassExcludes */; if (flags & 64 /* Interface */) - result |= ts.SymbolFlags.InterfaceExcludes; - if (flags & 128 /* Enum */) - result |= ts.SymbolFlags.EnumExcludes; - if (flags & 256 /* ValueModule */) - result |= ts.SymbolFlags.ValueModuleExcludes; - if (flags & 4096 /* Method */) - result |= ts.SymbolFlags.MethodExcludes; - if (flags & 16384 /* GetAccessor */) - result |= ts.SymbolFlags.GetAccessorExcludes; - if (flags & 32768 /* SetAccessor */) - result |= ts.SymbolFlags.SetAccessorExcludes; - if (flags & 524288 /* TypeParameter */) - result |= ts.SymbolFlags.TypeParameterExcludes; - if (flags & 1048576 /* TypeAlias */) - result |= ts.SymbolFlags.TypeAliasExcludes; - if (flags & 16777216 /* Import */) - result |= ts.SymbolFlags.ImportExcludes; + result |= 3152288 /* InterfaceExcludes */; + if (flags & 256 /* RegularEnum */) + result |= 3258623 /* RegularEnumExcludes */; + if (flags & 128 /* ConstEnum */) + result |= 3259263 /* ConstEnumExcludes */; + if (flags & 512 /* ValueModule */) + result |= 106639 /* ValueModuleExcludes */; + if (flags & 8192 /* Method */) + result |= 99263 /* MethodExcludes */; + if (flags & 32768 /* GetAccessor */) + result |= 41919 /* GetAccessorExcludes */; + if (flags & 65536 /* SetAccessor */) + result |= 74687 /* SetAccessorExcludes */; + if (flags & 1048576 /* TypeParameter */) + result |= 2103776 /* TypeParameterExcludes */; + if (flags & 2097152 /* TypeAlias */) + result |= 3152352 /* TypeAliasExcludes */; + if (flags & 33554432 /* Import */) + result |= 33554432 /* ImportExcludes */; return result; } function recordMergedSymbol(target, source) { @@ -9418,11 +9123,13 @@ var ts; mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { - var result = createSymbol(symbol.flags | 67108864 /* Merged */, symbol.name); + var result = createSymbol(symbol.flags | 134217728 /* Merged */, symbol.name); result.declarations = symbol.declarations.slice(0); result.parent = symbol.parent; if (symbol.valueDeclaration) result.valueDeclaration = symbol.valueDeclaration; + if (symbol.constEnumOnlyModule) + result.constEnumOnlyModule = true; if (symbol.members) result.members = cloneSymbolTable(symbol.members); if (symbol.exports) @@ -9432,6 +9139,9 @@ var ts; } function extendSymbol(target, source) { if (!(target.flags & getExcludedSymbolFlags(source.flags))) { + if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) { + target.constEnumOnlyModule = false; + } target.flags |= source.flags; if (!target.valueDeclaration && source.valueDeclaration) target.valueDeclaration = source.valueDeclaration; @@ -9477,7 +9187,7 @@ var ts; } else { var symbol = target[id]; - if (!(symbol.flags & 67108864 /* Merged */)) { + if (!(symbol.flags & 134217728 /* Merged */)) { target[id] = symbol = cloneSymbol(symbol); } extendSymbol(symbol, source[id]); @@ -9486,7 +9196,7 @@ var ts; } } function getSymbolLinks(symbol) { - if (symbol.flags & 134217728 /* Transient */) + if (symbol.flags & 268435456 /* Transient */) return symbol; if (!symbol.id) symbol.id = nextSymbolId++; @@ -9498,19 +9208,19 @@ var ts; return nodeLinks[node.id] || (nodeLinks[node.id] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 186 /* SourceFile */); + return ts.getAncestor(node, 193 /* SourceFile */); } function isGlobalSourceFile(node) { - return node.kind === 186 /* SourceFile */ && !ts.isExternalModule(node); + return node.kind === 193 /* SourceFile */ && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { var symbol = symbols[name]; - ts.Debug.assert((symbol.flags & 33554432 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); if (symbol.flags & meaning) { return symbol; } - if (symbol.flags & 16777216 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { var target = resolveImport(symbol); if (target === unknownSymbol || target.flags & meaning) { return symbol; @@ -9518,6 +9228,18 @@ var ts; } } } + function isDefinedBefore(node1, node2) { + var file1 = ts.getSourceFileOfNode(node1); + var file2 = ts.getSourceFileOfNode(node2); + if (file1 === file2) { + return node1.pos <= node2.pos; + } + if (!compilerOptions.out) { + return true; + } + var sourceFiles = program.getSourceFiles(); + return sourceFiles.indexOf(file1) <= sourceFiles.indexOf(file2); + } function resolveName(location, name, meaning, nameNotFoundMessage, nameArg) { var result; var lastLocation; @@ -9530,32 +9252,32 @@ var ts; } } switch (location.kind) { - case 186 /* SourceFile */: + case 193 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 181 /* ModuleDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & ts.SymbolFlags.ModuleMember)) { + case 188 /* ModuleDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 35653619 /* ModuleMember */)) { break loop; } break; - case 180 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 120 /* Property */: - if (location.parent.kind === 177 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { + case 124 /* Property */: + if (location.parent.kind === 184 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { - if (getSymbol(ctor.locals, name, meaning & ts.SymbolFlags.Value)) { + if (getSymbol(ctor.locals, name, meaning & 107455 /* Value */)) { propertyWithInvalidInitializer = location; } } } break; - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & ts.SymbolFlags.Type)) { + case 184 /* ClassDeclaration */: + case 185 /* 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); return undefined; @@ -9563,18 +9285,18 @@ var ts; break loop; } break; - case 121 /* Method */: - case 122 /* Constructor */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 175 /* FunctionDeclaration */: - case 145 /* ArrowFunction */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 182 /* FunctionDeclaration */: + case 150 /* ArrowFunction */: if (name === "arguments") { result = argumentsSymbol; break loop; } break; - case 144 /* FunctionExpression */: + case 149 /* FunctionExpression */: if (name === "arguments") { result = argumentsSymbol; break loop; @@ -9585,7 +9307,7 @@ var ts; break loop; } break; - case 171 /* CatchBlock */: + case 178 /* CatchBlock */: var id = location.variable; if (name === id.text) { result = location.symbol; @@ -9612,31 +9334,21 @@ var ts; return undefined; } if (result.flags & 2 /* BlockScopedVariable */) { - var declaration = ts.forEach(result.declarations, function (d) { return d.flags & ts.NodeFlags.BlockScoped ? d : undefined; }); - ts.Debug.assert(declaration, "Block-scoped variable declaration is undefined"); - var declarationSourceFile = ts.getSourceFileOfNode(declaration); - var referenceSourceFile = ts.getSourceFileOfNode(errorLocation); - if (declarationSourceFile === referenceSourceFile) { - if (declaration.pos > errorLocation.pos) { - error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.identifierToString(declaration.name)); - } - } - else if (compilerOptions.out) { - var sourceFiles = program.getSourceFiles(); - if (sourceFiles.indexOf(referenceSourceFile) < sourceFiles.indexOf(declarationSourceFile)) { - error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.identifierToString(declaration.name)); - } + 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)); } } } return result; } function resolveImport(symbol) { - ts.Debug.assert((symbol.flags & 16777216 /* Import */) !== 0, "Should only get Imports here."); + ts.Debug.assert((symbol.flags & 33554432 /* Import */) !== 0, "Should only get Imports here."); var links = getSymbolLinks(symbol); if (!links.target) { links.target = resolvingSymbol; - var node = getDeclarationOfKind(symbol, 183 /* ImportDeclaration */); + var node = getDeclarationOfKind(symbol, 190 /* ImportDeclaration */); var target = node.externalModuleName ? resolveExternalModuleName(node, node.externalModuleName) : getSymbolOfPartOfRightHandSideOfImport(node.entityName, node); if (links.target === resolvingSymbol) { links.target = target || unknownSymbol; @@ -9652,33 +9364,33 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImport(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 183 /* ImportDeclaration */); - ts.Debug.assert(importDeclaration); + importDeclaration = ts.getAncestor(entityName, 190 /* ImportDeclaration */); + ts.Debug.assert(importDeclaration !== undefined); } - if (entityName.kind === 59 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + if (entityName.kind === 63 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 59 /* Identifier */ || entityName.parent.kind === 117 /* QualifiedName */) { - return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Namespace); + if (entityName.kind === 63 /* Identifier */ || entityName.parent.kind === 121 /* QualifiedName */) { + return resolveEntityName(importDeclaration, entityName, 1536 /* Namespace */); } else { - ts.Debug.assert(entityName.parent.kind === 183 /* ImportDeclaration */); - return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace); + ts.Debug.assert(entityName.parent.kind === 190 /* ImportDeclaration */); + return resolveEntityName(importDeclaration, entityName, 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */); } } function getFullyQualifiedName(symbol) { return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); } function resolveEntityName(location, name, meaning) { - if (name.kind === 59 /* Identifier */) { + if (name.kind === 63 /* Identifier */) { var symbol = resolveName(location, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); if (!symbol) { return; } } - else if (name.kind === 117 /* QualifiedName */) { - var namespace = resolveEntityName(location, name.left, ts.SymbolFlags.Namespace); - if (!namespace || namespace === unknownSymbol || name.right.kind === 116 /* Missing */) + else if (name.kind === 121 /* QualifiedName */) { + var namespace = resolveEntityName(location, name.left, 1536 /* Namespace */); + if (!namespace || namespace === unknownSymbol || name.right.kind === 120 /* Missing */) return; var symbol = getSymbol(namespace.exports, name.right.text, meaning); if (!symbol) { @@ -9689,7 +9401,7 @@ var ts; else { return; } - ts.Debug.assert((symbol.flags & 33554432 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); return symbol.flags & meaning ? symbol : resolveImport(symbol); } function isExternalModuleNameRelative(moduleName) { @@ -9702,7 +9414,7 @@ var ts; return; var isRelative = isExternalModuleNameRelative(moduleName); if (!isRelative) { - var symbol = getSymbol(globals, '"' + moduleName + '"', 256 /* ValueModule */); + var symbol = getSymbol(globals, '"' + moduleName + '"', 512 /* ValueModule */); if (symbol) { return getResolvedExportSymbol(symbol); } @@ -9729,10 +9441,10 @@ var ts; function getResolvedExportSymbol(moduleSymbol) { var symbol = getExportAssignmentSymbol(moduleSymbol); if (symbol) { - if (symbol.flags & (ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace)) { + if (symbol.flags & (107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */)) { return symbol; } - if (symbol.flags & 16777216 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { return resolveImport(symbol); } } @@ -9756,7 +9468,7 @@ var ts; error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); } if (node.exportName.text) { - var meaning = ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace; + var meaning = 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */; var exportSymbol = resolveName(node, node.exportName.text, meaning, ts.Diagnostics.Cannot_find_name_0, node.exportName); } } @@ -9767,9 +9479,9 @@ var ts; var seenExportedMember = false; var result = []; ts.forEach(symbol.declarations, function (declaration) { - var block = (declaration.kind === 186 /* SourceFile */ ? declaration : declaration.body); + var block = (declaration.kind === 193 /* SourceFile */ ? declaration : declaration.body); ts.forEach(block.statements, function (node) { - if (node.kind === 184 /* ExportAssignment */) { + if (node.kind === 191 /* ExportAssignment */) { result.push(node); } else { @@ -9793,17 +9505,17 @@ var ts; return getMergedSymbol(symbol.parent); } function getExportSymbolOfValueSymbolIfExported(symbol) { - return symbol && (symbol.flags & 2097152 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; + return symbol && (symbol.flags & 4194304 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; } function symbolIsValue(symbol) { - if (symbol.flags & 33554432 /* Instantiated */) { + if (symbol.flags & 67108864 /* Instantiated */) { return symbolIsValue(getSymbolLinks(symbol).target); } - if (symbol.flags & ts.SymbolFlags.Value) { + if (symbol.flags & 107455 /* Value */) { return true; } - if (symbol.flags & 16777216 /* Import */) { - return (resolveImport(symbol).flags & ts.SymbolFlags.Value) !== 0; + if (symbol.flags & 33554432 /* Import */) { + return (resolveImport(symbol).flags & 107455 /* Value */) !== 0; } return false; } @@ -9811,7 +9523,7 @@ var ts; var members = node.members; for (var i = 0; i < members.length; i++) { var member = members[i]; - if (member.kind === 122 /* Constructor */ && member.body) { + if (member.kind === 126 /* Constructor */ && member.body) { return member; } } @@ -9865,7 +9577,7 @@ var ts; return setObjectTypeMembers(createObjectType(32768 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function isOptionalProperty(propertySymbol) { - return propertySymbol.valueDeclaration && propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */ && propertySymbol.valueDeclaration.kind !== 119 /* Parameter */; + return propertySymbol.valueDeclaration && propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */ && propertySymbol.valueDeclaration.kind !== 123 /* Parameter */; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; @@ -9876,17 +9588,17 @@ var ts; } } switch (location.kind) { - case 186 /* SourceFile */: + case 193 /* SourceFile */: if (!ts.isExternalModule(location)) { break; } - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location).exports)) { return result; } break; - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: if (result = callback(getSymbolOfNode(location).members)) { return result; } @@ -9896,7 +9608,7 @@ var ts; return callback(globals); } function getQualifiedLeftMeaning(rightMeaning) { - return rightMeaning === ts.SymbolFlags.Value ? ts.SymbolFlags.Value : ts.SymbolFlags.Namespace; + return rightMeaning === 107455 /* Value */ ? 107455 /* Value */ : 1536 /* Namespace */; } function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing) { function getAccessibleSymbolChainFromSymbolTable(symbols) { @@ -9916,8 +9628,8 @@ var ts; return [symbol]; } return ts.forEachValue(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 16777216 /* Import */) { - if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 183 /* ImportDeclaration */ && declaration.externalModuleName; })) { + if (symbolFromSymbolTable.flags & 33554432 /* Import */) { + if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 190 /* ImportDeclaration */ && declaration.externalModuleName; })) { var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable); if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) { return [symbolFromSymbolTable]; @@ -9944,7 +9656,7 @@ var ts; if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 16777216 /* Import */) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 33554432 /* Import */) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -9954,7 +9666,7 @@ var ts; return qualify; } function isSymbolAccessible(symbol, enclosingDeclaration, meaning) { - if (symbol && enclosingDeclaration && !(symbol.flags & 524288 /* TypeParameter */)) { + if (symbol && enclosingDeclaration && !(symbol.flags & 1048576 /* TypeParameter */)) { var initialSymbol = symbol; var meaningToLook = meaning; while (symbol) { @@ -9965,7 +9677,7 @@ var ts; return { accessibility: 1 /* NotAccessible */, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), - errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, ts.SymbolFlags.Namespace) : undefined + errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, 1536 /* Namespace */) : undefined }; } return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasAccessibleDeclarations.aliasesToMakeVisible }; @@ -9999,7 +9711,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 181 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 186 /* SourceFile */ && ts.isExternalModule(declaration)); + return (declaration.kind === 188 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 193 /* SourceFile */ && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -10009,7 +9721,7 @@ var ts; return { aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 183 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { + if (declaration.kind === 190 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { if (!ts.contains(aliasesToMakeVisible, declaration)) { @@ -10028,7 +9740,7 @@ var ts; } function isImportDeclarationEntityNameReferenceDeclarationVisibile(entityName) { var firstIdentifier = getFirstIdentifier(entityName); - var symbolOfNameSpace = resolveName(entityName.parent, firstIdentifier.text, ts.SymbolFlags.Namespace, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); + 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) }; } @@ -10067,12 +9779,12 @@ var ts; return result; } function getTypeAliasForTypeLiteral(type) { - if (type.symbol && type.symbol.flags & 1024 /* TypeLiteral */) { + if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { var node = type.symbol.declarations[0].parent; - while (node.kind === 134 /* ParenType */) { + while (node.kind === 138 /* ParenType */) { node = node.parent; } - if (node.kind === 179 /* TypeAliasDeclaration */) { + if (node.kind === 186 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -10095,14 +9807,14 @@ var ts; function appendParentTypeArgumentsAndSymbolName(symbol) { if (parentSymbol) { if (flags & 1 /* WriteTypeParametersOrArguments */) { - if (symbol.flags & 33554432 /* Instantiated */) { + if (symbol.flags & 67108864 /* Instantiated */) { buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration); } else { buildTypeParameterDisplayFromSymbol(parentSymbol, writer, enclosingDeclaration); } } - writePunctuation(writer, 15 /* DotToken */); + writePunctuation(writer, 19 /* DotToken */); } parentSymbol = symbol; appendSymbolNameOnly(symbol, writer); @@ -10123,14 +9835,14 @@ var ts; if (!parentSymbol && ts.forEach(symbol.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); })) { return; } - if (symbol.flags & 1024 /* TypeLiteral */ || symbol.flags & 2048 /* ObjectLiteral */) { + if (symbol.flags & 2048 /* TypeLiteral */ || symbol.flags & 4096 /* ObjectLiteral */) { return; } appendParentTypeArgumentsAndSymbolName(symbol); } } } - if (enclosingDeclaration && !(symbol.flags & 524288 /* TypeParameter */)) { + if (enclosingDeclaration && !(symbol.flags & 1048576 /* TypeParameter */)) { walkSymbol(symbol, meaning); return; } @@ -10140,14 +9852,14 @@ var ts; var globalFlagsToPass = globalFlags & 16 /* WriteOwnNameForAnyLike */; return writeType(type, globalFlags); function writeType(type, flags) { - if (type.flags & ts.TypeFlags.Intrinsic) { + if (type.flags & 127 /* Intrinsic */) { writer.writeKeyword(!(globalFlags & 16 /* WriteOwnNameForAnyLike */) && (type.flags & 1 /* Any */) ? "any" : type.intrinsicName); } else if (type.flags & 4096 /* Reference */) { writeTypeReference(type, flags); } else if (type.flags & (1024 /* Class */ | 2048 /* Interface */ | 128 /* Enum */ | 512 /* TypeParameter */)) { - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, ts.SymbolFlags.Type); + buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 3152352 /* Type */); } else if (type.flags & 8192 /* Tuple */) { writeTupleType(type); @@ -10162,11 +9874,11 @@ var ts; writer.writeStringLiteral(type.text); } else { - writePunctuation(writer, 9 /* OpenBraceToken */); + writePunctuation(writer, 13 /* OpenBraceToken */); writeSpace(writer); - writePunctuation(writer, 16 /* DotDotDotToken */); + writePunctuation(writer, 20 /* DotDotDotToken */); writeSpace(writer); - writePunctuation(writer, 10 /* CloseBraceToken */); + writePunctuation(writer, 14 /* CloseBraceToken */); } } function writeTypeList(types, union) { @@ -10175,7 +9887,7 @@ var ts; if (union) { writeSpace(writer); } - writePunctuation(writer, union ? 39 /* BarToken */ : 18 /* CommaToken */); + writePunctuation(writer, union ? 43 /* BarToken */ : 22 /* CommaToken */); writeSpace(writer); } writeType(types[i], union ? 64 /* InElementType */ : 0 /* None */); @@ -10184,32 +9896,32 @@ var ts; function writeTypeReference(type, flags) { if (type.target === globalArrayType && !(flags & 1 /* WriteArrayAsGenericType */)) { writeType(type.typeArguments[0], 64 /* InElementType */); - writePunctuation(writer, 13 /* OpenBracketToken */); - writePunctuation(writer, 14 /* CloseBracketToken */); + writePunctuation(writer, 17 /* OpenBracketToken */); + writePunctuation(writer, 18 /* CloseBracketToken */); } else { - buildSymbolDisplay(type.target.symbol, writer, enclosingDeclaration, ts.SymbolFlags.Type); - writePunctuation(writer, 19 /* LessThanToken */); + buildSymbolDisplay(type.target.symbol, writer, enclosingDeclaration, 3152352 /* Type */); + writePunctuation(writer, 23 /* LessThanToken */); writeTypeList(type.typeArguments, false); - writePunctuation(writer, 20 /* GreaterThanToken */); + writePunctuation(writer, 24 /* GreaterThanToken */); } } function writeTupleType(type) { - writePunctuation(writer, 13 /* OpenBracketToken */); + writePunctuation(writer, 17 /* OpenBracketToken */); writeTypeList(type.elementTypes, false); - writePunctuation(writer, 14 /* CloseBracketToken */); + writePunctuation(writer, 18 /* CloseBracketToken */); } function writeUnionType(type, flags) { if (flags & 64 /* InElementType */) { - writePunctuation(writer, 11 /* OpenParenToken */); + writePunctuation(writer, 15 /* OpenParenToken */); } writeTypeList(type.types, true); if (flags & 64 /* InElementType */) { - writePunctuation(writer, 12 /* CloseParenToken */); + writePunctuation(writer, 16 /* CloseParenToken */); } } function writeAnonymousType(type, flags) { - if (type.symbol && type.symbol.flags & (32 /* Class */ | 128 /* Enum */ | 256 /* ValueModule */)) { + if (type.symbol && type.symbol.flags & (32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { writeTypeofSymbol(type); } else if (shouldWriteTypeOfFunctionSymbol()) { @@ -10218,10 +9930,10 @@ var ts; else if (typeStack && ts.contains(typeStack, type)) { var typeAlias = getTypeAliasForTypeLiteral(type); if (typeAlias) { - buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, ts.SymbolFlags.Type); + buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 3152352 /* Type */); } else { - writeKeyword(writer, 105 /* AnyKeyword */); + writeKeyword(writer, 109 /* AnyKeyword */); } } else { @@ -10234,8 +9946,8 @@ var ts; } function shouldWriteTypeOfFunctionSymbol() { if (type.symbol) { - var isStaticMethodSymbol = !!(type.symbol.flags & 4096 /* 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 === 186 /* SourceFile */ || declaration.parent.kind === 182 /* ModuleBlock */; })); + 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 */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2 /* UseTypeOfFunction */) || (typeStack && ts.contains(typeStack, type)); } @@ -10243,111 +9955,111 @@ var ts; } } function writeTypeofSymbol(type) { - writeKeyword(writer, 91 /* TypeOfKeyword */); + writeKeyword(writer, 95 /* TypeOfKeyword */); writeSpace(writer); - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, ts.SymbolFlags.Value); + buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455 /* Value */); } function writeLiteralType(type, flags) { var resolved = resolveObjectOrUnionTypeMembers(type); if (!resolved.properties.length && !resolved.stringIndexType && !resolved.numberIndexType) { if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { - writePunctuation(writer, 9 /* OpenBraceToken */); - writePunctuation(writer, 10 /* CloseBraceToken */); + writePunctuation(writer, 13 /* OpenBraceToken */); + writePunctuation(writer, 14 /* CloseBraceToken */); return; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { if (flags & 64 /* InElementType */) { - writePunctuation(writer, 11 /* OpenParenToken */); + writePunctuation(writer, 15 /* OpenParenToken */); } buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, typeStack); if (flags & 64 /* InElementType */) { - writePunctuation(writer, 12 /* CloseParenToken */); + writePunctuation(writer, 16 /* CloseParenToken */); } return; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { if (flags & 64 /* InElementType */) { - writePunctuation(writer, 11 /* OpenParenToken */); + writePunctuation(writer, 15 /* OpenParenToken */); } - writeKeyword(writer, 82 /* NewKeyword */); + writeKeyword(writer, 86 /* NewKeyword */); writeSpace(writer); buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, typeStack); if (flags & 64 /* InElementType */) { - writePunctuation(writer, 12 /* CloseParenToken */); + writePunctuation(writer, 16 /* CloseParenToken */); } return; } } - writePunctuation(writer, 9 /* OpenBraceToken */); + writePunctuation(writer, 13 /* OpenBraceToken */); writer.writeLine(); writer.increaseIndent(); for (var i = 0; i < resolved.callSignatures.length; i++) { buildSignatureDisplay(resolved.callSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } for (var i = 0; i < resolved.constructSignatures.length; i++) { - writeKeyword(writer, 82 /* NewKeyword */); + writeKeyword(writer, 86 /* NewKeyword */); writeSpace(writer); buildSignatureDisplay(resolved.constructSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } if (resolved.stringIndexType) { - writePunctuation(writer, 13 /* OpenBracketToken */); + writePunctuation(writer, 17 /* OpenBracketToken */); writer.writeParameter("x"); - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); - writeKeyword(writer, 114 /* StringKeyword */); - writePunctuation(writer, 14 /* CloseBracketToken */); - writePunctuation(writer, 46 /* ColonToken */); + writeKeyword(writer, 118 /* StringKeyword */); + writePunctuation(writer, 18 /* CloseBracketToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); writeType(resolved.stringIndexType, 0 /* None */); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } if (resolved.numberIndexType) { - writePunctuation(writer, 13 /* OpenBracketToken */); + writePunctuation(writer, 17 /* OpenBracketToken */); writer.writeParameter("x"); - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); - writeKeyword(writer, 112 /* NumberKeyword */); - writePunctuation(writer, 14 /* CloseBracketToken */); - writePunctuation(writer, 46 /* ColonToken */); + writeKeyword(writer, 116 /* NumberKeyword */); + writePunctuation(writer, 18 /* CloseBracketToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); writeType(resolved.numberIndexType, 0 /* None */); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } for (var i = 0; i < resolved.properties.length; i++) { var p = resolved.properties[i]; var t = getTypeOfSymbol(p); - if (p.flags & (16 /* Function */ | 4096 /* Method */) && !getPropertiesOfObjectType(t).length) { + if (p.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0 /* Call */); for (var j = 0; j < signatures.length; j++) { buildSymbolDisplay(p, writer); if (isOptionalProperty(p)) { - writePunctuation(writer, 45 /* QuestionToken */); + writePunctuation(writer, 49 /* QuestionToken */); } buildSignatureDisplay(signatures[j], writer, enclosingDeclaration, globalFlagsToPass, typeStack); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } } else { buildSymbolDisplay(p, writer); if (isOptionalProperty(p)) { - writePunctuation(writer, 45 /* QuestionToken */); + writePunctuation(writer, 49 /* QuestionToken */); } - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); writeType(t, 0 /* None */); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } } writer.decreaseIndent(); - writePunctuation(writer, 10 /* CloseBraceToken */); + writePunctuation(writer, 14 /* CloseBraceToken */); } } function buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaraiton, flags) { @@ -10361,67 +10073,67 @@ var ts; var constraint = getConstraintOfTypeParameter(tp); if (constraint) { writeSpace(writer); - writeKeyword(writer, 73 /* ExtendsKeyword */); + writeKeyword(writer, 77 /* ExtendsKeyword */); writeSpace(writer); buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, typeStack); } } function buildParameterDisplay(p, writer, enclosingDeclaration, flags, typeStack) { if (getDeclarationFlagsFromSymbol(p) & 8 /* Rest */) { - writePunctuation(writer, 16 /* DotDotDotToken */); + writePunctuation(writer, 20 /* DotDotDotToken */); } appendSymbolNameOnly(p, writer); if (p.valueDeclaration.flags & 4 /* QuestionMark */ || p.valueDeclaration.initializer) { - writePunctuation(writer, 45 /* QuestionToken */); + writePunctuation(writer, 49 /* QuestionToken */); } - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, typeStack); } function buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, enclosingDeclaration, flags, typeStack) { if (typeParameters && typeParameters.length) { - writePunctuation(writer, 19 /* LessThanToken */); + writePunctuation(writer, 23 /* LessThanToken */); for (var i = 0; i < typeParameters.length; i++) { if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); + writePunctuation(writer, 22 /* CommaToken */); writeSpace(writer); } buildTypeParameterDisplay(typeParameters[i], writer, enclosingDeclaration, flags, typeStack); } - writePunctuation(writer, 20 /* GreaterThanToken */); + writePunctuation(writer, 24 /* GreaterThanToken */); } } function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration, flags, typeStack) { if (typeParameters && typeParameters.length) { - writePunctuation(writer, 19 /* LessThanToken */); + writePunctuation(writer, 23 /* LessThanToken */); for (var i = 0; i < typeParameters.length; i++) { if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); + writePunctuation(writer, 22 /* CommaToken */); writeSpace(writer); } buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, 0 /* None */); } - writePunctuation(writer, 20 /* GreaterThanToken */); + writePunctuation(writer, 24 /* GreaterThanToken */); } } function buildDisplayForParametersAndDelimiters(parameters, writer, enclosingDeclaration, flags, typeStack) { - writePunctuation(writer, 11 /* OpenParenToken */); + writePunctuation(writer, 15 /* OpenParenToken */); for (var i = 0; i < parameters.length; i++) { if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); + writePunctuation(writer, 22 /* CommaToken */); writeSpace(writer); } buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, typeStack); } - writePunctuation(writer, 12 /* CloseParenToken */); + writePunctuation(writer, 16 /* CloseParenToken */); } function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, typeStack) { if (flags & 8 /* WriteArrowStyleSignature */) { writeSpace(writer); - writePunctuation(writer, 27 /* EqualsGreaterThanToken */); + writePunctuation(writer, 31 /* EqualsGreaterThanToken */); } else { - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); } writeSpace(writer); buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags, typeStack); @@ -10454,12 +10166,12 @@ var ts; function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 181 /* ModuleDeclaration */) { + if (node.kind === 188 /* ModuleDeclaration */) { if (node.name.kind === 7 /* StringLiteral */) { return node; } } - else if (node.kind === 186 /* SourceFile */) { + else if (node.kind === 193 /* SourceFile */) { return ts.isExternalModule(node) ? node : undefined; } } @@ -10475,7 +10187,7 @@ var ts; if (isSymbolUsedInExportAssignment(symbolOfNode)) { return true; } - if (symbolOfNode.flags & 16777216 /* Import */) { + if (symbolOfNode.flags & 33554432 /* Import */) { return isSymbolUsedInExportAssignment(resolveImport(symbolOfNode)); } } @@ -10483,7 +10195,7 @@ var ts; if (exportAssignmentSymbol === symbol) { return true; } - if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 16777216 /* Import */)) { + if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 33554432 /* Import */)) { resolvedExportSymbol = resolvedExportSymbol || resolveImport(exportAssignmentSymbol); if (resolvedExportSymbol === symbol) { return true; @@ -10501,35 +10213,35 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 174 /* VariableDeclaration */: - case 181 /* ModuleDeclaration */: - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - case 179 /* TypeAliasDeclaration */: - case 175 /* FunctionDeclaration */: - case 180 /* EnumDeclaration */: - case 183 /* ImportDeclaration */: - var parent = node.kind === 174 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (!(node.flags & 1 /* Export */) && !(node.kind !== 183 /* ImportDeclaration */ && parent.kind !== 186 /* SourceFile */ && ts.isInAmbientContext(parent))) { + 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))) { return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); } return isDeclarationVisible(parent); - case 120 /* Property */: - case 121 /* Method */: + case 124 /* Property */: + case 125 /* Method */: if (node.flags & (32 /* Private */ | 64 /* Protected */)) { return false; } - case 122 /* Constructor */: - case 126 /* ConstructSignature */: - case 125 /* CallSignature */: - case 127 /* IndexSignature */: - case 119 /* Parameter */: - case 182 /* ModuleBlock */: + case 126 /* Constructor */: + case 130 /* ConstructSignature */: + case 129 /* CallSignature */: + case 131 /* IndexSignature */: + case 123 /* Parameter */: + case 189 /* ModuleBlock */: return isDeclarationVisible(node.parent); - case 186 /* SourceFile */: + case 193 /* SourceFile */: return true; default: - ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + ts.SyntaxKind[node.kind]); + ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } } if (node) { @@ -10545,16 +10257,16 @@ var ts; return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; } function getTypeOfVariableDeclaration(declaration) { - if (declaration.parent.kind === 159 /* ForInStatement */) { + if (declaration.parent.kind === 166 /* ForInStatement */) { return anyType; } if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 119 /* Parameter */) { + if (declaration.kind === 123 /* Parameter */) { var func = declaration.parent; - if (func.kind === 124 /* SetAccessor */) { - var getter = getDeclarationOfKind(declaration.parent.symbol, 123 /* GetAccessor */); + if (func.kind === 128 /* SetAccessor */) { + var getter = getDeclarationOfKind(declaration.parent.symbol, 127 /* GetAccessor */); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -10566,7 +10278,7 @@ var ts; } if (declaration.initializer) { var type = checkAndMarkExpression(declaration.initializer); - if (declaration.kind !== 137 /* PropertyAssignment */) { + if (declaration.kind !== 141 /* PropertyAssignment */) { var unwidenedType = type; type = getWidenedType(type); if (type !== unwidenedType) { @@ -10585,14 +10297,14 @@ var ts; if (getInnermostTypeOfNestedArrayTypes(type) !== anyType) { return; } - if (isPrivateWithinAmbient(declaration) || (declaration.kind === 119 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { + if (isPrivateWithinAmbient(declaration) || (declaration.kind === 123 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { return; } switch (declaration.kind) { - case 120 /* Property */: + case 124 /* Property */: var diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 119 /* Parameter */: + case 123 /* Parameter */: var diagnostic = declaration.flags & 8 /* Rest */ ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; default: @@ -10604,11 +10316,11 @@ var ts; function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.flags & 268435456 /* Prototype */) { + if (symbol.flags & 536870912 /* Prototype */) { return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.kind === 171 /* CatchBlock */) { + if (declaration.kind === 178 /* CatchBlock */) { return links.type = anyType; } links.type = resolvingType; @@ -10631,7 +10343,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 123 /* GetAccessor */) { + if (accessor.kind === 127 /* GetAccessor */) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -10650,8 +10362,8 @@ var ts; links = links || getSymbolLinks(symbol); if (!links.type) { links.type = resolvingType; - var getter = getDeclarationOfKind(symbol, 123 /* GetAccessor */); - var setter = getDeclarationOfKind(symbol, 124 /* SetAccessor */); + var getter = getDeclarationOfKind(symbol, 127 /* GetAccessor */); + var setter = getDeclarationOfKind(symbol, 128 /* SetAccessor */); var type; var getterReturnType = getAnnotatedAccessorType(getter); if (getterReturnType) { @@ -10681,7 +10393,7 @@ var ts; else if (links.type === resolvingType) { links.type = anyType; if (compilerOptions.noImplicitAny) { - var getter = getDeclarationOfKind(symbol, 123 /* GetAccessor */); + var getter = getDeclarationOfKind(symbol, 127 /* GetAccessor */); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -10715,22 +10427,22 @@ var ts; return links.type; } function getTypeOfSymbol(symbol) { - if (symbol.flags & 33554432 /* Instantiated */) { + if (symbol.flags & 67108864 /* Instantiated */) { return getTypeOfInstantiatedSymbol(symbol); } - if (symbol.flags & (ts.SymbolFlags.Variable | 4 /* Property */)) { + if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { return getTypeOfVariableOrParameterOrProperty(symbol); } - if (symbol.flags & (16 /* Function */ | 4096 /* Method */ | 32 /* Class */ | 128 /* Enum */ | 256 /* ValueModule */)) { + if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { return getTypeOfFuncClassEnumModule(symbol); } if (symbol.flags & 8 /* EnumMember */) { return getTypeOfEnumMember(symbol); } - if (symbol.flags & ts.SymbolFlags.Accessor) { + if (symbol.flags & 98304 /* Accessor */) { return getTypeOfAccessors(symbol); } - if (symbol.flags & 16777216 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { return getTypeOfImport(symbol); } return unknownType; @@ -10748,7 +10460,7 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 178 /* InterfaceDeclaration */ || node.kind === 177 /* ClassDeclaration */) { + if (node.kind === 185 /* InterfaceDeclaration */ || node.kind === 184 /* ClassDeclaration */) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { @@ -10779,7 +10491,7 @@ var ts; type.typeArguments = type.typeParameters; } type.baseTypes = []; - var declaration = getDeclarationOfKind(symbol, 177 /* ClassDeclaration */); + var declaration = getDeclarationOfKind(symbol, 184 /* ClassDeclaration */); if (declaration.baseType) { var baseType = getTypeFromTypeReferenceNode(declaration.baseType); if (baseType !== unknownType) { @@ -10819,7 +10531,7 @@ var ts; } type.baseTypes = []; ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 178 /* InterfaceDeclaration */ && declaration.baseTypes) { + if (declaration.kind === 185 /* InterfaceDeclaration */ && declaration.baseTypes) { ts.forEach(declaration.baseTypes, function (node) { var baseType = getTypeFromTypeReferenceNode(node); if (baseType !== unknownType) { @@ -10850,7 +10562,7 @@ var ts; var links = getSymbolLinks(symbol); if (!links.declaredType) { links.declaredType = resolvingType; - var declaration = getDeclarationOfKind(symbol, 179 /* TypeAliasDeclaration */); + var declaration = getDeclarationOfKind(symbol, 186 /* TypeAliasDeclaration */); var type = getTypeFromTypeNode(declaration.type); if (links.declaredType === resolvingType) { links.declaredType = type; @@ -10858,7 +10570,7 @@ var ts; } else if (links.declaredType === resolvingType) { links.declaredType = unknownType; - var declaration = getDeclarationOfKind(symbol, 179 /* TypeAliasDeclaration */); + var declaration = getDeclarationOfKind(symbol, 186 /* TypeAliasDeclaration */); error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); } return links.declaredType; @@ -10877,7 +10589,7 @@ var ts; if (!links.declaredType) { var type = createType(512 /* TypeParameter */); type.symbol = symbol; - if (!getDeclarationOfKind(symbol, 118 /* TypeParameter */).constraint) { + if (!getDeclarationOfKind(symbol, 122 /* TypeParameter */).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -10892,23 +10604,23 @@ var ts; return links.declaredType; } function getDeclaredTypeOfSymbol(symbol) { - ts.Debug.assert((symbol.flags & 33554432 /* Instantiated */) === 0); + ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0); if (symbol.flags & 32 /* Class */) { return getDeclaredTypeOfClass(symbol); } if (symbol.flags & 64 /* Interface */) { return getDeclaredTypeOfInterface(symbol); } - if (symbol.flags & 1048576 /* TypeAlias */) { + if (symbol.flags & 2097152 /* TypeAlias */) { return getDeclaredTypeOfTypeAlias(symbol); } - if (symbol.flags & 128 /* Enum */) { + if (symbol.flags & 384 /* Enum */) { return getDeclaredTypeOfEnum(symbol); } - if (symbol.flags & 524288 /* TypeParameter */) { + if (symbol.flags & 1048576 /* TypeParameter */) { return getDeclaredTypeOfTypeParameter(symbol); } - if (symbol.flags & 16777216 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { return getDeclaredTypeOfImport(symbol); } return unknownType; @@ -11010,7 +10722,7 @@ var ts; function createTupleTypeMemberSymbols(memberTypes) { var members = {}; for (var i = 0; i < memberTypes.length; i++) { - var symbol = createSymbol(4 /* Property */ | 134217728 /* Transient */, "" + i); + var symbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "" + i); symbol.type = memberTypes[i]; members[i] = symbol; } @@ -11027,7 +10739,7 @@ var ts; return false; } for (var i = 0; i < s.length; i++) { - if (!compareSignatures(s[i], t[i], false, isTypeIdenticalTo)) { + if (!compareSignatures(s[i], t[i], false, compareTypes)) { return false; } } @@ -11074,7 +10786,7 @@ var ts; } function resolveAnonymousTypeMembers(type) { var symbol = type.symbol; - if (symbol.flags & 1024 /* TypeLiteral */) { + if (symbol.flags & 2048 /* TypeLiteral */) { var members = symbol.members; var callSignatures = getSignaturesOfSymbol(members["__call"]); var constructSignatures = getSignaturesOfSymbol(members["__new"]); @@ -11085,10 +10797,10 @@ var ts; var members = emptySymbols; var callSignatures = emptyArray; var constructSignatures = emptyArray; - if (symbol.flags & ts.SymbolFlags.HasExports) { + if (symbol.flags & 1952 /* HasExports */) { members = symbol.exports; } - if (symbol.flags & (16 /* Function */ | 4096 /* Method */)) { + if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) { callSignatures = getSignaturesOfSymbol(symbol); } if (symbol.flags & 32 /* Class */) { @@ -11103,7 +10815,7 @@ var ts; } } var stringIndexType = undefined; - var numberIndexType = (symbol.flags & 128 /* Enum */) ? stringType : undefined; + var numberIndexType = (symbol.flags & 384 /* Enum */) ? stringType : undefined; } setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } @@ -11128,13 +10840,13 @@ var ts; return type; } function getPropertiesOfObjectType(type) { - if (type.flags & ts.TypeFlags.ObjectType) { + if (type.flags & 48128 /* ObjectType */) { return resolveObjectOrUnionTypeMembers(type).properties; } return emptyArray; } function getPropertyOfObjectType(type, name) { - if (type.flags & ts.TypeFlags.ObjectType) { + if (type.flags & 48128 /* ObjectType */) { var resolved = resolveObjectOrUnionTypeMembers(type); if (ts.hasProperty(resolved.members, name)) { var symbol = resolved.members[name]; @@ -11169,10 +10881,10 @@ var ts; type = emptyObjectType; } } - if (type.flags & ts.TypeFlags.StringLike) { + if (type.flags & 258 /* StringLike */) { type = globalStringType; } - else if (type.flags & ts.TypeFlags.NumberLike) { + else if (type.flags & 132 /* NumberLike */) { type = globalNumberType; } else if (type.flags & 8 /* Boolean */) { @@ -11207,7 +10919,7 @@ var ts; } propTypes.push(getTypeOfSymbol(prop)); } - var result = createSymbol(4 /* Property */ | 134217728 /* Transient */ | 536870912 /* UnionProperty */, name); + var result = createSymbol(4 /* Property */ | 268435456 /* Transient */ | 1073741824 /* UnionProperty */, name); result.unionType = unionType; result.declarations = declarations; result.type = getUnionType(propTypes); @@ -11228,9 +10940,9 @@ var ts; if (type.flags & 16384 /* Union */) { return getPropertyOfUnionType(type, name); } - if (!(type.flags & ts.TypeFlags.ObjectType)) { + if (!(type.flags & 48128 /* ObjectType */)) { type = getApparentType(type); - if (!(type.flags & ts.TypeFlags.ObjectType)) { + if (!(type.flags & 48128 /* ObjectType */)) { return undefined; } } @@ -11249,7 +10961,7 @@ var ts; return getPropertyOfObjectType(globalObjectType, name); } function getSignaturesOfObjectOrUnionType(type, kind) { - if (type.flags & (ts.TypeFlags.ObjectType | 16384 /* Union */)) { + if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { var resolved = resolveObjectOrUnionTypeMembers(type); return kind === 0 /* Call */ ? resolved.callSignatures : resolved.constructSignatures; } @@ -11259,7 +10971,7 @@ var ts; return getSignaturesOfObjectOrUnionType(getApparentType(type), kind); } function getIndexTypeOfObjectOrUnionType(type, kind) { - if (type.flags & (ts.TypeFlags.ObjectType | 16384 /* Union */)) { + if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { var resolved = resolveObjectOrUnionTypeMembers(type); return kind === 0 /* String */ ? resolved.stringIndexType : resolved.numberIndexType; } @@ -11280,7 +10992,7 @@ var ts; function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 122 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var classType = declaration.kind === 126 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; var hasStringLiterals = false; @@ -11308,8 +11020,8 @@ var ts; returnType = getTypeFromTypeNode(declaration.type); } else { - if (declaration.kind === 123 /* GetAccessor */) { - var setter = getDeclarationOfKind(declaration.symbol, 124 /* SetAccessor */); + if (declaration.kind === 127 /* GetAccessor */) { + var setter = getDeclarationOfKind(declaration.symbol, 128 /* SetAccessor */); returnType = getAnnotatedAccessorType(setter); } if (!returnType && !declaration.body) { @@ -11327,16 +11039,16 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 175 /* FunctionDeclaration */: - case 121 /* Method */: - case 122 /* Constructor */: - case 125 /* CallSignature */: - case 126 /* ConstructSignature */: - case 127 /* IndexSignature */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: + case 182 /* FunctionDeclaration */: + case 125 /* Method */: + case 126 /* Constructor */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 149 /* FunctionExpression */: + case 150 /* 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) { @@ -11405,7 +11117,7 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 122 /* Constructor */ || signature.declaration.kind === 126 /* ConstructSignature */; + var isConstructor = signature.declaration.kind === 126 /* Constructor */ || signature.declaration.kind === 130 /* ConstructSignature */; var type = createObjectType(32768 /* Anonymous */ | 65536 /* FromSignature */); type.members = emptySymbols; type.properties = emptyArray; @@ -11419,7 +11131,7 @@ var ts; return symbol.members["__index"]; } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 112 /* NumberKeyword */ : 114 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 116 /* NumberKeyword */ : 118 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; @@ -11446,7 +11158,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 118 /* TypeParameter */).constraint); + type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 122 /* TypeParameter */).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -11486,17 +11198,17 @@ var ts; while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { currentNode = currentNode.parent; } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 118 /* TypeParameter */; + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 122 /* TypeParameter */; return links.isIllegalTypeReferenceInConstraint; } function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { var typeParameterSymbol; function check(n) { - if (n.kind === 128 /* TypeReference */ && n.typeName.kind === 59 /* Identifier */) { + if (n.kind === 132 /* TypeReference */ && n.typeName.kind === 63 /* Identifier */) { var links = getNodeLinks(n); if (links.isIllegalTypeReferenceInConstraint === undefined) { - var symbol = resolveName(typeParameter, n.typeName.text, ts.SymbolFlags.Type, undefined, undefined); - if (symbol && (symbol.flags & 524288 /* TypeParameter */)) { + var symbol = resolveName(typeParameter, n.typeName.text, 3152352 /* Type */, undefined, undefined); + if (symbol && (symbol.flags & 1048576 /* TypeParameter */)) { links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; }); } } @@ -11514,10 +11226,10 @@ var ts; function getTypeFromTypeReferenceNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - var symbol = resolveEntityName(node, node.typeName, ts.SymbolFlags.Type); + var symbol = resolveEntityName(node, node.typeName, 3152352 /* Type */); if (symbol) { var type; - if ((symbol.flags & 524288 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { + if ((symbol.flags & 1048576 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { type = unknownType; } else { @@ -11557,9 +11269,9 @@ var ts; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; switch (declaration.kind) { - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - case 180 /* EnumDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 187 /* EnumDeclaration */: return declaration; } } @@ -11568,7 +11280,7 @@ var ts; return emptyObjectType; } var type = getDeclaredTypeOfSymbol(symbol); - if (!(type.flags & ts.TypeFlags.ObjectType)) { + if (!(type.flags & 48128 /* ObjectType */)) { error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name); return emptyObjectType; } @@ -11579,7 +11291,7 @@ var ts; return type; } function getGlobalSymbol(name) { - return resolveName(undefined, name, ts.SymbolFlags.Type, ts.Diagnostics.Cannot_find_global_type_0, name); + return resolveName(undefined, name, 3152352 /* Type */, ts.Diagnostics.Cannot_find_global_type_0, name); } function getGlobalType(name) { return getTypeOfGlobalSymbol(getGlobalSymbol(name), 0); @@ -11722,34 +11434,34 @@ var ts; } function getTypeFromTypeNode(node) { switch (node.kind) { - case 105 /* AnyKeyword */: + case 109 /* AnyKeyword */: return anyType; - case 114 /* StringKeyword */: + case 118 /* StringKeyword */: return stringType; - case 112 /* NumberKeyword */: + case 116 /* NumberKeyword */: return numberType; - case 106 /* BooleanKeyword */: + case 110 /* BooleanKeyword */: return booleanType; - case 93 /* VoidKeyword */: + case 97 /* VoidKeyword */: return voidType; case 7 /* StringLiteral */: return getTypeFromStringLiteral(node); - case 128 /* TypeReference */: + case 132 /* TypeReference */: return getTypeFromTypeReferenceNode(node); - case 129 /* TypeQuery */: + case 133 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 131 /* ArrayType */: + case 135 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 132 /* TupleType */: + case 136 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 133 /* UnionType */: + case 137 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 134 /* ParenType */: + case 138 /* ParenType */: return getTypeFromTypeNode(node.type); - case 130 /* TypeLiteral */: + case 134 /* TypeLiteral */: return getTypeFromTypeLiteralNode(node); - case 59 /* Identifier */: - case 117 /* QualifiedName */: + case 63 /* Identifier */: + case 121 /* QualifiedName */: var symbol = getSymbolInfo(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -11774,10 +11486,8 @@ var ts; } function createTypeMapper(sources, targets) { switch (sources.length) { - case 1: - return createUnaryTypeMapper(sources[0], targets[0]); - case 2: - return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); + case 1: return createUnaryTypeMapper(sources[0], targets[0]); + case 2: return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); } return function (t) { for (var i = 0; i < sources.length; i++) { @@ -11795,10 +11505,8 @@ var ts; } function createTypeEraser(sources) { switch (sources.length) { - case 1: - return createUnaryTypeEraser(sources[0]); - case 2: - return createBinaryTypeEraser(sources[0], sources[1]); + case 1: return createUnaryTypeEraser(sources[0]); + case 2: return createBinaryTypeEraser(sources[0], sources[1]); } return function (t) { for (var i = 0; i < sources.length; i++) { @@ -11847,12 +11555,12 @@ var ts; return result; } function instantiateSymbol(symbol, mapper) { - if (symbol.flags & 33554432 /* Instantiated */) { + if (symbol.flags & 67108864 /* Instantiated */) { var links = getSymbolLinks(symbol); symbol = links.target; mapper = combineTypeMappers(links.mapper, mapper); } - var result = createSymbol(33554432 /* Instantiated */ | 134217728 /* Transient */ | symbol.flags, symbol.name); + var result = createSymbol(67108864 /* Instantiated */ | 268435456 /* Transient */ | symbol.flags, symbol.name); result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -11882,7 +11590,7 @@ var ts; return mapper(type); } if (type.flags & 32768 /* Anonymous */) { - return type.symbol && type.symbol.flags & (16 /* Function */ | 4096 /* Method */ | 1024 /* TypeLiteral */ | 2048 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; + return type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; } if (type.flags & 4096 /* Reference */) { return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType)); @@ -11898,22 +11606,22 @@ var ts; } function isContextSensitiveExpression(node) { switch (node.kind) { - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: return !node.typeParameters && !ts.forEach(node.parameters, function (p) { return p.type; }); - case 136 /* ObjectLiteral */: - return ts.forEach(node.properties, function (p) { return p.kind === 137 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); - case 135 /* ArrayLiteral */: + case 140 /* ObjectLiteral */: + return ts.forEach(node.properties, function (p) { return p.kind === 141 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); + case 139 /* ArrayLiteral */: return ts.forEach(node.elements, function (e) { return isContextSensitiveExpression(e); }); - case 149 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return isContextSensitiveExpression(node.whenTrue) || isContextSensitiveExpression(node.whenFalse); - case 148 /* BinaryExpression */: - return node.operator === 44 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); + case 153 /* BinaryExpression */: + return node.operator === 48 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); } return false; } function getTypeWithoutConstructors(type) { - if (type.flags & ts.TypeFlags.ObjectType) { + if (type.flags & 48128 /* ObjectType */) { var resolved = resolveObjectOrUnionTypeMembers(type); if (resolved.constructSignatures.length) { var result = createObjectType(32768 /* Anonymous */, type.symbol); @@ -11932,78 +11640,26 @@ var ts; function isTypeIdenticalTo(source, target) { return checkTypeRelatedTo(source, target, identityRelation, undefined); } + function compareTypes(source, target) { + return checkTypeRelatedTo(source, target, identityRelation, undefined) ? -1 /* True */ : 0 /* False */; + } function isTypeSubtypeOf(source, target) { return checkTypeSubtypeOf(source, target, undefined); } - function checkTypeSubtypeOf(source, target, errorNode, headMessage, containingMessageChain) { - return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, headMessage, containingMessageChain); - } function isTypeAssignableTo(source, target) { return checkTypeAssignableTo(source, target, undefined); } + function checkTypeSubtypeOf(source, target, errorNode, headMessage, containingMessageChain) { + return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, headMessage, containingMessageChain); + } function checkTypeAssignableTo(source, target, errorNode, headMessage) { return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage); } - function isTypeRelatedTo(source, target, relation) { - return checkTypeRelatedTo(source, target, relation, undefined); - } function isSignatureAssignableTo(source, target) { var sourceType = getOrCreateTypeFromSignature(source); var targetType = getOrCreateTypeFromSignature(target); return checkTypeRelatedTo(sourceType, targetType, assignableRelation, undefined); } - function isPropertyIdenticalTo(sourceProp, targetProp) { - return isPropertyIdenticalToRecursive(sourceProp, targetProp, false, function (s, t, _reportErrors) { return isTypeIdenticalTo(s, t); }); - } - function checkInheritedPropertiesAreIdentical(type, typeNode) { - if (!type.baseTypes.length || type.baseTypes.length === 1) { - return true; - } - var seen = {}; - ts.forEach(type.declaredProperties, function (p) { - seen[p.name] = { prop: p, containingType: type }; - }); - var ok = true; - for (var i = 0, len = type.baseTypes.length; i < len; ++i) { - var base = type.baseTypes[i]; - var properties = getPropertiesOfObjectType(base); - for (var j = 0, proplen = properties.length; j < proplen; ++j) { - var prop = properties[j]; - if (!ts.hasProperty(seen, prop.name)) { - seen[prop.name] = { prop: prop, containingType: base }; - } - else { - var existing = seen[prop.name]; - var isInheritedProperty = existing.containingType !== type; - if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { - ok = false; - var typeName1 = typeToString(existing.containingType); - var typeName2 = typeToString(base); - var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); - addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine())); - } - } - } - } - return ok; - } - function isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, relate) { - if (sourceProp === targetProp) { - return true; - } - var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (32 /* Private */ | 64 /* Protected */); - var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (32 /* Private */ | 64 /* Protected */); - if (sourcePropAccessibility !== targetPropAccessibility) { - return false; - } - if (sourcePropAccessibility) { - return getTargetSymbol(sourceProp) === getTargetSymbol(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - else { - return isOptionalProperty(sourceProp) === isOptionalProperty(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - } function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain) { var errorInfo; var sourceStack; @@ -12012,7 +11668,7 @@ var ts; var depth = 0; var overflow = false; ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - var result = isRelatedToWithCustomErrors(source, target, errorNode !== undefined, headMessage); + var result = isRelatedTo(source, target, errorNode !== undefined, headMessage); if (overflow) { error(errorNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); } @@ -12022,109 +11678,114 @@ var ts; } addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, program.getCompilerHost().getNewLine())); } - return result; + return result !== 0 /* False */; function reportError(message, arg0, arg1, arg2) { errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } - function isRelatedTo(source, target, reportErrors) { - return isRelatedToWithCustomErrors(source, target, reportErrors, undefined); - } - function isRelatedToWithCustomErrors(source, target, reportErrors, headMessage) { + function isRelatedTo(source, target, reportErrors, headMessage) { + var result; if (relation === identityRelation) { if (source === target) - return true; + return -1 /* True */; } else { if (source === target) - return true; + return -1 /* True */; if (target.flags & 1 /* Any */) - return true; + return -1 /* True */; if (source === undefinedType) - return true; + return -1 /* True */; if (source === nullType && target !== undefinedType) - return true; + return -1 /* True */; if (source.flags & 128 /* Enum */ && target === numberType) - return true; + return -1 /* True */; if (source.flags & 256 /* StringLiteral */ && target === stringType) - return true; + return -1 /* True */; if (relation === assignableRelation) { if (source.flags & 1 /* Any */) - return true; + return -1 /* True */; if (source === numberType && target.flags & 128 /* Enum */) - return true; + return -1 /* True */; } } if (source.flags & 16384 /* Union */) { - if (unionTypeRelatedToType(source, target, reportErrors)) { - return true; + if (result = unionTypeRelatedToType(source, target, reportErrors)) { + return result; } } else if (target.flags & 16384 /* Union */) { - if (typeRelatedToUnionType(source, target, reportErrors)) { - return true; + if (result = typeRelatedToUnionType(source, target, reportErrors)) { + return result; } } else if (source.flags & 512 /* TypeParameter */ && target.flags & 512 /* TypeParameter */) { - if (typeParameterRelatedTo(source, target, reportErrors)) { - return true; + if (result = typeParameterRelatedTo(source, target, reportErrors)) { + return result; } } else { var saveErrorInfo = errorInfo; if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { - if (typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { - return true; + if (result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { + return result; } } var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); - if (sourceOrApparentType.flags & ts.TypeFlags.ObjectType && target.flags & ts.TypeFlags.ObjectType && objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) { + if (sourceOrApparentType.flags & 48128 /* ObjectType */ && target.flags & 48128 /* ObjectType */ && (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors))) { errorInfo = saveErrorInfo; - return true; + return result; } } if (reportErrors) { headMessage = headMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1; - ts.Debug.assert(headMessage); reportError(headMessage, typeToString(source), typeToString(target)); } - return false; + return 0 /* False */; } function typeRelatedToUnionType(source, target, reportErrors) { var targetTypes = target.types; for (var i = 0, len = targetTypes.length; i < len; i++) { - if (isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1)) { - return true; + var related = isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1); + if (related) { + return related; } } - return false; + return 0 /* False */; } function unionTypeRelatedToType(source, target, reportErrors) { + var result = -1 /* True */; var sourceTypes = source.types; for (var i = 0, len = sourceTypes.length; i < len; i++) { - if (!isRelatedTo(sourceTypes[i], target, reportErrors)) { - return false; + var related = isRelatedTo(sourceTypes[i], target, reportErrors); + if (!related) { + return 0 /* False */; } + result &= related; } - return true; + return result; } function typesRelatedTo(sources, targets, reportErrors) { + var result = -1 /* True */; for (var i = 0, len = sources.length; i < len; i++) { - if (!isRelatedTo(sources[i], targets[i], reportErrors)) - return false; + var related = isRelatedTo(sources[i], targets[i], reportErrors); + if (!related) { + return 0 /* False */; + } + result &= related; } - return true; + return result; } function typeParameterRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { if (source.symbol.name !== target.symbol.name) { - return false; + return 0 /* False */; } if (source.constraint === target.constraint) { - return true; + return -1 /* True */; } if (source.constraint === noConstraintType || target.constraint === noConstraintType) { - return false; + return 0 /* False */; } return isRelatedTo(source.constraint, target.constraint, reportErrors); } @@ -12132,29 +11793,32 @@ var ts; while (true) { var constraint = getConstraintOfTypeParameter(source); if (constraint === target) - return true; + return -1 /* True */; if (!(constraint && constraint.flags & 512 /* TypeParameter */)) break; source = constraint; } - return false; + return 0 /* False */; } } function objectTypeRelatedTo(source, target, reportErrors) { - if (overflow) - return false; - var result; + if (overflow) { + return 0 /* False */; + } var id = source.id + "," + target.id; - if ((result = relation[id]) !== undefined) - return result; + var related = relation[id]; + if (related !== undefined) { + return related; + } if (depth > 0) { for (var i = 0; i < depth; i++) { - if (source === sourceStack[i] && target === targetStack[i]) - return true; + if (source === sourceStack[i] && target === targetStack[i]) { + return 1 /* Maybe */; + } } if (depth === 100) { overflow = true; - return false; + return 0 /* False */; } } else { @@ -12170,10 +11834,27 @@ var ts; expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; - result = expandingFlags === 3 || propertiesRelatedTo(source, target, reportErrors) && signaturesRelatedTo(source, target, 0 /* Call */, reportErrors) && signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors) && stringIndexTypesRelatedTo(source, target, reportErrors) && numberIndexTypesRelatedTo(source, target, reportErrors); + if (expandingFlags === 3) { + var result = -1 /* True */; + } + else { + var result = propertiesRelatedTo(source, target, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 0 /* Call */, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors); + if (result) { + result &= stringIndexTypesRelatedTo(source, target, reportErrors); + if (result) { + result &= numberIndexTypesRelatedTo(source, target, reportErrors); + } + } + } + } + } expandingFlags = saveExpandingFlags; depth--; - if (depth === 0) { + if (result !== 1 /* Maybe */) { relation[id] = result; } return result; @@ -12195,8 +11876,9 @@ var ts; } function propertiesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return propertiesIdenticalTo(source, target, reportErrors); + return propertiesIdenticalTo(source, target); } + var result = -1 /* True */; var properties = getPropertiesOfObjectType(target); for (var i = 0; i < properties.length; i++) { var targetProp = properties[i]; @@ -12207,10 +11889,10 @@ var ts; if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); } - return false; + return 0 /* False */; } } - else if (!(targetProp.flags & 268435456 /* Prototype */)) { + else if (!(targetProp.flags & 536870912 /* Prototype */)) { var sourceFlags = getDeclarationFlagsFromSymbol(sourceProp); var targetFlags = getDeclarationFlagsFromSymbol(targetProp); if (sourceFlags & 32 /* Private */ || targetFlags & 32 /* Private */) { @@ -12223,7 +11905,7 @@ var ts; reportError(ts.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourceFlags & 32 /* Private */ ? source : target), typeToString(sourceFlags & 32 /* Private */ ? target : source)); } } - return false; + return 0 /* False */; } } else if (targetFlags & 64 /* Protected */) { @@ -12234,55 +11916,65 @@ var ts; if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass)); } - return false; + return 0 /* False */; } } else if (sourceFlags & 64 /* Protected */) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); } - return false; + return 0 /* False */; } - if (!isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors)) { + var related = isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); + if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Types_of_property_0_are_incompatible, symbolToString(targetProp)); } - return false; + return 0 /* False */; } + result &= related; if (isOptionalProperty(sourceProp) && !isOptionalProperty(targetProp)) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); } - return false; + return 0 /* False */; } } } } - return true; + return result; } - function propertiesIdenticalTo(source, target, reportErrors) { + function propertiesIdenticalTo(source, target) { var sourceProperties = getPropertiesOfObjectType(source); var targetProperties = getPropertiesOfObjectType(target); if (sourceProperties.length !== targetProperties.length) { - return false; + return 0 /* False */; } + var result = -1 /* True */; for (var i = 0, len = sourceProperties.length; i < len; ++i) { var sourceProp = sourceProperties[i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); - if (!targetProp || !isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, isRelatedTo)) { - return false; + if (!targetProp) { + return 0 /* False */; } + var related = compareProperties(sourceProp, targetProp, isRelatedTo); + if (!related) { + return 0 /* False */; + } + result &= related; } - return true; + return result; } function signaturesRelatedTo(source, target, kind, reportErrors) { if (relation === identityRelation) { - return signaturesIdenticalTo(source, target, kind, reportErrors); + return signaturesIdenticalTo(source, target, kind); + } + if (target === anyFunctionType || source === anyFunctionType) { + return -1 /* True */; } - if (target === anyFunctionType || source === anyFunctionType) - return true; var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); + var result = -1 /* True */; var saveErrorInfo = errorInfo; outer: for (var i = 0; i < targetSignatures.length; i++) { var t = targetSignatures[i]; @@ -12291,24 +11983,26 @@ var ts; for (var j = 0; j < sourceSignatures.length; j++) { var s = sourceSignatures[j]; if (!s.hasStringLiterals || source.flags & 65536 /* FromSignature */) { - if (signatureRelatedTo(s, t, localErrors)) { + var related = signatureRelatedTo(s, t, localErrors); + if (related) { + result &= related; errorInfo = saveErrorInfo; continue outer; } localErrors = false; } } - return false; + return 0 /* False */; } } - return true; + return result; } function signatureRelatedTo(source, target, reportErrors) { if (source === target) { - return true; + return -1 /* True */; } if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return false; + return 0 /* False */; } var sourceMax = source.parameters.length; var targetMax = target.parameters.length; @@ -12331,42 +12025,49 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); + var result = -1 /* True */; for (var i = 0; i < checkCount; i++) { var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); var saveErrorInfo = errorInfo; - if (!isRelatedTo(s, t, reportErrors)) { - if (!isRelatedTo(t, s, false)) { + var related = isRelatedTo(s, t, reportErrors); + if (!related) { + related = isRelatedTo(t, s, false); + if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); } - return false; + return 0 /* False */; } errorInfo = saveErrorInfo; } + result &= related; } var t = getReturnTypeOfSignature(target); if (t === voidType) - return true; + return result; var s = getReturnTypeOfSignature(source); - return isRelatedTo(s, t, reportErrors); + return result & isRelatedTo(s, t, reportErrors); } - function signaturesIdenticalTo(source, target, kind, reportErrors) { + function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); if (sourceSignatures.length !== targetSignatures.length) { - return false; + return 0 /* False */; } + var result = -1 /* True */; for (var i = 0, len = sourceSignatures.length; i < len; ++i) { - if (!compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo)) { - return false; + var related = compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo); + if (!related) { + return 0 /* False */; } + result &= related; } - return true; + return result; } function stringIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return indexTypesIdenticalTo(0 /* String */, source, target, reportErrors); + return indexTypesIdenticalTo(0 /* String */, source, target); } var targetType = getIndexTypeOfType(target, 0 /* String */); if (targetType) { @@ -12375,20 +12076,22 @@ var ts; if (reportErrors) { reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); } - return false; + return 0 /* False */; } - if (!isRelatedTo(sourceType, targetType, reportErrors)) { + var related = isRelatedTo(sourceType, targetType, reportErrors); + if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Index_signatures_are_incompatible); } - return false; + return 0 /* False */; } + return related; } - return true; + return -1 /* True */; } function numberIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return indexTypesIdenticalTo(1 /* Number */, source, target, reportErrors); + return indexTypesIdenticalTo(1 /* Number */, source, target); } var targetType = getIndexTypeOfType(target, 1 /* Number */); if (targetType) { @@ -12398,59 +12101,98 @@ var ts; if (reportErrors) { reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); } - return false; + return 0 /* False */; } if (sourceStringType && sourceNumberType) { - var compatible = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + var related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); } else { - var compatible = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); + var related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); } - if (!compatible) { + if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Index_signatures_are_incompatible); } - return false; + return 0 /* False */; } + return related; } - return true; + return -1 /* True */; } - function indexTypesIdenticalTo(indexKind, source, target, reportErrors) { + function indexTypesIdenticalTo(indexKind, source, target) { var targetType = getIndexTypeOfType(target, indexKind); var sourceType = getIndexTypeOfType(source, indexKind); - return (!sourceType && !targetType) || (sourceType && targetType && isRelatedTo(sourceType, targetType, reportErrors)); + if (!sourceType && !targetType) { + return -1 /* True */; + } + if (sourceType && targetType) { + return isRelatedTo(sourceType, targetType); + } + return 0 /* False */; } } + function isPropertyIdenticalTo(sourceProp, targetProp) { + return compareProperties(sourceProp, targetProp, compareTypes) !== 0 /* False */; + } + function compareProperties(sourceProp, targetProp, compareTypes) { + if (sourceProp === targetProp) { + return -1 /* True */; + } + var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (32 /* Private */ | 64 /* Protected */); + var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (32 /* Private */ | 64 /* Protected */); + if (sourcePropAccessibility !== targetPropAccessibility) { + return 0 /* False */; + } + if (sourcePropAccessibility) { + if (getTargetSymbol(sourceProp) !== getTargetSymbol(targetProp)) { + return 0 /* False */; + } + } + else { + if (isOptionalProperty(sourceProp) !== isOptionalProperty(targetProp)) { + return 0 /* False */; + } + } + return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); + } function compareSignatures(source, target, compareReturnTypes, compareTypes) { if (source === target) { - return true; + return -1 /* True */; } if (source.parameters.length !== target.parameters.length || source.minArgumentCount !== target.minArgumentCount || source.hasRestParameter !== target.hasRestParameter) { - return false; + return 0 /* False */; } + var result = -1 /* True */; if (source.typeParameters && target.typeParameters) { if (source.typeParameters.length !== target.typeParameters.length) { - return false; + return 0 /* False */; } for (var i = 0, len = source.typeParameters.length; i < len; ++i) { - if (!compareTypes(source.typeParameters[i], target.typeParameters[i])) { - return false; + var related = compareTypes(source.typeParameters[i], target.typeParameters[i]); + if (!related) { + return 0 /* False */; } + result &= related; } } else if (source.typeParameters || source.typeParameters) { - return false; + return 0 /* False */; } source = getErasedSignature(source); target = getErasedSignature(target); for (var i = 0, len = source.parameters.length; i < len; i++) { var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); - if (!compareTypes(s, t)) { - return false; + var related = compareTypes(s, t); + if (!related) { + return 0 /* False */; } + result &= related; } - return !compareReturnTypes || compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + if (compareReturnTypes) { + result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + } + return result; } function isSupertypeOfEach(candidate, types) { for (var i = 0, len = types.length; i < len; i++) { @@ -12489,7 +12231,7 @@ var ts; checkTypeSubtypeOf(bestSupertypeDownfallType, bestSupertype, errorLocation, ts.Diagnostics.Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0, errorMessageChainHead); } function isTypeOfObjectLiteral(type) { - return (type.flags & 32768 /* Anonymous */) && type.symbol && (type.symbol.flags & 2048 /* ObjectLiteral */) ? true : false; + return (type.flags & 32768 /* Anonymous */) && type.symbol && (type.symbol.flags & 4096 /* ObjectLiteral */) ? true : false; } function isArrayType(type) { return type.flags & 4096 /* Reference */ && type.target === globalArrayType; @@ -12537,7 +12279,7 @@ var ts; var members = {}; var index = 0; ts.forEach(properties, function (p) { - var symbol = createSymbol(4 /* Property */ | 134217728 /* Transient */ | p.flags, p.name); + var symbol = createSymbol(4 /* Property */ | 268435456 /* Transient */ | p.flags, p.name); symbol.declarations = p.declarations; symbol.parent = p.parent; symbol.type = widenedTypes[index++]; @@ -12672,7 +12414,7 @@ var ts; inferFromTypes(sourceTypes[i], target); } } - else if (source.flags & ts.TypeFlags.ObjectType && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || (target.flags & 32768 /* Anonymous */) && target.symbol && target.symbol.flags & (4096 /* Method */ | 1024 /* TypeLiteral */))) { + else if (source.flags & 48128 /* ObjectType */ && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || (target.flags & 32768 /* Anonymous */) && target.symbol && target.symbol.flags & (8192 /* Method */ | 2048 /* TypeLiteral */))) { if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { if (depth === 0) { sourceStack = []; @@ -12756,17 +12498,17 @@ var ts; function getResolvedSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { - links.resolvedSymbol = resolveName(node, node.text, ts.SymbolFlags.Value | 2097152 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node) || unknownSymbol; + links.resolvedSymbol = resolveName(node, node.text, 107455 /* Value */ | 4194304 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node) || unknownSymbol; } return links.resolvedSymbol; } function isInTypeQuery(node) { while (node) { switch (node.kind) { - case 129 /* TypeQuery */: + case 133 /* TypeQuery */: return true; - case 59 /* Identifier */: - case 117 /* QualifiedName */: + case 63 /* Identifier */: + case 121 /* QualifiedName */: node = node.parent; continue; default: @@ -12797,12 +12539,12 @@ var ts; } return links.assignmentChecks[symbol.id] = isAssignedIn(node); function isAssignedInBinaryExpression(node) { - if (node.operator >= ts.SyntaxKind.FirstAssignment && node.operator <= ts.SyntaxKind.LastAssignment) { + if (node.operator >= 51 /* FirstAssignment */ && node.operator <= 62 /* LastAssignment */) { var n = node.left; - while (n.kind === 143 /* ParenExpression */) { + while (n.kind === 148 /* ParenExpression */) { n = n.expression; } - if (n.kind === 59 /* Identifier */ && getResolvedSymbol(n) === symbol) { + if (n.kind === 63 /* Identifier */ && getResolvedSymbol(n) === symbol) { return true; } } @@ -12816,40 +12558,40 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 148 /* BinaryExpression */: + case 153 /* BinaryExpression */: return isAssignedInBinaryExpression(node); - case 174 /* VariableDeclaration */: + case 181 /* VariableDeclaration */: return isAssignedInVariableDeclaration(node); - case 135 /* ArrayLiteral */: - case 136 /* ObjectLiteral */: - case 138 /* PropertyAccess */: - case 139 /* IndexedAccess */: - case 140 /* CallExpression */: - case 141 /* NewExpression */: - case 142 /* TypeAssertion */: - case 143 /* ParenExpression */: - case 146 /* PrefixOperator */: - case 147 /* PostfixOperator */: - case 149 /* ConditionalExpression */: - case 151 /* Block */: - case 152 /* VariableStatement */: - case 154 /* ExpressionStatement */: - case 155 /* IfStatement */: - case 156 /* DoStatement */: - case 157 /* WhileStatement */: - case 158 /* ForStatement */: - case 159 /* ForInStatement */: - case 162 /* ReturnStatement */: - case 163 /* WithStatement */: - case 164 /* SwitchStatement */: - case 165 /* CaseClause */: - case 166 /* DefaultClause */: - case 167 /* LabeledStatement */: - case 168 /* ThrowStatement */: - case 169 /* TryStatement */: - case 170 /* TryBlock */: - case 171 /* CatchBlock */: - case 172 /* FinallyBlock */: + 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 */: return ts.forEachChild(node, isAssignedIn); } return false; @@ -12857,31 +12599,31 @@ var ts; } function getNarrowedTypeOfSymbol(symbol, node) { var type = getTypeOfSymbol(symbol); - if (symbol.flags & ts.SymbolFlags.Variable && type.flags & ts.TypeFlags.Structured) { + if (symbol.flags & 3 /* Variable */ && type.flags & 65025 /* Structured */) { while (true) { var child = node; node = node.parent; - if (!node || node.kind === 176 /* FunctionBlock */ || node.kind === 182 /* ModuleBlock */) { + if (!node || node.kind === 183 /* FunctionBlock */ || node.kind === 189 /* ModuleBlock */) { break; } var narrowedType = type; switch (node.kind) { - case 155 /* IfStatement */: + case 162 /* IfStatement */: if (child !== node.expression) { narrowedType = narrowType(type, node.expression, child === node.thenStatement); } break; - case 149 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: if (child !== node.condition) { narrowedType = narrowType(type, node.condition, child === node.whenTrue); } break; - case 148 /* BinaryExpression */: + case 153 /* BinaryExpression */: if (child === node.right) { - if (node.operator === 43 /* AmpersandAmpersandToken */) { + if (node.operator === 47 /* AmpersandAmpersandToken */) { narrowedType = narrowType(type, node.left, true); } - else if (node.operator === 44 /* BarBarToken */) { + else if (node.operator === 48 /* BarBarToken */) { narrowedType = narrowType(type, node.left, false); } } @@ -12899,12 +12641,12 @@ var ts; function narrowTypeByEquality(type, expr, assumeTrue) { var left = expr.left; var right = expr.right; - if (left.kind !== 146 /* PrefixOperator */ || left.operator !== 91 /* TypeOfKeyword */ || left.operand.kind !== 59 /* Identifier */ || right.kind !== 7 /* StringLiteral */ || getResolvedSymbol(left.operand) !== symbol) { + if (left.kind !== 151 /* PrefixOperator */ || left.operator !== 95 /* TypeOfKeyword */ || left.operand.kind !== 63 /* Identifier */ || right.kind !== 7 /* StringLiteral */ || getResolvedSymbol(left.operand) !== symbol) { return type; } var t = right.text; var checkType = t === "string" ? stringType : t === "number" ? numberType : t === "boolean" ? booleanType : emptyObjectType; - if (expr.operator === 26 /* ExclamationEqualsEqualsToken */) { + if (expr.operator === 30 /* ExclamationEqualsEqualsToken */) { assumeTrue = !assumeTrue; } if (assumeTrue) { @@ -12937,7 +12679,7 @@ var ts; } } function narrowTypeByInstanceof(type, expr, assumeTrue) { - if (!assumeTrue || expr.left.kind !== 59 /* Identifier */ || getResolvedSymbol(expr.left) !== symbol) { + if (!assumeTrue || expr.left.kind !== 63 /* Identifier */ || getResolvedSymbol(expr.left) !== symbol) { return type; } var rightType = checkExpression(expr.right); @@ -12953,25 +12695,25 @@ var ts; } function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 143 /* ParenExpression */: + case 148 /* ParenExpression */: return narrowType(type, expr.expression, assumeTrue); - case 148 /* BinaryExpression */: + case 153 /* BinaryExpression */: var operator = expr.operator; - if (operator === 25 /* EqualsEqualsEqualsToken */ || operator === 26 /* ExclamationEqualsEqualsToken */) { + if (operator === 29 /* EqualsEqualsEqualsToken */ || operator === 30 /* ExclamationEqualsEqualsToken */) { return narrowTypeByEquality(type, expr, assumeTrue); } - else if (operator === 43 /* AmpersandAmpersandToken */) { + else if (operator === 47 /* AmpersandAmpersandToken */) { return narrowTypeByAnd(type, expr, assumeTrue); } - else if (operator === 44 /* BarBarToken */) { + else if (operator === 48 /* BarBarToken */) { return narrowTypeByOr(type, expr, assumeTrue); } - else if (operator === 81 /* InstanceOfKeyword */) { + else if (operator === 85 /* InstanceOfKeyword */) { return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 146 /* PrefixOperator */: - if (expr.operator === 41 /* ExclamationToken */) { + case 151 /* PrefixOperator */: + if (expr.operator === 45 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } break; @@ -12981,8 +12723,8 @@ var ts; } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); - if (symbol.flags & 16777216 /* Import */) { - getSymbolLinks(symbol).referenced = !isInTypeQuery(node); + if (symbol.flags & 33554432 /* Import */) { + getSymbolLinks(symbol).referenced = !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveImport(symbol)); } checkCollisionWithCapturedSuperVariable(node, node); checkCollisionWithCapturedThisVariable(node, node); @@ -12990,9 +12732,9 @@ var ts; return getNarrowedTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol), node); } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 177 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 184 /* ClassDeclaration */ ? container.parent : undefined; getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 120 /* Property */ || container.kind === 122 /* Constructor */) { + if (container.kind === 124 /* Property */ || container.kind === 126 /* Constructor */) { getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } else { @@ -13002,23 +12744,23 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 145 /* ArrowFunction */) { + if (container.kind === 150 /* ArrowFunction */) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = true; } switch (container.kind) { - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); break; - case 180 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 122 /* Constructor */: + case 126 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 120 /* Property */: + case 124 /* Property */: if (container.flags & 128 /* Static */) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } @@ -13027,7 +12769,7 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } - var classNode = container.parent && container.parent.kind === 177 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 184 /* ClassDeclaration */ ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); return container.flags & 128 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); @@ -13040,29 +12782,29 @@ var ts; if (!node) return node; switch (node.kind) { - case 175 /* FunctionDeclaration */: - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: - case 120 /* Property */: - case 121 /* Method */: - case 122 /* Constructor */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return node; } } } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 119 /* Parameter */) { + if (n.kind === 123 /* Parameter */) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 140 /* CallExpression */ && node.parent.func === node; - var enclosingClass = ts.getAncestor(node, 177 /* ClassDeclaration */); + var isCallExpression = node.parent.kind === 144 /* CallExpression */ && node.parent.func === node; + var enclosingClass = ts.getAncestor(node, 184 /* ClassDeclaration */); var baseClass; if (enclosingClass && enclosingClass.baseType) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); @@ -13076,20 +12818,20 @@ var ts; if (container) { var canUseSuperExpression = false; if (isCallExpression) { - canUseSuperExpression = container.kind === 122 /* Constructor */; + canUseSuperExpression = container.kind === 126 /* Constructor */; } else { var needToCaptureLexicalThis = false; - while (container && container.kind === 145 /* ArrowFunction */) { + while (container && container.kind === 150 /* ArrowFunction */) { container = getSuperContainer(container); needToCaptureLexicalThis = true; } - if (container && container.parent && container.parent.kind === 177 /* ClassDeclaration */) { + if (container && container.parent && container.parent.kind === 184 /* ClassDeclaration */) { if (container.flags & 128 /* Static */) { - canUseSuperExpression = container.kind === 121 /* Method */ || container.kind === 123 /* GetAccessor */ || container.kind === 124 /* SetAccessor */; + canUseSuperExpression = container.kind === 125 /* Method */ || container.kind === 127 /* GetAccessor */ || container.kind === 128 /* SetAccessor */; } else { - canUseSuperExpression = container.kind === 121 /* Method */ || container.kind === 123 /* GetAccessor */ || container.kind === 124 /* SetAccessor */ || container.kind === 120 /* Property */ || container.kind === 122 /* Constructor */; + canUseSuperExpression = container.kind === 125 /* Method */ || container.kind === 127 /* GetAccessor */ || container.kind === 128 /* SetAccessor */ || container.kind === 124 /* Property */ || container.kind === 126 /* Constructor */; } } } @@ -13103,7 +12845,7 @@ var ts; getNodeLinks(node).flags |= 16 /* SuperInstance */; returnType = baseClass; } - if (container.kind === 122 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 126 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); returnType = unknownType; } @@ -13123,7 +12865,7 @@ var ts; } function getContextuallyTypedParameterType(parameter) { var func = parameter.parent; - if (func.kind === 144 /* FunctionExpression */ || func.kind === 145 /* ArrowFunction */) { + if (func.kind === 149 /* FunctionExpression */ || func.kind === 150 /* ArrowFunction */) { if (isContextSensitiveExpression(func)) { var contextualSignature = getContextualSignature(func); if (contextualSignature) { @@ -13147,7 +12889,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 119 /* Parameter */) { + if (declaration.kind === 123 /* Parameter */) { return getContextuallyTypedParameterType(declaration); } } @@ -13156,7 +12898,7 @@ var ts; function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); if (func) { - if (func.type || func.kind === 122 /* Constructor */ || func.kind === 123 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 124 /* SetAccessor */))) { + if (func.type || func.kind === 126 /* Constructor */ || func.kind === 127 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 128 /* SetAccessor */))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); } var signature = getContextualSignature(func); @@ -13178,12 +12920,12 @@ var ts; function getContextualTypeForBinaryOperand(node) { var binaryExpression = node.parent; var operator = binaryExpression.operator; - if (operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { + if (operator >= 51 /* FirstAssignment */ && operator <= 62 /* LastAssignment */) { if (node === binaryExpression.right) { return checkExpression(binaryExpression.left); } } - else if (operator === 44 /* BarBarToken */) { + else if (operator === 48 /* BarBarToken */) { var type = getContextualType(binaryExpression); if (!type && node === binaryExpression.right) { type = checkExpression(binaryExpression.left); @@ -13262,25 +13004,25 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 174 /* VariableDeclaration */: - case 119 /* Parameter */: - case 120 /* Property */: + case 181 /* VariableDeclaration */: + case 123 /* Parameter */: + case 124 /* Property */: return getContextualTypeForInitializerExpression(node); - case 145 /* ArrowFunction */: - case 162 /* ReturnStatement */: + case 150 /* ArrowFunction */: + case 169 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 140 /* CallExpression */: - case 141 /* NewExpression */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: return getContextualTypeForArgument(node); - case 142 /* TypeAssertion */: + case 147 /* TypeAssertion */: return getTypeFromTypeNode(parent.type); - case 148 /* BinaryExpression */: + case 153 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 137 /* PropertyAssignment */: + case 141 /* PropertyAssignment */: return getContextualTypeForPropertyExpression(node); - case 135 /* ArrayLiteral */: + case 139 /* ArrayLiteral */: return getContextualTypeForElementExpression(node); - case 149 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); } return undefined; @@ -13310,7 +13052,7 @@ var ts; if (!result) { result = signature; } - else if (!compareSignatures(result, signature, true, isTypeIdenticalTo)) { + else if (!compareSignatures(result, signature, true, compareTypes)) { return undefined; } } @@ -13344,7 +13086,7 @@ var ts; var member = members[id]; if (member.flags & 4 /* Property */) { var type = checkExpression(member.declarations[0].initializer, contextualMapper); - var prop = createSymbol(4 /* Property */ | 134217728 /* Transient */ | member.flags, member.name); + var prop = createSymbol(4 /* Property */ | 268435456 /* Transient */ | member.flags, member.name); prop.declarations = member.declarations; prop.parent = member.parent; if (member.valueDeclaration) @@ -13354,11 +13096,11 @@ var ts; member = prop; } else { - var getAccessor = getDeclarationOfKind(member, 123 /* GetAccessor */); + var getAccessor = getDeclarationOfKind(member, 127 /* GetAccessor */); if (getAccessor) { checkAccessorDeclaration(getAccessor); } - var setAccessor = getDeclarationOfKind(member, 124 /* SetAccessor */); + var setAccessor = getDeclarationOfKind(member, 128 /* SetAccessor */); if (setAccessor) { checkAccessorDeclaration(setAccessor); } @@ -13388,17 +13130,17 @@ var ts; } } function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 120 /* Property */; + return s.valueDeclaration ? s.valueDeclaration.kind : 124 /* Property */; } function getDeclarationFlagsFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.flags : s.flags & 268435456 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; + return s.valueDeclaration ? s.valueDeclaration.flags : s.flags & 536870912 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; } function checkClassPropertyAccess(node, type, prop) { var flags = getDeclarationFlagsFromSymbol(prop); if (!(flags & (32 /* Private */ | 64 /* Protected */))) { return; } - var enclosingClassDeclaration = ts.getAncestor(node, 177 /* ClassDeclaration */); + var enclosingClassDeclaration = ts.getAncestor(node, 184 /* ClassDeclaration */); var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (flags & 32 /* Private */) { @@ -13407,7 +13149,7 @@ var ts; } return; } - if (node.left.kind === 85 /* SuperKeyword */) { + if (node.left.kind === 89 /* SuperKeyword */) { return; } if (!enclosingClass || !hasBaseType(enclosingClass, declaringClass)) { @@ -13439,7 +13181,7 @@ var ts; } getNodeLinks(node).resolvedSymbol = prop; if (prop.parent && prop.parent.flags & 32 /* Class */) { - if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 121 /* Method */) { + if (node.left.kind === 89 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 125 /* Method */) { error(node.right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } else { @@ -13455,7 +13197,7 @@ var ts; if (type !== unknownType && type !== anyType) { var prop = getPropertyOfType(getWidenedType(type), propertyName); if (prop && prop.parent && prop.parent.flags & 32 /* Class */) { - if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 121 /* Method */) { + if (node.left.kind === 89 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 125 /* Method */) { return false; } else { @@ -13472,15 +13214,19 @@ var ts; var indexType = checkExpression(node.index); if (objectType === unknownType) return unknownType; + if (isConstEnumObjectType(objectType) && node.index.kind !== 7 /* StringLiteral */) { + error(node.index, ts.Diagnostics.Index_expression_arguments_in_const_enums_must_be_of_type_string); + } if (node.index.kind === 7 /* StringLiteral */ || node.index.kind === 6 /* NumericLiteral */) { var name = node.index.text; var prop = getPropertyOfType(objectType, name); if (prop) { + getNodeLinks(node).resolvedSymbol = prop; return getTypeOfSymbol(prop); } } - if (indexType.flags & (1 /* Any */ | ts.TypeFlags.StringLike | ts.TypeFlags.NumberLike)) { - if (indexType.flags & (1 /* Any */ | ts.TypeFlags.NumberLike)) { + if (indexType.flags & (1 /* Any */ | 258 /* StringLike */ | 132 /* NumberLike */)) { + if (indexType.flags & (1 /* Any */ | 132 /* NumberLike */)) { var numberIndexType = getIndexTypeOfType(objectType, 1 /* Number */); if (numberIndexType) { return numberIndexType; @@ -13524,7 +13270,7 @@ var ts; return callIsIncomplete || hasEnoughArguments; } function getSingleCallSignature(type) { - if (type.flags & ts.TypeFlags.ObjectType) { + if (type.flags & 48128 /* ObjectType */) { var resolved = resolveObjectOrUnionTypeMembers(type); if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { return resolved.callSignatures[0]; @@ -13544,7 +13290,7 @@ var ts; var context = createInferenceContext(typeParameters, false); var mapper = createInferenceMapper(context); for (var i = 0; i < args.length; i++) { - if (args[i].kind === 150 /* OmittedExpression */) { + if (args[i].kind === 157 /* OmittedExpression */) { continue; } if (!excludeArgument || excludeArgument[i] === undefined) { @@ -13554,7 +13300,7 @@ var ts; } if (excludeArgument) { for (var i = 0; i < args.length; i++) { - if (args[i].kind === 150 /* OmittedExpression */) { + if (args[i].kind === 157 /* OmittedExpression */) { continue; } if (excludeArgument[i] === false) { @@ -13592,7 +13338,7 @@ var ts; if (node.arguments) { for (var i = 0; i < node.arguments.length; i++) { var arg = node.arguments[i]; - if (arg.kind === 150 /* OmittedExpression */) { + if (arg.kind === 157 /* OmittedExpression */) { continue; } var paramType = getTypeAtPosition(signature, i); @@ -13727,33 +13473,31 @@ var ts; ts.Debug.assert(!result.length); for (var i = 0; i < signatures.length; i++) { var signature = signatures[i]; - if (true) { - var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var parent = signature.declaration && signature.declaration.parent; - if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent === lastParent) { - pos++; - } - else { - lastParent = parent; - pos = cutoffPos; - } + var symbol = signature.declaration && getSymbolOfNode(signature.declaration); + var parent = signature.declaration && signature.declaration.parent; + if (!lastSymbol || symbol === lastSymbol) { + if (lastParent && parent === lastParent) { + pos++; } else { - pos = cutoffPos = result.length; lastParent = parent; + pos = cutoffPos; } - lastSymbol = symbol; - for (var j = result.length; j > pos; j--) { - result[j] = result[j - 1]; - } - result[pos] = signature; } + else { + pos = cutoffPos = result.length; + lastParent = parent; + } + lastSymbol = symbol; + for (var j = result.length; j > pos; j--) { + result[j] = result[j - 1]; + } + result[pos] = signature; } } } function resolveCallExpression(node, candidatesOutArray) { - if (node.func.kind === 85 /* SuperKeyword */) { + if (node.func.kind === 89 /* SuperKeyword */) { var superType = checkSuperExpression(node.func); if (superType !== unknownType) { return resolveCall(node, getSignaturesOfType(superType, 1 /* Construct */), candidatesOutArray); @@ -13815,18 +13559,18 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - links.resolvedSignature = node.kind === 140 /* CallExpression */ ? resolveCallExpression(node, candidatesOutArray) : resolveNewExpression(node, candidatesOutArray); + links.resolvedSignature = node.kind === 144 /* CallExpression */ ? resolveCallExpression(node, candidatesOutArray) : resolveNewExpression(node, candidatesOutArray); } return links.resolvedSignature; } function checkCallExpression(node) { var signature = getResolvedSignature(node); - if (node.func.kind === 85 /* SuperKeyword */) { + if (node.func.kind === 89 /* SuperKeyword */) { return voidType; } - if (node.kind === 141 /* NewExpression */) { + if (node.kind === 145 /* NewExpression */) { var declaration = signature.declaration; - if (declaration && (declaration.kind !== 122 /* Constructor */ && declaration.kind !== 126 /* ConstructSignature */)) { + if (declaration && (declaration.kind !== 126 /* Constructor */ && declaration.kind !== 130 /* ConstructSignature */)) { if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -13835,6 +13579,11 @@ var ts; } return getReturnTypeOfSignature(signature); } + function checkTaggedTemplateExpression(node) { + checkExpression(node.tag); + checkExpression(node.template); + return anyType; + } function checkTypeAssertion(node) { var exprType = checkExpression(node.operand); var targetType = getTypeFromTypeNode(node.type); @@ -13864,7 +13613,7 @@ var ts; } function getReturnTypeFromBody(func, contextualMapper) { var contextualSignature = getContextualSignature(func); - if (func.body.kind !== 176 /* FunctionBlock */) { + if (func.body.kind !== 183 /* FunctionBlock */) { var unwidenedType = checkAndMarkExpression(func.body, contextualMapper); var widenedType = getWidenedType(unwidenedType); if (fullTypeCheck && compilerOptions.noImplicitAny && !contextualSignature && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { @@ -13912,7 +13661,7 @@ var ts; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 168 /* ThrowStatement */); + return (body.statements.length === 1) && (body.statements[0].kind === 175 /* ThrowStatement */); } function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { if (!fullTypeCheck) { @@ -13921,7 +13670,7 @@ var ts; if (returnType === voidType || returnType === anyType) { return; } - if (!func.body || func.body.kind !== 176 /* FunctionBlock */) { + if (!func.body || func.body.kind !== 183 /* FunctionBlock */) { return; } var bodyBlock = func.body; @@ -13965,7 +13714,7 @@ var ts; if (node.type) { checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } - if (node.body.kind === 176 /* FunctionBlock */) { + if (node.body.kind === 183 /* FunctionBlock */) { checkSourceElement(node.body); } else { @@ -13977,7 +13726,7 @@ var ts; } } function checkArithmeticOperandType(operand, type, diagnostic) { - if (!(type.flags & (1 /* Any */ | ts.TypeFlags.NumberLike))) { + if (!(type.flags & (1 /* Any */ | 132 /* NumberLike */))) { error(operand, diagnostic); return false; } @@ -13990,15 +13739,15 @@ var ts; } function isReferenceOrErrorExpression(n) { switch (n.kind) { - case 59 /* Identifier */: + case 63 /* Identifier */: var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & ts.SymbolFlags.Variable) !== 0; - case 138 /* PropertyAccess */: + return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3 /* Variable */) !== 0; + case 142 /* PropertyAccess */: var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || (symbol.flags & ~8 /* EnumMember */) !== 0; - case 139 /* IndexedAccess */: + case 143 /* IndexedAccess */: return true; - case 143 /* ParenExpression */: + case 148 /* ParenExpression */: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -14006,20 +13755,20 @@ var ts; } function isConstVariableReference(n) { switch (n.kind) { - case 59 /* Identifier */: - case 138 /* PropertyAccess */: + case 63 /* Identifier */: + case 142 /* PropertyAccess */: var symbol = findSymbol(n); - return symbol && (symbol.flags & ts.SymbolFlags.Variable) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 4096 /* Const */) !== 0; - case 139 /* IndexedAccess */: + return symbol && (symbol.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 4096 /* Const */) !== 0; + case 143 /* IndexedAccess */: var index = n.index; var symbol = findSymbol(n.object); if (symbol && index.kind === 7 /* StringLiteral */) { var name = index.text; var prop = getPropertyOfType(getTypeOfSymbol(symbol), name); - return prop && (prop.flags & ts.SymbolFlags.Variable) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 4096 /* Const */) !== 0; + return prop && (prop.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 4096 /* Const */) !== 0; } return false; - case 143 /* ParenExpression */: + case 148 /* ParenExpression */: return isConstVariableReference(n.expression); default: return false; @@ -14038,19 +13787,19 @@ var ts; function checkPrefixExpression(node) { var operandType = checkExpression(node.operand); switch (node.operator) { - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: return numberType; - case 41 /* ExclamationToken */: - case 68 /* DeleteKeyword */: + case 45 /* ExclamationToken */: + case 72 /* DeleteKeyword */: return booleanType; - case 91 /* TypeOfKeyword */: + case 95 /* TypeOfKeyword */: return stringType; - case 93 /* VoidKeyword */: + case 97 /* VoidKeyword */: return undefinedType; - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); @@ -14071,7 +13820,13 @@ var ts; if (type.flags & 16384 /* Union */) { return !ts.forEach(type.types, function (t) { return !isStructuredType(t); }); } - return (type.flags & ts.TypeFlags.Structured) !== 0; + return (type.flags & 65025 /* Structured */) !== 0; + } + function isConstEnumObjectType(type) { + return type.flags & (48128 /* ObjectType */ | 32768 /* Anonymous */) && type.symbol && isConstEnumSymbol(type.symbol); + } + function isConstEnumSymbol(symbol) { + return (symbol.flags & 128 /* ConstEnum */) !== 0; } function checkInstanceOfExpression(node, leftType, rightType) { if (leftType !== unknownType && !isStructuredType(leftType)) { @@ -14096,26 +13851,26 @@ var ts; var leftType = checkExpression(node.left, contextualMapper); var rightType = checkExpression(node.right, contextualMapper); switch (operator) { - case 30 /* AsteriskToken */: - case 50 /* AsteriskEqualsToken */: - case 31 /* SlashToken */: - case 51 /* SlashEqualsToken */: - case 32 /* PercentToken */: - case 52 /* PercentEqualsToken */: - case 29 /* MinusToken */: - case 49 /* MinusEqualsToken */: - case 35 /* LessThanLessThanToken */: - case 53 /* LessThanLessThanEqualsToken */: - case 36 /* GreaterThanGreaterThanToken */: - case 54 /* GreaterThanGreaterThanEqualsToken */: - case 37 /* GreaterThanGreaterThanGreaterThanToken */: - case 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 39 /* BarToken */: - case 57 /* BarEqualsToken */: - case 40 /* CaretToken */: - case 58 /* CaretEqualsToken */: - case 38 /* AmpersandToken */: - case 56 /* AmpersandEqualsToken */: + case 34 /* AsteriskToken */: + case 54 /* AsteriskEqualsToken */: + case 35 /* SlashToken */: + case 55 /* SlashEqualsToken */: + case 36 /* PercentToken */: + case 56 /* PercentEqualsToken */: + case 33 /* MinusToken */: + case 53 /* MinusEqualsToken */: + case 39 /* LessThanLessThanToken */: + case 57 /* LessThanLessThanEqualsToken */: + case 40 /* GreaterThanGreaterThanToken */: + case 58 /* GreaterThanGreaterThanEqualsToken */: + case 41 /* GreaterThanGreaterThanGreaterThanToken */: + case 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 43 /* BarToken */: + case 61 /* BarEqualsToken */: + case 44 /* CaretToken */: + case 62 /* CaretEqualsToken */: + case 42 /* AmpersandToken */: + case 60 /* AmpersandEqualsToken */: if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) leftType = rightType; if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) @@ -14132,17 +13887,17 @@ var ts; } } return numberType; - case 28 /* PlusToken */: - case 48 /* PlusEqualsToken */: + case 32 /* PlusToken */: + case 52 /* PlusEqualsToken */: if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) leftType = rightType; if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) rightType = leftType; var resultType; - if (leftType.flags & ts.TypeFlags.NumberLike && rightType.flags & ts.TypeFlags.NumberLike) { + if (leftType.flags & 132 /* NumberLike */ && rightType.flags & 132 /* NumberLike */) { resultType = numberType; } - else if (leftType.flags & ts.TypeFlags.StringLike || rightType.flags & ts.TypeFlags.StringLike) { + else if (leftType.flags & 258 /* StringLike */ || rightType.flags & 258 /* StringLike */) { resultType = stringType; } else if (leftType.flags & 1 /* Any */ || leftType === unknownType || rightType.flags & 1 /* Any */ || rightType === unknownType) { @@ -14152,53 +13907,53 @@ var ts; reportOperatorError(); return anyType; } - if (operator === 48 /* PlusEqualsToken */) { + if (operator === 52 /* PlusEqualsToken */) { checkAssignmentOperator(resultType); } return resultType; - case 23 /* EqualsEqualsToken */: - case 24 /* ExclamationEqualsToken */: - case 25 /* EqualsEqualsEqualsToken */: - case 26 /* ExclamationEqualsEqualsToken */: - case 19 /* LessThanToken */: - case 20 /* GreaterThanToken */: - case 21 /* LessThanEqualsToken */: - case 22 /* GreaterThanEqualsToken */: + case 27 /* EqualsEqualsToken */: + case 28 /* ExclamationEqualsToken */: + case 29 /* EqualsEqualsEqualsToken */: + case 30 /* ExclamationEqualsEqualsToken */: + case 23 /* LessThanToken */: + case 24 /* GreaterThanToken */: + case 25 /* LessThanEqualsToken */: + case 26 /* GreaterThanEqualsToken */: if (!isTypeAssignableTo(leftType, rightType) && !isTypeAssignableTo(rightType, leftType)) { reportOperatorError(); } return booleanType; - case 81 /* InstanceOfKeyword */: + case 85 /* InstanceOfKeyword */: return checkInstanceOfExpression(node, leftType, rightType); - case 80 /* InKeyword */: + case 84 /* InKeyword */: return checkInExpression(node, leftType, rightType); - case 43 /* AmpersandAmpersandToken */: + case 47 /* AmpersandAmpersandToken */: return rightType; - case 44 /* BarBarToken */: + case 48 /* BarBarToken */: return getUnionType([leftType, rightType]); - case 47 /* EqualsToken */: + case 51 /* EqualsToken */: checkAssignmentOperator(rightType); return rightType; - case 18 /* CommaToken */: + case 22 /* CommaToken */: return rightType; } function getSuggestedBooleanOperator(operator) { switch (operator) { - case 39 /* BarToken */: - case 57 /* BarEqualsToken */: - return 44 /* BarBarToken */; - case 40 /* CaretToken */: - case 58 /* CaretEqualsToken */: - return 26 /* ExclamationEqualsEqualsToken */; - case 38 /* AmpersandToken */: - case 56 /* AmpersandEqualsToken */: - return 43 /* AmpersandAmpersandToken */; + case 43 /* BarToken */: + case 61 /* BarEqualsToken */: + return 48 /* BarBarToken */; + case 44 /* CaretToken */: + case 62 /* CaretEqualsToken */: + return 30 /* ExclamationEqualsEqualsToken */; + case 42 /* AmpersandToken */: + case 60 /* AmpersandEqualsToken */: + return 47 /* AmpersandAmpersandToken */; default: return undefined; } } function checkAssignmentOperator(valueType) { - if (fullTypeCheck && operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { + if (fullTypeCheck && operator >= 51 /* FirstAssignment */ && operator <= 62 /* LastAssignment */) { var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); if (ok) { checkTypeAssignableTo(valueType, leftType, node.left, undefined); @@ -14215,6 +13970,12 @@ var ts; var type2 = checkExpression(node.whenFalse, contextualMapper); return getUnionType([type1, type2]); } + function checkTemplateExpression(node) { + ts.forEach(node.templateSpans, function (templateSpan) { + checkExpression(templateSpan.expression); + }); + return stringType; + } function checkExpressionWithContextualType(node, contextualType, contextualMapper) { var saveContextualType = node.contextualType; node.contextualType = contextualType; @@ -14241,56 +14002,67 @@ 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)); + 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); + } + } return type; } function checkExpressionNode(node, contextualMapper) { switch (node.kind) { - case 59 /* Identifier */: + case 63 /* Identifier */: return checkIdentifier(node); - case 87 /* ThisKeyword */: + case 91 /* ThisKeyword */: return checkThisExpression(node); - case 85 /* SuperKeyword */: + case 89 /* SuperKeyword */: return checkSuperExpression(node); - case 83 /* NullKeyword */: + case 87 /* NullKeyword */: return nullType; - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: return booleanType; case 6 /* NumericLiteral */: return numberType; + case 155 /* TemplateExpression */: + return checkTemplateExpression(node); case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: return stringType; case 8 /* RegularExpressionLiteral */: return globalRegExpType; - case 117 /* QualifiedName */: + case 121 /* QualifiedName */: return checkPropertyAccess(node); - case 135 /* ArrayLiteral */: + case 139 /* ArrayLiteral */: return checkArrayLiteral(node, contextualMapper); - case 136 /* ObjectLiteral */: + case 140 /* ObjectLiteral */: return checkObjectLiteral(node, contextualMapper); - case 138 /* PropertyAccess */: + case 142 /* PropertyAccess */: return checkPropertyAccess(node); - case 139 /* IndexedAccess */: + case 143 /* IndexedAccess */: return checkIndexedAccess(node); - case 140 /* CallExpression */: - case 141 /* NewExpression */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: return checkCallExpression(node); - case 142 /* TypeAssertion */: + case 146 /* TaggedTemplateExpression */: + return checkTaggedTemplateExpression(node); + case 147 /* TypeAssertion */: return checkTypeAssertion(node); - case 143 /* ParenExpression */: + case 148 /* ParenExpression */: return checkExpression(node.expression); - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: return checkFunctionExpression(node, contextualMapper); - case 146 /* PrefixOperator */: + case 151 /* PrefixOperator */: return checkPrefixExpression(node); - case 147 /* PostfixOperator */: + case 152 /* PostfixOperator */: return checkPostfixExpression(node); - case 148 /* BinaryExpression */: + case 153 /* BinaryExpression */: return checkBinaryExpression(node, contextualMapper); - case 149 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return checkConditionalExpression(node, contextualMapper); - case 150 /* OmittedExpression */: + case 157 /* OmittedExpression */: return undefinedType; } return unknownType; @@ -14306,7 +14078,7 @@ var ts; checkVariableDeclaration(parameterDeclaration); if (fullTypeCheck) { checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name); - if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */) && !(parameterDeclaration.parent.kind === 122 /* Constructor */ && parameterDeclaration.parent.body)) { + if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */) && !(parameterDeclaration.parent.kind === 126 /* Constructor */ && parameterDeclaration.parent.body)) { error(parameterDeclaration, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } if (parameterDeclaration.flags & 8 /* Rest */) { @@ -14321,10 +14093,10 @@ var ts; } } function checkReferencesInInitializer(n) { - if (n.kind === 59 /* Identifier */) { + if (n.kind === 63 /* Identifier */) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; - if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, ts.SymbolFlags.Value) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 119 /* Parameter */) { + 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)); return; @@ -14358,10 +14130,10 @@ var ts; checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 126 /* ConstructSignature */: + case 130 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 125 /* CallSignature */: + case 129 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -14370,7 +14142,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 178 /* InterfaceDeclaration */) { + if (node.kind === 185 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -14384,7 +14156,7 @@ var ts; var declaration = indexSymbol.declarations[i]; if (declaration.parameters.length == 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 114 /* StringKeyword */: + case 118 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -14392,7 +14164,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 112 /* NumberKeyword */: + case 116 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -14426,39 +14198,37 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 140 /* CallExpression */ && n.func.kind === 85 /* SuperKeyword */; + return n.kind === 144 /* CallExpression */ && n.func.kind === 89 /* SuperKeyword */; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 144 /* FunctionExpression */: - case 175 /* FunctionDeclaration */: - case 145 /* ArrowFunction */: - case 136 /* ObjectLiteral */: - return false; - default: - return ts.forEachChild(n, containsSuperCall); + case 149 /* FunctionExpression */: + case 182 /* FunctionDeclaration */: + case 150 /* ArrowFunction */: + case 140 /* ObjectLiteral */: return false; + default: return ts.forEachChild(n, containsSuperCall); } } function markThisReferencesAsErrors(n) { - if (n.kind === 87 /* ThisKeyword */) { + if (n.kind === 91 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 144 /* FunctionExpression */ && n.kind !== 175 /* FunctionDeclaration */) { + else if (n.kind !== 149 /* FunctionExpression */ && n.kind !== 182 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 120 /* Property */ && !(n.flags & 128 /* Static */) && !!n.initializer; + return n.kind === 124 /* Property */ && !(n.flags & 128 /* Static */) && !!n.initializer; } if (node.parent.baseType) { if (containsSuperCall(node.body)) { 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 !== 154 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 161 /* 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 { @@ -14473,15 +14243,15 @@ var ts; } function checkAccessorDeclaration(node) { if (fullTypeCheck) { - if (node.kind === 123 /* GetAccessor */) { + if (node.kind === 127 /* GetAccessor */) { if (!ts.isInAmbientContext(node) && node.body && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); } } - var otherKind = node.kind === 123 /* GetAccessor */ ? 124 /* SetAccessor */ : 123 /* GetAccessor */; + var otherKind = node.kind === 127 /* GetAccessor */ ? 128 /* SetAccessor */ : 127 /* GetAccessor */; var otherAccessor = getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { - if (((node.flags & ts.NodeFlags.AccessibilityModifier) !== (otherAccessor.flags & ts.NodeFlags.AccessibilityModifier))) { + if (((node.flags & 112 /* AccessibilityModifier */) !== (otherAccessor.flags & 112 /* AccessibilityModifier */))) { error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); } var thisType = getAnnotatedAccessorType(node); @@ -14547,9 +14317,9 @@ var ts; } var symbol = getSymbolOfNode(signatureDeclarationNode); var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 178 /* InterfaceDeclaration */) { - ts.Debug.assert(signatureDeclarationNode.kind === 125 /* CallSignature */ || signatureDeclarationNode.kind === 126 /* ConstructSignature */); - var signatureKind = signatureDeclarationNode.kind === 125 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 185 /* 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); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -14567,7 +14337,7 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = n.flags; - if (n.parent.kind !== 178 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { + if (n.parent.kind !== 185 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { if (!(flags & 2 /* Ambient */)) { flags |= 1 /* Export */; } @@ -14609,9 +14379,9 @@ var ts; var lastSeenNonAmbientDeclaration; var previousDeclaration; var declarations = symbol.declarations; - var isConstructor = (symbol.flags & 8192 /* Constructor */) !== 0; + var isConstructor = (symbol.flags & 16384 /* Constructor */) !== 0; function reportImplementationExpectedError(node) { - if (node.name && node.name.kind === 116 /* Missing */) { + if (node.name && node.name.kind === 120 /* Missing */) { return; } var seen = false; @@ -14627,7 +14397,7 @@ var ts; if (subsequentNode.kind === node.kind) { var errorNode = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - ts.Debug.assert(node.kind === 121 /* Method */); + ts.Debug.assert(node.kind === 125 /* Method */); ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */)); var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; error(errorNode, diagnostic); @@ -14647,17 +14417,17 @@ var ts; error(errorNode, ts.Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration); } } - var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & ts.SymbolFlags.Module; + var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536 /* Module */; var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; for (var i = 0; i < declarations.length; i++) { var node = declarations[i]; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 178 /* InterfaceDeclaration */ || node.parent.kind === 130 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 185 /* InterfaceDeclaration */ || node.parent.kind === 134 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 175 /* FunctionDeclaration */ || node.kind === 121 /* Method */ || node.kind === 122 /* Constructor */) { + if (node.kind === 182 /* FunctionDeclaration */ || node.kind === 125 /* Method */ || node.kind === 126 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -14723,7 +14493,7 @@ var ts; var symbol = node.localSymbol; if (!symbol) { symbol = getSymbolOfNode(node); - if (!(symbol.flags & ts.SymbolFlags.Export)) { + if (!(symbol.flags & 29360128 /* Export */)) { return; } } @@ -14751,14 +14521,14 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 178 /* InterfaceDeclaration */: - return 4194304 /* ExportType */; - case 181 /* ModuleDeclaration */: - return d.name.kind === 7 /* StringLiteral */ || ts.isInstantiated(d) ? 8388608 /* ExportNamespace */ | 2097152 /* ExportValue */ : 8388608 /* ExportNamespace */; - case 177 /* ClassDeclaration */: - case 180 /* EnumDeclaration */: - return 4194304 /* ExportType */ | 2097152 /* ExportValue */; - case 183 /* ImportDeclaration */: + case 185 /* InterfaceDeclaration */: + return 8388608 /* ExportType */; + case 188 /* ModuleDeclaration */: + return d.name.kind === 7 /* StringLiteral */ || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 16777216 /* ExportNamespace */ | 4194304 /* ExportValue */ : 16777216 /* ExportNamespace */; + case 184 /* ClassDeclaration */: + case 187 /* EnumDeclaration */: + return 8388608 /* ExportType */ | 4194304 /* ExportValue */; + case 190 /* ImportDeclaration */: var result = 0; var target = resolveImport(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { @@ -14766,7 +14536,7 @@ var ts; }); return result; default: - return 2097152 /* ExportValue */; + return 4194304 /* ExportValue */; } } } @@ -14816,7 +14586,7 @@ var ts; if (!(name && name.text === "_i")) { return; } - if (node.kind === 119 /* Parameter */) { + if (node.kind === 123 /* Parameter */) { if (node.parent.body && ts.hasRestParameters(node.parent) && !ts.isInAmbientContext(node)) { error(node, ts.Diagnostics.Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter); } @@ -14833,11 +14603,11 @@ var ts; return; } switch (current.kind) { - case 175 /* FunctionDeclaration */: - case 144 /* FunctionExpression */: - case 121 /* Method */: - case 145 /* ArrowFunction */: - case 122 /* Constructor */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 125 /* Method */: + case 150 /* 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); return; @@ -14851,13 +14621,13 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 120 /* Property */ || node.kind === 121 /* Method */ || node.kind === 123 /* GetAccessor */ || node.kind === 124 /* SetAccessor */) { + if (node.kind === 124 /* Property */ || node.kind === 125 /* Method */ || node.kind === 127 /* GetAccessor */ || node.kind === 128 /* SetAccessor */) { return false; } if (ts.isInAmbientContext(node)) { return false; } - if (node.kind === 119 /* Parameter */ && !node.parent.body) { + if (node.kind === 123 /* Parameter */ && !node.parent.body) { return false; } return true; @@ -14872,7 +14642,7 @@ var ts; var current = node; while (current) { if (getNodeCheckFlags(current) & 4 /* CaptureThis */) { - var isDeclaration = node.kind !== 59 /* Identifier */; + var isDeclaration = node.kind !== 63 /* Identifier */; if (isDeclaration) { error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); } @@ -14888,12 +14658,12 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } - var enclosingClass = ts.getAncestor(node, 177 /* ClassDeclaration */); + var enclosingClass = ts.getAncestor(node, 184 /* ClassDeclaration */); if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; } if (enclosingClass.baseType) { - var isDeclaration = node.kind !== 59 /* Identifier */; + var isDeclaration = node.kind !== 63 /* Identifier */; if (isDeclaration) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } @@ -14906,19 +14676,19 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 181 /* ModuleDeclaration */ && !ts.isInstantiated(node)) { + if (node.kind === 188 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return; } - var parent = node.kind === 174 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (parent.kind === 186 /* SourceFile */ && ts.isExternalModule(parent)) { + 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); } } function checkCollisionWithConstDeclarations(node) { - if (node.initializer && (node.flags & ts.NodeFlags.BlockScoped) === 0) { + if (node.initializer && (node.flags & 6144 /* BlockScoped */) === 0) { var symbol = getSymbolOfNode(node); if (symbol.flags & 1 /* FunctionScopedVariable */) { - var localDeclarationSymbol = resolveName(node, node.name.text, ts.SymbolFlags.Variable, undefined, undefined); + var localDeclarationSymbol = resolveName(node, node.name.text, 3 /* Variable */, undefined, undefined); if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 4096 /* Const */) { error(node, ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0, symbolToString(localDeclarationSymbol)); @@ -15015,18 +14785,18 @@ var ts; if (node.expression && !(getNodeLinks(node.expression).flags & 1 /* TypeChecked */)) { var func = ts.getContainingFunction(node); if (func) { - if (func.kind === 124 /* SetAccessor */) { + if (func.kind === 128 /* SetAccessor */) { if (node.expression) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } } else { var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); - var checkAssignability = func.type || (func.kind === 123 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 124 /* SetAccessor */))); + var checkAssignability = func.type || (func.kind === 127 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 128 /* SetAccessor */))); if (checkAssignability) { checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, undefined); } - else if (func.kind == 122 /* Constructor */) { + else if (func.kind == 126 /* Constructor */) { if (!isTypeAssignableTo(checkExpression(node.expression), returnType)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -15155,7 +14925,7 @@ var ts; checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); var staticBaseType = getTypeOfSymbol(baseType.symbol); checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, ts.SymbolFlags.Value)) { + if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, 107455 /* Value */)) { error(node.baseType, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); } checkKindsOfPropertyMemberOverrides(type, baseType); @@ -15186,13 +14956,13 @@ var ts; } } function getTargetSymbol(s) { - return s.flags & 33554432 /* Instantiated */ ? getSymbolLinks(s).target : s; + return s.flags & 67108864 /* Instantiated */ ? getSymbolLinks(s).target : s; } function checkKindsOfPropertyMemberOverrides(type, baseType) { var baseProperties = getPropertiesOfObjectType(baseType); for (var i = 0, len = baseProperties.length; i < len; ++i) { var base = getTargetSymbol(baseProperties[i]); - if (base.flags & 268435456 /* Prototype */) { + if (base.flags & 536870912 /* Prototype */) { continue; } var derived = getTargetSymbol(getPropertyOfObjectType(type, base.name)); @@ -15205,26 +14975,26 @@ var ts; if ((baseDeclarationFlags & 128 /* Static */) !== (derivedDeclarationFlags & 128 /* Static */)) { continue; } - if ((base.flags & derived.flags & 4096 /* Method */) || ((base.flags & ts.SymbolFlags.PropertyOrAccessor) && (derived.flags & ts.SymbolFlags.PropertyOrAccessor))) { + if ((base.flags & derived.flags & 8192 /* Method */) || ((base.flags & 98308 /* PropertyOrAccessor */) && (derived.flags & 98308 /* PropertyOrAccessor */))) { continue; } var errorMessage; - if (base.flags & 4096 /* Method */) { - if (derived.flags & ts.SymbolFlags.Accessor) { + if (base.flags & 8192 /* Method */) { + if (derived.flags & 98304 /* Accessor */) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; } else { - ts.Debug.assert(derived.flags & 4 /* Property */); + ts.Debug.assert((derived.flags & 4 /* Property */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; } } else if (base.flags & 4 /* Property */) { - ts.Debug.assert(derived.flags & 4096 /* Method */); + ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; } else { - ts.Debug.assert(base.flags & ts.SymbolFlags.Accessor); - ts.Debug.assert(derived.flags & 4096 /* Method */); + ts.Debug.assert((base.flags & 98304 /* Accessor */) !== 0); + ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; } error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); @@ -15232,7 +15002,7 @@ var ts; } } function isAccessor(kind) { - return kind === 123 /* GetAccessor */ || kind === 124 /* SetAccessor */; + return kind === 127 /* GetAccessor */ || kind === 128 /* SetAccessor */; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -15259,13 +15029,46 @@ var ts; } return true; } + function checkInheritedPropertiesAreIdentical(type, typeNode) { + if (!type.baseTypes.length || type.baseTypes.length === 1) { + return true; + } + var seen = {}; + ts.forEach(type.declaredProperties, function (p) { + seen[p.name] = { prop: p, containingType: type }; + }); + var ok = true; + for (var i = 0, len = type.baseTypes.length; i < len; ++i) { + var base = type.baseTypes[i]; + var properties = getPropertiesOfObjectType(base); + for (var j = 0, proplen = properties.length; j < proplen; ++j) { + var prop = properties[j]; + if (!ts.hasProperty(seen, prop.name)) { + seen[prop.name] = { prop: prop, containingType: base }; + } + else { + var existing = seen[prop.name]; + var isInheritedProperty = existing.containingType !== type; + if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { + ok = false; + var typeName1 = typeToString(existing.containingType); + var typeName2 = typeToString(base); + var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); + errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); + addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine())); + } + } + } + } + return ok; + } function checkInterfaceDeclaration(node) { checkTypeParameters(node.typeParameters); if (fullTypeCheck) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = getDeclarationOfKind(symbol, 178 /* InterfaceDeclaration */); + var firstInterfaceDecl = getDeclarationOfKind(symbol, 185 /* 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); @@ -15288,23 +15091,9 @@ var ts; } } function checkTypeAliasDeclaration(node) { + checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0); checkSourceElement(node.type); } - function getConstantValueForExpression(node) { - var isNegative = false; - if (node.kind === 146 /* PrefixOperator */) { - var unaryExpression = node; - if (unaryExpression.operator === 29 /* MinusToken */ || unaryExpression.operator === 28 /* PlusToken */) { - node = unaryExpression.operand; - isNegative = unaryExpression.operator === 29 /* MinusToken */; - } - } - if (node.kind === 6 /* NumericLiteral */) { - var literalText = node.text; - return isNegative ? -literalText : +literalText; - } - return undefined; - } function computeEnumMemberValues(node) { var nodeLinks = getNodeLinks(node); if (!(nodeLinks.flags & 128 /* EnumValuesComputed */)) { @@ -15312,18 +15101,32 @@ var ts; var enumType = getDeclaredTypeOfSymbol(enumSymbol); var autoValue = 0; var ambient = ts.isInAmbientContext(node); + var enumIsConst = ts.isConstEnumDeclaration(node); ts.forEach(node.members, function (member) { if (isNumericName(member.name.text)) { error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); } var initializer = member.initializer; if (initializer) { - autoValue = getConstantValueForExpression(initializer); - if (autoValue === undefined && !ambient) { - checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined); + autoValue = getConstantValueForEnumMemberInitializer(initializer, enumIsConst); + if (autoValue === undefined) { + if (enumIsConst) { + error(initializer, ts.Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression); + } + else if (!ambient) { + checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined); + } + } + else if (enumIsConst) { + if (isNaN(autoValue)) { + error(initializer, ts.Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN); + } + else if (!isFinite(autoValue)) { + error(initializer, ts.Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value); + } } } - else if (ambient) { + else if (ambient && !enumIsConst) { autoValue = undefined; } if (autoValue !== undefined) { @@ -15332,6 +15135,99 @@ var ts; }); nodeLinks.flags |= 128 /* EnumValuesComputed */; } + function getConstantValueForEnumMemberInitializer(initializer, enumIsConst) { + return evalConstant(initializer); + function evalConstant(e) { + switch (e.kind) { + case 151 /* PrefixOperator */: + var value = evalConstant(e.operand); + if (value === undefined) { + return undefined; + } + switch (e.operator) { + case 32 /* PlusToken */: return value; + case 33 /* MinusToken */: return -value; + case 46 /* TildeToken */: return enumIsConst ? ~value : undefined; + } + return undefined; + case 153 /* BinaryExpression */: + if (!enumIsConst) { + return undefined; + } + var left = evalConstant(e.left); + if (left === undefined) { + return undefined; + } + var right = evalConstant(e.right); + if (right === undefined) { + return undefined; + } + switch (e.operator) { + case 43 /* BarToken */: return left | right; + case 42 /* AmpersandToken */: return left & right; + case 40 /* GreaterThanGreaterThanToken */: return left >> right; + case 41 /* GreaterThanGreaterThanGreaterThanToken */: return left >>> right; + case 39 /* LessThanLessThanToken */: return left << right; + case 44 /* CaretToken */: return left ^ right; + case 34 /* AsteriskToken */: return left * right; + case 35 /* SlashToken */: return left / right; + case 32 /* PlusToken */: return left + right; + case 33 /* MinusToken */: return left - right; + case 36 /* PercentToken */: return left % right; + } + return undefined; + case 6 /* NumericLiteral */: + return +e.text; + case 148 /* ParenExpression */: + return enumIsConst ? evalConstant(e.expression) : undefined; + case 63 /* Identifier */: + case 143 /* IndexedAccess */: + case 142 /* PropertyAccess */: + if (!enumIsConst) { + return undefined; + } + var member = initializer.parent; + var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); + var enumType; + var propertyName; + if (e.kind === 63 /* Identifier */) { + enumType = currentType; + propertyName = e.text; + } + else { + if (e.kind === 143 /* IndexedAccess */) { + if (e.index.kind !== 7 /* StringLiteral */) { + return undefined; + } + var enumType = getTypeOfNode(e.object); + propertyName = e.index.text; + } + else { + var enumType = getTypeOfNode(e.left); + propertyName = e.right.text; + } + if (enumType !== currentType) { + return undefined; + } + } + if (propertyName === undefined) { + return undefined; + } + var property = getPropertyOfObjectType(enumType, propertyName); + if (!property || !(property.flags & 8 /* EnumMember */)) { + return undefined; + } + var propertyDecl = property.valueDeclaration; + if (member === propertyDecl) { + return undefined; + } + if (!isDefinedBefore(propertyDecl, member)) { + return undefined; + } + return getNodeLinks(propertyDecl).enumMemberValue; + } + } + } } function checkEnumDeclaration(node) { if (!fullTypeCheck) { @@ -15345,9 +15241,17 @@ var ts; var enumSymbol = getSymbolOfNode(node); var firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind); if (node === firstDeclaration) { + if (enumSymbol.declarations.length > 1) { + var enumIsConst = ts.isConstEnumDeclaration(node); + ts.forEach(enumSymbol.declarations, function (decl) { + if (ts.isConstEnumDeclaration(decl) !== enumIsConst) { + error(decl.name, ts.Diagnostics.Enum_declarations_must_all_be_const_or_non_const); + } + }); + } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 180 /* EnumDeclaration */) { + if (declaration.kind !== 187 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -15370,7 +15274,7 @@ var ts; var declarations = symbol.declarations; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; - if ((declaration.kind === 177 /* ClassDeclaration */ || (declaration.kind === 175 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { + if ((declaration.kind === 184 /* ClassDeclaration */ || (declaration.kind === 182 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { return declaration; } } @@ -15382,7 +15286,7 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - if (symbol.flags & 256 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { + if (symbol.flags & 512 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (classOrFunc) { if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { @@ -15405,7 +15309,7 @@ var ts; checkSourceElement(node.body); } function getFirstIdentifier(node) { - while (node.kind === 117 /* QualifiedName */) { + while (node.kind === 121 /* QualifiedName */) { node = node.left; } return node; @@ -15418,25 +15322,25 @@ var ts; if (node.entityName) { target = resolveImport(symbol); if (target !== unknownSymbol) { - if (target.flags & ts.SymbolFlags.Value) { + if (target.flags & 107455 /* Value */) { var moduleName = getFirstIdentifier(node.entityName); - if (resolveEntityName(node, moduleName, ts.SymbolFlags.Value | ts.SymbolFlags.Namespace).flags & ts.SymbolFlags.Namespace) { + if (resolveEntityName(node, moduleName, 107455 /* Value */ | 1536 /* Namespace */).flags & 1536 /* Namespace */) { checkExpression(node.entityName); } else { error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.identifierToString(moduleName)); } } - if (target.flags & ts.SymbolFlags.Type) { + if (target.flags & 3152352 /* Type */) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0); } } } else { - if (node.parent.kind === 186 /* SourceFile */) { + if (node.parent.kind === 193 /* SourceFile */) { target = resolveImport(symbol); } - else if (node.parent.kind === 182 /* ModuleBlock */ && node.parent.parent.name.kind === 7 /* StringLiteral */) { + else if (node.parent.kind === 189 /* 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; @@ -15450,7 +15354,7 @@ var ts; } } if (target !== unknownSymbol) { - var excludedMeanings = (symbol.flags & ts.SymbolFlags.Value ? ts.SymbolFlags.Value : 0) | (symbol.flags & ts.SymbolFlags.Type ? ts.SymbolFlags.Type : 0) | (symbol.flags & ts.SymbolFlags.Namespace ? ts.SymbolFlags.Namespace : 0); + var excludedMeanings = (symbol.flags & 107455 /* Value */ ? 107455 /* Value */ : 0) | (symbol.flags & 3152352 /* Type */ ? 3152352 /* Type */ : 0) | (symbol.flags & 1536 /* Namespace */ ? 1536 /* Namespace */ : 0); if (target.flags & excludedMeanings) { error(node, ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0, symbolToString(symbol)); } @@ -15458,7 +15362,7 @@ var ts; } function checkExportAssignment(node) { var container = node.parent; - if (container.kind !== 186 /* SourceFile */) { + if (container.kind !== 193 /* SourceFile */) { container = container.parent; } checkTypeOfExportAssignmentSymbol(getSymbolOfNode(container)); @@ -15467,150 +15371,151 @@ var ts; if (!node) return; switch (node.kind) { - case 118 /* TypeParameter */: + case 122 /* TypeParameter */: return checkTypeParameter(node); - case 119 /* Parameter */: + case 123 /* Parameter */: return checkParameter(node); - case 120 /* Property */: + case 124 /* Property */: return checkPropertyDeclaration(node); - case 125 /* CallSignature */: - case 126 /* ConstructSignature */: - case 127 /* IndexSignature */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: return checkSignatureDeclaration(node); - case 121 /* Method */: + case 125 /* Method */: return checkMethodDeclaration(node); - case 122 /* Constructor */: + case 126 /* Constructor */: return checkConstructorDeclaration(node); - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return checkAccessorDeclaration(node); - case 128 /* TypeReference */: + case 132 /* TypeReference */: return checkTypeReference(node); - case 129 /* TypeQuery */: + case 133 /* TypeQuery */: return checkTypeQuery(node); - case 130 /* TypeLiteral */: + case 134 /* TypeLiteral */: return checkTypeLiteral(node); - case 131 /* ArrayType */: + case 135 /* ArrayType */: return checkArrayType(node); - case 132 /* TupleType */: + case 136 /* TupleType */: return checkTupleType(node); - case 133 /* UnionType */: + case 137 /* UnionType */: return checkUnionType(node); - case 134 /* ParenType */: + case 138 /* ParenType */: return checkSourceElement(node.type); - case 175 /* FunctionDeclaration */: + case 182 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 151 /* Block */: + case 158 /* Block */: return checkBlock(node); - case 176 /* FunctionBlock */: - case 182 /* ModuleBlock */: + case 183 /* FunctionBlock */: + case 189 /* ModuleBlock */: return checkBody(node); - case 152 /* VariableStatement */: + case 159 /* VariableStatement */: return checkVariableStatement(node); - case 154 /* ExpressionStatement */: + case 161 /* ExpressionStatement */: return checkExpressionStatement(node); - case 155 /* IfStatement */: + case 162 /* IfStatement */: return checkIfStatement(node); - case 156 /* DoStatement */: + case 163 /* DoStatement */: return checkDoStatement(node); - case 157 /* WhileStatement */: + case 164 /* WhileStatement */: return checkWhileStatement(node); - case 158 /* ForStatement */: + case 165 /* ForStatement */: return checkForStatement(node); - case 159 /* ForInStatement */: + case 166 /* ForInStatement */: return checkForInStatement(node); - case 160 /* ContinueStatement */: - case 161 /* BreakStatement */: + case 167 /* ContinueStatement */: + case 168 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 162 /* ReturnStatement */: + case 169 /* ReturnStatement */: return checkReturnStatement(node); - case 163 /* WithStatement */: + case 170 /* WithStatement */: return checkWithStatement(node); - case 164 /* SwitchStatement */: + case 171 /* SwitchStatement */: return checkSwitchStatement(node); - case 167 /* LabeledStatement */: + case 174 /* LabeledStatement */: return checkLabeledStatement(node); - case 168 /* ThrowStatement */: + case 175 /* ThrowStatement */: return checkThrowStatement(node); - case 169 /* TryStatement */: + case 176 /* TryStatement */: return checkTryStatement(node); - case 174 /* VariableDeclaration */: + case 181 /* VariableDeclaration */: return ts.Debug.fail("Checker encountered variable declaration"); - case 177 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return checkClassDeclaration(node); - case 178 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 179 /* TypeAliasDeclaration */: + case 186 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 180 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 183 /* ImportDeclaration */: + case 190 /* ImportDeclaration */: return checkImportDeclaration(node); - case 184 /* ExportAssignment */: + case 191 /* ExportAssignment */: return checkExportAssignment(node); } } function checkFunctionExpressionBodies(node) { switch (node.kind) { - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: ts.forEach(node.parameters, checkFunctionExpressionBodies); checkFunctionExpressionBody(node); break; - case 121 /* Method */: - case 122 /* Constructor */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 175 /* FunctionDeclaration */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 182 /* FunctionDeclaration */: ts.forEach(node.parameters, checkFunctionExpressionBodies); break; - case 163 /* WithStatement */: + case 170 /* WithStatement */: checkFunctionExpressionBodies(node.expression); break; - case 119 /* Parameter */: - case 120 /* Property */: - case 135 /* ArrayLiteral */: - case 136 /* ObjectLiteral */: - case 137 /* PropertyAssignment */: - case 138 /* PropertyAccess */: - case 139 /* IndexedAccess */: - case 140 /* CallExpression */: - case 141 /* NewExpression */: - case 142 /* TypeAssertion */: - case 143 /* ParenExpression */: - case 146 /* PrefixOperator */: - case 147 /* PostfixOperator */: - case 148 /* BinaryExpression */: - case 149 /* ConditionalExpression */: - case 151 /* Block */: - case 176 /* FunctionBlock */: - case 182 /* ModuleBlock */: - case 152 /* VariableStatement */: - case 154 /* ExpressionStatement */: - case 155 /* IfStatement */: - case 156 /* DoStatement */: - case 157 /* WhileStatement */: - case 158 /* ForStatement */: - case 159 /* ForInStatement */: - case 160 /* ContinueStatement */: - case 161 /* BreakStatement */: - case 162 /* ReturnStatement */: - case 164 /* SwitchStatement */: - case 165 /* CaseClause */: - case 166 /* DefaultClause */: - case 167 /* LabeledStatement */: - case 168 /* ThrowStatement */: - case 169 /* TryStatement */: - case 170 /* TryBlock */: - case 171 /* CatchBlock */: - case 172 /* FinallyBlock */: - case 174 /* VariableDeclaration */: - case 177 /* ClassDeclaration */: - case 180 /* EnumDeclaration */: - case 185 /* EnumMember */: - case 186 /* SourceFile */: + 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 */: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -15627,7 +15532,7 @@ var ts; checkBody(node); if (ts.isExternalModule(node)) { var symbol = getExportAssignmentSymbol(node.symbol); - if (symbol && symbol.flags & 16777216 /* Import */) { + if (symbol && symbol.flags & 33554432 /* Import */) { getSymbolLinks(symbol).referenced = true; } } @@ -15681,7 +15586,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 163 /* WithStatement */ && node.parent.statement === node) { + if (node.parent.kind === 170 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; @@ -15717,27 +15622,27 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 186 /* SourceFile */: + case 193 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 181 /* ModuleDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & ts.SymbolFlags.ModuleMember); + case 188 /* ModuleDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 35653619 /* ModuleMember */); break; - case 180 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: if (!(memberFlags & 128 /* Static */)) { - copySymbols(getSymbolOfNode(location).members, meaning & ts.SymbolFlags.Type); + copySymbols(getSymbolOfNode(location).members, meaning & 3152352 /* Type */); } break; - case 144 /* FunctionExpression */: + case 149 /* FunctionExpression */: if (location.name) { copySymbol(location.symbol, meaning); } break; - case 171 /* CatchBlock */: + case 178 /* CatchBlock */: if (location.variable.text) { copySymbol(location.symbol, meaning); } @@ -15750,100 +15655,102 @@ var ts; return ts.mapToArray(symbols); } function isTypeDeclarationName(name) { - return name.kind == 59 /* Identifier */ && isTypeDeclaration(name.parent) && name.parent.name === name; + return name.kind == 63 /* Identifier */ && isTypeDeclaration(name.parent) && name.parent.name === name; } function isTypeDeclaration(node) { switch (node.kind) { - case 118 /* TypeParameter */: - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - case 179 /* TypeAliasDeclaration */: - case 180 /* EnumDeclaration */: + case 122 /* TypeParameter */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 186 /* TypeAliasDeclaration */: + case 187 /* EnumDeclaration */: return true; } } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 117 /* QualifiedName */) + while (node.parent && node.parent.kind === 121 /* QualifiedName */) node = node.parent; - return node.parent && node.parent.kind === 128 /* TypeReference */; + return node.parent && node.parent.kind === 132 /* TypeReference */; } function isTypeNode(node) { - if (ts.SyntaxKind.FirstTypeNode <= node.kind && node.kind <= ts.SyntaxKind.LastTypeNode) { + if (132 /* FirstTypeNode */ <= node.kind && node.kind <= 138 /* LastTypeNode */) { return true; } switch (node.kind) { - case 105 /* AnyKeyword */: - case 112 /* NumberKeyword */: - case 114 /* StringKeyword */: - case 106 /* BooleanKeyword */: + case 109 /* AnyKeyword */: + case 116 /* NumberKeyword */: + case 118 /* StringKeyword */: + case 110 /* BooleanKeyword */: return true; - case 93 /* VoidKeyword */: - return node.parent.kind !== 146 /* PrefixOperator */; + case 97 /* VoidKeyword */: + return node.parent.kind !== 151 /* PrefixOperator */; case 7 /* StringLiteral */: - return node.parent.kind === 119 /* Parameter */; - case 59 /* Identifier */: - if (node.parent.kind === 117 /* QualifiedName */) { + return node.parent.kind === 123 /* Parameter */; + case 63 /* Identifier */: + if (node.parent.kind === 121 /* QualifiedName */) { node = node.parent; } - case 117 /* QualifiedName */: - ts.Debug.assert(node.kind === 59 /* Identifier */ || node.kind === 117 /* QualifiedName */, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); + 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 === 129 /* TypeQuery */) { + if (parent.kind === 133 /* TypeQuery */) { return false; } - if (ts.SyntaxKind.FirstTypeNode <= parent.kind && parent.kind <= ts.SyntaxKind.LastTypeNode) { + if (132 /* FirstTypeNode */ <= parent.kind && parent.kind <= 138 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 118 /* TypeParameter */: + case 122 /* TypeParameter */: return node === parent.constraint; - case 120 /* Property */: - case 119 /* Parameter */: - case 174 /* VariableDeclaration */: + case 124 /* Property */: + case 123 /* Parameter */: + case 181 /* VariableDeclaration */: return node === parent.type; - case 175 /* FunctionDeclaration */: - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: - case 122 /* Constructor */: - case 121 /* Method */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: + case 126 /* Constructor */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return node === parent.type; - case 125 /* CallSignature */: - case 126 /* ConstructSignature */: - case 127 /* IndexSignature */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: return node === parent.type; - case 142 /* TypeAssertion */: + case 147 /* TypeAssertion */: return node === parent.type; - case 140 /* CallExpression */: - case 141 /* NewExpression */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: return parent.typeArguments && parent.typeArguments.indexOf(node) >= 0; + case 146 /* TaggedTemplateExpression */: + return false; } } return false; } function isInRightSideOfImportOrExportAssignment(node) { - while (node.parent.kind === 117 /* QualifiedName */) { + while (node.parent.kind === 121 /* QualifiedName */) { node = node.parent; } - if (node.parent.kind === 183 /* ImportDeclaration */) { + if (node.parent.kind === 190 /* ImportDeclaration */) { return node.parent.entityName === node; } - if (node.parent.kind === 184 /* ExportAssignment */) { + if (node.parent.kind === 191 /* ExportAssignment */) { return node.parent.exportName === node; } return false; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 117 /* QualifiedName */ || node.parent.kind === 138 /* PropertyAccess */) && node.parent.right === node; + return (node.parent.kind === 121 /* QualifiedName */ || node.parent.kind === 142 /* PropertyAccess */) && node.parent.right === node; } function getSymbolOfEntityName(entityName) { if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 184 /* ExportAssignment */) { - return resolveEntityName(entityName.parent.parent, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace | 16777216 /* Import */); + if (entityName.parent.kind === 191 /* ExportAssignment */) { + return resolveEntityName(entityName.parent.parent, entityName, 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */ | 33554432 /* Import */); } if (isInRightSideOfImportOrExportAssignment(entityName)) { return getSymbolOfPartOfRightHandSideOfImport(entityName); @@ -15852,11 +15759,11 @@ var ts; entityName = entityName.parent; } if (ts.isExpression(entityName)) { - if (entityName.kind === 59 /* Identifier */) { - var meaning = ts.SymbolFlags.Value | 16777216 /* Import */; + if (entityName.kind === 63 /* Identifier */) { + var meaning = 107455 /* Value */ | 33554432 /* Import */; return resolveEntityName(entityName, entityName, meaning); } - else if (entityName.kind === 117 /* QualifiedName */ || entityName.kind === 138 /* PropertyAccess */) { + else if (entityName.kind === 121 /* QualifiedName */ || entityName.kind === 142 /* PropertyAccess */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccess(entityName); @@ -15868,8 +15775,8 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 128 /* TypeReference */ ? ts.SymbolFlags.Type : ts.SymbolFlags.Namespace; - meaning |= 16777216 /* Import */; + var meaning = entityName.parent.kind === 132 /* TypeReference */ ? 3152352 /* Type */ : 1536 /* Namespace */; + meaning |= 33554432 /* Import */; return resolveEntityName(entityName, entityName, meaning); } return undefined; @@ -15881,32 +15788,32 @@ var ts; if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { return getSymbolOfNode(node.parent); } - if (node.kind === 59 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 184 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); + if (node.kind === 63 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { + return node.parent.kind === 191 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); } switch (node.kind) { - case 59 /* Identifier */: - case 138 /* PropertyAccess */: - case 117 /* QualifiedName */: + case 63 /* Identifier */: + case 142 /* PropertyAccess */: + case 121 /* QualifiedName */: return getSymbolOfEntityName(node); - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: var type = checkExpression(node); return type.symbol; - case 107 /* ConstructorKeyword */: + case 111 /* ConstructorKeyword */: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 122 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 126 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; case 7 /* StringLiteral */: - if (node.parent.kind === 183 /* ImportDeclaration */ && node.parent.externalModuleName === node) { + if (node.parent.kind === 190 /* 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 == 139 /* IndexedAccess */ && node.parent.index === node) { + if (node.parent.kind == 143 /* IndexedAccess */ && node.parent.index === node) { var objectType = checkExpression(node.parent.object); if (objectType === unknownType) return undefined; @@ -15971,7 +15878,7 @@ var ts; return getNamedMembers(propsByName); } function getRootSymbols(symbol) { - if (symbol.flags & 536870912 /* UnionProperty */) { + if (symbol.flags & 1073741824 /* UnionProperty */) { var symbols = []; var name = symbol.name; ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) { @@ -15979,7 +15886,7 @@ var ts; }); return symbols; } - else if (symbol.flags & 134217728 /* Transient */) { + else if (symbol.flags & 268435456 /* Transient */) { var target = getSymbolLinks(symbol).target; if (target) { return [target]; @@ -15988,7 +15895,7 @@ var ts; return [symbol]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 256 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 186 /* SourceFile */; + return symbol.flags & 512 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 193 /* SourceFile */; } function isNodeDescendentOf(node, ancestor) { while (node) { @@ -16000,7 +15907,7 @@ var ts; } function isUniqueLocalName(name, container) { for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (ts.SymbolFlags.Value | 2097152 /* ExportValue */)) { + if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (107455 /* Value */ | 4194304 /* ExportValue */)) { return false; } } @@ -16021,7 +15928,7 @@ var ts; function getLocalNameForSymbol(symbol, location) { var node = location; while (node) { - if ((node.kind === 181 /* ModuleDeclaration */ || node.kind === 180 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { + if ((node.kind === 188 /* ModuleDeclaration */ || node.kind === 187 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { return getLocalNameOfContainer(node); } node = node.parent; @@ -16032,7 +15939,7 @@ var ts; var symbol = getNodeLinks(node).resolvedSymbol; if (symbol) { var exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); - if (symbol !== exportSymbol && !(exportSymbol.flags & ts.SymbolFlags.ExportHasLocal)) { + if (symbol !== exportSymbol && !(exportSymbol.flags & 944 /* ExportHasLocal */)) { symbol = exportSymbol; } if (symbol.parent) { @@ -16042,15 +15949,14 @@ var ts; } function getExportAssignmentName(node) { var symbol = getExportAssignmentSymbol(getSymbolOfNode(node)); - return symbol && symbolIsValue(symbol) ? symbolToString(symbol) : undefined; + return symbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol) ? symbolToString(symbol) : undefined; } - function isTopLevelValueImportedViaEntityName(node) { - if (node.parent.kind !== 186 /* SourceFile */ || !node.entityName) { + function isTopLevelValueImportWithEntityName(node) { + if (node.parent.kind !== 193 /* SourceFile */ || !node.entityName) { return false; } var symbol = getSymbolOfNode(node); - var target = resolveImport(symbol); - return target !== unknownSymbol && ((target.flags & ts.SymbolFlags.Value) !== 0); + return isImportResolvedToValue(getSymbolOfNode(node)); } function hasSemanticErrors() { return getDiagnostics().length > 0 || getGlobalDiagnostics().length > 0; @@ -16058,16 +15964,20 @@ var ts; function hasEarlyErrors(sourceFile) { return ts.forEach(getDiagnostics(sourceFile), function (d) { return d.isEarly; }); } + function isImportResolvedToValue(symbol) { + var target = resolveImport(symbol); + return target !== unknownSymbol && target.flags & 107455 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target); + } + function isConstEnumOrConstEnumOnlyModule(s) { + return isConstEnumSymbol(s) || s.constEnumOnlyModule; + } function isReferencedImportDeclaration(node) { var symbol = getSymbolOfNode(node); if (getSymbolLinks(symbol).referenced) { return true; } if (node.flags & 1 /* Export */) { - var target = resolveImport(symbol); - if (target !== unknownSymbol && target.flags & ts.SymbolFlags.Value) { - return true; - } + return isImportResolvedToValue(symbol); } return false; } @@ -16091,7 +16001,7 @@ var ts; if (symbol && (symbol.flags & 8 /* EnumMember */)) { var declaration = symbol.valueDeclaration; var constantValue; - if (declaration.kind === 185 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { + if (declaration.kind === 192 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { return constantValue; } } @@ -16099,7 +16009,7 @@ var ts; } function writeTypeAtLocation(location, enclosingDeclaration, flags, writer) { var symbol = getSymbolOfNode(location); - var type = symbol && !(symbol.flags & 1024 /* TypeLiteral */) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); + var type = symbol && !(symbol.flags & 2048 /* TypeLiteral */) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { @@ -16115,7 +16025,7 @@ var ts; isReferencedImportDeclaration: isReferencedImportDeclaration, getNodeCheckFlags: getNodeCheckFlags, getEnumMemberValue: getEnumMemberValue, - isTopLevelValueImportedViaEntityName: isTopLevelValueImportedViaEntityName, + isTopLevelValueImportWithEntityName: isTopLevelValueImportWithEntityName, hasSemanticErrors: hasSemanticErrors, hasEarlyErrors: hasEarlyErrors, isDeclarationVisible: isDeclarationVisible, @@ -16273,6 +16183,11 @@ var ts; shortName: "w", type: "boolean", description: ts.Diagnostics.Watch_input_files + }, + { + name: "preserveConstEnums", + type: "boolean", + description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code } ]; var shortOptionNames = {}; diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js index 8aebc0f642a..ea97ea9ea75 100644 --- a/bin/typescriptServices.js +++ b/bin/typescriptServices.js @@ -134,7 +134,8 @@ var ts; 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." }, - Aliased_type_cannot_be_an_object_type_literal_Use_an_interface_declaration_instead: { code: 1158, category: 1 /* Error */, key: "Aliased type cannot be an object type literal. Use an interface declaration instead." }, + 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." }, @@ -282,6 +283,7 @@ var ts; 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}'." }, @@ -364,6 +366,12 @@ var ts; 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}" }, @@ -378,6 +386,7 @@ var ts; 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'" }, @@ -431,112 +440,112 @@ var ts; var ts; (function (ts) { var textToToken = { - "any": 105 /* AnyKeyword */, - "boolean": 106 /* BooleanKeyword */, - "break": 60 /* BreakKeyword */, - "case": 61 /* CaseKeyword */, - "catch": 62 /* CatchKeyword */, - "class": 63 /* ClassKeyword */, - "continue": 65 /* ContinueKeyword */, - "const": 64 /* ConstKeyword */, - "constructor": 107 /* ConstructorKeyword */, - "debugger": 66 /* DebuggerKeyword */, - "declare": 108 /* DeclareKeyword */, - "default": 67 /* DefaultKeyword */, - "delete": 68 /* DeleteKeyword */, - "do": 69 /* DoKeyword */, - "else": 70 /* ElseKeyword */, - "enum": 71 /* EnumKeyword */, - "export": 72 /* ExportKeyword */, - "extends": 73 /* ExtendsKeyword */, - "false": 74 /* FalseKeyword */, - "finally": 75 /* FinallyKeyword */, - "for": 76 /* ForKeyword */, - "function": 77 /* FunctionKeyword */, - "get": 109 /* GetKeyword */, - "if": 78 /* IfKeyword */, - "implements": 96 /* ImplementsKeyword */, - "import": 79 /* ImportKeyword */, - "in": 80 /* InKeyword */, - "instanceof": 81 /* InstanceOfKeyword */, - "interface": 97 /* InterfaceKeyword */, - "let": 98 /* LetKeyword */, - "module": 110 /* ModuleKeyword */, - "new": 82 /* NewKeyword */, - "null": 83 /* NullKeyword */, - "number": 112 /* NumberKeyword */, - "package": 99 /* PackageKeyword */, - "private": 100 /* PrivateKeyword */, - "protected": 101 /* ProtectedKeyword */, - "public": 102 /* PublicKeyword */, - "require": 111 /* RequireKeyword */, - "return": 84 /* ReturnKeyword */, - "set": 113 /* SetKeyword */, - "static": 103 /* StaticKeyword */, - "string": 114 /* StringKeyword */, - "super": 85 /* SuperKeyword */, - "switch": 86 /* SwitchKeyword */, - "this": 87 /* ThisKeyword */, - "throw": 88 /* ThrowKeyword */, - "true": 89 /* TrueKeyword */, - "try": 90 /* TryKeyword */, - "type": 115 /* TypeKeyword */, - "typeof": 91 /* TypeOfKeyword */, - "var": 92 /* VarKeyword */, - "void": 93 /* VoidKeyword */, - "while": 94 /* WhileKeyword */, - "with": 95 /* WithKeyword */, - "yield": 104 /* YieldKeyword */, - "{": 9 /* OpenBraceToken */, - "}": 10 /* CloseBraceToken */, - "(": 11 /* OpenParenToken */, - ")": 12 /* CloseParenToken */, - "[": 13 /* OpenBracketToken */, - "]": 14 /* CloseBracketToken */, - ".": 15 /* DotToken */, - "...": 16 /* DotDotDotToken */, - ";": 17 /* SemicolonToken */, - ",": 18 /* CommaToken */, - "<": 19 /* LessThanToken */, - ">": 20 /* GreaterThanToken */, - "<=": 21 /* LessThanEqualsToken */, - ">=": 22 /* GreaterThanEqualsToken */, - "==": 23 /* EqualsEqualsToken */, - "!=": 24 /* ExclamationEqualsToken */, - "===": 25 /* EqualsEqualsEqualsToken */, - "!==": 26 /* ExclamationEqualsEqualsToken */, - "=>": 27 /* EqualsGreaterThanToken */, - "+": 28 /* PlusToken */, - "-": 29 /* MinusToken */, - "*": 30 /* AsteriskToken */, - "/": 31 /* SlashToken */, - "%": 32 /* PercentToken */, - "++": 33 /* PlusPlusToken */, - "--": 34 /* MinusMinusToken */, - "<<": 35 /* LessThanLessThanToken */, - ">>": 36 /* GreaterThanGreaterThanToken */, - ">>>": 37 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 38 /* AmpersandToken */, - "|": 39 /* BarToken */, - "^": 40 /* CaretToken */, - "!": 41 /* ExclamationToken */, - "~": 42 /* TildeToken */, - "&&": 43 /* AmpersandAmpersandToken */, - "||": 44 /* BarBarToken */, - "?": 45 /* QuestionToken */, - ":": 46 /* ColonToken */, - "=": 47 /* EqualsToken */, - "+=": 48 /* PlusEqualsToken */, - "-=": 49 /* MinusEqualsToken */, - "*=": 50 /* AsteriskEqualsToken */, - "/=": 51 /* SlashEqualsToken */, - "%=": 52 /* PercentEqualsToken */, - "<<=": 53 /* LessThanLessThanEqualsToken */, - ">>=": 54 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 56 /* AmpersandEqualsToken */, - "|=": 57 /* BarEqualsToken */, - "^=": 58 /* CaretEqualsToken */ + "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,]; @@ -838,10 +847,10 @@ var ts; } return +(text.substring(start, pos)); } - function scanHexDigits(count, exact) { + function scanHexDigits(count, mustMatchCount) { var digits = 0; var value = 0; - while (digits < count || !exact) { + while (digits < count || !mustMatchCount) { var ch = text.charCodeAt(pos); if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { value = value * 16 + ch - 48 /* _0 */; @@ -881,61 +890,7 @@ var ts; } if (ch === 92 /* backslash */) { result += text.substring(start, pos); - pos++; - if (pos >= len) { - error(ts.Diagnostics.Unexpected_end_of_text); - break; - } - ch = text.charCodeAt(pos++); - switch (ch) { - case 48 /* _0 */: - result += "\0"; - break; - case 98 /* b */: - result += "\b"; - break; - case 116 /* t */: - result += "\t"; - break; - case 110 /* n */: - result += "\n"; - break; - case 118 /* v */: - result += "\v"; - break; - case 102 /* f */: - result += "\f"; - break; - case 114 /* r */: - result += "\r"; - break; - case 39 /* singleQuote */: - result += "\'"; - break; - case 34 /* doubleQuote */: - result += "\""; - break; - case 120 /* x */: - case 117 /* u */: - var ch = scanHexDigits(ch === 120 /* x */ ? 2 : 4, true); - if (ch >= 0) { - result += String.fromCharCode(ch); - } - else { - error(ts.Diagnostics.Hexadecimal_digit_expected); - } - break; - case 13 /* carriageReturn */: - if (pos < len && text.charCodeAt(pos) === 10 /* lineFeed */) - pos++; - break; - case 10 /* lineFeed */: - case 8232 /* lineSeparator */: - case 8233 /* paragraphSeparator */: - break; - default: - result += String.fromCharCode(ch); - } + result += scanEscapeSequence(); start = pos; continue; } @@ -948,6 +903,102 @@ var ts; } 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; @@ -991,7 +1042,7 @@ var ts; return token = textToToken[tokenValue]; } } - return token = 59 /* Identifier */; + return token = 63 /* Identifier */; } function scan() { startPos = pos; @@ -1036,64 +1087,66 @@ var ts; case 33 /* exclamation */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 26 /* ExclamationEqualsEqualsToken */; + return pos += 3, token = 30 /* ExclamationEqualsEqualsToken */; } - return pos += 2, token = 24 /* ExclamationEqualsToken */; + return pos += 2, token = 28 /* ExclamationEqualsToken */; } - return pos++, token = 41 /* ExclamationToken */; + 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 = 52 /* PercentEqualsToken */; + return pos += 2, token = 56 /* PercentEqualsToken */; } - return pos++, token = 32 /* PercentToken */; + return pos++, token = 36 /* PercentToken */; case 38 /* ampersand */: if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { - return pos += 2, token = 43 /* AmpersandAmpersandToken */; + return pos += 2, token = 47 /* AmpersandAmpersandToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 56 /* AmpersandEqualsToken */; + return pos += 2, token = 60 /* AmpersandEqualsToken */; } - return pos++, token = 38 /* AmpersandToken */; + return pos++, token = 42 /* AmpersandToken */; case 40 /* openParen */: - return pos++, token = 11 /* OpenParenToken */; + return pos++, token = 15 /* OpenParenToken */; case 41 /* closeParen */: - return pos++, token = 12 /* CloseParenToken */; + return pos++, token = 16 /* CloseParenToken */; case 42 /* asterisk */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 50 /* AsteriskEqualsToken */; + return pos += 2, token = 54 /* AsteriskEqualsToken */; } - return pos++, token = 30 /* AsteriskToken */; + return pos++, token = 34 /* AsteriskToken */; case 43 /* plus */: if (text.charCodeAt(pos + 1) === 43 /* plus */) { - return pos += 2, token = 33 /* PlusPlusToken */; + return pos += 2, token = 37 /* PlusPlusToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 48 /* PlusEqualsToken */; + return pos += 2, token = 52 /* PlusEqualsToken */; } - return pos++, token = 28 /* PlusToken */; + return pos++, token = 32 /* PlusToken */; case 44 /* comma */: - return pos++, token = 18 /* CommaToken */; + return pos++, token = 22 /* CommaToken */; case 45 /* minus */: if (text.charCodeAt(pos + 1) === 45 /* minus */) { - return pos += 2, token = 34 /* MinusMinusToken */; + return pos += 2, token = 38 /* MinusMinusToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 49 /* MinusEqualsToken */; + return pos += 2, token = 53 /* MinusEqualsToken */; } - return pos++, token = 29 /* MinusToken */; + 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 = 16 /* DotDotDotToken */; + return pos += 3, token = 20 /* DotDotDotToken */; } - return pos++, token = 15 /* DotToken */; + return pos++, token = 19 /* DotToken */; case 47 /* slash */: if (text.charCodeAt(pos + 1) === 47 /* slash */) { pos += 2; @@ -1142,9 +1195,9 @@ var ts; } } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 51 /* SlashEqualsToken */; + return pos += 2, token = 55 /* SlashEqualsToken */; } - return pos++, token = 31 /* SlashToken */; + 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; @@ -1172,58 +1225,58 @@ var ts; tokenValue = "" + scanNumber(); return token = 6 /* NumericLiteral */; case 58 /* colon */: - return pos++, token = 46 /* ColonToken */; + return pos++, token = 50 /* ColonToken */; case 59 /* semicolon */: - return pos++, token = 17 /* SemicolonToken */; + 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 = 53 /* LessThanLessThanEqualsToken */; + return pos += 3, token = 57 /* LessThanLessThanEqualsToken */; } - return pos += 2, token = 35 /* LessThanLessThanToken */; + return pos += 2, token = 39 /* LessThanLessThanToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 21 /* LessThanEqualsToken */; + return pos += 2, token = 25 /* LessThanEqualsToken */; } - return pos++, token = 19 /* LessThanToken */; + 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 = 25 /* EqualsEqualsEqualsToken */; + return pos += 3, token = 29 /* EqualsEqualsEqualsToken */; } - return pos += 2, token = 23 /* EqualsEqualsToken */; + return pos += 2, token = 27 /* EqualsEqualsToken */; } if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { - return pos += 2, token = 27 /* EqualsGreaterThanToken */; + return pos += 2, token = 31 /* EqualsGreaterThanToken */; } - return pos++, token = 47 /* EqualsToken */; + return pos++, token = 51 /* EqualsToken */; case 62 /* greaterThan */: - return pos++, token = 20 /* GreaterThanToken */; + return pos++, token = 24 /* GreaterThanToken */; case 63 /* question */: - return pos++, token = 45 /* QuestionToken */; + return pos++, token = 49 /* QuestionToken */; case 91 /* openBracket */: - return pos++, token = 13 /* OpenBracketToken */; + return pos++, token = 17 /* OpenBracketToken */; case 93 /* closeBracket */: - return pos++, token = 14 /* CloseBracketToken */; + return pos++, token = 18 /* CloseBracketToken */; case 94 /* caret */: if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 58 /* CaretEqualsToken */; + return pos += 2, token = 62 /* CaretEqualsToken */; } - return pos++, token = 40 /* CaretToken */; + return pos++, token = 44 /* CaretToken */; case 123 /* openBrace */: - return pos++, token = 9 /* OpenBraceToken */; + return pos++, token = 13 /* OpenBraceToken */; case 124 /* bar */: if (text.charCodeAt(pos + 1) === 124 /* bar */) { - return pos += 2, token = 44 /* BarBarToken */; + return pos += 2, token = 48 /* BarBarToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 57 /* BarEqualsToken */; + return pos += 2, token = 61 /* BarEqualsToken */; } - return pos++, token = 39 /* BarToken */; + return pos++, token = 43 /* BarToken */; case 125 /* closeBrace */: - return pos++, token = 10 /* CloseBraceToken */; + return pos++, token = 14 /* CloseBraceToken */; case 126 /* tilde */: - return pos++, token = 42 /* TildeToken */; + return pos++, token = 46 /* TildeToken */; case 92 /* backslash */: var ch = peekUnicodeEscape(); if (ch >= 0 && isIdentifierStart(ch)) { @@ -1259,27 +1312,27 @@ var ts; } } function reScanGreaterToken() { - if (token === 20 /* GreaterThanToken */) { + 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 = 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */; + return pos += 3, token = 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */; } - return pos += 2, token = 37 /* GreaterThanGreaterThanGreaterThanToken */; + return pos += 2, token = 41 /* GreaterThanGreaterThanGreaterThanToken */; } if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 54 /* GreaterThanGreaterThanEqualsToken */; + return pos += 2, token = 58 /* GreaterThanGreaterThanEqualsToken */; } - return pos++, token = 36 /* GreaterThanGreaterThanToken */; + return pos++, token = 40 /* GreaterThanGreaterThanToken */; } if (text.charCodeAt(pos) === 61 /* equals */) { - return pos++, token = 22 /* GreaterThanEqualsToken */; + return pos++, token = 26 /* GreaterThanEqualsToken */; } } return token; } function reScanSlashToken() { - if (token === 31 /* SlashToken */ || token === 51 /* SlashEqualsToken */) { + if (token === 35 /* SlashToken */ || token === 55 /* SlashEqualsToken */) { var p = tokenPos + 1; var inEscape = false; var inCharacterClass = false; @@ -1318,6 +1371,11 @@ var ts; } 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; @@ -1357,10 +1415,11 @@ var ts; getTokenText: function () { return text.substring(tokenPos, pos); }, getTokenValue: function () { return tokenValue; }, hasPrecedingLineBreak: function () { return precedingLineBreak; }, - isIdentifier: function () { return token === 59 /* Identifier */ || token > ts.SyntaxKind.LastReservedWord; }, - isReservedWord: function () { return token >= ts.SyntaxKind.FirstReservedWord && token <= ts.SyntaxKind.LastReservedWord; }, + 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, @@ -1371,234 +1430,6 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - (function (SyntaxKind) { - SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown"; - SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken"; - SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia"; - SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia"; - SyntaxKind[SyntaxKind["NewLineTrivia"] = 4] = "NewLineTrivia"; - SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 5] = "WhitespaceTrivia"; - SyntaxKind[SyntaxKind["NumericLiteral"] = 6] = "NumericLiteral"; - SyntaxKind[SyntaxKind["StringLiteral"] = 7] = "StringLiteral"; - SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 8] = "RegularExpressionLiteral"; - SyntaxKind[SyntaxKind["OpenBraceToken"] = 9] = "OpenBraceToken"; - SyntaxKind[SyntaxKind["CloseBraceToken"] = 10] = "CloseBraceToken"; - SyntaxKind[SyntaxKind["OpenParenToken"] = 11] = "OpenParenToken"; - SyntaxKind[SyntaxKind["CloseParenToken"] = 12] = "CloseParenToken"; - SyntaxKind[SyntaxKind["OpenBracketToken"] = 13] = "OpenBracketToken"; - SyntaxKind[SyntaxKind["CloseBracketToken"] = 14] = "CloseBracketToken"; - SyntaxKind[SyntaxKind["DotToken"] = 15] = "DotToken"; - SyntaxKind[SyntaxKind["DotDotDotToken"] = 16] = "DotDotDotToken"; - SyntaxKind[SyntaxKind["SemicolonToken"] = 17] = "SemicolonToken"; - SyntaxKind[SyntaxKind["CommaToken"] = 18] = "CommaToken"; - SyntaxKind[SyntaxKind["LessThanToken"] = 19] = "LessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanToken"] = 20] = "GreaterThanToken"; - SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 21] = "LessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 22] = "GreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 23] = "EqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 24] = "ExclamationEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 25] = "EqualsEqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 26] = "ExclamationEqualsEqualsToken"; - SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 27] = "EqualsGreaterThanToken"; - SyntaxKind[SyntaxKind["PlusToken"] = 28] = "PlusToken"; - SyntaxKind[SyntaxKind["MinusToken"] = 29] = "MinusToken"; - SyntaxKind[SyntaxKind["AsteriskToken"] = 30] = "AsteriskToken"; - SyntaxKind[SyntaxKind["SlashToken"] = 31] = "SlashToken"; - SyntaxKind[SyntaxKind["PercentToken"] = 32] = "PercentToken"; - SyntaxKind[SyntaxKind["PlusPlusToken"] = 33] = "PlusPlusToken"; - SyntaxKind[SyntaxKind["MinusMinusToken"] = 34] = "MinusMinusToken"; - SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 35] = "LessThanLessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 36] = "GreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 37] = "GreaterThanGreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["AmpersandToken"] = 38] = "AmpersandToken"; - SyntaxKind[SyntaxKind["BarToken"] = 39] = "BarToken"; - SyntaxKind[SyntaxKind["CaretToken"] = 40] = "CaretToken"; - SyntaxKind[SyntaxKind["ExclamationToken"] = 41] = "ExclamationToken"; - SyntaxKind[SyntaxKind["TildeToken"] = 42] = "TildeToken"; - SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 43] = "AmpersandAmpersandToken"; - SyntaxKind[SyntaxKind["BarBarToken"] = 44] = "BarBarToken"; - SyntaxKind[SyntaxKind["QuestionToken"] = 45] = "QuestionToken"; - SyntaxKind[SyntaxKind["ColonToken"] = 46] = "ColonToken"; - SyntaxKind[SyntaxKind["EqualsToken"] = 47] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 48] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 49] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 50] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 51] = "SlashEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 52] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 53] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 54] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 55] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 56] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 57] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 58] = "CaretEqualsToken"; - SyntaxKind[SyntaxKind["Identifier"] = 59] = "Identifier"; - SyntaxKind[SyntaxKind["BreakKeyword"] = 60] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 61] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 62] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ClassKeyword"] = 63] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 64] = "ConstKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 65] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 66] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 67] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 68] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 69] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 70] = "ElseKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 71] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 72] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 73] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 74] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 75] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 76] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 77] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 78] = "IfKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 79] = "ImportKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 80] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 81] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 82] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 83] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 84] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 85] = "SuperKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 86] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 87] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 88] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 89] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 90] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 91] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 92] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 93] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 94] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 95] = "WithKeyword"; - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 96] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 97] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 98] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 99] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 100] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 101] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 102] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 103] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 104] = "YieldKeyword"; - SyntaxKind[SyntaxKind["AnyKeyword"] = 105] = "AnyKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 106] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 107] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 108] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 109] = "GetKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 110] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 111] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 112] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 113] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 114] = "StringKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 115] = "TypeKeyword"; - SyntaxKind[SyntaxKind["Missing"] = 116] = "Missing"; - SyntaxKind[SyntaxKind["QualifiedName"] = 117] = "QualifiedName"; - SyntaxKind[SyntaxKind["TypeParameter"] = 118] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 119] = "Parameter"; - SyntaxKind[SyntaxKind["Property"] = 120] = "Property"; - SyntaxKind[SyntaxKind["Method"] = 121] = "Method"; - SyntaxKind[SyntaxKind["Constructor"] = 122] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 123] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 124] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 125] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 126] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 127] = "IndexSignature"; - SyntaxKind[SyntaxKind["TypeReference"] = 128] = "TypeReference"; - SyntaxKind[SyntaxKind["TypeQuery"] = 129] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 130] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 131] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 132] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 133] = "UnionType"; - SyntaxKind[SyntaxKind["ParenType"] = 134] = "ParenType"; - SyntaxKind[SyntaxKind["ArrayLiteral"] = 135] = "ArrayLiteral"; - SyntaxKind[SyntaxKind["ObjectLiteral"] = 136] = "ObjectLiteral"; - SyntaxKind[SyntaxKind["PropertyAssignment"] = 137] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["PropertyAccess"] = 138] = "PropertyAccess"; - SyntaxKind[SyntaxKind["IndexedAccess"] = 139] = "IndexedAccess"; - SyntaxKind[SyntaxKind["CallExpression"] = 140] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 141] = "NewExpression"; - SyntaxKind[SyntaxKind["TypeAssertion"] = 142] = "TypeAssertion"; - SyntaxKind[SyntaxKind["ParenExpression"] = 143] = "ParenExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 144] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 145] = "ArrowFunction"; - SyntaxKind[SyntaxKind["PrefixOperator"] = 146] = "PrefixOperator"; - SyntaxKind[SyntaxKind["PostfixOperator"] = 147] = "PostfixOperator"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 148] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 149] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 150] = "OmittedExpression"; - SyntaxKind[SyntaxKind["Block"] = 151] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 152] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 153] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 154] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 155] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 156] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 157] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 158] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 159] = "ForInStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 160] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 161] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 162] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 163] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 164] = "SwitchStatement"; - SyntaxKind[SyntaxKind["CaseClause"] = 165] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 166] = "DefaultClause"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 167] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 168] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 169] = "TryStatement"; - SyntaxKind[SyntaxKind["TryBlock"] = 170] = "TryBlock"; - SyntaxKind[SyntaxKind["CatchBlock"] = 171] = "CatchBlock"; - SyntaxKind[SyntaxKind["FinallyBlock"] = 172] = "FinallyBlock"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 173] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 174] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 175] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["FunctionBlock"] = 176] = "FunctionBlock"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 177] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 178] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 179] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 180] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 181] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 182] = "ModuleBlock"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 183] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 184] = "ExportAssignment"; - SyntaxKind[SyntaxKind["EnumMember"] = 185] = "EnumMember"; - SyntaxKind[SyntaxKind["SourceFile"] = 186] = "SourceFile"; - SyntaxKind[SyntaxKind["Program"] = 187] = "Program"; - SyntaxKind[SyntaxKind["SyntaxList"] = 188] = "SyntaxList"; - SyntaxKind[SyntaxKind["Count"] = 189] = "Count"; - SyntaxKind[SyntaxKind["FirstAssignment"] = SyntaxKind.EqualsToken] = "FirstAssignment"; - SyntaxKind[SyntaxKind["LastAssignment"] = SyntaxKind.CaretEqualsToken] = "LastAssignment"; - SyntaxKind[SyntaxKind["FirstReservedWord"] = SyntaxKind.BreakKeyword] = "FirstReservedWord"; - SyntaxKind[SyntaxKind["LastReservedWord"] = SyntaxKind.WithKeyword] = "LastReservedWord"; - SyntaxKind[SyntaxKind["FirstKeyword"] = SyntaxKind.BreakKeyword] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.TypeKeyword] = "LastKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = SyntaxKind.ImplementsKeyword] = "FirstFutureReservedWord"; - SyntaxKind[SyntaxKind["LastFutureReservedWord"] = SyntaxKind.YieldKeyword] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = SyntaxKind.TypeReference] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = SyntaxKind.ParenType] = "LastTypeNode"; - SyntaxKind[SyntaxKind["FirstPunctuation"] = SyntaxKind.OpenBraceToken] = "FirstPunctuation"; - SyntaxKind[SyntaxKind["LastPunctuation"] = SyntaxKind.CaretEqualsToken] = "LastPunctuation"; - SyntaxKind[SyntaxKind["FirstToken"] = SyntaxKind.EndOfFileToken] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = SyntaxKind.TypeKeyword] = "LastToken"; - SyntaxKind[SyntaxKind["FirstTriviaToken"] = SyntaxKind.SingleLineCommentTrivia] = "FirstTriviaToken"; - SyntaxKind[SyntaxKind["LastTriviaToken"] = SyntaxKind.WhitespaceTrivia] = "LastTriviaToken"; - })(ts.SyntaxKind || (ts.SyntaxKind = {})); - var SyntaxKind = ts.SyntaxKind; - (function (NodeFlags) { - NodeFlags[NodeFlags["Export"] = 0x00000001] = "Export"; - NodeFlags[NodeFlags["Ambient"] = 0x00000002] = "Ambient"; - NodeFlags[NodeFlags["QuestionMark"] = 0x00000004] = "QuestionMark"; - NodeFlags[NodeFlags["Rest"] = 0x00000008] = "Rest"; - NodeFlags[NodeFlags["Public"] = 0x00000010] = "Public"; - NodeFlags[NodeFlags["Private"] = 0x00000020] = "Private"; - NodeFlags[NodeFlags["Protected"] = 0x00000040] = "Protected"; - NodeFlags[NodeFlags["Static"] = 0x00000080] = "Static"; - NodeFlags[NodeFlags["MultiLine"] = 0x00000100] = "MultiLine"; - NodeFlags[NodeFlags["Synthetic"] = 0x00000200] = "Synthetic"; - NodeFlags[NodeFlags["DeclarationFile"] = 0x00000400] = "DeclarationFile"; - NodeFlags[NodeFlags["Let"] = 0x00000800] = "Let"; - NodeFlags[NodeFlags["Const"] = 0x00001000] = "Const"; - NodeFlags[NodeFlags["Modifier"] = NodeFlags.Export | NodeFlags.Ambient | NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected | NodeFlags.Static] = "Modifier"; - NodeFlags[NodeFlags["AccessibilityModifier"] = NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected] = "AccessibilityModifier"; - NodeFlags[NodeFlags["BlockScoped"] = NodeFlags.Let | NodeFlags.Const] = "BlockScoped"; - })(ts.NodeFlags || (ts.NodeFlags = {})); - var NodeFlags = ts.NodeFlags; (function (EmitReturnStatus) { EmitReturnStatus[EmitReturnStatus["Succeeded"] = 0] = "Succeeded"; EmitReturnStatus[EmitReturnStatus["AllOutputGenerationSkipped"] = 1] = "AllOutputGenerationSkipped"; @@ -1608,284 +1439,12 @@ var ts; EmitReturnStatus[EmitReturnStatus["CompilerOptionsErrors"] = 5] = "CompilerOptionsErrors"; })(ts.EmitReturnStatus || (ts.EmitReturnStatus = {})); var EmitReturnStatus = ts.EmitReturnStatus; - (function (TypeFormatFlags) { - TypeFormatFlags[TypeFormatFlags["None"] = 0x00000000] = "None"; - TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 0x00000001] = "WriteArrayAsGenericType"; - TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 0x00000002] = "UseTypeOfFunction"; - TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 0x00000004] = "NoTruncation"; - TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 0x00000008] = "WriteArrowStyleSignature"; - TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 0x00000010] = "WriteOwnNameForAnyLike"; - TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 0x00000020] = "WriteTypeArgumentsOfSignature"; - TypeFormatFlags[TypeFormatFlags["InElementType"] = 0x00000040] = "InElementType"; - })(ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); - var TypeFormatFlags = ts.TypeFormatFlags; - (function (SymbolFormatFlags) { - SymbolFormatFlags[SymbolFormatFlags["None"] = 0x00000000] = "None"; - SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 0x00000001] = "WriteTypeParametersOrArguments"; - SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 0x00000002] = "UseOnlyExternalAliasing"; - })(ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {})); - var SymbolFormatFlags = ts.SymbolFormatFlags; - (function (SymbolAccessibility) { - SymbolAccessibility[SymbolAccessibility["Accessible"] = 0] = "Accessible"; - SymbolAccessibility[SymbolAccessibility["NotAccessible"] = 1] = "NotAccessible"; - SymbolAccessibility[SymbolAccessibility["CannotBeNamed"] = 2] = "CannotBeNamed"; - })(ts.SymbolAccessibility || (ts.SymbolAccessibility = {})); - var SymbolAccessibility = ts.SymbolAccessibility; - (function (SymbolFlags) { - SymbolFlags[SymbolFlags["FunctionScopedVariable"] = 0x00000001] = "FunctionScopedVariable"; - SymbolFlags[SymbolFlags["BlockScopedVariable"] = 0x00000002] = "BlockScopedVariable"; - SymbolFlags[SymbolFlags["Property"] = 0x00000004] = "Property"; - SymbolFlags[SymbolFlags["EnumMember"] = 0x00000008] = "EnumMember"; - SymbolFlags[SymbolFlags["Function"] = 0x00000010] = "Function"; - SymbolFlags[SymbolFlags["Class"] = 0x00000020] = "Class"; - SymbolFlags[SymbolFlags["Interface"] = 0x00000040] = "Interface"; - SymbolFlags[SymbolFlags["Enum"] = 0x00000080] = "Enum"; - SymbolFlags[SymbolFlags["ValueModule"] = 0x00000100] = "ValueModule"; - SymbolFlags[SymbolFlags["NamespaceModule"] = 0x00000200] = "NamespaceModule"; - SymbolFlags[SymbolFlags["TypeLiteral"] = 0x00000400] = "TypeLiteral"; - SymbolFlags[SymbolFlags["ObjectLiteral"] = 0x00000800] = "ObjectLiteral"; - SymbolFlags[SymbolFlags["Method"] = 0x00001000] = "Method"; - SymbolFlags[SymbolFlags["Constructor"] = 0x00002000] = "Constructor"; - SymbolFlags[SymbolFlags["GetAccessor"] = 0x00004000] = "GetAccessor"; - SymbolFlags[SymbolFlags["SetAccessor"] = 0x00008000] = "SetAccessor"; - SymbolFlags[SymbolFlags["CallSignature"] = 0x00010000] = "CallSignature"; - SymbolFlags[SymbolFlags["ConstructSignature"] = 0x00020000] = "ConstructSignature"; - SymbolFlags[SymbolFlags["IndexSignature"] = 0x00040000] = "IndexSignature"; - SymbolFlags[SymbolFlags["TypeParameter"] = 0x00080000] = "TypeParameter"; - SymbolFlags[SymbolFlags["TypeAlias"] = 0x00100000] = "TypeAlias"; - SymbolFlags[SymbolFlags["ExportValue"] = 0x00200000] = "ExportValue"; - SymbolFlags[SymbolFlags["ExportType"] = 0x00400000] = "ExportType"; - SymbolFlags[SymbolFlags["ExportNamespace"] = 0x00800000] = "ExportNamespace"; - SymbolFlags[SymbolFlags["Import"] = 0x01000000] = "Import"; - SymbolFlags[SymbolFlags["Instantiated"] = 0x02000000] = "Instantiated"; - SymbolFlags[SymbolFlags["Merged"] = 0x04000000] = "Merged"; - SymbolFlags[SymbolFlags["Transient"] = 0x08000000] = "Transient"; - SymbolFlags[SymbolFlags["Prototype"] = 0x10000000] = "Prototype"; - SymbolFlags[SymbolFlags["UnionProperty"] = 0x20000000] = "UnionProperty"; - SymbolFlags[SymbolFlags["Variable"] = SymbolFlags.FunctionScopedVariable | SymbolFlags.BlockScopedVariable] = "Variable"; - SymbolFlags[SymbolFlags["Value"] = SymbolFlags.Variable | SymbolFlags.Property | SymbolFlags.EnumMember | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule | SymbolFlags.Method | SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Value"; - SymbolFlags[SymbolFlags["Type"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral | SymbolFlags.TypeParameter | SymbolFlags.TypeAlias] = "Type"; - SymbolFlags[SymbolFlags["Namespace"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Namespace"; - SymbolFlags[SymbolFlags["Module"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Module"; - SymbolFlags[SymbolFlags["Accessor"] = SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Accessor"; - SymbolFlags[SymbolFlags["Signature"] = SymbolFlags.CallSignature | SymbolFlags.ConstructSignature | SymbolFlags.IndexSignature] = "Signature"; - SymbolFlags[SymbolFlags["FunctionScopedVariableExcludes"] = SymbolFlags.Value & ~SymbolFlags.FunctionScopedVariable] = "FunctionScopedVariableExcludes"; - SymbolFlags[SymbolFlags["BlockScopedVariableExcludes"] = SymbolFlags.Value] = "BlockScopedVariableExcludes"; - SymbolFlags[SymbolFlags["ParameterExcludes"] = SymbolFlags.Value] = "ParameterExcludes"; - SymbolFlags[SymbolFlags["PropertyExcludes"] = SymbolFlags.Value] = "PropertyExcludes"; - SymbolFlags[SymbolFlags["EnumMemberExcludes"] = SymbolFlags.Value] = "EnumMemberExcludes"; - SymbolFlags[SymbolFlags["FunctionExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.ValueModule)] = "FunctionExcludes"; - SymbolFlags[SymbolFlags["ClassExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~SymbolFlags.ValueModule] = "ClassExcludes"; - SymbolFlags[SymbolFlags["InterfaceExcludes"] = SymbolFlags.Type & ~SymbolFlags.Interface] = "InterfaceExcludes"; - SymbolFlags[SymbolFlags["EnumExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~(SymbolFlags.Enum | SymbolFlags.ValueModule)] = "EnumExcludes"; - SymbolFlags[SymbolFlags["ValueModuleExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)] = "ValueModuleExcludes"; - SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; - SymbolFlags[SymbolFlags["MethodExcludes"] = SymbolFlags.Value & ~SymbolFlags.Method] = "MethodExcludes"; - SymbolFlags[SymbolFlags["GetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.SetAccessor] = "GetAccessorExcludes"; - SymbolFlags[SymbolFlags["SetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.GetAccessor] = "SetAccessorExcludes"; - SymbolFlags[SymbolFlags["TypeParameterExcludes"] = SymbolFlags.Type & ~SymbolFlags.TypeParameter] = "TypeParameterExcludes"; - SymbolFlags[SymbolFlags["TypeAliasExcludes"] = SymbolFlags.Type] = "TypeAliasExcludes"; - SymbolFlags[SymbolFlags["ImportExcludes"] = SymbolFlags.Import] = "ImportExcludes"; - SymbolFlags[SymbolFlags["ModuleMember"] = SymbolFlags.Variable | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.Module | SymbolFlags.TypeAlias | SymbolFlags.Import] = "ModuleMember"; - SymbolFlags[SymbolFlags["ExportHasLocal"] = SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule] = "ExportHasLocal"; - SymbolFlags[SymbolFlags["HasLocals"] = SymbolFlags.Function | SymbolFlags.Module | SymbolFlags.Method | SymbolFlags.Constructor | SymbolFlags.Accessor | SymbolFlags.Signature] = "HasLocals"; - SymbolFlags[SymbolFlags["HasExports"] = SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.Module] = "HasExports"; - SymbolFlags[SymbolFlags["HasMembers"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral] = "HasMembers"; - SymbolFlags[SymbolFlags["IsContainer"] = SymbolFlags.HasLocals | SymbolFlags.HasExports | SymbolFlags.HasMembers] = "IsContainer"; - SymbolFlags[SymbolFlags["PropertyOrAccessor"] = SymbolFlags.Property | SymbolFlags.Accessor] = "PropertyOrAccessor"; - SymbolFlags[SymbolFlags["Export"] = SymbolFlags.ExportNamespace | SymbolFlags.ExportType | SymbolFlags.ExportValue] = "Export"; - })(ts.SymbolFlags || (ts.SymbolFlags = {})); - var SymbolFlags = ts.SymbolFlags; - (function (NodeCheckFlags) { - NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 0x00000001] = "TypeChecked"; - NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 0x00000002] = "LexicalThis"; - NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 0x00000004] = "CaptureThis"; - NodeCheckFlags[NodeCheckFlags["EmitExtends"] = 0x00000008] = "EmitExtends"; - NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 0x00000010] = "SuperInstance"; - NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 0x00000020] = "SuperStatic"; - NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 0x00000040] = "ContextChecked"; - NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 0x00000080] = "EnumValuesComputed"; - })(ts.NodeCheckFlags || (ts.NodeCheckFlags = {})); - var NodeCheckFlags = ts.NodeCheckFlags; - (function (TypeFlags) { - TypeFlags[TypeFlags["Any"] = 0x00000001] = "Any"; - TypeFlags[TypeFlags["String"] = 0x00000002] = "String"; - TypeFlags[TypeFlags["Number"] = 0x00000004] = "Number"; - TypeFlags[TypeFlags["Boolean"] = 0x00000008] = "Boolean"; - TypeFlags[TypeFlags["Void"] = 0x00000010] = "Void"; - TypeFlags[TypeFlags["Undefined"] = 0x00000020] = "Undefined"; - TypeFlags[TypeFlags["Null"] = 0x00000040] = "Null"; - TypeFlags[TypeFlags["Enum"] = 0x00000080] = "Enum"; - TypeFlags[TypeFlags["StringLiteral"] = 0x00000100] = "StringLiteral"; - TypeFlags[TypeFlags["TypeParameter"] = 0x00000200] = "TypeParameter"; - TypeFlags[TypeFlags["Class"] = 0x00000400] = "Class"; - TypeFlags[TypeFlags["Interface"] = 0x00000800] = "Interface"; - TypeFlags[TypeFlags["Reference"] = 0x00001000] = "Reference"; - TypeFlags[TypeFlags["Tuple"] = 0x00002000] = "Tuple"; - TypeFlags[TypeFlags["Union"] = 0x00004000] = "Union"; - TypeFlags[TypeFlags["Anonymous"] = 0x00008000] = "Anonymous"; - TypeFlags[TypeFlags["FromSignature"] = 0x00010000] = "FromSignature"; - TypeFlags[TypeFlags["Intrinsic"] = TypeFlags.Any | TypeFlags.String | TypeFlags.Number | TypeFlags.Boolean | TypeFlags.Void | TypeFlags.Undefined | TypeFlags.Null] = "Intrinsic"; - TypeFlags[TypeFlags["StringLike"] = TypeFlags.String | TypeFlags.StringLiteral] = "StringLike"; - TypeFlags[TypeFlags["NumberLike"] = TypeFlags.Number | TypeFlags.Enum] = "NumberLike"; - TypeFlags[TypeFlags["ObjectType"] = TypeFlags.Class | TypeFlags.Interface | TypeFlags.Reference | TypeFlags.Tuple | TypeFlags.Anonymous] = "ObjectType"; - TypeFlags[TypeFlags["Structured"] = TypeFlags.Any | TypeFlags.ObjectType | TypeFlags.Union | TypeFlags.TypeParameter] = "Structured"; - })(ts.TypeFlags || (ts.TypeFlags = {})); - var TypeFlags = ts.TypeFlags; - (function (SignatureKind) { - SignatureKind[SignatureKind["Call"] = 0] = "Call"; - SignatureKind[SignatureKind["Construct"] = 1] = "Construct"; - })(ts.SignatureKind || (ts.SignatureKind = {})); - var SignatureKind = ts.SignatureKind; - (function (IndexKind) { - IndexKind[IndexKind["String"] = 0] = "String"; - IndexKind[IndexKind["Number"] = 1] = "Number"; - })(ts.IndexKind || (ts.IndexKind = {})); - var IndexKind = ts.IndexKind; (function (DiagnosticCategory) { DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; })(ts.DiagnosticCategory || (ts.DiagnosticCategory = {})); var DiagnosticCategory = ts.DiagnosticCategory; - (function (ModuleKind) { - ModuleKind[ModuleKind["None"] = 0] = "None"; - ModuleKind[ModuleKind["CommonJS"] = 1] = "CommonJS"; - ModuleKind[ModuleKind["AMD"] = 2] = "AMD"; - })(ts.ModuleKind || (ts.ModuleKind = {})); - var ModuleKind = ts.ModuleKind; - (function (ScriptTarget) { - ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; - ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; - ScriptTarget[ScriptTarget["ES6"] = 2] = "ES6"; - ScriptTarget[ScriptTarget["Latest"] = ScriptTarget.ES6] = "Latest"; - })(ts.ScriptTarget || (ts.ScriptTarget = {})); - var ScriptTarget = ts.ScriptTarget; - (function (CharacterCodes) { - CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; - CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 0x7F] = "maxAsciiCharacter"; - CharacterCodes[CharacterCodes["lineFeed"] = 0x0A] = "lineFeed"; - CharacterCodes[CharacterCodes["carriageReturn"] = 0x0D] = "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["mathematicalSpace"] = 0x205F] = "mathematicalSpace"; - CharacterCodes[CharacterCodes["ogham"] = 0x1680] = "ogham"; - CharacterCodes[CharacterCodes["_"] = 0x5F] = "_"; - CharacterCodes[CharacterCodes["$"] = 0x24] = "$"; - CharacterCodes[CharacterCodes["_0"] = 0x30] = "_0"; - CharacterCodes[CharacterCodes["_1"] = 0x31] = "_1"; - CharacterCodes[CharacterCodes["_2"] = 0x32] = "_2"; - CharacterCodes[CharacterCodes["_3"] = 0x33] = "_3"; - CharacterCodes[CharacterCodes["_4"] = 0x34] = "_4"; - CharacterCodes[CharacterCodes["_5"] = 0x35] = "_5"; - CharacterCodes[CharacterCodes["_6"] = 0x36] = "_6"; - CharacterCodes[CharacterCodes["_7"] = 0x37] = "_7"; - CharacterCodes[CharacterCodes["_8"] = 0x38] = "_8"; - CharacterCodes[CharacterCodes["_9"] = 0x39] = "_9"; - CharacterCodes[CharacterCodes["a"] = 0x61] = "a"; - CharacterCodes[CharacterCodes["b"] = 0x62] = "b"; - CharacterCodes[CharacterCodes["c"] = 0x63] = "c"; - CharacterCodes[CharacterCodes["d"] = 0x64] = "d"; - CharacterCodes[CharacterCodes["e"] = 0x65] = "e"; - CharacterCodes[CharacterCodes["f"] = 0x66] = "f"; - CharacterCodes[CharacterCodes["g"] = 0x67] = "g"; - CharacterCodes[CharacterCodes["h"] = 0x68] = "h"; - CharacterCodes[CharacterCodes["i"] = 0x69] = "i"; - CharacterCodes[CharacterCodes["j"] = 0x6A] = "j"; - CharacterCodes[CharacterCodes["k"] = 0x6B] = "k"; - CharacterCodes[CharacterCodes["l"] = 0x6C] = "l"; - CharacterCodes[CharacterCodes["m"] = 0x6D] = "m"; - CharacterCodes[CharacterCodes["n"] = 0x6E] = "n"; - CharacterCodes[CharacterCodes["o"] = 0x6F] = "o"; - CharacterCodes[CharacterCodes["p"] = 0x70] = "p"; - CharacterCodes[CharacterCodes["q"] = 0x71] = "q"; - CharacterCodes[CharacterCodes["r"] = 0x72] = "r"; - CharacterCodes[CharacterCodes["s"] = 0x73] = "s"; - CharacterCodes[CharacterCodes["t"] = 0x74] = "t"; - CharacterCodes[CharacterCodes["u"] = 0x75] = "u"; - CharacterCodes[CharacterCodes["v"] = 0x76] = "v"; - CharacterCodes[CharacterCodes["w"] = 0x77] = "w"; - CharacterCodes[CharacterCodes["x"] = 0x78] = "x"; - CharacterCodes[CharacterCodes["y"] = 0x79] = "y"; - CharacterCodes[CharacterCodes["z"] = 0x7A] = "z"; - CharacterCodes[CharacterCodes["A"] = 0x41] = "A"; - CharacterCodes[CharacterCodes["B"] = 0x42] = "B"; - CharacterCodes[CharacterCodes["C"] = 0x43] = "C"; - CharacterCodes[CharacterCodes["D"] = 0x44] = "D"; - CharacterCodes[CharacterCodes["E"] = 0x45] = "E"; - CharacterCodes[CharacterCodes["F"] = 0x46] = "F"; - CharacterCodes[CharacterCodes["G"] = 0x47] = "G"; - CharacterCodes[CharacterCodes["H"] = 0x48] = "H"; - CharacterCodes[CharacterCodes["I"] = 0x49] = "I"; - CharacterCodes[CharacterCodes["J"] = 0x4A] = "J"; - CharacterCodes[CharacterCodes["K"] = 0x4B] = "K"; - CharacterCodes[CharacterCodes["L"] = 0x4C] = "L"; - CharacterCodes[CharacterCodes["M"] = 0x4D] = "M"; - CharacterCodes[CharacterCodes["N"] = 0x4E] = "N"; - CharacterCodes[CharacterCodes["O"] = 0x4F] = "O"; - CharacterCodes[CharacterCodes["P"] = 0x50] = "P"; - CharacterCodes[CharacterCodes["Q"] = 0x51] = "Q"; - CharacterCodes[CharacterCodes["R"] = 0x52] = "R"; - CharacterCodes[CharacterCodes["S"] = 0x53] = "S"; - CharacterCodes[CharacterCodes["T"] = 0x54] = "T"; - CharacterCodes[CharacterCodes["U"] = 0x55] = "U"; - CharacterCodes[CharacterCodes["V"] = 0x56] = "V"; - CharacterCodes[CharacterCodes["W"] = 0x57] = "W"; - CharacterCodes[CharacterCodes["X"] = 0x58] = "X"; - CharacterCodes[CharacterCodes["Y"] = 0x59] = "Y"; - CharacterCodes[CharacterCodes["Z"] = 0x5a] = "Z"; - CharacterCodes[CharacterCodes["ampersand"] = 0x26] = "ampersand"; - CharacterCodes[CharacterCodes["asterisk"] = 0x2A] = "asterisk"; - CharacterCodes[CharacterCodes["at"] = 0x40] = "at"; - CharacterCodes[CharacterCodes["backslash"] = 0x5C] = "backslash"; - CharacterCodes[CharacterCodes["bar"] = 0x7C] = "bar"; - CharacterCodes[CharacterCodes["caret"] = 0x5E] = "caret"; - CharacterCodes[CharacterCodes["closeBrace"] = 0x7D] = "closeBrace"; - CharacterCodes[CharacterCodes["closeBracket"] = 0x5D] = "closeBracket"; - CharacterCodes[CharacterCodes["closeParen"] = 0x29] = "closeParen"; - CharacterCodes[CharacterCodes["colon"] = 0x3A] = "colon"; - CharacterCodes[CharacterCodes["comma"] = 0x2C] = "comma"; - CharacterCodes[CharacterCodes["dot"] = 0x2E] = "dot"; - CharacterCodes[CharacterCodes["doubleQuote"] = 0x22] = "doubleQuote"; - CharacterCodes[CharacterCodes["equals"] = 0x3D] = "equals"; - CharacterCodes[CharacterCodes["exclamation"] = 0x21] = "exclamation"; - CharacterCodes[CharacterCodes["greaterThan"] = 0x3E] = "greaterThan"; - CharacterCodes[CharacterCodes["lessThan"] = 0x3C] = "lessThan"; - CharacterCodes[CharacterCodes["minus"] = 0x2D] = "minus"; - CharacterCodes[CharacterCodes["openBrace"] = 0x7B] = "openBrace"; - CharacterCodes[CharacterCodes["openBracket"] = 0x5B] = "openBracket"; - CharacterCodes[CharacterCodes["openParen"] = 0x28] = "openParen"; - CharacterCodes[CharacterCodes["percent"] = 0x25] = "percent"; - CharacterCodes[CharacterCodes["plus"] = 0x2B] = "plus"; - CharacterCodes[CharacterCodes["question"] = 0x3F] = "question"; - CharacterCodes[CharacterCodes["semicolon"] = 0x3B] = "semicolon"; - CharacterCodes[CharacterCodes["singleQuote"] = 0x27] = "singleQuote"; - CharacterCodes[CharacterCodes["slash"] = 0x2F] = "slash"; - CharacterCodes[CharacterCodes["tilde"] = 0x7E] = "tilde"; - CharacterCodes[CharacterCodes["backspace"] = 0x08] = "backspace"; - CharacterCodes[CharacterCodes["formFeed"] = 0x0C] = "formFeed"; - CharacterCodes[CharacterCodes["byteOrderMark"] = 0xFEFF] = "byteOrderMark"; - CharacterCodes[CharacterCodes["tab"] = 0x09] = "tab"; - CharacterCodes[CharacterCodes["verticalTab"] = 0x0B] = "verticalTab"; - })(ts.CharacterCodes || (ts.CharacterCodes = {})); - var CharacterCodes = ts.CharacterCodes; })(ts || (ts = {})); var ts; (function (ts) { @@ -2161,12 +1720,12 @@ var ts; ts.flattenDiagnosticChain = flattenDiagnosticChain; function compareValues(a, b) { if (a === b) - return 0; + return 0 /* EqualTo */; if (a === undefined) - return -1; + return -1 /* LessThan */; if (b === undefined) - return 1; - return a < b ? -1 : 1; + return 1 /* GreaterThan */; + return a < b ? -1 /* LessThan */ : 1 /* GreaterThan */; } ts.compareValues = compareValues; function getDiagnosticFilename(diagnostic) { @@ -2184,7 +1743,7 @@ var ts; var previousDiagnostic = diagnostics[0]; for (var i = 1; i < diagnostics.length; i++) { var currentDiagnostic = diagnostics[i]; - var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0; + var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0 /* EqualTo */; if (!isDupe) { newDiagnostics.push(currentDiagnostic); previousDiagnostic = currentDiagnostic; @@ -2413,13 +1972,6 @@ var ts; getTypeConstructor: function () { return Type; }, getSignatureConstructor: function () { return Signature; } }; - (function (AssertionLevel) { - AssertionLevel[AssertionLevel["None"] = 0] = "None"; - AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; - AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; - AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; - })(ts.AssertionLevel || (ts.AssertionLevel = {})); - var AssertionLevel = ts.AssertionLevel; var Debug; (function (Debug) { var currentAssertionLevel = 0 /* None */; @@ -2445,7 +1997,7 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var nodeConstructors = new Array(189 /* Count */); + var nodeConstructors = new Array(196 /* Count */); function getNodeConstructor(kind) { return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); } @@ -2458,7 +2010,7 @@ var ts; return node; } function getSourceFileOfNode(node) { - while (node && node.kind !== 186 /* SourceFile */) + while (node && node.kind !== 193 /* SourceFile */) node = node.parent; return node; } @@ -2495,81 +2047,13 @@ var ts; } ts.unescapeIdentifier = unescapeIdentifier; function identifierToString(identifier) { - return identifier.kind === 116 /* Missing */ ? "(Missing)" : getTextOfNode(identifier); + return identifier.kind === 120 /* Missing */ ? "(Missing)" : getTextOfNode(identifier); } ts.identifierToString = identifierToString; - function isExpression(node) { - switch (node.kind) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: - case 8 /* RegularExpressionLiteral */: - case 135 /* ArrayLiteral */: - case 136 /* ObjectLiteral */: - case 138 /* PropertyAccess */: - case 139 /* IndexedAccess */: - case 140 /* CallExpression */: - case 141 /* NewExpression */: - case 142 /* TypeAssertion */: - case 143 /* ParenExpression */: - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: - case 146 /* PrefixOperator */: - case 147 /* PostfixOperator */: - case 148 /* BinaryExpression */: - case 149 /* ConditionalExpression */: - case 150 /* OmittedExpression */: - return true; - case 117 /* QualifiedName */: - while (node.parent.kind === 117 /* QualifiedName */) - node = node.parent; - return node.parent.kind === 129 /* TypeQuery */; - case 59 /* Identifier */: - if (node.parent.kind === 129 /* TypeQuery */) { - return true; - } - case 6 /* NumericLiteral */: - case 7 /* StringLiteral */: - var parent = node.parent; - switch (parent.kind) { - case 174 /* VariableDeclaration */: - case 119 /* Parameter */: - case 120 /* Property */: - case 185 /* EnumMember */: - case 137 /* PropertyAssignment */: - return parent.initializer === node; - case 154 /* ExpressionStatement */: - case 155 /* IfStatement */: - case 156 /* DoStatement */: - case 157 /* WhileStatement */: - case 162 /* ReturnStatement */: - case 163 /* WithStatement */: - case 164 /* SwitchStatement */: - case 165 /* CaseClause */: - case 168 /* ThrowStatement */: - case 164 /* SwitchStatement */: - return parent.expression === node; - case 158 /* ForStatement */: - return parent.initializer === node || parent.condition === node || parent.iterator === node; - case 159 /* ForInStatement */: - return parent.variable === node || parent.expression === node; - case 142 /* TypeAssertion */: - return node === parent.operand; - default: - if (isExpression(parent)) { - return true; - } - } - } - return false; - } - ts.isExpression = isExpression; function createDiagnosticForNode(node, message, arg0, arg1, arg2) { node = getErrorSpanForNode(node); var file = getSourceFileOfNode(node); - var start = node.kind === 116 /* Missing */ ? node.pos : ts.skipTrivia(file.text, node.pos); + var start = node.kind === 120 /* Missing */ ? node.pos : ts.skipTrivia(file.text, node.pos); var length = node.end - start; return ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); } @@ -2585,12 +2069,12 @@ var ts; function getErrorSpanForNode(node) { var errorSpan; switch (node.kind) { - case 174 /* VariableDeclaration */: - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - case 181 /* ModuleDeclaration */: - case 180 /* EnumDeclaration */: - case 185 /* EnumMember */: + case 181 /* VariableDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 188 /* ModuleDeclaration */: + case 187 /* EnumDeclaration */: + case 192 /* EnumMember */: errorSpan = node.name; break; } @@ -2605,12 +2089,16 @@ var ts; return (file.flags & 1024 /* DeclarationFile */) !== 0; } ts.isDeclarationFile = isDeclarationFile; + function isConstEnumDeclaration(node) { + return (node.flags & 4096 /* Const */) !== 0; + } + ts.isConstEnumDeclaration = isConstEnumDeclaration; function isPrologueDirective(node) { - return node.kind === 154 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; + return node.kind === 161 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; function isEvalOrArgumentsIdentifier(node) { - return node.kind === 59 /* Identifier */ && node.text && (node.text === "eval" || node.text === "arguments"); + return node.kind === 63 /* Identifier */ && node.text && (node.text === "eval" || node.text === "arguments"); } function isUseStrictPrologueDirective(node) { ts.Debug.assert(isPrologueDirective(node)); @@ -2618,7 +2106,7 @@ var ts; } function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { sourceFileOfNode = sourceFileOfNode || getSourceFileOfNode(node); - if (node.kind === 119 /* Parameter */ || node.kind === 118 /* TypeParameter */) { + if (node.kind === 123 /* Parameter */ || node.kind === 122 /* TypeParameter */) { return ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); } else { @@ -2654,122 +2142,128 @@ var ts; if (!node) return; switch (node.kind) { - case 117 /* QualifiedName */: + case 121 /* QualifiedName */: return child(node.left) || child(node.right); - case 118 /* TypeParameter */: + case 122 /* TypeParameter */: return child(node.name) || child(node.constraint); - case 119 /* Parameter */: + case 123 /* Parameter */: return child(node.name) || child(node.type) || child(node.initializer); - case 120 /* Property */: - case 137 /* PropertyAssignment */: + case 124 /* Property */: + case 141 /* PropertyAssignment */: return child(node.name) || child(node.type) || child(node.initializer); - case 125 /* CallSignature */: - case 126 /* ConstructSignature */: - case 127 /* IndexSignature */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: return children(node.typeParameters) || children(node.parameters) || child(node.type); - case 121 /* Method */: - case 122 /* Constructor */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 144 /* FunctionExpression */: - case 175 /* FunctionDeclaration */: - case 145 /* ArrowFunction */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 149 /* FunctionExpression */: + case 182 /* FunctionDeclaration */: + case 150 /* ArrowFunction */: return child(node.name) || children(node.typeParameters) || children(node.parameters) || child(node.type) || child(node.body); - case 128 /* TypeReference */: + case 132 /* TypeReference */: return child(node.typeName) || children(node.typeArguments); - case 129 /* TypeQuery */: + case 133 /* TypeQuery */: return child(node.exprName); - case 130 /* TypeLiteral */: + case 134 /* TypeLiteral */: return children(node.members); - case 131 /* ArrayType */: + case 135 /* ArrayType */: return child(node.elementType); - case 132 /* TupleType */: + case 136 /* TupleType */: return children(node.elementTypes); - case 133 /* UnionType */: + case 137 /* UnionType */: return children(node.types); - case 134 /* ParenType */: + case 138 /* ParenType */: return child(node.type); - case 135 /* ArrayLiteral */: + case 139 /* ArrayLiteral */: return children(node.elements); - case 136 /* ObjectLiteral */: + case 140 /* ObjectLiteral */: return children(node.properties); - case 138 /* PropertyAccess */: + case 142 /* PropertyAccess */: return child(node.left) || child(node.right); - case 139 /* IndexedAccess */: + case 143 /* IndexedAccess */: return child(node.object) || child(node.index); - case 140 /* CallExpression */: - case 141 /* NewExpression */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: return child(node.func) || children(node.typeArguments) || children(node.arguments); - case 142 /* TypeAssertion */: + case 146 /* TaggedTemplateExpression */: + return child(node.tag) || child(node.template); + case 147 /* TypeAssertion */: return child(node.type) || child(node.operand); - case 143 /* ParenExpression */: + case 148 /* ParenExpression */: return child(node.expression); - case 146 /* PrefixOperator */: - case 147 /* PostfixOperator */: + case 151 /* PrefixOperator */: + case 152 /* PostfixOperator */: return child(node.operand); - case 148 /* BinaryExpression */: + case 153 /* BinaryExpression */: return child(node.left) || child(node.right); - case 149 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return child(node.condition) || child(node.whenTrue) || child(node.whenFalse); - case 151 /* Block */: - case 170 /* TryBlock */: - case 172 /* FinallyBlock */: - case 176 /* FunctionBlock */: - case 182 /* ModuleBlock */: - case 186 /* SourceFile */: + case 158 /* Block */: + case 177 /* TryBlock */: + case 179 /* FinallyBlock */: + case 183 /* FunctionBlock */: + case 189 /* ModuleBlock */: + case 193 /* SourceFile */: return children(node.statements); - case 152 /* VariableStatement */: + case 159 /* VariableStatement */: return children(node.declarations); - case 154 /* ExpressionStatement */: + case 161 /* ExpressionStatement */: return child(node.expression); - case 155 /* IfStatement */: + case 162 /* IfStatement */: return child(node.expression) || child(node.thenStatement) || child(node.elseStatement); - case 156 /* DoStatement */: + case 163 /* DoStatement */: return child(node.statement) || child(node.expression); - case 157 /* WhileStatement */: + case 164 /* WhileStatement */: return child(node.expression) || child(node.statement); - case 158 /* ForStatement */: + case 165 /* ForStatement */: return children(node.declarations) || child(node.initializer) || child(node.condition) || child(node.iterator) || child(node.statement); - case 159 /* ForInStatement */: + case 166 /* ForInStatement */: return child(node.declaration) || child(node.variable) || child(node.expression) || child(node.statement); - case 160 /* ContinueStatement */: - case 161 /* BreakStatement */: + case 167 /* ContinueStatement */: + case 168 /* BreakStatement */: return child(node.label); - case 162 /* ReturnStatement */: + case 169 /* ReturnStatement */: return child(node.expression); - case 163 /* WithStatement */: + case 170 /* WithStatement */: return child(node.expression) || child(node.statement); - case 164 /* SwitchStatement */: + case 171 /* SwitchStatement */: return child(node.expression) || children(node.clauses); - case 165 /* CaseClause */: - case 166 /* DefaultClause */: + case 172 /* CaseClause */: + case 173 /* DefaultClause */: return child(node.expression) || children(node.statements); - case 167 /* LabeledStatement */: + case 174 /* LabeledStatement */: return child(node.label) || child(node.statement); - case 168 /* ThrowStatement */: + case 175 /* ThrowStatement */: return child(node.expression); - case 169 /* TryStatement */: + case 176 /* TryStatement */: return child(node.tryBlock) || child(node.catchBlock) || child(node.finallyBlock); - case 171 /* CatchBlock */: + case 178 /* CatchBlock */: return child(node.variable) || children(node.statements); - case 174 /* VariableDeclaration */: + case 181 /* VariableDeclaration */: return child(node.name) || child(node.type) || child(node.initializer); - case 177 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return child(node.name) || children(node.typeParameters) || child(node.baseType) || children(node.implementedTypes) || children(node.members); - case 178 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: return child(node.name) || children(node.typeParameters) || children(node.baseTypes) || children(node.members); - case 179 /* TypeAliasDeclaration */: + case 186 /* TypeAliasDeclaration */: return child(node.name) || child(node.type); - case 180 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: return child(node.name) || children(node.members); - case 185 /* EnumMember */: + case 192 /* EnumMember */: return child(node.name) || child(node.initializer); - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return child(node.name) || child(node.body); - case 183 /* ImportDeclaration */: + case 190 /* ImportDeclaration */: return child(node.name) || child(node.entityName) || child(node.externalModuleName); - case 184 /* ExportAssignment */: + case 191 /* ExportAssignment */: return child(node.exportName); + case 155 /* TemplateExpression */: + return child(node.head) || children(node.templateSpans); + case 156 /* TemplateSpan */: + return child(node.expression) || child(node.literal); } } ts.forEachChild = forEachChild; @@ -2777,24 +2271,24 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 162 /* ReturnStatement */: + case 169 /* ReturnStatement */: return visitor(node); - case 151 /* Block */: - case 176 /* FunctionBlock */: - case 155 /* IfStatement */: - case 156 /* DoStatement */: - case 157 /* WhileStatement */: - case 158 /* ForStatement */: - case 159 /* ForInStatement */: - case 163 /* WithStatement */: - case 164 /* SwitchStatement */: - case 165 /* CaseClause */: - case 166 /* DefaultClause */: - case 167 /* LabeledStatement */: - case 169 /* TryStatement */: - case 170 /* TryBlock */: - case 171 /* CatchBlock */: - case 172 /* FinallyBlock */: + 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 */: return forEachChild(node, traverse); } } @@ -2803,13 +2297,13 @@ var ts; function isAnyFunction(node) { if (node) { switch (node.kind) { - case 144 /* FunctionExpression */: - case 175 /* FunctionDeclaration */: - case 145 /* ArrowFunction */: - case 121 /* Method */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 122 /* Constructor */: + case 149 /* FunctionExpression */: + case 182 /* FunctionDeclaration */: + case 150 /* ArrowFunction */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: return true; } } @@ -2832,20 +2326,20 @@ var ts; return undefined; } switch (node.kind) { - case 145 /* ArrowFunction */: + case 150 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } - case 175 /* FunctionDeclaration */: - case 144 /* FunctionExpression */: - case 181 /* ModuleDeclaration */: - case 120 /* Property */: - case 121 /* Method */: - case 122 /* Constructor */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 180 /* EnumDeclaration */: - case 186 /* SourceFile */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 188 /* ModuleDeclaration */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 187 /* EnumDeclaration */: + case 193 /* SourceFile */: return node; } } @@ -2858,20 +2352,103 @@ var ts; return undefined; } switch (node.kind) { - case 120 /* Property */: - case 121 /* Method */: - case 122 /* Constructor */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return node; } } } ts.getSuperContainer = getSuperContainer; + function isExpression(node) { + switch (node.kind) { + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: + case 87 /* NullKeyword */: + 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 */: + return true; + case 121 /* QualifiedName */: + while (node.parent.kind === 121 /* QualifiedName */) + node = node.parent; + return node.parent.kind === 133 /* TypeQuery */; + case 63 /* Identifier */: + if (node.parent.kind === 133 /* TypeQuery */) { + return true; + } + case 6 /* NumericLiteral */: + case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: + var parent = node.parent; + switch (parent.kind) { + case 181 /* VariableDeclaration */: + case 123 /* Parameter */: + case 124 /* Property */: + case 192 /* EnumMember */: + case 141 /* 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 */: + return parent.expression === node; + case 165 /* ForStatement */: + return parent.initializer === node || parent.condition === node || parent.iterator === node; + case 166 /* ForInStatement */: + return parent.variable === node || parent.expression === node; + case 147 /* TypeAssertion */: + return node === parent.operand; + default: + if (isExpression(parent)) { + return true; + } + } + } + return false; + } + ts.isExpression = isExpression; function hasRestParameters(s) { return s.parameters.length > 0 && (s.parameters[s.parameters.length - 1].flags & 8 /* Rest */) !== 0; } ts.hasRestParameters = hasRestParameters; + function isLiteralKind(kind) { + return 6 /* FirstLiteralToken */ <= kind && kind <= 9 /* LastLiteralToken */; + } + ts.isLiteralKind = isLiteralKind; + function isTextualLiteralKind(kind) { + return kind === 7 /* StringLiteral */ || kind === 9 /* NoSubstitutionTemplateLiteral */; + } + ts.isTextualLiteralKind = isTextualLiteralKind; + function isTemplateLiteralKind(kind) { + return 9 /* FirstTemplateToken */ <= kind && kind <= 12 /* LastTemplateToken */; + } + ts.isTemplateLiteralKind = isTemplateLiteralKind; function isInAmbientContext(node) { while (node) { if (node.flags & (2 /* Ambient */ | 1024 /* DeclarationFile */)) @@ -2883,22 +2460,22 @@ var ts; ts.isInAmbientContext = isInAmbientContext; function isDeclaration(node) { switch (node.kind) { - case 118 /* TypeParameter */: - case 119 /* Parameter */: - case 174 /* VariableDeclaration */: - case 120 /* Property */: - case 137 /* PropertyAssignment */: - case 185 /* EnumMember */: - case 121 /* Method */: - case 175 /* FunctionDeclaration */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - case 179 /* TypeAliasDeclaration */: - case 180 /* EnumDeclaration */: - case 181 /* ModuleDeclaration */: - case 183 /* ImportDeclaration */: + case 122 /* TypeParameter */: + case 123 /* Parameter */: + case 181 /* VariableDeclaration */: + case 124 /* Property */: + case 141 /* PropertyAssignment */: + case 192 /* EnumMember */: + case 125 /* Method */: + case 182 /* 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 */: return true; } return false; @@ -2906,24 +2483,24 @@ var ts; ts.isDeclaration = isDeclaration; function isStatement(n) { switch (n.kind) { - case 161 /* BreakStatement */: - case 160 /* ContinueStatement */: - case 173 /* DebuggerStatement */: - case 156 /* DoStatement */: - case 154 /* ExpressionStatement */: - case 153 /* EmptyStatement */: - case 159 /* ForInStatement */: - case 158 /* ForStatement */: - case 155 /* IfStatement */: - case 167 /* LabeledStatement */: - case 162 /* ReturnStatement */: - case 164 /* SwitchStatement */: - case 88 /* ThrowKeyword */: - case 169 /* TryStatement */: - case 152 /* VariableStatement */: - case 157 /* WhileStatement */: - case 163 /* WithStatement */: - case 184 /* ExportAssignment */: + 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 92 /* ThrowKeyword */: + case 176 /* TryStatement */: + case 159 /* VariableStatement */: + case 164 /* WhileStatement */: + case 170 /* WithStatement */: + case 191 /* ExportAssignment */: return true; default: return false; @@ -2931,14 +2508,14 @@ var ts; } ts.isStatement = isStatement; function isDeclarationOrFunctionExpressionOrCatchVariableName(name) { - if (name.kind !== 59 /* Identifier */ && name.kind !== 7 /* StringLiteral */ && name.kind !== 6 /* NumericLiteral */) { + if (name.kind !== 63 /* Identifier */ && name.kind !== 7 /* StringLiteral */ && name.kind !== 6 /* NumericLiteral */) { return false; } var parent = name.parent; - if (isDeclaration(parent) || parent.kind === 144 /* FunctionExpression */) { + if (isDeclaration(parent) || parent.kind === 149 /* FunctionExpression */) { return parent.name === name; } - if (parent.kind === 171 /* CatchBlock */) { + if (parent.kind === 178 /* CatchBlock */) { return parent.variable === name; } return false; @@ -2946,16 +2523,16 @@ var ts; ts.isDeclarationOrFunctionExpressionOrCatchVariableName = isDeclarationOrFunctionExpressionOrCatchVariableName; function getAncestor(node, kind) { switch (kind) { - case 177 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: while (node) { switch (node.kind) { - case 177 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return node; - case 180 /* EnumDeclaration */: - case 178 /* InterfaceDeclaration */: - case 179 /* TypeAliasDeclaration */: - case 181 /* ModuleDeclaration */: - case 183 /* ImportDeclaration */: + case 187 /* EnumDeclaration */: + case 185 /* InterfaceDeclaration */: + case 186 /* TypeAliasDeclaration */: + case 188 /* ModuleDeclaration */: + case 190 /* ImportDeclaration */: return undefined; default: node = node.parent; @@ -2975,107 +2552,44 @@ var ts; return undefined; } ts.getAncestor = getAncestor; - var ParsingContext; - (function (ParsingContext) { - ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements"; - ParsingContext[ParsingContext["ModuleElements"] = 1] = "ModuleElements"; - ParsingContext[ParsingContext["BlockStatements"] = 2] = "BlockStatements"; - ParsingContext[ParsingContext["SwitchClauses"] = 3] = "SwitchClauses"; - ParsingContext[ParsingContext["SwitchClauseStatements"] = 4] = "SwitchClauseStatements"; - ParsingContext[ParsingContext["TypeMembers"] = 5] = "TypeMembers"; - ParsingContext[ParsingContext["ClassMembers"] = 6] = "ClassMembers"; - ParsingContext[ParsingContext["EnumMembers"] = 7] = "EnumMembers"; - ParsingContext[ParsingContext["BaseTypeReferences"] = 8] = "BaseTypeReferences"; - ParsingContext[ParsingContext["VariableDeclarations"] = 9] = "VariableDeclarations"; - ParsingContext[ParsingContext["ArgumentExpressions"] = 10] = "ArgumentExpressions"; - ParsingContext[ParsingContext["ObjectLiteralMembers"] = 11] = "ObjectLiteralMembers"; - ParsingContext[ParsingContext["ArrayLiteralMembers"] = 12] = "ArrayLiteralMembers"; - ParsingContext[ParsingContext["Parameters"] = 13] = "Parameters"; - ParsingContext[ParsingContext["TypeParameters"] = 14] = "TypeParameters"; - ParsingContext[ParsingContext["TypeArguments"] = 15] = "TypeArguments"; - ParsingContext[ParsingContext["TupleElementTypes"] = 16] = "TupleElementTypes"; - ParsingContext[ParsingContext["Count"] = 17] = "Count"; - })(ParsingContext || (ParsingContext = {})); - var Tristate; - (function (Tristate) { - Tristate[Tristate["False"] = 0] = "False"; - Tristate[Tristate["True"] = 1] = "True"; - Tristate[Tristate["Unknown"] = 2] = "Unknown"; - })(Tristate || (Tristate = {})); function parsingContextErrors(context) { switch (context) { - case 0 /* SourceElements */: - return ts.Diagnostics.Declaration_or_statement_expected; - case 1 /* ModuleElements */: - return ts.Diagnostics.Declaration_or_statement_expected; - case 2 /* BlockStatements */: - return ts.Diagnostics.Statement_expected; - case 3 /* SwitchClauses */: - return ts.Diagnostics.case_or_default_expected; - case 4 /* SwitchClauseStatements */: - return ts.Diagnostics.Statement_expected; - case 5 /* TypeMembers */: - return ts.Diagnostics.Property_or_signature_expected; - case 6 /* ClassMembers */: - return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; - case 7 /* EnumMembers */: - return ts.Diagnostics.Enum_member_expected; - case 8 /* BaseTypeReferences */: - return ts.Diagnostics.Type_reference_expected; - case 9 /* VariableDeclarations */: - return ts.Diagnostics.Variable_declaration_expected; - case 10 /* ArgumentExpressions */: - return ts.Diagnostics.Argument_expression_expected; - case 11 /* ObjectLiteralMembers */: - return ts.Diagnostics.Property_assignment_expected; - case 12 /* ArrayLiteralMembers */: - return ts.Diagnostics.Expression_or_comma_expected; - case 13 /* Parameters */: - return ts.Diagnostics.Parameter_declaration_expected; - case 14 /* TypeParameters */: - return ts.Diagnostics.Type_parameter_declaration_expected; - case 15 /* TypeArguments */: - return ts.Diagnostics.Type_argument_expected; - case 16 /* TupleElementTypes */: - return ts.Diagnostics.Type_expected; + case 0 /* SourceElements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 1 /* ModuleElements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 2 /* BlockStatements */: return ts.Diagnostics.Statement_expected; + case 3 /* SwitchClauses */: return ts.Diagnostics.case_or_default_expected; + case 4 /* SwitchClauseStatements */: return ts.Diagnostics.Statement_expected; + case 5 /* TypeMembers */: return ts.Diagnostics.Property_or_signature_expected; + case 6 /* ClassMembers */: return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; + case 7 /* EnumMembers */: return ts.Diagnostics.Enum_member_expected; + case 8 /* BaseTypeReferences */: return ts.Diagnostics.Type_reference_expected; + case 9 /* VariableDeclarations */: return ts.Diagnostics.Variable_declaration_expected; + case 10 /* ArgumentExpressions */: return ts.Diagnostics.Argument_expression_expected; + case 11 /* ObjectLiteralMembers */: return ts.Diagnostics.Property_assignment_expected; + case 12 /* ArrayLiteralMembers */: return ts.Diagnostics.Expression_or_comma_expected; + case 13 /* Parameters */: return ts.Diagnostics.Parameter_declaration_expected; + case 14 /* TypeParameters */: return ts.Diagnostics.Type_parameter_declaration_expected; + case 15 /* TypeArguments */: return ts.Diagnostics.Type_argument_expected; + case 16 /* TupleElementTypes */: return ts.Diagnostics.Type_expected; } } ; - var LookAheadMode; - (function (LookAheadMode) { - LookAheadMode[LookAheadMode["NotLookingAhead"] = 0] = "NotLookingAhead"; - LookAheadMode[LookAheadMode["NoErrorYet"] = 1] = "NoErrorYet"; - LookAheadMode[LookAheadMode["Error"] = 2] = "Error"; - })(LookAheadMode || (LookAheadMode = {})); - var ModifierContext; - (function (ModifierContext) { - ModifierContext[ModifierContext["SourceElements"] = 0] = "SourceElements"; - ModifierContext[ModifierContext["ModuleElements"] = 1] = "ModuleElements"; - ModifierContext[ModifierContext["ClassMembers"] = 2] = "ClassMembers"; - ModifierContext[ModifierContext["Parameters"] = 3] = "Parameters"; - })(ModifierContext || (ModifierContext = {})); - var ControlBlockContext; - (function (ControlBlockContext) { - ControlBlockContext[ControlBlockContext["NotNested"] = 0] = "NotNested"; - ControlBlockContext[ControlBlockContext["Nested"] = 1] = "Nested"; - ControlBlockContext[ControlBlockContext["CrossingFunctionBoundary"] = 2] = "CrossingFunctionBoundary"; - })(ControlBlockContext || (ControlBlockContext = {})); function isKeyword(token) { - return ts.SyntaxKind.FirstKeyword <= token && token <= ts.SyntaxKind.LastKeyword; + return 64 /* FirstKeyword */ <= token && token <= 119 /* LastKeyword */; } ts.isKeyword = isKeyword; function isTrivia(token) { - return ts.SyntaxKind.FirstTriviaToken <= token && token <= ts.SyntaxKind.LastTriviaToken; + return 2 /* FirstTriviaToken */ <= token && token <= 5 /* LastTriviaToken */; } ts.isTrivia = isTrivia; function isModifier(token) { switch (token) { - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: - case 103 /* StaticKeyword */: - case 72 /* ExportKeyword */: - case 108 /* DeclareKeyword */: + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: + case 107 /* StaticKeyword */: + case 76 /* ExportKeyword */: + case 112 /* DeclareKeyword */: return true; } return false; @@ -3237,6 +2751,9 @@ var ts; function reScanSlashToken() { return token = scanner.reScanSlashToken(); } + function reScanTemplateToken() { + return token = scanner.reScanTemplateToken(); + } function lookAheadHelper(callback, alwaysResetState) { var saveToken = token; var saveSyntacticErrorsLength = file.syntacticErrors.length; @@ -3266,7 +2783,7 @@ var ts; return scanner.tryScan(function () { return lookAheadHelper(callback, false); }); } function isIdentifier() { - return token === 59 /* Identifier */ || (isInStrictMode ? token > ts.SyntaxKind.LastFutureReservedWord : token > ts.SyntaxKind.LastReservedWord); + return token === 63 /* Identifier */ || (isInStrictMode ? token > 108 /* LastFutureReservedWord */ : token > 99 /* LastReservedWord */); } function parseExpected(t) { if (token === t) { @@ -3284,14 +2801,14 @@ var ts; return false; } function canParseSemicolon() { - if (token === 17 /* SemicolonToken */) { + if (token === 21 /* SemicolonToken */) { return true; } - return token === 10 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); + return token === 14 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); } function parseSemicolon() { if (canParseSemicolon()) { - if (token === 17 /* SemicolonToken */) { + if (token === 21 /* SemicolonToken */) { nextToken(); } } @@ -3313,7 +2830,7 @@ var ts; return node; } function createMissingNode() { - return createNode(116 /* Missing */); + return createNode(120 /* Missing */); } function internIdentifier(text) { return ts.hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); @@ -3321,7 +2838,7 @@ var ts; function createIdentifier(isIdentifier) { identifierCount++; if (isIdentifier) { - var node = createNode(59 /* Identifier */); + var node = createNode(63 /* Identifier */); var text = escapeIdentifier(scanner.getTokenValue()); node.text = internIdentifier(text); nextToken(); @@ -3336,10 +2853,10 @@ var ts; return createIdentifier(isIdentifier()); } function parseIdentifierName() { - return createIdentifier(token >= 59 /* Identifier */); + return createIdentifier(token >= 63 /* Identifier */); } function isPropertyName() { - return token >= 59 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */; + return token >= 63 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */; } function parsePropertyName() { if (token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { @@ -3350,13 +2867,13 @@ var ts; function parseContextualModifier(t) { return token === t && tryParse(function () { nextToken(); - return token === 13 /* OpenBracketToken */ || isPropertyName(); + return token === 17 /* OpenBracketToken */ || isPropertyName(); }); } function parseAnyContextualModifier() { return isModifier(token) && tryParse(function () { nextToken(); - return token === 13 /* OpenBracketToken */ || isPropertyName(); + return token === 17 /* OpenBracketToken */ || isPropertyName(); }); } function isListElement(kind, inErrorRecovery) { @@ -3368,28 +2885,28 @@ var ts; case 4 /* SwitchClauseStatements */: return isStatement(inErrorRecovery); case 3 /* SwitchClauses */: - return token === 61 /* CaseKeyword */ || token === 67 /* DefaultKeyword */; + return token === 65 /* CaseKeyword */ || token === 71 /* DefaultKeyword */; case 5 /* TypeMembers */: - return isTypeMember(); + return isStartOfTypeMember(); case 6 /* ClassMembers */: return lookAhead(isClassMemberStart); case 7 /* EnumMembers */: case 11 /* ObjectLiteralMembers */: return isPropertyName(); case 8 /* BaseTypeReferences */: - return isIdentifier() && ((token !== 73 /* ExtendsKeyword */ && token !== 96 /* ImplementsKeyword */) || !lookAhead(function () { return (nextToken(), isIdentifier()); })); + return isIdentifier() && ((token !== 77 /* ExtendsKeyword */ && token !== 100 /* ImplementsKeyword */) || !lookAhead(function () { return (nextToken(), isIdentifier()); })); case 9 /* VariableDeclarations */: case 14 /* TypeParameters */: return isIdentifier(); case 10 /* ArgumentExpressions */: - return token === 18 /* CommaToken */ || isExpression(); + return token === 22 /* CommaToken */ || isStartOfExpression(); case 12 /* ArrayLiteralMembers */: - return token === 18 /* CommaToken */ || isExpression(); + return token === 22 /* CommaToken */ || isStartOfExpression(); case 13 /* Parameters */: - return isParameter(); + return isStartOfParameter(); case 15 /* TypeArguments */: case 16 /* TupleElementTypes */: - return token === 18 /* CommaToken */ || isType(); + return token === 22 /* CommaToken */ || isStartOfType(); } ts.Debug.fail("Non-exhaustive case in 'isListElement'."); } @@ -3405,34 +2922,34 @@ var ts; case 6 /* ClassMembers */: case 7 /* EnumMembers */: case 11 /* ObjectLiteralMembers */: - return token === 10 /* CloseBraceToken */; + return token === 14 /* CloseBraceToken */; case 4 /* SwitchClauseStatements */: - return token === 10 /* CloseBraceToken */ || token === 61 /* CaseKeyword */ || token === 67 /* DefaultKeyword */; + return token === 14 /* CloseBraceToken */ || token === 65 /* CaseKeyword */ || token === 71 /* DefaultKeyword */; case 8 /* BaseTypeReferences */: - return token === 9 /* OpenBraceToken */ || token === 73 /* ExtendsKeyword */ || token === 96 /* ImplementsKeyword */; + return token === 13 /* OpenBraceToken */ || token === 77 /* ExtendsKeyword */ || token === 100 /* ImplementsKeyword */; case 9 /* VariableDeclarations */: return isVariableDeclaratorListTerminator(); case 14 /* TypeParameters */: - return token === 20 /* GreaterThanToken */ || token === 11 /* OpenParenToken */ || token === 9 /* OpenBraceToken */ || token === 73 /* ExtendsKeyword */ || token === 96 /* ImplementsKeyword */; + return token === 24 /* GreaterThanToken */ || token === 15 /* OpenParenToken */ || token === 13 /* OpenBraceToken */ || token === 77 /* ExtendsKeyword */ || token === 100 /* ImplementsKeyword */; case 10 /* ArgumentExpressions */: - return token === 12 /* CloseParenToken */ || token === 17 /* SemicolonToken */; + return token === 16 /* CloseParenToken */ || token === 21 /* SemicolonToken */; case 12 /* ArrayLiteralMembers */: case 16 /* TupleElementTypes */: - return token === 14 /* CloseBracketToken */; + return token === 18 /* CloseBracketToken */; case 13 /* Parameters */: - return token === 12 /* CloseParenToken */ || token === 14 /* CloseBracketToken */ || token === 9 /* OpenBraceToken */; + return token === 16 /* CloseParenToken */ || token === 18 /* CloseBracketToken */ || token === 13 /* OpenBraceToken */; case 15 /* TypeArguments */: - return token === 20 /* GreaterThanToken */ || token === 11 /* OpenParenToken */; + return token === 24 /* GreaterThanToken */ || token === 15 /* OpenParenToken */; } } function isVariableDeclaratorListTerminator() { if (canParseSemicolon()) { return true; } - if (token === 80 /* InKeyword */) { + if (token === 84 /* InKeyword */) { return true; } - if (token === 27 /* EqualsGreaterThanToken */) { + if (token === 31 /* EqualsGreaterThanToken */) { return true; } return false; @@ -3493,7 +3010,7 @@ var ts; if (isListElement(kind, false)) { result.push(parseElement()); commaStart = scanner.getTokenPos(); - if (parseOptional(18 /* CommaToken */)) { + if (parseOptional(22 /* CommaToken */)) { continue; } commaStart = -1; @@ -3548,8 +3065,8 @@ var ts; } function parseEntityName(allowReservedWords) { var entity = parseIdentifier(); - while (parseOptional(15 /* DotToken */)) { - var node = createNode(117 /* QualifiedName */, entity.pos); + while (parseOptional(19 /* DotToken */)) { + var node = createNode(121 /* QualifiedName */, entity.pos); node.left = entity; node.right = allowReservedWords ? parseIdentifierName() : parseIdentifier(); entity = finishNode(node); @@ -3561,6 +3078,35 @@ var ts; nextToken(); return finishNode(node); } + function parseTemplateExpression() { + var template = createNode(155 /* TemplateExpression */); + template.head = parseLiteralNode(); + ts.Debug.assert(template.head.kind === 10 /* TemplateHead */, "Template head has wrong token kind"); + var templateSpans = []; + templateSpans.pos = getNodePos(); + do { + templateSpans.push(parseTemplateSpan()); + } while (templateSpans[templateSpans.length - 1].literal.kind === 11 /* TemplateMiddle */); + templateSpans.end = getNodeEnd(); + template.templateSpans = templateSpans; + return finishNode(template); + } + function parseTemplateSpan() { + var span = createNode(156 /* TemplateSpan */); + span.expression = parseExpression(false); + var literal; + if (token === 14 /* CloseBraceToken */) { + reScanTemplateToken(); + literal = parseLiteralNode(); + } + else { + error(ts.Diagnostics.Invalid_template_literal_expected); + literal = createMissingNode(); + literal.text = ""; + } + span.literal = literal; + return finishNode(span); + } function parseLiteralNode(internName) { var node = createNode(token); var text = scanner.getTokenValue(); @@ -3579,30 +3125,31 @@ var ts; return node; } function parseStringLiteral() { - if (token === 7 /* StringLiteral */) + if (token === 7 /* StringLiteral */) { return parseLiteralNode(true); + } error(ts.Diagnostics.String_literal_expected); return createMissingNode(); } function parseTypeReference() { - var node = createNode(128 /* TypeReference */); + var node = createNode(132 /* TypeReference */); node.typeName = parseEntityName(false); - if (!scanner.hasPrecedingLineBreak() && token === 19 /* LessThanToken */) { + if (!scanner.hasPrecedingLineBreak() && token === 23 /* LessThanToken */) { node.typeArguments = parseTypeArguments(); } return finishNode(node); } function parseTypeQuery() { - var node = createNode(129 /* TypeQuery */); - parseExpected(91 /* TypeOfKeyword */); + var node = createNode(133 /* TypeQuery */); + parseExpected(95 /* TypeOfKeyword */); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(118 /* TypeParameter */); + var node = createNode(122 /* TypeParameter */); node.name = parseIdentifier(); - if (parseOptional(73 /* ExtendsKeyword */)) { - if (isType() || !isExpression()) { + if (parseOptional(77 /* ExtendsKeyword */)) { + if (isStartOfType() || !isStartOfExpression()) { node.constraint = parseType(); } else { @@ -3613,9 +3160,9 @@ var ts; return finishNode(node); } function parseTypeParameters() { - if (token === 19 /* LessThanToken */) { + if (token === 23 /* LessThanToken */) { var pos = getNodePos(); - var result = parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 19 /* LessThanToken */, 20 /* GreaterThanToken */); + var result = parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 23 /* LessThanToken */, 24 /* GreaterThanToken */); if (!result.length) { var start = getTokenPos(pos); var length = getNodePos() - start; @@ -3625,23 +3172,23 @@ var ts; } } function parseParameterType() { - return parseOptional(46 /* ColonToken */) ? token === 7 /* StringLiteral */ ? parseStringLiteral() : parseType() : undefined; + return parseOptional(50 /* ColonToken */) ? token === 7 /* StringLiteral */ ? parseStringLiteral() : parseType() : undefined; } - function isParameter() { - return token === 16 /* DotDotDotToken */ || isIdentifier() || isModifier(token); + function isStartOfParameter() { + return token === 20 /* DotDotDotToken */ || isIdentifier() || isModifier(token); } function parseParameter(flags) { if (flags === void 0) { flags = 0; } - var node = createNode(119 /* Parameter */); + var node = createNode(123 /* Parameter */); node.flags |= parseAndCheckModifiers(3 /* Parameters */); - if (parseOptional(16 /* DotDotDotToken */)) { + if (parseOptional(20 /* DotDotDotToken */)) { node.flags |= 8 /* Rest */; } node.name = parseIdentifier(); - if (node.name.kind === 116 /* Missing */ && node.flags === 0 && isModifier(token)) { + if (node.name.kind === 120 /* Missing */ && node.flags === 0 && isModifier(token)) { nextToken(); } - if (parseOptional(45 /* QuestionToken */)) { + if (parseOptional(49 /* QuestionToken */)) { node.flags |= 4 /* QuestionMark */; } node.type = parseParameterType(); @@ -3649,11 +3196,11 @@ var ts; return finishNode(node); } function parseSignature(kind, returnToken, returnTokenRequired) { - if (kind === 126 /* ConstructSignature */) { - parseExpected(82 /* NewKeyword */); + if (kind === 130 /* ConstructSignature */) { + parseExpected(86 /* NewKeyword */); } var typeParameters = parseTypeParameters(); - var parameters = parseParameterList(11 /* OpenParenToken */, 12 /* CloseParenToken */); + var parameters = parseParameterList(15 /* OpenParenToken */, 16 /* CloseParenToken */); checkParameterList(parameters); var type; if (returnTokenRequired) { @@ -3720,10 +3267,10 @@ var ts; return finishNode(node); } function parseIndexSignatureMember() { - var node = createNode(127 /* IndexSignature */); + var node = createNode(131 /* IndexSignature */); var errorCountBeforeIndexSignature = file.syntacticErrors.length; var indexerStart = scanner.getTokenPos(); - node.parameters = parseParameterList(13 /* OpenBracketToken */, 14 /* CloseBracketToken */); + node.parameters = parseParameterList(17 /* OpenBracketToken */, 18 /* CloseBracketToken */); var indexerLength = scanner.getStartPos() - indexerStart; node.type = parseTypeAnnotation(); parseSemicolon(); @@ -3748,7 +3295,7 @@ var ts; grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); return; } - else if (parameter.flags & ts.NodeFlags.Modifier) { + else if (parameter.flags & 243 /* Modifier */) { grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); return; } @@ -3764,7 +3311,7 @@ var ts; grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); return; } - else if (parameter.type.kind !== 114 /* StringKeyword */ && parameter.type.kind !== 112 /* NumberKeyword */) { + 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; } @@ -3776,58 +3323,58 @@ var ts; function parsePropertyOrMethod() { var node = createNode(0 /* Unknown */); node.name = parsePropertyName(); - if (parseOptional(45 /* QuestionToken */)) { + if (parseOptional(49 /* QuestionToken */)) { node.flags |= 4 /* QuestionMark */; } - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - node.kind = 121 /* Method */; - var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + node.kind = 125 /* Method */; + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; } else { - node.kind = 120 /* Property */; + node.kind = 124 /* Property */; node.type = parseTypeAnnotation(); } parseSemicolon(); return finishNode(node); } - function isTypeMember() { + function isStartOfTypeMember() { switch (token) { - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - case 13 /* OpenBracketToken */: + case 15 /* OpenParenToken */: + case 23 /* LessThanToken */: + case 17 /* OpenBracketToken */: return true; default: - return isPropertyName() && lookAhead(function () { return nextToken() === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */ || token === 45 /* QuestionToken */ || token === 46 /* ColonToken */ || canParseSemicolon(); }); + return isPropertyName() && lookAhead(function () { return nextToken() === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */ || token === 49 /* QuestionToken */ || token === 50 /* ColonToken */ || canParseSemicolon(); }); } } function parseTypeMember() { switch (token) { - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - return parseSignatureMember(125 /* CallSignature */, 46 /* ColonToken */); - case 13 /* OpenBracketToken */: + case 15 /* OpenParenToken */: + case 23 /* LessThanToken */: + return parseSignatureMember(129 /* CallSignature */, 50 /* ColonToken */); + case 17 /* OpenBracketToken */: return parseIndexSignatureMember(); - case 82 /* NewKeyword */: - if (lookAhead(function () { return nextToken() === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */; })) { - return parseSignatureMember(126 /* ConstructSignature */, 46 /* ColonToken */); + case 86 /* NewKeyword */: + if (lookAhead(function () { return nextToken() === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */; })) { + return parseSignatureMember(130 /* ConstructSignature */, 50 /* ColonToken */); } case 7 /* StringLiteral */: case 6 /* NumericLiteral */: return parsePropertyOrMethod(); default: - if (token >= 59 /* Identifier */) { + if (token >= 63 /* Identifier */) { return parsePropertyOrMethod(); } } } function parseTypeLiteral() { - var node = createNode(130 /* TypeLiteral */); - if (parseExpected(9 /* OpenBraceToken */)) { + var node = createNode(134 /* TypeLiteral */); + if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseList(5 /* TypeMembers */, false, parseTypeMember); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -3835,26 +3382,26 @@ var ts; return finishNode(node); } function parseTupleType() { - var node = createNode(132 /* TupleType */); + var node = createNode(136 /* TupleType */); var startTokenPos = scanner.getTokenPos(); var startErrorCount = file.syntacticErrors.length; - node.elementTypes = parseBracketedList(16 /* TupleElementTypes */, parseType, 13 /* OpenBracketToken */, 14 /* CloseBracketToken */); + 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(134 /* ParenType */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(138 /* ParenType */); + parseExpected(15 /* OpenParenToken */); node.type = parseType(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); return finishNode(node); } function parseFunctionType(signatureKind) { - var node = createNode(130 /* TypeLiteral */); + var node = createNode(134 /* TypeLiteral */); var member = createNode(signatureKind); - var sig = parseSignature(signatureKind, 27 /* EqualsGreaterThanToken */, true); + var sig = parseSignature(signatureKind, 31 /* EqualsGreaterThanToken */, true); member.typeParameters = sig.typeParameters; member.parameters = sig.parameters; member.type = sig.type; @@ -3864,24 +3411,24 @@ var ts; } function parseKeywordAndNoDot() { var node = parseTokenNode(); - return token === 15 /* DotToken */ ? undefined : node; + return token === 19 /* DotToken */ ? undefined : node; } function parseNonArrayType() { switch (token) { - case 105 /* AnyKeyword */: - case 114 /* StringKeyword */: - case 112 /* NumberKeyword */: - case 106 /* BooleanKeyword */: - case 93 /* VoidKeyword */: + case 109 /* AnyKeyword */: + case 118 /* StringKeyword */: + case 116 /* NumberKeyword */: + case 110 /* BooleanKeyword */: + case 97 /* VoidKeyword */: var node = tryParse(parseKeywordAndNoDot); return node || parseTypeReference(); - case 91 /* TypeOfKeyword */: + case 95 /* TypeOfKeyword */: return parseTypeQuery(); - case 9 /* OpenBraceToken */: + case 13 /* OpenBraceToken */: return parseTypeLiteral(); - case 13 /* OpenBracketToken */: + case 17 /* OpenBracketToken */: return parseTupleType(); - case 11 /* OpenParenToken */: + case 15 /* OpenParenToken */: return parseParenType(); default: if (isIdentifier()) { @@ -3891,23 +3438,23 @@ var ts; error(ts.Diagnostics.Type_expected); return createMissingNode(); } - function isType() { + function isStartOfType() { switch (token) { - case 105 /* AnyKeyword */: - case 114 /* StringKeyword */: - case 112 /* NumberKeyword */: - case 106 /* BooleanKeyword */: - case 93 /* VoidKeyword */: - case 91 /* TypeOfKeyword */: - case 9 /* OpenBraceToken */: - case 13 /* OpenBracketToken */: - case 19 /* LessThanToken */: - case 82 /* NewKeyword */: + case 109 /* AnyKeyword */: + case 118 /* StringKeyword */: + case 116 /* NumberKeyword */: + case 110 /* BooleanKeyword */: + case 97 /* VoidKeyword */: + case 95 /* TypeOfKeyword */: + case 13 /* OpenBraceToken */: + case 17 /* OpenBracketToken */: + case 23 /* LessThanToken */: + case 86 /* NewKeyword */: return true; - case 11 /* OpenParenToken */: + case 15 /* OpenParenToken */: return lookAhead(function () { nextToken(); - return token === 12 /* CloseParenToken */ || isParameter() || isType(); + return token === 16 /* CloseParenToken */ || isStartOfParameter() || isStartOfType(); }); default: return isIdentifier(); @@ -3915,9 +3462,9 @@ var ts; } function parsePrimaryType() { var type = parseNonArrayType(); - while (!scanner.hasPrecedingLineBreak() && parseOptional(13 /* OpenBracketToken */)) { - parseExpected(14 /* CloseBracketToken */); - var node = createNode(131 /* ArrayType */, type.pos); + while (!scanner.hasPrecedingLineBreak() && parseOptional(17 /* OpenBracketToken */)) { + parseExpected(18 /* CloseBracketToken */); + var node = createNode(135 /* ArrayType */, type.pos); node.elementType = type; type = finishNode(node); } @@ -3925,33 +3472,33 @@ var ts; } function parseUnionType() { var type = parsePrimaryType(); - if (token === 39 /* BarToken */) { + if (token === 43 /* BarToken */) { var types = [type]; types.pos = type.pos; - while (parseOptional(39 /* BarToken */)) { + while (parseOptional(43 /* BarToken */)) { types.push(parsePrimaryType()); } types.end = getNodeEnd(); - var node = createNode(133 /* UnionType */, type.pos); + var node = createNode(137 /* UnionType */, type.pos); node.types = types; type = finishNode(node); } return type; } - function isFunctionType() { - return token === 19 /* LessThanToken */ || token === 11 /* OpenParenToken */ && lookAhead(function () { + function isStartOfFunctionType() { + return token === 23 /* LessThanToken */ || token === 15 /* OpenParenToken */ && lookAhead(function () { nextToken(); - if (token === 12 /* CloseParenToken */ || token === 16 /* DotDotDotToken */) { + if (token === 16 /* CloseParenToken */ || token === 20 /* DotDotDotToken */) { return true; } if (isIdentifier() || isModifier(token)) { nextToken(); - if (token === 46 /* ColonToken */ || token === 18 /* CommaToken */ || token === 45 /* QuestionToken */ || token === 47 /* EqualsToken */ || isIdentifier() || isModifier(token)) { + if (token === 50 /* ColonToken */ || token === 22 /* CommaToken */ || token === 49 /* QuestionToken */ || token === 51 /* EqualsToken */ || isIdentifier() || isModifier(token)) { return true; } - if (token === 12 /* CloseParenToken */) { + if (token === 16 /* CloseParenToken */) { nextToken(); - if (token === 27 /* EqualsGreaterThanToken */) { + if (token === 31 /* EqualsGreaterThanToken */) { return true; } } @@ -3960,66 +3507,68 @@ var ts; }); } function parseType() { - if (isFunctionType()) { - return parseFunctionType(125 /* CallSignature */); + if (isStartOfFunctionType()) { + return parseFunctionType(129 /* CallSignature */); } - if (token === 82 /* NewKeyword */) { - return parseFunctionType(126 /* ConstructSignature */); + if (token === 86 /* NewKeyword */) { + return parseFunctionType(130 /* ConstructSignature */); } return parseUnionType(); } function parseTypeAnnotation() { - return parseOptional(46 /* ColonToken */) ? parseType() : undefined; + return parseOptional(50 /* ColonToken */) ? parseType() : undefined; } - function isExpression() { + function isStartOfExpression() { switch (token) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: + case 87 /* NullKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: case 6 /* NumericLiteral */: case 7 /* StringLiteral */: - case 11 /* OpenParenToken */: - case 13 /* OpenBracketToken */: - case 9 /* OpenBraceToken */: - case 77 /* FunctionKeyword */: - case 82 /* NewKeyword */: - case 31 /* SlashToken */: - case 51 /* SlashEqualsToken */: - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: - case 41 /* ExclamationToken */: - case 68 /* DeleteKeyword */: - case 91 /* TypeOfKeyword */: - case 93 /* VoidKeyword */: - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: - case 19 /* LessThanToken */: - case 59 /* Identifier */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 10 /* TemplateHead */: + case 15 /* OpenParenToken */: + case 17 /* OpenBracketToken */: + case 13 /* OpenBraceToken */: + case 81 /* FunctionKeyword */: + case 86 /* NewKeyword */: + case 35 /* SlashToken */: + case 55 /* SlashEqualsToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: + case 45 /* ExclamationToken */: + case 72 /* DeleteKeyword */: + case 95 /* TypeOfKeyword */: + case 97 /* VoidKeyword */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: + case 23 /* LessThanToken */: + case 63 /* Identifier */: return true; default: return isIdentifier(); } } - function isExpressionStatement() { - return token !== 9 /* OpenBraceToken */ && token !== 77 /* FunctionKeyword */ && isExpression(); + function isStartOfExpressionStatement() { + return token !== 13 /* OpenBraceToken */ && token !== 81 /* FunctionKeyword */ && isStartOfExpression(); } function parseExpression(noIn) { var expr = parseAssignmentExpression(noIn); - while (parseOptional(18 /* CommaToken */)) { - expr = makeBinaryExpression(expr, 18 /* CommaToken */, parseAssignmentExpression(noIn)); + while (parseOptional(22 /* CommaToken */)) { + expr = makeBinaryExpression(expr, 22 /* CommaToken */, parseAssignmentExpression(noIn)); } return expr; } function parseInitializer(inParameter, noIn) { - if (token !== 47 /* EqualsToken */) { - if (scanner.hasPrecedingLineBreak() || (inParameter && token === 9 /* OpenBraceToken */) || !isExpression()) { + if (token !== 51 /* EqualsToken */) { + if (scanner.hasPrecedingLineBreak() || (inParameter && token === 13 /* OpenBraceToken */) || !isStartOfExpression()) { return undefined; } } - parseExpected(47 /* EqualsToken */); + parseExpected(51 /* EqualsToken */); return parseAssignmentExpression(noIn); } function parseAssignmentExpression(noIn) { @@ -4028,7 +3577,7 @@ var ts; return arrowExpression; } var expr = parseConditionalExpression(noIn); - if (expr.kind === 59 /* Identifier */ && token === 27 /* EqualsGreaterThanToken */) { + if (expr.kind === 63 /* Identifier */ && token === 31 /* EqualsGreaterThanToken */) { return parseSimpleArrowFunctionExpression(expr); } if (isLeftHandSideExpression(expr) && isAssignmentOperator()) { @@ -4044,33 +3593,36 @@ var ts; function isLeftHandSideExpression(expr) { if (expr) { switch (expr.kind) { - case 138 /* PropertyAccess */: - case 139 /* IndexedAccess */: - case 141 /* NewExpression */: - case 140 /* CallExpression */: - case 135 /* ArrayLiteral */: - case 143 /* ParenExpression */: - case 136 /* ObjectLiteral */: - case 144 /* FunctionExpression */: - case 59 /* Identifier */: - case 116 /* Missing */: + 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 74 /* FalseKeyword */: - case 83 /* NullKeyword */: - case 87 /* ThisKeyword */: - case 89 /* TrueKeyword */: - case 85 /* SuperKeyword */: + 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 === 27 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - parseExpected(27 /* EqualsGreaterThanToken */); - var parameter = createNode(119 /* Parameter */, identifier.pos); + ts.Debug.assert(token === 31 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); + parseExpected(31 /* EqualsGreaterThanToken */); + var parameter = createNode(123 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); var parameters = []; @@ -4087,17 +3639,17 @@ var ts; } var pos = getNodePos(); if (triState === 1 /* True */) { - var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); - if (parseExpected(27 /* EqualsGreaterThanToken */) || token === 9 /* OpenBraceToken */) { + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); + if (parseExpected(31 /* EqualsGreaterThanToken */) || token === 13 /* OpenBraceToken */) { return parseArrowExpressionTail(pos, sig, false); } else { - return makeFunctionExpression(145 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); + return makeFunctionExpression(150 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); } } var sig = tryParseSignatureIfArrowOrBraceFollows(); if (sig) { - parseExpected(27 /* EqualsGreaterThanToken */); + parseExpected(31 /* EqualsGreaterThanToken */); return parseArrowExpressionTail(pos, sig, false); } else { @@ -4105,35 +3657,35 @@ var ts; } } function isParenthesizedArrowFunctionExpression() { - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { return lookAhead(function () { var first = token; var second = nextToken(); - if (first === 11 /* OpenParenToken */) { - if (second === 12 /* CloseParenToken */) { + if (first === 15 /* OpenParenToken */) { + if (second === 16 /* CloseParenToken */) { var third = nextToken(); switch (third) { - case 27 /* EqualsGreaterThanToken */: - case 46 /* ColonToken */: - case 9 /* OpenBraceToken */: + case 31 /* EqualsGreaterThanToken */: + case 50 /* ColonToken */: + case 13 /* OpenBraceToken */: return 1 /* True */; default: return 0 /* False */; } } - if (second === 16 /* DotDotDotToken */) { + if (second === 20 /* DotDotDotToken */) { return 1 /* True */; } if (!isIdentifier()) { return 0 /* False */; } - if (nextToken() === 46 /* ColonToken */) { + if (nextToken() === 50 /* ColonToken */) { return 1 /* True */; } return 2 /* Unknown */; } else { - ts.Debug.assert(first === 19 /* LessThanToken */); + ts.Debug.assert(first === 23 /* LessThanToken */); if (!isIdentifier()) { return 0 /* False */; } @@ -4141,15 +3693,15 @@ var ts; } }); } - if (token === 27 /* EqualsGreaterThanToken */) { + if (token === 31 /* EqualsGreaterThanToken */) { return 1 /* True */; } return 0 /* False */; } function tryParseSignatureIfArrowOrBraceFollows() { return tryParse(function () { - var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); - if (token === 27 /* EqualsGreaterThanToken */ || token === 9 /* OpenBraceToken */) { + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); + if (token === 31 /* EqualsGreaterThanToken */ || token === 13 /* OpenBraceToken */) { return sig; } return undefined; @@ -4157,27 +3709,27 @@ var ts; } function parseArrowExpressionTail(pos, sig, noIn) { var body; - if (token === 9 /* OpenBraceToken */) { + if (token === 13 /* OpenBraceToken */) { body = parseBody(false); } - else if (isStatement(true) && !isExpressionStatement() && token !== 77 /* FunctionKeyword */) { + else if (isStatement(true) && !isStartOfExpressionStatement() && token !== 81 /* FunctionKeyword */) { body = parseBody(true); } else { body = parseAssignmentExpression(noIn); } - return makeFunctionExpression(145 /* ArrowFunction */, pos, undefined, sig, body); + return makeFunctionExpression(150 /* ArrowFunction */, pos, undefined, sig, body); } function isAssignmentOperator() { - return token >= ts.SyntaxKind.FirstAssignment && token <= ts.SyntaxKind.LastAssignment; + return token >= 51 /* FirstAssignment */ && token <= 62 /* LastAssignment */; } function parseConditionalExpression(noIn) { var expr = parseBinaryExpression(noIn); - while (parseOptional(45 /* QuestionToken */)) { - var node = createNode(149 /* ConditionalExpression */, expr.pos); + while (parseOptional(49 /* QuestionToken */)) { + var node = createNode(154 /* ConditionalExpression */, expr.pos); node.condition = expr; node.whenTrue = parseAssignmentExpression(false); - parseExpected(46 /* ColonToken */); + parseExpected(50 /* ColonToken */); node.whenFalse = parseAssignmentExpression(noIn); expr = finishNode(node); } @@ -4190,7 +3742,7 @@ var ts; while (true) { reScanGreaterToken(); var precedence = getOperatorPrecedence(); - if (precedence && precedence > minPrecedence && (!noIn || token !== 80 /* InKeyword */)) { + if (precedence && precedence > minPrecedence && (!noIn || token !== 84 /* InKeyword */)) { var operator = token; nextToken(); expr = makeBinaryExpression(expr, operator, parseBinaryOperators(parseUnaryExpression(), precedence, noIn)); @@ -4201,44 +3753,44 @@ var ts; } function getOperatorPrecedence() { switch (token) { - case 44 /* BarBarToken */: + case 48 /* BarBarToken */: return 1; - case 43 /* AmpersandAmpersandToken */: + case 47 /* AmpersandAmpersandToken */: return 2; - case 39 /* BarToken */: + case 43 /* BarToken */: return 3; - case 40 /* CaretToken */: + case 44 /* CaretToken */: return 4; - case 38 /* AmpersandToken */: + case 42 /* AmpersandToken */: return 5; - case 23 /* EqualsEqualsToken */: - case 24 /* ExclamationEqualsToken */: - case 25 /* EqualsEqualsEqualsToken */: - case 26 /* ExclamationEqualsEqualsToken */: + case 27 /* EqualsEqualsToken */: + case 28 /* ExclamationEqualsToken */: + case 29 /* EqualsEqualsEqualsToken */: + case 30 /* ExclamationEqualsEqualsToken */: return 6; - case 19 /* LessThanToken */: - case 20 /* GreaterThanToken */: - case 21 /* LessThanEqualsToken */: - case 22 /* GreaterThanEqualsToken */: - case 81 /* InstanceOfKeyword */: - case 80 /* InKeyword */: + case 23 /* LessThanToken */: + case 24 /* GreaterThanToken */: + case 25 /* LessThanEqualsToken */: + case 26 /* GreaterThanEqualsToken */: + case 85 /* InstanceOfKeyword */: + case 84 /* InKeyword */: return 7; - case 35 /* LessThanLessThanToken */: - case 36 /* GreaterThanGreaterThanToken */: - case 37 /* GreaterThanGreaterThanGreaterThanToken */: + case 39 /* LessThanLessThanToken */: + case 40 /* GreaterThanGreaterThanToken */: + case 41 /* GreaterThanGreaterThanGreaterThanToken */: return 8; - case 28 /* PlusToken */: - case 29 /* MinusToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: return 9; - case 30 /* AsteriskToken */: - case 31 /* SlashToken */: - case 32 /* PercentToken */: + case 34 /* AsteriskToken */: + case 35 /* SlashToken */: + case 36 /* PercentToken */: return 10; } return undefined; } function makeBinaryExpression(left, operator, right) { - var node = createNode(148 /* BinaryExpression */, left.pos); + var node = createNode(153 /* BinaryExpression */, left.pos); node.left = left; node.operator = operator; node.right = right; @@ -4247,52 +3799,52 @@ var ts; function parseUnaryExpression() { var pos = getNodePos(); switch (token) { - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: - case 41 /* ExclamationToken */: - case 68 /* DeleteKeyword */: - case 91 /* TypeOfKeyword */: - case 93 /* VoidKeyword */: - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: + case 45 /* ExclamationToken */: + case 72 /* DeleteKeyword */: + case 95 /* TypeOfKeyword */: + case 97 /* VoidKeyword */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: var operator = token; nextToken(); var operand = parseUnaryExpression(); if (isInStrictMode) { - if ((operator === 33 /* PlusPlusToken */ || operator === 34 /* MinusMinusToken */) && isEvalOrArgumentsIdentifier(operand)) { + if ((operator === 37 /* PlusPlusToken */ || operator === 38 /* MinusMinusToken */) && isEvalOrArgumentsIdentifier(operand)) { reportInvalidUseInStrictMode(operand); } - else if (operator === 68 /* DeleteKeyword */ && operand.kind === 59 /* Identifier */) { + 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(146 /* PrefixOperator */, pos, operator, operand); - case 19 /* LessThanToken */: + return makeUnaryExpression(151 /* PrefixOperator */, pos, operator, operand); + case 23 /* LessThanToken */: return parseTypeAssertion(); } var primaryExpression = parsePrimaryExpression(); - var illegalUsageOfSuperKeyword = primaryExpression.kind === 85 /* SuperKeyword */ && token !== 11 /* OpenParenToken */ && token !== 15 /* DotToken */; + var illegalUsageOfSuperKeyword = primaryExpression.kind === 89 /* SuperKeyword */ && token !== 15 /* OpenParenToken */ && token !== 19 /* DotToken */; if (illegalUsageOfSuperKeyword) { error(ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); } var expr = parseCallAndAccess(primaryExpression, false); ts.Debug.assert(isLeftHandSideExpression(expr)); - if ((token === 33 /* PlusPlusToken */ || token === 34 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { + if ((token === 37 /* PlusPlusToken */ || token === 38 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { reportInvalidUseInStrictMode(expr); } var operator = token; nextToken(); - expr = makeUnaryExpression(147 /* PostfixOperator */, expr.pos, operator, expr); + expr = makeUnaryExpression(152 /* PostfixOperator */, expr.pos, operator, expr); } return expr; } function parseTypeAssertion() { - var node = createNode(142 /* TypeAssertion */); - parseExpected(19 /* LessThanToken */); + var node = createNode(147 /* TypeAssertion */); + parseExpected(23 /* LessThanToken */); node.type = parseType(); - parseExpected(20 /* GreaterThanToken */); + parseExpected(24 /* GreaterThanToken */); node.operand = parseUnaryExpression(); return finishNode(node); } @@ -4304,11 +3856,11 @@ var ts; } function parseCallAndAccess(expr, inNewExpression) { while (true) { - var dotStart = scanner.getTokenPos(); - if (parseOptional(15 /* DotToken */)) { - var propertyAccess = createNode(138 /* PropertyAccess */, expr.pos); + 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(dotStart, scanner.getStartPos() - dotStart, ts.Diagnostics.Identifier_expected); + grammarErrorAtPos(dotOrBracketStart, scanner.getStartPos() - dotOrBracketStart, ts.Diagnostics.Identifier_expected); var id = createMissingNode(); } else { @@ -4319,13 +3871,12 @@ var ts; expr = finishNode(propertyAccess); continue; } - var bracketStart = scanner.getTokenPos(); - if (parseOptional(13 /* OpenBracketToken */)) { - var indexedAccess = createNode(139 /* IndexedAccess */, expr.pos); + if (parseOptional(17 /* OpenBracketToken */)) { + var indexedAccess = createNode(143 /* IndexedAccess */, expr.pos); indexedAccess.object = expr; - if (inNewExpression && parseOptional(14 /* CloseBracketToken */)) { + if (inNewExpression && parseOptional(18 /* CloseBracketToken */)) { indexedAccess.index = createMissingNode(); - grammarErrorAtPos(bracketStart, scanner.getStartPos() - bracketStart, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); + 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(); @@ -4333,79 +3884,92 @@ var ts; var literal = indexedAccess.index; literal.text = internIdentifier(literal.text); } - parseExpected(14 /* CloseBracketToken */); + parseExpected(18 /* CloseBracketToken */); } expr = finishNode(indexedAccess); continue; } - if ((token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) && !inNewExpression) { - var callExpr = createNode(140 /* CallExpression */, expr.pos); + if ((token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) && !inNewExpression) { + var callExpr = createNode(144 /* CallExpression */, expr.pos); callExpr.func = expr; - if (token === 19 /* LessThanToken */) { + if (token === 23 /* LessThanToken */) { if (!(callExpr.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) return expr; } else { - parseExpected(11 /* OpenParenToken */); + parseExpected(15 /* OpenParenToken */); } callExpr.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression, false); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); expr = finishNode(callExpr); continue; } + if (token === 9 /* NoSubstitutionTemplateLiteral */ || token === 10 /* TemplateHead */) { + var tagExpression = createNode(146 /* 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; } } function parseTypeArgumentsAndOpenParen() { var result = parseTypeArguments(); - parseExpected(11 /* OpenParenToken */); + parseExpected(15 /* OpenParenToken */); return result; } function parseTypeArguments() { var typeArgumentListStart = scanner.getTokenPos(); var errorCountBeforeTypeParameterList = file.syntacticErrors.length; - var result = parseBracketedList(15 /* TypeArguments */, parseSingleTypeArgument, 19 /* LessThanToken */, 20 /* GreaterThanToken */); + 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; } function parseSingleTypeArgument() { - if (token === 18 /* CommaToken */) { + if (token === 22 /* CommaToken */) { var errorStart = scanner.getTokenPos(); var errorLength = scanner.getTextPos() - errorStart; grammarErrorAtPos(errorStart, errorLength, ts.Diagnostics.Type_expected); - return createNode(116 /* Missing */); + return createNode(120 /* Missing */); } return parseType(); } function parsePrimaryExpression() { switch (token) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: + case 87 /* NullKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: return parseTokenNode(); case 6 /* NumericLiteral */: case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: return parseLiteralNode(); - case 11 /* OpenParenToken */: + case 15 /* OpenParenToken */: return parseParenExpression(); - case 13 /* OpenBracketToken */: + case 17 /* OpenBracketToken */: return parseArrayLiteral(); - case 9 /* OpenBraceToken */: + case 13 /* OpenBraceToken */: return parseObjectLiteral(); - case 77 /* FunctionKeyword */: + case 81 /* FunctionKeyword */: return parseFunctionExpression(); - case 82 /* NewKeyword */: + case 86 /* NewKeyword */: return parseNewExpression(); - case 31 /* SlashToken */: - case 51 /* SlashEqualsToken */: + case 35 /* SlashToken */: + case 55 /* SlashEqualsToken */: if (reScanSlashToken() === 8 /* RegularExpressionLiteral */) { return parseLiteralNode(); } break; + case 10 /* TemplateHead */: + return parseTemplateExpression(); default: if (isIdentifier()) { return parseIdentifier(); @@ -4415,20 +3979,20 @@ var ts; return createMissingNode(); } function parseParenExpression() { - var node = createNode(143 /* ParenExpression */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(148 /* ParenExpression */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); return finishNode(node); } function parseAssignmentExpressionOrOmittedExpression(omittedExpressionDiagnostic) { - if (token === 18 /* CommaToken */) { + if (token === 22 /* CommaToken */) { if (omittedExpressionDiagnostic) { var errorStart = scanner.getTokenPos(); var errorLength = scanner.getTextPos() - errorStart; grammarErrorAtPos(errorStart, errorLength, omittedExpressionDiagnostic); } - return createNode(150 /* OmittedExpression */); + return createNode(157 /* OmittedExpression */); } return parseAssignmentExpression(); } @@ -4439,24 +4003,24 @@ var ts; return parseAssignmentExpressionOrOmittedExpression(ts.Diagnostics.Argument_expression_expected); } function parseArrayLiteral() { - var node = createNode(135 /* ArrayLiteral */); - parseExpected(13 /* OpenBracketToken */); + var node = createNode(139 /* ArrayLiteral */); + parseExpected(17 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) node.flags |= 256 /* MultiLine */; node.elements = parseDelimitedList(12 /* ArrayLiteralMembers */, parseArrayLiteralElement, true); - parseExpected(14 /* CloseBracketToken */); + parseExpected(18 /* CloseBracketToken */); return finishNode(node); } function parsePropertyAssignment() { - var node = createNode(137 /* PropertyAssignment */); + var node = createNode(141 /* PropertyAssignment */); node.name = parsePropertyName(); - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); var body = parseBody(false); - node.initializer = makeFunctionExpression(144 /* FunctionExpression */, node.pos, undefined, sig, body); + node.initializer = makeFunctionExpression(149 /* FunctionExpression */, node.pos, undefined, sig, body); } else { - parseExpected(46 /* ColonToken */); + parseExpected(50 /* ColonToken */); node.initializer = parseAssignmentExpression(false); } return finishNode(node); @@ -4464,41 +4028,41 @@ var ts; function parseObjectLiteralMember() { var initialPos = getNodePos(); var initialToken = token; - if (parseContextualModifier(109 /* GetKeyword */) || parseContextualModifier(113 /* SetKeyword */)) { - var kind = initialToken === 109 /* GetKeyword */ ? 123 /* GetAccessor */ : 124 /* SetAccessor */; + if (parseContextualModifier(113 /* GetKeyword */) || parseContextualModifier(117 /* SetKeyword */)) { + var kind = initialToken === 113 /* GetKeyword */ ? 127 /* GetAccessor */ : 128 /* SetAccessor */; return parseAndCheckMemberAccessorDeclaration(kind, initialPos, 0); } return parsePropertyAssignment(); } function parseObjectLiteral() { - var node = createNode(136 /* ObjectLiteral */); - parseExpected(9 /* OpenBraceToken */); + var node = createNode(140 /* ObjectLiteral */); + parseExpected(13 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.flags |= 256 /* MultiLine */; } node.properties = parseDelimitedList(11 /* ObjectLiteralMembers */, parseObjectLiteralMember, true); - parseExpected(10 /* CloseBraceToken */); + 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 === 150 /* OmittedExpression */) { + if (p.kind === 157 /* OmittedExpression */) { return; } var currentKind; - if (p.kind === 137 /* PropertyAssignment */) { + if (p.kind === 141 /* PropertyAssignment */) { currentKind = Property; } - else if (p.kind === 123 /* GetAccessor */) { + else if (p.kind === 127 /* GetAccessor */) { currentKind = GetAccessor; } - else if (p.kind === 124 /* SetAccessor */) { + else if (p.kind === 128 /* SetAccessor */) { currentKind = SetAccesor; } else { - ts.Debug.fail("Unexpected syntax kind:" + ts.SyntaxKind[p.kind]); + ts.Debug.fail("Unexpected syntax kind:" + p.kind); } if (!ts.hasProperty(seen, p.name.text)) { seen[p.name.text] = currentKind; @@ -4527,14 +4091,14 @@ var ts; } function parseFunctionExpression() { var pos = getNodePos(); - parseExpected(77 /* FunctionKeyword */); + parseExpected(81 /* FunctionKeyword */); var name = isIdentifier() ? parseIdentifier() : undefined; - var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); var body = parseBody(false); if (name && isInStrictMode && isEvalOrArgumentsIdentifier(name)) { reportInvalidUseInStrictMode(name); } - return makeFunctionExpression(144 /* FunctionExpression */, pos, name, sig, body); + return makeFunctionExpression(149 /* FunctionExpression */, pos, name, sig, body); } function makeFunctionExpression(kind, pos, name, sig, body) { var node = createNode(kind, pos); @@ -4546,12 +4110,12 @@ var ts; return finishNode(node); } function parseNewExpression() { - var node = createNode(141 /* NewExpression */); - parseExpected(82 /* NewKeyword */); + var node = createNode(145 /* NewExpression */); + parseExpected(86 /* NewKeyword */); node.func = parseCallAndAccess(parsePrimaryExpression(), true); - if (parseOptional(11 /* OpenParenToken */) || token === 19 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { + if (parseOptional(15 /* OpenParenToken */) || token === 23 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { node.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression, false); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); } return finishNode(node); } @@ -4559,10 +4123,10 @@ var ts; return parseStatement(true); } function parseBlock(ignoreMissingOpenBrace, checkForStrictMode) { - var node = createNode(151 /* Block */); - if (parseExpected(9 /* OpenBraceToken */) || ignoreMissingOpenBrace) { + var node = createNode(158 /* Block */); + if (parseExpected(13 /* OpenBraceToken */) || ignoreMissingOpenBrace) { node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatementAllowingLetDeclaration); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.statements = createMissingList(); @@ -4582,7 +4146,7 @@ var ts; } labelledStatementInfo.pushFunctionBoundary(); var block = parseBlock(ignoreMissingOpenBrace, true); - block.kind = 176 /* FunctionBlock */; + block.kind = 183 /* FunctionBlock */; labelledStatementInfo.pop(); inFunctionBody = saveInFunctionBody; inSwitchStatement = saveInSwitchStatement; @@ -4590,40 +4154,40 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(153 /* EmptyStatement */); - parseExpected(17 /* SemicolonToken */); + var node = createNode(160 /* EmptyStatement */); + parseExpected(21 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(155 /* IfStatement */); - parseExpected(78 /* IfKeyword */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(162 /* IfStatement */); + parseExpected(82 /* IfKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); node.thenStatement = parseStatement(false); - node.elseStatement = parseOptional(70 /* ElseKeyword */) ? parseStatement(false) : undefined; + node.elseStatement = parseOptional(74 /* ElseKeyword */) ? parseStatement(false) : undefined; return finishNode(node); } function parseDoStatement() { - var node = createNode(156 /* DoStatement */); - parseExpected(69 /* DoKeyword */); + var node = createNode(163 /* DoStatement */); + parseExpected(73 /* DoKeyword */); var saveInIterationStatement = inIterationStatement; inIterationStatement = 1 /* Nested */; node.statement = parseStatement(false); inIterationStatement = saveInIterationStatement; - parseExpected(94 /* WhileKeyword */); - parseExpected(11 /* OpenParenToken */); + parseExpected(98 /* WhileKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - parseOptional(17 /* SemicolonToken */); + parseExpected(16 /* CloseParenToken */); + parseOptional(21 /* SemicolonToken */); return finishNode(node); } function parseWhileStatement() { - var node = createNode(157 /* WhileStatement */); - parseExpected(94 /* WhileKeyword */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(164 /* WhileStatement */); + parseExpected(98 /* WhileKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); var saveInIterationStatement = inIterationStatement; inIterationStatement = 1 /* Nested */; node.statement = parseStatement(false); @@ -4632,16 +4196,16 @@ var ts; } function parseForOrForInStatement() { var pos = getNodePos(); - parseExpected(76 /* ForKeyword */); - parseExpected(11 /* OpenParenToken */); - if (token !== 17 /* SemicolonToken */) { - if (parseOptional(92 /* VarKeyword */)) { + parseExpected(80 /* ForKeyword */); + parseExpected(15 /* OpenParenToken */); + 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(98 /* LetKeyword */)) { + else if (parseOptional(102 /* LetKeyword */)) { var declarations = parseVariableDeclarationList(2048 /* Let */, true); if (!declarations.length) { error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); @@ -4650,7 +4214,7 @@ var ts; grammarErrorAtPos(declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher); } } - else if (parseOptional(64 /* ConstKeyword */)) { + else if (parseOptional(68 /* ConstKeyword */)) { var declarations = parseVariableDeclarationList(4096 /* Const */, true); if (!declarations.length) { error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); @@ -4664,8 +4228,8 @@ var ts; } } var forOrForInStatement; - if (parseOptional(80 /* InKeyword */)) { - var forInStatement = createNode(159 /* ForInStatement */, pos); + if (parseOptional(84 /* InKeyword */)) { + var forInStatement = createNode(166 /* ForInStatement */, pos); if (declarations) { if (declarations.length > 1) { error(ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); @@ -4676,24 +4240,24 @@ var ts; forInStatement.variable = varOrInit; } forInStatement.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); forOrForInStatement = forInStatement; } else { - var forStatement = createNode(158 /* ForStatement */, pos); + var forStatement = createNode(165 /* ForStatement */, pos); if (declarations) forStatement.declarations = declarations; if (varOrInit) forStatement.initializer = varOrInit; - parseExpected(17 /* SemicolonToken */); - if (token !== 17 /* SemicolonToken */ && token !== 12 /* CloseParenToken */) { + parseExpected(21 /* SemicolonToken */); + if (token !== 21 /* SemicolonToken */ && token !== 16 /* CloseParenToken */) { forStatement.condition = parseExpression(); } - parseExpected(17 /* SemicolonToken */); - if (token !== 12 /* CloseParenToken */) { + parseExpected(21 /* SemicolonToken */); + if (token !== 16 /* CloseParenToken */) { forStatement.iterator = parseExpression(); } - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); forOrForInStatement = forStatement; } var saveInIterationStatement = inIterationStatement; @@ -4705,7 +4269,7 @@ var ts; function parseBreakOrContinueStatement(kind) { var node = createNode(kind); var errorCountBeforeStatement = file.syntacticErrors.length; - parseExpected(kind === 161 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */); + parseExpected(kind === 168 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */); if (!canParseSemicolon()) node.label = parseIdentifier(); parseSemicolon(); @@ -4721,7 +4285,7 @@ var ts; return node; } function checkBareBreakOrContinueStatement(node) { - if (node.kind === 161 /* BreakStatement */) { + if (node.kind === 168 /* BreakStatement */) { if (inIterationStatement === 1 /* Nested */ || inSwitchStatement === 1 /* Nested */) { return; } @@ -4730,7 +4294,7 @@ var ts; return; } } - else if (node.kind === 160 /* ContinueStatement */) { + else if (node.kind === 167 /* ContinueStatement */) { if (inIterationStatement === 1 /* Nested */) { return; } @@ -4746,7 +4310,7 @@ var ts; grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } function checkBreakOrContinueStatementWithLabel(node) { - var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, node.kind === 160 /* ContinueStatement */, false); + var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, node.kind === 167 /* ContinueStatement */, false); if (nodeIsNestedInLabel === 1 /* Nested */) { return; } @@ -4754,10 +4318,10 @@ var ts; grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); return; } - if (node.kind === 160 /* ContinueStatement */) { + 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 === 161 /* BreakStatement */) { + else if (node.kind === 168 /* BreakStatement */) { grammarErrorOnNode(node, ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement); } else { @@ -4765,11 +4329,11 @@ var ts; } } function parseReturnStatement() { - var node = createNode(162 /* ReturnStatement */); + var node = createNode(169 /* ReturnStatement */); var errorCountBeforeReturnStatement = file.syntacticErrors.length; var returnTokenStart = scanner.getTokenPos(); var returnTokenLength = scanner.getTextPos() - returnTokenStart; - parseExpected(84 /* ReturnKeyword */); + parseExpected(88 /* ReturnKeyword */); if (!canParseSemicolon()) node.expression = parseExpression(); parseSemicolon(); @@ -4779,13 +4343,13 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(163 /* WithStatement */); + var node = createNode(170 /* WithStatement */); var startPos = scanner.getTokenPos(); - parseExpected(95 /* WithKeyword */); + parseExpected(99 /* WithKeyword */); var endPos = scanner.getStartPos(); - parseExpected(11 /* OpenParenToken */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); node.statement = parseStatement(false); node = finishNode(node); if (isInStrictMode) { @@ -4794,36 +4358,36 @@ var ts; return node; } function parseCaseClause() { - var node = createNode(165 /* CaseClause */); - parseExpected(61 /* CaseKeyword */); + var node = createNode(172 /* CaseClause */); + parseExpected(65 /* CaseKeyword */); node.expression = parseExpression(); - parseExpected(46 /* ColonToken */); + parseExpected(50 /* ColonToken */); node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatementAllowingLetDeclaration); return finishNode(node); } function parseDefaultClause() { - var node = createNode(166 /* DefaultClause */); - parseExpected(67 /* DefaultKeyword */); - parseExpected(46 /* ColonToken */); + var node = createNode(173 /* DefaultClause */); + parseExpected(71 /* DefaultKeyword */); + parseExpected(50 /* ColonToken */); node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatementAllowingLetDeclaration); return finishNode(node); } function parseCaseOrDefaultClause() { - return token === 61 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); + return token === 65 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(164 /* SwitchStatement */); - parseExpected(86 /* SwitchKeyword */); - parseExpected(11 /* OpenParenToken */); + var node = createNode(171 /* SwitchStatement */); + parseExpected(90 /* SwitchKeyword */); + parseExpected(15 /* OpenParenToken */); node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - parseExpected(9 /* OpenBraceToken */); + parseExpected(16 /* CloseParenToken */); + parseExpected(13 /* OpenBraceToken */); var saveInSwitchStatement = inSwitchStatement; inSwitchStatement = 1 /* Nested */; node.clauses = parseList(3 /* SwitchClauses */, false, parseCaseOrDefaultClause); inSwitchStatement = saveInSwitchStatement; - parseExpected(10 /* CloseBraceToken */); - var defaultClauses = ts.filter(node.clauses, function (clause) { return clause.kind === 166 /* DefaultClause */; }); + 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); @@ -4833,8 +4397,8 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(168 /* ThrowStatement */); - parseExpected(88 /* ThrowKeyword */); + var node = createNode(175 /* ThrowStatement */); + parseExpected(92 /* ThrowKeyword */); if (scanner.hasPrecedingLineBreak()) { error(ts.Diagnostics.Line_break_not_permitted_here); } @@ -4843,13 +4407,13 @@ var ts; return finishNode(node); } function parseTryStatement() { - var node = createNode(169 /* TryStatement */); - node.tryBlock = parseTokenAndBlock(90 /* TryKeyword */, 170 /* TryBlock */); - if (token === 62 /* CatchKeyword */) { + var node = createNode(176 /* TryStatement */); + node.tryBlock = parseTokenAndBlock(94 /* TryKeyword */, 177 /* TryBlock */); + if (token === 66 /* CatchKeyword */) { node.catchBlock = parseCatchBlock(); } - if (token === 75 /* FinallyKeyword */) { - node.finallyBlock = parseTokenAndBlock(75 /* FinallyKeyword */, 172 /* FinallyBlock */); + if (token === 79 /* FinallyKeyword */) { + node.finallyBlock = parseTokenAndBlock(79 /* FinallyKeyword */, 179 /* FinallyBlock */); } if (!(node.catchBlock || node.finallyBlock)) { error(ts.Diagnostics.catch_or_finally_expected); @@ -4866,15 +4430,15 @@ var ts; } function parseCatchBlock() { var pos = getNodePos(); - parseExpected(62 /* CatchKeyword */); - parseExpected(11 /* OpenParenToken */); + parseExpected(66 /* CatchKeyword */); + parseExpected(15 /* OpenParenToken */); var variable = parseIdentifier(); var typeAnnotationColonStart = scanner.getTokenPos(); var typeAnnotationColonLength = scanner.getTextPos() - typeAnnotationColonStart; var typeAnnotation = parseTypeAnnotation(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); var result = parseBlock(false, false); - result.kind = 171 /* CatchBlock */; + result.kind = 178 /* CatchBlock */; result.pos = pos; result.variable = variable; if (typeAnnotation) { @@ -4886,13 +4450,13 @@ var ts; return result; } function parseDebuggerStatement() { - var node = createNode(173 /* DebuggerStatement */); - parseExpected(66 /* DebuggerKeyword */); + var node = createNode(180 /* DebuggerStatement */); + parseExpected(70 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); } function isIterationStatementStart() { - return token === 94 /* WhileKeyword */ || token === 69 /* DoKeyword */ || token === 76 /* ForKeyword */; + return token === 98 /* WhileKeyword */ || token === 73 /* DoKeyword */ || token === 80 /* ForKeyword */; } function parseStatementWithLabelSet(allowLetAndConstDeclarations) { labelledStatementInfo.pushCurrentLabelSet(isIterationStatementStart()); @@ -4901,12 +4465,12 @@ var ts; return statement; } function isLabel() { - return isIdentifier() && lookAhead(function () { return nextToken() === 46 /* ColonToken */; }); + return isIdentifier() && lookAhead(function () { return nextToken() === 50 /* ColonToken */; }); } function parseLabeledStatement(allowLetAndConstDeclarations) { - var node = createNode(167 /* LabeledStatement */); + var node = createNode(174 /* LabeledStatement */); node.label = parseIdentifier(); - parseExpected(46 /* ColonToken */); + parseExpected(50 /* ColonToken */); if (labelledStatementInfo.nodeIsNestedInLabel(node.label, false, true)) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, getTextOfNodeFromSourceText(sourceText, node.label)); } @@ -4915,91 +4479,93 @@ var ts; return finishNode(node); } function parseExpressionStatement() { - var node = createNode(154 /* ExpressionStatement */); + var node = createNode(161 /* ExpressionStatement */); node.expression = parseExpression(); parseSemicolon(); return finishNode(node); } function isStatement(inErrorRecovery) { switch (token) { - case 17 /* SemicolonToken */: + case 21 /* SemicolonToken */: return !inErrorRecovery; - case 9 /* OpenBraceToken */: - case 92 /* VarKeyword */: - case 98 /* LetKeyword */: - case 64 /* ConstKeyword */: - case 77 /* FunctionKeyword */: - case 78 /* IfKeyword */: - case 69 /* DoKeyword */: - case 94 /* WhileKeyword */: - case 76 /* ForKeyword */: - case 65 /* ContinueKeyword */: - case 60 /* BreakKeyword */: - case 84 /* ReturnKeyword */: - case 95 /* WithKeyword */: - case 86 /* SwitchKeyword */: - case 88 /* ThrowKeyword */: - case 90 /* TryKeyword */: - case 66 /* DebuggerKeyword */: - case 62 /* CatchKeyword */: - case 75 /* FinallyKeyword */: + case 13 /* OpenBraceToken */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + case 81 /* FunctionKeyword */: + case 82 /* IfKeyword */: + case 73 /* DoKeyword */: + case 98 /* WhileKeyword */: + case 80 /* ForKeyword */: + case 69 /* ContinueKeyword */: + case 64 /* BreakKeyword */: + case 88 /* ReturnKeyword */: + case 99 /* WithKeyword */: + case 90 /* SwitchKeyword */: + case 92 /* ThrowKeyword */: + case 94 /* TryKeyword */: + case 70 /* DebuggerKeyword */: + case 66 /* CatchKeyword */: + case 79 /* FinallyKeyword */: return true; - case 97 /* InterfaceKeyword */: - case 63 /* ClassKeyword */: - case 110 /* ModuleKeyword */: - case 71 /* EnumKeyword */: - case 115 /* TypeKeyword */: - if (isDeclaration()) { + case 68 /* ConstKeyword */: + var isConstEnum = lookAhead(function () { return nextToken() === 75 /* EnumKeyword */; }); + return !isConstEnum; + case 101 /* InterfaceKeyword */: + case 67 /* ClassKeyword */: + case 114 /* ModuleKeyword */: + case 75 /* EnumKeyword */: + case 119 /* TypeKeyword */: + if (isDeclarationStart()) { return false; } - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: - case 103 /* StaticKeyword */: - if (lookAhead(function () { return nextToken() >= 59 /* Identifier */; })) { + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: + case 107 /* StaticKeyword */: + if (lookAhead(function () { return nextToken() >= 63 /* Identifier */; })) { return false; } default: - return isExpression(); + return isStartOfExpression(); } } function parseStatement(allowLetAndConstDeclarations) { switch (token) { - case 9 /* OpenBraceToken */: + case 13 /* OpenBraceToken */: return parseBlock(false, false); - case 92 /* VarKeyword */: - case 98 /* LetKeyword */: - case 64 /* ConstKeyword */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + case 68 /* ConstKeyword */: return parseVariableStatement(allowLetAndConstDeclarations); - case 77 /* FunctionKeyword */: + case 81 /* FunctionKeyword */: return parseFunctionDeclaration(); - case 17 /* SemicolonToken */: + case 21 /* SemicolonToken */: return parseEmptyStatement(); - case 78 /* IfKeyword */: + case 82 /* IfKeyword */: return parseIfStatement(); - case 69 /* DoKeyword */: + case 73 /* DoKeyword */: return parseDoStatement(); - case 94 /* WhileKeyword */: + case 98 /* WhileKeyword */: return parseWhileStatement(); - case 76 /* ForKeyword */: + case 80 /* ForKeyword */: return parseForOrForInStatement(); - case 65 /* ContinueKeyword */: - return parseBreakOrContinueStatement(160 /* ContinueStatement */); - case 60 /* BreakKeyword */: - return parseBreakOrContinueStatement(161 /* BreakStatement */); - case 84 /* ReturnKeyword */: + case 69 /* ContinueKeyword */: + return parseBreakOrContinueStatement(167 /* ContinueStatement */); + case 64 /* BreakKeyword */: + return parseBreakOrContinueStatement(168 /* BreakStatement */); + case 88 /* ReturnKeyword */: return parseReturnStatement(); - case 95 /* WithKeyword */: + case 99 /* WithKeyword */: return parseWithStatement(); - case 86 /* SwitchKeyword */: + case 90 /* SwitchKeyword */: return parseSwitchStatement(); - case 88 /* ThrowKeyword */: + case 92 /* ThrowKeyword */: return parseThrowStatement(); - case 90 /* TryKeyword */: - case 62 /* CatchKeyword */: - case 75 /* FinallyKeyword */: + case 94 /* TryKeyword */: + case 66 /* CatchKeyword */: + case 79 /* FinallyKeyword */: return parseTryStatement(); - case 66 /* DebuggerKeyword */: + case 70 /* DebuggerKeyword */: return parseDebuggerStatement(); default: if (isLabel()) { @@ -5011,7 +4577,7 @@ var ts; function parseAndCheckFunctionBody(isConstructor) { var initialPosition = scanner.getTokenPos(); var errorCountBeforeBody = file.syntacticErrors.length; - if (token === 9 /* OpenBraceToken */) { + 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; @@ -5026,7 +4592,7 @@ var ts; error(ts.Diagnostics.Block_or_expected); } function parseVariableDeclaration(flags, noIn) { - var node = createNode(174 /* VariableDeclaration */); + var node = createNode(181 /* VariableDeclaration */); node.flags = flags; var errorCountBeforeVariableDeclaration = file.syntacticErrors.length; node.name = parseIdentifier(); @@ -5049,17 +4615,17 @@ var ts; return parseDelimitedList(9 /* VariableDeclarations */, function () { return parseVariableDeclaration(flags, noIn); }, false); } function parseVariableStatement(allowLetAndConstDeclarations, pos, flags) { - var node = createNode(152 /* VariableStatement */, pos); + var node = createNode(159 /* VariableStatement */, pos); if (flags) node.flags = flags; var errorCountBeforeVarStatement = file.syntacticErrors.length; - if (token === 98 /* LetKeyword */) { + if (token === 102 /* LetKeyword */) { node.flags |= 2048 /* Let */; } - else if (token === 64 /* ConstKeyword */) { + else if (token === 68 /* ConstKeyword */) { node.flags |= 4096 /* Const */; } - else if (token !== 92 /* VarKeyword */) { + else if (token !== 96 /* VarKeyword */) { error(ts.Diagnostics.var_let_or_const_expected); } nextToken(); @@ -5088,12 +4654,12 @@ var ts; return node; } function parseFunctionDeclaration(pos, flags) { - var node = createNode(175 /* FunctionDeclaration */, pos); + var node = createNode(182 /* FunctionDeclaration */, pos); if (flags) node.flags = flags; - parseExpected(77 /* FunctionKeyword */); + parseExpected(81 /* FunctionKeyword */); node.name = parseIdentifier(); - var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; @@ -5104,10 +4670,10 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(pos, flags) { - var node = createNode(122 /* Constructor */, pos); + var node = createNode(126 /* Constructor */, pos); node.flags = flags; - parseExpected(107 /* ConstructorKeyword */); - var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); + parseExpected(111 /* ConstructorKeyword */); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; @@ -5124,14 +4690,14 @@ var ts; var errorCountBeforePropertyDeclaration = file.syntacticErrors.length; var name = parsePropertyName(); var questionStart = scanner.getTokenPos(); - if (parseOptional(45 /* QuestionToken */)) { + if (parseOptional(49 /* QuestionToken */)) { errorAtPos(questionStart, scanner.getStartPos() - questionStart, ts.Diagnostics.A_class_member_cannot_be_declared_optional); } - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - var method = createNode(121 /* Method */, pos); + if (token === 15 /* OpenParenToken */ || token === 23 /* LessThanToken */) { + var method = createNode(125 /* Method */, pos); method.flags = flags; method.name = name; - var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); method.typeParameters = sig.typeParameters; method.parameters = sig.parameters; method.type = sig.type; @@ -5139,7 +4705,7 @@ var ts; return finishNode(method); } else { - var property = createNode(120 /* Property */, pos); + var property = createNode(124 /* Property */, pos); property.flags = flags; property.name = name; property.type = parseTypeAnnotation(); @@ -5166,10 +4732,10 @@ var ts; else if (accessor.typeParameters) { grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } - else if (kind === 123 /* GetAccessor */ && accessor.parameters.length) { + else if (kind === 127 /* GetAccessor */ && accessor.parameters.length) { grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); } - else if (kind === 124 /* SetAccessor */) { + else if (kind === 128 /* SetAccessor */) { if (accessor.type) { grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -5181,7 +4747,7 @@ var ts; if (parameter.flags & 8 /* Rest */) { grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter); } - else if (parameter.flags & ts.NodeFlags.Modifier) { + 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 */) { @@ -5199,7 +4765,7 @@ var ts; var node = createNode(kind, pos); node.flags = flags; node.name = parsePropertyName(); - var sig = parseSignature(125 /* CallSignature */, 46 /* ColonToken */, false); + var sig = parseSignature(129 /* CallSignature */, 50 /* ColonToken */, false); node.typeParameters = sig.typeParameters; node.parameters = sig.parameters; node.type = sig.type; @@ -5222,19 +4788,19 @@ var ts; idToken = token; nextToken(); } - if (token === 13 /* OpenBracketToken */) { + if (token === 17 /* OpenBracketToken */) { return true; } if (idToken !== undefined) { - if (!isKeyword(idToken) || idToken === 113 /* SetKeyword */ || idToken === 109 /* GetKeyword */) { + if (!isKeyword(idToken) || idToken === 117 /* SetKeyword */ || idToken === 113 /* GetKeyword */) { return true; } switch (token) { - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - case 46 /* ColonToken */: - case 47 /* EqualsToken */: - case 45 /* QuestionToken */: + case 15 /* OpenParenToken */: + case 23 /* LessThanToken */: + case 50 /* ColonToken */: + case 51 /* EqualsToken */: + case 49 /* QuestionToken */: return true; default: return canParseSemicolon(); @@ -5259,8 +4825,8 @@ var ts; break; var modifierLength = scanner.getStartPos() - modifierStart; switch (modifierToken) { - case 102 /* PublicKeyword */: - if (flags & ts.NodeFlags.AccessibilityModifier) { + case 106 /* PublicKeyword */: + if (flags & 112 /* AccessibilityModifier */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); } else if (flags & 128 /* Static */) { @@ -5271,8 +4837,8 @@ var ts; } flags |= 16 /* Public */; break; - case 100 /* PrivateKeyword */: - if (flags & ts.NodeFlags.AccessibilityModifier) { + case 104 /* PrivateKeyword */: + if (flags & 112 /* AccessibilityModifier */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); } else if (flags & 128 /* Static */) { @@ -5285,7 +4851,7 @@ var ts; lastPrivateModifierLength = modifierLength; flags |= 32 /* Private */; break; - case 101 /* ProtectedKeyword */: + case 105 /* ProtectedKeyword */: if (flags & 16 /* Public */ || flags & 32 /* Private */ || flags & 64 /* Protected */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); } @@ -5299,7 +4865,7 @@ var ts; lastProtectedModifierLength = modifierLength; flags |= 64 /* Protected */; break; - case 103 /* StaticKeyword */: + case 107 /* StaticKeyword */: if (flags & 128 /* Static */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "static"); } @@ -5313,7 +4879,7 @@ var ts; lastStaticModifierLength = modifierLength; flags |= 128 /* Static */; break; - case 72 /* ExportKeyword */: + case 76 /* ExportKeyword */: if (flags & 1 /* Export */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "export"); } @@ -5328,7 +4894,7 @@ var ts; } flags |= 1 /* Export */; break; - case 108 /* DeclareKeyword */: + case 112 /* DeclareKeyword */: if (flags & 2 /* Ambient */) { grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "declare"); } @@ -5347,26 +4913,26 @@ var ts; break; } } - if (token === 107 /* ConstructorKeyword */ && flags & 128 /* Static */) { + if (token === 111 /* ConstructorKeyword */ && flags & 128 /* Static */) { grammarErrorAtPos(lastStaticModifierStart, lastStaticModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } - else if (token === 107 /* ConstructorKeyword */ && flags & 32 /* Private */) { + 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 === 107 /* ConstructorKeyword */ && flags & 64 /* Protected */) { + 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 === 79 /* ImportKeyword */) { + 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 === 97 /* InterfaceKeyword */) { + 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 !== 72 /* ExportKeyword */ && !(flags & 2 /* Ambient */) && inAmbientContext && context === 0 /* SourceElements */) { + 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); @@ -5376,19 +4942,19 @@ var ts; function parseClassMemberDeclaration() { var pos = getNodePos(); var flags = parseAndCheckModifiers(2 /* ClassMembers */); - if (parseContextualModifier(109 /* GetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(123 /* GetAccessor */, pos, flags); + if (parseContextualModifier(113 /* GetKeyword */)) { + return parseAndCheckMemberAccessorDeclaration(127 /* GetAccessor */, pos, flags); } - if (parseContextualModifier(113 /* SetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(124 /* SetAccessor */, pos, flags); + if (parseContextualModifier(117 /* SetKeyword */)) { + return parseAndCheckMemberAccessorDeclaration(128 /* SetAccessor */, pos, flags); } - if (token === 107 /* ConstructorKeyword */) { + if (token === 111 /* ConstructorKeyword */) { return parseConstructorDeclaration(pos, flags); } - if (token >= 59 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { + if (token >= 63 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { return parsePropertyMemberDeclaration(pos, flags); } - if (token === 13 /* OpenBracketToken */) { + if (token === 17 /* OpenBracketToken */) { if (flags) { var start = getTokenPos(pos); var length = getNodePos() - start; @@ -5399,23 +4965,23 @@ var ts; ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassDeclaration(pos, flags) { - var node = createNode(177 /* ClassDeclaration */, pos); + var node = createNode(184 /* ClassDeclaration */, pos); node.flags = flags; var errorCountBeforeClassDeclaration = file.syntacticErrors.length; - parseExpected(63 /* ClassKeyword */); + parseExpected(67 /* ClassKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); - node.baseType = parseOptional(73 /* ExtendsKeyword */) ? parseTypeReference() : undefined; + node.baseType = parseOptional(77 /* ExtendsKeyword */) ? parseTypeReference() : undefined; var implementsKeywordStart = scanner.getTokenPos(); var implementsKeywordLength; - if (parseOptional(96 /* ImplementsKeyword */)) { + if (parseOptional(100 /* ImplementsKeyword */)) { implementsKeywordLength = scanner.getStartPos() - implementsKeywordStart; node.implementedTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); } var errorCountBeforeClassBody = file.syntacticErrors.length; - if (parseExpected(9 /* OpenBraceToken */)) { + if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseList(6 /* ClassMembers */, false, parseClassMemberDeclaration); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -5426,15 +4992,15 @@ var ts; return finishNode(node); } function parseInterfaceDeclaration(pos, flags) { - var node = createNode(178 /* InterfaceDeclaration */, pos); + var node = createNode(185 /* InterfaceDeclaration */, pos); node.flags = flags; var errorCountBeforeInterfaceDeclaration = file.syntacticErrors.length; - parseExpected(97 /* InterfaceKeyword */); + parseExpected(101 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); var extendsKeywordStart = scanner.getTokenPos(); var extendsKeywordLength; - if (parseOptional(73 /* ExtendsKeyword */)) { + if (parseOptional(77 /* ExtendsKeyword */)) { extendsKeywordLength = scanner.getStartPos() - extendsKeywordStart; node.baseTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); } @@ -5446,30 +5012,24 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(pos, flags) { - var node = createNode(179 /* TypeAliasDeclaration */, pos); + var node = createNode(186 /* TypeAliasDeclaration */, pos); node.flags = flags; - parseExpected(115 /* TypeKeyword */); + parseExpected(119 /* TypeKeyword */); node.name = parseIdentifier(); - parseExpected(47 /* EqualsToken */); + parseExpected(51 /* EqualsToken */); node.type = parseType(); parseSemicolon(); - var n = node.type; - while (n.kind === 134 /* ParenType */) { - n = n.type; - } - if (n.kind === 130 /* TypeLiteral */ && (n.pos !== n.members.pos || n.end !== n.members.end)) { - grammarErrorOnNode(node.type, ts.Diagnostics.Aliased_type_cannot_be_an_object_type_literal_Use_an_interface_declaration_instead); - } return finishNode(node); } 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 === 146 /* PrefixOperator */) { + if (expression.kind === 151 /* PrefixOperator */) { var unaryExpression = expression; - if (unaryExpression.operator === 28 /* PlusToken */ || unaryExpression.operator === 29 /* MinusToken */) { + if (unaryExpression.operator === 32 /* PlusToken */ || unaryExpression.operator === 33 /* MinusToken */) { expression = unaryExpression.operand; } } @@ -5480,30 +5040,35 @@ var ts; } var inConstantEnumMemberSection = true; function parseAndCheckEnumMember() { - var node = createNode(185 /* EnumMember */); + var node = createNode(192 /* EnumMember */); var errorCountBeforeEnumMember = file.syntacticErrors.length; node.name = parsePropertyName(); node.initializer = parseInitializer(false); - 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); + 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); } - } - 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(180 /* EnumDeclaration */, pos); + var node = createNode(187 /* EnumDeclaration */, pos); node.flags = flags; - parseExpected(71 /* EnumKeyword */); + if (enumIsConst) { + parseExpected(68 /* ConstKeyword */); + } + parseExpected(75 /* EnumKeyword */); node.name = parseIdentifier(); - if (parseExpected(9 /* OpenBraceToken */)) { + if (parseExpected(13 /* OpenBraceToken */)) { node.members = parseDelimitedList(7 /* EnumMembers */, parseAndCheckEnumMember, true); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.members = createMissingList(); @@ -5511,10 +5076,10 @@ var ts; return finishNode(node); } function parseModuleBody() { - var node = createNode(182 /* ModuleBlock */); - if (parseExpected(9 /* OpenBraceToken */)) { + var node = createNode(189 /* ModuleBlock */); + if (parseExpected(13 /* OpenBraceToken */)) { node.statements = parseList(1 /* ModuleElements */, false, parseModuleElement); - parseExpected(10 /* CloseBraceToken */); + parseExpected(14 /* CloseBraceToken */); } else { node.statements = createMissingList(); @@ -5522,19 +5087,19 @@ var ts; return finishNode(node); } function parseInternalModuleTail(pos, flags) { - var node = createNode(181 /* ModuleDeclaration */, pos); + var node = createNode(188 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseIdentifier(); - if (parseOptional(15 /* DotToken */)) { + if (parseOptional(19 /* DotToken */)) { node.body = parseInternalModuleTail(getNodePos(), 1 /* Export */); } else { node.body = parseModuleBody(); ts.forEach(node.body.statements, function (s) { - if (s.kind === 184 /* ExportAssignment */) { + if (s.kind === 191 /* ExportAssignment */) { grammarErrorOnNode(s, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); } - else if (s.kind === 183 /* ImportDeclaration */ && s.externalModuleName) { + else if (s.kind === 190 /* ImportDeclaration */ && s.externalModuleName) { grammarErrorOnNode(s, ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); } }); @@ -5542,7 +5107,7 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(pos, flags) { - var node = createNode(181 /* ModuleDeclaration */, pos); + var node = createNode(188 /* ModuleDeclaration */, pos); node.flags = flags; node.name = parseStringLiteral(); if (!inAmbientContext) { @@ -5558,19 +5123,19 @@ var ts; return finishNode(node); } function parseModuleDeclaration(pos, flags) { - parseExpected(110 /* ModuleKeyword */); + parseExpected(114 /* ModuleKeyword */); return token === 7 /* StringLiteral */ ? parseAmbientExternalModuleDeclaration(pos, flags) : parseInternalModuleTail(pos, flags); } function parseImportDeclaration(pos, flags) { - var node = createNode(183 /* ImportDeclaration */, pos); + var node = createNode(190 /* ImportDeclaration */, pos); node.flags = flags; - parseExpected(79 /* ImportKeyword */); + parseExpected(83 /* ImportKeyword */); node.name = parseIdentifier(); - parseExpected(47 /* EqualsToken */); + parseExpected(51 /* EqualsToken */); var entityName = parseEntityName(false); - if (entityName.kind === 59 /* Identifier */ && entityName.text === "require" && parseOptional(11 /* OpenParenToken */)) { + if (entityName.kind === 63 /* Identifier */ && entityName.text === "require" && parseOptional(15 /* OpenParenToken */)) { node.externalModuleName = parseStringLiteral(); - parseExpected(12 /* CloseParenToken */); + parseExpected(16 /* CloseParenToken */); } else { node.entityName = entityName; @@ -5579,36 +5144,36 @@ var ts; return finishNode(node); } function parseExportAssignmentTail(pos) { - var node = createNode(184 /* ExportAssignment */, pos); + var node = createNode(191 /* ExportAssignment */, pos); node.exportName = parseIdentifier(); parseSemicolon(); return finishNode(node); } - function isDeclaration() { + function isDeclarationStart() { switch (token) { - case 92 /* VarKeyword */: - case 98 /* LetKeyword */: - case 64 /* ConstKeyword */: - case 77 /* FunctionKeyword */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: + case 68 /* ConstKeyword */: + case 81 /* FunctionKeyword */: return true; - case 63 /* ClassKeyword */: - case 97 /* InterfaceKeyword */: - case 71 /* EnumKeyword */: - case 79 /* ImportKeyword */: - case 115 /* TypeKeyword */: - return lookAhead(function () { return nextToken() >= 59 /* Identifier */; }); - case 110 /* ModuleKeyword */: - return lookAhead(function () { return nextToken() >= 59 /* Identifier */ || token === 7 /* StringLiteral */; }); - case 72 /* ExportKeyword */: - return lookAhead(function () { return nextToken() === 47 /* EqualsToken */ || isDeclaration(); }); - case 108 /* DeclareKeyword */: - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: - case 103 /* StaticKeyword */: + case 67 /* ClassKeyword */: + case 101 /* InterfaceKeyword */: + case 75 /* EnumKeyword */: + case 83 /* ImportKeyword */: + case 119 /* TypeKeyword */: + return lookAhead(function () { return nextToken() >= 63 /* Identifier */; }); + case 114 /* ModuleKeyword */: + return lookAhead(function () { return nextToken() >= 63 /* Identifier */ || token === 7 /* StringLiteral */; }); + case 76 /* ExportKeyword */: + return lookAhead(function () { return nextToken() === 51 /* EqualsToken */ || isDeclarationStart(); }); + case 112 /* DeclareKeyword */: + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: + case 107 /* StaticKeyword */: return lookAhead(function () { nextToken(); - return isDeclaration(); + return isDeclarationStart(); }); } } @@ -5616,10 +5181,10 @@ var ts; var pos = getNodePos(); var errorCountBeforeModifiers = file.syntacticErrors.length; var flags = parseAndCheckModifiers(modifierContext); - if (token === 72 /* ExportKeyword */) { + if (token === 76 /* ExportKeyword */) { var modifiersEnd = scanner.getStartPos(); nextToken(); - if (parseOptional(47 /* EqualsToken */)) { + if (parseOptional(51 /* EqualsToken */)) { var exportAssignmentTail = parseExportAssignmentTail(pos); if (flags !== 0 && errorCountBeforeModifiers === file.syntacticErrors.length) { var modifiersStart = ts.skipTrivia(sourceText, pos); @@ -5634,30 +5199,38 @@ var ts; } var result; switch (token) { - case 92 /* VarKeyword */: - case 98 /* LetKeyword */: - case 64 /* ConstKeyword */: + case 96 /* VarKeyword */: + case 102 /* LetKeyword */: result = parseVariableStatement(true, pos, flags); break; - case 77 /* FunctionKeyword */: + case 68 /* ConstKeyword */: + var isConstEnum = lookAhead(function () { return nextToken() === 75 /* EnumKeyword */; }); + if (isConstEnum) { + result = parseAndCheckEnumDeclaration(pos, flags | 4096 /* Const */); + } + else { + result = parseVariableStatement(true, pos, flags); + } + break; + case 81 /* FunctionKeyword */: result = parseFunctionDeclaration(pos, flags); break; - case 63 /* ClassKeyword */: + case 67 /* ClassKeyword */: result = parseClassDeclaration(pos, flags); break; - case 97 /* InterfaceKeyword */: + case 101 /* InterfaceKeyword */: result = parseInterfaceDeclaration(pos, flags); break; - case 115 /* TypeKeyword */: + case 119 /* TypeKeyword */: result = parseTypeAliasDeclaration(pos, flags); break; - case 71 /* EnumKeyword */: + case 75 /* EnumKeyword */: result = parseAndCheckEnumDeclaration(pos, flags); break; - case 110 /* ModuleKeyword */: + case 114 /* ModuleKeyword */: result = parseModuleDeclaration(pos, flags); break; - case 79 /* ImportKeyword */: + case 83 /* ImportKeyword */: result = parseImportDeclaration(pos, flags); break; default: @@ -5667,7 +5240,7 @@ var ts; return result; } function isSourceElement(inErrorRecovery) { - return isDeclaration() || isStatement(inErrorRecovery); + return isDeclarationStart() || isStatement(inErrorRecovery); } function parseSourceElement() { return parseSourceElementOrModuleElement(0 /* SourceElements */); @@ -5676,7 +5249,7 @@ var ts; return parseSourceElementOrModuleElement(1 /* ModuleElements */); } function parseSourceElementOrModuleElement(modifierContext) { - if (isDeclaration()) { + if (isDeclarationStart()) { return parseDeclaration(modifierContext); } var statementStart = scanner.getTokenPos(); @@ -5734,7 +5307,7 @@ var ts; }; } function getExternalModuleIndicator() { - return ts.forEach(file.statements, function (node) { return node.flags & 1 /* Export */ || node.kind === 183 /* ImportDeclaration */ && node.externalModuleName || node.kind === 184 /* ExportAssignment */ ? node : undefined; }); + return ts.forEach(file.statements, function (node) { return node.flags & 1 /* Export */ || node.kind === 190 /* ImportDeclaration */ && node.externalModuleName || node.kind === 191 /* ExportAssignment */ ? node : undefined; }); } scanner = ts.createScanner(languageVersion, true, sourceText, scanError, onComment); var rootNodeFlags = 0; @@ -5742,7 +5315,7 @@ var ts; rootNodeFlags = 1024 /* DeclarationFile */; inAmbientContext = true; } - file = createRootNode(186 /* SourceFile */, 0, sourceText.length, rootNodeFlags); + file = createRootNode(193 /* SourceFile */, 0, sourceText.length, rootNodeFlags); file.filename = ts.normalizePath(filename); file.text = sourceText; file.getLineAndCharacterFromPosition = getLineAndCharacterlFromSourcePosition; @@ -5875,7 +5448,7 @@ var ts; } function processImportedModules(file, basePath) { ts.forEach(file.statements, function (node) { - if (node.kind === 183 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 190 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -5893,9 +5466,9 @@ var ts; } } } - else if (node.kind === 181 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { + else if (node.kind === 188 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { forEachChild(node.body, function (node) { - if (node.kind === 183 /* ImportDeclaration */ && node.externalModuleName) { + if (node.kind === 190 /* ImportDeclaration */ && node.externalModuleName) { var nameLiteral = node.externalModuleName; var moduleName = nameLiteral.text; if (moduleName) { @@ -5967,24 +5540,40 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - function isInstantiated(node) { - if (node.kind === 178 /* InterfaceDeclaration */) { - return false; + function getModuleInstanceState(node) { + if (node.kind === 185 /* InterfaceDeclaration */) { + return 0 /* NonInstantiated */; } - else if (node.kind === 183 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { - return false; + else if (node.kind === 187 /* EnumDeclaration */ && ts.isConstEnumDeclaration(node)) { + return 2 /* ConstEnumOnly */; } - else if (node.kind === 182 /* ModuleBlock */ && !ts.forEachChild(node, isInstantiated)) { - return false; + else if (node.kind === 190 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { + return 0 /* NonInstantiated */; } - else if (node.kind === 181 /* ModuleDeclaration */ && !isInstantiated(node.body)) { - return false; + else if (node.kind === 189 /* ModuleBlock */) { + var state = 0 /* NonInstantiated */; + ts.forEachChild(node, function (n) { + switch (getModuleInstanceState(n)) { + case 0 /* NonInstantiated */: + return false; + case 2 /* ConstEnumOnly */: + state = 2 /* ConstEnumOnly */; + return false; + case 1 /* Instantiated */: + state = 1 /* Instantiated */; + return true; + } + }); + return state; + } + else if (node.kind === 188 /* ModuleDeclaration */) { + return getModuleInstanceState(node.body); } else { - return true; + return 1 /* Instantiated */; } } - ts.isInstantiated = isInstantiated; + ts.getModuleInstanceState = getModuleInstanceState; function bindSourceFile(file) { var parent; var container; @@ -6007,30 +5596,26 @@ var ts; if (!symbol.declarations) symbol.declarations = []; symbol.declarations.push(node); - if (symbolKind & ts.SymbolFlags.HasExports && !symbol.exports) + if (symbolKind & 1952 /* HasExports */ && !symbol.exports) symbol.exports = {}; - if (symbolKind & ts.SymbolFlags.HasMembers && !symbol.members) + if (symbolKind & 6240 /* HasMembers */ && !symbol.members) symbol.members = {}; node.symbol = symbol; - if (symbolKind & ts.SymbolFlags.Value && !symbol.valueDeclaration) + if (symbolKind & 107455 /* Value */ && !symbol.valueDeclaration) symbol.valueDeclaration = node; } function getDeclarationName(node) { if (node.name) { - if (node.kind === 181 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { + if (node.kind === 188 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { return '"' + node.name.text + '"'; } return node.name.text; } switch (node.kind) { - case 122 /* Constructor */: - return "__constructor"; - case 125 /* CallSignature */: - return "__call"; - case 126 /* ConstructSignature */: - return "__new"; - case 127 /* IndexSignature */: - return "__index"; + case 126 /* Constructor */: return "__constructor"; + case 129 /* CallSignature */: return "__call"; + case 130 /* ConstructSignature */: return "__new"; + case 131 /* IndexSignature */: return "__index"; } } function getDisplayName(node) { @@ -6057,8 +5642,8 @@ var ts; } addDeclarationToSymbol(symbol, node, includes); symbol.parent = parent; - if (node.kind === 177 /* ClassDeclaration */ && symbol.exports) { - var prototypeSymbol = createSymbol(4 /* Property */ | 268435456 /* Prototype */, "prototype"); + if (node.kind === 184 /* 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; @@ -6080,16 +5665,16 @@ var ts; } function declareModuleMember(node, symbolKind, symbolExcludes) { var exportKind = 0; - if (symbolKind & ts.SymbolFlags.Value) { - exportKind |= 2097152 /* ExportValue */; + if (symbolKind & 107455 /* Value */) { + exportKind |= 4194304 /* ExportValue */; } - if (symbolKind & ts.SymbolFlags.Type) { - exportKind |= 4194304 /* ExportType */; + if (symbolKind & 3152352 /* Type */) { + exportKind |= 8388608 /* ExportType */; } - if (symbolKind & ts.SymbolFlags.Namespace) { - exportKind |= 8388608 /* ExportNamespace */; + if (symbolKind & 1536 /* Namespace */) { + exportKind |= 16777216 /* ExportNamespace */; } - if (node.flags & 1 /* Export */ || (node.kind !== 183 /* ImportDeclaration */ && isAmbientContext(container))) { + if (node.flags & 1 /* Export */ || (node.kind !== 190 /* 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); @@ -6104,14 +5689,14 @@ var ts; } } function bindChildren(node, symbolKind, isBlockScopeContainer) { - if (symbolKind & ts.SymbolFlags.HasLocals) { + if (symbolKind & 1041936 /* HasLocals */) { node.locals = {}; } var saveParent = parent; var saveContainer = container; var savedBlockScopeContainer = blockScopeContainer; parent = node; - if (symbolKind & ts.SymbolFlags.IsContainer) { + if (symbolKind & 1048560 /* IsContainer */) { container = node; if (lastContainer !== container && !container.nextContainer) { if (lastContainer) { @@ -6130,59 +5715,68 @@ var ts; } function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) { switch (container.kind) { - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: declareModuleMember(node, symbolKind, symbolExcludes); break; - case 186 /* SourceFile */: + case 193 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolKind, symbolExcludes); break; } - case 125 /* CallSignature */: - case 126 /* ConstructSignature */: - case 127 /* IndexSignature */: - case 121 /* Method */: - case 122 /* Constructor */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 175 /* FunctionDeclaration */: - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); break; - case 177 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: if (node.flags & 128 /* Static */) { declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } - case 130 /* TypeLiteral */: - case 136 /* ObjectLiteral */: - case 178 /* InterfaceDeclaration */: + case 134 /* TypeLiteral */: + case 140 /* ObjectLiteral */: + case 185 /* InterfaceDeclaration */: declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); break; - case 180 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); break; } bindChildren(node, symbolKind, isBlockScopeContainer); } function bindConstructorDeclaration(node) { - bindDeclaration(node, 8192 /* Constructor */, 0, true); + bindDeclaration(node, 16384 /* Constructor */, 0, true); ts.forEach(node.parameters, function (p) { if (p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */)) { - bindDeclaration(p, 4 /* Property */, ts.SymbolFlags.PropertyExcludes, false); + bindDeclaration(p, 4 /* Property */, 107455 /* PropertyExcludes */, false); } }); } function bindModuleDeclaration(node) { if (node.name.kind === 7 /* StringLiteral */) { - bindDeclaration(node, 256 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes, true); - } - else if (isInstantiated(node)) { - bindDeclaration(node, 256 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes, true); + bindDeclaration(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */, true); } else { - bindDeclaration(node, 512 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */, true); + var state = getModuleInstanceState(node); + if (state === 0 /* NonInstantiated */) { + bindDeclaration(node, 1024 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */, true); + } + else { + bindDeclaration(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */, true); + if (state === 2 /* ConstEnumOnly */) { + node.symbol.constEnumOnlyModule = true; + } + else if (node.symbol.constEnumOnlyModule) { + node.symbol.constEnumOnlyModule = false; + } + } } } function bindAnonymousDeclaration(node, symbolKind, name, isBlockScopeContainer) { @@ -6202,113 +5796,118 @@ var ts; } function bindBlockScopedVariableDeclaration(node) { switch (blockScopeContainer.kind) { - case 181 /* ModuleDeclaration */: - declareModuleMember(node, 2 /* BlockScopedVariable */, ts.SymbolFlags.BlockScopedVariableExcludes); + case 188 /* ModuleDeclaration */: + declareModuleMember(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); break; - case 186 /* SourceFile */: + case 193 /* SourceFile */: if (ts.isExternalModule(container)) { - declareModuleMember(node, 2 /* BlockScopedVariable */, ts.SymbolFlags.BlockScopedVariableExcludes); + declareModuleMember(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); break; } default: if (!blockScopeContainer.locals) { blockScopeContainer.locals = {}; } - declareSymbol(blockScopeContainer.locals, undefined, node, 2 /* BlockScopedVariable */, ts.SymbolFlags.BlockScopedVariableExcludes); + declareSymbol(blockScopeContainer.locals, undefined, node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); } bindChildren(node, 2 /* BlockScopedVariable */, false); } function bind(node) { node.parent = parent; switch (node.kind) { - case 118 /* TypeParameter */: - bindDeclaration(node, 524288 /* TypeParameter */, ts.SymbolFlags.TypeParameterExcludes, false); + case 122 /* TypeParameter */: + bindDeclaration(node, 1048576 /* TypeParameter */, 2103776 /* TypeParameterExcludes */, false); break; - case 119 /* Parameter */: - bindDeclaration(node, 1 /* FunctionScopedVariable */, ts.SymbolFlags.ParameterExcludes, false); + case 123 /* Parameter */: + bindDeclaration(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */, false); break; - case 174 /* VariableDeclaration */: - if (node.flags & ts.NodeFlags.BlockScoped) { + case 181 /* VariableDeclaration */: + if (node.flags & 6144 /* BlockScoped */) { bindBlockScopedVariableDeclaration(node); } else { - bindDeclaration(node, 1 /* FunctionScopedVariable */, ts.SymbolFlags.FunctionScopedVariableExcludes, false); + bindDeclaration(node, 1 /* FunctionScopedVariable */, 107454 /* FunctionScopedVariableExcludes */, false); } break; - case 120 /* Property */: - case 137 /* PropertyAssignment */: - bindDeclaration(node, 4 /* Property */, ts.SymbolFlags.PropertyExcludes, false); + case 124 /* Property */: + case 141 /* PropertyAssignment */: + bindDeclaration(node, 4 /* Property */, 107455 /* PropertyExcludes */, false); break; - case 185 /* EnumMember */: - bindDeclaration(node, 8 /* EnumMember */, ts.SymbolFlags.EnumMemberExcludes, false); + case 192 /* EnumMember */: + bindDeclaration(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */, false); break; - case 125 /* CallSignature */: - bindDeclaration(node, 65536 /* CallSignature */, 0, false); + case 129 /* CallSignature */: + bindDeclaration(node, 131072 /* CallSignature */, 0, false); break; - case 121 /* Method */: - bindDeclaration(node, 4096 /* Method */, ts.SymbolFlags.MethodExcludes, true); + case 125 /* Method */: + bindDeclaration(node, 8192 /* Method */, 99263 /* MethodExcludes */, true); break; - case 126 /* ConstructSignature */: - bindDeclaration(node, 131072 /* ConstructSignature */, 0, true); + case 130 /* ConstructSignature */: + bindDeclaration(node, 262144 /* ConstructSignature */, 0, true); break; - case 127 /* IndexSignature */: - bindDeclaration(node, 262144 /* IndexSignature */, 0, false); + case 131 /* IndexSignature */: + bindDeclaration(node, 524288 /* IndexSignature */, 0, false); break; - case 175 /* FunctionDeclaration */: - bindDeclaration(node, 16 /* Function */, ts.SymbolFlags.FunctionExcludes, true); + case 182 /* FunctionDeclaration */: + bindDeclaration(node, 16 /* Function */, 106927 /* FunctionExcludes */, true); break; - case 122 /* Constructor */: + case 126 /* Constructor */: bindConstructorDeclaration(node); break; - case 123 /* GetAccessor */: - bindDeclaration(node, 16384 /* GetAccessor */, ts.SymbolFlags.GetAccessorExcludes, true); + case 127 /* GetAccessor */: + bindDeclaration(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */, true); break; - case 124 /* SetAccessor */: - bindDeclaration(node, 32768 /* SetAccessor */, ts.SymbolFlags.SetAccessorExcludes, true); + case 128 /* SetAccessor */: + bindDeclaration(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */, true); break; - case 130 /* TypeLiteral */: - bindAnonymousDeclaration(node, 1024 /* TypeLiteral */, "__type", false); + case 134 /* TypeLiteral */: + bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type", false); break; - case 136 /* ObjectLiteral */: - bindAnonymousDeclaration(node, 2048 /* ObjectLiteral */, "__object", false); + case 140 /* ObjectLiteral */: + bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object", false); break; - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: bindAnonymousDeclaration(node, 16 /* Function */, "__function", true); break; - case 171 /* CatchBlock */: + case 178 /* CatchBlock */: bindCatchVariableDeclaration(node); break; - case 177 /* ClassDeclaration */: - bindDeclaration(node, 32 /* Class */, ts.SymbolFlags.ClassExcludes, false); + case 184 /* ClassDeclaration */: + bindDeclaration(node, 32 /* Class */, 3258879 /* ClassExcludes */, false); break; - case 178 /* InterfaceDeclaration */: - bindDeclaration(node, 64 /* Interface */, ts.SymbolFlags.InterfaceExcludes, false); + case 185 /* InterfaceDeclaration */: + bindDeclaration(node, 64 /* Interface */, 3152288 /* InterfaceExcludes */, false); break; - case 179 /* TypeAliasDeclaration */: - bindDeclaration(node, 1048576 /* TypeAlias */, ts.SymbolFlags.TypeAliasExcludes, false); + case 186 /* TypeAliasDeclaration */: + bindDeclaration(node, 2097152 /* TypeAlias */, 3152352 /* TypeAliasExcludes */, false); break; - case 180 /* EnumDeclaration */: - bindDeclaration(node, 128 /* Enum */, ts.SymbolFlags.EnumExcludes, false); + case 187 /* EnumDeclaration */: + if (ts.isConstEnumDeclaration(node)) { + bindDeclaration(node, 128 /* ConstEnum */, 3259263 /* ConstEnumExcludes */, false); + } + else { + bindDeclaration(node, 256 /* RegularEnum */, 3258623 /* RegularEnumExcludes */, false); + } break; - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: bindModuleDeclaration(node); break; - case 183 /* ImportDeclaration */: - bindDeclaration(node, 16777216 /* Import */, ts.SymbolFlags.ImportExcludes, false); + case 190 /* ImportDeclaration */: + bindDeclaration(node, 33554432 /* Import */, 33554432 /* ImportExcludes */, false); break; - case 186 /* SourceFile */: + case 193 /* SourceFile */: if (ts.isExternalModule(node)) { - bindAnonymousDeclaration(node, 256 /* ValueModule */, '"' + ts.removeFileExtension(node.filename) + '"', true); + bindAnonymousDeclaration(node, 512 /* ValueModule */, '"' + ts.removeFileExtension(node.filename) + '"', true); break; } - case 151 /* Block */: - case 170 /* TryBlock */: - case 171 /* CatchBlock */: - case 172 /* FinallyBlock */: - case 158 /* ForStatement */: - case 159 /* ForInStatement */: - case 164 /* SwitchStatement */: + case 158 /* Block */: + case 177 /* TryBlock */: + case 178 /* CatchBlock */: + case 179 /* FinallyBlock */: + case 165 /* ForStatement */: + case 166 /* ForInStatement */: + case 171 /* SwitchStatement */: bindChildren(node, 0, true); break; default: @@ -6371,7 +5970,7 @@ var ts; } function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 122 /* Constructor */ && member.body) { + if (member.kind === 126 /* Constructor */ && member.body) { return member; } }); @@ -6381,14 +5980,14 @@ var ts; var getAccessor; var setAccessor; ts.forEach(node.members, function (member) { - if ((member.kind === 123 /* GetAccessor */ || member.kind === 124 /* SetAccessor */) && member.name.text === accessor.name.text && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { + if ((member.kind === 127 /* GetAccessor */ || member.kind === 128 /* SetAccessor */) && member.name.text === accessor.name.text && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { if (!firstAccessor) { firstAccessor = member; } - if (member.kind === 123 /* GetAccessor */ && !getAccessor) { + if (member.kind === 127 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 124 /* SetAccessor */ && !setAccessor) { + if (member.kind === 128 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -6711,7 +6310,7 @@ var ts; if (scopeName) { recordScopeNameStart(scopeName); } - else if (node.kind === 175 /* FunctionDeclaration */ || node.kind === 144 /* FunctionExpression */ || node.kind === 121 /* Method */ || node.kind === 123 /* GetAccessor */ || node.kind === 124 /* SetAccessor */ || node.kind === 181 /* ModuleDeclaration */ || node.kind === 177 /* ClassDeclaration */ || node.kind === 180 /* EnumDeclaration */) { + 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 */) { if (node.name) { scopeName = node.name.text; } @@ -6793,7 +6392,7 @@ var ts; } function emitNodeWithMap(node) { if (node) { - if (node.kind != 186 /* SourceFile */) { + if (node.kind != 193 /* SourceFile */) { recordEmitNodeStartSpan(node); emitNode(node); recordEmitNodeEndSpan(node); @@ -6880,13 +6479,76 @@ var ts; } } function emitLiteral(node) { - var text = getSourceTextOfLocalNode(node); - if (node.kind === 7 /* StringLiteral */ && compilerOptions.sourceMap) { + var text = getLiteralText(); + if (compilerOptions.sourceMap && (node.kind === 7 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) { writer.writeLiteral(text); } else { write(text); } + function getLiteralText() { + if (compilerOptions.target < 2 /* ES6 */ && ts.isTemplateLiteralKind(node.kind)) { + return getTemplateLiteralAsStringLiteral(node); + } + return getSourceTextOfLocalNode(node); + } + } + function getTemplateLiteralAsStringLiteral(node) { + return '"' + ts.escapeString(node.text) + '"'; + } + function emitTemplateExpression(node) { + if (compilerOptions.target >= 2 /* ES6 */) { + 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) { + write("("); + } + emitLiteral(node.head); + ts.forEach(node.templateSpans, function (templateSpan) { + var needsParens = templateSpan.expression.kind !== 148 /* ParenExpression */ && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1 /* GreaterThan */; + write(" + "); + if (needsParens) { + write("("); + } + emit(templateSpan.expression); + if (needsParens) { + write(")"); + } + if (templateSpan.literal.text.length !== 0) { + write(" + "); + emitLiteral(templateSpan.literal); + } + }); + if (templateNeedsParens) { + write(")"); + } + function comparePrecedenceToBinaryPlus(expression) { + ts.Debug.assert(compilerOptions.target <= 1 /* ES5 */); + switch (expression.kind) { + case 153 /* BinaryExpression */: + switch (expression.operator) { + case 34 /* AsteriskToken */: + case 35 /* SlashToken */: + case 36 /* PercentToken */: + return 1 /* GreaterThan */; + case 32 /* PlusToken */: + return 0 /* EqualTo */; + default: + return -1 /* LessThan */; + } + case 154 /* ConditionalExpression */: + return -1 /* LessThan */; + default: + return 1 /* GreaterThan */; + } + } + } + function emitTemplateSpan(span) { + emit(span.expression); + emit(span.literal); } function emitQuotedIdentifier(node) { if (node.kind === 7 /* StringLiteral */) { @@ -6906,29 +6568,29 @@ var ts; function isNonExpressionIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 119 /* Parameter */: - case 174 /* VariableDeclaration */: - case 120 /* Property */: - case 137 /* PropertyAssignment */: - case 185 /* EnumMember */: - case 121 /* Method */: - case 175 /* FunctionDeclaration */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 144 /* FunctionExpression */: - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - case 180 /* EnumDeclaration */: - case 181 /* ModuleDeclaration */: - case 183 /* ImportDeclaration */: + case 123 /* Parameter */: + case 181 /* VariableDeclaration */: + case 124 /* Property */: + case 141 /* PropertyAssignment */: + case 192 /* EnumMember */: + case 125 /* Method */: + case 182 /* 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 */: return parent.name === node; - case 161 /* BreakStatement */: - case 160 /* ContinueStatement */: - case 184 /* ExportAssignment */: + case 168 /* BreakStatement */: + case 167 /* ContinueStatement */: + case 191 /* ExportAssignment */: return false; - case 167 /* LabeledStatement */: + case 174 /* LabeledStatement */: return node.parent.label === node; - case 171 /* CatchBlock */: + case 178 /* CatchBlock */: return node.parent.variable === node; } } @@ -7002,18 +6664,27 @@ var ts; emit(node.initializer); emitTrailingComments(node); } - function emitPropertyAccess(node) { + function tryEmitConstantValue(node) { var constantValue = resolver.getConstantValue(node); if (constantValue !== undefined) { - write(constantValue.toString() + " /* " + ts.identifierToString(node.right) + " */"); + var propertyName = node.kind === 142 /* PropertyAccess */ ? ts.identifierToString(node.right) : ts.getTextOfNode(node.index); + write(constantValue.toString() + " /* " + propertyName + " */"); + return true; } - else { - emit(node.left); - write("."); - emit(node.right); + return false; + } + function emitPropertyAccess(node) { + if (tryEmitConstantValue(node)) { + return; } + emit(node.left); + write("."); + emit(node.right); } function emitIndexedAccess(node) { + if (tryEmitConstantValue(node)) { + return; + } emit(node.object); write("["); emit(node.index); @@ -7021,13 +6692,13 @@ var ts; } function emitCallExpression(node) { var superCall = false; - if (node.func.kind === 85 /* SuperKeyword */) { + if (node.func.kind === 89 /* SuperKeyword */) { write("_super"); superCall = true; } else { emit(node.func); - superCall = node.func.kind === 138 /* PropertyAccess */ && node.func.left.kind === 85 /* SuperKeyword */; + superCall = node.func.kind === 142 /* PropertyAccess */ && node.func.left.kind === 89 /* SuperKeyword */; } if (superCall) { write(".call("); @@ -7053,13 +6724,19 @@ var ts; write(")"); } } + function emitTaggedTemplateExpression(node) { + ts.Debug.assert(compilerOptions.target >= 2 /* ES6 */, "Trying to emit a tagged template in pre-ES6 mode."); + emit(node.tag); + write(" "); + emit(node.template); + } function emitParenExpression(node) { - if (node.expression.kind === 142 /* TypeAssertion */) { + if (node.expression.kind === 147 /* TypeAssertion */) { var operand = node.expression.operand; - while (operand.kind == 142 /* TypeAssertion */) { + while (operand.kind == 147 /* TypeAssertion */) { operand = operand.operand; } - if (operand.kind !== 146 /* PrefixOperator */ && operand.kind !== 147 /* PostfixOperator */ && operand.kind !== 141 /* NewExpression */ && !(operand.kind === 140 /* CallExpression */ && node.parent.kind === 141 /* NewExpression */) && !(operand.kind === 144 /* FunctionExpression */ && node.parent.kind === 140 /* CallExpression */)) { + 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 */)) { emit(operand); return; } @@ -7069,29 +6746,29 @@ var ts; write(")"); } function emitUnaryExpression(node) { - if (node.kind === 146 /* PrefixOperator */) { + if (node.kind === 151 /* PrefixOperator */) { write(ts.tokenToString(node.operator)); } - if (node.operator >= 59 /* Identifier */) { + if (node.operator >= 63 /* Identifier */) { write(" "); } - else if (node.kind === 146 /* PrefixOperator */ && node.operand.kind === 146 /* PrefixOperator */) { + else if (node.kind === 151 /* PrefixOperator */ && node.operand.kind === 151 /* PrefixOperator */) { var operand = node.operand; - if (node.operator === 28 /* PlusToken */ && (operand.operator === 28 /* PlusToken */ || operand.operator === 33 /* PlusPlusToken */)) { + if (node.operator === 32 /* PlusToken */ && (operand.operator === 32 /* PlusToken */ || operand.operator === 37 /* PlusPlusToken */)) { write(" "); } - else if (node.operator === 29 /* MinusToken */ && (operand.operator === 29 /* MinusToken */ || operand.operator === 34 /* MinusMinusToken */)) { + else if (node.operator === 33 /* MinusToken */ && (operand.operator === 33 /* MinusToken */ || operand.operator === 38 /* MinusMinusToken */)) { write(" "); } } emit(node.operand); - if (node.kind === 147 /* PostfixOperator */) { + if (node.kind === 152 /* PostfixOperator */) { write(ts.tokenToString(node.operator)); } } function emitBinaryExpression(node) { emit(node.left); - if (node.operator !== 18 /* CommaToken */) + if (node.operator !== 22 /* CommaToken */) write(" "); write(ts.tokenToString(node.operator)); write(" "); @@ -7105,21 +6782,21 @@ var ts; emit(node.whenFalse); } function emitBlock(node) { - emitToken(9 /* OpenBraceToken */, node.pos); + emitToken(13 /* OpenBraceToken */, node.pos); increaseIndent(); scopeEmitStart(node.parent); - if (node.kind === 182 /* ModuleBlock */) { - ts.Debug.assert(node.parent.kind === 181 /* ModuleDeclaration */); + if (node.kind === 189 /* ModuleBlock */) { + ts.Debug.assert(node.parent.kind === 188 /* ModuleDeclaration */); emitCaptureThisForNodeIfNecessary(node.parent); } emitLines(node.statements); decreaseIndent(); writeLine(); - emitToken(10 /* CloseBraceToken */, node.statements.end); + emitToken(14 /* CloseBraceToken */, node.statements.end); scopeEmitEnd(); } function emitEmbeddedStatement(node) { - if (node.kind === 151 /* Block */) { + if (node.kind === 158 /* Block */) { write(" "); emit(node); } @@ -7131,7 +6808,7 @@ var ts; } } function emitExpressionStatement(node) { - var isArrowExpression = node.expression.kind === 145 /* ArrowFunction */; + var isArrowExpression = node.expression.kind === 150 /* ArrowFunction */; emitLeadingComments(node); if (isArrowExpression) write("("); @@ -7143,16 +6820,16 @@ var ts; } function emitIfStatement(node) { emitLeadingComments(node); - var endPos = emitToken(78 /* IfKeyword */, node.pos); + var endPos = emitToken(82 /* IfKeyword */, node.pos); write(" "); - endPos = emitToken(11 /* OpenParenToken */, endPos); + endPos = emitToken(15 /* OpenParenToken */, endPos); emit(node.expression); - emitToken(12 /* CloseParenToken */, node.expression.end); + emitToken(16 /* CloseParenToken */, node.expression.end); emitEmbeddedStatement(node.thenStatement); if (node.elseStatement) { writeLine(); - emitToken(70 /* ElseKeyword */, node.thenStatement.end); - if (node.elseStatement.kind === 155 /* IfStatement */) { + emitToken(74 /* ElseKeyword */, node.thenStatement.end); + if (node.elseStatement.kind === 162 /* IfStatement */) { write(" "); emit(node.elseStatement); } @@ -7165,7 +6842,7 @@ var ts; function emitDoStatement(node) { write("do"); emitEmbeddedStatement(node.statement); - if (node.statement.kind === 151 /* Block */) { + if (node.statement.kind === 158 /* Block */) { write(" "); } else { @@ -7182,18 +6859,18 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForStatement(node) { - var endPos = emitToken(76 /* ForKeyword */, node.pos); + var endPos = emitToken(80 /* ForKeyword */, node.pos); write(" "); - endPos = emitToken(11 /* OpenParenToken */, endPos); + endPos = emitToken(15 /* OpenParenToken */, endPos); if (node.declarations) { if (node.declarations[0] && node.declarations[0].flags & 2048 /* Let */) { - emitToken(98 /* LetKeyword */, endPos); + emitToken(102 /* LetKeyword */, endPos); } else if (node.declarations[0] && node.declarations[0].flags & 4096 /* Const */) { - emitToken(64 /* ConstKeyword */, endPos); + emitToken(68 /* ConstKeyword */, endPos); } else { - emitToken(92 /* VarKeyword */, endPos); + emitToken(96 /* VarKeyword */, endPos); } write(" "); emitCommaList(node.declarations, false); @@ -7209,15 +6886,15 @@ var ts; emitEmbeddedStatement(node.statement); } function emitForInStatement(node) { - var endPos = emitToken(76 /* ForKeyword */, node.pos); + var endPos = emitToken(80 /* ForKeyword */, node.pos); write(" "); - endPos = emitToken(11 /* OpenParenToken */, endPos); + endPos = emitToken(15 /* OpenParenToken */, endPos); if (node.declaration) { if (node.declaration.flags & 2048 /* Let */) { - emitToken(98 /* LetKeyword */, endPos); + emitToken(102 /* LetKeyword */, endPos); } else { - emitToken(92 /* VarKeyword */, endPos); + emitToken(96 /* VarKeyword */, endPos); } write(" "); emit(node.declaration); @@ -7227,17 +6904,17 @@ var ts; } write(" in "); emit(node.expression); - emitToken(12 /* CloseParenToken */, node.expression.end); + emitToken(16 /* CloseParenToken */, node.expression.end); emitEmbeddedStatement(node.statement); } function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 161 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */, node.pos); + emitToken(node.kind === 168 /* BreakStatement */ ? 64 /* BreakKeyword */ : 69 /* ContinueKeyword */, node.pos); emitOptional(" ", node.label); write(";"); } function emitReturnStatement(node) { emitLeadingComments(node); - emitToken(84 /* ReturnKeyword */, node.pos); + emitToken(88 /* ReturnKeyword */, node.pos); emitOptional(" ", node.expression); write(";"); emitTrailingComments(node); @@ -7249,21 +6926,24 @@ var ts; emitEmbeddedStatement(node.statement); } function emitSwitchStatement(node) { - var endPos = emitToken(86 /* SwitchKeyword */, node.pos); + var endPos = emitToken(90 /* SwitchKeyword */, node.pos); write(" "); - emitToken(11 /* OpenParenToken */, endPos); + emitToken(15 /* OpenParenToken */, endPos); emit(node.expression); - endPos = emitToken(12 /* CloseParenToken */, node.expression.end); + endPos = emitToken(16 /* CloseParenToken */, node.expression.end); write(" "); - emitToken(9 /* OpenBraceToken */, endPos); + emitToken(13 /* OpenBraceToken */, endPos); increaseIndent(); emitLines(node.clauses); decreaseIndent(); writeLine(); - emitToken(10 /* CloseBraceToken */, node.clauses.end); + emitToken(14 /* CloseBraceToken */, node.clauses.end); + } + function isOnSameLine(node1, node2) { + return getLineOfLocalPosition(ts.skipTrivia(currentSourceFile.text, node1.pos)) === getLineOfLocalPosition(ts.skipTrivia(currentSourceFile.text, node2.pos)); } function emitCaseOrDefaultClause(node) { - if (node.kind === 165 /* CaseClause */) { + if (node.kind === 172 /* CaseClause */) { write("case "); emit(node.expression); write(":"); @@ -7271,9 +6951,15 @@ var ts; else { write("default:"); } - increaseIndent(); - emitLines(node.statements); - decreaseIndent(); + if (node.statements.length === 1 && isOnSameLine(node, node.statements[0])) { + write(" "); + emit(node.statements[0]); + } + else { + increaseIndent(); + emitLines(node.statements); + decreaseIndent(); + } } function emitThrowStatement(node) { write("throw "); @@ -7292,16 +6978,16 @@ var ts; } function emitCatchBlock(node) { writeLine(); - var endPos = emitToken(62 /* CatchKeyword */, node.pos); + var endPos = emitToken(66 /* CatchKeyword */, node.pos); write(" "); - emitToken(11 /* OpenParenToken */, endPos); + emitToken(15 /* OpenParenToken */, endPos); emit(node.variable); - emitToken(12 /* CloseParenToken */, node.variable.end); + emitToken(16 /* CloseParenToken */, node.variable.end); write(" "); emitBlock(node); } function emitDebuggerStatement(node) { - emitToken(66 /* DebuggerKeyword */, node.pos); + emitToken(70 /* DebuggerKeyword */, node.pos); write(";"); } function emitLabelledStatement(node) { @@ -7312,7 +6998,7 @@ var ts; function getContainingModule(node) { do { node = node.parent; - } while (node && node.kind !== 181 /* ModuleDeclaration */); + } while (node && node.kind !== 188 /* ModuleDeclaration */); return node; } function emitModuleMemberName(node) { @@ -7411,7 +7097,7 @@ var ts; } function emitAccessor(node) { emitLeadingComments(node); - write(node.kind === 123 /* GetAccessor */ ? "get " : "set "); + write(node.kind === 127 /* GetAccessor */ ? "get " : "set "); emit(node.name); emitSignatureAndBody(node); emitTrailingComments(node); @@ -7420,15 +7106,15 @@ var ts; if (!node.body) { return emitPinnedOrTripleSlashComments(node); } - if (node.kind !== 121 /* Method */) { + if (node.kind !== 125 /* Method */) { emitLeadingComments(node); } write("function "); - if (node.kind === 175 /* FunctionDeclaration */ || (node.kind === 144 /* FunctionExpression */ && node.name)) { + if (node.kind === 182 /* FunctionDeclaration */ || (node.kind === 149 /* FunctionExpression */ && node.name)) { emit(node.name); } emitSignatureAndBody(node); - if (node.kind !== 121 /* Method */) { + if (node.kind !== 125 /* Method */) { emitTrailingComments(node); } } @@ -7454,16 +7140,16 @@ var ts; write(" {"); scopeEmitStart(node); increaseIndent(); - emitDetachedComments(node.body.kind === 176 /* FunctionBlock */ ? node.body.statements : node.body); + emitDetachedComments(node.body.kind === 183 /* FunctionBlock */ ? node.body.statements : node.body); var startIndex = 0; - if (node.body.kind === 176 /* FunctionBlock */) { + if (node.body.kind === 183 /* FunctionBlock */) { startIndex = emitDirectivePrologues(node.body.statements, true); } var outPos = writer.getTextPos(); emitCaptureThisForNodeIfNecessary(node); emitDefaultValueAssignments(node); emitRestParameter(node); - if (node.body.kind !== 176 /* FunctionBlock */ && outPos === writer.getTextPos()) { + if (node.body.kind !== 183 /* FunctionBlock */ && outPos === writer.getTextPos()) { decreaseIndent(); write(" "); emitStart(node.body); @@ -7476,7 +7162,7 @@ var ts; emitEnd(node.body); } else { - if (node.body.kind === 176 /* FunctionBlock */) { + if (node.body.kind === 183 /* FunctionBlock */) { emitLinesStartingAt(node.body.statements, startIndex); } else { @@ -7488,10 +7174,10 @@ var ts; emitTrailingComments(node.body); } writeLine(); - if (node.body.kind === 176 /* FunctionBlock */) { + if (node.body.kind === 183 /* FunctionBlock */) { emitLeadingCommentsOfPosition(node.body.statements.end); decreaseIndent(); - emitToken(10 /* CloseBraceToken */, node.body.statements.end); + emitToken(14 /* CloseBraceToken */, node.body.statements.end); } else { decreaseIndent(); @@ -7514,11 +7200,11 @@ var ts; function findInitialSuperCall(ctor) { if (ctor.body) { var statement = ctor.body.statements[0]; - if (statement && statement.kind === 154 /* ExpressionStatement */) { + if (statement && statement.kind === 161 /* ExpressionStatement */) { var expr = statement.expression; - if (expr && expr.kind === 140 /* CallExpression */) { + if (expr && expr.kind === 144 /* CallExpression */) { var func = expr.func; - if (func && func.kind === 85 /* SuperKeyword */) { + if (func && func.kind === 89 /* SuperKeyword */) { return statement; } } @@ -7527,7 +7213,7 @@ var ts; } function emitParameterPropertyAssignments(node) { ts.forEach(node.parameters, function (param) { - if (param.flags & ts.NodeFlags.AccessibilityModifier) { + if (param.flags & 112 /* AccessibilityModifier */) { writeLine(); emitStart(param); emitStart(param.name); @@ -7554,7 +7240,7 @@ var ts; } function emitMemberAssignments(node, staticFlag) { ts.forEach(node.members, function (member) { - if (member.kind === 120 /* Property */ && (member.flags & 128 /* Static */) === staticFlag && member.initializer) { + if (member.kind === 124 /* Property */ && (member.flags & 128 /* Static */) === staticFlag && member.initializer) { writeLine(); emitLeadingComments(member); emitStart(member); @@ -7577,7 +7263,7 @@ var ts; } function emitMemberFunctions(node) { ts.forEach(node.members, function (member) { - if (member.kind === 121 /* Method */) { + if (member.kind === 125 /* Method */) { if (!member.body) { return emitPinnedOrTripleSlashComments(member); } @@ -7599,7 +7285,7 @@ var ts; write(";"); emitTrailingComments(member); } - else if (member.kind === 123 /* GetAccessor */ || member.kind === 124 /* SetAccessor */) { + else if (member.kind === 127 /* GetAccessor */ || member.kind === 128 /* SetAccessor */) { var accessors = getAllAccessorDeclarations(node, member); if (member === accessors.firstAccessor) { writeLine(); @@ -7677,11 +7363,11 @@ var ts; write("return "); emitNode(node.name); } - emitToken(10 /* CloseBraceToken */, node.members.end, emitClassReturnStatement); + emitToken(14 /* CloseBraceToken */, node.members.end, emitClassReturnStatement); write(";"); decreaseIndent(); writeLine(); - emitToken(10 /* CloseBraceToken */, node.members.end); + emitToken(14 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); emitStart(node); write(")("); @@ -7702,7 +7388,7 @@ var ts; emitTrailingComments(node); function emitConstructorOfClass() { ts.forEach(node.members, function (member) { - if (member.kind === 122 /* Constructor */ && !member.body) { + if (member.kind === 126 /* Constructor */ && !member.body) { emitPinnedOrTripleSlashComments(member); } }); @@ -7753,7 +7439,7 @@ var ts; emitLeadingCommentsOfPosition(ctor.body.statements.end); } decreaseIndent(); - emitToken(10 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end); + emitToken(14 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end); scopeEmitEnd(); emitEnd(ctor || node); if (ctor) { @@ -7765,6 +7451,10 @@ var ts; emitPinnedOrTripleSlashComments(node); } function emitEnumDeclaration(node) { + var isConstEnum = ts.isConstEnumDeclaration(node); + if (isConstEnum && !compilerOptions.preserveConstEnums) { + return; + } emitLeadingComments(node); if (!(node.flags & 1 /* Export */)) { emitStart(node); @@ -7782,10 +7472,10 @@ var ts; write(") {"); increaseIndent(); scopeEmitStart(node); - emitEnumMemberDeclarations(); + emitEnumMemberDeclarations(isConstEnum); decreaseIndent(); writeLine(); - emitToken(10 /* CloseBraceToken */, node.members.end); + emitToken(14 /* CloseBraceToken */, node.members.end); scopeEmitEnd(); write(")("); emitModuleMemberName(node); @@ -7804,7 +7494,7 @@ var ts; write(";"); } emitTrailingComments(node); - function emitEnumMemberDeclarations() { + function emitEnumMemberDeclarations(isConstEnum) { ts.forEach(node.members, function (member) { writeLine(); emitLeadingComments(member); @@ -7815,7 +7505,7 @@ var ts; write("["); emitQuotedIdentifier(member.name); write("] = "); - if (member.initializer) { + if (member.initializer && !isConstEnum) { emit(member.initializer); } else { @@ -7830,13 +7520,13 @@ var ts; } } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 181 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 188 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } } function emitModuleDeclaration(node) { - if (!ts.isInstantiated(node)) { + if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return emitPinnedOrTripleSlashComments(node); } emitLeadingComments(node); @@ -7852,7 +7542,7 @@ var ts; write(resolver.getLocalNameOfContainer(node)); emitEnd(node.name); write(") "); - if (node.body.kind === 182 /* ModuleBlock */) { + if (node.body.kind === 189 /* ModuleBlock */) { emit(node.body); } else { @@ -7865,7 +7555,7 @@ var ts; decreaseIndent(); writeLine(); var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; - emitToken(10 /* CloseBraceToken */, moduleBlock.statements.end); + emitToken(14 /* CloseBraceToken */, moduleBlock.statements.end); scopeEmitEnd(); } write(")("); @@ -7883,10 +7573,10 @@ var ts; function emitImportDeclaration(node) { var emitImportDeclaration = resolver.isReferencedImportDeclaration(node); if (!emitImportDeclaration) { - emitImportDeclaration = !ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportedViaEntityName(node); + emitImportDeclaration = !ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportWithEntityName(node); } if (emitImportDeclaration) { - if (node.externalModuleName && node.parent.kind === 186 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { + if (node.externalModuleName && node.parent.kind === 193 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { if (node.flags & 1 /* Export */) { writeLine(); emitLeadingComments(node); @@ -7915,7 +7605,7 @@ var ts; emitStart(node.externalModuleName); emitLiteral(node.externalModuleName); emitEnd(node.externalModuleName); - emitToken(12 /* CloseParenToken */, node.externalModuleName.end); + emitToken(16 /* CloseParenToken */, node.externalModuleName.end); } write(";"); emitEnd(node); @@ -7926,7 +7616,7 @@ var ts; function getExternalImportDeclarations(node) { var result = []; ts.forEach(node.statements, function (stat) { - if (stat.kind === 183 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { + if (stat.kind === 190 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { result.push(stat); } }); @@ -7934,7 +7624,7 @@ var ts; } function getFirstExportAssignment(sourceFile) { return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 184 /* ExportAssignment */) { + if (node.kind === 191 /* ExportAssignment */) { return node; } }); @@ -8050,117 +7740,127 @@ var ts; return emitPinnedOrTripleSlashComments(node); } switch (node.kind) { - case 59 /* Identifier */: + case 63 /* Identifier */: return emitIdentifier(node); - case 119 /* Parameter */: + case 123 /* Parameter */: return emitParameter(node); - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return emitAccessor(node); - case 87 /* ThisKeyword */: + case 91 /* ThisKeyword */: return emitThis(node); - case 85 /* SuperKeyword */: + case 89 /* SuperKeyword */: return emitSuper(node); - case 83 /* NullKeyword */: + case 87 /* NullKeyword */: return write("null"); - case 89 /* TrueKeyword */: + case 93 /* TrueKeyword */: return write("true"); - case 74 /* FalseKeyword */: + case 78 /* FalseKeyword */: return write("false"); case 6 /* NumericLiteral */: case 7 /* StringLiteral */: case 8 /* RegularExpressionLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: + case 10 /* TemplateHead */: + case 11 /* TemplateMiddle */: + case 12 /* TemplateTail */: return emitLiteral(node); - case 117 /* QualifiedName */: + case 155 /* TemplateExpression */: + return emitTemplateExpression(node); + case 156 /* TemplateSpan */: + return emitTemplateSpan(node); + case 121 /* QualifiedName */: return emitPropertyAccess(node); - case 135 /* ArrayLiteral */: + case 139 /* ArrayLiteral */: return emitArrayLiteral(node); - case 136 /* ObjectLiteral */: + case 140 /* ObjectLiteral */: return emitObjectLiteral(node); - case 137 /* PropertyAssignment */: + case 141 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 138 /* PropertyAccess */: + case 142 /* PropertyAccess */: return emitPropertyAccess(node); - case 139 /* IndexedAccess */: + case 143 /* IndexedAccess */: return emitIndexedAccess(node); - case 140 /* CallExpression */: + case 144 /* CallExpression */: return emitCallExpression(node); - case 141 /* NewExpression */: + case 145 /* NewExpression */: return emitNewExpression(node); - case 142 /* TypeAssertion */: + case 146 /* TaggedTemplateExpression */: + return emitTaggedTemplateExpression(node); + case 147 /* TypeAssertion */: return emit(node.operand); - case 143 /* ParenExpression */: + case 148 /* ParenExpression */: return emitParenExpression(node); - case 175 /* FunctionDeclaration */: - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: return emitFunctionDeclaration(node); - case 146 /* PrefixOperator */: - case 147 /* PostfixOperator */: + case 151 /* PrefixOperator */: + case 152 /* PostfixOperator */: return emitUnaryExpression(node); - case 148 /* BinaryExpression */: + case 153 /* BinaryExpression */: return emitBinaryExpression(node); - case 149 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return emitConditionalExpression(node); - case 150 /* OmittedExpression */: + case 157 /* OmittedExpression */: return; - case 151 /* Block */: - case 170 /* TryBlock */: - case 172 /* FinallyBlock */: - case 176 /* FunctionBlock */: - case 182 /* ModuleBlock */: + case 158 /* Block */: + case 177 /* TryBlock */: + case 179 /* FinallyBlock */: + case 183 /* FunctionBlock */: + case 189 /* ModuleBlock */: return emitBlock(node); - case 152 /* VariableStatement */: + case 159 /* VariableStatement */: return emitVariableStatement(node); - case 153 /* EmptyStatement */: + case 160 /* EmptyStatement */: return write(";"); - case 154 /* ExpressionStatement */: + case 161 /* ExpressionStatement */: return emitExpressionStatement(node); - case 155 /* IfStatement */: + case 162 /* IfStatement */: return emitIfStatement(node); - case 156 /* DoStatement */: + case 163 /* DoStatement */: return emitDoStatement(node); - case 157 /* WhileStatement */: + case 164 /* WhileStatement */: return emitWhileStatement(node); - case 158 /* ForStatement */: + case 165 /* ForStatement */: return emitForStatement(node); - case 159 /* ForInStatement */: + case 166 /* ForInStatement */: return emitForInStatement(node); - case 160 /* ContinueStatement */: - case 161 /* BreakStatement */: + case 167 /* ContinueStatement */: + case 168 /* BreakStatement */: return emitBreakOrContinueStatement(node); - case 162 /* ReturnStatement */: + case 169 /* ReturnStatement */: return emitReturnStatement(node); - case 163 /* WithStatement */: + case 170 /* WithStatement */: return emitWithStatement(node); - case 164 /* SwitchStatement */: + case 171 /* SwitchStatement */: return emitSwitchStatement(node); - case 165 /* CaseClause */: - case 166 /* DefaultClause */: + case 172 /* CaseClause */: + case 173 /* DefaultClause */: return emitCaseOrDefaultClause(node); - case 167 /* LabeledStatement */: + case 174 /* LabeledStatement */: return emitLabelledStatement(node); - case 168 /* ThrowStatement */: + case 175 /* ThrowStatement */: return emitThrowStatement(node); - case 169 /* TryStatement */: + case 176 /* TryStatement */: return emitTryStatement(node); - case 171 /* CatchBlock */: + case 178 /* CatchBlock */: return emitCatchBlock(node); - case 173 /* DebuggerStatement */: + case 180 /* DebuggerStatement */: return emitDebuggerStatement(node); - case 174 /* VariableDeclaration */: + case 181 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 177 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return emitClassDeclaration(node); - case 178 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 180 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 183 /* ImportDeclaration */: + case 190 /* ImportDeclaration */: return emitImportDeclaration(node); - case 186 /* SourceFile */: + case 193 /* SourceFile */: return emitSourceFile(node); } } @@ -8178,7 +7878,7 @@ var ts; return leadingComments; } function getLeadingCommentsToEmit(node) { - if (node.parent.kind === 186 /* SourceFile */ || node.pos !== node.parent.pos) { + if (node.parent.kind === 193 /* SourceFile */ || node.pos !== node.parent.pos) { var leadingComments; if (hasDetachedComments(node.pos)) { leadingComments = getLeadingCommentsWithoutDetachedComments(); @@ -8195,7 +7895,7 @@ var ts; emitComments(leadingComments, true, writer, writeComment); } function emitTrailingDeclarationComments(node) { - if (node.parent.kind === 186 /* SourceFile */ || node.end !== node.parent.end) { + if (node.parent.kind === 193 /* SourceFile */ || node.end !== node.parent.end) { var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); emitComments(trailingComments, false, writer, writeComment); } @@ -8387,7 +8087,7 @@ var ts; if (node.flags & 1 /* Export */) { write("export "); } - if (node.kind !== 178 /* InterfaceDeclaration */) { + if (node.kind !== 185 /* InterfaceDeclaration */) { write("declare "); } } @@ -8443,7 +8143,7 @@ var ts; emitDeclarationFlags(node); write("module "); emitSourceTextOfNode(node.name); - while (node.body.kind !== 182 /* ModuleBlock */) { + while (node.body.kind !== 189 /* ModuleBlock */) { node = node.body; write("."); emitSourceTextOfNode(node.name); @@ -8485,6 +8185,9 @@ var ts; if (resolver.isDeclarationVisible(node)) { emitJsDocComments(node); emitDeclarationFlags(node); + if (ts.isConstEnumDeclaration(node)) { + write("const "); + } write("enum "); emitSourceTextOfNode(node.name); write(" {"); @@ -8512,34 +8215,34 @@ var ts; function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 177 /* ClassDeclaration */: + case 184 /* 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 178 /* InterfaceDeclaration */: + case 185 /* 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 126 /* ConstructSignature */: + case 130 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 125 /* CallSignature */: + case 129 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 121 /* Method */: + case 125 /* Method */: 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 === 177 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 184 /* 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 175 /* FunctionDeclaration */: + case 182 /* 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: - ts.Debug.fail("This is unknown parent for type parameter: " + ts.SyntaxKind[node.parent.kind]); + ts.Debug.fail("This is unknown parent for type parameter: " + node.parent.kind); } return { diagnosticMessage: diagnosticMessage, @@ -8551,7 +8254,7 @@ var ts; emitJsDocComments(node); decreaseIndent(); emitSourceTextOfNode(node.name); - if (node.constraint && (node.parent.kind !== 121 /* Method */ || !(node.parent.flags & 32 /* Private */))) { + if (node.constraint && (node.parent.kind !== 125 /* Method */ || !(node.parent.flags & 32 /* Private */))) { write(" extends "); getSymbolVisibilityDiagnosticMessage = getTypeParameterConstraintVisibilityError; resolver.writeTypeAtLocation(node.constraint, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); @@ -8573,7 +8276,7 @@ var ts; resolver.writeTypeAtLocation(node, enclosingDeclaration, 1 /* WriteArrayAsGenericType */ | 2 /* UseTypeOfFunction */, writer); function getHeritageClauseVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.parent.kind === 177 /* ClassDeclaration */) { + if (node.parent.kind === 184 /* 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; } @@ -8601,7 +8304,7 @@ var ts; function emitParameterProperties(constructorDeclaration) { if (constructorDeclaration) { ts.forEach(constructorDeclaration.parameters, function (param) { - if (param.flags & ts.NodeFlags.AccessibilityModifier) { + if (param.flags & 112 /* AccessibilityModifier */) { emitPropertyDeclaration(param); } }); @@ -8658,9 +8361,9 @@ var ts; writeLine(); } function emitVariableDeclaration(node) { - if (node.kind !== 174 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { + if (node.kind !== 181 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { emitSourceTextOfNode(node.name); - if (node.kind === 120 /* Property */ && (node.flags & 4 /* QuestionMark */)) { + if (node.kind === 124 /* Property */ && (node.flags & 4 /* QuestionMark */)) { write("?"); } if (!(node.flags & 32 /* Private */)) { @@ -8671,14 +8374,14 @@ var ts; } function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.kind === 174 /* VariableDeclaration */) { + if (node.kind === 181 /* 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 === 120 /* Property */) { + 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 === 177 /* ClassDeclaration */) { + else if (node.parent.kind === 184 /* 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 { @@ -8728,7 +8431,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; - if (node.kind === 124 /* SetAccessor */) { + if (node.kind === 128 /* SetAccessor */) { if (node.parent.flags & 128 /* Static */) { diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; } @@ -8757,14 +8460,14 @@ var ts; } } function emitFunctionDeclaration(node) { - if ((node.kind !== 175 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { + if ((node.kind !== 182 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); emitDeclarationFlags(node); - if (node.kind === 175 /* FunctionDeclaration */) { + if (node.kind === 182 /* FunctionDeclaration */) { write("function "); emitSourceTextOfNode(node.name); } - else if (node.kind === 122 /* Constructor */) { + else if (node.kind === 126 /* Constructor */) { write("constructor"); } else { @@ -8782,24 +8485,24 @@ var ts; emitSignatureDeclaration(node); } function emitSignatureDeclaration(node) { - if (node.kind === 125 /* CallSignature */ || node.kind === 127 /* IndexSignature */) { + if (node.kind === 129 /* CallSignature */ || node.kind === 131 /* IndexSignature */) { emitJsDocComments(node); } emitTypeParameters(node.typeParameters); - if (node.kind === 127 /* IndexSignature */) { + if (node.kind === 131 /* IndexSignature */) { write("["); } else { write("("); } emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 127 /* IndexSignature */) { + if (node.kind === 131 /* IndexSignature */) { write("]"); } else { write(")"); } - if (node.kind !== 122 /* Constructor */ && !(node.flags & 32 /* Private */)) { + if (node.kind !== 126 /* Constructor */ && !(node.flags & 32 /* Private */)) { write(": "); getSymbolVisibilityDiagnosticMessage = getReturnTypeVisibilityError; resolver.writeReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); @@ -8809,31 +8512,31 @@ var ts; function getReturnTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.kind) { - case 126 /* ConstructSignature */: + case 130 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 125 /* CallSignature */: + case 129 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 127 /* IndexSignature */: + case 131 /* IndexSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 121 /* Method */: + case 125 /* Method */: 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 === 177 /* ClassDeclaration */) { + else if (node.parent.kind === 184 /* 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 175 /* FunctionDeclaration */: + case 182 /* 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: - ts.Debug.fail("This is unknown kind for signature: " + ts.SyntaxKind[node.kind]); + ts.Debug.fail("This is unknown kind for signature: " + node.kind); } return { diagnosticMessage: diagnosticMessage, @@ -8860,31 +8563,31 @@ var ts; function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult) { var diagnosticMessage; switch (node.parent.kind) { - case 122 /* Constructor */: + case 126 /* Constructor */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; break; - case 126 /* ConstructSignature */: + case 130 /* ConstructSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 125 /* CallSignature */: + case 129 /* CallSignature */: diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 121 /* Method */: + case 125 /* Method */: 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 === 177 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 184 /* 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 175 /* FunctionDeclaration */: + case 182 /* 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: - ts.Debug.fail("This is unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]); + ts.Debug.fail("This is unknown parent for parameter: " + node.parent.kind); } return { diagnosticMessage: diagnosticMessage, @@ -8895,39 +8598,39 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 122 /* Constructor */: - case 175 /* FunctionDeclaration */: - case 121 /* Method */: + case 126 /* Constructor */: + case 182 /* FunctionDeclaration */: + case 125 /* Method */: return emitFunctionDeclaration(node); - case 126 /* ConstructSignature */: + case 130 /* ConstructSignature */: return emitConstructSignatureDeclaration(node); - case 125 /* CallSignature */: - case 127 /* IndexSignature */: + case 129 /* CallSignature */: + case 131 /* IndexSignature */: return emitSignatureDeclaration(node); - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return emitAccessorDeclaration(node); - case 152 /* VariableStatement */: + case 159 /* VariableStatement */: return emitVariableStatement(node); - case 120 /* Property */: + case 124 /* Property */: return emitPropertyDeclaration(node); - case 178 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 177 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return emitClassDeclaration(node); - case 179 /* TypeAliasDeclaration */: + case 186 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 185 /* EnumMember */: + case 192 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 180 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 183 /* ImportDeclaration */: + case 190 /* ImportDeclaration */: return emitImportDeclaration(node); - case 184 /* ExportAssignment */: + case 191 /* ExportAssignment */: return emitExportAssignment(node); - case 186 /* SourceFile */: + case 193 /* SourceFile */: return emitSourceFile(node); } } @@ -9134,10 +8837,10 @@ var ts; isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, hasEarlyErrors: hasEarlyErrors }; - var undefinedSymbol = createSymbol(4 /* Property */ | 134217728 /* Transient */, "undefined"); - var argumentsSymbol = createSymbol(4 /* Property */ | 134217728 /* Transient */, "arguments"); - var unknownSymbol = createSymbol(4 /* Property */ | 134217728 /* Transient */, "unknown"); - var resolvingSymbol = createSymbol(134217728 /* Transient */, "__resolving__"); + var undefinedSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "undefined"); + var argumentsSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "arguments"); + var unknownSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "unknown"); + var resolvingSymbol = createSymbol(268435456 /* Transient */, "__resolving__"); var anyType = createIntrinsicType(1 /* Any */, "any"); var stringType = createIntrinsicType(2 /* String */, "string"); var numberType = createIntrinsicType(4 /* Number */, "number"); @@ -9186,35 +8889,37 @@ var ts; function getExcludedSymbolFlags(flags) { var result = 0; if (flags & 2 /* BlockScopedVariable */) - result |= ts.SymbolFlags.BlockScopedVariableExcludes; + result |= 107455 /* BlockScopedVariableExcludes */; if (flags & 1 /* FunctionScopedVariable */) - result |= ts.SymbolFlags.FunctionScopedVariableExcludes; + result |= 107454 /* FunctionScopedVariableExcludes */; if (flags & 4 /* Property */) - result |= ts.SymbolFlags.PropertyExcludes; + result |= 107455 /* PropertyExcludes */; if (flags & 8 /* EnumMember */) - result |= ts.SymbolFlags.EnumMemberExcludes; + result |= 107455 /* EnumMemberExcludes */; if (flags & 16 /* Function */) - result |= ts.SymbolFlags.FunctionExcludes; + result |= 106927 /* FunctionExcludes */; if (flags & 32 /* Class */) - result |= ts.SymbolFlags.ClassExcludes; + result |= 3258879 /* ClassExcludes */; if (flags & 64 /* Interface */) - result |= ts.SymbolFlags.InterfaceExcludes; - if (flags & 128 /* Enum */) - result |= ts.SymbolFlags.EnumExcludes; - if (flags & 256 /* ValueModule */) - result |= ts.SymbolFlags.ValueModuleExcludes; - if (flags & 4096 /* Method */) - result |= ts.SymbolFlags.MethodExcludes; - if (flags & 16384 /* GetAccessor */) - result |= ts.SymbolFlags.GetAccessorExcludes; - if (flags & 32768 /* SetAccessor */) - result |= ts.SymbolFlags.SetAccessorExcludes; - if (flags & 524288 /* TypeParameter */) - result |= ts.SymbolFlags.TypeParameterExcludes; - if (flags & 1048576 /* TypeAlias */) - result |= ts.SymbolFlags.TypeAliasExcludes; - if (flags & 16777216 /* Import */) - result |= ts.SymbolFlags.ImportExcludes; + result |= 3152288 /* InterfaceExcludes */; + if (flags & 256 /* RegularEnum */) + result |= 3258623 /* RegularEnumExcludes */; + if (flags & 128 /* ConstEnum */) + result |= 3259263 /* ConstEnumExcludes */; + if (flags & 512 /* ValueModule */) + result |= 106639 /* ValueModuleExcludes */; + if (flags & 8192 /* Method */) + result |= 99263 /* MethodExcludes */; + if (flags & 32768 /* GetAccessor */) + result |= 41919 /* GetAccessorExcludes */; + if (flags & 65536 /* SetAccessor */) + result |= 74687 /* SetAccessorExcludes */; + if (flags & 1048576 /* TypeParameter */) + result |= 2103776 /* TypeParameterExcludes */; + if (flags & 2097152 /* TypeAlias */) + result |= 3152352 /* TypeAliasExcludes */; + if (flags & 33554432 /* Import */) + result |= 33554432 /* ImportExcludes */; return result; } function recordMergedSymbol(target, source) { @@ -9223,11 +8928,13 @@ var ts; mergedSymbols[source.mergeId] = target; } function cloneSymbol(symbol) { - var result = createSymbol(symbol.flags | 67108864 /* Merged */, symbol.name); + var result = createSymbol(symbol.flags | 134217728 /* Merged */, symbol.name); result.declarations = symbol.declarations.slice(0); result.parent = symbol.parent; if (symbol.valueDeclaration) result.valueDeclaration = symbol.valueDeclaration; + if (symbol.constEnumOnlyModule) + result.constEnumOnlyModule = true; if (symbol.members) result.members = cloneSymbolTable(symbol.members); if (symbol.exports) @@ -9237,6 +8944,9 @@ var ts; } function extendSymbol(target, source) { if (!(target.flags & getExcludedSymbolFlags(source.flags))) { + if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) { + target.constEnumOnlyModule = false; + } target.flags |= source.flags; if (!target.valueDeclaration && source.valueDeclaration) target.valueDeclaration = source.valueDeclaration; @@ -9282,7 +8992,7 @@ var ts; } else { var symbol = target[id]; - if (!(symbol.flags & 67108864 /* Merged */)) { + if (!(symbol.flags & 134217728 /* Merged */)) { target[id] = symbol = cloneSymbol(symbol); } extendSymbol(symbol, source[id]); @@ -9291,7 +9001,7 @@ var ts; } } function getSymbolLinks(symbol) { - if (symbol.flags & 134217728 /* Transient */) + if (symbol.flags & 268435456 /* Transient */) return symbol; if (!symbol.id) symbol.id = nextSymbolId++; @@ -9303,19 +9013,19 @@ var ts; return nodeLinks[node.id] || (nodeLinks[node.id] = {}); } function getSourceFile(node) { - return ts.getAncestor(node, 186 /* SourceFile */); + return ts.getAncestor(node, 193 /* SourceFile */); } function isGlobalSourceFile(node) { - return node.kind === 186 /* SourceFile */ && !ts.isExternalModule(node); + return node.kind === 193 /* SourceFile */ && !ts.isExternalModule(node); } function getSymbol(symbols, name, meaning) { if (meaning && ts.hasProperty(symbols, name)) { var symbol = symbols[name]; - ts.Debug.assert((symbol.flags & 33554432 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); if (symbol.flags & meaning) { return symbol; } - if (symbol.flags & 16777216 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { var target = resolveImport(symbol); if (target === unknownSymbol || target.flags & meaning) { return symbol; @@ -9323,6 +9033,18 @@ var ts; } } } + function isDefinedBefore(node1, node2) { + var file1 = ts.getSourceFileOfNode(node1); + var file2 = ts.getSourceFileOfNode(node2); + if (file1 === file2) { + return node1.pos <= node2.pos; + } + if (!compilerOptions.out) { + return true; + } + var sourceFiles = program.getSourceFiles(); + return sourceFiles.indexOf(file1) <= sourceFiles.indexOf(file2); + } function resolveName(location, name, meaning, nameNotFoundMessage, nameArg) { var result; var lastLocation; @@ -9335,32 +9057,32 @@ var ts; } } switch (location.kind) { - case 186 /* SourceFile */: + case 193 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 181 /* ModuleDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & ts.SymbolFlags.ModuleMember)) { + case 188 /* ModuleDeclaration */: + if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 35653619 /* ModuleMember */)) { break loop; } break; - case 180 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 120 /* Property */: - if (location.parent.kind === 177 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { + case 124 /* Property */: + if (location.parent.kind === 184 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { - if (getSymbol(ctor.locals, name, meaning & ts.SymbolFlags.Value)) { + if (getSymbol(ctor.locals, name, meaning & 107455 /* Value */)) { propertyWithInvalidInitializer = location; } } } break; - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & ts.SymbolFlags.Type)) { + case 184 /* ClassDeclaration */: + case 185 /* 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); return undefined; @@ -9368,18 +9090,18 @@ var ts; break loop; } break; - case 121 /* Method */: - case 122 /* Constructor */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 175 /* FunctionDeclaration */: - case 145 /* ArrowFunction */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 182 /* FunctionDeclaration */: + case 150 /* ArrowFunction */: if (name === "arguments") { result = argumentsSymbol; break loop; } break; - case 144 /* FunctionExpression */: + case 149 /* FunctionExpression */: if (name === "arguments") { result = argumentsSymbol; break loop; @@ -9390,7 +9112,7 @@ var ts; break loop; } break; - case 171 /* CatchBlock */: + case 178 /* CatchBlock */: var id = location.variable; if (name === id.text) { result = location.symbol; @@ -9417,31 +9139,21 @@ var ts; return undefined; } if (result.flags & 2 /* BlockScopedVariable */) { - var declaration = ts.forEach(result.declarations, function (d) { return d.flags & ts.NodeFlags.BlockScoped ? d : undefined; }); - ts.Debug.assert(declaration, "Block-scoped variable declaration is undefined"); - var declarationSourceFile = ts.getSourceFileOfNode(declaration); - var referenceSourceFile = ts.getSourceFileOfNode(errorLocation); - if (declarationSourceFile === referenceSourceFile) { - if (declaration.pos > errorLocation.pos) { - error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.identifierToString(declaration.name)); - } - } - else if (compilerOptions.out) { - var sourceFiles = program.getSourceFiles(); - if (sourceFiles.indexOf(referenceSourceFile) < sourceFiles.indexOf(declarationSourceFile)) { - error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.identifierToString(declaration.name)); - } + 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)); } } } return result; } function resolveImport(symbol) { - ts.Debug.assert((symbol.flags & 16777216 /* Import */) !== 0, "Should only get Imports here."); + ts.Debug.assert((symbol.flags & 33554432 /* Import */) !== 0, "Should only get Imports here."); var links = getSymbolLinks(symbol); if (!links.target) { links.target = resolvingSymbol; - var node = getDeclarationOfKind(symbol, 183 /* ImportDeclaration */); + var node = getDeclarationOfKind(symbol, 190 /* ImportDeclaration */); var target = node.externalModuleName ? resolveExternalModuleName(node, node.externalModuleName) : getSymbolOfPartOfRightHandSideOfImport(node.entityName, node); if (links.target === resolvingSymbol) { links.target = target || unknownSymbol; @@ -9457,33 +9169,33 @@ var ts; } function getSymbolOfPartOfRightHandSideOfImport(entityName, importDeclaration) { if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 183 /* ImportDeclaration */); - ts.Debug.assert(importDeclaration); + importDeclaration = ts.getAncestor(entityName, 190 /* ImportDeclaration */); + ts.Debug.assert(importDeclaration !== undefined); } - if (entityName.kind === 59 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + if (entityName.kind === 63 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 59 /* Identifier */ || entityName.parent.kind === 117 /* QualifiedName */) { - return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Namespace); + if (entityName.kind === 63 /* Identifier */ || entityName.parent.kind === 121 /* QualifiedName */) { + return resolveEntityName(importDeclaration, entityName, 1536 /* Namespace */); } else { - ts.Debug.assert(entityName.parent.kind === 183 /* ImportDeclaration */); - return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace); + ts.Debug.assert(entityName.parent.kind === 190 /* ImportDeclaration */); + return resolveEntityName(importDeclaration, entityName, 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */); } } function getFullyQualifiedName(symbol) { return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); } function resolveEntityName(location, name, meaning) { - if (name.kind === 59 /* Identifier */) { + if (name.kind === 63 /* Identifier */) { var symbol = resolveName(location, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name); if (!symbol) { return; } } - else if (name.kind === 117 /* QualifiedName */) { - var namespace = resolveEntityName(location, name.left, ts.SymbolFlags.Namespace); - if (!namespace || namespace === unknownSymbol || name.right.kind === 116 /* Missing */) + else if (name.kind === 121 /* QualifiedName */) { + var namespace = resolveEntityName(location, name.left, 1536 /* Namespace */); + if (!namespace || namespace === unknownSymbol || name.right.kind === 120 /* Missing */) return; var symbol = getSymbol(namespace.exports, name.right.text, meaning); if (!symbol) { @@ -9494,7 +9206,7 @@ var ts; else { return; } - ts.Debug.assert((symbol.flags & 33554432 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); + ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); return symbol.flags & meaning ? symbol : resolveImport(symbol); } function isExternalModuleNameRelative(moduleName) { @@ -9507,7 +9219,7 @@ var ts; return; var isRelative = isExternalModuleNameRelative(moduleName); if (!isRelative) { - var symbol = getSymbol(globals, '"' + moduleName + '"', 256 /* ValueModule */); + var symbol = getSymbol(globals, '"' + moduleName + '"', 512 /* ValueModule */); if (symbol) { return getResolvedExportSymbol(symbol); } @@ -9534,10 +9246,10 @@ var ts; function getResolvedExportSymbol(moduleSymbol) { var symbol = getExportAssignmentSymbol(moduleSymbol); if (symbol) { - if (symbol.flags & (ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace)) { + if (symbol.flags & (107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */)) { return symbol; } - if (symbol.flags & 16777216 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { return resolveImport(symbol); } } @@ -9561,7 +9273,7 @@ var ts; error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); } if (node.exportName.text) { - var meaning = ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace; + var meaning = 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */; var exportSymbol = resolveName(node, node.exportName.text, meaning, ts.Diagnostics.Cannot_find_name_0, node.exportName); } } @@ -9572,9 +9284,9 @@ var ts; var seenExportedMember = false; var result = []; ts.forEach(symbol.declarations, function (declaration) { - var block = (declaration.kind === 186 /* SourceFile */ ? declaration : declaration.body); + var block = (declaration.kind === 193 /* SourceFile */ ? declaration : declaration.body); ts.forEach(block.statements, function (node) { - if (node.kind === 184 /* ExportAssignment */) { + if (node.kind === 191 /* ExportAssignment */) { result.push(node); } else { @@ -9598,17 +9310,17 @@ var ts; return getMergedSymbol(symbol.parent); } function getExportSymbolOfValueSymbolIfExported(symbol) { - return symbol && (symbol.flags & 2097152 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; + return symbol && (symbol.flags & 4194304 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; } function symbolIsValue(symbol) { - if (symbol.flags & 33554432 /* Instantiated */) { + if (symbol.flags & 67108864 /* Instantiated */) { return symbolIsValue(getSymbolLinks(symbol).target); } - if (symbol.flags & ts.SymbolFlags.Value) { + if (symbol.flags & 107455 /* Value */) { return true; } - if (symbol.flags & 16777216 /* Import */) { - return (resolveImport(symbol).flags & ts.SymbolFlags.Value) !== 0; + if (symbol.flags & 33554432 /* Import */) { + return (resolveImport(symbol).flags & 107455 /* Value */) !== 0; } return false; } @@ -9616,7 +9328,7 @@ var ts; var members = node.members; for (var i = 0; i < members.length; i++) { var member = members[i]; - if (member.kind === 122 /* Constructor */ && member.body) { + if (member.kind === 126 /* Constructor */ && member.body) { return member; } } @@ -9670,7 +9382,7 @@ var ts; return setObjectTypeMembers(createObjectType(32768 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } function isOptionalProperty(propertySymbol) { - return propertySymbol.valueDeclaration && propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */ && propertySymbol.valueDeclaration.kind !== 119 /* Parameter */; + return propertySymbol.valueDeclaration && propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */ && propertySymbol.valueDeclaration.kind !== 123 /* Parameter */; } function forEachSymbolTableInScope(enclosingDeclaration, callback) { var result; @@ -9681,17 +9393,17 @@ var ts; } } switch (location.kind) { - case 186 /* SourceFile */: + case 193 /* SourceFile */: if (!ts.isExternalModule(location)) { break; } - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location).exports)) { return result; } break; - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: if (result = callback(getSymbolOfNode(location).members)) { return result; } @@ -9701,7 +9413,7 @@ var ts; return callback(globals); } function getQualifiedLeftMeaning(rightMeaning) { - return rightMeaning === ts.SymbolFlags.Value ? ts.SymbolFlags.Value : ts.SymbolFlags.Namespace; + return rightMeaning === 107455 /* Value */ ? 107455 /* Value */ : 1536 /* Namespace */; } function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing) { function getAccessibleSymbolChainFromSymbolTable(symbols) { @@ -9721,8 +9433,8 @@ var ts; return [symbol]; } return ts.forEachValue(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 16777216 /* Import */) { - if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 183 /* ImportDeclaration */ && declaration.externalModuleName; })) { + if (symbolFromSymbolTable.flags & 33554432 /* Import */) { + if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 190 /* ImportDeclaration */ && declaration.externalModuleName; })) { var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable); if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) { return [symbolFromSymbolTable]; @@ -9749,7 +9461,7 @@ var ts; if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 16777216 /* Import */) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 33554432 /* Import */) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -9759,7 +9471,7 @@ var ts; return qualify; } function isSymbolAccessible(symbol, enclosingDeclaration, meaning) { - if (symbol && enclosingDeclaration && !(symbol.flags & 524288 /* TypeParameter */)) { + if (symbol && enclosingDeclaration && !(symbol.flags & 1048576 /* TypeParameter */)) { var initialSymbol = symbol; var meaningToLook = meaning; while (symbol) { @@ -9770,7 +9482,7 @@ var ts; return { accessibility: 1 /* NotAccessible */, errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), - errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, ts.SymbolFlags.Namespace) : undefined + errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, 1536 /* Namespace */) : undefined }; } return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasAccessibleDeclarations.aliasesToMakeVisible }; @@ -9804,7 +9516,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 181 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 186 /* SourceFile */ && ts.isExternalModule(declaration)); + return (declaration.kind === 188 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 193 /* SourceFile */ && ts.isExternalModule(declaration)); } function hasVisibleDeclarations(symbol) { var aliasesToMakeVisible; @@ -9814,7 +9526,7 @@ var ts; return { aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 183 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { + if (declaration.kind === 190 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { if (!ts.contains(aliasesToMakeVisible, declaration)) { @@ -9833,7 +9545,7 @@ var ts; } function isImportDeclarationEntityNameReferenceDeclarationVisibile(entityName) { var firstIdentifier = getFirstIdentifier(entityName); - var symbolOfNameSpace = resolveName(entityName.parent, firstIdentifier.text, ts.SymbolFlags.Namespace, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); + 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) }; } @@ -9872,12 +9584,12 @@ var ts; return result; } function getTypeAliasForTypeLiteral(type) { - if (type.symbol && type.symbol.flags & 1024 /* TypeLiteral */) { + if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { var node = type.symbol.declarations[0].parent; - while (node.kind === 134 /* ParenType */) { + while (node.kind === 138 /* ParenType */) { node = node.parent; } - if (node.kind === 179 /* TypeAliasDeclaration */) { + if (node.kind === 186 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -9900,14 +9612,14 @@ var ts; function appendParentTypeArgumentsAndSymbolName(symbol) { if (parentSymbol) { if (flags & 1 /* WriteTypeParametersOrArguments */) { - if (symbol.flags & 33554432 /* Instantiated */) { + if (symbol.flags & 67108864 /* Instantiated */) { buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration); } else { buildTypeParameterDisplayFromSymbol(parentSymbol, writer, enclosingDeclaration); } } - writePunctuation(writer, 15 /* DotToken */); + writePunctuation(writer, 19 /* DotToken */); } parentSymbol = symbol; appendSymbolNameOnly(symbol, writer); @@ -9928,14 +9640,14 @@ var ts; if (!parentSymbol && ts.forEach(symbol.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); })) { return; } - if (symbol.flags & 1024 /* TypeLiteral */ || symbol.flags & 2048 /* ObjectLiteral */) { + if (symbol.flags & 2048 /* TypeLiteral */ || symbol.flags & 4096 /* ObjectLiteral */) { return; } appendParentTypeArgumentsAndSymbolName(symbol); } } } - if (enclosingDeclaration && !(symbol.flags & 524288 /* TypeParameter */)) { + if (enclosingDeclaration && !(symbol.flags & 1048576 /* TypeParameter */)) { walkSymbol(symbol, meaning); return; } @@ -9945,14 +9657,14 @@ var ts; var globalFlagsToPass = globalFlags & 16 /* WriteOwnNameForAnyLike */; return writeType(type, globalFlags); function writeType(type, flags) { - if (type.flags & ts.TypeFlags.Intrinsic) { + if (type.flags & 127 /* Intrinsic */) { writer.writeKeyword(!(globalFlags & 16 /* WriteOwnNameForAnyLike */) && (type.flags & 1 /* Any */) ? "any" : type.intrinsicName); } else if (type.flags & 4096 /* Reference */) { writeTypeReference(type, flags); } else if (type.flags & (1024 /* Class */ | 2048 /* Interface */ | 128 /* Enum */ | 512 /* TypeParameter */)) { - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, ts.SymbolFlags.Type); + buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 3152352 /* Type */); } else if (type.flags & 8192 /* Tuple */) { writeTupleType(type); @@ -9967,11 +9679,11 @@ var ts; writer.writeStringLiteral(type.text); } else { - writePunctuation(writer, 9 /* OpenBraceToken */); + writePunctuation(writer, 13 /* OpenBraceToken */); writeSpace(writer); - writePunctuation(writer, 16 /* DotDotDotToken */); + writePunctuation(writer, 20 /* DotDotDotToken */); writeSpace(writer); - writePunctuation(writer, 10 /* CloseBraceToken */); + writePunctuation(writer, 14 /* CloseBraceToken */); } } function writeTypeList(types, union) { @@ -9980,7 +9692,7 @@ var ts; if (union) { writeSpace(writer); } - writePunctuation(writer, union ? 39 /* BarToken */ : 18 /* CommaToken */); + writePunctuation(writer, union ? 43 /* BarToken */ : 22 /* CommaToken */); writeSpace(writer); } writeType(types[i], union ? 64 /* InElementType */ : 0 /* None */); @@ -9989,32 +9701,32 @@ var ts; function writeTypeReference(type, flags) { if (type.target === globalArrayType && !(flags & 1 /* WriteArrayAsGenericType */)) { writeType(type.typeArguments[0], 64 /* InElementType */); - writePunctuation(writer, 13 /* OpenBracketToken */); - writePunctuation(writer, 14 /* CloseBracketToken */); + writePunctuation(writer, 17 /* OpenBracketToken */); + writePunctuation(writer, 18 /* CloseBracketToken */); } else { - buildSymbolDisplay(type.target.symbol, writer, enclosingDeclaration, ts.SymbolFlags.Type); - writePunctuation(writer, 19 /* LessThanToken */); + buildSymbolDisplay(type.target.symbol, writer, enclosingDeclaration, 3152352 /* Type */); + writePunctuation(writer, 23 /* LessThanToken */); writeTypeList(type.typeArguments, false); - writePunctuation(writer, 20 /* GreaterThanToken */); + writePunctuation(writer, 24 /* GreaterThanToken */); } } function writeTupleType(type) { - writePunctuation(writer, 13 /* OpenBracketToken */); + writePunctuation(writer, 17 /* OpenBracketToken */); writeTypeList(type.elementTypes, false); - writePunctuation(writer, 14 /* CloseBracketToken */); + writePunctuation(writer, 18 /* CloseBracketToken */); } function writeUnionType(type, flags) { if (flags & 64 /* InElementType */) { - writePunctuation(writer, 11 /* OpenParenToken */); + writePunctuation(writer, 15 /* OpenParenToken */); } writeTypeList(type.types, true); if (flags & 64 /* InElementType */) { - writePunctuation(writer, 12 /* CloseParenToken */); + writePunctuation(writer, 16 /* CloseParenToken */); } } function writeAnonymousType(type, flags) { - if (type.symbol && type.symbol.flags & (32 /* Class */ | 128 /* Enum */ | 256 /* ValueModule */)) { + if (type.symbol && type.symbol.flags & (32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { writeTypeofSymbol(type); } else if (shouldWriteTypeOfFunctionSymbol()) { @@ -10023,10 +9735,10 @@ var ts; else if (typeStack && ts.contains(typeStack, type)) { var typeAlias = getTypeAliasForTypeLiteral(type); if (typeAlias) { - buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, ts.SymbolFlags.Type); + buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 3152352 /* Type */); } else { - writeKeyword(writer, 105 /* AnyKeyword */); + writeKeyword(writer, 109 /* AnyKeyword */); } } else { @@ -10039,8 +9751,8 @@ var ts; } function shouldWriteTypeOfFunctionSymbol() { if (type.symbol) { - var isStaticMethodSymbol = !!(type.symbol.flags & 4096 /* 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 === 186 /* SourceFile */ || declaration.parent.kind === 182 /* ModuleBlock */; })); + 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 */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return !!(flags & 2 /* UseTypeOfFunction */) || (typeStack && ts.contains(typeStack, type)); } @@ -10048,111 +9760,111 @@ var ts; } } function writeTypeofSymbol(type) { - writeKeyword(writer, 91 /* TypeOfKeyword */); + writeKeyword(writer, 95 /* TypeOfKeyword */); writeSpace(writer); - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, ts.SymbolFlags.Value); + buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455 /* Value */); } function writeLiteralType(type, flags) { var resolved = resolveObjectOrUnionTypeMembers(type); if (!resolved.properties.length && !resolved.stringIndexType && !resolved.numberIndexType) { if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { - writePunctuation(writer, 9 /* OpenBraceToken */); - writePunctuation(writer, 10 /* CloseBraceToken */); + writePunctuation(writer, 13 /* OpenBraceToken */); + writePunctuation(writer, 14 /* CloseBraceToken */); return; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { if (flags & 64 /* InElementType */) { - writePunctuation(writer, 11 /* OpenParenToken */); + writePunctuation(writer, 15 /* OpenParenToken */); } buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, typeStack); if (flags & 64 /* InElementType */) { - writePunctuation(writer, 12 /* CloseParenToken */); + writePunctuation(writer, 16 /* CloseParenToken */); } return; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { if (flags & 64 /* InElementType */) { - writePunctuation(writer, 11 /* OpenParenToken */); + writePunctuation(writer, 15 /* OpenParenToken */); } - writeKeyword(writer, 82 /* NewKeyword */); + writeKeyword(writer, 86 /* NewKeyword */); writeSpace(writer); buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, typeStack); if (flags & 64 /* InElementType */) { - writePunctuation(writer, 12 /* CloseParenToken */); + writePunctuation(writer, 16 /* CloseParenToken */); } return; } } - writePunctuation(writer, 9 /* OpenBraceToken */); + writePunctuation(writer, 13 /* OpenBraceToken */); writer.writeLine(); writer.increaseIndent(); for (var i = 0; i < resolved.callSignatures.length; i++) { buildSignatureDisplay(resolved.callSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } for (var i = 0; i < resolved.constructSignatures.length; i++) { - writeKeyword(writer, 82 /* NewKeyword */); + writeKeyword(writer, 86 /* NewKeyword */); writeSpace(writer); buildSignatureDisplay(resolved.constructSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } if (resolved.stringIndexType) { - writePunctuation(writer, 13 /* OpenBracketToken */); + writePunctuation(writer, 17 /* OpenBracketToken */); writer.writeParameter("x"); - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); - writeKeyword(writer, 114 /* StringKeyword */); - writePunctuation(writer, 14 /* CloseBracketToken */); - writePunctuation(writer, 46 /* ColonToken */); + writeKeyword(writer, 118 /* StringKeyword */); + writePunctuation(writer, 18 /* CloseBracketToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); writeType(resolved.stringIndexType, 0 /* None */); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } if (resolved.numberIndexType) { - writePunctuation(writer, 13 /* OpenBracketToken */); + writePunctuation(writer, 17 /* OpenBracketToken */); writer.writeParameter("x"); - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); - writeKeyword(writer, 112 /* NumberKeyword */); - writePunctuation(writer, 14 /* CloseBracketToken */); - writePunctuation(writer, 46 /* ColonToken */); + writeKeyword(writer, 116 /* NumberKeyword */); + writePunctuation(writer, 18 /* CloseBracketToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); writeType(resolved.numberIndexType, 0 /* None */); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } for (var i = 0; i < resolved.properties.length; i++) { var p = resolved.properties[i]; var t = getTypeOfSymbol(p); - if (p.flags & (16 /* Function */ | 4096 /* Method */) && !getPropertiesOfObjectType(t).length) { + if (p.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, 0 /* Call */); for (var j = 0; j < signatures.length; j++) { buildSymbolDisplay(p, writer); if (isOptionalProperty(p)) { - writePunctuation(writer, 45 /* QuestionToken */); + writePunctuation(writer, 49 /* QuestionToken */); } buildSignatureDisplay(signatures[j], writer, enclosingDeclaration, globalFlagsToPass, typeStack); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } } else { buildSymbolDisplay(p, writer); if (isOptionalProperty(p)) { - writePunctuation(writer, 45 /* QuestionToken */); + writePunctuation(writer, 49 /* QuestionToken */); } - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); writeType(t, 0 /* None */); - writePunctuation(writer, 17 /* SemicolonToken */); + writePunctuation(writer, 21 /* SemicolonToken */); writer.writeLine(); } } writer.decreaseIndent(); - writePunctuation(writer, 10 /* CloseBraceToken */); + writePunctuation(writer, 14 /* CloseBraceToken */); } } function buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaraiton, flags) { @@ -10166,67 +9878,67 @@ var ts; var constraint = getConstraintOfTypeParameter(tp); if (constraint) { writeSpace(writer); - writeKeyword(writer, 73 /* ExtendsKeyword */); + writeKeyword(writer, 77 /* ExtendsKeyword */); writeSpace(writer); buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, typeStack); } } function buildParameterDisplay(p, writer, enclosingDeclaration, flags, typeStack) { if (getDeclarationFlagsFromSymbol(p) & 8 /* Rest */) { - writePunctuation(writer, 16 /* DotDotDotToken */); + writePunctuation(writer, 20 /* DotDotDotToken */); } appendSymbolNameOnly(p, writer); if (p.valueDeclaration.flags & 4 /* QuestionMark */ || p.valueDeclaration.initializer) { - writePunctuation(writer, 45 /* QuestionToken */); + writePunctuation(writer, 49 /* QuestionToken */); } - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); writeSpace(writer); buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, typeStack); } function buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, enclosingDeclaration, flags, typeStack) { if (typeParameters && typeParameters.length) { - writePunctuation(writer, 19 /* LessThanToken */); + writePunctuation(writer, 23 /* LessThanToken */); for (var i = 0; i < typeParameters.length; i++) { if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); + writePunctuation(writer, 22 /* CommaToken */); writeSpace(writer); } buildTypeParameterDisplay(typeParameters[i], writer, enclosingDeclaration, flags, typeStack); } - writePunctuation(writer, 20 /* GreaterThanToken */); + writePunctuation(writer, 24 /* GreaterThanToken */); } } function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration, flags, typeStack) { if (typeParameters && typeParameters.length) { - writePunctuation(writer, 19 /* LessThanToken */); + writePunctuation(writer, 23 /* LessThanToken */); for (var i = 0; i < typeParameters.length; i++) { if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); + writePunctuation(writer, 22 /* CommaToken */); writeSpace(writer); } buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, 0 /* None */); } - writePunctuation(writer, 20 /* GreaterThanToken */); + writePunctuation(writer, 24 /* GreaterThanToken */); } } function buildDisplayForParametersAndDelimiters(parameters, writer, enclosingDeclaration, flags, typeStack) { - writePunctuation(writer, 11 /* OpenParenToken */); + writePunctuation(writer, 15 /* OpenParenToken */); for (var i = 0; i < parameters.length; i++) { if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); + writePunctuation(writer, 22 /* CommaToken */); writeSpace(writer); } buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, typeStack); } - writePunctuation(writer, 12 /* CloseParenToken */); + writePunctuation(writer, 16 /* CloseParenToken */); } function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, typeStack) { if (flags & 8 /* WriteArrowStyleSignature */) { writeSpace(writer); - writePunctuation(writer, 27 /* EqualsGreaterThanToken */); + writePunctuation(writer, 31 /* EqualsGreaterThanToken */); } else { - writePunctuation(writer, 46 /* ColonToken */); + writePunctuation(writer, 50 /* ColonToken */); } writeSpace(writer); buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags, typeStack); @@ -10259,12 +9971,12 @@ var ts; function isDeclarationVisible(node) { function getContainingExternalModule(node) { for (; node; node = node.parent) { - if (node.kind === 181 /* ModuleDeclaration */) { + if (node.kind === 188 /* ModuleDeclaration */) { if (node.name.kind === 7 /* StringLiteral */) { return node; } } - else if (node.kind === 186 /* SourceFile */) { + else if (node.kind === 193 /* SourceFile */) { return ts.isExternalModule(node) ? node : undefined; } } @@ -10280,7 +9992,7 @@ var ts; if (isSymbolUsedInExportAssignment(symbolOfNode)) { return true; } - if (symbolOfNode.flags & 16777216 /* Import */) { + if (symbolOfNode.flags & 33554432 /* Import */) { return isSymbolUsedInExportAssignment(resolveImport(symbolOfNode)); } } @@ -10288,7 +10000,7 @@ var ts; if (exportAssignmentSymbol === symbol) { return true; } - if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 16777216 /* Import */)) { + if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 33554432 /* Import */)) { resolvedExportSymbol = resolvedExportSymbol || resolveImport(exportAssignmentSymbol); if (resolvedExportSymbol === symbol) { return true; @@ -10306,35 +10018,35 @@ var ts; } function determineIfDeclarationIsVisible() { switch (node.kind) { - case 174 /* VariableDeclaration */: - case 181 /* ModuleDeclaration */: - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - case 179 /* TypeAliasDeclaration */: - case 175 /* FunctionDeclaration */: - case 180 /* EnumDeclaration */: - case 183 /* ImportDeclaration */: - var parent = node.kind === 174 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (!(node.flags & 1 /* Export */) && !(node.kind !== 183 /* ImportDeclaration */ && parent.kind !== 186 /* SourceFile */ && ts.isInAmbientContext(parent))) { + 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))) { return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); } return isDeclarationVisible(parent); - case 120 /* Property */: - case 121 /* Method */: + case 124 /* Property */: + case 125 /* Method */: if (node.flags & (32 /* Private */ | 64 /* Protected */)) { return false; } - case 122 /* Constructor */: - case 126 /* ConstructSignature */: - case 125 /* CallSignature */: - case 127 /* IndexSignature */: - case 119 /* Parameter */: - case 182 /* ModuleBlock */: + case 126 /* Constructor */: + case 130 /* ConstructSignature */: + case 129 /* CallSignature */: + case 131 /* IndexSignature */: + case 123 /* Parameter */: + case 189 /* ModuleBlock */: return isDeclarationVisible(node.parent); - case 186 /* SourceFile */: + case 193 /* SourceFile */: return true; default: - ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + ts.SyntaxKind[node.kind]); + ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } } if (node) { @@ -10350,16 +10062,16 @@ var ts; return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; } function getTypeOfVariableDeclaration(declaration) { - if (declaration.parent.kind === 159 /* ForInStatement */) { + if (declaration.parent.kind === 166 /* ForInStatement */) { return anyType; } if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 119 /* Parameter */) { + if (declaration.kind === 123 /* Parameter */) { var func = declaration.parent; - if (func.kind === 124 /* SetAccessor */) { - var getter = getDeclarationOfKind(declaration.parent.symbol, 123 /* GetAccessor */); + if (func.kind === 128 /* SetAccessor */) { + var getter = getDeclarationOfKind(declaration.parent.symbol, 127 /* GetAccessor */); if (getter) { return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); } @@ -10371,7 +10083,7 @@ var ts; } if (declaration.initializer) { var type = checkAndMarkExpression(declaration.initializer); - if (declaration.kind !== 137 /* PropertyAssignment */) { + if (declaration.kind !== 141 /* PropertyAssignment */) { var unwidenedType = type; type = getWidenedType(type); if (type !== unwidenedType) { @@ -10390,14 +10102,14 @@ var ts; if (getInnermostTypeOfNestedArrayTypes(type) !== anyType) { return; } - if (isPrivateWithinAmbient(declaration) || (declaration.kind === 119 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { + if (isPrivateWithinAmbient(declaration) || (declaration.kind === 123 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { return; } switch (declaration.kind) { - case 120 /* Property */: + case 124 /* Property */: var diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 119 /* Parameter */: + case 123 /* Parameter */: var diagnostic = declaration.flags & 8 /* Rest */ ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; default: @@ -10409,11 +10121,11 @@ var ts; function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.flags & 268435456 /* Prototype */) { + if (symbol.flags & 536870912 /* Prototype */) { return links.type = getTypeOfPrototypeProperty(symbol); } var declaration = symbol.valueDeclaration; - if (declaration.kind === 171 /* CatchBlock */) { + if (declaration.kind === 178 /* CatchBlock */) { return links.type = anyType; } links.type = resolvingType; @@ -10436,7 +10148,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 123 /* GetAccessor */) { + if (accessor.kind === 127 /* GetAccessor */) { return accessor.type && getTypeFromTypeNode(accessor.type); } else { @@ -10455,8 +10167,8 @@ var ts; links = links || getSymbolLinks(symbol); if (!links.type) { links.type = resolvingType; - var getter = getDeclarationOfKind(symbol, 123 /* GetAccessor */); - var setter = getDeclarationOfKind(symbol, 124 /* SetAccessor */); + var getter = getDeclarationOfKind(symbol, 127 /* GetAccessor */); + var setter = getDeclarationOfKind(symbol, 128 /* SetAccessor */); var type; var getterReturnType = getAnnotatedAccessorType(getter); if (getterReturnType) { @@ -10486,7 +10198,7 @@ var ts; else if (links.type === resolvingType) { links.type = anyType; if (compilerOptions.noImplicitAny) { - var getter = getDeclarationOfKind(symbol, 123 /* GetAccessor */); + var getter = getDeclarationOfKind(symbol, 127 /* GetAccessor */); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -10520,22 +10232,22 @@ var ts; return links.type; } function getTypeOfSymbol(symbol) { - if (symbol.flags & 33554432 /* Instantiated */) { + if (symbol.flags & 67108864 /* Instantiated */) { return getTypeOfInstantiatedSymbol(symbol); } - if (symbol.flags & (ts.SymbolFlags.Variable | 4 /* Property */)) { + if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { return getTypeOfVariableOrParameterOrProperty(symbol); } - if (symbol.flags & (16 /* Function */ | 4096 /* Method */ | 32 /* Class */ | 128 /* Enum */ | 256 /* ValueModule */)) { + if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { return getTypeOfFuncClassEnumModule(symbol); } if (symbol.flags & 8 /* EnumMember */) { return getTypeOfEnumMember(symbol); } - if (symbol.flags & ts.SymbolFlags.Accessor) { + if (symbol.flags & 98304 /* Accessor */) { return getTypeOfAccessors(symbol); } - if (symbol.flags & 16777216 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { return getTypeOfImport(symbol); } return unknownType; @@ -10553,7 +10265,7 @@ var ts; function getTypeParametersOfClassOrInterface(symbol) { var result; ts.forEach(symbol.declarations, function (node) { - if (node.kind === 178 /* InterfaceDeclaration */ || node.kind === 177 /* ClassDeclaration */) { + if (node.kind === 185 /* InterfaceDeclaration */ || node.kind === 184 /* ClassDeclaration */) { var declaration = node; if (declaration.typeParameters && declaration.typeParameters.length) { ts.forEach(declaration.typeParameters, function (node) { @@ -10584,7 +10296,7 @@ var ts; type.typeArguments = type.typeParameters; } type.baseTypes = []; - var declaration = getDeclarationOfKind(symbol, 177 /* ClassDeclaration */); + var declaration = getDeclarationOfKind(symbol, 184 /* ClassDeclaration */); if (declaration.baseType) { var baseType = getTypeFromTypeReferenceNode(declaration.baseType); if (baseType !== unknownType) { @@ -10624,7 +10336,7 @@ var ts; } type.baseTypes = []; ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 178 /* InterfaceDeclaration */ && declaration.baseTypes) { + if (declaration.kind === 185 /* InterfaceDeclaration */ && declaration.baseTypes) { ts.forEach(declaration.baseTypes, function (node) { var baseType = getTypeFromTypeReferenceNode(node); if (baseType !== unknownType) { @@ -10655,7 +10367,7 @@ var ts; var links = getSymbolLinks(symbol); if (!links.declaredType) { links.declaredType = resolvingType; - var declaration = getDeclarationOfKind(symbol, 179 /* TypeAliasDeclaration */); + var declaration = getDeclarationOfKind(symbol, 186 /* TypeAliasDeclaration */); var type = getTypeFromTypeNode(declaration.type); if (links.declaredType === resolvingType) { links.declaredType = type; @@ -10663,7 +10375,7 @@ var ts; } else if (links.declaredType === resolvingType) { links.declaredType = unknownType; - var declaration = getDeclarationOfKind(symbol, 179 /* TypeAliasDeclaration */); + var declaration = getDeclarationOfKind(symbol, 186 /* TypeAliasDeclaration */); error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); } return links.declaredType; @@ -10682,7 +10394,7 @@ var ts; if (!links.declaredType) { var type = createType(512 /* TypeParameter */); type.symbol = symbol; - if (!getDeclarationOfKind(symbol, 118 /* TypeParameter */).constraint) { + if (!getDeclarationOfKind(symbol, 122 /* TypeParameter */).constraint) { type.constraint = noConstraintType; } links.declaredType = type; @@ -10697,23 +10409,23 @@ var ts; return links.declaredType; } function getDeclaredTypeOfSymbol(symbol) { - ts.Debug.assert((symbol.flags & 33554432 /* Instantiated */) === 0); + ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0); if (symbol.flags & 32 /* Class */) { return getDeclaredTypeOfClass(symbol); } if (symbol.flags & 64 /* Interface */) { return getDeclaredTypeOfInterface(symbol); } - if (symbol.flags & 1048576 /* TypeAlias */) { + if (symbol.flags & 2097152 /* TypeAlias */) { return getDeclaredTypeOfTypeAlias(symbol); } - if (symbol.flags & 128 /* Enum */) { + if (symbol.flags & 384 /* Enum */) { return getDeclaredTypeOfEnum(symbol); } - if (symbol.flags & 524288 /* TypeParameter */) { + if (symbol.flags & 1048576 /* TypeParameter */) { return getDeclaredTypeOfTypeParameter(symbol); } - if (symbol.flags & 16777216 /* Import */) { + if (symbol.flags & 33554432 /* Import */) { return getDeclaredTypeOfImport(symbol); } return unknownType; @@ -10815,7 +10527,7 @@ var ts; function createTupleTypeMemberSymbols(memberTypes) { var members = {}; for (var i = 0; i < memberTypes.length; i++) { - var symbol = createSymbol(4 /* Property */ | 134217728 /* Transient */, "" + i); + var symbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, "" + i); symbol.type = memberTypes[i]; members[i] = symbol; } @@ -10832,7 +10544,7 @@ var ts; return false; } for (var i = 0; i < s.length; i++) { - if (!compareSignatures(s[i], t[i], false, isTypeIdenticalTo)) { + if (!compareSignatures(s[i], t[i], false, compareTypes)) { return false; } } @@ -10879,7 +10591,7 @@ var ts; } function resolveAnonymousTypeMembers(type) { var symbol = type.symbol; - if (symbol.flags & 1024 /* TypeLiteral */) { + if (symbol.flags & 2048 /* TypeLiteral */) { var members = symbol.members; var callSignatures = getSignaturesOfSymbol(members["__call"]); var constructSignatures = getSignaturesOfSymbol(members["__new"]); @@ -10890,10 +10602,10 @@ var ts; var members = emptySymbols; var callSignatures = emptyArray; var constructSignatures = emptyArray; - if (symbol.flags & ts.SymbolFlags.HasExports) { + if (symbol.flags & 1952 /* HasExports */) { members = symbol.exports; } - if (symbol.flags & (16 /* Function */ | 4096 /* Method */)) { + if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) { callSignatures = getSignaturesOfSymbol(symbol); } if (symbol.flags & 32 /* Class */) { @@ -10908,7 +10620,7 @@ var ts; } } var stringIndexType = undefined; - var numberIndexType = (symbol.flags & 128 /* Enum */) ? stringType : undefined; + var numberIndexType = (symbol.flags & 384 /* Enum */) ? stringType : undefined; } setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); } @@ -10933,13 +10645,13 @@ var ts; return type; } function getPropertiesOfObjectType(type) { - if (type.flags & ts.TypeFlags.ObjectType) { + if (type.flags & 48128 /* ObjectType */) { return resolveObjectOrUnionTypeMembers(type).properties; } return emptyArray; } function getPropertyOfObjectType(type, name) { - if (type.flags & ts.TypeFlags.ObjectType) { + if (type.flags & 48128 /* ObjectType */) { var resolved = resolveObjectOrUnionTypeMembers(type); if (ts.hasProperty(resolved.members, name)) { var symbol = resolved.members[name]; @@ -10974,10 +10686,10 @@ var ts; type = emptyObjectType; } } - if (type.flags & ts.TypeFlags.StringLike) { + if (type.flags & 258 /* StringLike */) { type = globalStringType; } - else if (type.flags & ts.TypeFlags.NumberLike) { + else if (type.flags & 132 /* NumberLike */) { type = globalNumberType; } else if (type.flags & 8 /* Boolean */) { @@ -11012,7 +10724,7 @@ var ts; } propTypes.push(getTypeOfSymbol(prop)); } - var result = createSymbol(4 /* Property */ | 134217728 /* Transient */ | 536870912 /* UnionProperty */, name); + var result = createSymbol(4 /* Property */ | 268435456 /* Transient */ | 1073741824 /* UnionProperty */, name); result.unionType = unionType; result.declarations = declarations; result.type = getUnionType(propTypes); @@ -11033,9 +10745,9 @@ var ts; if (type.flags & 16384 /* Union */) { return getPropertyOfUnionType(type, name); } - if (!(type.flags & ts.TypeFlags.ObjectType)) { + if (!(type.flags & 48128 /* ObjectType */)) { type = getApparentType(type); - if (!(type.flags & ts.TypeFlags.ObjectType)) { + if (!(type.flags & 48128 /* ObjectType */)) { return undefined; } } @@ -11054,7 +10766,7 @@ var ts; return getPropertyOfObjectType(globalObjectType, name); } function getSignaturesOfObjectOrUnionType(type, kind) { - if (type.flags & (ts.TypeFlags.ObjectType | 16384 /* Union */)) { + if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { var resolved = resolveObjectOrUnionTypeMembers(type); return kind === 0 /* Call */ ? resolved.callSignatures : resolved.constructSignatures; } @@ -11064,7 +10776,7 @@ var ts; return getSignaturesOfObjectOrUnionType(getApparentType(type), kind); } function getIndexTypeOfObjectOrUnionType(type, kind) { - if (type.flags & (ts.TypeFlags.ObjectType | 16384 /* Union */)) { + if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { var resolved = resolveObjectOrUnionTypeMembers(type); return kind === 0 /* String */ ? resolved.stringIndexType : resolved.numberIndexType; } @@ -11085,7 +10797,7 @@ var ts; function getSignatureFromDeclaration(declaration) { var links = getNodeLinks(declaration); if (!links.resolvedSignature) { - var classType = declaration.kind === 122 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; + var classType = declaration.kind === 126 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; var parameters = []; var hasStringLiterals = false; @@ -11113,8 +10825,8 @@ var ts; returnType = getTypeFromTypeNode(declaration.type); } else { - if (declaration.kind === 123 /* GetAccessor */) { - var setter = getDeclarationOfKind(declaration.symbol, 124 /* SetAccessor */); + if (declaration.kind === 127 /* GetAccessor */) { + var setter = getDeclarationOfKind(declaration.symbol, 128 /* SetAccessor */); returnType = getAnnotatedAccessorType(setter); } if (!returnType && !declaration.body) { @@ -11132,16 +10844,16 @@ var ts; for (var i = 0, len = symbol.declarations.length; i < len; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 175 /* FunctionDeclaration */: - case 121 /* Method */: - case 122 /* Constructor */: - case 125 /* CallSignature */: - case 126 /* ConstructSignature */: - case 127 /* IndexSignature */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: + case 182 /* FunctionDeclaration */: + case 125 /* Method */: + case 126 /* Constructor */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 149 /* FunctionExpression */: + case 150 /* 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) { @@ -11210,7 +10922,7 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 122 /* Constructor */ || signature.declaration.kind === 126 /* ConstructSignature */; + var isConstructor = signature.declaration.kind === 126 /* Constructor */ || signature.declaration.kind === 130 /* ConstructSignature */; var type = createObjectType(32768 /* Anonymous */ | 65536 /* FromSignature */); type.members = emptySymbols; type.properties = emptyArray; @@ -11224,7 +10936,7 @@ var ts; return symbol.members["__index"]; } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 112 /* NumberKeyword */ : 114 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 116 /* NumberKeyword */ : 118 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { var len = indexSymbol.declarations.length; @@ -11251,7 +10963,7 @@ var ts; type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 118 /* TypeParameter */).constraint); + type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 122 /* TypeParameter */).constraint); } } return type.constraint === noConstraintType ? undefined : type.constraint; @@ -11291,17 +11003,17 @@ var ts; while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { currentNode = currentNode.parent; } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 118 /* TypeParameter */; + links.isIllegalTypeReferenceInConstraint = currentNode.kind === 122 /* TypeParameter */; return links.isIllegalTypeReferenceInConstraint; } function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { var typeParameterSymbol; function check(n) { - if (n.kind === 128 /* TypeReference */ && n.typeName.kind === 59 /* Identifier */) { + if (n.kind === 132 /* TypeReference */ && n.typeName.kind === 63 /* Identifier */) { var links = getNodeLinks(n); if (links.isIllegalTypeReferenceInConstraint === undefined) { - var symbol = resolveName(typeParameter, n.typeName.text, ts.SymbolFlags.Type, undefined, undefined); - if (symbol && (symbol.flags & 524288 /* TypeParameter */)) { + var symbol = resolveName(typeParameter, n.typeName.text, 3152352 /* Type */, undefined, undefined); + if (symbol && (symbol.flags & 1048576 /* TypeParameter */)) { links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; }); } } @@ -11319,10 +11031,10 @@ var ts; function getTypeFromTypeReferenceNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - var symbol = resolveEntityName(node, node.typeName, ts.SymbolFlags.Type); + var symbol = resolveEntityName(node, node.typeName, 3152352 /* Type */); if (symbol) { var type; - if ((symbol.flags & 524288 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { + if ((symbol.flags & 1048576 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { type = unknownType; } else { @@ -11362,9 +11074,9 @@ var ts; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; switch (declaration.kind) { - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - case 180 /* EnumDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 187 /* EnumDeclaration */: return declaration; } } @@ -11373,7 +11085,7 @@ var ts; return emptyObjectType; } var type = getDeclaredTypeOfSymbol(symbol); - if (!(type.flags & ts.TypeFlags.ObjectType)) { + if (!(type.flags & 48128 /* ObjectType */)) { error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name); return emptyObjectType; } @@ -11384,7 +11096,7 @@ var ts; return type; } function getGlobalSymbol(name) { - return resolveName(undefined, name, ts.SymbolFlags.Type, ts.Diagnostics.Cannot_find_global_type_0, name); + return resolveName(undefined, name, 3152352 /* Type */, ts.Diagnostics.Cannot_find_global_type_0, name); } function getGlobalType(name) { return getTypeOfGlobalSymbol(getGlobalSymbol(name), 0); @@ -11527,34 +11239,34 @@ var ts; } function getTypeFromTypeNode(node) { switch (node.kind) { - case 105 /* AnyKeyword */: + case 109 /* AnyKeyword */: return anyType; - case 114 /* StringKeyword */: + case 118 /* StringKeyword */: return stringType; - case 112 /* NumberKeyword */: + case 116 /* NumberKeyword */: return numberType; - case 106 /* BooleanKeyword */: + case 110 /* BooleanKeyword */: return booleanType; - case 93 /* VoidKeyword */: + case 97 /* VoidKeyword */: return voidType; case 7 /* StringLiteral */: return getTypeFromStringLiteral(node); - case 128 /* TypeReference */: + case 132 /* TypeReference */: return getTypeFromTypeReferenceNode(node); - case 129 /* TypeQuery */: + case 133 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 131 /* ArrayType */: + case 135 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 132 /* TupleType */: + case 136 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 133 /* UnionType */: + case 137 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 134 /* ParenType */: + case 138 /* ParenType */: return getTypeFromTypeNode(node.type); - case 130 /* TypeLiteral */: + case 134 /* TypeLiteral */: return getTypeFromTypeLiteralNode(node); - case 59 /* Identifier */: - case 117 /* QualifiedName */: + case 63 /* Identifier */: + case 121 /* QualifiedName */: var symbol = getSymbolInfo(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -11579,10 +11291,8 @@ var ts; } function createTypeMapper(sources, targets) { switch (sources.length) { - case 1: - return createUnaryTypeMapper(sources[0], targets[0]); - case 2: - return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); + case 1: return createUnaryTypeMapper(sources[0], targets[0]); + case 2: return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); } return function (t) { for (var i = 0; i < sources.length; i++) { @@ -11600,10 +11310,8 @@ var ts; } function createTypeEraser(sources) { switch (sources.length) { - case 1: - return createUnaryTypeEraser(sources[0]); - case 2: - return createBinaryTypeEraser(sources[0], sources[1]); + case 1: return createUnaryTypeEraser(sources[0]); + case 2: return createBinaryTypeEraser(sources[0], sources[1]); } return function (t) { for (var i = 0; i < sources.length; i++) { @@ -11652,12 +11360,12 @@ var ts; return result; } function instantiateSymbol(symbol, mapper) { - if (symbol.flags & 33554432 /* Instantiated */) { + if (symbol.flags & 67108864 /* Instantiated */) { var links = getSymbolLinks(symbol); symbol = links.target; mapper = combineTypeMappers(links.mapper, mapper); } - var result = createSymbol(33554432 /* Instantiated */ | 134217728 /* Transient */ | symbol.flags, symbol.name); + var result = createSymbol(67108864 /* Instantiated */ | 268435456 /* Transient */ | symbol.flags, symbol.name); result.declarations = symbol.declarations; result.parent = symbol.parent; result.target = symbol; @@ -11687,7 +11395,7 @@ var ts; return mapper(type); } if (type.flags & 32768 /* Anonymous */) { - return type.symbol && type.symbol.flags & (16 /* Function */ | 4096 /* Method */ | 1024 /* TypeLiteral */ | 2048 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; + return type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; } if (type.flags & 4096 /* Reference */) { return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType)); @@ -11703,22 +11411,22 @@ var ts; } function isContextSensitiveExpression(node) { switch (node.kind) { - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: return !node.typeParameters && !ts.forEach(node.parameters, function (p) { return p.type; }); - case 136 /* ObjectLiteral */: - return ts.forEach(node.properties, function (p) { return p.kind === 137 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); - case 135 /* ArrayLiteral */: + case 140 /* ObjectLiteral */: + return ts.forEach(node.properties, function (p) { return p.kind === 141 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); + case 139 /* ArrayLiteral */: return ts.forEach(node.elements, function (e) { return isContextSensitiveExpression(e); }); - case 149 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return isContextSensitiveExpression(node.whenTrue) || isContextSensitiveExpression(node.whenFalse); - case 148 /* BinaryExpression */: - return node.operator === 44 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); + case 153 /* BinaryExpression */: + return node.operator === 48 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); } return false; } function getTypeWithoutConstructors(type) { - if (type.flags & ts.TypeFlags.ObjectType) { + if (type.flags & 48128 /* ObjectType */) { var resolved = resolveObjectOrUnionTypeMembers(type); if (resolved.constructSignatures.length) { var result = createObjectType(32768 /* Anonymous */, type.symbol); @@ -11737,78 +11445,26 @@ var ts; function isTypeIdenticalTo(source, target) { return checkTypeRelatedTo(source, target, identityRelation, undefined); } + function compareTypes(source, target) { + return checkTypeRelatedTo(source, target, identityRelation, undefined) ? -1 /* True */ : 0 /* False */; + } function isTypeSubtypeOf(source, target) { return checkTypeSubtypeOf(source, target, undefined); } - function checkTypeSubtypeOf(source, target, errorNode, headMessage, containingMessageChain) { - return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, headMessage, containingMessageChain); - } function isTypeAssignableTo(source, target) { return checkTypeAssignableTo(source, target, undefined); } + function checkTypeSubtypeOf(source, target, errorNode, headMessage, containingMessageChain) { + return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, headMessage, containingMessageChain); + } function checkTypeAssignableTo(source, target, errorNode, headMessage) { return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage); } - function isTypeRelatedTo(source, target, relation) { - return checkTypeRelatedTo(source, target, relation, undefined); - } function isSignatureAssignableTo(source, target) { var sourceType = getOrCreateTypeFromSignature(source); var targetType = getOrCreateTypeFromSignature(target); return checkTypeRelatedTo(sourceType, targetType, assignableRelation, undefined); } - function isPropertyIdenticalTo(sourceProp, targetProp) { - return isPropertyIdenticalToRecursive(sourceProp, targetProp, false, function (s, t, _reportErrors) { return isTypeIdenticalTo(s, t); }); - } - function checkInheritedPropertiesAreIdentical(type, typeNode) { - if (!type.baseTypes.length || type.baseTypes.length === 1) { - return true; - } - var seen = {}; - ts.forEach(type.declaredProperties, function (p) { - seen[p.name] = { prop: p, containingType: type }; - }); - var ok = true; - for (var i = 0, len = type.baseTypes.length; i < len; ++i) { - var base = type.baseTypes[i]; - var properties = getPropertiesOfObjectType(base); - for (var j = 0, proplen = properties.length; j < proplen; ++j) { - var prop = properties[j]; - if (!ts.hasProperty(seen, prop.name)) { - seen[prop.name] = { prop: prop, containingType: base }; - } - else { - var existing = seen[prop.name]; - var isInheritedProperty = existing.containingType !== type; - if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { - ok = false; - var typeName1 = typeToString(existing.containingType); - var typeName2 = typeToString(base); - var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); - addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine())); - } - } - } - } - return ok; - } - function isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, relate) { - if (sourceProp === targetProp) { - return true; - } - var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (32 /* Private */ | 64 /* Protected */); - var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (32 /* Private */ | 64 /* Protected */); - if (sourcePropAccessibility !== targetPropAccessibility) { - return false; - } - if (sourcePropAccessibility) { - return getTargetSymbol(sourceProp) === getTargetSymbol(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - else { - return isOptionalProperty(sourceProp) === isOptionalProperty(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - } function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain) { var errorInfo; var sourceStack; @@ -11817,7 +11473,7 @@ var ts; var depth = 0; var overflow = false; ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - var result = isRelatedToWithCustomErrors(source, target, errorNode !== undefined, headMessage); + var result = isRelatedTo(source, target, errorNode !== undefined, headMessage); if (overflow) { error(errorNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); } @@ -11827,109 +11483,114 @@ var ts; } addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, program.getCompilerHost().getNewLine())); } - return result; + return result !== 0 /* False */; function reportError(message, arg0, arg1, arg2) { errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } - function isRelatedTo(source, target, reportErrors) { - return isRelatedToWithCustomErrors(source, target, reportErrors, undefined); - } - function isRelatedToWithCustomErrors(source, target, reportErrors, headMessage) { + function isRelatedTo(source, target, reportErrors, headMessage) { + var result; if (relation === identityRelation) { if (source === target) - return true; + return -1 /* True */; } else { if (source === target) - return true; + return -1 /* True */; if (target.flags & 1 /* Any */) - return true; + return -1 /* True */; if (source === undefinedType) - return true; + return -1 /* True */; if (source === nullType && target !== undefinedType) - return true; + return -1 /* True */; if (source.flags & 128 /* Enum */ && target === numberType) - return true; + return -1 /* True */; if (source.flags & 256 /* StringLiteral */ && target === stringType) - return true; + return -1 /* True */; if (relation === assignableRelation) { if (source.flags & 1 /* Any */) - return true; + return -1 /* True */; if (source === numberType && target.flags & 128 /* Enum */) - return true; + return -1 /* True */; } } if (source.flags & 16384 /* Union */) { - if (unionTypeRelatedToType(source, target, reportErrors)) { - return true; + if (result = unionTypeRelatedToType(source, target, reportErrors)) { + return result; } } else if (target.flags & 16384 /* Union */) { - if (typeRelatedToUnionType(source, target, reportErrors)) { - return true; + if (result = typeRelatedToUnionType(source, target, reportErrors)) { + return result; } } else if (source.flags & 512 /* TypeParameter */ && target.flags & 512 /* TypeParameter */) { - if (typeParameterRelatedTo(source, target, reportErrors)) { - return true; + if (result = typeParameterRelatedTo(source, target, reportErrors)) { + return result; } } else { var saveErrorInfo = errorInfo; if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { - if (typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { - return true; + if (result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { + return result; } } var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); - if (sourceOrApparentType.flags & ts.TypeFlags.ObjectType && target.flags & ts.TypeFlags.ObjectType && objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) { + if (sourceOrApparentType.flags & 48128 /* ObjectType */ && target.flags & 48128 /* ObjectType */ && (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors))) { errorInfo = saveErrorInfo; - return true; + return result; } } if (reportErrors) { headMessage = headMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1; - ts.Debug.assert(headMessage); reportError(headMessage, typeToString(source), typeToString(target)); } - return false; + return 0 /* False */; } function typeRelatedToUnionType(source, target, reportErrors) { var targetTypes = target.types; for (var i = 0, len = targetTypes.length; i < len; i++) { - if (isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1)) { - return true; + var related = isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1); + if (related) { + return related; } } - return false; + return 0 /* False */; } function unionTypeRelatedToType(source, target, reportErrors) { + var result = -1 /* True */; var sourceTypes = source.types; for (var i = 0, len = sourceTypes.length; i < len; i++) { - if (!isRelatedTo(sourceTypes[i], target, reportErrors)) { - return false; + var related = isRelatedTo(sourceTypes[i], target, reportErrors); + if (!related) { + return 0 /* False */; } + result &= related; } - return true; + return result; } function typesRelatedTo(sources, targets, reportErrors) { + var result = -1 /* True */; for (var i = 0, len = sources.length; i < len; i++) { - if (!isRelatedTo(sources[i], targets[i], reportErrors)) - return false; + var related = isRelatedTo(sources[i], targets[i], reportErrors); + if (!related) { + return 0 /* False */; + } + result &= related; } - return true; + return result; } function typeParameterRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { if (source.symbol.name !== target.symbol.name) { - return false; + return 0 /* False */; } if (source.constraint === target.constraint) { - return true; + return -1 /* True */; } if (source.constraint === noConstraintType || target.constraint === noConstraintType) { - return false; + return 0 /* False */; } return isRelatedTo(source.constraint, target.constraint, reportErrors); } @@ -11937,29 +11598,32 @@ var ts; while (true) { var constraint = getConstraintOfTypeParameter(source); if (constraint === target) - return true; + return -1 /* True */; if (!(constraint && constraint.flags & 512 /* TypeParameter */)) break; source = constraint; } - return false; + return 0 /* False */; } } function objectTypeRelatedTo(source, target, reportErrors) { - if (overflow) - return false; - var result; + if (overflow) { + return 0 /* False */; + } var id = source.id + "," + target.id; - if ((result = relation[id]) !== undefined) - return result; + var related = relation[id]; + if (related !== undefined) { + return related; + } if (depth > 0) { for (var i = 0; i < depth; i++) { - if (source === sourceStack[i] && target === targetStack[i]) - return true; + if (source === sourceStack[i] && target === targetStack[i]) { + return 1 /* Maybe */; + } } if (depth === 100) { overflow = true; - return false; + return 0 /* False */; } } else { @@ -11975,10 +11639,27 @@ var ts; expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) expandingFlags |= 2; - result = expandingFlags === 3 || propertiesRelatedTo(source, target, reportErrors) && signaturesRelatedTo(source, target, 0 /* Call */, reportErrors) && signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors) && stringIndexTypesRelatedTo(source, target, reportErrors) && numberIndexTypesRelatedTo(source, target, reportErrors); + if (expandingFlags === 3) { + var result = -1 /* True */; + } + else { + var result = propertiesRelatedTo(source, target, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 0 /* Call */, reportErrors); + if (result) { + result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors); + if (result) { + result &= stringIndexTypesRelatedTo(source, target, reportErrors); + if (result) { + result &= numberIndexTypesRelatedTo(source, target, reportErrors); + } + } + } + } + } expandingFlags = saveExpandingFlags; depth--; - if (depth === 0) { + if (result !== 1 /* Maybe */) { relation[id] = result; } return result; @@ -12000,8 +11681,9 @@ var ts; } function propertiesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return propertiesIdenticalTo(source, target, reportErrors); + return propertiesIdenticalTo(source, target); } + var result = -1 /* True */; var properties = getPropertiesOfObjectType(target); for (var i = 0; i < properties.length; i++) { var targetProp = properties[i]; @@ -12012,10 +11694,10 @@ var ts; if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); } - return false; + return 0 /* False */; } } - else if (!(targetProp.flags & 268435456 /* Prototype */)) { + else if (!(targetProp.flags & 536870912 /* Prototype */)) { var sourceFlags = getDeclarationFlagsFromSymbol(sourceProp); var targetFlags = getDeclarationFlagsFromSymbol(targetProp); if (sourceFlags & 32 /* Private */ || targetFlags & 32 /* Private */) { @@ -12028,7 +11710,7 @@ var ts; reportError(ts.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourceFlags & 32 /* Private */ ? source : target), typeToString(sourceFlags & 32 /* Private */ ? target : source)); } } - return false; + return 0 /* False */; } } else if (targetFlags & 64 /* Protected */) { @@ -12039,55 +11721,65 @@ var ts; if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass)); } - return false; + return 0 /* False */; } } else if (sourceFlags & 64 /* Protected */) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); } - return false; + return 0 /* False */; } - if (!isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors)) { + var related = isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); + if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Types_of_property_0_are_incompatible, symbolToString(targetProp)); } - return false; + return 0 /* False */; } + result &= related; if (isOptionalProperty(sourceProp) && !isOptionalProperty(targetProp)) { if (reportErrors) { reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); } - return false; + return 0 /* False */; } } } } - return true; + return result; } - function propertiesIdenticalTo(source, target, reportErrors) { + function propertiesIdenticalTo(source, target) { var sourceProperties = getPropertiesOfObjectType(source); var targetProperties = getPropertiesOfObjectType(target); if (sourceProperties.length !== targetProperties.length) { - return false; + return 0 /* False */; } + var result = -1 /* True */; for (var i = 0, len = sourceProperties.length; i < len; ++i) { var sourceProp = sourceProperties[i]; var targetProp = getPropertyOfObjectType(target, sourceProp.name); - if (!targetProp || !isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, isRelatedTo)) { - return false; + if (!targetProp) { + return 0 /* False */; } + var related = compareProperties(sourceProp, targetProp, isRelatedTo); + if (!related) { + return 0 /* False */; + } + result &= related; } - return true; + return result; } function signaturesRelatedTo(source, target, kind, reportErrors) { if (relation === identityRelation) { - return signaturesIdenticalTo(source, target, kind, reportErrors); + return signaturesIdenticalTo(source, target, kind); + } + if (target === anyFunctionType || source === anyFunctionType) { + return -1 /* True */; } - if (target === anyFunctionType || source === anyFunctionType) - return true; var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); + var result = -1 /* True */; var saveErrorInfo = errorInfo; outer: for (var i = 0; i < targetSignatures.length; i++) { var t = targetSignatures[i]; @@ -12096,24 +11788,26 @@ var ts; for (var j = 0; j < sourceSignatures.length; j++) { var s = sourceSignatures[j]; if (!s.hasStringLiterals || source.flags & 65536 /* FromSignature */) { - if (signatureRelatedTo(s, t, localErrors)) { + var related = signatureRelatedTo(s, t, localErrors); + if (related) { + result &= related; errorInfo = saveErrorInfo; continue outer; } localErrors = false; } } - return false; + return 0 /* False */; } } - return true; + return result; } function signatureRelatedTo(source, target, reportErrors) { if (source === target) { - return true; + return -1 /* True */; } if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return false; + return 0 /* False */; } var sourceMax = source.parameters.length; var targetMax = target.parameters.length; @@ -12136,42 +11830,49 @@ var ts; } source = getErasedSignature(source); target = getErasedSignature(target); + var result = -1 /* True */; for (var i = 0; i < checkCount; i++) { var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); var saveErrorInfo = errorInfo; - if (!isRelatedTo(s, t, reportErrors)) { - if (!isRelatedTo(t, s, false)) { + var related = isRelatedTo(s, t, reportErrors); + if (!related) { + related = isRelatedTo(t, s, false); + if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); } - return false; + return 0 /* False */; } errorInfo = saveErrorInfo; } + result &= related; } var t = getReturnTypeOfSignature(target); if (t === voidType) - return true; + return result; var s = getReturnTypeOfSignature(source); - return isRelatedTo(s, t, reportErrors); + return result & isRelatedTo(s, t, reportErrors); } - function signaturesIdenticalTo(source, target, kind, reportErrors) { + function signaturesIdenticalTo(source, target, kind) { var sourceSignatures = getSignaturesOfType(source, kind); var targetSignatures = getSignaturesOfType(target, kind); if (sourceSignatures.length !== targetSignatures.length) { - return false; + return 0 /* False */; } + var result = -1 /* True */; for (var i = 0, len = sourceSignatures.length; i < len; ++i) { - if (!compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo)) { - return false; + var related = compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo); + if (!related) { + return 0 /* False */; } + result &= related; } - return true; + return result; } function stringIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return indexTypesIdenticalTo(0 /* String */, source, target, reportErrors); + return indexTypesIdenticalTo(0 /* String */, source, target); } var targetType = getIndexTypeOfType(target, 0 /* String */); if (targetType) { @@ -12180,20 +11881,22 @@ var ts; if (reportErrors) { reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); } - return false; + return 0 /* False */; } - if (!isRelatedTo(sourceType, targetType, reportErrors)) { + var related = isRelatedTo(sourceType, targetType, reportErrors); + if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Index_signatures_are_incompatible); } - return false; + return 0 /* False */; } + return related; } - return true; + return -1 /* True */; } function numberIndexTypesRelatedTo(source, target, reportErrors) { if (relation === identityRelation) { - return indexTypesIdenticalTo(1 /* Number */, source, target, reportErrors); + return indexTypesIdenticalTo(1 /* Number */, source, target); } var targetType = getIndexTypeOfType(target, 1 /* Number */); if (targetType) { @@ -12203,59 +11906,98 @@ var ts; if (reportErrors) { reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); } - return false; + return 0 /* False */; } if (sourceStringType && sourceNumberType) { - var compatible = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + var related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); } else { - var compatible = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); + var related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); } - if (!compatible) { + if (!related) { if (reportErrors) { reportError(ts.Diagnostics.Index_signatures_are_incompatible); } - return false; + return 0 /* False */; } + return related; } - return true; + return -1 /* True */; } - function indexTypesIdenticalTo(indexKind, source, target, reportErrors) { + function indexTypesIdenticalTo(indexKind, source, target) { var targetType = getIndexTypeOfType(target, indexKind); var sourceType = getIndexTypeOfType(source, indexKind); - return (!sourceType && !targetType) || (sourceType && targetType && isRelatedTo(sourceType, targetType, reportErrors)); + if (!sourceType && !targetType) { + return -1 /* True */; + } + if (sourceType && targetType) { + return isRelatedTo(sourceType, targetType); + } + return 0 /* False */; } } + function isPropertyIdenticalTo(sourceProp, targetProp) { + return compareProperties(sourceProp, targetProp, compareTypes) !== 0 /* False */; + } + function compareProperties(sourceProp, targetProp, compareTypes) { + if (sourceProp === targetProp) { + return -1 /* True */; + } + var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (32 /* Private */ | 64 /* Protected */); + var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (32 /* Private */ | 64 /* Protected */); + if (sourcePropAccessibility !== targetPropAccessibility) { + return 0 /* False */; + } + if (sourcePropAccessibility) { + if (getTargetSymbol(sourceProp) !== getTargetSymbol(targetProp)) { + return 0 /* False */; + } + } + else { + if (isOptionalProperty(sourceProp) !== isOptionalProperty(targetProp)) { + return 0 /* False */; + } + } + return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); + } function compareSignatures(source, target, compareReturnTypes, compareTypes) { if (source === target) { - return true; + return -1 /* True */; } if (source.parameters.length !== target.parameters.length || source.minArgumentCount !== target.minArgumentCount || source.hasRestParameter !== target.hasRestParameter) { - return false; + return 0 /* False */; } + var result = -1 /* True */; if (source.typeParameters && target.typeParameters) { if (source.typeParameters.length !== target.typeParameters.length) { - return false; + return 0 /* False */; } for (var i = 0, len = source.typeParameters.length; i < len; ++i) { - if (!compareTypes(source.typeParameters[i], target.typeParameters[i])) { - return false; + var related = compareTypes(source.typeParameters[i], target.typeParameters[i]); + if (!related) { + return 0 /* False */; } + result &= related; } } else if (source.typeParameters || source.typeParameters) { - return false; + return 0 /* False */; } source = getErasedSignature(source); target = getErasedSignature(target); for (var i = 0, len = source.parameters.length; i < len; i++) { var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); - if (!compareTypes(s, t)) { - return false; + var related = compareTypes(s, t); + if (!related) { + return 0 /* False */; } + result &= related; } - return !compareReturnTypes || compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + if (compareReturnTypes) { + result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + } + return result; } function isSupertypeOfEach(candidate, types) { for (var i = 0, len = types.length; i < len; i++) { @@ -12294,7 +12036,7 @@ var ts; checkTypeSubtypeOf(bestSupertypeDownfallType, bestSupertype, errorLocation, ts.Diagnostics.Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0, errorMessageChainHead); } function isTypeOfObjectLiteral(type) { - return (type.flags & 32768 /* Anonymous */) && type.symbol && (type.symbol.flags & 2048 /* ObjectLiteral */) ? true : false; + return (type.flags & 32768 /* Anonymous */) && type.symbol && (type.symbol.flags & 4096 /* ObjectLiteral */) ? true : false; } function isArrayType(type) { return type.flags & 4096 /* Reference */ && type.target === globalArrayType; @@ -12342,7 +12084,7 @@ var ts; var members = {}; var index = 0; ts.forEach(properties, function (p) { - var symbol = createSymbol(4 /* Property */ | 134217728 /* Transient */ | p.flags, p.name); + var symbol = createSymbol(4 /* Property */ | 268435456 /* Transient */ | p.flags, p.name); symbol.declarations = p.declarations; symbol.parent = p.parent; symbol.type = widenedTypes[index++]; @@ -12477,7 +12219,7 @@ var ts; inferFromTypes(sourceTypes[i], target); } } - else if (source.flags & ts.TypeFlags.ObjectType && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || (target.flags & 32768 /* Anonymous */) && target.symbol && target.symbol.flags & (4096 /* Method */ | 1024 /* TypeLiteral */))) { + else if (source.flags & 48128 /* ObjectType */ && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || (target.flags & 32768 /* Anonymous */) && target.symbol && target.symbol.flags & (8192 /* Method */ | 2048 /* TypeLiteral */))) { if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { if (depth === 0) { sourceStack = []; @@ -12561,17 +12303,17 @@ var ts; function getResolvedSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { - links.resolvedSymbol = resolveName(node, node.text, ts.SymbolFlags.Value | 2097152 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node) || unknownSymbol; + links.resolvedSymbol = resolveName(node, node.text, 107455 /* Value */ | 4194304 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node) || unknownSymbol; } return links.resolvedSymbol; } function isInTypeQuery(node) { while (node) { switch (node.kind) { - case 129 /* TypeQuery */: + case 133 /* TypeQuery */: return true; - case 59 /* Identifier */: - case 117 /* QualifiedName */: + case 63 /* Identifier */: + case 121 /* QualifiedName */: node = node.parent; continue; default: @@ -12602,12 +12344,12 @@ var ts; } return links.assignmentChecks[symbol.id] = isAssignedIn(node); function isAssignedInBinaryExpression(node) { - if (node.operator >= ts.SyntaxKind.FirstAssignment && node.operator <= ts.SyntaxKind.LastAssignment) { + if (node.operator >= 51 /* FirstAssignment */ && node.operator <= 62 /* LastAssignment */) { var n = node.left; - while (n.kind === 143 /* ParenExpression */) { + while (n.kind === 148 /* ParenExpression */) { n = n.expression; } - if (n.kind === 59 /* Identifier */ && getResolvedSymbol(n) === symbol) { + if (n.kind === 63 /* Identifier */ && getResolvedSymbol(n) === symbol) { return true; } } @@ -12621,40 +12363,40 @@ var ts; } function isAssignedIn(node) { switch (node.kind) { - case 148 /* BinaryExpression */: + case 153 /* BinaryExpression */: return isAssignedInBinaryExpression(node); - case 174 /* VariableDeclaration */: + case 181 /* VariableDeclaration */: return isAssignedInVariableDeclaration(node); - case 135 /* ArrayLiteral */: - case 136 /* ObjectLiteral */: - case 138 /* PropertyAccess */: - case 139 /* IndexedAccess */: - case 140 /* CallExpression */: - case 141 /* NewExpression */: - case 142 /* TypeAssertion */: - case 143 /* ParenExpression */: - case 146 /* PrefixOperator */: - case 147 /* PostfixOperator */: - case 149 /* ConditionalExpression */: - case 151 /* Block */: - case 152 /* VariableStatement */: - case 154 /* ExpressionStatement */: - case 155 /* IfStatement */: - case 156 /* DoStatement */: - case 157 /* WhileStatement */: - case 158 /* ForStatement */: - case 159 /* ForInStatement */: - case 162 /* ReturnStatement */: - case 163 /* WithStatement */: - case 164 /* SwitchStatement */: - case 165 /* CaseClause */: - case 166 /* DefaultClause */: - case 167 /* LabeledStatement */: - case 168 /* ThrowStatement */: - case 169 /* TryStatement */: - case 170 /* TryBlock */: - case 171 /* CatchBlock */: - case 172 /* FinallyBlock */: + 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 */: return ts.forEachChild(node, isAssignedIn); } return false; @@ -12662,31 +12404,31 @@ var ts; } function getNarrowedTypeOfSymbol(symbol, node) { var type = getTypeOfSymbol(symbol); - if (symbol.flags & ts.SymbolFlags.Variable && type.flags & ts.TypeFlags.Structured) { + if (symbol.flags & 3 /* Variable */ && type.flags & 65025 /* Structured */) { while (true) { var child = node; node = node.parent; - if (!node || node.kind === 176 /* FunctionBlock */ || node.kind === 182 /* ModuleBlock */) { + if (!node || node.kind === 183 /* FunctionBlock */ || node.kind === 189 /* ModuleBlock */) { break; } var narrowedType = type; switch (node.kind) { - case 155 /* IfStatement */: + case 162 /* IfStatement */: if (child !== node.expression) { narrowedType = narrowType(type, node.expression, child === node.thenStatement); } break; - case 149 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: if (child !== node.condition) { narrowedType = narrowType(type, node.condition, child === node.whenTrue); } break; - case 148 /* BinaryExpression */: + case 153 /* BinaryExpression */: if (child === node.right) { - if (node.operator === 43 /* AmpersandAmpersandToken */) { + if (node.operator === 47 /* AmpersandAmpersandToken */) { narrowedType = narrowType(type, node.left, true); } - else if (node.operator === 44 /* BarBarToken */) { + else if (node.operator === 48 /* BarBarToken */) { narrowedType = narrowType(type, node.left, false); } } @@ -12704,12 +12446,12 @@ var ts; function narrowTypeByEquality(type, expr, assumeTrue) { var left = expr.left; var right = expr.right; - if (left.kind !== 146 /* PrefixOperator */ || left.operator !== 91 /* TypeOfKeyword */ || left.operand.kind !== 59 /* Identifier */ || right.kind !== 7 /* StringLiteral */ || getResolvedSymbol(left.operand) !== symbol) { + if (left.kind !== 151 /* PrefixOperator */ || left.operator !== 95 /* TypeOfKeyword */ || left.operand.kind !== 63 /* Identifier */ || right.kind !== 7 /* StringLiteral */ || getResolvedSymbol(left.operand) !== symbol) { return type; } var t = right.text; var checkType = t === "string" ? stringType : t === "number" ? numberType : t === "boolean" ? booleanType : emptyObjectType; - if (expr.operator === 26 /* ExclamationEqualsEqualsToken */) { + if (expr.operator === 30 /* ExclamationEqualsEqualsToken */) { assumeTrue = !assumeTrue; } if (assumeTrue) { @@ -12742,7 +12484,7 @@ var ts; } } function narrowTypeByInstanceof(type, expr, assumeTrue) { - if (!assumeTrue || expr.left.kind !== 59 /* Identifier */ || getResolvedSymbol(expr.left) !== symbol) { + if (!assumeTrue || expr.left.kind !== 63 /* Identifier */ || getResolvedSymbol(expr.left) !== symbol) { return type; } var rightType = checkExpression(expr.right); @@ -12758,25 +12500,25 @@ var ts; } function narrowType(type, expr, assumeTrue) { switch (expr.kind) { - case 143 /* ParenExpression */: + case 148 /* ParenExpression */: return narrowType(type, expr.expression, assumeTrue); - case 148 /* BinaryExpression */: + case 153 /* BinaryExpression */: var operator = expr.operator; - if (operator === 25 /* EqualsEqualsEqualsToken */ || operator === 26 /* ExclamationEqualsEqualsToken */) { + if (operator === 29 /* EqualsEqualsEqualsToken */ || operator === 30 /* ExclamationEqualsEqualsToken */) { return narrowTypeByEquality(type, expr, assumeTrue); } - else if (operator === 43 /* AmpersandAmpersandToken */) { + else if (operator === 47 /* AmpersandAmpersandToken */) { return narrowTypeByAnd(type, expr, assumeTrue); } - else if (operator === 44 /* BarBarToken */) { + else if (operator === 48 /* BarBarToken */) { return narrowTypeByOr(type, expr, assumeTrue); } - else if (operator === 81 /* InstanceOfKeyword */) { + else if (operator === 85 /* InstanceOfKeyword */) { return narrowTypeByInstanceof(type, expr, assumeTrue); } break; - case 146 /* PrefixOperator */: - if (expr.operator === 41 /* ExclamationToken */) { + case 151 /* PrefixOperator */: + if (expr.operator === 45 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } break; @@ -12786,8 +12528,8 @@ var ts; } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); - if (symbol.flags & 16777216 /* Import */) { - getSymbolLinks(symbol).referenced = !isInTypeQuery(node); + if (symbol.flags & 33554432 /* Import */) { + getSymbolLinks(symbol).referenced = !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveImport(symbol)); } checkCollisionWithCapturedSuperVariable(node, node); checkCollisionWithCapturedThisVariable(node, node); @@ -12795,9 +12537,9 @@ var ts; return getNarrowedTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol), node); } function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 177 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 184 /* ClassDeclaration */ ? container.parent : undefined; getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 120 /* Property */ || container.kind === 122 /* Constructor */) { + if (container.kind === 124 /* Property */ || container.kind === 126 /* Constructor */) { getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } else { @@ -12807,23 +12549,23 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 145 /* ArrowFunction */) { + if (container.kind === 150 /* ArrowFunction */) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = true; } switch (container.kind) { - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); break; - case 180 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 122 /* Constructor */: + case 126 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 120 /* Property */: + case 124 /* Property */: if (container.flags & 128 /* Static */) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } @@ -12832,7 +12574,7 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } - var classNode = container.parent && container.parent.kind === 177 /* ClassDeclaration */ ? container.parent : undefined; + var classNode = container.parent && container.parent.kind === 184 /* ClassDeclaration */ ? container.parent : undefined; if (classNode) { var symbol = getSymbolOfNode(classNode); return container.flags & 128 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); @@ -12845,29 +12587,29 @@ var ts; if (!node) return node; switch (node.kind) { - case 175 /* FunctionDeclaration */: - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: - case 120 /* Property */: - case 121 /* Method */: - case 122 /* Constructor */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return node; } } } function isInConstructorArgumentInitializer(node, constructorDecl) { for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 119 /* Parameter */) { + if (n.kind === 123 /* Parameter */) { return true; } } return false; } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 140 /* CallExpression */ && node.parent.func === node; - var enclosingClass = ts.getAncestor(node, 177 /* ClassDeclaration */); + var isCallExpression = node.parent.kind === 144 /* CallExpression */ && node.parent.func === node; + var enclosingClass = ts.getAncestor(node, 184 /* ClassDeclaration */); var baseClass; if (enclosingClass && enclosingClass.baseType) { var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); @@ -12881,20 +12623,20 @@ var ts; if (container) { var canUseSuperExpression = false; if (isCallExpression) { - canUseSuperExpression = container.kind === 122 /* Constructor */; + canUseSuperExpression = container.kind === 126 /* Constructor */; } else { var needToCaptureLexicalThis = false; - while (container && container.kind === 145 /* ArrowFunction */) { + while (container && container.kind === 150 /* ArrowFunction */) { container = getSuperContainer(container); needToCaptureLexicalThis = true; } - if (container && container.parent && container.parent.kind === 177 /* ClassDeclaration */) { + if (container && container.parent && container.parent.kind === 184 /* ClassDeclaration */) { if (container.flags & 128 /* Static */) { - canUseSuperExpression = container.kind === 121 /* Method */ || container.kind === 123 /* GetAccessor */ || container.kind === 124 /* SetAccessor */; + canUseSuperExpression = container.kind === 125 /* Method */ || container.kind === 127 /* GetAccessor */ || container.kind === 128 /* SetAccessor */; } else { - canUseSuperExpression = container.kind === 121 /* Method */ || container.kind === 123 /* GetAccessor */ || container.kind === 124 /* SetAccessor */ || container.kind === 120 /* Property */ || container.kind === 122 /* Constructor */; + canUseSuperExpression = container.kind === 125 /* Method */ || container.kind === 127 /* GetAccessor */ || container.kind === 128 /* SetAccessor */ || container.kind === 124 /* Property */ || container.kind === 126 /* Constructor */; } } } @@ -12908,7 +12650,7 @@ var ts; getNodeLinks(node).flags |= 16 /* SuperInstance */; returnType = baseClass; } - if (container.kind === 122 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 126 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); returnType = unknownType; } @@ -12928,7 +12670,7 @@ var ts; } function getContextuallyTypedParameterType(parameter) { var func = parameter.parent; - if (func.kind === 144 /* FunctionExpression */ || func.kind === 145 /* ArrowFunction */) { + if (func.kind === 149 /* FunctionExpression */ || func.kind === 150 /* ArrowFunction */) { if (isContextSensitiveExpression(func)) { var contextualSignature = getContextualSignature(func); if (contextualSignature) { @@ -12952,7 +12694,7 @@ var ts; if (declaration.type) { return getTypeFromTypeNode(declaration.type); } - if (declaration.kind === 119 /* Parameter */) { + if (declaration.kind === 123 /* Parameter */) { return getContextuallyTypedParameterType(declaration); } } @@ -12961,7 +12703,7 @@ var ts; function getContextualTypeForReturnExpression(node) { var func = ts.getContainingFunction(node); if (func) { - if (func.type || func.kind === 122 /* Constructor */ || func.kind === 123 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 124 /* SetAccessor */))) { + if (func.type || func.kind === 126 /* Constructor */ || func.kind === 127 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 128 /* SetAccessor */))) { return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); } var signature = getContextualSignature(func); @@ -12983,12 +12725,12 @@ var ts; function getContextualTypeForBinaryOperand(node) { var binaryExpression = node.parent; var operator = binaryExpression.operator; - if (operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { + if (operator >= 51 /* FirstAssignment */ && operator <= 62 /* LastAssignment */) { if (node === binaryExpression.right) { return checkExpression(binaryExpression.left); } } - else if (operator === 44 /* BarBarToken */) { + else if (operator === 48 /* BarBarToken */) { var type = getContextualType(binaryExpression); if (!type && node === binaryExpression.right) { type = checkExpression(binaryExpression.left); @@ -13067,25 +12809,25 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 174 /* VariableDeclaration */: - case 119 /* Parameter */: - case 120 /* Property */: + case 181 /* VariableDeclaration */: + case 123 /* Parameter */: + case 124 /* Property */: return getContextualTypeForInitializerExpression(node); - case 145 /* ArrowFunction */: - case 162 /* ReturnStatement */: + case 150 /* ArrowFunction */: + case 169 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 140 /* CallExpression */: - case 141 /* NewExpression */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: return getContextualTypeForArgument(node); - case 142 /* TypeAssertion */: + case 147 /* TypeAssertion */: return getTypeFromTypeNode(parent.type); - case 148 /* BinaryExpression */: + case 153 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 137 /* PropertyAssignment */: + case 141 /* PropertyAssignment */: return getContextualTypeForPropertyExpression(node); - case 135 /* ArrayLiteral */: + case 139 /* ArrayLiteral */: return getContextualTypeForElementExpression(node); - case 149 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); } return undefined; @@ -13115,7 +12857,7 @@ var ts; if (!result) { result = signature; } - else if (!compareSignatures(result, signature, true, isTypeIdenticalTo)) { + else if (!compareSignatures(result, signature, true, compareTypes)) { return undefined; } } @@ -13149,7 +12891,7 @@ var ts; var member = members[id]; if (member.flags & 4 /* Property */) { var type = checkExpression(member.declarations[0].initializer, contextualMapper); - var prop = createSymbol(4 /* Property */ | 134217728 /* Transient */ | member.flags, member.name); + var prop = createSymbol(4 /* Property */ | 268435456 /* Transient */ | member.flags, member.name); prop.declarations = member.declarations; prop.parent = member.parent; if (member.valueDeclaration) @@ -13159,11 +12901,11 @@ var ts; member = prop; } else { - var getAccessor = getDeclarationOfKind(member, 123 /* GetAccessor */); + var getAccessor = getDeclarationOfKind(member, 127 /* GetAccessor */); if (getAccessor) { checkAccessorDeclaration(getAccessor); } - var setAccessor = getDeclarationOfKind(member, 124 /* SetAccessor */); + var setAccessor = getDeclarationOfKind(member, 128 /* SetAccessor */); if (setAccessor) { checkAccessorDeclaration(setAccessor); } @@ -13193,17 +12935,17 @@ var ts; } } function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 120 /* Property */; + return s.valueDeclaration ? s.valueDeclaration.kind : 124 /* Property */; } function getDeclarationFlagsFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.flags : s.flags & 268435456 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; + return s.valueDeclaration ? s.valueDeclaration.flags : s.flags & 536870912 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; } function checkClassPropertyAccess(node, type, prop) { var flags = getDeclarationFlagsFromSymbol(prop); if (!(flags & (32 /* Private */ | 64 /* Protected */))) { return; } - var enclosingClassDeclaration = ts.getAncestor(node, 177 /* ClassDeclaration */); + var enclosingClassDeclaration = ts.getAncestor(node, 184 /* ClassDeclaration */); var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; var declaringClass = getDeclaredTypeOfSymbol(prop.parent); if (flags & 32 /* Private */) { @@ -13212,7 +12954,7 @@ var ts; } return; } - if (node.left.kind === 85 /* SuperKeyword */) { + if (node.left.kind === 89 /* SuperKeyword */) { return; } if (!enclosingClass || !hasBaseType(enclosingClass, declaringClass)) { @@ -13244,7 +12986,7 @@ var ts; } getNodeLinks(node).resolvedSymbol = prop; if (prop.parent && prop.parent.flags & 32 /* Class */) { - if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 121 /* Method */) { + if (node.left.kind === 89 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 125 /* Method */) { error(node.right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); } else { @@ -13260,7 +13002,7 @@ var ts; if (type !== unknownType && type !== anyType) { var prop = getPropertyOfType(getWidenedType(type), propertyName); if (prop && prop.parent && prop.parent.flags & 32 /* Class */) { - if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 121 /* Method */) { + if (node.left.kind === 89 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 125 /* Method */) { return false; } else { @@ -13277,15 +13019,19 @@ var ts; var indexType = checkExpression(node.index); if (objectType === unknownType) return unknownType; + if (isConstEnumObjectType(objectType) && node.index.kind !== 7 /* StringLiteral */) { + error(node.index, ts.Diagnostics.Index_expression_arguments_in_const_enums_must_be_of_type_string); + } if (node.index.kind === 7 /* StringLiteral */ || node.index.kind === 6 /* NumericLiteral */) { var name = node.index.text; var prop = getPropertyOfType(objectType, name); if (prop) { + getNodeLinks(node).resolvedSymbol = prop; return getTypeOfSymbol(prop); } } - if (indexType.flags & (1 /* Any */ | ts.TypeFlags.StringLike | ts.TypeFlags.NumberLike)) { - if (indexType.flags & (1 /* Any */ | ts.TypeFlags.NumberLike)) { + if (indexType.flags & (1 /* Any */ | 258 /* StringLike */ | 132 /* NumberLike */)) { + if (indexType.flags & (1 /* Any */ | 132 /* NumberLike */)) { var numberIndexType = getIndexTypeOfType(objectType, 1 /* Number */); if (numberIndexType) { return numberIndexType; @@ -13329,7 +13075,7 @@ var ts; return callIsIncomplete || hasEnoughArguments; } function getSingleCallSignature(type) { - if (type.flags & ts.TypeFlags.ObjectType) { + if (type.flags & 48128 /* ObjectType */) { var resolved = resolveObjectOrUnionTypeMembers(type); if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { return resolved.callSignatures[0]; @@ -13349,7 +13095,7 @@ var ts; var context = createInferenceContext(typeParameters, false); var mapper = createInferenceMapper(context); for (var i = 0; i < args.length; i++) { - if (args[i].kind === 150 /* OmittedExpression */) { + if (args[i].kind === 157 /* OmittedExpression */) { continue; } if (!excludeArgument || excludeArgument[i] === undefined) { @@ -13359,7 +13105,7 @@ var ts; } if (excludeArgument) { for (var i = 0; i < args.length; i++) { - if (args[i].kind === 150 /* OmittedExpression */) { + if (args[i].kind === 157 /* OmittedExpression */) { continue; } if (excludeArgument[i] === false) { @@ -13397,7 +13143,7 @@ var ts; if (node.arguments) { for (var i = 0; i < node.arguments.length; i++) { var arg = node.arguments[i]; - if (arg.kind === 150 /* OmittedExpression */) { + if (arg.kind === 157 /* OmittedExpression */) { continue; } var paramType = getTypeAtPosition(signature, i); @@ -13532,33 +13278,31 @@ var ts; ts.Debug.assert(!result.length); for (var i = 0; i < signatures.length; i++) { var signature = signatures[i]; - if (true) { - var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var parent = signature.declaration && signature.declaration.parent; - if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent === lastParent) { - pos++; - } - else { - lastParent = parent; - pos = cutoffPos; - } + var symbol = signature.declaration && getSymbolOfNode(signature.declaration); + var parent = signature.declaration && signature.declaration.parent; + if (!lastSymbol || symbol === lastSymbol) { + if (lastParent && parent === lastParent) { + pos++; } else { - pos = cutoffPos = result.length; lastParent = parent; + pos = cutoffPos; } - lastSymbol = symbol; - for (var j = result.length; j > pos; j--) { - result[j] = result[j - 1]; - } - result[pos] = signature; } + else { + pos = cutoffPos = result.length; + lastParent = parent; + } + lastSymbol = symbol; + for (var j = result.length; j > pos; j--) { + result[j] = result[j - 1]; + } + result[pos] = signature; } } } function resolveCallExpression(node, candidatesOutArray) { - if (node.func.kind === 85 /* SuperKeyword */) { + if (node.func.kind === 89 /* SuperKeyword */) { var superType = checkSuperExpression(node.func); if (superType !== unknownType) { return resolveCall(node, getSignaturesOfType(superType, 1 /* Construct */), candidatesOutArray); @@ -13620,18 +13364,18 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSignature || candidatesOutArray) { links.resolvedSignature = anySignature; - links.resolvedSignature = node.kind === 140 /* CallExpression */ ? resolveCallExpression(node, candidatesOutArray) : resolveNewExpression(node, candidatesOutArray); + links.resolvedSignature = node.kind === 144 /* CallExpression */ ? resolveCallExpression(node, candidatesOutArray) : resolveNewExpression(node, candidatesOutArray); } return links.resolvedSignature; } function checkCallExpression(node) { var signature = getResolvedSignature(node); - if (node.func.kind === 85 /* SuperKeyword */) { + if (node.func.kind === 89 /* SuperKeyword */) { return voidType; } - if (node.kind === 141 /* NewExpression */) { + if (node.kind === 145 /* NewExpression */) { var declaration = signature.declaration; - if (declaration && (declaration.kind !== 122 /* Constructor */ && declaration.kind !== 126 /* ConstructSignature */)) { + if (declaration && (declaration.kind !== 126 /* Constructor */ && declaration.kind !== 130 /* ConstructSignature */)) { if (compilerOptions.noImplicitAny) { error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); } @@ -13640,6 +13384,11 @@ var ts; } return getReturnTypeOfSignature(signature); } + function checkTaggedTemplateExpression(node) { + checkExpression(node.tag); + checkExpression(node.template); + return anyType; + } function checkTypeAssertion(node) { var exprType = checkExpression(node.operand); var targetType = getTypeFromTypeNode(node.type); @@ -13669,7 +13418,7 @@ var ts; } function getReturnTypeFromBody(func, contextualMapper) { var contextualSignature = getContextualSignature(func); - if (func.body.kind !== 176 /* FunctionBlock */) { + if (func.body.kind !== 183 /* FunctionBlock */) { var unwidenedType = checkAndMarkExpression(func.body, contextualMapper); var widenedType = getWidenedType(unwidenedType); if (fullTypeCheck && compilerOptions.noImplicitAny && !contextualSignature && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { @@ -13717,7 +13466,7 @@ var ts; }); } function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 168 /* ThrowStatement */); + return (body.statements.length === 1) && (body.statements[0].kind === 175 /* ThrowStatement */); } function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { if (!fullTypeCheck) { @@ -13726,7 +13475,7 @@ var ts; if (returnType === voidType || returnType === anyType) { return; } - if (!func.body || func.body.kind !== 176 /* FunctionBlock */) { + if (!func.body || func.body.kind !== 183 /* FunctionBlock */) { return; } var bodyBlock = func.body; @@ -13770,7 +13519,7 @@ var ts; if (node.type) { checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); } - if (node.body.kind === 176 /* FunctionBlock */) { + if (node.body.kind === 183 /* FunctionBlock */) { checkSourceElement(node.body); } else { @@ -13782,7 +13531,7 @@ var ts; } } function checkArithmeticOperandType(operand, type, diagnostic) { - if (!(type.flags & (1 /* Any */ | ts.TypeFlags.NumberLike))) { + if (!(type.flags & (1 /* Any */ | 132 /* NumberLike */))) { error(operand, diagnostic); return false; } @@ -13795,15 +13544,15 @@ var ts; } function isReferenceOrErrorExpression(n) { switch (n.kind) { - case 59 /* Identifier */: + case 63 /* Identifier */: var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & ts.SymbolFlags.Variable) !== 0; - case 138 /* PropertyAccess */: + return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3 /* Variable */) !== 0; + case 142 /* PropertyAccess */: var symbol = findSymbol(n); return !symbol || symbol === unknownSymbol || (symbol.flags & ~8 /* EnumMember */) !== 0; - case 139 /* IndexedAccess */: + case 143 /* IndexedAccess */: return true; - case 143 /* ParenExpression */: + case 148 /* ParenExpression */: return isReferenceOrErrorExpression(n.expression); default: return false; @@ -13811,20 +13560,20 @@ var ts; } function isConstVariableReference(n) { switch (n.kind) { - case 59 /* Identifier */: - case 138 /* PropertyAccess */: + case 63 /* Identifier */: + case 142 /* PropertyAccess */: var symbol = findSymbol(n); - return symbol && (symbol.flags & ts.SymbolFlags.Variable) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 4096 /* Const */) !== 0; - case 139 /* IndexedAccess */: + return symbol && (symbol.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 4096 /* Const */) !== 0; + case 143 /* IndexedAccess */: var index = n.index; var symbol = findSymbol(n.object); if (symbol && index.kind === 7 /* StringLiteral */) { var name = index.text; var prop = getPropertyOfType(getTypeOfSymbol(symbol), name); - return prop && (prop.flags & ts.SymbolFlags.Variable) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 4096 /* Const */) !== 0; + return prop && (prop.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 4096 /* Const */) !== 0; } return false; - case 143 /* ParenExpression */: + case 148 /* ParenExpression */: return isConstVariableReference(n.expression); default: return false; @@ -13843,19 +13592,19 @@ var ts; function checkPrefixExpression(node) { var operandType = checkExpression(node.operand); switch (node.operator) { - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: return numberType; - case 41 /* ExclamationToken */: - case 68 /* DeleteKeyword */: + case 45 /* ExclamationToken */: + case 72 /* DeleteKeyword */: return booleanType; - case 91 /* TypeOfKeyword */: + case 95 /* TypeOfKeyword */: return stringType; - case 93 /* VoidKeyword */: + case 97 /* VoidKeyword */: return undefinedType; - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); if (ok) { checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); @@ -13876,7 +13625,13 @@ var ts; if (type.flags & 16384 /* Union */) { return !ts.forEach(type.types, function (t) { return !isStructuredType(t); }); } - return (type.flags & ts.TypeFlags.Structured) !== 0; + return (type.flags & 65025 /* Structured */) !== 0; + } + function isConstEnumObjectType(type) { + return type.flags & (48128 /* ObjectType */ | 32768 /* Anonymous */) && type.symbol && isConstEnumSymbol(type.symbol); + } + function isConstEnumSymbol(symbol) { + return (symbol.flags & 128 /* ConstEnum */) !== 0; } function checkInstanceOfExpression(node, leftType, rightType) { if (leftType !== unknownType && !isStructuredType(leftType)) { @@ -13901,26 +13656,26 @@ var ts; var leftType = checkExpression(node.left, contextualMapper); var rightType = checkExpression(node.right, contextualMapper); switch (operator) { - case 30 /* AsteriskToken */: - case 50 /* AsteriskEqualsToken */: - case 31 /* SlashToken */: - case 51 /* SlashEqualsToken */: - case 32 /* PercentToken */: - case 52 /* PercentEqualsToken */: - case 29 /* MinusToken */: - case 49 /* MinusEqualsToken */: - case 35 /* LessThanLessThanToken */: - case 53 /* LessThanLessThanEqualsToken */: - case 36 /* GreaterThanGreaterThanToken */: - case 54 /* GreaterThanGreaterThanEqualsToken */: - case 37 /* GreaterThanGreaterThanGreaterThanToken */: - case 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 39 /* BarToken */: - case 57 /* BarEqualsToken */: - case 40 /* CaretToken */: - case 58 /* CaretEqualsToken */: - case 38 /* AmpersandToken */: - case 56 /* AmpersandEqualsToken */: + case 34 /* AsteriskToken */: + case 54 /* AsteriskEqualsToken */: + case 35 /* SlashToken */: + case 55 /* SlashEqualsToken */: + case 36 /* PercentToken */: + case 56 /* PercentEqualsToken */: + case 33 /* MinusToken */: + case 53 /* MinusEqualsToken */: + case 39 /* LessThanLessThanToken */: + case 57 /* LessThanLessThanEqualsToken */: + case 40 /* GreaterThanGreaterThanToken */: + case 58 /* GreaterThanGreaterThanEqualsToken */: + case 41 /* GreaterThanGreaterThanGreaterThanToken */: + case 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 43 /* BarToken */: + case 61 /* BarEqualsToken */: + case 44 /* CaretToken */: + case 62 /* CaretEqualsToken */: + case 42 /* AmpersandToken */: + case 60 /* AmpersandEqualsToken */: if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) leftType = rightType; if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) @@ -13937,17 +13692,17 @@ var ts; } } return numberType; - case 28 /* PlusToken */: - case 48 /* PlusEqualsToken */: + case 32 /* PlusToken */: + case 52 /* PlusEqualsToken */: if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) leftType = rightType; if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) rightType = leftType; var resultType; - if (leftType.flags & ts.TypeFlags.NumberLike && rightType.flags & ts.TypeFlags.NumberLike) { + if (leftType.flags & 132 /* NumberLike */ && rightType.flags & 132 /* NumberLike */) { resultType = numberType; } - else if (leftType.flags & ts.TypeFlags.StringLike || rightType.flags & ts.TypeFlags.StringLike) { + else if (leftType.flags & 258 /* StringLike */ || rightType.flags & 258 /* StringLike */) { resultType = stringType; } else if (leftType.flags & 1 /* Any */ || leftType === unknownType || rightType.flags & 1 /* Any */ || rightType === unknownType) { @@ -13957,53 +13712,53 @@ var ts; reportOperatorError(); return anyType; } - if (operator === 48 /* PlusEqualsToken */) { + if (operator === 52 /* PlusEqualsToken */) { checkAssignmentOperator(resultType); } return resultType; - case 23 /* EqualsEqualsToken */: - case 24 /* ExclamationEqualsToken */: - case 25 /* EqualsEqualsEqualsToken */: - case 26 /* ExclamationEqualsEqualsToken */: - case 19 /* LessThanToken */: - case 20 /* GreaterThanToken */: - case 21 /* LessThanEqualsToken */: - case 22 /* GreaterThanEqualsToken */: + case 27 /* EqualsEqualsToken */: + case 28 /* ExclamationEqualsToken */: + case 29 /* EqualsEqualsEqualsToken */: + case 30 /* ExclamationEqualsEqualsToken */: + case 23 /* LessThanToken */: + case 24 /* GreaterThanToken */: + case 25 /* LessThanEqualsToken */: + case 26 /* GreaterThanEqualsToken */: if (!isTypeAssignableTo(leftType, rightType) && !isTypeAssignableTo(rightType, leftType)) { reportOperatorError(); } return booleanType; - case 81 /* InstanceOfKeyword */: + case 85 /* InstanceOfKeyword */: return checkInstanceOfExpression(node, leftType, rightType); - case 80 /* InKeyword */: + case 84 /* InKeyword */: return checkInExpression(node, leftType, rightType); - case 43 /* AmpersandAmpersandToken */: + case 47 /* AmpersandAmpersandToken */: return rightType; - case 44 /* BarBarToken */: + case 48 /* BarBarToken */: return getUnionType([leftType, rightType]); - case 47 /* EqualsToken */: + case 51 /* EqualsToken */: checkAssignmentOperator(rightType); return rightType; - case 18 /* CommaToken */: + case 22 /* CommaToken */: return rightType; } function getSuggestedBooleanOperator(operator) { switch (operator) { - case 39 /* BarToken */: - case 57 /* BarEqualsToken */: - return 44 /* BarBarToken */; - case 40 /* CaretToken */: - case 58 /* CaretEqualsToken */: - return 26 /* ExclamationEqualsEqualsToken */; - case 38 /* AmpersandToken */: - case 56 /* AmpersandEqualsToken */: - return 43 /* AmpersandAmpersandToken */; + case 43 /* BarToken */: + case 61 /* BarEqualsToken */: + return 48 /* BarBarToken */; + case 44 /* CaretToken */: + case 62 /* CaretEqualsToken */: + return 30 /* ExclamationEqualsEqualsToken */; + case 42 /* AmpersandToken */: + case 60 /* AmpersandEqualsToken */: + return 47 /* AmpersandAmpersandToken */; default: return undefined; } } function checkAssignmentOperator(valueType) { - if (fullTypeCheck && operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { + if (fullTypeCheck && operator >= 51 /* FirstAssignment */ && operator <= 62 /* LastAssignment */) { var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); if (ok) { checkTypeAssignableTo(valueType, leftType, node.left, undefined); @@ -14020,6 +13775,12 @@ var ts; var type2 = checkExpression(node.whenFalse, contextualMapper); return getUnionType([type1, type2]); } + function checkTemplateExpression(node) { + ts.forEach(node.templateSpans, function (templateSpan) { + checkExpression(templateSpan.expression); + }); + return stringType; + } function checkExpressionWithContextualType(node, contextualType, contextualMapper) { var saveContextualType = node.contextualType; node.contextualType = contextualType; @@ -14046,56 +13807,67 @@ 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)); + 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); + } + } return type; } function checkExpressionNode(node, contextualMapper) { switch (node.kind) { - case 59 /* Identifier */: + case 63 /* Identifier */: return checkIdentifier(node); - case 87 /* ThisKeyword */: + case 91 /* ThisKeyword */: return checkThisExpression(node); - case 85 /* SuperKeyword */: + case 89 /* SuperKeyword */: return checkSuperExpression(node); - case 83 /* NullKeyword */: + case 87 /* NullKeyword */: return nullType; - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: + case 93 /* TrueKeyword */: + case 78 /* FalseKeyword */: return booleanType; case 6 /* NumericLiteral */: return numberType; + case 155 /* TemplateExpression */: + return checkTemplateExpression(node); case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: return stringType; case 8 /* RegularExpressionLiteral */: return globalRegExpType; - case 117 /* QualifiedName */: + case 121 /* QualifiedName */: return checkPropertyAccess(node); - case 135 /* ArrayLiteral */: + case 139 /* ArrayLiteral */: return checkArrayLiteral(node, contextualMapper); - case 136 /* ObjectLiteral */: + case 140 /* ObjectLiteral */: return checkObjectLiteral(node, contextualMapper); - case 138 /* PropertyAccess */: + case 142 /* PropertyAccess */: return checkPropertyAccess(node); - case 139 /* IndexedAccess */: + case 143 /* IndexedAccess */: return checkIndexedAccess(node); - case 140 /* CallExpression */: - case 141 /* NewExpression */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: return checkCallExpression(node); - case 142 /* TypeAssertion */: + case 146 /* TaggedTemplateExpression */: + return checkTaggedTemplateExpression(node); + case 147 /* TypeAssertion */: return checkTypeAssertion(node); - case 143 /* ParenExpression */: + case 148 /* ParenExpression */: return checkExpression(node.expression); - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: return checkFunctionExpression(node, contextualMapper); - case 146 /* PrefixOperator */: + case 151 /* PrefixOperator */: return checkPrefixExpression(node); - case 147 /* PostfixOperator */: + case 152 /* PostfixOperator */: return checkPostfixExpression(node); - case 148 /* BinaryExpression */: + case 153 /* BinaryExpression */: return checkBinaryExpression(node, contextualMapper); - case 149 /* ConditionalExpression */: + case 154 /* ConditionalExpression */: return checkConditionalExpression(node, contextualMapper); - case 150 /* OmittedExpression */: + case 157 /* OmittedExpression */: return undefinedType; } return unknownType; @@ -14111,7 +13883,7 @@ var ts; checkVariableDeclaration(parameterDeclaration); if (fullTypeCheck) { checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name); - if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */) && !(parameterDeclaration.parent.kind === 122 /* Constructor */ && parameterDeclaration.parent.body)) { + if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */) && !(parameterDeclaration.parent.kind === 126 /* Constructor */ && parameterDeclaration.parent.body)) { error(parameterDeclaration, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } if (parameterDeclaration.flags & 8 /* Rest */) { @@ -14126,10 +13898,10 @@ var ts; } } function checkReferencesInInitializer(n) { - if (n.kind === 59 /* Identifier */) { + if (n.kind === 63 /* Identifier */) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; - if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, ts.SymbolFlags.Value) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 119 /* Parameter */) { + 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)); return; @@ -14163,10 +13935,10 @@ var ts; checkCollisionWithArgumentsInGeneratedCode(node); if (compilerOptions.noImplicitAny && !node.type) { switch (node.kind) { - case 126 /* ConstructSignature */: + case 130 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 125 /* CallSignature */: + case 129 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -14175,7 +13947,7 @@ var ts; checkSpecializedSignatureDeclaration(node); } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 178 /* InterfaceDeclaration */) { + if (node.kind === 185 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -14189,7 +13961,7 @@ var ts; var declaration = indexSymbol.declarations[i]; if (declaration.parameters.length == 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 114 /* StringKeyword */: + case 118 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -14197,7 +13969,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 112 /* NumberKeyword */: + case 116 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -14231,39 +14003,37 @@ var ts; return; } function isSuperCallExpression(n) { - return n.kind === 140 /* CallExpression */ && n.func.kind === 85 /* SuperKeyword */; + return n.kind === 144 /* CallExpression */ && n.func.kind === 89 /* SuperKeyword */; } function containsSuperCall(n) { if (isSuperCallExpression(n)) { return true; } switch (n.kind) { - case 144 /* FunctionExpression */: - case 175 /* FunctionDeclaration */: - case 145 /* ArrowFunction */: - case 136 /* ObjectLiteral */: - return false; - default: - return ts.forEachChild(n, containsSuperCall); + case 149 /* FunctionExpression */: + case 182 /* FunctionDeclaration */: + case 150 /* ArrowFunction */: + case 140 /* ObjectLiteral */: return false; + default: return ts.forEachChild(n, containsSuperCall); } } function markThisReferencesAsErrors(n) { - if (n.kind === 87 /* ThisKeyword */) { + if (n.kind === 91 /* ThisKeyword */) { error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); } - else if (n.kind !== 144 /* FunctionExpression */ && n.kind !== 175 /* FunctionDeclaration */) { + else if (n.kind !== 149 /* FunctionExpression */ && n.kind !== 182 /* FunctionDeclaration */) { ts.forEachChild(n, markThisReferencesAsErrors); } } function isInstancePropertyWithInitializer(n) { - return n.kind === 120 /* Property */ && !(n.flags & 128 /* Static */) && !!n.initializer; + return n.kind === 124 /* Property */ && !(n.flags & 128 /* Static */) && !!n.initializer; } if (node.parent.baseType) { if (containsSuperCall(node.body)) { 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 !== 154 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { + if (!statements.length || statements[0].kind !== 161 /* 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 { @@ -14278,15 +14048,15 @@ var ts; } function checkAccessorDeclaration(node) { if (fullTypeCheck) { - if (node.kind === 123 /* GetAccessor */) { + if (node.kind === 127 /* GetAccessor */) { if (!ts.isInAmbientContext(node) && node.body && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); } } - var otherKind = node.kind === 123 /* GetAccessor */ ? 124 /* SetAccessor */ : 123 /* GetAccessor */; + var otherKind = node.kind === 127 /* GetAccessor */ ? 128 /* SetAccessor */ : 127 /* GetAccessor */; var otherAccessor = getDeclarationOfKind(node.symbol, otherKind); if (otherAccessor) { - if (((node.flags & ts.NodeFlags.AccessibilityModifier) !== (otherAccessor.flags & ts.NodeFlags.AccessibilityModifier))) { + if (((node.flags & 112 /* AccessibilityModifier */) !== (otherAccessor.flags & 112 /* AccessibilityModifier */))) { error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); } var thisType = getAnnotatedAccessorType(node); @@ -14352,9 +14122,9 @@ var ts; } var symbol = getSymbolOfNode(signatureDeclarationNode); var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 178 /* InterfaceDeclaration */) { - ts.Debug.assert(signatureDeclarationNode.kind === 125 /* CallSignature */ || signatureDeclarationNode.kind === 126 /* ConstructSignature */); - var signatureKind = signatureDeclarationNode.kind === 125 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; + if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 185 /* 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); var containingType = getDeclaredTypeOfSymbol(containingSymbol); signaturesToCheck = getSignaturesOfType(containingType, signatureKind); @@ -14372,7 +14142,7 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = n.flags; - if (n.parent.kind !== 178 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { + if (n.parent.kind !== 185 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { if (!(flags & 2 /* Ambient */)) { flags |= 1 /* Export */; } @@ -14414,9 +14184,9 @@ var ts; var lastSeenNonAmbientDeclaration; var previousDeclaration; var declarations = symbol.declarations; - var isConstructor = (symbol.flags & 8192 /* Constructor */) !== 0; + var isConstructor = (symbol.flags & 16384 /* Constructor */) !== 0; function reportImplementationExpectedError(node) { - if (node.name && node.name.kind === 116 /* Missing */) { + if (node.name && node.name.kind === 120 /* Missing */) { return; } var seen = false; @@ -14432,7 +14202,7 @@ var ts; if (subsequentNode.kind === node.kind) { var errorNode = subsequentNode.name || subsequentNode; if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - ts.Debug.assert(node.kind === 121 /* Method */); + ts.Debug.assert(node.kind === 125 /* Method */); ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */)); var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; error(errorNode, diagnostic); @@ -14452,17 +14222,17 @@ var ts; error(errorNode, ts.Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration); } } - var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & ts.SymbolFlags.Module; + var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536 /* Module */; var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; for (var i = 0; i < declarations.length; i++) { var node = declarations[i]; var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 178 /* InterfaceDeclaration */ || node.parent.kind === 130 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 185 /* InterfaceDeclaration */ || node.parent.kind === 134 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 175 /* FunctionDeclaration */ || node.kind === 121 /* Method */ || node.kind === 122 /* Constructor */) { + if (node.kind === 182 /* FunctionDeclaration */ || node.kind === 125 /* Method */ || node.kind === 126 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -14528,7 +14298,7 @@ var ts; var symbol = node.localSymbol; if (!symbol) { symbol = getSymbolOfNode(node); - if (!(symbol.flags & ts.SymbolFlags.Export)) { + if (!(symbol.flags & 29360128 /* Export */)) { return; } } @@ -14556,14 +14326,14 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 178 /* InterfaceDeclaration */: - return 4194304 /* ExportType */; - case 181 /* ModuleDeclaration */: - return d.name.kind === 7 /* StringLiteral */ || ts.isInstantiated(d) ? 8388608 /* ExportNamespace */ | 2097152 /* ExportValue */ : 8388608 /* ExportNamespace */; - case 177 /* ClassDeclaration */: - case 180 /* EnumDeclaration */: - return 4194304 /* ExportType */ | 2097152 /* ExportValue */; - case 183 /* ImportDeclaration */: + case 185 /* InterfaceDeclaration */: + return 8388608 /* ExportType */; + case 188 /* ModuleDeclaration */: + return d.name.kind === 7 /* StringLiteral */ || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 16777216 /* ExportNamespace */ | 4194304 /* ExportValue */ : 16777216 /* ExportNamespace */; + case 184 /* ClassDeclaration */: + case 187 /* EnumDeclaration */: + return 8388608 /* ExportType */ | 4194304 /* ExportValue */; + case 190 /* ImportDeclaration */: var result = 0; var target = resolveImport(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { @@ -14571,7 +14341,7 @@ var ts; }); return result; default: - return 2097152 /* ExportValue */; + return 4194304 /* ExportValue */; } } } @@ -14621,7 +14391,7 @@ var ts; if (!(name && name.text === "_i")) { return; } - if (node.kind === 119 /* Parameter */) { + if (node.kind === 123 /* Parameter */) { if (node.parent.body && ts.hasRestParameters(node.parent) && !ts.isInAmbientContext(node)) { error(node, ts.Diagnostics.Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter); } @@ -14638,11 +14408,11 @@ var ts; return; } switch (current.kind) { - case 175 /* FunctionDeclaration */: - case 144 /* FunctionExpression */: - case 121 /* Method */: - case 145 /* ArrowFunction */: - case 122 /* Constructor */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 125 /* Method */: + case 150 /* 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); return; @@ -14656,13 +14426,13 @@ var ts; if (!(identifier && identifier.text === name)) { return false; } - if (node.kind === 120 /* Property */ || node.kind === 121 /* Method */ || node.kind === 123 /* GetAccessor */ || node.kind === 124 /* SetAccessor */) { + if (node.kind === 124 /* Property */ || node.kind === 125 /* Method */ || node.kind === 127 /* GetAccessor */ || node.kind === 128 /* SetAccessor */) { return false; } if (ts.isInAmbientContext(node)) { return false; } - if (node.kind === 119 /* Parameter */ && !node.parent.body) { + if (node.kind === 123 /* Parameter */ && !node.parent.body) { return false; } return true; @@ -14677,7 +14447,7 @@ var ts; var current = node; while (current) { if (getNodeCheckFlags(current) & 4 /* CaptureThis */) { - var isDeclaration = node.kind !== 59 /* Identifier */; + var isDeclaration = node.kind !== 63 /* Identifier */; if (isDeclaration) { error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); } @@ -14693,12 +14463,12 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } - var enclosingClass = ts.getAncestor(node, 177 /* ClassDeclaration */); + var enclosingClass = ts.getAncestor(node, 184 /* ClassDeclaration */); if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { return; } if (enclosingClass.baseType) { - var isDeclaration = node.kind !== 59 /* Identifier */; + var isDeclaration = node.kind !== 63 /* Identifier */; if (isDeclaration) { error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); } @@ -14711,19 +14481,19 @@ var ts; if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } - if (node.kind === 181 /* ModuleDeclaration */ && !ts.isInstantiated(node)) { + if (node.kind === 188 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return; } - var parent = node.kind === 174 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (parent.kind === 186 /* SourceFile */ && ts.isExternalModule(parent)) { + 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); } } function checkCollisionWithConstDeclarations(node) { - if (node.initializer && (node.flags & ts.NodeFlags.BlockScoped) === 0) { + if (node.initializer && (node.flags & 6144 /* BlockScoped */) === 0) { var symbol = getSymbolOfNode(node); if (symbol.flags & 1 /* FunctionScopedVariable */) { - var localDeclarationSymbol = resolveName(node, node.name.text, ts.SymbolFlags.Variable, undefined, undefined); + var localDeclarationSymbol = resolveName(node, node.name.text, 3 /* Variable */, undefined, undefined); if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 4096 /* Const */) { error(node, ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0, symbolToString(localDeclarationSymbol)); @@ -14820,18 +14590,18 @@ var ts; if (node.expression && !(getNodeLinks(node.expression).flags & 1 /* TypeChecked */)) { var func = ts.getContainingFunction(node); if (func) { - if (func.kind === 124 /* SetAccessor */) { + if (func.kind === 128 /* SetAccessor */) { if (node.expression) { error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); } } else { var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); - var checkAssignability = func.type || (func.kind === 123 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 124 /* SetAccessor */))); + var checkAssignability = func.type || (func.kind === 127 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 128 /* SetAccessor */))); if (checkAssignability) { checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, undefined); } - else if (func.kind == 122 /* Constructor */) { + else if (func.kind == 126 /* Constructor */) { if (!isTypeAssignableTo(checkExpression(node.expression), returnType)) { error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -14960,7 +14730,7 @@ var ts; checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); var staticBaseType = getTypeOfSymbol(baseType.symbol); checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, ts.SymbolFlags.Value)) { + if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, 107455 /* Value */)) { error(node.baseType, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); } checkKindsOfPropertyMemberOverrides(type, baseType); @@ -14991,13 +14761,13 @@ var ts; } } function getTargetSymbol(s) { - return s.flags & 33554432 /* Instantiated */ ? getSymbolLinks(s).target : s; + return s.flags & 67108864 /* Instantiated */ ? getSymbolLinks(s).target : s; } function checkKindsOfPropertyMemberOverrides(type, baseType) { var baseProperties = getPropertiesOfObjectType(baseType); for (var i = 0, len = baseProperties.length; i < len; ++i) { var base = getTargetSymbol(baseProperties[i]); - if (base.flags & 268435456 /* Prototype */) { + if (base.flags & 536870912 /* Prototype */) { continue; } var derived = getTargetSymbol(getPropertyOfObjectType(type, base.name)); @@ -15010,26 +14780,26 @@ var ts; if ((baseDeclarationFlags & 128 /* Static */) !== (derivedDeclarationFlags & 128 /* Static */)) { continue; } - if ((base.flags & derived.flags & 4096 /* Method */) || ((base.flags & ts.SymbolFlags.PropertyOrAccessor) && (derived.flags & ts.SymbolFlags.PropertyOrAccessor))) { + if ((base.flags & derived.flags & 8192 /* Method */) || ((base.flags & 98308 /* PropertyOrAccessor */) && (derived.flags & 98308 /* PropertyOrAccessor */))) { continue; } var errorMessage; - if (base.flags & 4096 /* Method */) { - if (derived.flags & ts.SymbolFlags.Accessor) { + if (base.flags & 8192 /* Method */) { + if (derived.flags & 98304 /* Accessor */) { errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; } else { - ts.Debug.assert(derived.flags & 4 /* Property */); + ts.Debug.assert((derived.flags & 4 /* Property */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; } } else if (base.flags & 4 /* Property */) { - ts.Debug.assert(derived.flags & 4096 /* Method */); + ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; } else { - ts.Debug.assert(base.flags & ts.SymbolFlags.Accessor); - ts.Debug.assert(derived.flags & 4096 /* Method */); + ts.Debug.assert((base.flags & 98304 /* Accessor */) !== 0); + ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; } error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); @@ -15037,7 +14807,7 @@ var ts; } } function isAccessor(kind) { - return kind === 123 /* GetAccessor */ || kind === 124 /* SetAccessor */; + return kind === 127 /* GetAccessor */ || kind === 128 /* SetAccessor */; } function areTypeParametersIdentical(list1, list2) { if (!list1 && !list2) { @@ -15064,13 +14834,46 @@ var ts; } return true; } + function checkInheritedPropertiesAreIdentical(type, typeNode) { + if (!type.baseTypes.length || type.baseTypes.length === 1) { + return true; + } + var seen = {}; + ts.forEach(type.declaredProperties, function (p) { + seen[p.name] = { prop: p, containingType: type }; + }); + var ok = true; + for (var i = 0, len = type.baseTypes.length; i < len; ++i) { + var base = type.baseTypes[i]; + var properties = getPropertiesOfObjectType(base); + for (var j = 0, proplen = properties.length; j < proplen; ++j) { + var prop = properties[j]; + if (!ts.hasProperty(seen, prop.name)) { + seen[prop.name] = { prop: prop, containingType: base }; + } + else { + var existing = seen[prop.name]; + var isInheritedProperty = existing.containingType !== type; + if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { + ok = false; + var typeName1 = typeToString(existing.containingType); + var typeName2 = typeToString(base); + var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); + errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); + addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine())); + } + } + } + } + return ok; + } function checkInterfaceDeclaration(node) { checkTypeParameters(node.typeParameters); if (fullTypeCheck) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = getDeclarationOfKind(symbol, 178 /* InterfaceDeclaration */); + var firstInterfaceDecl = getDeclarationOfKind(symbol, 185 /* 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); @@ -15093,23 +14896,9 @@ var ts; } } function checkTypeAliasDeclaration(node) { + checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0); checkSourceElement(node.type); } - function getConstantValueForExpression(node) { - var isNegative = false; - if (node.kind === 146 /* PrefixOperator */) { - var unaryExpression = node; - if (unaryExpression.operator === 29 /* MinusToken */ || unaryExpression.operator === 28 /* PlusToken */) { - node = unaryExpression.operand; - isNegative = unaryExpression.operator === 29 /* MinusToken */; - } - } - if (node.kind === 6 /* NumericLiteral */) { - var literalText = node.text; - return isNegative ? -literalText : +literalText; - } - return undefined; - } function computeEnumMemberValues(node) { var nodeLinks = getNodeLinks(node); if (!(nodeLinks.flags & 128 /* EnumValuesComputed */)) { @@ -15117,18 +14906,32 @@ var ts; var enumType = getDeclaredTypeOfSymbol(enumSymbol); var autoValue = 0; var ambient = ts.isInAmbientContext(node); + var enumIsConst = ts.isConstEnumDeclaration(node); ts.forEach(node.members, function (member) { if (isNumericName(member.name.text)) { error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); } var initializer = member.initializer; if (initializer) { - autoValue = getConstantValueForExpression(initializer); - if (autoValue === undefined && !ambient) { - checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined); + autoValue = getConstantValueForEnumMemberInitializer(initializer, enumIsConst); + if (autoValue === undefined) { + if (enumIsConst) { + error(initializer, ts.Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression); + } + else if (!ambient) { + checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined); + } + } + else if (enumIsConst) { + if (isNaN(autoValue)) { + error(initializer, ts.Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN); + } + else if (!isFinite(autoValue)) { + error(initializer, ts.Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value); + } } } - else if (ambient) { + else if (ambient && !enumIsConst) { autoValue = undefined; } if (autoValue !== undefined) { @@ -15137,6 +14940,99 @@ var ts; }); nodeLinks.flags |= 128 /* EnumValuesComputed */; } + function getConstantValueForEnumMemberInitializer(initializer, enumIsConst) { + return evalConstant(initializer); + function evalConstant(e) { + switch (e.kind) { + case 151 /* PrefixOperator */: + var value = evalConstant(e.operand); + if (value === undefined) { + return undefined; + } + switch (e.operator) { + case 32 /* PlusToken */: return value; + case 33 /* MinusToken */: return -value; + case 46 /* TildeToken */: return enumIsConst ? ~value : undefined; + } + return undefined; + case 153 /* BinaryExpression */: + if (!enumIsConst) { + return undefined; + } + var left = evalConstant(e.left); + if (left === undefined) { + return undefined; + } + var right = evalConstant(e.right); + if (right === undefined) { + return undefined; + } + switch (e.operator) { + case 43 /* BarToken */: return left | right; + case 42 /* AmpersandToken */: return left & right; + case 40 /* GreaterThanGreaterThanToken */: return left >> right; + case 41 /* GreaterThanGreaterThanGreaterThanToken */: return left >>> right; + case 39 /* LessThanLessThanToken */: return left << right; + case 44 /* CaretToken */: return left ^ right; + case 34 /* AsteriskToken */: return left * right; + case 35 /* SlashToken */: return left / right; + case 32 /* PlusToken */: return left + right; + case 33 /* MinusToken */: return left - right; + case 36 /* PercentToken */: return left % right; + } + return undefined; + case 6 /* NumericLiteral */: + return +e.text; + case 148 /* ParenExpression */: + return enumIsConst ? evalConstant(e.expression) : undefined; + case 63 /* Identifier */: + case 143 /* IndexedAccess */: + case 142 /* PropertyAccess */: + if (!enumIsConst) { + return undefined; + } + var member = initializer.parent; + var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); + var enumType; + var propertyName; + if (e.kind === 63 /* Identifier */) { + enumType = currentType; + propertyName = e.text; + } + else { + if (e.kind === 143 /* IndexedAccess */) { + if (e.index.kind !== 7 /* StringLiteral */) { + return undefined; + } + var enumType = getTypeOfNode(e.object); + propertyName = e.index.text; + } + else { + var enumType = getTypeOfNode(e.left); + propertyName = e.right.text; + } + if (enumType !== currentType) { + return undefined; + } + } + if (propertyName === undefined) { + return undefined; + } + var property = getPropertyOfObjectType(enumType, propertyName); + if (!property || !(property.flags & 8 /* EnumMember */)) { + return undefined; + } + var propertyDecl = property.valueDeclaration; + if (member === propertyDecl) { + return undefined; + } + if (!isDefinedBefore(propertyDecl, member)) { + return undefined; + } + return getNodeLinks(propertyDecl).enumMemberValue; + } + } + } } function checkEnumDeclaration(node) { if (!fullTypeCheck) { @@ -15150,9 +15046,17 @@ var ts; var enumSymbol = getSymbolOfNode(node); var firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind); if (node === firstDeclaration) { + if (enumSymbol.declarations.length > 1) { + var enumIsConst = ts.isConstEnumDeclaration(node); + ts.forEach(enumSymbol.declarations, function (decl) { + if (ts.isConstEnumDeclaration(decl) !== enumIsConst) { + error(decl.name, ts.Diagnostics.Enum_declarations_must_all_be_const_or_non_const); + } + }); + } var seenEnumMissingInitialInitializer = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 180 /* EnumDeclaration */) { + if (declaration.kind !== 187 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -15175,7 +15079,7 @@ var ts; var declarations = symbol.declarations; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; - if ((declaration.kind === 177 /* ClassDeclaration */ || (declaration.kind === 175 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { + if ((declaration.kind === 184 /* ClassDeclaration */ || (declaration.kind === 182 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { return declaration; } } @@ -15187,7 +15091,7 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); - if (symbol.flags & 256 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { + if (symbol.flags & 512 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); if (classOrFunc) { if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { @@ -15210,7 +15114,7 @@ var ts; checkSourceElement(node.body); } function getFirstIdentifier(node) { - while (node.kind === 117 /* QualifiedName */) { + while (node.kind === 121 /* QualifiedName */) { node = node.left; } return node; @@ -15223,25 +15127,25 @@ var ts; if (node.entityName) { target = resolveImport(symbol); if (target !== unknownSymbol) { - if (target.flags & ts.SymbolFlags.Value) { + if (target.flags & 107455 /* Value */) { var moduleName = getFirstIdentifier(node.entityName); - if (resolveEntityName(node, moduleName, ts.SymbolFlags.Value | ts.SymbolFlags.Namespace).flags & ts.SymbolFlags.Namespace) { + if (resolveEntityName(node, moduleName, 107455 /* Value */ | 1536 /* Namespace */).flags & 1536 /* Namespace */) { checkExpression(node.entityName); } else { error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.identifierToString(moduleName)); } } - if (target.flags & ts.SymbolFlags.Type) { + if (target.flags & 3152352 /* Type */) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0); } } } else { - if (node.parent.kind === 186 /* SourceFile */) { + if (node.parent.kind === 193 /* SourceFile */) { target = resolveImport(symbol); } - else if (node.parent.kind === 182 /* ModuleBlock */ && node.parent.parent.name.kind === 7 /* StringLiteral */) { + else if (node.parent.kind === 189 /* 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; @@ -15255,7 +15159,7 @@ var ts; } } if (target !== unknownSymbol) { - var excludedMeanings = (symbol.flags & ts.SymbolFlags.Value ? ts.SymbolFlags.Value : 0) | (symbol.flags & ts.SymbolFlags.Type ? ts.SymbolFlags.Type : 0) | (symbol.flags & ts.SymbolFlags.Namespace ? ts.SymbolFlags.Namespace : 0); + var excludedMeanings = (symbol.flags & 107455 /* Value */ ? 107455 /* Value */ : 0) | (symbol.flags & 3152352 /* Type */ ? 3152352 /* Type */ : 0) | (symbol.flags & 1536 /* Namespace */ ? 1536 /* Namespace */ : 0); if (target.flags & excludedMeanings) { error(node, ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0, symbolToString(symbol)); } @@ -15263,7 +15167,7 @@ var ts; } function checkExportAssignment(node) { var container = node.parent; - if (container.kind !== 186 /* SourceFile */) { + if (container.kind !== 193 /* SourceFile */) { container = container.parent; } checkTypeOfExportAssignmentSymbol(getSymbolOfNode(container)); @@ -15272,150 +15176,151 @@ var ts; if (!node) return; switch (node.kind) { - case 118 /* TypeParameter */: + case 122 /* TypeParameter */: return checkTypeParameter(node); - case 119 /* Parameter */: + case 123 /* Parameter */: return checkParameter(node); - case 120 /* Property */: + case 124 /* Property */: return checkPropertyDeclaration(node); - case 125 /* CallSignature */: - case 126 /* ConstructSignature */: - case 127 /* IndexSignature */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: return checkSignatureDeclaration(node); - case 121 /* Method */: + case 125 /* Method */: return checkMethodDeclaration(node); - case 122 /* Constructor */: + case 126 /* Constructor */: return checkConstructorDeclaration(node); - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return checkAccessorDeclaration(node); - case 128 /* TypeReference */: + case 132 /* TypeReference */: return checkTypeReference(node); - case 129 /* TypeQuery */: + case 133 /* TypeQuery */: return checkTypeQuery(node); - case 130 /* TypeLiteral */: + case 134 /* TypeLiteral */: return checkTypeLiteral(node); - case 131 /* ArrayType */: + case 135 /* ArrayType */: return checkArrayType(node); - case 132 /* TupleType */: + case 136 /* TupleType */: return checkTupleType(node); - case 133 /* UnionType */: + case 137 /* UnionType */: return checkUnionType(node); - case 134 /* ParenType */: + case 138 /* ParenType */: return checkSourceElement(node.type); - case 175 /* FunctionDeclaration */: + case 182 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 151 /* Block */: + case 158 /* Block */: return checkBlock(node); - case 176 /* FunctionBlock */: - case 182 /* ModuleBlock */: + case 183 /* FunctionBlock */: + case 189 /* ModuleBlock */: return checkBody(node); - case 152 /* VariableStatement */: + case 159 /* VariableStatement */: return checkVariableStatement(node); - case 154 /* ExpressionStatement */: + case 161 /* ExpressionStatement */: return checkExpressionStatement(node); - case 155 /* IfStatement */: + case 162 /* IfStatement */: return checkIfStatement(node); - case 156 /* DoStatement */: + case 163 /* DoStatement */: return checkDoStatement(node); - case 157 /* WhileStatement */: + case 164 /* WhileStatement */: return checkWhileStatement(node); - case 158 /* ForStatement */: + case 165 /* ForStatement */: return checkForStatement(node); - case 159 /* ForInStatement */: + case 166 /* ForInStatement */: return checkForInStatement(node); - case 160 /* ContinueStatement */: - case 161 /* BreakStatement */: + case 167 /* ContinueStatement */: + case 168 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 162 /* ReturnStatement */: + case 169 /* ReturnStatement */: return checkReturnStatement(node); - case 163 /* WithStatement */: + case 170 /* WithStatement */: return checkWithStatement(node); - case 164 /* SwitchStatement */: + case 171 /* SwitchStatement */: return checkSwitchStatement(node); - case 167 /* LabeledStatement */: + case 174 /* LabeledStatement */: return checkLabeledStatement(node); - case 168 /* ThrowStatement */: + case 175 /* ThrowStatement */: return checkThrowStatement(node); - case 169 /* TryStatement */: + case 176 /* TryStatement */: return checkTryStatement(node); - case 174 /* VariableDeclaration */: + case 181 /* VariableDeclaration */: return ts.Debug.fail("Checker encountered variable declaration"); - case 177 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return checkClassDeclaration(node); - case 178 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 179 /* TypeAliasDeclaration */: + case 186 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 180 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 183 /* ImportDeclaration */: + case 190 /* ImportDeclaration */: return checkImportDeclaration(node); - case 184 /* ExportAssignment */: + case 191 /* ExportAssignment */: return checkExportAssignment(node); } } function checkFunctionExpressionBodies(node) { switch (node.kind) { - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: ts.forEach(node.parameters, checkFunctionExpressionBodies); checkFunctionExpressionBody(node); break; - case 121 /* Method */: - case 122 /* Constructor */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 175 /* FunctionDeclaration */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 182 /* FunctionDeclaration */: ts.forEach(node.parameters, checkFunctionExpressionBodies); break; - case 163 /* WithStatement */: + case 170 /* WithStatement */: checkFunctionExpressionBodies(node.expression); break; - case 119 /* Parameter */: - case 120 /* Property */: - case 135 /* ArrayLiteral */: - case 136 /* ObjectLiteral */: - case 137 /* PropertyAssignment */: - case 138 /* PropertyAccess */: - case 139 /* IndexedAccess */: - case 140 /* CallExpression */: - case 141 /* NewExpression */: - case 142 /* TypeAssertion */: - case 143 /* ParenExpression */: - case 146 /* PrefixOperator */: - case 147 /* PostfixOperator */: - case 148 /* BinaryExpression */: - case 149 /* ConditionalExpression */: - case 151 /* Block */: - case 176 /* FunctionBlock */: - case 182 /* ModuleBlock */: - case 152 /* VariableStatement */: - case 154 /* ExpressionStatement */: - case 155 /* IfStatement */: - case 156 /* DoStatement */: - case 157 /* WhileStatement */: - case 158 /* ForStatement */: - case 159 /* ForInStatement */: - case 160 /* ContinueStatement */: - case 161 /* BreakStatement */: - case 162 /* ReturnStatement */: - case 164 /* SwitchStatement */: - case 165 /* CaseClause */: - case 166 /* DefaultClause */: - case 167 /* LabeledStatement */: - case 168 /* ThrowStatement */: - case 169 /* TryStatement */: - case 170 /* TryBlock */: - case 171 /* CatchBlock */: - case 172 /* FinallyBlock */: - case 174 /* VariableDeclaration */: - case 177 /* ClassDeclaration */: - case 180 /* EnumDeclaration */: - case 185 /* EnumMember */: - case 186 /* SourceFile */: + 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 */: ts.forEachChild(node, checkFunctionExpressionBodies); break; } @@ -15432,7 +15337,7 @@ var ts; checkBody(node); if (ts.isExternalModule(node)) { var symbol = getExportAssignmentSymbol(node.symbol); - if (symbol && symbol.flags & 16777216 /* Import */) { + if (symbol && symbol.flags & 33554432 /* Import */) { getSymbolLinks(symbol).referenced = true; } } @@ -15486,7 +15391,7 @@ var ts; function isInsideWithStatementBody(node) { if (node) { while (node.parent) { - if (node.parent.kind === 163 /* WithStatement */ && node.parent.statement === node) { + if (node.parent.kind === 170 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; @@ -15522,27 +15427,27 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 186 /* SourceFile */: + case 193 /* SourceFile */: if (!ts.isExternalModule(location)) break; - case 181 /* ModuleDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & ts.SymbolFlags.ModuleMember); + case 188 /* ModuleDeclaration */: + copySymbols(getSymbolOfNode(location).exports, meaning & 35653619 /* ModuleMember */); break; - case 180 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: if (!(memberFlags & 128 /* Static */)) { - copySymbols(getSymbolOfNode(location).members, meaning & ts.SymbolFlags.Type); + copySymbols(getSymbolOfNode(location).members, meaning & 3152352 /* Type */); } break; - case 144 /* FunctionExpression */: + case 149 /* FunctionExpression */: if (location.name) { copySymbol(location.symbol, meaning); } break; - case 171 /* CatchBlock */: + case 178 /* CatchBlock */: if (location.variable.text) { copySymbol(location.symbol, meaning); } @@ -15555,100 +15460,102 @@ var ts; return ts.mapToArray(symbols); } function isTypeDeclarationName(name) { - return name.kind == 59 /* Identifier */ && isTypeDeclaration(name.parent) && name.parent.name === name; + return name.kind == 63 /* Identifier */ && isTypeDeclaration(name.parent) && name.parent.name === name; } function isTypeDeclaration(node) { switch (node.kind) { - case 118 /* TypeParameter */: - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - case 179 /* TypeAliasDeclaration */: - case 180 /* EnumDeclaration */: + case 122 /* TypeParameter */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 186 /* TypeAliasDeclaration */: + case 187 /* EnumDeclaration */: return true; } } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 117 /* QualifiedName */) + while (node.parent && node.parent.kind === 121 /* QualifiedName */) node = node.parent; - return node.parent && node.parent.kind === 128 /* TypeReference */; + return node.parent && node.parent.kind === 132 /* TypeReference */; } function isTypeNode(node) { - if (ts.SyntaxKind.FirstTypeNode <= node.kind && node.kind <= ts.SyntaxKind.LastTypeNode) { + if (132 /* FirstTypeNode */ <= node.kind && node.kind <= 138 /* LastTypeNode */) { return true; } switch (node.kind) { - case 105 /* AnyKeyword */: - case 112 /* NumberKeyword */: - case 114 /* StringKeyword */: - case 106 /* BooleanKeyword */: + case 109 /* AnyKeyword */: + case 116 /* NumberKeyword */: + case 118 /* StringKeyword */: + case 110 /* BooleanKeyword */: return true; - case 93 /* VoidKeyword */: - return node.parent.kind !== 146 /* PrefixOperator */; + case 97 /* VoidKeyword */: + return node.parent.kind !== 151 /* PrefixOperator */; case 7 /* StringLiteral */: - return node.parent.kind === 119 /* Parameter */; - case 59 /* Identifier */: - if (node.parent.kind === 117 /* QualifiedName */) { + return node.parent.kind === 123 /* Parameter */; + case 63 /* Identifier */: + if (node.parent.kind === 121 /* QualifiedName */) { node = node.parent; } - case 117 /* QualifiedName */: - ts.Debug.assert(node.kind === 59 /* Identifier */ || node.kind === 117 /* QualifiedName */, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); + 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 === 129 /* TypeQuery */) { + if (parent.kind === 133 /* TypeQuery */) { return false; } - if (ts.SyntaxKind.FirstTypeNode <= parent.kind && parent.kind <= ts.SyntaxKind.LastTypeNode) { + if (132 /* FirstTypeNode */ <= parent.kind && parent.kind <= 138 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 118 /* TypeParameter */: + case 122 /* TypeParameter */: return node === parent.constraint; - case 120 /* Property */: - case 119 /* Parameter */: - case 174 /* VariableDeclaration */: + case 124 /* Property */: + case 123 /* Parameter */: + case 181 /* VariableDeclaration */: return node === parent.type; - case 175 /* FunctionDeclaration */: - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: - case 122 /* Constructor */: - case 121 /* Method */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: + case 126 /* Constructor */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: return node === parent.type; - case 125 /* CallSignature */: - case 126 /* ConstructSignature */: - case 127 /* IndexSignature */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: return node === parent.type; - case 142 /* TypeAssertion */: + case 147 /* TypeAssertion */: return node === parent.type; - case 140 /* CallExpression */: - case 141 /* NewExpression */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: return parent.typeArguments && parent.typeArguments.indexOf(node) >= 0; + case 146 /* TaggedTemplateExpression */: + return false; } } return false; } function isInRightSideOfImportOrExportAssignment(node) { - while (node.parent.kind === 117 /* QualifiedName */) { + while (node.parent.kind === 121 /* QualifiedName */) { node = node.parent; } - if (node.parent.kind === 183 /* ImportDeclaration */) { + if (node.parent.kind === 190 /* ImportDeclaration */) { return node.parent.entityName === node; } - if (node.parent.kind === 184 /* ExportAssignment */) { + if (node.parent.kind === 191 /* ExportAssignment */) { return node.parent.exportName === node; } return false; } function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 117 /* QualifiedName */ || node.parent.kind === 138 /* PropertyAccess */) && node.parent.right === node; + return (node.parent.kind === 121 /* QualifiedName */ || node.parent.kind === 142 /* PropertyAccess */) && node.parent.right === node; } function getSymbolOfEntityName(entityName) { if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(entityName)) { return getSymbolOfNode(entityName.parent); } - if (entityName.parent.kind === 184 /* ExportAssignment */) { - return resolveEntityName(entityName.parent.parent, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace | 16777216 /* Import */); + if (entityName.parent.kind === 191 /* ExportAssignment */) { + return resolveEntityName(entityName.parent.parent, entityName, 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */ | 33554432 /* Import */); } if (isInRightSideOfImportOrExportAssignment(entityName)) { return getSymbolOfPartOfRightHandSideOfImport(entityName); @@ -15657,11 +15564,11 @@ var ts; entityName = entityName.parent; } if (ts.isExpression(entityName)) { - if (entityName.kind === 59 /* Identifier */) { - var meaning = ts.SymbolFlags.Value | 16777216 /* Import */; + if (entityName.kind === 63 /* Identifier */) { + var meaning = 107455 /* Value */ | 33554432 /* Import */; return resolveEntityName(entityName, entityName, meaning); } - else if (entityName.kind === 117 /* QualifiedName */ || entityName.kind === 138 /* PropertyAccess */) { + else if (entityName.kind === 121 /* QualifiedName */ || entityName.kind === 142 /* PropertyAccess */) { var symbol = getNodeLinks(entityName).resolvedSymbol; if (!symbol) { checkPropertyAccess(entityName); @@ -15673,8 +15580,8 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 128 /* TypeReference */ ? ts.SymbolFlags.Type : ts.SymbolFlags.Namespace; - meaning |= 16777216 /* Import */; + var meaning = entityName.parent.kind === 132 /* TypeReference */ ? 3152352 /* Type */ : 1536 /* Namespace */; + meaning |= 33554432 /* Import */; return resolveEntityName(entityName, entityName, meaning); } return undefined; @@ -15686,32 +15593,32 @@ var ts; if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { return getSymbolOfNode(node.parent); } - if (node.kind === 59 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 184 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); + if (node.kind === 63 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { + return node.parent.kind === 191 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); } switch (node.kind) { - case 59 /* Identifier */: - case 138 /* PropertyAccess */: - case 117 /* QualifiedName */: + case 63 /* Identifier */: + case 142 /* PropertyAccess */: + case 121 /* QualifiedName */: return getSymbolOfEntityName(node); - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: var type = checkExpression(node); return type.symbol; - case 107 /* ConstructorKeyword */: + case 111 /* ConstructorKeyword */: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 122 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 126 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; case 7 /* StringLiteral */: - if (node.parent.kind === 183 /* ImportDeclaration */ && node.parent.externalModuleName === node) { + if (node.parent.kind === 190 /* 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 == 139 /* IndexedAccess */ && node.parent.index === node) { + if (node.parent.kind == 143 /* IndexedAccess */ && node.parent.index === node) { var objectType = checkExpression(node.parent.object); if (objectType === unknownType) return undefined; @@ -15776,7 +15683,7 @@ var ts; return getNamedMembers(propsByName); } function getRootSymbols(symbol) { - if (symbol.flags & 536870912 /* UnionProperty */) { + if (symbol.flags & 1073741824 /* UnionProperty */) { var symbols = []; var name = symbol.name; ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) { @@ -15784,7 +15691,7 @@ var ts; }); return symbols; } - else if (symbol.flags & 134217728 /* Transient */) { + else if (symbol.flags & 268435456 /* Transient */) { var target = getSymbolLinks(symbol).target; if (target) { return [target]; @@ -15793,7 +15700,7 @@ var ts; return [symbol]; } function isExternalModuleSymbol(symbol) { - return symbol.flags & 256 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 186 /* SourceFile */; + return symbol.flags & 512 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 193 /* SourceFile */; } function isNodeDescendentOf(node, ancestor) { while (node) { @@ -15805,7 +15712,7 @@ var ts; } function isUniqueLocalName(name, container) { for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (ts.SymbolFlags.Value | 2097152 /* ExportValue */)) { + if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (107455 /* Value */ | 4194304 /* ExportValue */)) { return false; } } @@ -15826,7 +15733,7 @@ var ts; function getLocalNameForSymbol(symbol, location) { var node = location; while (node) { - if ((node.kind === 181 /* ModuleDeclaration */ || node.kind === 180 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { + if ((node.kind === 188 /* ModuleDeclaration */ || node.kind === 187 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { return getLocalNameOfContainer(node); } node = node.parent; @@ -15837,7 +15744,7 @@ var ts; var symbol = getNodeLinks(node).resolvedSymbol; if (symbol) { var exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); - if (symbol !== exportSymbol && !(exportSymbol.flags & ts.SymbolFlags.ExportHasLocal)) { + if (symbol !== exportSymbol && !(exportSymbol.flags & 944 /* ExportHasLocal */)) { symbol = exportSymbol; } if (symbol.parent) { @@ -15847,15 +15754,14 @@ var ts; } function getExportAssignmentName(node) { var symbol = getExportAssignmentSymbol(getSymbolOfNode(node)); - return symbol && symbolIsValue(symbol) ? symbolToString(symbol) : undefined; + return symbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol) ? symbolToString(symbol) : undefined; } - function isTopLevelValueImportedViaEntityName(node) { - if (node.parent.kind !== 186 /* SourceFile */ || !node.entityName) { + function isTopLevelValueImportWithEntityName(node) { + if (node.parent.kind !== 193 /* SourceFile */ || !node.entityName) { return false; } var symbol = getSymbolOfNode(node); - var target = resolveImport(symbol); - return target !== unknownSymbol && ((target.flags & ts.SymbolFlags.Value) !== 0); + return isImportResolvedToValue(getSymbolOfNode(node)); } function hasSemanticErrors() { return getDiagnostics().length > 0 || getGlobalDiagnostics().length > 0; @@ -15863,16 +15769,20 @@ var ts; function hasEarlyErrors(sourceFile) { return ts.forEach(getDiagnostics(sourceFile), function (d) { return d.isEarly; }); } + function isImportResolvedToValue(symbol) { + var target = resolveImport(symbol); + return target !== unknownSymbol && target.flags & 107455 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target); + } + function isConstEnumOrConstEnumOnlyModule(s) { + return isConstEnumSymbol(s) || s.constEnumOnlyModule; + } function isReferencedImportDeclaration(node) { var symbol = getSymbolOfNode(node); if (getSymbolLinks(symbol).referenced) { return true; } if (node.flags & 1 /* Export */) { - var target = resolveImport(symbol); - if (target !== unknownSymbol && target.flags & ts.SymbolFlags.Value) { - return true; - } + return isImportResolvedToValue(symbol); } return false; } @@ -15896,7 +15806,7 @@ var ts; if (symbol && (symbol.flags & 8 /* EnumMember */)) { var declaration = symbol.valueDeclaration; var constantValue; - if (declaration.kind === 185 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { + if (declaration.kind === 192 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { return constantValue; } } @@ -15904,7 +15814,7 @@ var ts; } function writeTypeAtLocation(location, enclosingDeclaration, flags, writer) { var symbol = getSymbolOfNode(location); - var type = symbol && !(symbol.flags & 1024 /* TypeLiteral */) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); + var type = symbol && !(symbol.flags & 2048 /* TypeLiteral */) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { @@ -15920,7 +15830,7 @@ var ts; isReferencedImportDeclaration: isReferencedImportDeclaration, getNodeCheckFlags: getNodeCheckFlags, getEnumMemberValue: getEnumMemberValue, - isTopLevelValueImportedViaEntityName: isTopLevelValueImportedViaEntityName, + isTopLevelValueImportWithEntityName: isTopLevelValueImportWithEntityName, hasSemanticErrors: hasSemanticErrors, hasEarlyErrors: hasEarlyErrors, isDeclarationVisible: isDeclarationVisible, @@ -15977,7 +15887,6 @@ var TypeScript; 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.", - AsteriskSlash_expected: "'*/' expected.", 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.", @@ -16059,6 +15968,7 @@ var TypeScript; 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.", @@ -16514,6 +16424,7 @@ var TypeScript; "'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 */ }, @@ -16871,7 +16782,7 @@ var TypeScript; if (array1 === array2) { return true; } - if (array1 === null || array2 === null) { + if (!array1 || !array2) { return false; } if (array1.length !== array2.length) { @@ -16920,7 +16831,7 @@ var TypeScript; return v; } } - return null; + return undefined; }; ArrayUtilities.firstOrDefault = function (array, func) { for (var i = 0, n = array.length; i < n; i++) { @@ -16929,7 +16840,7 @@ var TypeScript; return value; } } - return null; + return undefined; }; ArrayUtilities.first = function (array, func) { for (var i = 0, n = array.length; i < n; i++) { @@ -17043,13 +16954,12 @@ var TypeScript; return this.currentAssertionLevel >= level; }; Debug.assert = function (expression, message, verboseDebugInfo) { - if (message === void 0) { message = ""; } - if (verboseDebugInfo === void 0) { verboseDebugInfo = null; } if (!expression) { var verboseDebugString = ""; if (verboseDebugInfo) { verboseDebugString = "\r\nVerbose Debug Information:" + verboseDebugInfo(); } + message = message || ""; throw new Error("Debug Failure. False expression: " + message + verboseDebugString); } }; @@ -17103,12 +17013,10 @@ var TypeScript; var Diagnostic = (function (_super) { __extends(Diagnostic, _super); function Diagnostic(fileName, lineMap, start, length, diagnosticKey, _arguments, additionalLocations) { - if (_arguments === void 0) { _arguments = null; } - if (additionalLocations === void 0) { additionalLocations = null; } _super.call(this, fileName, lineMap, start, length); this._diagnosticKey = diagnosticKey; - this._arguments = (_arguments && _arguments.length > 0) ? _arguments : null; - this._additionalLocations = (additionalLocations && additionalLocations.length > 0) ? additionalLocations : null; + this._arguments = (_arguments && _arguments.length > 0) ? _arguments : undefined; + this._additionalLocations = (additionalLocations && additionalLocations.length > 0) ? additionalLocations : undefined; } Diagnostic.prototype.toJSON = function (key) { var result = {}; @@ -17260,7 +17168,7 @@ var TypeScript; function LineMap(_computeLineStarts, length) { this._computeLineStarts = _computeLineStarts; this.length = length; - this._lineStarts = null; + this._lineStarts = undefined; } LineMap.prototype.toJSON = function (key) { return { lineStarts: this.lineStarts(), length: this.length }; @@ -17269,7 +17177,7 @@ var TypeScript; 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 === null) { + if (!this._lineStarts) { this._lineStarts = this._computeLineStarts(); } return this._lineStarts; @@ -17456,6 +17364,7 @@ var TypeScript; 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"; @@ -17495,7 +17404,7 @@ var TypeScript; var StringScriptSnapshot = (function () { function StringScriptSnapshot(text) { this.text = text; - this._lineStartPositions = null; + this._lineStartPositions = undefined; } StringScriptSnapshot.prototype.getText = function (start, end) { return this.text.substring(start, end); @@ -17545,13 +17454,14 @@ var TypeScript; var SimpleStringText = (function () { function SimpleStringText(value) { this.value = value; - this._lineMap = null; + this._lineMap = undefined; } SimpleStringText.prototype.length = function () { return this.value.length; }; SimpleStringText.prototype.substr = function (start, length) { - return this.value.substr(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); @@ -17567,7 +17477,7 @@ var TypeScript; var SimpleScriptSnapshotText = (function () { function SimpleScriptSnapshotText(scriptSnapshot) { this.scriptSnapshot = scriptSnapshot; - this._lineMap = null; + this._lineMap = undefined; } SimpleScriptSnapshotText.prototype.charCodeAt = function (index) { return this.scriptSnapshot.getText(index, index + 1).charCodeAt(0); @@ -17580,7 +17490,7 @@ var TypeScript; }; SimpleScriptSnapshotText.prototype.lineMap = function () { var _this = this; - if (this._lineMap === null) { + if (!this._lineMap) { this._lineMap = new TypeScript.LineMap(function () { return _this.scriptSnapshot.getLineStartPositions(); }, this.length()); } return this._lineMap; @@ -17714,7 +17624,7 @@ var TypeScript; if (overlapStart < overlapEnd) { return TextSpan.fromBounds(overlapStart, overlapEnd); } - return null; + return undefined; }; TextSpan.prototype.intersectsWithTextSpan = function (span) { return span._start <= this.end() && span.end() >= this._start; @@ -17732,7 +17642,7 @@ var TypeScript; if (intersectStart <= intersectEnd) { return TextSpan.fromBounds(intersectStart, intersectEnd); } - return null; + return undefined; }; TextSpan.fromBounds = function (start, end) { TypeScript.Debug.assert(start >= 0); @@ -17885,252 +17795,217 @@ var TypeScript; (function (SyntaxKind) { SyntaxKind[SyntaxKind["None"] = 0] = "None"; SyntaxKind[SyntaxKind["List"] = 1] = "List"; - SyntaxKind[SyntaxKind["SeparatedList"] = 2] = "SeparatedList"; - SyntaxKind[SyntaxKind["TriviaList"] = 3] = "TriviaList"; - SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 4] = "WhitespaceTrivia"; - SyntaxKind[SyntaxKind["NewLineTrivia"] = 5] = "NewLineTrivia"; - SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 6] = "MultiLineCommentTrivia"; - SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 7] = "SingleLineCommentTrivia"; - SyntaxKind[SyntaxKind["SkippedTokenTrivia"] = 8] = "SkippedTokenTrivia"; - SyntaxKind[SyntaxKind["ErrorToken"] = 9] = "ErrorToken"; - SyntaxKind[SyntaxKind["EndOfFileToken"] = 10] = "EndOfFileToken"; - SyntaxKind[SyntaxKind["IdentifierName"] = 11] = "IdentifierName"; - SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 12] = "RegularExpressionLiteral"; - SyntaxKind[SyntaxKind["NumericLiteral"] = 13] = "NumericLiteral"; - SyntaxKind[SyntaxKind["StringLiteral"] = 14] = "StringLiteral"; - SyntaxKind[SyntaxKind["BreakKeyword"] = 15] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 16] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 17] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 18] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 19] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 20] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 21] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 22] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 23] = "ElseKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 24] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 25] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 26] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 27] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 28] = "IfKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 29] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 30] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 31] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 32] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 33] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 34] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 35] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 36] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 37] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 38] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 39] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 40] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 41] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 42] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 43] = "WithKeyword"; - SyntaxKind[SyntaxKind["ClassKeyword"] = 44] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 45] = "ConstKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 46] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 47] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 48] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 49] = "ImportKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 50] = "SuperKeyword"; - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 51] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 52] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 53] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 54] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 55] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 56] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 57] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 58] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 59] = "YieldKeyword"; - SyntaxKind[SyntaxKind["AnyKeyword"] = 60] = "AnyKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 61] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 62] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 63] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 64] = "GetKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 65] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 66] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 67] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 68] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 69] = "StringKeyword"; - SyntaxKind[SyntaxKind["OpenBraceToken"] = 70] = "OpenBraceToken"; - SyntaxKind[SyntaxKind["CloseBraceToken"] = 71] = "CloseBraceToken"; - SyntaxKind[SyntaxKind["OpenParenToken"] = 72] = "OpenParenToken"; - SyntaxKind[SyntaxKind["CloseParenToken"] = 73] = "CloseParenToken"; - SyntaxKind[SyntaxKind["OpenBracketToken"] = 74] = "OpenBracketToken"; - SyntaxKind[SyntaxKind["CloseBracketToken"] = 75] = "CloseBracketToken"; - SyntaxKind[SyntaxKind["DotToken"] = 76] = "DotToken"; - SyntaxKind[SyntaxKind["DotDotDotToken"] = 77] = "DotDotDotToken"; - SyntaxKind[SyntaxKind["SemicolonToken"] = 78] = "SemicolonToken"; - SyntaxKind[SyntaxKind["CommaToken"] = 79] = "CommaToken"; - SyntaxKind[SyntaxKind["LessThanToken"] = 80] = "LessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanToken"] = 81] = "GreaterThanToken"; - SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 82] = "LessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 83] = "GreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 84] = "EqualsEqualsToken"; - SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 85] = "EqualsGreaterThanToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 86] = "ExclamationEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 87] = "EqualsEqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 88] = "ExclamationEqualsEqualsToken"; - SyntaxKind[SyntaxKind["PlusToken"] = 89] = "PlusToken"; - SyntaxKind[SyntaxKind["MinusToken"] = 90] = "MinusToken"; - SyntaxKind[SyntaxKind["AsteriskToken"] = 91] = "AsteriskToken"; - SyntaxKind[SyntaxKind["PercentToken"] = 92] = "PercentToken"; - SyntaxKind[SyntaxKind["PlusPlusToken"] = 93] = "PlusPlusToken"; - SyntaxKind[SyntaxKind["MinusMinusToken"] = 94] = "MinusMinusToken"; - SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 95] = "LessThanLessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 96] = "GreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 97] = "GreaterThanGreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["AmpersandToken"] = 98] = "AmpersandToken"; - SyntaxKind[SyntaxKind["BarToken"] = 99] = "BarToken"; - SyntaxKind[SyntaxKind["CaretToken"] = 100] = "CaretToken"; - SyntaxKind[SyntaxKind["ExclamationToken"] = 101] = "ExclamationToken"; - SyntaxKind[SyntaxKind["TildeToken"] = 102] = "TildeToken"; - SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 103] = "AmpersandAmpersandToken"; - SyntaxKind[SyntaxKind["BarBarToken"] = 104] = "BarBarToken"; - SyntaxKind[SyntaxKind["QuestionToken"] = 105] = "QuestionToken"; - SyntaxKind[SyntaxKind["ColonToken"] = 106] = "ColonToken"; - SyntaxKind[SyntaxKind["EqualsToken"] = 107] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 108] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 109] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 110] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 111] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 112] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 113] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 114] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 115] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 116] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 117] = "CaretEqualsToken"; - SyntaxKind[SyntaxKind["SlashToken"] = 118] = "SlashToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 119] = "SlashEqualsToken"; - SyntaxKind[SyntaxKind["SourceUnit"] = 120] = "SourceUnit"; - SyntaxKind[SyntaxKind["QualifiedName"] = 121] = "QualifiedName"; - SyntaxKind[SyntaxKind["ObjectType"] = 122] = "ObjectType"; - SyntaxKind[SyntaxKind["FunctionType"] = 123] = "FunctionType"; - SyntaxKind[SyntaxKind["ArrayType"] = 124] = "ArrayType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 125] = "ConstructorType"; - SyntaxKind[SyntaxKind["GenericType"] = 126] = "GenericType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 127] = "TypeQuery"; - SyntaxKind[SyntaxKind["TupleType"] = 128] = "TupleType"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 129] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 130] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 131] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 132] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 133] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 134] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 135] = "ExportAssignment"; - SyntaxKind[SyntaxKind["MemberFunctionDeclaration"] = 136] = "MemberFunctionDeclaration"; - SyntaxKind[SyntaxKind["MemberVariableDeclaration"] = 137] = "MemberVariableDeclaration"; - SyntaxKind[SyntaxKind["ConstructorDeclaration"] = 138] = "ConstructorDeclaration"; - SyntaxKind[SyntaxKind["IndexMemberDeclaration"] = 139] = "IndexMemberDeclaration"; - SyntaxKind[SyntaxKind["GetAccessor"] = 140] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 141] = "SetAccessor"; - SyntaxKind[SyntaxKind["PropertySignature"] = 142] = "PropertySignature"; - SyntaxKind[SyntaxKind["CallSignature"] = 143] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 144] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 145] = "IndexSignature"; - SyntaxKind[SyntaxKind["MethodSignature"] = 146] = "MethodSignature"; - SyntaxKind[SyntaxKind["Block"] = 147] = "Block"; - SyntaxKind[SyntaxKind["IfStatement"] = 148] = "IfStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 149] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 150] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 151] = "ReturnStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 152] = "SwitchStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 153] = "BreakStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 154] = "ContinueStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 155] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 156] = "ForInStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 157] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 158] = "ThrowStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 159] = "WhileStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 160] = "TryStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 161] = "LabeledStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 162] = "DoStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 163] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 164] = "WithStatement"; - SyntaxKind[SyntaxKind["PlusExpression"] = 165] = "PlusExpression"; - SyntaxKind[SyntaxKind["NegateExpression"] = 166] = "NegateExpression"; - SyntaxKind[SyntaxKind["BitwiseNotExpression"] = 167] = "BitwiseNotExpression"; - SyntaxKind[SyntaxKind["LogicalNotExpression"] = 168] = "LogicalNotExpression"; - SyntaxKind[SyntaxKind["PreIncrementExpression"] = 169] = "PreIncrementExpression"; - SyntaxKind[SyntaxKind["PreDecrementExpression"] = 170] = "PreDecrementExpression"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 171] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 172] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 173] = "VoidExpression"; - SyntaxKind[SyntaxKind["CommaExpression"] = 174] = "CommaExpression"; - SyntaxKind[SyntaxKind["AssignmentExpression"] = 175] = "AssignmentExpression"; - SyntaxKind[SyntaxKind["AddAssignmentExpression"] = 176] = "AddAssignmentExpression"; - SyntaxKind[SyntaxKind["SubtractAssignmentExpression"] = 177] = "SubtractAssignmentExpression"; - SyntaxKind[SyntaxKind["MultiplyAssignmentExpression"] = 178] = "MultiplyAssignmentExpression"; - SyntaxKind[SyntaxKind["DivideAssignmentExpression"] = 179] = "DivideAssignmentExpression"; - SyntaxKind[SyntaxKind["ModuloAssignmentExpression"] = 180] = "ModuloAssignmentExpression"; - SyntaxKind[SyntaxKind["AndAssignmentExpression"] = 181] = "AndAssignmentExpression"; - SyntaxKind[SyntaxKind["ExclusiveOrAssignmentExpression"] = 182] = "ExclusiveOrAssignmentExpression"; - SyntaxKind[SyntaxKind["OrAssignmentExpression"] = 183] = "OrAssignmentExpression"; - SyntaxKind[SyntaxKind["LeftShiftAssignmentExpression"] = 184] = "LeftShiftAssignmentExpression"; - SyntaxKind[SyntaxKind["SignedRightShiftAssignmentExpression"] = 185] = "SignedRightShiftAssignmentExpression"; - SyntaxKind[SyntaxKind["UnsignedRightShiftAssignmentExpression"] = 186] = "UnsignedRightShiftAssignmentExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 187] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["LogicalOrExpression"] = 188] = "LogicalOrExpression"; - SyntaxKind[SyntaxKind["LogicalAndExpression"] = 189] = "LogicalAndExpression"; - SyntaxKind[SyntaxKind["BitwiseOrExpression"] = 190] = "BitwiseOrExpression"; - SyntaxKind[SyntaxKind["BitwiseExclusiveOrExpression"] = 191] = "BitwiseExclusiveOrExpression"; - SyntaxKind[SyntaxKind["BitwiseAndExpression"] = 192] = "BitwiseAndExpression"; - SyntaxKind[SyntaxKind["EqualsWithTypeConversionExpression"] = 193] = "EqualsWithTypeConversionExpression"; - SyntaxKind[SyntaxKind["NotEqualsWithTypeConversionExpression"] = 194] = "NotEqualsWithTypeConversionExpression"; - SyntaxKind[SyntaxKind["EqualsExpression"] = 195] = "EqualsExpression"; - SyntaxKind[SyntaxKind["NotEqualsExpression"] = 196] = "NotEqualsExpression"; - SyntaxKind[SyntaxKind["LessThanExpression"] = 197] = "LessThanExpression"; - SyntaxKind[SyntaxKind["GreaterThanExpression"] = 198] = "GreaterThanExpression"; - SyntaxKind[SyntaxKind["LessThanOrEqualExpression"] = 199] = "LessThanOrEqualExpression"; - SyntaxKind[SyntaxKind["GreaterThanOrEqualExpression"] = 200] = "GreaterThanOrEqualExpression"; - SyntaxKind[SyntaxKind["InstanceOfExpression"] = 201] = "InstanceOfExpression"; - SyntaxKind[SyntaxKind["InExpression"] = 202] = "InExpression"; - SyntaxKind[SyntaxKind["LeftShiftExpression"] = 203] = "LeftShiftExpression"; - SyntaxKind[SyntaxKind["SignedRightShiftExpression"] = 204] = "SignedRightShiftExpression"; - SyntaxKind[SyntaxKind["UnsignedRightShiftExpression"] = 205] = "UnsignedRightShiftExpression"; - SyntaxKind[SyntaxKind["MultiplyExpression"] = 206] = "MultiplyExpression"; - SyntaxKind[SyntaxKind["DivideExpression"] = 207] = "DivideExpression"; - SyntaxKind[SyntaxKind["ModuloExpression"] = 208] = "ModuloExpression"; - SyntaxKind[SyntaxKind["AddExpression"] = 209] = "AddExpression"; - SyntaxKind[SyntaxKind["SubtractExpression"] = 210] = "SubtractExpression"; - SyntaxKind[SyntaxKind["PostIncrementExpression"] = 211] = "PostIncrementExpression"; - SyntaxKind[SyntaxKind["PostDecrementExpression"] = 212] = "PostDecrementExpression"; - SyntaxKind[SyntaxKind["MemberAccessExpression"] = 213] = "MemberAccessExpression"; - SyntaxKind[SyntaxKind["InvocationExpression"] = 214] = "InvocationExpression"; - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 215] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 216] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectCreationExpression"] = 217] = "ObjectCreationExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 218] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["ParenthesizedArrowFunctionExpression"] = 219] = "ParenthesizedArrowFunctionExpression"; - SyntaxKind[SyntaxKind["SimpleArrowFunctionExpression"] = 220] = "SimpleArrowFunctionExpression"; - SyntaxKind[SyntaxKind["CastExpression"] = 221] = "CastExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 222] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 223] = "FunctionExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 224] = "OmittedExpression"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 225] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarator"] = 226] = "VariableDeclarator"; - SyntaxKind[SyntaxKind["ArgumentList"] = 227] = "ArgumentList"; - SyntaxKind[SyntaxKind["ParameterList"] = 228] = "ParameterList"; - SyntaxKind[SyntaxKind["TypeArgumentList"] = 229] = "TypeArgumentList"; - SyntaxKind[SyntaxKind["TypeParameterList"] = 230] = "TypeParameterList"; - SyntaxKind[SyntaxKind["ExtendsHeritageClause"] = 231] = "ExtendsHeritageClause"; - SyntaxKind[SyntaxKind["ImplementsHeritageClause"] = 232] = "ImplementsHeritageClause"; - SyntaxKind[SyntaxKind["EqualsValueClause"] = 233] = "EqualsValueClause"; - SyntaxKind[SyntaxKind["CaseSwitchClause"] = 234] = "CaseSwitchClause"; - SyntaxKind[SyntaxKind["DefaultSwitchClause"] = 235] = "DefaultSwitchClause"; - SyntaxKind[SyntaxKind["ElseClause"] = 236] = "ElseClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 237] = "CatchClause"; - SyntaxKind[SyntaxKind["FinallyClause"] = 238] = "FinallyClause"; - SyntaxKind[SyntaxKind["TypeParameter"] = 239] = "TypeParameter"; - SyntaxKind[SyntaxKind["Constraint"] = 240] = "Constraint"; - SyntaxKind[SyntaxKind["SimplePropertyAssignment"] = 241] = "SimplePropertyAssignment"; - SyntaxKind[SyntaxKind["FunctionPropertyAssignment"] = 242] = "FunctionPropertyAssignment"; - SyntaxKind[SyntaxKind["Parameter"] = 243] = "Parameter"; - SyntaxKind[SyntaxKind["EnumElement"] = 244] = "EnumElement"; - SyntaxKind[SyntaxKind["TypeAnnotation"] = 245] = "TypeAnnotation"; - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 246] = "ExternalModuleReference"; - SyntaxKind[SyntaxKind["ModuleNameModuleReference"] = 247] = "ModuleNameModuleReference"; + 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"; @@ -18159,111 +18034,111 @@ var TypeScript; var SyntaxFacts; (function (SyntaxFacts) { var textToKeywordKind = { - "any": 60 /* AnyKeyword */, - "boolean": 61 /* BooleanKeyword */, - "break": 15 /* BreakKeyword */, - "case": 16 /* CaseKeyword */, - "catch": 17 /* CatchKeyword */, - "class": 44 /* ClassKeyword */, - "continue": 18 /* ContinueKeyword */, - "const": 45 /* ConstKeyword */, - "constructor": 62 /* ConstructorKeyword */, - "debugger": 19 /* DebuggerKeyword */, - "declare": 63 /* DeclareKeyword */, - "default": 20 /* DefaultKeyword */, - "delete": 21 /* DeleteKeyword */, - "do": 22 /* DoKeyword */, - "else": 23 /* ElseKeyword */, - "enum": 46 /* EnumKeyword */, - "export": 47 /* ExportKeyword */, - "extends": 48 /* ExtendsKeyword */, - "false": 24 /* FalseKeyword */, - "finally": 25 /* FinallyKeyword */, - "for": 26 /* ForKeyword */, - "function": 27 /* FunctionKeyword */, - "get": 64 /* GetKeyword */, - "if": 28 /* IfKeyword */, - "implements": 51 /* ImplementsKeyword */, - "import": 49 /* ImportKeyword */, - "in": 29 /* InKeyword */, - "instanceof": 30 /* InstanceOfKeyword */, - "interface": 52 /* InterfaceKeyword */, - "let": 53 /* LetKeyword */, - "module": 65 /* ModuleKeyword */, - "new": 31 /* NewKeyword */, - "null": 32 /* NullKeyword */, - "number": 67 /* NumberKeyword */, - "package": 54 /* PackageKeyword */, - "private": 55 /* PrivateKeyword */, - "protected": 56 /* ProtectedKeyword */, - "public": 57 /* PublicKeyword */, - "require": 66 /* RequireKeyword */, - "return": 33 /* ReturnKeyword */, - "set": 68 /* SetKeyword */, - "static": 58 /* StaticKeyword */, - "string": 69 /* StringKeyword */, - "super": 50 /* SuperKeyword */, - "switch": 34 /* SwitchKeyword */, - "this": 35 /* ThisKeyword */, - "throw": 36 /* ThrowKeyword */, - "true": 37 /* TrueKeyword */, - "try": 38 /* TryKeyword */, - "typeof": 39 /* TypeOfKeyword */, - "var": 40 /* VarKeyword */, - "void": 41 /* VoidKeyword */, - "while": 42 /* WhileKeyword */, - "with": 43 /* WithKeyword */, - "yield": 59 /* YieldKeyword */, - "{": 70 /* OpenBraceToken */, - "}": 71 /* CloseBraceToken */, - "(": 72 /* OpenParenToken */, - ")": 73 /* CloseParenToken */, - "[": 74 /* OpenBracketToken */, - "]": 75 /* CloseBracketToken */, - ".": 76 /* DotToken */, - "...": 77 /* DotDotDotToken */, - ";": 78 /* SemicolonToken */, - ",": 79 /* CommaToken */, - "<": 80 /* LessThanToken */, - ">": 81 /* GreaterThanToken */, - "<=": 82 /* LessThanEqualsToken */, - ">=": 83 /* GreaterThanEqualsToken */, - "==": 84 /* EqualsEqualsToken */, - "=>": 85 /* EqualsGreaterThanToken */, - "!=": 86 /* ExclamationEqualsToken */, - "===": 87 /* EqualsEqualsEqualsToken */, - "!==": 88 /* ExclamationEqualsEqualsToken */, - "+": 89 /* PlusToken */, - "-": 90 /* MinusToken */, - "*": 91 /* AsteriskToken */, - "%": 92 /* PercentToken */, - "++": 93 /* PlusPlusToken */, - "--": 94 /* MinusMinusToken */, - "<<": 95 /* LessThanLessThanToken */, - ">>": 96 /* GreaterThanGreaterThanToken */, - ">>>": 97 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 98 /* AmpersandToken */, - "|": 99 /* BarToken */, - "^": 100 /* CaretToken */, - "!": 101 /* ExclamationToken */, - "~": 102 /* TildeToken */, - "&&": 103 /* AmpersandAmpersandToken */, - "||": 104 /* BarBarToken */, - "?": 105 /* QuestionToken */, - ":": 106 /* ColonToken */, - "=": 107 /* EqualsToken */, - "+=": 108 /* PlusEqualsToken */, - "-=": 109 /* MinusEqualsToken */, - "*=": 110 /* AsteriskEqualsToken */, - "%=": 111 /* PercentEqualsToken */, - "<<=": 112 /* LessThanLessThanEqualsToken */, - ">>=": 113 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 115 /* AmpersandEqualsToken */, - "|=": 116 /* BarEqualsToken */, - "^=": 117 /* CaretEqualsToken */, - "/": 118 /* SlashToken */, - "/=": 119 /* SlashEqualsToken */ + "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) { @@ -18271,7 +18146,7 @@ var TypeScript; kindToText[textToKeywordKind[name]] = name; } } - kindToText[62 /* ConstructorKeyword */] = "constructor"; + kindToText[64 /* ConstructorKeyword */] = "constructor"; function getTokenKind(text) { if (textToKeywordKind.hasOwnProperty(text)) { return textToKeywordKind[text]; @@ -18281,7 +18156,7 @@ var TypeScript; SyntaxFacts.getTokenKind = getTokenKind; function getText(kind) { var result = kindToText[kind]; - return result !== undefined ? result : null; + return result; } SyntaxFacts.getText = getText; function isAnyKeyword(kind) { @@ -18293,215 +18168,77 @@ var TypeScript; } SyntaxFacts.isAnyPunctuation = isAnyPunctuation; function isPrefixUnaryExpressionOperatorToken(tokenKind) { - return getPrefixUnaryExpressionFromOperatorToken(tokenKind) !== 0 /* None */; + 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) { - return getBinaryExpressionFromOperatorToken(tokenKind) !== 0 /* None */; + 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 getPrefixUnaryExpressionFromOperatorToken(tokenKind) { - switch (tokenKind) { - case 89 /* PlusToken */: - return 165 /* PlusExpression */; - case 90 /* MinusToken */: - return 166 /* NegateExpression */; - case 102 /* TildeToken */: - return 167 /* BitwiseNotExpression */; - case 101 /* ExclamationToken */: - return 168 /* LogicalNotExpression */; - case 93 /* PlusPlusToken */: - return 169 /* PreIncrementExpression */; - case 94 /* MinusMinusToken */: - return 170 /* PreDecrementExpression */; - default: - return 0 /* None */; - } - } - SyntaxFacts.getPrefixUnaryExpressionFromOperatorToken = getPrefixUnaryExpressionFromOperatorToken; - function getPostfixUnaryExpressionFromOperatorToken(tokenKind) { - switch (tokenKind) { - case 93 /* PlusPlusToken */: - return 211 /* PostIncrementExpression */; - case 94 /* MinusMinusToken */: - return 212 /* PostDecrementExpression */; - default: - return 0 /* None */; - } - } - SyntaxFacts.getPostfixUnaryExpressionFromOperatorToken = getPostfixUnaryExpressionFromOperatorToken; - function getBinaryExpressionFromOperatorToken(tokenKind) { - switch (tokenKind) { - case 91 /* AsteriskToken */: - return 206 /* MultiplyExpression */; - case 118 /* SlashToken */: - return 207 /* DivideExpression */; - case 92 /* PercentToken */: - return 208 /* ModuloExpression */; - case 89 /* PlusToken */: - return 209 /* AddExpression */; - case 90 /* MinusToken */: - return 210 /* SubtractExpression */; - case 95 /* LessThanLessThanToken */: - return 203 /* LeftShiftExpression */; - case 96 /* GreaterThanGreaterThanToken */: - return 204 /* SignedRightShiftExpression */; - case 97 /* GreaterThanGreaterThanGreaterThanToken */: - return 205 /* UnsignedRightShiftExpression */; - case 80 /* LessThanToken */: - return 197 /* LessThanExpression */; - case 81 /* GreaterThanToken */: - return 198 /* GreaterThanExpression */; - case 82 /* LessThanEqualsToken */: - return 199 /* LessThanOrEqualExpression */; - case 83 /* GreaterThanEqualsToken */: - return 200 /* GreaterThanOrEqualExpression */; - case 30 /* InstanceOfKeyword */: - return 201 /* InstanceOfExpression */; - case 29 /* InKeyword */: - return 202 /* InExpression */; - case 84 /* EqualsEqualsToken */: - return 193 /* EqualsWithTypeConversionExpression */; - case 86 /* ExclamationEqualsToken */: - return 194 /* NotEqualsWithTypeConversionExpression */; - case 87 /* EqualsEqualsEqualsToken */: - return 195 /* EqualsExpression */; - case 88 /* ExclamationEqualsEqualsToken */: - return 196 /* NotEqualsExpression */; - case 98 /* AmpersandToken */: - return 192 /* BitwiseAndExpression */; - case 100 /* CaretToken */: - return 191 /* BitwiseExclusiveOrExpression */; - case 99 /* BarToken */: - return 190 /* BitwiseOrExpression */; - case 103 /* AmpersandAmpersandToken */: - return 189 /* LogicalAndExpression */; - case 104 /* BarBarToken */: - return 188 /* LogicalOrExpression */; - case 116 /* BarEqualsToken */: - return 183 /* OrAssignmentExpression */; - case 115 /* AmpersandEqualsToken */: - return 181 /* AndAssignmentExpression */; - case 117 /* CaretEqualsToken */: - return 182 /* ExclusiveOrAssignmentExpression */; - case 112 /* LessThanLessThanEqualsToken */: - return 184 /* LeftShiftAssignmentExpression */; - case 113 /* GreaterThanGreaterThanEqualsToken */: - return 185 /* SignedRightShiftAssignmentExpression */; - case 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - return 186 /* UnsignedRightShiftAssignmentExpression */; - case 108 /* PlusEqualsToken */: - return 176 /* AddAssignmentExpression */; - case 109 /* MinusEqualsToken */: - return 177 /* SubtractAssignmentExpression */; - case 110 /* AsteriskEqualsToken */: - return 178 /* MultiplyAssignmentExpression */; - case 119 /* SlashEqualsToken */: - return 179 /* DivideAssignmentExpression */; - case 111 /* PercentEqualsToken */: - return 180 /* ModuloAssignmentExpression */; - case 107 /* EqualsToken */: - return 175 /* AssignmentExpression */; - case 79 /* CommaToken */: - return 174 /* CommaExpression */; - default: - return 0 /* None */; - } - } - SyntaxFacts.getBinaryExpressionFromOperatorToken = getBinaryExpressionFromOperatorToken; - function getOperatorTokenFromBinaryExpression(tokenKind) { - switch (tokenKind) { - case 206 /* MultiplyExpression */: - return 91 /* AsteriskToken */; - case 207 /* DivideExpression */: - return 118 /* SlashToken */; - case 208 /* ModuloExpression */: - return 92 /* PercentToken */; - case 209 /* AddExpression */: - return 89 /* PlusToken */; - case 210 /* SubtractExpression */: - return 90 /* MinusToken */; - case 203 /* LeftShiftExpression */: - return 95 /* LessThanLessThanToken */; - case 204 /* SignedRightShiftExpression */: - return 96 /* GreaterThanGreaterThanToken */; - case 205 /* UnsignedRightShiftExpression */: - return 97 /* GreaterThanGreaterThanGreaterThanToken */; - case 197 /* LessThanExpression */: - return 80 /* LessThanToken */; - case 198 /* GreaterThanExpression */: - return 81 /* GreaterThanToken */; - case 199 /* LessThanOrEqualExpression */: - return 82 /* LessThanEqualsToken */; - case 200 /* GreaterThanOrEqualExpression */: - return 83 /* GreaterThanEqualsToken */; - case 201 /* InstanceOfExpression */: - return 30 /* InstanceOfKeyword */; - case 202 /* InExpression */: - return 29 /* InKeyword */; - case 193 /* EqualsWithTypeConversionExpression */: - return 84 /* EqualsEqualsToken */; - case 194 /* NotEqualsWithTypeConversionExpression */: - return 86 /* ExclamationEqualsToken */; - case 195 /* EqualsExpression */: - return 87 /* EqualsEqualsEqualsToken */; - case 196 /* NotEqualsExpression */: - return 88 /* ExclamationEqualsEqualsToken */; - case 192 /* BitwiseAndExpression */: - return 98 /* AmpersandToken */; - case 191 /* BitwiseExclusiveOrExpression */: - return 100 /* CaretToken */; - case 190 /* BitwiseOrExpression */: - return 99 /* BarToken */; - case 189 /* LogicalAndExpression */: - return 103 /* AmpersandAmpersandToken */; - case 188 /* LogicalOrExpression */: - return 104 /* BarBarToken */; - case 183 /* OrAssignmentExpression */: - return 116 /* BarEqualsToken */; - case 181 /* AndAssignmentExpression */: - return 115 /* AmpersandEqualsToken */; - case 182 /* ExclusiveOrAssignmentExpression */: - return 117 /* CaretEqualsToken */; - case 184 /* LeftShiftAssignmentExpression */: - return 112 /* LessThanLessThanEqualsToken */; - case 185 /* SignedRightShiftAssignmentExpression */: - return 113 /* GreaterThanGreaterThanEqualsToken */; - case 186 /* UnsignedRightShiftAssignmentExpression */: - return 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */; - case 176 /* AddAssignmentExpression */: - return 108 /* PlusEqualsToken */; - case 177 /* SubtractAssignmentExpression */: - return 109 /* MinusEqualsToken */; - case 178 /* MultiplyAssignmentExpression */: - return 110 /* AsteriskEqualsToken */; - case 179 /* DivideAssignmentExpression */: - return 119 /* SlashEqualsToken */; - case 180 /* ModuloAssignmentExpression */: - return 111 /* PercentEqualsToken */; - case 175 /* AssignmentExpression */: - return 107 /* EqualsToken */; - case 174 /* CommaExpression */: - return 79 /* CommaToken */; - default: - return 0 /* None */; - } - } - SyntaxFacts.getOperatorTokenFromBinaryExpression = getOperatorTokenFromBinaryExpression; function isAssignmentOperatorToken(tokenKind) { switch (tokenKind) { - case 116 /* BarEqualsToken */: - case 115 /* AmpersandEqualsToken */: - case 117 /* CaretEqualsToken */: - case 112 /* LessThanLessThanEqualsToken */: - case 113 /* GreaterThanGreaterThanEqualsToken */: - case 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 108 /* PlusEqualsToken */: - case 109 /* MinusEqualsToken */: - case 110 /* AsteriskEqualsToken */: - case 119 /* SlashEqualsToken */: - case 111 /* PercentEqualsToken */: - case 107 /* EqualsToken */: + 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; @@ -18510,19 +18247,19 @@ var TypeScript; SyntaxFacts.isAssignmentOperatorToken = isAssignmentOperatorToken; function isType(kind) { switch (kind) { - case 124 /* ArrayType */: - case 60 /* AnyKeyword */: - case 67 /* NumberKeyword */: - case 61 /* BooleanKeyword */: - case 69 /* StringKeyword */: - case 41 /* VoidKeyword */: - case 123 /* FunctionType */: - case 122 /* ObjectType */: - case 125 /* ConstructorType */: - case 127 /* TypeQuery */: - case 126 /* GenericType */: - case 121 /* QualifiedName */: - case 11 /* IdentifierName */: + 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; @@ -18614,12 +18351,15 @@ var TypeScript; } function isContextualToken(token) { switch (token.kind()) { - case 12 /* RegularExpressionLiteral */: - case 96 /* GreaterThanGreaterThanToken */: - case 97 /* GreaterThanGreaterThanGreaterThanToken */: - case 83 /* GreaterThanEqualsToken */: - case 113 /* GreaterThanGreaterThanEqualsToken */: - case 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + 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(); @@ -18628,7 +18368,7 @@ var TypeScript; Scanner.isContextualToken = isContextualToken; var lastTokenInfo = { leadingTriviaWidth: -1, width: -1 }; var lastTokenInfoTokenID = -1; - var triviaScanner = createScannerInternal(ts.ScriptTarget.Latest, TypeScript.SimpleText.fromString(""), function () { + var triviaScanner = createScannerInternal(2 /* Latest */, TypeScript.SimpleText.fromString(""), function () { }); function fillSizeInfo(token, text) { if (lastTokenInfoTokenID !== TypeScript.syntaxID(token)) { @@ -18675,6 +18415,15 @@ var TypeScript; 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; }; @@ -18706,7 +18455,7 @@ var TypeScript; return this._packedData & 127 /* KindMask */; }; FixedWidthTokenWithNoTrivia.prototype.fullWidth = function () { - return this.fullText().length; + return fixedWidthTokenLength(this._packedData & 127 /* KindMask */); }; FixedWidthTokenWithNoTrivia.prototype.fullStart = function () { return fixedWidthTokenUnpackFullStart(this._packedData); @@ -18739,6 +18488,15 @@ var TypeScript; 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); @@ -19026,7 +18784,7 @@ var TypeScript; } break; } - return createTrivia(4 /* WhitespaceTrivia */, absoluteStartIndex); + return createTrivia(2 /* WhitespaceTrivia */, absoluteStartIndex); } function createTrivia(kind, absoluteStartIndex) { var fullWidth = index - absoluteStartIndex; @@ -19035,7 +18793,7 @@ var TypeScript; function scanSingleLineCommentTrivia() { var absoluteStartIndex = index; skipSingleLineCommentTrivia(); - return createTrivia(7 /* SingleLineCommentTrivia */, absoluteStartIndex); + return createTrivia(5 /* SingleLineCommentTrivia */, absoluteStartIndex); } function skipSingleLineCommentTrivia() { index += 2; @@ -19049,13 +18807,13 @@ var TypeScript; function scanMultiLineCommentTrivia() { var absoluteStartIndex = index; skipMultiLineCommentTrivia(); - return createTrivia(6 /* MultiLineCommentTrivia */, absoluteStartIndex); + return createTrivia(4 /* MultiLineCommentTrivia */, absoluteStartIndex); } function skipMultiLineCommentTrivia() { index += 2; while (true) { if (index === end) { - reportDiagnostic(end, 0, TypeScript.DiagnosticCode.AsteriskSlash_expected, null); + reportDiagnostic(end, 0, TypeScript.DiagnosticCode._0_expected, ["*/"]); return; } if ((index + 1) < end && str.charCodeAt(index) === 42 /* asterisk */ && str.charCodeAt(index + 1) === 47 /* slash */) { @@ -19068,7 +18826,7 @@ var TypeScript; function scanLineTerminatorSequenceTrivia(ch) { var absoluteStartIndex = index; skipLineTerminatorSequence(ch); - return createTrivia(5 /* NewLineTrivia */, absoluteStartIndex); + return createTrivia(3 /* NewLineTrivia */, absoluteStartIndex); } function skipLineTerminatorSequence(ch) { index++; @@ -19078,37 +18836,24 @@ var TypeScript; } function scanSyntaxKind(allowContextualToken) { if (index >= end) { - return 10 /* EndOfFileToken */; + 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 72 /* OpenParenToken */; - case 41 /* closeParen */: - return 73 /* CloseParenToken */; - case 42 /* asterisk */: - return scanAsteriskToken(); - case 43 /* plus */: - return scanPlusToken(); - case 44 /* comma */: - return 79 /* CommaToken */; - case 45 /* minus */: - return scanMinusToken(); - case 46 /* dot */: - return scanDotToken(); - case 47 /* slash */: - return scanSlashToken(allowContextualToken); + 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 */: @@ -19120,32 +18865,20 @@ var TypeScript; case 56 /* _8 */: case 57 /* _9 */: return scanNumericLiteral(character); - case 58 /* colon */: - return 106 /* ColonToken */; - case 59 /* semicolon */: - return 78 /* SemicolonToken */; - case 60 /* lessThan */: - return scanLessThanToken(); - case 61 /* equals */: - return scanEqualsToken(); - case 62 /* greaterThan */: - return scanGreaterThanToken(allowContextualToken); - case 63 /* question */: - return 105 /* QuestionToken */; - case 91 /* openBracket */: - return 74 /* OpenBracketToken */; - case 93 /* closeBracket */: - return 75 /* CloseBracketToken */; - case 94 /* caret */: - return scanCaretToken(); - case 123 /* openBrace */: - return 70 /* OpenBraceToken */; - case 124 /* bar */: - return scanBarToken(); - case 125 /* closeBrace */: - return 71 /* CloseBraceToken */; - case 126 /* tilde */: - return 102 /* TildeToken */; + 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); @@ -19161,7 +18894,7 @@ var TypeScript; var messageText = getErrorMessageText(text); reportDiagnostic(index, 1, TypeScript.DiagnosticCode.Unexpected_character_0, [messageText]); index++; - return 9 /* ErrorToken */; + return 7 /* ErrorToken */; } function isIdentifierStart(interpretedChar) { if (isIdentifierStartCharacter[interpretedChar]) { @@ -19194,7 +18927,7 @@ var TypeScript; return TypeScript.ScannerUtilities.identifierKind(str, startIndex - 1, index - startIndex + 1); } else { - return 11 /* IdentifierName */; + return 9 /* IdentifierName */; } } } @@ -19210,7 +18943,7 @@ var TypeScript; if (keywordKind >= TypeScript.SyntaxKind.FirstKeyword && keywordKind <= TypeScript.SyntaxKind.LastKeyword) { return keywordKind | 128 /* IsVariableWidthMask */; } - return 11 /* IdentifierName */; + return 9 /* IdentifierName */; } function scanNumericLiteral(ch) { if (isHexNumericLiteral(ch)) { @@ -19222,7 +18955,7 @@ var TypeScript; else { scanDecimalNumericLiteral(); } - return 13 /* NumericLiteral */; + return 11 /* NumericLiteral */; } function isOctalNumericLiteral(ch) { return ch === 48 /* _0 */ && TypeScript.CharacterInfo.isOctalDigit(str.charCodeAt(index)); @@ -19233,7 +18966,7 @@ var TypeScript; index++; } if (languageVersion >= 1 /* ES5 */) { - reportDiagnostic(start, index - start, TypeScript.DiagnosticCode.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher, null); + reportDiagnostic(start, index - start, TypeScript.DiagnosticCode.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher, undefined); } } function scanDecimalDigits() { @@ -19285,20 +19018,20 @@ var TypeScript; var ch0 = str.charCodeAt(index); if (ch0 === 61 /* equals */) { index++; - return 82 /* LessThanEqualsToken */; + return 84 /* LessThanEqualsToken */; } else if (ch0 === 60 /* lessThan */) { index++; if (str.charCodeAt(index) === 61 /* equals */) { index++; - return 112 /* LessThanLessThanEqualsToken */; + return 114 /* LessThanLessThanEqualsToken */; } else { - return 95 /* LessThanLessThanToken */; + return 97 /* LessThanLessThanToken */; } } else { - return 80 /* LessThanToken */; + return 82 /* LessThanToken */; } } function scanGreaterThanToken(allowContextualToken) { @@ -19312,108 +19045,130 @@ var TypeScript; var ch2 = str.charCodeAt(index); if (ch2 === 61 /* equals */) { index++; - return 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */; + return 116 /* GreaterThanGreaterThanGreaterThanEqualsToken */; } else { - return 97 /* GreaterThanGreaterThanGreaterThanToken */; + return 99 /* GreaterThanGreaterThanGreaterThanToken */; } } else if (ch1 === 61 /* equals */) { index++; - return 113 /* GreaterThanGreaterThanEqualsToken */; + return 115 /* GreaterThanGreaterThanEqualsToken */; } else { - return 96 /* GreaterThanGreaterThanToken */; + return 98 /* GreaterThanGreaterThanToken */; } } else if (ch0 === 61 /* equals */) { index++; - return 83 /* GreaterThanEqualsToken */; + return 85 /* GreaterThanEqualsToken */; } } - return 81 /* GreaterThanToken */; + return 83 /* GreaterThanToken */; } function scanBarToken() { var ch = str.charCodeAt(index); if (ch === 61 /* equals */) { index++; - return 116 /* BarEqualsToken */; + return 118 /* BarEqualsToken */; } else if (ch === 124 /* bar */) { index++; - return 104 /* BarBarToken */; + return 106 /* BarBarToken */; } else { - return 99 /* BarToken */; + return 101 /* BarToken */; } } function scanCaretToken() { if (str.charCodeAt(index) === 61 /* equals */) { index++; - return 117 /* CaretEqualsToken */; + return 119 /* CaretEqualsToken */; } else { - return 100 /* CaretToken */; + 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 115 /* AmpersandEqualsToken */; + return 117 /* AmpersandEqualsToken */; } else if (character === 38 /* ampersand */) { index++; - return 103 /* AmpersandAmpersandToken */; + return 105 /* AmpersandAmpersandToken */; } else { - return 98 /* AmpersandToken */; + return 100 /* AmpersandToken */; } } function scanPercentToken() { if (str.charCodeAt(index) === 61 /* equals */) { index++; - return 111 /* PercentEqualsToken */; + return 113 /* PercentEqualsToken */; } else { - return 92 /* PercentToken */; + return 94 /* PercentToken */; } } function scanMinusToken() { var character = str.charCodeAt(index); if (character === 61 /* equals */) { index++; - return 109 /* MinusEqualsToken */; + return 111 /* MinusEqualsToken */; } else if (character === 45 /* minus */) { index++; - return 94 /* MinusMinusToken */; + return 96 /* MinusMinusToken */; } else { - return 90 /* MinusToken */; + return 92 /* MinusToken */; } } function scanPlusToken() { var character = str.charCodeAt(index); if (character === 61 /* equals */) { index++; - return 108 /* PlusEqualsToken */; + return 110 /* PlusEqualsToken */; } else if (character === 43 /* plus */) { index++; - return 93 /* PlusPlusToken */; + return 95 /* PlusPlusToken */; } else { - return 89 /* PlusToken */; + return 91 /* PlusToken */; } } function scanAsteriskToken() { if (str.charCodeAt(index) === 61 /* equals */) { index++; - return 110 /* AsteriskEqualsToken */; + return 112 /* AsteriskEqualsToken */; } else { - return 91 /* AsteriskToken */; + return 93 /* AsteriskToken */; } } function scanEqualsToken() { @@ -19422,32 +19177,32 @@ var TypeScript; index++; if (str.charCodeAt(index) === 61 /* equals */) { index++; - return 87 /* EqualsEqualsEqualsToken */; + return 89 /* EqualsEqualsEqualsToken */; } else { - return 84 /* EqualsEqualsToken */; + return 86 /* EqualsEqualsToken */; } } else if (character === 62 /* greaterThan */) { index++; - return 85 /* EqualsGreaterThanToken */; + return 87 /* EqualsGreaterThanToken */; } else { - return 107 /* EqualsToken */; + return 109 /* EqualsToken */; } } function scanDotToken() { var nextChar = str.charCodeAt(index); if (TypeScript.CharacterInfo.isDecimalDigit(nextChar)) { scanDecimalNumericLiteralAfterDot(); - return 13 /* NumericLiteral */; + return 11 /* NumericLiteral */; } if (nextChar === 46 /* dot */ && str.charCodeAt(index + 1) === 46 /* dot */) { index += 2; - return 77 /* DotDotDotToken */; + return 79 /* DotDotDotToken */; } else { - return 76 /* DotToken */; + return 78 /* DotToken */; } } function scanSlashToken(allowContextualToken) { @@ -19459,10 +19214,10 @@ var TypeScript; } if (str.charCodeAt(index) === 61 /* equals */) { index++; - return 119 /* SlashEqualsToken */; + return 121 /* SlashEqualsToken */; } else { - return 118 /* SlashToken */; + return 120 /* SlashToken */; } } function tryScanRegularExpressionToken() { @@ -19503,21 +19258,21 @@ var TypeScript; while (isIdentifierPartCharacter[str.charCodeAt(index)]) { index++; } - return 12 /* RegularExpressionLiteral */; + return 10 /* RegularExpressionLiteral */; } function scanExclamationToken() { if (str.charCodeAt(index) === 61 /* equals */) { index++; if (str.charCodeAt(index) === 61 /* equals */) { index++; - return 88 /* ExclamationEqualsEqualsToken */; + return 90 /* ExclamationEqualsEqualsToken */; } else { - return 86 /* ExclamationEqualsToken */; + return 88 /* ExclamationEqualsToken */; } } else { - return 101 /* ExclamationToken */; + return 103 /* ExclamationToken */; } } function getErrorMessageText(text) { @@ -19560,14 +19315,14 @@ var TypeScript; break; } else if (isNaN(ch) || isNewLineCharacter(ch)) { - reportDiagnostic(Math.min(index, end), 1, TypeScript.DiagnosticCode.Missing_close_quote_character, null); + reportDiagnostic(Math.min(index, end), 1, TypeScript.DiagnosticCode.Missing_close_quote_character, undefined); break; } else { index++; } } - return 14 /* StringLiteral */; + return 12 /* StringLiteral */; } function isUnicodeEscape(character) { return character === 92 /* backslash */ && str.charCodeAt(index + 1) === 117 /* u */; @@ -19607,7 +19362,7 @@ var TypeScript; var ch2 = str.charCodeAt(index); if (!TypeScript.CharacterInfo.isHexDigit(ch2)) { if (report) { - reportDiagnostic(start, index - start, TypeScript.DiagnosticCode.Unrecognized_escape_sequence, null); + reportDiagnostic(start, index - start, TypeScript.DiagnosticCode.Unrecognized_escape_sequence, undefined); } break; } @@ -19647,22 +19402,22 @@ var TypeScript; var _tokenDiagnostics = []; var rewindPointPool = []; var rewindPointPoolCount = 0; - var lastDiagnostic = null; + 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, null), null); + var slidingWindow = new TypeScript.SlidingWindow(fetchNextItem, TypeScript.ArrayUtilities.createArray(1024, undefined), undefined); var scanner = createScanner(languageVersion, text, reportDiagnostic); function release() { - slidingWindow = null; - scanner = null; + slidingWindow = undefined; + scanner = undefined; _tokenDiagnostics = []; rewindPointPool = []; - lastDiagnostic = null; - reportDiagnostic = null; + lastDiagnostic = undefined; + reportDiagnostic = undefined; } function currentNode() { - return null; + return undefined; } function consumeNode(node) { throw TypeScript.Errors.invalidOperation(); @@ -19679,7 +19434,7 @@ var TypeScript; } rewindPointPoolCount--; var result = rewindPointPool[rewindPointPoolCount]; - rewindPointPool[rewindPointPoolCount] = null; + rewindPointPool[rewindPointPoolCount] = undefined; return result; } function getRewindPoint() { @@ -19700,11 +19455,11 @@ var TypeScript; } function fetchNextItem(allowContextualToken) { var token = scanner.scan(allowContextualToken); - if (lastDiagnostic === null) { + if (lastDiagnostic === undefined) { return token; } _tokenDiagnostics.push(lastDiagnostic); - lastDiagnostic = null; + lastDiagnostic = undefined; return TypeScript.Syntax.realizeToken(token, text); } function peekToken(n) { @@ -19723,12 +19478,12 @@ var TypeScript; var diagnostic = _tokenDiagnostics[tokenDiagnosticsLength - 1]; if (diagnostic.start() >= position) { tokenDiagnosticsLength--; + _tokenDiagnostics.pop(); } else { break; } } - _tokenDiagnostics.length = tokenDiagnosticsLength; } function resetToPosition(absolutePosition) { TypeScript.Debug.assert(absolutePosition <= text.length(), "Trying to set the position outside the bounds of the text!"); @@ -19762,227 +19517,371 @@ var TypeScript; }; } 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 () { - function ScannerUtilities() { + 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.identifierKind = function (str, start, length) { + 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 */) ? 22 /* DoKeyword */ : 11 /* IdentifierName */; + 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 28 /* IfKeyword */; - case 110 /* n */: - return 29 /* InKeyword */; - default: - return 11 /* IdentifierName */; + case 102 /* f */: return 30 /* IfKeyword */; + case 110 /* n */: return 31 /* InKeyword */; + default: return 9 /* IdentifierName */; } - default: - return 11 /* 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 */) ? 60 /* AnyKeyword */ : 11 /* IdentifierName */; - case 102 /* f */: - return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 114 /* r */) ? 26 /* ForKeyword */ : 11 /* IdentifierName */; - case 103 /* g */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */) ? 64 /* GetKeyword */ : 11 /* IdentifierName */; - case 108 /* l */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */) ? 53 /* LetKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 119 /* w */) ? 31 /* NewKeyword */ : 11 /* IdentifierName */; - case 115 /* s */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */) ? 68 /* SetKeyword */ : 11 /* IdentifierName */; - case 116 /* t */: - return (str.charCodeAt(start + 1) === 114 /* r */ && str.charCodeAt(start + 2) === 121 /* y */) ? 38 /* TryKeyword */ : 11 /* IdentifierName */; - case 118 /* v */: - return (str.charCodeAt(start + 1) === 97 /* a */ && str.charCodeAt(start + 2) === 114 /* r */) ? 40 /* VarKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + 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 */) ? 16 /* CaseKeyword */ : 11 /* IdentifierName */; + 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 */) ? 23 /* ElseKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (str.charCodeAt(start + 2) === 117 /* u */ && str.charCodeAt(start + 3) === 109 /* m */) ? 46 /* EnumKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + 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 */) ? 32 /* NullKeyword */ : 11 /* 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 */) ? 35 /* ThisKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (str.charCodeAt(start + 2) === 117 /* u */ && str.charCodeAt(start + 3) === 101 /* e */) ? 37 /* TrueKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + 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 */) ? 41 /* VoidKeyword */ : 11 /* IdentifierName */; - case 119 /* w */: - return (str.charCodeAt(start + 1) === 105 /* i */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 104 /* h */) ? 43 /* WithKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* 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 */) ? 15 /* BreakKeyword */ : 11 /* IdentifierName */; + 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 */) ? 17 /* CatchKeyword */ : 11 /* IdentifierName */; - case 108 /* l */: - return (str.charCodeAt(start + 2) === 97 /* a */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 115 /* s */) ? 44 /* ClassKeyword */ : 11 /* IdentifierName */; - case 111 /* o */: - return (str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 116 /* t */) ? 45 /* ConstKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + 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 */) ? 24 /* FalseKeyword */ : 11 /* 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 */) ? 50 /* SuperKeyword */ : 11 /* 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 */) ? 36 /* ThrowKeyword */ : 11 /* 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 */) ? 42 /* WhileKeyword */ : 11 /* 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 */) ? 59 /* YieldKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* 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 */) ? 21 /* DeleteKeyword */ : 11 /* 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 */) ? 47 /* ExportKeyword */ : 11 /* 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 */) ? 49 /* ImportKeyword */ : 11 /* 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 */) ? 65 /* ModuleKeyword */ : 11 /* 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 */) ? 67 /* NumberKeyword */ : 11 /* 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 */) ? 57 /* PublicKeyword */ : 11 /* 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 */) ? 33 /* ReturnKeyword */ : 11 /* IdentifierName */; + 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 */) ? 58 /* StaticKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (str.charCodeAt(start + 3) === 105 /* i */ && str.charCodeAt(start + 4) === 110 /* n */ && str.charCodeAt(start + 5) === 103 /* g */) ? 69 /* StringKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + 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 */) ? 34 /* SwitchKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* 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 */) ? 39 /* TypeOfKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* 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 */) ? 61 /* BooleanKeyword */ : 11 /* IdentifierName */; + 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 */) ? 63 /* DeclareKeyword */ : 11 /* 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 */) ? 20 /* DefaultKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + 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 11 /* 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 */) ? 48 /* ExtendsKeyword */ : 11 /* 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 */) ? 25 /* FinallyKeyword */ : 11 /* 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 */) ? 54 /* PackageKeyword */ : 11 /* 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 */) ? 55 /* PrivateKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + 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 */) ? 66 /* RequireKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* 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 */) ? 18 /* ContinueKeyword */ : 11 /* 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 */) ? 19 /* DebuggerKeyword */ : 11 /* 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 */) ? 27 /* FunctionKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + 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 */) ? 52 /* InterfaceKeyword */ : 11 /* 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 */) ? 56 /* ProtectedKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + 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 */) ? 51 /* ImplementsKeyword */ : 11 /* 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 */) ? 30 /* InstanceOfKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; + 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 11 /* 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 */) ? 62 /* ConstructorKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* 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 */; } - }; - return ScannerUtilities; - })(); - TypeScript.ScannerUtilities = ScannerUtilities; + } + ScannerUtilities.identifierKind = identifierKind; + })(ScannerUtilities = TypeScript.ScannerUtilities || (TypeScript.ScannerUtilities = {})); })(TypeScript || (TypeScript = {})); var TypeScript; (function (TypeScript) { @@ -20063,7 +19962,7 @@ var TypeScript; }; SlidingWindow.prototype.peekItemN = function (n) { while (this.currentRelativeItemIndex + n >= this.windowCount) { - if (!this.addMoreItemsToWindow(null)) { + if (!this.addMoreItemsToWindow(undefined)) { return this.defaultValue; } } @@ -20084,22 +19983,12 @@ var TypeScript; var Syntax; (function (Syntax) { Syntax._nextSyntaxID = 1; - function childIndex(parent, child) { - for (var i = 0, n = TypeScript.childCount(parent); i < n; i++) { - var current = TypeScript.childAt(parent, i); - if (current === child) { - return i; - } - } - throw TypeScript.Errors.invalidOperation(); - } - Syntax.childIndex = childIndex; 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() !== 10 /* EndOfFileToken */)) { + if (token.hasSkippedToken() || (TypeScript.width(token) === 0 && token.kind() !== 8 /* EndOfFileToken */)) { return true; } } @@ -20108,7 +19997,7 @@ var TypeScript; } Syntax.nodeHasSkippedOrMissingTokens = nodeHasSkippedOrMissingTokens; function isUnterminatedStringLiteral(token) { - if (token && token.kind() === 14 /* StringLiteral */) { + if (token && token.kind() === 12 /* StringLiteral */) { var text = token.text(); return text.length < 2 || text.charCodeAt(text.length - 1) !== text.charCodeAt(0); } @@ -20116,7 +20005,7 @@ var TypeScript; } Syntax.isUnterminatedStringLiteral = isUnterminatedStringLiteral; function isUnterminatedMultilineCommentTrivia(trivia) { - if (trivia && trivia.kind() === 6 /* MultiLineCommentTrivia */) { + if (trivia && trivia.kind() === 4 /* MultiLineCommentTrivia */) { var text = trivia.fullText(); return text.length < 4 || text.substring(text.length - 2) !== "*/"; } @@ -20130,7 +20019,7 @@ var TypeScript; return true; } else if (position === end) { - return trivia.kind() === 7 /* SingleLineCommentTrivia */ || isUnterminatedMultilineCommentTrivia(trivia); + return trivia.kind() === 5 /* SingleLineCommentTrivia */ || isUnterminatedMultilineCommentTrivia(trivia); } } return false; @@ -20139,9 +20028,9 @@ var TypeScript; function isEntirelyInsideComment(sourceUnit, position) { var positionedToken = TypeScript.findToken(sourceUnit, position); var fullStart = positionedToken.fullStart(); - var triviaList = null; - var lastTriviaBeforeToken = null; - if (positionedToken.kind() === 10 /* EndOfFileToken */) { + var triviaList = undefined; + var lastTriviaBeforeToken = undefined; + if (positionedToken.kind() === 8 /* EndOfFileToken */) { if (positionedToken.hasLeadingTrivia()) { triviaList = positionedToken.leadingTrivia(); } @@ -20183,45 +20072,17 @@ var TypeScript; function isEntirelyInStringOrRegularExpressionLiteral(sourceUnit, position) { var positionedToken = TypeScript.findToken(sourceUnit, position); if (positionedToken) { - if (positionedToken.kind() === 10 /* EndOfFileToken */) { + 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() === 14 /* StringLiteral */ || positionedToken.kind() === 12 /* RegularExpressionLiteral */)) || (position <= TypeScript.end(positionedToken) && isUnterminatedStringLiteral(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 findSkippedTokenOnLeftInTriviaList(positionedToken, position, lookInLeadingTriviaList) { - var triviaList = null; - var fullEnd; - if (lookInLeadingTriviaList) { - triviaList = positionedToken.leadingTrivia(); - fullEnd = positionedToken.fullStart() + triviaList.fullWidth(); - } - else { - triviaList = positionedToken.trailingTrivia(); - fullEnd = TypeScript.fullEnd(positionedToken); - } - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = triviaList.count() - 1; i >= 0; i--) { - var trivia = triviaList.syntaxTriviaAt(i); - var triviaWidth = trivia.fullWidth(); - if (trivia.isSkippedToken() && position >= fullEnd) { - return trivia.skippedToken(); - } - fullEnd -= triviaWidth; - } - } - return null; - } - function findSkippedTokenOnLeft(positionedToken, position) { - var positionInLeadingTriviaList = (position < TypeScript.start(positionedToken)); - return findSkippedTokenOnLeftInTriviaList(positionedToken, position, positionInLeadingTriviaList); - } - Syntax.findSkippedTokenOnLeft = findSkippedTokenOnLeft; function getAncestorOfKind(positionedToken, kind) { while (positionedToken && positionedToken.parent) { if (positionedToken.parent.kind() === kind) { @@ -20229,21 +20090,24 @@ var TypeScript; } positionedToken = positionedToken.parent; } - return null; + return undefined; } Syntax.getAncestorOfKind = getAncestorOfKind; function hasAncestorOfKind(positionedToken, kind) { - return getAncestorOfKind(positionedToken, kind) !== null; + return !!getAncestorOfKind(positionedToken, kind); } Syntax.hasAncestorOfKind = hasAncestorOfKind; function isIntegerLiteral(expression) { if (expression) { switch (expression.kind()) { - case 165 /* PlusExpression */: - case 166 /* NegateExpression */: - expression = expression.operand; - return TypeScript.isToken(expression) && TypeScript.IntegerUtilities.isInteger(expression.text()); - case 13 /* NumericLiteral */: + 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); } @@ -20253,38 +20117,30 @@ var TypeScript; Syntax.isIntegerLiteral = isIntegerLiteral; function containingNode(element) { var current = element.parent; - while (current !== null && !TypeScript.isNode(current)) { + while (current && !TypeScript.isNode(current)) { current = current.parent; } return current; } Syntax.containingNode = containingNode; - function findTokenOnLeft(element, position, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - var positionedToken = TypeScript.findToken(element, position, false); + function findTokenOnLeft(sourceUnit, position) { + var positionedToken = TypeScript.findToken(sourceUnit, position); var _start = TypeScript.start(positionedToken); - if (includeSkippedTokens) { - positionedToken = findSkippedTokenOnLeft(positionedToken, position) || positionedToken; - } if (position > _start) { return positionedToken; } if (positionedToken.fullStart() === 0) { - return null; + return undefined; } - return TypeScript.previousToken(positionedToken, includeSkippedTokens); + return TypeScript.previousToken(positionedToken); } Syntax.findTokenOnLeft = findTokenOnLeft; - function findCompleteTokenOnLeft(element, position, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - var positionedToken = TypeScript.findToken(element, position, false); - if (includeSkippedTokens) { - positionedToken = findSkippedTokenOnLeft(positionedToken, position) || positionedToken; - } + 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, includeSkippedTokens); + return TypeScript.previousToken(positionedToken); } Syntax.findCompleteTokenOnLeft = findCompleteTokenOnLeft; function firstTokenInLineContainingPosition(syntaxTree, position) { @@ -20300,7 +20156,7 @@ var TypeScript; Syntax.firstTokenInLineContainingPosition = firstTokenInLineContainingPosition; function isFirstTokenInLine(token, lineMap) { var _previousToken = TypeScript.previousToken(token); - if (_previousToken === null) { + if (_previousToken === undefined) { return true; } return lineMap.getLineNumberFromPosition(TypeScript.end(_previousToken)) !== lineMap.getLineNumberFromPosition(TypeScript.start(token)); @@ -20309,97 +20165,50 @@ var TypeScript; })(TypeScript || (TypeScript = {})); var TypeScript; (function (TypeScript) { - function isShared(element) { - var kind = element.kind(); - return (kind === 1 /* List */ || kind === 2 /* SeparatedList */) && element.length === 0; - } - TypeScript.isShared = isShared; - function childCount(element) { - var kind = element.kind(); - if (kind === 1 /* List */) { - return element.length; - } - else if (kind === 2 /* SeparatedList */) { - return element.length + element.separators.length; - } - else if (kind >= TypeScript.SyntaxKind.FirstToken && kind <= TypeScript.SyntaxKind.LastToken) { - return 0; - } - else { - return TypeScript.nodeMetadata[kind].length; - } - } - TypeScript.childCount = childCount; - function childAt(element, index) { - var kind = element.kind(); - if (kind === 1 /* List */) { - return element[index]; - } - else if (kind === 2 /* SeparatedList */) { - return (index % 2 === 0) ? element[index / 2] : element.separators[(index - 1) / 2]; - } - else { - return element[TypeScript.nodeMetadata[element.kind()][index]]; - } - } - TypeScript.childAt = childAt; function syntaxTree(element) { if (element) { - TypeScript.Debug.assert(!isShared(element)); while (element) { - if (element.kind() === 120 /* SourceUnit */) { + if (element.kind() === 122 /* SourceUnit */) { return element.syntaxTree; } element = element.parent; } } - return null; + return undefined; } TypeScript.syntaxTree = syntaxTree; function parsedInStrictMode(node) { - var info = node.data; + var info = node.__data; if (info === undefined) { return false; } return (info & 4 /* NodeParsedInStrictModeMask */) !== 0; } TypeScript.parsedInStrictMode = parsedInStrictMode; - function previousToken(token, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - if (includeSkippedTokens) { - var triviaList = token.leadingTrivia(); - if (triviaList && triviaList.hasSkippedToken()) { - var currentTriviaEndPosition = TypeScript.start(token); - for (var i = triviaList.count() - 1; i >= 0; i--) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isSkippedToken()) { - return trivia.skippedToken(); - } - currentTriviaEndPosition -= trivia.fullWidth(); - } - } - } + function previousToken(token) { var start = token.fullStart(); if (start === 0) { - return null; + return undefined; } - return findToken(syntaxTree(token).sourceUnit(), start - 1, includeSkippedTokens); + return findToken(syntaxTree(token).sourceUnit(), start - 1); } TypeScript.previousToken = previousToken; - function findToken(element, position, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - var endOfFileToken = tryGetEndOfFileAt(element, position); - if (endOfFileToken !== null) { - return endOfFileToken; - } - if (position < 0 || position >= fullWidth(element)) { + function findToken(sourceUnit, position) { + if (position < 0) { throw TypeScript.Errors.argumentOutOfRange("position"); } - var positionedToken = findTokenWorker(element, position); - if (includeSkippedTokens) { - return findSkippedTokenInPositionedToken(positionedToken, position) || positionedToken; + var token = findTokenWorker(sourceUnit, 0, position); + if (token) { + TypeScript.Debug.assert(token.fullWidth() > 0); + return token; } - return positionedToken; + 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) { @@ -20416,7 +20225,7 @@ var TypeScript; } TypeScript.findSkippedTokenInTrailingTriviaList = findSkippedTokenInTrailingTriviaList; function findSkippedTokenInTriviaList(positionedToken, position, lookInLeadingTriviaList) { - var triviaList = null; + var triviaList = undefined; var fullStart; if (lookInLeadingTriviaList) { triviaList = positionedToken.leadingTrivia(); @@ -20436,61 +20245,41 @@ var TypeScript; fullStart += triviaWidth; } } - return null; + return undefined; } - function findTokenWorker(element, position) { + function findTokenWorker(element, elementPosition, position) { if (isToken(element)) { - TypeScript.Debug.assert(fullWidth(element) > 0); return element; } - if (isShared(element)) { - throw TypeScript.Errors.invalidOperation(); - } - for (var i = 0, n = childCount(element); i < n; i++) { - var child = childAt(element, i); - if (child !== null) { + for (var i = 0, n = TypeScript.childCount(element); i < n; i++) { + var child = TypeScript.childAt(element, i); + if (child) { var childFullWidth = fullWidth(child); - if (childFullWidth > 0) { - var childFullStart = fullStart(child); - if (position >= childFullStart) { - var childFullEnd = childFullStart + childFullWidth; - if (position < childFullEnd) { - return findTokenWorker(child, position); - } - } + var elementEndPosition = elementPosition + childFullWidth; + if (position < elementEndPosition) { + return findTokenWorker(child, elementPosition, position); } + elementPosition = elementEndPosition; } } - throw TypeScript.Errors.invalidOperation(); + return undefined; } function tryGetEndOfFileAt(element, position) { - if (element.kind() === 120 /* SourceUnit */ && position === fullWidth(element)) { + if (element.kind() === 122 /* SourceUnit */ && position === fullWidth(element)) { var sourceUnit = element; return sourceUnit.endOfFileToken; } - return null; + return undefined; } - function nextToken(token, text, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - if (token.kind() === 10 /* EndOfFileToken */) { - return null; + function nextToken(token, text) { + if (token.kind() === 8 /* EndOfFileToken */) { + return undefined; } - if (includeSkippedTokens) { - var triviaList = token.trailingTrivia(text); - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isSkippedToken()) { - return trivia.skippedToken(); - } - } - } - } - return findToken(syntaxTree(token).sourceUnit(), fullEnd(token), includeSkippedTokens); + return findToken(syntaxTree(token).sourceUnit(), fullEnd(token)); } TypeScript.nextToken = nextToken; function isNode(element) { - if (element !== null) { + if (element) { var kind = element.kind(); return kind >= TypeScript.SyntaxKind.FirstNode && kind <= TypeScript.SyntaxKind.LastNode; } @@ -20501,24 +20290,17 @@ var TypeScript; return kind >= TypeScript.SyntaxKind.FirstToken && kind <= TypeScript.SyntaxKind.LastToken; } function isToken(element) { - if (element !== null) { + if (element) { return isTokenKind(element.kind()); } return false; } TypeScript.isToken = isToken; function isList(element) { - return element !== null && element.kind() === 1 /* List */; + return element instanceof Array; } TypeScript.isList = isList; - function isSeparatedList(element) { - return element !== null && element.kind() === 2 /* SeparatedList */; - } - TypeScript.isSeparatedList = isSeparatedList; function syntaxID(element) { - if (isShared(element)) { - throw TypeScript.Errors.invalidOperation("Should not use shared syntax element as a key."); - } var obj = element; if (obj._syntaxID === undefined) { obj._syntaxID = TypeScript.Syntax._nextSyntaxID++; @@ -20532,8 +20314,8 @@ var TypeScript; elements.push(element.fullText(text)); } else { - for (var i = 0, n = childCount(element); i < n; i++) { - collectTextElements(childAt(element, i), elements, text); + for (var i = 0, n = TypeScript.childCount(element); i < n; i++) { + collectTextElements(TypeScript.childAt(element, i), elements, text); } } } @@ -20561,65 +20343,38 @@ var TypeScript; if (element) { var kind = element.kind(); if (isTokenKind(kind)) { - return fullWidth(element) > 0 || element.kind() === 10 /* EndOfFileToken */ ? element : null; + return element.fullWidth() > 0 || kind === 8 /* EndOfFileToken */ ? element : undefined; } - if (kind === 1 /* List */) { - var array = element; - for (var i = 0, n = array.length; i < n; i++) { - var token = firstToken(array[i]); - if (token) { - return token; - } - } - } - else if (kind === 2 /* SeparatedList */) { - var array = element; - var separators = array.separators; - for (var i = 0, n = array.length + separators.length; i < n; i++) { - var token = firstToken(i % 2 === 0 ? array[i / 2] : separators[(i - 1) / 2]); - if (token) { - return token; - } - } - } - else { - var metadata = TypeScript.nodeMetadata[kind]; - for (var i = 0, n = metadata.length; i < n; i++) { - var child = element[metadata[i]]; - var token = firstToken(child); - if (token) { - return token; - } - } - if (element.kind() === 120 /* SourceUnit */) { - return element.endOfFileToken; + for (var i = 0, n = TypeScript.childCount(element); i < n; i++) { + var token = firstToken(TypeScript.childAt(element, i)); + if (token) { + return token; } } } - return null; + return undefined; } TypeScript.firstToken = firstToken; function lastToken(element) { if (isToken(element)) { - return fullWidth(element) > 0 || element.kind() === 10 /* EndOfFileToken */ ? element : null; + return fullWidth(element) > 0 || element.kind() === 8 /* EndOfFileToken */ ? element : undefined; } - if (element.kind() === 120 /* SourceUnit */) { + if (element.kind() === 122 /* SourceUnit */) { return element.endOfFileToken; } - for (var i = childCount(element) - 1; i >= 0; i--) { - var child = childAt(element, i); - if (child !== null) { + 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 null; + return undefined; } TypeScript.lastToken = lastToken; function fullStart(element) { - TypeScript.Debug.assert(!isShared(element)); var token = isToken(element) ? element : firstToken(element); return token ? token.fullStart() : -1; } @@ -20628,9 +20383,6 @@ var TypeScript; if (isToken(element)) { return element.fullWidth(); } - if (isShared(element)) { - return 0; - } var info = data(element); return info >>> 3 /* NodeFullWidthShift */; } @@ -20639,31 +20391,27 @@ var TypeScript; if (isToken(element)) { return element.isIncrementallyUnusable(); } - if (isShared(element)) { - return false; - } return (data(element) & 2 /* NodeIncrementallyUnusableMask */) !== 0; } TypeScript.isIncrementallyUnusable = isIncrementallyUnusable; function data(element) { - TypeScript.Debug.assert(isNode(element) || isList(element) || isSeparatedList(element)); var dataElement = element; - var info = dataElement.data; + var info = dataElement.__data; if (info === undefined) { info = 0; } if ((info & 1 /* NodeDataComputed */) === 0) { info |= computeData(element); - dataElement.data = info; + dataElement.__data = info; } return info; } function computeData(element) { - var slotCount = childCount(element); + var slotCount = TypeScript.childCount(element); var fullWidth = 0; - var isIncrementallyUnusable = slotCount === 0; + var isIncrementallyUnusable = slotCount === 0 && !isList(element); for (var i = 0, n = slotCount; i < n; i++) { - var child = childAt(element, i); + var child = TypeScript.childAt(element, i); if (child) { fullWidth += TypeScript.fullWidth(child); isIncrementallyUnusable = isIncrementallyUnusable || TypeScript.isIncrementallyUnusable(child); @@ -20696,7 +20444,7 @@ var TypeScript; if (token1 === token2) { return false; } - if (token1 === null || token2 === null) { + if (!token1 || !token2) { return true; } var lineMap = text.lineMap(); @@ -20709,10 +20457,10 @@ var TypeScript; var SyntaxFacts; (function (SyntaxFacts) { function isDirectivePrologueElement(node) { - if (node.kind() === 150 /* ExpressionStatement */) { + if (node.kind() === 154 /* ExpressionStatement */) { var expressionStatement = node; var expression = expressionStatement.expression; - if (expression.kind() === 14 /* StringLiteral */) { + if (expression.kind() === 12 /* StringLiteral */) { return true; } } @@ -20728,14 +20476,14 @@ var TypeScript; SyntaxFacts.isUseStrictDirective = isUseStrictDirective; function isIdentifierNameOrAnyKeyword(token) { var tokenKind = token.kind(); - return tokenKind === 11 /* IdentifierName */ || SyntaxFacts.isAnyKeyword(tokenKind); + return tokenKind === 9 /* IdentifierName */ || SyntaxFacts.isAnyKeyword(tokenKind); } SyntaxFacts.isIdentifierNameOrAnyKeyword = isIdentifierNameOrAnyKeyword; function isAccessibilityModifier(kind) { switch (kind) { - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 56 /* ProtectedKeyword */: + case 59 /* PublicKeyword */: + case 57 /* PrivateKeyword */: + case 58 /* ProtectedKeyword */: return true; } return false; @@ -20744,126 +20492,94 @@ var TypeScript; })(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) { - var _emptyList = []; - var _emptySeparatedList = []; - var _emptySeparators = []; - _emptySeparatedList.separators = _emptySeparators; - function assertEmptyLists() { - } - Array.prototype.kind = function () { - return this.separators === undefined ? 1 /* List */ : 2 /* SeparatedList */; - }; - Array.prototype.separatorCount = function () { - assertEmptyLists(); - return this.separators.length; - }; - Array.prototype.separatorAt = function (index) { - assertEmptyLists(); - return this.separators[index]; - }; - function emptyList() { - return _emptyList; - } - Syntax.emptyList = emptyList; - function emptySeparatedList() { - return _emptySeparatedList; - } - Syntax.emptySeparatedList = emptySeparatedList; - function list(nodes) { - if (nodes === undefined || nodes === null || nodes.length === 0) { - return emptyList(); + 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(nodes, separators) { - if (nodes === undefined || nodes === null || nodes.length === 0) { - return emptySeparatedList(); + function separatedList(nodesAndTokens) { + for (var i = 0, n = nodesAndTokens.length; i < n; i++) { + nodesAndTokens[i].parent = nodesAndTokens; } - for (var i = 0, n = nodes.length; i < n; i++) { - nodes[i].parent = nodes; - } - for (var i = 0, n = separators.length; i < n; i++) { - separators[i].parent = nodes; - } - nodes.separators = separators.length === 0 ? _emptySeparators : separators; - return nodes; + return nodesAndTokens; } Syntax.separatedList = separatedList; - function nonSeparatorIndexOf(list, ast) { - for (var i = 0, n = list.length; i < n; i++) { - if (list[i] === ast) { - return i; - } - } - return -1; - } - Syntax.nonSeparatorIndexOf = nonSeparatorIndexOf; })(Syntax = TypeScript.Syntax || (TypeScript.Syntax = {})); })(TypeScript || (TypeScript = {})); var TypeScript; -(function (TypeScript) { - var SyntaxNode = (function () { - function SyntaxNode(data) { - if (data) { - this.data = data; - } - } - SyntaxNode.prototype.kind = function () { - return this.__kind; - }; - return SyntaxNode; - })(); - TypeScript.SyntaxNode = SyntaxNode; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.nodeMetadata = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], ["moduleElements", "endOfFileToken"], ["left", "dotToken", "right"], ["openBraceToken", "typeMembers", "closeBraceToken"], ["typeParameterList", "parameterList", "equalsGreaterThanToken", "type"], ["type", "openBracketToken", "closeBracketToken"], ["newKeyword", "typeParameterList", "parameterList", "equalsGreaterThanToken", "type"], ["name", "typeArgumentList"], ["typeOfKeyword", "name"], ["openBracketToken", "types", "closeBracketToken"], ["modifiers", "interfaceKeyword", "identifier", "typeParameterList", "heritageClauses", "body"], ["modifiers", "functionKeyword", "identifier", "callSignature", "block", "semicolonToken"], ["modifiers", "moduleKeyword", "name", "stringLiteral", "openBraceToken", "moduleElements", "closeBraceToken"], ["modifiers", "classKeyword", "identifier", "typeParameterList", "heritageClauses", "openBraceToken", "classElements", "closeBraceToken"], ["modifiers", "enumKeyword", "identifier", "openBraceToken", "enumElements", "closeBraceToken"], ["modifiers", "importKeyword", "identifier", "equalsToken", "moduleReference", "semicolonToken"], ["exportKeyword", "equalsToken", "identifier", "semicolonToken"], ["modifiers", "propertyName", "callSignature", "block", "semicolonToken"], ["modifiers", "variableDeclarator", "semicolonToken"], ["modifiers", "constructorKeyword", "callSignature", "block", "semicolonToken"], ["modifiers", "indexSignature", "semicolonToken"], ["modifiers", "getKeyword", "propertyName", "callSignature", "block"], ["modifiers", "setKeyword", "propertyName", "callSignature", "block"], ["propertyName", "questionToken", "typeAnnotation"], ["typeParameterList", "parameterList", "typeAnnotation"], ["newKeyword", "callSignature"], ["openBracketToken", "parameters", "closeBracketToken", "typeAnnotation"], ["propertyName", "questionToken", "callSignature"], ["openBraceToken", "statements", "closeBraceToken"], ["ifKeyword", "openParenToken", "condition", "closeParenToken", "statement", "elseClause"], ["modifiers", "variableDeclaration", "semicolonToken"], ["expression", "semicolonToken"], ["returnKeyword", "expression", "semicolonToken"], ["switchKeyword", "openParenToken", "expression", "closeParenToken", "openBraceToken", "switchClauses", "closeBraceToken"], ["breakKeyword", "identifier", "semicolonToken"], ["continueKeyword", "identifier", "semicolonToken"], ["forKeyword", "openParenToken", "variableDeclaration", "initializer", "firstSemicolonToken", "condition", "secondSemicolonToken", "incrementor", "closeParenToken", "statement"], ["forKeyword", "openParenToken", "variableDeclaration", "left", "inKeyword", "expression", "closeParenToken", "statement"], ["semicolonToken"], ["throwKeyword", "expression", "semicolonToken"], ["whileKeyword", "openParenToken", "condition", "closeParenToken", "statement"], ["tryKeyword", "block", "catchClause", "finallyClause"], ["identifier", "colonToken", "statement"], ["doKeyword", "statement", "whileKeyword", "openParenToken", "condition", "closeParenToken", "semicolonToken"], ["debuggerKeyword", "semicolonToken"], ["withKeyword", "openParenToken", "condition", "closeParenToken", "statement"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["deleteKeyword", "expression"], ["typeOfKeyword", "expression"], ["voidKeyword", "expression"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["condition", "questionToken", "whenTrue", "colonToken", "whenFalse"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["operand", "operatorToken"], ["operand", "operatorToken"], ["expression", "dotToken", "name"], ["expression", "argumentList"], ["openBracketToken", "expressions", "closeBracketToken"], ["openBraceToken", "propertyAssignments", "closeBraceToken"], ["newKeyword", "expression", "argumentList"], ["openParenToken", "expression", "closeParenToken"], ["callSignature", "equalsGreaterThanToken", "block", "expression"], ["parameter", "equalsGreaterThanToken", "block", "expression"], ["lessThanToken", "type", "greaterThanToken", "expression"], ["expression", "openBracketToken", "argumentExpression", "closeBracketToken"], ["functionKeyword", "identifier", "callSignature", "block"], [], ["varKeyword", "variableDeclarators"], ["propertyName", "typeAnnotation", "equalsValueClause"], ["typeArgumentList", "openParenToken", "arguments", "closeParenToken"], ["openParenToken", "parameters", "closeParenToken"], ["lessThanToken", "typeArguments", "greaterThanToken"], ["lessThanToken", "typeParameters", "greaterThanToken"], ["extendsOrImplementsKeyword", "typeNames"], ["extendsOrImplementsKeyword", "typeNames"], ["equalsToken", "value"], ["caseKeyword", "expression", "colonToken", "statements"], ["defaultKeyword", "colonToken", "statements"], ["elseKeyword", "statement"], ["catchKeyword", "openParenToken", "identifier", "typeAnnotation", "closeParenToken", "block"], ["finallyKeyword", "block"], ["identifier", "constraint"], ["extendsKeyword", "typeOrExpression"], ["propertyName", "colonToken", "expression"], ["propertyName", "callSignature", "block"], ["dotDotDotToken", "modifiers", "identifier", "questionToken", "typeAnnotation", "equalsValueClause"], ["propertyName", "equalsValueClause"], ["colonToken", "type"], ["requireKeyword", "openParenToken", "stringLiteral", "closeParenToken"], ["moduleName"],]; -})(TypeScript || (TypeScript = {})); -var TypeScript; (function (TypeScript) { function tokenValue(token) { if (token.fullWidth() === 0) { - return null; + return undefined; } var kind = token.kind(); var text = token.text(); - if (kind === 11 /* IdentifierName */) { + if (kind === 9 /* IdentifierName */) { return massageEscapes(text); } switch (kind) { - case 37 /* TrueKeyword */: + case 39 /* TrueKeyword */: return true; - case 24 /* FalseKeyword */: + case 26 /* FalseKeyword */: return false; - case 32 /* NullKeyword */: - return null; + case 34 /* NullKeyword */: + return undefined; } if (TypeScript.SyntaxFacts.isAnyKeyword(kind) || TypeScript.SyntaxFacts.isAnyPunctuation(kind)) { return TypeScript.SyntaxFacts.getText(kind); } - if (kind === 13 /* NumericLiteral */) { + if (kind === 11 /* NumericLiteral */) { return TypeScript.IntegerUtilities.isHexInteger(text) ? parseInt(text, 16) : parseFloat(text); } - else if (kind === 14 /* StringLiteral */) { - if (text.length > 1 && text.charCodeAt(text.length - 1) === text.charCodeAt(0)) { - return massageEscapes(text.substr(1, text.length - 2)); - } - else { - return massageEscapes(text.substr(1)); - } + 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 === 12 /* RegularExpressionLiteral */) { + 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 === 10 /* EndOfFileToken */ || kind === 9 /* ErrorToken */) { - return null; + else if (kind === 8 /* EndOfFileToken */ || kind === 7 /* ErrorToken */) { + return undefined; } else { throw TypeScript.Errors.invalidOperation(); @@ -20872,9 +20588,13 @@ var TypeScript; TypeScript.tokenValue = tokenValue; function tokenValueText(token) { var value = tokenValue(token); - return value === null ? "" : massageDisallowedIdentifiers(value.toString()); + 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; } @@ -20887,7 +20607,7 @@ var TypeScript; return new RegExp(body, flags); } catch (e) { - return null; + return undefined; } } function massageDisallowedIdentifiers(text) { @@ -20952,12 +20672,12 @@ var TypeScript; } characterArray.push(ch); if (i && !(i % 1024)) { - result = result.concat(String.fromCharCode.apply(null, characterArray)); + result = result.concat(String.fromCharCode.apply(undefined, characterArray)); characterArray.length = 0; } } if (characterArray.length) { - result = result.concat(String.fromCharCode.apply(null, characterArray)); + result = result.concat(String.fromCharCode.apply(undefined, characterArray)); } return result; } @@ -21006,6 +20726,15 @@ var TypeScript; 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()); }; @@ -21020,15 +20749,15 @@ var TypeScript; }; EmptyToken.prototype.position = function () { var previousElement = this.previousNonZeroWidthElement(); - return previousElement === null ? 0 : TypeScript.fullStart(previousElement) + TypeScript.fullWidth(previousElement); + return !previousElement ? 0 : TypeScript.fullStart(previousElement) + TypeScript.fullWidth(previousElement); }; EmptyToken.prototype.previousNonZeroWidthElement = function () { var current = this; while (true) { var parent = current.parent; - if (parent === null) { - TypeScript.Debug.assert(current.kind() === 120 /* SourceUnit */, "We had a node without a parent that was not the root node!"); - return null; + 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) { @@ -21104,6 +20833,15 @@ var TypeScript; 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); }; @@ -21159,11 +20897,20 @@ var TypeScript; this.underlyingToken = underlyingToken; } ConvertedKeywordToken.prototype.kind = function () { - return 11 /* IdentifierName */; + 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(); }; @@ -21252,23 +20999,23 @@ var TypeScript; throw TypeScript.Errors.abstract(); }; AbstractTrivia.prototype.isWhitespace = function () { - return this.kind() === 4 /* WhitespaceTrivia */; + return this.kind() === 2 /* WhitespaceTrivia */; }; AbstractTrivia.prototype.isComment = function () { - return this.kind() === 7 /* SingleLineCommentTrivia */ || this.kind() === 6 /* MultiLineCommentTrivia */; + return this.kind() === 5 /* SingleLineCommentTrivia */ || this.kind() === 4 /* MultiLineCommentTrivia */; }; AbstractTrivia.prototype.isNewLine = function () { - return this.kind() === 5 /* NewLineTrivia */; + return this.kind() === 3 /* NewLineTrivia */; }; AbstractTrivia.prototype.isSkippedToken = function () { - return this.kind() === 8 /* SkippedTokenTrivia */; + return this.kind() === 6 /* SkippedTokenTrivia */; }; return AbstractTrivia; })(); var SkippedTokenTrivia = (function (_super) { __extends(SkippedTokenTrivia, _super); function SkippedTokenTrivia(_skippedToken, _fullText) { - _super.call(this, 8 /* SkippedTokenTrivia */); + _super.call(this, 6 /* SkippedTokenTrivia */); this._skippedToken = _skippedToken; this._fullText = _fullText; _skippedToken.parent = this; @@ -21358,9 +21105,6 @@ var TypeScript; var EmptyTriviaList = (function () { function EmptyTriviaList() { } - EmptyTriviaList.prototype.kind = function () { - return 3 /* TriviaList */; - }; EmptyTriviaList.prototype.isShared = function () { return true; }; @@ -21399,16 +21143,13 @@ var TypeScript; ; Syntax.emptyTriviaList = new EmptyTriviaList(); function isComment(trivia) { - return trivia.kind() === 6 /* MultiLineCommentTrivia */ || trivia.kind() === 7 /* SingleLineCommentTrivia */; + 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.kind = function () { - return 3 /* TriviaList */; - }; SingletonSyntaxTriviaList.prototype.isShared = function () { return false; }; @@ -21434,10 +21175,10 @@ var TypeScript; return isComment(this.item); }; SingletonSyntaxTriviaList.prototype.hasNewLine = function () { - return this.item.kind() === 5 /* NewLineTrivia */; + return this.item.kind() === 3 /* NewLineTrivia */; }; SingletonSyntaxTriviaList.prototype.hasSkippedToken = function () { - return this.item.kind() === 8 /* SkippedTokenTrivia */; + return this.item.kind() === 6 /* SkippedTokenTrivia */; }; SingletonSyntaxTriviaList.prototype.toArray = function () { return [this.item]; @@ -21456,9 +21197,6 @@ var TypeScript; return cloned; }); } - NormalSyntaxTriviaList.prototype.kind = function () { - return 3 /* TriviaList */; - }; NormalSyntaxTriviaList.prototype.isShared = function () { return false; }; @@ -21494,7 +21232,7 @@ var TypeScript; }; NormalSyntaxTriviaList.prototype.hasNewLine = function () { for (var i = 0; i < this.trivia.length; i++) { - if (this.trivia[i].kind() === 5 /* NewLineTrivia */) { + if (this.trivia[i].kind() === 3 /* NewLineTrivia */) { return true; } } @@ -21502,7 +21240,7 @@ var TypeScript; }; NormalSyntaxTriviaList.prototype.hasSkippedToken = function () { for (var i = 0; i < this.trivia.length; i++) { - if (this.trivia[i].kind() === 8 /* SkippedTokenTrivia */) { + if (this.trivia[i].kind() === 6 /* SkippedTokenTrivia */) { return true; } } @@ -21517,7 +21255,7 @@ var TypeScript; return NormalSyntaxTriviaList; })(); function triviaList(trivia) { - if (trivia === undefined || trivia === null || trivia.length === 0) { + if (!trivia || trivia.length === 0) { return Syntax.emptyTriviaList; } if (trivia.length === 1) { @@ -21535,22 +21273,22 @@ var TypeScript; } SyntaxUtilities.isAnyFunctionExpressionOrDeclaration = function (ast) { switch (ast.kind()) { - case 220 /* SimpleArrowFunctionExpression */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 223 /* FunctionExpression */: - case 130 /* FunctionDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 242 /* FunctionPropertyAssignment */: - case 138 /* ConstructorDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: + 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 === null) { + if (_nextToken === undefined) { return true; } var lineMap = text.lineMap(); @@ -21561,100 +21299,24 @@ var TypeScript; SyntaxUtilities.isLeftHandSizeExpression = function (element) { if (element) { switch (element.kind()) { - case 213 /* MemberAccessExpression */: - case 222 /* ElementAccessExpression */: - case 217 /* ObjectCreationExpression */: - case 214 /* InvocationExpression */: - case 215 /* ArrayLiteralExpression */: - case 218 /* ParenthesizedExpression */: - case 216 /* ObjectLiteralExpression */: - case 223 /* FunctionExpression */: - case 11 /* IdentifierName */: - case 12 /* RegularExpressionLiteral */: - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 50 /* SuperKeyword */: - return true; - } - } - return false; - }; - SyntaxUtilities.isExpression = function (element) { - if (element) { - switch (element.kind()) { - case 11 /* IdentifierName */: - case 12 /* RegularExpressionLiteral */: - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 50 /* SuperKeyword */: - case 165 /* PlusExpression */: - case 166 /* NegateExpression */: - case 167 /* BitwiseNotExpression */: - case 168 /* LogicalNotExpression */: - case 169 /* PreIncrementExpression */: - case 170 /* PreDecrementExpression */: - case 171 /* DeleteExpression */: - case 172 /* TypeOfExpression */: - case 173 /* VoidExpression */: - case 174 /* CommaExpression */: - case 175 /* AssignmentExpression */: - case 176 /* AddAssignmentExpression */: - case 177 /* SubtractAssignmentExpression */: - case 178 /* MultiplyAssignmentExpression */: - case 179 /* DivideAssignmentExpression */: - case 180 /* ModuloAssignmentExpression */: - case 181 /* AndAssignmentExpression */: - case 182 /* ExclusiveOrAssignmentExpression */: - case 183 /* OrAssignmentExpression */: - case 184 /* LeftShiftAssignmentExpression */: - case 185 /* SignedRightShiftAssignmentExpression */: - case 186 /* UnsignedRightShiftAssignmentExpression */: - case 187 /* ConditionalExpression */: - case 188 /* LogicalOrExpression */: - case 189 /* LogicalAndExpression */: - case 190 /* BitwiseOrExpression */: - case 191 /* BitwiseExclusiveOrExpression */: - case 192 /* BitwiseAndExpression */: - case 193 /* EqualsWithTypeConversionExpression */: - case 194 /* NotEqualsWithTypeConversionExpression */: - case 195 /* EqualsExpression */: - case 196 /* NotEqualsExpression */: - case 197 /* LessThanExpression */: - case 198 /* GreaterThanExpression */: - case 199 /* LessThanOrEqualExpression */: - case 200 /* GreaterThanOrEqualExpression */: - case 201 /* InstanceOfExpression */: - case 202 /* InExpression */: - case 203 /* LeftShiftExpression */: - case 204 /* SignedRightShiftExpression */: - case 205 /* UnsignedRightShiftExpression */: - case 206 /* MultiplyExpression */: - case 207 /* DivideExpression */: - case 208 /* ModuloExpression */: - case 209 /* AddExpression */: - case 210 /* SubtractExpression */: - case 211 /* PostIncrementExpression */: - case 212 /* PostDecrementExpression */: - case 213 /* MemberAccessExpression */: - case 214 /* InvocationExpression */: - case 215 /* ArrayLiteralExpression */: - case 216 /* ObjectLiteralExpression */: - case 217 /* ObjectCreationExpression */: - case 218 /* ParenthesizedExpression */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 220 /* SimpleArrowFunctionExpression */: - case 221 /* CastExpression */: - case 222 /* ElementAccessExpression */: - case 223 /* FunctionExpression */: - case 224 /* OmittedExpression */: + 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; } } @@ -21663,8 +21325,8 @@ var TypeScript; SyntaxUtilities.isSwitchClause = function (element) { if (element) { switch (element.kind()) { - case 234 /* CaseSwitchClause */: - case 235 /* DefaultSwitchClause */: + case 198 /* CaseSwitchClause */: + case 199 /* DefaultSwitchClause */: return true; } } @@ -21673,11 +21335,11 @@ var TypeScript; SyntaxUtilities.isTypeMember = function (element) { if (element) { switch (element.kind()) { - case 144 /* ConstructSignature */: - case 146 /* MethodSignature */: - case 145 /* IndexSignature */: - case 142 /* PropertySignature */: - case 143 /* CallSignature */: + case 148 /* ConstructSignature */: + case 150 /* MethodSignature */: + case 149 /* IndexSignature */: + case 146 /* PropertySignature */: + case 147 /* CallSignature */: return true; } } @@ -21686,13 +21348,13 @@ var TypeScript; SyntaxUtilities.isClassElement = function (element) { if (element) { switch (element.kind()) { - case 138 /* ConstructorDeclaration */: - case 139 /* IndexMemberDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 136 /* MemberFunctionDeclaration */: - case 137 /* MemberVariableDeclaration */: + case 142 /* ConstructorDeclaration */: + case 143 /* IndexMemberDeclaration */: + case 140 /* MemberFunctionDeclaration */: + case 144 /* GetAccessor */: + case 145 /* SetAccessor */: + case 140 /* MemberFunctionDeclaration */: + case 141 /* MemberVariableDeclaration */: return true; } } @@ -21701,31 +21363,31 @@ var TypeScript; SyntaxUtilities.isModuleElement = function (element) { if (element) { switch (element.kind()) { - case 134 /* ImportDeclaration */: - case 135 /* ExportAssignment */: - case 132 /* ClassDeclaration */: - case 129 /* InterfaceDeclaration */: - case 131 /* ModuleDeclaration */: - case 133 /* EnumDeclaration */: - case 130 /* FunctionDeclaration */: - case 149 /* VariableStatement */: - case 147 /* Block */: - case 148 /* IfStatement */: - case 150 /* ExpressionStatement */: - case 158 /* ThrowStatement */: - case 151 /* ReturnStatement */: - case 152 /* SwitchStatement */: - case 153 /* BreakStatement */: - case 154 /* ContinueStatement */: - case 156 /* ForInStatement */: - case 155 /* ForStatement */: - case 159 /* WhileStatement */: - case 164 /* WithStatement */: - case 157 /* EmptyStatement */: - case 160 /* TryStatement */: - case 161 /* LabeledStatement */: - case 162 /* DoStatement */: - case 163 /* DebuggerStatement */: + 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; } } @@ -21734,25 +21396,25 @@ var TypeScript; SyntaxUtilities.isStatement = function (element) { if (element) { switch (element.kind()) { - case 130 /* FunctionDeclaration */: - case 149 /* VariableStatement */: - case 147 /* Block */: - case 148 /* IfStatement */: - case 150 /* ExpressionStatement */: - case 158 /* ThrowStatement */: - case 151 /* ReturnStatement */: - case 152 /* SwitchStatement */: - case 153 /* BreakStatement */: - case 154 /* ContinueStatement */: - case 156 /* ForInStatement */: - case 155 /* ForStatement */: - case 159 /* WhileStatement */: - case 164 /* WithStatement */: - case 157 /* EmptyStatement */: - case 160 /* TryStatement */: - case 161 /* LabeledStatement */: - case 162 /* DoStatement */: - case 163 /* DebuggerStatement */: + 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; } } @@ -21761,11 +21423,11 @@ var TypeScript; SyntaxUtilities.isAngleBracket = function (positionedElement) { var element = positionedElement; var parent = positionedElement.parent; - if (parent !== null && (element.kind() === 80 /* LessThanToken */ || element.kind() === 81 /* GreaterThanToken */)) { + if (parent && (element.kind() === 82 /* LessThanToken */ || element.kind() === 83 /* GreaterThanToken */)) { switch (parent.kind()) { - case 229 /* TypeArgumentList */: - case 230 /* TypeParameterList */: - case 221 /* CastExpression */: + case 194 /* TypeArgumentList */: + case 195 /* TypeParameterList */: + case 184 /* CastExpression */: return true; } } @@ -21778,26 +21440,26 @@ var TypeScript; return token; } } - return null; + return undefined; }; SyntaxUtilities.containsToken = function (list, kind) { - return SyntaxUtilities.getToken(list, kind) !== null; + return !!SyntaxUtilities.getToken(list, kind); }; SyntaxUtilities.hasExportKeyword = function (moduleElement) { - return SyntaxUtilities.getExportKeyword(moduleElement) !== null; + return !!SyntaxUtilities.getExportKeyword(moduleElement); }; SyntaxUtilities.getExportKeyword = function (moduleElement) { switch (moduleElement.kind()) { - case 131 /* ModuleDeclaration */: - case 132 /* ClassDeclaration */: - case 130 /* FunctionDeclaration */: - case 149 /* VariableStatement */: - case 133 /* EnumDeclaration */: - case 129 /* InterfaceDeclaration */: - case 134 /* ImportDeclaration */: - return SyntaxUtilities.getToken(moduleElement.modifiers, 47 /* ExportKeyword */); + 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 null; + return undefined; } }; SyntaxUtilities.isAmbientDeclarationSyntax = function (positionNode) { @@ -21806,24 +21468,24 @@ var TypeScript; } var node = positionNode; switch (node.kind()) { - case 131 /* ModuleDeclaration */: - case 132 /* ClassDeclaration */: - case 130 /* FunctionDeclaration */: - case 149 /* VariableStatement */: - case 133 /* EnumDeclaration */: - if (SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */)) { + 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 134 /* ImportDeclaration */: - case 138 /* ConstructorDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 137 /* MemberVariableDeclaration */: + 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 244 /* EnumElement */: + case 209 /* EnumElement */: return SyntaxUtilities.isAmbientDeclarationSyntax(TypeScript.Syntax.containingNode(TypeScript.Syntax.containingNode(positionNode))); default: return SyntaxUtilities.isAmbientDeclarationSyntax(TypeScript.Syntax.containingNode(positionNode)); @@ -21835,230 +21497,897 @@ var TypeScript; })(TypeScript || (TypeScript = {})); var TypeScript; (function (TypeScript) { - function visitNodeOrToken(visitor, element) { - if (element === null) { - return null; + 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; } - if (TypeScript.isToken(element)) { - return visitor.visitToken(element); + 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 120 /* SourceUnit */: - return visitor.visitSourceUnit(element); - case 121 /* QualifiedName */: - return visitor.visitQualifiedName(element); - case 122 /* ObjectType */: - return visitor.visitObjectType(element); - case 123 /* FunctionType */: - return visitor.visitFunctionType(element); - case 124 /* ArrayType */: - return visitor.visitArrayType(element); - case 125 /* ConstructorType */: - return visitor.visitConstructorType(element); - case 126 /* GenericType */: - return visitor.visitGenericType(element); - case 127 /* TypeQuery */: - return visitor.visitTypeQuery(element); - case 128 /* TupleType */: - return visitor.visitTupleType(element); - case 129 /* InterfaceDeclaration */: - return visitor.visitInterfaceDeclaration(element); - case 130 /* FunctionDeclaration */: - return visitor.visitFunctionDeclaration(element); - case 131 /* ModuleDeclaration */: - return visitor.visitModuleDeclaration(element); - case 132 /* ClassDeclaration */: - return visitor.visitClassDeclaration(element); - case 133 /* EnumDeclaration */: - return visitor.visitEnumDeclaration(element); - case 134 /* ImportDeclaration */: - return visitor.visitImportDeclaration(element); - case 135 /* ExportAssignment */: - return visitor.visitExportAssignment(element); - case 136 /* MemberFunctionDeclaration */: - return visitor.visitMemberFunctionDeclaration(element); - case 137 /* MemberVariableDeclaration */: - return visitor.visitMemberVariableDeclaration(element); - case 138 /* ConstructorDeclaration */: - return visitor.visitConstructorDeclaration(element); - case 139 /* IndexMemberDeclaration */: - return visitor.visitIndexMemberDeclaration(element); - case 140 /* GetAccessor */: - return visitor.visitGetAccessor(element); - case 141 /* SetAccessor */: - return visitor.visitSetAccessor(element); - case 142 /* PropertySignature */: - return visitor.visitPropertySignature(element); - case 143 /* CallSignature */: - return visitor.visitCallSignature(element); - case 144 /* ConstructSignature */: - return visitor.visitConstructSignature(element); - case 145 /* IndexSignature */: - return visitor.visitIndexSignature(element); - case 146 /* MethodSignature */: - return visitor.visitMethodSignature(element); - case 147 /* Block */: - return visitor.visitBlock(element); - case 148 /* IfStatement */: - return visitor.visitIfStatement(element); - case 149 /* VariableStatement */: - return visitor.visitVariableStatement(element); - case 150 /* ExpressionStatement */: - return visitor.visitExpressionStatement(element); - case 151 /* ReturnStatement */: - return visitor.visitReturnStatement(element); - case 152 /* SwitchStatement */: - return visitor.visitSwitchStatement(element); - case 153 /* BreakStatement */: - return visitor.visitBreakStatement(element); - case 154 /* ContinueStatement */: - return visitor.visitContinueStatement(element); - case 155 /* ForStatement */: - return visitor.visitForStatement(element); - case 156 /* ForInStatement */: - return visitor.visitForInStatement(element); - case 157 /* EmptyStatement */: - return visitor.visitEmptyStatement(element); - case 158 /* ThrowStatement */: - return visitor.visitThrowStatement(element); - case 159 /* WhileStatement */: - return visitor.visitWhileStatement(element); - case 160 /* TryStatement */: - return visitor.visitTryStatement(element); - case 161 /* LabeledStatement */: - return visitor.visitLabeledStatement(element); - case 162 /* DoStatement */: - return visitor.visitDoStatement(element); - case 163 /* DebuggerStatement */: - return visitor.visitDebuggerStatement(element); - case 164 /* WithStatement */: - return visitor.visitWithStatement(element); - case 169 /* PreIncrementExpression */: - case 170 /* PreDecrementExpression */: - case 165 /* PlusExpression */: - case 166 /* NegateExpression */: - case 167 /* BitwiseNotExpression */: - case 168 /* LogicalNotExpression */: - return visitor.visitPrefixUnaryExpression(element); - case 171 /* DeleteExpression */: - return visitor.visitDeleteExpression(element); - case 172 /* TypeOfExpression */: - return visitor.visitTypeOfExpression(element); - case 173 /* VoidExpression */: - return visitor.visitVoidExpression(element); - case 187 /* ConditionalExpression */: - return visitor.visitConditionalExpression(element); - case 206 /* MultiplyExpression */: - case 207 /* DivideExpression */: - case 208 /* ModuloExpression */: - case 209 /* AddExpression */: - case 210 /* SubtractExpression */: - case 203 /* LeftShiftExpression */: - case 204 /* SignedRightShiftExpression */: - case 205 /* UnsignedRightShiftExpression */: - case 197 /* LessThanExpression */: - case 198 /* GreaterThanExpression */: - case 199 /* LessThanOrEqualExpression */: - case 200 /* GreaterThanOrEqualExpression */: - case 201 /* InstanceOfExpression */: - case 202 /* InExpression */: - case 193 /* EqualsWithTypeConversionExpression */: - case 194 /* NotEqualsWithTypeConversionExpression */: - case 195 /* EqualsExpression */: - case 196 /* NotEqualsExpression */: - case 192 /* BitwiseAndExpression */: - case 191 /* BitwiseExclusiveOrExpression */: - case 190 /* BitwiseOrExpression */: - case 189 /* LogicalAndExpression */: - case 188 /* LogicalOrExpression */: - case 183 /* OrAssignmentExpression */: - case 181 /* AndAssignmentExpression */: - case 182 /* ExclusiveOrAssignmentExpression */: - case 184 /* LeftShiftAssignmentExpression */: - case 185 /* SignedRightShiftAssignmentExpression */: - case 186 /* UnsignedRightShiftAssignmentExpression */: - case 176 /* AddAssignmentExpression */: - case 177 /* SubtractAssignmentExpression */: - case 178 /* MultiplyAssignmentExpression */: - case 179 /* DivideAssignmentExpression */: - case 180 /* ModuloAssignmentExpression */: - case 175 /* AssignmentExpression */: - case 174 /* CommaExpression */: - return visitor.visitBinaryExpression(element); - case 211 /* PostIncrementExpression */: - case 212 /* PostDecrementExpression */: - return visitor.visitPostfixUnaryExpression(element); - case 213 /* MemberAccessExpression */: - return visitor.visitMemberAccessExpression(element); - case 214 /* InvocationExpression */: - return visitor.visitInvocationExpression(element); - case 215 /* ArrayLiteralExpression */: - return visitor.visitArrayLiteralExpression(element); - case 216 /* ObjectLiteralExpression */: - return visitor.visitObjectLiteralExpression(element); - case 217 /* ObjectCreationExpression */: - return visitor.visitObjectCreationExpression(element); - case 218 /* ParenthesizedExpression */: - return visitor.visitParenthesizedExpression(element); - case 219 /* ParenthesizedArrowFunctionExpression */: - return visitor.visitParenthesizedArrowFunctionExpression(element); - case 220 /* SimpleArrowFunctionExpression */: - return visitor.visitSimpleArrowFunctionExpression(element); - case 221 /* CastExpression */: - return visitor.visitCastExpression(element); - case 222 /* ElementAccessExpression */: - return visitor.visitElementAccessExpression(element); - case 223 /* FunctionExpression */: - return visitor.visitFunctionExpression(element); - case 224 /* OmittedExpression */: - return visitor.visitOmittedExpression(element); - case 225 /* VariableDeclaration */: - return visitor.visitVariableDeclaration(element); - case 226 /* VariableDeclarator */: - return visitor.visitVariableDeclarator(element); - case 227 /* ArgumentList */: - return visitor.visitArgumentList(element); - case 228 /* ParameterList */: - return visitor.visitParameterList(element); - case 229 /* TypeArgumentList */: - return visitor.visitTypeArgumentList(element); - case 230 /* TypeParameterList */: - return visitor.visitTypeParameterList(element); - case 231 /* ExtendsHeritageClause */: - case 232 /* ImplementsHeritageClause */: - return visitor.visitHeritageClause(element); - case 233 /* EqualsValueClause */: - return visitor.visitEqualsValueClause(element); - case 234 /* CaseSwitchClause */: - return visitor.visitCaseSwitchClause(element); - case 235 /* DefaultSwitchClause */: - return visitor.visitDefaultSwitchClause(element); - case 236 /* ElseClause */: - return visitor.visitElseClause(element); - case 237 /* CatchClause */: - return visitor.visitCatchClause(element); - case 238 /* FinallyClause */: - return visitor.visitFinallyClause(element); - case 239 /* TypeParameter */: - return visitor.visitTypeParameter(element); - case 240 /* Constraint */: - return visitor.visitConstraint(element); - case 241 /* SimplePropertyAssignment */: - return visitor.visitSimplePropertyAssignment(element); - case 242 /* FunctionPropertyAssignment */: - return visitor.visitFunctionPropertyAssignment(element); - case 243 /* Parameter */: - return visitor.visitParameter(element); - case 244 /* EnumElement */: - return visitor.visitEnumElement(element); - case 245 /* TypeAnnotation */: - return visitor.visitTypeAnnotation(element); - case 246 /* ExternalModuleReference */: - return visitor.visitExternalModuleReference(element); - case 247 /* ModuleNameModuleReference */: - return visitor.visitModuleNameModuleReference(element); + 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); } - throw TypeScript.Errors.invalidOperation(); } TypeScript.visitNodeOrToken = visitNodeOrToken; })(TypeScript || (TypeScript = {})); @@ -22069,44 +22398,15 @@ var TypeScript; } SyntaxWalker.prototype.visitToken = function (token) { }; - SyntaxWalker.prototype.visitNode = function (node) { - TypeScript.visitNodeOrToken(this, node); - }; - SyntaxWalker.prototype.visitNodeOrToken = function (nodeOrToken) { - if (TypeScript.isToken(nodeOrToken)) { - this.visitToken(nodeOrToken); - } - else { - this.visitNode(nodeOrToken); - } - }; SyntaxWalker.prototype.visitOptionalToken = function (token) { - if (token === null) { + if (token === undefined) { return; } this.visitToken(token); }; - SyntaxWalker.prototype.visitOptionalNode = function (node) { - if (node === null) { - return; - } - this.visitNode(node); - }; - SyntaxWalker.prototype.visitOptionalNodeOrToken = function (nodeOrToken) { - if (nodeOrToken === null) { - return; - } - this.visitNodeOrToken(nodeOrToken); - }; SyntaxWalker.prototype.visitList = function (list) { for (var i = 0, n = list.length; i < n; i++) { - this.visitNodeOrToken(list[i]); - } - }; - SyntaxWalker.prototype.visitSeparatedList = function (list) { - for (var i = 0, n = TypeScript.childCount(list); i < n; i++) { - var item = TypeScript.childAt(list, i); - this.visitNodeOrToken(item); + TypeScript.visitNodeOrToken(this, list[i]); } }; SyntaxWalker.prototype.visitSourceUnit = function (node) { @@ -22114,66 +22414,76 @@ var TypeScript; this.visitToken(node.endOfFileToken); }; SyntaxWalker.prototype.visitQualifiedName = function (node) { - this.visitNodeOrToken(node.left); + TypeScript.visitNodeOrToken(this, node.left); this.visitToken(node.dotToken); this.visitToken(node.right); }; SyntaxWalker.prototype.visitObjectType = function (node) { this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.typeMembers); + this.visitList(node.typeMembers); this.visitToken(node.closeBraceToken); }; SyntaxWalker.prototype.visitFunctionType = function (node) { - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); + TypeScript.visitNodeOrToken(this, node.typeParameterList); + TypeScript.visitNodeOrToken(this, node.parameterList); this.visitToken(node.equalsGreaterThanToken); - this.visitNodeOrToken(node.type); + TypeScript.visitNodeOrToken(this, node.type); }; SyntaxWalker.prototype.visitArrayType = function (node) { - this.visitNodeOrToken(node.type); + TypeScript.visitNodeOrToken(this, node.type); this.visitToken(node.openBracketToken); this.visitToken(node.closeBracketToken); }; SyntaxWalker.prototype.visitConstructorType = function (node) { this.visitToken(node.newKeyword); - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); + TypeScript.visitNodeOrToken(this, node.typeParameterList); + TypeScript.visitNodeOrToken(this, node.parameterList); this.visitToken(node.equalsGreaterThanToken); - this.visitNodeOrToken(node.type); + TypeScript.visitNodeOrToken(this, node.type); }; SyntaxWalker.prototype.visitGenericType = function (node) { - this.visitNodeOrToken(node.name); - this.visitNode(node.typeArgumentList); + TypeScript.visitNodeOrToken(this, node.name); + TypeScript.visitNodeOrToken(this, node.typeArgumentList); }; SyntaxWalker.prototype.visitTypeQuery = function (node) { this.visitToken(node.typeOfKeyword); - this.visitNodeOrToken(node.name); + TypeScript.visitNodeOrToken(this, node.name); }; SyntaxWalker.prototype.visitTupleType = function (node) { this.visitToken(node.openBracketToken); - this.visitSeparatedList(node.types); + 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); - this.visitOptionalNode(node.typeParameterList); + TypeScript.visitNodeOrToken(this, node.typeParameterList); this.visitList(node.heritageClauses); - this.visitNode(node.body); + TypeScript.visitNodeOrToken(this, node.body); }; SyntaxWalker.prototype.visitFunctionDeclaration = function (node) { this.visitList(node.modifiers); this.visitToken(node.functionKeyword); this.visitToken(node.identifier); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); + 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); - this.visitOptionalNodeOrToken(node.name); + TypeScript.visitNodeOrToken(this, node.name); this.visitOptionalToken(node.stringLiteral); this.visitToken(node.openBraceToken); this.visitList(node.moduleElements); @@ -22183,7 +22493,7 @@ var TypeScript; this.visitList(node.modifiers); this.visitToken(node.classKeyword); this.visitToken(node.identifier); - this.visitOptionalNode(node.typeParameterList); + TypeScript.visitNodeOrToken(this, node.typeParameterList); this.visitList(node.heritageClauses); this.visitToken(node.openBraceToken); this.visitList(node.classElements); @@ -22194,7 +22504,7 @@ var TypeScript; this.visitToken(node.enumKeyword); this.visitToken(node.identifier); this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.enumElements); + this.visitList(node.enumElements); this.visitToken(node.closeBraceToken); }; SyntaxWalker.prototype.visitImportDeclaration = function (node) { @@ -22202,7 +22512,7 @@ var TypeScript; this.visitToken(node.importKeyword); this.visitToken(node.identifier); this.visitToken(node.equalsToken); - this.visitNodeOrToken(node.moduleReference); + TypeScript.visitNodeOrToken(this, node.moduleReference); this.visitOptionalToken(node.semicolonToken); }; SyntaxWalker.prototype.visitExportAssignment = function (node) { @@ -22214,65 +22524,65 @@ var TypeScript; SyntaxWalker.prototype.visitMemberFunctionDeclaration = function (node) { this.visitList(node.modifiers); this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); + TypeScript.visitNodeOrToken(this, node.callSignature); + TypeScript.visitNodeOrToken(this, node.block); this.visitOptionalToken(node.semicolonToken); }; SyntaxWalker.prototype.visitMemberVariableDeclaration = function (node) { this.visitList(node.modifiers); - this.visitNode(node.variableDeclarator); + TypeScript.visitNodeOrToken(this, node.variableDeclarator); this.visitOptionalToken(node.semicolonToken); }; SyntaxWalker.prototype.visitConstructorDeclaration = function (node) { this.visitList(node.modifiers); this.visitToken(node.constructorKeyword); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); + TypeScript.visitNodeOrToken(this, node.callSignature); + TypeScript.visitNodeOrToken(this, node.block); this.visitOptionalToken(node.semicolonToken); }; SyntaxWalker.prototype.visitIndexMemberDeclaration = function (node) { this.visitList(node.modifiers); - this.visitNode(node.indexSignature); + 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); - this.visitNode(node.callSignature); - this.visitNode(node.block); + 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); - this.visitNode(node.callSignature); - this.visitNode(node.block); + TypeScript.visitNodeOrToken(this, node.callSignature); + TypeScript.visitNodeOrToken(this, node.block); }; SyntaxWalker.prototype.visitPropertySignature = function (node) { this.visitToken(node.propertyName); this.visitOptionalToken(node.questionToken); - this.visitOptionalNode(node.typeAnnotation); + TypeScript.visitNodeOrToken(this, node.typeAnnotation); }; SyntaxWalker.prototype.visitCallSignature = function (node) { - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); - this.visitOptionalNode(node.typeAnnotation); + TypeScript.visitNodeOrToken(this, node.typeParameterList); + TypeScript.visitNodeOrToken(this, node.parameterList); + TypeScript.visitNodeOrToken(this, node.typeAnnotation); }; SyntaxWalker.prototype.visitConstructSignature = function (node) { this.visitToken(node.newKeyword); - this.visitNode(node.callSignature); + TypeScript.visitNodeOrToken(this, node.callSignature); }; SyntaxWalker.prototype.visitIndexSignature = function (node) { this.visitToken(node.openBracketToken); - this.visitSeparatedList(node.parameters); + this.visitList(node.parameters); this.visitToken(node.closeBracketToken); - this.visitOptionalNode(node.typeAnnotation); + TypeScript.visitNodeOrToken(this, node.typeAnnotation); }; SyntaxWalker.prototype.visitMethodSignature = function (node) { this.visitToken(node.propertyName); this.visitOptionalToken(node.questionToken); - this.visitNode(node.callSignature); + TypeScript.visitNodeOrToken(this, node.callSignature); }; SyntaxWalker.prototype.visitBlock = function (node) { this.visitToken(node.openBraceToken); @@ -22282,29 +22592,29 @@ var TypeScript; SyntaxWalker.prototype.visitIfStatement = function (node) { this.visitToken(node.ifKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); + TypeScript.visitNodeOrToken(this, node.condition); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - this.visitOptionalNode(node.elseClause); + TypeScript.visitNodeOrToken(this, node.statement); + TypeScript.visitNodeOrToken(this, node.elseClause); }; SyntaxWalker.prototype.visitVariableStatement = function (node) { this.visitList(node.modifiers); - this.visitNode(node.variableDeclaration); + TypeScript.visitNodeOrToken(this, node.variableDeclaration); this.visitOptionalToken(node.semicolonToken); }; SyntaxWalker.prototype.visitExpressionStatement = function (node) { - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); this.visitOptionalToken(node.semicolonToken); }; SyntaxWalker.prototype.visitReturnStatement = function (node) { this.visitToken(node.returnKeyword); - this.visitOptionalNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); this.visitOptionalToken(node.semicolonToken); }; SyntaxWalker.prototype.visitSwitchStatement = function (node) { this.visitToken(node.switchKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); this.visitToken(node.closeParenToken); this.visitToken(node.openBraceToken); this.visitList(node.switchClauses); @@ -22323,57 +22633,57 @@ var TypeScript; SyntaxWalker.prototype.visitForStatement = function (node) { this.visitToken(node.forKeyword); this.visitToken(node.openParenToken); - this.visitOptionalNode(node.variableDeclaration); - this.visitOptionalNodeOrToken(node.initializer); + TypeScript.visitNodeOrToken(this, node.variableDeclaration); + TypeScript.visitNodeOrToken(this, node.initializer); this.visitToken(node.firstSemicolonToken); - this.visitOptionalNodeOrToken(node.condition); + TypeScript.visitNodeOrToken(this, node.condition); this.visitToken(node.secondSemicolonToken); - this.visitOptionalNodeOrToken(node.incrementor); + TypeScript.visitNodeOrToken(this, node.incrementor); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); + TypeScript.visitNodeOrToken(this, node.statement); }; SyntaxWalker.prototype.visitForInStatement = function (node) { this.visitToken(node.forKeyword); this.visitToken(node.openParenToken); - this.visitOptionalNode(node.variableDeclaration); - this.visitOptionalNodeOrToken(node.left); + TypeScript.visitNodeOrToken(this, node.variableDeclaration); + TypeScript.visitNodeOrToken(this, node.left); this.visitToken(node.inKeyword); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); + TypeScript.visitNodeOrToken(this, node.statement); }; SyntaxWalker.prototype.visitEmptyStatement = function (node) { this.visitToken(node.semicolonToken); }; SyntaxWalker.prototype.visitThrowStatement = function (node) { this.visitToken(node.throwKeyword); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); this.visitOptionalToken(node.semicolonToken); }; SyntaxWalker.prototype.visitWhileStatement = function (node) { this.visitToken(node.whileKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); + TypeScript.visitNodeOrToken(this, node.condition); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); + TypeScript.visitNodeOrToken(this, node.statement); }; SyntaxWalker.prototype.visitTryStatement = function (node) { this.visitToken(node.tryKeyword); - this.visitNode(node.block); - this.visitOptionalNode(node.catchClause); - this.visitOptionalNode(node.finallyClause); + 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); - this.visitNodeOrToken(node.statement); + TypeScript.visitNodeOrToken(this, node.statement); }; SyntaxWalker.prototype.visitDoStatement = function (node) { this.visitToken(node.doKeyword); - this.visitNodeOrToken(node.statement); + TypeScript.visitNodeOrToken(this, node.statement); this.visitToken(node.whileKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); + TypeScript.visitNodeOrToken(this, node.condition); this.visitToken(node.closeParenToken); this.visitOptionalToken(node.semicolonToken); }; @@ -22384,144 +22694,152 @@ var TypeScript; SyntaxWalker.prototype.visitWithStatement = function (node) { this.visitToken(node.withKeyword); this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); + TypeScript.visitNodeOrToken(this, node.condition); this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); + TypeScript.visitNodeOrToken(this, node.statement); }; SyntaxWalker.prototype.visitPrefixUnaryExpression = function (node) { this.visitToken(node.operatorToken); - this.visitNodeOrToken(node.operand); + TypeScript.visitNodeOrToken(this, node.operand); }; SyntaxWalker.prototype.visitDeleteExpression = function (node) { this.visitToken(node.deleteKeyword); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); }; SyntaxWalker.prototype.visitTypeOfExpression = function (node) { this.visitToken(node.typeOfKeyword); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); }; SyntaxWalker.prototype.visitVoidExpression = function (node) { this.visitToken(node.voidKeyword); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); }; SyntaxWalker.prototype.visitConditionalExpression = function (node) { - this.visitNodeOrToken(node.condition); + TypeScript.visitNodeOrToken(this, node.condition); this.visitToken(node.questionToken); - this.visitNodeOrToken(node.whenTrue); + TypeScript.visitNodeOrToken(this, node.whenTrue); this.visitToken(node.colonToken); - this.visitNodeOrToken(node.whenFalse); + TypeScript.visitNodeOrToken(this, node.whenFalse); }; SyntaxWalker.prototype.visitBinaryExpression = function (node) { - this.visitNodeOrToken(node.left); + TypeScript.visitNodeOrToken(this, node.left); this.visitToken(node.operatorToken); - this.visitNodeOrToken(node.right); + TypeScript.visitNodeOrToken(this, node.right); }; SyntaxWalker.prototype.visitPostfixUnaryExpression = function (node) { - this.visitNodeOrToken(node.operand); + TypeScript.visitNodeOrToken(this, node.operand); this.visitToken(node.operatorToken); }; SyntaxWalker.prototype.visitMemberAccessExpression = function (node) { - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); this.visitToken(node.dotToken); this.visitToken(node.name); }; SyntaxWalker.prototype.visitInvocationExpression = function (node) { - this.visitNodeOrToken(node.expression); - this.visitNode(node.argumentList); + TypeScript.visitNodeOrToken(this, node.expression); + TypeScript.visitNodeOrToken(this, node.argumentList); }; SyntaxWalker.prototype.visitArrayLiteralExpression = function (node) { this.visitToken(node.openBracketToken); - this.visitSeparatedList(node.expressions); + this.visitList(node.expressions); this.visitToken(node.closeBracketToken); }; SyntaxWalker.prototype.visitObjectLiteralExpression = function (node) { this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.propertyAssignments); + this.visitList(node.propertyAssignments); this.visitToken(node.closeBraceToken); }; SyntaxWalker.prototype.visitObjectCreationExpression = function (node) { this.visitToken(node.newKeyword); - this.visitNodeOrToken(node.expression); - this.visitOptionalNode(node.argumentList); + TypeScript.visitNodeOrToken(this, node.expression); + TypeScript.visitNodeOrToken(this, node.argumentList); }; SyntaxWalker.prototype.visitParenthesizedExpression = function (node) { this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); this.visitToken(node.closeParenToken); }; SyntaxWalker.prototype.visitParenthesizedArrowFunctionExpression = function (node) { - this.visitNode(node.callSignature); + TypeScript.visitNodeOrToken(this, node.callSignature); this.visitToken(node.equalsGreaterThanToken); - this.visitOptionalNode(node.block); - this.visitOptionalNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.block); + TypeScript.visitNodeOrToken(this, node.expression); }; SyntaxWalker.prototype.visitSimpleArrowFunctionExpression = function (node) { - this.visitNode(node.parameter); + TypeScript.visitNodeOrToken(this, node.parameter); this.visitToken(node.equalsGreaterThanToken); - this.visitOptionalNode(node.block); - this.visitOptionalNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.block); + TypeScript.visitNodeOrToken(this, node.expression); }; SyntaxWalker.prototype.visitCastExpression = function (node) { this.visitToken(node.lessThanToken); - this.visitNodeOrToken(node.type); + TypeScript.visitNodeOrToken(this, node.type); this.visitToken(node.greaterThanToken); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); }; SyntaxWalker.prototype.visitElementAccessExpression = function (node) { - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); this.visitToken(node.openBracketToken); - this.visitNodeOrToken(node.argumentExpression); + TypeScript.visitNodeOrToken(this, node.argumentExpression); this.visitToken(node.closeBracketToken); }; SyntaxWalker.prototype.visitFunctionExpression = function (node) { this.visitToken(node.functionKeyword); this.visitOptionalToken(node.identifier); - this.visitNode(node.callSignature); - this.visitNode(node.block); + 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.visitSeparatedList(node.variableDeclarators); + this.visitList(node.variableDeclarators); }; SyntaxWalker.prototype.visitVariableDeclarator = function (node) { this.visitToken(node.propertyName); - this.visitOptionalNode(node.typeAnnotation); - this.visitOptionalNode(node.equalsValueClause); + TypeScript.visitNodeOrToken(this, node.typeAnnotation); + TypeScript.visitNodeOrToken(this, node.equalsValueClause); }; SyntaxWalker.prototype.visitArgumentList = function (node) { - this.visitOptionalNode(node.typeArgumentList); + TypeScript.visitNodeOrToken(this, node.typeArgumentList); this.visitToken(node.openParenToken); - this.visitSeparatedList(node.arguments); + this.visitList(node.arguments); this.visitToken(node.closeParenToken); }; SyntaxWalker.prototype.visitParameterList = function (node) { this.visitToken(node.openParenToken); - this.visitSeparatedList(node.parameters); + this.visitList(node.parameters); this.visitToken(node.closeParenToken); }; SyntaxWalker.prototype.visitTypeArgumentList = function (node) { this.visitToken(node.lessThanToken); - this.visitSeparatedList(node.typeArguments); + this.visitList(node.typeArguments); this.visitToken(node.greaterThanToken); }; SyntaxWalker.prototype.visitTypeParameterList = function (node) { this.visitToken(node.lessThanToken); - this.visitSeparatedList(node.typeParameters); + this.visitList(node.typeParameters); this.visitToken(node.greaterThanToken); }; SyntaxWalker.prototype.visitHeritageClause = function (node) { this.visitToken(node.extendsOrImplementsKeyword); - this.visitSeparatedList(node.typeNames); + this.visitList(node.typeNames); }; SyntaxWalker.prototype.visitEqualsValueClause = function (node) { this.visitToken(node.equalsToken); - this.visitNodeOrToken(node.value); + TypeScript.visitNodeOrToken(this, node.value); }; SyntaxWalker.prototype.visitCaseSwitchClause = function (node) { this.visitToken(node.caseKeyword); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); this.visitToken(node.colonToken); this.visitList(node.statements); }; @@ -22532,53 +22850,57 @@ var TypeScript; }; SyntaxWalker.prototype.visitElseClause = function (node) { this.visitToken(node.elseKeyword); - this.visitNodeOrToken(node.statement); + TypeScript.visitNodeOrToken(this, node.statement); }; SyntaxWalker.prototype.visitCatchClause = function (node) { this.visitToken(node.catchKeyword); this.visitToken(node.openParenToken); this.visitToken(node.identifier); - this.visitOptionalNode(node.typeAnnotation); + TypeScript.visitNodeOrToken(this, node.typeAnnotation); this.visitToken(node.closeParenToken); - this.visitNode(node.block); + TypeScript.visitNodeOrToken(this, node.block); }; SyntaxWalker.prototype.visitFinallyClause = function (node) { this.visitToken(node.finallyKeyword); - this.visitNode(node.block); + 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); - this.visitOptionalNode(node.constraint); + TypeScript.visitNodeOrToken(this, node.constraint); }; SyntaxWalker.prototype.visitConstraint = function (node) { this.visitToken(node.extendsKeyword); - this.visitNodeOrToken(node.typeOrExpression); + TypeScript.visitNodeOrToken(this, node.typeOrExpression); }; SyntaxWalker.prototype.visitSimplePropertyAssignment = function (node) { this.visitToken(node.propertyName); this.visitToken(node.colonToken); - this.visitNodeOrToken(node.expression); + TypeScript.visitNodeOrToken(this, node.expression); }; SyntaxWalker.prototype.visitFunctionPropertyAssignment = function (node) { this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitNode(node.block); + 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); - this.visitOptionalNode(node.typeAnnotation); - this.visitOptionalNode(node.equalsValueClause); + TypeScript.visitNodeOrToken(this, node.typeAnnotation); + TypeScript.visitNodeOrToken(this, node.equalsValueClause); }; SyntaxWalker.prototype.visitEnumElement = function (node) { this.visitToken(node.propertyName); - this.visitOptionalNode(node.equalsValueClause); + TypeScript.visitNodeOrToken(this, node.equalsValueClause); }; SyntaxWalker.prototype.visitTypeAnnotation = function (node) { this.visitToken(node.colonToken); - this.visitNodeOrToken(node.type); + TypeScript.visitNodeOrToken(this, node.type); }; SyntaxWalker.prototype.visitExternalModuleReference = function (node) { this.visitToken(node.requireKeyword); @@ -22587,38 +22909,16 @@ var TypeScript; this.visitToken(node.closeParenToken); }; SyntaxWalker.prototype.visitModuleNameModuleReference = function (node) { - this.visitNodeOrToken(node.moduleName); + TypeScript.visitNodeOrToken(this, node.moduleName); }; return SyntaxWalker; })(); TypeScript.SyntaxWalker = SyntaxWalker; })(TypeScript || (TypeScript = {})); var TypeScript; -(function (TypeScript) { - var DepthLimitedWalker = (function (_super) { - __extends(DepthLimitedWalker, _super); - function DepthLimitedWalker(maximumDepth) { - _super.call(this); - this._depth = 0; - this._maximumDepth = 0; - this._maximumDepth = maximumDepth; - } - DepthLimitedWalker.prototype.visitNode = function (node) { - if (this._depth < this._maximumDepth) { - this._depth++; - _super.prototype.visitNode.call(this, node); - this._depth--; - } - }; - return DepthLimitedWalker; - })(TypeScript.SyntaxWalker); - TypeScript.DepthLimitedWalker = DepthLimitedWalker; -})(TypeScript || (TypeScript = {})); -var TypeScript; (function (TypeScript) { var Parser; (function (Parser) { - Parser.syntaxFactory; var arrayPool = []; var arrayPoolCount = 0; function getArray() { @@ -22627,14 +22927,9 @@ var TypeScript; } arrayPoolCount--; var result = arrayPool[arrayPoolCount]; - arrayPool[arrayPoolCount] = null; + arrayPool[arrayPoolCount] = undefined; return result; } - function returnZeroLengthArray(array) { - if (array.length === 0) { - returnArray(array); - } - } function returnArray(array) { array.length = 0; arrayPool[arrayPoolCount] = array; @@ -22655,17 +22950,17 @@ var TypeScript; var result = parseSyntaxTreeWorker(isDeclaration); diagnostics = []; parseNodeData = 0 /* None */; - fileName = null; + fileName = undefined; source.release(); - source = null; - _source = null; + 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(Parser.syntaxFactory.isConcrete, sourceUnit, isDeclaration, allDiagnostics, fileName, source.text, languageVersion); + return new TypeScript.SyntaxTree(sourceUnit, isDeclaration, allDiagnostics, fileName, source.text, languageVersion); } function getRewindPoint() { var rewindPoint = source.getRewindPoint(); @@ -22683,8 +22978,8 @@ var TypeScript; } function currentNode() { var node = source.currentNode(); - if (node === null || TypeScript.parsedInStrictMode(node) !== isInStrictMode) { - return null; + if (!node || TypeScript.parsedInStrictMode(node) !== isInStrictMode) { + return undefined; } return node; } @@ -22716,11 +23011,11 @@ var TypeScript; if (_currentToken.kind() === kind) { return consumeToken(_currentToken); } - return null; + return undefined; } function isIdentifier(token) { var tokenKind = token.kind(); - if (tokenKind === 11 /* IdentifierName */) { + if (tokenKind === 9 /* IdentifierName */) { return true; } if (tokenKind >= TypeScript.SyntaxKind.FirstFutureReservedStrictKeyword) { @@ -22734,27 +23029,27 @@ var TypeScript; function eatIdentifierNameToken() { var token = currentToken(); var tokenKind = token.kind(); - if (tokenKind === 11 /* IdentifierName */) { + if (tokenKind === 9 /* IdentifierName */) { return consumeToken(token); } if (TypeScript.SyntaxFacts.isAnyKeyword(tokenKind)) { return TypeScript.Syntax.convertKeywordToIdentifier(consumeToken(token)); } - return createMissingToken(11 /* IdentifierName */, token); + return createMissingToken(9 /* IdentifierName */, token); } function eatOptionalIdentifierToken() { - return isIdentifier(currentToken()) ? eatIdentifierToken() : null; + return isIdentifier(currentToken()) ? eatIdentifierToken() : undefined; } function eatIdentifierToken(diagnosticCode) { var token = currentToken(); if (isIdentifier(token)) { consumeToken(token); - if (token.kind() === 11 /* IdentifierName */) { + if (token.kind() === 9 /* IdentifierName */) { return token; } return TypeScript.Syntax.convertKeywordToIdentifier(token); } - return createMissingToken(11 /* IdentifierName */, token, diagnosticCode); + return createMissingToken(9 /* IdentifierName */, token, diagnosticCode); } function previousTokenHasTrailingNewLine(token) { var tokenFullStart = token.fullStart(); @@ -22768,10 +23063,10 @@ var TypeScript; function canEatAutomaticSemicolon(allowWithoutNewLine) { var token = currentToken(); var tokenKind = token.kind(); - if (tokenKind === 10 /* EndOfFileToken */) { + if (tokenKind === 8 /* EndOfFileToken */) { return true; } - if (tokenKind === 71 /* CloseBraceToken */) { + if (tokenKind === 73 /* CloseBraceToken */) { return true; } if (allowWithoutNewLine) { @@ -22784,20 +23079,20 @@ var TypeScript; } function canEatExplicitOrAutomaticSemicolon(allowWithoutNewline) { var token = currentToken(); - if (token.kind() === 78 /* SemicolonToken */) { + if (token.kind() === 80 /* SemicolonToken */) { return true; } return canEatAutomaticSemicolon(allowWithoutNewline); } function eatExplicitOrAutomaticSemicolon(allowWithoutNewline) { var token = currentToken(); - if (token.kind() === 78 /* SemicolonToken */) { + if (token.kind() === 80 /* SemicolonToken */) { return consumeToken(token); } if (canEatAutomaticSemicolon(allowWithoutNewline)) { - return null; + return undefined; } - return eatToken(78 /* SemicolonToken */); + return eatToken(80 /* SemicolonToken */); } function createMissingToken(expectedKind, actual, diagnosticCode) { var diagnostic = getExpectedTokenDiagnostic(expectedKind, actual, diagnosticCode); @@ -22806,14 +23101,14 @@ var TypeScript; } function getExpectedTokenDiagnostic(expectedKind, actual, diagnosticCode) { var token = currentToken(); - var args = null; + 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 !== null && TypeScript.SyntaxFacts.isAnyKeyword(actual.kind())) { + if (actual && TypeScript.SyntaxFacts.isAnyKeyword(actual.kind())) { diagnosticCode = TypeScript.DiagnosticCode.Identifier_expected_0_is_a_keyword; args = [TypeScript.SyntaxFacts.getText(actual.kind())]; } @@ -22826,38 +23121,33 @@ var TypeScript; } function getBinaryExpressionPrecedence(tokenKind) { switch (tokenKind) { - case 104 /* BarBarToken */: - return 2 /* LogicalOrExpressionPrecedence */; - case 103 /* AmpersandAmpersandToken */: - return 3 /* LogicalAndExpressionPrecedence */; - case 99 /* BarToken */: - return 4 /* BitwiseOrExpressionPrecedence */; - case 100 /* CaretToken */: - return 5 /* BitwiseExclusiveOrExpressionPrecedence */; - case 98 /* AmpersandToken */: - return 6 /* BitwiseAndExpressionPrecedence */; - case 84 /* EqualsEqualsToken */: - case 86 /* ExclamationEqualsToken */: - case 87 /* EqualsEqualsEqualsToken */: - case 88 /* ExclamationEqualsEqualsToken */: + 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 80 /* LessThanToken */: - case 81 /* GreaterThanToken */: - case 82 /* LessThanEqualsToken */: - case 83 /* GreaterThanEqualsToken */: - case 30 /* InstanceOfKeyword */: - case 29 /* InKeyword */: + case 82 /* LessThanToken */: + case 83 /* GreaterThanToken */: + case 84 /* LessThanEqualsToken */: + case 85 /* GreaterThanEqualsToken */: + case 32 /* InstanceOfKeyword */: + case 31 /* InKeyword */: return 8 /* RelationalExpressionPrecedence */; - case 95 /* LessThanLessThanToken */: - case 96 /* GreaterThanGreaterThanToken */: - case 97 /* GreaterThanGreaterThanGreaterThanToken */: + case 97 /* LessThanLessThanToken */: + case 98 /* GreaterThanGreaterThanToken */: + case 99 /* GreaterThanGreaterThanGreaterThanToken */: return 9 /* ShiftExpressionPrecdence */; - case 89 /* PlusToken */: - case 90 /* MinusToken */: + case 91 /* PlusToken */: + case 92 /* MinusToken */: return 10 /* AdditiveExpressionPrecedence */; - case 91 /* AsteriskToken */: - case 118 /* SlashToken */: - case 92 /* PercentToken */: + case 93 /* AsteriskToken */: + case 120 /* SlashToken */: + case 94 /* PercentToken */: return 11 /* MultiplicativeExpressionPrecedence */; } throw TypeScript.Errors.invalidOperation(); @@ -22878,11 +23168,12 @@ var TypeScript; var parent = oldToken.parent; newToken.parent = parent; while (true) { - TypeScript.Debug.assert(TypeScript.isNode(parent) || TypeScript.isList(parent) || TypeScript.isSeparatedList(parent)); + TypeScript.Debug.assert(TypeScript.isNode(parent) || TypeScript.isList(parent)); var dataElement = parent; - if (dataElement.data) { - dataElement.data &= 4 /* NodeParsedInStrictModeMask */; + if (dataElement.__data) { + dataElement.__data &= 4 /* NodeParsedInStrictModeMask */; } + dataElement.__cachedTokens = undefined; if (parent === node) { break; } @@ -22909,20 +23200,6 @@ var TypeScript; } } } - else if (TypeScript.isSeparatedList(parent)) { - var list2 = parent; - for (var i = 0, n = TypeScript.childCount(list2); i < n; i++) { - if (TypeScript.childAt(list2, i) === oldToken) { - if (i % 2 === 0) { - list2[i / 2] = newToken; - } - else { - list2.separators[(i - 1) / 2] = newToken; - } - return; - } - } - } throw TypeScript.Errors.invalidOperation(); } function addSkippedTokenAfterNode(node, skippedToken) { @@ -22989,7 +23266,7 @@ var TypeScript; var skippedTokens = getArray(); var moduleElements = parseSyntaxList(0 /* SourceUnit_ModuleElements */, skippedTokens, updateStrictModeState); setStrictMode(savedIsInStrictMode); - var sourceUnit = new Parser.syntaxFactory.SourceUnitSyntax(parseNodeData, moduleElements, currentToken()); + 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()); @@ -23027,48 +23304,43 @@ var TypeScript; var _modifierCount = modifierCount(); if (_modifierCount) { switch (peekToken(_modifierCount).kind()) { - case 49 /* ImportKeyword */: - return parseImportDeclaration(); - case 65 /* ModuleKeyword */: - return parseModuleDeclaration(); - case 52 /* InterfaceKeyword */: - return parseInterfaceDeclaration(); - case 44 /* ClassKeyword */: - return parseClassDeclaration(); - case 46 /* EnumKeyword */: - return parseEnumDeclaration(); + 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 65 /* ModuleKeyword */: - if (isIdentifier(nextToken) || nextToken.kind() === 14 /* StringLiteral */) { + case 67 /* ModuleKeyword */: + if (isIdentifier(nextToken) || nextToken.kind() === 12 /* StringLiteral */) { return parseModuleDeclaration(); } break; - case 49 /* ImportKeyword */: + case 51 /* ImportKeyword */: if (isIdentifier(nextToken)) { return parseImportDeclaration(); } break; - case 44 /* ClassKeyword */: + case 46 /* ClassKeyword */: if (isIdentifier(nextToken)) { return parseClassDeclaration(); } break; - case 46 /* EnumKeyword */: + case 48 /* EnumKeyword */: if (isIdentifier(nextToken)) { return parseEnumDeclaration(); } break; - case 52 /* InterfaceKeyword */: + case 54 /* InterfaceKeyword */: if (isIdentifier(nextToken)) { return parseInterfaceDeclaration(); } break; - case 47 /* ExportKeyword */: - if (nextToken.kind() === 107 /* EqualsToken */) { + case 49 /* ExportKeyword */: + if (nextToken.kind() === 109 /* EqualsToken */) { return parseExportAssignment(); } break; @@ -23076,72 +23348,72 @@ var TypeScript; return tryParseStatementWorker(_currentToken, currentTokenKind, _modifierCount, inErrorRecovery); } function parseImportDeclaration() { - return new Parser.syntaxFactory.ImportDeclarationSyntax(parseNodeData, parseModifiers(), eatToken(49 /* ImportKeyword */), eatIdentifierToken(), eatToken(107 /* EqualsToken */), parseModuleReference(), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.ImportDeclarationSyntax(parseNodeData, parseModifiers(), eatToken(51 /* ImportKeyword */), eatIdentifierToken(), eatToken(109 /* EqualsToken */), parseModuleReference(), eatExplicitOrAutomaticSemicolon(false)); } function parseExportAssignment() { - return new Parser.syntaxFactory.ExportAssignmentSyntax(parseNodeData, eatToken(47 /* ExportKeyword */), eatToken(107 /* EqualsToken */), eatIdentifierToken(), eatExplicitOrAutomaticSemicolon(false)); + 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() === 66 /* RequireKeyword */ && peekToken(1).kind() === 72 /* OpenParenToken */; + return currentToken().kind() === 68 /* RequireKeyword */ && peekToken(1).kind() === 74 /* OpenParenToken */; } function parseExternalModuleReference() { - return new Parser.syntaxFactory.ExternalModuleReferenceSyntax(parseNodeData, eatToken(66 /* RequireKeyword */), eatToken(72 /* OpenParenToken */), eatToken(14 /* StringLiteral */), eatToken(73 /* CloseParenToken */)); + return new TypeScript.ExternalModuleReferenceSyntax(parseNodeData, eatToken(68 /* RequireKeyword */), eatToken(74 /* OpenParenToken */), eatToken(12 /* StringLiteral */), eatToken(75 /* CloseParenToken */)); } function parseModuleNameModuleReference() { - return new Parser.syntaxFactory.ModuleNameModuleReferenceSyntax(parseNodeData, parseName(false)); + return new TypeScript.ModuleNameModuleReferenceSyntax(parseNodeData, parseName(false)); } function tryParseTypeArgumentList(inExpression) { var _currentToken = currentToken(); - if (_currentToken.kind() !== 80 /* LessThanToken */) { - return null; + 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 Parser.syntaxFactory.TypeArgumentListSyntax(parseNodeData, lessThanToken, typeArguments, eatToken(81 /* GreaterThanToken */)); + 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(81 /* GreaterThanToken */); + var greaterThanToken = eatToken(83 /* GreaterThanToken */); if (greaterThanToken.fullWidth() === 0 || !canFollowTypeArgumentListInExpression(currentToken().kind())) { rewind(rewindPoint); releaseRewindPoint(rewindPoint); - return null; + return undefined; } else { releaseRewindPoint(rewindPoint); - return new Parser.syntaxFactory.TypeArgumentListSyntax(parseNodeData, lessThanToken, typeArguments, greaterThanToken); + return new TypeScript.TypeArgumentListSyntax(parseNodeData, lessThanToken, typeArguments, greaterThanToken); } } function canFollowTypeArgumentListInExpression(kind) { switch (kind) { - case 72 /* OpenParenToken */: - case 76 /* DotToken */: - case 73 /* CloseParenToken */: - case 75 /* CloseBracketToken */: - case 106 /* ColonToken */: - case 78 /* SemicolonToken */: - case 79 /* CommaToken */: - case 105 /* QuestionToken */: - case 84 /* EqualsEqualsToken */: - case 87 /* EqualsEqualsEqualsToken */: - case 86 /* ExclamationEqualsToken */: - case 88 /* ExclamationEqualsEqualsToken */: - case 103 /* AmpersandAmpersandToken */: - case 104 /* BarBarToken */: - case 100 /* CaretToken */: - case 98 /* AmpersandToken */: - case 99 /* BarToken */: - case 71 /* CloseBraceToken */: - case 10 /* EndOfFileToken */: + 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; @@ -23155,7 +23427,7 @@ var TypeScript; 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(11 /* IdentifierName */, _currentToken); + return createMissingToken(9 /* IdentifierName */, _currentToken); } } return allowIdentifierNames ? eatIdentifierNameToken() : eatIdentifierToken(); @@ -23164,59 +23436,59 @@ var TypeScript; var token0 = currentToken(); var shouldContinue = isIdentifier(token0); if (!shouldContinue) { - return null; + return undefined; } var current = eatIdentifierToken(); - while (shouldContinue && currentToken().kind() === 76 /* DotToken */) { + while (shouldContinue && currentToken().kind() === 78 /* DotToken */) { var dotToken = consumeToken(currentToken()); var identifierName = eatRightSideOfName(allowIdentifierNames); - current = new Parser.syntaxFactory.QualifiedNameSyntax(parseNodeData, current, dotToken, identifierName); + current = new TypeScript.QualifiedNameSyntax(parseNodeData, current, dotToken, identifierName); shouldContinue = identifierName.fullWidth() > 0; } return current; } function parseEnumDeclaration() { var modifiers = parseModifiers(); - var enumKeyword = eatToken(46 /* EnumKeyword */); + var enumKeyword = eatToken(48 /* EnumKeyword */); var identifier = eatIdentifierToken(); - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var enumElements = TypeScript.Syntax.emptySeparatedList(); + 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 Parser.syntaxFactory.EnumDeclarationSyntax(parseNodeData, modifiers, enumKeyword, identifier, openBraceToken, enumElements, eatToken(71 /* CloseBraceToken */)); + return new TypeScript.EnumDeclarationSyntax(parseNodeData, modifiers, enumKeyword, identifier, openBraceToken, enumElements || [], eatToken(73 /* CloseBraceToken */)); } function isEnumElement(inErrorRecovery) { var node = currentNode(); - if (node !== null && node.kind() === 244 /* EnumElement */) { + if (node && node.kind() === 209 /* EnumElement */) { return true; } return isPropertyName(currentToken(), inErrorRecovery); } function tryParseEnumElementEqualsValueClause() { - return isEqualsValueClause(false) ? parseEqualsValueClause(true) : null; + return isEqualsValueClause(false) ? parseEqualsValueClause(true) : undefined; } function tryParseEnumElement(inErrorRecovery) { var node = currentNode(); - if (node !== null && node.kind() === 244 /* EnumElement */) { + if (node && node.kind() === 209 /* EnumElement */) { consumeNode(node); return node; } if (!isPropertyName(currentToken(), inErrorRecovery)) { - return null; + return undefined; } - return new Parser.syntaxFactory.EnumElementSyntax(parseNodeData, eatPropertyName(), tryParseEnumElementEqualsValueClause()); + return new TypeScript.EnumElementSyntax(parseNodeData, eatPropertyName(), tryParseEnumElementEqualsValueClause()); } function isModifierKind(kind) { switch (kind) { - case 47 /* ExportKeyword */: - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 56 /* ProtectedKeyword */: - case 58 /* StaticKeyword */: - case 63 /* DeclareKeyword */: + case 49 /* ExportKeyword */: + case 59 /* PublicKeyword */: + case 57 /* PrivateKeyword */: + case 58 /* ProtectedKeyword */: + case 60 /* StaticKeyword */: + case 65 /* DeclareKeyword */: return true; } return false; @@ -23226,10 +23498,10 @@ var TypeScript; var nextToken = peekToken(index + 1); var nextTokenKind = nextToken.kind(); switch (nextTokenKind) { - case 11 /* IdentifierName */: - case 74 /* OpenBracketToken */: - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: + case 9 /* IdentifierName */: + case 76 /* OpenBracketToken */: + case 11 /* NumericLiteral */: + case 12 /* StringLiteral */: return true; default: return TypeScript.SyntaxFacts.isAnyKeyword(nextTokenKind); @@ -23254,39 +23526,37 @@ var TypeScript; } break; } - var result = TypeScript.Syntax.list(tokens); - returnZeroLengthArray(tokens); - return result; + return TypeScript.Syntax.list(tokens); } function parseHeritageClauses() { - var heritageClauses = TypeScript.Syntax.emptyList(); + var heritageClauses; if (isHeritageClause()) { - heritageClauses = parseSyntaxList(10 /* ClassOrInterfaceDeclaration_HeritageClauses */, null); + heritageClauses = parseSyntaxList(10 /* ClassOrInterfaceDeclaration_HeritageClauses */, undefined); } - return heritageClauses; + return heritageClauses || []; } function tryParseHeritageClauseTypeName() { - return isHeritageClauseTypeName() ? tryParseNameOrGenericType() : null; + return isHeritageClauseTypeName() ? tryParseNameOrGenericType() : undefined; } function parseClassDeclaration() { var modifiers = parseModifiers(); - var classKeyword = eatToken(44 /* ClassKeyword */); + var classKeyword = eatToken(46 /* ClassKeyword */); var identifier = eatIdentifierToken(); var typeParameterList = tryParseTypeParameterList(false); var heritageClauses = parseHeritageClauses(); - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var classElements = TypeScript.Syntax.emptyList(); + 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 Parser.syntaxFactory.ClassDeclarationSyntax(parseNodeData, modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, eatToken(71 /* CloseBraceToken */)); + 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 !== 64 /* GetKeyword */ && tokenKind !== 68 /* SetKeyword */) { + if (tokenKind !== 66 /* GetKeyword */ && tokenKind !== 70 /* SetKeyword */) { return false; } return isPropertyName(peekToken(modifierCount + 1), inErrorRecovery); @@ -23295,10 +23565,10 @@ var TypeScript; var modifiers = parseModifiers(); var _currenToken = currentToken(); var tokenKind = _currenToken.kind(); - if (tokenKind === 64 /* GetKeyword */) { + if (tokenKind === 66 /* GetKeyword */) { return parseGetMemberAccessorDeclaration(modifiers, _currenToken, checkForStrictMode); } - else if (tokenKind === 68 /* SetKeyword */) { + else if (tokenKind === 70 /* SetKeyword */) { return parseSetMemberAccessorDeclaration(modifiers, _currenToken, checkForStrictMode); } else { @@ -23306,10 +23576,10 @@ var TypeScript; } } function parseGetMemberAccessorDeclaration(modifiers, getKeyword, checkForStrictMode) { - return new Parser.syntaxFactory.GetAccessorSyntax(parseNodeData, modifiers, consumeToken(getKeyword), eatPropertyName(), parseCallSignature(false), parseBlock(false, checkForStrictMode)); + return new TypeScript.GetAccessorSyntax(parseNodeData, modifiers, consumeToken(getKeyword), eatPropertyName(), parseCallSignature(false), parseBlock(false, checkForStrictMode)); } function parseSetMemberAccessorDeclaration(modifiers, setKeyword, checkForStrictMode) { - return new Parser.syntaxFactory.SetAccessorSyntax(parseNodeData, modifiers, consumeToken(setKeyword), eatPropertyName(), parseCallSignature(false), parseBlock(false, checkForStrictMode)); + return new TypeScript.SetAccessorSyntax(parseNodeData, modifiers, consumeToken(setKeyword), eatPropertyName(), parseCallSignature(false), parseBlock(false, checkForStrictMode)); } function isClassElement(inErrorRecovery) { if (TypeScript.SyntaxUtilities.isClassElement(currentNode())) { @@ -23341,25 +23611,25 @@ var TypeScript; return parseIndexMemberDeclaration(); } else { - return null; + return undefined; } } function isConstructorDeclaration(modifierCount) { - return peekToken(modifierCount).kind() === 62 /* ConstructorKeyword */; + return peekToken(modifierCount).kind() === 64 /* ConstructorKeyword */; } function parseConstructorDeclaration() { var modifiers = parseModifiers(); - var constructorKeyword = eatToken(62 /* ConstructorKeyword */); + var constructorKeyword = eatToken(64 /* ConstructorKeyword */); var callSignature = parseCallSignature(false); - var semicolonToken = null; - var block = null; + var semicolonToken = undefined; + var block = undefined; if (isBlock()) { block = parseBlock(false, true); } else { semicolonToken = eatExplicitOrAutomaticSemicolon(false); } - return new Parser.syntaxFactory.ConstructorDeclarationSyntax(parseNodeData, modifiers, constructorKeyword, callSignature, block, semicolonToken); + return new TypeScript.ConstructorDeclarationSyntax(parseNodeData, modifiers, constructorKeyword, callSignature, block, semicolonToken); } function isMemberFunctionDeclaration(modifierCount, inErrorRecovery) { return isPropertyName(peekToken(modifierCount), inErrorRecovery) && isCallSignature(modifierCount + 1); @@ -23369,25 +23639,25 @@ var TypeScript; var propertyName = eatPropertyName(); var callSignature = parseCallSignature(false); var parseBlockEvenWithNoOpenBrace = tryAddUnexpectedEqualsGreaterThanToken(callSignature); - var block = null; - var semicolon = null; + var block = undefined; + var semicolon = undefined; if (parseBlockEvenWithNoOpenBrace || isBlock()) { block = parseBlock(parseBlockEvenWithNoOpenBrace, true); } else { semicolon = eatExplicitOrAutomaticSemicolon(false); } - return new Parser.syntaxFactory.MemberFunctionDeclarationSyntax(parseNodeData, modifiers, propertyName, callSignature, block, semicolon); + 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 78 /* SemicolonToken */: - case 107 /* EqualsToken */: - case 106 /* ColonToken */: - case 71 /* CloseBraceToken */: - case 10 /* EndOfFileToken */: + case 80 /* SemicolonToken */: + case 109 /* EqualsToken */: + case 108 /* ColonToken */: + case 73 /* CloseBraceToken */: + case 8 /* EndOfFileToken */: return true; default: return previousTokenHasTrailingNewLine(nextToken); @@ -23401,92 +23671,90 @@ var TypeScript; return isPropertyName(peekToken(modifierCount), inErrorRecover) && isDefinitelyMemberVariablePropertyName(modifierCount); } function parseMemberVariableDeclaration() { - return new Parser.syntaxFactory.MemberVariableDeclarationSyntax(parseNodeData, parseModifiers(), tryParseVariableDeclarator(true, true), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.MemberVariableDeclarationSyntax(parseNodeData, parseModifiers(), tryParseVariableDeclarator(true, true), eatExplicitOrAutomaticSemicolon(false)); } function isIndexMemberDeclaration(modifierCount) { return isIndexSignature(modifierCount); } function parseIndexMemberDeclaration() { - return new Parser.syntaxFactory.IndexMemberDeclarationSyntax(parseNodeData, parseModifiers(), parseIndexSignature(), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.IndexMemberDeclarationSyntax(parseNodeData, parseModifiers(), parseIndexSignature(), eatExplicitOrAutomaticSemicolon(false)); } function tryAddUnexpectedEqualsGreaterThanToken(callSignature) { var token0 = currentToken(); - var hasEqualsGreaterThanToken = token0.kind() === 85 /* EqualsGreaterThanToken */; + 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(70 /* OpenBraceToken */)]); + 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); - if (Parser.syntaxFactory.isConcrete) { - addSkippedTokenAfterNode(callSignature, token0); - } + addSkippedTokenAfterNode(callSignature, token0); return true; } } return false; } function isFunctionDeclaration(modifierCount) { - return peekToken(modifierCount).kind() === 27 /* FunctionKeyword */; + return peekToken(modifierCount).kind() === 29 /* FunctionKeyword */; } function parseFunctionDeclaration() { var modifiers = parseModifiers(); - var functionKeyword = eatToken(27 /* FunctionKeyword */); + var functionKeyword = eatToken(29 /* FunctionKeyword */); var identifier = eatIdentifierToken(); var callSignature = parseCallSignature(false); var parseBlockEvenWithNoOpenBrace = tryAddUnexpectedEqualsGreaterThanToken(callSignature); - var semicolonToken = null; - var block = null; + var semicolonToken = undefined; + var block = undefined; if (parseBlockEvenWithNoOpenBrace || isBlock()) { block = parseBlock(parseBlockEvenWithNoOpenBrace, true); } else { semicolonToken = eatExplicitOrAutomaticSemicolon(false); } - return new Parser.syntaxFactory.FunctionDeclarationSyntax(parseNodeData, modifiers, functionKeyword, identifier, callSignature, block, semicolonToken); + return new TypeScript.FunctionDeclarationSyntax(parseNodeData, modifiers, functionKeyword, identifier, callSignature, block, semicolonToken); } function parseModuleDeclaration() { var modifiers = parseModifiers(); - var moduleKeyword = eatToken(65 /* ModuleKeyword */); - var moduleName = null; - var stringLiteral = null; - if (currentToken().kind() === 14 /* StringLiteral */) { - stringLiteral = eatToken(14 /* StringLiteral */); + 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(70 /* OpenBraceToken */); - var moduleElements = TypeScript.Syntax.emptyList(); + 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 Parser.syntaxFactory.ModuleDeclarationSyntax(parseNodeData, modifiers, moduleKeyword, moduleName, stringLiteral, openBraceToken, moduleElements, eatToken(71 /* CloseBraceToken */)); + return new TypeScript.ModuleDeclarationSyntax(parseNodeData, modifiers, moduleKeyword, moduleName, stringLiteral, openBraceToken, moduleElements || [], eatToken(73 /* CloseBraceToken */)); } function parseInterfaceDeclaration() { - return new Parser.syntaxFactory.InterfaceDeclarationSyntax(parseNodeData, parseModifiers(), eatToken(52 /* InterfaceKeyword */), eatIdentifierToken(), tryParseTypeParameterList(false), parseHeritageClauses(), parseObjectType()); + return new TypeScript.InterfaceDeclarationSyntax(parseNodeData, parseModifiers(), eatToken(54 /* InterfaceKeyword */), eatIdentifierToken(), tryParseTypeParameterList(false), parseHeritageClauses(), parseObjectType()); } function parseObjectType() { - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var typeMembers = TypeScript.Syntax.emptySeparatedList(); + 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 Parser.syntaxFactory.ObjectTypeSyntax(parseNodeData, openBraceToken, typeMembers, eatToken(71 /* CloseBraceToken */)); + return new TypeScript.ObjectTypeSyntax(parseNodeData, openBraceToken, typeMembers || [], eatToken(73 /* CloseBraceToken */)); } function parseTupleType(currentToken) { var openBracket = consumeToken(currentToken); - var types = TypeScript.Syntax.emptySeparatedList(); + var types; if (openBracket.fullWidth() > 0) { var skippedTokens = getArray(); types = parseSeparatedSyntaxList(21 /* TupleType_Types */, skippedTokens); openBracket = addSkippedTokensAfterToken(openBracket, skippedTokens); } - return new Parser.syntaxFactory.TupleTypeSyntax(parseNodeData, openBracket, types, eatToken(75 /* CloseBracketToken */)); + return new TypeScript.TupleTypeSyntax(parseNodeData, openBracket, types || [], eatToken(77 /* CloseBracketToken */)); } function isTypeMember(inErrorRecovery) { if (TypeScript.SyntaxUtilities.isTypeMember(currentNode())) { @@ -23516,44 +23784,44 @@ var TypeScript; return parsePropertySignature(); } else { - return null; + return undefined; } } function parseConstructSignature() { - return new Parser.syntaxFactory.ConstructSignatureSyntax(parseNodeData, eatToken(31 /* NewKeyword */), parseCallSignature(false)); + return new TypeScript.ConstructSignatureSyntax(parseNodeData, eatToken(33 /* NewKeyword */), parseCallSignature(false)); } function parseIndexSignature() { - var openBracketToken = eatToken(74 /* OpenBracketToken */); + var openBracketToken = eatToken(76 /* OpenBracketToken */); var skippedTokens = getArray(); var parameters = parseSeparatedSyntaxList(18 /* IndexSignature_Parameters */, skippedTokens); openBracketToken = addSkippedTokensAfterToken(openBracketToken, skippedTokens); - return new Parser.syntaxFactory.IndexSignatureSyntax(parseNodeData, openBracketToken, parameters, eatToken(75 /* CloseBracketToken */), parseOptionalTypeAnnotation(false)); + return new TypeScript.IndexSignatureSyntax(parseNodeData, openBracketToken, parameters, eatToken(77 /* CloseBracketToken */), parseOptionalTypeAnnotation(false)); } function parseMethodSignature() { - return new Parser.syntaxFactory.MethodSignatureSyntax(parseNodeData, eatPropertyName(), tryEatToken(105 /* QuestionToken */), parseCallSignature(false)); + return new TypeScript.MethodSignatureSyntax(parseNodeData, eatPropertyName(), tryEatToken(107 /* QuestionToken */), parseCallSignature(false)); } function parsePropertySignature() { - return new Parser.syntaxFactory.PropertySignatureSyntax(parseNodeData, eatPropertyName(), tryEatToken(105 /* QuestionToken */), parseOptionalTypeAnnotation(false)); + return new TypeScript.PropertySignatureSyntax(parseNodeData, eatPropertyName(), tryEatToken(107 /* QuestionToken */), parseOptionalTypeAnnotation(false)); } function isCallSignature(peekIndex) { var tokenKind = peekToken(peekIndex).kind(); - return tokenKind === 72 /* OpenParenToken */ || tokenKind === 80 /* LessThanToken */; + return tokenKind === 74 /* OpenParenToken */ || tokenKind === 82 /* LessThanToken */; } function isConstructSignature() { - if (currentToken().kind() !== 31 /* NewKeyword */) { + if (currentToken().kind() !== 33 /* NewKeyword */) { return false; } return isCallSignature(1); } function isIndexSignature(peekIndex) { - return peekToken(peekIndex).kind() === 74 /* OpenBracketToken */; + return peekToken(peekIndex).kind() === 76 /* OpenBracketToken */; } function isMethodSignature(inErrorRecovery) { if (isPropertyName(currentToken(), inErrorRecovery)) { if (isCallSignature(1)) { return true; } - if (peekToken(1).kind() === 105 /* QuestionToken */ && isCallSignature(2)) { + if (peekToken(1).kind() === 107 /* QuestionToken */ && isCallSignature(2)) { return true; } } @@ -23570,11 +23838,11 @@ var TypeScript; } function isHeritageClause() { var tokenKind = currentToken().kind(); - return tokenKind === 48 /* ExtendsKeyword */ || tokenKind === 51 /* ImplementsKeyword */; + return tokenKind === 50 /* ExtendsKeyword */ || tokenKind === 53 /* ImplementsKeyword */; } function isNotHeritageClauseTypeName() { var tokenKind = currentToken().kind(); - if (tokenKind === 51 /* ImplementsKeyword */ || tokenKind === 48 /* ExtendsKeyword */) { + if (tokenKind === 53 /* ImplementsKeyword */ || tokenKind === 50 /* ExtendsKeyword */) { return isIdentifier(peekToken(1)); } return false; @@ -23588,47 +23856,38 @@ var TypeScript; function tryParseHeritageClause() { var extendsOrImplementsKeyword = currentToken(); var tokenKind = extendsOrImplementsKeyword.kind(); - if (tokenKind !== 48 /* ExtendsKeyword */ && tokenKind !== 51 /* ImplementsKeyword */) { - return null; + 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 Parser.syntaxFactory.HeritageClauseSyntax(parseNodeData, extendsOrImplementsKeyword, typeNames); + return new TypeScript.HeritageClauseSyntax(parseNodeData, extendsOrImplementsKeyword, typeNames); } - function isInterfaceEnumClassModuleImportOrExport(modifierCount) { - var _currentToken = currentToken(); + function isInterfaceEnumClassModuleImportOrExport(modifierCount, _currentToken) { if (modifierCount) { switch (peekToken(modifierCount).kind()) { - case 49 /* ImportKeyword */: - case 65 /* ModuleKeyword */: - case 52 /* InterfaceKeyword */: - case 44 /* ClassKeyword */: - case 46 /* EnumKeyword */: + 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 65 /* ModuleKeyword */: - if (isIdentifier(nextToken) || nextToken.kind() === 14 /* StringLiteral */) { - return true; - } - break; - case 49 /* ImportKeyword */: - case 44 /* ClassKeyword */: - case 46 /* EnumKeyword */: - case 52 /* InterfaceKeyword */: - if (isIdentifier(nextToken)) { - return true; - } - break; - case 47 /* ExportKeyword */: - if (nextToken.kind() === 107 /* EqualsToken */) { - return true; - } - break; + 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; } @@ -23639,31 +23898,31 @@ var TypeScript; var _currentToken = currentToken(); var currentTokenKind = _currentToken.kind(); switch (currentTokenKind) { - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 56 /* ProtectedKeyword */: - case 58 /* StaticKeyword */: + 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 28 /* IfKeyword */: - case 70 /* OpenBraceToken */: - case 33 /* ReturnKeyword */: - case 34 /* SwitchKeyword */: - case 36 /* ThrowKeyword */: - case 15 /* BreakKeyword */: - case 18 /* ContinueKeyword */: - case 26 /* ForKeyword */: - case 42 /* WhileKeyword */: - case 43 /* WithKeyword */: - case 22 /* DoKeyword */: - case 38 /* TryKeyword */: - case 19 /* DebuggerKeyword */: + 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)) { + if (isInterfaceEnumClassModuleImportOrExport(modifierCount, _currentToken)) { return false; } return isLabeledStatement(_currentToken) || isVariableStatement(modifierCount) || isFunctionDeclaration(modifierCount) || isEmptyStatement(_currentToken, inErrorRecovery) || isExpressionStatement(_currentToken); @@ -23683,45 +23942,32 @@ var TypeScript; } function tryParseStatementWorker(_currentToken, currentTokenKind, modifierCount, inErrorRecovery) { switch (currentTokenKind) { - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 56 /* ProtectedKeyword */: - case 58 /* StaticKeyword */: + case 59 /* PublicKeyword */: + case 57 /* PrivateKeyword */: + case 58 /* ProtectedKeyword */: + case 60 /* StaticKeyword */: if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(peekToken(1))) { - return null; + return undefined; } else { break; } - case 28 /* IfKeyword */: - return parseIfStatement(_currentToken); - case 70 /* OpenBraceToken */: - return parseBlock(false, false); - case 33 /* ReturnKeyword */: - return parseReturnStatement(_currentToken); - case 34 /* SwitchKeyword */: - return parseSwitchStatement(_currentToken); - case 36 /* ThrowKeyword */: - return parseThrowStatement(_currentToken); - case 15 /* BreakKeyword */: - return parseBreakStatement(_currentToken); - case 18 /* ContinueKeyword */: - return parseContinueStatement(_currentToken); - case 26 /* ForKeyword */: - return parseForOrForInStatement(_currentToken); - case 42 /* WhileKeyword */: - return parseWhileStatement(_currentToken); - case 43 /* WithKeyword */: - return parseWithStatement(_currentToken); - case 22 /* DoKeyword */: - return parseDoStatement(_currentToken); - case 38 /* TryKeyword */: - return parseTryStatement(_currentToken); - case 19 /* DebuggerKeyword */: - return parseDebuggerStatement(_currentToken); + 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)) { - return null; + if (isInterfaceEnumClassModuleImportOrExport(modifierCount, _currentToken)) { + return undefined; } else if (isVariableStatement(modifierCount)) { return parseVariableStatement(); @@ -23739,20 +23985,20 @@ var TypeScript; return parseExpressionStatement(); } else { - return null; + return undefined; } } function parseDebuggerStatement(debuggerKeyword) { - return new Parser.syntaxFactory.DebuggerStatementSyntax(parseNodeData, consumeToken(debuggerKeyword), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.DebuggerStatementSyntax(parseNodeData, consumeToken(debuggerKeyword), eatExplicitOrAutomaticSemicolon(false)); } function parseDoStatement(doKeyword) { - return new Parser.syntaxFactory.DoStatementSyntax(parseNodeData, consumeToken(doKeyword), parseStatement(false), eatToken(42 /* WhileKeyword */), eatToken(72 /* OpenParenToken */), parseExpression(true), eatToken(73 /* CloseParenToken */), eatExplicitOrAutomaticSemicolon(true)); + 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() === 106 /* ColonToken */; + return isIdentifier(currentToken) && peekToken(1).kind() === 108 /* ColonToken */; } function parseLabeledStatement(identifierToken) { - return new Parser.syntaxFactory.LabeledStatementSyntax(parseNodeData, consumeToken(identifierToken), eatToken(106 /* ColonToken */), parseStatement(false)); + return new TypeScript.LabeledStatementSyntax(parseNodeData, consumeToken(identifierToken), eatToken(108 /* ColonToken */), parseStatement(false)); } function parseTryStatement(tryKeyword) { var tryKeyword = consumeToken(tryKeyword); @@ -23760,15 +24006,15 @@ var TypeScript; listParsingState |= (1 << 6 /* TryBlock_Statements */); var block = parseBlock(false, false); listParsingState = savedListParsingState; - var catchClause = null; - if (currentToken().kind() === 17 /* CatchKeyword */) { + var catchClause = undefined; + if (currentToken().kind() === 19 /* CatchKeyword */) { catchClause = parseCatchClause(); } - var finallyClause = null; - if (catchClause === null || currentToken().kind() === 25 /* FinallyKeyword */) { + var finallyClause = undefined; + if (!catchClause || currentToken().kind() === 27 /* FinallyKeyword */) { finallyClause = parseFinallyClause(); } - return new Parser.syntaxFactory.TryStatementSyntax(parseNodeData, tryKeyword, block, catchClause, finallyClause); + return new TypeScript.TryStatementSyntax(parseNodeData, tryKeyword, block, catchClause, finallyClause); } function parseCatchClauseBlock() { var savedListParsingState = listParsingState; @@ -23778,35 +24024,35 @@ var TypeScript; return block; } function parseCatchClause() { - return new Parser.syntaxFactory.CatchClauseSyntax(parseNodeData, eatToken(17 /* CatchKeyword */), eatToken(72 /* OpenParenToken */), eatIdentifierToken(), parseOptionalTypeAnnotation(false), eatToken(73 /* CloseParenToken */), parseCatchClauseBlock()); + return new TypeScript.CatchClauseSyntax(parseNodeData, eatToken(19 /* CatchKeyword */), eatToken(74 /* OpenParenToken */), eatIdentifierToken(), parseOptionalTypeAnnotation(false), eatToken(75 /* CloseParenToken */), parseCatchClauseBlock()); } function parseFinallyClause() { - return new Parser.syntaxFactory.FinallyClauseSyntax(parseNodeData, eatToken(25 /* FinallyKeyword */), parseBlock(false, false)); + return new TypeScript.FinallyClauseSyntax(parseNodeData, eatToken(27 /* FinallyKeyword */), parseBlock(false, false)); } function parseWithStatement(withKeyword) { - return new Parser.syntaxFactory.WithStatementSyntax(parseNodeData, consumeToken(withKeyword), eatToken(72 /* OpenParenToken */), parseExpression(true), eatToken(73 /* CloseParenToken */), parseStatement(false)); + return new TypeScript.WithStatementSyntax(parseNodeData, consumeToken(withKeyword), eatToken(74 /* OpenParenToken */), parseExpression(true), eatToken(75 /* CloseParenToken */), parseStatement(false)); } function parseWhileStatement(whileKeyword) { - return new Parser.syntaxFactory.WhileStatementSyntax(parseNodeData, consumeToken(whileKeyword), eatToken(72 /* OpenParenToken */), parseExpression(true), eatToken(73 /* CloseParenToken */), parseStatement(false)); + 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() === 78 /* SemicolonToken */; + return currentToken.kind() === 80 /* SemicolonToken */; } function parseEmptyStatement(semicolonToken) { - return new Parser.syntaxFactory.EmptyStatementSyntax(parseNodeData, consumeToken(semicolonToken)); + return new TypeScript.EmptyStatementSyntax(parseNodeData, consumeToken(semicolonToken)); } function parseForOrForInStatement(forKeyword) { consumeToken(forKeyword); - var openParenToken = eatToken(72 /* OpenParenToken */); + var openParenToken = eatToken(74 /* OpenParenToken */); var _currentToken = currentToken(); var tokenKind = _currentToken.kind(); - if (tokenKind === 40 /* VarKeyword */) { + if (tokenKind === 42 /* VarKeyword */) { return parseForOrForInStatementWithVariableDeclaration(forKeyword, openParenToken); } - else if (tokenKind === 78 /* SemicolonToken */) { + else if (tokenKind === 80 /* SemicolonToken */) { return parseForStatementWithNoVariableDeclarationOrInitializer(forKeyword, openParenToken); } else { @@ -23815,70 +24061,70 @@ var TypeScript; } function parseForOrForInStatementWithVariableDeclaration(forKeyword, openParenToken) { var variableDeclaration = parseVariableDeclaration(false); - return currentToken().kind() === 29 /* InKeyword */ ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, null) : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, null); + return currentToken().kind() === 31 /* InKeyword */ ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, undefined) : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, undefined); } function parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, initializer) { - return new Parser.syntaxFactory.ForInStatementSyntax(parseNodeData, forKeyword, openParenToken, variableDeclaration, initializer, eatToken(29 /* InKeyword */), parseExpression(true), eatToken(73 /* CloseParenToken */), parseStatement(false)); + 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() === 29 /* InKeyword */ ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, initializer) : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, initializer); + return currentToken().kind() === 31 /* InKeyword */ ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, undefined, initializer) : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, undefined, initializer); } function parseForStatementWithNoVariableDeclarationOrInitializer(forKeyword, openParenToken) { - return parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, null); + return parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, undefined, undefined); } function tryParseForStatementCondition() { var tokenKind = currentToken().kind(); - if (tokenKind !== 78 /* SemicolonToken */ && tokenKind !== 73 /* CloseParenToken */ && tokenKind !== 10 /* EndOfFileToken */) { + if (tokenKind !== 80 /* SemicolonToken */ && tokenKind !== 75 /* CloseParenToken */ && tokenKind !== 8 /* EndOfFileToken */) { return parseExpression(true); } - return null; + return undefined; } function tryParseForStatementIncrementor() { var tokenKind = currentToken().kind(); - if (tokenKind !== 73 /* CloseParenToken */ && tokenKind !== 10 /* EndOfFileToken */) { + if (tokenKind !== 75 /* CloseParenToken */ && tokenKind !== 8 /* EndOfFileToken */) { return parseExpression(true); } - return null; + return undefined; } function parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, initializer) { - return new Parser.syntaxFactory.ForStatementSyntax(parseNodeData, forKeyword, openParenToken, variableDeclaration, initializer, eatToken(78 /* SemicolonToken */), tryParseForStatementCondition(), eatToken(78 /* SemicolonToken */), tryParseForStatementIncrementor(), eatToken(73 /* CloseParenToken */), parseStatement(false)); + 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 = null; + var identifier = undefined; if (!canEatExplicitOrAutomaticSemicolon(false)) { if (isIdentifier(currentToken())) { return eatIdentifierToken(); } } - return null; + return undefined; } function parseBreakStatement(breakKeyword) { - return new Parser.syntaxFactory.BreakStatementSyntax(parseNodeData, consumeToken(breakKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.BreakStatementSyntax(parseNodeData, consumeToken(breakKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(false)); } function parseContinueStatement(continueKeyword) { - return new Parser.syntaxFactory.ContinueStatementSyntax(parseNodeData, consumeToken(continueKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.ContinueStatementSyntax(parseNodeData, consumeToken(continueKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(false)); } function parseSwitchStatement(switchKeyword) { consumeToken(switchKeyword); - var openParenToken = eatToken(72 /* OpenParenToken */); + var openParenToken = eatToken(74 /* OpenParenToken */); var expression = parseExpression(true); - var closeParenToken = eatToken(73 /* CloseParenToken */); - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var switchClauses = TypeScript.Syntax.emptyList(); + 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 Parser.syntaxFactory.SwitchStatementSyntax(parseNodeData, switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, eatToken(71 /* CloseBraceToken */)); + 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 === 16 /* CaseKeyword */ || currentTokenKind === 20 /* DefaultKeyword */; + return currentTokenKind === 18 /* CaseKeyword */ || currentTokenKind === 22 /* DefaultKeyword */; } function tryParseSwitchClause() { var node = currentNode(); @@ -23888,136 +24134,138 @@ var TypeScript; } var _currentToken = currentToken(); var kind = _currentToken.kind(); - if (kind === 16 /* CaseKeyword */) { + if (kind === 18 /* CaseKeyword */) { return parseCaseSwitchClause(_currentToken); } - else if (kind === 20 /* DefaultKeyword */) { + else if (kind === 22 /* DefaultKeyword */) { return parseDefaultSwitchClause(_currentToken); } else { - return null; + return undefined; } } function parseCaseSwitchClause(caseKeyword) { consumeToken(caseKeyword); var expression = parseExpression(true); - var colonToken = eatToken(106 /* ColonToken */); - var statements = TypeScript.Syntax.emptyList(); + 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 Parser.syntaxFactory.CaseSwitchClauseSyntax(parseNodeData, caseKeyword, expression, colonToken, statements); + return new TypeScript.CaseSwitchClauseSyntax(parseNodeData, caseKeyword, expression, colonToken, statements || []); } function parseDefaultSwitchClause(defaultKeyword) { consumeToken(defaultKeyword); - var colonToken = eatToken(106 /* ColonToken */); - var statements = TypeScript.Syntax.emptyList(); + 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 Parser.syntaxFactory.DefaultSwitchClauseSyntax(parseNodeData, defaultKeyword, colonToken, statements); + return new TypeScript.DefaultSwitchClauseSyntax(parseNodeData, defaultKeyword, colonToken, statements || []); } function parseThrowStatementExpression() { - return canEatExplicitOrAutomaticSemicolon(false) ? createMissingToken(11 /* IdentifierName */, null) : parseExpression(true); + return canEatExplicitOrAutomaticSemicolon(false) ? createMissingToken(9 /* IdentifierName */, undefined) : parseExpression(true); } function parseThrowStatement(throwKeyword) { - return new Parser.syntaxFactory.ThrowStatementSyntax(parseNodeData, consumeToken(throwKeyword), parseThrowStatementExpression(), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.ThrowStatementSyntax(parseNodeData, consumeToken(throwKeyword), parseThrowStatementExpression(), eatExplicitOrAutomaticSemicolon(false)); } function tryParseReturnStatementExpression() { - return !canEatExplicitOrAutomaticSemicolon(false) ? parseExpression(true) : null; + return !canEatExplicitOrAutomaticSemicolon(false) ? parseExpression(true) : undefined; } function parseReturnStatement(returnKeyword) { - return new Parser.syntaxFactory.ReturnStatementSyntax(parseNodeData, consumeToken(returnKeyword), tryParseReturnStatementExpression(), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.ReturnStatementSyntax(parseNodeData, consumeToken(returnKeyword), tryParseReturnStatementExpression(), eatExplicitOrAutomaticSemicolon(false)); } function isExpressionStatement(currentToken) { var tokenKind = currentToken.kind(); - return tokenKind !== 70 /* OpenBraceToken */ && tokenKind !== 27 /* FunctionKeyword */ && isExpression(currentToken); + return tokenKind !== 72 /* OpenBraceToken */ && tokenKind !== 29 /* FunctionKeyword */ && isExpression(currentToken); } function isAssignmentOrOmittedExpression() { var _currentToken = currentToken(); - return _currentToken.kind() === 79 /* CommaToken */ || isExpression(_currentToken); + return _currentToken.kind() === 81 /* CommaToken */ || isExpression(_currentToken); } function tryParseAssignmentOrOmittedExpression() { - if (currentToken().kind() === 79 /* CommaToken */) { - return new Parser.syntaxFactory.OmittedExpressionSyntax(parseNodeData); + if (currentToken().kind() === 81 /* CommaToken */) { + return new TypeScript.OmittedExpressionSyntax(parseNodeData); } return tryParseAssignmentExpressionOrHigher(false, true); } function isExpression(currentToken) { switch (currentToken.kind()) { - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: - case 12 /* RegularExpressionLiteral */: - case 74 /* OpenBracketToken */: - case 72 /* OpenParenToken */: - case 80 /* LessThanToken */: - case 93 /* PlusPlusToken */: - case 94 /* MinusMinusToken */: - case 89 /* PlusToken */: - case 90 /* MinusToken */: - case 102 /* TildeToken */: - case 101 /* ExclamationToken */: - case 70 /* OpenBraceToken */: - case 85 /* EqualsGreaterThanToken */: - case 118 /* SlashToken */: - case 119 /* SlashEqualsToken */: - case 50 /* SuperKeyword */: - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 31 /* NewKeyword */: - case 21 /* DeleteKeyword */: - case 41 /* VoidKeyword */: - case 39 /* TypeOfKeyword */: - case 27 /* FunctionKeyword */: + 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 Parser.syntaxFactory.ExpressionStatementSyntax(parseNodeData, parseExpression(true), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.ExpressionStatementSyntax(parseNodeData, parseExpression(true), eatExplicitOrAutomaticSemicolon(false)); } function parseIfStatement(ifKeyword) { - return new Parser.syntaxFactory.IfStatementSyntax(parseNodeData, consumeToken(ifKeyword), eatToken(72 /* OpenParenToken */), parseExpression(true), eatToken(73 /* CloseParenToken */), parseStatement(false), parseOptionalElseClause()); + return new TypeScript.IfStatementSyntax(parseNodeData, consumeToken(ifKeyword), eatToken(74 /* OpenParenToken */), parseExpression(true), eatToken(75 /* CloseParenToken */), parseStatement(false), parseOptionalElseClause()); } function parseOptionalElseClause() { - return currentToken().kind() === 23 /* ElseKeyword */ ? parseElseClause() : null; + return currentToken().kind() === 25 /* ElseKeyword */ ? parseElseClause() : undefined; } function parseElseClause() { - return new Parser.syntaxFactory.ElseClauseSyntax(parseNodeData, eatToken(23 /* ElseKeyword */), parseStatement(false)); + return new TypeScript.ElseClauseSyntax(parseNodeData, eatToken(25 /* ElseKeyword */), parseStatement(false)); } function isVariableStatement(modifierCount) { - return peekToken(modifierCount).kind() === 40 /* VarKeyword */; + return peekToken(modifierCount).kind() === 42 /* VarKeyword */; } function parseVariableStatement() { - return new Parser.syntaxFactory.VariableStatementSyntax(parseNodeData, parseModifiers(), parseVariableDeclaration(true), eatExplicitOrAutomaticSemicolon(false)); + return new TypeScript.VariableStatementSyntax(parseNodeData, parseModifiers(), parseVariableDeclaration(true), eatExplicitOrAutomaticSemicolon(false)); } function parseVariableDeclaration(allowIn) { - var varKeyword = eatToken(40 /* VarKeyword */); + 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 Parser.syntaxFactory.VariableDeclarationSyntax(parseNodeData, varKeyword, variableDeclarators); + return new TypeScript.VariableDeclarationSyntax(parseNodeData, varKeyword, variableDeclarators); } function isVariableDeclarator() { var node = currentNode(); - if (node !== null && node.kind() === 226 /* VariableDeclarator */) { + if (node && node.kind() === 191 /* VariableDeclarator */) { return true; } return isIdentifier(currentToken()); } function canReuseVariableDeclaratorNode(node) { - if (node === null || node.kind() !== 226 /* VariableDeclarator */) { + if (!node || node.kind() !== 191 /* VariableDeclarator */) { return false; } var variableDeclarator = node; - return variableDeclarator.equalsValueClause === null; + return variableDeclarator.equalsValueClause === undefined; } function tryParseVariableDeclarator(allowIn, allowPropertyName) { var node = currentNode(); @@ -24028,30 +24276,30 @@ var TypeScript; if (allowPropertyName) { } if (!allowPropertyName && !isIdentifier(currentToken())) { - return null; + return undefined; } var propertyName = allowPropertyName ? eatPropertyName() : eatIdentifierToken(); - var equalsValueClause = null; - var typeAnnotation = null; + var equalsValueClause = undefined; + var typeAnnotation = undefined; if (propertyName.fullWidth() > 0) { typeAnnotation = parseOptionalTypeAnnotation(false); if (isEqualsValueClause(false)) { equalsValueClause = parseEqualsValueClause(allowIn); } } - return new Parser.syntaxFactory.VariableDeclaratorSyntax(parseNodeData, propertyName, typeAnnotation, equalsValueClause); + return new TypeScript.VariableDeclaratorSyntax(parseNodeData, propertyName, typeAnnotation, equalsValueClause); } function isEqualsValueClause(inParameter) { var token0 = currentToken(); - if (token0.kind() === 107 /* EqualsToken */) { + if (token0.kind() === 109 /* EqualsToken */) { return true; } if (!previousTokenHasTrailingNewLine(token0)) { var tokenKind = token0.kind(); - if (tokenKind === 85 /* EqualsGreaterThanToken */) { + if (tokenKind === 87 /* EqualsGreaterThanToken */) { return false; } - if (tokenKind === 70 /* OpenBraceToken */ && inParameter) { + if (tokenKind === 72 /* OpenBraceToken */ && inParameter) { return false; } return isExpression(token0); @@ -24059,33 +24307,33 @@ var TypeScript; return false; } function parseEqualsValueClause(allowIn) { - return new Parser.syntaxFactory.EqualsValueClauseSyntax(parseNodeData, eatToken(107 /* EqualsToken */), tryParseAssignmentExpressionOrHigher(true, 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() !== 79 /* CommaToken */) { + if (_currentToken.kind() !== 81 /* CommaToken */) { break; } - leftOperand = new Parser.syntaxFactory.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(_currentToken), tryParseAssignmentExpressionOrHigher(true, allowIn)); + 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 !== null) { + if (arrowFunction) { return arrowFunction; } var leftOperand = tryParseBinaryExpressionOrHigher(_currentToken, force, 1 /* Lowest */, allowIn); - if (leftOperand === null) { - return null; + if (leftOperand === undefined) { + return undefined; } if (TypeScript.SyntaxUtilities.isLeftHandSizeExpression(leftOperand)) { var operatorToken = currentOperatorToken(); if (TypeScript.SyntaxFacts.isAssignmentOperatorToken(operatorToken.kind())) { - return new Parser.syntaxFactory.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), tryParseAssignmentExpressionOrHigher(true, allowIn)); + return new TypeScript.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), tryParseAssignmentExpressionOrHigher(true, allowIn)); } } return parseConditionalExpressionRest(allowIn, leftOperand); @@ -24096,68 +24344,64 @@ var TypeScript; function tryParseUnaryExpressionOrHigher(_currentToken, force) { var currentTokenKind = _currentToken.kind(); switch (currentTokenKind) { - case 89 /* PlusToken */: - case 90 /* MinusToken */: - case 102 /* TildeToken */: - case 101 /* ExclamationToken */: - case 93 /* PlusPlusToken */: - case 94 /* MinusMinusToken */: - return new Parser.syntaxFactory.PrefixUnaryExpressionSyntax(parseNodeData, consumeToken(_currentToken), tryParseUnaryExpressionOrHigher(currentToken(), true)); - case 39 /* TypeOfKeyword */: - return parseTypeOfExpression(_currentToken); - case 41 /* VoidKeyword */: - return parseVoidExpression(_currentToken); - case 21 /* DeleteKeyword */: - return parseDeleteExpression(_currentToken); - case 80 /* LessThanToken */: - return parseCastExpression(_currentToken); + 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 === null) { - return null; + if (leftOperand === undefined) { + return undefined; } return parseBinaryExpressionRest(precedence, allowIn, leftOperand); } function parseConditionalExpressionRest(allowIn, leftOperand) { var _currentToken = currentToken(); - if (_currentToken.kind() !== 105 /* QuestionToken */) { + if (_currentToken.kind() !== 107 /* QuestionToken */) { return leftOperand; } - return new Parser.syntaxFactory.ConditionalExpressionSyntax(parseNodeData, leftOperand, consumeToken(_currentToken), tryParseAssignmentExpressionOrHigher(true, true), eatToken(106 /* ColonToken */), tryParseAssignmentExpressionOrHigher(true, allowIn)); + 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 === 79 /* CommaToken */ || TypeScript.SyntaxFacts.isAssignmentOperatorToken(tokenKind)) { + if (!TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken(tokenKind) || tokenKind === 81 /* CommaToken */ || TypeScript.SyntaxFacts.isAssignmentOperatorToken(tokenKind)) { break; } - if (tokenKind === 29 /* InKeyword */ && !allowIn) { + if (tokenKind === 31 /* InKeyword */ && !allowIn) { break; } var newPrecedence = getBinaryExpressionPrecedence(tokenKind); if (newPrecedence <= precedence) { break; } - leftOperand = new Parser.syntaxFactory.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), tryParseBinaryExpressionOrHigher(currentToken(), true, newPrecedence, allowIn)); + leftOperand = new TypeScript.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), tryParseBinaryExpressionOrHigher(currentToken(), true, newPrecedence, allowIn)); } return leftOperand; } function currentOperatorToken() { var token0 = currentToken(); - if (token0.kind() === 81 /* GreaterThanToken */) { + if (token0.kind() === 83 /* GreaterThanToken */) { return currentContextualToken(); } return token0; } function tryParseMemberExpressionOrHigher(_currentToken, force, inObjectCreation) { var expression = tryParsePrimaryExpression(_currentToken, force); - if (expression === null) { - return null; + if (expression === undefined) { + return undefined; } return parseMemberExpressionRest(expression, inObjectCreation); } @@ -24166,21 +24410,25 @@ var TypeScript; var _currentToken = currentToken(); var currentTokenKind = _currentToken.kind(); switch (currentTokenKind) { - case 72 /* OpenParenToken */: - expression = new Parser.syntaxFactory.InvocationExpressionSyntax(parseNodeData, expression, parseArgumentList(null)); + case 74 /* OpenParenToken */: + expression = new TypeScript.InvocationExpressionSyntax(parseNodeData, expression, parseArgumentList(undefined)); continue; - case 80 /* LessThanToken */: + case 82 /* LessThanToken */: var argumentList = tryParseArgumentList(); - if (argumentList === null) { + if (argumentList === undefined) { break; } - expression = new Parser.syntaxFactory.InvocationExpressionSyntax(parseNodeData, expression, argumentList); + expression = new TypeScript.InvocationExpressionSyntax(parseNodeData, expression, argumentList); continue; - case 74 /* OpenBracketToken */: + case 76 /* OpenBracketToken */: expression = parseElementAccessExpression(expression, _currentToken, false); continue; - case 76 /* DotToken */: - expression = new Parser.syntaxFactory.MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); + 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; @@ -24191,25 +24439,29 @@ var TypeScript; var _currentToken = currentToken(); var currentTokenKind = _currentToken.kind(); switch (currentTokenKind) { - case 74 /* OpenBracketToken */: + case 76 /* OpenBracketToken */: expression = parseElementAccessExpression(expression, _currentToken, inObjectCreation); continue; - case 76 /* DotToken */: - expression = new Parser.syntaxFactory.MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); + 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 = null; - if (_currentToken.kind() === 50 /* SuperKeyword */) { + var expression = undefined; + if (_currentToken.kind() === 52 /* SuperKeyword */) { expression = parseSuperExpression(_currentToken); } else { expression = tryParseMemberExpressionOrHigher(_currentToken, force, false); - if (expression === null) { - return null; + if (expression === undefined) { + return undefined; } } return parseCallExpressionRest(expression); @@ -24217,22 +24469,22 @@ var TypeScript; function parseSuperExpression(superToken) { var expression = consumeToken(superToken); var currentTokenKind = currentToken().kind(); - return currentTokenKind === 72 /* OpenParenToken */ || currentTokenKind === 76 /* DotToken */ ? expression : new Parser.syntaxFactory.MemberAccessExpressionSyntax(parseNodeData, expression, eatToken(76 /* DotToken */), eatIdentifierNameToken()); + 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 === null) { - return null; + if (expression === undefined) { + return undefined; } var _currentToken = currentToken(); var currentTokenKind = _currentToken.kind(); switch (currentTokenKind) { - case 93 /* PlusPlusToken */: - case 94 /* MinusMinusToken */: + case 95 /* PlusPlusToken */: + case 96 /* MinusMinusToken */: if (previousTokenHasTrailingNewLine(_currentToken)) { break; } - return new Parser.syntaxFactory.PostfixUnaryExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken)); + return new TypeScript.PostfixUnaryExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken)); } return expression; } @@ -24241,21 +24493,21 @@ var TypeScript; var typeArgumentList = tryParseTypeArgumentList(true); var token0 = currentToken(); var tokenKind = token0.kind(); - var isOpenParen = tokenKind === 72 /* OpenParenToken */; - var isDot = tokenKind === 76 /* DotToken */; + var isOpenParen = tokenKind === 74 /* OpenParenToken */; + var isDot = tokenKind === 78 /* DotToken */; var isOpenParenOrDot = isOpenParen || isDot; - var argumentList = null; - if (typeArgumentList === null || !isOpenParenOrDot) { + var argumentList = undefined; + if (!typeArgumentList || !isOpenParenOrDot) { rewind(rewindPoint); releaseRewindPoint(rewindPoint); - return null; + 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, null); + 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 Parser.syntaxFactory.ArgumentListSyntax(parseNodeData, typeArgumentList, TypeScript.Syntax.emptyToken(72 /* OpenParenToken */), TypeScript.Syntax.emptySeparatedList(), TypeScript.Syntax.emptyToken(73 /* CloseParenToken */)); + return new TypeScript.ArgumentListSyntax(parseNodeData, typeArgumentList, TypeScript.Syntax.emptyToken(74 /* OpenParenToken */), [], TypeScript.Syntax.emptyToken(75 /* CloseParenToken */)); } else { return parseArgumentList(typeArgumentList); @@ -24264,42 +24516,42 @@ var TypeScript; } function tryParseArgumentList() { var tokenKind = currentToken().kind(); - if (tokenKind === 80 /* LessThanToken */) { + if (tokenKind === 82 /* LessThanToken */) { return tryParseGenericArgumentList(); } - if (tokenKind === 72 /* OpenParenToken */) { - return parseArgumentList(null); + if (tokenKind === 74 /* OpenParenToken */) { + return parseArgumentList(undefined); } - return null; + return undefined; } function parseArgumentList(typeArgumentList) { - var openParenToken = eatToken(72 /* OpenParenToken */); - var _arguments = TypeScript.Syntax.emptySeparatedList(); + 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 Parser.syntaxFactory.ArgumentListSyntax(parseNodeData, typeArgumentList, openParenToken, _arguments, eatToken(73 /* CloseParenToken */)); + return new TypeScript.ArgumentListSyntax(parseNodeData, typeArgumentList, openParenToken, _arguments || [], eatToken(75 /* CloseParenToken */)); } function tryParseArgumentListExpression() { - var force = currentToken().kind() === 79 /* CommaToken */; + var force = currentToken().kind() === 81 /* CommaToken */; return tryParseAssignmentExpressionOrHigher(force, true); } function parseElementAccessArgumentExpression(openBracketToken, inObjectCreation) { - if (inObjectCreation && currentToken().kind() === 75 /* CloseBracketToken */) { + 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, null); + 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(11 /* IdentifierName */); + return TypeScript.Syntax.emptyToken(9 /* IdentifierName */); } else { return parseExpression(true); } } function parseElementAccessExpression(expression, openBracketToken, inObjectCreation) { - return new Parser.syntaxFactory.ElementAccessExpressionSyntax(parseNodeData, expression, consumeToken(openBracketToken), parseElementAccessArgumentExpression(openBracketToken, inObjectCreation), eatToken(75 /* CloseBracketToken */)); + return new TypeScript.ElementAccessExpressionSyntax(parseNodeData, expression, consumeToken(openBracketToken), parseElementAccessArgumentExpression(openBracketToken, inObjectCreation), eatToken(77 /* CloseBracketToken */)); } function tryParsePrimaryExpression(_currentToken, force) { if (isIdentifier(_currentToken)) { @@ -24307,41 +24559,39 @@ var TypeScript; } var currentTokenKind = _currentToken.kind(); switch (currentTokenKind) { - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 13 /* NumericLiteral */: - case 12 /* RegularExpressionLiteral */: - case 14 /* StringLiteral */: + 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 27 /* FunctionKeyword */: - return parseFunctionExpression(_currentToken); - case 74 /* OpenBracketToken */: - return parseArrayLiteralExpression(_currentToken); - case 70 /* OpenBraceToken */: - return parseObjectLiteralExpression(_currentToken); - case 72 /* OpenParenToken */: - return parseParenthesizedExpression(_currentToken); - case 31 /* NewKeyword */: - return parseObjectCreationExpression(_currentToken); - case 118 /* SlashToken */: - case 119 /* SlashEqualsToken */: + 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 null; + return undefined; } return eatIdentifierToken(TypeScript.DiagnosticCode.Expression_expected); } function tryReparseDivideAsRegularExpression() { var currentToken = currentContextualToken(); var tokenKind = currentToken.kind(); - if (tokenKind === 118 /* SlashToken */ || tokenKind === 119 /* SlashEqualsToken */) { - return null; + if (tokenKind === 120 /* SlashToken */ || tokenKind === 121 /* SlashEqualsToken */) { + return undefined; } - else if (tokenKind === 12 /* RegularExpressionLiteral */) { + else if (tokenKind === 10 /* RegularExpressionLiteral */) { return consumeToken(currentToken); } else { @@ -24349,40 +24599,66 @@ var TypeScript; } } function parseTypeOfExpression(typeOfKeyword) { - return new Parser.syntaxFactory.TypeOfExpressionSyntax(parseNodeData, consumeToken(typeOfKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); + return new TypeScript.TypeOfExpressionSyntax(parseNodeData, consumeToken(typeOfKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); } function parseDeleteExpression(deleteKeyword) { - return new Parser.syntaxFactory.DeleteExpressionSyntax(parseNodeData, consumeToken(deleteKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); + return new TypeScript.DeleteExpressionSyntax(parseNodeData, consumeToken(deleteKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); } function parseVoidExpression(voidKeyword) { - return new Parser.syntaxFactory.VoidExpressionSyntax(parseNodeData, consumeToken(voidKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); + return new TypeScript.VoidExpressionSyntax(parseNodeData, consumeToken(voidKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); } function parseFunctionExpression(functionKeyword) { - return new Parser.syntaxFactory.FunctionExpressionSyntax(parseNodeData, consumeToken(functionKeyword), eatOptionalIdentifierToken(), parseCallSignature(false), parseBlock(false, true)); + return new TypeScript.FunctionExpressionSyntax(parseNodeData, consumeToken(functionKeyword), eatOptionalIdentifierToken(), parseCallSignature(false), parseBlock(false, true)); } function parseObjectCreationExpression(newKeyword) { - return new Parser.syntaxFactory.ObjectCreationExpressionSyntax(parseNodeData, consumeToken(newKeyword), tryParseMemberExpressionOrHigher(currentToken(), true, true), tryParseArgumentList()); + 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 Parser.syntaxFactory.CastExpressionSyntax(parseNodeData, consumeToken(lessThanToken), parseType(), eatToken(81 /* GreaterThanToken */), tryParseUnaryExpressionOrHigher(currentToken(), true)); + return new TypeScript.CastExpressionSyntax(parseNodeData, consumeToken(lessThanToken), parseType(), eatToken(83 /* GreaterThanToken */), tryParseUnaryExpressionOrHigher(currentToken(), true)); } function parseParenthesizedExpression(openParenToken) { - return new Parser.syntaxFactory.ParenthesizedExpressionSyntax(parseNodeData, consumeToken(openParenToken), parseExpression(true), eatToken(73 /* CloseParenToken */)); + return new TypeScript.ParenthesizedExpressionSyntax(parseNodeData, consumeToken(openParenToken), parseExpression(true), eatToken(75 /* CloseParenToken */)); } function tryParseParenthesizedArrowFunctionExpression() { var tokenKind = currentToken().kind(); - if (tokenKind !== 72 /* OpenParenToken */ && tokenKind !== 80 /* LessThanToken */) { - return null; + if (tokenKind !== 74 /* OpenParenToken */ && tokenKind !== 82 /* LessThanToken */) { + return undefined; } if (isDefinitelyArrowFunctionExpression()) { return tryParseParenthesizedArrowFunctionExpressionWorker(false); } if (!isPossiblyArrowFunctionExpression()) { - return null; + return undefined; } var rewindPoint = getRewindPoint(); var arrowFunction = tryParseParenthesizedArrowFunctionExpressionWorker(true); - if (arrowFunction === null) { + if (arrowFunction === undefined) { rewind(rewindPoint); } releaseRewindPoint(rewindPoint); @@ -24391,16 +24667,16 @@ var TypeScript; function tryParseParenthesizedArrowFunctionExpressionWorker(requireArrow) { var _currentToken = currentToken(); var callSignature = parseCallSignature(true); - if (requireArrow && currentToken().kind() !== 85 /* EqualsGreaterThanToken */) { - return null; + if (requireArrow && currentToken().kind() !== 87 /* EqualsGreaterThanToken */) { + return undefined; } - var equalsGreaterThanToken = eatToken(85 /* EqualsGreaterThanToken */); + var equalsGreaterThanToken = eatToken(87 /* EqualsGreaterThanToken */); var block = tryParseArrowFunctionBlock(); - var expression = null; - if (block === null) { + var expression = undefined; + if (block === undefined) { expression = tryParseAssignmentExpressionOrHigher(true, true); } - return new Parser.syntaxFactory.ParenthesizedArrowFunctionExpressionSyntax(parseNodeData, callSignature, equalsGreaterThanToken, block, expression); + return new TypeScript.ParenthesizedArrowFunctionExpressionSyntax(parseNodeData, callSignature, equalsGreaterThanToken, block, expression); } function tryParseArrowFunctionBlock() { if (isBlock()) { @@ -24412,43 +24688,43 @@ var TypeScript; return parseBlock(true, false); } else { - return null; + return undefined; } } } function isSimpleArrowFunctionExpression(_currentToken) { - if (_currentToken.kind() === 85 /* EqualsGreaterThanToken */) { + if (_currentToken.kind() === 87 /* EqualsGreaterThanToken */) { return true; } - return isIdentifier(_currentToken) && peekToken(1).kind() === 85 /* EqualsGreaterThanToken */; + return isIdentifier(_currentToken) && peekToken(1).kind() === 87 /* EqualsGreaterThanToken */; } function parseSimpleArrowFunctionExpression() { var parameter = eatSimpleParameter(); - var equalsGreaterThanToken = eatToken(85 /* EqualsGreaterThanToken */); + var equalsGreaterThanToken = eatToken(87 /* EqualsGreaterThanToken */); var block = tryParseArrowFunctionBlock(); - var expression = null; - if (block === null) { + var expression = undefined; + if (block === undefined) { expression = tryParseAssignmentExpressionOrHigher(true, true); } - return new Parser.syntaxFactory.SimpleArrowFunctionExpressionSyntax(parseNodeData, parameter, equalsGreaterThanToken, block, expression); + return new TypeScript.SimpleArrowFunctionExpressionSyntax(parseNodeData, parameter, equalsGreaterThanToken, block, expression); } function isBlock() { - return currentToken().kind() === 70 /* OpenBraceToken */; + return currentToken().kind() === 72 /* OpenBraceToken */; } function isDefinitelyArrowFunctionExpression() { var token0 = currentToken(); - if (token0.kind() !== 72 /* OpenParenToken */) { + if (token0.kind() !== 74 /* OpenParenToken */) { return false; } var token1 = peekToken(1); var token1Kind = token1.kind(); var token2; - if (token1Kind === 73 /* CloseParenToken */) { + if (token1Kind === 75 /* CloseParenToken */) { token2 = peekToken(2); var token2Kind = token2.kind(); - return token2Kind === 106 /* ColonToken */ || token2Kind === 85 /* EqualsGreaterThanToken */ || token2Kind === 70 /* OpenBraceToken */; + return token2Kind === 108 /* ColonToken */ || token2Kind === 87 /* EqualsGreaterThanToken */ || token2Kind === 72 /* OpenBraceToken */; } - if (token1Kind === 77 /* DotDotDotToken */) { + if (token1Kind === 79 /* DotDotDotToken */) { return true; } token2 = peekToken(2); @@ -24461,18 +24737,18 @@ var TypeScript; if (!isIdentifier(token1)) { return false; } - if (token2Kind === 106 /* ColonToken */) { + if (token2Kind === 108 /* ColonToken */) { return true; } var token3 = peekToken(3); var token3Kind = token3.kind(); - if (token2Kind === 105 /* QuestionToken */) { - if (token3Kind === 106 /* ColonToken */ || token3Kind === 73 /* CloseParenToken */ || token3Kind === 79 /* CommaToken */) { + if (token2Kind === 107 /* QuestionToken */) { + if (token3Kind === 108 /* ColonToken */ || token3Kind === 75 /* CloseParenToken */ || token3Kind === 81 /* CommaToken */) { return true; } } - if (token2Kind === 73 /* CloseParenToken */) { - if (token3Kind === 85 /* EqualsGreaterThanToken */) { + if (token2Kind === 75 /* CloseParenToken */) { + if (token3Kind === 87 /* EqualsGreaterThanToken */) { return true; } } @@ -24480,7 +24756,7 @@ var TypeScript; } function isPossiblyArrowFunctionExpression() { var token0 = currentToken(); - if (token0.kind() !== 72 /* OpenParenToken */) { + if (token0.kind() !== 74 /* OpenParenToken */) { return true; } var token1 = peekToken(1); @@ -24489,15 +24765,15 @@ var TypeScript; } var token2 = peekToken(2); var token2Kind = token2.kind(); - if (token2Kind === 107 /* EqualsToken */) { + if (token2Kind === 109 /* EqualsToken */) { return true; } - if (token2Kind === 79 /* CommaToken */) { + if (token2Kind === 81 /* CommaToken */) { return true; } - if (token2Kind === 73 /* CloseParenToken */) { + if (token2Kind === 75 /* CloseParenToken */) { var token3 = peekToken(3); - if (token3.kind() === 106 /* ColonToken */) { + if (token3.kind() === 108 /* ColonToken */) { return true; } } @@ -24508,7 +24784,7 @@ var TypeScript; var skippedTokens = getArray(); var propertyAssignments = parseSeparatedSyntaxList(15 /* ObjectLiteralExpression_PropertyAssignments */, skippedTokens); openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - return new Parser.syntaxFactory.ObjectLiteralExpressionSyntax(parseNodeData, openBraceToken, propertyAssignments, eatToken(71 /* CloseBraceToken */)); + return new TypeScript.ObjectLiteralExpressionSyntax(parseNodeData, openBraceToken, propertyAssignments, eatToken(73 /* CloseBraceToken */)); } function tryParsePropertyAssignment(inErrorRecovery) { if (isAccessor(modifierCount(), inErrorRecovery)) { @@ -24521,7 +24797,7 @@ var TypeScript; return parseSimplePropertyAssignment(); } else { - return null; + return undefined; } } function isPropertyAssignment(inErrorRecovery) { @@ -24535,13 +24811,13 @@ var TypeScript; return isPropertyName(currentToken(), inErrorRecovery) && isCallSignature(1); } function parseFunctionPropertyAssignment() { - return new Parser.syntaxFactory.FunctionPropertyAssignmentSyntax(parseNodeData, eatPropertyName(), parseCallSignature(false), parseBlock(false, true)); + return new TypeScript.FunctionPropertyAssignmentSyntax(parseNodeData, eatPropertyName(), parseCallSignature(false), parseBlock(false, true)); } function isSimplePropertyAssignment(inErrorRecovery) { return isPropertyName(currentToken(), inErrorRecovery); } function parseSimplePropertyAssignment() { - return new Parser.syntaxFactory.SimplePropertyAssignmentSyntax(parseNodeData, eatPropertyName(), eatToken(106 /* ColonToken */), tryParseAssignmentExpressionOrHigher(true, true)); + return new TypeScript.SimplePropertyAssignmentSyntax(parseNodeData, eatPropertyName(), eatToken(108 /* ColonToken */), tryParseAssignmentExpressionOrHigher(true, true)); } function isPropertyName(token, inErrorRecovery) { if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token)) { @@ -24553,50 +24829,50 @@ var TypeScript; } } var kind = token.kind(); - return kind === 14 /* StringLiteral */ || kind === 13 /* NumericLiteral */; + 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 Parser.syntaxFactory.ArrayLiteralExpressionSyntax(parseNodeData, openBracketToken, expressions, eatToken(75 /* CloseBracketToken */)); + return new TypeScript.ArrayLiteralExpressionSyntax(parseNodeData, openBracketToken, expressions, eatToken(77 /* CloseBracketToken */)); } function parseBlock(parseBlockEvenWithNoOpenBrace, checkForStrictMode) { - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var statements = TypeScript.Syntax.emptyList(); + var openBraceToken = eatToken(72 /* OpenBraceToken */); + var statements; if (parseBlockEvenWithNoOpenBrace || openBraceToken.fullWidth() > 0) { var savedIsInStrictMode = isInStrictMode; - var processItems = checkForStrictMode ? updateStrictModeState : null; + var processItems = checkForStrictMode ? updateStrictModeState : undefined; var skippedTokens = getArray(); var statements = parseSyntaxList(5 /* Block_Statements */, skippedTokens, processItems); openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); setStrictMode(savedIsInStrictMode); } - return new Parser.syntaxFactory.BlockSyntax(parseNodeData, openBraceToken, statements, eatToken(71 /* CloseBraceToken */)); + return new TypeScript.BlockSyntax(parseNodeData, openBraceToken, statements || [], eatToken(73 /* CloseBraceToken */)); } function parseCallSignature(requireCompleteTypeParameterList) { - return new Parser.syntaxFactory.CallSignatureSyntax(parseNodeData, tryParseTypeParameterList(requireCompleteTypeParameterList), parseParameterList(), parseOptionalTypeAnnotation(false)); + return new TypeScript.CallSignatureSyntax(parseNodeData, tryParseTypeParameterList(requireCompleteTypeParameterList), parseParameterList(), parseOptionalTypeAnnotation(false)); } function tryParseTypeParameterList(requireCompleteTypeParameterList) { var _currentToken = currentToken(); - if (_currentToken.kind() !== 80 /* LessThanToken */) { - return null; + 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(81 /* GreaterThanToken */); + var greaterThanToken = eatToken(83 /* GreaterThanToken */); if (requireCompleteTypeParameterList && greaterThanToken.fullWidth() === 0) { rewind(rewindPoint); releaseRewindPoint(rewindPoint); - return null; + return undefined; } else { releaseRewindPoint(rewindPoint); - return new Parser.syntaxFactory.TypeParameterListSyntax(parseNodeData, lessThanToken, typeParameters, greaterThanToken); + return new TypeScript.TypeParameterListSyntax(parseNodeData, lessThanToken, typeParameters, greaterThanToken); } } function isTypeParameter() { @@ -24604,63 +24880,63 @@ var TypeScript; } function tryParseTypeParameter() { if (!isIdentifier(currentToken())) { - return null; + return undefined; } - return new Parser.syntaxFactory.TypeParameterSyntax(parseNodeData, eatIdentifierToken(), tryParseConstraint()); + return new TypeScript.TypeParameterSyntax(parseNodeData, eatIdentifierToken(), tryParseConstraint()); } function tryParseConstraint() { - if (currentToken().kind() !== 48 /* ExtendsKeyword */) { - return null; + if (currentToken().kind() !== 50 /* ExtendsKeyword */) { + return undefined; } - return new Parser.syntaxFactory.ConstraintSyntax(parseNodeData, eatToken(48 /* ExtendsKeyword */), parseTypeOrExpression()); + return new TypeScript.ConstraintSyntax(parseNodeData, eatToken(50 /* ExtendsKeyword */), parseTypeOrExpression()); } function tryParseParameterList() { - if (currentToken().kind() === 72 /* OpenParenToken */) { + if (currentToken().kind() === 74 /* OpenParenToken */) { var token1 = peekToken(1); - if (token1.kind() === 73 /* CloseParenToken */ || isParameterHelper(token1)) { + if (token1.kind() === 75 /* CloseParenToken */ || isParameterHelper(token1)) { return parseParameterList(); } } - return null; + return undefined; } function parseParameterList() { - var openParenToken = eatToken(72 /* OpenParenToken */); - var parameters = TypeScript.Syntax.emptySeparatedList(); + 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 Parser.syntaxFactory.ParameterListSyntax(parseNodeData, openParenToken, parameters, eatToken(73 /* CloseParenToken */)); + return new TypeScript.ParameterListSyntax(parseNodeData, openParenToken, parameters || [], eatToken(75 /* CloseParenToken */)); } function parseOptionalTypeAnnotation(allowStringLiteral) { - return currentToken().kind() === 106 /* ColonToken */ ? parseTypeAnnotation(allowStringLiteral) : null; + return currentToken().kind() === 108 /* ColonToken */ ? parseTypeAnnotation(allowStringLiteral) : undefined; } function parseTypeAnnotationType(allowStringLiteral) { if (allowStringLiteral) { var _currentToken = currentToken(); - if (_currentToken.kind() === 14 /* StringLiteral */) { + if (_currentToken.kind() === 12 /* StringLiteral */) { return consumeToken(_currentToken); } } return parseType(); } function parseTypeAnnotation(allowStringLiteral) { - return new Parser.syntaxFactory.TypeAnnotationSyntax(parseNodeData, consumeToken(currentToken()), parseTypeAnnotationType(allowStringLiteral)); + return new TypeScript.TypeAnnotationSyntax(parseNodeData, consumeToken(currentToken()), parseTypeAnnotationType(allowStringLiteral)); } function isType() { var _currentToken = currentToken(); switch (_currentToken.kind()) { - case 39 /* TypeOfKeyword */: - case 60 /* AnyKeyword */: - case 67 /* NumberKeyword */: - case 61 /* BooleanKeyword */: - case 69 /* StringKeyword */: - case 41 /* VoidKeyword */: - case 70 /* OpenBraceToken */: - case 72 /* OpenParenToken */: - case 80 /* LessThanToken */: - case 31 /* NewKeyword */: + 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); @@ -24681,115 +24957,149 @@ var TypeScript; 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() !== 74 /* OpenBracketToken */) { + if (previousTokenHasTrailingNewLine(_currentToken) || _currentToken.kind() !== 76 /* OpenBracketToken */) { break; } - type = new Parser.syntaxFactory.ArrayTypeSyntax(parseNodeData, type, consumeToken(_currentToken), eatToken(75 /* CloseBracketToken */)); + type = new TypeScript.ArrayTypeSyntax(parseNodeData, type, consumeToken(_currentToken), eatToken(77 /* CloseBracketToken */)); } return type; } function parseTypeQuery(typeOfKeyword) { - return new Parser.syntaxFactory.TypeQuerySyntax(parseNodeData, consumeToken(typeOfKeyword), parseName(true)); + return new TypeScript.TypeQuerySyntax(parseNodeData, consumeToken(typeOfKeyword), parseName(true)); } function tryParseNonArrayType() { var _currentToken = currentToken(); switch (_currentToken.kind()) { - case 60 /* AnyKeyword */: - case 67 /* NumberKeyword */: - case 61 /* BooleanKeyword */: - case 69 /* StringKeyword */: - if (peekToken(1).kind() === 76 /* DotToken */) { + case 62 /* AnyKeyword */: + case 69 /* NumberKeyword */: + case 63 /* BooleanKeyword */: + case 71 /* StringKeyword */: + if (peekToken(1).kind() === 78 /* DotToken */) { break; } return consumeToken(_currentToken); - case 72 /* OpenParenToken */: - case 80 /* LessThanToken */: - return tryParseFunctionType(); - case 41 /* VoidKeyword */: - return consumeToken(_currentToken); - case 70 /* OpenBraceToken */: - return parseObjectType(); - case 31 /* NewKeyword */: - return parseConstructorType(); - case 39 /* TypeOfKeyword */: - return parseTypeQuery(_currentToken); - case 74 /* OpenBracketToken */: - return parseTupleType(_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 === null) { - return null; + if (name === undefined) { + return undefined; } if (previousTokenHasTrailingNewLine(currentToken())) { return name; } var typeArgumentList = tryParseTypeArgumentList(false); - return typeArgumentList === null ? name : new Parser.syntaxFactory.GenericTypeSyntax(parseNodeData, name, typeArgumentList); + return !typeArgumentList ? name : new TypeScript.GenericTypeSyntax(parseNodeData, name, typeArgumentList); } - function tryParseFunctionType() { - var typeParameterList = tryParseTypeParameterList(false); - var parameterList = null; - if (typeParameterList === null) { - parameterList = tryParseParameterList(); - if (parameterList === null) { - return null; + 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 */; + } } } - else { - parameterList = parseParameterList(); - } - return new Parser.syntaxFactory.FunctionTypeSyntax(parseNodeData, typeParameterList, parameterList, eatToken(85 /* EqualsGreaterThanToken */), parseType()); + 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 Parser.syntaxFactory.ConstructorTypeSyntax(parseNodeData, eatToken(31 /* NewKeyword */), tryParseTypeParameterList(false), parseParameterList(), eatToken(85 /* EqualsGreaterThanToken */), parseType()); + return new TypeScript.ConstructorTypeSyntax(parseNodeData, eatToken(33 /* NewKeyword */), tryParseTypeParameterList(false), parseParameterList(), eatToken(87 /* EqualsGreaterThanToken */), parseType()); } function isParameter() { - if (currentNode() !== null && currentNode().kind() === 243 /* Parameter */) { + if (currentNode() && currentNode().kind() === 208 /* Parameter */) { return true; } return isParameterHelper(currentToken()); } function isParameterHelper(token) { var tokenKind = token.kind(); - return tokenKind === 77 /* DotDotDotToken */ || isModifierKind(tokenKind) || isIdentifier(token); + return tokenKind === 79 /* DotDotDotToken */ || isModifierKind(tokenKind) || isIdentifier(token); } function eatSimpleParameter() { - return new Parser.syntaxFactory.ParameterSyntax(parseNodeData, null, TypeScript.Syntax.emptyList(), eatIdentifierToken(), null, null, null); + return new TypeScript.ParameterSyntax(parseNodeData, undefined, [], eatIdentifierToken(), undefined, undefined, undefined); } function tryParseParameter() { var node = currentNode(); - if (node !== null && node.kind() === 243 /* Parameter */) { + if (node && node.kind() === 208 /* Parameter */) { consumeNode(node); return node; } - var dotDotDotToken = tryEatToken(77 /* DotDotDotToken */); + var dotDotDotToken = tryEatToken(79 /* DotDotDotToken */); var modifiers = parseModifiers(); var _currentToken = currentToken(); - if (!isIdentifier(_currentToken) && dotDotDotToken === null && modifiers.length === 0) { + if (!isIdentifier(_currentToken) && !dotDotDotToken && modifiers.length === 0) { if (isModifierKind(_currentToken.kind())) { modifiers = TypeScript.Syntax.list([consumeToken(_currentToken)]); } else { - return null; + return undefined; } } var identifier = eatIdentifierToken(); - var questionToken = tryEatToken(105 /* QuestionToken */); + var questionToken = tryEatToken(107 /* QuestionToken */); var typeAnnotation = parseOptionalTypeAnnotation(true); - var equalsValueClause = null; + var equalsValueClause = undefined; if (isEqualsValueClause(true)) { equalsValueClause = parseEqualsValueClause(true); } - return new Parser.syntaxFactory.ParameterSyntax(parseNodeData, dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause); + return new TypeScript.ParameterSyntax(parseNodeData, dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause); } function parseSyntaxList(currentListType, skippedTokens, processItems) { - if (processItems === void 0) { processItems = null; } var savedListParsingState = listParsingState; listParsingState |= (1 << currentListType); var result = parseSyntaxListWorker(currentListType, skippedTokens, processItems); @@ -24803,7 +25113,7 @@ var TypeScript; listParsingState = savedListParsingState; return result; } - function abortParsingListOrMoveToNextToken(currentListType, nodes, separators, skippedTokens) { + function abortParsingListOrMoveToNextToken(currentListType, nodeAndSeparators, skippedTokens) { reportUnexpectedTokenDiagnostic(currentListType); for (var state = ListParsingState.LastListParsingState; state >= ListParsingState.FirstListParsingState; state--) { if ((listParsingState & (1 << state)) !== 0) { @@ -24812,70 +25122,63 @@ var TypeScript; } } } - addSkippedTokenToList(nodes, separators, skippedTokens, consumeToken(currentToken())); + addSkippedTokenToList(nodeAndSeparators, skippedTokens, consumeToken(currentToken())); return false; } - function addSkippedTokenToList(nodes, separators, skippedTokens, skippedToken) { - if (Parser.syntaxFactory.isConcrete) { - var length = nodes.length + (separators ? separators.length : 0); - for (var i = length - 1; i >= 0; i--) { - var array = separators && (i % 2 === 1) ? separators : nodes; - var arrayIndex = separators ? TypeScript.IntegerUtilities.integerDivide(i, 2) : i; - var item = array[arrayIndex]; - var _lastToken = TypeScript.lastToken(item); - if (_lastToken && _lastToken.fullWidth() > 0) { - array[arrayIndex] = addSkippedTokenAfterNodeOrToken(item, skippedToken); - return; - } + 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); } + skippedTokens.push(skippedToken); } function tryParseExpectedListItem(currentListType, inErrorRecovery, items, processItems) { var item = tryParseExpectedListItemWorker(currentListType, inErrorRecovery); - if (item === null) { + if (item === undefined) { return false; } items.push(item); - if (processItems !== null) { + if (processItems) { processItems(items); } return true; } function listIsTerminated(currentListType) { - return isExpectedListTerminator(currentListType) || currentToken().kind() === 10 /* EndOfFileToken */; + return isExpectedListTerminator(currentListType) || currentToken().kind() === 8 /* EndOfFileToken */; } function parseSyntaxListWorker(currentListType, skippedTokens, processItems) { - var items = getArray(); + var items = []; while (true) { var succeeded = tryParseExpectedListItem(currentListType, false, items, processItems); if (!succeeded) { if (listIsTerminated(currentListType)) { break; } - var abort = abortParsingListOrMoveToNextToken(currentListType, items, null, skippedTokens); + var abort = abortParsingListOrMoveToNextToken(currentListType, items, skippedTokens); if (abort) { break; } } } - var result = TypeScript.Syntax.list(items); - returnZeroLengthArray(items); - return result; + return TypeScript.Syntax.list(items); } function parseSeparatedSyntaxListWorker(currentListType, skippedTokens) { - var nodes = getArray(); - var separators = getArray(); - var _separatorKind = currentListType === 9 /* ObjectType_TypeMembers */ ? 78 /* SemicolonToken */ : 79 /* CommaToken */; - var allowAutomaticSemicolonInsertion = _separatorKind === 78 /* SemicolonToken */; + 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, nodes, null); + var succeeded = tryParseExpectedListItem(currentListType, inErrorRecovery, nodesAndSeparators, undefined); if (!succeeded) { if (listIsTerminated(currentListType)) { break; } - var abort = abortParsingListOrMoveToNextToken(currentListType, nodes, separators, skippedTokens); + var abort = abortParsingListOrMoveToNextToken(currentListType, nodesAndSeparators, skippedTokens); if (abort) { break; } @@ -24887,25 +25190,22 @@ var TypeScript; inErrorRecovery = false; var _currentToken = currentToken(); var tokenKind = _currentToken.kind(); - if (tokenKind === _separatorKind || tokenKind === 79 /* CommaToken */) { - separators.push(consumeToken(_currentToken)); + 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(78 /* SemicolonToken */); - separators.push(semicolonToken); + var semicolonToken = eatExplicitOrAutomaticSemicolon(false) || TypeScript.Syntax.emptyToken(80 /* SemicolonToken */); + nodesAndSeparators.push(semicolonToken); continue; } - separators.push(eatToken(_separatorKind)); + nodesAndSeparators.push(eatToken(_separatorKind)); inErrorRecovery = true; } - var result = TypeScript.Syntax.separatedList(nodes, separators); - returnZeroLengthArray(nodes); - returnZeroLengthArray(separators); - return result; + return TypeScript.Syntax.separatedList(nodesAndSeparators); } function reportUnexpectedTokenDiagnostic(listType) { var token = currentToken(); @@ -24920,76 +25220,54 @@ var TypeScript; } 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(); + 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() === 10 /* EndOfFileToken */; + return currentToken().kind() === 8 /* EndOfFileToken */; } function isExpectedEnumDeclaration_EnumElementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; + return currentToken().kind() === 73 /* CloseBraceToken */; } function isExpectedModuleDeclaration_ModuleElementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; + return currentToken().kind() === 73 /* CloseBraceToken */; } function isExpectedObjectType_TypeMembersTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; + return currentToken().kind() === 73 /* CloseBraceToken */; } function isExpectedObjectLiteralExpression_PropertyAssignmentsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; + return currentToken().kind() === 73 /* CloseBraceToken */; } function isExpectedLiteralExpression_AssignmentExpressionsTerminator() { - return currentToken().kind() === 75 /* CloseBracketToken */; + return currentToken().kind() === 77 /* CloseBracketToken */; } function isExpectedTypeArgumentList_TypesTerminator() { var token = currentToken(); var tokenKind = token.kind(); - if (tokenKind === 81 /* GreaterThanToken */) { + if (tokenKind === 83 /* GreaterThanToken */) { return true; } if (canFollowTypeArgumentListInExpression(tokenKind)) { @@ -25000,70 +25278,70 @@ var TypeScript; function isExpectedTupleType_TypesTerminator() { var token = currentToken(); var tokenKind = token.kind(); - if (tokenKind === 75 /* CloseBracketToken */) { + if (tokenKind === 77 /* CloseBracketToken */) { return true; } return false; } function isExpectedTypeParameterList_TypeParametersTerminator() { var tokenKind = currentToken().kind(); - if (tokenKind === 81 /* GreaterThanToken */) { + if (tokenKind === 83 /* GreaterThanToken */) { return true; } - if (tokenKind === 72 /* OpenParenToken */ || tokenKind === 70 /* OpenBraceToken */ || tokenKind === 48 /* ExtendsKeyword */ || tokenKind === 51 /* ImplementsKeyword */) { + 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 === 73 /* CloseParenToken */) { + if (tokenKind === 75 /* CloseParenToken */) { return true; } - if (tokenKind === 70 /* OpenBraceToken */) { + if (tokenKind === 72 /* OpenBraceToken */) { return true; } - if (tokenKind === 85 /* EqualsGreaterThanToken */) { + if (tokenKind === 87 /* EqualsGreaterThanToken */) { return true; } return false; } function isExpectedIndexSignature_ParametersTerminator() { var tokenKind = currentToken().kind(); - if (tokenKind === 75 /* CloseBracketToken */) { + if (tokenKind === 77 /* CloseBracketToken */) { return true; } - if (tokenKind === 70 /* OpenBraceToken */) { + if (tokenKind === 72 /* OpenBraceToken */) { return true; } return false; } function isExpectedVariableDeclaration_VariableDeclarators_DisallowInTerminator() { var tokenKind = currentToken().kind(); - if (tokenKind === 78 /* SemicolonToken */ || tokenKind === 73 /* CloseParenToken */) { + if (tokenKind === 80 /* SemicolonToken */ || tokenKind === 75 /* CloseParenToken */) { return true; } - if (tokenKind === 29 /* InKeyword */) { + if (tokenKind === 31 /* InKeyword */) { return true; } return false; } function isExpectedVariableDeclaration_VariableDeclarators_AllowInTerminator() { - if (currentToken().kind() === 85 /* EqualsGreaterThanToken */) { + if (currentToken().kind() === 87 /* EqualsGreaterThanToken */) { return true; } return canEatExplicitOrAutomaticSemicolon(false); } function isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator() { var tokenKind = currentToken().kind(); - if (tokenKind === 70 /* OpenBraceToken */ || tokenKind === 71 /* CloseBraceToken */) { + if (tokenKind === 72 /* OpenBraceToken */ || tokenKind === 73 /* CloseBraceToken */) { return true; } return false; } function isExpectedHeritageClause_TypeNameListTerminator() { var tokenKind = currentToken().kind(); - if (tokenKind === 48 /* ExtendsKeyword */ || tokenKind === 51 /* ImplementsKeyword */) { + if (tokenKind === 50 /* ExtendsKeyword */ || tokenKind === 53 /* ImplementsKeyword */) { return true; } if (isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator()) { @@ -25074,75 +25352,52 @@ var TypeScript; function isExpectedArgumentList_AssignmentExpressionsTerminator() { var token0 = currentToken(); var tokenKind = token0.kind(); - return tokenKind === 73 /* CloseParenToken */ || tokenKind === 78 /* SemicolonToken */; + return tokenKind === 75 /* CloseParenToken */ || tokenKind === 80 /* SemicolonToken */; } function isExpectedClassDeclaration_ClassElementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; + return currentToken().kind() === 73 /* CloseBraceToken */; } function isExpectedSwitchStatement_SwitchClausesTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; + return currentToken().kind() === 73 /* CloseBraceToken */; } function isExpectedSwitchClause_StatementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */ || isSwitchClause(); + return currentToken().kind() === 73 /* CloseBraceToken */ || isSwitchClause(); } function isExpectedBlock_StatementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; + return currentToken().kind() === 73 /* CloseBraceToken */; } function isExpectedTryBlock_StatementsTerminator() { var tokenKind = currentToken().kind(); - return tokenKind === 17 /* CatchKeyword */ || tokenKind === 25 /* FinallyKeyword */; + return tokenKind === 19 /* CatchKeyword */ || tokenKind === 27 /* FinallyKeyword */; } function isExpectedCatchBlock_StatementsTerminator() { - return currentToken().kind() === 25 /* FinallyKeyword */; + 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(); + 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() { @@ -25150,105 +25405,61 @@ var TypeScript; if (isExpression(_currentToken)) { return true; } - if (_currentToken.kind() === 79 /* CommaToken */) { + 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(); + 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, null); - case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return '{'; - case 1 /* ClassDeclaration_ClassElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.constructor_function_accessor_or_variable, null); - case 2 /* ModuleDeclaration_ModuleElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.module_class_interface_enum_import_or_statement, null); - case 3 /* SwitchStatement_SwitchClauses */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.case_or_default_clause, null); - case 4 /* SwitchClause_Statements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.statement, null); - case 5 /* Block_Statements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.statement, null); - case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null); - case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null); - case 8 /* EnumDeclaration_EnumElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null); - case 9 /* ObjectType_TypeMembers */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.call_construct_index_property_or_function_signature, null); - case 14 /* ArgumentList_AssignmentExpressions */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.expression, null); - case 11 /* HeritageClause_TypeNameList */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_name, null); - case 15 /* ObjectLiteralExpression_PropertyAssignments */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.property_or_accessor, null); - case 17 /* ParameterList_Parameters */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.parameter, null); - case 18 /* IndexSignature_Parameters */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.parameter, null); - case 19 /* TypeArgumentList_Types */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type, null); - case 20 /* TypeParameterList_TypeParameters */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_parameter, null); - case 21 /* TupleType_Types */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type, null); - case 16 /* ArrayLiteralExpression_AssignmentExpressions */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.expression, null); - default: - throw TypeScript.Errors.invalidOperation(); + 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; @@ -25307,810 +25518,922 @@ var TypeScript; })(TypeScript || (TypeScript = {})); var TypeScript; (function (TypeScript) { - var Syntax; - (function (Syntax) { - var Concrete; - (function (Concrete) { - TypeScript.Parser.syntaxFactory = Concrete; - Concrete.isConcrete = true; - var SourceUnitSyntax = (function (_super) { - __extends(SourceUnitSyntax, _super); - function SourceUnitSyntax(data, moduleElements, endOfFileToken) { - _super.call(this, data); - this.syntaxTree = null; - this.parent = null, this.moduleElements = moduleElements, this.endOfFileToken = endOfFileToken, !TypeScript.isShared(moduleElements) && (moduleElements.parent = this), endOfFileToken.parent = this; - } - return SourceUnitSyntax; - })(TypeScript.SyntaxNode); - Concrete.SourceUnitSyntax = SourceUnitSyntax; - var QualifiedNameSyntax = (function (_super) { - __extends(QualifiedNameSyntax, _super); - function QualifiedNameSyntax(data, left, dotToken, right) { - _super.call(this, data); - this.left = left, this.dotToken = dotToken, this.right = right, left.parent = this, dotToken.parent = this, right.parent = this; - } - return QualifiedNameSyntax; - })(TypeScript.SyntaxNode); - Concrete.QualifiedNameSyntax = QualifiedNameSyntax; - var ObjectTypeSyntax = (function (_super) { - __extends(ObjectTypeSyntax, _super); - function ObjectTypeSyntax(data, openBraceToken, typeMembers, closeBraceToken) { - _super.call(this, data); - this.openBraceToken = openBraceToken, this.typeMembers = typeMembers, this.closeBraceToken = closeBraceToken, openBraceToken.parent = this, !TypeScript.isShared(typeMembers) && (typeMembers.parent = this), closeBraceToken.parent = this; - } - return ObjectTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.ObjectTypeSyntax = ObjectTypeSyntax; - var FunctionTypeSyntax = (function (_super) { - __extends(FunctionTypeSyntax, _super); - function FunctionTypeSyntax(data, typeParameterList, parameterList, equalsGreaterThanToken, type) { - _super.call(this, 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; - } - return FunctionTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.FunctionTypeSyntax = FunctionTypeSyntax; - var ArrayTypeSyntax = (function (_super) { - __extends(ArrayTypeSyntax, _super); - function ArrayTypeSyntax(data, type, openBracketToken, closeBracketToken) { - _super.call(this, data); - this.type = type, this.openBracketToken = openBracketToken, this.closeBracketToken = closeBracketToken, type.parent = this, openBracketToken.parent = this, closeBracketToken.parent = this; - } - return ArrayTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.ArrayTypeSyntax = ArrayTypeSyntax; - var ConstructorTypeSyntax = (function (_super) { - __extends(ConstructorTypeSyntax, _super); - function ConstructorTypeSyntax(data, newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type) { - _super.call(this, 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; - } - return ConstructorTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConstructorTypeSyntax = ConstructorTypeSyntax; - var GenericTypeSyntax = (function (_super) { - __extends(GenericTypeSyntax, _super); - function GenericTypeSyntax(data, name, typeArgumentList) { - _super.call(this, data); - this.name = name, this.typeArgumentList = typeArgumentList, name.parent = this, typeArgumentList.parent = this; - } - return GenericTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.GenericTypeSyntax = GenericTypeSyntax; - var TypeQuerySyntax = (function (_super) { - __extends(TypeQuerySyntax, _super); - function TypeQuerySyntax(data, typeOfKeyword, name) { - _super.call(this, data); - this.typeOfKeyword = typeOfKeyword, this.name = name, typeOfKeyword.parent = this, name.parent = this; - } - return TypeQuerySyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeQuerySyntax = TypeQuerySyntax; - var TupleTypeSyntax = (function (_super) { - __extends(TupleTypeSyntax, _super); - function TupleTypeSyntax(data, openBracketToken, types, closeBracketToken) { - _super.call(this, data); - this.openBracketToken = openBracketToken, this.types = types, this.closeBracketToken = closeBracketToken, openBracketToken.parent = this, !TypeScript.isShared(types) && (types.parent = this), closeBracketToken.parent = this; - } - return TupleTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.TupleTypeSyntax = TupleTypeSyntax; - var InterfaceDeclarationSyntax = (function (_super) { - __extends(InterfaceDeclarationSyntax, _super); - function InterfaceDeclarationSyntax(data, modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body) { - _super.call(this, data); - this.modifiers = modifiers, this.interfaceKeyword = interfaceKeyword, this.identifier = identifier, this.typeParameterList = typeParameterList, this.heritageClauses = heritageClauses, this.body = body, !TypeScript.isShared(modifiers) && (modifiers.parent = this), interfaceKeyword.parent = this, identifier.parent = this, typeParameterList && (typeParameterList.parent = this), !TypeScript.isShared(heritageClauses) && (heritageClauses.parent = this), body.parent = this; - } - return InterfaceDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.InterfaceDeclarationSyntax = InterfaceDeclarationSyntax; - var FunctionDeclarationSyntax = (function (_super) { - __extends(FunctionDeclarationSyntax, _super); - function FunctionDeclarationSyntax(data, modifiers, functionKeyword, identifier, callSignature, block, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.functionKeyword = functionKeyword, this.identifier = identifier, this.callSignature = callSignature, this.block = block, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), functionKeyword.parent = this, identifier.parent = this, callSignature.parent = this, block && (block.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return FunctionDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.FunctionDeclarationSyntax = FunctionDeclarationSyntax; - var ModuleDeclarationSyntax = (function (_super) { - __extends(ModuleDeclarationSyntax, _super); - function ModuleDeclarationSyntax(data, modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken) { - _super.call(this, data); - this.modifiers = modifiers, this.moduleKeyword = moduleKeyword, this.name = name, this.stringLiteral = stringLiteral, this.openBraceToken = openBraceToken, this.moduleElements = moduleElements, this.closeBraceToken = closeBraceToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), moduleKeyword.parent = this, name && (name.parent = this), stringLiteral && (stringLiteral.parent = this), openBraceToken.parent = this, !TypeScript.isShared(moduleElements) && (moduleElements.parent = this), closeBraceToken.parent = this; - } - return ModuleDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.ModuleDeclarationSyntax = ModuleDeclarationSyntax; - var ClassDeclarationSyntax = (function (_super) { - __extends(ClassDeclarationSyntax, _super); - function ClassDeclarationSyntax(data, modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken) { - _super.call(this, 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, !TypeScript.isShared(modifiers) && (modifiers.parent = this), classKeyword.parent = this, identifier.parent = this, typeParameterList && (typeParameterList.parent = this), !TypeScript.isShared(heritageClauses) && (heritageClauses.parent = this), openBraceToken.parent = this, !TypeScript.isShared(classElements) && (classElements.parent = this), closeBraceToken.parent = this; - } - return ClassDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.ClassDeclarationSyntax = ClassDeclarationSyntax; - var EnumDeclarationSyntax = (function (_super) { - __extends(EnumDeclarationSyntax, _super); - function EnumDeclarationSyntax(data, modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken) { - _super.call(this, data); - this.modifiers = modifiers, this.enumKeyword = enumKeyword, this.identifier = identifier, this.openBraceToken = openBraceToken, this.enumElements = enumElements, this.closeBraceToken = closeBraceToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), enumKeyword.parent = this, identifier.parent = this, openBraceToken.parent = this, !TypeScript.isShared(enumElements) && (enumElements.parent = this), closeBraceToken.parent = this; - } - return EnumDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.EnumDeclarationSyntax = EnumDeclarationSyntax; - var ImportDeclarationSyntax = (function (_super) { - __extends(ImportDeclarationSyntax, _super); - function ImportDeclarationSyntax(data, modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.importKeyword = importKeyword, this.identifier = identifier, this.equalsToken = equalsToken, this.moduleReference = moduleReference, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), importKeyword.parent = this, identifier.parent = this, equalsToken.parent = this, moduleReference.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return ImportDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.ImportDeclarationSyntax = ImportDeclarationSyntax; - var ExportAssignmentSyntax = (function (_super) { - __extends(ExportAssignmentSyntax, _super); - function ExportAssignmentSyntax(data, exportKeyword, equalsToken, identifier, semicolonToken) { - _super.call(this, 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); - } - return ExportAssignmentSyntax; - })(TypeScript.SyntaxNode); - Concrete.ExportAssignmentSyntax = ExportAssignmentSyntax; - var MemberFunctionDeclarationSyntax = (function (_super) { - __extends(MemberFunctionDeclarationSyntax, _super); - function MemberFunctionDeclarationSyntax(data, modifiers, propertyName, callSignature, block, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.propertyName = propertyName, this.callSignature = callSignature, this.block = block, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), propertyName.parent = this, callSignature.parent = this, block && (block.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return MemberFunctionDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.MemberFunctionDeclarationSyntax = MemberFunctionDeclarationSyntax; - var MemberVariableDeclarationSyntax = (function (_super) { - __extends(MemberVariableDeclarationSyntax, _super); - function MemberVariableDeclarationSyntax(data, modifiers, variableDeclarator, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.variableDeclarator = variableDeclarator, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), variableDeclarator.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return MemberVariableDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.MemberVariableDeclarationSyntax = MemberVariableDeclarationSyntax; - var ConstructorDeclarationSyntax = (function (_super) { - __extends(ConstructorDeclarationSyntax, _super); - function ConstructorDeclarationSyntax(data, modifiers, constructorKeyword, callSignature, block, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.constructorKeyword = constructorKeyword, this.callSignature = callSignature, this.block = block, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), constructorKeyword.parent = this, callSignature.parent = this, block && (block.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return ConstructorDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConstructorDeclarationSyntax = ConstructorDeclarationSyntax; - var IndexMemberDeclarationSyntax = (function (_super) { - __extends(IndexMemberDeclarationSyntax, _super); - function IndexMemberDeclarationSyntax(data, modifiers, indexSignature, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.indexSignature = indexSignature, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), indexSignature.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return IndexMemberDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.IndexMemberDeclarationSyntax = IndexMemberDeclarationSyntax; - var GetAccessorSyntax = (function (_super) { - __extends(GetAccessorSyntax, _super); - function GetAccessorSyntax(data, modifiers, getKeyword, propertyName, callSignature, block) { - _super.call(this, data); - this.modifiers = modifiers, this.getKeyword = getKeyword, this.propertyName = propertyName, this.callSignature = callSignature, this.block = block, !TypeScript.isShared(modifiers) && (modifiers.parent = this), getKeyword.parent = this, propertyName.parent = this, callSignature.parent = this, block.parent = this; - } - return GetAccessorSyntax; - })(TypeScript.SyntaxNode); - Concrete.GetAccessorSyntax = GetAccessorSyntax; - var SetAccessorSyntax = (function (_super) { - __extends(SetAccessorSyntax, _super); - function SetAccessorSyntax(data, modifiers, setKeyword, propertyName, callSignature, block) { - _super.call(this, data); - this.modifiers = modifiers, this.setKeyword = setKeyword, this.propertyName = propertyName, this.callSignature = callSignature, this.block = block, !TypeScript.isShared(modifiers) && (modifiers.parent = this), setKeyword.parent = this, propertyName.parent = this, callSignature.parent = this, block.parent = this; - } - return SetAccessorSyntax; - })(TypeScript.SyntaxNode); - Concrete.SetAccessorSyntax = SetAccessorSyntax; - var PropertySignatureSyntax = (function (_super) { - __extends(PropertySignatureSyntax, _super); - function PropertySignatureSyntax(data, propertyName, questionToken, typeAnnotation) { - _super.call(this, data); - this.propertyName = propertyName, this.questionToken = questionToken, this.typeAnnotation = typeAnnotation, propertyName.parent = this, questionToken && (questionToken.parent = this), typeAnnotation && (typeAnnotation.parent = this); - } - return PropertySignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.PropertySignatureSyntax = PropertySignatureSyntax; - var CallSignatureSyntax = (function (_super) { - __extends(CallSignatureSyntax, _super); - function CallSignatureSyntax(data, typeParameterList, parameterList, typeAnnotation) { - _super.call(this, data); - this.typeParameterList = typeParameterList, this.parameterList = parameterList, this.typeAnnotation = typeAnnotation, typeParameterList && (typeParameterList.parent = this), parameterList.parent = this, typeAnnotation && (typeAnnotation.parent = this); - } - return CallSignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.CallSignatureSyntax = CallSignatureSyntax; - var ConstructSignatureSyntax = (function (_super) { - __extends(ConstructSignatureSyntax, _super); - function ConstructSignatureSyntax(data, newKeyword, callSignature) { - _super.call(this, data); - this.newKeyword = newKeyword, this.callSignature = callSignature, newKeyword.parent = this, callSignature.parent = this; - } - return ConstructSignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConstructSignatureSyntax = ConstructSignatureSyntax; - var IndexSignatureSyntax = (function (_super) { - __extends(IndexSignatureSyntax, _super); - function IndexSignatureSyntax(data, openBracketToken, parameters, closeBracketToken, typeAnnotation) { - _super.call(this, data); - this.openBracketToken = openBracketToken, this.parameters = parameters, this.closeBracketToken = closeBracketToken, this.typeAnnotation = typeAnnotation, openBracketToken.parent = this, !TypeScript.isShared(parameters) && (parameters.parent = this), closeBracketToken.parent = this, typeAnnotation && (typeAnnotation.parent = this); - } - return IndexSignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.IndexSignatureSyntax = IndexSignatureSyntax; - var MethodSignatureSyntax = (function (_super) { - __extends(MethodSignatureSyntax, _super); - function MethodSignatureSyntax(data, propertyName, questionToken, callSignature) { - _super.call(this, data); - this.propertyName = propertyName, this.questionToken = questionToken, this.callSignature = callSignature, propertyName.parent = this, questionToken && (questionToken.parent = this), callSignature.parent = this; - } - return MethodSignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.MethodSignatureSyntax = MethodSignatureSyntax; - var BlockSyntax = (function (_super) { - __extends(BlockSyntax, _super); - function BlockSyntax(data, openBraceToken, statements, closeBraceToken) { - _super.call(this, data); - this.openBraceToken = openBraceToken, this.statements = statements, this.closeBraceToken = closeBraceToken, openBraceToken.parent = this, !TypeScript.isShared(statements) && (statements.parent = this), closeBraceToken.parent = this; - } - return BlockSyntax; - })(TypeScript.SyntaxNode); - Concrete.BlockSyntax = BlockSyntax; - var IfStatementSyntax = (function (_super) { - __extends(IfStatementSyntax, _super); - function IfStatementSyntax(data, ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause) { - _super.call(this, 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); - } - return IfStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.IfStatementSyntax = IfStatementSyntax; - var VariableStatementSyntax = (function (_super) { - __extends(VariableStatementSyntax, _super); - function VariableStatementSyntax(data, modifiers, variableDeclaration, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.variableDeclaration = variableDeclaration, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), variableDeclaration.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return VariableStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.VariableStatementSyntax = VariableStatementSyntax; - var ExpressionStatementSyntax = (function (_super) { - __extends(ExpressionStatementSyntax, _super); - function ExpressionStatementSyntax(data, expression, semicolonToken) { - _super.call(this, data); - this.expression = expression, this.semicolonToken = semicolonToken, expression.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return ExpressionStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ExpressionStatementSyntax = ExpressionStatementSyntax; - var ReturnStatementSyntax = (function (_super) { - __extends(ReturnStatementSyntax, _super); - function ReturnStatementSyntax(data, returnKeyword, expression, semicolonToken) { - _super.call(this, data); - this.returnKeyword = returnKeyword, this.expression = expression, this.semicolonToken = semicolonToken, returnKeyword.parent = this, expression && (expression.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return ReturnStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ReturnStatementSyntax = ReturnStatementSyntax; - var SwitchStatementSyntax = (function (_super) { - __extends(SwitchStatementSyntax, _super); - function SwitchStatementSyntax(data, switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken) { - _super.call(this, 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, !TypeScript.isShared(switchClauses) && (switchClauses.parent = this), closeBraceToken.parent = this; - } - return SwitchStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.SwitchStatementSyntax = SwitchStatementSyntax; - var BreakStatementSyntax = (function (_super) { - __extends(BreakStatementSyntax, _super); - function BreakStatementSyntax(data, breakKeyword, identifier, semicolonToken) { - _super.call(this, data); - this.breakKeyword = breakKeyword, this.identifier = identifier, this.semicolonToken = semicolonToken, breakKeyword.parent = this, identifier && (identifier.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return BreakStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.BreakStatementSyntax = BreakStatementSyntax; - var ContinueStatementSyntax = (function (_super) { - __extends(ContinueStatementSyntax, _super); - function ContinueStatementSyntax(data, continueKeyword, identifier, semicolonToken) { - _super.call(this, data); - this.continueKeyword = continueKeyword, this.identifier = identifier, this.semicolonToken = semicolonToken, continueKeyword.parent = this, identifier && (identifier.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return ContinueStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ContinueStatementSyntax = ContinueStatementSyntax; - var ForStatementSyntax = (function (_super) { - __extends(ForStatementSyntax, _super); - function ForStatementSyntax(data, forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement) { - _super.call(this, 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; - } - return ForStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ForStatementSyntax = ForStatementSyntax; - var ForInStatementSyntax = (function (_super) { - __extends(ForInStatementSyntax, _super); - function ForInStatementSyntax(data, forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement) { - _super.call(this, 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; - } - return ForInStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ForInStatementSyntax = ForInStatementSyntax; - var EmptyStatementSyntax = (function (_super) { - __extends(EmptyStatementSyntax, _super); - function EmptyStatementSyntax(data, semicolonToken) { - _super.call(this, data); - this.semicolonToken = semicolonToken, semicolonToken.parent = this; - } - return EmptyStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.EmptyStatementSyntax = EmptyStatementSyntax; - var ThrowStatementSyntax = (function (_super) { - __extends(ThrowStatementSyntax, _super); - function ThrowStatementSyntax(data, throwKeyword, expression, semicolonToken) { - _super.call(this, data); - this.throwKeyword = throwKeyword, this.expression = expression, this.semicolonToken = semicolonToken, throwKeyword.parent = this, expression.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return ThrowStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ThrowStatementSyntax = ThrowStatementSyntax; - var WhileStatementSyntax = (function (_super) { - __extends(WhileStatementSyntax, _super); - function WhileStatementSyntax(data, whileKeyword, openParenToken, condition, closeParenToken, statement) { - _super.call(this, 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; - } - return WhileStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.WhileStatementSyntax = WhileStatementSyntax; - var TryStatementSyntax = (function (_super) { - __extends(TryStatementSyntax, _super); - function TryStatementSyntax(data, tryKeyword, block, catchClause, finallyClause) { - _super.call(this, 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); - } - return TryStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.TryStatementSyntax = TryStatementSyntax; - var LabeledStatementSyntax = (function (_super) { - __extends(LabeledStatementSyntax, _super); - function LabeledStatementSyntax(data, identifier, colonToken, statement) { - _super.call(this, data); - this.identifier = identifier, this.colonToken = colonToken, this.statement = statement, identifier.parent = this, colonToken.parent = this, statement.parent = this; - } - return LabeledStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.LabeledStatementSyntax = LabeledStatementSyntax; - var DoStatementSyntax = (function (_super) { - __extends(DoStatementSyntax, _super); - function DoStatementSyntax(data, doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken) { - _super.call(this, 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); - } - return DoStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.DoStatementSyntax = DoStatementSyntax; - var DebuggerStatementSyntax = (function (_super) { - __extends(DebuggerStatementSyntax, _super); - function DebuggerStatementSyntax(data, debuggerKeyword, semicolonToken) { - _super.call(this, data); - this.debuggerKeyword = debuggerKeyword, this.semicolonToken = semicolonToken, debuggerKeyword.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return DebuggerStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.DebuggerStatementSyntax = DebuggerStatementSyntax; - var WithStatementSyntax = (function (_super) { - __extends(WithStatementSyntax, _super); - function WithStatementSyntax(data, withKeyword, openParenToken, condition, closeParenToken, statement) { - _super.call(this, 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; - } - return WithStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.WithStatementSyntax = WithStatementSyntax; - var PrefixUnaryExpressionSyntax = (function (_super) { - __extends(PrefixUnaryExpressionSyntax, _super); - function PrefixUnaryExpressionSyntax(data, operatorToken, operand) { - _super.call(this, data); - this.operatorToken = operatorToken, this.operand = operand, operatorToken.parent = this, operand.parent = this; - } - PrefixUnaryExpressionSyntax.prototype.kind = function () { - return TypeScript.SyntaxFacts.getPrefixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); - }; - return PrefixUnaryExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.PrefixUnaryExpressionSyntax = PrefixUnaryExpressionSyntax; - var DeleteExpressionSyntax = (function (_super) { - __extends(DeleteExpressionSyntax, _super); - function DeleteExpressionSyntax(data, deleteKeyword, expression) { - _super.call(this, data); - this.deleteKeyword = deleteKeyword, this.expression = expression, deleteKeyword.parent = this, expression.parent = this; - } - return DeleteExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.DeleteExpressionSyntax = DeleteExpressionSyntax; - var TypeOfExpressionSyntax = (function (_super) { - __extends(TypeOfExpressionSyntax, _super); - function TypeOfExpressionSyntax(data, typeOfKeyword, expression) { - _super.call(this, data); - this.typeOfKeyword = typeOfKeyword, this.expression = expression, typeOfKeyword.parent = this, expression.parent = this; - } - return TypeOfExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeOfExpressionSyntax = TypeOfExpressionSyntax; - var VoidExpressionSyntax = (function (_super) { - __extends(VoidExpressionSyntax, _super); - function VoidExpressionSyntax(data, voidKeyword, expression) { - _super.call(this, data); - this.voidKeyword = voidKeyword, this.expression = expression, voidKeyword.parent = this, expression.parent = this; - } - return VoidExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.VoidExpressionSyntax = VoidExpressionSyntax; - var ConditionalExpressionSyntax = (function (_super) { - __extends(ConditionalExpressionSyntax, _super); - function ConditionalExpressionSyntax(data, condition, questionToken, whenTrue, colonToken, whenFalse) { - _super.call(this, 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; - } - return ConditionalExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConditionalExpressionSyntax = ConditionalExpressionSyntax; - var BinaryExpressionSyntax = (function (_super) { - __extends(BinaryExpressionSyntax, _super); - function BinaryExpressionSyntax(data, left, operatorToken, right) { - _super.call(this, data); - this.left = left, this.operatorToken = operatorToken, this.right = right, left.parent = this, operatorToken.parent = this, right.parent = this; - } - BinaryExpressionSyntax.prototype.kind = function () { - return TypeScript.SyntaxFacts.getBinaryExpressionFromOperatorToken(this.operatorToken.kind()); - }; - return BinaryExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.BinaryExpressionSyntax = BinaryExpressionSyntax; - var PostfixUnaryExpressionSyntax = (function (_super) { - __extends(PostfixUnaryExpressionSyntax, _super); - function PostfixUnaryExpressionSyntax(data, operand, operatorToken) { - _super.call(this, data); - this.operand = operand, this.operatorToken = operatorToken, operand.parent = this, operatorToken.parent = this; - } - PostfixUnaryExpressionSyntax.prototype.kind = function () { - return TypeScript.SyntaxFacts.getPostfixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); - }; - return PostfixUnaryExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.PostfixUnaryExpressionSyntax = PostfixUnaryExpressionSyntax; - var MemberAccessExpressionSyntax = (function (_super) { - __extends(MemberAccessExpressionSyntax, _super); - function MemberAccessExpressionSyntax(data, expression, dotToken, name) { - _super.call(this, data); - this.expression = expression, this.dotToken = dotToken, this.name = name, expression.parent = this, dotToken.parent = this, name.parent = this; - } - return MemberAccessExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.MemberAccessExpressionSyntax = MemberAccessExpressionSyntax; - var InvocationExpressionSyntax = (function (_super) { - __extends(InvocationExpressionSyntax, _super); - function InvocationExpressionSyntax(data, expression, argumentList) { - _super.call(this, data); - this.expression = expression, this.argumentList = argumentList, expression.parent = this, argumentList.parent = this; - } - return InvocationExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.InvocationExpressionSyntax = InvocationExpressionSyntax; - var ArrayLiteralExpressionSyntax = (function (_super) { - __extends(ArrayLiteralExpressionSyntax, _super); - function ArrayLiteralExpressionSyntax(data, openBracketToken, expressions, closeBracketToken) { - _super.call(this, data); - this.openBracketToken = openBracketToken, this.expressions = expressions, this.closeBracketToken = closeBracketToken, openBracketToken.parent = this, !TypeScript.isShared(expressions) && (expressions.parent = this), closeBracketToken.parent = this; - } - return ArrayLiteralExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ArrayLiteralExpressionSyntax = ArrayLiteralExpressionSyntax; - var ObjectLiteralExpressionSyntax = (function (_super) { - __extends(ObjectLiteralExpressionSyntax, _super); - function ObjectLiteralExpressionSyntax(data, openBraceToken, propertyAssignments, closeBraceToken) { - _super.call(this, data); - this.openBraceToken = openBraceToken, this.propertyAssignments = propertyAssignments, this.closeBraceToken = closeBraceToken, openBraceToken.parent = this, !TypeScript.isShared(propertyAssignments) && (propertyAssignments.parent = this), closeBraceToken.parent = this; - } - return ObjectLiteralExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ObjectLiteralExpressionSyntax = ObjectLiteralExpressionSyntax; - var ObjectCreationExpressionSyntax = (function (_super) { - __extends(ObjectCreationExpressionSyntax, _super); - function ObjectCreationExpressionSyntax(data, newKeyword, expression, argumentList) { - _super.call(this, data); - this.newKeyword = newKeyword, this.expression = expression, this.argumentList = argumentList, newKeyword.parent = this, expression.parent = this, argumentList && (argumentList.parent = this); - } - return ObjectCreationExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ObjectCreationExpressionSyntax = ObjectCreationExpressionSyntax; - var ParenthesizedExpressionSyntax = (function (_super) { - __extends(ParenthesizedExpressionSyntax, _super); - function ParenthesizedExpressionSyntax(data, openParenToken, expression, closeParenToken) { - _super.call(this, data); - this.openParenToken = openParenToken, this.expression = expression, this.closeParenToken = closeParenToken, openParenToken.parent = this, expression.parent = this, closeParenToken.parent = this; - } - return ParenthesizedExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ParenthesizedExpressionSyntax = ParenthesizedExpressionSyntax; - var ParenthesizedArrowFunctionExpressionSyntax = (function (_super) { - __extends(ParenthesizedArrowFunctionExpressionSyntax, _super); - function ParenthesizedArrowFunctionExpressionSyntax(data, callSignature, equalsGreaterThanToken, block, expression) { - _super.call(this, 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); - } - return ParenthesizedArrowFunctionExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ParenthesizedArrowFunctionExpressionSyntax = ParenthesizedArrowFunctionExpressionSyntax; - var SimpleArrowFunctionExpressionSyntax = (function (_super) { - __extends(SimpleArrowFunctionExpressionSyntax, _super); - function SimpleArrowFunctionExpressionSyntax(data, parameter, equalsGreaterThanToken, block, expression) { - _super.call(this, 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); - } - return SimpleArrowFunctionExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.SimpleArrowFunctionExpressionSyntax = SimpleArrowFunctionExpressionSyntax; - var CastExpressionSyntax = (function (_super) { - __extends(CastExpressionSyntax, _super); - function CastExpressionSyntax(data, lessThanToken, type, greaterThanToken, expression) { - _super.call(this, 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; - } - return CastExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.CastExpressionSyntax = CastExpressionSyntax; - var ElementAccessExpressionSyntax = (function (_super) { - __extends(ElementAccessExpressionSyntax, _super); - function ElementAccessExpressionSyntax(data, expression, openBracketToken, argumentExpression, closeBracketToken) { - _super.call(this, 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; - } - return ElementAccessExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ElementAccessExpressionSyntax = ElementAccessExpressionSyntax; - var FunctionExpressionSyntax = (function (_super) { - __extends(FunctionExpressionSyntax, _super); - function FunctionExpressionSyntax(data, functionKeyword, identifier, callSignature, block) { - _super.call(this, 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; - } - return FunctionExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.FunctionExpressionSyntax = FunctionExpressionSyntax; - var OmittedExpressionSyntax = (function (_super) { - __extends(OmittedExpressionSyntax, _super); - function OmittedExpressionSyntax(data) { - _super.call(this, data); - } - return OmittedExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.OmittedExpressionSyntax = OmittedExpressionSyntax; - var VariableDeclarationSyntax = (function (_super) { - __extends(VariableDeclarationSyntax, _super); - function VariableDeclarationSyntax(data, varKeyword, variableDeclarators) { - _super.call(this, data); - this.varKeyword = varKeyword, this.variableDeclarators = variableDeclarators, varKeyword.parent = this, !TypeScript.isShared(variableDeclarators) && (variableDeclarators.parent = this); - } - return VariableDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.VariableDeclarationSyntax = VariableDeclarationSyntax; - var VariableDeclaratorSyntax = (function (_super) { - __extends(VariableDeclaratorSyntax, _super); - function VariableDeclaratorSyntax(data, propertyName, typeAnnotation, equalsValueClause) { - _super.call(this, data); - this.propertyName = propertyName, this.typeAnnotation = typeAnnotation, this.equalsValueClause = equalsValueClause, propertyName.parent = this, typeAnnotation && (typeAnnotation.parent = this), equalsValueClause && (equalsValueClause.parent = this); - } - return VariableDeclaratorSyntax; - })(TypeScript.SyntaxNode); - Concrete.VariableDeclaratorSyntax = VariableDeclaratorSyntax; - var ArgumentListSyntax = (function (_super) { - __extends(ArgumentListSyntax, _super); - function ArgumentListSyntax(data, typeArgumentList, openParenToken, _arguments, closeParenToken) { - _super.call(this, data); - this.typeArgumentList = typeArgumentList, this.openParenToken = openParenToken, this.arguments = _arguments, this.closeParenToken = closeParenToken, typeArgumentList && (typeArgumentList.parent = this), openParenToken.parent = this, !TypeScript.isShared(_arguments) && (_arguments.parent = this), closeParenToken.parent = this; - } - return ArgumentListSyntax; - })(TypeScript.SyntaxNode); - Concrete.ArgumentListSyntax = ArgumentListSyntax; - var ParameterListSyntax = (function (_super) { - __extends(ParameterListSyntax, _super); - function ParameterListSyntax(data, openParenToken, parameters, closeParenToken) { - _super.call(this, data); - this.openParenToken = openParenToken, this.parameters = parameters, this.closeParenToken = closeParenToken, openParenToken.parent = this, !TypeScript.isShared(parameters) && (parameters.parent = this), closeParenToken.parent = this; - } - return ParameterListSyntax; - })(TypeScript.SyntaxNode); - Concrete.ParameterListSyntax = ParameterListSyntax; - var TypeArgumentListSyntax = (function (_super) { - __extends(TypeArgumentListSyntax, _super); - function TypeArgumentListSyntax(data, lessThanToken, typeArguments, greaterThanToken) { - _super.call(this, data); - this.lessThanToken = lessThanToken, this.typeArguments = typeArguments, this.greaterThanToken = greaterThanToken, lessThanToken.parent = this, !TypeScript.isShared(typeArguments) && (typeArguments.parent = this), greaterThanToken.parent = this; - } - return TypeArgumentListSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeArgumentListSyntax = TypeArgumentListSyntax; - var TypeParameterListSyntax = (function (_super) { - __extends(TypeParameterListSyntax, _super); - function TypeParameterListSyntax(data, lessThanToken, typeParameters, greaterThanToken) { - _super.call(this, data); - this.lessThanToken = lessThanToken, this.typeParameters = typeParameters, this.greaterThanToken = greaterThanToken, lessThanToken.parent = this, !TypeScript.isShared(typeParameters) && (typeParameters.parent = this), greaterThanToken.parent = this; - } - return TypeParameterListSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeParameterListSyntax = TypeParameterListSyntax; - var HeritageClauseSyntax = (function (_super) { - __extends(HeritageClauseSyntax, _super); - function HeritageClauseSyntax(data, extendsOrImplementsKeyword, typeNames) { - _super.call(this, data); - this.extendsOrImplementsKeyword = extendsOrImplementsKeyword, this.typeNames = typeNames, extendsOrImplementsKeyword.parent = this, !TypeScript.isShared(typeNames) && (typeNames.parent = this); - } - HeritageClauseSyntax.prototype.kind = function () { - return this.extendsOrImplementsKeyword.kind() === 48 /* ExtendsKeyword */ ? 231 /* ExtendsHeritageClause */ : 232 /* ImplementsHeritageClause */; - }; - return HeritageClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.HeritageClauseSyntax = HeritageClauseSyntax; - var EqualsValueClauseSyntax = (function (_super) { - __extends(EqualsValueClauseSyntax, _super); - function EqualsValueClauseSyntax(data, equalsToken, value) { - _super.call(this, data); - this.equalsToken = equalsToken, this.value = value, equalsToken.parent = this, value.parent = this; - } - return EqualsValueClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.EqualsValueClauseSyntax = EqualsValueClauseSyntax; - var CaseSwitchClauseSyntax = (function (_super) { - __extends(CaseSwitchClauseSyntax, _super); - function CaseSwitchClauseSyntax(data, caseKeyword, expression, colonToken, statements) { - _super.call(this, data); - this.caseKeyword = caseKeyword, this.expression = expression, this.colonToken = colonToken, this.statements = statements, caseKeyword.parent = this, expression.parent = this, colonToken.parent = this, !TypeScript.isShared(statements) && (statements.parent = this); - } - return CaseSwitchClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.CaseSwitchClauseSyntax = CaseSwitchClauseSyntax; - var DefaultSwitchClauseSyntax = (function (_super) { - __extends(DefaultSwitchClauseSyntax, _super); - function DefaultSwitchClauseSyntax(data, defaultKeyword, colonToken, statements) { - _super.call(this, data); - this.defaultKeyword = defaultKeyword, this.colonToken = colonToken, this.statements = statements, defaultKeyword.parent = this, colonToken.parent = this, !TypeScript.isShared(statements) && (statements.parent = this); - } - return DefaultSwitchClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.DefaultSwitchClauseSyntax = DefaultSwitchClauseSyntax; - var ElseClauseSyntax = (function (_super) { - __extends(ElseClauseSyntax, _super); - function ElseClauseSyntax(data, elseKeyword, statement) { - _super.call(this, data); - this.elseKeyword = elseKeyword, this.statement = statement, elseKeyword.parent = this, statement.parent = this; - } - return ElseClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.ElseClauseSyntax = ElseClauseSyntax; - var CatchClauseSyntax = (function (_super) { - __extends(CatchClauseSyntax, _super); - function CatchClauseSyntax(data, catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block) { - _super.call(this, 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; - } - return CatchClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.CatchClauseSyntax = CatchClauseSyntax; - var FinallyClauseSyntax = (function (_super) { - __extends(FinallyClauseSyntax, _super); - function FinallyClauseSyntax(data, finallyKeyword, block) { - _super.call(this, data); - this.finallyKeyword = finallyKeyword, this.block = block, finallyKeyword.parent = this, block.parent = this; - } - return FinallyClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.FinallyClauseSyntax = FinallyClauseSyntax; - var TypeParameterSyntax = (function (_super) { - __extends(TypeParameterSyntax, _super); - function TypeParameterSyntax(data, identifier, constraint) { - _super.call(this, data); - this.identifier = identifier, this.constraint = constraint, identifier.parent = this, constraint && (constraint.parent = this); - } - return TypeParameterSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeParameterSyntax = TypeParameterSyntax; - var ConstraintSyntax = (function (_super) { - __extends(ConstraintSyntax, _super); - function ConstraintSyntax(data, extendsKeyword, typeOrExpression) { - _super.call(this, data); - this.extendsKeyword = extendsKeyword, this.typeOrExpression = typeOrExpression, extendsKeyword.parent = this, typeOrExpression.parent = this; - } - return ConstraintSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConstraintSyntax = ConstraintSyntax; - var SimplePropertyAssignmentSyntax = (function (_super) { - __extends(SimplePropertyAssignmentSyntax, _super); - function SimplePropertyAssignmentSyntax(data, propertyName, colonToken, expression) { - _super.call(this, data); - this.propertyName = propertyName, this.colonToken = colonToken, this.expression = expression, propertyName.parent = this, colonToken.parent = this, expression.parent = this; - } - return SimplePropertyAssignmentSyntax; - })(TypeScript.SyntaxNode); - Concrete.SimplePropertyAssignmentSyntax = SimplePropertyAssignmentSyntax; - var FunctionPropertyAssignmentSyntax = (function (_super) { - __extends(FunctionPropertyAssignmentSyntax, _super); - function FunctionPropertyAssignmentSyntax(data, propertyName, callSignature, block) { - _super.call(this, data); - this.propertyName = propertyName, this.callSignature = callSignature, this.block = block, propertyName.parent = this, callSignature.parent = this, block.parent = this; - } - return FunctionPropertyAssignmentSyntax; - })(TypeScript.SyntaxNode); - Concrete.FunctionPropertyAssignmentSyntax = FunctionPropertyAssignmentSyntax; - var ParameterSyntax = (function (_super) { - __extends(ParameterSyntax, _super); - function ParameterSyntax(data, dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause) { - _super.call(this, data); - this.dotDotDotToken = dotDotDotToken, this.modifiers = modifiers, this.identifier = identifier, this.questionToken = questionToken, this.typeAnnotation = typeAnnotation, this.equalsValueClause = equalsValueClause, dotDotDotToken && (dotDotDotToken.parent = this), !TypeScript.isShared(modifiers) && (modifiers.parent = this), identifier.parent = this, questionToken && (questionToken.parent = this), typeAnnotation && (typeAnnotation.parent = this), equalsValueClause && (equalsValueClause.parent = this); - } - return ParameterSyntax; - })(TypeScript.SyntaxNode); - Concrete.ParameterSyntax = ParameterSyntax; - var EnumElementSyntax = (function (_super) { - __extends(EnumElementSyntax, _super); - function EnumElementSyntax(data, propertyName, equalsValueClause) { - _super.call(this, data); - this.propertyName = propertyName, this.equalsValueClause = equalsValueClause, propertyName.parent = this, equalsValueClause && (equalsValueClause.parent = this); - } - return EnumElementSyntax; - })(TypeScript.SyntaxNode); - Concrete.EnumElementSyntax = EnumElementSyntax; - var TypeAnnotationSyntax = (function (_super) { - __extends(TypeAnnotationSyntax, _super); - function TypeAnnotationSyntax(data, colonToken, type) { - _super.call(this, data); - this.colonToken = colonToken, this.type = type, colonToken.parent = this, type.parent = this; - } - return TypeAnnotationSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeAnnotationSyntax = TypeAnnotationSyntax; - var ExternalModuleReferenceSyntax = (function (_super) { - __extends(ExternalModuleReferenceSyntax, _super); - function ExternalModuleReferenceSyntax(data, requireKeyword, openParenToken, stringLiteral, closeParenToken) { - _super.call(this, 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; - } - return ExternalModuleReferenceSyntax; - })(TypeScript.SyntaxNode); - Concrete.ExternalModuleReferenceSyntax = ExternalModuleReferenceSyntax; - var ModuleNameModuleReferenceSyntax = (function (_super) { - __extends(ModuleNameModuleReferenceSyntax, _super); - function ModuleNameModuleReferenceSyntax(data, moduleName) { - _super.call(this, data); - this.moduleName = moduleName, moduleName.parent = this; - } - return ModuleNameModuleReferenceSyntax; - })(TypeScript.SyntaxNode); - Concrete.ModuleNameModuleReferenceSyntax = ModuleNameModuleReferenceSyntax; - SourceUnitSyntax.prototype.__kind = 120 /* SourceUnit */, QualifiedNameSyntax.prototype.__kind = 121 /* QualifiedName */, ObjectTypeSyntax.prototype.__kind = 122 /* ObjectType */, FunctionTypeSyntax.prototype.__kind = 123 /* FunctionType */, ArrayTypeSyntax.prototype.__kind = 124 /* ArrayType */, ConstructorTypeSyntax.prototype.__kind = 125 /* ConstructorType */, GenericTypeSyntax.prototype.__kind = 126 /* GenericType */, TypeQuerySyntax.prototype.__kind = 127 /* TypeQuery */, TupleTypeSyntax.prototype.__kind = 128 /* TupleType */, InterfaceDeclarationSyntax.prototype.__kind = 129 /* InterfaceDeclaration */, FunctionDeclarationSyntax.prototype.__kind = 130 /* FunctionDeclaration */, ModuleDeclarationSyntax.prototype.__kind = 131 /* ModuleDeclaration */, ClassDeclarationSyntax.prototype.__kind = 132 /* ClassDeclaration */, EnumDeclarationSyntax.prototype.__kind = 133 /* EnumDeclaration */, ImportDeclarationSyntax.prototype.__kind = 134 /* ImportDeclaration */, ExportAssignmentSyntax.prototype.__kind = 135 /* ExportAssignment */, MemberFunctionDeclarationSyntax.prototype.__kind = 136 /* MemberFunctionDeclaration */, MemberVariableDeclarationSyntax.prototype.__kind = 137 /* MemberVariableDeclaration */, ConstructorDeclarationSyntax.prototype.__kind = 138 /* ConstructorDeclaration */, IndexMemberDeclarationSyntax.prototype.__kind = 139 /* IndexMemberDeclaration */, GetAccessorSyntax.prototype.__kind = 140 /* GetAccessor */, SetAccessorSyntax.prototype.__kind = 141 /* SetAccessor */, PropertySignatureSyntax.prototype.__kind = 142 /* PropertySignature */, CallSignatureSyntax.prototype.__kind = 143 /* CallSignature */, ConstructSignatureSyntax.prototype.__kind = 144 /* ConstructSignature */, IndexSignatureSyntax.prototype.__kind = 145 /* IndexSignature */, MethodSignatureSyntax.prototype.__kind = 146 /* MethodSignature */, BlockSyntax.prototype.__kind = 147 /* Block */, IfStatementSyntax.prototype.__kind = 148 /* IfStatement */, VariableStatementSyntax.prototype.__kind = 149 /* VariableStatement */, ExpressionStatementSyntax.prototype.__kind = 150 /* ExpressionStatement */, ReturnStatementSyntax.prototype.__kind = 151 /* ReturnStatement */, SwitchStatementSyntax.prototype.__kind = 152 /* SwitchStatement */, BreakStatementSyntax.prototype.__kind = 153 /* BreakStatement */, ContinueStatementSyntax.prototype.__kind = 154 /* ContinueStatement */, ForStatementSyntax.prototype.__kind = 155 /* ForStatement */, ForInStatementSyntax.prototype.__kind = 156 /* ForInStatement */, EmptyStatementSyntax.prototype.__kind = 157 /* EmptyStatement */, ThrowStatementSyntax.prototype.__kind = 158 /* ThrowStatement */, WhileStatementSyntax.prototype.__kind = 159 /* WhileStatement */, TryStatementSyntax.prototype.__kind = 160 /* TryStatement */, LabeledStatementSyntax.prototype.__kind = 161 /* LabeledStatement */, DoStatementSyntax.prototype.__kind = 162 /* DoStatement */, DebuggerStatementSyntax.prototype.__kind = 163 /* DebuggerStatement */, WithStatementSyntax.prototype.__kind = 164 /* WithStatement */, DeleteExpressionSyntax.prototype.__kind = 171 /* DeleteExpression */, TypeOfExpressionSyntax.prototype.__kind = 172 /* TypeOfExpression */, VoidExpressionSyntax.prototype.__kind = 173 /* VoidExpression */, ConditionalExpressionSyntax.prototype.__kind = 187 /* ConditionalExpression */, MemberAccessExpressionSyntax.prototype.__kind = 213 /* MemberAccessExpression */, InvocationExpressionSyntax.prototype.__kind = 214 /* InvocationExpression */, ArrayLiteralExpressionSyntax.prototype.__kind = 215 /* ArrayLiteralExpression */, ObjectLiteralExpressionSyntax.prototype.__kind = 216 /* ObjectLiteralExpression */, ObjectCreationExpressionSyntax.prototype.__kind = 217 /* ObjectCreationExpression */, ParenthesizedExpressionSyntax.prototype.__kind = 218 /* ParenthesizedExpression */, ParenthesizedArrowFunctionExpressionSyntax.prototype.__kind = 219 /* ParenthesizedArrowFunctionExpression */, SimpleArrowFunctionExpressionSyntax.prototype.__kind = 220 /* SimpleArrowFunctionExpression */, CastExpressionSyntax.prototype.__kind = 221 /* CastExpression */, ElementAccessExpressionSyntax.prototype.__kind = 222 /* ElementAccessExpression */, FunctionExpressionSyntax.prototype.__kind = 223 /* FunctionExpression */, OmittedExpressionSyntax.prototype.__kind = 224 /* OmittedExpression */, VariableDeclarationSyntax.prototype.__kind = 225 /* VariableDeclaration */, VariableDeclaratorSyntax.prototype.__kind = 226 /* VariableDeclarator */, ArgumentListSyntax.prototype.__kind = 227 /* ArgumentList */, ParameterListSyntax.prototype.__kind = 228 /* ParameterList */, TypeArgumentListSyntax.prototype.__kind = 229 /* TypeArgumentList */, TypeParameterListSyntax.prototype.__kind = 230 /* TypeParameterList */, EqualsValueClauseSyntax.prototype.__kind = 233 /* EqualsValueClause */, CaseSwitchClauseSyntax.prototype.__kind = 234 /* CaseSwitchClause */, DefaultSwitchClauseSyntax.prototype.__kind = 235 /* DefaultSwitchClause */, ElseClauseSyntax.prototype.__kind = 236 /* ElseClause */, CatchClauseSyntax.prototype.__kind = 237 /* CatchClause */, FinallyClauseSyntax.prototype.__kind = 238 /* FinallyClause */, TypeParameterSyntax.prototype.__kind = 239 /* TypeParameter */, ConstraintSyntax.prototype.__kind = 240 /* Constraint */, SimplePropertyAssignmentSyntax.prototype.__kind = 241 /* SimplePropertyAssignment */, FunctionPropertyAssignmentSyntax.prototype.__kind = 242 /* FunctionPropertyAssignment */, ParameterSyntax.prototype.__kind = 243 /* Parameter */, EnumElementSyntax.prototype.__kind = 244 /* EnumElement */, TypeAnnotationSyntax.prototype.__kind = 245 /* TypeAnnotation */, ExternalModuleReferenceSyntax.prototype.__kind = 246 /* ExternalModuleReference */, ModuleNameModuleReferenceSyntax.prototype.__kind = 247 /* ModuleNameModuleReference */; - })(Concrete = Syntax.Concrete || (Syntax.Concrete = {})); - })(Syntax = TypeScript.Syntax || (TypeScript.Syntax = {})); + 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(isConcrete, sourceUnit, isDeclaration, diagnostics, fileName, text, languageVersion) { + function SyntaxTree(sourceUnit, isDeclaration, diagnostics, fileName, text, languageVersion) { this.text = text; - this._allDiagnostics = null; - this._isConcrete = isConcrete; + this._allDiagnostics = undefined; this._sourceUnit = sourceUnit; this._isDeclaration = isDeclaration; this._parserDiagnostics = diagnostics; @@ -26119,9 +26442,6 @@ var TypeScript; this._languageVersion = languageVersion; sourceUnit.syntaxTree = this; } - SyntaxTree.prototype.isConcrete = function () { - return this._isConcrete; - }; SyntaxTree.prototype.sourceUnit = function () { return this._sourceUnit; }; @@ -26137,7 +26457,7 @@ var TypeScript; return diagnostics; }; SyntaxTree.prototype.diagnostics = function () { - if (this._allDiagnostics === null) { + if (!this._allDiagnostics) { var start = new Date().getTime(); this._allDiagnostics = this.computeDiagnostics(); TypeScript.syntaxDiagnosticsTime += new Date().getTime() - start; @@ -26156,7 +26476,7 @@ var TypeScript; SyntaxTree.prototype.cacheSyntaxTreeInfo = function () { var firstToken = firstSyntaxTreeToken(this); var leadingTrivia = firstToken.leadingTrivia(this.text); - this._isExternalModule = externalModuleIndicatorSpanWorker(this, firstToken) !== null; + this._isExternalModule = !!externalModuleIndicatorSpanWorker(this, firstToken); var amdDependencies = []; for (var i = 0, n = leadingTrivia.count(); i < n; i++) { var trivia = leadingTrivia.syntaxTriviaAt(i); @@ -26172,7 +26492,7 @@ var TypeScript; SyntaxTree.prototype.getAmdDependency = function (comment) { var amdDependencyRegEx = /^\/\/\/\s* 0) { return false; } @@ -26310,7 +26629,7 @@ var TypeScript; _super.prototype.visitParameterList.call(this, node); }; GrammarCheckerWalker.prototype.visitHeritageClause = function (node) { - if (this.checkForTrailingComma(node.typeNames) || this.checkForAtLeastOneElement(node, node.typeNames, node.extendsOrImplementsKeyword, TypeScript.SyntaxFacts.getText(node.extendsOrImplementsKeyword.kind()))) { + if (this.checkForTrailingComma(node.typeNames) || this.checkForAtLeastOneElement(node.typeNames, node.extendsOrImplementsKeyword, TypeScript.SyntaxFacts.getText(node.extendsOrImplementsKeyword.kind()))) { return; } _super.prototype.visitHeritageClause.call(this, node); @@ -26322,25 +26641,25 @@ var TypeScript; _super.prototype.visitArgumentList.call(this, node); }; GrammarCheckerWalker.prototype.visitVariableDeclaration = function (node) { - if (this.checkForAtLeastOneElement(node, node.variableDeclarators, node.varKeyword, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.variable_declaration, null)) || this.checkForTrailingComma(node.variableDeclarators)) { + 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, node.typeArguments, node.lessThanToken, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_argument, null))) { + 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, node.types, node.openBracketToken, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type, null))) { + 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, node.typeParameters, node.lessThanToken, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_parameter, null))) { + 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); @@ -26350,7 +26669,7 @@ var TypeScript; this.pushDiagnostic(node.openBracketToken, TypeScript.DiagnosticCode.Index_signature_must_have_exactly_one_parameter); return true; } - var parameter = node.parameters[0]; + var parameter = TypeScript.nonSeparatorAt(node.parameters, 0); if (parameter.dotDotDotToken) { this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signatures_cannot_have_rest_parameters); return true; @@ -26371,7 +26690,7 @@ var TypeScript; this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signature_parameter_must_have_a_type_annotation); return true; } - else if (parameter.typeAnnotation.type.kind() !== 69 /* StringKeyword */ && parameter.typeAnnotation.type.kind() !== 67 /* NumberKeyword */) { + 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; } @@ -26393,7 +26712,7 @@ var TypeScript; 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() === 48 /* ExtendsKeyword */) { + if (heritageClause.extendsOrImplementsKeyword.kind() === 50 /* ExtendsKeyword */) { if (seenExtendsClause) { this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.extends_clause_already_seen); return true; @@ -26402,14 +26721,14 @@ var TypeScript; this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.extends_clause_must_precede_implements_clause); return true; } - if (heritageClause.typeNames.length > 1) { + 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() === 51 /* ImplementsKeyword */); + TypeScript.Debug.assert(heritageClause.extendsOrImplementsKeyword.kind() === 53 /* ImplementsKeyword */); if (seenImplementsClause) { this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.implements_clause_already_seen); return true; @@ -26421,7 +26740,7 @@ var TypeScript; }; GrammarCheckerWalker.prototype.checkForDisallowedDeclareModifier = function (modifiers) { if (this.inAmbientDeclaration) { - var declareToken = TypeScript.SyntaxUtilities.getToken(modifiers, 63 /* DeclareKeyword */); + 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; @@ -26431,7 +26750,7 @@ var TypeScript; }; GrammarCheckerWalker.prototype.checkForRequiredDeclareModifier = function (moduleElement, reportToken, modifiers) { if (!this.inAmbientDeclaration && this.syntaxTree.isDeclaration()) { - if (!TypeScript.SyntaxUtilities.containsToken(modifiers, 63 /* DeclareKeyword */)) { + 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; } @@ -26442,7 +26761,7 @@ var TypeScript; return; } var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); + this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 65 /* DeclareKeyword */); _super.prototype.visitClassDeclaration.call(this, node); this.inAmbientDeclaration = savedInAmbientDeclaration; }; @@ -26451,7 +26770,7 @@ var TypeScript; 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() === 48 /* ExtendsKeyword */) { + if (heritageClause.extendsOrImplementsKeyword.kind() === 50 /* ExtendsKeyword */) { if (seenExtendsClause) { this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.extends_clause_already_seen); return true; @@ -26459,7 +26778,7 @@ var TypeScript; seenExtendsClause = true; } else { - TypeScript.Debug.assert(heritageClause.extendsOrImplementsKeyword.kind() === 51 /* ImplementsKeyword */); + TypeScript.Debug.assert(heritageClause.extendsOrImplementsKeyword.kind() === 53 /* ImplementsKeyword */); this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.Interface_declaration_cannot_have_implements_clause); return true; } @@ -26469,7 +26788,7 @@ var TypeScript; GrammarCheckerWalker.prototype.checkInterfaceModifiers = function (modifiers) { for (var i = 0, n = modifiers.length; i < n; i++) { var modifier = modifiers[i]; - if (modifier.kind() === 63 /* DeclareKeyword */) { + if (modifier.kind() === 65 /* DeclareKeyword */) { this.pushDiagnostic(modifier, TypeScript.DiagnosticCode.A_declare_modifier_cannot_be_used_with_an_interface_declaration); return true; } @@ -26499,7 +26818,7 @@ var TypeScript; } seenAccessibilityModifier = true; } - else if (modifier.kind() === 58 /* StaticKeyword */) { + else if (modifier.kind() === 60 /* StaticKeyword */) { if (seenStaticModifier) { this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_already_seen, [modifier.text()]); return true; @@ -26519,8 +26838,20 @@ var TypeScript; } _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)) { + if (this.checkClassElementModifiers(node.modifiers) || this.checkForTemplatePropertyName(node.propertyName)) { return; } _super.prototype.visitMemberFunctionDeclaration.call(this, node); @@ -26540,12 +26871,12 @@ var TypeScript; }; GrammarCheckerWalker.prototype.checkIndexMemberModifiers = function (node) { if (node.modifiers.length > 0) { - this.pushDiagnostic(TypeScript.childAt(node.modifiers, 0), TypeScript.DiagnosticCode.Modifiers_cannot_appear_here); + this.pushDiagnostic(node.modifiers[0], TypeScript.DiagnosticCode.Modifiers_cannot_appear_here); return true; } return false; }; - GrammarCheckerWalker.prototype.checkEcmaScriptVersionIsAtLeast = function (parent, reportToken, languageVersion, diagnosticKey) { + GrammarCheckerWalker.prototype.checkEcmaScriptVersionIsAtLeast = function (reportToken, languageVersion, diagnosticKey) { if (this.syntaxTree.languageVersion() < languageVersion) { this.pushDiagnostic(reportToken, diagnosticKey); return true; @@ -26559,7 +26890,7 @@ var TypeScript; this.inObjectLiteralExpression = savedInObjectLiteralExpression; }; GrammarCheckerWalker.prototype.visitGetAccessor = function (node) { - if (this.checkForAccessorDeclarationInAmbientContext(node) || this.checkEcmaScriptVersionIsAtLeast(node, node.propertyName, 1 /* ES5 */, TypeScript.DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkForDisallowedAccessorTypeParameters(node.callSignature) || this.checkGetAccessorParameter(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); @@ -26572,7 +26903,7 @@ var TypeScript; return false; }; GrammarCheckerWalker.prototype.checkForDisallowedAccessorTypeParameters = function (callSignature) { - if (callSignature.typeParameterList !== null) { + if (callSignature.typeParameterList) { this.pushDiagnostic(callSignature.typeParameterList, TypeScript.DiagnosticCode.Type_parameters_cannot_appear_on_an_accessor); return true; } @@ -26587,11 +26918,11 @@ var TypeScript; }; GrammarCheckerWalker.prototype.checkSetAccessorParameter = function (node) { var parameters = node.callSignature.parameterList.parameters; - if (TypeScript.childCount(parameters) !== 1) { + if (TypeScript.nonSeparatorCount(parameters) !== 1) { this.pushDiagnostic(node.propertyName, TypeScript.DiagnosticCode.set_accessor_must_have_exactly_one_parameter); return true; } - var parameter = parameters[0]; + var parameter = TypeScript.nonSeparatorAt(parameters, 0); if (parameter.questionToken) { this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.set_accessor_parameter_cannot_be_optional); return true; @@ -26606,8 +26937,14 @@ var TypeScript; } 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, node.propertyName, 1 /* ES5 */, TypeScript.DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkForDisallowedAccessorTypeParameters(node.callSignature) || this.checkForDisallowedSetAccessorTypeAnnotation(node) || this.checkSetAccessorParameter(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); @@ -26617,29 +26954,29 @@ var TypeScript; return; } var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); + 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.childCount(node.enumElements); i < n; i++) { - var child = TypeScript.childAt(node.enumElements, i); - if (i % 2 === 0) { - var enumElement = child; - 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); - } + 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)) { @@ -26650,7 +26987,7 @@ var TypeScript; _super.prototype.visitEnumElement.call(this, node); }; GrammarCheckerWalker.prototype.visitInvocationExpression = function (node) { - if (node.expression.kind() === 50 /* SuperKeyword */ && node.argumentList.typeArgumentList !== null) { + 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); @@ -26660,24 +26997,24 @@ var TypeScript; 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() === 58 /* StaticKeyword */) { + 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() === 63 /* DeclareKeyword */) { + if (modifier.kind() === 65 /* DeclareKeyword */) { if (seenDeclareModifier) { this.pushDiagnostic(modifier, TypeScript.DiagnosticCode.Accessibility_modifier_already_seen); return; } seenDeclareModifier = true; } - else if (modifier.kind() === 47 /* ExportKeyword */) { + 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(47 /* ExportKeyword */), TypeScript.SyntaxFacts.getText(63 /* DeclareKeyword */)]); + this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_must_precede_1_modifier, [TypeScript.SyntaxFacts.getText(49 /* ExportKeyword */), TypeScript.SyntaxFacts.getText(65 /* DeclareKeyword */)]); return; } seenExportModifier = true; @@ -26689,9 +27026,9 @@ var TypeScript; if (!node.stringLiteral) { for (var i = 0, n = node.moduleElements.length; i < n; i++) { var child = node.moduleElements[i]; - if (child.kind() === 134 /* ImportDeclaration */) { + if (child.kind() === 138 /* ImportDeclaration */) { var importDeclaration = child; - if (importDeclaration.moduleReference.kind() === 246 /* ExternalModuleReference */) { + if (importDeclaration.moduleReference.kind() === 211 /* ExternalModuleReference */) { this.pushDiagnostic(importDeclaration, TypeScript.DiagnosticCode.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); } } @@ -26700,7 +27037,7 @@ var TypeScript; return false; }; GrammarCheckerWalker.prototype.checkForDisallowedDeclareModifierOnImportDeclaration = function (modifiers) { - var declareToken = TypeScript.SyntaxUtilities.getToken(modifiers, 63 /* DeclareKeyword */); + 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; @@ -26717,7 +27054,7 @@ var TypeScript; return; } if (node.stringLiteral) { - if (!this.inAmbientDeclaration && !TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */)) { + if (!this.inAmbientDeclaration && !TypeScript.SyntaxUtilities.containsToken(node.modifiers, 65 /* DeclareKeyword */)) { this.pushDiagnostic(node.stringLiteral, TypeScript.DiagnosticCode.Only_ambient_modules_can_use_quoted_names); return; } @@ -26726,14 +27063,14 @@ var TypeScript; return; } var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); + 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() === 135 /* ExportAssignment */) { + if (child.kind() === 139 /* ExportAssignment */) { this.pushDiagnostic(child, TypeScript.DiagnosticCode.Export_assignment_cannot_be_used_in_internal_modules); return true; } @@ -26807,7 +27144,7 @@ var TypeScript; }; GrammarCheckerWalker.prototype.inSwitchStatement = function (ast) { while (ast) { - if (ast.kind() === 152 /* SwitchStatement */) { + if (ast.kind() === 156 /* SwitchStatement */) { return true; } if (TypeScript.SyntaxUtilities.isAnyFunctionExpressionOrDeclaration(ast)) { @@ -26819,10 +27156,10 @@ var TypeScript; }; GrammarCheckerWalker.prototype.isIterationStatement = function (ast) { switch (ast.kind()) { - case 155 /* ForStatement */: - case 156 /* ForInStatement */: - case 159 /* WhileStatement */: - case 162 /* DoStatement */: + case 159 /* ForStatement */: + case 160 /* ForInStatement */: + case 163 /* WhileStatement */: + case 166 /* DoStatement */: return true; } return false; @@ -26843,7 +27180,7 @@ var TypeScript; var result = []; element = element.parent; while (element) { - if (element.kind() === 161 /* LabeledStatement */) { + if (element.kind() === 165 /* LabeledStatement */) { var labeledStatement = element; if (breakable) { result.push(labeledStatement); @@ -26863,12 +27200,12 @@ var TypeScript; }; GrammarCheckerWalker.prototype.labelIsOnContinuableConstruct = function (statement) { switch (statement.kind()) { - case 161 /* LabeledStatement */: + case 165 /* LabeledStatement */: return this.labelIsOnContinuableConstruct(statement.statement); - case 159 /* WhileStatement */: - case 155 /* ForStatement */: - case 156 /* ForInStatement */: - case 162 /* DoStatement */: + case 163 /* WhileStatement */: + case 159 /* ForStatement */: + case 160 /* ForInStatement */: + case 166 /* DoStatement */: return true; default: return false; @@ -27023,21 +27360,21 @@ var TypeScript; } return false; }; - GrammarCheckerWalker.prototype.checkForDisallowedModifiers = function (parent, modifiers) { + GrammarCheckerWalker.prototype.checkForDisallowedModifiers = function (modifiers) { if (this.inBlock || this.inObjectLiteralExpression) { if (modifiers.length > 0) { - this.pushDiagnostic(TypeScript.childAt(modifiers, 0), TypeScript.DiagnosticCode.Modifiers_cannot_appear_here); + 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, node.modifiers) || this.checkForRequiredDeclareModifier(node, node.identifier, node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkForDisallowedEvalOrArguments(node, node.identifier)) { + 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, 63 /* DeclareKeyword */); + this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 65 /* DeclareKeyword */); _super.prototype.visitFunctionDeclaration.call(this, node); this.inAmbientDeclaration = savedInAmbientDeclaration; }; @@ -27047,26 +27384,32 @@ var TypeScript; } _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, node.modifiers) || this.checkForRequiredDeclareModifier(node, node.variableDeclaration.varKeyword, node.modifiers) || this.checkModuleElementModifiers(node.modifiers)) { + 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, 63 /* DeclareKeyword */); + 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 (parent, list, kind) { - for (var i = 0, n = TypeScript.childCount(list); i < n; i++) { - var child = TypeScript.childAt(list, i); - if (i % 2 === 1 && child.kind() !== kind) { + 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, node.typeMembers, 78 /* SemicolonToken */)) { + if (this.checkListSeparators(node.typeMembers, 80 /* SemicolonToken */)) { return; } var savedInAmbientDeclaration = this.inAmbientDeclaration; @@ -27093,13 +27436,20 @@ var TypeScript; this.inAmbientDeclaration = savedInAmbientDeclaration; }; GrammarCheckerWalker.prototype.visitVariableDeclarator = function (node) { - if (this.checkVariableDeclaratorInitializer(node) || this.checkVariableDeclaratorIdentifier(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() !== 137 /* MemberVariableDeclaration */) { + if (node.parent.kind() !== 141 /* MemberVariableDeclaration */) { if (this.checkForDisallowedEvalOrArguments(node, node.propertyName)) { return true; } @@ -27122,7 +27472,7 @@ var TypeScript; GrammarCheckerWalker.prototype.checkConstructorModifiers = function (modifiers) { for (var i = 0, n = modifiers.length; i < n; i++) { var child = modifiers[i]; - if (child.kind() !== 57 /* PublicKeyword */) { + 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; } @@ -27177,15 +27527,15 @@ var TypeScript; return false; }; GrammarCheckerWalker.prototype.isPreIncrementOrDecrementExpression = function (node) { - switch (node.kind()) { - case 170 /* PreDecrementExpression */: - case 169 /* PreIncrementExpression */: + 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() === 11 /* IdentifierName */) { + 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; } @@ -27199,16 +27549,16 @@ var TypeScript; return false; }; GrammarCheckerWalker.prototype.getEvalOrArguments = function (expr) { - if (expr.kind() === 11 /* IdentifierName */) { + if (expr.kind() === 9 /* IdentifierName */) { var text = TypeScript.tokenValueText(expr); if (text === "eval" || text === "arguments") { return text; } } - return null; + return undefined; }; GrammarCheckerWalker.prototype.isEvalOrArguments = function (expr) { - return this.getEvalOrArguments(expr) !== null; + return !!this.getEvalOrArguments(expr); }; GrammarCheckerWalker.prototype.visitConstraint = function (node) { if (this.checkConstraintType(node)) { @@ -27250,7 +27600,7 @@ var TypeScript; } } } - return null; + return undefined; } function implicitImportSpanWorker(trivia) { var implicitImportRegEx = /^(\/\/\/\s*/gim; @@ -27258,24 +27608,24 @@ var TypeScript; if (match) { return new TypeScript.TextSpan(trivia.fullStart(), trivia.fullWidth()); } - return null; + 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 !== null && _firstToken.kind() === 47 /* ExportKeyword */) { + if (_firstToken && _firstToken.kind() === 49 /* ExportKeyword */) { return new TypeScript.TextSpan(TypeScript.start(_firstToken), TypeScript.width(_firstToken)); } - if (moduleElement.kind() === 134 /* ImportDeclaration */) { + if (moduleElement.kind() === 138 /* ImportDeclaration */) { var importDecl = moduleElement; - if (importDecl.moduleReference.kind() === 246 /* ExternalModuleReference */) { + if (importDecl.moduleReference.kind() === 211 /* ExternalModuleReference */) { var literal = importDecl.moduleReference.stringLiteral; return new TypeScript.TextSpan(TypeScript.start(literal), TypeScript.width(literal)); } } } - return null; + return undefined; } })(TypeScript || (TypeScript = {})); var TypeScript; @@ -27360,8 +27710,8 @@ var TypeScript; _scannerParserSource = TypeScript.Scanner.createParserSource(oldSyntaxTree.fileName(), text, oldSyntaxTree.languageVersion()); function release() { _scannerParserSource.release(); - _scannerParserSource = null; - _oldSourceUnitCursor = null; + _scannerParserSource = undefined; + _oldSourceUnitCursor = undefined; _outstandingRewindPointCount = 0; } function extendToAffectedRange(changeRange, sourceUnit) { @@ -27397,11 +27747,11 @@ var TypeScript; _changeDelta = rewindPoint.changeDelta; returnSyntaxCursor(_oldSourceUnitCursor); _oldSourceUnitCursor = rewindPoint.oldSourceUnitCursor; - rewindPoint.oldSourceUnitCursor = null; + rewindPoint.oldSourceUnitCursor = undefined; _scannerParserSource.rewind(rewindPoint); } function releaseRewindPoint(rewindPoint) { - if (rewindPoint.oldSourceUnitCursor !== null) { + if (rewindPoint.oldSourceUnitCursor) { returnSyntaxCursor(rewindPoint.oldSourceUnitCursor); } _scannerParserSource.releaseRewindPoint(rewindPoint); @@ -27415,34 +27765,53 @@ var TypeScript; if (isPinned()) { return false; } - if (_changeRange !== null && _changeRangeNewSpan.intersectsWithPosition(absolutePosition())) { + if (_changeRange && _changeRangeNewSpan.intersectsWithPosition(absolutePosition())) { return false; } syncCursorToNewTextIfBehind(); return _changeDelta === 0 && !_oldSourceUnitCursor.isFinished(); } function updateTokens(nodeOrToken) { - var position = absolutePosition(); - var tokenWasMoved = isPastChangeRange() && TypeScript.fullStart(nodeOrToken) !== position; - if (tokenWasMoved) { - setTokenFullStartWalker.position = position; - TypeScript.visitNodeOrToken(setTokenFullStartWalker, 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 !== null) { + if (node) { updateTokens(node); return node; } } - return null; + return undefined; } function currentToken() { if (canReadFromOldSourceUnit()) { var token = tryGetTokenFromOldSourceUnit(); - if (token !== null) { + if (token) { updateTokens(token); return token; } @@ -27476,8 +27845,8 @@ var TypeScript; function tryGetNodeFromOldSourceUnit() { while (true) { var node = _oldSourceUnitCursor.currentNode(); - if (node === null) { - return null; + if (node === undefined) { + return undefined; } if (!intersectsWithChangeRangeSpanInOriginalText(absolutePosition(), TypeScript.fullWidth(node))) { var isIncrementallyUnusuable = TypeScript.isIncrementallyUnusable(node); @@ -27489,7 +27858,7 @@ var TypeScript; } } function canReuseTokenFromOldSourceUnit(position, token) { - if (token !== null) { + if (token) { if (!intersectsWithChangeRangeSpanInOriginalText(position, token.fullWidth())) { if (!token.isIncrementallyUnusable() && !TypeScript.Scanner.isContextualToken(token)) { return true; @@ -27500,12 +27869,12 @@ var TypeScript; } function tryGetTokenFromOldSourceUnit() { var token = _oldSourceUnitCursor.currentToken(); - return canReuseTokenFromOldSourceUnit(absolutePosition(), token) ? token : null; + return canReuseTokenFromOldSourceUnit(absolutePosition(), token) ? token : undefined; } function peekToken(n) { if (canReadFromOldSourceUnit()) { var token = tryPeekTokenFromOldSourceUnit(n); - if (token !== null) { + if (token) { return token; } } @@ -27524,13 +27893,13 @@ var TypeScript; for (var i = 0; i < n; i++) { var interimToken = _oldSourceUnitCursor.currentToken(); if (!canReuseTokenFromOldSourceUnit(currentPosition, interimToken)) { - return null; + return undefined; } currentPosition += interimToken.fullWidth(); _oldSourceUnitCursor.moveToNextSibling(); } var token = _oldSourceUnitCursor.currentToken(); - return canReuseTokenFromOldSourceUnit(currentPosition, token) ? token : null; + return canReuseTokenFromOldSourceUnit(currentPosition, token) ? token : undefined; } function consumeNode(node) { _oldSourceUnitCursor.moveToNextSibling(); @@ -27549,13 +27918,13 @@ var TypeScript; if (!isPastChangeRange()) { if (absolutePosition() >= _changeRangeNewSpan.end()) { _changeDelta += _changeRange.newLength() - _changeRange.span().length(); - _changeRange = null; + _changeRange = undefined; } } } } function isPastChangeRange() { - return _changeRange === null; + return _changeRange === undefined; } return { text: text, @@ -27588,7 +27957,7 @@ var TypeScript; var cursor = syntaxCursorPoolCount > 0 ? syntaxCursorPool[syntaxCursorPoolCount - 1] : createSyntaxCursor(); if (syntaxCursorPoolCount > 0) { syntaxCursorPoolCount--; - syntaxCursorPool[syntaxCursorPoolCount] = null; + syntaxCursorPool[syntaxCursorPoolCount] = undefined; } return cursor; } @@ -27603,10 +27972,10 @@ var TypeScript; function clean() { for (var i = 0, n = pieces.length; i < n; i++) { var piece = pieces[i]; - if (piece.element === null) { + if (piece.element === undefined) { break; } - piece.element = null; + piece.element = undefined; piece.indexInParent = -1; } currentPieceIndex = -1; @@ -27614,7 +27983,7 @@ var TypeScript; function deepCopyFrom(other) { for (var i = 0, n = other.pieces.length; i < n; i++) { var piece = other.pieces[i]; - if (piece.element === null) { + if (piece.element === undefined) { break; } pushElement(piece.element, piece.indexInParent); @@ -27625,18 +27994,21 @@ var TypeScript; } function currentNodeOrToken() { if (isFinished()) { - return null; + return undefined; } var result = pieces[currentPieceIndex].element; return result; } function currentNode() { var element = currentNodeOrToken(); - return TypeScript.isNode(element) ? element : null; + return TypeScript.isNode(element) ? element : undefined; + } + function isEmptyList(element) { + return TypeScript.isList(element) && element.length === 0; } function moveToFirstChild() { var nodeOrToken = currentNodeOrToken(); - if (nodeOrToken === null) { + if (nodeOrToken === undefined) { return; } if (TypeScript.isToken(nodeOrToken)) { @@ -27644,7 +28016,7 @@ var TypeScript; } for (var i = 0, n = TypeScript.childCount(nodeOrToken); i < n; i++) { var child = TypeScript.childAt(nodeOrToken, i); - if (child !== null && !TypeScript.isShared(child)) { + if (child && !isEmptyList(child)) { pushElement(child, i); moveToFirstChildIfList(); return; @@ -27658,21 +28030,21 @@ var TypeScript; 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 !== null && !TypeScript.isShared(sibling)) { + if (sibling && !isEmptyList(sibling)) { currentPiece.element = sibling; currentPiece.indexInParent = i; moveToFirstChildIfList(); return; } } - currentPiece.element = null; + currentPiece.element = undefined; currentPiece.indexInParent = -1; currentPieceIndex--; } } function moveToFirstChildIfList() { var element = pieces[currentPieceIndex].element; - if (TypeScript.isList(element) || TypeScript.isSeparatedList(element)) { + if (TypeScript.isList(element)) { pushElement(TypeScript.childAt(element, 0), 0); } } @@ -27700,7 +28072,7 @@ var TypeScript; function currentToken() { moveToFirstToken(); var element = currentNodeOrToken(); - return element === null ? null : element; + return element; } return { pieces: pieces, @@ -27716,21 +28088,19 @@ var TypeScript; deepCopyFrom: deepCopyFrom }; } - var SetTokenFullStartWalker = (function (_super) { - __extends(SetTokenFullStartWalker, _super); - function SetTokenFullStartWalker() { + var TokenCollectorWalker = (function (_super) { + __extends(TokenCollectorWalker, _super); + function TokenCollectorWalker() { _super.apply(this, arguments); + this.tokens = []; } - SetTokenFullStartWalker.prototype.visitToken = function (token) { - var position = this.position; - token.setFullStart(position); - this.position = position + token.fullWidth(); + TokenCollectorWalker.prototype.visitToken = function (token) { + this.tokens.push(token); }; - return SetTokenFullStartWalker; + return TokenCollectorWalker; })(TypeScript.SyntaxWalker); - var setTokenFullStartWalker = new SetTokenFullStartWalker(); + var tokenCollectorWalker = new TokenCollectorWalker(); function parse(oldSyntaxTree, textChangeRange, newText) { - TypeScript.Debug.assert(oldSyntaxTree.isConcrete(), "Can only incrementally parse a concrete syntax tree."); if (textChangeRange.isUnchanged()) { return oldSyntaxTree; } @@ -27759,10 +28129,10 @@ var ts; } function autoCollapse(node) { switch (node.kind) { - case 182 /* ModuleBlock */: - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - case 180 /* EnumDeclaration */: + case 189 /* ModuleBlock */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 187 /* EnumDeclaration */: return false; } return true; @@ -27774,11 +28144,11 @@ var ts; return; } switch (n.kind) { - case 151 /* Block */: + case 158 /* Block */: var parent = n.parent; - var openBrace = ts.findChildOfKind(n, 9 /* OpenBraceToken */, sourceFile); - var closeBrace = ts.findChildOfKind(n, 10 /* CloseBraceToken */, sourceFile); - if (parent.kind === 156 /* DoStatement */ || parent.kind === 159 /* ForInStatement */ || parent.kind === 158 /* ForStatement */ || parent.kind === 155 /* IfStatement */ || parent.kind === 157 /* WhileStatement */ || parent.kind === 163 /* WithStatement */) { + 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 */) { addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); } else { @@ -27791,27 +28161,27 @@ var ts; }); } break; - case 176 /* FunctionBlock */: - case 182 /* ModuleBlock */: - case 170 /* TryBlock */: - case 171 /* CatchBlock */: - case 172 /* FinallyBlock */: - var openBrace = ts.findChildOfKind(n, 9 /* OpenBraceToken */, sourceFile); - var closeBrace = ts.findChildOfKind(n, 10 /* CloseBraceToken */, sourceFile); + case 183 /* FunctionBlock */: + case 189 /* ModuleBlock */: + case 177 /* TryBlock */: + case 178 /* CatchBlock */: + case 179 /* 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 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - case 180 /* EnumDeclaration */: - case 136 /* ObjectLiteral */: - case 164 /* SwitchStatement */: - var openBrace = ts.findChildOfKind(n, 9 /* OpenBraceToken */, sourceFile); - var closeBrace = ts.findChildOfKind(n, 10 /* CloseBraceToken */, sourceFile); + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 187 /* EnumDeclaration */: + case 140 /* ObjectLiteral */: + case 171 /* 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 135 /* ArrayLiteral */: - var openBracket = ts.findChildOfKind(n, 13 /* OpenBracketToken */, sourceFile); - var closeBracket = ts.findChildOfKind(n, 14 /* CloseBracketToken */, sourceFile); + case 139 /* ArrayLiteral */: + var openBracket = ts.findChildOfKind(n, 17 /* OpenBracketToken */, sourceFile); + var closeBracket = ts.findChildOfKind(n, 18 /* CloseBracketToken */, sourceFile); addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); break; } @@ -27837,14 +28207,14 @@ var ts; var current = node.parent; while (current) { switch (current.kind) { - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: do { current = current.parent; - } while (current.kind === 181 /* ModuleDeclaration */); - case 177 /* ClassDeclaration */: - case 180 /* EnumDeclaration */: - case 178 /* InterfaceDeclaration */: - case 175 /* FunctionDeclaration */: + } while (current.kind === 188 /* ModuleDeclaration */); + case 184 /* ClassDeclaration */: + case 187 /* EnumDeclaration */: + case 185 /* InterfaceDeclaration */: + case 182 /* FunctionDeclaration */: indent++; } current = current.parent; @@ -27855,10 +28225,10 @@ var ts; var childNodes = []; for (var i = 0, n = nodes.length; i < n; i++) { var node = nodes[i]; - if (node.kind === 177 /* ClassDeclaration */ || node.kind === 180 /* EnumDeclaration */ || node.kind === 178 /* InterfaceDeclaration */ || node.kind === 181 /* ModuleDeclaration */ || node.kind === 175 /* FunctionDeclaration */) { + if (node.kind === 184 /* ClassDeclaration */ || node.kind === 187 /* EnumDeclaration */ || node.kind === 185 /* InterfaceDeclaration */ || node.kind === 188 /* ModuleDeclaration */ || node.kind === 182 /* FunctionDeclaration */) { childNodes.push(node); } - else if (node.kind === 152 /* VariableStatement */) { + else if (node.kind === 159 /* VariableStatement */) { childNodes.push.apply(childNodes, node.declarations); } } @@ -27891,17 +28261,17 @@ var ts; for (var i = 0, n = nodes.length; i < n; i++) { var node = nodes[i]; switch (node.kind) { - case 177 /* ClassDeclaration */: - case 180 /* EnumDeclaration */: - case 178 /* InterfaceDeclaration */: + case 184 /* ClassDeclaration */: + case 187 /* EnumDeclaration */: + case 185 /* InterfaceDeclaration */: topLevelNodes.push(node); break; - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: var moduleDeclaration = node; topLevelNodes.push(node); addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); break; - case 175 /* FunctionDeclaration */: + case 182 /* FunctionDeclaration */: var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); @@ -27912,12 +28282,12 @@ var ts; } } function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 175 /* FunctionDeclaration */) { - if (functionDeclaration.body && functionDeclaration.body.kind === 176 /* FunctionBlock */) { - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 175 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { + 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); })) { return true; } - if (functionDeclaration.parent.kind !== 176 /* FunctionBlock */) { + if (functionDeclaration.parent.kind !== 183 /* FunctionBlock */) { return true; } } @@ -27967,37 +28337,37 @@ var ts; } function createChildItem(node) { switch (node.kind) { - case 119 /* Parameter */: - if ((node.flags & ts.NodeFlags.Modifier) === 0) { + case 123 /* Parameter */: + if ((node.flags & 243 /* Modifier */) === 0) { return undefined; } return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 121 /* Method */: + case 125 /* Method */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberFunctionElement); - case 123 /* GetAccessor */: + case 127 /* GetAccessor */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberGetAccessorElement); - case 124 /* SetAccessor */: + case 128 /* SetAccessor */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); - case 127 /* IndexSignature */: + case 131 /* IndexSignature */: return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 185 /* EnumMember */: + case 192 /* EnumMember */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 125 /* CallSignature */: + case 129 /* CallSignature */: return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); - case 126 /* ConstructSignature */: + case 130 /* ConstructSignature */: return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); - case 120 /* Property */: + case 124 /* Property */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 175 /* FunctionDeclaration */: + case 182 /* FunctionDeclaration */: return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 174 /* VariableDeclaration */: + case 181 /* VariableDeclaration */: if (node.flags & 4096 /* Const */) { return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.constantElement); } else { return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.variableElement); } - case 122 /* Constructor */: + case 126 /* Constructor */: return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); } return undefined; @@ -28027,17 +28397,17 @@ var ts; } function createTopLevelItem(node) { switch (node.kind) { - case 186 /* SourceFile */: + case 193 /* SourceFile */: return createSourceFileItem(node); - case 177 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: return createClassItem(node); - case 180 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: return createEnumItem(node); - case 178 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: return createIterfaceItem(node); - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return createModuleItem(node); - case 175 /* FunctionDeclaration */: + case 182 /* FunctionDeclaration */: return createFunctionItem(node); } return undefined; @@ -28047,7 +28417,7 @@ var ts; } var result = []; result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 181 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 188 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(moduleDeclaration.name.text); } @@ -28059,7 +28429,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 === 176 /* FunctionBlock */) { + if (node.name && node.body && node.body.kind === 183 /* 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)); } @@ -28078,7 +28448,7 @@ var ts; var childItems; if (node.members) { var constructor = ts.forEach(node.members, function (member) { - return member.kind === 122 /* Constructor */ && member; + return member.kind === 126 /* Constructor */ && member; }); var nodes = constructor ? constructor.parameters.concat(node.members) : node.members; var childItems = getItemsWorker(sortNodes(nodes), createChildItem); @@ -28095,13 +28465,13 @@ var ts; } } function getInnermostModule(node) { - while (node.body.kind === 181 /* ModuleDeclaration */) { + while (node.body.kind === 188 /* ModuleDeclaration */) { node = node.body; } return node; } function getNodeSpan(node) { - return node.kind === 186 /* SourceFile */ ? TypeScript.TextSpan.fromBounds(node.getFullStart(), node.getEnd()) : TypeScript.TextSpan.fromBounds(node.getStart(), node.getEnd()); + return node.kind === 193 /* SourceFile */ ? TypeScript.TextSpan.fromBounds(node.getFullStart(), node.getEnd()) : TypeScript.TextSpan.fromBounds(node.getStart(), node.getEnd()); } function getTextOfNode(node) { return ts.getTextOfNodeFromSourceText(sourceFile.text, node); @@ -28149,10 +28519,10 @@ var TypeScript; var leadingTrivia = firstTokenInLine.leadingTrivia(); for (var i = leadingTrivia.count() - 1; i >= 0; i--) { var trivia = leadingTrivia.syntaxTriviaAt(i); - if (trivia.kind() === 5 /* NewLineTrivia */) { + if (trivia.kind() === 3 /* NewLineTrivia */) { break; } - if (trivia.kind() === 6 /* MultiLineCommentTrivia */) { + if (trivia.kind() === 4 /* MultiLineCommentTrivia */) { var lineSegments = TypeScript.Syntax.splitMultiLineCommentTriviaIntoMultipleLines(trivia); leadingTextInReverse.push(TypeScript.ArrayUtilities.last(lineSegments)); if (lineSegments.length > 0) { @@ -28234,13 +28604,13 @@ var ts; } return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); function getImmediatelyContainingArgumentInfo(node) { - if (node.parent.kind !== 140 /* CallExpression */ && node.parent.kind !== 141 /* NewExpression */) { + if (node.parent.kind !== 144 /* CallExpression */ && node.parent.kind !== 145 /* NewExpression */) { return undefined; } var parent = node.parent; - if (node.kind === 19 /* LessThanToken */ || node.kind === 11 /* OpenParenToken */) { + if (node.kind === 23 /* LessThanToken */ || node.kind === 15 /* OpenParenToken */) { var list = getChildListThatStartsWithOpenerToken(parent, node, sourceFile); - ts.Debug.assert(list); + ts.Debug.assert(list !== undefined); return { list: list, listItemIndex: 0 @@ -28249,12 +28619,12 @@ var ts; return ts.findListItemInfo(node); } function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 186 /* SourceFile */; n = n.parent) { - if (n.kind === 176 /* FunctionBlock */) { + for (var n = node; n.kind !== 193 /* SourceFile */; n = n.parent) { + if (n.kind === 183 /* FunctionBlock */) { return undefined; } if (n.pos < n.parent.pos || n.end > n.parent.end) { - ts.Debug.fail("Node of kind " + ts.SyntaxKind[n.kind] + " is not a subspan of its parent of kind " + ts.SyntaxKind[n.parent.kind]); + ts.Debug.fail("Node of kind " + n.kind + " is not a subspan of its parent of kind " + n.parent.kind); } var argumentInfo = getImmediatelyContainingArgumentInfo(n); if (argumentInfo) { @@ -28300,20 +28670,20 @@ var ts; prefixParts.push.apply(prefixParts, callTargetDisplayParts); } if (isTypeParameterHelp) { - prefixParts.push(ts.punctuationPart(19 /* LessThanToken */)); + prefixParts.push(ts.punctuationPart(23 /* LessThanToken */)); var typeParameters = candidateSignature.typeParameters; signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray; - suffixParts.push(ts.punctuationPart(20 /* GreaterThanToken */)); + suffixParts.push(ts.punctuationPart(24 /* GreaterThanToken */)); var parameterParts = ts.mapToDisplayParts(function (writer) { return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, argumentListOrTypeArgumentList); }); suffixParts.push.apply(suffixParts, 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(11 /* OpenParenToken */)); + prefixParts.push(ts.punctuationPart(15 /* OpenParenToken */)); var parameters = candidateSignature.parameters; signatureHelpParameters = parameters.length > 0 ? ts.map(parameters, createSignatureHelpParameterForParameter) : emptyArray; - suffixParts.push(ts.punctuationPart(12 /* CloseParenToken */)); + suffixParts.push(ts.punctuationPart(16 /* CloseParenToken */)); } var returnTypeParts = ts.mapToDisplayParts(function (writer) { return typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, argumentListOrTypeArgumentList); }); suffixParts.push.apply(suffixParts, returnTypeParts); @@ -28321,7 +28691,7 @@ var ts; isVariadic: candidateSignature.hasRestParameter, prefixDisplayParts: prefixParts, suffixDisplayParts: suffixParts, - separatorDisplayParts: [ts.punctuationPart(18 /* CommaToken */), ts.spacePart()], + separatorDisplayParts: [ts.punctuationPart(22 /* CommaToken */), ts.spacePart()], parameters: signatureHelpParameters, documentation: candidateSignature.getDocumentationComment() }; @@ -28330,7 +28700,7 @@ var ts; var applicableSpanEnd = ts.skipTrivia(sourceFile.text, argumentListOrTypeArgumentList.end, false); var applicableSpan = new TypeScript.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 === 18 /* CommaToken */; }); + var argumentCount = argumentListOrTypeArgumentList.getChildCount() === 0 ? 0 : 1 + ts.countWhere(argumentListOrTypeArgumentList.getChildren(), function (arg) { return arg.kind === 22 /* CommaToken */; }); var selectedItemIndex = candidates.indexOf(bestSignature); if (selectedItemIndex < 0) { selectedItemIndex = selectBestInvalidOverloadIndex(candidates, argumentCount); @@ -28387,7 +28757,7 @@ var ts; ts.findChildOfKind = findChildOfKind; function findContainingList(node) { var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { - if (c.kind === 188 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { + if (c.kind === 195 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { return c; } }); @@ -28395,7 +28765,7 @@ var ts; } ts.findContainingList = findContainingList; function findListItemIndexContainingPosition(list, position) { - ts.Debug.assert(list.kind === 188 /* SyntaxList */); + ts.Debug.assert(list.kind === 195 /* SyntaxList */); var children = list.getChildren(); for (var i = 0; i < children.length; i++) { if (children[i].pos <= position && children[i].end > position) { @@ -28502,7 +28872,7 @@ var ts; } } } - ts.Debug.assert(startNode || n.kind === 186 /* SourceFile */); + ts.Debug.assert(startNode !== undefined || n.kind === 193 /* SourceFile */); if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, children.length); return candidate && findRightmostToken(candidate); @@ -28518,30 +28888,30 @@ var ts; } ts.findPrecedingToken = findPrecedingToken; function nodeHasTokens(n) { - if (n.kind === 154 /* ExpressionStatement */) { + if (n.kind === 161 /* ExpressionStatement */) { return nodeHasTokens(n.expression); } - if (n.kind === 1 /* EndOfFileToken */ || n.kind === 150 /* OmittedExpression */ || n.kind === 116 /* Missing */) { + if (n.kind === 1 /* EndOfFileToken */ || n.kind === 157 /* OmittedExpression */ || n.kind === 120 /* Missing */) { return false; } - return n.kind !== 188 /* SyntaxList */ || n.getChildCount() !== 0; + return n.kind !== 195 /* SyntaxList */ || n.getChildCount() !== 0; } function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 128 /* TypeReference */ || node.kind === 140 /* CallExpression */) { + if (node.kind === 132 /* TypeReference */ || node.kind === 144 /* CallExpression */) { return node.typeArguments; } - if (ts.isAnyFunction(node) || node.kind === 177 /* ClassDeclaration */ || node.kind === 178 /* InterfaceDeclaration */) { + if (ts.isAnyFunction(node) || node.kind === 184 /* ClassDeclaration */ || node.kind === 185 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; } ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; function isToken(n) { - return n.kind >= ts.SyntaxKind.FirstToken && n.kind <= ts.SyntaxKind.LastToken; + return n.kind >= 1 /* FirstToken */ && n.kind <= 119 /* LastToken */; } ts.isToken = isToken; function isWord(n) { - return n.kind === 59 /* Identifier */ || ts.isKeyword(n.kind); + return n.kind === 63 /* Identifier */ || ts.isKeyword(n.kind); } function isPropertyName(n) { return n.kind === 7 /* StringLiteral */ || n.kind === 6 /* NumericLiteral */ || isWord(n); @@ -28551,7 +28921,7 @@ var ts; } ts.isComment = isComment; function isPunctuation(n) { - return ts.SyntaxKind.FirstPunctuation <= n.kind && n.kind <= ts.SyntaxKind.LastPunctuation; + return 13 /* FirstPunctuation */ <= n.kind && n.kind <= 62 /* LastPunctuation */; } ts.isPunctuation = isPunctuation; })(ts || (ts = {})); @@ -28802,7 +29172,7 @@ var TypeScript; FormattingManager.prototype.formatOnSemicolon = function (caretPosition) { var sourceUnit = this.syntaxTree.sourceUnit(); var semicolonPositionedToken = TypeScript.findToken(sourceUnit, caretPosition - 1); - if (semicolonPositionedToken.kind() === 78 /* SemicolonToken */) { + 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; @@ -28815,7 +29185,7 @@ var TypeScript; FormattingManager.prototype.formatOnClosingCurlyBrace = function (caretPosition) { var sourceUnit = this.syntaxTree.sourceUnit(); var closeBracePositionedToken = TypeScript.findToken(sourceUnit, caretPosition - 1); - if (closeBracePositionedToken.kind() === 71 /* CloseBraceToken */) { + 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; @@ -29029,71 +29399,71 @@ var TypeScript; 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(7 /* SingleLineCommentTrivia */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create1(0 /* Ignore */)); - this.NoSpaceBeforeSemicolon = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 78 /* SemicolonToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeColon = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 106 /* 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, 105 /* QuestionToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); - this.SpaceAfterColon = new Formatting.Rule(Formatting.RuleDescriptor.create3(106 /* 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(105 /* 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(78 /* SemicolonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceAfterCloseBrace = new Formatting.Rule(Formatting.RuleDescriptor.create3(71 /* 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(71 /* CloseBraceToken */, 23 /* ElseKeyword */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceBetweenCloseBraceAndWhile = new Formatting.Rule(Formatting.RuleDescriptor.create1(71 /* CloseBraceToken */, 42 /* WhileKeyword */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceAfterCloseBrace = new Formatting.Rule(Formatting.RuleDescriptor.create3(71 /* CloseBraceToken */, Formatting.Shared.TokenRange.FromTokens([73 /* CloseParenToken */, 75 /* CloseBracketToken */, 79 /* CommaToken */, 78 /* SemicolonToken */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeDot = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 76 /* DotToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterDot = new Formatting.Rule(Formatting.RuleDescriptor.create3(76 /* 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, 74 /* OpenBracketToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterOpenBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(74 /* 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, 75 /* CloseBracketToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterCloseBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(75 /* CloseBracketToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + 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, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 1 /* Space */), 1 /* CanDeleteNewLines */); - this.TypeScriptOpenBraceLeftTokenRange = Formatting.Shared.TokenRange.FromTokens([11 /* IdentifierName */, 6 /* MultiLineCommentTrivia */]); - this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 1 /* Space */), 1 /* CanDeleteNewLines */); - this.ControlOpenBraceLeftTokenRange = Formatting.Shared.TokenRange.FromTokens([73 /* CloseParenToken */, 6 /* MultiLineCommentTrivia */, 22 /* DoKeyword */, 38 /* TryKeyword */, 25 /* FinallyKeyword */, 23 /* ElseKeyword */]); - this.SpaceBeforeOpenBraceInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 70 /* 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(70 /* 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, 71 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 1 /* Space */)); - this.NoSpaceBetweenEmptyBraceBrackets = new Formatting.Rule(Formatting.RuleDescriptor.create1(70 /* OpenBraceToken */, 71 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectContext), 3 /* Delete */)); - this.NewLineAfterOpenBraceInBlockContext = new Formatting.Rule(Formatting.RuleDescriptor.create3(70 /* 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, 71 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 2 /* NewLine */)); + 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(93 /* PlusPlusToken */, Formatting.Shared.TokenRange.UnaryPreincrementExpressions), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterUnaryPredecrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create3(94 /* 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, 93 /* PlusPlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeUnaryPostdecrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.UnaryPostdecrementExpressions, 94 /* MinusMinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterPostincrementWhenFollowedByAdd = new Formatting.Rule(Formatting.RuleDescriptor.create1(93 /* PlusPlusToken */, 89 /* PlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterAddWhenFollowedByUnaryPlus = new Formatting.Rule(Formatting.RuleDescriptor.create1(89 /* PlusToken */, 89 /* PlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterAddWhenFollowedByPreincrement = new Formatting.Rule(Formatting.RuleDescriptor.create1(89 /* PlusToken */, 93 /* PlusPlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterPostdecrementWhenFollowedBySubtract = new Formatting.Rule(Formatting.RuleDescriptor.create1(94 /* MinusMinusToken */, 90 /* MinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new Formatting.Rule(Formatting.RuleDescriptor.create1(90 /* MinusToken */, 90 /* MinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterSubtractWhenFollowedByPredecrement = new Formatting.Rule(Formatting.RuleDescriptor.create1(90 /* MinusToken */, 94 /* 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, 79 /* CommaToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterCertainKeywords = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.FromTokens([40 /* VarKeyword */, 36 /* ThrowKeyword */, 31 /* NewKeyword */, 21 /* DeleteKeyword */, 33 /* ReturnKeyword */, 39 /* 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, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext), 3 /* Delete */)); - this.SpaceAfterFunctionInFuncDecl = new Formatting.Rule(Formatting.RuleDescriptor.create3(27 /* 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, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 3 /* Delete */)); - this.SpaceAfterVoidOperator = new Formatting.Rule(Formatting.RuleDescriptor.create3(41 /* 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(33 /* ReturnKeyword */, 78 /* SemicolonToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceBetweenStatements = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.FromTokens([73 /* CloseParenToken */, 22 /* DoKeyword */, 23 /* ElseKeyword */, 16 /* 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([38 /* TryKeyword */, 25 /* FinallyKeyword */]), 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceAfterGetSetInMember = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.FromTokens([64 /* GetKeyword */, 68 /* SetKeyword */]), 11 /* IdentifierName */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 1 /* Space */)); + 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(62 /* ConstructorKeyword */, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterModuleImport = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.FromTokens([65 /* ModuleKeyword */, 66 /* RequireKeyword */]), 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterCertainTypeScriptKeywords = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.FromTokens([44 /* ClassKeyword */, 63 /* DeclareKeyword */, 46 /* EnumKeyword */, 47 /* ExportKeyword */, 48 /* ExtendsKeyword */, 64 /* GetKeyword */, 51 /* ImplementsKeyword */, 49 /* ImportKeyword */, 52 /* InterfaceKeyword */, 65 /* ModuleKeyword */, 55 /* PrivateKeyword */, 57 /* PublicKeyword */, 68 /* SetKeyword */, 58 /* 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([48 /* ExtendsKeyword */, 51 /* ImplementsKeyword */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceAfterModuleName = new Formatting.Rule(Formatting.RuleDescriptor.create1(14 /* StringLiteral */, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsModuleDeclContext), 1 /* Space */)); - this.SpaceAfterArrow = new Formatting.Rule(Formatting.RuleDescriptor.create3(85 /* EqualsGreaterThanToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceAfterEllipsis = new Formatting.Rule(Formatting.RuleDescriptor.create1(77 /* DotDotDotToken */, 11 /* IdentifierName */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterOptionalParameters = new Formatting.Rule(Formatting.RuleDescriptor.create3(105 /* QuestionToken */, Formatting.Shared.TokenRange.FromTokens([73 /* CloseParenToken */, 79 /* 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, 80 /* LessThanToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceBetweenCloseParenAndAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create1(73 /* CloseParenToken */, 80 /* LessThanToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceAfterOpenAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(80 /* 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, 81 /* GreaterThanToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceAfterCloseAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(81 /* GreaterThanToken */, Formatting.Shared.TokenRange.FromTokens([72 /* OpenParenToken */, 74 /* OpenBracketToken */, 81 /* GreaterThanToken */, 79 /* CommaToken */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new Formatting.Rule(Formatting.RuleDescriptor.create1(70 /* OpenBraceToken */, 71 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), 3 /* Delete */)); + 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, @@ -29161,26 +29531,26 @@ var TypeScript; this.SpaceBetweenStatements, this.SpaceAfterTryFinally ]; - this.SpaceAfterComma = new Formatting.Rule(Formatting.RuleDescriptor.create3(79 /* CommaToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceAfterComma = new Formatting.Rule(Formatting.RuleDescriptor.create3(79 /* CommaToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); + 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, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext), 1 /* Space */)); - this.NoSpaceAfterKeywordInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Keywords, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext), 3 /* Delete */)); - this.NewLineBeforeOpenBraceInFunction = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 70 /* 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, 70 /* 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, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsBeforeMultilineBlockContext), 2 /* NewLine */), 1 /* CanDeleteNewLines */); - this.SpaceAfterSemicolonInFor = new Formatting.Rule(Formatting.RuleDescriptor.create3(78 /* 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(78 /* 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(72 /* 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, 73 /* CloseParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceBetweenParens = new Formatting.Rule(Formatting.RuleDescriptor.create1(72 /* OpenParenToken */, 73 /* CloseParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterOpenParen = new Formatting.Rule(Formatting.RuleDescriptor.create3(72 /* 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, 73 /* CloseParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterAnonymousFunctionKeyword = new Formatting.Rule(Formatting.RuleDescriptor.create1(27 /* FunctionKeyword */, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 1 /* Space */)); - this.NoSpaceAfterAnonymousFunctionKeyword = new Formatting.Rule(Formatting.RuleDescriptor.create1(27 /* FunctionKeyword */, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 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; @@ -29192,56 +29562,22 @@ var TypeScript; throw new Error(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Unknown_rule, null)); }; Rules.IsForContext = function (context) { - return context.contextNode.kind() === 155 /* ForStatement */; + return context.contextNode.kind() === 159 /* ForStatement */; }; Rules.IsNotForContext = function (context) { return !Rules.IsForContext(context); }; Rules.IsBinaryOpContext = function (context) { switch (context.contextNode.kind()) { - case 175 /* AssignmentExpression */: - case 176 /* AddAssignmentExpression */: - case 177 /* SubtractAssignmentExpression */: - case 178 /* MultiplyAssignmentExpression */: - case 179 /* DivideAssignmentExpression */: - case 180 /* ModuloAssignmentExpression */: - case 181 /* AndAssignmentExpression */: - case 182 /* ExclusiveOrAssignmentExpression */: - case 183 /* OrAssignmentExpression */: - case 184 /* LeftShiftAssignmentExpression */: - case 185 /* SignedRightShiftAssignmentExpression */: - case 186 /* UnsignedRightShiftAssignmentExpression */: - case 187 /* ConditionalExpression */: - case 188 /* LogicalOrExpression */: - case 189 /* LogicalAndExpression */: - case 190 /* BitwiseOrExpression */: - case 191 /* BitwiseExclusiveOrExpression */: - case 192 /* BitwiseAndExpression */: - case 193 /* EqualsWithTypeConversionExpression */: - case 194 /* NotEqualsWithTypeConversionExpression */: - case 195 /* EqualsExpression */: - case 196 /* NotEqualsExpression */: - case 197 /* LessThanExpression */: - case 198 /* GreaterThanExpression */: - case 199 /* LessThanOrEqualExpression */: - case 200 /* GreaterThanOrEqualExpression */: - case 201 /* InstanceOfExpression */: - case 202 /* InExpression */: - case 203 /* LeftShiftExpression */: - case 204 /* SignedRightShiftExpression */: - case 205 /* UnsignedRightShiftExpression */: - case 206 /* MultiplyExpression */: - case 207 /* DivideExpression */: - case 208 /* ModuloExpression */: - case 209 /* AddExpression */: - case 210 /* SubtractExpression */: + case 174 /* BinaryExpression */: + case 173 /* ConditionalExpression */: return true; - case 134 /* ImportDeclaration */: - case 226 /* VariableDeclarator */: - case 233 /* EqualsValueClause */: - return context.currentTokenSpan.kind === 107 /* EqualsToken */ || context.nextTokenSpan.kind === 107 /* EqualsToken */; - case 156 /* ForInStatement */: - return context.currentTokenSpan.kind === 29 /* InKeyword */ || context.nextTokenSpan.kind === 29 /* InKeyword */; + 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; }; @@ -29271,26 +29607,26 @@ var TypeScript; return true; } switch (node.kind()) { - case 147 /* Block */: - case 152 /* SwitchStatement */: - case 216 /* ObjectLiteralExpression */: + case 151 /* Block */: + case 156 /* SwitchStatement */: + case 179 /* ObjectLiteralExpression */: return true; } return false; }; Rules.IsFunctionDeclContext = function (context) { switch (context.contextNode.kind()) { - case 130 /* FunctionDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 146 /* MethodSignature */: - case 143 /* CallSignature */: - case 223 /* FunctionExpression */: - case 138 /* ConstructorDeclaration */: - case 220 /* SimpleArrowFunctionExpression */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 129 /* InterfaceDeclaration */: + 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; @@ -29300,51 +29636,51 @@ var TypeScript; }; Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { switch (node.kind()) { - case 132 /* ClassDeclaration */: - case 133 /* EnumDeclaration */: - case 122 /* ObjectType */: - case 131 /* ModuleDeclaration */: + 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 132 /* ClassDeclaration */: - case 131 /* ModuleDeclaration */: - case 133 /* EnumDeclaration */: - case 147 /* Block */: - case 152 /* SwitchStatement */: + 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 148 /* IfStatement */: - case 152 /* SwitchStatement */: - case 155 /* ForStatement */: - case 156 /* ForInStatement */: - case 159 /* WhileStatement */: - case 160 /* TryStatement */: - case 162 /* DoStatement */: - case 164 /* WithStatement */: - case 236 /* ElseClause */: - case 237 /* CatchClause */: - case 238 /* FinallyClause */: + 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() === 216 /* ObjectLiteralExpression */; + return context.contextNode.kind() === 179 /* ObjectLiteralExpression */; }; Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind() === 214 /* InvocationExpression */; + return context.contextNode.kind() === 177 /* InvocationExpression */; }; Rules.IsNewContext = function (context) { - return context.contextNode.kind() === 217 /* ObjectCreationExpression */; + return context.contextNode.kind() === 180 /* ObjectCreationExpression */; }; Rules.IsFunctionCallOrNewContext = function (context) { return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); @@ -29356,19 +29692,19 @@ var TypeScript; return context.formattingRequestKind != 2 /* FormatOnEnter */; }; Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind() === 131 /* ModuleDeclaration */; + return context.contextNode.kind() === 135 /* ModuleDeclaration */; }; Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind() === 122 /* ObjectType */ && context.contextNode.parent().kind() !== 129 /* InterfaceDeclaration */; + return context.contextNode.kind() === 124 /* ObjectType */ && context.contextNode.parent().kind() !== 133 /* InterfaceDeclaration */; }; Rules.IsTypeArgumentOrParameter = function (tokenKind, parentKind) { - return ((tokenKind === 80 /* LessThanToken */ || tokenKind === 81 /* GreaterThanToken */) && (parentKind === 230 /* TypeParameterList */ || parentKind === 229 /* TypeArgumentList */)); + 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 === 41 /* VoidKeyword */ && context.currentTokenParent.kind() === 173 /* VoidExpression */; + return context.currentTokenSpan.kind === 43 /* VoidKeyword */ && context.currentTokenParent.kind() === 172 /* VoidExpression */; }; return Rules; })(); @@ -29721,20 +30057,20 @@ var TypeScript; return this.tokenAccess.toString(); }; TokenRange.Any = TokenRange.AllTokens(); - TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([6 /* MultiLineCommentTrivia */])); + TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([4 /* MultiLineCommentTrivia */])); TokenRange.Keywords = TokenRange.FromRange(TypeScript.SyntaxKind.FirstKeyword, TypeScript.SyntaxKind.LastKeyword); - TokenRange.Operators = TokenRange.FromRange(78 /* SemicolonToken */, 119 /* SlashEqualsToken */); - TokenRange.BinaryOperators = TokenRange.FromRange(80 /* LessThanToken */, 119 /* SlashEqualsToken */); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([29 /* InKeyword */, 30 /* InstanceOfKeyword */]); + 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([93 /* PlusPlusToken */, 94 /* MinusMinusToken */, 102 /* TildeToken */, 101 /* ExclamationToken */]); - TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([13 /* NumericLiteral */, 11 /* IdentifierName */, 72 /* OpenParenToken */, 74 /* OpenBracketToken */, 70 /* OpenBraceToken */, 35 /* ThisKeyword */, 31 /* NewKeyword */]); - TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([11 /* IdentifierName */, 72 /* OpenParenToken */, 35 /* ThisKeyword */, 31 /* NewKeyword */]); - TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([11 /* IdentifierName */, 73 /* CloseParenToken */, 75 /* CloseBracketToken */, 31 /* NewKeyword */]); - TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([11 /* IdentifierName */, 72 /* OpenParenToken */, 35 /* ThisKeyword */, 31 /* NewKeyword */]); - TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([11 /* IdentifierName */, 73 /* CloseParenToken */, 75 /* CloseBracketToken */, 31 /* NewKeyword */]); - TokenRange.Comments = TokenRange.FromTokens([7 /* SingleLineCommentTrivia */, 6 /* MultiLineCommentTrivia */]); - TokenRange.TypeNames = TokenRange.FromTokens([11 /* IdentifierName */, 67 /* NumberKeyword */, 69 /* StringKeyword */, 61 /* BooleanKeyword */, 41 /* VoidKeyword */, 60 /* AnyKeyword */]); + 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; @@ -29873,10 +30209,8 @@ var TypeScript; (function (Services) { var Formatting; (function (Formatting) { - var IndentationTrackingWalker = (function (_super) { - __extends(IndentationTrackingWalker, _super); + var IndentationTrackingWalker = (function () { function IndentationTrackingWalker(textSpan, sourceUnit, snapshot, indentFirstToken, options) { - _super.call(this); this.options = options; this._position = 0; this._parent = null; @@ -29925,17 +30259,34 @@ var TypeScript; if (tokenSpan.intersectsWithTextSpan(this._textSpan)) { this.visitTokenInSpan(token); var trivia = token.trailingTrivia(); - this._lastTriviaWasNewLine = trivia.hasNewLine() && trivia.syntaxTriviaAt(trivia.count() - 1).kind() == 5 /* NewLineTrivia */; + 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); - TypeScript.visitNodeOrToken(this, node); + 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; } @@ -29944,13 +30295,13 @@ var TypeScript; } }; IndentationTrackingWalker.prototype.getTokenIndentationAmount = function (token) { - if (TypeScript.firstToken(this._parent.node()) === token || token.kind() === 70 /* OpenBraceToken */ || token.kind() === 71 /* CloseBraceToken */ || token.kind() === 74 /* OpenBracketToken */ || token.kind() === 75 /* CloseBracketToken */ || (token.kind() === 42 /* WhileKeyword */ && this._parent.node().kind() == 162 /* DoStatement */)) { + 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() === 71 /* CloseBraceToken */ || token.kind() === 75 /* CloseBracketToken */) { + if (token.kind() === 73 /* CloseBraceToken */ || token.kind() === 77 /* CloseBracketToken */) { return (this._parent.indentationAmount() + this._parent.childIndentationAmountDelta()); } return this._parent.indentationAmount(); @@ -29962,7 +30313,7 @@ var TypeScript; parentIndentationAmount = parent.indentationAmount(); } else { - if (parent.kind() === 147 /* Block */ && !this.shouldIndentBlockInParent(this._parent.parent())) { + if (parent.kind() === 151 /* Block */ && !this.shouldIndentBlockInParent(this._parent.parent())) { parent = this._parent.parent(); } var line = this._snapshot.getLineFromPosition(parent.start()).getText(); @@ -29978,46 +30329,46 @@ var TypeScript; indentationAmount = (parentIndentationAmount + parentIndentationAmountDelta); indentationAmountDelta = 0; break; - case 132 /* ClassDeclaration */: - case 131 /* ModuleDeclaration */: - case 122 /* ObjectType */: - case 133 /* EnumDeclaration */: - case 152 /* SwitchStatement */: - case 216 /* ObjectLiteralExpression */: - case 138 /* ConstructorDeclaration */: - case 130 /* FunctionDeclaration */: - case 223 /* FunctionExpression */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 139 /* IndexMemberDeclaration */: - case 237 /* CatchClause */: - case 215 /* ArrayLiteralExpression */: - case 124 /* ArrayType */: - case 222 /* ElementAccessExpression */: - case 145 /* IndexSignature */: - case 155 /* ForStatement */: - case 156 /* ForInStatement */: - case 159 /* WhileStatement */: - case 162 /* DoStatement */: - case 164 /* WithStatement */: - case 234 /* CaseSwitchClause */: - case 235 /* DefaultSwitchClause */: - case 151 /* ReturnStatement */: - case 158 /* ThrowStatement */: - case 220 /* SimpleArrowFunctionExpression */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 225 /* VariableDeclaration */: - case 135 /* ExportAssignment */: - case 214 /* InvocationExpression */: - case 217 /* ObjectCreationExpression */: - case 143 /* CallSignature */: - case 144 /* ConstructSignature */: + 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 148 /* IfStatement */: - if (parent.kind() === 236 /* ElseClause */ && !TypeScript.SyntaxUtilities.isLastTokenOnLine(parentNode.elseKeyword, this._text)) { + case 152 /* IfStatement */: + if (parent.kind() === 200 /* ElseClause */ && !TypeScript.SyntaxUtilities.isLastTokenOnLine(parentNode.elseKeyword, this._text)) { indentationAmount = parentIndentationAmount; } else { @@ -30025,11 +30376,11 @@ var TypeScript; } indentationAmountDelta = this.options.indentSpaces; break; - case 236 /* ElseClause */: + case 200 /* ElseClause */: indentationAmount = parentIndentationAmount; indentationAmountDelta = this.options.indentSpaces; break; - case 147 /* Block */: + case 151 /* Block */: if (this.shouldIndentBlockInParent(parent)) { indentationAmount = parentIndentationAmount + parentIndentationAmountDelta; } @@ -30056,11 +30407,11 @@ var TypeScript; }; IndentationTrackingWalker.prototype.shouldIndentBlockInParent = function (parent) { switch (parent.kind()) { - case 120 /* SourceUnit */: - case 131 /* ModuleDeclaration */: - case 147 /* Block */: - case 234 /* CaseSwitchClause */: - case 235 /* DefaultSwitchClause */: + case 122 /* SourceUnit */: + case 135 /* ModuleDeclaration */: + case 151 /* Block */: + case 198 /* CaseSwitchClause */: + case 199 /* DefaultSwitchClause */: return true; default: return false; @@ -30076,7 +30427,7 @@ var TypeScript; } }; return IndentationTrackingWalker; - })(TypeScript.SyntaxWalker); + })(); Formatting.IndentationTrackingWalker = IndentationTrackingWalker; })(Formatting = Services.Formatting || (Services.Formatting = {})); })(Services = TypeScript.Services || (TypeScript.Services = {})); @@ -30126,19 +30477,19 @@ var TypeScript; continue; } switch (trivia.kind()) { - case 6 /* MultiLineCommentTrivia */: + case 4 /* MultiLineCommentTrivia */: this.recordIndentationEditsForMultiLineComment(trivia, position, commentIndentationString, leadingWhiteSpace, !indentNextTokenOrTrivia); indentNextTokenOrTrivia = false; leadingWhiteSpace = ""; break; - case 7 /* SingleLineCommentTrivia */: - case 8 /* SkippedTokenTrivia */: + case 5 /* SingleLineCommentTrivia */: + case 6 /* SkippedTokenTrivia */: if (indentNextTokenOrTrivia) { this.recordIndentationEditsForSingleLineOrSkippedText(trivia, position, commentIndentationString); indentNextTokenOrTrivia = false; } break; - case 4 /* WhitespaceTrivia */: + case 2 /* WhitespaceTrivia */: var nextTrivia = length > i + 1 && triviaList.syntaxTriviaAt(i + 1); var whiteSpaceIndentationString = nextTrivia && nextTrivia.isComment() ? commentIndentationString : indentationString; if (indentNextTokenOrTrivia) { @@ -30149,7 +30500,7 @@ var TypeScript; } leadingWhiteSpace += trivia.fullText(); break; - case 5 /* NewLineTrivia */: + case 3 /* NewLineTrivia */: indentNextTokenOrTrivia = true; leadingWhiteSpace = ""; break; @@ -30158,7 +30509,7 @@ var TypeScript; } } } - if (token.kind() !== 10 /* EndOfFileToken */ && indentNextTokenOrTrivia) { + if (token.kind() !== 8 /* EndOfFileToken */ && indentNextTokenOrTrivia) { if (indentationString.length > 0) { this.recordEdit(position, 0, indentationString); } @@ -30241,7 +30592,7 @@ var TypeScript; } Formatter.getEdits = function (textSpan, sourceUnit, options, indentFirstToken, snapshot, rulesProvider, formattingRequestKind) { var walker = new Formatter(textSpan, sourceUnit, indentFirstToken, options, snapshot, rulesProvider, formattingRequestKind); - TypeScript.visitNodeOrToken(walker, sourceUnit); + walker.walk(sourceUnit); return walker.edits(); }; Formatter.prototype.visitTokenInSpan = function (token) { @@ -30365,7 +30716,7 @@ var TypeScript; } }; Formatter.prototype.trimWhitespace = function (line, token) { - if (token && (token.kind == 6 /* MultiLineCommentTrivia */ || token.kind == 7 /* SingleLineCommentTrivia */) && token.start() <= line.endPosition() && token.end() >= line.endPosition()) + 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; @@ -30456,7 +30807,7 @@ var ts; return 0; } var lineAtPosition = sourceFile.getLineAndCharacterFromPosition(position).line; - if (precedingToken.kind === 18 /* CommaToken */ && precedingToken.parent.kind !== 148 /* BinaryExpression */) { + if (precedingToken.kind === 22 /* CommaToken */ && precedingToken.parent.kind !== 153 /* BinaryExpression */) { var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1) { return actualIndentation; @@ -30516,7 +30867,7 @@ var ts; 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 === 186 /* SourceFile */ || !parentAndChildShareLine); + var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && (parent.kind === 193 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1; } @@ -30527,10 +30878,10 @@ var ts; if (!nextToken) { return false; } - if (nextToken.kind === 9 /* OpenBraceToken */) { + if (nextToken.kind === 13 /* OpenBraceToken */) { return true; } - else if (nextToken.kind === 10 /* CloseBraceToken */) { + else if (nextToken.kind === 14 /* CloseBraceToken */) { var nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line; return lineAtPosition === nextTokenStartLine; } @@ -30543,9 +30894,9 @@ var ts; return candidate.end > position || !isCompletedNode(candidate, sourceFile); } function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 155 /* IfStatement */ && parent.elseStatement === child) { - var elseKeyword = ts.findChildOfKind(parent, 70 /* ElseKeyword */, sourceFile); - ts.Debug.assert(elseKeyword); + if (parent.kind === 162 /* 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; } @@ -30553,29 +30904,29 @@ var ts; function getActualIndentationForListItem(node, sourceFile, options) { if (node.parent) { switch (node.parent.kind) { - case 128 /* TypeReference */: + case 132 /* TypeReference */: if (node.parent.typeArguments) { return getActualIndentationFromList(node.parent.typeArguments); } break; - case 136 /* ObjectLiteral */: + case 140 /* ObjectLiteral */: return getActualIndentationFromList(node.parent.properties); - case 130 /* TypeLiteral */: + case 134 /* TypeLiteral */: return getActualIndentationFromList(node.parent.members); - case 135 /* ArrayLiteral */: + case 139 /* ArrayLiteral */: return getActualIndentationFromList(node.parent.elements); - case 175 /* FunctionDeclaration */: - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: - case 121 /* Method */: - case 125 /* CallSignature */: - case 126 /* ConstructSignature */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 150 /* 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); } return getActualIndentationFromList(node.parent.parameters); - case 141 /* NewExpression */: - case 140 /* CallExpression */: + case 145 /* NewExpression */: + case 144 /* CallExpression */: if (node.parent.typeArguments && node.end < node.parent.typeArguments.end) { return getActualIndentationFromList(node.parent.typeArguments); } @@ -30593,7 +30944,7 @@ var ts; var node = list[index]; var lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile); for (var i = index - 1; i >= 0; --i) { - if (list[i].kind === 18 /* CommaToken */) { + if (list[i].kind === 22 /* CommaToken */) { continue; } var prevEndLine = sourceFile.getLineAndCharacterFromPosition(list[i].end).line; @@ -30623,45 +30974,45 @@ var ts; } function nodeContentIsIndented(parent, child) { switch (parent.kind) { - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - case 180 /* EnumDeclaration */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 187 /* EnumDeclaration */: return true; - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return false; - case 175 /* FunctionDeclaration */: - case 121 /* Method */: - case 144 /* FunctionExpression */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 122 /* Constructor */: + case 182 /* FunctionDeclaration */: + case 125 /* Method */: + case 149 /* FunctionExpression */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: return false; - case 156 /* DoStatement */: - case 157 /* WhileStatement */: - case 159 /* ForInStatement */: - case 158 /* ForStatement */: - return child && child.kind !== 151 /* Block */; - case 155 /* IfStatement */: - return child && child.kind !== 151 /* Block */; - case 169 /* TryStatement */: + 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 135 /* ArrayLiteral */: - case 151 /* Block */: - case 176 /* FunctionBlock */: - case 170 /* TryBlock */: - case 171 /* CatchBlock */: - case 172 /* FinallyBlock */: - case 182 /* ModuleBlock */: - case 136 /* ObjectLiteral */: - case 130 /* TypeLiteral */: - case 164 /* SwitchStatement */: - case 166 /* DefaultClause */: - case 165 /* CaseClause */: - case 143 /* ParenExpression */: - case 140 /* CallExpression */: - case 141 /* NewExpression */: - case 152 /* VariableStatement */: - case 174 /* VariableDeclaration */: + 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; default: return false; @@ -30674,7 +31025,7 @@ var ts; if (last.kind === expectedLastToken) { return true; } - else if (last.kind === 17 /* SemicolonToken */ && children.length !== 1) { + else if (last.kind === 21 /* SemicolonToken */ && children.length !== 1) { return children[children.length - 2].kind === expectedLastToken; } } @@ -30682,49 +31033,49 @@ var ts; } function isCompletedNode(n, sourceFile) { switch (n.kind) { - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - case 180 /* EnumDeclaration */: - case 136 /* ObjectLiteral */: - case 151 /* Block */: - case 171 /* CatchBlock */: - case 172 /* FinallyBlock */: - case 176 /* FunctionBlock */: - case 182 /* ModuleBlock */: - case 164 /* SwitchStatement */: - return nodeEndsWith(n, 10 /* CloseBraceToken */, sourceFile); - case 143 /* ParenExpression */: - case 125 /* CallSignature */: - case 140 /* CallExpression */: - case 126 /* ConstructSignature */: - return nodeEndsWith(n, 12 /* CloseParenToken */, sourceFile); - case 175 /* FunctionDeclaration */: - case 144 /* FunctionExpression */: - case 121 /* Method */: - case 145 /* ArrowFunction */: + 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 */: + return nodeEndsWith(n, 14 /* CloseBraceToken */, sourceFile); + case 148 /* ParenExpression */: + case 129 /* CallSignature */: + case 144 /* CallExpression */: + case 130 /* ConstructSignature */: + return nodeEndsWith(n, 16 /* CloseParenToken */, sourceFile); + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 125 /* Method */: + case 150 /* ArrowFunction */: return !n.body || isCompletedNode(n.body, sourceFile); - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: return n.body && isCompletedNode(n.body, sourceFile); - case 155 /* IfStatement */: + case 162 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 154 /* ExpressionStatement */: + case 161 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile); - case 135 /* ArrayLiteral */: - return nodeEndsWith(n, 14 /* CloseBracketToken */, sourceFile); - case 116 /* Missing */: + case 139 /* ArrayLiteral */: + return nodeEndsWith(n, 18 /* CloseBracketToken */, sourceFile); + case 120 /* Missing */: return false; - case 165 /* CaseClause */: - case 166 /* DefaultClause */: + case 172 /* CaseClause */: + case 173 /* DefaultClause */: return false; - case 157 /* WhileStatement */: + case 164 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 156 /* DoStatement */: - var hasWhileKeyword = ts.findChildOfKind(n, 94 /* WhileKeyword */, sourceFile); + case 163 /* DoStatement */: + var hasWhileKeyword = ts.findChildOfKind(n, 98 /* WhileKeyword */, sourceFile); if (hasWhileKeyword) { - return nodeEndsWith(n, 12 /* CloseParenToken */, sourceFile); + return nodeEndsWith(n, 16 /* CloseParenToken */, sourceFile); } return isCompletedNode(n.statement, sourceFile); default: @@ -30769,1203 +31120,6 @@ var TypeScript; TypeScript.createIntrinsicsObject = createIntrinsicsObject; })(TypeScript || (TypeScript = {})); var TypeScript; -(function (TypeScript) { - var Comment = (function () { - function Comment(_trivia, endsLine, _start, _end) { - this._trivia = _trivia; - this.endsLine = endsLine; - this._start = _start; - this._end = _end; - } - Comment.prototype.start = function () { - return this._start; - }; - Comment.prototype.end = function () { - return this._end; - }; - Comment.prototype.fullText = function () { - return this._trivia.fullText(); - }; - Comment.prototype.kind = function () { - return this._trivia.kind(); - }; - Comment.prototype.structuralEquals = function (ast, includingPosition) { - if (includingPosition) { - if (this.start() !== ast.start() || this.end() !== ast.end()) { - return false; - } - } - return this._trivia.fullText() === ast._trivia.fullText() && this.endsLine === ast.endsLine; - }; - return Comment; - })(); - TypeScript.Comment = Comment; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function walkListChildren(preAst, walker) { - for (var i = 0, n = preAst.length; i < n; i++) { - walker.walk(preAst[i]); - } - } - function walkThrowStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkPrefixUnaryExpressionChildren(preAst, walker) { - walker.walk(preAst.operand); - } - function walkPostfixUnaryExpressionChildren(preAst, walker) { - walker.walk(preAst.operand); - } - function walkDeleteExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkTypeArgumentListChildren(preAst, walker) { - walker.walk(preAst.typeArguments); - } - function walkTupleTypeChildren(preAst, walker) { - walker.walk(preAst.types); - } - function walkTypeOfExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkVoidExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkArgumentListChildren(preAst, walker) { - walker.walk(preAst.typeArgumentList); - walker.walk(preAst.arguments); - } - function walkArrayLiteralExpressionChildren(preAst, walker) { - walker.walk(preAst.expressions); - } - function walkSimplePropertyAssignmentChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.expression); - } - function walkFunctionPropertyAssignmentChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkGetAccessorChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkSeparatedListChildren(preAst, walker) { - for (var i = 0, n = preAst.length; i < n; i++) { - walker.walk(preAst[i]); - } - } - function walkSetAccessorChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkObjectLiteralExpressionChildren(preAst, walker) { - walker.walk(preAst.propertyAssignments); - } - function walkCastExpressionChildren(preAst, walker) { - walker.walk(preAst.type); - walker.walk(preAst.expression); - } - function walkParenthesizedExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkElementAccessExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.argumentExpression); - } - function walkMemberAccessExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.name); - } - function walkQualifiedNameChildren(preAst, walker) { - walker.walk(preAst.left); - walker.walk(preAst.right); - } - function walkBinaryExpressionChildren(preAst, walker) { - walker.walk(preAst.left); - walker.walk(preAst.right); - } - function walkEqualsValueClauseChildren(preAst, walker) { - walker.walk(preAst.value); - } - function walkTypeParameterChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.constraint); - } - function walkTypeParameterListChildren(preAst, walker) { - walker.walk(preAst.typeParameters); - } - function walkGenericTypeChildren(preAst, walker) { - walker.walk(preAst.name); - walker.walk(preAst.typeArgumentList); - } - function walkTypeAnnotationChildren(preAst, walker) { - walker.walk(preAst.type); - } - function walkTypeQueryChildren(preAst, walker) { - walker.walk(preAst.name); - } - function walkInvocationExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.argumentList); - } - function walkObjectCreationExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.argumentList); - } - function walkTrinaryExpressionChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.whenTrue); - walker.walk(preAst.whenFalse); - } - function walkFunctionExpressionChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkFunctionTypeChildren(preAst, walker) { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.type); - } - function walkParenthesizedArrowFunctionExpressionChildren(preAst, walker) { - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - walker.walk(preAst.expression); - } - function walkSimpleArrowFunctionExpressionChildren(preAst, walker) { - walker.walk(preAst.parameter); - walker.walk(preAst.block); - walker.walk(preAst.expression); - } - function walkMemberFunctionDeclarationChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkFuncDeclChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkIndexMemberDeclarationChildren(preAst, walker) { - walker.walk(preAst.indexSignature); - } - function walkIndexSignatureChildren(preAst, walker) { - walker.walk(preAst.parameters); - walker.walk(preAst.typeAnnotation); - } - function walkCallSignatureChildren(preAst, walker) { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.typeAnnotation); - } - function walkConstraintChildren(preAst, walker) { - walker.walk(preAst.typeOrExpression); - } - function walkConstructorDeclarationChildren(preAst, walker) { - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkConstructorTypeChildren(preAst, walker) { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.type); - } - function walkConstructSignatureChildren(preAst, walker) { - walker.walk(preAst.callSignature); - } - function walkParameterChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.equalsValueClause); - } - function walkParameterListChildren(preAst, walker) { - walker.walk(preAst.parameters); - } - function walkPropertySignatureChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.typeAnnotation); - } - function walkVariableDeclaratorChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.equalsValueClause); - } - function walkMemberVariableDeclarationChildren(preAst, walker) { - walker.walk(preAst.variableDeclarator); - } - function walkMethodSignatureChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - } - function walkReturnStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkForStatementChildren(preAst, walker) { - walker.walk(preAst.variableDeclaration); - walker.walk(preAst.initializer); - walker.walk(preAst.condition); - walker.walk(preAst.incrementor); - walker.walk(preAst.statement); - } - function walkForInStatementChildren(preAst, walker) { - walker.walk(preAst.variableDeclaration); - walker.walk(preAst.left); - walker.walk(preAst.expression); - walker.walk(preAst.statement); - } - function walkIfStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - walker.walk(preAst.elseClause); - } - function walkElseClauseChildren(preAst, walker) { - walker.walk(preAst.statement); - } - function walkWhileStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - function walkDoStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - function walkBlockChildren(preAst, walker) { - walker.walk(preAst.statements); - } - function walkVariableDeclarationChildren(preAst, walker) { - walker.walk(preAst.variableDeclarators); - } - function walkCaseSwitchClauseChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.statements); - } - function walkDefaultSwitchClauseChildren(preAst, walker) { - walker.walk(preAst.statements); - } - function walkSwitchStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.switchClauses); - } - function walkTryStatementChildren(preAst, walker) { - walker.walk(preAst.block); - walker.walk(preAst.catchClause); - walker.walk(preAst.finallyClause); - } - function walkCatchClauseChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.block); - } - function walkExternalModuleReferenceChildren(preAst, walker) { - walker.walk(preAst.stringLiteral); - } - function walkFinallyClauseChildren(preAst, walker) { - walker.walk(preAst.block); - } - function walkClassDeclChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeParameterList); - walker.walk(preAst.heritageClauses); - walker.walk(preAst.classElements); - } - function walkScriptChildren(preAst, walker) { - walker.walk(preAst.moduleElements); - } - function walkHeritageClauseChildren(preAst, walker) { - walker.walk(preAst.typeNames); - } - function walkInterfaceDeclerationChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeParameterList); - walker.walk(preAst.heritageClauses); - walker.walk(preAst.body); - } - function walkObjectTypeChildren(preAst, walker) { - walker.walk(preAst.typeMembers); - } - function walkArrayTypeChildren(preAst, walker) { - walker.walk(preAst.type); - } - function walkModuleDeclarationChildren(preAst, walker) { - walker.walk(preAst.name); - walker.walk(preAst.stringLiteral); - walker.walk(preAst.moduleElements); - } - function walkModuleNameModuleReferenceChildren(preAst, walker) { - walker.walk(preAst.moduleName); - } - function walkEnumDeclarationChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.enumElements); - } - function walkEnumElementChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.equalsValueClause); - } - function walkImportDeclarationChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.moduleReference); - } - function walkExportAssignmentChildren(preAst, walker) { - walker.walk(preAst.identifier); - } - function walkWithStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - function walkExpressionStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkLabeledStatementChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.statement); - } - function walkVariableStatementChildren(preAst, walker) { - walker.walk(preAst.variableDeclaration); - } - var childrenWalkers = new Array(TypeScript.SyntaxKind.LastNode + 1); - for (var i = TypeScript.SyntaxKind.FirstToken, n = TypeScript.SyntaxKind.LastToken; i <= n; i++) { - childrenWalkers[i] = null; - } - for (var i = TypeScript.SyntaxKind.FirstTrivia, n = TypeScript.SyntaxKind.LastTrivia; i <= n; i++) { - childrenWalkers[i] = null; - } - childrenWalkers[176 /* AddAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[209 /* AddExpression */] = walkBinaryExpressionChildren; - childrenWalkers[181 /* AndAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[60 /* AnyKeyword */] = null; - childrenWalkers[227 /* ArgumentList */] = walkArgumentListChildren; - childrenWalkers[215 /* ArrayLiteralExpression */] = walkArrayLiteralExpressionChildren; - childrenWalkers[124 /* ArrayType */] = walkArrayTypeChildren; - childrenWalkers[220 /* SimpleArrowFunctionExpression */] = walkSimpleArrowFunctionExpressionChildren; - childrenWalkers[219 /* ParenthesizedArrowFunctionExpression */] = walkParenthesizedArrowFunctionExpressionChildren; - childrenWalkers[175 /* AssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[192 /* BitwiseAndExpression */] = walkBinaryExpressionChildren; - childrenWalkers[191 /* BitwiseExclusiveOrExpression */] = walkBinaryExpressionChildren; - childrenWalkers[167 /* BitwiseNotExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[190 /* BitwiseOrExpression */] = walkBinaryExpressionChildren; - childrenWalkers[147 /* Block */] = walkBlockChildren; - childrenWalkers[61 /* BooleanKeyword */] = null; - childrenWalkers[153 /* BreakStatement */] = null; - childrenWalkers[143 /* CallSignature */] = walkCallSignatureChildren; - childrenWalkers[234 /* CaseSwitchClause */] = walkCaseSwitchClauseChildren; - childrenWalkers[221 /* CastExpression */] = walkCastExpressionChildren; - childrenWalkers[237 /* CatchClause */] = walkCatchClauseChildren; - childrenWalkers[132 /* ClassDeclaration */] = walkClassDeclChildren; - childrenWalkers[174 /* CommaExpression */] = walkBinaryExpressionChildren; - childrenWalkers[187 /* ConditionalExpression */] = walkTrinaryExpressionChildren; - childrenWalkers[240 /* Constraint */] = walkConstraintChildren; - childrenWalkers[138 /* ConstructorDeclaration */] = walkConstructorDeclarationChildren; - childrenWalkers[144 /* ConstructSignature */] = walkConstructSignatureChildren; - childrenWalkers[154 /* ContinueStatement */] = null; - childrenWalkers[125 /* ConstructorType */] = walkConstructorTypeChildren; - childrenWalkers[163 /* DebuggerStatement */] = null; - childrenWalkers[235 /* DefaultSwitchClause */] = walkDefaultSwitchClauseChildren; - childrenWalkers[171 /* DeleteExpression */] = walkDeleteExpressionChildren; - childrenWalkers[179 /* DivideAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[207 /* DivideExpression */] = walkBinaryExpressionChildren; - childrenWalkers[162 /* DoStatement */] = walkDoStatementChildren; - childrenWalkers[222 /* ElementAccessExpression */] = walkElementAccessExpressionChildren; - childrenWalkers[236 /* ElseClause */] = walkElseClauseChildren; - childrenWalkers[157 /* EmptyStatement */] = null; - childrenWalkers[133 /* EnumDeclaration */] = walkEnumDeclarationChildren; - childrenWalkers[244 /* EnumElement */] = walkEnumElementChildren; - childrenWalkers[195 /* EqualsExpression */] = walkBinaryExpressionChildren; - childrenWalkers[233 /* EqualsValueClause */] = walkEqualsValueClauseChildren; - childrenWalkers[193 /* EqualsWithTypeConversionExpression */] = walkBinaryExpressionChildren; - childrenWalkers[182 /* ExclusiveOrAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[135 /* ExportAssignment */] = walkExportAssignmentChildren; - childrenWalkers[150 /* ExpressionStatement */] = walkExpressionStatementChildren; - childrenWalkers[231 /* ExtendsHeritageClause */] = walkHeritageClauseChildren; - childrenWalkers[246 /* ExternalModuleReference */] = walkExternalModuleReferenceChildren; - childrenWalkers[24 /* FalseKeyword */] = null; - childrenWalkers[238 /* FinallyClause */] = walkFinallyClauseChildren; - childrenWalkers[156 /* ForInStatement */] = walkForInStatementChildren; - childrenWalkers[155 /* ForStatement */] = walkForStatementChildren; - childrenWalkers[130 /* FunctionDeclaration */] = walkFuncDeclChildren; - childrenWalkers[223 /* FunctionExpression */] = walkFunctionExpressionChildren; - childrenWalkers[242 /* FunctionPropertyAssignment */] = walkFunctionPropertyAssignmentChildren; - childrenWalkers[123 /* FunctionType */] = walkFunctionTypeChildren; - childrenWalkers[126 /* GenericType */] = walkGenericTypeChildren; - childrenWalkers[140 /* GetAccessor */] = walkGetAccessorChildren; - childrenWalkers[198 /* GreaterThanExpression */] = walkBinaryExpressionChildren; - childrenWalkers[200 /* GreaterThanOrEqualExpression */] = walkBinaryExpressionChildren; - childrenWalkers[148 /* IfStatement */] = walkIfStatementChildren; - childrenWalkers[232 /* ImplementsHeritageClause */] = walkHeritageClauseChildren; - childrenWalkers[134 /* ImportDeclaration */] = walkImportDeclarationChildren; - childrenWalkers[139 /* IndexMemberDeclaration */] = walkIndexMemberDeclarationChildren; - childrenWalkers[145 /* IndexSignature */] = walkIndexSignatureChildren; - childrenWalkers[202 /* InExpression */] = walkBinaryExpressionChildren; - childrenWalkers[201 /* InstanceOfExpression */] = walkBinaryExpressionChildren; - childrenWalkers[129 /* InterfaceDeclaration */] = walkInterfaceDeclerationChildren; - childrenWalkers[214 /* InvocationExpression */] = walkInvocationExpressionChildren; - childrenWalkers[161 /* LabeledStatement */] = walkLabeledStatementChildren; - childrenWalkers[184 /* LeftShiftAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[203 /* LeftShiftExpression */] = walkBinaryExpressionChildren; - childrenWalkers[197 /* LessThanExpression */] = walkBinaryExpressionChildren; - childrenWalkers[199 /* LessThanOrEqualExpression */] = walkBinaryExpressionChildren; - childrenWalkers[1 /* List */] = walkListChildren; - childrenWalkers[189 /* LogicalAndExpression */] = walkBinaryExpressionChildren; - childrenWalkers[168 /* LogicalNotExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[188 /* LogicalOrExpression */] = walkBinaryExpressionChildren; - childrenWalkers[213 /* MemberAccessExpression */] = walkMemberAccessExpressionChildren; - childrenWalkers[136 /* MemberFunctionDeclaration */] = walkMemberFunctionDeclarationChildren; - childrenWalkers[137 /* MemberVariableDeclaration */] = walkMemberVariableDeclarationChildren; - childrenWalkers[146 /* MethodSignature */] = walkMethodSignatureChildren; - childrenWalkers[131 /* ModuleDeclaration */] = walkModuleDeclarationChildren; - childrenWalkers[247 /* ModuleNameModuleReference */] = walkModuleNameModuleReferenceChildren; - childrenWalkers[180 /* ModuloAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[208 /* ModuloExpression */] = walkBinaryExpressionChildren; - childrenWalkers[178 /* MultiplyAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[206 /* MultiplyExpression */] = walkBinaryExpressionChildren; - childrenWalkers[11 /* IdentifierName */] = null; - childrenWalkers[166 /* NegateExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[0 /* None */] = null; - childrenWalkers[196 /* NotEqualsExpression */] = walkBinaryExpressionChildren; - childrenWalkers[194 /* NotEqualsWithTypeConversionExpression */] = walkBinaryExpressionChildren; - childrenWalkers[32 /* NullKeyword */] = null; - childrenWalkers[67 /* NumberKeyword */] = null; - childrenWalkers[13 /* NumericLiteral */] = null; - childrenWalkers[217 /* ObjectCreationExpression */] = walkObjectCreationExpressionChildren; - childrenWalkers[216 /* ObjectLiteralExpression */] = walkObjectLiteralExpressionChildren; - childrenWalkers[122 /* ObjectType */] = walkObjectTypeChildren; - childrenWalkers[224 /* OmittedExpression */] = null; - childrenWalkers[183 /* OrAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[243 /* Parameter */] = walkParameterChildren; - childrenWalkers[228 /* ParameterList */] = walkParameterListChildren; - childrenWalkers[218 /* ParenthesizedExpression */] = walkParenthesizedExpressionChildren; - childrenWalkers[165 /* PlusExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[212 /* PostDecrementExpression */] = walkPostfixUnaryExpressionChildren; - childrenWalkers[211 /* PostIncrementExpression */] = walkPostfixUnaryExpressionChildren; - childrenWalkers[170 /* PreDecrementExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[169 /* PreIncrementExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[142 /* PropertySignature */] = walkPropertySignatureChildren; - childrenWalkers[121 /* QualifiedName */] = walkQualifiedNameChildren; - childrenWalkers[12 /* RegularExpressionLiteral */] = null; - childrenWalkers[151 /* ReturnStatement */] = walkReturnStatementChildren; - childrenWalkers[120 /* SourceUnit */] = walkScriptChildren; - childrenWalkers[2 /* SeparatedList */] = walkSeparatedListChildren; - childrenWalkers[141 /* SetAccessor */] = walkSetAccessorChildren; - childrenWalkers[185 /* SignedRightShiftAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[204 /* SignedRightShiftExpression */] = walkBinaryExpressionChildren; - childrenWalkers[241 /* SimplePropertyAssignment */] = walkSimplePropertyAssignmentChildren; - childrenWalkers[14 /* StringLiteral */] = null; - childrenWalkers[69 /* StringKeyword */] = null; - childrenWalkers[177 /* SubtractAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[210 /* SubtractExpression */] = walkBinaryExpressionChildren; - childrenWalkers[50 /* SuperKeyword */] = null; - childrenWalkers[152 /* SwitchStatement */] = walkSwitchStatementChildren; - childrenWalkers[35 /* ThisKeyword */] = null; - childrenWalkers[158 /* ThrowStatement */] = walkThrowStatementChildren; - childrenWalkers[3 /* TriviaList */] = null; - childrenWalkers[37 /* TrueKeyword */] = null; - childrenWalkers[160 /* TryStatement */] = walkTryStatementChildren; - childrenWalkers[128 /* TupleType */] = walkTupleTypeChildren; - childrenWalkers[245 /* TypeAnnotation */] = walkTypeAnnotationChildren; - childrenWalkers[229 /* TypeArgumentList */] = walkTypeArgumentListChildren; - childrenWalkers[172 /* TypeOfExpression */] = walkTypeOfExpressionChildren; - childrenWalkers[239 /* TypeParameter */] = walkTypeParameterChildren; - childrenWalkers[230 /* TypeParameterList */] = walkTypeParameterListChildren; - childrenWalkers[127 /* TypeQuery */] = walkTypeQueryChildren; - childrenWalkers[186 /* UnsignedRightShiftAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[205 /* UnsignedRightShiftExpression */] = walkBinaryExpressionChildren; - childrenWalkers[225 /* VariableDeclaration */] = walkVariableDeclarationChildren; - childrenWalkers[226 /* VariableDeclarator */] = walkVariableDeclaratorChildren; - childrenWalkers[149 /* VariableStatement */] = walkVariableStatementChildren; - childrenWalkers[173 /* VoidExpression */] = walkVoidExpressionChildren; - childrenWalkers[41 /* VoidKeyword */] = null; - childrenWalkers[159 /* WhileStatement */] = walkWhileStatementChildren; - childrenWalkers[164 /* WithStatement */] = walkWithStatementChildren; - for (var e in TypeScript.SyntaxKind) { - if (TypeScript.SyntaxKind.hasOwnProperty(e) && TypeScript.StringUtilities.isString(TypeScript.SyntaxKind[e])) { - TypeScript.Debug.assert(childrenWalkers[e] !== undefined, "Fix initWalkers: " + TypeScript.SyntaxKind[e]); - } - } - var AstWalkOptions = (function () { - function AstWalkOptions() { - this.goChildren = true; - this.stopWalking = false; - } - return AstWalkOptions; - })(); - TypeScript.AstWalkOptions = AstWalkOptions; - var SimplePreAstWalker = (function () { - function SimplePreAstWalker(pre, state) { - this.pre = pre; - this.state = state; - this.options = new AstWalkOptions(); - } - SimplePreAstWalker.prototype.walk = function (ast) { - if (!ast) { - return; - } - this.pre(ast, this.state); - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - }; - return SimplePreAstWalker; - })(); - var SimplePrePostAstWalker = (function () { - function SimplePrePostAstWalker(pre, post, state) { - this.pre = pre; - this.post = post; - this.state = state; - this.options = new AstWalkOptions(); - } - SimplePrePostAstWalker.prototype.walk = function (ast) { - if (!ast) { - return; - } - this.pre(ast, this.state); - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - this.post(ast, this.state); - }; - return SimplePrePostAstWalker; - })(); - var NormalAstWalker = (function () { - function NormalAstWalker(pre, post, state) { - this.pre = pre; - this.post = post; - this.state = state; - this.options = new AstWalkOptions(); - } - NormalAstWalker.prototype.walk = function (ast) { - if (!ast) { - return; - } - if (this.options.stopWalking) { - return; - } - this.pre(ast, this); - if (this.options.stopWalking) { - return; - } - if (this.options.goChildren) { - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - } - else { - this.options.goChildren = true; - } - if (this.post) { - this.post(ast, this); - } - }; - return NormalAstWalker; - })(); - var AstWalkerFactory = (function () { - function AstWalkerFactory() { - } - AstWalkerFactory.prototype.walk = function (ast, pre, post, state) { - new NormalAstWalker(pre, post, state).walk(ast); - }; - AstWalkerFactory.prototype.simpleWalk = function (ast, pre, post, state) { - if (post) { - new SimplePrePostAstWalker(pre, post, state).walk(ast); - } - else { - new SimplePreAstWalker(pre, state).walk(ast); - } - }; - return AstWalkerFactory; - })(); - TypeScript.AstWalkerFactory = AstWalkerFactory; - var globalAstWalkerFactory = new AstWalkerFactory(); - function getAstWalkerFactory() { - return globalAstWalkerFactory; - } - TypeScript.getAstWalkerFactory = getAstWalkerFactory; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ASTHelpers; - (function (ASTHelpers) { - var sentinelEmptyArray = []; - function isValidAstNode(ast) { - return ast && !TypeScript.isShared(ast) && TypeScript.start(ast) !== -1 && TypeScript.end(ast) !== -1; - } - ASTHelpers.isValidAstNode = isValidAstNode; - function isValidSpan(ast) { - if (!ast) - return false; - if (ast.start() === -1 || ast.end() === -1) - return false; - return true; - } - ASTHelpers.isValidSpan = isValidSpan; - function getAstAtPosition(script, pos, useTrailingTriviaAsLimChar, forceInclusive) { - if (useTrailingTriviaAsLimChar === void 0) { useTrailingTriviaAsLimChar = true; } - if (forceInclusive === void 0) { forceInclusive = false; } - var top = null; - var pre = function (cur, walker) { - if (!TypeScript.isShared(cur) && isValidAstNode(cur)) { - var isInvalid1 = cur.kind() === 150 /* ExpressionStatement */ && TypeScript.width(cur) === 0; - if (isInvalid1) { - walker.options.goChildren = false; - } - else { - var inclusive = forceInclusive || cur.kind() === 11 /* IdentifierName */ || cur.kind() === 213 /* MemberAccessExpression */ || cur.kind() === 121 /* QualifiedName */ || cur.kind() === 225 /* VariableDeclaration */ || cur.kind() === 226 /* VariableDeclarator */ || cur.kind() === 214 /* InvocationExpression */ || pos === TypeScript.end(script) + TypeScript.lastToken(script).trailingTriviaWidth(); - var minChar = TypeScript.start(cur); - var limChar = TypeScript.end(cur) + (useTrailingTriviaAsLimChar ? TypeScript.trailingTriviaWidth(cur) : 0) + (inclusive ? 1 : 0); - if (pos >= minChar && pos < limChar) { - if ((cur.kind() !== 1 /* List */ && cur.kind() !== 2 /* SeparatedList */) || TypeScript.end(cur) > TypeScript.start(cur)) { - if (top === null) { - top = cur; - } - else if (TypeScript.start(cur) >= TypeScript.start(top) && (TypeScript.end(cur) + (useTrailingTriviaAsLimChar ? TypeScript.trailingTriviaWidth(cur) : 0)) <= (TypeScript.end(top) + (useTrailingTriviaAsLimChar ? TypeScript.trailingTriviaWidth(top) : 0))) { - if (TypeScript.width(top) !== 0 || TypeScript.width(cur) !== 0) { - top = cur; - } - } - } - } - walker.options.goChildren = (minChar <= pos && pos <= limChar); - } - } - }; - TypeScript.getAstWalkerFactory().walk(script, pre); - return top; - } - ASTHelpers.getAstAtPosition = getAstAtPosition; - function getExtendsHeritageClause(clauses) { - return getHeritageClause(clauses, 231 /* ExtendsHeritageClause */); - } - ASTHelpers.getExtendsHeritageClause = getExtendsHeritageClause; - function getImplementsHeritageClause(clauses) { - return getHeritageClause(clauses, 232 /* ImplementsHeritageClause */); - } - ASTHelpers.getImplementsHeritageClause = getImplementsHeritageClause; - function getHeritageClause(clauses, kind) { - if (clauses) { - for (var i = 0, n = clauses.length; i < n; i++) { - var child = clauses[i]; - if (child.typeNames.length > 0 && child.kind() === kind) { - return child; - } - } - } - return null; - } - function isCallExpression(ast) { - return (ast && ast.kind() === 214 /* InvocationExpression */) || (ast && ast.kind() === 217 /* ObjectCreationExpression */); - } - ASTHelpers.isCallExpression = isCallExpression; - function isCallExpressionTarget(ast) { - return !!getCallExpressionTarget(ast); - } - ASTHelpers.isCallExpressionTarget = isCallExpressionTarget; - function getCallExpressionTarget(ast) { - if (!ast) { - return null; - } - var current = ast; - while (current && current.parent) { - if (current.parent.kind() === 213 /* MemberAccessExpression */ && current.parent.name === current) { - current = current.parent; - continue; - } - break; - } - if (current && current.parent) { - if (current.parent.kind() === 214 /* InvocationExpression */ || current.parent.kind() === 217 /* ObjectCreationExpression */) { - return current === current.parent.expression ? current : null; - } - } - return null; - } - ASTHelpers.getCallExpressionTarget = getCallExpressionTarget; - function isNameOfSomeDeclaration(ast) { - if (ast === null || ast.parent === null) { - return false; - } - if (ast.kind() !== 11 /* IdentifierName */) { - return false; - } - switch (ast.parent.kind()) { - case 132 /* ClassDeclaration */: - return ast.parent.identifier === ast; - case 129 /* InterfaceDeclaration */: - return ast.parent.identifier === ast; - case 133 /* EnumDeclaration */: - return ast.parent.identifier === ast; - case 131 /* ModuleDeclaration */: - return ast.parent.name === ast || ast.parent.stringLiteral === ast; - case 226 /* VariableDeclarator */: - return ast.parent.propertyName === ast; - case 130 /* FunctionDeclaration */: - return ast.parent.identifier === ast; - case 136 /* MemberFunctionDeclaration */: - return ast.parent.propertyName === ast; - case 243 /* Parameter */: - return ast.parent.identifier === ast; - case 239 /* TypeParameter */: - return ast.parent.identifier === ast; - case 241 /* SimplePropertyAssignment */: - return ast.parent.propertyName === ast; - case 242 /* FunctionPropertyAssignment */: - return ast.parent.propertyName === ast; - case 244 /* EnumElement */: - return ast.parent.propertyName === ast; - case 134 /* ImportDeclaration */: - return ast.parent.identifier === ast; - case 146 /* MethodSignature */: - return ast.parent.propertyName === ast; - case 142 /* PropertySignature */: - return ast.parent.propertyName === ast; - } - return false; - } - function isDeclarationASTOrDeclarationNameAST(ast) { - return isNameOfSomeDeclaration(ast) || ASTHelpers.isDeclarationAST(ast); - } - ASTHelpers.isDeclarationASTOrDeclarationNameAST = isDeclarationASTOrDeclarationNameAST; - function getEnclosingParameterForInitializer(ast) { - var current = ast; - while (current) { - switch (current.kind()) { - case 233 /* EqualsValueClause */: - if (current.parent && current.parent.kind() === 243 /* Parameter */) { - return current.parent; - } - break; - case 132 /* ClassDeclaration */: - case 129 /* InterfaceDeclaration */: - case 131 /* ModuleDeclaration */: - return null; - } - current = current.parent; - } - return null; - } - ASTHelpers.getEnclosingParameterForInitializer = getEnclosingParameterForInitializer; - function getEnclosingMemberDeclaration(ast) { - var current = ast; - while (current) { - switch (current.kind()) { - case 137 /* MemberVariableDeclaration */: - case 146 /* MethodSignature */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - return current; - case 132 /* ClassDeclaration */: - case 129 /* InterfaceDeclaration */: - case 131 /* ModuleDeclaration */: - return null; - } - current = current.parent; - } - return null; - } - ASTHelpers.getEnclosingMemberDeclaration = getEnclosingMemberDeclaration; - function isNameOfFunction(ast) { - return ast && ast.parent && ast.kind() === 11 /* IdentifierName */ && ast.parent.kind() === 130 /* FunctionDeclaration */ && ast.parent.identifier === ast; - } - ASTHelpers.isNameOfFunction = isNameOfFunction; - function isNameOfMemberFunction(ast) { - return ast && ast.parent && ast.kind() === 11 /* IdentifierName */ && ast.parent.kind() === 136 /* MemberFunctionDeclaration */ && ast.parent.propertyName === ast; - } - ASTHelpers.isNameOfMemberFunction = isNameOfMemberFunction; - function isNameOfMemberAccessExpression(ast) { - if (ast && ast.parent && ast.parent.kind() === 213 /* MemberAccessExpression */ && ast.parent.name === ast) { - return true; - } - return false; - } - ASTHelpers.isNameOfMemberAccessExpression = isNameOfMemberAccessExpression; - function isRightSideOfQualifiedName(ast) { - if (ast && ast.parent && ast.parent.kind() === 121 /* QualifiedName */ && ast.parent.right === ast) { - return true; - } - return false; - } - ASTHelpers.isRightSideOfQualifiedName = isRightSideOfQualifiedName; - function parentIsModuleDeclaration(ast) { - return ast.parent && ast.parent.kind() === 131 /* ModuleDeclaration */; - } - ASTHelpers.parentIsModuleDeclaration = parentIsModuleDeclaration; - function isDeclarationAST(ast) { - switch (ast.kind()) { - case 226 /* VariableDeclarator */: - return getVariableStatement(ast) !== null; - case 134 /* ImportDeclaration */: - case 132 /* ClassDeclaration */: - case 129 /* InterfaceDeclaration */: - case 243 /* Parameter */: - case 220 /* SimpleArrowFunctionExpression */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 145 /* IndexSignature */: - case 130 /* FunctionDeclaration */: - case 131 /* ModuleDeclaration */: - case 124 /* ArrayType */: - case 122 /* ObjectType */: - case 239 /* TypeParameter */: - case 138 /* ConstructorDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 137 /* MemberVariableDeclaration */: - case 139 /* IndexMemberDeclaration */: - case 133 /* EnumDeclaration */: - case 244 /* EnumElement */: - case 241 /* SimplePropertyAssignment */: - case 242 /* FunctionPropertyAssignment */: - case 223 /* FunctionExpression */: - case 143 /* CallSignature */: - case 144 /* ConstructSignature */: - case 146 /* MethodSignature */: - case 142 /* PropertySignature */: - return true; - default: - return false; - } - } - ASTHelpers.isDeclarationAST = isDeclarationAST; - function preComments(element, text) { - if (element) { - switch (element.kind()) { - case 149 /* VariableStatement */: - case 150 /* ExpressionStatement */: - case 132 /* ClassDeclaration */: - case 134 /* ImportDeclaration */: - case 130 /* FunctionDeclaration */: - case 131 /* ModuleDeclaration */: - case 133 /* EnumDeclaration */: - case 148 /* IfStatement */: - case 241 /* SimplePropertyAssignment */: - case 136 /* MemberFunctionDeclaration */: - case 129 /* InterfaceDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 151 /* ReturnStatement */: - case 138 /* ConstructorDeclaration */: - case 137 /* MemberVariableDeclaration */: - case 244 /* EnumElement */: - case 143 /* CallSignature */: - case 144 /* ConstructSignature */: - case 145 /* IndexSignature */: - case 142 /* PropertySignature */: - case 146 /* MethodSignature */: - case 242 /* FunctionPropertyAssignment */: - case 243 /* Parameter */: - return convertNodeLeadingComments(element, text); - } - } - return null; - } - ASTHelpers.preComments = preComments; - function postComments(element, text) { - if (element) { - switch (element.kind()) { - case 150 /* ExpressionStatement */: - return convertNodeTrailingComments(element, text, true); - case 149 /* VariableStatement */: - case 132 /* ClassDeclaration */: - case 134 /* ImportDeclaration */: - case 130 /* FunctionDeclaration */: - case 131 /* ModuleDeclaration */: - case 133 /* EnumDeclaration */: - case 148 /* IfStatement */: - case 241 /* SimplePropertyAssignment */: - case 136 /* MemberFunctionDeclaration */: - case 129 /* InterfaceDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 151 /* ReturnStatement */: - case 138 /* ConstructorDeclaration */: - case 137 /* MemberVariableDeclaration */: - case 244 /* EnumElement */: - case 143 /* CallSignature */: - case 144 /* ConstructSignature */: - case 145 /* IndexSignature */: - case 142 /* PropertySignature */: - case 146 /* MethodSignature */: - case 242 /* FunctionPropertyAssignment */: - case 243 /* Parameter */: - return convertNodeTrailingComments(element, text); - } - } - return null; - } - ASTHelpers.postComments = postComments; - function convertNodeTrailingComments(node, text, allowWithNewLine) { - if (allowWithNewLine === void 0) { allowWithNewLine = false; } - var _lastToken = TypeScript.lastToken(node); - if (_lastToken === null || !_lastToken.hasTrailingTrivia()) { - return null; - } - if (!allowWithNewLine && TypeScript.SyntaxUtilities.isLastTokenOnLine(_lastToken, text)) { - return null; - } - return convertComments(_lastToken.trailingTrivia(text), TypeScript.fullStart(node) + TypeScript.fullWidth(node) - _lastToken.trailingTriviaWidth(text)); - } - function convertNodeLeadingComments(element, text) { - if (element) { - return convertTokenLeadingComments(TypeScript.firstToken(element), text); - } - return null; - } - function convertTokenLeadingComments(token, text) { - if (token === null) { - return null; - } - return token.hasLeadingTrivia() ? convertComments(token.leadingTrivia(text), token.fullStart()) : null; - } - ASTHelpers.convertTokenLeadingComments = convertTokenLeadingComments; - function convertTokenTrailingComments(token, text) { - if (token === null) { - return null; - } - return token.hasTrailingTrivia() ? convertComments(token.trailingTrivia(text), TypeScript.fullEnd(token) - token.trailingTriviaWidth(text)) : null; - } - ASTHelpers.convertTokenTrailingComments = convertTokenTrailingComments; - function convertComments(triviaList, commentStartPosition) { - var result = null; - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isComment()) { - var hasTrailingNewLine = ((i + 1) < n) && triviaList.syntaxTriviaAt(i + 1).isNewLine(); - result = result || []; - result.push(convertComment(trivia, commentStartPosition, hasTrailingNewLine)); - } - commentStartPosition += trivia.fullWidth(); - } - return result; - } - function convertComment(trivia, commentStartPosition, hasTrailingNewLine) { - var comment = new TypeScript.Comment(trivia, hasTrailingNewLine, commentStartPosition, commentStartPosition + trivia.fullWidth()); - return comment; - } - function docComments(ast, text) { - if (isDeclarationAST(ast)) { - var comments = null; - if (ast.kind() === 226 /* VariableDeclarator */) { - comments = TypeScript.ASTHelpers.preComments(getVariableStatement(ast), text); - } - else if (ast.kind() === 243 /* Parameter */) { - comments = TypeScript.ASTHelpers.preComments(ast, text); - if (!comments) { - var previousToken = TypeScript.findToken(TypeScript.syntaxTree(ast).sourceUnit(), TypeScript.firstToken(ast).fullStart() - 1); - if (previousToken && (previousToken.kind() === 72 /* OpenParenToken */ || previousToken.kind() === 79 /* CommaToken */)) { - comments = convertTokenTrailingComments(previousToken, text); - } - } - } - else { - comments = TypeScript.ASTHelpers.preComments(ast, text); - } - if (comments && comments.length > 0) { - return comments.filter(function (c) { return isDocComment(c); }); - } - } - return sentinelEmptyArray; - } - ASTHelpers.docComments = docComments; - function isDocComment(comment) { - if (comment.kind() === 6 /* MultiLineCommentTrivia */) { - var fullText = comment.fullText(); - return fullText.charAt(2) === "*" && fullText.charAt(3) !== "/"; - } - return false; - } - ASTHelpers.isDocComment = isDocComment; - function getParameterList(ast) { - if (ast) { - switch (ast.kind()) { - case 138 /* ConstructorDeclaration */: - return getParameterList(ast.callSignature); - case 130 /* FunctionDeclaration */: - return getParameterList(ast.callSignature); - case 219 /* ParenthesizedArrowFunctionExpression */: - return getParameterList(ast.callSignature); - case 144 /* ConstructSignature */: - return getParameterList(ast.callSignature); - case 136 /* MemberFunctionDeclaration */: - return getParameterList(ast.callSignature); - case 242 /* FunctionPropertyAssignment */: - return getParameterList(ast.callSignature); - case 223 /* FunctionExpression */: - return getParameterList(ast.callSignature); - case 146 /* MethodSignature */: - return getParameterList(ast.callSignature); - case 125 /* ConstructorType */: - return ast.parameterList; - case 123 /* FunctionType */: - return ast.parameterList; - case 143 /* CallSignature */: - return ast.parameterList; - case 140 /* GetAccessor */: - return getParameterList(ast.callSignature); - case 141 /* SetAccessor */: - return getParameterList(ast.callSignature); - } - } - return null; - } - ASTHelpers.getParameterList = getParameterList; - function getType(ast) { - if (ast) { - switch (ast.kind()) { - case 130 /* FunctionDeclaration */: - return getType(ast.callSignature); - case 219 /* ParenthesizedArrowFunctionExpression */: - return getType(ast.callSignature); - case 144 /* ConstructSignature */: - return getType(ast.callSignature); - case 136 /* MemberFunctionDeclaration */: - return getType(ast.callSignature); - case 242 /* FunctionPropertyAssignment */: - return getType(ast.callSignature); - case 223 /* FunctionExpression */: - return getType(ast.callSignature); - case 146 /* MethodSignature */: - return getType(ast.callSignature); - case 143 /* CallSignature */: - return getType(ast.typeAnnotation); - case 145 /* IndexSignature */: - return getType(ast.typeAnnotation); - case 142 /* PropertySignature */: - return getType(ast.typeAnnotation); - case 140 /* GetAccessor */: - return getType(ast.callSignature); - case 243 /* Parameter */: - return getType(ast.typeAnnotation); - case 137 /* MemberVariableDeclaration */: - return getType(ast.variableDeclarator); - case 226 /* VariableDeclarator */: - return getType(ast.typeAnnotation); - case 237 /* CatchClause */: - return getType(ast.typeAnnotation); - case 125 /* ConstructorType */: - return ast.type; - case 123 /* FunctionType */: - return ast.type; - case 245 /* TypeAnnotation */: - return ast.type; - } - } - return null; - } - ASTHelpers.getType = getType; - function getVariableStatement(variableDeclarator) { - if (variableDeclarator && variableDeclarator.parent && variableDeclarator.parent.parent && variableDeclarator.parent.parent.parent && variableDeclarator.parent.kind() === 2 /* SeparatedList */ && variableDeclarator.parent.parent.kind() === 225 /* VariableDeclaration */ && variableDeclarator.parent.parent.parent.kind() === 149 /* VariableStatement */) { - return variableDeclarator.parent.parent.parent; - } - return null; - } - function getVariableDeclaratorModifiers(variableDeclarator) { - var variableStatement = getVariableStatement(variableDeclarator); - return variableStatement ? variableStatement.modifiers : TypeScript.Syntax.emptyList(); - } - ASTHelpers.getVariableDeclaratorModifiers = getVariableDeclaratorModifiers; - function isIntegerLiteralAST(expression) { - if (expression) { - switch (expression.kind()) { - case 165 /* PlusExpression */: - case 166 /* NegateExpression */: - expression = expression.operand; - return expression.kind() === 13 /* NumericLiteral */ && TypeScript.IntegerUtilities.isInteger(expression.text()); - case 13 /* NumericLiteral */: - var text = expression.text(); - return TypeScript.IntegerUtilities.isInteger(text) || TypeScript.IntegerUtilities.isHexInteger(text); - } - } - return false; - } - ASTHelpers.isIntegerLiteralAST = isIntegerLiteralAST; - function getEnclosingModuleDeclaration(ast) { - while (ast) { - if (ast.kind() === 131 /* ModuleDeclaration */) { - return ast; - } - ast = ast.parent; - } - return null; - } - ASTHelpers.getEnclosingModuleDeclaration = getEnclosingModuleDeclaration; - function isEntireNameOfModuleDeclaration(nameAST) { - return parentIsModuleDeclaration(nameAST) && nameAST.parent.name === nameAST; - } - function getModuleDeclarationFromNameAST(ast) { - if (ast) { - switch (ast.kind()) { - case 14 /* StringLiteral */: - if (parentIsModuleDeclaration(ast) && ast.parent.stringLiteral === ast) { - return ast.parent; - } - return null; - case 11 /* IdentifierName */: - case 121 /* QualifiedName */: - if (isEntireNameOfModuleDeclaration(ast)) { - return ast.parent; - } - break; - default: - return null; - } - for (ast = ast.parent; ast && ast.kind() === 121 /* QualifiedName */; ast = ast.parent) { - if (isEntireNameOfModuleDeclaration(ast)) { - return ast.parent; - } - } - } - return null; - } - ASTHelpers.getModuleDeclarationFromNameAST = getModuleDeclarationFromNameAST; - function isLastNameOfModule(ast, astName) { - if (ast) { - if (ast.stringLiteral) { - return astName === ast.stringLiteral; - } - else if (ast.name.kind() === 121 /* QualifiedName */) { - return astName === ast.name.right; - } - else { - return astName === ast.name; - } - } - return false; - } - ASTHelpers.isLastNameOfModule = isLastNameOfModule; - function getNameOfIdentifierOrQualifiedName(name) { - if (name.kind() === 11 /* IdentifierName */) { - return name.text(); - } - else { - TypeScript.Debug.assert(name.kind() == 121 /* QualifiedName */); - var dotExpr = name; - return getNameOfIdentifierOrQualifiedName(dotExpr.left) + "." + getNameOfIdentifierOrQualifiedName(dotExpr.right); - } - } - ASTHelpers.getNameOfIdentifierOrQualifiedName = getNameOfIdentifierOrQualifiedName; - function getModuleNames(name, result) { - result = result || []; - if (name.kind() === 121 /* QualifiedName */) { - getModuleNames(name.left, result); - result.push(name.right); - } - else { - result.push(name); - } - return result; - } - ASTHelpers.getModuleNames = getModuleNames; - })(ASTHelpers = TypeScript.ASTHelpers || (TypeScript.ASTHelpers = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; (function (TypeScript) { function stripStartAndEndQuotes(str) { var firstCharCode = str && str.charCodeAt(0); @@ -31975,143 +31129,31 @@ var TypeScript; return str; } TypeScript.stripStartAndEndQuotes = stripStartAndEndQuotes; - function isSingleQuoted(str) { - return str && str.length >= 2 && str.charCodeAt(0) === str.charCodeAt(str.length - 1) && str.charCodeAt(0) === 39 /* singleQuote */; - } - TypeScript.isSingleQuoted = isSingleQuoted; - function isDoubleQuoted(str) { - return str && str.length >= 2 && str.charCodeAt(0) === str.charCodeAt(str.length - 1) && str.charCodeAt(0) === 34 /* doubleQuote */; - } - TypeScript.isDoubleQuoted = isDoubleQuoted; - function isQuoted(str) { - return isDoubleQuoted(str) || isSingleQuoted(str); - } - TypeScript.isQuoted = isQuoted; - function quoteStr(str) { - return "\"" + str + "\""; - } - TypeScript.quoteStr = quoteStr; var switchToForwardSlashesRegEx = /\\/g; function switchToForwardSlashes(path) { return path.replace(switchToForwardSlashesRegEx, "/"); } TypeScript.switchToForwardSlashes = switchToForwardSlashes; - function trimModName(modName) { - if (modName.length > 5 && modName.substring(modName.length - 5, modName.length) === ".d.ts") { - return modName.substring(0, modName.length - 5); - } - if (modName.length > 3 && modName.substring(modName.length - 3, modName.length) === ".ts") { - return modName.substring(0, modName.length - 3); - } - if (modName.length > 3 && modName.substring(modName.length - 3, modName.length) === ".js") { - return modName.substring(0, modName.length - 3); - } - return modName; - } - TypeScript.trimModName = trimModName; - function getDeclareFilePath(fname) { - return isTSFile(fname) ? changePathToDTS(fname) : changePathToDTS(fname); - } - TypeScript.getDeclareFilePath = getDeclareFilePath; 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 isTSFile(fname) { - return isFileOfExtension(fname, ".ts"); - } - TypeScript.isTSFile = isTSFile; function isDTSFile(fname) { return isFileOfExtension(fname, ".d.ts"); } TypeScript.isDTSFile = isDTSFile; - function getPrettyName(modPath, quote, treatAsFileName) { - if (quote === void 0) { quote = true; } - if (treatAsFileName === void 0) { treatAsFileName = false; } - var modName = treatAsFileName ? switchToForwardSlashes(modPath) : trimModName(stripStartAndEndQuotes(modPath)); - var components = this.getPathComponents(modName); - return components.length ? (quote ? quoteStr(components[components.length - 1]) : components[components.length - 1]) : modPath; - } - TypeScript.getPrettyName = getPrettyName; function getPathComponents(path) { return path.split("/"); } TypeScript.getPathComponents = getPathComponents; - function getRelativePathToFixedPath(fixedModFilePath, absoluteModPath, isAbsoultePathURL) { - if (isAbsoultePathURL === void 0) { isAbsoultePathURL = true; } - absoluteModPath = switchToForwardSlashes(absoluteModPath); - var modComponents = this.getPathComponents(absoluteModPath); - var fixedModComponents = this.getPathComponents(fixedModFilePath); - var joinStartIndex = 0; - for (; joinStartIndex < modComponents.length && joinStartIndex < fixedModComponents.length; joinStartIndex++) { - if (fixedModComponents[joinStartIndex] !== modComponents[joinStartIndex]) { - break; - } - } - if (joinStartIndex !== 0) { - var relativePath = ""; - var relativePathComponents = modComponents.slice(joinStartIndex, modComponents.length); - for (; joinStartIndex < fixedModComponents.length; joinStartIndex++) { - if (fixedModComponents[joinStartIndex] !== "") { - relativePath = relativePath + "../"; - } - } - return relativePath + relativePathComponents.join("/"); - } - if (isAbsoultePathURL && absoluteModPath.indexOf("://") === -1) { - absoluteModPath = "file:///" + absoluteModPath; - } - return absoluteModPath; - } - TypeScript.getRelativePathToFixedPath = getRelativePathToFixedPath; - function changePathToDTS(modPath) { - return trimModName(stripStartAndEndQuotes(modPath)) + ".d.ts"; - } - TypeScript.changePathToDTS = changePathToDTS; - function isRelative(path) { - return path.length > 0 && path.charAt(0) === "."; - } - TypeScript.isRelative = isRelative; - function isRooted(path) { - return path.length > 0 && (path.charAt(0) === "\\" || path.charAt(0) === "/" || (path.indexOf(":\\") !== -1) || (path.indexOf(":/") !== -1)); - } - TypeScript.isRooted = isRooted; - function getRootFilePath(outFname) { - if (outFname === "") { - return outFname; - } - else { - var isPath = outFname.indexOf("/") !== -1; - return isPath ? filePath(outFname) : ""; - } - } - TypeScript.getRootFilePath = getRootFilePath; - function filePathComponents(fullPath) { - fullPath = switchToForwardSlashes(fullPath); - var components = getPathComponents(fullPath); - return components.slice(0, components.length - 1); - } - TypeScript.filePathComponents = filePathComponents; - function filePath(fullPath) { - var path = filePathComponents(fullPath); - return path.join("/") + "/"; - } - TypeScript.filePath = filePath; - function convertToDirectoryPath(dirPath) { - if (dirPath && dirPath.charAt(dirPath.length - 1) !== "/") { - dirPath += "/"; - } - return dirPath; - } - TypeScript.convertToDirectoryPath = convertToDirectoryPath; var normalizePathRegEx = /^\\\\[^\\]/; function normalizePath(path) { if (normalizePathRegEx.test(path)) { path = "file:" + path; } - var parts = this.getPathComponents(switchToForwardSlashes(path)); + var parts = getPathComponents(switchToForwardSlashes(path)); var normalizedParts = []; for (var i = 0; i < parts.length; i++) { var part = parts[i]; @@ -32130,7 +31172,7 @@ var TypeScript; })(TypeScript || (TypeScript = {})); var ts; (function (ts) { - var scanner = ts.createScanner(ts.ScriptTarget.Latest, true); + var scanner = ts.createScanner(2 /* Latest */, true); var emptyArray = []; function createNode(kind, pos, end, flags, parent) { var node = new (ts.getNodeConstructor(kind))(); @@ -32181,7 +31223,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(188 /* SyntaxList */, nodes.pos, nodes.end, 512 /* Synthetic */, this); + var list = createNode(195 /* SyntaxList */, nodes.pos, nodes.end, 512 /* Synthetic */, this); list._children = []; var pos = nodes.pos; for (var i = 0, len = nodes.length; i < len; i++) { @@ -32199,7 +31241,7 @@ var ts; }; NodeObject.prototype.createChildren = function (sourceFile) { var _this = this; - if (this.kind > 116 /* Missing */) { + if (this.kind > 120 /* Missing */) { scanner.setText((sourceFile || this.getSourceFile()).text); var children = []; var pos = this.pos; @@ -32244,9 +31286,9 @@ var ts; var children = this.getChildren(); for (var i = 0; i < children.length; i++) { var child = children[i]; - if (child.kind < 116 /* Missing */) + if (child.kind < 120 /* Missing */) return child; - if (child.kind > 116 /* Missing */) + if (child.kind > 120 /* Missing */) return child.getFirstToken(sourceFile); } }; @@ -32254,9 +31296,9 @@ var ts; var children = this.getChildren(sourceFile); for (var i = children.length - 1; i >= 0; i--) { var child = children[i]; - if (child.kind < 116 /* Missing */) + if (child.kind < 120 /* Missing */) return child; - if (child.kind > 116 /* Missing */) + if (child.kind > 120 /* Missing */) return child.getLastToken(sourceFile); } }; @@ -32299,7 +31341,7 @@ var ts; var jsDocCommentParts = []; ts.forEach(declarations, function (declaration) { var sourceFileOfDeclaration = ts.getSourceFileOfNode(declaration); - if (canUseParsedParamTagComments && declaration.kind === 119 /* Parameter */) { + if (canUseParsedParamTagComments && declaration.kind === 123 /* Parameter */) { ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedParamJsDocComment) { @@ -32307,13 +31349,13 @@ var ts; } }); } - if (declaration.kind === 181 /* ModuleDeclaration */ && declaration.body.kind === 181 /* ModuleDeclaration */) { + if (declaration.kind === 188 /* ModuleDeclaration */ && declaration.body.kind === 188 /* ModuleDeclaration */) { return; } - while (declaration.kind === 181 /* ModuleDeclaration */ && declaration.parent.kind === 181 /* ModuleDeclaration */) { + while (declaration.kind === 188 /* ModuleDeclaration */ && declaration.parent.kind === 188 /* ModuleDeclaration */) { declaration = declaration.parent; } - ts.forEach(getJsDocCommentTextRange(declaration.kind === 174 /* VariableDeclaration */ ? declaration.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { + ts.forEach(getJsDocCommentTextRange(declaration.kind === 181 /* VariableDeclaration */ ? declaration.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); if (cleanedJsDocComment) { jsDocCommentParts.push.apply(jsDocCommentParts, cleanedJsDocComment); @@ -32574,10 +31616,10 @@ var ts; var namedDeclarations = []; ts.forEachChild(sourceFile, function visit(node) { switch (node.kind) { - case 175 /* FunctionDeclaration */: - case 121 /* Method */: + case 182 /* FunctionDeclaration */: + case 125 /* Method */: var functionDeclaration = node; - if (functionDeclaration.name && functionDeclaration.name.kind !== 116 /* Missing */) { + if (functionDeclaration.name && functionDeclaration.name.kind !== 120 /* Missing */) { var lastDeclaration = namedDeclarations.length > 0 ? namedDeclarations[namedDeclarations.length - 1] : undefined; if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) { if (functionDeclaration.body && !lastDeclaration.body) { @@ -32590,31 +31632,31 @@ var ts; ts.forEachChild(node, visit); } break; - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - case 179 /* TypeAliasDeclaration */: - case 180 /* EnumDeclaration */: - case 181 /* ModuleDeclaration */: - case 183 /* ImportDeclaration */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 130 /* TypeLiteral */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 186 /* TypeAliasDeclaration */: + case 187 /* EnumDeclaration */: + case 188 /* ModuleDeclaration */: + case 190 /* ImportDeclaration */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 134 /* TypeLiteral */: if (node.name) { namedDeclarations.push(node); } - case 122 /* Constructor */: - case 152 /* VariableStatement */: - case 182 /* ModuleBlock */: - case 176 /* FunctionBlock */: + case 126 /* Constructor */: + case 159 /* VariableStatement */: + case 189 /* ModuleBlock */: + case 183 /* FunctionBlock */: ts.forEachChild(node, visit); break; - case 119 /* Parameter */: - if (!(node.flags & ts.NodeFlags.AccessibilityModifier)) { + case 123 /* Parameter */: + if (!(node.flags & 112 /* AccessibilityModifier */)) { break; } - case 174 /* VariableDeclaration */: - case 185 /* EnumMember */: - case 120 /* Property */: + case 181 /* VariableDeclaration */: + case 192 /* EnumMember */: + case 124 /* Property */: namedDeclarations.push(node); break; } @@ -32680,19 +31722,6 @@ var ts; SymbolDisplayPartKind[SymbolDisplayPartKind["regularExpressionLiteral"] = 21] = "regularExpressionLiteral"; })(ts.SymbolDisplayPartKind || (ts.SymbolDisplayPartKind = {})); var SymbolDisplayPartKind = ts.SymbolDisplayPartKind; - (function (OutputFileType) { - OutputFileType[OutputFileType["JavaScript"] = 0] = "JavaScript"; - OutputFileType[OutputFileType["SourceMap"] = 1] = "SourceMap"; - OutputFileType[OutputFileType["Declaration"] = 2] = "Declaration"; - })(ts.OutputFileType || (ts.OutputFileType = {})); - var OutputFileType = ts.OutputFileType; - (function (EndOfLineState) { - EndOfLineState[EndOfLineState["Start"] = 0] = "Start"; - EndOfLineState[EndOfLineState["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia"; - EndOfLineState[EndOfLineState["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral"; - EndOfLineState[EndOfLineState["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral"; - })(ts.EndOfLineState || (ts.EndOfLineState = {})); - var EndOfLineState = ts.EndOfLineState; (function (TokenClass) { TokenClass[TokenClass["Punctuation"] = 0] = "Punctuation"; TokenClass[TokenClass["Keyword"] = 1] = "Keyword"; @@ -32865,21 +31894,21 @@ var ts; } ts.lineBreakPart = lineBreakPart; function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 119 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 123 /* Parameter */; } function isLocalVariableOrFunction(symbol) { if (symbol.parent) { return false; } return ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 144 /* FunctionExpression */) { + if (declaration.kind === 149 /* FunctionExpression */) { return true; } - if (declaration.kind !== 174 /* VariableDeclaration */ && declaration.kind !== 175 /* FunctionDeclaration */) { + if (declaration.kind !== 181 /* VariableDeclaration */ && declaration.kind !== 182 /* FunctionDeclaration */) { return false; } - for (var parent = declaration.parent; parent.kind !== 176 /* FunctionBlock */; parent = parent.parent) { - if (parent.kind === 186 /* SourceFile */ || parent.kind === 182 /* ModuleBlock */) { + for (var parent = declaration.parent; parent.kind !== 183 /* FunctionBlock */; parent = parent.parent) { + if (parent.kind === 193 /* SourceFile */ || parent.kind === 189 /* ModuleBlock */) { return false; } } @@ -32890,7 +31919,7 @@ var ts; return displayPart(text, displayPartKind(symbol), symbol); function displayPartKind(symbol) { var flags = symbol.flags; - if (flags & ts.SymbolFlags.Variable) { + if (flags & 3 /* Variable */) { return isFirstDeclarationOfSymbolParameter(symbol) ? 13 /* parameterName */ : 9 /* localName */; } else if (flags & 4 /* Property */) { @@ -32908,16 +31937,16 @@ var ts; else if (flags & 64 /* Interface */) { return 4 /* interfaceName */; } - else if (flags & 128 /* Enum */) { + else if (flags & 384 /* Enum */) { return 2 /* enumName */; } - else if (flags & ts.SymbolFlags.Module) { + else if (flags & 1536 /* Module */) { return 11 /* moduleName */; } - else if (flags & 4096 /* Method */) { + else if (flags & 8192 /* Method */) { return 10 /* methodName */; } - else if (flags & 524288 /* TypeParameter */) { + else if (flags & 1048576 /* TypeParameter */) { return 18 /* typeParameterName */; } return 17 /* text */; @@ -32950,7 +31979,7 @@ var ts; } function getDefaultCompilerOptions() { return { - target: ts.ScriptTarget.Latest, + target: 2 /* Latest */, module: 0 /* None */ }; } @@ -33098,7 +32127,7 @@ var ts; this.host.log("SyntaxTreeCache.Initialize: fixupParentRefs : " + (new Date().getTime() - start)); } if (syntaxTree !== null) { - ts.Debug.assert(sourceFile); + ts.Debug.assert(sourceFile !== undefined); this.currentFileVersion = version; this.currentFilename = filename; this.currentFileSyntaxTree = syntaxTree; @@ -33179,7 +32208,7 @@ var ts; function createDocumentRegistry() { var buckets = {}; function getKeyFromCompilationSettings(settings) { - return "_" + ts.ScriptTarget[settings.target]; + return "_" + settings.target; } function getBucketForCompilationSettings(settings, createIfMissing) { var key = getKeyFromCompilationSettings(settings); @@ -33225,9 +32254,9 @@ var ts; } function updateDocument(sourceFile, filename, compilationSettings, scriptSnapshot, version, isOpen, textChangeRange) { var bucket = getBucketForCompilationSettings(compilationSettings, false); - ts.Debug.assert(bucket); + ts.Debug.assert(bucket !== undefined); var entry = ts.lookUp(bucket, filename); - ts.Debug.assert(entry); + ts.Debug.assert(entry !== undefined); if (entry.sourceFile.isOpen === isOpen && entry.sourceFile.version === version) { return entry.sourceFile; } @@ -33236,7 +32265,7 @@ var ts; } function releaseDocument(filename, compilationSettings) { var bucket = getBucketForCompilationSettings(compilationSettings, false); - ts.Debug.assert(bucket); + ts.Debug.assert(bucket !== undefined); var entry = ts.lookUp(bucket, filename); entry.refCount--; ts.Debug.assert(entry.refCount >= 0); @@ -33272,7 +32301,7 @@ var ts; ts.getNodeModifiers = getNodeModifiers; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 167 /* LabeledStatement */ && referenceNode.label.text === labelName) { + if (referenceNode.kind === 174 /* LabeledStatement */ && referenceNode.label.text === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -33280,13 +32309,13 @@ var ts; return undefined; } function isJumpStatementTarget(node) { - return node.kind === 59 /* Identifier */ && (node.parent.kind === 161 /* BreakStatement */ || node.parent.kind === 160 /* ContinueStatement */) && node.parent.label === node; + return node.kind === 63 /* Identifier */ && (node.parent.kind === 168 /* BreakStatement */ || node.parent.kind === 167 /* ContinueStatement */) && node.parent.label === node; } function isLabelOfLabeledStatement(node) { - return node.kind === 59 /* Identifier */ && node.parent.kind === 167 /* LabeledStatement */ && node.parent.label === node; + return node.kind === 63 /* Identifier */ && node.parent.kind === 174 /* LabeledStatement */ && node.parent.label === node; } function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 167 /* LabeledStatement */; owner = owner.parent) { + for (var owner = node.parent; owner.kind === 174 /* LabeledStatement */; owner = owner.parent) { if (owner.label.text === labelName) { return true; } @@ -33297,51 +32326,51 @@ var ts; return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } function isRightSideOfQualifiedName(node) { - return node.parent.kind === 117 /* QualifiedName */ && node.parent.right === node; + return node.parent.kind === 121 /* QualifiedName */ && node.parent.right === node; } function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 138 /* PropertyAccess */ && node.parent.right === node; + return node && node.parent && node.parent.kind === 142 /* PropertyAccess */ && node.parent.right === node; } function isCallExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 140 /* CallExpression */ && node.parent.func === node; + return node && node.parent && node.parent.kind === 144 /* CallExpression */ && node.parent.func === node; } function isNewExpressionTarget(node) { if (isRightSideOfPropertyAccess(node)) { node = node.parent; } - return node && node.parent && node.parent.kind === 141 /* NewExpression */ && node.parent.func === node; + return node && node.parent && node.parent.kind === 145 /* NewExpression */ && node.parent.func === node; } function isNameOfModuleDeclaration(node) { - return node.parent.kind === 181 /* ModuleDeclaration */ && node.parent.name === node; + return node.parent.kind === 188 /* ModuleDeclaration */ && node.parent.name === node; } function isNameOfFunctionDeclaration(node) { - return node.kind === 59 /* Identifier */ && ts.isAnyFunction(node.parent) && node.parent.name === node; + return node.kind === 63 /* Identifier */ && ts.isAnyFunction(node.parent) && node.parent.name === node; } function isNameOfPropertyAssignment(node) { - return (node.kind === 59 /* Identifier */ || node.kind === 7 /* StringLiteral */ || node.kind === 6 /* NumericLiteral */) && node.parent.kind === 137 /* PropertyAssignment */ && node.parent.name === node; + return (node.kind === 63 /* Identifier */ || node.kind === 7 /* StringLiteral */ || node.kind === 6 /* NumericLiteral */) && node.parent.kind === 141 /* PropertyAssignment */ && node.parent.name === node; } function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { if (node.kind === 7 /* StringLiteral */ || node.kind === 6 /* NumericLiteral */) { switch (node.parent.kind) { - case 120 /* Property */: - case 137 /* PropertyAssignment */: - case 185 /* EnumMember */: - case 121 /* Method */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 181 /* ModuleDeclaration */: + case 124 /* Property */: + case 141 /* PropertyAssignment */: + case 192 /* EnumMember */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 188 /* ModuleDeclaration */: return node.parent.name === node; - case 139 /* IndexedAccess */: + case 143 /* IndexedAccess */: return node.parent.index === node; } } return false; } function isNameOfExternalModuleImportOrDeclaration(node) { - return node.kind === 7 /* StringLiteral */ && (isNameOfModuleDeclaration(node) || (node.parent.kind === 183 /* ImportDeclaration */ && node.parent.externalModuleName === node)); + return node.kind === 7 /* StringLiteral */ && (isNameOfModuleDeclaration(node) || (node.parent.kind === 190 /* 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()))); @@ -33364,23 +32393,8 @@ var ts; }); } } - var SemanticMeaning; - (function (SemanticMeaning) { - SemanticMeaning[SemanticMeaning["None"] = 0x0] = "None"; - SemanticMeaning[SemanticMeaning["Value"] = 0x1] = "Value"; - SemanticMeaning[SemanticMeaning["Type"] = 0x2] = "Type"; - SemanticMeaning[SemanticMeaning["Namespace"] = 0x4] = "Namespace"; - SemanticMeaning[SemanticMeaning["All"] = SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace] = "All"; - })(SemanticMeaning || (SemanticMeaning = {})); - var BreakContinueSearchType; - (function (BreakContinueSearchType) { - BreakContinueSearchType[BreakContinueSearchType["None"] = 0x0] = "None"; - BreakContinueSearchType[BreakContinueSearchType["Unlabeled"] = 0x1] = "Unlabeled"; - BreakContinueSearchType[BreakContinueSearchType["Labeled"] = 0x2] = "Labeled"; - BreakContinueSearchType[BreakContinueSearchType["All"] = BreakContinueSearchType.Unlabeled | BreakContinueSearchType.Labeled] = "All"; - })(BreakContinueSearchType || (BreakContinueSearchType = {})); var keywordCompletions = []; - for (var i = ts.SyntaxKind.FirstKeyword; i <= ts.SyntaxKind.LastKeyword; i++) { + for (var i = 64 /* FirstKeyword */; i <= 119 /* LastKeyword */; i++) { keywordCompletions.push({ name: ts.tokenToString(i), kind: ScriptElementKind.keyword, @@ -33537,7 +32551,7 @@ var ts; var displayName = symbol.getName(); if (displayName && displayName.length > 0) { var firstCharCode = displayName.charCodeAt(0); - if ((symbol.flags & ts.SymbolFlags.Namespace) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) { + if ((symbol.flags & 1536 /* Namespace */) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) { return undefined; } if (displayName && displayName.length >= 2 && firstCharCode === displayName.charCodeAt(displayName.length - 1) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) { @@ -33567,15 +32581,25 @@ var ts; function getCompletionsAtPosition(filename, position, isMemberCompletion) { synchronizeHostData(); filename = TypeScript.switchToForwardSlashes(filename); + var syntacticStart = new Date().getTime(); var sourceFile = getSourceFile(filename); + var start = new Date().getTime(); var currentToken = ts.getTokenAtPosition(sourceFile, position); - if (isInsideComment(sourceFile, currentToken, position)) { + host.log("getCompletionsAtPosition: Get current token: " + (new Date().getTime() - start)); + var start = new Date().getTime(); + var insideComment = isInsideComment(sourceFile, currentToken, position); + host.log("getCompletionsAtPosition: Is inside comment: " + (new Date().getTime() - start)); + if (insideComment) { host.log("Returning an empty list because completion was inside a comment."); return undefined; } + var start = new Date().getTime(); var previousToken = ts.findPrecedingToken(position, sourceFile); - if (previousToken && position <= previousToken.end && previousToken.kind === 59 /* Identifier */) { + host.log("getCompletionsAtPosition: Get previous token 1: " + (new Date().getTime() - start)); + if (previousToken && position <= previousToken.end && previousToken.kind === 63 /* Identifier */) { + var start = new Date().getTime(); previousToken = ts.findPrecedingToken(previousToken.pos, sourceFile); + host.log("getCompletionsAtPosition: Get previous token 2: " + (new Date().getTime() - start)); } if (previousToken && isCompletionListBlocker(previousToken)) { host.log("Returning an empty list because completion was requested in an invalid position."); @@ -33583,7 +32607,7 @@ var ts; } var node; var isRightOfDot; - if (previousToken && previousToken.kind === 15 /* DotToken */ && (previousToken.parent.kind === 138 /* PropertyAccess */ || previousToken.parent.kind === 117 /* QualifiedName */)) { + if (previousToken && previousToken.kind === 19 /* DotToken */ && (previousToken.parent.kind === 142 /* PropertyAccess */ || previousToken.parent.kind === 121 /* QualifiedName */)) { node = previousToken.parent.left; isRightOfDot = true; } @@ -33598,15 +32622,17 @@ var ts; symbols: {}, typeChecker: typeInfoResolver }; + host.log("getCompletionsAtPosition: Syntactic work: " + (new Date().getTime() - syntacticStart)); + var semanticStart = new Date().getTime(); if (isRightOfDot) { var symbols = []; isMemberCompletion = true; - if (node.kind === 59 /* Identifier */ || node.kind === 117 /* QualifiedName */ || node.kind === 138 /* PropertyAccess */) { + if (node.kind === 63 /* Identifier */ || node.kind === 121 /* QualifiedName */ || node.kind === 142 /* PropertyAccess */) { var symbol = typeInfoResolver.getSymbolInfo(node); - if (symbol && symbol.flags & 16777216 /* Import */) { + if (symbol && symbol.flags & 33554432 /* Import */) { symbol = typeInfoResolver.getAliasedSymbol(symbol); } - if (symbol && symbol.flags & ts.SymbolFlags.HasExports) { + if (symbol && symbol.flags & 1952 /* HasExports */) { ts.forEachValue(symbol.exports, function (symbol) { if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) { symbols.push(symbol); @@ -33640,7 +32666,7 @@ var ts; } else { isMemberCompletion = false; - var symbolMeanings = ts.SymbolFlags.Type | ts.SymbolFlags.Value | ts.SymbolFlags.Namespace | 16777216 /* Import */; + var symbolMeanings = 3152352 /* Type */ | 107455 /* Value */ | 1536 /* Namespace */ | 33554432 /* Import */; var symbols = typeInfoResolver.getSymbolsInScope(node, symbolMeanings); getCompletionEntriesFromSymbols(symbols, activeCompletionSession); } @@ -33648,11 +32674,13 @@ var ts; if (!isMemberCompletion) { Array.prototype.push.apply(activeCompletionSession.entries, keywordCompletions); } + host.log("getCompletionsAtPosition: Semantic work: " + (new Date().getTime() - semanticStart)); return { isMemberCompletion: isMemberCompletion, entries: activeCompletionSession.entries }; 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)) { @@ -33660,12 +32688,16 @@ var ts; session.symbols[entry.name] = symbol; } }); + host.log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - semanticStart)); } function isCompletionListBlocker(previousToken) { - return isInStringOrRegularExpressionLiteral(previousToken) || isIdentifierDefinitionLocation(previousToken) || isRightOfIllegalDot(previousToken); + var start = new Date().getTime(); + var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || isIdentifierDefinitionLocation(previousToken) || isRightOfIllegalDot(previousToken); + host.log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - semanticStart)); + return result; } - function isInStringOrRegularExpressionLiteral(previousToken) { - if (previousToken.kind === 7 /* StringLiteral */) { + function isInStringOrRegularExpressionOrTemplateLiteral(previousToken) { + if (previousToken.kind === 7 /* StringLiteral */ || ts.isTemplateLiteralKind(previousToken.kind)) { var start = previousToken.getStart(); var end = previousToken.getEnd(); if (start < position && position < end) { @@ -33674,7 +32706,20 @@ var ts; else if (position === end) { var width = end - start; var text = previousToken.getSourceFile().text; - return width <= 1 || text.charCodeAt(start) !== text.charCodeAt(end - 1) || text.charCodeAt(end - 2) === 92 /* backslash */; + if (width <= 1 || text.charCodeAt(end - 2) === 92 /* backslash */) { + return true; + } + switch (previousToken.kind) { + case 7 /* StringLiteral */: + case 9 /* NoSubstitutionTemplateLiteral */: + return text.charCodeAt(start) !== text.charCodeAt(end - 1); + case 10 /* TemplateHead */: + case 11 /* TemplateMiddle */: + return text.charCodeAt(end - 1) !== 123 /* openBrace */ || text.charCodeAt(end - 2) !== 36 /* $ */; + case 12 /* TemplateTail */: + return text.charCodeAt(end - 1) !== 96 /* backtick */; + } + return false; } } else if (previousToken.kind === 8 /* RegularExpressionLiteral */) { @@ -33686,9 +32731,9 @@ var ts; if (previousToken) { var parent = previousToken.parent; switch (previousToken.kind) { - case 9 /* OpenBraceToken */: - case 18 /* CommaToken */: - if (parent && parent.kind === 136 /* ObjectLiteral */) { + case 13 /* OpenBraceToken */: + case 22 /* CommaToken */: + if (parent && parent.kind === 140 /* ObjectLiteral */) { return parent; } break; @@ -33698,16 +32743,16 @@ var ts; } function isFunction(kind) { switch (kind) { - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: - case 175 /* FunctionDeclaration */: - case 121 /* Method */: - case 122 /* Constructor */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 125 /* CallSignature */: - case 126 /* ConstructSignature */: - case 127 /* IndexSignature */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: + case 182 /* FunctionDeclaration */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 129 /* CallSignature */: + case 130 /* ConstructSignature */: + case 131 /* IndexSignature */: return true; } return false; @@ -33716,27 +32761,27 @@ var ts; if (previousToken) { var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { - case 18 /* CommaToken */: - return containingNodeKind === 174 /* VariableDeclaration */ || containingNodeKind === 152 /* VariableStatement */ || containingNodeKind === 180 /* EnumDeclaration */ || isFunction(containingNodeKind); - case 11 /* OpenParenToken */: - return containingNodeKind === 171 /* CatchBlock */ || isFunction(containingNodeKind); - case 9 /* OpenBraceToken */: - return containingNodeKind === 180 /* EnumDeclaration */ || containingNodeKind === 178 /* InterfaceDeclaration */; - case 17 /* SemicolonToken */: - return containingNodeKind === 120 /* Property */ && previousToken.parent.parent.kind === 178 /* InterfaceDeclaration */; - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 103 /* StaticKeyword */: - case 16 /* DotDotDotToken */: - return containingNodeKind === 119 /* Parameter */; - case 63 /* ClassKeyword */: - case 110 /* ModuleKeyword */: - case 71 /* EnumKeyword */: - case 97 /* InterfaceKeyword */: - case 77 /* FunctionKeyword */: - case 92 /* VarKeyword */: - case 109 /* GetKeyword */: - case 113 /* SetKeyword */: + case 22 /* CommaToken */: + return containingNodeKind === 181 /* VariableDeclaration */ || containingNodeKind === 159 /* VariableStatement */ || containingNodeKind === 187 /* EnumDeclaration */ || isFunction(containingNodeKind); + case 15 /* OpenParenToken */: + return containingNodeKind === 178 /* CatchBlock */ || isFunction(containingNodeKind); + case 13 /* OpenBraceToken */: + return containingNodeKind === 187 /* EnumDeclaration */ || containingNodeKind === 185 /* InterfaceDeclaration */; + case 21 /* SemicolonToken */: + return containingNodeKind === 124 /* Property */ && previousToken.parent.parent.kind === 185 /* InterfaceDeclaration */; + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 107 /* StaticKeyword */: + case 20 /* DotDotDotToken */: + return containingNodeKind === 123 /* Parameter */; + case 67 /* ClassKeyword */: + case 114 /* ModuleKeyword */: + case 75 /* EnumKeyword */: + case 101 /* InterfaceKeyword */: + case 81 /* FunctionKeyword */: + case 96 /* VarKeyword */: + case 113 /* GetKeyword */: + case 117 /* SetKeyword */: return true; } switch (previousToken.getText()) { @@ -33764,7 +32809,7 @@ var ts; } var existingMemberNames = {}; ts.forEach(existingMembers, function (m) { - if (m.kind !== 137 /* PropertyAssignment */) { + if (m.kind !== 141 /* PropertyAssignment */) { return; } if (m.getStart() <= position && position <= m.getEnd()) { @@ -33791,10 +32836,10 @@ var ts; var symbol = ts.lookUp(activeCompletionSession.symbols, entryName); if (symbol) { var type = session.typeChecker.getTypeOfSymbol(symbol); - ts.Debug.assert(type, "Could not find type for 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 displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getSourceFile(filename), location, session.typeChecker, location, SemanticMeaning.All); + var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getSourceFile(filename), location, session.typeChecker, location, 7 /* All */); return { name: entryName, kind: displayPartsDocumentationsAndSymbolKind.symbolKind, @@ -33820,16 +32865,16 @@ var ts; return node; } switch (node.kind) { - case 186 /* SourceFile */: - case 121 /* Method */: - case 175 /* FunctionDeclaration */: - case 144 /* FunctionExpression */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 177 /* ClassDeclaration */: - case 178 /* InterfaceDeclaration */: - case 180 /* EnumDeclaration */: - case 181 /* ModuleDeclaration */: + case 193 /* SourceFile */: + case 125 /* Method */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 184 /* ClassDeclaration */: + case 185 /* InterfaceDeclaration */: + case 187 /* EnumDeclaration */: + case 188 /* ModuleDeclaration */: return node; } } @@ -33838,21 +32883,21 @@ var ts; var flags = symbol.getFlags(); if (flags & 32 /* Class */) return ScriptElementKind.classElement; - if (flags & 128 /* Enum */) + if (flags & 384 /* Enum */) return ScriptElementKind.enumElement; - if (flags & 1048576 /* TypeAlias */) + if (flags & 2097152 /* TypeAlias */) return ScriptElementKind.typeElement; if (flags & 64 /* Interface */) return ScriptElementKind.interfaceElement; - if (flags & 524288 /* TypeParameter */) + if (flags & 1048576 /* TypeParameter */) return ScriptElementKind.typeParameterElement; var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver); if (result === ScriptElementKind.unknown) { - if (flags & 524288 /* TypeParameter */) + if (flags & 1048576 /* TypeParameter */) return ScriptElementKind.typeParameterElement; if (flags & 8 /* EnumMember */) return ScriptElementKind.variableElement; - if (flags & 16777216 /* Import */) + if (flags & 33554432 /* Import */) return ScriptElementKind.alias; } return result; @@ -33864,7 +32909,7 @@ var ts; if (typeResolver.isArgumentsSymbol(symbol)) { return ScriptElementKind.localVariableElement; } - if (flags & ts.SymbolFlags.Variable) { + if (flags & 3 /* Variable */) { if (isFirstDeclarationOfSymbolParameter(symbol)) { return ScriptElementKind.parameterElement; } @@ -33875,26 +32920,26 @@ var ts; } if (flags & 16 /* Function */) return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localFunctionElement : ScriptElementKind.functionElement; - if (flags & 16384 /* GetAccessor */) + if (flags & 32768 /* GetAccessor */) return ScriptElementKind.memberGetAccessorElement; - if (flags & 32768 /* SetAccessor */) + if (flags & 65536 /* SetAccessor */) return ScriptElementKind.memberSetAccessorElement; - if (flags & 4096 /* Method */) + if (flags & 8192 /* Method */) return ScriptElementKind.memberFunctionElement; - if (flags & 8192 /* Constructor */) + if (flags & 16384 /* Constructor */) return ScriptElementKind.constructorImplementationElement; if (flags & 4 /* Property */) { - if (flags & 536870912 /* UnionProperty */) { + if (flags & 1073741824 /* UnionProperty */) { return ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) { var rootSymbolFlags = rootSymbol.getFlags(); if (rootSymbolFlags & 4 /* Property */) { return ScriptElementKind.memberVariableElement; } - if (rootSymbolFlags & 16384 /* GetAccessor */) + if (rootSymbolFlags & 32768 /* GetAccessor */) return ScriptElementKind.memberVariableElement; - if (rootSymbolFlags & 32768 /* SetAccessor */) + if (rootSymbolFlags & 65536 /* SetAccessor */) return ScriptElementKind.memberVariableElement; - ts.Debug.assert(rootSymbolFlags & 4096 /* Method */); + ts.Debug.assert((rootSymbolFlags & 8192 /* Method */) !== undefined); }) || ScriptElementKind.memberFunctionElement; } return ScriptElementKind.memberVariableElement; @@ -33911,7 +32956,7 @@ var ts; return ScriptElementKind.interfaceElement; if (flags & 512 /* TypeParameter */) return ScriptElementKind.typeParameterElement; - if (flags & ts.TypeFlags.Intrinsic) + if (flags & 127 /* Intrinsic */) return ScriptElementKind.primitiveType; if (flags & 256 /* StringLiteral */) return ScriptElementKind.primitiveType; @@ -33919,42 +32964,24 @@ var ts; } function getNodeKind(node) { switch (node.kind) { - case 181 /* ModuleDeclaration */: - return ScriptElementKind.moduleElement; - case 177 /* ClassDeclaration */: - return ScriptElementKind.classElement; - case 178 /* InterfaceDeclaration */: - return ScriptElementKind.interfaceElement; - case 179 /* TypeAliasDeclaration */: - return ScriptElementKind.typeElement; - case 180 /* EnumDeclaration */: - return ScriptElementKind.enumElement; - case 174 /* VariableDeclaration */: - return node.flags & 4096 /* Const */ ? ScriptElementKind.constantElement : ScriptElementKind.variableElement; - case 175 /* FunctionDeclaration */: - return ScriptElementKind.functionElement; - case 123 /* GetAccessor */: - return ScriptElementKind.memberGetAccessorElement; - case 124 /* SetAccessor */: - return ScriptElementKind.memberSetAccessorElement; - case 121 /* Method */: - return ScriptElementKind.memberFunctionElement; - case 120 /* Property */: - return ScriptElementKind.memberVariableElement; - case 127 /* IndexSignature */: - return ScriptElementKind.indexSignatureElement; - case 126 /* ConstructSignature */: - return ScriptElementKind.constructSignatureElement; - case 125 /* CallSignature */: - return ScriptElementKind.callSignatureElement; - case 122 /* Constructor */: - return ScriptElementKind.constructorImplementationElement; - case 118 /* TypeParameter */: - return ScriptElementKind.typeParameterElement; - case 185 /* EnumMember */: - return ScriptElementKind.variableElement; - case 119 /* Parameter */: - return (node.flags & ts.NodeFlags.AccessibilityModifier) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; + 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 127 /* GetAccessor */: return ScriptElementKind.memberGetAccessorElement; + case 128 /* SetAccessor */: return ScriptElementKind.memberSetAccessorElement; + case 125 /* Method */: return ScriptElementKind.memberFunctionElement; + case 124 /* Property */: return ScriptElementKind.memberVariableElement; + case 131 /* IndexSignature */: return ScriptElementKind.indexSignatureElement; + case 130 /* ConstructSignature */: return ScriptElementKind.constructSignatureElement; + 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 123 /* Parameter */: return (node.flags & 112 /* AccessibilityModifier */) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; } return ScriptElementKind.unknown; } @@ -33968,20 +32995,20 @@ var ts; var symbolFlags = symbol.flags; var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver); var hasAddedSymbolInfo; - if (symbolKind !== ScriptElementKind.unknown || symbolFlags & 32 /* Class */ || symbolFlags & 16777216 /* Import */) { + 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); if (type) { - if (location.parent && location.parent.kind === 138 /* PropertyAccess */) { + if (location.parent && location.parent.kind === 142 /* PropertyAccess */) { var right = location.parent.right; - if (right === location || (right && right.kind === 116 /* Missing */)) { + if (right === location || (right && right.kind === 120 /* Missing */)) { location = location.parent; } } var callExpression; - if (location.kind === 140 /* CallExpression */ || location.kind === 141 /* NewExpression */) { + if (location.kind === 144 /* CallExpression */ || location.kind === 145 /* NewExpression */) { callExpression = location; } else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { @@ -33993,7 +33020,7 @@ var ts; if (!signature && candidateSignatures.length) { signature = candidateSignatures[0]; } - var useConstructSignatures = callExpression.kind === 141 /* NewExpression */ || callExpression.func.kind === 85 /* SuperKeyword */; + var useConstructSignatures = callExpression.kind === 145 /* 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; @@ -34003,14 +33030,14 @@ var ts; symbolKind = ScriptElementKind.constructorImplementationElement; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } - else if (symbolFlags & 16777216 /* Import */) { + else if (symbolFlags & 33554432 /* Import */) { symbolKind = ScriptElementKind.alias; - displayParts.push(punctuationPart(11 /* OpenParenToken */)); + displayParts.push(punctuationPart(15 /* OpenParenToken */)); displayParts.push(textPart(symbolKind)); - displayParts.push(punctuationPart(12 /* CloseParenToken */)); + displayParts.push(punctuationPart(16 /* CloseParenToken */)); displayParts.push(spacePart()); if (useConstructSignatures) { - displayParts.push(keywordPart(82 /* NewKeyword */)); + displayParts.push(keywordPart(86 /* NewKeyword */)); displayParts.push(spacePart()); } addFullSymbolName(symbol); @@ -34024,10 +33051,10 @@ var ts; case ScriptElementKind.constantElement: case ScriptElementKind.parameterElement: case ScriptElementKind.localVariableElement: - displayParts.push(punctuationPart(46 /* ColonToken */)); + displayParts.push(punctuationPart(50 /* ColonToken */)); displayParts.push(spacePart()); if (useConstructSignatures) { - displayParts.push(keywordPart(82 /* NewKeyword */)); + displayParts.push(keywordPart(86 /* NewKeyword */)); displayParts.push(spacePart()); } if (!(type.flags & 32768 /* Anonymous */)) { @@ -34041,21 +33068,21 @@ var ts; hasAddedSymbolInfo = true; } } - else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & ts.SymbolFlags.Accessor)) || (location.kind === 107 /* ConstructorKeyword */ && location.parent.kind === 122 /* Constructor */)) { + else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304 /* Accessor */)) || (location.kind === 111 /* ConstructorKeyword */ && location.parent.kind === 126 /* Constructor */)) { var signature; var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 122 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures(); + var allSignatures = functionDeclaration.kind === 126 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures(); if (!typeResolver.isImplementationOfOverload(functionDeclaration)) { signature = typeResolver.getSignatureFromDeclaration(functionDeclaration); } else { signature = allSignatures[0]; } - if (functionDeclaration.kind === 122 /* Constructor */) { + if (functionDeclaration.kind === 126 /* Constructor */) { addPrefixForAnyFunctionOrVar(type.symbol, ScriptElementKind.constructorImplementationElement); } else { - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 125 /* CallSignature */ && !(type.symbol.flags & 1024 /* TypeLiteral */ || type.symbol.flags & 2048 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 129 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); hasAddedSymbolInfo = true; @@ -34063,62 +33090,62 @@ var ts; } } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo) { - displayParts.push(keywordPart(63 /* ClassKeyword */)); + displayParts.push(keywordPart(67 /* ClassKeyword */)); displayParts.push(spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } if ((symbolFlags & 64 /* Interface */) && (semanticMeaning & 2 /* Type */)) { addNewLineIfDisplayPartsExist(); - displayParts.push(keywordPart(97 /* InterfaceKeyword */)); + displayParts.push(keywordPart(101 /* InterfaceKeyword */)); displayParts.push(spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } - if (symbolFlags & 1048576 /* TypeAlias */) { + if (symbolFlags & 2097152 /* TypeAlias */) { addNewLineIfDisplayPartsExist(); - displayParts.push(keywordPart(115 /* TypeKeyword */)); + displayParts.push(keywordPart(119 /* TypeKeyword */)); displayParts.push(spacePart()); addFullSymbolName(symbol); displayParts.push(spacePart()); - displayParts.push(punctuationPart(47 /* EqualsToken */)); + displayParts.push(punctuationPart(51 /* EqualsToken */)); displayParts.push(spacePart()); displayParts.push.apply(displayParts, typeToDisplayParts(typeResolver, typeResolver.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration)); } - if (symbolFlags & 128 /* Enum */) { + if (symbolFlags & 384 /* Enum */) { addNewLineIfDisplayPartsExist(); - displayParts.push(keywordPart(71 /* EnumKeyword */)); + displayParts.push(keywordPart(75 /* EnumKeyword */)); displayParts.push(spacePart()); addFullSymbolName(symbol); } - if (symbolFlags & ts.SymbolFlags.Module) { + if (symbolFlags & 1536 /* Module */) { addNewLineIfDisplayPartsExist(); - displayParts.push(keywordPart(110 /* ModuleKeyword */)); + displayParts.push(keywordPart(114 /* ModuleKeyword */)); displayParts.push(spacePart()); addFullSymbolName(symbol); } - if ((symbolFlags & 524288 /* TypeParameter */) && (semanticMeaning & 2 /* Type */)) { + if ((symbolFlags & 1048576 /* TypeParameter */) && (semanticMeaning & 2 /* Type */)) { addNewLineIfDisplayPartsExist(); - displayParts.push(punctuationPart(11 /* OpenParenToken */)); + displayParts.push(punctuationPart(15 /* OpenParenToken */)); displayParts.push(textPart("type parameter")); - displayParts.push(punctuationPart(12 /* CloseParenToken */)); + displayParts.push(punctuationPart(16 /* CloseParenToken */)); displayParts.push(spacePart()); addFullSymbolName(symbol); displayParts.push(spacePart()); - displayParts.push(keywordPart(80 /* InKeyword */)); + displayParts.push(keywordPart(84 /* InKeyword */)); displayParts.push(spacePart()); if (symbol.parent) { addFullSymbolName(symbol.parent, enclosingDeclaration); writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); } else { - var signatureDeclaration = ts.getDeclarationOfKind(symbol, 118 /* TypeParameter */).parent; + var signatureDeclaration = ts.getDeclarationOfKind(symbol, 122 /* TypeParameter */).parent; var signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); - if (signatureDeclaration.kind === 126 /* ConstructSignature */) { - displayParts.push(keywordPart(82 /* NewKeyword */)); + if (signatureDeclaration.kind === 130 /* ConstructSignature */) { + displayParts.push(keywordPart(86 /* NewKeyword */)); displayParts.push(spacePart()); } - else if (signatureDeclaration.kind !== 125 /* CallSignature */ && signatureDeclaration.name) { + else if (signatureDeclaration.kind !== 129 /* CallSignature */ && signatureDeclaration.name) { addFullSymbolName(signatureDeclaration.symbol); } displayParts.push.apply(displayParts, signatureToDisplayParts(typeResolver, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); @@ -34127,32 +33154,32 @@ var ts; if (symbolFlags & 8 /* EnumMember */) { addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 185 /* EnumMember */) { + if (declaration.kind === 192 /* EnumMember */) { var constantValue = typeResolver.getEnumMemberValue(declaration); if (constantValue !== undefined) { displayParts.push(spacePart()); - displayParts.push(operatorPart(47 /* EqualsToken */)); + displayParts.push(operatorPart(51 /* EqualsToken */)); displayParts.push(spacePart()); displayParts.push(displayPart(constantValue.toString(), 7 /* numericLiteral */)); } } } - if (symbolFlags & 16777216 /* Import */) { + if (symbolFlags & 33554432 /* Import */) { addNewLineIfDisplayPartsExist(); - displayParts.push(keywordPart(79 /* ImportKeyword */)); + displayParts.push(keywordPart(83 /* ImportKeyword */)); displayParts.push(spacePart()); addFullSymbolName(symbol); displayParts.push(spacePart()); - displayParts.push(punctuationPart(47 /* EqualsToken */)); + displayParts.push(punctuationPart(51 /* EqualsToken */)); displayParts.push(spacePart()); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 183 /* ImportDeclaration */) { + if (declaration.kind === 190 /* ImportDeclaration */) { var importDeclaration = declaration; if (importDeclaration.externalModuleName) { - displayParts.push(keywordPart(111 /* RequireKeyword */)); - displayParts.push(punctuationPart(11 /* OpenParenToken */)); + displayParts.push(keywordPart(115 /* RequireKeyword */)); + displayParts.push(punctuationPart(15 /* OpenParenToken */)); displayParts.push(displayPart(ts.getTextOfNode(importDeclaration.externalModuleName), 8 /* stringLiteral */)); - displayParts.push(punctuationPart(12 /* CloseParenToken */)); + displayParts.push(punctuationPart(16 /* CloseParenToken */)); } else { var internalAliasSymbol = typeResolver.getSymbolInfo(importDeclaration.entityName); @@ -34166,10 +33193,10 @@ var ts; if (symbolKind !== ScriptElementKind.unknown) { if (type) { addPrefixForAnyFunctionOrVar(symbol, symbolKind); - if (symbolKind === ScriptElementKind.memberVariableElement || symbolFlags & ts.SymbolFlags.Variable || symbolKind === ScriptElementKind.localVariableElement) { - displayParts.push(punctuationPart(46 /* ColonToken */)); + if (symbolKind === ScriptElementKind.memberVariableElement || symbolFlags & 3 /* Variable */ || symbolKind === ScriptElementKind.localVariableElement) { + displayParts.push(punctuationPart(50 /* ColonToken */)); displayParts.push(spacePart()); - if (type.symbol && type.symbol.flags & 524288 /* TypeParameter */) { + if (type.symbol && type.symbol.flags & 1048576 /* TypeParameter */) { var typeParameterParts = mapToDisplayParts(function (writer) { typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); }); @@ -34179,7 +33206,7 @@ var ts; displayParts.push.apply(displayParts, typeToDisplayParts(typeResolver, type, enclosingDeclaration)); } } - else if (symbolFlags & 16 /* Function */ || symbolFlags & 4096 /* Method */ || symbolFlags & 8192 /* Constructor */ || symbolFlags & ts.SymbolFlags.Signature || symbolFlags & ts.SymbolFlags.Accessor || symbolKind === ScriptElementKind.memberFunctionElement) { + else if (symbolFlags & 16 /* Function */ || symbolFlags & 8192 /* Method */ || symbolFlags & 16384 /* Constructor */ || symbolFlags & 917504 /* Signature */ || symbolFlags & 98304 /* Accessor */ || symbolKind === ScriptElementKind.memberFunctionElement) { var allSignatures = type.getCallSignatures(); addSignatureDisplayParts(allSignatures[0], allSignatures); } @@ -34205,9 +33232,9 @@ var ts; function addPrefixForAnyFunctionOrVar(symbol, symbolKind) { addNewLineIfDisplayPartsExist(); if (symbolKind) { - displayParts.push(punctuationPart(11 /* OpenParenToken */)); + displayParts.push(punctuationPart(15 /* OpenParenToken */)); displayParts.push(textPart(symbolKind)); - displayParts.push(punctuationPart(12 /* CloseParenToken */)); + displayParts.push(punctuationPart(16 /* CloseParenToken */)); displayParts.push(spacePart()); addFullSymbolName(symbol); } @@ -34216,12 +33243,12 @@ var ts; displayParts.push.apply(displayParts, signatureToDisplayParts(typeResolver, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */)); if (allSignatures.length > 1) { displayParts.push(spacePart()); - displayParts.push(punctuationPart(11 /* OpenParenToken */)); - displayParts.push(operatorPart(28 /* PlusToken */)); + displayParts.push(punctuationPart(15 /* OpenParenToken */)); + displayParts.push(operatorPart(32 /* PlusToken */)); displayParts.push(displayPart((allSignatures.length - 1).toString(), 7 /* numericLiteral */)); displayParts.push(spacePart()); displayParts.push(textPart(allSignatures.length === 2 ? "overload" : "overloads")); - displayParts.push(punctuationPart(12 /* CloseParenToken */)); + displayParts.push(punctuationPart(16 /* CloseParenToken */)); } documentation = signature.getDocumentationComment(); } @@ -34243,11 +33270,11 @@ var ts; var symbol = typeInfoResolver.getSymbolInfo(node); if (!symbol) { switch (node.kind) { - case 59 /* Identifier */: - case 138 /* PropertyAccess */: - case 117 /* QualifiedName */: - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: + case 63 /* Identifier */: + case 142 /* PropertyAccess */: + case 121 /* QualifiedName */: + case 91 /* ThisKeyword */: + case 89 /* SuperKeyword */: var type = typeInfoResolver.getTypeOfNode(node); if (type) { return { @@ -34285,7 +33312,7 @@ var ts; var declarations = []; var definition; ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 122 /* Constructor */) || (!selectConstructors && (d.kind === 175 /* FunctionDeclaration */ || d.kind === 121 /* Method */))) { + if ((selectConstructors && d.kind === 126 /* Constructor */) || (!selectConstructors && (d.kind === 182 /* FunctionDeclaration */ || d.kind === 125 /* Method */))) { declarations.push(d); if (d.body) definition = d; @@ -34302,10 +33329,10 @@ var ts; return false; } function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (isNewExpressionTarget(location) || location.kind === 107 /* ConstructorKeyword */) { + if (isNewExpressionTarget(location) || location.kind === 111 /* ConstructorKeyword */) { if (symbol.flags & 32 /* Class */) { var classDeclaration = symbol.getDeclarations()[0]; - ts.Debug.assert(classDeclaration && classDeclaration.kind === 177 /* ClassDeclaration */); + ts.Debug.assert(classDeclaration && classDeclaration.kind === 184 /* ClassDeclaration */); return tryAddSignature(classDeclaration.members, true, symbolKind, symbolName, containerName, result); } } @@ -34370,94 +33397,94 @@ var ts; if (!node) { return undefined; } - if (node.kind === 59 /* Identifier */ || node.kind === 87 /* ThisKeyword */ || node.kind === 85 /* SuperKeyword */ || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { + if (node.kind === 63 /* Identifier */ || node.kind === 91 /* ThisKeyword */ || node.kind === 89 /* SuperKeyword */ || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { return getReferencesForNode(node, [sourceFile], false, false); } switch (node.kind) { - case 78 /* IfKeyword */: - case 70 /* ElseKeyword */: - if (hasKind(node.parent, 155 /* IfStatement */)) { + case 82 /* IfKeyword */: + case 74 /* ElseKeyword */: + if (hasKind(node.parent, 162 /* IfStatement */)) { return getIfElseOccurrences(node.parent); } break; - case 84 /* ReturnKeyword */: - if (hasKind(node.parent, 162 /* ReturnStatement */)) { + case 88 /* ReturnKeyword */: + if (hasKind(node.parent, 169 /* ReturnStatement */)) { return getReturnOccurrences(node.parent); } break; - case 88 /* ThrowKeyword */: - if (hasKind(node.parent, 168 /* ThrowStatement */)) { + case 92 /* ThrowKeyword */: + if (hasKind(node.parent, 175 /* ThrowStatement */)) { return getThrowOccurrences(node.parent); } break; - case 90 /* TryKeyword */: - case 62 /* CatchKeyword */: - case 75 /* FinallyKeyword */: - if (hasKind(parent(parent(node)), 169 /* TryStatement */)) { + case 94 /* TryKeyword */: + case 66 /* CatchKeyword */: + case 79 /* FinallyKeyword */: + if (hasKind(parent(parent(node)), 176 /* TryStatement */)) { return getTryCatchFinallyOccurrences(node.parent.parent); } break; - case 86 /* SwitchKeyword */: - if (hasKind(node.parent, 164 /* SwitchStatement */)) { + case 90 /* SwitchKeyword */: + if (hasKind(node.parent, 171 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent); } break; - case 61 /* CaseKeyword */: - case 67 /* DefaultKeyword */: - if (hasKind(parent(parent(node)), 164 /* SwitchStatement */)) { + case 65 /* CaseKeyword */: + case 71 /* DefaultKeyword */: + if (hasKind(parent(parent(node)), 171 /* SwitchStatement */)) { return getSwitchCaseDefaultOccurrences(node.parent.parent); } break; - case 60 /* BreakKeyword */: - case 65 /* ContinueKeyword */: - if (hasKind(node.parent, 161 /* BreakStatement */) || hasKind(node.parent, 160 /* ContinueStatement */)) { + case 64 /* BreakKeyword */: + case 69 /* ContinueKeyword */: + if (hasKind(node.parent, 168 /* BreakStatement */) || hasKind(node.parent, 167 /* ContinueStatement */)) { return getBreakOrContinueStatementOccurences(node.parent); } break; - case 76 /* ForKeyword */: - if (hasKind(node.parent, 158 /* ForStatement */) || hasKind(node.parent, 159 /* ForInStatement */)) { + case 80 /* ForKeyword */: + if (hasKind(node.parent, 165 /* ForStatement */) || hasKind(node.parent, 166 /* ForInStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; - case 94 /* WhileKeyword */: - case 69 /* DoKeyword */: - if (hasKind(node.parent, 157 /* WhileStatement */) || hasKind(node.parent, 156 /* DoStatement */)) { + case 98 /* WhileKeyword */: + case 73 /* DoKeyword */: + if (hasKind(node.parent, 164 /* WhileStatement */) || hasKind(node.parent, 163 /* DoStatement */)) { return getLoopBreakContinueOccurrences(node.parent); } break; - case 107 /* ConstructorKeyword */: - if (hasKind(node.parent, 122 /* Constructor */)) { + case 111 /* ConstructorKeyword */: + if (hasKind(node.parent, 126 /* Constructor */)) { return getConstructorOccurrences(node.parent); } break; - case 109 /* GetKeyword */: - case 113 /* SetKeyword */: - if (hasKind(node.parent, 123 /* GetAccessor */) || hasKind(node.parent, 124 /* SetAccessor */)) { + case 113 /* GetKeyword */: + case 117 /* SetKeyword */: + if (hasKind(node.parent, 127 /* GetAccessor */) || hasKind(node.parent, 128 /* SetAccessor */)) { return getGetAndSetOccurrences(node.parent); } } return undefined; function getIfElseOccurrences(ifStatement) { var keywords = []; - while (hasKind(ifStatement.parent, 155 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { + while (hasKind(ifStatement.parent, 162 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { ifStatement = ifStatement.parent; } while (ifStatement) { var children = ifStatement.getChildren(); - pushKeywordIf(keywords, children[0], 78 /* IfKeyword */); + pushKeywordIf(keywords, children[0], 82 /* IfKeyword */); for (var i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], 70 /* ElseKeyword */)) { + if (pushKeywordIf(keywords, children[i], 74 /* ElseKeyword */)) { break; } } - if (!hasKind(ifStatement.elseStatement, 155 /* IfStatement */)) { + if (!hasKind(ifStatement.elseStatement, 162 /* IfStatement */)) { break; } ifStatement = ifStatement.elseStatement; } var result = []; for (var i = 0; i < keywords.length; i++) { - if (keywords[i].kind === 70 /* ElseKeyword */ && i < keywords.length - 1) { + if (keywords[i].kind === 74 /* ElseKeyword */ && i < keywords.length - 1) { var elseKeyword = keywords[i]; var ifKeyword = keywords[i + 1]; var shouldHighlightNextKeyword = true; @@ -34483,15 +33510,15 @@ var ts; } function getReturnOccurrences(returnStatement) { var func = ts.getContainingFunction(returnStatement); - if (!(func && hasKind(func.body, 176 /* FunctionBlock */))) { + if (!(func && hasKind(func.body, 183 /* FunctionBlock */))) { return undefined; } var keywords = []; ts.forEachReturnStatement(func.body, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 84 /* ReturnKeyword */); + pushKeywordIf(keywords, returnStatement.getFirstToken(), 88 /* ReturnKeyword */); }); ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 88 /* ThrowKeyword */); + pushKeywordIf(keywords, throwStatement.getFirstToken(), 92 /* ThrowKeyword */); }); return ts.map(keywords, getReferenceEntryFromNode); } @@ -34502,11 +33529,11 @@ var ts; } var keywords = []; ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 88 /* ThrowKeyword */); + pushKeywordIf(keywords, throwStatement.getFirstToken(), 92 /* ThrowKeyword */); }); - if (owner.kind === 176 /* FunctionBlock */) { + if (owner.kind === 183 /* FunctionBlock */) { ts.forEachReturnStatement(owner, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 84 /* ReturnKeyword */); + pushKeywordIf(keywords, returnStatement.getFirstToken(), 88 /* ReturnKeyword */); }); } return ts.map(keywords, getReferenceEntryFromNode); @@ -34516,10 +33543,10 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 168 /* ThrowStatement */) { + if (node.kind === 175 /* ThrowStatement */) { statementAccumulator.push(node); } - else if (node.kind === 169 /* TryStatement */) { + else if (node.kind === 176 /* TryStatement */) { var tryStatement = node; if (tryStatement.catchBlock) { aggregate(tryStatement.catchBlock); @@ -34541,10 +33568,10 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (parent.kind === 176 /* FunctionBlock */ || parent.kind === 186 /* SourceFile */) { + if (parent.kind === 183 /* FunctionBlock */ || parent.kind === 193 /* SourceFile */) { return parent; } - if (parent.kind === 169 /* TryStatement */) { + if (parent.kind === 176 /* TryStatement */) { var tryStatement = parent; if (tryStatement.tryBlock === child && tryStatement.catchBlock) { return child; @@ -34556,22 +33583,22 @@ var ts; } function getTryCatchFinallyOccurrences(tryStatement) { var keywords = []; - pushKeywordIf(keywords, tryStatement.getFirstToken(), 90 /* TryKeyword */); + pushKeywordIf(keywords, tryStatement.getFirstToken(), 94 /* TryKeyword */); if (tryStatement.catchBlock) { - pushKeywordIf(keywords, tryStatement.catchBlock.getFirstToken(), 62 /* CatchKeyword */); + pushKeywordIf(keywords, tryStatement.catchBlock.getFirstToken(), 66 /* CatchKeyword */); } if (tryStatement.finallyBlock) { - pushKeywordIf(keywords, tryStatement.finallyBlock.getFirstToken(), 75 /* FinallyKeyword */); + pushKeywordIf(keywords, tryStatement.finallyBlock.getFirstToken(), 79 /* FinallyKeyword */); } return ts.map(keywords, getReferenceEntryFromNode); } function getLoopBreakContinueOccurrences(loopNode) { var keywords = []; - if (pushKeywordIf(keywords, loopNode.getFirstToken(), 76 /* ForKeyword */, 94 /* WhileKeyword */, 69 /* DoKeyword */)) { - if (loopNode.kind === 156 /* DoStatement */) { + if (pushKeywordIf(keywords, loopNode.getFirstToken(), 80 /* ForKeyword */, 98 /* WhileKeyword */, 73 /* DoKeyword */)) { + if (loopNode.kind === 163 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, loopTokens[i], 94 /* WhileKeyword */)) { + if (pushKeywordIf(keywords, loopTokens[i], 98 /* WhileKeyword */)) { break; } } @@ -34580,21 +33607,21 @@ var ts; var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); ts.forEach(breaksAndContinues, function (statement) { if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 60 /* BreakKeyword */, 65 /* ContinueKeyword */); + pushKeywordIf(keywords, statement.getFirstToken(), 64 /* BreakKeyword */, 69 /* ContinueKeyword */); } }); return ts.map(keywords, getReferenceEntryFromNode); } function getSwitchCaseDefaultOccurrences(switchStatement) { var keywords = []; - pushKeywordIf(keywords, switchStatement.getFirstToken(), 86 /* SwitchKeyword */); - var breakSearchType = BreakContinueSearchType.All; + pushKeywordIf(keywords, switchStatement.getFirstToken(), 90 /* SwitchKeyword */); + var breakSearchType = 3 /* All */; ts.forEach(switchStatement.clauses, function (clause) { - pushKeywordIf(keywords, clause.getFirstToken(), 61 /* CaseKeyword */, 67 /* DefaultKeyword */); + pushKeywordIf(keywords, clause.getFirstToken(), 65 /* CaseKeyword */, 71 /* DefaultKeyword */); var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); ts.forEach(breaksAndContinues, function (statement) { if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 60 /* BreakKeyword */); + pushKeywordIf(keywords, statement.getFirstToken(), 64 /* BreakKeyword */); } }); }); @@ -34604,12 +33631,12 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 158 /* ForStatement */: - case 159 /* ForInStatement */: - case 156 /* DoStatement */: - case 157 /* WhileStatement */: + case 165 /* ForStatement */: + case 166 /* ForInStatement */: + case 163 /* DoStatement */: + case 164 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 164 /* SwitchStatement */: + case 171 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -34620,7 +33647,7 @@ var ts; aggregate(node); return statementAccumulator; function aggregate(node) { - if (node.kind === 161 /* BreakStatement */ || node.kind === 160 /* ContinueStatement */) { + if (node.kind === 168 /* BreakStatement */ || node.kind === 167 /* ContinueStatement */) { statementAccumulator.push(node); } else if (!ts.isAnyFunction(node)) { @@ -34636,14 +33663,14 @@ var ts; function getBreakOrContinueOwner(statement) { for (var node = statement.parent; node; node = node.parent) { switch (node.kind) { - case 164 /* SwitchStatement */: - if (statement.kind === 160 /* ContinueStatement */) { + case 171 /* SwitchStatement */: + if (statement.kind === 167 /* ContinueStatement */) { continue; } - case 158 /* ForStatement */: - case 159 /* ForInStatement */: - case 157 /* WhileStatement */: - case 156 /* DoStatement */: + case 165 /* ForStatement */: + case 166 /* ForInStatement */: + case 164 /* WhileStatement */: + case 163 /* DoStatement */: if (!statement.label || isLabeledBy(node, statement.label.text)) { return node; } @@ -34662,20 +33689,20 @@ var ts; var keywords = []; ts.forEach(declarations, function (declaration) { ts.forEach(declaration.getChildren(), function (token) { - return pushKeywordIf(keywords, token, 107 /* ConstructorKeyword */); + return pushKeywordIf(keywords, token, 111 /* ConstructorKeyword */); }); }); return ts.map(keywords, getReferenceEntryFromNode); } function getGetAndSetOccurrences(accessorDeclaration) { var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 123 /* GetAccessor */); - tryPushAccessorKeyword(accessorDeclaration.symbol, 124 /* SetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 127 /* GetAccessor */); + tryPushAccessorKeyword(accessorDeclaration.symbol, 128 /* SetAccessor */); return ts.map(keywords, getReferenceEntryFromNode); function tryPushAccessorKeyword(accessorSymbol, accessorKind) { var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); if (accessor) { - ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 109 /* GetKeyword */, 113 /* SetKeyword */); }); + ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 113 /* GetKeyword */, 117 /* SetKeyword */); }); } } } @@ -34711,10 +33738,10 @@ var ts; if (!node) { return undefined; } - if (node.kind !== 59 /* Identifier */ && !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && !isNameOfExternalModuleImportOrDeclaration(node)) { + if (node.kind !== 63 /* Identifier */ && !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && !isNameOfExternalModuleImportOrDeclaration(node)) { return undefined; } - ts.Debug.assert(node.kind === 59 /* Identifier */ || node.kind === 6 /* NumericLiteral */ || node.kind === 7 /* StringLiteral */); + ts.Debug.assert(node.kind === 63 /* Identifier */ || node.kind === 6 /* NumericLiteral */ || node.kind === 7 /* StringLiteral */); return getReferencesForNode(node, program.getSourceFiles(), findInStrings, findInComments); } function getReferencesForNode(node, sourceFiles, findInStrings, findInComments) { @@ -34727,10 +33754,10 @@ var ts; return getLabelReferencesInNode(node.parent, node); } } - if (node.kind === 87 /* ThisKeyword */) { + if (node.kind === 91 /* ThisKeyword */) { return getReferencesForThisKeyword(node, sourceFiles); } - if (node.kind === 85 /* SuperKeyword */) { + if (node.kind === 89 /* SuperKeyword */) { return getReferencesForSuperKeyword(node); } var symbol = typeInfoResolver.getSymbolInfo(node); @@ -34760,7 +33787,7 @@ var ts; } return result; function getNormalizedSymbolName(symbolName, declarations) { - var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 144 /* FunctionExpression */ ? d : undefined; }); + var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 149 /* FunctionExpression */ ? d : undefined; }); if (functionExpression && functionExpression.name) { var name = functionExpression.name.text; } @@ -34775,10 +33802,10 @@ var ts; return name; } function getSymbolScope(symbol) { - if (symbol.getFlags() && (4 /* Property */ | 4096 /* Method */)) { + 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, 177 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 184 /* ClassDeclaration */); } } if (symbol.parent) { @@ -34792,7 +33819,7 @@ var ts; if (scope && scope !== container) { return undefined; } - if (container.kind === 186 /* SourceFile */ && !ts.isExternalModule(container)) { + if (container.kind === 193 /* SourceFile */ && !ts.isExternalModule(container)) { return undefined; } scope = container; @@ -34814,7 +33841,7 @@ var ts; if (position > end) break; var endPosition = position + symbolNameLength; - if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), ts.ScriptTarget.Latest)) && (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), ts.ScriptTarget.Latest))) { + if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2 /* Latest */)) && (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2 /* Latest */))) { positions.push(position); } position = text.indexOf(symbolName, position + symbolNameLength + 1); @@ -34841,7 +33868,7 @@ var ts; function isValidReferencePosition(node, searchSymbolName) { if (node) { switch (node.kind) { - case 59 /* Identifier */: + case 63 /* Identifier */: return node.getWidth() === searchSymbolName.length; case 7 /* StringLiteral */: if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { @@ -34912,11 +33939,11 @@ var ts; } var staticFlag = 128 /* Static */; switch (searchSpaceNode.kind) { - case 120 /* Property */: - case 121 /* Method */: - case 122 /* Constructor */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; @@ -34929,7 +33956,7 @@ var ts; ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 85 /* SuperKeyword */) { + if (!node || node.kind !== 89 /* SuperKeyword */) { return; } var container = ts.getSuperContainer(node); @@ -34943,26 +33970,26 @@ var ts; var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false); var staticFlag = 128 /* Static */; switch (searchSpaceNode.kind) { - case 120 /* Property */: - case 121 /* Method */: - case 122 /* Constructor */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: + case 124 /* Property */: + case 125 /* Method */: + case 126 /* Constructor */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: staticFlag &= searchSpaceNode.flags; searchSpaceNode = searchSpaceNode.parent; break; - case 186 /* SourceFile */: + case 193 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } - case 175 /* FunctionDeclaration */: - case 144 /* FunctionExpression */: + case 182 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: break; default: return undefined; } var result = []; - if (searchSpaceNode.kind === 186 /* SourceFile */) { + if (searchSpaceNode.kind === 193 /* SourceFile */) { ts.forEach(sourceFiles, function (sourceFile) { var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, result); @@ -34978,24 +34005,24 @@ var ts; ts.forEach(possiblePositions, function (position) { cancellationToken.throwIfCancellationRequested(); var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 87 /* ThisKeyword */) { + if (!node || node.kind !== 91 /* ThisKeyword */) { return; } var container = ts.getThisContainer(node, false); switch (searchSpaceNode.kind) { - case 144 /* FunctionExpression */: - case 175 /* FunctionDeclaration */: + case 149 /* FunctionExpression */: + case 182 /* FunctionDeclaration */: if (searchSpaceNode.symbol === container.symbol) { result.push(getReferenceEntryFromNode(node)); } break; - case 177 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 128 /* Static */) === staticFlag) { result.push(getReferenceEntryFromNode(node)); } break; - case 186 /* SourceFile */: - if (container.kind === 186 /* SourceFile */ && !ts.isExternalModule(container)) { + case 193 /* SourceFile */: + if (container.kind === 193 /* SourceFile */ && !ts.isExternalModule(container)) { result.push(getReferenceEntryFromNode(node)); } break; @@ -35023,11 +34050,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 === 177 /* ClassDeclaration */) { + if (declaration.kind === 184 /* ClassDeclaration */) { getPropertySymbolFromTypeReference(declaration.baseType); ts.forEach(declaration.implementedTypes, getPropertySymbolFromTypeReference); } - else if (declaration.kind === 178 /* InterfaceDeclaration */) { + else if (declaration.kind === 185 /* InterfaceDeclaration */) { ts.forEach(declaration.baseTypes, getPropertySymbolFromTypeReference); } }); @@ -35128,17 +34155,17 @@ var ts; }; } function isWriteAccess(node) { - if (node.kind === 59 /* Identifier */ && ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { + if (node.kind === 63 /* Identifier */ && ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { return true; } var parent = node.parent; if (parent) { - if (parent.kind === 147 /* PostfixOperator */ || parent.kind === 146 /* PrefixOperator */) { + if (parent.kind === 152 /* PostfixOperator */ || parent.kind === 151 /* PrefixOperator */) { return true; } - else if (parent.kind === 148 /* BinaryExpression */ && parent.left === node) { + else if (parent.kind === 153 /* BinaryExpression */ && parent.left === node) { var operator = parent.operator; - return ts.SyntaxKind.FirstAssignment <= operator && operator <= ts.SyntaxKind.LastAssignment; + return 51 /* FirstAssignment */ <= operator && operator <= 62 /* LastAssignment */; } } return false; @@ -35250,40 +34277,40 @@ var ts; } function getMeaningFromDeclaration(node) { switch (node.kind) { - case 119 /* Parameter */: - case 174 /* VariableDeclaration */: - case 120 /* Property */: - case 137 /* PropertyAssignment */: - case 185 /* EnumMember */: - case 121 /* Method */: - case 122 /* Constructor */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 175 /* FunctionDeclaration */: - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: - case 171 /* CatchBlock */: + case 123 /* Parameter */: + case 181 /* VariableDeclaration */: + case 124 /* Property */: + case 141 /* PropertyAssignment */: + case 192 /* 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 */: return 1 /* Value */; - case 118 /* TypeParameter */: - case 178 /* InterfaceDeclaration */: - case 179 /* TypeAliasDeclaration */: - case 130 /* TypeLiteral */: + case 122 /* TypeParameter */: + case 185 /* InterfaceDeclaration */: + case 186 /* TypeAliasDeclaration */: + case 134 /* TypeLiteral */: return 2 /* Type */; - case 177 /* ClassDeclaration */: - case 180 /* EnumDeclaration */: + case 184 /* ClassDeclaration */: + case 187 /* EnumDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: if (node.name.kind === 7 /* StringLiteral */) { return 4 /* Namespace */ | 1 /* Value */; } - else if (ts.isInstantiated(node)) { + else if (ts.getModuleInstanceState(node) === 1 /* Instantiated */) { return 4 /* Namespace */ | 1 /* Value */; } else { return 4 /* Namespace */; } break; - case 183 /* ImportDeclaration */: + case 190 /* ImportDeclaration */: return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } ts.Debug.fail("Unknown declaration type"); @@ -35292,33 +34319,33 @@ var ts; if (isRightSideOfQualifiedName(node)) { node = node.parent; } - return node.parent.kind === 128 /* TypeReference */; + return node.parent.kind === 132 /* TypeReference */; } function isNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 117 /* QualifiedName */) { - while (root.parent && root.parent.kind === 117 /* QualifiedName */) + if (root.parent.kind === 121 /* QualifiedName */) { + while (root.parent && root.parent.kind === 121 /* QualifiedName */) root = root.parent; isLastClause = root.right === node; } - return root.parent.kind === 128 /* TypeReference */ && !isLastClause; + return root.parent.kind === 132 /* TypeReference */ && !isLastClause; } function isInRightSideOfImport(node) { - while (node.parent.kind === 117 /* QualifiedName */) { + while (node.parent.kind === 121 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 183 /* ImportDeclaration */ && node.parent.entityName === node; + return node.parent.kind === 190 /* ImportDeclaration */ && node.parent.entityName === node; } function getMeaningFromRightHandSideOfImport(node) { - ts.Debug.assert(node.kind === 59 /* Identifier */); - if (node.parent.kind === 117 /* QualifiedName */ && node.parent.right === node && node.parent.parent.kind === 183 /* ImportDeclaration */) { + ts.Debug.assert(node.kind === 63 /* Identifier */); + if (node.parent.kind === 121 /* QualifiedName */ && node.parent.right === node && node.parent.parent.kind === 190 /* ImportDeclaration */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } return 4 /* Namespace */; } function getMeaningFromLocation(node) { - if (node.parent.kind === 184 /* ExportAssignment */) { + if (node.parent.kind === 191 /* ExportAssignment */) { return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; } else if (isInRightSideOfImport(node)) { @@ -35407,15 +34434,15 @@ var ts; return; } switch (node.kind) { - case 138 /* PropertyAccess */: - case 117 /* QualifiedName */: + case 142 /* PropertyAccess */: + case 121 /* QualifiedName */: case 7 /* StringLiteral */: - case 74 /* FalseKeyword */: - case 89 /* TrueKeyword */: - case 83 /* NullKeyword */: - case 85 /* SuperKeyword */: - case 87 /* ThisKeyword */: - case 59 /* Identifier */: + case 78 /* FalseKeyword */: + case 93 /* TrueKeyword */: + case 87 /* NullKeyword */: + case 89 /* SuperKeyword */: + case 91 /* ThisKeyword */: + case 63 /* Identifier */: break; default: return; @@ -35426,7 +34453,7 @@ var ts; nodeForStartPos = nodeForStartPos.parent; } else if (isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 181 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { + if (nodeForStartPos.parent.parent.kind === 188 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { nodeForStartPos = nodeForStartPos.parent.parent.name; } else { @@ -35459,18 +34486,18 @@ var ts; if (flags & 32 /* Class */) { return ClassificationTypeNames.className; } - else if (flags & 128 /* Enum */) { + else if (flags & 384 /* Enum */) { return ClassificationTypeNames.enumName; } else if (meaningAtPosition & 2 /* Type */) { if (flags & 64 /* Interface */) { return ClassificationTypeNames.interfaceName; } - else if (flags & 524288 /* TypeParameter */) { + else if (flags & 1048576 /* TypeParameter */) { return ClassificationTypeNames.typeParameterName; } } - else if (flags & ts.SymbolFlags.Module) { + else if (flags & 1536 /* Module */) { if (meaningAtPosition & 4 /* Namespace */ || (meaningAtPosition & 1 /* Value */ && hasValueSideModule(symbol))) { return ClassificationTypeNames.moduleName; } @@ -35478,13 +34505,13 @@ var ts; return undefined; function hasValueSideModule(symbol) { return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 181 /* ModuleDeclaration */ && ts.isInstantiated(declaration); + return declaration.kind === 188 /* ModuleDeclaration */ && ts.getModuleInstanceState(declaration) == 1 /* Instantiated */; }); } } function processNode(node) { if (node && span.intersectsWith(node.getStart(), node.getWidth())) { - if (node.kind === 59 /* Identifier */ && node.getWidth() > 0) { + if (node.kind === 63 /* Identifier */ && node.getWidth() > 0) { var symbol = typeInfoResolver.getSymbolInfo(node); if (symbol) { var type = classifySymbol(symbol, getMeaningFromLocation(node)); @@ -35533,13 +34560,13 @@ var ts; if (ts.isKeyword(tokenKind)) { return ClassificationTypeNames.keyword; } - if (tokenKind === 19 /* LessThanToken */ || tokenKind === 20 /* GreaterThanToken */) { + if (tokenKind === 23 /* LessThanToken */ || tokenKind === 24 /* GreaterThanToken */) { if (ts.getTypeArgumentOrTypeParameterList(token.parent)) { return ClassificationTypeNames.punctuation; } } if (ts.isPunctuation(token)) { - if (token.parent.kind === 148 /* BinaryExpression */ || token.parent.kind === 174 /* VariableDeclaration */ || token.parent.kind === 146 /* PrefixOperator */ || token.parent.kind === 147 /* PostfixOperator */ || token.parent.kind === 149 /* ConditionalExpression */) { + 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 */) { return ClassificationTypeNames.operator; } else { @@ -35555,29 +34582,32 @@ var ts; else if (tokenKind === 8 /* RegularExpressionLiteral */) { return ClassificationTypeNames.stringLiteral; } - else if (tokenKind === 59 /* Identifier */) { + else if (ts.isTemplateLiteralKind(tokenKind)) { + return ClassificationTypeNames.stringLiteral; + } + else if (tokenKind === 63 /* Identifier */) { switch (token.parent.kind) { - case 177 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.className; } return; - case 118 /* TypeParameter */: + case 122 /* TypeParameter */: if (token.parent.name === token) { return ClassificationTypeNames.typeParameterName; } return; - case 178 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.interfaceName; } return; - case 180 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.enumName; } return; - case 181 /* ModuleDeclaration */: + case 188 /* ModuleDeclaration */: if (token.parent.name === token) { return ClassificationTypeNames.moduleName; } @@ -35635,22 +34665,14 @@ var ts; return result; function getMatchingTokenKind(token) { switch (token.kind) { - case 9 /* OpenBraceToken */: - return 10 /* CloseBraceToken */; - case 11 /* OpenParenToken */: - return 12 /* CloseParenToken */; - case 13 /* OpenBracketToken */: - return 14 /* CloseBracketToken */; - case 19 /* LessThanToken */: - return 20 /* GreaterThanToken */; - case 10 /* CloseBraceToken */: - return 9 /* OpenBraceToken */; - case 12 /* CloseParenToken */: - return 11 /* OpenParenToken */; - case 14 /* CloseBracketToken */: - return 13 /* OpenBracketToken */; - case 20 /* GreaterThanToken */: - return 19 /* LessThanToken */; + case 13 /* OpenBraceToken */: return 14 /* CloseBraceToken */; + case 15 /* OpenParenToken */: return 16 /* CloseParenToken */; + case 17 /* OpenBracketToken */: return 18 /* CloseBracketToken */; + case 23 /* LessThanToken */: return 24 /* GreaterThanToken */; + case 14 /* CloseBraceToken */: return 13 /* OpenBraceToken */; + case 16 /* CloseParenToken */: return 15 /* OpenParenToken */; + case 18 /* CloseBracketToken */: return 17 /* OpenBracketToken */; + case 24 /* GreaterThanToken */: return 23 /* LessThanToken */; } return undefined; } @@ -35703,8 +34725,9 @@ var ts; return []; } function getTodoComments(filename, descriptors) { + synchronizeHostData(); filename = TypeScript.switchToForwardSlashes(filename); - var sourceFile = getCurrentSourceFile(filename); + var sourceFile = getSourceFile(filename); cancellationToken.throwIfCancellationRequested(); var fileContents = sourceFile.text; cancellationToken.throwIfCancellationRequested(); @@ -35728,7 +34751,7 @@ var ts; descriptor = descriptors[i]; } } - ts.Debug.assert(descriptor); + ts.Debug.assert(descriptor !== undefined); if (isLetterOrDigit(fileContents.charCodeAt(matchPosition + descriptor.text.length))) { continue; } @@ -35776,7 +34799,7 @@ var ts; fileName = TypeScript.switchToForwardSlashes(fileName); var sourceFile = getSourceFile(fileName); var node = ts.getTouchingWord(sourceFile, position); - if (node && node.kind === 59 /* Identifier */) { + if (node && node.kind === 63 /* Identifier */) { var symbol = typeInfoResolver.getSymbolInfo(node); if (symbol && symbol.getDeclarations() && symbol.getDeclarations().length > 0) { var kind = getSymbolKind(symbol, typeInfoResolver); @@ -35844,32 +34867,32 @@ var ts; } ts.createLanguageService = createLanguageService; function createClassifier(host) { - var scanner = ts.createScanner(ts.ScriptTarget.Latest, false); + var scanner = ts.createScanner(2 /* Latest */, false); var noRegexTable = []; - noRegexTable[59 /* Identifier */] = true; + noRegexTable[63 /* Identifier */] = true; noRegexTable[7 /* StringLiteral */] = true; noRegexTable[6 /* NumericLiteral */] = true; noRegexTable[8 /* RegularExpressionLiteral */] = true; - noRegexTable[87 /* ThisKeyword */] = true; - noRegexTable[33 /* PlusPlusToken */] = true; - noRegexTable[34 /* MinusMinusToken */] = true; - noRegexTable[12 /* CloseParenToken */] = true; - noRegexTable[14 /* CloseBracketToken */] = true; - noRegexTable[10 /* CloseBraceToken */] = true; - noRegexTable[89 /* TrueKeyword */] = true; - noRegexTable[74 /* FalseKeyword */] = true; + noRegexTable[91 /* ThisKeyword */] = true; + noRegexTable[37 /* PlusPlusToken */] = true; + noRegexTable[38 /* MinusMinusToken */] = true; + noRegexTable[16 /* CloseParenToken */] = true; + noRegexTable[18 /* CloseBracketToken */] = true; + noRegexTable[14 /* CloseBraceToken */] = true; + noRegexTable[93 /* TrueKeyword */] = true; + noRegexTable[78 /* FalseKeyword */] = true; function isAccessibilityModifier(kind) { switch (kind) { - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: + case 106 /* PublicKeyword */: + case 104 /* PrivateKeyword */: + case 105 /* ProtectedKeyword */: return true; } return false; } function canFollow(keyword1, keyword2) { if (isAccessibilityModifier(keyword1)) { - if (keyword2 === 109 /* GetKeyword */ || keyword2 === 113 /* SetKeyword */ || keyword2 === 107 /* ConstructorKeyword */ || keyword2 === 103 /* StaticKeyword */) { + if (keyword2 === 113 /* GetKeyword */ || keyword2 === 117 /* SetKeyword */ || keyword2 === 111 /* ConstructorKeyword */ || keyword2 === 107 /* StaticKeyword */) { return true; } return false; @@ -35904,26 +34927,26 @@ var ts; do { token = scanner.scan(); if (!ts.isTrivia(token)) { - if ((token === 31 /* SlashToken */ || token === 51 /* SlashEqualsToken */) && !noRegexTable[lastNonTriviaToken]) { + if ((token === 35 /* SlashToken */ || token === 55 /* SlashEqualsToken */) && !noRegexTable[lastNonTriviaToken]) { if (scanner.reScanSlashToken() === 8 /* RegularExpressionLiteral */) { token = 8 /* RegularExpressionLiteral */; } } - else if (lastNonTriviaToken === 15 /* DotToken */ && isKeyword(token)) { - token = 59 /* Identifier */; + else if (lastNonTriviaToken === 19 /* DotToken */ && isKeyword(token)) { + token = 63 /* Identifier */; } else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { - token = 59 /* Identifier */; + token = 63 /* Identifier */; } - else if (lastNonTriviaToken === 59 /* Identifier */ && token === 19 /* LessThanToken */) { + else if (lastNonTriviaToken === 63 /* Identifier */ && token === 23 /* LessThanToken */) { angleBracketStack++; } - else if (token === 20 /* GreaterThanToken */ && angleBracketStack > 0) { + else if (token === 24 /* GreaterThanToken */ && angleBracketStack > 0) { angleBracketStack--; } - else if (token === 105 /* AnyKeyword */ || token === 114 /* StringKeyword */ || token === 112 /* NumberKeyword */ || token === 106 /* BooleanKeyword */) { + else if (token === 109 /* AnyKeyword */ || token === 118 /* StringKeyword */ || token === 116 /* NumberKeyword */ || token === 110 /* BooleanKeyword */) { if (angleBracketStack > 0) { - token = 59 /* Identifier */; + token = 63 /* Identifier */; } } lastNonTriviaToken = token; @@ -35962,62 +34985,61 @@ var ts; } function isBinaryExpressionOperatorToken(token) { switch (token) { - case 30 /* AsteriskToken */: - case 31 /* SlashToken */: - case 32 /* PercentToken */: - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 35 /* LessThanLessThanToken */: - case 36 /* GreaterThanGreaterThanToken */: - case 37 /* GreaterThanGreaterThanGreaterThanToken */: - case 19 /* LessThanToken */: - case 20 /* GreaterThanToken */: - case 21 /* LessThanEqualsToken */: - case 22 /* GreaterThanEqualsToken */: - case 81 /* InstanceOfKeyword */: - case 80 /* InKeyword */: - case 23 /* EqualsEqualsToken */: - case 24 /* ExclamationEqualsToken */: - case 25 /* EqualsEqualsEqualsToken */: - case 26 /* ExclamationEqualsEqualsToken */: - case 38 /* AmpersandToken */: - case 40 /* CaretToken */: - case 39 /* BarToken */: - case 43 /* AmpersandAmpersandToken */: - case 44 /* BarBarToken */: - case 57 /* BarEqualsToken */: - case 56 /* AmpersandEqualsToken */: - case 58 /* CaretEqualsToken */: - case 53 /* LessThanLessThanEqualsToken */: - case 54 /* GreaterThanGreaterThanEqualsToken */: - case 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 48 /* PlusEqualsToken */: - case 49 /* MinusEqualsToken */: - case 50 /* AsteriskEqualsToken */: - case 51 /* SlashEqualsToken */: - case 52 /* PercentEqualsToken */: - case 47 /* EqualsToken */: - case 18 /* CommaToken */: + case 34 /* AsteriskToken */: + case 35 /* SlashToken */: + case 36 /* PercentToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 39 /* LessThanLessThanToken */: + case 40 /* GreaterThanGreaterThanToken */: + case 41 /* GreaterThanGreaterThanGreaterThanToken */: + case 23 /* LessThanToken */: + case 24 /* GreaterThanToken */: + case 25 /* LessThanEqualsToken */: + case 26 /* GreaterThanEqualsToken */: + case 85 /* InstanceOfKeyword */: + case 84 /* InKeyword */: + case 27 /* EqualsEqualsToken */: + case 28 /* ExclamationEqualsToken */: + case 29 /* EqualsEqualsEqualsToken */: + case 30 /* ExclamationEqualsEqualsToken */: + case 42 /* AmpersandToken */: + case 44 /* CaretToken */: + case 43 /* BarToken */: + case 47 /* AmpersandAmpersandToken */: + case 48 /* BarBarToken */: + case 61 /* BarEqualsToken */: + case 60 /* AmpersandEqualsToken */: + case 62 /* CaretEqualsToken */: + case 57 /* LessThanLessThanEqualsToken */: + case 58 /* GreaterThanGreaterThanEqualsToken */: + case 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */: + case 52 /* PlusEqualsToken */: + case 53 /* MinusEqualsToken */: + case 54 /* AsteriskEqualsToken */: + case 55 /* SlashEqualsToken */: + case 56 /* PercentEqualsToken */: + case 51 /* EqualsToken */: + case 22 /* CommaToken */: return true; - default: - return false; + default: return false; } } function isPrefixUnaryExpressionOperatorToken(token) { switch (token) { - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: - case 41 /* ExclamationToken */: - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: + case 32 /* PlusToken */: + case 33 /* MinusToken */: + case 46 /* TildeToken */: + case 45 /* ExclamationToken */: + case 37 /* PlusPlusToken */: + case 38 /* MinusMinusToken */: return true; default: return false; } } function isKeyword(token) { - return token >= ts.SyntaxKind.FirstKeyword && token <= ts.SyntaxKind.LastKeyword; + return token >= 64 /* FirstKeyword */ && token <= 119 /* LastKeyword */; } function classFromKind(token) { if (isKeyword(token)) { @@ -36026,7 +35048,7 @@ var ts; else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { return 2 /* Operator */; } - else if (token >= ts.SyntaxKind.FirstPunctuation && token <= ts.SyntaxKind.LastPunctuation) { + else if (token >= 13 /* FirstPunctuation */ && token <= 62 /* LastPunctuation */) { return 0 /* Punctuation */; } switch (token) { @@ -36041,7 +35063,7 @@ var ts; return 3 /* Comment */; case 5 /* WhitespaceTrivia */: return 4 /* Whitespace */; - case 59 /* Identifier */: + case 63 /* Identifier */: default: return 5 /* Identifier */; } @@ -36056,7 +35078,7 @@ var ts; getNodeConstructor: function (kind) { function Node() { } - var proto = kind === 186 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); + var proto = kind === 193 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); proto.kind = kind; proto.pos = 0; proto.end = 0; @@ -36110,120 +35132,120 @@ var ts; function spanInNode(node) { if (node) { if (ts.isExpression(node)) { - if (node.parent.kind === 156 /* DoStatement */) { + if (node.parent.kind === 163 /* DoStatement */) { return spanInPreviousNode(node); } - if (node.parent.kind === 158 /* ForStatement */) { + if (node.parent.kind === 165 /* ForStatement */) { return textSpan(node); } - if (node.parent.kind === 148 /* BinaryExpression */ && node.parent.operator === 18 /* CommaToken */) { + if (node.parent.kind === 153 /* BinaryExpression */ && node.parent.operator === 22 /* CommaToken */) { return textSpan(node); } - if (node.parent.kind == 145 /* ArrowFunction */ && node.parent.body == node) { + if (node.parent.kind == 150 /* ArrowFunction */ && node.parent.body == node) { return textSpan(node); } } switch (node.kind) { - case 152 /* VariableStatement */: + case 159 /* VariableStatement */: return spanInVariableDeclaration(node.declarations[0]); - case 174 /* VariableDeclaration */: - case 120 /* Property */: + case 181 /* VariableDeclaration */: + case 124 /* Property */: return spanInVariableDeclaration(node); - case 119 /* Parameter */: + case 123 /* Parameter */: return spanInParameterDeclaration(node); - case 175 /* FunctionDeclaration */: - case 121 /* Method */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 122 /* Constructor */: - case 144 /* FunctionExpression */: - case 145 /* ArrowFunction */: + case 182 /* FunctionDeclaration */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: + case 149 /* FunctionExpression */: + case 150 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 176 /* FunctionBlock */: + case 183 /* FunctionBlock */: return spanInFunctionBlock(node); - case 151 /* Block */: - case 170 /* TryBlock */: - case 171 /* CatchBlock */: - case 172 /* FinallyBlock */: - case 182 /* ModuleBlock */: + case 158 /* Block */: + case 177 /* TryBlock */: + case 178 /* CatchBlock */: + case 179 /* FinallyBlock */: + case 189 /* ModuleBlock */: return spanInBlock(node); - case 154 /* ExpressionStatement */: + case 161 /* ExpressionStatement */: return textSpan(node.expression); - case 162 /* ReturnStatement */: + case 169 /* ReturnStatement */: return textSpan(node.getChildAt(0), node.expression); - case 157 /* WhileStatement */: + case 164 /* WhileStatement */: return textSpan(node, ts.findNextToken(node.expression, node)); - case 156 /* DoStatement */: + case 163 /* DoStatement */: return spanInNode(node.statement); - case 173 /* DebuggerStatement */: + case 180 /* DebuggerStatement */: return textSpan(node.getChildAt(0)); - case 155 /* IfStatement */: + case 162 /* IfStatement */: return textSpan(node, ts.findNextToken(node.expression, node)); - case 167 /* LabeledStatement */: + case 174 /* LabeledStatement */: return spanInNode(node.statement); - case 161 /* BreakStatement */: - case 160 /* ContinueStatement */: + case 168 /* BreakStatement */: + case 167 /* ContinueStatement */: return textSpan(node.getChildAt(0), node.label); - case 158 /* ForStatement */: + case 165 /* ForStatement */: return spanInForStatement(node); - case 159 /* ForInStatement */: + case 166 /* ForInStatement */: return textSpan(node, ts.findNextToken(node.expression, node)); - case 164 /* SwitchStatement */: + case 171 /* SwitchStatement */: return textSpan(node, ts.findNextToken(node.expression, node)); - case 165 /* CaseClause */: - case 166 /* DefaultClause */: + case 172 /* CaseClause */: + case 173 /* DefaultClause */: return spanInNode(node.statements[0]); - case 169 /* TryStatement */: + case 176 /* TryStatement */: return spanInBlock(node.tryBlock); - case 168 /* ThrowStatement */: + case 175 /* ThrowStatement */: return textSpan(node, node.expression); - case 184 /* ExportAssignment */: + case 191 /* ExportAssignment */: return textSpan(node, node.exportName); - case 183 /* ImportDeclaration */: + case 190 /* ImportDeclaration */: return textSpan(node, node.entityName || node.externalModuleName); - case 181 /* ModuleDeclaration */: - if (!ts.isInstantiated(node)) { + case 188 /* ModuleDeclaration */: + if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } - case 177 /* ClassDeclaration */: - case 180 /* EnumDeclaration */: - case 185 /* EnumMember */: - case 140 /* CallExpression */: - case 141 /* NewExpression */: + case 184 /* ClassDeclaration */: + case 187 /* EnumDeclaration */: + case 192 /* EnumMember */: + case 144 /* CallExpression */: + case 145 /* NewExpression */: return textSpan(node); - case 163 /* WithStatement */: + case 170 /* WithStatement */: return spanInNode(node.statement); - case 178 /* InterfaceDeclaration */: + case 185 /* InterfaceDeclaration */: return undefined; - case 17 /* SemicolonToken */: + case 21 /* SemicolonToken */: case 1 /* EndOfFileToken */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile)); - case 18 /* CommaToken */: + case 22 /* CommaToken */: return spanInPreviousNode(node); - case 9 /* OpenBraceToken */: + case 13 /* OpenBraceToken */: return spanInOpenBraceToken(node); - case 10 /* CloseBraceToken */: + case 14 /* CloseBraceToken */: return spanInCloseBraceToken(node); - case 11 /* OpenParenToken */: + case 15 /* OpenParenToken */: return spanInOpenParenToken(node); - case 12 /* CloseParenToken */: + case 16 /* CloseParenToken */: return spanInCloseParenToken(node); - case 46 /* ColonToken */: + case 50 /* ColonToken */: return spanInColonToken(node); - case 20 /* GreaterThanToken */: - case 19 /* LessThanToken */: + case 24 /* GreaterThanToken */: + case 23 /* LessThanToken */: return spanInGreaterThanOrLessThanToken(node); - case 94 /* WhileKeyword */: + case 98 /* WhileKeyword */: return spanInWhileKeyword(node); - case 70 /* ElseKeyword */: - case 62 /* CatchKeyword */: - case 75 /* FinallyKeyword */: + case 74 /* ElseKeyword */: + case 66 /* CatchKeyword */: + case 79 /* FinallyKeyword */: return spanInNextNode(node); default: - if (node.parent.kind === 137 /* PropertyAssignment */ && node.parent.name === node) { + if (node.parent.kind === 141 /* PropertyAssignment */ && node.parent.name === node) { return spanInNode(node.parent.initializer); } - if (node.parent.kind === 142 /* TypeAssertion */ && node.parent.type === node) { + if (node.parent.kind === 147 /* TypeAssertion */ && node.parent.type === node) { return spanInNode(node.parent.operand); } if (ts.isAnyFunction(node.parent) && node.parent.type === node) { @@ -36233,11 +35255,11 @@ var ts; } } function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.kind === 159 /* ForInStatement */) { + if (variableDeclaration.parent.kind === 166 /* ForInStatement */) { return spanInNode(variableDeclaration.parent); } - var isParentVariableStatement = variableDeclaration.parent.kind === 152 /* VariableStatement */; - var isDeclarationOfForStatement = variableDeclaration.parent.kind === 158 /* ForStatement */ && ts.contains(variableDeclaration.parent.declarations, variableDeclaration); + var isParentVariableStatement = variableDeclaration.parent.kind === 159 /* VariableStatement */; + var isDeclarationOfForStatement = variableDeclaration.parent.kind === 165 /* 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) { @@ -36277,7 +35299,7 @@ var ts; } } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { - return !!(functionDeclaration.flags & 1 /* Export */) || (functionDeclaration.parent.kind === 177 /* ClassDeclaration */ && functionDeclaration.kind !== 122 /* Constructor */); + return !!(functionDeclaration.flags & 1 /* Export */) || (functionDeclaration.parent.kind === 184 /* ClassDeclaration */ && functionDeclaration.kind !== 126 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { if (!functionDeclaration.body) { @@ -36297,15 +35319,15 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 181 /* ModuleDeclaration */: - if (!ts.isInstantiated(block.parent)) { + case 188 /* ModuleDeclaration */: + if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } - case 157 /* WhileStatement */: - case 155 /* IfStatement */: - case 159 /* ForInStatement */: + case 164 /* WhileStatement */: + case 162 /* IfStatement */: + case 166 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); - case 158 /* ForStatement */: + case 165 /* ForStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } return spanInNode(block.statements[0]); @@ -36326,34 +35348,34 @@ var ts; } function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 180 /* EnumDeclaration */: + case 187 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 177 /* ClassDeclaration */: + case 184 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 164 /* SwitchStatement */: + case 171 /* SwitchStatement */: return spanInNodeIfStartsOnSameLine(node.parent, node.parent.clauses[0]); } return spanInNode(node.parent); } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 182 /* ModuleBlock */: - if (!ts.isInstantiated(node.parent.parent)) { + case 189 /* ModuleBlock */: + if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } - case 176 /* FunctionBlock */: - case 180 /* EnumDeclaration */: - case 177 /* ClassDeclaration */: + case 183 /* FunctionBlock */: + case 187 /* EnumDeclaration */: + case 184 /* ClassDeclaration */: return textSpan(node); - case 151 /* Block */: - case 170 /* TryBlock */: - case 171 /* CatchBlock */: - case 172 /* FinallyBlock */: + case 158 /* Block */: + case 177 /* TryBlock */: + case 178 /* CatchBlock */: + case 179 /* FinallyBlock */: return spanInNode(node.parent.statements[node.parent.statements.length - 1]); ; - case 164 /* SwitchStatement */: + case 171 /* SwitchStatement */: var switchStatement = node.parent; var lastClause = switchStatement.clauses[switchStatement.clauses.length - 1]; if (lastClause) { @@ -36365,23 +35387,23 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 156 /* DoStatement */) { + if (node.parent.kind === 163 /* DoStatement */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInCloseParenToken(node) { switch (node.parent.kind) { - case 144 /* FunctionExpression */: - case 175 /* FunctionDeclaration */: - case 145 /* ArrowFunction */: - case 121 /* Method */: - case 123 /* GetAccessor */: - case 124 /* SetAccessor */: - case 122 /* Constructor */: - case 157 /* WhileStatement */: - case 156 /* DoStatement */: - case 158 /* ForStatement */: + case 149 /* FunctionExpression */: + case 182 /* FunctionDeclaration */: + case 150 /* ArrowFunction */: + case 125 /* Method */: + case 127 /* GetAccessor */: + case 128 /* SetAccessor */: + case 126 /* Constructor */: + case 164 /* WhileStatement */: + case 163 /* DoStatement */: + case 165 /* ForStatement */: return spanInPreviousNode(node); default: return spanInNode(node.parent); @@ -36389,19 +35411,19 @@ var ts; return spanInNode(node.parent); } function spanInColonToken(node) { - if (ts.isAnyFunction(node.parent) || node.parent.kind === 137 /* PropertyAssignment */) { + if (ts.isAnyFunction(node.parent) || node.parent.kind === 141 /* PropertyAssignment */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 142 /* TypeAssertion */) { + if (node.parent.kind === 147 /* TypeAssertion */) { return spanInNode(node.parent.operand); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 156 /* DoStatement */) { + if (node.parent.kind === 163 /* DoStatement */) { return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); } return spanInNode(node.parent); @@ -36452,20 +35474,20 @@ var TypeScript; var lineChar = { line: -1, character: -1 }; var lineMap = text.lineMap(); var start = new Date().getTime(); - while (token.kind() !== 10 /* EndOfFileToken */) { - if (token.kind() === 49 /* ImportKeyword */) { + 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() === 107 /* EqualsToken */) { + if (token.kind() === 109 /* EqualsToken */) { token = scanner.scan(false); - if (token.kind() === 65 /* ModuleKeyword */ || token.kind() === 66 /* RequireKeyword */) { + if (token.kind() === 67 /* ModuleKeyword */ || token.kind() === 68 /* RequireKeyword */) { token = scanner.scan(false); - if (token.kind() === 72 /* OpenParenToken */) { + if (token.kind() === 74 /* OpenParenToken */) { token = scanner.scan(false); lineMap.fillLineAndCharacterFromPosition(TypeScript.start(importToken, text), lineChar); - if (token.kind() === 14 /* StringLiteral */) { + if (token.kind() === 12 /* StringLiteral */) { var ref = { line: lineChar.line, character: lineChar.character, @@ -36495,7 +35517,7 @@ var TypeScript; var lineMap = text.lineMap(); for (var i = 0, n = leadingTrivia.count(); i < n; i++) { var trivia = leadingTrivia.syntaxTriviaAt(i); - if (trivia.kind() === 7 /* SingleLineCommentTrivia */) { + if (trivia.kind() === 5 /* SingleLineCommentTrivia */) { var triviaText = trivia.fullText(); var referencedCode = getFileReferenceFromReferencePath(fileName, text, position, triviaText, diagnostics); if (referencedCode) { @@ -36518,7 +35540,7 @@ var TypeScript; function preProcessFile(fileName, sourceText, readImportFiles) { if (readImportFiles === void 0) { readImportFiles = true; } var text = TypeScript.SimpleText.fromScriptSnapshot(sourceText); - var scanner = TypeScript.Scanner.createScanner(ts.ScriptTarget.Latest, text, reportDiagnostic); + var scanner = TypeScript.Scanner.createScanner(2 /* Latest */, text, reportDiagnostic); var firstToken = scanner.scan(false); var importedFiles = []; if (readImportFiles) { @@ -36536,72 +35558,44 @@ var TypeScript; var debugObjectHost = this; var ts; (function (ts) { - (function (LanguageVersion) { - LanguageVersion[LanguageVersion["EcmaScript3"] = 0] = "EcmaScript3"; - LanguageVersion[LanguageVersion["EcmaScript5"] = 1] = "EcmaScript5"; - LanguageVersion[LanguageVersion["EcmaScript6"] = 2] = "EcmaScript6"; - })(ts.LanguageVersion || (ts.LanguageVersion = {})); - var LanguageVersion = ts.LanguageVersion; - (function (ModuleGenTarget) { - ModuleGenTarget[ModuleGenTarget["Unspecified"] = 0] = "Unspecified"; - ModuleGenTarget[ModuleGenTarget["Synchronous"] = 1] = "Synchronous"; - ModuleGenTarget[ModuleGenTarget["Asynchronous"] = 2] = "Asynchronous"; - })(ts.ModuleGenTarget || (ts.ModuleGenTarget = {})); - var ModuleGenTarget = ts.ModuleGenTarget; function languageVersionToScriptTarget(languageVersion) { if (typeof languageVersion === "undefined") return undefined; switch (languageVersion) { - case 0 /* EcmaScript3 */: - return 0 /* ES3 */; - case 1 /* EcmaScript5 */: - return 1 /* ES5 */; - case 2 /* EcmaScript6 */: - return 2 /* ES6 */; - default: - throw Error("unsupported LanguageVersion value: " + languageVersion); + case 0 /* EcmaScript3 */: return 0 /* ES3 */; + case 1 /* EcmaScript5 */: return 1 /* ES5 */; + case 2 /* EcmaScript6 */: return 2 /* ES6 */; + default: throw Error("unsupported LanguageVersion value: " + languageVersion); } } function moduleGenTargetToModuleKind(moduleGenTarget) { if (typeof moduleGenTarget === "undefined") return undefined; switch (moduleGenTarget) { - case 2 /* Asynchronous */: - return 2 /* AMD */; - case 1 /* Synchronous */: - return 1 /* CommonJS */; - case 0 /* Unspecified */: - return 0 /* None */; - default: - throw Error("unsupported ModuleGenTarget value: " + moduleGenTarget); + case 2 /* Asynchronous */: return 2 /* AMD */; + case 1 /* Synchronous */: return 1 /* CommonJS */; + case 0 /* Unspecified */: return 0 /* None */; + default: throw Error("unsupported ModuleGenTarget value: " + moduleGenTarget); } } function scriptTargetTolanguageVersion(scriptTarget) { if (typeof scriptTarget === "undefined") return undefined; switch (scriptTarget) { - case 0 /* ES3 */: - return 0 /* EcmaScript3 */; - case 1 /* ES5 */: - return 1 /* EcmaScript5 */; - case 2 /* ES6 */: - return 2 /* EcmaScript6 */; - default: - throw Error("unsupported ScriptTarget value: " + scriptTarget); + case 0 /* ES3 */: return 0 /* EcmaScript3 */; + case 1 /* ES5 */: return 1 /* EcmaScript5 */; + case 2 /* ES6 */: return 2 /* EcmaScript6 */; + default: throw Error("unsupported ScriptTarget value: " + scriptTarget); } } function moduleKindToModuleGenTarget(moduleKind) { if (typeof moduleKind === "undefined") return undefined; switch (moduleKind) { - case 2 /* AMD */: - return 2 /* Asynchronous */; - case 1 /* CommonJS */: - return 1 /* Synchronous */; - case 0 /* None */: - return 0 /* Unspecified */; - default: - throw Error("unsupported ModuleKind value: " + moduleKind); + case 2 /* AMD */: return 2 /* Asynchronous */; + case 1 /* CommonJS */: return 1 /* Synchronous */; + case 0 /* None */: return 0 /* Unspecified */; + default: throw Error("unsupported ModuleKind value: " + moduleKind); } } function compilationSettingsToCompilerOptions(settings) { diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index f1d6050f8f4..e06e2cf62aa 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -5,25 +5,51 @@ module ts { - export function isInstantiated(node: Node): boolean { + export const enum ModuleInstanceState { + NonInstantiated = 0, + Instantiated = 1, + ConstEnumOnly = 2 + } + + export function getModuleInstanceState(node: Node): ModuleInstanceState { // A module is uninstantiated if it contains only // 1. interface declarations if (node.kind === SyntaxKind.InterfaceDeclaration) { - return false; + return ModuleInstanceState.NonInstantiated; } - // 2. non - exported import declarations + // 2. const enum declarations don't make module instantiated + else if (node.kind === SyntaxKind.EnumDeclaration && isConstEnumDeclaration(node)) { + return ModuleInstanceState.ConstEnumOnly; + } + // 3. non - exported import declarations else if (node.kind === SyntaxKind.ImportDeclaration && !(node.flags & NodeFlags.Export)) { - return false; + return ModuleInstanceState.NonInstantiated; } - // 3. other uninstantiated module declarations. - else if (node.kind === SyntaxKind.ModuleBlock && !forEachChild(node, isInstantiated)) { - return false; + // 4. other uninstantiated module declarations. + else if (node.kind === SyntaxKind.ModuleBlock) { + var state = ModuleInstanceState.NonInstantiated; + forEachChild(node, n => { + switch (getModuleInstanceState(n)) { + case ModuleInstanceState.NonInstantiated: + // child is non-instantiated - continue searching + return false; + case ModuleInstanceState.ConstEnumOnly: + // child is const enum only - record state and continue searching + state = ModuleInstanceState.ConstEnumOnly; + return false; + case ModuleInstanceState.Instantiated: + // child is instantiated - record state and stop + state = ModuleInstanceState.Instantiated; + return true; + } + }); + return state; } - else if (node.kind === SyntaxKind.ModuleDeclaration && !isInstantiated((node).body)) { - return false; + else if (node.kind === SyntaxKind.ModuleDeclaration) { + return getModuleInstanceState((node).body); } else { - return true; + return ModuleInstanceState.Instantiated; } } @@ -58,12 +84,13 @@ module ts { if (symbolKind & SymbolFlags.Value && !symbol.valueDeclaration) symbol.valueDeclaration = node; } + // TODO(jfreeman): Implement getDeclarationName for property name function getDeclarationName(node: Declaration): string { if (node.name) { if (node.kind === SyntaxKind.ModuleDeclaration && node.name.kind === SyntaxKind.StringLiteral) { - return '"' + node.name.text + '"'; + return '"' + (node.name).text + '"'; } - return node.name.text; + return (node.name).text; } switch (node.kind) { case SyntaxKind.Constructor: return "__constructor"; @@ -74,7 +101,7 @@ module ts { } function getDisplayName(node: Declaration): string { - return node.name ? identifierToString(node.name) : getDeclarationName(node); + return node.name ? declarationNameToString(node.name) : getDeclarationName(node); } function declareSymbol(symbols: SymbolTable, parent: Symbol, node: Declaration, includes: SymbolFlags, excludes: SymbolFlags): Symbol { @@ -248,11 +275,22 @@ module ts { if (node.name.kind === SyntaxKind.StringLiteral) { bindDeclaration(node, SymbolFlags.ValueModule, SymbolFlags.ValueModuleExcludes, /*isBlockScopeContainer*/ true); } - else if (isInstantiated(node)) { - bindDeclaration(node, SymbolFlags.ValueModule, SymbolFlags.ValueModuleExcludes, /*isBlockScopeContainer*/ true); - } else { - bindDeclaration(node, SymbolFlags.NamespaceModule, SymbolFlags.NamespaceModuleExcludes, /*isBlockScopeContainer*/ true); + var state = getModuleInstanceState(node); + if (state === ModuleInstanceState.NonInstantiated) { + bindDeclaration(node, SymbolFlags.NamespaceModule, SymbolFlags.NamespaceModuleExcludes, /*isBlockScopeContainer*/ true); + } + else { + bindDeclaration(node, SymbolFlags.ValueModule, SymbolFlags.ValueModuleExcludes, /*isBlockScopeContainer*/ true); + if (state === ModuleInstanceState.ConstEnumOnly) { + // mark value module as module that contains only enums + node.symbol.constEnumOnlyModule = true; + } + else if (node.symbol.constEnumOnlyModule) { + // const only value module was merged with instantiated module - reset flag + node.symbol.constEnumOnlyModule = false; + } + } } } @@ -369,7 +407,12 @@ module ts { bindDeclaration(node, SymbolFlags.TypeAlias, SymbolFlags.TypeAliasExcludes, /*isBlockScopeContainer*/ false); break; case SyntaxKind.EnumDeclaration: - bindDeclaration(node, SymbolFlags.Enum, SymbolFlags.EnumExcludes, /*isBlockScopeContainer*/ false); + if (isConstEnumDeclaration(node)) { + bindDeclaration(node, SymbolFlags.ConstEnum, SymbolFlags.ConstEnumExcludes, /*isBlockScopeContainer*/ false); + } + else { + bindDeclaration(node, SymbolFlags.RegularEnum, SymbolFlags.RegularEnumExcludes, /*isBlockScopeContainer*/ false); + } break; case SyntaxKind.ModuleDeclaration: bindModuleDeclaration(node); diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ec565a94edb..d70481184fc 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -186,7 +186,8 @@ module ts { if (flags & SymbolFlags.Function) result |= SymbolFlags.FunctionExcludes; if (flags & SymbolFlags.Class) result |= SymbolFlags.ClassExcludes; if (flags & SymbolFlags.Interface) result |= SymbolFlags.InterfaceExcludes; - if (flags & SymbolFlags.Enum) result |= SymbolFlags.EnumExcludes; + if (flags & SymbolFlags.RegularEnum) result |= SymbolFlags.RegularEnumExcludes; + if (flags & SymbolFlags.ConstEnum) result |= SymbolFlags.ConstEnumExcludes; if (flags & SymbolFlags.ValueModule) result |= SymbolFlags.ValueModuleExcludes; if (flags & SymbolFlags.Method) result |= SymbolFlags.MethodExcludes; if (flags & SymbolFlags.GetAccessor) result |= SymbolFlags.GetAccessorExcludes; @@ -207,6 +208,7 @@ module ts { result.declarations = symbol.declarations.slice(0); result.parent = symbol.parent; if (symbol.valueDeclaration) result.valueDeclaration = symbol.valueDeclaration; + if (symbol.constEnumOnlyModule) result.constEnumOnlyModule = true; if (symbol.members) result.members = cloneSymbolTable(symbol.members); if (symbol.exports) result.exports = cloneSymbolTable(symbol.exports); recordMergedSymbol(result, symbol); @@ -215,6 +217,10 @@ module ts { function extendSymbol(target: Symbol, source: Symbol) { if (!(target.flags & getExcludedSymbolFlags(source.flags))) { + if (source.flags & SymbolFlags.ValueModule && target.flags & SymbolFlags.ValueModule && target.constEnumOnlyModule && !source.constEnumOnlyModule) { + // reset flag when merging instantiated module into value module that has only const enums + target.constEnumOnlyModule = false; + } target.flags |= source.flags; if (!target.valueDeclaration && source.valueDeclaration) target.valueDeclaration = source.valueDeclaration; forEach(source.declarations, node => { @@ -309,6 +315,22 @@ module ts { // return undefined if we can't find a symbol. } + /** Returns true if node1 is defined before node 2**/ + function isDefinedBefore(node1: Node, node2: Node): boolean { + var file1 = getSourceFileOfNode(node1); + var file2 = getSourceFileOfNode(node2); + if (file1 === file2) { + return node1.pos <= node2.pos; + } + + if (!compilerOptions.out) { + return true; + } + + var sourceFiles = program.getSourceFiles(); + return sourceFiles.indexOf(file1) <= sourceFiles.indexOf(file2); + } + // Resolve a given name for a given meaning at a given location. An error is reported if the name was not found and // the nameNotFoundMessage argument is not undefined. Returns the resolved symbol, or undefined if no symbol with // the given name can be found. @@ -409,7 +431,7 @@ module ts { if (!result) { if (nameNotFoundMessage) { - error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : identifierToString(nameArg)); + error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : declarationNameToString(nameArg)); } return undefined; } @@ -421,25 +443,15 @@ module ts { // to a local variable in the constructor where the code will be emitted. var propertyName = (propertyWithInvalidInitializer).name; error(errorLocation, Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, - identifierToString(propertyName), typeof nameArg === "string" ? nameArg : identifierToString(nameArg)); + declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : declarationNameToString(nameArg)); return undefined; } if (result.flags & SymbolFlags.BlockScopedVariable) { // Block-scoped variables cannot be used before their definition var declaration = forEach(result.declarations, d => d.flags & NodeFlags.BlockScoped ? d : undefined); Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - var declarationSourceFile = getSourceFileOfNode(declaration); - var referenceSourceFile = getSourceFileOfNode(errorLocation); - if (declarationSourceFile === referenceSourceFile) { - if (declaration.pos > errorLocation.pos) { - error(errorLocation, Diagnostics.Block_scoped_variable_0_used_before_its_declaration, identifierToString(declaration.name)); - } - } - else if (compilerOptions.out) { - var sourceFiles = program.getSourceFiles(); - if (sourceFiles.indexOf(referenceSourceFile) < sourceFiles.indexOf(declarationSourceFile)) { - error(errorLocation, Diagnostics.Block_scoped_variable_0_used_before_its_declaration, identifierToString(declaration.name)); - } + if (!isDefinedBefore(declaration, errorLocation)) { + error(errorLocation, Diagnostics.Block_scoped_variable_0_used_before_its_declaration, declarationNameToString(declaration.name)); } } } @@ -471,7 +483,7 @@ module ts { // This function is only for imports with entity names function getSymbolOfPartOfRightHandSideOfImport(entityName: EntityName, importDeclaration?: ImportDeclaration): Symbol { if (!importDeclaration) { - importDeclaration = getAncestor(entityName, SyntaxKind.ImportDeclaration); + importDeclaration = getAncestor(entityName, SyntaxKind.ImportDeclaration); Debug.assert(importDeclaration !== undefined); } // There are three things we might try to look for. In the following examples, @@ -513,7 +525,7 @@ module ts { var symbol = getSymbol(namespace.exports, (name).right.text, meaning); if (!symbol) { error(location, Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), - identifierToString((name).right)); + declarationNameToString((name).right)); return; } } @@ -951,11 +963,11 @@ module ts { getNodeLinks(declaration).isVisible = true; if (aliasesToMakeVisible) { if (!contains(aliasesToMakeVisible, declaration)) { - aliasesToMakeVisible.push(declaration); + aliasesToMakeVisible.push(declaration); } } else { - aliasesToMakeVisible = [declaration]; + aliasesToMakeVisible = [declaration]; } return true; } @@ -975,7 +987,7 @@ module ts { var hasNamespaceDeclarationsVisibile = hasVisibleDeclarations(symbolOfNameSpace); return hasNamespaceDeclarationsVisibile ? { accessibility: SymbolAccessibility.Accessible, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : - { accessibility: SymbolAccessibility.NotAccessible, errorSymbolName: identifierToString(firstIdentifier) }; + { accessibility: SymbolAccessibility.NotAccessible, errorSymbolName: declarationNameToString(firstIdentifier) }; } function releaseStringWriter(writer: StringSymbolWriter) { @@ -1048,7 +1060,7 @@ module ts { if (symbol.declarations && symbol.declarations.length > 0) { var declaration = symbol.declarations[0]; if (declaration.name) { - writer.writeSymbol(identifierToString(declaration.name), symbol); + writer.writeSymbol(declarationNameToString(declaration.name), symbol); return; } } @@ -1594,7 +1606,7 @@ module ts { return true; default: - Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + SyntaxKind[node.kind]); + Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); } } @@ -1616,7 +1628,7 @@ module ts { return classType.typeParameters ? createTypeReference(classType, map(classType.typeParameters, _ => anyType)) : classType; } - function getTypeOfVariableDeclaration(declaration: VariableDeclaration): Type { + function getTypeOfVariableOrPropertyDeclaration(declaration: VariableDeclaration | PropertyDeclaration): Type { // A variable declared in a for..in statement is always of type any if (declaration.parent.kind === SyntaxKind.ForInStatement) { return anyType; @@ -1626,7 +1638,7 @@ module ts { return getTypeFromTypeNode(declaration.type); } if (declaration.kind === SyntaxKind.Parameter) { - var func = declaration.parent; + var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present if (func.kind === SyntaxKind.SetAccessor) { var getter = getDeclarationOfKind(declaration.parent.symbol, SyntaxKind.GetAccessor); @@ -1635,7 +1647,7 @@ module ts { } } // Use contextual parameter type if one is available - var type = getContextuallyTypedParameterType(declaration); + var type = getContextuallyTypedParameterType(declaration); if (type) { return type; } @@ -1672,7 +1684,7 @@ module ts { } // Handle variable, parameter or property links.type = resolvingType; - var type = getTypeOfVariableDeclaration(declaration); + var type = getTypeOfVariableOrPropertyDeclaration(declaration); if (links.type === resolvingType) { links.type = type; } @@ -2465,7 +2477,7 @@ module ts { returnType = getAnnotatedAccessorType(setter); } - if (!returnType && !(declaration).body) { + if (!returnType && !(declaration).body) { returnType = anyType; } } @@ -2495,7 +2507,7 @@ module ts { // Don't include signature if node is the implementation of an overloaded function. A node is considered // an implementation node if it has a body and the previous node is of the same kind and immediately // precedes the implementation node (i.e. has the same parent and ends where the implementation starts). - if (i > 0 && (node).body) { + if (i > 0 && (node).body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { break; @@ -2517,7 +2529,7 @@ module ts { var type = getUnionType(map(signature.unionSignatures, getReturnTypeOfSignature)); } else { - var type = getReturnTypeFromBody(signature.declaration); + var type = getReturnTypeFromBody(signature.declaration); } if (signature.resolvedReturnType === resolvingType) { signature.resolvedReturnType = type; @@ -2528,7 +2540,7 @@ module ts { if (compilerOptions.noImplicitAny) { var declaration = signature.declaration; if (declaration.name) { - error(declaration.name, 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, identifierToString(declaration.name)); + error(declaration.name, 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, declarationNameToString(declaration.name)); } else { error(declaration, 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); @@ -4002,8 +4014,10 @@ module ts { } function createInferenceContext(typeParameters: TypeParameter[], inferUnionTypes: boolean): InferenceContext { - var inferences: Type[][] = []; - for (var i = 0; i < typeParameters.length; i++) inferences.push([]); + var inferences: TypeInferences[] = []; + for (var i = 0; i < typeParameters.length; i++) { + inferences.push({ primary: undefined, secondary: undefined }); + } return { typeParameters: typeParameters, inferUnionTypes: inferUnionTypes, @@ -4017,6 +4031,7 @@ module ts { var sourceStack: Type[]; var targetStack: Type[]; var depth = 0; + var inferiority = 0; inferFromTypes(source, target); function isInProcess(source: Type, target: Type) { @@ -4045,9 +4060,11 @@ module 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 (!contains(inferences, source)) inferences.push(source); + var candidates = inferiority ? + inferences.secondary || (inferences.secondary = []) : + inferences.primary || (inferences.primary = []); + if (!contains(candidates, source)) candidates.push(source); break; } } @@ -4062,7 +4079,6 @@ module ts { } else if (target.flags & TypeFlags.Union) { var targetTypes = (target).types; - var startCount = context.inferenceCount; var typeParameterCount = 0; var typeParameter: TypeParameter; // First infer to each type in union that isn't a type parameter @@ -4076,9 +4092,11 @@ module ts { inferFromTypes(source, t); } } - // If no inferences were produced above and union contains a single naked type parameter, infer to that type parameter - if (context.inferenceCount === startCount && typeParameterCount === 1) { + // If union contains a single naked type parameter, make a secondary inference to that type parameter + if (typeParameterCount === 1) { + inferiority++; inferFromTypes(source, typeParameter); + inferiority--; } } else if (source.flags & TypeFlags.Union) { @@ -4148,10 +4166,15 @@ module ts { } } + function getInferenceCandidates(context: InferenceContext, index: number): Type[]{ + var inferences = context.inferences[index]; + return inferences.primary || inferences.secondary || emptyArray; + } + function getInferredType(context: InferenceContext, index: number): Type { var inferredType = context.inferredTypes[index]; if (!inferredType) { - var inferences = context.inferences[index]; + var inferences = getInferenceCandidates(context, index); if (inferences.length) { // Infer widened union or supertype, or the undefined type for no common supertype var unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences) : getCommonSupertype(inferences); @@ -4161,7 +4184,6 @@ module ts { // Infer the empty object type when no inferences were made inferredType = emptyObjectType; } - if (inferredType !== inferenceFailureType) { var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; @@ -4461,8 +4483,8 @@ module ts { if (symbol.flags & SymbolFlags.Import) { // Mark the import as referenced so that we emit it in the final .js file. - // exception: identifiers that appear in type queries - getSymbolLinks(symbol).referenced = !isInTypeQuery(node); + // exception: identifiers that appear in type queries, const enums, modules that contain only const enums + getSymbolLinks(symbol).referenced = !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveImport(symbol)); } checkCollisionWithCapturedSuperVariable(node, node); @@ -4653,7 +4675,7 @@ module ts { // Return contextual type of parameter or undefined if no contextual type is available function getContextuallyTypedParameterType(parameter: ParameterDeclaration): Type { - var func = parameter.parent; + var func = parameter.parent; if (func.kind === SyntaxKind.FunctionExpression || func.kind === SyntaxKind.ArrowFunction) { if (isContextSensitiveExpression(func)) { var contextualSignature = getContextualSignature(func); @@ -4799,7 +4821,8 @@ module ts { var declaration = node.parent; var objectLiteral = declaration.parent; var type = getContextualType(objectLiteral); - var name = declaration.name.text; + // TODO(jfreeman): Handle this case for computed names and symbols + var name = (declaration.name).text; if (type && name) { return getTypeOfPropertyOfContextualType(type, name) || isNumericName(name) && getIndexTypeOfContextualType(type, IndexKind.Number) || @@ -5070,7 +5093,7 @@ module ts { var prop = getPropertyOfType(apparentType, node.right.text); if (!prop) { if (node.right.text) { - error(node.right, Diagnostics.Property_0_does_not_exist_on_type_1, identifierToString(node.right), typeToString(type)); + error(node.right, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(node.right), typeToString(type)); } return unknownType; } @@ -5120,6 +5143,10 @@ module ts { if (objectType === unknownType) return unknownType; + if (isConstEnumObjectType(objectType) && node.index.kind !== SyntaxKind.StringLiteral) { + error(node.index, Diagnostics.Index_expression_arguments_in_const_enums_must_be_of_type_string); + } + // TypeScript 1.0 spec (April 2014): 4.10 Property Access // - If IndexExpr is a string literal or a numeric literal and ObjExpr's apparent type has a property with the name // given by that literal(converted to its string representation in the case of a numeric literal), the property access is of the type of that property. @@ -5134,6 +5161,7 @@ module ts { var name = (node.index).text; var prop = getPropertyOfType(objectType, name); if (prop) { + getNodeLinks(node).resolvedSymbol = prop; return getTypeOfSymbol(prop); } } @@ -5401,7 +5429,7 @@ module ts { else { 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 = chainDiagnosticMessages(/*details*/ undefined, // details will be provided by call to reportNoCommonSupertypeError Diagnostics.The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly, @@ -5712,7 +5740,7 @@ module ts { } } - function getReturnTypeFromBody(func: FunctionDeclaration, contextualMapper?: TypeMapper): Type { + function getReturnTypeFromBody(func: FunctionLikeDeclaration, contextualMapper?: TypeMapper): Type { var contextualSignature = getContextualSignature(func); if (func.body.kind !== SyntaxKind.FunctionBlock) { var type = checkAndMarkExpression(func.body, contextualMapper); @@ -5768,7 +5796,7 @@ module ts { // An explicitly typed function whose return type isn't the Void or the Any type // must have at least one return statement somewhere in its body. // An exception to this rule is if the function implementation consists of a single 'throw' statement. - function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func: FunctionDeclaration, returnType: Type): void { + function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func: FunctionLikeDeclaration, returnType: Type): void { if (!fullTypeCheck) { return; } @@ -5979,6 +6007,14 @@ module ts { return (type.flags & TypeFlags.Structured) !== 0; } + function isConstEnumObjectType(type: Type) : boolean { + return type.flags & (TypeFlags.ObjectType | TypeFlags.Anonymous) && type.symbol && isConstEnumSymbol(type.symbol); + } + + function isConstEnumSymbol(symbol: Symbol): boolean { + return (symbol.flags & SymbolFlags.ConstEnum) !== 0; + } + function checkInstanceOfExpression(node: BinaryExpression, leftType: Type, rightType: Type): Type { // TypeScript 1.0 spec (April 2014): 4.15.4 // The instanceof operator requires the left operand to be of type Any, an object type, or a type parameter type, @@ -6216,6 +6252,21 @@ module ts { } } } + + if (isConstEnumObjectType(type)) { + // enum object type for const enums are only permitted in: + // - 'left' in property access + // - 'object' in indexed access + // - target in rhs of import statement + var ok = + (node.parent.kind === SyntaxKind.PropertyAccess && (node.parent).left === node) || + (node.parent.kind === SyntaxKind.IndexedAccess && (node.parent).object === node) || + ((node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName) && isInRightSideOfImportOrExportAssignment(node)); + + if (!ok) { + error(node, 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); + } + } return type; } @@ -6304,7 +6355,7 @@ module ts { } } else { - if (parameterDeclaration.initializer && !(parameterDeclaration.parent).body) { + if (parameterDeclaration.initializer && !(parameterDeclaration.parent).body) { error(parameterDeclaration, Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); } } @@ -6313,16 +6364,16 @@ module ts { function checkReferencesInInitializer(n: Node): void { if (n.kind === SyntaxKind.Identifier) { var referencedSymbol = getNodeLinks(n).resolvedSymbol; - // check FunctionDeclaration.locals (stores parameters\function local variable) + // check FunctionLikeDeclaration.locals (stores parameters\function local variable) // if it contains entry with a specified name and if this entry matches the resolved symbol if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, SymbolFlags.Value) === referencedSymbol) { if (referencedSymbol.valueDeclaration.kind === SyntaxKind.Parameter) { if (referencedSymbol.valueDeclaration === parameterDeclaration) { - error(n, Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, identifierToString(parameterDeclaration.name)); + error(n, Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, declarationNameToString(parameterDeclaration.name)); return; } var enclosingOrReferencedParameter = - forEach((parameterDeclaration.parent).parameters, p => p === parameterDeclaration || p === referencedSymbol.valueDeclaration ? p : undefined); + forEach((parameterDeclaration.parent).parameters, p => p === parameterDeclaration || p === referencedSymbol.valueDeclaration ? p : undefined); if (enclosingOrReferencedParameter === referencedSymbol.valueDeclaration) { // legal case - parameter initializer references some parameter strictly on left of current parameter declaration @@ -6331,7 +6382,7 @@ module ts { // fall through to error reporting } - error(n, Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, identifierToString(parameterDeclaration.name), identifierToString(n)); + error(n, Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, declarationNameToString(parameterDeclaration.name), declarationNameToString(n)); } } else { @@ -6596,7 +6647,7 @@ module ts { // TypeScript 1.0 spec (April 2014): 3.7.2.2 // Specialized signatures are not permitted in conjunction with a function body - if ((signatureDeclarationNode).body) { + if ((signatureDeclarationNode).body) { error(signatureDeclarationNode, Diagnostics.A_signature_with_an_implementation_cannot_use_a_string_literal_type); return; } @@ -6647,7 +6698,7 @@ module ts { return; } - function checkFlagAgreementBetweenOverloads(overloads: Declaration[], implementation: FunctionDeclaration, flagsToCheck: NodeFlags, someOverloadFlags: NodeFlags, allOverloadFlags: NodeFlags): void { + function checkFlagAgreementBetweenOverloads(overloads: Declaration[], implementation: FunctionLikeDeclaration, flagsToCheck: NodeFlags, someOverloadFlags: NodeFlags, allOverloadFlags: NodeFlags): void { // Error if some overloads have a flag that is not shared by all overloads. To find the // deviations, we XOR someOverloadFlags with allOverloadFlags var someButNotAllOverloadFlags = someOverloadFlags ^ allOverloadFlags; @@ -6683,14 +6734,14 @@ module ts { var someNodeFlags: NodeFlags = 0; var allNodeFlags = flagsToCheck; var hasOverloads = false; - var bodyDeclaration: FunctionDeclaration; - var lastSeenNonAmbientDeclaration: FunctionDeclaration; - var previousDeclaration: FunctionDeclaration; + var bodyDeclaration: FunctionLikeDeclaration; + var lastSeenNonAmbientDeclaration: FunctionLikeDeclaration; + var previousDeclaration: FunctionLikeDeclaration; var declarations = symbol.declarations; var isConstructor = (symbol.flags & SymbolFlags.Constructor) !== 0; - function reportImplementationExpectedError(node: FunctionDeclaration): void { + function reportImplementationExpectedError(node: FunctionLikeDeclaration): void { if (node.name && node.name.kind === SyntaxKind.Missing) { return; } @@ -6706,8 +6757,9 @@ module ts { }); if (subsequentNode) { if (subsequentNode.kind === node.kind) { - var errorNode: Node = (subsequentNode).name || subsequentNode; - if (node.name && (subsequentNode).name && node.name.text === (subsequentNode).name.text) { + var errorNode: Node = (subsequentNode).name || subsequentNode; + // TODO(jfreeman): These are methods, so handle computed name case + if (node.name && (subsequentNode).name && (node.name).text === ((subsequentNode).name).text) { // the only situation when this is possible (same kind\same name but different symbol) - mixed static and instance class members Debug.assert(node.kind === SyntaxKind.Method); Debug.assert((node.flags & NodeFlags.Static) !== (subsequentNode.flags & NodeFlags.Static)); @@ -6715,8 +6767,8 @@ module ts { error(errorNode, diagnostic); return; } - else if ((subsequentNode).body) { - error(errorNode, Diagnostics.Function_implementation_name_must_be_0, identifierToString(node.name)); + else if ((subsequentNode).body) { + error(errorNode, Diagnostics.Function_implementation_name_must_be_0, declarationNameToString(node.name)); return; } } @@ -6736,7 +6788,7 @@ module ts { var duplicateFunctionDeclaration = false; var multipleConstructorImplementation = false; for (var i = 0; i < declarations.length; i++) { - var node = declarations[i]; + var node = declarations[i]; var inAmbientContext = isInAmbientContext(node); var inAmbientContextOrInterface = node.parent.kind === SyntaxKind.InterfaceDeclaration || node.parent.kind === SyntaxKind.TypeLiteral || inAmbientContext; if (inAmbientContextOrInterface) { @@ -6880,7 +6932,7 @@ module ts { // declaration spaces for exported and non-exported declarations intersect forEach(symbol.declarations, d => { if (getDeclarationSpaces(d) & commonDeclarationSpace) { - error(d.name, Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, identifierToString(d.name)); + error(d.name, Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, declarationNameToString(d.name)); } }); } @@ -6890,7 +6942,7 @@ module ts { case SyntaxKind.InterfaceDeclaration: return SymbolFlags.ExportType; case SyntaxKind.ModuleDeclaration: - return (d).name.kind === SyntaxKind.StringLiteral || isInstantiated(d) + return (d).name.kind === SyntaxKind.StringLiteral || getModuleInstanceState(d) !== ModuleInstanceState.NonInstantiated ? SymbolFlags.ExportNamespace | SymbolFlags.ExportValue : SymbolFlags.ExportNamespace; case SyntaxKind.ClassDeclaration: @@ -6907,7 +6959,7 @@ module ts { } } - function checkFunctionDeclaration(node: FunctionDeclaration): void { + function checkFunctionDeclaration(node: FunctionLikeDeclaration): void { checkSignatureDeclaration(node); var symbol = getSymbolOfNode(node); @@ -6948,7 +7000,7 @@ module ts { function checkCollisionWithArgumentsInGeneratedCode(node: SignatureDeclaration) { // no rest parameters \ declaration context \ overload - no codegen impact - if (!hasRestParameters(node) || isInAmbientContext(node) || !(node).body) { + if (!hasRestParameters(node) || isInAmbientContext(node) || !(node).body) { return; } @@ -6969,7 +7021,7 @@ module ts { // - function has implementation (not a signature) // - function has rest parameters // - context is not ambient (otherwise no codegen impact) - if ((node.parent).body && hasRestParameters(node.parent) && !isInAmbientContext(node)) { + if ((node.parent).body && hasRestParameters(node.parent) && !isInAmbientContext(node)) { error(node, Diagnostics.Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter); } return; @@ -7027,7 +7079,7 @@ module ts { case SyntaxKind.Method: case SyntaxKind.ArrowFunction: case SyntaxKind.Constructor: - if (hasRestParameters(current)) { + if (hasRestParameters(current)) { error(node, Diagnostics.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter); return; } @@ -7037,8 +7089,9 @@ module ts { } } - function needCollisionCheckForIdentifier(node: Node, identifier: Identifier, name: string): boolean { - if (!(identifier && identifier.text === name)) { + // TODO(jfreeman): Decide what to do for computed properties + function needCollisionCheckForIdentifier(node: Node, identifier: DeclarationName, name: string): boolean { + if (!(identifier && (identifier).text === name)) { return false; } @@ -7055,15 +7108,16 @@ module ts { return false; } - if (node.kind === SyntaxKind.Parameter && !(node.parent).body) { + if (node.kind === SyntaxKind.Parameter && !(node.parent).body) { // just an overload - no codegen impact return false; } return true; } - - function checkCollisionWithCapturedThisVariable(node: Node, name: Identifier): void { + + // TODO(jfreeman): Decide what to do for computed properties + function checkCollisionWithCapturedThisVariable(node: Node, name: DeclarationName): void { if (!needCollisionCheckForIdentifier(node, name, "_this")) { return; } @@ -7088,7 +7142,7 @@ module ts { } } - function checkCollisionWithCapturedSuperVariable(node: Node, name: Identifier) { + function checkCollisionWithCapturedSuperVariable(node: Node, name: DeclarationName) { if (!needCollisionCheckForIdentifier(node, name, "_super")) { return; } @@ -7111,13 +7165,14 @@ module ts { } } - function checkCollisionWithRequireExportsInGeneratedCode(node: Node, name: Identifier) { + // TODO(jfreeman): Decide what to do for computed properties + function checkCollisionWithRequireExportsInGeneratedCode(node: Node, name: DeclarationName) { if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { return; } // Uninstantiated modules shouldnt do this check - if (node.kind === SyntaxKind.ModuleDeclaration && !isInstantiated(node)) { + if (node.kind === SyntaxKind.ModuleDeclaration && getModuleInstanceState(node) !== ModuleInstanceState.Instantiated) { return; } @@ -7125,7 +7180,8 @@ module ts { var parent = node.kind === SyntaxKind.VariableDeclaration ? node.parent.parent : node.parent; if (parent.kind === SyntaxKind.SourceFile && isExternalModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords - error(name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, name.text, name.text); + error(name, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, + declarationNameToString(name), declarationNameToString(name)); } } @@ -7161,7 +7217,7 @@ module ts { } } - function checkVariableDeclaration(node: VariableDeclaration) { + function checkVariableDeclaration(node: VariableDeclaration | PropertyDeclaration) { checkSourceElement(node.type); checkExportsOnMergedDeclarations(node); @@ -7175,7 +7231,7 @@ module ts { type = typeOfValueDeclaration; } else { - type = getTypeOfVariableDeclaration(node); + type = getTypeOfVariableOrPropertyDeclaration(node); } @@ -7184,7 +7240,8 @@ module ts { // Use default messages checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, /*headMessage*/ undefined); } - checkCollisionWithConstDeclarations(node); + //TODO(jfreeman): Check that it is not a computed property + checkCollisionWithConstDeclarations(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -7195,7 +7252,7 @@ module ts { // Multiple declarations for the same variable name in the same declaration space are permitted, // provided that each declaration associates the same type with the variable. if (typeOfValueDeclaration !== unknownType && type !== unknownType && !isTypeIdenticalTo(typeOfValueDeclaration, type)) { - error(node.name, Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, identifierToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); + error(node.name, Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, declarationNameToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); } } } @@ -7413,16 +7470,17 @@ module ts { } } - function checkTypeNameIsReserved(name: Identifier, message: DiagnosticMessage): void { + // TODO(jfreeman): Decide what to do for computed properties + function checkTypeNameIsReserved(name: DeclarationName, message: DiagnosticMessage): void { // TS 1.0 spec (April 2014): 3.6.1 // The predefined type keywords are reserved and cannot be used as names of user defined types. - switch (name.text) { + switch ((name).text) { case "any": case "number": case "boolean": case "string": case "void": - error(name, message, name.text); + error(name, message, (name).text); } } @@ -7436,7 +7494,7 @@ module ts { if (fullTypeCheck) { for (var j = 0; j < i; j++) { if (typeParameterDeclarations[j].symbol === node.symbol) { - error(node.name, Diagnostics.Duplicate_identifier_0, identifierToString(node.name)); + error(node.name, Diagnostics.Duplicate_identifier_0, declarationNameToString(node.name)); } } } @@ -7683,23 +7741,6 @@ module ts { checkSourceElement(node.type); } - function getConstantValueForExpression(node: Expression): number { - var isNegative = false; - if (node.kind === SyntaxKind.PrefixOperator) { - var unaryExpression = node; - if (unaryExpression.operator === SyntaxKind.MinusToken || unaryExpression.operator === SyntaxKind.PlusToken) { - node = unaryExpression.operand; - isNegative = unaryExpression.operator === SyntaxKind.MinusToken; - } - } - if (node.kind === SyntaxKind.NumericLiteral) { - var literalText = (node).text; - return isNegative ? -literalText : +literalText; - } - - return undefined; - } - function computeEnumMemberValues(node: EnumDeclaration) { var nodeLinks = getNodeLinks(node); @@ -7708,23 +7749,39 @@ module ts { var enumType = getDeclaredTypeOfSymbol(enumSymbol); var autoValue = 0; var ambient = isInAmbientContext(node); + var enumIsConst = isConstEnumDeclaration(node); forEach(node.members, member => { - if(isNumericName(member.name.text)) { + // TODO(jfreeman): Check that it is not a computed name + if(isNumericName((member.name).text)) { error(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name); } var initializer = member.initializer; if (initializer) { - autoValue = getConstantValueForExpression(initializer); - if (autoValue === undefined && !ambient) { - // Only here do we need to check that the initializer is assignable to the enum type. - // If it is a constant value (not undefined), it is syntactically constrained to be a number. - // Also, we do not need to check this for ambients because there is already - // a syntax error if it is not a constant. + autoValue = getConstantValueForEnumMemberInitializer(initializer, enumIsConst); + if (autoValue === undefined) { + if (enumIsConst) { + error(initializer, Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression); + } + else if (!ambient) { + // Only here do we need to check that the initializer is assignable to the enum type. + // If it is a constant value (not undefined), it is syntactically constrained to be a number. + // Also, we do not need to check this for ambients because there is already + // a syntax error if it is not a constant. checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, /*headMessage*/ undefined); + } } + else if (enumIsConst) { + if (isNaN(autoValue)) { + error(initializer, Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN); + } + else if (!isFinite(autoValue)) { + error(initializer, Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value); + } + } + } - else if (ambient) { + else if (ambient && !enumIsConst) { autoValue = undefined; } @@ -7735,6 +7792,110 @@ module ts { nodeLinks.flags |= NodeCheckFlags.EnumValuesComputed; } + + function getConstantValueForEnumMemberInitializer(initializer: Expression, enumIsConst: boolean): number { + return evalConstant(initializer); + + function evalConstant(e: Node): number { + switch (e.kind) { + case SyntaxKind.PrefixOperator: + var value = evalConstant((e).operand); + if (value === undefined) { + return undefined; + } + switch ((e).operator) { + case SyntaxKind.PlusToken: return value; + case SyntaxKind.MinusToken: return -value; + case SyntaxKind.TildeToken: return enumIsConst ? ~value : undefined; + } + return undefined; + case SyntaxKind.BinaryExpression: + if (!enumIsConst) { + return undefined; + } + + var left = evalConstant((e).left); + if (left === undefined) { + return undefined; + } + var right = evalConstant((e).right); + if (right === undefined) { + return undefined; + } + switch ((e).operator) { + case SyntaxKind.BarToken: return left | right; + case SyntaxKind.AmpersandToken: return left & right; + case SyntaxKind.GreaterThanGreaterThanToken: return left >> right; + case SyntaxKind.GreaterThanGreaterThanGreaterThanToken: return left >>> right; + case SyntaxKind.LessThanLessThanToken: return left << right; + case SyntaxKind.CaretToken: return left ^ right; + case SyntaxKind.AsteriskToken: return left * right; + case SyntaxKind.SlashToken: return left / right; + case SyntaxKind.PlusToken: return left + right; + case SyntaxKind.MinusToken: return left - right; + case SyntaxKind.PercentToken: return left % right; + } + return undefined; + case SyntaxKind.NumericLiteral: + return +(e).text; + case SyntaxKind.ParenExpression: + return enumIsConst ? evalConstant((e).expression) : undefined; + case SyntaxKind.Identifier: + case SyntaxKind.IndexedAccess: + case SyntaxKind.PropertyAccess: + if (!enumIsConst) { + return undefined; + } + + var member = initializer.parent; + var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); + var enumType: Type; + var propertyName: string; + + if (e.kind === SyntaxKind.Identifier) { + // unqualified names can refer to member that reside in different declaration of the enum so just doing name resolution won't work. + // instead pick current enum type and later try to fetch member from the type + enumType = currentType; + propertyName = (e).text; + } + else { + if (e.kind === SyntaxKind.IndexedAccess) { + if ((e).index.kind !== SyntaxKind.StringLiteral) { + return undefined; + } + var enumType = getTypeOfNode((e).object); + propertyName = ((e).index).text; + } + else { + var enumType = getTypeOfNode((e).left); + propertyName = (e).right.text; + } + if (enumType !== currentType) { + return undefined; + } + } + + if (propertyName === undefined) { + return undefined; + } + var property = getPropertyOfObjectType(enumType, propertyName); + if (!property || !(property.flags & SymbolFlags.EnumMember)) { + return undefined; + } + var propertyDecl = property.valueDeclaration; + // self references are illegal + if (member === propertyDecl) { + return undefined; + } + + // illegal case: forward reference + if (!isDefinedBefore(propertyDecl, member)) { + return undefined; + } + return getNodeLinks(propertyDecl).enumMemberValue; + } + } + } } function checkEnumDeclaration(node: EnumDeclaration) { @@ -7758,6 +7919,16 @@ module ts { var enumSymbol = getSymbolOfNode(node); var firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind); if (node === firstDeclaration) { + if (enumSymbol.declarations.length > 1) { + var enumIsConst = isConstEnumDeclaration(node); + // check that const is placed\omitted on all enum declarations + forEach(enumSymbol.declarations, decl => { + if (isConstEnumDeclaration(decl) !== enumIsConst) { + error(decl.name, Diagnostics.Enum_declarations_must_all_be_const_or_non_const); + } + }); + } + var seenEnumMissingInitialInitializer = false; forEach(enumSymbol.declarations, declaration => { // return true if we hit a violation of the rule, false otherwise @@ -7787,7 +7958,7 @@ module ts { var declarations = symbol.declarations; for (var i = 0; i < declarations.length; i++) { var declaration = declarations[i]; - if ((declaration.kind === SyntaxKind.ClassDeclaration || (declaration.kind === SyntaxKind.FunctionDeclaration && (declaration).body)) && !isInAmbientContext(declaration)) { + if ((declaration.kind === SyntaxKind.ClassDeclaration || (declaration.kind === SyntaxKind.FunctionDeclaration && (declaration).body)) && !isInAmbientContext(declaration)) { return declaration; } } @@ -7848,7 +8019,7 @@ module ts { checkExpression(node.entityName); } else { - error(moduleName, Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, identifierToString(moduleName)); + error(moduleName, Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, declarationNameToString(moduleName)); } } if (target.flags & SymbolFlags.Type) { @@ -7934,7 +8105,7 @@ module ts { case SyntaxKind.ParenType: return checkSourceElement((node).type); case SyntaxKind.FunctionDeclaration: - return checkFunctionDeclaration(node); + return checkFunctionDeclaration(node); case SyntaxKind.Block: return checkBlock(node); case SyntaxKind.FunctionBlock: @@ -8001,7 +8172,7 @@ module ts { switch (node.kind) { case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: - forEach((node).parameters, checkFunctionExpressionBodies); + forEach((node).parameters, checkFunctionExpressionBodies); checkFunctionExpressionBody(node); break; case SyntaxKind.Method: @@ -8009,7 +8180,7 @@ module ts { case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: case SyntaxKind.FunctionDeclaration: - forEach((node).parameters, checkFunctionExpressionBodies); + forEach((node).parameters, checkFunctionExpressionBodies); break; case SyntaxKind.WithStatement: checkFunctionExpressionBodies((node).expression); @@ -8294,7 +8465,7 @@ module ts { case SyntaxKind.Method: case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: - return node === (parent).type; + return node === (parent).type; case SyntaxKind.CallSignature: case SyntaxKind.ConstructSignature: case SyntaxKind.IndexSignature: @@ -8550,7 +8721,7 @@ module ts { return true; } - function getLocalNameOfContainer(container: Declaration): string { + function getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string { var links = getNodeLinks(container); if (!links.localModuleName) { var prefix = ""; @@ -8567,7 +8738,7 @@ module ts { var node = location; while (node) { if ((node.kind === SyntaxKind.ModuleDeclaration || node.kind === SyntaxKind.EnumDeclaration) && getSymbolOfNode(node) === symbol) { - return getLocalNameOfContainer(node); + return getLocalNameOfContainer(node); } node = node.parent; } @@ -8594,17 +8765,16 @@ module ts { function getExportAssignmentName(node: SourceFile): string { var symbol = getExportAssignmentSymbol(getSymbolOfNode(node)); - return symbol && symbolIsValue(symbol) ? symbolToString(symbol): undefined; + return symbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol) ? symbolToString(symbol): undefined; } - function isTopLevelValueImportedViaEntityName(node: ImportDeclaration): boolean { + function isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean { if (node.parent.kind !== SyntaxKind.SourceFile || !node.entityName) { // parent is not source file or it is not reference to internal module return false; } var symbol = getSymbolOfNode(node); - var target = resolveImport(symbol); - return target !== unknownSymbol && ((target.flags & SymbolFlags.Value) !== 0); + return isImportResolvedToValue(getSymbolOfNode(node)); } function hasSemanticErrors() { @@ -8616,6 +8786,16 @@ module ts { return forEach(getDiagnostics(sourceFile), d => d.isEarly); } + function isImportResolvedToValue(symbol: Symbol): boolean { + var target = resolveImport(symbol); + // const enums and modules that contain only const enums are not considered values from the emit perespective + return target !== unknownSymbol && target.flags & SymbolFlags.Value && !isConstEnumOrConstEnumOnlyModule(target); + } + + function isConstEnumOrConstEnumOnlyModule(s: Symbol): boolean { + return isConstEnumSymbol(s) || s.constEnumOnlyModule; + } + function isReferencedImportDeclaration(node: ImportDeclaration): boolean { var symbol = getSymbolOfNode(node); if (getSymbolLinks(symbol).referenced) { @@ -8624,15 +8804,12 @@ module ts { // logic below will answer 'true' for exported import declaration in a nested module that itself is not exported. // As a consequence this might cause emitting extra. if (node.flags & NodeFlags.Export) { - var target = resolveImport(symbol); - if (target !== unknownSymbol && target.flags & SymbolFlags.Value) { - return true; - } + return isImportResolvedToValue(symbol); } return false; } - function isImplementationOfOverload(node: FunctionDeclaration) { + function isImplementationOfOverload(node: FunctionLikeDeclaration) { if (node.body) { var symbol = getSymbolOfNode(node); var signaturesOfSymbol = getSignaturesOfSymbol(symbol); @@ -8662,7 +8839,7 @@ module ts { return getNodeLinks(node).enumMemberValue; } - function getConstantValue(node: PropertyAccess): number { + function getConstantValue(node: PropertyAccess | IndexedAccess): number { var symbol = getNodeLinks(node).resolvedSymbol; if (symbol && (symbol.flags & SymbolFlags.EnumMember)) { var declaration = symbol.valueDeclaration; @@ -8697,7 +8874,7 @@ module ts { isReferencedImportDeclaration: isReferencedImportDeclaration, getNodeCheckFlags: getNodeCheckFlags, getEnumMemberValue: getEnumMemberValue, - isTopLevelValueImportedViaEntityName: isTopLevelValueImportedViaEntityName, + isTopLevelValueImportWithEntityName: isTopLevelValueImportWithEntityName, hasSemanticErrors: hasSemanticErrors, hasEarlyErrors: hasEarlyErrors, isDeclarationVisible: isDeclarationVisible, diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 63c555f1951..fed7c991b2e 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -24,7 +24,7 @@ module ts { type: "boolean", }, { - name: "emitBOM", + name: "emitBOM", type: "boolean" }, { @@ -102,7 +102,7 @@ module ts { { name: "target", shortName: "t", - type: { "es3": ScriptTarget.ES3, "es5": ScriptTarget.ES5 , "es6": ScriptTarget.ES6 }, + type: { "es3": ScriptTarget.ES3, "es5": ScriptTarget.ES5, "es6": ScriptTarget.ES6 }, description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental, paramType: Diagnostics.VERSION, error: Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6 @@ -118,6 +118,11 @@ module ts { shortName: "w", type: "boolean", description: Diagnostics.Watch_input_files, + }, + { + name: "preserveConstEnums", + type: "boolean", + description: Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code } ]; diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 6fd07fe4a6a..76767dcb637 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -9,7 +9,7 @@ module ts { // x | y is False if both x and y are False. // x | y is Maybe if either x or y is Maybe, but neither x or y is True. // x | y is True if either x or y is True. - export enum Ternary { + export const enum Ternary { False = 0, Maybe = 1, True = -1 @@ -19,7 +19,7 @@ module ts { [index: string]: T; } - export enum Comparison { + export const enum Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 @@ -637,7 +637,7 @@ module ts { getSignatureConstructor: () => Signature } - export enum AssertionLevel { + export const enum AssertionLevel { None = 0, Normal = 1, Aggressive = 2, diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 2f00a727ba1..8292565f000 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -146,7 +146,7 @@ module ts { Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: DiagnosticCategory.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: DiagnosticCategory.Error, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: DiagnosticCategory.Error, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1: { code: 2323, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." }, + Type_0_is_not_assignable_to_type_1: { code: 2322, category: DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." }, Property_0_is_missing_in_type_1: { code: 2324, category: DiagnosticCategory.Error, key: "Property '{0}' is missing in type '{1}'." }, Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: DiagnosticCategory.Error, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, Types_of_property_0_are_incompatible: { code: 2326, category: DiagnosticCategory.Error, key: "Types of property '{0}' are incompatible." }, @@ -354,6 +354,12 @@ module ts { 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 }, + 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: DiagnosticCategory.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: DiagnosticCategory.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: DiagnosticCategory.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: DiagnosticCategory.Error, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, The_current_host_does_not_support_the_0_option: { code: 5001, category: DiagnosticCategory.Error, key: "The current host does not support the '{0}' option." }, Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: DiagnosticCategory.Error, key: "Cannot find the common subdirectory path for the input files." }, Cannot_read_file_0_Colon_1: { code: 5012, category: DiagnosticCategory.Error, key: "Cannot read file '{0}': {1}" }, @@ -368,6 +374,7 @@ module ts { Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: DiagnosticCategory.Message, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, Watch_input_files: { code: 6005, category: DiagnosticCategory.Message, key: "Watch input files." }, Redirect_output_structure_to_the_directory: { code: 6006, category: DiagnosticCategory.Message, key: "Redirect output structure to the directory." }, + Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: DiagnosticCategory.Message, key: "Do not erase const enum declarations in generated code." }, Do_not_emit_comments_to_output: { code: 6009, category: DiagnosticCategory.Message, key: "Do not emit comments to output." }, Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: DiagnosticCategory.Message, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs' or 'amd'" }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 0269850936d..1859bc9841a 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -580,10 +580,6 @@ "category": "Error", "code": 2322 }, - "Type '{0}' is not assignable to type '{1}'.": { - "category": "Error", - "code": 2323 - }, "Property '{0}' is missing in type '{1}'.": { "category": "Error", "code": 2324 @@ -1417,13 +1413,35 @@ "category": "Error", "code": 4081 }, - - + "Enum declarations must all be const or non-const.": { + "category": "Error", + "code": 4082 + }, + "In 'const' enum declarations member initializer must be constant expression.": { + "category": "Error", + "code": 4083, + "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.": { + "category": "Error", + "code": 4084 + }, + "Index expression arguments in 'const' enums must be of type 'string'.": { + "category": "Error", + "code": 4085 + }, + "'const' enum member initializer was evaluated to a non-finite value.": { + "category": "Error", + "code": 4086 + }, + "'const' enum member initializer was evaluated to disallowed value 'NaN'.": { + "category": "Error", + "code": 4087 + }, "The current host does not support the '{0}' option.": { "category": "Error", "code": 5001 }, - "Cannot find the common subdirectory path for the input files.": { "category": "Error", "code": 5009 @@ -1476,6 +1494,10 @@ "category": "Message", "code": 6006 }, + "Do not erase const enum declarations in generated code.": { + "category": "Message", + "code": 6007 + }, "Do not emit comments to output.": { "category": "Message", "code": 6009 diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 782d22a0bf4..f61d4403eec 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -86,8 +86,9 @@ module ts { 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.name).text === (accessor.name).text && (member.flags & NodeFlags.Static) === (accessor.flags & NodeFlags.Static)) { if (!firstAccessor) { firstAccessor = member; @@ -577,7 +578,8 @@ module ts { node.kind === SyntaxKind.EnumDeclaration) { // Declaration and has associated name use it if ((node).name) { - scopeName = (node).name.text; + // TODO(jfreeman): Ask shkamat about what this name should be for source maps + scopeName = ((node).name).text; } recordScopeNameStart(scopeName); } @@ -907,15 +909,15 @@ module ts { // This function specifically handles numeric/string literals for enum and accessor 'identifiers'. // In a sense, it does not actually emit identifiers as much as it declares a name for a specific property. - function emitQuotedIdentifier(node: Identifier) { + function emitExpressionForPropertyName(node: DeclarationName) { if (node.kind === SyntaxKind.StringLiteral) { - emitLiteral(node); + emitLiteral(node); } else { write("\""); if (node.kind === SyntaxKind.NumericLiteral) { - write(node.text); + write((node).text); } else { write(getSourceTextOfLocalNode(node)); @@ -1031,19 +1033,29 @@ module ts { emitTrailingComments(node); } - function emitPropertyAccess(node: PropertyAccess) { + function tryEmitConstantValue(node: PropertyAccess | IndexedAccess): boolean { var constantValue = resolver.getConstantValue(node); if (constantValue !== undefined) { - write(constantValue.toString() + " /* " + identifierToString(node.right) + " */"); + var propertyName = node.kind === SyntaxKind.PropertyAccess ? declarationNameToString((node).right) : getTextOfNode((node).index); + write(constantValue.toString() + " /* " + propertyName + " */"); + return true; } - else { - emit(node.left); - write("."); - emit(node.right); + return false; + } + + function emitPropertyAccess(node: PropertyAccess) { + if (tryEmitConstantValue(node)) { + return; } + emit(node.left); + write("."); + emit(node.right); } function emitIndexedAccess(node: IndexedAccess) { + if (tryEmitConstantValue(node)) { + return; + } emit(node.object); write("["); emit(node.index); @@ -1341,6 +1353,10 @@ module ts { emitToken(SyntaxKind.CloseBraceToken, node.clauses.end); } + function isOnSameLine(node1: Node, node2: Node) { + return getLineOfLocalPosition(skipTrivia(currentSourceFile.text, node1.pos)) === getLineOfLocalPosition(skipTrivia(currentSourceFile.text, node2.pos)); + } + function emitCaseOrDefaultClause(node: CaseOrDefaultClause) { if (node.kind === SyntaxKind.CaseClause) { write("case "); @@ -1350,9 +1366,16 @@ module ts { else { write("default:"); } - increaseIndent(); - emitLines(node.statements); - decreaseIndent(); + + if (node.statements.length === 1 && isOnSameLine(node, node.statements[0])) { + write(" "); + emit(node.statements[0]); + } + else { + increaseIndent(); + emitLines(node.statements); + decreaseIndent(); + } } function emitThrowStatement(node: ThrowStatement) { @@ -1443,7 +1466,7 @@ module ts { emitTrailingComments(node); } - function emitDefaultValueAssignments(node: FunctionDeclaration) { + function emitDefaultValueAssignments(node: FunctionLikeDeclaration) { forEach(node.parameters, param => { if (param.initializer) { writeLine(); @@ -1463,7 +1486,7 @@ module ts { }); } - function emitRestParameter(node: FunctionDeclaration) { + function emitRestParameter(node: FunctionLikeDeclaration) { if (hasRestParameters(node)) { var restIndex = node.parameters.length - 1; var restParam = node.parameters[restIndex]; @@ -1509,7 +1532,7 @@ module ts { emitTrailingComments(node); } - function emitFunctionDeclaration(node: FunctionDeclaration) { + function emitFunctionDeclaration(node: FunctionLikeDeclaration) { if (!node.body) { return emitPinnedOrTripleSlashComments(node); } @@ -1537,7 +1560,7 @@ module ts { } } - function emitSignatureParameters(node: FunctionDeclaration) { + function emitSignatureParameters(node: FunctionLikeDeclaration) { increaseIndent(); write("("); if (node) { @@ -1547,7 +1570,7 @@ module ts { decreaseIndent(); } - function emitSignatureAndBody(node: FunctionDeclaration) { + function emitSignatureAndBody(node: FunctionLikeDeclaration) { emitSignatureParameters(node); write(" {"); scopeEmitStart(node); @@ -1644,7 +1667,8 @@ module ts { }); } - function emitMemberAccess(memberName: Identifier) { + // TODO(jfreeman): Account for computed property name + function emitMemberAccess(memberName: DeclarationName) { if (memberName.kind === SyntaxKind.StringLiteral || memberName.kind === SyntaxKind.NumericLiteral) { write("["); emitNode(memberName); @@ -1717,7 +1741,7 @@ module ts { write(".prototype"); } write(", "); - emitQuotedIdentifier((member).name); + emitExpressionForPropertyName((member).name); emitEnd((member).name); write(", {"); increaseIndent(); @@ -1876,6 +1900,11 @@ module ts { } function emitEnumDeclaration(node: EnumDeclaration) { + // const enums are completely erased during compilation. + var isConstEnum = isConstEnumDeclaration(node); + if (isConstEnum && !compilerOptions.preserveConstEnums) { + return; + } emitLeadingComments(node); if (!(node.flags & NodeFlags.Export)) { emitStart(node); @@ -1893,7 +1922,7 @@ module ts { write(") {"); increaseIndent(); scopeEmitStart(node); - emitEnumMemberDeclarations(); + emitEnumMemberDeclarations(isConstEnum); decreaseIndent(); writeLine(); emitToken(SyntaxKind.CloseBraceToken, node.members.end); @@ -1916,7 +1945,7 @@ module ts { } emitTrailingComments(node); - function emitEnumMemberDeclarations() { + function emitEnumMemberDeclarations(isConstEnum: boolean) { forEach(node.members, member => { writeLine(); emitLeadingComments(member); @@ -1925,16 +1954,16 @@ module ts { write("["); write(resolver.getLocalNameOfContainer(node)); write("["); - emitQuotedIdentifier(member.name); + emitExpressionForPropertyName(member.name); write("] = "); - if (member.initializer) { + if (member.initializer && !isConstEnum) { emit(member.initializer); } else { write(resolver.getEnumMemberValue(member).toString()); } write("] = "); - emitQuotedIdentifier(member.name); + emitExpressionForPropertyName(member.name); emitEnd(member); write(";"); emitTrailingComments(member); @@ -1950,7 +1979,7 @@ module ts { } function emitModuleDeclaration(node: ModuleDeclaration) { - if (!isInstantiated(node)) { + if (getModuleInstanceState(node) !== ModuleInstanceState.Instantiated) { return emitPinnedOrTripleSlashComments(node); } emitLeadingComments(node); @@ -2002,7 +2031,7 @@ module ts { // preserve old compiler's behavior: emit 'var' for import declaration (even if we do not consider them referenced) when // - current file is not external module // - import declaration is top level and target is value imported by entity name - emitImportDeclaration = !isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportedViaEntityName(node); + emitImportDeclaration = !isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportWithEntityName(node); } if (emitImportDeclaration) { @@ -2046,7 +2075,10 @@ module ts { function getExternalImportDeclarations(node: SourceFile): ImportDeclaration[] { var result: ImportDeclaration[] = []; forEach(node.statements, stat => { - if (stat.kind === SyntaxKind.ImportDeclaration && (stat).externalModuleName && resolver.isReferencedImportDeclaration(stat)) { + if (stat.kind === SyntaxKind.ImportDeclaration + && (stat).externalModuleName + && resolver.isReferencedImportDeclaration(stat)) { + result.push(stat); } }); @@ -2235,7 +2267,7 @@ module ts { case SyntaxKind.FunctionDeclaration: case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: - return emitFunctionDeclaration(node); + return emitFunctionDeclaration(node); case SyntaxKind.PrefixOperator: case SyntaxKind.PostfixOperator: return emitUnaryExpression(node); @@ -2478,7 +2510,7 @@ module ts { var getSymbolVisibilityDiagnosticMessage: (symbolAccesibilityResult: SymbolAccessiblityResult) => { errorNode: Node; diagnosticMessage: DiagnosticMessage; - typeName?: Identifier + typeName?: DeclarationName } function createTextWriterWithSymbolWriter(): EmitTextWriterWithSymbolWriter { @@ -2722,6 +2754,9 @@ module ts { if (resolver.isDeclarationVisible(node)) { emitJsDocComments(node); emitDeclarationFlags(node); + if (isConstEnumDeclaration(node)) { + write("const ") + } write("enum "); emitSourceTextOfNode(node.name); write(" {"); @@ -2801,7 +2836,7 @@ module ts { break; default: - Debug.fail("This is unknown parent for type parameter: " + SyntaxKind[node.parent.kind]); + Debug.fail("This is unknown parent for type parameter: " + node.parent.kind); } return { @@ -2937,11 +2972,12 @@ module ts { function emitPropertyDeclaration(node: PropertyDeclaration) { emitJsDocComments(node); emitDeclarationFlags(node); - emitVariableDeclaration(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 @@ -2969,6 +3005,7 @@ module ts { } // 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 ? @@ -3052,6 +3089,7 @@ module ts { 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 }; } @@ -3079,7 +3117,7 @@ module ts { } } - function emitFunctionDeclaration(node: FunctionDeclaration) { + 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)) && @@ -3197,7 +3235,7 @@ module ts { break; default: - Debug.fail("This is unknown kind for signature: " + SyntaxKind[node.kind]); + Debug.fail("This is unknown kind for signature: " + node.kind); } return { @@ -3282,7 +3320,7 @@ module ts { break; default: - Debug.fail("This is unknown parent for parameter: " + SyntaxKind[node.parent.kind]); + Debug.fail("This is unknown parent for parameter: " + node.parent.kind); } return { @@ -3298,7 +3336,7 @@ module ts { case SyntaxKind.Constructor: case SyntaxKind.FunctionDeclaration: case SyntaxKind.Method: - return emitFunctionDeclaration(node); + return emitFunctionDeclaration(node); case SyntaxKind.ConstructSignature: return emitConstructSignatureDeclaration(node); case SyntaxKind.CallSignature: diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 242a60f5bde..69c4db9f440 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -62,9 +62,10 @@ module ts { return identifier.length >= 3 && identifier.charCodeAt(0) === CharacterCodes._ && identifier.charCodeAt(1) === CharacterCodes._ && identifier.charCodeAt(2) === CharacterCodes._ ? identifier.substr(1) : identifier; } + // TODO(jfreeman): Implement declarationNameToString for computed properties // Return display name of an identifier - export function identifierToString(identifier: Identifier) { - return identifier.kind === SyntaxKind.Missing ? "(Missing)" : getTextOfNode(identifier); + export function declarationNameToString(name: DeclarationName) { + return name.kind === SyntaxKind.Missing ? "(Missing)" : getTextOfNode(name); } export function createDiagnosticForNode(node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): Diagnostic { @@ -115,6 +116,10 @@ module ts { return (file.flags & NodeFlags.DeclarationFile) !== 0; } + export function isConstEnumDeclaration(node: EnumDeclaration): boolean { + return (node.flags & NodeFlags.Const) !== 0; + } + export function isPrologueDirective(node: Node): boolean { return node.kind === SyntaxKind.ExpressionStatement && (node).expression.kind === SyntaxKind.StringLiteral; } @@ -209,11 +214,11 @@ module ts { case SyntaxKind.FunctionExpression: case SyntaxKind.FunctionDeclaration: case SyntaxKind.ArrowFunction: - return child((node).name) || - children((node).typeParameters) || - children((node).parameters) || - child((node).type) || - child((node).body); + return child((node).name) || + children((node).typeParameters) || + children((node).parameters) || + child((node).type) || + child((node).body); case SyntaxKind.TypeReference: return child((node).typeName) || children((node).typeArguments); @@ -694,7 +699,7 @@ module ts { Count // Number of parsing contexts } - enum Tristate { + const enum Tristate { False, True, Unknown @@ -724,13 +729,13 @@ module ts { } }; - enum LookAheadMode { + const enum LookAheadMode { NotLookingAhead, NoErrorYet, Error } - enum ModifierContext { + const enum ModifierContext { SourceElements, // Top level elements in a source file ModuleElements, // Elements in module declaration ClassMembers, // Members in class declaration @@ -739,7 +744,7 @@ module ts { // Tracks whether we nested (directly or indirectly) in a certain control block. // Used for validating break and continue statements. - enum ControlBlockContext { + const enum ControlBlockContext { NotNested, Nested, CrossingFunctionBoundary @@ -935,7 +940,7 @@ module ts { } function reportInvalidUseInStrictMode(node: Identifier): void { - // identifierToString cannot be used here since it uses a backreference to 'parent' that is not yet set + // 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); } @@ -1645,7 +1650,7 @@ module ts { // 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 FunctionDeclaration or FunctionExpression(13.1) + // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) if (isInStrictMode && isEvalOrArgumentsIdentifier(parameter.name)) { reportInvalidUseInStrictMode(parameter.name); return; @@ -2726,9 +2731,13 @@ module ts { 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 @@ -2748,29 +2757,29 @@ module ts { currentKind = SetAccesor; } else { - Debug.fail("Unexpected syntax kind:" + SyntaxKind[p.kind]); + Debug.fail("Unexpected syntax kind:" + p.kind); } - if (!hasProperty(seen, p.name.text)) { - seen[p.name.text] = currentKind; + if (!hasProperty(seen, name.text)) { + seen[name.text] = currentKind; } else { - var existingKind = seen[p.name.text]; + var existingKind = seen[name.text]; if (currentKind === Property && existingKind === Property) { if (isInStrictMode) { - grammarErrorOnNode(p.name, Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); + 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[p.name.text] = currentKind | existingKind; + seen[name.text] = currentKind | existingKind; } else { - grammarErrorOnNode(p.name, Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); } } else { - grammarErrorOnNode(p.name, Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + grammarErrorOnNode(name, Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); } } }); @@ -2785,7 +2794,7 @@ module ts { 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 FunctionDeclaration or FunctionExpression or as a formal parameter name(13.1) + // Identifier of a FunctionLikeDeclaration or FunctionExpression or as a formal parameter name(13.1) reportInvalidUseInStrictMode(name); } return makeFunctionExpression(SyntaxKind.FunctionExpression, pos, name, sig, body); @@ -3264,7 +3273,6 @@ module ts { case SyntaxKind.OpenBraceToken: case SyntaxKind.VarKeyword: case SyntaxKind.LetKeyword: - case SyntaxKind.ConstKeyword: case SyntaxKind.FunctionKeyword: case SyntaxKind.IfKeyword: case SyntaxKind.DoKeyword: @@ -3283,6 +3291,12 @@ module ts { case SyntaxKind.CatchKeyword: case SyntaxKind.FinallyKeyword: return true; + case SyntaxKind.ConstKeyword: + // const keyword can precede enum keyword when defining constant enums + // 'const enum' do not start statement. + // In ES 6 'enum' is a future reserved keyword, so it should not be used as identifier + var isConstEnum = lookAhead(() => nextToken() === SyntaxKind.EnumKeyword); + return !isConstEnum; case SyntaxKind.InterfaceKeyword: case SyntaxKind.ClassKeyword: case SyntaxKind.ModuleKeyword: @@ -3293,6 +3307,7 @@ module ts { if (isDeclarationStart()) { return false; } + case SyntaxKind.PublicKeyword: case SyntaxKind.PrivateKeyword: case SyntaxKind.ProtectedKeyword: @@ -3314,6 +3329,7 @@ module ts { case SyntaxKind.VarKeyword: case SyntaxKind.LetKeyword: case SyntaxKind.ConstKeyword: + // const here should always be parsed as const declaration because of check in 'isStatement' return parseVariableStatement(allowLetAndConstDeclarations); case SyntaxKind.FunctionKeyword: return parseFunctionDeclaration(); @@ -3501,8 +3517,8 @@ module ts { return node; } - function parseFunctionDeclaration(pos?: number, flags?: NodeFlags): FunctionDeclaration { - var node = createNode(SyntaxKind.FunctionDeclaration, pos); + function parseFunctionDeclaration(pos?: number, flags?: NodeFlags): FunctionLikeDeclaration { + var node = createNode(SyntaxKind.FunctionDeclaration, pos); if (flags) node.flags = flags; parseExpected(SyntaxKind.FunctionKeyword); node.name = parseIdentifier(); @@ -3511,10 +3527,10 @@ module ts { node.parameters = sig.parameters; node.type = sig.type; node.body = parseAndCheckFunctionBody(/*isConstructor*/ false); - if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { + 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 FunctionDeclaration or FunctionExpression or as a formal parameter name(13.1) - reportInvalidUseInStrictMode(node.name); + // Identifier of a FunctionLikeDeclaration or FunctionExpression or as a formal parameter name(13.1) + reportInvalidUseInStrictMode(node.name); } return finishNode(node); } @@ -3631,7 +3647,7 @@ module ts { // A common error is to try to declare an accessor in an ambient class. if (inAmbientContext && canParseSemicolon()) { parseSemicolon(); - node.body = createMissingNode(); + node.body = createMissingNode(); } else { node.body = parseBody(/* ignoreMissingOpenBrace */ false); @@ -3935,6 +3951,7 @@ module ts { } 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 @@ -3969,22 +3986,29 @@ module ts { node.name = parsePropertyName(); node.initializer = parseInitializer(/*inParameter*/ false); - 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); + // 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); } - } - 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); node.flags = flags; + if (enumIsConst) { + parseExpected(SyntaxKind.ConstKeyword); + } parseExpected(SyntaxKind.EnumKeyword); node.name = parseIdentifier(); if (parseExpected(SyntaxKind.OpenBraceToken)) { @@ -4141,9 +4165,17 @@ module ts { switch (token) { case SyntaxKind.VarKeyword: case SyntaxKind.LetKeyword: - case SyntaxKind.ConstKeyword: result = parseVariableStatement(/*allowLetAndConstDeclarations*/ true, pos, flags); break; + case SyntaxKind.ConstKeyword: + var isConstEnum = lookAhead(() => nextToken() === SyntaxKind.EnumKeyword); + if (isConstEnum) { + result = parseAndCheckEnumDeclaration(pos, flags | NodeFlags.Const); + } + else { + result = parseVariableStatement(/*allowLetAndConstDeclarations*/ true, pos, flags); + } + break; case SyntaxKind.FunctionKeyword: result = parseFunctionDeclaration(pos, flags); break; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index b4ca7f810b5..22a0cf40502 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1,5 +1,4 @@ /// -/// module ts { @@ -9,7 +8,7 @@ module ts { } // token > SyntaxKind.Identifer => token is a keyword - export enum SyntaxKind { + export const enum SyntaxKind { Unknown, EndOfFileToken, SingleLineCommentTrivia, @@ -253,7 +252,7 @@ module ts { LastTemplateToken = TemplateTail } - export enum NodeFlags { + export const enum NodeFlags { Export = 0x00000001, // Declarations Ambient = 0x00000002, // Declarations QuestionMark = 0x00000004, // Parameter/Property/Method @@ -306,17 +305,25 @@ module ts { type?: TypeNode; } + export type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName; + export interface Declaration extends Node { - name?: Identifier; + name?: DeclarationName; + } + + export interface ComputedPropertyName extends Node { + expression: Expression; } export interface TypeParameterDeclaration extends Declaration { + name: Identifier; constraint?: TypeNode; } export interface SignatureDeclaration extends Declaration, ParsedSignature { } export interface VariableDeclaration extends Declaration { + name: Identifier; pattern?: BindingPattern; type?: TypeNode; initializer?: Expression; @@ -338,19 +345,43 @@ module ts { pattern?: BindingPattern; } - export interface PropertyDeclaration extends VariableDeclaration { } + export interface PropertyDeclaration extends Declaration { + type?: TypeNode; + initializer?: Expression; + } export interface ParameterDeclaration extends VariableDeclaration { } - export interface FunctionDeclaration extends Declaration, ParsedSignature { + /** + * Several node kinds share function-like features such as a signature, + * a name, and a body. These nodes should extend FunctionLikeDeclaration. + * Examples: + * FunctionDeclaration + * MethodDeclaration + * ConstructorDeclaration + * AccessorDeclaration + * FunctionExpression + */ + export interface FunctionLikeDeclaration extends Declaration, ParsedSignature { body?: Block | Expression; } - export interface MethodDeclaration extends FunctionDeclaration { } + export interface FunctionDeclaration extends FunctionLikeDeclaration { + name: Identifier; + body?: Block; + } - export interface ConstructorDeclaration extends FunctionDeclaration { } + export interface MethodDeclaration extends FunctionLikeDeclaration { + body?: Block; + } - export interface AccessorDeclaration extends FunctionDeclaration { } + export interface ConstructorDeclaration extends FunctionLikeDeclaration { + body?: Block; + } + + export interface AccessorDeclaration extends FunctionLikeDeclaration { + body?: Block; + } export interface TypeNode extends Node { } @@ -408,7 +439,8 @@ module ts { whenFalse: Expression; } - export interface FunctionExpression extends Expression, FunctionDeclaration { + export interface FunctionExpression extends Expression, FunctionLikeDeclaration { + name?: Identifier; body: Block | Expression; // Required, whereas the member inherited from FunctionDeclaration is optional } @@ -559,6 +591,7 @@ module ts { } export interface ClassDeclaration extends Declaration { + name: Identifier; typeParameters?: NodeArray; baseType?: TypeReferenceNode; implementedTypes?: NodeArray; @@ -566,28 +599,34 @@ module ts { } export interface InterfaceDeclaration extends Declaration { + name: Identifier; typeParameters?: NodeArray; baseTypes?: NodeArray; members: NodeArray; } export interface TypeAliasDeclaration extends Declaration { + name: Identifier; type: TypeNode; } export interface EnumMember extends Declaration { + name: Identifier | LiteralExpression; initializer?: Expression; } export interface EnumDeclaration extends Declaration { + name: Identifier; members: NodeArray; } export interface ModuleDeclaration extends Declaration { + name: Identifier | LiteralExpression; body: Block | ModuleDeclaration; } export interface ImportDeclaration extends Declaration { + name: Identifier; entityName?: EntityName; externalModuleName?: LiteralExpression; } @@ -702,7 +741,7 @@ module ts { getContextualType(node: Node): Type; getResolvedSignature(node: CallExpression, candidatesOutArray?: Signature[]): Signature; getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; - isImplementationOfOverload(node: FunctionDeclaration): boolean; + isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; isUndefinedSymbol(symbol: Symbol): boolean; isArgumentsSymbol(symbol: Symbol): boolean; hasEarlyErrors(sourceFile?: SourceFile): boolean; @@ -743,7 +782,7 @@ module ts { trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; } - export enum TypeFormatFlags { + export const enum TypeFormatFlags { None = 0x00000000, WriteArrayAsGenericType = 0x00000001, // Write Array instead T[] UseTypeOfFunction = 0x00000002, // Write typeof instead of function type literal @@ -754,7 +793,7 @@ module ts { InElementType = 0x00000040, // Writing an array or union element type } - export enum SymbolFormatFlags { + export const enum SymbolFormatFlags { None = 0x00000000, WriteTypeParametersOrArguments = 0x00000001, // Write symbols's type argument if it is instantiated symbol // eg. class C { p: T } <-- Show p as C.p here @@ -765,7 +804,7 @@ module ts { // When this flag is specified m.c will be used to refer to the class instead of alias symbol x } - export enum SymbolAccessibility { + export const enum SymbolAccessibility { Accessible, NotAccessible, CannotBeNamed @@ -780,26 +819,26 @@ module ts { export interface EmitResolver { getProgram(): Program; - getLocalNameOfContainer(container: Declaration): string; + getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string; getExpressionNamePrefix(node: Identifier): string; getExportAssignmentName(node: SourceFile): string; isReferencedImportDeclaration(node: ImportDeclaration): boolean; - isTopLevelValueImportedViaEntityName(node: ImportDeclaration): boolean; + isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean; getNodeCheckFlags(node: Node): NodeCheckFlags; getEnumMemberValue(node: EnumMember): number; hasSemanticErrors(): boolean; isDeclarationVisible(node: Declaration): boolean; - isImplementationOfOverload(node: FunctionDeclaration): boolean; + isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; 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; // Returns the constant value this property access resolves to, or 'undefined' for a non-constant - getConstantValue(node: PropertyAccess): number; + getConstantValue(node: PropertyAccess | IndexedAccess): number; hasEarlyErrors(sourceFile?: SourceFile): boolean; } - export enum SymbolFlags { + export const enum SymbolFlags { FunctionScopedVariable = 0x00000001, // Variable (var) or parameter BlockScopedVariable = 0x00000002, // A block-scoped variable (let or const) Property = 0x00000004, // Property or enum member @@ -807,32 +846,34 @@ module ts { Function = 0x00000010, // Function Class = 0x00000020, // Class Interface = 0x00000040, // Interface - Enum = 0x00000080, // Enum - ValueModule = 0x00000100, // Instantiated module - NamespaceModule = 0x00000200, // Uninstantiated module - TypeLiteral = 0x00000400, // Type Literal - ObjectLiteral = 0x00000800, // Object Literal - Method = 0x00001000, // Method - Constructor = 0x00002000, // Constructor - GetAccessor = 0x00004000, // Get accessor - SetAccessor = 0x00008000, // Set accessor - CallSignature = 0x00010000, // Call signature - ConstructSignature = 0x00020000, // Construct signature - IndexSignature = 0x00040000, // Index signature - TypeParameter = 0x00080000, // Type parameter - TypeAlias = 0x00100000, // Type alias + ConstEnum = 0x00000080, // Const enum + RegularEnum = 0x00000100, // Enum + ValueModule = 0x00000200, // Instantiated module + NamespaceModule = 0x00000400, // Uninstantiated module + TypeLiteral = 0x00000800, // Type Literal + ObjectLiteral = 0x00001000, // Object Literal + Method = 0x00002000, // Method + Constructor = 0x00004000, // Constructor + GetAccessor = 0x00008000, // Get accessor + SetAccessor = 0x00010000, // Set accessor + CallSignature = 0x00020000, // Call signature + ConstructSignature = 0x00040000, // Construct signature + IndexSignature = 0x00080000, // Index signature + TypeParameter = 0x00100000, // Type parameter + TypeAlias = 0x00200000, // Type alias // Export markers (see comment in declareModuleMember in binder) - ExportValue = 0x00200000, // Exported value marker - ExportType = 0x00400000, // Exported type marker - ExportNamespace = 0x00800000, // Exported namespace marker - Import = 0x01000000, // Import - Instantiated = 0x02000000, // Instantiated symbol - Merged = 0x04000000, // Merged symbol (created during program binding) - Transient = 0x08000000, // Transient symbol (created during type check) - Prototype = 0x10000000, // Prototype property (no source representation) - UnionProperty = 0x20000000, // Property in union type + ExportValue = 0x00400000, // Exported value marker + ExportType = 0x00800000, // Exported type marker + ExportNamespace = 0x01000000, // Exported namespace marker + Import = 0x02000000, // Import + Instantiated = 0x04000000, // Instantiated symbol + Merged = 0x08000000, // Merged symbol (created during program binding) + Transient = 0x10000000, // Transient symbol (created during type check) + Prototype = 0x20000000, // Prototype property (no source representation) + UnionProperty = 0x40000000, // Property in union type + Enum = RegularEnum | ConstEnum, Variable = FunctionScopedVariable | BlockScopedVariable, Value = Variable | Property | EnumMember | Function | Class | Enum | ValueModule | Method | GetAccessor | SetAccessor, Type = Class | Interface | Enum | TypeLiteral | ObjectLiteral | TypeParameter | TypeAlias, @@ -855,8 +896,9 @@ module ts { FunctionExcludes = Value & ~(Function | ValueModule), ClassExcludes = (Value | Type) & ~ValueModule, InterfaceExcludes = Type & ~Interface, - EnumExcludes = (Value | Type) & ~(Enum | ValueModule), - ValueModuleExcludes = Value & ~(Function | Class | Enum | ValueModule), + RegularEnumExcludes = (Value | Type) & ~(RegularEnum | ValueModule), // regular enums merge only with regular enums and modules + ConstEnumExcludes = (Value | Type) & ~ConstEnum, // const enums merge only with const enums + ValueModuleExcludes = Value & ~(Function | Class | RegularEnum | ValueModule), NamespaceModuleExcludes = 0, MethodExcludes = Value & ~Method, GetAccessorExcludes = Value & ~SetAccessor, @@ -888,7 +930,8 @@ module ts { members?: SymbolTable; // Class, interface or literal instance members exports?: SymbolTable; // Module exports exportSymbol?: Symbol; // Exported symbol associated with this symbol - valueDeclaration?: Declaration // First value declaration of the symbol + valueDeclaration?: Declaration // First value declaration of the symbol, + constEnumOnlyModule?: boolean // For modules - if true - module contains only const enums or other modules with only const enums. } export interface SymbolLinks { @@ -907,7 +950,7 @@ module ts { [index: string]: Symbol; } - export enum NodeCheckFlags { + export const enum NodeCheckFlags { TypeChecked = 0x00000001, // Node has been type checked LexicalThis = 0x00000002, // Lexical 'this' reference CaptureThis = 0x00000004, // Lexical 'this' used in body @@ -932,7 +975,7 @@ module ts { assignmentChecks?: Map; // Cache of assignment checks } - export enum TypeFlags { + export const enum TypeFlags { Any = 0x00000001, String = 0x00000002, Number = 0x00000004, @@ -1030,7 +1073,7 @@ module ts { mapper?: TypeMapper; // Instantiation mapper } - export enum SignatureKind { + export const enum SignatureKind { Call, Construct, } @@ -1050,7 +1093,7 @@ module ts { isolatedSignatureType?: ObjectType; // A manufactured type that just contains the signature for purposes of signature comparison } - export enum IndexKind { + export const enum IndexKind { String, Number, } @@ -1059,14 +1102,18 @@ module ts { (t: Type): Type; } + export interface TypeInferences { + primary: Type[]; // Inferences made directly to a type parameter + secondary: Type[]; // Inferences made to a type parameter in a union type + } + export interface InferenceContext { - typeParameters: TypeParameter[]; // Type parameters for which inferences are made - inferUnionTypes: boolean; // Infer union types for disjoint candidates (otherwise undefinedType) - inferenceCount: number; // Incremented for every inference made (whether new or not) - inferences: Type[][]; // Inferences made for each type parameter - inferredTypes: Type[]; // Inferred type for each type parameter - failedTypeParameterIndex?: number; // Index of type parameter for which inference failed - // It is optional because in contextual signature instantiation, nothing fails + typeParameters: TypeParameter[]; // Type parameters for which inferences are made + inferUnionTypes: boolean; // Infer union types for disjoint candidates (otherwise undefinedType) + inferences: TypeInferences[]; // Inferences made for each type parameter + inferredTypes: Type[]; // Inferred type for each type parameter + failedTypeParameterIndex?: number; // Index of type parameter for which inference failed + // It is optional because in contextual signature instantiation, nothing fails } export interface DiagnosticMessage { @@ -1126,10 +1173,11 @@ module ts { target?: ScriptTarget; version?: boolean; watch?: boolean; + preserveConstEnums?: boolean; [option: string]: string | number | boolean; } - export enum ModuleKind { + export const enum ModuleKind { None, CommonJS, AMD, @@ -1144,7 +1192,7 @@ module ts { } - export enum ScriptTarget { + export const enum ScriptTarget { ES3, ES5, ES6, @@ -1166,7 +1214,7 @@ module ts { error?: DiagnosticMessage; // The error given when the argument does not fit a customized 'type'. } - export enum CharacterCodes { + export const enum CharacterCodes { nullCharacter = 0, maxAsciiCharacter = 0x7F, diff --git a/src/harness/compilerRunner.ts b/src/harness/compilerRunner.ts index 6e211892437..f23647024f9 100644 --- a/src/harness/compilerRunner.ts +++ b/src/harness/compilerRunner.ts @@ -3,7 +3,7 @@ /// /// -enum CompilerTestType { +const enum CompilerTestType { Conformance, Regressions, Test262 diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 33f435ce76b..268a54f8e63 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -2368,7 +2368,7 @@ module FourSlash { }; } - enum State { + const enum State { none, inSlashStarMarker, inObjectMarker diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 60c5da5a1a6..14e2c9b42d4 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -30,7 +30,7 @@ module Utils { var global = Function("return this").call(null); // Setup some globals based on the current environment - export enum ExecutionEnvironment { + export const enum ExecutionEnvironment { Node, Browser, CScript @@ -757,7 +757,6 @@ module Harness { case 'codepage': case 'createFileLog': case 'filename': - case 'propagateenumconstants': case 'removecomments': case 'watch': case 'allowautomaticsemicoloninsertion': @@ -772,7 +771,9 @@ module Harness { case 'errortruncation': options.noErrorTruncation = setting.value === 'false'; break; - + case 'preserveconstenums': + options.preserveConstEnums = setting.value === 'true'; + break; default: throw new Error('Unsupported compiler setting ' + setting.flag); } @@ -1147,7 +1148,7 @@ module Harness { var optionRegex = /^[\/]{2}\s*@(\w+)\s*:\s*(\S*)/gm; // multiple matches on multiple lines // List of allowed metadata names - var fileMetadataNames = ["filename", "comments", "declaration", "module", "nolib", "sourcemap", "target", "out", "outdir", "noimplicitany", "noresolve", "newline", "newlines", "emitbom", "errortruncation", "usecasesensitivefilenames"]; + var fileMetadataNames = ["filename", "comments", "declaration", "module", "nolib", "sourcemap", "target", "out", "outdir", "noimplicitany", "noresolve", "newline", "newlines", "emitbom", "errortruncation", "usecasesensitivefilenames", "preserveconstenums"]; function extractCompilerSettings(content: string): CompilerSetting[] { diff --git a/src/harness/typeWriter.ts b/src/harness/typeWriter.ts index 6f7a7c335a0..ed8d37c9c7e 100644 --- a/src/harness/typeWriter.ts +++ b/src/harness/typeWriter.ts @@ -1,7 +1,7 @@ interface TypeWriterResult { line: number; column: number; - syntaxKind: string; + syntaxKind: number; sourceText: string; type: string; } @@ -84,7 +84,7 @@ class TypeWriterWalker { this.results.push({ line: lineAndCharacter.line - 1, column: lineAndCharacter.character, - syntaxKind: ts.SyntaxKind[node.kind], + syntaxKind: node.kind, sourceText: sourceText, type: this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.WriteOwnNameForAnyLike) }); diff --git a/src/services/breakpoints.ts b/src/services/breakpoints.ts index 3a72ee9bfa6..aa8ec8217ce 100644 --- a/src/services/breakpoints.ts +++ b/src/services/breakpoints.ts @@ -74,7 +74,7 @@ module ts.BreakpointResolver { return textSpan(node); } - if (node.parent.kind == SyntaxKind.ArrowFunction && (node.parent).body == node) { + if (node.parent.kind == SyntaxKind.ArrowFunction && (node.parent).body == node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); } @@ -99,7 +99,7 @@ module ts.BreakpointResolver { case SyntaxKind.Constructor: case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: - return spanInFunctionDeclaration(node); + return spanInFunctionDeclaration(node); case SyntaxKind.FunctionBlock: return spanInFunctionBlock(node); @@ -178,7 +178,7 @@ module ts.BreakpointResolver { case SyntaxKind.ModuleDeclaration: // span on complete module if it is instantiated - if (!isInstantiated(node)) { + if (getModuleInstanceState(node) !== ModuleInstanceState.Instantiated) { return undefined; } @@ -246,7 +246,7 @@ module ts.BreakpointResolver { } // return type of function go to previous token - if (isAnyFunction(node.parent) && (node.parent).type === node) { + if (isAnyFunction(node.parent) && (node.parent).type === node) { return spanInPreviousNode(node); } @@ -305,7 +305,7 @@ module ts.BreakpointResolver { return textSpan(parameter); } else { - var functionDeclaration = parameter.parent; + var functionDeclaration = parameter.parent; var indexOfParameter = indexOf(functionDeclaration.parameters, parameter); if (indexOfParameter) { // Not a first parameter, go to previous parameter @@ -318,12 +318,12 @@ module ts.BreakpointResolver { } } - function canFunctionHaveSpanInWholeDeclaration(functionDeclaration: FunctionDeclaration) { + function canFunctionHaveSpanInWholeDeclaration(functionDeclaration: FunctionLikeDeclaration) { return !!(functionDeclaration.flags & NodeFlags.Export) || (functionDeclaration.parent.kind === SyntaxKind.ClassDeclaration && functionDeclaration.kind !== SyntaxKind.Constructor); } - function spanInFunctionDeclaration(functionDeclaration: FunctionDeclaration): TypeScript.TextSpan { + function spanInFunctionDeclaration(functionDeclaration: FunctionLikeDeclaration): TypeScript.TextSpan { // No breakpoints in the function signature if (!functionDeclaration.body) { return undefined; @@ -340,7 +340,7 @@ module ts.BreakpointResolver { function spanInFunctionBlock(block: Block): TypeScript.TextSpan { var nodeForSpanInBlock = block.statements.length ? block.statements[0] : block.getLastToken(); - if (canFunctionHaveSpanInWholeDeclaration(block.parent)) { + if (canFunctionHaveSpanInWholeDeclaration(block.parent)) { return spanInNodeIfStartsOnSameLine(block.parent, nodeForSpanInBlock); } @@ -350,7 +350,7 @@ module ts.BreakpointResolver { function spanInBlock(block: Block): TypeScript.TextSpan { switch (block.parent.kind) { case SyntaxKind.ModuleDeclaration: - if (!isInstantiated(block.parent)) { + if (getModuleInstanceState(block.parent) !== ModuleInstanceState.Instantiated) { return undefined; } @@ -407,7 +407,7 @@ module ts.BreakpointResolver { switch (node.parent.kind) { case SyntaxKind.ModuleBlock: // If this is not instantiated module block no bp span - if (!isInstantiated(node.parent.parent)) { + if (getModuleInstanceState(node.parent.parent) !== ModuleInstanceState.Instantiated) { return undefined; } diff --git a/src/services/compiler/precompile.ts b/src/services/compiler/precompile.ts index 08a919a65b5..3396cb4f2a2 100644 --- a/src/services/compiler/precompile.ts +++ b/src/services/compiler/precompile.ts @@ -99,26 +99,26 @@ module TypeScript { var start = new Date().getTime(); // Look for: // import foo = module("foo") - while (token.kind() !== SyntaxKind.EndOfFileToken) { - if (token.kind() === SyntaxKind.ImportKeyword) { + while (token.kind !== SyntaxKind.EndOfFileToken) { + if (token.kind === SyntaxKind.ImportKeyword) { var importToken = token; token = scanner.scan(/*allowRegularExpression:*/ false); if (SyntaxFacts.isIdentifierNameOrAnyKeyword(token)) { token = scanner.scan(/*allowRegularExpression:*/ false); - if (token.kind() === SyntaxKind.EqualsToken) { + if (token.kind === SyntaxKind.EqualsToken) { token = scanner.scan(/*allowRegularExpression:*/ false); - if (token.kind() === SyntaxKind.ModuleKeyword || token.kind() === SyntaxKind.RequireKeyword) { + if (token.kind === SyntaxKind.ModuleKeyword || token.kind === SyntaxKind.RequireKeyword) { token = scanner.scan(/*allowRegularExpression:*/ false); - if (token.kind() === SyntaxKind.OpenParenToken) { + if (token.kind === SyntaxKind.OpenParenToken) { token = scanner.scan(/*allowRegularExpression:*/ false); lineMap.fillLineAndCharacterFromPosition(TypeScript.start(importToken, text), lineChar); - if (token.kind() === SyntaxKind.StringLiteral) { + if (token.kind === SyntaxKind.StringLiteral) { var ref = { line: lineChar.line, character: lineChar.character, diff --git a/src/services/formatting/formatter.ts b/src/services/formatting/formatter.ts index a98d969c059..92417168eac 100644 --- a/src/services/formatting/formatter.ts +++ b/src/services/formatting/formatter.ts @@ -78,7 +78,7 @@ module TypeScript.Services.Formatting { } // Push the token - var currentTokenSpan = new TokenSpan(token.kind(), position, width(token)); + var currentTokenSpan = new TokenSpan(token.kind, position, width(token)); if (!this.parent().hasSkippedOrMissingTokenChild()) { if (this.previousTokenSpan) { // Note that formatPair calls TrimWhitespaceInLineRange in between the 2 tokens diff --git a/src/services/formatting/formattingManager.ts b/src/services/formatting/formattingManager.ts index 727c97cce30..b83281fb9ec 100644 --- a/src/services/formatting/formattingManager.ts +++ b/src/services/formatting/formattingManager.ts @@ -42,12 +42,12 @@ module TypeScript.Services.Formatting { var sourceUnit = this.syntaxTree.sourceUnit(); var semicolonPositionedToken = findToken(sourceUnit, caretPosition - 1); - if (semicolonPositionedToken.kind() === SyntaxKind.SemicolonToken) { + if (semicolonPositionedToken.kind === SyntaxKind.SemicolonToken) { // Find the outer most parent that this semicolon terminates var current: ISyntaxElement = semicolonPositionedToken; while (current.parent !== null && end(current.parent) === end(semicolonPositionedToken) && - current.parent.kind() !== SyntaxKind.List) { + current.parent.kind !== SyntaxKind.List) { current = current.parent; } @@ -65,12 +65,12 @@ module TypeScript.Services.Formatting { var sourceUnit = this.syntaxTree.sourceUnit(); var closeBracePositionedToken = findToken(sourceUnit, caretPosition - 1); - if (closeBracePositionedToken.kind() === SyntaxKind.CloseBraceToken) { + if (closeBracePositionedToken.kind === SyntaxKind.CloseBraceToken) { // Find the outer most parent that this closing brace terminates var current: ISyntaxElement = closeBracePositionedToken; while (current.parent !== null && end(current.parent) === end(closeBracePositionedToken) && - current.parent.kind() !== SyntaxKind.List) { + current.parent.kind !== SyntaxKind.List) { current = current.parent; } diff --git a/src/services/formatting/indentationNodeContext.ts b/src/services/formatting/indentationNodeContext.ts index 398d4998eed..7aa10d2f9b9 100644 --- a/src/services/formatting/indentationNodeContext.ts +++ b/src/services/formatting/indentationNodeContext.ts @@ -66,7 +66,7 @@ module TypeScript.Services.Formatting { } public kind(): SyntaxKind { - return this._node.kind(); + return this._node.kind; } public hasSkippedOrMissingTokenChild(): boolean { diff --git a/src/services/formatting/indentationTrackingWalker.ts b/src/services/formatting/indentationTrackingWalker.ts index d02f2f50825..9ed998858c5 100644 --- a/src/services/formatting/indentationTrackingWalker.ts +++ b/src/services/formatting/indentationTrackingWalker.ts @@ -103,7 +103,7 @@ module TypeScript.Services.Formatting { if (isToken(element)) { this.visitToken(element); } - else if (element.kind() === SyntaxKind.List) { + else if (element.kind === SyntaxKind.List) { for (var i = 0, n = childCount(element); i < n; i++) { this.walk(childAt(element, i)); } @@ -148,9 +148,9 @@ module TypeScript.Services.Formatting { // } // Also in a do-while statement, the while should be indented like the parent. if (firstToken(this._parent.node()) === token || - token.kind() === SyntaxKind.OpenBraceToken || token.kind() === SyntaxKind.CloseBraceToken || - token.kind() === SyntaxKind.OpenBracketToken || token.kind() === SyntaxKind.CloseBracketToken || - (token.kind() === SyntaxKind.WhileKeyword && this._parent.node().kind() == SyntaxKind.DoStatement)) { + token.kind === SyntaxKind.OpenBraceToken || token.kind === SyntaxKind.CloseBraceToken || + token.kind === SyntaxKind.OpenBracketToken || token.kind === SyntaxKind.CloseBracketToken || + (token.kind === SyntaxKind.WhileKeyword && this._parent.node().kind == SyntaxKind.DoStatement)) { return this._parent.indentationAmount(); } @@ -161,7 +161,7 @@ module TypeScript.Services.Formatting { // If this is token terminating an indentation scope, leading comments should be indented to follow the children // indentation level and not the node - if (token.kind() === SyntaxKind.CloseBraceToken || token.kind() === SyntaxKind.CloseBracketToken) { + if (token.kind === SyntaxKind.CloseBraceToken || token.kind === SyntaxKind.CloseBracketToken) { return (this._parent.indentationAmount() + this._parent.childIndentationAmountDelta()); } return this._parent.indentationAmount(); @@ -213,7 +213,7 @@ module TypeScript.Services.Formatting { var indentationAmountDelta: number; var parentNode = parent.node(); - switch (node.kind()) { + switch (node.kind) { default: // General case // This node should follow the child indentation set by its parent diff --git a/src/services/formatting/multipleTokenIndenter.ts b/src/services/formatting/multipleTokenIndenter.ts index 23181571427..9297db96635 100644 --- a/src/services/formatting/multipleTokenIndenter.ts +++ b/src/services/formatting/multipleTokenIndenter.ts @@ -119,7 +119,7 @@ module TypeScript.Services.Formatting { } - if (token.kind() !== SyntaxKind.EndOfFileToken && indentNextTokenOrTrivia) { + if (token.kind !== SyntaxKind.EndOfFileToken && indentNextTokenOrTrivia) { // If the last trivia item was a new line, or no trivia items were encounterd record the // indentation edit at the token position if (indentationString.length > 0) { diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index e31c6687428..029df425045 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -361,7 +361,7 @@ module ts.formatting { case SyntaxKind.FunctionExpression: case SyntaxKind.Method: case SyntaxKind.ArrowFunction: - return !(n).body || isCompletedNode((n).body, sourceFile); + return !(n).body || isCompletedNode((n).body, sourceFile); case SyntaxKind.ModuleDeclaration: return (n).body && isCompletedNode((n).body, sourceFile); case SyntaxKind.IfStatement: diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index 69180974120..ca06d40fa88 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -73,13 +73,14 @@ module ts.NavigationBar { function sortNodes(nodes: Node[]): Node[] { return nodes.slice(0).sort((n1: Declaration, n2: Declaration) => { if (n1.name && n2.name) { - return n1.name.text.localeCompare(n2.name.text); + // TODO(jfreeman): How do we sort declarations with computed names? + return (n1.name).text.localeCompare((n2.name).text); } else if (n1.name) { return 1; } else if (n2.name) { - -1; + return -1; } else { return n1.kind - n2.kind; @@ -106,7 +107,7 @@ module ts.NavigationBar { break; case SyntaxKind.FunctionDeclaration: - var functionDeclaration = node; + var functionDeclaration = node; if (isTopLevelFunctionDeclaration(functionDeclaration)) { topLevelNodes.push(node); addTopLevelNodes((functionDeclaration.body).statements, topLevelNodes); @@ -116,11 +117,12 @@ module ts.NavigationBar { } } - function isTopLevelFunctionDeclaration(functionDeclaration: FunctionDeclaration) { + function isTopLevelFunctionDeclaration(functionDeclaration: FunctionLikeDeclaration) { if (functionDeclaration.kind === SyntaxKind.FunctionDeclaration) { // A function declaration is 'top level' if it contains any function declarations // within it. if (functionDeclaration.body && functionDeclaration.body.kind === SyntaxKind.FunctionBlock) { + // Proper function declarations can only have identifier names if (forEach((functionDeclaration.body).statements, s => s.kind === SyntaxKind.FunctionDeclaration && !isEmpty((s).name.text))) { @@ -230,7 +232,7 @@ module ts.NavigationBar { return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.memberVariableElement); case SyntaxKind.FunctionDeclaration: - return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.functionElement); + return createItem(node, getTextOfNode((node).name), ts.ScriptElementKind.functionElement); case SyntaxKind.VariableDeclaration: if (node.flags & NodeFlags.Const) { @@ -371,8 +373,10 @@ module ts.NavigationBar { }); // Add the constructor parameters in as children of the class (for property parameters). + // Note that *all* parameters will be added to the nodes array, but parameters that + // are not properties will be filtered out later by createChildItem. var nodes: Node[] = constructor - ? constructor.parameters.concat(node.members) + ? node.members.concat(constructor.parameters) : node.members; var childItems = getItemsWorker(sortNodes(nodes), createChildItem); diff --git a/src/services/resources/diagnosticCode.generated.ts b/src/services/resources/diagnosticCode.generated.ts index 838879b55bc..04359272698 100644 --- a/src/services/resources/diagnosticCode.generated.ts +++ b/src/services/resources/diagnosticCode.generated.ts @@ -95,6 +95,7 @@ module TypeScript { 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.", + Computed_property_names_cannot_be_used_here: "Computed property names cannot be used here.", 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 6bf01f5873a..d772d2ced82 100644 --- a/src/services/resources/diagnosticInformationMap.generated.ts +++ b/src/services/resources/diagnosticInformationMap.generated.ts @@ -97,6 +97,7 @@ module TypeScript { "Expression expected.": { "code": 1109, "category": DiagnosticCategory.Error }, "Type expected.": { "code": 1110, "category": DiagnosticCategory.Error }, "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 }, "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 95e7f109edf..06be87b172a 100644 --- a/src/services/resources/diagnosticMessages.json +++ b/src/services/resources/diagnosticMessages.json @@ -375,6 +375,10 @@ "category": "Error", "code": 1111 }, + "Computed property names cannot be used here.": { + "category": "Error", + "code": 1112 + }, "Duplicate identifier '{0}'.": { "category": "Error", "code": 2000 diff --git a/src/services/services.ts b/src/services/services.ts index d208eb87e96..d6465084fa4 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -628,7 +628,7 @@ module ts { if (this.documentationComment === undefined) { this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations( [this.declaration], - this.declaration.name ? this.declaration.name.text : "", + /*name*/ undefined, /*canUseParsedParamTagComments*/ false) : []; } @@ -674,7 +674,7 @@ module ts { switch (node.kind) { case SyntaxKind.FunctionDeclaration: case SyntaxKind.Method: - var functionDeclaration = node; + var functionDeclaration = node; if (functionDeclaration.name && functionDeclaration.name.kind !== SyntaxKind.Missing) { var lastDeclaration = namedDeclarations.length > 0 ? @@ -685,7 +685,7 @@ module ts { if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) { // Overwrite the last declaration if it was an overload // and this one is an implementation. - if (functionDeclaration.body && !(lastDeclaration).body) { + if (functionDeclaration.body && !(lastDeclaration).body) { namedDeclarations[namedDeclarations.length - 1] = functionDeclaration; } } @@ -1065,7 +1065,7 @@ module ts { emitOutputStatus: EmitReturnStatus; } - export enum OutputFileType { + export const enum OutputFileType { JavaScript, SourceMap, Declaration @@ -1077,7 +1077,7 @@ module ts { text: string; } - export enum EndOfLineState { + export const enum EndOfLineState { Start, InMultiLineCommentTrivia, InSingleQuoteStringLiteral, @@ -1780,7 +1780,7 @@ module ts { var buckets: Map> = {}; function getKeyFromCompilationSettings(settings: CompilerOptions): string { - return "_" + ScriptTarget[settings.target]; // + "|" + settings.propagateEnumConstantoString() + return "_" + settings.target; // + "|" + settings.propagateEnumConstantoString() } function getBucketForCompilationSettings(settings: CompilerOptions, createIfMissing: boolean): Map { @@ -1963,7 +1963,7 @@ module ts { function isNameOfFunctionDeclaration(node: Node): boolean { return node.kind === SyntaxKind.Identifier && - isAnyFunction(node.parent) && (node.parent).name === node; + isAnyFunction(node.parent) && (node.parent).name === node; } /** Returns true if node is a name of an object literal property, e.g. "a" in x = { "a": 1 } */ @@ -2028,7 +2028,7 @@ module ts { } } - enum SemanticMeaning { + const enum SemanticMeaning { None = 0x0, Value = 0x1, Type = 0x2, @@ -2036,7 +2036,7 @@ module ts { All = Value | Type | Namespace } - enum BreakContinueSearchType { + const enum BreakContinueSearchType { None = 0x0, Unlabeled = 0x1, Labeled = 0x2, @@ -2335,24 +2335,35 @@ module ts { filename = TypeScript.switchToForwardSlashes(filename); + var syntacticStart = new Date().getTime(); var sourceFile = getSourceFile(filename); + var start = new Date().getTime(); var currentToken = getTokenAtPosition(sourceFile, position); + host.log("getCompletionsAtPosition: Get current token: " + (new Date().getTime() - start)); + var start = new Date().getTime(); // Completion not allowed inside comments, bail out if this is the case - if (isInsideComment(sourceFile, currentToken, position)) { + var insideComment = isInsideComment(sourceFile, currentToken, position); + host.log("getCompletionsAtPosition: Is inside comment: " + (new Date().getTime() - start)); + + if (insideComment) { host.log("Returning an empty list because completion was inside a comment."); return undefined; } // The decision to provide completion depends on the previous token, so find it // Note: previousToken can be undefined if we are the beginning of the file + var start = new Date().getTime(); var previousToken = findPrecedingToken(position, sourceFile); + host.log("getCompletionsAtPosition: Get previous token 1: " + (new Date().getTime() - start)); // The caret is at the end of an identifier; this is a partial identifier that we want to complete: e.g. a.toS| // Skip this partial identifier to the previous token if (previousToken && position <= previousToken.end && previousToken.kind === SyntaxKind.Identifier) { + var start = new Date().getTime(); previousToken = findPrecedingToken(previousToken.pos, sourceFile); + host.log("getCompletionsAtPosition: Get previous token 2: " + (new Date().getTime() - start)); } // Check if this is a valid completion location @@ -2383,8 +2394,10 @@ module ts { symbols: {}, typeChecker: typeInfoResolver }; + host.log("getCompletionsAtPosition: Syntactic work: " + (new Date().getTime() - syntacticStart)); // Populate the completion list + var semanticStart = new Date().getTime(); if (isRightOfDot) { // Right of dot member completion list var symbols: Symbol[] = []; @@ -2454,6 +2467,7 @@ module ts { if (!isMemberCompletion) { Array.prototype.push.apply(activeCompletionSession.entries, keywordCompletions); } + host.log("getCompletionsAtPosition: Semantic work: " + (new Date().getTime() - semanticStart)); return { isMemberCompletion: isMemberCompletion, @@ -2461,6 +2475,7 @@ module ts { }; function getCompletionEntriesFromSymbols(symbols: Symbol[], session: CompletionSession): void { + var start = new Date().getTime(); forEach(symbols, symbol => { var entry = createCompletionEntry(symbol, session.typeChecker); if (entry && !lookUp(session.symbols, entry.name)) { @@ -2468,12 +2483,16 @@ module ts { session.symbols[entry.name] = symbol; } }); + host.log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - semanticStart)); } function isCompletionListBlocker(previousToken: Node): boolean { - return isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || + var start = new Date().getTime(); + var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || isIdentifierDefinitionLocation(previousToken) || isRightOfIllegalDot(previousToken); + host.log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - semanticStart)); + return result; } function isInStringOrRegularExpressionOrTemplateLiteral(previousToken: Node): boolean { @@ -2639,7 +2658,8 @@ module ts { return; } - existingMemberNames[m.name.text] = true; + // TODO(jfreeman): Account for computed property name + existingMemberNames[(m.name).text] = true; }); var filteredMembers: Symbol[] = []; @@ -2926,7 +2946,7 @@ module ts { (location.kind === SyntaxKind.ConstructorKeyword && location.parent.kind === SyntaxKind.Constructor)) { // At constructor keyword of constructor declaration // get the signature from the declaration and write it var signature: Signature; - var functionDeclaration = location.parent; + var functionDeclaration = location.parent; var allSignatures = functionDeclaration.kind === SyntaxKind.Constructor ? type.getConstructSignatures() : type.getCallSignatures(); if (!typeResolver.isImplementationOfOverload(functionDeclaration)) { signature = typeResolver.getSignatureFromDeclaration(functionDeclaration); @@ -3206,7 +3226,7 @@ module ts { if ((selectConstructors && d.kind === SyntaxKind.Constructor) || (!selectConstructors && (d.kind === SyntaxKind.FunctionDeclaration || d.kind === SyntaxKind.Method))) { declarations.push(d); - if ((d).body) definition = d; + if ((d).body) definition = d; } }); @@ -3453,7 +3473,7 @@ module ts { } function getReturnOccurrences(returnStatement: ReturnStatement): ReferenceEntry[] { - var func = getContainingFunction(returnStatement); + var func = getContainingFunction(returnStatement); // If we didn't find a containing function with a block body, bail out. if (!(func && hasKind(func.body, SyntaxKind.FunctionBlock))) { @@ -3852,7 +3872,7 @@ module ts { function getNormalizedSymbolName(symbolName: string, 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); + var functionExpression = forEach(declarations, d => d.kind === SyntaxKind.FunctionExpression ? d : undefined); if (functionExpression && functionExpression.name) { var name = functionExpression.name.text; @@ -4411,7 +4431,8 @@ module ts { var declarations = sourceFile.getNamedDeclarations(); for (var i = 0, n = declarations.length; i < n; i++) { var declaration = declarations[i]; - var name = declaration.name.text; + // TODO(jfreeman): Skip this declaration if it has a computed name + var name = (declaration.name).text; var matchKind = getMatchKind(searchTerms, name); if (matchKind !== MatchKind.none) { var container = getContainerNode(declaration); @@ -4422,7 +4443,8 @@ module ts { matchKind: MatchKind[matchKind], fileName: filename, textSpan: TypeScript.TextSpan.fromBounds(declaration.getStart(), declaration.getEnd()), - containerName: container.name ? container.name.text : "", + // 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) : "" }); } @@ -4572,7 +4594,7 @@ module ts { if ((node).name.kind === SyntaxKind.StringLiteral) { return SemanticMeaning.Namespace | SemanticMeaning.Value; } - else if (isInstantiated(node)) { + else if (getModuleInstanceState(node) === ModuleInstanceState.Instantiated) { return SemanticMeaning.Namespace | SemanticMeaning.Value; } else { @@ -4849,7 +4871,7 @@ module ts { */ function hasValueSideModule(symbol: Symbol): boolean { return forEach(symbol.declarations, declaration => { - return declaration.kind === SyntaxKind.ModuleDeclaration && isInstantiated(declaration); + return declaration.kind === SyntaxKind.ModuleDeclaration && getModuleInstanceState(declaration) == ModuleInstanceState.Instantiated; }); } } @@ -5135,9 +5157,17 @@ module ts { } function getTodoComments(filename: string, descriptors: TodoCommentDescriptor[]): TodoComment[] { + // Note: while getting todo comments seems like a syntactic operation, we actually + // treat it as a semantic operation here. This is because we expect our host to call + // this on every single file. If we treat this syntactically, then that will cause + // us to populate and throw away the tree in our syntax tree cache for each file. By + // treating this as a semantic operation, we can access any tree without throwing + // anything away. + synchronizeHostData(); + filename = TypeScript.switchToForwardSlashes(filename); - var sourceFile = getCurrentSourceFile(filename); + var sourceFile = getSourceFile(filename); cancellationToken.throwIfCancellationRequested(); diff --git a/src/services/shims.ts b/src/services/shims.ts index a6bf421b095..b93c699be73 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -171,13 +171,13 @@ module ts { } /// TODO: delete this, it is only needed until the VS interface is updated - export enum LanguageVersion { + export const enum LanguageVersion { EcmaScript3 = 0, EcmaScript5 = 1, EcmaScript6 = 2, } - export enum ModuleGenTarget { + export const enum ModuleGenTarget { Unspecified = 0, Synchronous = 1, Asynchronous = 2, diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts index f0b4ddc5ef7..41f64c1b8db 100644 --- a/src/services/signatureHelp.ts +++ b/src/services/signatureHelp.ts @@ -244,7 +244,7 @@ module ts.SignatureHelp { // If the node is not a subspan of its parent, this is a big problem. // There have been crashes that might be caused by this violation. if (n.pos < n.parent.pos || n.end > n.parent.end) { - Debug.fail("Node of kind " + SyntaxKind[n.kind] + " is not a subspan of its parent of kind " + SyntaxKind[n.parent.kind]); + Debug.fail("Node of kind " + n.kind + " is not a subspan of its parent of kind " + n.parent.kind); } var argumentInfo = getImmediatelyContainingArgumentInfo(n); diff --git a/src/services/syntax/SyntaxGenerator.js b/src/services/syntax/SyntaxGenerator.js index de5987c253b..3745cda815a 100644 --- a/src/services/syntax/SyntaxGenerator.js +++ b/src/services/syntax/SyntaxGenerator.js @@ -620,8 +620,9 @@ var TypeScript; 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["ComputedPropertyName"] = 211] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 212] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ModuleNameModuleReference"] = 213] = "ModuleNameModuleReference"; SyntaxKind[SyntaxKind["FirstStandardKeyword"] = SyntaxKind.BreakKeyword] = "FirstStandardKeyword"; SyntaxKind[SyntaxKind["LastStandardKeyword"] = SyntaxKind.WithKeyword] = "LastStandardKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedKeyword"] = SyntaxKind.ClassKeyword] = "FirstFutureReservedKeyword"; @@ -1040,7 +1041,7 @@ var definitions = [ name: 'VariableDeclaratorSyntax', baseType: 'ISyntaxNode', children: [ - { name: 'propertyName', isToken: true }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true, isTypeScriptSpecific: true }, { name: 'equalsValueClause', type: 'EqualsValueClauseSyntax', isOptional: true } ] @@ -1300,7 +1301,7 @@ var definitions = [ interfaces: ['IMemberExpressionSyntax', 'ICallExpressionSyntax'], children: [ { name: 'expression', type: 'ILeftHandSideExpressionSyntax' }, - { name: 'templateExpression', type: 'IPrimaryExpressionSyntax' }, + { name: 'templateExpression', type: 'IPrimaryExpressionSyntax' } ] }, { @@ -1309,7 +1310,7 @@ var definitions = [ interfaces: ['IPrimaryExpressionSyntax'], children: [ { name: 'templateStartToken', isToken: true, excludeFromAST: true }, - { name: 'templateClauses', isList: true, elementType: 'TemplateClauseSyntax' }, + { name: 'templateClauses', isList: true, elementType: 'TemplateClauseSyntax' } ] }, { @@ -1317,7 +1318,7 @@ var definitions = [ baseType: 'ISyntaxNode', children: [ { name: 'expression', type: 'IExpressionSyntax' }, - { name: 'templateMiddleOrEndToken', isToken: true, elementType: 'TemplateSpanSyntax' }, + { name: 'templateMiddleOrEndToken', isToken: true, elementType: 'TemplateSpanSyntax' } ] }, { @@ -1376,7 +1377,7 @@ var definitions = [ baseType: 'ISyntaxNode', interfaces: ['ITypeMemberSyntax'], children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'questionToken', isToken: true, isOptional: true, itTypeScriptSpecific: true }, { name: 'callSignature', type: 'CallSignatureSyntax' } ] @@ -1398,7 +1399,7 @@ var definitions = [ baseType: 'ISyntaxNode', interfaces: ['ITypeMemberSyntax'], children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'questionToken', isToken: true, isOptional: true }, { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true } ], @@ -1500,7 +1501,7 @@ var definitions = [ interfaces: ['IMemberDeclarationSyntax'], children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, { name: 'block', type: 'BlockSyntax', isOptional: true }, { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } @@ -1510,11 +1511,11 @@ var definitions = [ { name: 'GetAccessorSyntax', baseType: 'ISyntaxNode', - interfaces: ['IMemberDeclarationSyntax', 'IPropertyAssignmentSyntax'], + interfaces: ['IAccessorSyntax'], children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken', isTypeScriptSpecific: true }, { name: 'getKeyword', isToken: true, excludeFromAST: true }, - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, { name: 'block', type: 'BlockSyntax' } ] @@ -1522,11 +1523,11 @@ var definitions = [ { name: 'SetAccessorSyntax', baseType: 'ISyntaxNode', - interfaces: ['IMemberDeclarationSyntax', 'IPropertyAssignmentSyntax'], + interfaces: ['IAccessorSyntax'], children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken', isTypeScriptSpecific: true }, { name: 'setKeyword', isToken: true, excludeFromAST: true }, - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, { name: 'block', type: 'BlockSyntax' } ], @@ -1713,7 +1714,7 @@ var definitions = [ name: 'EnumElementSyntax', baseType: 'ISyntaxNode', children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'equalsValueClause', type: 'EqualsValueClauseSyntax', isOptional: true } ] }, @@ -1739,12 +1740,22 @@ var definitions = [ { name: 'closeBraceToken', isToken: true, excludeFromAST: true } ] }, + { + name: 'ComputedPropertyNameSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPropertyNameSyntax'], + children: [ + { name: 'openBracketToken', isToken: true }, + { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'closeBracketToken', isToken: true } + ] + }, { name: 'SimplePropertyAssignmentSyntax', baseType: 'ISyntaxNode', interfaces: ['IPropertyAssignmentSyntax'], children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'colonToken', isToken: true, excludeFromAST: true }, { name: 'expression', type: 'IExpressionSyntax' } ] @@ -1754,7 +1765,7 @@ var definitions = [ baseType: 'ISyntaxNode', interfaces: ['IPropertyAssignmentSyntax'], children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, { name: 'block', type: 'BlockSyntax' } ] @@ -1907,43 +1918,6 @@ function getSafeName(child) { } return child.name; } -function generateBrands(definition, accessibility) { - var properties = ""; - var types = []; - if (definition.interfaces) { - var ifaces = definition.interfaces.slice(0); - var i; - for (i = 0; i < ifaces.length; i++) { - var current = ifaces[i]; - while (current !== undefined) { - if (!TypeScript.ArrayUtilities.contains(ifaces, current)) { - ifaces.push(current); - } - current = interfaces[current]; - } - } - for (i = 0; i < ifaces.length; i++) { - var type = ifaces[i]; - type = getStringWithoutSuffix(type); - if (isInterface(type)) { - type = "_" + type.substr(1, 1).toLowerCase() + type.substr(2) + "Brand"; - } - types.push(type); - } - } - types.push("_syntaxNodeOrTokenBrand"); - if (types.length > 0) { - properties += " "; - for (var i = 0; i < types.length; i++) { - if (accessibility) { - properties += " public "; - } - properties += types[i] + ": any;"; - } - properties += "\r\n"; - } - return properties; -} function generateConstructorFunction(definition) { var result = " export var " + definition.name + ": " + getNameWithoutSuffix(definition) + "Constructor = function(data: number"; for (var i = 0; i < definition.children.length; i++) { @@ -1982,7 +1956,20 @@ function generateConstructorFunction(definition) { result += ";\r\n"; } result += " };\r\n"; - result += " " + definition.name + ".prototype.kind = function() { return SyntaxKind." + getNameWithoutSuffix(definition) + "; }\r\n"; + result += " " + definition.name + ".prototype.kind = SyntaxKind." + getNameWithoutSuffix(definition) + ";\r\n"; + result += " " + definition.name + ".prototype.childCount = " + definition.children.length + ";\r\n"; + result += " " + definition.name + ".prototype.childAt = function(index: number): ISyntaxElement {\r\n"; + if (definition.children.length) { + result += " switch (index) {\r\n"; + for (var j = 0; j < definition.children.length; j++) { + result += " case " + j + ": return this." + definition.children[j].name + ";\r\n"; + } + result += " }\r\n"; + } + else { + result += " throw Errors.invalidOperation();\r\n"; + } + result += " }\r\n"; return result; } function generateSyntaxInterfaces() { @@ -2154,16 +2141,28 @@ function max(array, func) { } return max; } +function generateUtilities() { + var result = ""; + result += " var fixedWidthArray = ["; + for (var i = 0; i <= TypeScript.SyntaxKind.LastFixedWidth; i++) { + if (i) { + result += ", "; + } + if (i < TypeScript.SyntaxKind.FirstFixedWidth) { + result += "0"; + } + else { + result += TypeScript.SyntaxFacts.getText(i).length; + } + } + result += "];\r\n"; + result += " function fixedWidthTokenLength(kind: SyntaxKind) {\r\n"; + result += " return fixedWidthArray[kind];\r\n"; + result += " }\r\n"; + return result; +} function generateScannerUtilities() { var result = "///\r\n" + "\r\n" + "module TypeScript {\r\n" + " export module ScannerUtilities {\r\n"; - result += " export function fixedWidthTokenLength(kind: SyntaxKind) {\r\n"; - result += " switch (kind) {\r\n"; - for (var k = TypeScript.SyntaxKind.FirstFixedWidth; k <= TypeScript.SyntaxKind.LastFixedWidth; k++) { - result += " case SyntaxKind." + syntaxKindName(k) + ": return " + TypeScript.SyntaxFacts.getText(k).length + ";\r\n"; - } - result += " default: throw new Error();\r\n"; - result += " }\r\n"; - result += " }\r\n\r\n"; var i; var keywords = []; for (i = TypeScript.SyntaxKind.FirstKeyword; i <= TypeScript.SyntaxKind.LastKeyword; i++) { @@ -2202,7 +2201,7 @@ function generateVisitor() { result += "module TypeScript {\r\n"; result += " export function visitNodeOrToken(visitor: ISyntaxVisitor, element: ISyntaxNodeOrToken): any {\r\n"; result += " if (element === undefined) { return undefined; }\r\n"; - result += " switch (element.kind()) {\r\n"; + result += " switch (element.kind) {\r\n"; for (var i = 0; i < definitions.length; i++) { var definition = definitions[i]; result += " case SyntaxKind." + getNameWithoutSuffix(definition) + ": "; @@ -2221,55 +2220,16 @@ function generateVisitor() { result += "\r\n}"; return result; } -function generateServicesUtilities() { - var result = ""; - result += "module TypeScript {\r\n"; - result += " export function childCount(element: ISyntaxElement): number {\r\n"; - result += " if (isList(element)) { return (element).length; }\r\n"; - result += " switch (element.kind()) {\r\n"; - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - result += " case SyntaxKind." + getNameWithoutSuffix(definition) + ": return " + definition.children.length + ";\r\n"; - } - result += " default: return 0;\r\n"; - result += " }\r\n"; - result += " }\r\n\r\n"; - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - result += " function " + camelCase(getNameWithoutSuffix(definition)) + "ChildAt(node: " + definition.name + ", index: number): ISyntaxElement {\r\n"; - if (definition.children.length) { - result += " switch (index) {\r\n"; - for (var j = 0; j < definition.children.length; j++) { - result += " case " + j + ": return node." + definition.children[j].name + ";\r\n"; - } - result += " }\r\n"; - } - else { - result += " throw Errors.invalidOperation();\r\n"; - } - result += " }\r\n"; - } - result += " export function childAt(element: ISyntaxElement, index: number): ISyntaxElement {\r\n"; - result += " if (isList(element)) { return (element)[index]; }\r\n"; - result += " switch (element.kind()) {\r\n"; - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - result += " case SyntaxKind." + getNameWithoutSuffix(definition) + ": return " + camelCase(getNameWithoutSuffix(definition)) + "ChildAt(<" + definition.name + ">element, index);\r\n"; - } - result += " }\r\n"; - result += " }\r\n"; - result += "}"; - return result; -} var syntaxNodesConcrete = generateNodes(); var syntaxInterfaces = generateSyntaxInterfaces(); var walker = generateWalker(); var scannerUtilities = generateScannerUtilities(); var visitor = generateVisitor(); -var servicesUtilities = generateServicesUtilities(); +var utilities = generateUtilities(); sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxNodes.concrete.generated.ts", syntaxNodesConcrete, false); sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxInterfaces.generated.ts", syntaxInterfaces, false); sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxWalker.generated.ts", walker, false); sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\scannerUtilities.generated.ts", scannerUtilities, false); sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxVisitor.generated.ts", visitor, false); -sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxUtilities.generated.ts", servicesUtilities, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\utilities.generated.ts", utilities, false); +//# sourceMappingURL=file:///C:/VSPro_1/src/typescript/public_cyrusn/src/services/syntax/SyntaxGenerator.js.map diff --git a/src/services/syntax/SyntaxGenerator.js.map b/src/services/syntax/SyntaxGenerator.js.map new file mode 100644 index 00000000000..31e4fdec065 --- /dev/null +++ b/src/services/syntax/SyntaxGenerator.js.map @@ -0,0 +1,5 @@ +<<<<<<< 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":"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"} +======= +{"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":"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"} +>>>>>>> Stashed changes diff --git a/src/services/syntax/incrementalParser.ts b/src/services/syntax/incrementalParser.ts index 306d21be319..c0d1d4aa0ed 100644 --- a/src/services/syntax/incrementalParser.ts +++ b/src/services/syntax/incrementalParser.ts @@ -235,7 +235,20 @@ module TypeScript.IncrementalParser { !_oldSourceUnitCursor.isFinished(); } - function updateTokens(nodeOrToken: ISyntaxNodeOrToken): void { + 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. + + if (isPastChangeRange()) { + token.setFullStart(absolutePosition()); + } + } + + 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 @@ -246,18 +259,13 @@ module TypeScript.IncrementalParser { if (isPastChangeRange()) { var position = absolutePosition(); - if (isToken(nodeOrToken)) { - (nodeOrToken).setFullStart(position); - } - else { - var tokens = getTokens(nodeOrToken); + var tokens = getTokens(node); - for (var i = 0, n = tokens.length; i < n; i++) { - var token = tokens[i]; - token.setFullStart(position); + for (var i = 0, n = tokens.length; i < n; i++) { + var token = tokens[i]; + token.setFullStart(position); - position += token.fullWidth(); - } + position += token.fullWidth(); } } } @@ -284,7 +292,7 @@ module TypeScript.IncrementalParser { var node = tryGetNodeFromOldSourceUnit(); if (node) { // Make sure the positions for the tokens in this node are correct. - updateTokens(node); + updateNodePosition(node); return node; } } @@ -298,7 +306,7 @@ module TypeScript.IncrementalParser { var token = tryGetTokenFromOldSourceUnit(); if (token) { // Make sure the token's position/text is correct. - updateTokens(token); + updateTokenPosition(token); return token; } } diff --git a/src/services/syntax/parser.ts b/src/services/syntax/parser.ts index 6f35b45428b..efa73c8164a 100644 --- a/src/services/syntax/parser.ts +++ b/src/services/syntax/parser.ts @@ -290,7 +290,7 @@ module TypeScript.Parser { //we should keep it simple so that it can be inlined. function eatToken(kind: SyntaxKind): ISyntaxToken { var token = currentToken(); - if (token.kind() === kind) { + if (token.kind === kind) { return consumeToken(token); } @@ -301,7 +301,7 @@ module TypeScript.Parser { // Eats the token if it is there. Otherwise does nothing. Will not report errors. function tryEatToken(kind: SyntaxKind): ISyntaxToken { var _currentToken = currentToken(); - if (_currentToken.kind() === kind) { + if (_currentToken.kind === kind) { return consumeToken(_currentToken); } @@ -313,7 +313,7 @@ module TypeScript.Parser { // on the state of the parser. For example, 'yield' is an identifier *unless* the parser // is in strict mode. function isIdentifier(token: ISyntaxToken): boolean { - var tokenKind = token.kind(); + var tokenKind = token.kind; if (tokenKind === SyntaxKind.IdentifierName) { return true; @@ -342,7 +342,7 @@ module TypeScript.Parser { var token = currentToken(); // If we have an identifier name, then consume and return it. - var tokenKind = token.kind(); + var tokenKind = token.kind; if (tokenKind === SyntaxKind.IdentifierName) { return consumeToken(token); } @@ -368,7 +368,7 @@ module TypeScript.Parser { if (isIdentifier(token)) { consumeToken(token); - if (token.kind() === SyntaxKind.IdentifierName) { + if (token.kind === SyntaxKind.IdentifierName) { return token; } @@ -398,7 +398,7 @@ module TypeScript.Parser { var token = currentToken(); // An automatic semicolon is always allowed if we're at the end of the file. - var tokenKind = token.kind(); + var tokenKind = token.kind; if (tokenKind === SyntaxKind.EndOfFileToken) { return true; } @@ -423,7 +423,7 @@ module TypeScript.Parser { function canEatExplicitOrAutomaticSemicolon(allowWithoutNewline: boolean): boolean { var token = currentToken(); - if (token.kind() === SyntaxKind.SemicolonToken) { + if (token.kind === SyntaxKind.SemicolonToken) { return true; } @@ -434,7 +434,7 @@ module TypeScript.Parser { var token = currentToken(); // If we see a semicolon, then we can definitely eat it. - if (token.kind() === SyntaxKind.SemicolonToken) { + if (token.kind === SyntaxKind.SemicolonToken) { return consumeToken(token); } @@ -474,9 +474,9 @@ module TypeScript.Parser { // They wanted an identifier. // If the user supplied a keyword, give them a specialized message. - if (actual && SyntaxFacts.isAnyKeyword(actual.kind())) { + if (actual && SyntaxFacts.isAnyKeyword(actual.kind)) { diagnosticCode = DiagnosticCode.Identifier_expected_0_is_a_keyword; - args = [SyntaxFacts.getText(actual.kind())]; + args = [SyntaxFacts.getText(actual.kind)]; } else { // Otherwise just report that an identifier was expected. @@ -608,7 +608,7 @@ module TypeScript.Parser { } function addSkippedTokensBeforeToken(token: ISyntaxToken, skippedTokens: ISyntaxToken[]): ISyntaxToken { - // Debug.assert(token.fullWidth() > 0 || token.kind() === SyntaxKind.EndOfFileToken); + // Debug.assert(token.fullWidth() > 0 || token.kind === SyntaxKind.EndOfFileToken); // Debug.assert(skippedTokens.length > 0); var leadingTrivia: ISyntaxTrivia[] = []; @@ -711,12 +711,16 @@ module TypeScript.Parser { return sourceUnit; } + function isDirectivePrologueElement(node: ISyntaxNodeOrToken): boolean { + return node.kind === SyntaxKind.ExpressionStatement && + (node).expression.kind === SyntaxKind.StringLiteral; + } + function updateStrictModeState(items: any[]): void { if (!isInStrictMode) { // Check if all the items are directive prologue elements. - for (var i = 0; i < items.length; i++) { - var item = items[i]; - if (!SyntaxFacts.isDirectivePrologueElement(item)) { + for (var i = 0, n = items.length; i < n; i++) { + if (!isDirectivePrologueElement(items[i])) { return; } } @@ -748,7 +752,7 @@ module TypeScript.Parser { if (_modifierCount) { // if we have modifiers, then these are definitely TS constructs and we can // immediately start parsing them. - switch (peekToken(_modifierCount).kind()) { + switch (peekToken(_modifierCount).kind) { case SyntaxKind.ImportKeyword: return parseImportDeclaration(); case SyntaxKind.ModuleKeyword: return parseModuleDeclaration(); case SyntaxKind.InterfaceKeyword: return parseInterfaceDeclaration(); @@ -764,10 +768,10 @@ module TypeScript.Parser { // consuming these, we only parse them out if we can see enough context to 'prove' that // they really do start the module element var nextToken = peekToken(1); - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { case SyntaxKind.ModuleKeyword: - if (isIdentifier(nextToken) || nextToken.kind() === SyntaxKind.StringLiteral) { + if (isIdentifier(nextToken) || nextToken.kind === SyntaxKind.StringLiteral) { return parseModuleDeclaration(); } break; @@ -799,7 +803,7 @@ module TypeScript.Parser { case SyntaxKind.ExportKeyword: // 'export' could be a modifier on a statement (like export var ...). So we // only want to parse out an export assignment here if we actually see the equals. - if (nextToken.kind() === SyntaxKind.EqualsToken) { + if (nextToken.kind === SyntaxKind.EqualsToken) { return parseExportAssignment(); } break; @@ -823,8 +827,8 @@ module TypeScript.Parser { } function isExternalModuleReference(): boolean { - return currentToken().kind() === SyntaxKind.RequireKeyword && - peekToken(1).kind() === SyntaxKind.OpenParenToken; + return currentToken().kind === SyntaxKind.RequireKeyword && + peekToken(1).kind === SyntaxKind.OpenParenToken; } function parseExternalModuleReference(): ExternalModuleReferenceSyntax { @@ -838,7 +842,7 @@ module TypeScript.Parser { function tryParseTypeArgumentList(inExpression: boolean): TypeArgumentListSyntax { var _currentToken = currentToken(); - if (_currentToken.kind() !== SyntaxKind.LessThanToken) { + if (_currentToken.kind !== SyntaxKind.LessThanToken) { return undefined; } @@ -871,7 +875,7 @@ module TypeScript.Parser { // We're in a context where '<' could be the start of a type argument list, or part // of an arithmetic expression. We'll presume it's the latter unless we see the '>' // and a following token that guarantees that it's supposed to be a type argument list. - if (greaterThanToken.fullWidth() === 0 || !canFollowTypeArgumentListInExpression(currentToken().kind())) { + if (greaterThanToken.fullWidth() === 0 || !canFollowTypeArgumentListInExpression(currentToken().kind)) { rewind(rewindPoint); releaseRewindPoint(rewindPoint); return undefined; @@ -943,7 +947,7 @@ module TypeScript.Parser { // 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 (SyntaxFacts.isAnyKeyword(_currentToken.kind()) && + if (SyntaxFacts.isAnyKeyword(_currentToken.kind) && previousTokenHasTrailingNewLine(_currentToken)) { var token1 = peekToken(1); @@ -967,7 +971,7 @@ module TypeScript.Parser { // Call eatIdentifierName to convert the token to an identifier if it is as keyword. var current: INameSyntax = eatIdentifierToken(); - while (shouldContinue && currentToken().kind() === SyntaxKind.DotToken) { + while (shouldContinue && currentToken().kind === SyntaxKind.DotToken) { var dotToken = consumeToken(currentToken()); var identifierName = eatRightSideOfName(allowIdentifierNames); @@ -997,11 +1001,11 @@ module TypeScript.Parser { function isEnumElement(inErrorRecovery: boolean): boolean { var node = currentNode(); - if (node && node.kind() === SyntaxKind.EnumElement) { + if (node && node.kind === SyntaxKind.EnumElement) { return true; } - return isPropertyName(currentToken(), inErrorRecovery); + return isPropertyName(/*peekToken:*/ 0, inErrorRecovery); } function tryParseEnumElementEqualsValueClause(): EqualsValueClauseSyntax { @@ -1010,16 +1014,16 @@ module TypeScript.Parser { function tryParseEnumElement(inErrorRecovery: boolean): EnumElementSyntax { var node = currentNode(); - if (node && node.kind() === SyntaxKind.EnumElement) { + if (node && node.kind === SyntaxKind.EnumElement) { consumeNode(node); return node; } - if (!isPropertyName(currentToken(), inErrorRecovery)) { + if (!isPropertyName(/*peekToken:*/ 0, inErrorRecovery)) { return undefined; } - return new EnumElementSyntax(parseNodeData, eatPropertyName(), tryParseEnumElementEqualsValueClause()); + return new EnumElementSyntax(parseNodeData, parsePropertyName(), tryParseEnumElementEqualsValueClause()); } function isModifierKind(kind: SyntaxKind): boolean { @@ -1037,13 +1041,13 @@ module TypeScript.Parser { } function isModifier(token: ISyntaxToken, index: number): boolean { - if (isModifierKind(token.kind())) { + if (isModifierKind(token.kind)) { // These are modifiers only if we see an actual keyword, identifier, string literal // or number following. // Note: we also allow [ for error conditions. // [ is for: static [a: number] var nextToken = peekToken(index + 1); - var nextTokenKind = nextToken.kind(); + var nextTokenKind = nextToken.kind; switch (nextTokenKind) { case SyntaxKind.IdentifierName: @@ -1121,19 +1125,19 @@ module TypeScript.Parser { } function isAccessor(modifierCount: number, inErrorRecovery: boolean): boolean { - var tokenKind = peekToken(modifierCount).kind(); + var tokenKind = peekToken(modifierCount).kind; if (tokenKind !== SyntaxKind.GetKeyword && tokenKind !== SyntaxKind.SetKeyword) { return false; } - return isPropertyName(peekToken(modifierCount + 1), inErrorRecovery); + return isPropertyName(/*peekIndex:*/ modifierCount + 1, inErrorRecovery); } - function parseAccessor(checkForStrictMode: boolean): ISyntaxNode { + function parseAccessor(checkForStrictMode: boolean): IAccessorSyntax { var modifiers = parseModifiers(); var _currenToken = currentToken(); - var tokenKind = _currenToken.kind(); + var tokenKind = _currenToken.kind; if (tokenKind === SyntaxKind.GetKeyword) { return parseGetMemberAccessorDeclaration(modifiers, _currenToken, checkForStrictMode); @@ -1148,14 +1152,14 @@ module TypeScript.Parser { function parseGetMemberAccessorDeclaration(modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, checkForStrictMode: boolean): GetAccessorSyntax { return new GetAccessorSyntax(parseNodeData, - modifiers, consumeToken(getKeyword), eatPropertyName(), + modifiers, consumeToken(getKeyword), parsePropertyName(), parseCallSignature(/*requireCompleteTypeParameterList:*/ false), parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, checkForStrictMode)); } function parseSetMemberAccessorDeclaration(modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, checkForStrictMode: boolean): SetAccessorSyntax { return new SetAccessorSyntax(parseNodeData, - modifiers, consumeToken(setKeyword), eatPropertyName(), + modifiers, consumeToken(setKeyword), parsePropertyName(), parseCallSignature(/*requireCompleteTypeParameterList:*/ false), parseBlock(/*parseStatementsEvenWithNoOpenBrace:*/ false, checkForStrictMode)); } @@ -1169,10 +1173,48 @@ module TypeScript.Parser { // checks for a subset of the conditions of the previous two calls. var _modifierCount = modifierCount(); return isConstructorDeclaration(_modifierCount) || - isMemberFunctionDeclaration(_modifierCount, inErrorRecovery) || isAccessor(_modifierCount, inErrorRecovery) || - isMemberVariableDeclaration(_modifierCount, inErrorRecovery) || - isIndexMemberDeclaration(_modifierCount); + isIndexMemberDeclaration(_modifierCount) || + isMemberVariableOrFunctionDeclaration(_modifierCount, inErrorRecovery); + } + + function isMemberVariableOrFunctionDeclaration(peekIndex: number, inErrorRecovery: boolean) { + // Check if its the start of a property or method. Both must start with a property name. + if (!isPropertyName(peekIndex, inErrorRecovery)) { + return false; + } + + if (!SyntaxFacts.isAnyKeyword(peekToken(peekIndex).kind)) { + // It wasn't a keyword. So this is definitely a member variable or function. + return true; + } + + // Keywords *can* technically start properties and methods. However, they often + // are actually intended to start a real ts/js construct. Only accept a keyword + // if it is definitely a property or method. + // keywords are also property names. Only accept a keyword as a property + // name if is of the form: + // public; + // public= + // public: + // public } + // public( + // public< + // public + // public + var nextToken = peekToken(peekIndex + 1); + switch (nextToken.kind) { + case SyntaxKind.SemicolonToken: + case SyntaxKind.EqualsToken: + case SyntaxKind.ColonToken: + case SyntaxKind.CloseBraceToken: + case SyntaxKind.OpenParenToken: + case SyntaxKind.LessThanToken: + case SyntaxKind.EndOfFileToken: + return true; + default: + return previousTokenHasTrailingNewLine(nextToken); + } } function tryParseClassElement(inErrorRecovery: boolean): IClassElementSyntax { @@ -1182,21 +1224,28 @@ module TypeScript.Parser { return node; } + // Have to check for indexers before anything else. That way if we see "[foo:" we + // parse it out as an indexer and not a member function or variable. var _modifierCount = modifierCount(); if (isConstructorDeclaration(_modifierCount)) { return parseConstructorDeclaration(); } - else if (isMemberFunctionDeclaration(_modifierCount, inErrorRecovery)) { - return parseMemberFunctionDeclaration(); + else if (isIndexMemberDeclaration(_modifierCount)) { + return parseIndexMemberDeclaration(); } else if (isAccessor(_modifierCount, inErrorRecovery)) { return parseAccessor(/*checkForStrictMode:*/ false); } - else if (isMemberVariableDeclaration(_modifierCount, inErrorRecovery)) { - return parseMemberVariableDeclaration(); - } - else if (isIndexMemberDeclaration(_modifierCount)) { - return parseIndexMemberDeclaration(); + else if (isMemberVariableOrFunctionDeclaration(/*peekIndex:*/ _modifierCount, inErrorRecovery)) { + var modifiers = parseModifiers(); + var propertyName = parsePropertyName(); + + if (isCallSignature(/*peekIndex:*/ 0)) { + return parseMemberFunctionDeclaration(modifiers, propertyName); + } + else { + return parseMemberVariableDeclaration(modifiers, propertyName); + } } else { return undefined; @@ -1208,7 +1257,7 @@ module TypeScript.Parser { // assume this is a constructor. That means, if a user writes "public constructor;" // it won't be viewed as a member. As a workaround, they can simply write: // public 'constructor'; - return peekToken(modifierCount).kind() === SyntaxKind.ConstructorKeyword; + return peekToken(modifierCount).kind === SyntaxKind.ConstructorKeyword; } function parseConstructorDeclaration(): ConstructorDeclarationSyntax { @@ -1229,13 +1278,7 @@ module TypeScript.Parser { return new ConstructorDeclarationSyntax(parseNodeData, modifiers, constructorKeyword, callSignature, block, semicolonToken); } - function isMemberFunctionDeclaration(modifierCount: number, inErrorRecovery: boolean): boolean { - return isPropertyName(peekToken(modifierCount), inErrorRecovery) && isCallSignature(modifierCount + 1); - } - - function parseMemberFunctionDeclaration(): MemberFunctionDeclarationSyntax { - var modifiers = parseModifiers(); - var propertyName = eatPropertyName(); + function parseMemberFunctionDeclaration(modifiers: ISyntaxToken[], propertyName: IPropertyNameSyntax): MemberFunctionDeclarationSyntax { var callSignature = parseCallSignature(/*requireCompleteTypeParameterList:*/ false); // If we got an errant => then we want to parse what's coming up without requiring an @@ -1255,42 +1298,13 @@ module TypeScript.Parser { return new MemberFunctionDeclarationSyntax(parseNodeData, modifiers, propertyName, callSignature, block, semicolon); } - function isDefinitelyMemberVariablePropertyName(index: number): boolean { - // keywords are also property names. Only accept a keyword as a property - // name if is of the form: - // public; - // public= - // public: - // public } - // public - // public - if (SyntaxFacts.isAnyKeyword(peekToken(index).kind())) { - var nextToken = peekToken(index + 1); - switch (nextToken.kind()) { - case SyntaxKind.SemicolonToken: - case SyntaxKind.EqualsToken: - case SyntaxKind.ColonToken: - case SyntaxKind.CloseBraceToken: - case SyntaxKind.EndOfFileToken: - return true; - default: - return previousTokenHasTrailingNewLine(nextToken); - } - } - else { - // If was a property name and not a keyword, then we're good to go. - return true; - } - } - - function isMemberVariableDeclaration(modifierCount: number, inErrorRecover: boolean): boolean { - return isPropertyName(peekToken(modifierCount), inErrorRecover) && isDefinitelyMemberVariablePropertyName(modifierCount); - } - - function parseMemberVariableDeclaration(): MemberVariableDeclarationSyntax { + function parseMemberVariableDeclaration(modifiers: ISyntaxToken[], propertyName: IPropertyNameSyntax): MemberVariableDeclarationSyntax { return new MemberVariableDeclarationSyntax(parseNodeData, - parseModifiers(), - tryParseVariableDeclarator(/*allowIn:*/ true, /*allowPropertyName:*/ true), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); + modifiers, + new VariableDeclaratorSyntax(parseNodeData, propertyName, + parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false), + isEqualsValueClause(/*inParameter*/ false) ? parseEqualsValueClause(/*allowIn:*/ true) : undefined), + eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)); } function isIndexMemberDeclaration(modifierCount: number): boolean { @@ -1305,7 +1319,7 @@ module TypeScript.Parser { function tryAddUnexpectedEqualsGreaterThanToken(callSignature: CallSignatureSyntax): boolean { var token0 = currentToken(); - var hasEqualsGreaterThanToken = token0.kind() === SyntaxKind.EqualsGreaterThanToken; + var hasEqualsGreaterThanToken = token0.kind === SyntaxKind.EqualsGreaterThanToken; if (hasEqualsGreaterThanToken) { // We can only do this if the call signature actually contains a final token that we // could add the => to. @@ -1331,7 +1345,7 @@ module TypeScript.Parser { } function isFunctionDeclaration(modifierCount: number): boolean { - return peekToken(modifierCount).kind() === SyntaxKind.FunctionKeyword; + return peekToken(modifierCount).kind === SyntaxKind.FunctionKeyword; } function parseFunctionDeclaration(): FunctionDeclarationSyntax { @@ -1365,7 +1379,7 @@ module TypeScript.Parser { var moduleName: INameSyntax = undefined; var stringLiteral: ISyntaxToken = undefined; - if (currentToken().kind() === SyntaxKind.StringLiteral) { + if (currentToken().kind === SyntaxKind.StringLiteral) { stringLiteral = eatToken(SyntaxKind.StringLiteral); } else { @@ -1425,8 +1439,36 @@ module TypeScript.Parser { return isCallSignature(/*tokenIndex:*/ 0) || isConstructSignature() || isIndexSignature(/*tokenIndex:*/ 0) || - isMethodSignature(inErrorRecovery) || - isPropertySignature(inErrorRecovery); + isMethodOrPropertySignature(inErrorRecovery); + } + + function isMethodOrPropertySignature(inErrorRecovery: boolean): boolean { + var _currentToken = currentToken(); + + // Keywords can start properties. However, they're often intended to start something + // else. If we see a modifier before something that can be a property, then don't + // try parse it out as a property. For example, if we have: + // + // public foo + // + // Then don't parse 'public' as a property name. Note: if you have: + // + // public + // foo + // + // Then we *should* parse it as a property name, as ASI takes effect here. + if (isModifier(_currentToken, /*index:*/ 0)) { + var token1 = peekToken(1); + if (!existsNewLineBetweenTokens(_currentToken, token1, source.text) && + isPropertyNameToken(token1, inErrorRecovery)) { + + return false; + } + } + + // Note: property names also start function signatures. So it's important that we call this + // after we calll isFunctionSignature. + return isPropertyName(/*peekIndex:*/ 0, inErrorRecovery); } function tryParseTypeMember(inErrorRecovery: boolean): ITypeMemberSyntax { @@ -1445,13 +1487,16 @@ module TypeScript.Parser { else if (isIndexSignature(/*tokenIndex:*/ 0)) { return parseIndexSignature(); } - else if (isMethodSignature(inErrorRecovery)) { - // Note: it is important that isFunctionSignature is called before isPropertySignature. - // isPropertySignature checks for a subset of isFunctionSignature. - return parseMethodSignature(); - } - else if (isPropertySignature(inErrorRecovery)) { - return parsePropertySignature(); + else if (isMethodOrPropertySignature(inErrorRecovery)) { + var propertyName = parsePropertyName(); + var questionToken = tryEatToken(SyntaxKind.QuestionToken); + + if (isCallSignature(/*peekIndex:*/ 0)) { + return parseMethodSignature(propertyName, questionToken); + } + else { + return parsePropertySignature(propertyName, questionToken); + } } else { return undefined; @@ -1473,23 +1518,23 @@ module TypeScript.Parser { openBracketToken, parameters, eatToken(SyntaxKind.CloseBracketToken), parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false)); } - function parseMethodSignature(): MethodSignatureSyntax { + function parseMethodSignature(propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken): MethodSignatureSyntax { return new MethodSignatureSyntax(parseNodeData, - eatPropertyName(), tryEatToken(SyntaxKind.QuestionToken), parseCallSignature(/*requireCompleteTypeParameterList:*/ false)); + propertyName, questionToken, parseCallSignature(/*requireCompleteTypeParameterList:*/ false)); } - function parsePropertySignature(): PropertySignatureSyntax { + function parsePropertySignature(propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken): PropertySignatureSyntax { return new PropertySignatureSyntax(parseNodeData, - eatPropertyName(), tryEatToken(SyntaxKind.QuestionToken), parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false)); + propertyName, questionToken, parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false)); } function isCallSignature(peekIndex: number): boolean { - var tokenKind = peekToken(peekIndex).kind(); + var tokenKind = peekToken(peekIndex).kind; return tokenKind === SyntaxKind.OpenParenToken || tokenKind === SyntaxKind.LessThanToken; } function isConstructSignature(): boolean { - if (currentToken().kind() !== SyntaxKind.NewKeyword) { + if (currentToken().kind !== SyntaxKind.NewKeyword) { return false; } @@ -1497,61 +1542,43 @@ module TypeScript.Parser { } function isIndexSignature(peekIndex: number): boolean { - return peekToken(peekIndex).kind() === SyntaxKind.OpenBracketToken; - } - - function isMethodSignature(inErrorRecovery: boolean): boolean { - if (isPropertyName(currentToken(), inErrorRecovery)) { - // id( - if (isCallSignature(1)) { + // In order to be considered an index signature, we need to see at least: + // + // [a: + // [... + // [a, + // [public a + // [] + // + // Otherwise, we will think that this is the start of a computed property name + // for a function or variable. + if (peekToken(peekIndex).kind === SyntaxKind.OpenBracketToken) { + var token1 = peekToken(peekIndex + 1); + if (token1.kind === SyntaxKind.DotDotDotToken || token1.kind === SyntaxKind.CloseBracketToken) { return true; } - - // id?( - if (peekToken(1).kind() === SyntaxKind.QuestionToken && - isCallSignature(2)) { - return true; + if (isIdentifier(token1)) { + var token2 = peekToken(peekIndex + 2); + if (token2.kind === SyntaxKind.ColonToken || token2.kind === SyntaxKind.CommaToken) { + return true; + } + } + if (token1.kind === SyntaxKind.PublicKeyword || token1.kind === SyntaxKind.PrivateKeyword) { + var token2 = peekToken(peekIndex + 2); + return isIdentifier(token2); } } return false; } - function isPropertySignature(inErrorRecovery: boolean): boolean { - var _currentToken = currentToken(); - - // Keywords can start properties. However, they're often intended to start something - // else. If we see a modifier before something that can be a property, then don't - // try parse it out as a property. For example, if we have: - // - // public foo - // - // Then don't parse 'public' as a property name. Note: if you have: - // - // public - // foo - // - // Then we *should* parse it as a property name, as ASI takes effect here. - if (isModifier(_currentToken, /*index:*/ 0)) { - if (!existsNewLineBetweenTokens(_currentToken, peekToken(1), source.text) && - isPropertyName(peekToken(1), inErrorRecovery)) { - - return false; - } - } - - // Note: property names also start function signatures. So it's important that we call this - // after we calll isFunctionSignature. - return isPropertyName(_currentToken, inErrorRecovery); - } - function isHeritageClause(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; return tokenKind === SyntaxKind.ExtendsKeyword || tokenKind === SyntaxKind.ImplementsKeyword; } function isNotHeritageClauseTypeName(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.ImplementsKeyword || tokenKind === SyntaxKind.ExtendsKeyword) { @@ -1573,7 +1600,7 @@ module TypeScript.Parser { function tryParseHeritageClause(): HeritageClauseSyntax { var extendsOrImplementsKeyword = currentToken(); - var tokenKind = extendsOrImplementsKeyword.kind(); + var tokenKind = extendsOrImplementsKeyword.kind; if (tokenKind !== SyntaxKind.ExtendsKeyword && tokenKind !== SyntaxKind.ImplementsKeyword) { return undefined; } @@ -1590,7 +1617,7 @@ module TypeScript.Parser { function isInterfaceEnumClassModuleImportOrExport(modifierCount: number, _currentToken?: ISyntaxToken): boolean { if (modifierCount) { // Any of these keywords following a modifier is definitely a TS construct. - switch (peekToken(modifierCount).kind()) { + switch (peekToken(modifierCount).kind) { case SyntaxKind.ImportKeyword: case SyntaxKind.ModuleKeyword: case SyntaxKind.InterfaceKeyword: @@ -1609,9 +1636,9 @@ module TypeScript.Parser { // make sure it really is the start of a module element. var nextToken = peekToken(1); - switch (_currentToken.kind()) { + switch (_currentToken.kind) { case SyntaxKind.ModuleKeyword: - return isIdentifier(nextToken) || nextToken.kind() === SyntaxKind.StringLiteral; + return isIdentifier(nextToken) || nextToken.kind === SyntaxKind.StringLiteral; case SyntaxKind.ImportKeyword: case SyntaxKind.ClassKeyword: @@ -1620,7 +1647,7 @@ module TypeScript.Parser { return isIdentifier(nextToken); case SyntaxKind.ExportKeyword: - return nextToken.kind() === SyntaxKind.EqualsToken; + return nextToken.kind === SyntaxKind.EqualsToken; } return false; @@ -1632,7 +1659,7 @@ module TypeScript.Parser { } var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { // ERROR RECOVERY case SyntaxKind.PublicKeyword: @@ -1697,7 +1724,7 @@ module TypeScript.Parser { } var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; return tryParseStatementWorker(_currentToken, currentTokenKind, modifierCount(), inErrorRecovery); } @@ -1777,7 +1804,7 @@ module TypeScript.Parser { } function isLabeledStatement(currentToken: ISyntaxToken): boolean { - return isIdentifier(currentToken) && peekToken(1).kind() === SyntaxKind.ColonToken; + return isIdentifier(currentToken) && peekToken(1).kind === SyntaxKind.ColonToken; } function parseLabeledStatement(identifierToken: ISyntaxToken): LabeledStatementSyntax { @@ -1794,14 +1821,14 @@ module TypeScript.Parser { listParsingState = savedListParsingState; var catchClause: CatchClauseSyntax = undefined; - if (currentToken().kind() === SyntaxKind.CatchKeyword) { + if (currentToken().kind === SyntaxKind.CatchKeyword) { catchClause = parseCatchClause(); } // If we don't have a catch clause, then we must have a finally clause. Try to parse // one out no matter what. var finallyClause: FinallyClauseSyntax = undefined; - if (!catchClause || currentToken().kind() === SyntaxKind.FinallyKeyword) { + if (!catchClause || currentToken().kind === SyntaxKind.FinallyKeyword) { finallyClause = parseFinallyClause(); } @@ -1849,7 +1876,7 @@ module TypeScript.Parser { return false; } - return currentToken.kind() === SyntaxKind.SemicolonToken; + return currentToken.kind === SyntaxKind.SemicolonToken; } function parseEmptyStatement(semicolonToken: ISyntaxToken): EmptyStatementSyntax { @@ -1863,7 +1890,7 @@ module TypeScript.Parser { var openParenToken = eatToken(SyntaxKind.OpenParenToken); var _currentToken = currentToken(); - var tokenKind = _currentToken.kind(); + var tokenKind = _currentToken.kind; if (tokenKind === SyntaxKind.VarKeyword) { // for ( var VariableDeclarationListNoIn; Expressionopt ; Expressionopt ) Statement // for ( var VariableDeclarationNoIn in Expression ) Statement @@ -1881,14 +1908,14 @@ module TypeScript.Parser { } function parseForOrForInStatementWithVariableDeclaration(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken): IStatementSyntax { - // Debug.assert(forKeyword.kind === SyntaxKind.ForKeyword && openParenToken.kind() === SyntaxKind.OpenParenToken); - // Debug.assert(currentToken().kind() === SyntaxKind.VarKeyword); + // Debug.assert(forKeyword.kind === SyntaxKind.ForKeyword && openParenToken.kind === SyntaxKind.OpenParenToken); + // Debug.assert(currentToken().kind === SyntaxKind.VarKeyword); // for ( var VariableDeclarationListNoIn; Expressionopt ; Expressionopt ) Statement // for ( var VariableDeclarationNoIn in Expression ) Statement var variableDeclaration = parseVariableDeclaration(/*allowIn:*/ false); - return currentToken().kind() === SyntaxKind.InKeyword + return currentToken().kind === SyntaxKind.InKeyword ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, undefined) : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, undefined); } @@ -1902,27 +1929,27 @@ module TypeScript.Parser { } function parseForOrForInStatementWithInitializer(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken): IStatementSyntax { - // Debug.assert(forKeyword.kind() === SyntaxKind.ForKeyword && openParenToken.kind() === SyntaxKind.OpenParenToken); + // Debug.assert(forKeyword.kind === SyntaxKind.ForKeyword && openParenToken.kind === SyntaxKind.OpenParenToken); // for ( ExpressionNoInopt; Expressionopt ; Expressionopt ) Statement // for ( LeftHandSideExpression in Expression ) Statement var initializer = parseExpression(/*allowIn:*/ false); - return currentToken().kind() === SyntaxKind.InKeyword + return currentToken().kind === SyntaxKind.InKeyword ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, undefined, initializer) : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, undefined, initializer); } function parseForStatementWithNoVariableDeclarationOrInitializer(forKeyword: ISyntaxToken, openParenToken: ISyntaxToken): ForStatementSyntax { - // Debug.assert(forKeyword.kind() === SyntaxKind.ForKeyword && openParenToken.kind() === SyntaxKind.OpenParenToken); - // Debug.assert(currentToken().kind() === SyntaxKind.SemicolonToken); + // Debug.assert(forKeyword.kind === SyntaxKind.ForKeyword && openParenToken.kind === SyntaxKind.OpenParenToken); + // Debug.assert(currentToken().kind === SyntaxKind.SemicolonToken); // for ( ; Expressionopt ; Expressionopt ) Statement return parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, /*variableDeclaration:*/ undefined, /*initializer:*/ undefined); } function tryParseForStatementCondition(): IExpressionSyntax { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind !== SyntaxKind.SemicolonToken && tokenKind !== SyntaxKind.CloseParenToken && tokenKind !== SyntaxKind.EndOfFileToken) { @@ -1933,7 +1960,7 @@ module TypeScript.Parser { } function tryParseForStatementIncrementor(): IExpressionSyntax { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind !== SyntaxKind.CloseParenToken && tokenKind !== SyntaxKind.EndOfFileToken) { return parseExpression(/*allowIn:*/ true); @@ -1982,7 +2009,17 @@ module TypeScript.Parser { consumeToken(switchKeyword); var openParenToken = eatToken(SyntaxKind.OpenParenToken); - var expression = parseExpression(/*allowIn:*/ true); + var expression: IExpressionSyntax; + + // if we have "switch {" + // then don't try to consume the { as the start of an expression. + if (openParenToken.fullWidth() === 0 && currentToken().kind === SyntaxKind.OpenBraceToken) { + expression = eatIdentifierToken(); + } + else { + expression = parseExpression(/*allowIn:*/ true); + } + var closeParenToken = eatToken(SyntaxKind.CloseParenToken); var openBraceToken = eatToken(SyntaxKind.OpenBraceToken); @@ -2001,7 +2038,7 @@ module TypeScript.Parser { return true; } - var currentTokenKind = currentToken().kind(); + var currentTokenKind = currentToken().kind; return currentTokenKind === SyntaxKind.CaseKeyword || currentTokenKind === SyntaxKind.DefaultKeyword; } @@ -2014,7 +2051,7 @@ module TypeScript.Parser { } var _currentToken = currentToken(); - var kind = _currentToken.kind(); + var kind = _currentToken.kind; if (kind === SyntaxKind.CaseKeyword) { return parseCaseSwitchClause(_currentToken); } @@ -2088,19 +2125,19 @@ module TypeScript.Parser { function isExpressionStatement(currentToken: ISyntaxToken): boolean { // As per the gramar, neither { nor 'function' can start an expression statement. - var tokenKind = currentToken.kind(); + var tokenKind = currentToken.kind; return tokenKind !== SyntaxKind.OpenBraceToken && tokenKind !== SyntaxKind.FunctionKeyword && isExpression(currentToken); } function isAssignmentOrOmittedExpression(): boolean { var _currentToken = currentToken(); - return _currentToken.kind() === SyntaxKind.CommaToken || isExpression(_currentToken); + return _currentToken.kind === SyntaxKind.CommaToken || isExpression(_currentToken); } function tryParseAssignmentOrOmittedExpression(): IExpressionSyntax { // Debug.assert(isAssignmentOrOmittedExpression()); - if (currentToken().kind() === SyntaxKind.CommaToken) { + if (currentToken().kind === SyntaxKind.CommaToken) { return new OmittedExpressionSyntax(parseNodeData); } @@ -2108,7 +2145,7 @@ module TypeScript.Parser { } function isExpression(currentToken: ISyntaxToken): boolean { - switch (currentToken.kind()) { + switch (currentToken.kind) { // Literals case SyntaxKind.NumericLiteral: case SyntaxKind.StringLiteral: @@ -2189,7 +2226,7 @@ module TypeScript.Parser { } function parseOptionalElseClause(): ElseClauseSyntax { - return currentToken().kind() === SyntaxKind.ElseKeyword ? parseElseClause() : undefined; + return currentToken().kind === SyntaxKind.ElseKeyword ? parseElseClause() : undefined; } function parseElseClause(): ElseClauseSyntax { @@ -2197,7 +2234,7 @@ module TypeScript.Parser { } function isVariableStatement(modifierCount: number): boolean { - return peekToken(modifierCount).kind() === SyntaxKind.VarKeyword; + return peekToken(modifierCount).kind === SyntaxKind.VarKeyword; } function parseVariableStatement(): VariableStatementSyntax { @@ -2206,7 +2243,7 @@ module TypeScript.Parser { } function parseVariableDeclaration(allowIn: boolean): VariableDeclarationSyntax { - // Debug.assert(currentToken().kind() === SyntaxKind.VarKeyword); + // Debug.assert(currentToken().kind === SyntaxKind.VarKeyword); var varKeyword = eatToken(SyntaxKind.VarKeyword); // Debug.assert(varKeyword.fullWidth() > 0); @@ -2224,7 +2261,7 @@ module TypeScript.Parser { function isVariableDeclarator(): boolean { var node = currentNode(); - if (node && node.kind() === SyntaxKind.VariableDeclarator) { + if (node && node.kind === SyntaxKind.VariableDeclarator) { return true; } @@ -2232,7 +2269,7 @@ module TypeScript.Parser { } function canReuseVariableDeclaratorNode(node: ISyntaxNode) { - if (!node || node.kind() !== SyntaxKind.VariableDeclarator) { + if (!node || node.kind !== SyntaxKind.VariableDeclarator) { return false; } @@ -2254,7 +2291,7 @@ module TypeScript.Parser { return variableDeclarator.equalsValueClause === undefined; } - function tryParseVariableDeclarator(allowIn: boolean, allowPropertyName: boolean): VariableDeclaratorSyntax { + function tryParseVariableDeclarator(allowIn: boolean): VariableDeclaratorSyntax { // TODO(cyrusn): What if the 'allowIn' context has changed between when we last parsed // and now? We could end up with an incorrect tree. For example, say we had in the old // tree "var i = a in b". Then, in the new tree the declarator portion moved into: @@ -2267,19 +2304,15 @@ module TypeScript.Parser { return node; } - if (allowPropertyName) { - // Debug.assert(isPropertyName(currentToken(), /*inErrorRecovery:*/ false)); - } - - if (!allowPropertyName && !isIdentifier(currentToken())) { + if (!isIdentifier(currentToken())) { return undefined; } - var propertyName = allowPropertyName ? eatPropertyName() : eatIdentifierToken(); + var propertyName = eatIdentifierToken(); var equalsValueClause: EqualsValueClauseSyntax = undefined; var typeAnnotation: TypeAnnotationSyntax = undefined; - if (propertyName.fullWidth() > 0) { + if (fullWidth(propertyName) > 0) { typeAnnotation = parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false); if (isEqualsValueClause(/*inParameter*/ false)) { @@ -2292,7 +2325,7 @@ module TypeScript.Parser { function isEqualsValueClause(inParameter: boolean): boolean { var token0 = currentToken(); - if (token0.kind() === SyntaxKind.EqualsToken) { + if (token0.kind === SyntaxKind.EqualsToken) { return true; } @@ -2300,7 +2333,7 @@ module TypeScript.Parser { // there is no newline after the last token and if we're on an expression. If so, parse // this as an equals-value clause with a missing equals. if (!previousTokenHasTrailingNewLine(token0)) { - var tokenKind = token0.kind(); + var tokenKind = token0.kind; // The 'isExpression' call below returns true for "=>". That's because it smartly // assumes that there is just a missing identifier and the user wanted a lambda. @@ -2340,7 +2373,7 @@ module TypeScript.Parser { var leftOperand = tryParseAssignmentExpressionOrHigher(/*force:*/ true, allowIn); while (true) { var _currentToken = currentToken(); - if (_currentToken.kind() !== SyntaxKind.CommaToken) { + if (_currentToken.kind !== SyntaxKind.CommaToken) { break; } @@ -2407,7 +2440,7 @@ module TypeScript.Parser { var operatorToken = currentOperatorToken(); // Check for recursive assignment expressions. - if (SyntaxFacts.isAssignmentOperatorToken(operatorToken.kind())) { + if (SyntaxFacts.isAssignmentOperatorToken(operatorToken.kind)) { return new BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), tryParseAssignmentExpressionOrHigher(/*force:*/ true, allowIn)); } @@ -2424,7 +2457,7 @@ module TypeScript.Parser { } function tryParseUnaryExpressionOrHigher(_currentToken: ISyntaxToken, force: boolean): IUnaryExpressionSyntax { - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { case SyntaxKind.PlusToken: @@ -2466,7 +2499,7 @@ module TypeScript.Parser { var _currentToken = currentToken(); // Now check for conditional expression. - if (_currentToken.kind() !== SyntaxKind.QuestionToken) { + if (_currentToken.kind !== SyntaxKind.QuestionToken) { return leftOperand; } @@ -2484,7 +2517,7 @@ module TypeScript.Parser { // currentOperatorToken versus currentToken here so that we merge token sequences // like > and = into >= var operatorToken = currentOperatorToken(); - var tokenKind = operatorToken.kind(); + var tokenKind = operatorToken.kind; // Only proceed if we see binary expression token. However we don't parse // assignment expressions or comma expressions here. Those are taken care of @@ -2526,7 +2559,7 @@ module TypeScript.Parser { // If we see a > we need to see if we can actually merge this contextually into a // >> >>> >= >>= >>>= token. - if (token0.kind() === SyntaxKind.GreaterThanToken) { + if (token0.kind === SyntaxKind.GreaterThanToken) { return currentContextualToken(); // var kind = token0.kind; //Debug.assert(kind() === SyntaxKind.GreaterThanToken || kind() === SyntaxKind.GreaterThanGreaterThanToken || @@ -2596,7 +2629,7 @@ module TypeScript.Parser { function parseCallExpressionRest(expression: ILeftHandSideExpressionSyntax): ILeftHandSideExpressionSyntax { while (true) { var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { case SyntaxKind.OpenParenToken: @@ -2637,7 +2670,7 @@ module TypeScript.Parser { function parseMemberExpressionRest(expression: IMemberExpressionSyntax, inObjectCreation: boolean): IMemberExpressionSyntax { while (true) { var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { case SyntaxKind.OpenBracketToken: @@ -2691,7 +2724,7 @@ module TypeScript.Parser { // CallExpression productions. var expression: ILeftHandSideExpressionSyntax = undefined; - if (_currentToken.kind() === SyntaxKind.SuperKeyword) { + if (_currentToken.kind === SyntaxKind.SuperKeyword) { expression = parseSuperExpression(_currentToken); } else { @@ -2711,7 +2744,7 @@ module TypeScript.Parser { // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var currentTokenKind = currentToken().kind(); + var currentTokenKind = currentToken().kind; return currentTokenKind === SyntaxKind.OpenParenToken || currentTokenKind === SyntaxKind.DotToken ? expression : new MemberAccessExpressionSyntax(parseNodeData, expression, eatToken(SyntaxKind.DotToken), eatIdentifierNameToken()); @@ -2724,7 +2757,7 @@ module TypeScript.Parser { } var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { case SyntaxKind.PlusPlusToken: @@ -2742,14 +2775,14 @@ module TypeScript.Parser { } function tryParseGenericArgumentList(): ArgumentListSyntax { - // Debug.assert(currentToken().kind() === SyntaxKind.LessThanToken); + // Debug.assert(currentToken().kind === SyntaxKind.LessThanToken); // If we have a '<', then only parse this as a arugment list if the type arguments // are complete and we have an open paren. if we don't, rewind and return nothing. var rewindPoint = getRewindPoint(); var typeArgumentList = tryParseTypeArgumentList(/*inExpression:*/ true); var token0 = currentToken(); - var tokenKind = token0.kind(); + var tokenKind = token0.kind; var isOpenParen = tokenKind === SyntaxKind.OpenParenToken; var isDot = tokenKind === SyntaxKind.DotToken; @@ -2787,7 +2820,7 @@ module TypeScript.Parser { } function tryParseArgumentList(): ArgumentListSyntax { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.LessThanToken) { return tryParseGenericArgumentList(); } @@ -2822,14 +2855,14 @@ module TypeScript.Parser { // after the open paren, we still want to force parsing an expression (which will // cause a missing identiifer to be created), so that we will then consume the // comma and the following list items). - var force = currentToken().kind() === SyntaxKind.CommaToken; + var force = currentToken().kind === SyntaxKind.CommaToken; return tryParseAssignmentExpressionOrHigher(force, /*allowIn:*/ true); } function parseElementAccessArgumentExpression(openBracketToken: ISyntaxToken, inObjectCreation: boolean) { // 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) { + if (inObjectCreation && currentToken().kind === SyntaxKind.CloseBracketToken) { var errorStart = start(openBracketToken, source.text); var errorEnd = end(currentToken(), source.text); var diagnostic = new Diagnostic(fileName, source.text.lineMap(), errorStart, errorEnd - errorStart, @@ -2844,7 +2877,7 @@ module TypeScript.Parser { } function parseElementAccessExpression(expression: ILeftHandSideExpressionSyntax, openBracketToken: ISyntaxToken, inObjectCreation: boolean): ElementAccessExpressionSyntax { - // Debug.assert(currentToken().kind() === SyntaxKind.OpenBracketToken); + // Debug.assert(currentToken().kind === SyntaxKind.OpenBracketToken); return new ElementAccessExpressionSyntax(parseNodeData, expression, consumeToken(openBracketToken), parseElementAccessArgumentExpression(openBracketToken, inObjectCreation), eatToken(SyntaxKind.CloseBracketToken)); } @@ -2854,7 +2887,7 @@ module TypeScript.Parser { return eatIdentifierToken(); } - var currentTokenKind = _currentToken.kind(); + var currentTokenKind = _currentToken.kind; switch (currentTokenKind) { case SyntaxKind.ThisKeyword: case SyntaxKind.TrueKeyword: @@ -2901,7 +2934,7 @@ module TypeScript.Parser { // contexts. // var currentToken = this.currentToken(); - // Debug.assert(SyntaxFacts.isAnyDivideToken(currentToken.kind())); + // Debug.assert(SyntaxFacts.isAnyDivideToken(currentToken.kind)); // Ok, from our quick lexical check, this could be a place where a regular expression could // go. Now we have to do a bunch of work. Ask the source to retrive the token at the @@ -2910,9 +2943,9 @@ module TypeScript.Parser { // Note: we *must* have gotten a /, /= or regular expression. Or else something went *very* // wrong with our logic above. - // Debug.assert(SyntaxFacts.isAnyDivideOrRegularExpressionToken(currentToken.kind())); + // Debug.assert(SyntaxFacts.isAnyDivideOrRegularExpressionToken(currentToken.kind)); - var tokenKind = 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; @@ -2963,7 +2996,7 @@ module TypeScript.Parser { function parseTemplateExpression(startToken: ISyntaxToken): IPrimaryExpressionSyntax { consumeToken(startToken); - if (startToken.kind() === SyntaxKind.NoSubstitutionTemplateToken) { + if (startToken.kind === SyntaxKind.NoSubstitutionTemplateToken) { return startToken; } @@ -2974,7 +3007,7 @@ module TypeScript.Parser { // middle pieces. templateClauses.push(parseTemplateClause()); } - while (templateClauses[templateClauses.length - 1].templateMiddleOrEndToken.kind() === SyntaxKind.TemplateMiddleToken); + while (templateClauses[templateClauses.length - 1].templateMiddleOrEndToken.kind === SyntaxKind.TemplateMiddleToken); return new TemplateExpressionSyntax(parseNodeData, startToken, Syntax.list(templateClauses)); } @@ -2983,9 +3016,9 @@ module TypeScript.Parser { var expression = parseExpression(/*allowIn:*/ true); var token = currentToken(); - if (token.kind() === SyntaxKind.CloseBraceToken) { + if (token.kind === SyntaxKind.CloseBraceToken) { token = currentContextualToken(); - Debug.assert(token.kind() === SyntaxKind.TemplateMiddleToken || token.kind() === SyntaxKind.TemplateEndToken); + Debug.assert(token.kind === SyntaxKind.TemplateMiddleToken || token.kind === SyntaxKind.TemplateEndToken); consumeToken(token); } else { @@ -3008,7 +3041,7 @@ module TypeScript.Parser { } function tryParseParenthesizedArrowFunctionExpression(): ParenthesizedArrowFunctionExpressionSyntax { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind !== SyntaxKind.OpenParenToken && tokenKind !== SyntaxKind.LessThanToken) { return undefined; } @@ -3048,11 +3081,11 @@ module TypeScript.Parser { function tryParseParenthesizedArrowFunctionExpressionWorker(requireArrow: boolean): ParenthesizedArrowFunctionExpressionSyntax { var _currentToken = currentToken(); - // Debug.assert(currentToken.kind() === SyntaxKind.OpenParenToken || currentToken.kind() === SyntaxKind.LessThanToken); + // Debug.assert(currentToken.kind === SyntaxKind.OpenParenToken || currentToken.kind === SyntaxKind.LessThanToken); var callSignature = parseCallSignature(/*requireCompleteTypeParameterList:*/ true); - if (requireArrow && currentToken().kind() !== SyntaxKind.EqualsGreaterThanToken) { + if (requireArrow && currentToken().kind !== SyntaxKind.EqualsGreaterThanToken) { return undefined; } @@ -3100,12 +3133,12 @@ module TypeScript.Parser { // ERROR RECOVERY TWEAK: // If we see a standalone => try to parse it as an arrow function as that's likely what // the user intended to write. - if (_currentToken.kind() === SyntaxKind.EqualsGreaterThanToken) { + if (_currentToken.kind === SyntaxKind.EqualsGreaterThanToken) { return true; } return isIdentifier(_currentToken) && - peekToken(1).kind() === SyntaxKind.EqualsGreaterThanToken; + peekToken(1).kind === SyntaxKind.EqualsGreaterThanToken; } function parseSimpleArrowFunctionExpression(): SimpleArrowFunctionExpressionSyntax { @@ -3124,19 +3157,19 @@ module TypeScript.Parser { } function isBlock(): boolean { - return currentToken().kind() === SyntaxKind.OpenBraceToken; + return currentToken().kind === SyntaxKind.OpenBraceToken; } function isDefinitelyArrowFunctionExpression(): boolean { var token0 = currentToken(); - if (token0.kind() !== SyntaxKind.OpenParenToken) { + if (token0.kind !== SyntaxKind.OpenParenToken) { // If it didn't start with an (, then it could be generic. That's too complicated // and we can't say it's 'definitely' an arrow function. return false; } var token1 = peekToken(1); - var token1Kind = token1.kind(); + var token1Kind = token1.kind; var token2: ISyntaxToken; @@ -3149,7 +3182,7 @@ module TypeScript.Parser { // "():" or "() =>" or "() {}". Note: the last one is illegal. However it // most likely is a missing => and not a parenthesized expression. token2 = peekToken(2); - var token2Kind = token2.kind(); + var token2Kind = token2.kind; return token2Kind === SyntaxKind.ColonToken || token2Kind === SyntaxKind.EqualsGreaterThanToken || token2Kind === SyntaxKind.OpenBraceToken; @@ -3162,7 +3195,7 @@ module TypeScript.Parser { } token2 = peekToken(2); - token2Kind = token2.kind(); + token2Kind = token2.kind; if (SyntaxFacts.isAccessibilityModifier(token1Kind)) { if (isIdentifier(token2)) { @@ -3191,7 +3224,7 @@ module TypeScript.Parser { } var token3 = peekToken(3); - var token3Kind = token3.kind(); + var token3Kind = token3.kind; if (token2Kind === SyntaxKind.QuestionToken) { // (id? // Could be an arrow function, or a parenthesized conditional expression. @@ -3234,7 +3267,7 @@ module TypeScript.Parser { function isPossiblyArrowFunctionExpression(): boolean { var token0 = currentToken(); - if (token0.kind() !== SyntaxKind.OpenParenToken) { + if (token0.kind !== SyntaxKind.OpenParenToken) { // If it didn't start with an (, then it could be generic. That's too complicated // and we have to say it's possibly an arrow function. return true; @@ -3249,7 +3282,7 @@ module TypeScript.Parser { } var token2 = peekToken(2); - var token2Kind = token2.kind(); + var token2Kind = token2.kind; if (token2Kind === SyntaxKind.EqualsToken) { // (id = // @@ -3272,7 +3305,7 @@ module TypeScript.Parser { // (id) var token3 = peekToken(3); - if (token3.kind() === SyntaxKind.ColonToken) { + if (token3.kind === SyntaxKind.ColonToken) { // (id): // // This could be an arrow function. i.e. (id): number => { } @@ -3287,7 +3320,7 @@ module TypeScript.Parser { } function parseObjectLiteralExpression(openBraceToken: ISyntaxToken): ObjectLiteralExpressionSyntax { - // Debug.assert(currentToken().kind() === SyntaxKind.OpenBraceToken); + // Debug.assert(currentToken().kind === SyntaxKind.OpenBraceToken); consumeToken(openBraceToken); // Debug.assert(openBraceToken.fullWidth() > 0); @@ -3305,51 +3338,73 @@ module TypeScript.Parser { if (isAccessor(modifierCount(), inErrorRecovery)) { return parseAccessor(/*checkForStrictMode:*/ true); } - else if (isFunctionPropertyAssignment(inErrorRecovery)) { - return parseFunctionPropertyAssignment(); + + // Note: we don't want to call parsePropertyName here yet as it will convert a keyword + // to an identifier name. We don't want to do that yet as a keyword is not legal as a + // shorthand property assignment. + + var _currentToken = currentToken(); + if (isIdentifier(_currentToken)) { + var token1 = peekToken(1); + if (token1.kind !== SyntaxKind.ColonToken && + token1.kind !== SyntaxKind.OpenParenToken && + token1.kind !== SyntaxKind.LessThanToken) { + + // If we don't have one of: + // + // id: + // id( + // id< + // + // then this is a shorthand property assignment. Just return the identifier + // token as is. + return consumeToken(_currentToken); + } } - else if (isSimplePropertyAssignment(inErrorRecovery)) { - return parseSimplePropertyAssignment(); - } - else { - return undefined; + + // All the rest of the property assignments start with property names. They are: + // id: e + // [e1]: e2 + // id() { } + // [e]() { } + if (isPropertyName(/*peekIndex:*/ 0, inErrorRecovery)) { + var propertyName = parsePropertyName(); + + if (isCallSignature(/*peekIndex:*/ 0)) { + return parseFunctionPropertyAssignment(propertyName); + } + else { + // If we didn't have an identifier, then we must have gotten a keyword or a + // literal. Neither of these are allowed in a shorthand property, so this must + // be a simple property assignment. + // + // 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, + propertyName, eatToken(SyntaxKind.ColonToken), tryParseAssignmentExpressionOrHigher(/*force:*/ true, /*allowIn:*/ true)); + } } + + return undefined; } function isPropertyAssignment(inErrorRecovery: boolean): boolean { return isAccessor(modifierCount(), inErrorRecovery) || - isFunctionPropertyAssignment(inErrorRecovery) || - isSimplePropertyAssignment(inErrorRecovery); + isPropertyName(/*peekIndex:*/ 0, inErrorRecovery); } - function eatPropertyName(): ISyntaxToken { - var _currentToken = currentToken(); - return SyntaxFacts.isIdentifierNameOrAnyKeyword(_currentToken) - ? eatIdentifierNameToken() - : consumeToken(_currentToken); + function isPropertyName(peekIndex: number, inErrorRecovery: boolean): boolean { + var token = peekToken(peekIndex); + if (token.kind === SyntaxKind.OpenBracketToken) { + // A '[' only starts a property name as long as we're sure it doesn't start an + // index signature. + return !isIndexSignature(peekIndex); + } + + return isPropertyNameToken(token, inErrorRecovery); } - function isFunctionPropertyAssignment(inErrorRecovery: boolean): boolean { - return isPropertyName(currentToken(), inErrorRecovery) && - isCallSignature(/*peekIndex:*/ 1); - } - - function parseFunctionPropertyAssignment(): FunctionPropertyAssignmentSyntax { - return new FunctionPropertyAssignmentSyntax(parseNodeData, - eatPropertyName(), parseCallSignature(/*requireCompleteTypeParameterList:*/ false), - parseBlock(/*parseBlockEvenWithNoOpenBrace:*/ false, /*checkForStrictMode:*/ true)); - } - - function isSimplePropertyAssignment(inErrorRecovery: boolean): boolean { - return isPropertyName(currentToken(), inErrorRecovery); - } - - function parseSimplePropertyAssignment(): SimplePropertyAssignmentSyntax { - return new SimplePropertyAssignmentSyntax(parseNodeData, - eatPropertyName(), eatToken(SyntaxKind.ColonToken), tryParseAssignmentExpressionOrHigher(/*force:*/ true, /*allowIn:*/ true)); - } - - function isPropertyName(token: ISyntaxToken, inErrorRecovery: boolean): boolean { + function isPropertyNameToken(token: ISyntaxToken, inErrorRecovery: boolean): boolean { // NOTE: we do *not* want to check "isIdentifier" here. Any IdentifierName is // allowed here, even reserved words like keywords. if (SyntaxFacts.isIdentifierNameOrAnyKeyword(token)) { @@ -3368,14 +3423,44 @@ module TypeScript.Parser { } } + return isLiteralPropertyName(token); + } + + function isLiteralPropertyName(token: ISyntaxToken): boolean { // We allow a template literal while parser for error tolerance. We'll report errors // on this later in the grammar checker walker. - var kind = token.kind(); + var kind = token.kind; return kind === SyntaxKind.StringLiteral || kind === SyntaxKind.NumericLiteral || kind === SyntaxKind.NoSubstitutionTemplateToken; } + function parsePropertyName(): IPropertyNameSyntax { + var _currentToken = currentToken(); + if (_currentToken.kind === SyntaxKind.OpenBracketToken) { + return parseComputedPropertyName(_currentToken); + } + else if (SyntaxFacts.isIdentifierNameOrAnyKeyword(_currentToken)) { + // If it was a keyword, convert it to an identifier name. + return eatIdentifierNameToken(); + } + else { + // Must have been a literal. + return consumeToken(_currentToken); + } + } + + function parseComputedPropertyName(openBracketToken: ISyntaxToken): ComputedPropertyNameSyntax { + return new ComputedPropertyNameSyntax(parseNodeData, + consumeToken(openBracketToken), tryParseAssignmentExpressionOrHigher(/*force:*/ true, /*allowIn:*/ true), eatToken(SyntaxKind.CloseBracketToken)); + } + + function parseFunctionPropertyAssignment(propertyName: IPropertyNameSyntax): FunctionPropertyAssignmentSyntax { + return new FunctionPropertyAssignmentSyntax(parseNodeData, + propertyName, parseCallSignature(/*requireCompleteTypeParameterList:*/ false), + parseBlock(/*parseBlockEvenWithNoOpenBrace:*/ false, /*checkForStrictMode:*/ true)); + } + function parseArrayLiteralExpression(openBracketToken: ISyntaxToken): ArrayLiteralExpressionSyntax { - // Debug.assert(currentToken().kind() === SyntaxKind.OpenBracketToken); + // Debug.assert(currentToken().kind === SyntaxKind.OpenBracketToken); consumeToken(openBracketToken); // Debug.assert(openBracketToken.fullWidth() > 0); @@ -3411,7 +3496,7 @@ module TypeScript.Parser { function tryParseTypeParameterList(requireCompleteTypeParameterList: boolean): TypeParameterListSyntax { var _currentToken = currentToken(); - if (_currentToken.kind() !== SyntaxKind.LessThanToken) { + if (_currentToken.kind !== SyntaxKind.LessThanToken) { return undefined; } @@ -3451,7 +3536,7 @@ module TypeScript.Parser { } function tryParseConstraint(): ConstraintSyntax { - if (currentToken().kind() !== SyntaxKind.ExtendsKeyword) { + if (currentToken().kind !== SyntaxKind.ExtendsKeyword) { return undefined; } @@ -3459,10 +3544,10 @@ module TypeScript.Parser { } function tryParseParameterList(): ParameterListSyntax { - if (currentToken().kind() === SyntaxKind.OpenParenToken) { + if (currentToken().kind === SyntaxKind.OpenParenToken) { var token1 = peekToken(1); - if (token1.kind() === SyntaxKind.CloseParenToken || isParameterHelper(token1)) { + if (token1.kind === SyntaxKind.CloseParenToken || isParameterHelper(token1)) { return parseParameterList(); } } @@ -3484,13 +3569,13 @@ module TypeScript.Parser { } function parseOptionalTypeAnnotation(allowStringLiteral: boolean): TypeAnnotationSyntax { - return currentToken().kind() === SyntaxKind.ColonToken ? parseTypeAnnotation(allowStringLiteral) : undefined; + return currentToken().kind === SyntaxKind.ColonToken ? parseTypeAnnotation(allowStringLiteral) : undefined; } function parseTypeAnnotationType(allowStringLiteral: boolean): ITypeSyntax { if (allowStringLiteral) { var _currentToken = currentToken(); - if (_currentToken.kind() === SyntaxKind.StringLiteral) { + if (_currentToken.kind === SyntaxKind.StringLiteral) { return consumeToken(_currentToken); } } @@ -3505,7 +3590,7 @@ module TypeScript.Parser { function isType(): boolean { var _currentToken = currentToken(); - switch (_currentToken.kind()) { + switch (_currentToken.kind) { case SyntaxKind.TypeOfKeyword: case SyntaxKind.AnyKeyword: case SyntaxKind.NumberKeyword: @@ -3553,7 +3638,7 @@ module TypeScript.Parser { return parseFunctionType(); } - if (currentToken().kind() === SyntaxKind.NewKeyword) { + if (currentToken().kind === SyntaxKind.NewKeyword) { return parseConstructorType(); } @@ -3565,7 +3650,7 @@ module TypeScript.Parser { if (type) { var barToken: ISyntaxToken; - while ((barToken = currentToken()).kind() === SyntaxKind.BarToken) { + while ((barToken = currentToken()).kind === SyntaxKind.BarToken) { consumeToken(barToken); var right = parsePrimaryType(); @@ -3593,7 +3678,7 @@ module TypeScript.Parser { var _currentToken = currentToken(); if (previousTokenHasTrailingNewLine(_currentToken) || - _currentToken.kind() !== SyntaxKind.OpenBracketToken) { + _currentToken.kind !== SyntaxKind.OpenBracketToken) { break; } @@ -3609,14 +3694,14 @@ module TypeScript.Parser { function tryParseNonArrayType(): ITypeSyntax { var _currentToken = currentToken(); - switch (_currentToken.kind()) { + switch (_currentToken.kind) { case SyntaxKind.AnyKeyword: case SyntaxKind.NumberKeyword: case SyntaxKind.BooleanKeyword: case SyntaxKind.StringKeyword: // if any of these are followed by '.', then this is actually a module name, // and these keywords will be reinterpreted as an identifier. - if (peekToken(1).kind() === SyntaxKind.DotToken) { + if (peekToken(1).kind === SyntaxKind.DotToken) { break; } @@ -3657,7 +3742,7 @@ module TypeScript.Parser { function isFunctionType(): boolean { var token0 = currentToken(); - var token0Kind = token0.kind(); + var token0Kind = token0.kind; // If we see a < then we consider ourselves to be definitely in a (generic) function type. if (token0Kind === SyntaxKind.LessThanToken) { @@ -3671,7 +3756,7 @@ module TypeScript.Parser { // parenthesized type. if (token0Kind === SyntaxKind.OpenParenToken) { var token1 = peekToken(1); - var token1Kind = token1.kind(); + var token1Kind = token1.kind; if (token1Kind === SyntaxKind.CloseParenToken || token1Kind === SyntaxKind.DotDotDotToken) { // () @@ -3686,7 +3771,7 @@ module TypeScript.Parser { // could be a function type or a parenthesized type. var token2 = peekToken(2); - var token2Kind = token2.kind(); + var token2Kind = token2.kind; if (token2Kind === SyntaxKind.ColonToken || token2Kind === SyntaxKind.CommaToken || @@ -3708,7 +3793,7 @@ module TypeScript.Parser { // ( id ) // // Only a function type if we see an arrow following it. - return peekToken(3).kind() === SyntaxKind.EqualsGreaterThanToken; + return peekToken(3).kind === SyntaxKind.EqualsGreaterThanToken; } } } @@ -3732,7 +3817,7 @@ module TypeScript.Parser { } function isParameter(): boolean { - if (currentNode() && currentNode().kind() === SyntaxKind.Parameter) { + if (currentNode() && currentNode().kind === SyntaxKind.Parameter) { return true; } @@ -3740,7 +3825,7 @@ module TypeScript.Parser { } function isParameterHelper(token: ISyntaxToken): boolean { - var tokenKind = token.kind(); + var tokenKind = token.kind; return tokenKind === SyntaxKind.DotDotDotToken || isModifierKind(tokenKind) || isIdentifier(token); @@ -3754,7 +3839,7 @@ module TypeScript.Parser { function tryParseParameter(): ParameterSyntax { var node = currentNode(); - if (node && node.kind() === SyntaxKind.Parameter) { + if (node && node.kind === SyntaxKind.Parameter) { consumeNode(node); return node; } @@ -3770,7 +3855,7 @@ module TypeScript.Parser { // If we see a modifier alone in a parameter list, like: foo(static) // // then treat it like modifier, and continue parsing the parameter. - if (isModifierKind(_currentToken.kind())) { + if (isModifierKind(_currentToken.kind)) { modifiers = Syntax.list([consumeToken(_currentToken)]); } else { @@ -3864,7 +3949,7 @@ module TypeScript.Parser { } function tryParseExpectedListItem( - currentListType: ListParsingState, inErrorRecovery: boolean, items: ISyntaxElement[], processItems: (items: any[]) => void): boolean { + currentListType: ListParsingState, inErrorRecovery: boolean, items: ISyntaxNodeOrToken[], processItems: (items: ISyntaxNodeOrToken[]) => void): boolean { var item = tryParseExpectedListItemWorker(currentListType, inErrorRecovery); if (item === undefined) { @@ -3883,10 +3968,10 @@ module TypeScript.Parser { function listIsTerminated(currentListType: ListParsingState): boolean { return isExpectedListTerminator(currentListType) || - currentToken().kind() === SyntaxKind.EndOfFileToken; + currentToken().kind === SyntaxKind.EndOfFileToken; } - function parseSyntaxListWorker(currentListType: ListParsingState, skippedTokens: ISyntaxToken[], processItems: (items: any[]) => void ): T[] { + function parseSyntaxListWorker(currentListType: ListParsingState, skippedTokens: ISyntaxToken[], processItems: (items: ISyntaxNodeOrToken[]) => void ): T[] { var items: T[] = []; while (true) { @@ -3973,7 +4058,7 @@ module TypeScript.Parser { // allow 'comma' as a separator (for error tolerance). We will later do a post pass // to report when a comma was used improperly in a list that needed semicolons. var _currentToken = currentToken(); - var tokenKind = _currentToken.kind(); + var tokenKind = _currentToken.kind; if (tokenKind === _separatorKind || tokenKind === SyntaxKind.CommaToken) { // Consume the last separator and continue parsing list elements. nodesAndSeparators.push(consumeToken(_currentToken)); @@ -4081,32 +4166,32 @@ module TypeScript.Parser { } function isExpectedSourceUnit_ModuleElementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.EndOfFileToken; + return currentToken().kind === SyntaxKind.EndOfFileToken; } function isExpectedEnumDeclaration_EnumElementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedModuleDeclaration_ModuleElementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedObjectType_TypeMembersTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedObjectLiteralExpression_PropertyAssignmentsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedLiteralExpression_AssignmentExpressionsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBracketToken; + return currentToken().kind === SyntaxKind.CloseBracketToken; } function isExpectedTypeArgumentList_TypesTerminator(): boolean { var token = currentToken(); - var tokenKind = token.kind(); + var tokenKind = token.kind; if (tokenKind === SyntaxKind.GreaterThanToken) { return true; } @@ -4123,7 +4208,7 @@ module TypeScript.Parser { function isExpectedTupleType_TypesTerminator(): boolean { var token = currentToken(); - var tokenKind = token.kind(); + var tokenKind = token.kind; if (tokenKind === SyntaxKind.CloseBracketToken) { return true; } @@ -4133,7 +4218,7 @@ module TypeScript.Parser { } function isExpectedTypeParameterList_TypeParametersTerminator(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.GreaterThanToken) { return true; } @@ -4151,7 +4236,7 @@ module TypeScript.Parser { } function isExpectedParameterList_ParametersTerminator(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.CloseParenToken) { return true; } @@ -4172,7 +4257,7 @@ module TypeScript.Parser { } function isExpectedIndexSignature_ParametersTerminator() { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.CloseBracketToken) { return true; } @@ -4188,7 +4273,7 @@ module TypeScript.Parser { function isExpectedVariableDeclaration_VariableDeclarators_DisallowInTerminator(): boolean { // This is the case when we're parsing variable declarations in a for/for-in statement. - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.SemicolonToken || tokenKind === SyntaxKind.CloseParenToken) { @@ -4209,7 +4294,7 @@ module TypeScript.Parser { // For better error recovery, if we see a => then we just stop immediately. We've got an // arrow function here and it's going to be very unlikely that we'll resynchronize and get // another variable declaration. - if (currentToken().kind() === SyntaxKind.EqualsGreaterThanToken) { + if (currentToken().kind === SyntaxKind.EqualsGreaterThanToken) { return true; } @@ -4218,7 +4303,7 @@ module TypeScript.Parser { } function isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.OpenBraceToken || tokenKind === SyntaxKind.CloseBraceToken) { return true; } @@ -4227,7 +4312,7 @@ module TypeScript.Parser { } function isExpectedHeritageClause_TypeNameListTerminator(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; if (tokenKind === SyntaxKind.ExtendsKeyword || tokenKind === SyntaxKind.ImplementsKeyword) { return true; } @@ -4241,36 +4326,36 @@ module TypeScript.Parser { function isExpectedArgumentList_AssignmentExpressionsTerminator(): boolean { var token0 = currentToken(); - var tokenKind = token0.kind(); + var tokenKind = token0.kind; return tokenKind === SyntaxKind.CloseParenToken || tokenKind === SyntaxKind.SemicolonToken; } function isExpectedClassDeclaration_ClassElementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedSwitchStatement_SwitchClausesTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedSwitchClause_StatementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken || + return currentToken().kind === SyntaxKind.CloseBraceToken || isSwitchClause(); } function isExpectedBlock_StatementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.CloseBraceToken; + return currentToken().kind === SyntaxKind.CloseBraceToken; } function isExpectedTryBlock_StatementsTerminator(): boolean { - var tokenKind = currentToken().kind(); + var tokenKind = currentToken().kind; return tokenKind === SyntaxKind.CatchKeyword || tokenKind === SyntaxKind.FinallyKeyword; } function isExpectedCatchBlock_StatementsTerminator(): boolean { - return currentToken().kind() === SyntaxKind.FinallyKeyword; + return currentToken().kind === SyntaxKind.FinallyKeyword; } function isExpectedListItem(currentListType: ListParsingState, inErrorRecovery: boolean): any { @@ -4314,7 +4399,7 @@ module TypeScript.Parser { // If we're on a comma then the user has written something like "Foo(a,," or "Foo(,". // Instead of skipping the comma, create an empty expression to go before the comma // so that the tree is more well formed and doesn't have skipped tokens. - if (_currentToken.kind() === SyntaxKind.CommaToken) { + if (_currentToken.kind === SyntaxKind.CommaToken) { return true; } @@ -4335,8 +4420,8 @@ module TypeScript.Parser { case ListParsingState.ObjectType_TypeMembers: return tryParseTypeMember(inErrorRecovery); case ListParsingState.ClassOrInterfaceDeclaration_HeritageClauses: return tryParseHeritageClause(); case ListParsingState.HeritageClause_TypeNameList: return tryParseHeritageClauseTypeName(); - case ListParsingState.VariableDeclaration_VariableDeclarators_AllowIn: return tryParseVariableDeclarator(/*allowIn:*/ true, /*allowIdentifierName:*/ false); - case ListParsingState.VariableDeclaration_VariableDeclarators_DisallowIn: return tryParseVariableDeclarator(/*allowIn:*/ false, /*allowIdentifierName:*/ false); + case ListParsingState.VariableDeclaration_VariableDeclarators_AllowIn: return tryParseVariableDeclarator(/*allowIn:*/ true); + case ListParsingState.VariableDeclaration_VariableDeclarators_DisallowIn: return tryParseVariableDeclarator(/*allowIn:*/ false); case ListParsingState.ArgumentList_AssignmentExpressions: return tryParseArgumentListExpression(); case ListParsingState.ObjectLiteralExpression_PropertyAssignments: return tryParsePropertyAssignment(inErrorRecovery); case ListParsingState.ArrayLiteralExpression_AssignmentExpressions: return tryParseAssignmentOrOmittedExpression(); diff --git a/src/services/syntax/prettyPrinter.ts b/src/services/syntax/prettyPrinter.ts index 3d926fcfdee..357ae0064db 100644 --- a/src/services/syntax/prettyPrinter.ts +++ b/src/services/syntax/prettyPrinter.ts @@ -20,7 +20,7 @@ module TypeScript.PrettyPrinter { return 0; } - if (lastToken(element1).kind() === SyntaxKind.CloseBraceToken) { + if (lastToken(element1).kind === SyntaxKind.CloseBraceToken) { return 2; } @@ -35,12 +35,12 @@ module TypeScript.PrettyPrinter { return 1; } - private newLineCountBetweenStatements(element1: IClassElementSyntax, element2: IClassElementSyntax): number { + private newLineCountBetweenStatements(element1: IStatementSyntax, element2: IStatementSyntax): number { if (!element1 || !element2) { return 0; } - if (lastToken(element1).kind() === SyntaxKind.CloseBraceToken) { + if (lastToken(element1).kind === SyntaxKind.CloseBraceToken) { return 2; } @@ -353,7 +353,7 @@ module TypeScript.PrettyPrinter { } public visitVariableDeclarator(node: VariableDeclaratorSyntax): void { - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.appendNode(node.equalsValueClause); } @@ -552,7 +552,7 @@ module TypeScript.PrettyPrinter { public visitBinaryExpression(node: BinaryExpressionSyntax): void { visitNodeOrToken(this, node.left); - if (node.operatorToken.kind() !== SyntaxKind.CommaToken) { + if (node.operatorToken.kind !== SyntaxKind.CommaToken) { this.ensureSpace(); } @@ -579,7 +579,7 @@ module TypeScript.PrettyPrinter { } public visitMethodSignature(node: MethodSignatureSyntax): void { - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.appendToken(node.questionToken); visitNodeOrToken(this, node.callSignature); } @@ -592,7 +592,7 @@ module TypeScript.PrettyPrinter { } public visitPropertySignature(node: PropertySignatureSyntax): void { - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.appendToken(node.questionToken); this.appendNode(node.typeAnnotation); } @@ -628,7 +628,7 @@ module TypeScript.PrettyPrinter { } private appendBlockOrStatement(node: IStatementSyntax): void { - if (node.kind() === SyntaxKind.Block) { + if (node.kind === SyntaxKind.Block) { this.ensureSpace(); visitNodeOrToken(this, node); } @@ -654,7 +654,7 @@ module TypeScript.PrettyPrinter { this.ensureNewLine(); this.appendToken(node.elseKeyword); - if (node.statement.kind() === SyntaxKind.IfStatement) { + if (node.statement.kind === SyntaxKind.IfStatement) { this.ensureSpace(); visitNodeOrToken(this, node.statement); } @@ -684,7 +684,7 @@ module TypeScript.PrettyPrinter { public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): void { this.appendSpaceList(node.modifiers); this.ensureSpace(); - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature); this.appendBlockOrSemicolon(node.block, node.semicolonToken); } @@ -694,7 +694,7 @@ module TypeScript.PrettyPrinter { this.ensureSpace(); this.appendToken(node.getKeyword); this.ensureSpace(); - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature); this.ensureSpace(); visitNodeOrToken(this, node.block); @@ -705,7 +705,7 @@ module TypeScript.PrettyPrinter { this.ensureSpace(); this.appendToken(node.setKeyword); this.ensureSpace(); - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature) this.ensureSpace(); visitNodeOrToken(this, node.block); @@ -774,7 +774,7 @@ module TypeScript.PrettyPrinter { } private appendSwitchClauseStatements(node: ISwitchClauseSyntax): void { - if (childCount(node.statements) === 1 && childAt(node.statements, 0).kind() === SyntaxKind.Block) { + if (childCount(node.statements) === 1 && childAt(node.statements, 0).kind === SyntaxKind.Block) { this.ensureSpace(); visitNodeOrToken(this, node.statements[0]); } @@ -895,7 +895,7 @@ module TypeScript.PrettyPrinter { } public visitEnumElement(node: EnumElementSyntax): void { - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.ensureSpace(); this.appendNode(node.equalsValueClause); } @@ -926,15 +926,21 @@ module TypeScript.PrettyPrinter { this.appendToken(node.closeBraceToken); } + public visitComputedPropertyName(node: ComputedPropertyNameSyntax): void { + this.appendToken(node.openBracketToken); + visitNodeOrToken(this, node.expression); + this.appendToken(node.closeBracketToken); + } + public visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): void { - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.appendToken(node.colonToken); this.ensureSpace(); visitNodeOrToken(this, node.expression); } public visitFunctionPropertyAssignment(node: FunctionPropertyAssignmentSyntax): void { - this.appendToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature); this.ensureSpace(); visitNodeOrToken(this, node.block); diff --git a/src/services/syntax/references.ts b/src/services/syntax/references.ts index f2eed1365d5..5c1a6818ccc 100644 --- a/src/services/syntax/references.ts +++ b/src/services/syntax/references.ts @@ -28,7 +28,6 @@ /// /// /// -/// /// /// diff --git a/src/services/syntax/scanner.ts b/src/services/syntax/scanner.ts index be2abd11b4f..a56dbcdc474 100644 --- a/src/services/syntax/scanner.ts +++ b/src/services/syntax/scanner.ts @@ -60,84 +60,52 @@ module TypeScript.Scanner { // This gives us 23bit for width (or 8MB of width which should be enough for any codebase). enum ScannerConstants { - LargeTokenFullStartShift = 4, - LargeTokenFullWidthShift = 7, - LargeTokenLeadingTriviaBitMask = 0x01, // 00000001 - LargeTokenLeadingCommentBitMask = 0x02, // 00000010 - LargeTokenTrailingTriviaBitMask = 0x04, // 00000100 - LargeTokenTrailingCommentBitMask = 0x08, // 00001000 - LargeTokenTriviaBitMask = 0x0F, // 00001111 + LargeTokenFullWidthShift = 6, + LargeTokenLeadingTriviaShift = 3, - FixedWidthTokenFullStartShift = 7, - FixedWidthTokenMaxFullStart = 0x7FFFFF, // 23 ones. + WhitespaceTrivia = 0x01, // 00000001 + NewlineTrivia = 0x02, // 00000010 + CommentTrivia = 0x04, // 00000100 + TriviaMask = 0x07, // 00000111 - SmallTokenFullWidthShift = 7, - SmallTokenFullStartShift = 12, - SmallTokenMaxFullStart = 0x3FFFF, // 18 ones. - SmallTokenMaxFullWidth = 0x1F, // 5 ones - SmallTokenFullWidthMask = 0x1F, // 00011111 - - KindMask = 0x7F, // 01111111 - IsVariableWidthMask = 0x80, // 10000000 + KindMask = 0x7F, // 01111111 + IsVariableWidthMask = 0x80, // 10000000 } - // Make sure our math works for packing/unpacking large fullStarts. - Debug.assert(largeTokenUnpackFullStart(largeTokenPackFullStartAndInfo(1 << 26, 3)) === (1 << 26)); - Debug.assert(largeTokenUnpackFullStart(largeTokenPackFullStartAndInfo(3 << 25, 1)) === (3 << 25)); - Debug.assert(largeTokenUnpackFullStart(largeTokenPackFullStartAndInfo(10 << 23, 2)) === (10 << 23)); - - function fixedWidthTokenPackData(fullStart: number, kind: SyntaxKind) { - return (fullStart << ScannerConstants.FixedWidthTokenFullStartShift) | kind; + function largeTokenPackData(fullWidth: number, leadingTriviaInfo: number, trailingTriviaInfo: number) { + return (fullWidth << ScannerConstants.LargeTokenFullWidthShift) | (leadingTriviaInfo << ScannerConstants.LargeTokenLeadingTriviaShift) | trailingTriviaInfo; } - function fixedWidthTokenUnpackFullStart(packedData: number) { - return packedData >> ScannerConstants.FixedWidthTokenFullStartShift; + function largeTokenUnpackFullWidth(packedFullWidthAndInfo: number): number { + return packedFullWidthAndInfo >> ScannerConstants.LargeTokenFullWidthShift; } - function smallTokenPackData(fullStart: number, fullWidth: number, kind: SyntaxKind) { - return (fullStart << ScannerConstants.SmallTokenFullStartShift) | - (fullWidth << ScannerConstants.SmallTokenFullWidthShift) | - kind; + function largeTokenUnpackLeadingTriviaInfo(packedFullWidthAndInfo: number): number { + return (packedFullWidthAndInfo >> ScannerConstants.LargeTokenLeadingTriviaShift) & ScannerConstants.TriviaMask; } - function smallTokenUnpackFullWidth(packedData: number): SyntaxKind { - return (packedData >> ScannerConstants.SmallTokenFullWidthShift) & ScannerConstants.SmallTokenFullWidthMask; - } - - function smallTokenUnpackFullStart(packedData: number): number { - return packedData >> ScannerConstants.SmallTokenFullStartShift; - } - - function largeTokenPackFullStartAndInfo(fullStart: number, triviaInfo: number): number { - return (fullStart << ScannerConstants.LargeTokenFullStartShift) | triviaInfo; - } - - function largeTokenUnpackFullWidth(packedFullWidthAndKind: number) { - return packedFullWidthAndKind >> ScannerConstants.LargeTokenFullWidthShift; - } - - function largeTokenUnpackFullStart(packedFullStartAndInfo: number): number { - return packedFullStartAndInfo >> ScannerConstants.LargeTokenFullStartShift; + function largeTokenUnpackTrailingTriviaInfo(packedFullWidthAndInfo: number): number { + return packedFullWidthAndInfo & ScannerConstants.TriviaMask; } function largeTokenUnpackHasLeadingTrivia(packed: number): boolean { - return (packed & ScannerConstants.LargeTokenLeadingTriviaBitMask) !== 0; + return largeTokenUnpackLeadingTriviaInfo(packed) !== 0; } function largeTokenUnpackHasTrailingTrivia(packed: number): boolean { - return (packed & ScannerConstants.LargeTokenTrailingTriviaBitMask) !== 0; + return largeTokenUnpackTrailingTriviaInfo(packed) !== 0; + } + + function hasComment(info: number) { + return (info & ScannerConstants.CommentTrivia) !== 0; } function largeTokenUnpackHasLeadingComment(packed: number): boolean { - return (packed & ScannerConstants.LargeTokenLeadingCommentBitMask) !== 0; + return hasComment(largeTokenUnpackLeadingTriviaInfo(packed)); } function largeTokenUnpackHasTrailingComment(packed: number): boolean { - return (packed & ScannerConstants.LargeTokenTrailingCommentBitMask) !== 0; - } - - function largeTokenUnpackTriviaInfo(packed: number): number { - return packed & ScannerConstants.LargeTokenTriviaBitMask; + return hasComment(largeTokenUnpackTrailingTriviaInfo(packed)); } var isKeywordStartCharacter: number[] = ArrayUtilities.createArray(CharacterCodes.maxAsciiCharacter, 0); @@ -166,7 +134,7 @@ module TypeScript.Scanner { // These tokens are contextually created based on parsing decisions. We can't reuse // them in incremental scenarios as we may be in a context where the parser would not // create them. - switch (token.kind()) { + switch (token.kind) { // Created by the parser when it sees / or /= in a location where it needs an expression. case SyntaxKind.RegularExpressionLiteral: @@ -251,55 +219,57 @@ module TypeScript.Scanner { } class FixedWidthTokenWithNoTrivia implements ISyntaxToken { - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _syntaxNodeOrTokenBrand: any; + public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _nameBrand: any; public _propertyAssignmentBrand: any; public _propertyNameBrand: any; + public parent: ISyntaxElement; + public childCount: number; - constructor(private _packedData: number) { + constructor(private _fullStart: number, public kind: SyntaxKind) { } public setFullStart(fullStart: number): void { - this._packedData = fixedWidthTokenPackData(fullStart, this.kind()); + this._fullStart = fullStart; } - - public childCount() { return 0 } + public childAt(index: number): ISyntaxElement { throw Errors.invalidOperation() } public accept(visitor: ISyntaxVisitor): any { return visitor.visitToken(this) } public isIncrementallyUnusable(): boolean { return false; } public isKeywordConvertedToIdentifier(): boolean { return false; } public hasSkippedToken(): boolean { return false; } - public fullText(): string { return SyntaxFacts.getText(this.kind()); } + public fullText(): string { return SyntaxFacts.getText(this.kind); } public text(): string { return this.fullText(); } public leadingTrivia(): ISyntaxTriviaList { return Syntax.emptyTriviaList; } public trailingTrivia(): ISyntaxTriviaList { return Syntax.emptyTriviaList; } public leadingTriviaWidth(): number { return 0; } public trailingTriviaWidth(): number { return 0; } - public kind(): SyntaxKind { return this._packedData & ScannerConstants.KindMask; } - public fullWidth(): number { return fixedWidthTokenLength(this._packedData & ScannerConstants.KindMask); } - public fullStart(): number { return fixedWidthTokenUnpackFullStart(this._packedData); } + public fullWidth(): number { return fixedWidthTokenLength(this.kind); } + public fullStart(): number { return this._fullStart; } public hasLeadingTrivia(): boolean { return false; } public hasTrailingTrivia(): boolean { return false; } public hasLeadingComment(): boolean { return false; } public hasTrailingComment(): boolean { return false; } - public clone(): ISyntaxToken { return new FixedWidthTokenWithNoTrivia(this._packedData); } + public clone(): ISyntaxToken { return new FixedWidthTokenWithNoTrivia(this._fullStart, this.kind); } } + FixedWidthTokenWithNoTrivia.prototype.childCount = 0; class LargeScannerToken implements ISyntaxToken { - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _syntaxNodeOrTokenBrand: any; + public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _nameBrand: any; public _propertyAssignmentBrand: any; public _propertyNameBrand: any; + public parent: ISyntaxElement; + public childCount: number; private cachedText: string; - constructor(private _packedFullStartAndInfo: number, private _packedFullWidthAndKind: number, cachedText: string) { + + constructor(private _fullStart: number, public kind: SyntaxKind, private _packedFullWidthAndInfo: number, cachedText: string) { if (cachedText !== undefined) { this.cachedText = cachedText; } } public setFullStart(fullStart: number): void { - this._packedFullStartAndInfo = largeTokenPackFullStartAndInfo(fullStart, - largeTokenUnpackTriviaInfo(this._packedFullStartAndInfo)); + this._fullStart = fullStart; } - public childCount() { return 0 } public childAt(index: number): ISyntaxElement { throw Errors.invalidOperation() } public accept(visitor: ISyntaxVisitor): any { return visitor.visitToken(this) } @@ -319,7 +289,7 @@ module TypeScript.Scanner { public text(): string { var cachedText = this.cachedText; - return cachedText !== undefined ? cachedText : SyntaxFacts.getText(this.kind()); + return cachedText !== undefined ? cachedText : SyntaxFacts.getText(this.kind); } public leadingTrivia(text?: ISimpleText): ISyntaxTriviaList { return leadingTrivia(this, this.syntaxTreeText(text)); } @@ -333,15 +303,15 @@ module TypeScript.Scanner { return trailingTriviaWidth(this, this.syntaxTreeText(text)); } - public kind(): SyntaxKind { return this._packedFullWidthAndKind & ScannerConstants.KindMask; } - public fullWidth(): number { return largeTokenUnpackFullWidth(this._packedFullWidthAndKind); } - public fullStart(): number { return largeTokenUnpackFullStart(this._packedFullStartAndInfo); } - public hasLeadingTrivia(): boolean { return largeTokenUnpackHasLeadingTrivia(this._packedFullStartAndInfo); } - public hasTrailingTrivia(): boolean { return largeTokenUnpackHasTrailingTrivia(this._packedFullStartAndInfo); } - public hasLeadingComment(): boolean { return largeTokenUnpackHasLeadingComment(this._packedFullStartAndInfo); } - public hasTrailingComment(): boolean { return largeTokenUnpackHasTrailingComment(this._packedFullStartAndInfo); } - public clone(): ISyntaxToken { return new LargeScannerToken(this._packedFullStartAndInfo, this._packedFullWidthAndKind, this.cachedText); } + public fullWidth(): number { return largeTokenUnpackFullWidth(this._packedFullWidthAndInfo); } + public fullStart(): number { return this._fullStart; } + public hasLeadingTrivia(): boolean { return largeTokenUnpackHasLeadingTrivia(this._packedFullWidthAndInfo); } + public hasTrailingTrivia(): boolean { return largeTokenUnpackHasTrailingTrivia(this._packedFullWidthAndInfo); } + public hasLeadingComment(): boolean { return largeTokenUnpackHasLeadingComment(this._packedFullWidthAndInfo); } + public hasTrailingComment(): boolean { return largeTokenUnpackHasTrailingComment(this._packedFullWidthAndInfo); } + public clone(): ISyntaxToken { return new LargeScannerToken(this._fullStart, this.kind, this._packedFullWidthAndInfo, this.cachedText); } } + LargeScannerToken.prototype.childCount = 0; export interface DiagnosticCallback { (position: number, width: number, key: string, arguments: any[]): void; @@ -381,12 +351,13 @@ module TypeScript.Scanner { } function reset(_text: ISimpleText, _start: number, _end: number) { - Debug.assert(_start <= _text.length(), "Token's start was not within the bounds of text: " + _start + " - [0, " + _text.length() + ")"); - Debug.assert(_end <= _text.length(), "Token's end was not within the bounds of text: " + _end + " - [0, " + _text.length() + ")"); + var textLength = _text.length(); + Debug.assert(_start <= textLength, "Token's start was not within the bounds of text."); + Debug.assert(_end <= textLength, "Token's end was not within the bounds of text:"); if (!str || text !== _text) { text = _text; - str = _text.substr(0, _text.length()); + str = _text.substr(0, textLength); } start = _start; @@ -413,20 +384,14 @@ module TypeScript.Scanner { ((kindAndIsVariableWidth & ScannerConstants.IsVariableWidthMask) === 0); if (isFixedWidth && - leadingTriviaInfo === 0 && trailingTriviaInfo === 0 && - fullStart <= ScannerConstants.FixedWidthTokenMaxFullStart && - (kindAndIsVariableWidth & ScannerConstants.IsVariableWidthMask) === 0) { + leadingTriviaInfo === 0 && trailingTriviaInfo === 0) { - return new FixedWidthTokenWithNoTrivia((fullStart << ScannerConstants.FixedWidthTokenFullStartShift) | kind); + return new FixedWidthTokenWithNoTrivia(fullStart, kind); } else { - // inline the packing logic for perf. - var packedFullStartAndTriviaInfo = (fullStart << ScannerConstants.LargeTokenFullStartShift) | - leadingTriviaInfo | (trailingTriviaInfo << 2); - - var packedFullWidthAndKind = (fullWidth << ScannerConstants.LargeTokenFullWidthShift) | kind; + var packedFullWidthAndInfo = largeTokenPackData(fullWidth, leadingTriviaInfo, trailingTriviaInfo); var cachedText = isFixedWidth ? undefined : text.substr(start, end - start); - return new LargeScannerToken(packedFullStartAndTriviaInfo, packedFullWidthAndKind, cachedText); + return new LargeScannerToken(fullStart, kind, packedFullWidthAndInfo, cachedText); } } @@ -536,7 +501,7 @@ module TypeScript.Scanner { case CharacterCodes.formFeed: index++; // we have trivia - result |= 1; + result |= ScannerConstants.WhitespaceTrivia; continue; case CharacterCodes.carriageReturn: @@ -545,10 +510,12 @@ module TypeScript.Scanner { } // fall through. case CharacterCodes.lineFeed: + case CharacterCodes.paragraphSeparator: + case CharacterCodes.lineSeparator: index++; // we have trivia - result |= 1; + result |= ScannerConstants.NewlineTrivia; // If we're consuming leading trivia, then we will continue consuming more // trivia (including newlines) up to the first token we see. If we're @@ -564,14 +531,14 @@ module TypeScript.Scanner { var ch2 = str.charCodeAt(index + 1); if (ch2 === CharacterCodes.slash) { // we have a comment, and we have trivia - result |= 3; + result |= ScannerConstants.CommentTrivia; skipSingleLineCommentTrivia(); continue; } if (ch2 === CharacterCodes.asterisk) { // we have a comment, and we have trivia - result |= 3; + result |= ScannerConstants.CommentTrivia; skipMultiLineCommentTrivia(); continue; } @@ -581,8 +548,8 @@ module TypeScript.Scanner { return result; default: - if (ch > CharacterCodes.maxAsciiCharacter && slowScanTriviaInfo(ch)) { - result |= 1; + if (ch > CharacterCodes.maxAsciiCharacter && slowScanWhitespaceTriviaInfo(ch)) { + result |= ScannerConstants.WhitespaceTrivia; continue; } @@ -593,7 +560,7 @@ module TypeScript.Scanner { return result; } - function slowScanTriviaInfo(ch: number): boolean { + function slowScanWhitespaceTriviaInfo(ch: number): boolean { switch (ch) { case CharacterCodes.nonBreakingSpace: case CharacterCodes.enQuad: @@ -611,8 +578,6 @@ module TypeScript.Scanner { case CharacterCodes.narrowNoBreakSpace: case CharacterCodes.ideographicSpace: case CharacterCodes.byteOrderMark: - case CharacterCodes.paragraphSeparator: - case CharacterCodes.lineSeparator: index++; return true; @@ -1685,11 +1650,14 @@ module TypeScript.Scanner { function resetToPosition(absolutePosition: number): void { Debug.assert(absolutePosition <= text.length(), "Trying to set the position outside the bounds of the text!"); + var resetBackward = absolutePosition <= _absolutePosition; _absolutePosition = absolutePosition; - // First, remove any diagnostics that came after this position. - removeDiagnosticsOnOrAfterPosition(absolutePosition); + if (resetBackward) { + // First, remove any diagnostics that came after this position. + removeDiagnosticsOnOrAfterPosition(absolutePosition); + } // Now, tell our sliding window to throw away all tokens after this position as well. slidingWindow.disgardAllItemsFromCurrentIndexOnwards(); @@ -1701,7 +1669,7 @@ module TypeScript.Scanner { function currentContextualToken(): ISyntaxToken { // We better be on a / or > token right now. - // Debug.assert(SyntaxFacts.isAnyDivideToken(currentToken().kind())); + // Debug.assert(SyntaxFacts.isAnyDivideToken(currentToken().kind)); // First, we're going to rewind all our data to the point where this / or /= token started. // That's because if it does turn out to be a regular expression, then any tokens or token @@ -1721,7 +1689,7 @@ module TypeScript.Scanner { // We have better gotten some sort of regex token. Otherwise, something *very* wrong has // occurred. - // Debug.assert(SyntaxFacts.isAnyDivideOrRegularExpressionToken(token.kind())); + // Debug.assert(SyntaxFacts.isAnyDivideOrRegularExpressionToken(token.kind)); return token; } @@ -1746,114 +1714,8 @@ module TypeScript.Scanner { }; } + var fixedWidthArray = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 8, 8, 7, 6, 2, 4, 5, 7, 3, 8, 2, 2, 10, 3, 4, 6, 6, 4, 5, 4, 3, 6, 3, 4, 5, 4, 5, 5, 4, 6, 7, 6, 5, 10, 9, 3, 7, 7, 9, 6, 6, 5, 3, 7, 11, 7, 3, 6, 7, 6, 3, 6, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 2, 2, 2, 1, 2]; function fixedWidthTokenLength(kind: SyntaxKind) { - switch (kind) { - case SyntaxKind.BreakKeyword: return 5; - case SyntaxKind.CaseKeyword: return 4; - case SyntaxKind.CatchKeyword: return 5; - case SyntaxKind.ContinueKeyword: return 8; - case SyntaxKind.DebuggerKeyword: return 8; - case SyntaxKind.DefaultKeyword: return 7; - case SyntaxKind.DeleteKeyword: return 6; - case SyntaxKind.DoKeyword: return 2; - case SyntaxKind.ElseKeyword: return 4; - case SyntaxKind.FalseKeyword: return 5; - case SyntaxKind.FinallyKeyword: return 7; - case SyntaxKind.ForKeyword: return 3; - case SyntaxKind.FunctionKeyword: return 8; - case SyntaxKind.IfKeyword: return 2; - case SyntaxKind.InKeyword: return 2; - case SyntaxKind.InstanceOfKeyword: return 10; - case SyntaxKind.NewKeyword: return 3; - case SyntaxKind.NullKeyword: return 4; - case SyntaxKind.ReturnKeyword: return 6; - case SyntaxKind.SwitchKeyword: return 6; - case SyntaxKind.ThisKeyword: return 4; - case SyntaxKind.ThrowKeyword: return 5; - case SyntaxKind.TrueKeyword: return 4; - case SyntaxKind.TryKeyword: return 3; - case SyntaxKind.TypeOfKeyword: return 6; - case SyntaxKind.VarKeyword: return 3; - case SyntaxKind.VoidKeyword: return 4; - case SyntaxKind.WhileKeyword: return 5; - case SyntaxKind.WithKeyword: return 4; - case SyntaxKind.ClassKeyword: return 5; - case SyntaxKind.ConstKeyword: return 5; - case SyntaxKind.EnumKeyword: return 4; - case SyntaxKind.ExportKeyword: return 6; - case SyntaxKind.ExtendsKeyword: return 7; - case SyntaxKind.ImportKeyword: return 6; - case SyntaxKind.SuperKeyword: return 5; - case SyntaxKind.ImplementsKeyword: return 10; - case SyntaxKind.InterfaceKeyword: return 9; - case SyntaxKind.LetKeyword: return 3; - case SyntaxKind.PackageKeyword: return 7; - case SyntaxKind.PrivateKeyword: return 7; - case SyntaxKind.ProtectedKeyword: return 9; - case SyntaxKind.PublicKeyword: return 6; - case SyntaxKind.StaticKeyword: return 6; - case SyntaxKind.YieldKeyword: return 5; - case SyntaxKind.AnyKeyword: return 3; - case SyntaxKind.BooleanKeyword: return 7; - case SyntaxKind.ConstructorKeyword: return 11; - case SyntaxKind.DeclareKeyword: return 7; - case SyntaxKind.GetKeyword: return 3; - case SyntaxKind.ModuleKeyword: return 6; - case SyntaxKind.RequireKeyword: return 7; - case SyntaxKind.NumberKeyword: return 6; - case SyntaxKind.SetKeyword: return 3; - case SyntaxKind.StringKeyword: return 6; - case SyntaxKind.OpenBraceToken: return 1; - case SyntaxKind.CloseBraceToken: return 1; - case SyntaxKind.OpenParenToken: return 1; - case SyntaxKind.CloseParenToken: return 1; - case SyntaxKind.OpenBracketToken: return 1; - case SyntaxKind.CloseBracketToken: return 1; - case SyntaxKind.DotToken: return 1; - case SyntaxKind.DotDotDotToken: return 3; - case SyntaxKind.SemicolonToken: return 1; - case SyntaxKind.CommaToken: return 1; - case SyntaxKind.LessThanToken: return 1; - case SyntaxKind.GreaterThanToken: return 1; - case SyntaxKind.LessThanEqualsToken: return 2; - case SyntaxKind.GreaterThanEqualsToken: return 2; - case SyntaxKind.EqualsEqualsToken: return 2; - case SyntaxKind.EqualsGreaterThanToken: return 2; - case SyntaxKind.ExclamationEqualsToken: return 2; - case SyntaxKind.EqualsEqualsEqualsToken: return 3; - case SyntaxKind.ExclamationEqualsEqualsToken: return 3; - case SyntaxKind.PlusToken: return 1; - case SyntaxKind.MinusToken: return 1; - case SyntaxKind.AsteriskToken: return 1; - case SyntaxKind.PercentToken: return 1; - case SyntaxKind.PlusPlusToken: return 2; - case SyntaxKind.MinusMinusToken: return 2; - case SyntaxKind.LessThanLessThanToken: return 2; - case SyntaxKind.GreaterThanGreaterThanToken: return 2; - case SyntaxKind.GreaterThanGreaterThanGreaterThanToken: return 3; - case SyntaxKind.AmpersandToken: return 1; - case SyntaxKind.BarToken: return 1; - case SyntaxKind.CaretToken: return 1; - case SyntaxKind.ExclamationToken: return 1; - case SyntaxKind.TildeToken: return 1; - case SyntaxKind.AmpersandAmpersandToken: return 2; - case SyntaxKind.BarBarToken: return 2; - case SyntaxKind.QuestionToken: return 1; - case SyntaxKind.ColonToken: return 1; - case SyntaxKind.EqualsToken: return 1; - case SyntaxKind.PlusEqualsToken: return 2; - case SyntaxKind.MinusEqualsToken: return 2; - case SyntaxKind.AsteriskEqualsToken: return 2; - case SyntaxKind.PercentEqualsToken: return 2; - case SyntaxKind.LessThanLessThanEqualsToken: return 3; - case SyntaxKind.GreaterThanGreaterThanEqualsToken: return 3; - case SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken: return 4; - case SyntaxKind.AmpersandEqualsToken: return 2; - case SyntaxKind.BarEqualsToken: return 2; - case SyntaxKind.CaretEqualsToken: return 2; - case SyntaxKind.SlashToken: return 1; - case SyntaxKind.SlashEqualsToken: return 2; - default: throw new Error(); - } + return fixedWidthArray[kind]; } } \ No newline at end of file diff --git a/src/services/syntax/scannerUtilities.generated.ts b/src/services/syntax/scannerUtilities.generated.ts index 9e1a018006b..97f0093a672 100644 --- a/src/services/syntax/scannerUtilities.generated.ts +++ b/src/services/syntax/scannerUtilities.generated.ts @@ -2,117 +2,6 @@ module TypeScript { export module ScannerUtilities { - export function fixedWidthTokenLength(kind: SyntaxKind) { - switch (kind) { - case SyntaxKind.BreakKeyword: return 5; - case SyntaxKind.CaseKeyword: return 4; - case SyntaxKind.CatchKeyword: return 5; - case SyntaxKind.ContinueKeyword: return 8; - case SyntaxKind.DebuggerKeyword: return 8; - case SyntaxKind.DefaultKeyword: return 7; - case SyntaxKind.DeleteKeyword: return 6; - case SyntaxKind.DoKeyword: return 2; - case SyntaxKind.ElseKeyword: return 4; - case SyntaxKind.FalseKeyword: return 5; - case SyntaxKind.FinallyKeyword: return 7; - case SyntaxKind.ForKeyword: return 3; - case SyntaxKind.FunctionKeyword: return 8; - case SyntaxKind.IfKeyword: return 2; - case SyntaxKind.InKeyword: return 2; - case SyntaxKind.InstanceOfKeyword: return 10; - case SyntaxKind.NewKeyword: return 3; - case SyntaxKind.NullKeyword: return 4; - case SyntaxKind.ReturnKeyword: return 6; - case SyntaxKind.SwitchKeyword: return 6; - case SyntaxKind.ThisKeyword: return 4; - case SyntaxKind.ThrowKeyword: return 5; - case SyntaxKind.TrueKeyword: return 4; - case SyntaxKind.TryKeyword: return 3; - case SyntaxKind.TypeOfKeyword: return 6; - case SyntaxKind.VarKeyword: return 3; - case SyntaxKind.VoidKeyword: return 4; - case SyntaxKind.WhileKeyword: return 5; - case SyntaxKind.WithKeyword: return 4; - case SyntaxKind.ClassKeyword: return 5; - case SyntaxKind.ConstKeyword: return 5; - case SyntaxKind.EnumKeyword: return 4; - case SyntaxKind.ExportKeyword: return 6; - case SyntaxKind.ExtendsKeyword: return 7; - case SyntaxKind.ImportKeyword: return 6; - case SyntaxKind.SuperKeyword: return 5; - case SyntaxKind.ImplementsKeyword: return 10; - case SyntaxKind.InterfaceKeyword: return 9; - case SyntaxKind.LetKeyword: return 3; - case SyntaxKind.PackageKeyword: return 7; - case SyntaxKind.PrivateKeyword: return 7; - case SyntaxKind.ProtectedKeyword: return 9; - case SyntaxKind.PublicKeyword: return 6; - case SyntaxKind.StaticKeyword: return 6; - case SyntaxKind.YieldKeyword: return 5; - case SyntaxKind.AnyKeyword: return 3; - case SyntaxKind.BooleanKeyword: return 7; - case SyntaxKind.ConstructorKeyword: return 11; - case SyntaxKind.DeclareKeyword: return 7; - case SyntaxKind.GetKeyword: return 3; - case SyntaxKind.ModuleKeyword: return 6; - case SyntaxKind.RequireKeyword: return 7; - case SyntaxKind.NumberKeyword: return 6; - case SyntaxKind.SetKeyword: return 3; - case SyntaxKind.StringKeyword: return 6; - case SyntaxKind.OpenBraceToken: return 1; - case SyntaxKind.CloseBraceToken: return 1; - case SyntaxKind.OpenParenToken: return 1; - case SyntaxKind.CloseParenToken: return 1; - case SyntaxKind.OpenBracketToken: return 1; - case SyntaxKind.CloseBracketToken: return 1; - case SyntaxKind.DotToken: return 1; - case SyntaxKind.DotDotDotToken: return 3; - case SyntaxKind.SemicolonToken: return 1; - case SyntaxKind.CommaToken: return 1; - case SyntaxKind.LessThanToken: return 1; - case SyntaxKind.GreaterThanToken: return 1; - case SyntaxKind.LessThanEqualsToken: return 2; - case SyntaxKind.GreaterThanEqualsToken: return 2; - case SyntaxKind.EqualsEqualsToken: return 2; - case SyntaxKind.EqualsGreaterThanToken: return 2; - case SyntaxKind.ExclamationEqualsToken: return 2; - case SyntaxKind.EqualsEqualsEqualsToken: return 3; - case SyntaxKind.ExclamationEqualsEqualsToken: return 3; - case SyntaxKind.PlusToken: return 1; - case SyntaxKind.MinusToken: return 1; - case SyntaxKind.AsteriskToken: return 1; - case SyntaxKind.PercentToken: return 1; - case SyntaxKind.PlusPlusToken: return 2; - case SyntaxKind.MinusMinusToken: return 2; - case SyntaxKind.LessThanLessThanToken: return 2; - case SyntaxKind.GreaterThanGreaterThanToken: return 2; - case SyntaxKind.GreaterThanGreaterThanGreaterThanToken: return 3; - case SyntaxKind.AmpersandToken: return 1; - case SyntaxKind.BarToken: return 1; - case SyntaxKind.CaretToken: return 1; - case SyntaxKind.ExclamationToken: return 1; - case SyntaxKind.TildeToken: return 1; - case SyntaxKind.AmpersandAmpersandToken: return 2; - case SyntaxKind.BarBarToken: return 2; - case SyntaxKind.QuestionToken: return 1; - case SyntaxKind.ColonToken: return 1; - case SyntaxKind.EqualsToken: return 1; - case SyntaxKind.PlusEqualsToken: return 2; - case SyntaxKind.MinusEqualsToken: return 2; - case SyntaxKind.AsteriskEqualsToken: return 2; - case SyntaxKind.PercentEqualsToken: return 2; - case SyntaxKind.LessThanLessThanEqualsToken: return 3; - case SyntaxKind.GreaterThanGreaterThanEqualsToken: return 3; - case SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken: return 4; - case SyntaxKind.AmpersandEqualsToken: return 2; - case SyntaxKind.BarEqualsToken: return 2; - case SyntaxKind.CaretEqualsToken: return 2; - case SyntaxKind.SlashToken: return 1; - case SyntaxKind.SlashEqualsToken: return 2; - default: throw new Error(); - } - } - export function identifierKind(str: string, start: number, length: number): SyntaxKind { switch (length) { case 2: // do, if, in diff --git a/src/services/syntax/syntax.ts b/src/services/syntax/syntax.ts index 99741977751..cac2c280d24 100644 --- a/src/services/syntax/syntax.ts +++ b/src/services/syntax/syntax.ts @@ -9,7 +9,7 @@ module TypeScript.Syntax { if (isToken(child)) { var token = child; // If a token is skipped, return true. Or if it is a missing token. The only empty token that is not missing is EOF - if (token.hasSkippedToken() || (width(token) === 0 && token.kind() !== SyntaxKind.EndOfFileToken)) { + if (token.hasSkippedToken() || (width(token) === 0 && token.kind !== SyntaxKind.EndOfFileToken)) { return true; } } @@ -19,7 +19,7 @@ module TypeScript.Syntax { } export function isUnterminatedStringLiteral(token: ISyntaxToken): boolean { - if (token && token.kind() === SyntaxKind.StringLiteral) { + if (token && token.kind === SyntaxKind.StringLiteral) { var text = token.text(); return text.length < 2 || text.charCodeAt(text.length - 1) !== text.charCodeAt(0); } @@ -55,7 +55,7 @@ module TypeScript.Syntax { var triviaList: ISyntaxTriviaList = undefined; var lastTriviaBeforeToken: ISyntaxTrivia = undefined; - if (positionedToken.kind() === SyntaxKind.EndOfFileToken) { + if (positionedToken.kind === SyntaxKind.EndOfFileToken) { // Check if the trivia is leading on the EndOfFile token if (positionedToken.hasLeadingTrivia()) { triviaList = positionedToken.leadingTrivia(); @@ -106,14 +106,14 @@ module TypeScript.Syntax { var positionedToken = findToken(sourceUnit, position); if (positionedToken) { - if (positionedToken.kind() === SyntaxKind.EndOfFileToken) { + if (positionedToken.kind === SyntaxKind.EndOfFileToken) { // EndOfFile token, enusre it did not follow an unterminated string literal positionedToken = previousToken(positionedToken); return positionedToken && positionedToken.trailingTriviaWidth() === 0 && isUnterminatedStringLiteral(positionedToken); } else if (position > start(positionedToken)) { // Ensure position falls enterily within the literal if it is terminated, or the line if it is not - return (position < end(positionedToken) && (positionedToken.kind() === TypeScript.SyntaxKind.StringLiteral || positionedToken.kind() === TypeScript.SyntaxKind.RegularExpressionLiteral)) || + return (position < end(positionedToken) && (positionedToken.kind === TypeScript.SyntaxKind.StringLiteral || positionedToken.kind === TypeScript.SyntaxKind.RegularExpressionLiteral)) || (position <= end(positionedToken) && isUnterminatedStringLiteral(positionedToken)); } } @@ -123,7 +123,7 @@ module TypeScript.Syntax { export function getAncestorOfKind(positionedToken: ISyntaxElement, kind: SyntaxKind): ISyntaxElement { while (positionedToken && positionedToken.parent) { - if (positionedToken.parent.kind() === kind) { + if (positionedToken.parent.kind === kind) { return positionedToken.parent; } @@ -139,10 +139,10 @@ module TypeScript.Syntax { export function isIntegerLiteral(expression: IExpressionSyntax): boolean { if (expression) { - switch (expression.kind()) { + switch (expression.kind) { case SyntaxKind.PrefixUnaryExpression: var prefixExpr = expression; - if (prefixExpr.operatorToken.kind() == SyntaxKind.PlusToken || prefixExpr.operatorToken.kind() === SyntaxKind.MinusToken) { + if (prefixExpr.operatorToken.kind == SyntaxKind.PlusToken || prefixExpr.operatorToken.kind === SyntaxKind.MinusToken) { // Note: if there is a + or - sign, we can only allow a normal integer following // (and not a hex integer). i.e. -0xA is a legal expression, but it is not a // *literal*. diff --git a/src/services/syntax/syntaxElement.ts b/src/services/syntax/syntaxElement.ts index 78418950a57..10381ef3ebc 100644 --- a/src/services/syntax/syntaxElement.ts +++ b/src/services/syntax/syntaxElement.ts @@ -6,7 +6,7 @@ module TypeScript { // Debug.assert(!isShared(element)); while (element) { - if (element.kind() === SyntaxKind.SourceUnit) { + if (element.kind === SyntaxKind.SourceUnit) { return (element).syntaxTree; } @@ -53,7 +53,7 @@ module TypeScript { throw Errors.argumentOutOfRange("position"); } - var token = findTokenWorker(sourceUnit, 0, position); + var token = findTokenInNodeOrToken(sourceUnit, 0, position); if (token) { Debug.assert(token.fullWidth() > 0); return token; @@ -113,13 +113,39 @@ module TypeScript { } function findTokenWorker(element: ISyntaxElement, elementPosition: number, position: number): ISyntaxToken { - if (isToken(element)) { - return element; + if (isList(element)) { + return findTokenInList(element, elementPosition, position); + } + else { + return findTokenInNodeOrToken(element, elementPosition, position); + } + } + + function findTokenInList(list: ISyntaxNodeOrToken[], elementPosition: number, position: number): ISyntaxToken { + for (var i = 0, n = list.length; i < n; i++) { + var child = list[i]; + + var childFullWidth = fullWidth(child); + var elementEndPosition = elementPosition + childFullWidth; + + if (position < elementEndPosition) { + return findTokenWorker(child, elementPosition, position); + } + + elementPosition = elementEndPosition; } - // Consider: we could use a binary search here to find the child more quickly. - for (var i = 0, n = childCount(element); i < n; i++) { - var child = childAt(element, i); + return undefined; + } + + + function findTokenInNodeOrToken(nodeOrToken: ISyntaxNodeOrToken, elementPosition: number, position: number): ISyntaxToken { + if (isToken(nodeOrToken)) { + return nodeOrToken; + } + + for (var i = 0, n = childCount(nodeOrToken); i < n; i++) { + var child = nodeOrToken.childAt(i); if (child) { var childFullWidth = fullWidth(child); @@ -137,7 +163,7 @@ module TypeScript { } function tryGetEndOfFileAt(element: ISyntaxElement, position: number): ISyntaxToken { - if (element.kind() === SyntaxKind.SourceUnit && position === fullWidth(element)) { + if (element.kind === SyntaxKind.SourceUnit && position === fullWidth(element)) { var sourceUnit = element; return sourceUnit.endOfFileToken; } @@ -146,7 +172,7 @@ module TypeScript { } export function nextToken(token: ISyntaxToken, text?: ISimpleText): ISyntaxToken { - if (token.kind() === SyntaxKind.EndOfFileToken) { + if (token.kind === SyntaxKind.EndOfFileToken) { return undefined; } @@ -155,7 +181,7 @@ module TypeScript { export function isNode(element: ISyntaxElement): boolean { if (element) { - var kind = element.kind(); + var kind = element.kind; return kind >= SyntaxKind.FirstNode && kind <= SyntaxKind.LastNode; } @@ -168,7 +194,7 @@ module TypeScript { export function isToken(element: ISyntaxElement): boolean { if (element) { - return isTokenKind(element.kind()); + return isTokenKind(element.kind); } return false; @@ -227,7 +253,7 @@ module TypeScript { export function firstToken(element: ISyntaxElement): ISyntaxToken { if (element) { - var kind = element.kind(); + var kind = element.kind; if (isTokenKind(kind)) { return (element).fullWidth() > 0 || kind === SyntaxKind.EndOfFileToken ? element : undefined; @@ -246,10 +272,10 @@ module TypeScript { export function lastToken(element: ISyntaxElement): ISyntaxToken { if (isToken(element)) { - return fullWidth(element) > 0 || element.kind() === SyntaxKind.EndOfFileToken ? element : undefined; + return fullWidth(element) > 0 || element.kind === SyntaxKind.EndOfFileToken ? element : undefined; } - if (element.kind() === SyntaxKind.SourceUnit) { + if (element.kind === SyntaxKind.SourceUnit) { return (element).endOfFileToken; } @@ -308,27 +334,52 @@ module TypeScript { return info; } - function computeData(element: ISyntaxElement): number { - var slotCount = childCount(element); + function combineData(fullWidth: number, isIncrementallyUnusable: boolean) { + return (fullWidth << SyntaxConstants.NodeFullWidthShift) + | (isIncrementallyUnusable ? SyntaxConstants.NodeIncrementallyUnusableMask : 0) + | SyntaxConstants.NodeDataComputed; + } + function listComputeData(list: ISyntaxNodeOrToken[]): number { var fullWidth = 0; + var isIncrementallyUnusable = false; + + for (var i = 0, n = list.length; i < n; i++) { + var child: ISyntaxElement = list[i]; + + fullWidth += TypeScript.fullWidth(child); + isIncrementallyUnusable = isIncrementallyUnusable || TypeScript.isIncrementallyUnusable(child); + } + + return combineData(fullWidth, isIncrementallyUnusable); + } + + function computeData(element: ISyntaxElement): number { + if (isList(element)) { + return listComputeData(element); + } + else { + return nodeOrTokenComputeData(element); + } + } + + function nodeOrTokenComputeData(nodeOrToken: ISyntaxNodeOrToken) { + var fullWidth = 0; + var slotCount = nodeOrToken.childCount; // If we have no children (like an OmmittedExpressionSyntax), we're automatically not reusable. - var isIncrementallyUnusable = slotCount === 0 && !isList(element); + var isIncrementallyUnusable = slotCount === 0; for (var i = 0, n = slotCount; i < n; i++) { - var child = childAt(element, i); + var child = nodeOrToken.childAt(i); if (child) { fullWidth += TypeScript.fullWidth(child); - isIncrementallyUnusable = isIncrementallyUnusable || TypeScript.isIncrementallyUnusable(child); } } - return (fullWidth << SyntaxConstants.NodeFullWidthShift) - | (isIncrementallyUnusable ? SyntaxConstants.NodeIncrementallyUnusableMask : 0) - | SyntaxConstants.NodeDataComputed; + return combineData(fullWidth, isIncrementallyUnusable); } export function start(element: ISyntaxElement, text?: ISimpleText): number { @@ -366,8 +417,8 @@ module TypeScript { } export interface ISyntaxElement { - kind(): SyntaxKind; - parent?: ISyntaxElement; + kind: SyntaxKind; + parent: ISyntaxElement; } export interface ISyntaxNode extends ISyntaxNodeOrToken { @@ -380,6 +431,7 @@ module TypeScript { } export interface IModuleElementSyntax extends ISyntaxNode { + _moduleElementBrand: any; } export interface IStatementSyntax extends IModuleElementSyntax { @@ -387,15 +439,28 @@ module TypeScript { } export interface ITypeMemberSyntax extends ISyntaxNode { + _typeMemberBrand: any; } export interface IClassElementSyntax extends ISyntaxNode { + _classElementBrand: any; } export interface IMemberDeclarationSyntax extends IClassElementSyntax { + _memberDeclarationBrand: any; } - export interface IPropertyAssignmentSyntax extends IClassElementSyntax { + export interface IPropertyAssignmentSyntax extends ISyntaxNodeOrToken { + _propertyAssignmentBrand: any; + } + + export interface IAccessorSyntax extends IPropertyAssignmentSyntax, IMemberDeclarationSyntax { + _accessorBrand: any; + + modifiers: ISyntaxToken[]; + propertyName: IPropertyNameSyntax; + callSignature: CallSignatureSyntax; + block: BlockSyntax; } export interface ISwitchClauseSyntax extends ISyntaxNode { @@ -437,5 +502,10 @@ module TypeScript { } export interface INameSyntax extends ITypeSyntax { + _nameBrand: any; + } + + export interface IPropertyNameSyntax extends ISyntaxNodeOrToken { + _propertyNameBrand: any; } } \ No newline at end of file diff --git a/src/services/syntax/syntaxFacts2.ts b/src/services/syntax/syntaxFacts2.ts index 99a144176a4..7c73eb31513 100644 --- a/src/services/syntax/syntaxFacts2.ts +++ b/src/services/syntax/syntaxFacts2.ts @@ -2,16 +2,8 @@ module TypeScript.SyntaxFacts { export function isDirectivePrologueElement(node: ISyntaxNodeOrToken): boolean { - if (node.kind() === SyntaxKind.ExpressionStatement) { - var expressionStatement = node; - var expression = expressionStatement.expression; - - if (expression.kind() === SyntaxKind.StringLiteral) { - return true; - } - } - - return false; + return node.kind === SyntaxKind.ExpressionStatement && + (node).expression.kind === SyntaxKind.StringLiteral; } export function isUseStrictDirective(node: ISyntaxNodeOrToken): boolean { @@ -23,7 +15,7 @@ module TypeScript.SyntaxFacts { } export function isIdentifierNameOrAnyKeyword(token: ISyntaxToken): boolean { - var tokenKind = token.kind(); + var tokenKind = token.kind; return tokenKind === SyntaxKind.IdentifierName || SyntaxFacts.isAnyKeyword(tokenKind); } diff --git a/src/services/syntax/syntaxGenerator.ts b/src/services/syntax/syntaxGenerator.ts index a8783101f98..79ca5d30d0a 100644 --- a/src/services/syntax/syntaxGenerator.ts +++ b/src/services/syntax/syntaxGenerator.ts @@ -187,7 +187,7 @@ var definitions:ITypeDefinition[] = [ name: 'VariableDeclaratorSyntax', baseType: 'ISyntaxNode', children: [ - { name: 'propertyName', isToken: true }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true, isTypeScriptSpecific: true }, { name: 'equalsValueClause', type: 'EqualsValueClauseSyntax', isOptional: true } ] @@ -449,7 +449,7 @@ var definitions:ITypeDefinition[] = [ interfaces: ['IMemberExpressionSyntax', 'ICallExpressionSyntax'], children: [ { name: 'expression', type: 'ILeftHandSideExpressionSyntax' }, - { name: 'templateExpression', type: 'IPrimaryExpressionSyntax' }, + { name: 'templateExpression', type: 'IPrimaryExpressionSyntax' } ] }, { @@ -458,7 +458,7 @@ var definitions:ITypeDefinition[] = [ interfaces: ['IPrimaryExpressionSyntax'], children: [ { name: 'templateStartToken', isToken: true, excludeFromAST: true }, - { name: 'templateClauses', isList: true, elementType: 'TemplateClauseSyntax' }, + { name: 'templateClauses', isList: true, elementType: 'TemplateClauseSyntax' } ] }, { @@ -466,7 +466,7 @@ var definitions:ITypeDefinition[] = [ baseType: 'ISyntaxNode', children: [ { name: 'expression', type: 'IExpressionSyntax' }, - { name: 'templateMiddleOrEndToken', isToken: true, elementType: 'TemplateSpanSyntax' }, + { name: 'templateMiddleOrEndToken', isToken: true, elementType: 'TemplateSpanSyntax' } ] }, { @@ -525,7 +525,7 @@ var definitions:ITypeDefinition[] = [ baseType: 'ISyntaxNode', interfaces: ['ITypeMemberSyntax'], children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'questionToken', isToken: true, isOptional: true, itTypeScriptSpecific: true }, { name: 'callSignature', type: 'CallSignatureSyntax' } ] @@ -547,7 +547,7 @@ var definitions:ITypeDefinition[] = [ baseType: 'ISyntaxNode', interfaces: ['ITypeMemberSyntax'], children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'questionToken', isToken: true, isOptional: true }, { name: 'typeAnnotation', type: 'TypeAnnotationSyntax', isOptional: true } ], @@ -650,7 +650,7 @@ var definitions:ITypeDefinition[] = [ interfaces: ['IMemberDeclarationSyntax'], children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken' }, - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, { name: 'block', type: 'BlockSyntax', isOptional: true }, { name: 'semicolonToken', isToken: true, isOptional: true, excludeFromAST: true } @@ -660,11 +660,11 @@ var definitions:ITypeDefinition[] = [ { name: 'GetAccessorSyntax', baseType: 'ISyntaxNode', - interfaces: ['IMemberDeclarationSyntax', 'IPropertyAssignmentSyntax' ], + interfaces: ['IAccessorSyntax' ], children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken', isTypeScriptSpecific: true }, { name: 'getKeyword', isToken: true, excludeFromAST: true }, - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, { name: 'block', type: 'BlockSyntax' } ] @@ -672,11 +672,11 @@ var definitions:ITypeDefinition[] = [ { name: 'SetAccessorSyntax', baseType: 'ISyntaxNode', - interfaces: ['IMemberDeclarationSyntax', 'IPropertyAssignmentSyntax'], + interfaces: ['IAccessorSyntax'], children: [ { name: 'modifiers', isList: true, elementType: 'ISyntaxToken', isTypeScriptSpecific: true }, { name: 'setKeyword', isToken: true, excludeFromAST: true }, - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, { name: 'block', type: 'BlockSyntax' } ], @@ -863,7 +863,7 @@ var definitions:ITypeDefinition[] = [ name: 'EnumElementSyntax', baseType: 'ISyntaxNode', children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'equalsValueClause', type: 'EqualsValueClauseSyntax', isOptional: true } ] }, @@ -889,12 +889,22 @@ var definitions:ITypeDefinition[] = [ { name: 'closeBraceToken', isToken: true, excludeFromAST: true } ] }, + { + name: 'ComputedPropertyNameSyntax', + baseType: 'ISyntaxNode', + interfaces: ['IPropertyNameSyntax'], + children: [ + { name: 'openBracketToken', isToken: true }, + { name: 'expression', type: 'IExpressionSyntax' }, + { name: 'closeBracketToken', isToken: true } + ] + }, { name: 'SimplePropertyAssignmentSyntax', baseType: 'ISyntaxNode', interfaces: ['IPropertyAssignmentSyntax'], children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'colonToken', isToken: true, excludeFromAST: true }, { name: 'expression', type: 'IExpressionSyntax' } ] @@ -904,7 +914,7 @@ var definitions:ITypeDefinition[] = [ baseType: 'ISyntaxNode', interfaces: ['IPropertyAssignmentSyntax'], children: [ - { name: 'propertyName', isToken: true, tokenKinds: ['IdentifierName', 'StringLiteral', 'NumericLiteral'] }, + { name: 'propertyName', type: 'IPropertyNameSyntax' }, { name: 'callSignature', type: 'CallSignatureSyntax' }, { name: 'block', type: 'BlockSyntax' } ] @@ -1055,54 +1065,6 @@ function getSafeName(child: IMemberDefinition) { return child.name; } -function generateBrands(definition: ITypeDefinition, accessibility: boolean): string { - var properties = ""; - - var types: string[] = []; - if (definition.interfaces) { - var ifaces = definition.interfaces.slice(0); - var i: number; - for (i = 0; i < ifaces.length; i++) { - var current = ifaces[i]; - - while (current !== undefined) { - if (!TypeScript.ArrayUtilities.contains(ifaces, current)) { - ifaces.push(current); - } - - current = interfaces[current]; - } - } - - for (i = 0; i < ifaces.length; i++) { - var type = ifaces[i]; - type = getStringWithoutSuffix(type); - if (isInterface(type)) { - type = "_" + type.substr(1, 1).toLowerCase() + type.substr(2) + "Brand"; - } - - types.push(type); - } - } - - types.push("_syntaxNodeOrTokenBrand"); - if (types.length > 0) { - properties += " "; - - for (var i = 0; i < types.length; i++) { - if (accessibility) { - properties += " public "; - } - - properties += types[i] + ": any;"; - } - - properties += "\r\n"; - } - - return properties; -} - function generateConstructorFunction(definition: ITypeDefinition) { var result = " export var " + definition.name + ": " + getNameWithoutSuffix(definition) + "Constructor = function(data: number"; @@ -1153,7 +1115,22 @@ function generateConstructorFunction(definition: ITypeDefinition) { } result += " };\r\n"; - result += " " + definition.name + ".prototype.kind = function() { return SyntaxKind." + getNameWithoutSuffix(definition) + "; }\r\n"; + result += " " + definition.name + ".prototype.kind = SyntaxKind." + getNameWithoutSuffix(definition) + ";\r\n"; + result += " " + definition.name + ".prototype.childCount = " + definition.children.length + ";\r\n"; + result += " " + definition.name + ".prototype.childAt = function(index: number): ISyntaxElement {\r\n"; + if (definition.children.length) { + result += " switch (index) {\r\n"; + + for (var j = 0; j < definition.children.length; j++) { + result += " case " + j + ": return this." + definition.children[j].name + ";\r\n"; + } + + result += " }\r\n"; + } + else { + result += " throw Errors.invalidOperation();\r\n"; + } + result += " }\r\n"; return result; } @@ -1401,22 +1378,44 @@ function max(array: T[], func: (v: T) => number): number { return max; } +function generateUtilities(): string { + var result = ""; + result += " var fixedWidthArray = ["; + for (var i = 0; i <= TypeScript.SyntaxKind.LastFixedWidth; i++) { + if (i) { + result += ", "; + } + + if (i < TypeScript.SyntaxKind.FirstFixedWidth) { + result += "0"; + } + else { + result += TypeScript.SyntaxFacts.getText(i).length; + } + } + result += "];\r\n"; + + result += " function fixedWidthTokenLength(kind: SyntaxKind) {\r\n"; + result += " return fixedWidthArray[kind];\r\n"; + + //result += " switch (kind) {\r\n"; + + //for (var k = TypeScript.SyntaxKind.FirstFixedWidth; k <= TypeScript.SyntaxKind.LastFixedWidth; k++) { + // result += " case SyntaxKind." + syntaxKindName(k) + ": return " + TypeScript.SyntaxFacts.getText(k).length + ";\r\n"; + //} + //result += " default: throw new Error();\r\n"; + //result += " }\r\n"; + result += " }\r\n"; + + return result; +} + function generateScannerUtilities(): string { var result = "///\r\n" + "\r\n" + "module TypeScript {\r\n" + " export module ScannerUtilities {\r\n"; - result += " export function fixedWidthTokenLength(kind: SyntaxKind) {\r\n"; - result += " switch (kind) {\r\n"; - - for (var k = TypeScript.SyntaxKind.FirstFixedWidth; k <= TypeScript.SyntaxKind.LastFixedWidth; k++) { - result += " case SyntaxKind." + syntaxKindName(k) + ": return " + TypeScript.SyntaxFacts.getText(k).length + ";\r\n"; - } - result += " default: throw new Error();\r\n"; - result += " }\r\n"; - result += " }\r\n\r\n"; - var i: number; var keywords: { text: string; kind: TypeScript.SyntaxKind; }[] = []; @@ -1470,7 +1469,7 @@ function generateVisitor(): string { result += " export function visitNodeOrToken(visitor: ISyntaxVisitor, element: ISyntaxNodeOrToken): any {\r\n"; result += " if (element === undefined) { return undefined; }\r\n"; - result += " switch (element.kind()) {\r\n"; + result += " switch (element.kind) {\r\n"; for (var i = 0; i < definitions.length; i++) { var definition = definitions[i]; @@ -1498,71 +1497,16 @@ function generateVisitor(): string { return result; } -function generateServicesUtilities(): string { - var result = ""; - result += "module TypeScript {\r\n"; - - result += " export function childCount(element: ISyntaxElement): number {\r\n"; - result += " if (isList(element)) { return (element).length; }\r\n"; - result += " switch (element.kind()) {\r\n"; - - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - result += " case SyntaxKind." + getNameWithoutSuffix(definition) + ": return " + definition.children.length + ";\r\n"; - } - - result += " default: return 0;\r\n" - - result += " }\r\n"; - result += " }\r\n\r\n"; - - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - result += " function " + camelCase(getNameWithoutSuffix(definition)) + "ChildAt(node: " + definition.name + ", index: number): ISyntaxElement {\r\n"; - if (definition.children.length) { - result += " switch (index) {\r\n"; - - for (var j = 0; j < definition.children.length; j++) { - result += " case " + j + ": return node." + definition.children[j].name + ";\r\n"; - } - - result += " }\r\n"; - } - else { - result += " throw Errors.invalidOperation();\r\n"; - } - result += " }\r\n"; - } - - - result += " export function childAt(element: ISyntaxElement, index: number): ISyntaxElement {\r\n"; - result += " if (isList(element)) { return (element)[index]; }\r\n"; - result += " switch (element.kind()) {\r\n"; - - for (var i = 0; i < definitions.length; i++) { - var definition = definitions[i]; - result += " case SyntaxKind." + getNameWithoutSuffix(definition) + ": return " + camelCase(getNameWithoutSuffix(definition)) + "ChildAt(<" + definition.name + ">element, index);\r\n"; - } - - result += " }\r\n"; - result += " }\r\n"; - - result += "}"; - - - return result; -} - var syntaxNodesConcrete = generateNodes(); var syntaxInterfaces = generateSyntaxInterfaces(); var walker = generateWalker(); var scannerUtilities = generateScannerUtilities(); var visitor = generateVisitor(); -var servicesUtilities = generateServicesUtilities(); +var utilities = generateUtilities(); sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxNodes.concrete.generated.ts", syntaxNodesConcrete, false); sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxInterfaces.generated.ts", syntaxInterfaces, false); sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxWalker.generated.ts", walker, false); sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\scannerUtilities.generated.ts", scannerUtilities, false); sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxVisitor.generated.ts", visitor, false); -sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\syntaxUtilities.generated.ts", servicesUtilities, false); +sys.writeFile(sys.getCurrentDirectory() + "\\src\\services\\syntax\\utilities.generated.ts", utilities, false); diff --git a/src/services/syntax/syntaxInterfaces.generated.ts b/src/services/syntax/syntaxInterfaces.generated.ts index ba1b6a7298a..b76460173e5 100644 --- a/src/services/syntax/syntaxInterfaces.generated.ts +++ b/src/services/syntax/syntaxInterfaces.generated.ts @@ -152,12 +152,12 @@ module TypeScript { export interface MemberFunctionDeclarationSyntax extends ISyntaxNode, IMemberDeclarationSyntax { modifiers: ISyntaxToken[]; - propertyName: ISyntaxToken; + propertyName: IPropertyNameSyntax; callSignature: CallSignatureSyntax; block: BlockSyntax; semicolonToken: ISyntaxToken; } - export interface MemberFunctionDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): MemberFunctionDeclarationSyntax } + export interface MemberFunctionDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken): MemberFunctionDeclarationSyntax } export interface MemberVariableDeclarationSyntax extends ISyntaxNode, IMemberDeclarationSyntax { modifiers: ISyntaxToken[]; @@ -182,30 +182,30 @@ module TypeScript { } export interface IndexMemberDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], indexSignature: IndexSignatureSyntax, semicolonToken: ISyntaxToken): IndexMemberDeclarationSyntax } - export interface GetAccessorSyntax extends ISyntaxNode, IMemberDeclarationSyntax, IPropertyAssignmentSyntax { + export interface GetAccessorSyntax extends ISyntaxNode, IAccessorSyntax { modifiers: ISyntaxToken[]; getKeyword: ISyntaxToken; - propertyName: ISyntaxToken; + propertyName: IPropertyNameSyntax; callSignature: CallSignatureSyntax; block: BlockSyntax; } - export interface GetAccessorConstructor { new (data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): GetAccessorSyntax } + export interface GetAccessorConstructor { new (data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax): GetAccessorSyntax } - export interface SetAccessorSyntax extends ISyntaxNode, IMemberDeclarationSyntax, IPropertyAssignmentSyntax { + export interface SetAccessorSyntax extends ISyntaxNode, IAccessorSyntax { modifiers: ISyntaxToken[]; setKeyword: ISyntaxToken; - propertyName: ISyntaxToken; + propertyName: IPropertyNameSyntax; callSignature: CallSignatureSyntax; block: BlockSyntax; } - export interface SetAccessorConstructor { new (data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): SetAccessorSyntax } + export interface SetAccessorConstructor { new (data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax): SetAccessorSyntax } export interface PropertySignatureSyntax extends ISyntaxNode, ITypeMemberSyntax { - propertyName: ISyntaxToken; + propertyName: IPropertyNameSyntax; questionToken: ISyntaxToken; typeAnnotation: TypeAnnotationSyntax; } - export interface PropertySignatureConstructor { new (data: number, propertyName: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax): PropertySignatureSyntax } + export interface PropertySignatureConstructor { new (data: number, propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax): PropertySignatureSyntax } export interface CallSignatureSyntax extends ISyntaxNode, ITypeMemberSyntax { typeParameterList: TypeParameterListSyntax; @@ -229,11 +229,11 @@ module TypeScript { export interface IndexSignatureConstructor { new (data: number, openBracketToken: ISyntaxToken, parameters: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax): IndexSignatureSyntax } export interface MethodSignatureSyntax extends ISyntaxNode, ITypeMemberSyntax { - propertyName: ISyntaxToken; + propertyName: IPropertyNameSyntax; questionToken: ISyntaxToken; callSignature: CallSignatureSyntax; } - export interface MethodSignatureConstructor { new (data: number, propertyName: ISyntaxToken, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax): MethodSignatureSyntax } + export interface MethodSignatureConstructor { new (data: number, propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax): MethodSignatureSyntax } export interface BlockSyntax extends ISyntaxNode, IStatementSyntax { openBraceToken: ISyntaxToken; @@ -535,11 +535,11 @@ module TypeScript { export interface VariableDeclarationConstructor { new (data: number, varKeyword: ISyntaxToken, variableDeclarators: ISeparatedSyntaxList): VariableDeclarationSyntax } export interface VariableDeclaratorSyntax extends ISyntaxNode { - propertyName: ISyntaxToken; + propertyName: IPropertyNameSyntax; typeAnnotation: TypeAnnotationSyntax; equalsValueClause: EqualsValueClauseSyntax; } - export interface VariableDeclaratorConstructor { new (data: number, propertyName: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax): VariableDeclaratorSyntax } + export interface VariableDeclaratorConstructor { new (data: number, propertyName: IPropertyNameSyntax, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax): VariableDeclaratorSyntax } export interface ArgumentListSyntax extends ISyntaxNode { typeArgumentList: TypeArgumentListSyntax; @@ -638,18 +638,18 @@ module TypeScript { export interface ConstraintConstructor { new (data: number, extendsKeyword: ISyntaxToken, typeOrExpression: ISyntaxNodeOrToken): ConstraintSyntax } export interface SimplePropertyAssignmentSyntax extends ISyntaxNode, IPropertyAssignmentSyntax { - propertyName: ISyntaxToken; + propertyName: IPropertyNameSyntax; colonToken: ISyntaxToken; expression: IExpressionSyntax; } - export interface SimplePropertyAssignmentConstructor { new (data: number, propertyName: ISyntaxToken, colonToken: ISyntaxToken, expression: IExpressionSyntax): SimplePropertyAssignmentSyntax } + export interface SimplePropertyAssignmentConstructor { new (data: number, propertyName: IPropertyNameSyntax, colonToken: ISyntaxToken, expression: IExpressionSyntax): SimplePropertyAssignmentSyntax } export interface FunctionPropertyAssignmentSyntax extends ISyntaxNode, IPropertyAssignmentSyntax { - propertyName: ISyntaxToken; + propertyName: IPropertyNameSyntax; callSignature: CallSignatureSyntax; block: BlockSyntax; } - export interface FunctionPropertyAssignmentConstructor { new (data: number, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax): FunctionPropertyAssignmentSyntax } + export interface FunctionPropertyAssignmentConstructor { new (data: number, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax): FunctionPropertyAssignmentSyntax } export interface ParameterSyntax extends ISyntaxNode { dotDotDotToken: ISyntaxToken; @@ -662,10 +662,10 @@ module TypeScript { export interface ParameterConstructor { new (data: number, dotDotDotToken: ISyntaxToken, modifiers: ISyntaxToken[], identifier: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax): ParameterSyntax } export interface EnumElementSyntax extends ISyntaxNode { - propertyName: ISyntaxToken; + propertyName: IPropertyNameSyntax; equalsValueClause: EqualsValueClauseSyntax; } - export interface EnumElementConstructor { new (data: number, propertyName: ISyntaxToken, equalsValueClause: EqualsValueClauseSyntax): EnumElementSyntax } + export interface EnumElementConstructor { new (data: number, propertyName: IPropertyNameSyntax, equalsValueClause: EqualsValueClauseSyntax): EnumElementSyntax } export interface TypeAnnotationSyntax extends ISyntaxNode { colonToken: ISyntaxToken; @@ -673,6 +673,13 @@ module TypeScript { } export interface TypeAnnotationConstructor { new (data: number, colonToken: ISyntaxToken, type: ITypeSyntax): TypeAnnotationSyntax } + export interface ComputedPropertyNameSyntax extends ISyntaxNode, IPropertyNameSyntax { + openBracketToken: ISyntaxToken; + expression: IExpressionSyntax; + closeBracketToken: ISyntaxToken; + } + export interface ComputedPropertyNameConstructor { new (data: number, openBracketToken: ISyntaxToken, expression: IExpressionSyntax, closeBracketToken: ISyntaxToken): ComputedPropertyNameSyntax } + export interface ExternalModuleReferenceSyntax extends ISyntaxNode, IModuleReferenceSyntax { requireKeyword: ISyntaxToken; openParenToken: ISyntaxToken; diff --git a/src/services/syntax/syntaxKind.ts b/src/services/syntax/syntaxKind.ts index 8af2e944834..a2100aabff9 100644 --- a/src/services/syntax/syntaxKind.ts +++ b/src/services/syntax/syntaxKind.ts @@ -261,14 +261,13 @@ module TypeScript { // Property Assignment SimplePropertyAssignment, - // GetAccessorPropertyAssignment, - // SetAccessorPropertyAssignment, FunctionPropertyAssignment, // Misc. Parameter, EnumElement, TypeAnnotation, + ComputedPropertyName, ExternalModuleReference, ModuleNameModuleReference, diff --git a/src/services/syntax/syntaxList.ts b/src/services/syntax/syntaxList.ts index dc880ea0fa0..235e3defd53 100644 --- a/src/services/syntax/syntaxList.ts +++ b/src/services/syntax/syntaxList.ts @@ -3,7 +3,7 @@ interface Array { __data: number; - kind(): TypeScript.SyntaxKind; + kind: TypeScript.SyntaxKind; parent: TypeScript.ISyntaxElement; } @@ -36,18 +36,16 @@ module TypeScript { } module TypeScript.Syntax { - function addArrayFunction(name: string, func: Function) { - if (Object.defineProperty) { - Object.defineProperty(Array.prototype, name, { value: func, writable: true }); + function addArrayPrototypeValue(name: string, val: any) { + if (Object.defineProperty && (Array.prototype)[name] === undefined) { + Object.defineProperty(Array.prototype, name, { value: val, writable: false }); } else { - (Array.prototype)[name] = func; + (Array.prototype)[name] = val; } } - addArrayFunction("kind", function () { - return SyntaxKind.List; - }); + addArrayPrototypeValue("kind", SyntaxKind.List); export function list(nodes: T[]): T[] { for (var i = 0, n = nodes.length; i < n; i++) { diff --git a/src/services/syntax/syntaxNodeOrToken.ts b/src/services/syntax/syntaxNodeOrToken.ts index 6cb173df11a..932970169f6 100644 --- a/src/services/syntax/syntaxNodeOrToken.ts +++ b/src/services/syntax/syntaxNodeOrToken.ts @@ -2,6 +2,7 @@ module TypeScript { export interface ISyntaxNodeOrToken extends ISyntaxElement { - _syntaxNodeOrTokenBrand: any; + childCount: number; + childAt(index: number): ISyntaxElement; } } \ No newline at end of file diff --git a/src/services/syntax/syntaxNodes.concrete.generated.ts b/src/services/syntax/syntaxNodes.concrete.generated.ts index f26ab254ea2..ddd52f90c1e 100644 --- a/src/services/syntax/syntaxNodes.concrete.generated.ts +++ b/src/services/syntax/syntaxNodes.concrete.generated.ts @@ -3,636 +3,1889 @@ module TypeScript { export var SourceUnitSyntax: SourceUnitConstructor = function(data: number, moduleElements: IModuleElementSyntax[], endOfFileToken: ISyntaxToken) { if (data) { this.__data = data; } - this.moduleElements = moduleElements, this.endOfFileToken = endOfFileToken; - moduleElements.parent = this, endOfFileToken.parent = this; + this.moduleElements = moduleElements, + this.endOfFileToken = endOfFileToken, + moduleElements.parent = this, + endOfFileToken.parent = this; }; - SourceUnitSyntax.prototype.kind = function() { return SyntaxKind.SourceUnit; } + SourceUnitSyntax.prototype.kind = SyntaxKind.SourceUnit; + SourceUnitSyntax.prototype.childCount = 2; + SourceUnitSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.moduleElements; + case 1: return this.endOfFileToken; + } + } export var QualifiedNameSyntax: QualifiedNameConstructor = function(data: number, left: INameSyntax, dotToken: ISyntaxToken, right: ISyntaxToken) { if (data) { this.__data = data; } - this.left = left, this.dotToken = dotToken, this.right = right; - left.parent = this, dotToken.parent = this, right.parent = this; + this.left = left, + this.dotToken = dotToken, + this.right = right, + left.parent = this, + dotToken.parent = this, + right.parent = this; }; - QualifiedNameSyntax.prototype.kind = function() { return SyntaxKind.QualifiedName; } + QualifiedNameSyntax.prototype.kind = SyntaxKind.QualifiedName; + QualifiedNameSyntax.prototype.childCount = 3; + QualifiedNameSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.left; + case 1: return this.dotToken; + case 2: return this.right; + } + } export var ObjectTypeSyntax: ObjectTypeConstructor = function(data: number, openBraceToken: ISyntaxToken, typeMembers: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken) { if (data) { this.__data = data; } - this.openBraceToken = openBraceToken, this.typeMembers = typeMembers, this.closeBraceToken = closeBraceToken; - openBraceToken.parent = this, typeMembers.parent = this, closeBraceToken.parent = this; + this.openBraceToken = openBraceToken, + this.typeMembers = typeMembers, + this.closeBraceToken = closeBraceToken, + openBraceToken.parent = this, + typeMembers.parent = this, + closeBraceToken.parent = this; }; - ObjectTypeSyntax.prototype.kind = function() { return SyntaxKind.ObjectType; } + ObjectTypeSyntax.prototype.kind = SyntaxKind.ObjectType; + ObjectTypeSyntax.prototype.childCount = 3; + ObjectTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBraceToken; + case 1: return this.typeMembers; + case 2: return this.closeBraceToken; + } + } export var FunctionTypeSyntax: FunctionTypeConstructor = function(data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax) { 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; + 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; }; - FunctionTypeSyntax.prototype.kind = function() { return SyntaxKind.FunctionType; } + FunctionTypeSyntax.prototype.kind = SyntaxKind.FunctionType; + FunctionTypeSyntax.prototype.childCount = 4; + FunctionTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.typeParameterList; + case 1: return this.parameterList; + case 2: return this.equalsGreaterThanToken; + case 3: return this.type; + } + } export var ArrayTypeSyntax: ArrayTypeConstructor = function(data: number, type: ITypeSyntax, openBracketToken: ISyntaxToken, closeBracketToken: ISyntaxToken) { if (data) { this.__data = data; } - this.type = type, this.openBracketToken = openBracketToken, this.closeBracketToken = closeBracketToken; - type.parent = this, openBracketToken.parent = this, closeBracketToken.parent = this; + this.type = type, + this.openBracketToken = openBracketToken, + this.closeBracketToken = closeBracketToken, + type.parent = this, + openBracketToken.parent = this, + closeBracketToken.parent = this; }; - ArrayTypeSyntax.prototype.kind = function() { return SyntaxKind.ArrayType; } + ArrayTypeSyntax.prototype.kind = SyntaxKind.ArrayType; + ArrayTypeSyntax.prototype.childCount = 3; + ArrayTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.type; + case 1: return this.openBracketToken; + case 2: return this.closeBracketToken; + } + } export var ConstructorTypeSyntax: ConstructorTypeConstructor = function(data: number, newKeyword: ISyntaxToken, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, equalsGreaterThanToken: ISyntaxToken, type: ITypeSyntax) { 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; + 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; }; - ConstructorTypeSyntax.prototype.kind = function() { return SyntaxKind.ConstructorType; } + ConstructorTypeSyntax.prototype.kind = SyntaxKind.ConstructorType; + ConstructorTypeSyntax.prototype.childCount = 5; + ConstructorTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.newKeyword; + case 1: return this.typeParameterList; + case 2: return this.parameterList; + case 3: return this.equalsGreaterThanToken; + case 4: return this.type; + } + } export var GenericTypeSyntax: GenericTypeConstructor = function(data: number, name: INameSyntax, typeArgumentList: TypeArgumentListSyntax) { if (data) { this.__data = data; } - this.name = name, this.typeArgumentList = typeArgumentList; - name.parent = this, typeArgumentList.parent = this; + this.name = name, + this.typeArgumentList = typeArgumentList, + name.parent = this, + typeArgumentList.parent = this; }; - GenericTypeSyntax.prototype.kind = function() { return SyntaxKind.GenericType; } + GenericTypeSyntax.prototype.kind = SyntaxKind.GenericType; + GenericTypeSyntax.prototype.childCount = 2; + GenericTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.name; + case 1: return this.typeArgumentList; + } + } export var TypeQuerySyntax: TypeQueryConstructor = function(data: number, typeOfKeyword: ISyntaxToken, name: INameSyntax) { if (data) { this.__data = data; } - this.typeOfKeyword = typeOfKeyword, this.name = name; - typeOfKeyword.parent = this, name.parent = this; + this.typeOfKeyword = typeOfKeyword, + this.name = name, + typeOfKeyword.parent = this, + name.parent = this; }; - TypeQuerySyntax.prototype.kind = function() { return SyntaxKind.TypeQuery; } + TypeQuerySyntax.prototype.kind = SyntaxKind.TypeQuery; + TypeQuerySyntax.prototype.childCount = 2; + TypeQuerySyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.typeOfKeyword; + case 1: return this.name; + } + } export var TupleTypeSyntax: TupleTypeConstructor = function(data: number, openBracketToken: ISyntaxToken, types: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken) { if (data) { this.__data = data; } - this.openBracketToken = openBracketToken, this.types = types, this.closeBracketToken = closeBracketToken; - openBracketToken.parent = this, types.parent = this, closeBracketToken.parent = this; + this.openBracketToken = openBracketToken, + this.types = types, + this.closeBracketToken = closeBracketToken, + openBracketToken.parent = this, + types.parent = this, + closeBracketToken.parent = this; }; - TupleTypeSyntax.prototype.kind = function() { return SyntaxKind.TupleType; } + TupleTypeSyntax.prototype.kind = SyntaxKind.TupleType; + TupleTypeSyntax.prototype.childCount = 3; + TupleTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBracketToken; + case 1: return this.types; + case 2: return this.closeBracketToken; + } + } export var UnionTypeSyntax: UnionTypeConstructor = function(data: number, left: ITypeSyntax, barToken: ISyntaxToken, right: ITypeSyntax) { if (data) { this.__data = data; } - this.left = left, this.barToken = barToken, this.right = right; - left.parent = this, barToken.parent = this, right.parent = this; + this.left = left, + this.barToken = barToken, + this.right = right, + left.parent = this, + barToken.parent = this, + right.parent = this; }; - UnionTypeSyntax.prototype.kind = function() { return SyntaxKind.UnionType; } + UnionTypeSyntax.prototype.kind = SyntaxKind.UnionType; + UnionTypeSyntax.prototype.childCount = 3; + UnionTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.left; + case 1: return this.barToken; + case 2: return this.right; + } + } export var ParenthesizedTypeSyntax: ParenthesizedTypeConstructor = function(data: number, openParenToken: ISyntaxToken, type: ITypeSyntax, closeParenToken: ISyntaxToken) { if (data) { this.__data = data; } - this.openParenToken = openParenToken, this.type = type, this.closeParenToken = closeParenToken; - openParenToken.parent = this, type.parent = this, closeParenToken.parent = this; + this.openParenToken = openParenToken, + this.type = type, + this.closeParenToken = closeParenToken, + openParenToken.parent = this, + type.parent = this, + closeParenToken.parent = this; }; - ParenthesizedTypeSyntax.prototype.kind = function() { return SyntaxKind.ParenthesizedType; } + ParenthesizedTypeSyntax.prototype.kind = SyntaxKind.ParenthesizedType; + ParenthesizedTypeSyntax.prototype.childCount = 3; + ParenthesizedTypeSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openParenToken; + case 1: return this.type; + case 2: return this.closeParenToken; + } + } export var InterfaceDeclarationSyntax: InterfaceDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], interfaceKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], body: ObjectTypeSyntax) { 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; + 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; }; - InterfaceDeclarationSyntax.prototype.kind = function() { return SyntaxKind.InterfaceDeclaration; } + InterfaceDeclarationSyntax.prototype.kind = SyntaxKind.InterfaceDeclaration; + InterfaceDeclarationSyntax.prototype.childCount = 6; + InterfaceDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.interfaceKeyword; + case 2: return this.identifier; + case 3: return this.typeParameterList; + case 4: return this.heritageClauses; + case 5: return this.body; + } + } export var FunctionDeclarationSyntax: FunctionDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken) { 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); + 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); }; - FunctionDeclarationSyntax.prototype.kind = function() { return SyntaxKind.FunctionDeclaration; } + FunctionDeclarationSyntax.prototype.kind = SyntaxKind.FunctionDeclaration; + FunctionDeclarationSyntax.prototype.childCount = 6; + FunctionDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.functionKeyword; + case 2: return this.identifier; + case 3: return this.callSignature; + case 4: return this.block; + case 5: return this.semicolonToken; + } + } export var ModuleDeclarationSyntax: ModuleDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], moduleKeyword: ISyntaxToken, name: INameSyntax, stringLiteral: ISyntaxToken, openBraceToken: ISyntaxToken, moduleElements: IModuleElementSyntax[], closeBraceToken: ISyntaxToken) { 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; + 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; }; - ModuleDeclarationSyntax.prototype.kind = function() { return SyntaxKind.ModuleDeclaration; } + ModuleDeclarationSyntax.prototype.kind = SyntaxKind.ModuleDeclaration; + ModuleDeclarationSyntax.prototype.childCount = 7; + ModuleDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.moduleKeyword; + case 2: return this.name; + case 3: return this.stringLiteral; + case 4: return this.openBraceToken; + case 5: return this.moduleElements; + case 6: return this.closeBraceToken; + } + } export var ClassDeclarationSyntax: ClassDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], classKeyword: ISyntaxToken, identifier: ISyntaxToken, typeParameterList: TypeParameterListSyntax, heritageClauses: HeritageClauseSyntax[], openBraceToken: ISyntaxToken, classElements: IClassElementSyntax[], closeBraceToken: ISyntaxToken) { 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; + 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; }; - ClassDeclarationSyntax.prototype.kind = function() { return SyntaxKind.ClassDeclaration; } + ClassDeclarationSyntax.prototype.kind = SyntaxKind.ClassDeclaration; + ClassDeclarationSyntax.prototype.childCount = 8; + ClassDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.classKeyword; + case 2: return this.identifier; + case 3: return this.typeParameterList; + case 4: return this.heritageClauses; + case 5: return this.openBraceToken; + case 6: return this.classElements; + case 7: return this.closeBraceToken; + } + } export var EnumDeclarationSyntax: EnumDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], enumKeyword: ISyntaxToken, identifier: ISyntaxToken, openBraceToken: ISyntaxToken, enumElements: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken) { 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; + 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; }; - EnumDeclarationSyntax.prototype.kind = function() { return SyntaxKind.EnumDeclaration; } + EnumDeclarationSyntax.prototype.kind = SyntaxKind.EnumDeclaration; + EnumDeclarationSyntax.prototype.childCount = 6; + EnumDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.enumKeyword; + case 2: return this.identifier; + case 3: return this.openBraceToken; + case 4: return this.enumElements; + case 5: return this.closeBraceToken; + } + } export var ImportDeclarationSyntax: ImportDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], importKeyword: ISyntaxToken, identifier: ISyntaxToken, equalsToken: ISyntaxToken, moduleReference: IModuleReferenceSyntax, semicolonToken: ISyntaxToken) { 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); + 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); }; - ImportDeclarationSyntax.prototype.kind = function() { return SyntaxKind.ImportDeclaration; } + ImportDeclarationSyntax.prototype.kind = SyntaxKind.ImportDeclaration; + ImportDeclarationSyntax.prototype.childCount = 6; + ImportDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.importKeyword; + case 2: return this.identifier; + case 3: return this.equalsToken; + case 4: return this.moduleReference; + case 5: return this.semicolonToken; + } + } export var ExportAssignmentSyntax: ExportAssignmentConstructor = function(data: number, exportKeyword: ISyntaxToken, equalsToken: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { 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); + 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); }; - ExportAssignmentSyntax.prototype.kind = function() { return SyntaxKind.ExportAssignment; } + ExportAssignmentSyntax.prototype.kind = SyntaxKind.ExportAssignment; + ExportAssignmentSyntax.prototype.childCount = 4; + ExportAssignmentSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.exportKeyword; + case 1: return this.equalsToken; + case 2: return this.identifier; + case 3: return this.semicolonToken; + } + } - export var MemberFunctionDeclarationSyntax: MemberFunctionDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken) { + export var MemberFunctionDeclarationSyntax: MemberFunctionDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken) { 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); + 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); }; - MemberFunctionDeclarationSyntax.prototype.kind = function() { return SyntaxKind.MemberFunctionDeclaration; } + MemberFunctionDeclarationSyntax.prototype.kind = SyntaxKind.MemberFunctionDeclaration; + MemberFunctionDeclarationSyntax.prototype.childCount = 5; + MemberFunctionDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.propertyName; + case 2: return this.callSignature; + case 3: return this.block; + case 4: return this.semicolonToken; + } + } export var MemberVariableDeclarationSyntax: MemberVariableDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken) { if (data) { this.__data = data; } - this.modifiers = modifiers, this.variableDeclarator = variableDeclarator, this.semicolonToken = semicolonToken; - modifiers.parent = this, variableDeclarator.parent = this, semicolonToken && (semicolonToken.parent = this); + this.modifiers = modifiers, + this.variableDeclarator = variableDeclarator, + this.semicolonToken = semicolonToken, + modifiers.parent = this, + variableDeclarator.parent = this, + semicolonToken && (semicolonToken.parent = this); }; - MemberVariableDeclarationSyntax.prototype.kind = function() { return SyntaxKind.MemberVariableDeclaration; } + MemberVariableDeclarationSyntax.prototype.kind = SyntaxKind.MemberVariableDeclaration; + MemberVariableDeclarationSyntax.prototype.childCount = 3; + MemberVariableDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.variableDeclarator; + case 2: return this.semicolonToken; + } + } export var ConstructorDeclarationSyntax: ConstructorDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], constructorKeyword: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax, semicolonToken: ISyntaxToken) { 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); + 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); }; - ConstructorDeclarationSyntax.prototype.kind = function() { return SyntaxKind.ConstructorDeclaration; } + ConstructorDeclarationSyntax.prototype.kind = SyntaxKind.ConstructorDeclaration; + ConstructorDeclarationSyntax.prototype.childCount = 5; + ConstructorDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.constructorKeyword; + case 2: return this.callSignature; + case 3: return this.block; + case 4: return this.semicolonToken; + } + } export var IndexMemberDeclarationSyntax: IndexMemberDeclarationConstructor = function(data: number, modifiers: ISyntaxToken[], indexSignature: IndexSignatureSyntax, semicolonToken: ISyntaxToken) { if (data) { this.__data = data; } - this.modifiers = modifiers, this.indexSignature = indexSignature, this.semicolonToken = semicolonToken; - modifiers.parent = this, indexSignature.parent = this, semicolonToken && (semicolonToken.parent = this); + this.modifiers = modifiers, + this.indexSignature = indexSignature, + this.semicolonToken = semicolonToken, + modifiers.parent = this, + indexSignature.parent = this, + semicolonToken && (semicolonToken.parent = this); }; - IndexMemberDeclarationSyntax.prototype.kind = function() { return SyntaxKind.IndexMemberDeclaration; } + IndexMemberDeclarationSyntax.prototype.kind = SyntaxKind.IndexMemberDeclaration; + IndexMemberDeclarationSyntax.prototype.childCount = 3; + IndexMemberDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.indexSignature; + case 2: return this.semicolonToken; + } + } - export var GetAccessorSyntax: GetAccessorConstructor = function(data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { + export var GetAccessorSyntax: GetAccessorConstructor = function(data: number, modifiers: ISyntaxToken[], getKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax) { 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; + 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; }; - GetAccessorSyntax.prototype.kind = function() { return SyntaxKind.GetAccessor; } + GetAccessorSyntax.prototype.kind = SyntaxKind.GetAccessor; + GetAccessorSyntax.prototype.childCount = 5; + GetAccessorSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.getKeyword; + case 2: return this.propertyName; + case 3: return this.callSignature; + case 4: return this.block; + } + } - export var SetAccessorSyntax: SetAccessorConstructor = function(data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { + export var SetAccessorSyntax: SetAccessorConstructor = function(data: number, modifiers: ISyntaxToken[], setKeyword: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax) { 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; + 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; }; - SetAccessorSyntax.prototype.kind = function() { return SyntaxKind.SetAccessor; } + SetAccessorSyntax.prototype.kind = SyntaxKind.SetAccessor; + SetAccessorSyntax.prototype.childCount = 5; + SetAccessorSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.setKeyword; + case 2: return this.propertyName; + case 3: return this.callSignature; + case 4: return this.block; + } + } - export var PropertySignatureSyntax: PropertySignatureConstructor = function(data: number, propertyName: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax) { + export var PropertySignatureSyntax: PropertySignatureConstructor = function(data: number, propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax) { 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); + this.propertyName = propertyName, + this.questionToken = questionToken, + this.typeAnnotation = typeAnnotation, + propertyName.parent = this, + questionToken && (questionToken.parent = this), + typeAnnotation && (typeAnnotation.parent = this); }; - PropertySignatureSyntax.prototype.kind = function() { return SyntaxKind.PropertySignature; } + PropertySignatureSyntax.prototype.kind = SyntaxKind.PropertySignature; + PropertySignatureSyntax.prototype.childCount = 3; + PropertySignatureSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.propertyName; + case 1: return this.questionToken; + case 2: return this.typeAnnotation; + } + } export var CallSignatureSyntax: CallSignatureConstructor = function(data: number, typeParameterList: TypeParameterListSyntax, parameterList: ParameterListSyntax, typeAnnotation: TypeAnnotationSyntax) { 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); + this.typeParameterList = typeParameterList, + this.parameterList = parameterList, + this.typeAnnotation = typeAnnotation, + typeParameterList && (typeParameterList.parent = this), + parameterList.parent = this, + typeAnnotation && (typeAnnotation.parent = this); }; - CallSignatureSyntax.prototype.kind = function() { return SyntaxKind.CallSignature; } + CallSignatureSyntax.prototype.kind = SyntaxKind.CallSignature; + CallSignatureSyntax.prototype.childCount = 3; + CallSignatureSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.typeParameterList; + case 1: return this.parameterList; + case 2: return this.typeAnnotation; + } + } export var ConstructSignatureSyntax: ConstructSignatureConstructor = function(data: number, newKeyword: ISyntaxToken, callSignature: CallSignatureSyntax) { if (data) { this.__data = data; } - this.newKeyword = newKeyword, this.callSignature = callSignature; - newKeyword.parent = this, callSignature.parent = this; + this.newKeyword = newKeyword, + this.callSignature = callSignature, + newKeyword.parent = this, + callSignature.parent = this; }; - ConstructSignatureSyntax.prototype.kind = function() { return SyntaxKind.ConstructSignature; } + ConstructSignatureSyntax.prototype.kind = SyntaxKind.ConstructSignature; + ConstructSignatureSyntax.prototype.childCount = 2; + ConstructSignatureSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.newKeyword; + case 1: return this.callSignature; + } + } export var IndexSignatureSyntax: IndexSignatureConstructor = function(data: number, openBracketToken: ISyntaxToken, parameters: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax) { 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); + 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); }; - IndexSignatureSyntax.prototype.kind = function() { return SyntaxKind.IndexSignature; } + IndexSignatureSyntax.prototype.kind = SyntaxKind.IndexSignature; + IndexSignatureSyntax.prototype.childCount = 4; + IndexSignatureSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBracketToken; + case 1: return this.parameters; + case 2: return this.closeBracketToken; + case 3: return this.typeAnnotation; + } + } - export var MethodSignatureSyntax: MethodSignatureConstructor = function(data: number, propertyName: ISyntaxToken, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax) { + export var MethodSignatureSyntax: MethodSignatureConstructor = function(data: number, propertyName: IPropertyNameSyntax, questionToken: ISyntaxToken, callSignature: CallSignatureSyntax) { if (data) { this.__data = data; } - this.propertyName = propertyName, this.questionToken = questionToken, this.callSignature = callSignature; - propertyName.parent = this, questionToken && (questionToken.parent = this), callSignature.parent = this; + this.propertyName = propertyName, + this.questionToken = questionToken, + this.callSignature = callSignature, + propertyName.parent = this, + questionToken && (questionToken.parent = this), + callSignature.parent = this; }; - MethodSignatureSyntax.prototype.kind = function() { return SyntaxKind.MethodSignature; } + MethodSignatureSyntax.prototype.kind = SyntaxKind.MethodSignature; + MethodSignatureSyntax.prototype.childCount = 3; + MethodSignatureSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.propertyName; + case 1: return this.questionToken; + case 2: return this.callSignature; + } + } export var BlockSyntax: BlockConstructor = function(data: number, openBraceToken: ISyntaxToken, statements: IStatementSyntax[], closeBraceToken: ISyntaxToken) { if (data) { this.__data = data; } - this.openBraceToken = openBraceToken, this.statements = statements, this.closeBraceToken = closeBraceToken; - openBraceToken.parent = this, statements.parent = this, closeBraceToken.parent = this; + this.openBraceToken = openBraceToken, + this.statements = statements, + this.closeBraceToken = closeBraceToken, + openBraceToken.parent = this, + statements.parent = this, + closeBraceToken.parent = this; }; - BlockSyntax.prototype.kind = function() { return SyntaxKind.Block; } + BlockSyntax.prototype.kind = SyntaxKind.Block; + BlockSyntax.prototype.childCount = 3; + BlockSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBraceToken; + case 1: return this.statements; + case 2: return this.closeBraceToken; + } + } export var IfStatementSyntax: IfStatementConstructor = function(data: number, ifKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax, elseClause: ElseClauseSyntax) { 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); + 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); }; - IfStatementSyntax.prototype.kind = function() { return SyntaxKind.IfStatement; } + IfStatementSyntax.prototype.kind = SyntaxKind.IfStatement; + IfStatementSyntax.prototype.childCount = 6; + IfStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.ifKeyword; + case 1: return this.openParenToken; + case 2: return this.condition; + case 3: return this.closeParenToken; + case 4: return this.statement; + case 5: return this.elseClause; + } + } export var VariableStatementSyntax: VariableStatementConstructor = function(data: number, modifiers: ISyntaxToken[], variableDeclaration: VariableDeclarationSyntax, semicolonToken: ISyntaxToken) { if (data) { this.__data = data; } - this.modifiers = modifiers, this.variableDeclaration = variableDeclaration, this.semicolonToken = semicolonToken; - modifiers.parent = this, variableDeclaration.parent = this, semicolonToken && (semicolonToken.parent = this); + this.modifiers = modifiers, + this.variableDeclaration = variableDeclaration, + this.semicolonToken = semicolonToken, + modifiers.parent = this, + variableDeclaration.parent = this, + semicolonToken && (semicolonToken.parent = this); }; - VariableStatementSyntax.prototype.kind = function() { return SyntaxKind.VariableStatement; } + VariableStatementSyntax.prototype.kind = SyntaxKind.VariableStatement; + VariableStatementSyntax.prototype.childCount = 3; + VariableStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.modifiers; + case 1: return this.variableDeclaration; + case 2: return this.semicolonToken; + } + } export var ExpressionStatementSyntax: ExpressionStatementConstructor = function(data: number, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { if (data) { this.__data = data; } - this.expression = expression, this.semicolonToken = semicolonToken; - expression.parent = this, semicolonToken && (semicolonToken.parent = this); + this.expression = expression, + this.semicolonToken = semicolonToken, + expression.parent = this, + semicolonToken && (semicolonToken.parent = this); }; - ExpressionStatementSyntax.prototype.kind = function() { return SyntaxKind.ExpressionStatement; } + ExpressionStatementSyntax.prototype.kind = SyntaxKind.ExpressionStatement; + ExpressionStatementSyntax.prototype.childCount = 2; + ExpressionStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.expression; + case 1: return this.semicolonToken; + } + } export var ReturnStatementSyntax: ReturnStatementConstructor = function(data: number, returnKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { 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); + this.returnKeyword = returnKeyword, + this.expression = expression, + this.semicolonToken = semicolonToken, + returnKeyword.parent = this, + expression && (expression.parent = this), + semicolonToken && (semicolonToken.parent = this); }; - ReturnStatementSyntax.prototype.kind = function() { return SyntaxKind.ReturnStatement; } + ReturnStatementSyntax.prototype.kind = SyntaxKind.ReturnStatement; + ReturnStatementSyntax.prototype.childCount = 3; + ReturnStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.returnKeyword; + case 1: return this.expression; + case 2: return this.semicolonToken; + } + } export var SwitchStatementSyntax: SwitchStatementConstructor = function(data: number, switchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, openBraceToken: ISyntaxToken, switchClauses: ISwitchClauseSyntax[], closeBraceToken: ISyntaxToken) { 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; + 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; }; - SwitchStatementSyntax.prototype.kind = function() { return SyntaxKind.SwitchStatement; } + SwitchStatementSyntax.prototype.kind = SyntaxKind.SwitchStatement; + SwitchStatementSyntax.prototype.childCount = 7; + SwitchStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.switchKeyword; + case 1: return this.openParenToken; + case 2: return this.expression; + case 3: return this.closeParenToken; + case 4: return this.openBraceToken; + case 5: return this.switchClauses; + case 6: return this.closeBraceToken; + } + } export var BreakStatementSyntax: BreakStatementConstructor = function(data: number, breakKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { 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); + this.breakKeyword = breakKeyword, + this.identifier = identifier, + this.semicolonToken = semicolonToken, + breakKeyword.parent = this, + identifier && (identifier.parent = this), + semicolonToken && (semicolonToken.parent = this); }; - BreakStatementSyntax.prototype.kind = function() { return SyntaxKind.BreakStatement; } + BreakStatementSyntax.prototype.kind = SyntaxKind.BreakStatement; + BreakStatementSyntax.prototype.childCount = 3; + BreakStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.breakKeyword; + case 1: return this.identifier; + case 2: return this.semicolonToken; + } + } export var ContinueStatementSyntax: ContinueStatementConstructor = function(data: number, continueKeyword: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken) { 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); + this.continueKeyword = continueKeyword, + this.identifier = identifier, + this.semicolonToken = semicolonToken, + continueKeyword.parent = this, + identifier && (identifier.parent = this), + semicolonToken && (semicolonToken.parent = this); }; - ContinueStatementSyntax.prototype.kind = function() { return SyntaxKind.ContinueStatement; } + ContinueStatementSyntax.prototype.kind = SyntaxKind.ContinueStatement; + ContinueStatementSyntax.prototype.childCount = 3; + ContinueStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.continueKeyword; + case 1: return this.identifier; + case 2: return this.semicolonToken; + } + } export var ForStatementSyntax: ForStatementConstructor = function(data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, initializer: IExpressionSyntax, firstSemicolonToken: ISyntaxToken, condition: IExpressionSyntax, secondSemicolonToken: ISyntaxToken, incrementor: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { 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; + 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; }; - ForStatementSyntax.prototype.kind = function() { return SyntaxKind.ForStatement; } + ForStatementSyntax.prototype.kind = SyntaxKind.ForStatement; + ForStatementSyntax.prototype.childCount = 10; + ForStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.forKeyword; + case 1: return this.openParenToken; + case 2: return this.variableDeclaration; + case 3: return this.initializer; + case 4: return this.firstSemicolonToken; + case 5: return this.condition; + case 6: return this.secondSemicolonToken; + case 7: return this.incrementor; + case 8: return this.closeParenToken; + case 9: return this.statement; + } + } export var ForInStatementSyntax: ForInStatementConstructor = function(data: number, forKeyword: ISyntaxToken, openParenToken: ISyntaxToken, variableDeclaration: VariableDeclarationSyntax, left: IExpressionSyntax, inKeyword: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { 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; + 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; }; - ForInStatementSyntax.prototype.kind = function() { return SyntaxKind.ForInStatement; } + ForInStatementSyntax.prototype.kind = SyntaxKind.ForInStatement; + ForInStatementSyntax.prototype.childCount = 8; + ForInStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.forKeyword; + case 1: return this.openParenToken; + case 2: return this.variableDeclaration; + case 3: return this.left; + case 4: return this.inKeyword; + case 5: return this.expression; + case 6: return this.closeParenToken; + case 7: return this.statement; + } + } export var EmptyStatementSyntax: EmptyStatementConstructor = function(data: number, semicolonToken: ISyntaxToken) { if (data) { this.__data = data; } - this.semicolonToken = semicolonToken; + this.semicolonToken = semicolonToken, semicolonToken.parent = this; }; - EmptyStatementSyntax.prototype.kind = function() { return SyntaxKind.EmptyStatement; } + EmptyStatementSyntax.prototype.kind = SyntaxKind.EmptyStatement; + EmptyStatementSyntax.prototype.childCount = 1; + EmptyStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.semicolonToken; + } + } export var ThrowStatementSyntax: ThrowStatementConstructor = function(data: number, throwKeyword: ISyntaxToken, expression: IExpressionSyntax, semicolonToken: ISyntaxToken) { if (data) { this.__data = data; } - this.throwKeyword = throwKeyword, this.expression = expression, this.semicolonToken = semicolonToken; - throwKeyword.parent = this, expression.parent = this, semicolonToken && (semicolonToken.parent = this); + this.throwKeyword = throwKeyword, + this.expression = expression, + this.semicolonToken = semicolonToken, + throwKeyword.parent = this, + expression.parent = this, + semicolonToken && (semicolonToken.parent = this); }; - ThrowStatementSyntax.prototype.kind = function() { return SyntaxKind.ThrowStatement; } + ThrowStatementSyntax.prototype.kind = SyntaxKind.ThrowStatement; + ThrowStatementSyntax.prototype.childCount = 3; + ThrowStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.throwKeyword; + case 1: return this.expression; + case 2: return this.semicolonToken; + } + } export var WhileStatementSyntax: WhileStatementConstructor = function(data: number, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { 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; + 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; }; - WhileStatementSyntax.prototype.kind = function() { return SyntaxKind.WhileStatement; } + WhileStatementSyntax.prototype.kind = SyntaxKind.WhileStatement; + WhileStatementSyntax.prototype.childCount = 5; + WhileStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.whileKeyword; + case 1: return this.openParenToken; + case 2: return this.condition; + case 3: return this.closeParenToken; + case 4: return this.statement; + } + } export var TryStatementSyntax: TryStatementConstructor = function(data: number, tryKeyword: ISyntaxToken, block: BlockSyntax, catchClause: CatchClauseSyntax, finallyClause: FinallyClauseSyntax) { 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); + 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); }; - TryStatementSyntax.prototype.kind = function() { return SyntaxKind.TryStatement; } + TryStatementSyntax.prototype.kind = SyntaxKind.TryStatement; + TryStatementSyntax.prototype.childCount = 4; + TryStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.tryKeyword; + case 1: return this.block; + case 2: return this.catchClause; + case 3: return this.finallyClause; + } + } export var LabeledStatementSyntax: LabeledStatementConstructor = function(data: number, identifier: ISyntaxToken, colonToken: ISyntaxToken, statement: IStatementSyntax) { if (data) { this.__data = data; } - this.identifier = identifier, this.colonToken = colonToken, this.statement = statement; - identifier.parent = this, colonToken.parent = this, statement.parent = this; + this.identifier = identifier, + this.colonToken = colonToken, + this.statement = statement, + identifier.parent = this, + colonToken.parent = this, + statement.parent = this; }; - LabeledStatementSyntax.prototype.kind = function() { return SyntaxKind.LabeledStatement; } + LabeledStatementSyntax.prototype.kind = SyntaxKind.LabeledStatement; + LabeledStatementSyntax.prototype.childCount = 3; + LabeledStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.identifier; + case 1: return this.colonToken; + case 2: return this.statement; + } + } export var DoStatementSyntax: DoStatementConstructor = function(data: number, doKeyword: ISyntaxToken, statement: IStatementSyntax, whileKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, semicolonToken: ISyntaxToken) { 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); + 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); }; - DoStatementSyntax.prototype.kind = function() { return SyntaxKind.DoStatement; } + DoStatementSyntax.prototype.kind = SyntaxKind.DoStatement; + DoStatementSyntax.prototype.childCount = 7; + DoStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.doKeyword; + case 1: return this.statement; + case 2: return this.whileKeyword; + case 3: return this.openParenToken; + case 4: return this.condition; + case 5: return this.closeParenToken; + case 6: return this.semicolonToken; + } + } export var DebuggerStatementSyntax: DebuggerStatementConstructor = function(data: number, debuggerKeyword: ISyntaxToken, semicolonToken: ISyntaxToken) { if (data) { this.__data = data; } - this.debuggerKeyword = debuggerKeyword, this.semicolonToken = semicolonToken; - debuggerKeyword.parent = this, semicolonToken && (semicolonToken.parent = this); + this.debuggerKeyword = debuggerKeyword, + this.semicolonToken = semicolonToken, + debuggerKeyword.parent = this, + semicolonToken && (semicolonToken.parent = this); }; - DebuggerStatementSyntax.prototype.kind = function() { return SyntaxKind.DebuggerStatement; } + DebuggerStatementSyntax.prototype.kind = SyntaxKind.DebuggerStatement; + DebuggerStatementSyntax.prototype.childCount = 2; + DebuggerStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.debuggerKeyword; + case 1: return this.semicolonToken; + } + } export var WithStatementSyntax: WithStatementConstructor = function(data: number, withKeyword: ISyntaxToken, openParenToken: ISyntaxToken, condition: IExpressionSyntax, closeParenToken: ISyntaxToken, statement: IStatementSyntax) { 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; + 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; }; - WithStatementSyntax.prototype.kind = function() { return SyntaxKind.WithStatement; } + WithStatementSyntax.prototype.kind = SyntaxKind.WithStatement; + WithStatementSyntax.prototype.childCount = 5; + WithStatementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.withKeyword; + case 1: return this.openParenToken; + case 2: return this.condition; + case 3: return this.closeParenToken; + case 4: return this.statement; + } + } export var PrefixUnaryExpressionSyntax: PrefixUnaryExpressionConstructor = function(data: number, operatorToken: ISyntaxToken, operand: IUnaryExpressionSyntax) { if (data) { this.__data = data; } - this.operatorToken = operatorToken, this.operand = operand; - operatorToken.parent = this, operand.parent = this; + this.operatorToken = operatorToken, + this.operand = operand, + operatorToken.parent = this, + operand.parent = this; }; - PrefixUnaryExpressionSyntax.prototype.kind = function() { return SyntaxKind.PrefixUnaryExpression; } + PrefixUnaryExpressionSyntax.prototype.kind = SyntaxKind.PrefixUnaryExpression; + PrefixUnaryExpressionSyntax.prototype.childCount = 2; + PrefixUnaryExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.operatorToken; + case 1: return this.operand; + } + } export var DeleteExpressionSyntax: DeleteExpressionConstructor = function(data: number, deleteKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { if (data) { this.__data = data; } - this.deleteKeyword = deleteKeyword, this.expression = expression; - deleteKeyword.parent = this, expression.parent = this; + this.deleteKeyword = deleteKeyword, + this.expression = expression, + deleteKeyword.parent = this, + expression.parent = this; }; - DeleteExpressionSyntax.prototype.kind = function() { return SyntaxKind.DeleteExpression; } + DeleteExpressionSyntax.prototype.kind = SyntaxKind.DeleteExpression; + DeleteExpressionSyntax.prototype.childCount = 2; + DeleteExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.deleteKeyword; + case 1: return this.expression; + } + } export var TypeOfExpressionSyntax: TypeOfExpressionConstructor = function(data: number, typeOfKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { if (data) { this.__data = data; } - this.typeOfKeyword = typeOfKeyword, this.expression = expression; - typeOfKeyword.parent = this, expression.parent = this; + this.typeOfKeyword = typeOfKeyword, + this.expression = expression, + typeOfKeyword.parent = this, + expression.parent = this; }; - TypeOfExpressionSyntax.prototype.kind = function() { return SyntaxKind.TypeOfExpression; } + TypeOfExpressionSyntax.prototype.kind = SyntaxKind.TypeOfExpression; + TypeOfExpressionSyntax.prototype.childCount = 2; + TypeOfExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.typeOfKeyword; + case 1: return this.expression; + } + } export var VoidExpressionSyntax: VoidExpressionConstructor = function(data: number, voidKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) { if (data) { this.__data = data; } - this.voidKeyword = voidKeyword, this.expression = expression; - voidKeyword.parent = this, expression.parent = this; + this.voidKeyword = voidKeyword, + this.expression = expression, + voidKeyword.parent = this, + expression.parent = this; }; - VoidExpressionSyntax.prototype.kind = function() { return SyntaxKind.VoidExpression; } + VoidExpressionSyntax.prototype.kind = SyntaxKind.VoidExpression; + VoidExpressionSyntax.prototype.childCount = 2; + VoidExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.voidKeyword; + case 1: return this.expression; + } + } export var ConditionalExpressionSyntax: ConditionalExpressionConstructor = function(data: number, condition: IExpressionSyntax, questionToken: ISyntaxToken, whenTrue: IExpressionSyntax, colonToken: ISyntaxToken, whenFalse: IExpressionSyntax) { 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; + 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; }; - ConditionalExpressionSyntax.prototype.kind = function() { return SyntaxKind.ConditionalExpression; } + ConditionalExpressionSyntax.prototype.kind = SyntaxKind.ConditionalExpression; + ConditionalExpressionSyntax.prototype.childCount = 5; + ConditionalExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.condition; + case 1: return this.questionToken; + case 2: return this.whenTrue; + case 3: return this.colonToken; + case 4: return this.whenFalse; + } + } export var BinaryExpressionSyntax: BinaryExpressionConstructor = function(data: number, left: IExpressionSyntax, operatorToken: ISyntaxToken, right: IExpressionSyntax) { if (data) { this.__data = data; } - this.left = left, this.operatorToken = operatorToken, this.right = right; - left.parent = this, operatorToken.parent = this, right.parent = this; + this.left = left, + this.operatorToken = operatorToken, + this.right = right, + left.parent = this, + operatorToken.parent = this, + right.parent = this; }; - BinaryExpressionSyntax.prototype.kind = function() { return SyntaxKind.BinaryExpression; } + BinaryExpressionSyntax.prototype.kind = SyntaxKind.BinaryExpression; + BinaryExpressionSyntax.prototype.childCount = 3; + BinaryExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.left; + case 1: return this.operatorToken; + case 2: return this.right; + } + } export var PostfixUnaryExpressionSyntax: PostfixUnaryExpressionConstructor = function(data: number, operand: ILeftHandSideExpressionSyntax, operatorToken: ISyntaxToken) { if (data) { this.__data = data; } - this.operand = operand, this.operatorToken = operatorToken; - operand.parent = this, operatorToken.parent = this; + this.operand = operand, + this.operatorToken = operatorToken, + operand.parent = this, + operatorToken.parent = this; }; - PostfixUnaryExpressionSyntax.prototype.kind = function() { return SyntaxKind.PostfixUnaryExpression; } + PostfixUnaryExpressionSyntax.prototype.kind = SyntaxKind.PostfixUnaryExpression; + PostfixUnaryExpressionSyntax.prototype.childCount = 2; + PostfixUnaryExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.operand; + case 1: return this.operatorToken; + } + } export var MemberAccessExpressionSyntax: MemberAccessExpressionConstructor = function(data: number, expression: ILeftHandSideExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken) { if (data) { this.__data = data; } - this.expression = expression, this.dotToken = dotToken, this.name = name; - expression.parent = this, dotToken.parent = this, name.parent = this; + this.expression = expression, + this.dotToken = dotToken, + this.name = name, + expression.parent = this, + dotToken.parent = this, + name.parent = this; }; - MemberAccessExpressionSyntax.prototype.kind = function() { return SyntaxKind.MemberAccessExpression; } + MemberAccessExpressionSyntax.prototype.kind = SyntaxKind.MemberAccessExpression; + MemberAccessExpressionSyntax.prototype.childCount = 3; + MemberAccessExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.expression; + case 1: return this.dotToken; + case 2: return this.name; + } + } export var InvocationExpressionSyntax: InvocationExpressionConstructor = function(data: number, expression: ILeftHandSideExpressionSyntax, argumentList: ArgumentListSyntax) { if (data) { this.__data = data; } - this.expression = expression, this.argumentList = argumentList; - expression.parent = this, argumentList.parent = this; + this.expression = expression, + this.argumentList = argumentList, + expression.parent = this, + argumentList.parent = this; }; - InvocationExpressionSyntax.prototype.kind = function() { return SyntaxKind.InvocationExpression; } + InvocationExpressionSyntax.prototype.kind = SyntaxKind.InvocationExpression; + InvocationExpressionSyntax.prototype.childCount = 2; + InvocationExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.expression; + case 1: return this.argumentList; + } + } export var ArrayLiteralExpressionSyntax: ArrayLiteralExpressionConstructor = function(data: number, openBracketToken: ISyntaxToken, expressions: ISeparatedSyntaxList, closeBracketToken: ISyntaxToken) { if (data) { this.__data = data; } - this.openBracketToken = openBracketToken, this.expressions = expressions, this.closeBracketToken = closeBracketToken; - openBracketToken.parent = this, expressions.parent = this, closeBracketToken.parent = this; + this.openBracketToken = openBracketToken, + this.expressions = expressions, + this.closeBracketToken = closeBracketToken, + openBracketToken.parent = this, + expressions.parent = this, + closeBracketToken.parent = this; }; - ArrayLiteralExpressionSyntax.prototype.kind = function() { return SyntaxKind.ArrayLiteralExpression; } + ArrayLiteralExpressionSyntax.prototype.kind = SyntaxKind.ArrayLiteralExpression; + ArrayLiteralExpressionSyntax.prototype.childCount = 3; + ArrayLiteralExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBracketToken; + case 1: return this.expressions; + case 2: return this.closeBracketToken; + } + } export var ObjectLiteralExpressionSyntax: ObjectLiteralExpressionConstructor = function(data: number, openBraceToken: ISyntaxToken, propertyAssignments: ISeparatedSyntaxList, closeBraceToken: ISyntaxToken) { if (data) { this.__data = data; } - this.openBraceToken = openBraceToken, this.propertyAssignments = propertyAssignments, this.closeBraceToken = closeBraceToken; - openBraceToken.parent = this, propertyAssignments.parent = this, closeBraceToken.parent = this; + this.openBraceToken = openBraceToken, + this.propertyAssignments = propertyAssignments, + this.closeBraceToken = closeBraceToken, + openBraceToken.parent = this, + propertyAssignments.parent = this, + closeBraceToken.parent = this; }; - ObjectLiteralExpressionSyntax.prototype.kind = function() { return SyntaxKind.ObjectLiteralExpression; } + ObjectLiteralExpressionSyntax.prototype.kind = SyntaxKind.ObjectLiteralExpression; + ObjectLiteralExpressionSyntax.prototype.childCount = 3; + ObjectLiteralExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBraceToken; + case 1: return this.propertyAssignments; + case 2: return this.closeBraceToken; + } + } export var ObjectCreationExpressionSyntax: ObjectCreationExpressionConstructor = function(data: number, newKeyword: ISyntaxToken, expression: IMemberExpressionSyntax, argumentList: ArgumentListSyntax) { if (data) { this.__data = data; } - this.newKeyword = newKeyword, this.expression = expression, this.argumentList = argumentList; - newKeyword.parent = this, expression.parent = this, argumentList && (argumentList.parent = this); + this.newKeyword = newKeyword, + this.expression = expression, + this.argumentList = argumentList, + newKeyword.parent = this, + expression.parent = this, + argumentList && (argumentList.parent = this); }; - ObjectCreationExpressionSyntax.prototype.kind = function() { return SyntaxKind.ObjectCreationExpression; } + ObjectCreationExpressionSyntax.prototype.kind = SyntaxKind.ObjectCreationExpression; + ObjectCreationExpressionSyntax.prototype.childCount = 3; + ObjectCreationExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.newKeyword; + case 1: return this.expression; + case 2: return this.argumentList; + } + } export var ParenthesizedExpressionSyntax: ParenthesizedExpressionConstructor = function(data: number, openParenToken: ISyntaxToken, expression: IExpressionSyntax, closeParenToken: ISyntaxToken) { if (data) { this.__data = data; } - this.openParenToken = openParenToken, this.expression = expression, this.closeParenToken = closeParenToken; - openParenToken.parent = this, expression.parent = this, closeParenToken.parent = this; + this.openParenToken = openParenToken, + this.expression = expression, + this.closeParenToken = closeParenToken, + openParenToken.parent = this, + expression.parent = this, + closeParenToken.parent = this; }; - ParenthesizedExpressionSyntax.prototype.kind = function() { return SyntaxKind.ParenthesizedExpression; } + ParenthesizedExpressionSyntax.prototype.kind = SyntaxKind.ParenthesizedExpression; + ParenthesizedExpressionSyntax.prototype.childCount = 3; + ParenthesizedExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openParenToken; + case 1: return this.expression; + case 2: return this.closeParenToken; + } + } export var ParenthesizedArrowFunctionExpressionSyntax: ParenthesizedArrowFunctionExpressionConstructor = function(data: number, callSignature: CallSignatureSyntax, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax) { 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); + 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); }; - ParenthesizedArrowFunctionExpressionSyntax.prototype.kind = function() { return SyntaxKind.ParenthesizedArrowFunctionExpression; } + ParenthesizedArrowFunctionExpressionSyntax.prototype.kind = SyntaxKind.ParenthesizedArrowFunctionExpression; + ParenthesizedArrowFunctionExpressionSyntax.prototype.childCount = 4; + ParenthesizedArrowFunctionExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.callSignature; + case 1: return this.equalsGreaterThanToken; + case 2: return this.block; + case 3: return this.expression; + } + } export var SimpleArrowFunctionExpressionSyntax: SimpleArrowFunctionExpressionConstructor = function(data: number, parameter: ParameterSyntax, equalsGreaterThanToken: ISyntaxToken, block: BlockSyntax, expression: IExpressionSyntax) { 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); + 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); }; - SimpleArrowFunctionExpressionSyntax.prototype.kind = function() { return SyntaxKind.SimpleArrowFunctionExpression; } + SimpleArrowFunctionExpressionSyntax.prototype.kind = SyntaxKind.SimpleArrowFunctionExpression; + SimpleArrowFunctionExpressionSyntax.prototype.childCount = 4; + SimpleArrowFunctionExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.parameter; + case 1: return this.equalsGreaterThanToken; + case 2: return this.block; + case 3: return this.expression; + } + } export var CastExpressionSyntax: CastExpressionConstructor = function(data: number, lessThanToken: ISyntaxToken, type: ITypeSyntax, greaterThanToken: ISyntaxToken, expression: IUnaryExpressionSyntax) { 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; + this.lessThanToken = lessThanToken, + this.type = type, + this.greaterThanToken = greaterThanToken, + this.expression = expression, + lessThanToken.parent = this, + type.parent = this, + greaterThanToken.parent = this, + expression.parent = this; }; - CastExpressionSyntax.prototype.kind = function() { return SyntaxKind.CastExpression; } + CastExpressionSyntax.prototype.kind = SyntaxKind.CastExpression; + CastExpressionSyntax.prototype.childCount = 4; + CastExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.lessThanToken; + case 1: return this.type; + case 2: return this.greaterThanToken; + case 3: return this.expression; + } + } export var ElementAccessExpressionSyntax: ElementAccessExpressionConstructor = function(data: number, expression: ILeftHandSideExpressionSyntax, openBracketToken: ISyntaxToken, argumentExpression: IExpressionSyntax, closeBracketToken: ISyntaxToken) { 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; + this.expression = expression, + this.openBracketToken = openBracketToken, + this.argumentExpression = argumentExpression, + this.closeBracketToken = closeBracketToken, + expression.parent = this, + openBracketToken.parent = this, + argumentExpression.parent = this, + closeBracketToken.parent = this; }; - ElementAccessExpressionSyntax.prototype.kind = function() { return SyntaxKind.ElementAccessExpression; } + ElementAccessExpressionSyntax.prototype.kind = SyntaxKind.ElementAccessExpression; + ElementAccessExpressionSyntax.prototype.childCount = 4; + ElementAccessExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.expression; + case 1: return this.openBracketToken; + case 2: return this.argumentExpression; + case 3: return this.closeBracketToken; + } + } export var FunctionExpressionSyntax: FunctionExpressionConstructor = function(data: number, functionKeyword: ISyntaxToken, identifier: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { 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; + 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; }; - FunctionExpressionSyntax.prototype.kind = function() { return SyntaxKind.FunctionExpression; } + FunctionExpressionSyntax.prototype.kind = SyntaxKind.FunctionExpression; + FunctionExpressionSyntax.prototype.childCount = 4; + FunctionExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.functionKeyword; + case 1: return this.identifier; + case 2: return this.callSignature; + case 3: return this.block; + } + } export var OmittedExpressionSyntax: OmittedExpressionConstructor = function(data: number) { if (data) { this.__data = data; } }; - OmittedExpressionSyntax.prototype.kind = function() { return SyntaxKind.OmittedExpression; } + OmittedExpressionSyntax.prototype.kind = SyntaxKind.OmittedExpression; + OmittedExpressionSyntax.prototype.childCount = 0; + OmittedExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + throw Errors.invalidOperation(); + } export var TemplateExpressionSyntax: TemplateExpressionConstructor = function(data: number, templateStartToken: ISyntaxToken, templateClauses: TemplateClauseSyntax[]) { if (data) { this.__data = data; } - this.templateStartToken = templateStartToken, this.templateClauses = templateClauses; - templateStartToken.parent = this, templateClauses.parent = this; + this.templateStartToken = templateStartToken, + this.templateClauses = templateClauses, + templateStartToken.parent = this, + templateClauses.parent = this; }; - TemplateExpressionSyntax.prototype.kind = function() { return SyntaxKind.TemplateExpression; } + TemplateExpressionSyntax.prototype.kind = SyntaxKind.TemplateExpression; + TemplateExpressionSyntax.prototype.childCount = 2; + TemplateExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.templateStartToken; + case 1: return this.templateClauses; + } + } export var TemplateAccessExpressionSyntax: TemplateAccessExpressionConstructor = function(data: number, expression: ILeftHandSideExpressionSyntax, templateExpression: IPrimaryExpressionSyntax) { if (data) { this.__data = data; } - this.expression = expression, this.templateExpression = templateExpression; - expression.parent = this, templateExpression.parent = this; + this.expression = expression, + this.templateExpression = templateExpression, + expression.parent = this, + templateExpression.parent = this; }; - TemplateAccessExpressionSyntax.prototype.kind = function() { return SyntaxKind.TemplateAccessExpression; } + TemplateAccessExpressionSyntax.prototype.kind = SyntaxKind.TemplateAccessExpression; + TemplateAccessExpressionSyntax.prototype.childCount = 2; + TemplateAccessExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.expression; + case 1: return this.templateExpression; + } + } export var VariableDeclarationSyntax: VariableDeclarationConstructor = function(data: number, varKeyword: ISyntaxToken, variableDeclarators: ISeparatedSyntaxList) { if (data) { this.__data = data; } - this.varKeyword = varKeyword, this.variableDeclarators = variableDeclarators; - varKeyword.parent = this, variableDeclarators.parent = this; + this.varKeyword = varKeyword, + this.variableDeclarators = variableDeclarators, + varKeyword.parent = this, + variableDeclarators.parent = this; }; - VariableDeclarationSyntax.prototype.kind = function() { return SyntaxKind.VariableDeclaration; } + VariableDeclarationSyntax.prototype.kind = SyntaxKind.VariableDeclaration; + VariableDeclarationSyntax.prototype.childCount = 2; + VariableDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.varKeyword; + case 1: return this.variableDeclarators; + } + } - export var VariableDeclaratorSyntax: VariableDeclaratorConstructor = function(data: number, propertyName: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax) { + export var VariableDeclaratorSyntax: VariableDeclaratorConstructor = function(data: number, propertyName: IPropertyNameSyntax, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax) { 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); + this.propertyName = propertyName, + this.typeAnnotation = typeAnnotation, + this.equalsValueClause = equalsValueClause, + propertyName.parent = this, + typeAnnotation && (typeAnnotation.parent = this), + equalsValueClause && (equalsValueClause.parent = this); }; - VariableDeclaratorSyntax.prototype.kind = function() { return SyntaxKind.VariableDeclarator; } + VariableDeclaratorSyntax.prototype.kind = SyntaxKind.VariableDeclarator; + VariableDeclaratorSyntax.prototype.childCount = 3; + VariableDeclaratorSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.propertyName; + case 1: return this.typeAnnotation; + case 2: return this.equalsValueClause; + } + } export var ArgumentListSyntax: ArgumentListConstructor = function(data: number, typeArgumentList: TypeArgumentListSyntax, openParenToken: ISyntaxToken, _arguments: ISeparatedSyntaxList, closeParenToken: ISyntaxToken) { 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; + 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; }; - ArgumentListSyntax.prototype.kind = function() { return SyntaxKind.ArgumentList; } + ArgumentListSyntax.prototype.kind = SyntaxKind.ArgumentList; + ArgumentListSyntax.prototype.childCount = 4; + ArgumentListSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.typeArgumentList; + case 1: return this.openParenToken; + case 2: return this.arguments; + case 3: return this.closeParenToken; + } + } export var ParameterListSyntax: ParameterListConstructor = function(data: number, openParenToken: ISyntaxToken, parameters: ISeparatedSyntaxList, closeParenToken: ISyntaxToken) { if (data) { this.__data = data; } - this.openParenToken = openParenToken, this.parameters = parameters, this.closeParenToken = closeParenToken; - openParenToken.parent = this, parameters.parent = this, closeParenToken.parent = this; + this.openParenToken = openParenToken, + this.parameters = parameters, + this.closeParenToken = closeParenToken, + openParenToken.parent = this, + parameters.parent = this, + closeParenToken.parent = this; }; - ParameterListSyntax.prototype.kind = function() { return SyntaxKind.ParameterList; } + ParameterListSyntax.prototype.kind = SyntaxKind.ParameterList; + ParameterListSyntax.prototype.childCount = 3; + ParameterListSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openParenToken; + case 1: return this.parameters; + case 2: return this.closeParenToken; + } + } export var TypeArgumentListSyntax: TypeArgumentListConstructor = function(data: number, lessThanToken: ISyntaxToken, typeArguments: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken) { if (data) { this.__data = data; } - this.lessThanToken = lessThanToken, this.typeArguments = typeArguments, this.greaterThanToken = greaterThanToken; - lessThanToken.parent = this, typeArguments.parent = this, greaterThanToken.parent = this; + this.lessThanToken = lessThanToken, + this.typeArguments = typeArguments, + this.greaterThanToken = greaterThanToken, + lessThanToken.parent = this, + typeArguments.parent = this, + greaterThanToken.parent = this; }; - TypeArgumentListSyntax.prototype.kind = function() { return SyntaxKind.TypeArgumentList; } + TypeArgumentListSyntax.prototype.kind = SyntaxKind.TypeArgumentList; + TypeArgumentListSyntax.prototype.childCount = 3; + TypeArgumentListSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.lessThanToken; + case 1: return this.typeArguments; + case 2: return this.greaterThanToken; + } + } export var TypeParameterListSyntax: TypeParameterListConstructor = function(data: number, lessThanToken: ISyntaxToken, typeParameters: ISeparatedSyntaxList, greaterThanToken: ISyntaxToken) { if (data) { this.__data = data; } - this.lessThanToken = lessThanToken, this.typeParameters = typeParameters, this.greaterThanToken = greaterThanToken; - lessThanToken.parent = this, typeParameters.parent = this, greaterThanToken.parent = this; + this.lessThanToken = lessThanToken, + this.typeParameters = typeParameters, + this.greaterThanToken = greaterThanToken, + lessThanToken.parent = this, + typeParameters.parent = this, + greaterThanToken.parent = this; }; - TypeParameterListSyntax.prototype.kind = function() { return SyntaxKind.TypeParameterList; } + TypeParameterListSyntax.prototype.kind = SyntaxKind.TypeParameterList; + TypeParameterListSyntax.prototype.childCount = 3; + TypeParameterListSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.lessThanToken; + case 1: return this.typeParameters; + case 2: return this.greaterThanToken; + } + } export var HeritageClauseSyntax: HeritageClauseConstructor = function(data: number, extendsOrImplementsKeyword: ISyntaxToken, typeNames: ISeparatedSyntaxList) { if (data) { this.__data = data; } - this.extendsOrImplementsKeyword = extendsOrImplementsKeyword, this.typeNames = typeNames; - extendsOrImplementsKeyword.parent = this, typeNames.parent = this; + this.extendsOrImplementsKeyword = extendsOrImplementsKeyword, + this.typeNames = typeNames, + extendsOrImplementsKeyword.parent = this, + typeNames.parent = this; }; - HeritageClauseSyntax.prototype.kind = function() { return SyntaxKind.HeritageClause; } + HeritageClauseSyntax.prototype.kind = SyntaxKind.HeritageClause; + HeritageClauseSyntax.prototype.childCount = 2; + HeritageClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.extendsOrImplementsKeyword; + case 1: return this.typeNames; + } + } export var EqualsValueClauseSyntax: EqualsValueClauseConstructor = function(data: number, equalsToken: ISyntaxToken, value: IExpressionSyntax) { if (data) { this.__data = data; } - this.equalsToken = equalsToken, this.value = value; - equalsToken.parent = this, value.parent = this; + this.equalsToken = equalsToken, + this.value = value, + equalsToken.parent = this, + value.parent = this; }; - EqualsValueClauseSyntax.prototype.kind = function() { return SyntaxKind.EqualsValueClause; } + EqualsValueClauseSyntax.prototype.kind = SyntaxKind.EqualsValueClause; + EqualsValueClauseSyntax.prototype.childCount = 2; + EqualsValueClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.equalsToken; + case 1: return this.value; + } + } export var CaseSwitchClauseSyntax: CaseSwitchClauseConstructor = function(data: number, caseKeyword: ISyntaxToken, expression: IExpressionSyntax, colonToken: ISyntaxToken, statements: IStatementSyntax[]) { 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; + this.caseKeyword = caseKeyword, + this.expression = expression, + this.colonToken = colonToken, + this.statements = statements, + caseKeyword.parent = this, + expression.parent = this, + colonToken.parent = this, + statements.parent = this; }; - CaseSwitchClauseSyntax.prototype.kind = function() { return SyntaxKind.CaseSwitchClause; } + CaseSwitchClauseSyntax.prototype.kind = SyntaxKind.CaseSwitchClause; + CaseSwitchClauseSyntax.prototype.childCount = 4; + CaseSwitchClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.caseKeyword; + case 1: return this.expression; + case 2: return this.colonToken; + case 3: return this.statements; + } + } export var DefaultSwitchClauseSyntax: DefaultSwitchClauseConstructor = function(data: number, defaultKeyword: ISyntaxToken, colonToken: ISyntaxToken, statements: IStatementSyntax[]) { if (data) { this.__data = data; } - this.defaultKeyword = defaultKeyword, this.colonToken = colonToken, this.statements = statements; - defaultKeyword.parent = this, colonToken.parent = this, statements.parent = this; + this.defaultKeyword = defaultKeyword, + this.colonToken = colonToken, + this.statements = statements, + defaultKeyword.parent = this, + colonToken.parent = this, + statements.parent = this; }; - DefaultSwitchClauseSyntax.prototype.kind = function() { return SyntaxKind.DefaultSwitchClause; } + DefaultSwitchClauseSyntax.prototype.kind = SyntaxKind.DefaultSwitchClause; + DefaultSwitchClauseSyntax.prototype.childCount = 3; + DefaultSwitchClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.defaultKeyword; + case 1: return this.colonToken; + case 2: return this.statements; + } + } export var ElseClauseSyntax: ElseClauseConstructor = function(data: number, elseKeyword: ISyntaxToken, statement: IStatementSyntax) { if (data) { this.__data = data; } - this.elseKeyword = elseKeyword, this.statement = statement; - elseKeyword.parent = this, statement.parent = this; + this.elseKeyword = elseKeyword, + this.statement = statement, + elseKeyword.parent = this, + statement.parent = this; }; - ElseClauseSyntax.prototype.kind = function() { return SyntaxKind.ElseClause; } + ElseClauseSyntax.prototype.kind = SyntaxKind.ElseClause; + ElseClauseSyntax.prototype.childCount = 2; + ElseClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.elseKeyword; + case 1: return this.statement; + } + } export var CatchClauseSyntax: CatchClauseConstructor = function(data: number, catchKeyword: ISyntaxToken, openParenToken: ISyntaxToken, identifier: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, closeParenToken: ISyntaxToken, block: BlockSyntax) { 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; + 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; }; - CatchClauseSyntax.prototype.kind = function() { return SyntaxKind.CatchClause; } + CatchClauseSyntax.prototype.kind = SyntaxKind.CatchClause; + CatchClauseSyntax.prototype.childCount = 6; + CatchClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.catchKeyword; + case 1: return this.openParenToken; + case 2: return this.identifier; + case 3: return this.typeAnnotation; + case 4: return this.closeParenToken; + case 5: return this.block; + } + } export var FinallyClauseSyntax: FinallyClauseConstructor = function(data: number, finallyKeyword: ISyntaxToken, block: BlockSyntax) { if (data) { this.__data = data; } - this.finallyKeyword = finallyKeyword, this.block = block; - finallyKeyword.parent = this, block.parent = this; + this.finallyKeyword = finallyKeyword, + this.block = block, + finallyKeyword.parent = this, + block.parent = this; }; - FinallyClauseSyntax.prototype.kind = function() { return SyntaxKind.FinallyClause; } + FinallyClauseSyntax.prototype.kind = SyntaxKind.FinallyClause; + FinallyClauseSyntax.prototype.childCount = 2; + FinallyClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.finallyKeyword; + case 1: return this.block; + } + } export var TemplateClauseSyntax: TemplateClauseConstructor = function(data: number, expression: IExpressionSyntax, templateMiddleOrEndToken: ISyntaxToken) { if (data) { this.__data = data; } - this.expression = expression, this.templateMiddleOrEndToken = templateMiddleOrEndToken; - expression.parent = this, templateMiddleOrEndToken.parent = this; + this.expression = expression, + this.templateMiddleOrEndToken = templateMiddleOrEndToken, + expression.parent = this, + templateMiddleOrEndToken.parent = this; }; - TemplateClauseSyntax.prototype.kind = function() { return SyntaxKind.TemplateClause; } + TemplateClauseSyntax.prototype.kind = SyntaxKind.TemplateClause; + TemplateClauseSyntax.prototype.childCount = 2; + TemplateClauseSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.expression; + case 1: return this.templateMiddleOrEndToken; + } + } export var TypeParameterSyntax: TypeParameterConstructor = function(data: number, identifier: ISyntaxToken, constraint: ConstraintSyntax) { if (data) { this.__data = data; } - this.identifier = identifier, this.constraint = constraint; - identifier.parent = this, constraint && (constraint.parent = this); + this.identifier = identifier, + this.constraint = constraint, + identifier.parent = this, + constraint && (constraint.parent = this); }; - TypeParameterSyntax.prototype.kind = function() { return SyntaxKind.TypeParameter; } + TypeParameterSyntax.prototype.kind = SyntaxKind.TypeParameter; + TypeParameterSyntax.prototype.childCount = 2; + TypeParameterSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.identifier; + case 1: return this.constraint; + } + } export var ConstraintSyntax: ConstraintConstructor = function(data: number, extendsKeyword: ISyntaxToken, typeOrExpression: ISyntaxNodeOrToken) { if (data) { this.__data = data; } - this.extendsKeyword = extendsKeyword, this.typeOrExpression = typeOrExpression; - extendsKeyword.parent = this, typeOrExpression.parent = this; + this.extendsKeyword = extendsKeyword, + this.typeOrExpression = typeOrExpression, + extendsKeyword.parent = this, + typeOrExpression.parent = this; }; - ConstraintSyntax.prototype.kind = function() { return SyntaxKind.Constraint; } + ConstraintSyntax.prototype.kind = SyntaxKind.Constraint; + ConstraintSyntax.prototype.childCount = 2; + ConstraintSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.extendsKeyword; + case 1: return this.typeOrExpression; + } + } - export var SimplePropertyAssignmentSyntax: SimplePropertyAssignmentConstructor = function(data: number, propertyName: ISyntaxToken, colonToken: ISyntaxToken, expression: IExpressionSyntax) { + export var SimplePropertyAssignmentSyntax: SimplePropertyAssignmentConstructor = function(data: number, propertyName: IPropertyNameSyntax, colonToken: ISyntaxToken, expression: IExpressionSyntax) { if (data) { this.__data = data; } - this.propertyName = propertyName, this.colonToken = colonToken, this.expression = expression; - propertyName.parent = this, colonToken.parent = this, expression.parent = this; + this.propertyName = propertyName, + this.colonToken = colonToken, + this.expression = expression, + propertyName.parent = this, + colonToken.parent = this, + expression.parent = this; }; - SimplePropertyAssignmentSyntax.prototype.kind = function() { return SyntaxKind.SimplePropertyAssignment; } + SimplePropertyAssignmentSyntax.prototype.kind = SyntaxKind.SimplePropertyAssignment; + SimplePropertyAssignmentSyntax.prototype.childCount = 3; + SimplePropertyAssignmentSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.propertyName; + case 1: return this.colonToken; + case 2: return this.expression; + } + } - export var FunctionPropertyAssignmentSyntax: FunctionPropertyAssignmentConstructor = function(data: number, propertyName: ISyntaxToken, callSignature: CallSignatureSyntax, block: BlockSyntax) { + export var FunctionPropertyAssignmentSyntax: FunctionPropertyAssignmentConstructor = function(data: number, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, block: BlockSyntax) { if (data) { this.__data = data; } - this.propertyName = propertyName, this.callSignature = callSignature, this.block = block; - propertyName.parent = this, callSignature.parent = this, block.parent = this; + this.propertyName = propertyName, + this.callSignature = callSignature, + this.block = block, + propertyName.parent = this, + callSignature.parent = this, + block.parent = this; }; - FunctionPropertyAssignmentSyntax.prototype.kind = function() { return SyntaxKind.FunctionPropertyAssignment; } + FunctionPropertyAssignmentSyntax.prototype.kind = SyntaxKind.FunctionPropertyAssignment; + FunctionPropertyAssignmentSyntax.prototype.childCount = 3; + FunctionPropertyAssignmentSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.propertyName; + case 1: return this.callSignature; + case 2: return this.block; + } + } export var ParameterSyntax: ParameterConstructor = function(data: number, dotDotDotToken: ISyntaxToken, modifiers: ISyntaxToken[], identifier: ISyntaxToken, questionToken: ISyntaxToken, typeAnnotation: TypeAnnotationSyntax, equalsValueClause: EqualsValueClauseSyntax) { 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); + 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); }; - ParameterSyntax.prototype.kind = function() { return SyntaxKind.Parameter; } + ParameterSyntax.prototype.kind = SyntaxKind.Parameter; + ParameterSyntax.prototype.childCount = 6; + ParameterSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.dotDotDotToken; + case 1: return this.modifiers; + case 2: return this.identifier; + case 3: return this.questionToken; + case 4: return this.typeAnnotation; + case 5: return this.equalsValueClause; + } + } - export var EnumElementSyntax: EnumElementConstructor = function(data: number, propertyName: ISyntaxToken, equalsValueClause: EqualsValueClauseSyntax) { + export var EnumElementSyntax: EnumElementConstructor = function(data: number, propertyName: IPropertyNameSyntax, equalsValueClause: EqualsValueClauseSyntax) { if (data) { this.__data = data; } - this.propertyName = propertyName, this.equalsValueClause = equalsValueClause; - propertyName.parent = this, equalsValueClause && (equalsValueClause.parent = this); + this.propertyName = propertyName, + this.equalsValueClause = equalsValueClause, + propertyName.parent = this, + equalsValueClause && (equalsValueClause.parent = this); }; - EnumElementSyntax.prototype.kind = function() { return SyntaxKind.EnumElement; } + EnumElementSyntax.prototype.kind = SyntaxKind.EnumElement; + EnumElementSyntax.prototype.childCount = 2; + EnumElementSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.propertyName; + case 1: return this.equalsValueClause; + } + } export var TypeAnnotationSyntax: TypeAnnotationConstructor = function(data: number, colonToken: ISyntaxToken, type: ITypeSyntax) { if (data) { this.__data = data; } - this.colonToken = colonToken, this.type = type; - colonToken.parent = this, type.parent = this; + this.colonToken = colonToken, + this.type = type, + colonToken.parent = this, + type.parent = this; }; - TypeAnnotationSyntax.prototype.kind = function() { return SyntaxKind.TypeAnnotation; } + TypeAnnotationSyntax.prototype.kind = SyntaxKind.TypeAnnotation; + TypeAnnotationSyntax.prototype.childCount = 2; + TypeAnnotationSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.colonToken; + case 1: return this.type; + } + } + + export var ComputedPropertyNameSyntax: ComputedPropertyNameConstructor = function(data: number, openBracketToken: ISyntaxToken, expression: IExpressionSyntax, closeBracketToken: ISyntaxToken) { + if (data) { this.__data = data; } + this.openBracketToken = openBracketToken, + this.expression = expression, + this.closeBracketToken = closeBracketToken, + openBracketToken.parent = this, + expression.parent = this, + closeBracketToken.parent = this; + }; + ComputedPropertyNameSyntax.prototype.kind = SyntaxKind.ComputedPropertyName; + ComputedPropertyNameSyntax.prototype.childCount = 3; + ComputedPropertyNameSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.openBracketToken; + case 1: return this.expression; + case 2: return this.closeBracketToken; + } + } export var ExternalModuleReferenceSyntax: ExternalModuleReferenceConstructor = function(data: number, requireKeyword: ISyntaxToken, openParenToken: ISyntaxToken, stringLiteral: ISyntaxToken, closeParenToken: ISyntaxToken) { 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; + this.requireKeyword = requireKeyword, + this.openParenToken = openParenToken, + this.stringLiteral = stringLiteral, + this.closeParenToken = closeParenToken, + requireKeyword.parent = this, + openParenToken.parent = this, + stringLiteral.parent = this, + closeParenToken.parent = this; }; - ExternalModuleReferenceSyntax.prototype.kind = function() { return SyntaxKind.ExternalModuleReference; } + ExternalModuleReferenceSyntax.prototype.kind = SyntaxKind.ExternalModuleReference; + ExternalModuleReferenceSyntax.prototype.childCount = 4; + ExternalModuleReferenceSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.requireKeyword; + case 1: return this.openParenToken; + case 2: return this.stringLiteral; + case 3: return this.closeParenToken; + } + } export var ModuleNameModuleReferenceSyntax: ModuleNameModuleReferenceConstructor = function(data: number, moduleName: INameSyntax) { if (data) { this.__data = data; } - this.moduleName = moduleName; + this.moduleName = moduleName, moduleName.parent = this; }; - ModuleNameModuleReferenceSyntax.prototype.kind = function() { return SyntaxKind.ModuleNameModuleReference; } + ModuleNameModuleReferenceSyntax.prototype.kind = SyntaxKind.ModuleNameModuleReference; + ModuleNameModuleReferenceSyntax.prototype.childCount = 1; + ModuleNameModuleReferenceSyntax.prototype.childAt = function(index: number): ISyntaxElement { + switch (index) { + case 0: return this.moduleName; + } + } } \ No newline at end of file diff --git a/src/services/syntax/syntaxToken.ts b/src/services/syntax/syntaxToken.ts index 28045ddc37e..1e4f09dc350 100644 --- a/src/services/syntax/syntaxToken.ts +++ b/src/services/syntax/syntaxToken.ts @@ -1,7 +1,7 @@ /// module TypeScript { - export interface ISyntaxToken extends ISyntaxNodeOrToken, INameSyntax, IPrimaryExpressionSyntax { + export interface ISyntaxToken extends ISyntaxNodeOrToken, INameSyntax, IPrimaryExpressionSyntax, IPropertyAssignmentSyntax, IPropertyNameSyntax { // Adjusts the full start of this token. Should only be called by the parser. setFullStart(fullStart: number): void; @@ -74,7 +74,7 @@ module TypeScript { return undefined; } - var kind = token.kind(); + var kind = token.kind; var text = token.text(); if (kind === SyntaxKind.IdentifierName) { @@ -284,7 +284,7 @@ module TypeScript { module TypeScript.Syntax { export function realizeToken(token: ISyntaxToken, text: ISimpleText): ISyntaxToken { - return new RealizedToken(token.fullStart(), token.kind(), token.isKeywordConvertedToIdentifier(), token.leadingTrivia(text), token.text(), token.trailingTrivia(text)); + return new RealizedToken(token.fullStart(), token.kind, token.isKeywordConvertedToIdentifier(), token.leadingTrivia(text), token.text(), token.trailingTrivia(text)); } export function convertKeywordToIdentifier(token: ISyntaxToken): ISyntaxToken { @@ -292,11 +292,11 @@ module TypeScript.Syntax { } export function withLeadingTrivia(token: ISyntaxToken, leadingTrivia: ISyntaxTriviaList, text: ISimpleText): ISyntaxToken { - return new RealizedToken(token.fullStart(), token.kind(), token.isKeywordConvertedToIdentifier(), leadingTrivia, token.text(), token.trailingTrivia(text)); + return new RealizedToken(token.fullStart(), token.kind, token.isKeywordConvertedToIdentifier(), leadingTrivia, token.text(), token.trailingTrivia(text)); } export function withTrailingTrivia(token: ISyntaxToken, trailingTrivia: ISyntaxTriviaList, text: ISimpleText): ISyntaxToken { - return new RealizedToken(token.fullStart(), token.kind(), token.isKeywordConvertedToIdentifier(), token.leadingTrivia(text), token.text(), trailingTrivia); + return new RealizedToken(token.fullStart(), token.kind, token.isKeywordConvertedToIdentifier(), token.leadingTrivia(text), token.text(), trailingTrivia); } export function emptyToken(kind: SyntaxKind): ISyntaxToken { @@ -304,25 +304,23 @@ module TypeScript.Syntax { } class EmptyToken implements ISyntaxToken { - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _syntaxNodeOrTokenBrand: any; + public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _nameBrand: any; public _propertyAssignmentBrand: any; public _propertyNameBrand: any; - constructor(private _kind: SyntaxKind) { + public parent: ISyntaxElement; + public childCount: number; + + constructor(public kind: SyntaxKind) { } public setFullStart(fullStart: number): void { // An empty token is always at the -1 position. } - public kind(): SyntaxKind { - return this._kind; - } - - public childCount() { return 0 } public childAt(index: number): ISyntaxElement { throw Errors.invalidOperation() } public accept(visitor: ISyntaxVisitor): any { return visitor.visitToken(this) } public clone(): ISyntaxToken { - return new EmptyToken(this.kind()); + return new EmptyToken(this.kind); } // Empty tokens are never incrementally reusable. @@ -362,7 +360,7 @@ module TypeScript.Syntax { 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!"); + 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: @@ -418,25 +416,27 @@ module TypeScript.Syntax { public leadingTrivia(): ISyntaxTriviaList { return Syntax.emptyTriviaList; } public trailingTrivia(): ISyntaxTriviaList { return Syntax.emptyTriviaList; } } + EmptyToken.prototype.childCount = 0; class RealizedToken implements ISyntaxToken { + public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _nameBrand: any; public _propertyAssignmentBrand: any; public _propertyNameBrand: any; + private _fullStart: number; - private _kind: SyntaxKind; private _isKeywordConvertedToIdentifier: boolean; private _leadingTrivia: ISyntaxTriviaList; private _text: string; private _trailingTrivia: ISyntaxTriviaList; - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _syntaxNodeOrTokenBrand: any; + public parent: ISyntaxElement; + public childCount: number; constructor(fullStart: number, - kind: SyntaxKind, - isKeywordConvertedToIdentifier: boolean, - leadingTrivia: ISyntaxTriviaList, - text: string, - trailingTrivia: ISyntaxTriviaList) { + public kind: SyntaxKind, + isKeywordConvertedToIdentifier: boolean, + leadingTrivia: ISyntaxTriviaList, + text: string, + trailingTrivia: ISyntaxTriviaList) { this._fullStart = fullStart; - this._kind = kind; this._isKeywordConvertedToIdentifier = isKeywordConvertedToIdentifier; this._text = text; @@ -456,16 +456,11 @@ module TypeScript.Syntax { this._fullStart = fullStart; } - public kind(): SyntaxKind { - return this._kind; - } - - public childCount() { return 0 } public childAt(index: number): ISyntaxElement { throw Errors.invalidOperation() } public accept(visitor: ISyntaxVisitor): any { return visitor.visitToken(this) } public clone(): ISyntaxToken { - return new RealizedToken(this._fullStart, this.kind(), this._isKeywordConvertedToIdentifier, this._leadingTrivia, this._text, this._trailingTrivia); + return new RealizedToken(this._fullStart, this.kind, this._isKeywordConvertedToIdentifier, this._leadingTrivia, this._text, this._trailingTrivia); } // Realized tokens are created from the parser. They are *never* incrementally reusable. @@ -494,22 +489,22 @@ module TypeScript.Syntax { public leadingTrivia(): ISyntaxTriviaList { return this._leadingTrivia; } public trailingTrivia(): ISyntaxTriviaList { return this._trailingTrivia; } } + RealizedToken.prototype.childCount = 0; class ConvertedKeywordToken implements ISyntaxToken { - public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _syntaxNodeOrTokenBrand: any; + public _primaryExpressionBrand: any; public _memberExpressionBrand: any; public _leftHandSideExpressionBrand: any; public _postfixExpressionBrand: any; public _unaryExpressionBrand: any; public _expressionBrand: any; public _typeBrand: any; public _nameBrand: any; public _propertyAssignmentBrand: any; public _propertyNameBrand: any; + + public parent: ISyntaxElement; + public kind: SyntaxKind; + public childCount: number; constructor(private underlyingToken: ISyntaxToken) { } - public kind() { - return SyntaxKind.IdentifierName; - } - public setFullStart(fullStart: number): void { this.underlyingToken.setFullStart(fullStart); } - public childCount() { return 0 } public childAt(index: number): ISyntaxElement { throw Errors.invalidOperation() } public accept(visitor: ISyntaxVisitor): any { return visitor.visitToken(this) } @@ -591,4 +586,6 @@ module TypeScript.Syntax { return new ConvertedKeywordToken(this.underlyingToken); } } + ConvertedKeywordToken.prototype.kind = SyntaxKind.IdentifierName; + ConvertedKeywordToken.prototype.childCount = 0; } \ No newline at end of file diff --git a/src/services/syntax/syntaxTree.ts b/src/services/syntax/syntaxTree.ts index d466bd7df82..5a677f6e850 100644 --- a/src/services/syntax/syntaxTree.ts +++ b/src/services/syntax/syntaxTree.ts @@ -231,7 +231,7 @@ module TypeScript { } private checkParameterAccessibilityModifier(parameterList: ParameterListSyntax, modifier: ISyntaxToken, modifierIndex: number): boolean { - if (!SyntaxFacts.isAccessibilityModifier(modifier.kind())) { + if (!SyntaxFacts.isAccessibilityModifier(modifier.kind)) { this.pushDiagnostic(modifier, DiagnosticCode._0_modifier_cannot_appear_on_a_parameter, [modifier.text()]); return true; } @@ -280,7 +280,7 @@ module TypeScript { public visitHeritageClause(node: HeritageClauseSyntax): void { if (this.checkForTrailingComma(node.typeNames) || - this.checkForAtLeastOneElement(node.typeNames, node.extendsOrImplementsKeyword, SyntaxFacts.getText(node.extendsOrImplementsKeyword.kind()))) { + this.checkForAtLeastOneElement(node.typeNames, node.extendsOrImplementsKeyword, SyntaxFacts.getText(node.extendsOrImplementsKeyword.kind))) { return; } @@ -359,8 +359,8 @@ module TypeScript { this.pushDiagnostic(parameter, DiagnosticCode.Index_signature_parameter_must_have_a_type_annotation); return true; } - else if (parameter.typeAnnotation.type.kind() !== SyntaxKind.StringKeyword && - parameter.typeAnnotation.type.kind() !== SyntaxKind.NumberKeyword) { + else if (parameter.typeAnnotation.type.kind !== SyntaxKind.StringKeyword && + parameter.typeAnnotation.type.kind !== SyntaxKind.NumberKeyword) { this.pushDiagnostic(parameter, DiagnosticCode.Index_signature_parameter_type_must_be_string_or_number); return true; } @@ -389,7 +389,7 @@ module TypeScript { Debug.assert(i <= 2); var heritageClause = node.heritageClauses[i]; - if (heritageClause.extendsOrImplementsKeyword.kind() === SyntaxKind.ExtendsKeyword) { + if (heritageClause.extendsOrImplementsKeyword.kind === SyntaxKind.ExtendsKeyword) { if (seenExtendsClause) { this.pushDiagnostic(heritageClause, DiagnosticCode.extends_clause_already_seen); return true; @@ -408,7 +408,7 @@ module TypeScript { seenExtendsClause = true; } else { - Debug.assert(heritageClause.extendsOrImplementsKeyword.kind() === SyntaxKind.ImplementsKeyword); + Debug.assert(heritageClause.extendsOrImplementsKeyword.kind === SyntaxKind.ImplementsKeyword); if (seenImplementsClause) { this.pushDiagnostic(heritageClause, DiagnosticCode.implements_clause_already_seen); return true; @@ -468,7 +468,7 @@ module TypeScript { Debug.assert(i <= 1); var heritageClause = node.heritageClauses[i]; - if (heritageClause.extendsOrImplementsKeyword.kind() === SyntaxKind.ExtendsKeyword) { + if (heritageClause.extendsOrImplementsKeyword.kind === SyntaxKind.ExtendsKeyword) { if (seenExtendsClause) { this.pushDiagnostic(heritageClause, DiagnosticCode.extends_clause_already_seen); return true; @@ -477,7 +477,7 @@ module TypeScript { seenExtendsClause = true; } else { - Debug.assert(heritageClause.extendsOrImplementsKeyword.kind() === SyntaxKind.ImplementsKeyword); + Debug.assert(heritageClause.extendsOrImplementsKeyword.kind === SyntaxKind.ImplementsKeyword); this.pushDiagnostic(heritageClause, DiagnosticCode.Interface_declaration_cannot_have_implements_clause); return true; } @@ -489,7 +489,7 @@ module TypeScript { private checkInterfaceModifiers(modifiers: ISyntaxToken[]): boolean { for (var i = 0, n = modifiers.length; i < n; i++) { var modifier = modifiers[i]; - if (modifier.kind() === SyntaxKind.DeclareKeyword) { + if (modifier.kind === SyntaxKind.DeclareKeyword) { this.pushDiagnostic(modifier, DiagnosticCode.A_declare_modifier_cannot_be_used_with_an_interface_declaration); return true; @@ -516,7 +516,7 @@ module TypeScript { for (var i = 0, n = list.length; i < n; i++) { var modifier = list[i]; - if (SyntaxFacts.isAccessibilityModifier(modifier.kind())) { + if (SyntaxFacts.isAccessibilityModifier(modifier.kind)) { if (seenAccessibilityModifier) { this.pushDiagnostic(modifier, DiagnosticCode.Accessibility_modifier_already_seen); return true; @@ -530,7 +530,7 @@ module TypeScript { seenAccessibilityModifier = true; } - else if (modifier.kind() === SyntaxKind.StaticKeyword) { + else if (modifier.kind === SyntaxKind.StaticKeyword) { if (seenStaticModifier) { this.pushDiagnostic(modifier, DiagnosticCode._0_modifier_already_seen, [modifier.text()]); return true; @@ -556,7 +556,8 @@ module TypeScript { } public visitMethodSignature(node: MethodSignatureSyntax): void { - if (this.checkForTemplatePropertyName(node.propertyName)) { + if (this.checkForDisallowedTemplatePropertyName(node.propertyName) || + this.checkForDisallowedComputedPropertyName(node.propertyName)) { return; } @@ -564,7 +565,8 @@ module TypeScript { } public visitPropertySignature(node: PropertySignatureSyntax): void { - if (this.checkForTemplatePropertyName(node.propertyName)) { + if (this.checkForDisallowedTemplatePropertyName(node.propertyName) || + this.checkForDisallowedComputedPropertyName(node.propertyName)) { return; } @@ -573,7 +575,7 @@ module TypeScript { public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): void { if (this.checkClassElementModifiers(node.modifiers) || - this.checkForTemplatePropertyName(node.propertyName)) { + this.checkForDisallowedTemplatePropertyName(node.propertyName)) { return; } @@ -624,12 +626,12 @@ module TypeScript { public visitGetAccessor(node: GetAccessorSyntax): void { if (this.checkForAccessorDeclarationInAmbientContext(node) || - this.checkEcmaScriptVersionIsAtLeast(node.propertyName, ts.ScriptTarget.ES5, DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || + this.checkEcmaScriptVersionIsAtLeast(node.getKeyword, ts.ScriptTarget.ES5, 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)) { + this.checkForDisallowedTemplatePropertyName(node.propertyName)) { return; } @@ -691,7 +693,7 @@ module TypeScript { } public visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): void { - if (this.checkForTemplatePropertyName(node.propertyName)) { + if (this.checkForDisallowedTemplatePropertyName(node.propertyName)) { return; } @@ -700,13 +702,13 @@ module TypeScript { public visitSetAccessor(node: SetAccessorSyntax): void { if (this.checkForAccessorDeclarationInAmbientContext(node) || - this.checkEcmaScriptVersionIsAtLeast(node.propertyName, ts.ScriptTarget.ES5, DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || + this.checkEcmaScriptVersionIsAtLeast(node.setKeyword, ts.ScriptTarget.ES5, 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)) { + this.checkForDisallowedTemplatePropertyName(node.propertyName)) { return; } @@ -747,7 +749,8 @@ module TypeScript { } public visitEnumElement(node: EnumElementSyntax): void { - if (this.checkForTemplatePropertyName(node.propertyName)) { + if (this.checkForDisallowedTemplatePropertyName(node.propertyName) || + this.checkForDisallowedComputedPropertyName(node.propertyName)) { return; } @@ -763,7 +766,7 @@ module TypeScript { } public visitInvocationExpression(node: InvocationExpressionSyntax): void { - if (node.expression.kind() === SyntaxKind.SuperKeyword && + if (node.expression.kind === SyntaxKind.SuperKeyword && node.argumentList.typeArgumentList) { this.pushDiagnostic(node, DiagnosticCode.super_invocation_cannot_have_type_arguments); } @@ -777,13 +780,13 @@ module TypeScript { for (var i = 0, n = modifiers.length; i < n; i++) { var modifier = modifiers[i]; - if (SyntaxFacts.isAccessibilityModifier(modifier.kind()) || - modifier.kind() === SyntaxKind.StaticKeyword) { + if (SyntaxFacts.isAccessibilityModifier(modifier.kind) || + modifier.kind === SyntaxKind.StaticKeyword) { this.pushDiagnostic(modifier, DiagnosticCode._0_modifier_cannot_appear_on_a_module_element, [modifier.text()]); return true; } - if (modifier.kind() === SyntaxKind.DeclareKeyword) { + if (modifier.kind === SyntaxKind.DeclareKeyword) { if (seenDeclareModifier) { this.pushDiagnostic(modifier, DiagnosticCode.Accessibility_modifier_already_seen); return; @@ -791,7 +794,7 @@ module TypeScript { seenDeclareModifier = true; } - else if (modifier.kind() === SyntaxKind.ExportKeyword) { + else if (modifier.kind === SyntaxKind.ExportKeyword) { if (seenExportModifier) { this.pushDiagnostic(modifier, DiagnosticCode._0_modifier_already_seen, [modifier.text()]); return; @@ -814,9 +817,9 @@ module TypeScript { if (!node.stringLiteral) { for (var i = 0, n = node.moduleElements.length; i < n; i++) { var child = node.moduleElements[i]; - if (child.kind() === SyntaxKind.ImportDeclaration) { + if (child.kind === SyntaxKind.ImportDeclaration) { var importDeclaration = child; - if (importDeclaration.moduleReference.kind() === SyntaxKind.ExternalModuleReference) { + if (importDeclaration.moduleReference.kind === SyntaxKind.ExternalModuleReference) { this.pushDiagnostic(importDeclaration, DiagnosticCode.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); } } @@ -874,7 +877,7 @@ module TypeScript { for (var i = 0, n = node.moduleElements.length; i < n; i++) { var child = node.moduleElements[i]; - if (child.kind() === SyntaxKind.ExportAssignment) { + if (child.kind === SyntaxKind.ExportAssignment) { this.pushDiagnostic(child, DiagnosticCode.Export_assignment_cannot_be_used_in_internal_modules); return true; } @@ -898,7 +901,7 @@ module TypeScript { if (this.inAmbientDeclaration || this.syntaxTree.isDeclaration()) { // Provide a specialized message for a block as a statement versus the block as a // function body. - if (node.parent.kind() === SyntaxKind.List) { + if (node.parent.kind === SyntaxKind.List) { this.pushDiagnostic(firstToken(node), DiagnosticCode.Statements_are_not_allowed_in_ambient_contexts); } else { @@ -979,7 +982,7 @@ module TypeScript { private inSwitchStatement(ast: ISyntaxElement): boolean { while (ast) { - if (ast.kind() === SyntaxKind.SwitchStatement) { + if (ast.kind === SyntaxKind.SwitchStatement) { return true; } @@ -994,7 +997,7 @@ module TypeScript { } private isIterationStatement(ast: ISyntaxElement): boolean { - switch (ast.kind()) { + switch (ast.kind) { case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: case SyntaxKind.WhileStatement: @@ -1026,7 +1029,7 @@ module TypeScript { element = element.parent; while (element) { - if (element.kind() === SyntaxKind.LabeledStatement) { + if (element.kind === SyntaxKind.LabeledStatement) { var labeledStatement = element; if (breakable) { // Breakable labels can be placed on any construct @@ -1052,7 +1055,7 @@ module TypeScript { } private labelIsOnContinuableConstruct(statement: ISyntaxElement): boolean { - switch (statement.kind()) { + switch (statement.kind) { case SyntaxKind.LabeledStatement: // Labels work transitively. i.e. if you have: // foo: @@ -1338,7 +1341,7 @@ module TypeScript { } public visitFunctionPropertyAssignment(node: FunctionPropertyAssignmentSyntax): void { - if (this.checkForTemplatePropertyName(node.propertyName)) { + if (this.checkForDisallowedTemplatePropertyName(node.propertyName)) { return; } @@ -1363,7 +1366,7 @@ module TypeScript { private checkListSeparators(list: ISeparatedSyntaxList, kind: SyntaxKind): boolean { for (var i = 0, n = separatorCount(list); i < n; i++) { var child = separatorAt(list, i); - if (child.kind() !== kind) { + if (child.kind !== kind) { this.pushDiagnostic(child, DiagnosticCode._0_expected, [SyntaxFacts.getText(kind)]); } } @@ -1410,16 +1413,25 @@ module TypeScript { public visitVariableDeclarator(node: VariableDeclaratorSyntax): void { if (this.checkVariableDeclaratorInitializer(node) || this.checkVariableDeclaratorIdentifier(node) || - this.checkForTemplatePropertyName(node.propertyName)) { + this.checkForDisallowedTemplatePropertyName(node.propertyName)) { return; } super.visitVariableDeclarator(node); } - private checkForTemplatePropertyName(token: ISyntaxToken): boolean { - if (token.kind() === SyntaxKind.NoSubstitutionTemplateToken) { - this.pushDiagnostic(token, DiagnosticCode.Template_literal_cannot_be_used_as_an_element_name); + private checkForDisallowedTemplatePropertyName(propertyName: IPropertyNameSyntax): boolean { + if (propertyName.kind === SyntaxKind.NoSubstitutionTemplateToken) { + this.pushDiagnostic(propertyName, DiagnosticCode.Template_literal_cannot_be_used_as_an_element_name); + return true; + } + + return false; + } + + private checkForDisallowedComputedPropertyName(propertyName: IPropertyNameSyntax): boolean { + if (propertyName.kind === SyntaxKind.ComputedPropertyName) { + this.pushDiagnostic(propertyName, DiagnosticCode.Computed_property_names_cannot_be_used_here); return true; } @@ -1427,8 +1439,9 @@ module TypeScript { } private checkVariableDeclaratorIdentifier(node: VariableDeclaratorSyntax): boolean { - if (node.parent.kind() !== SyntaxKind.MemberVariableDeclaration) { - if (this.checkForDisallowedEvalOrArguments(node, node.propertyName)) { + if (node.parent.kind !== SyntaxKind.MemberVariableDeclaration) { + Debug.assert(isToken(node.propertyName), "A normal variable declarator must always have a token for a name."); + if (this.checkForDisallowedEvalOrArguments(node, node.propertyName)) { return true; } } @@ -1460,8 +1473,8 @@ module TypeScript { private checkConstructorModifiers(modifiers: ISyntaxToken[]): boolean { for (var i = 0, n = modifiers.length; i < n; i++) { var child = modifiers[i]; - if (child.kind() !== SyntaxKind.PublicKeyword) { - this.pushDiagnostic(child, DiagnosticCode._0_modifier_cannot_appear_on_a_constructor_declaration, [SyntaxFacts.getText(child.kind())]); + if (child.kind !== SyntaxKind.PublicKeyword) { + this.pushDiagnostic(child, DiagnosticCode._0_modifier_cannot_appear_on_a_constructor_declaration, [SyntaxFacts.getText(child.kind)]); return true; } } @@ -1531,7 +1544,7 @@ module TypeScript { } private isPreIncrementOrDecrementExpression(node: PrefixUnaryExpressionSyntax) { - switch (node.operatorToken.kind()) { + switch (node.operatorToken.kind) { case SyntaxKind.MinusMinusToken: case SyntaxKind.PlusPlusToken: return true; @@ -1541,7 +1554,7 @@ module TypeScript { } public visitDeleteExpression(node: DeleteExpressionSyntax): void { - if (parsedInStrictMode(node) && node.expression.kind() === SyntaxKind.IdentifierName) { + if (parsedInStrictMode(node) && node.expression.kind === SyntaxKind.IdentifierName) { this.pushDiagnostic(firstToken(node), DiagnosticCode.delete_cannot_be_called_on_an_identifier_in_strict_mode); return; } @@ -1550,7 +1563,7 @@ module TypeScript { } private checkIllegalAssignment(node: BinaryExpressionSyntax): boolean { - if (parsedInStrictMode(node) && SyntaxFacts.isAssignmentOperatorToken(node.operatorToken.kind()) && this.isEvalOrArguments(node.left)) { + if (parsedInStrictMode(node) && SyntaxFacts.isAssignmentOperatorToken(node.operatorToken.kind) && this.isEvalOrArguments(node.left)) { this.pushDiagnostic(node.operatorToken, DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(node.left)]); return true; } @@ -1559,7 +1572,7 @@ module TypeScript { } private getEvalOrArguments(expr: IExpressionSyntax): string { - if (expr.kind() === SyntaxKind.IdentifierName) { + if (expr.kind === SyntaxKind.IdentifierName) { var text = tokenValueText(expr); if (text === "eval" || text === "arguments") { return text; @@ -1582,7 +1595,7 @@ module TypeScript { } private checkConstraintType(node: ConstraintSyntax): boolean { - if (!SyntaxFacts.isType(node.typeOrExpression.kind())) { + if (!SyntaxFacts.isType(node.typeOrExpression.kind)) { this.pushDiagnostic(node.typeOrExpression, DiagnosticCode.Type_expected); return true; } @@ -1639,13 +1652,13 @@ module TypeScript { var moduleElement = node.moduleElements[i]; var _firstToken = firstToken(moduleElement); - if (_firstToken && _firstToken.kind() === SyntaxKind.ExportKeyword) { + if (_firstToken && _firstToken.kind === SyntaxKind.ExportKeyword) { return new TextSpan(start(_firstToken), width(_firstToken)); } - if (moduleElement.kind() === SyntaxKind.ImportDeclaration) { + if (moduleElement.kind === SyntaxKind.ImportDeclaration) { var importDecl = moduleElement; - if (importDecl.moduleReference.kind() === SyntaxKind.ExternalModuleReference) { + if (importDecl.moduleReference.kind === SyntaxKind.ExternalModuleReference) { var literal = (importDecl.moduleReference).stringLiteral; return new TextSpan(start(literal), width(literal)); } diff --git a/src/services/syntax/syntaxUtilities.generated.ts b/src/services/syntax/syntaxUtilities.generated.ts deleted file mode 100644 index ac73b433195..00000000000 --- a/src/services/syntax/syntaxUtilities.generated.ts +++ /dev/null @@ -1,879 +0,0 @@ -module TypeScript { - export function childCount(element: ISyntaxElement): number { - if (isList(element)) { return (element).length; } - switch (element.kind()) { - case SyntaxKind.SourceUnit: return 2; - case SyntaxKind.QualifiedName: return 3; - case SyntaxKind.ObjectType: return 3; - case SyntaxKind.FunctionType: return 4; - case SyntaxKind.ArrayType: return 3; - case SyntaxKind.ConstructorType: return 5; - case SyntaxKind.GenericType: return 2; - case SyntaxKind.TypeQuery: return 2; - case SyntaxKind.TupleType: return 3; - case SyntaxKind.UnionType: return 3; - case SyntaxKind.ParenthesizedType: return 3; - case SyntaxKind.InterfaceDeclaration: return 6; - case SyntaxKind.FunctionDeclaration: return 6; - case SyntaxKind.ModuleDeclaration: return 7; - case SyntaxKind.ClassDeclaration: return 8; - case SyntaxKind.EnumDeclaration: return 6; - case SyntaxKind.ImportDeclaration: return 6; - case SyntaxKind.ExportAssignment: return 4; - case SyntaxKind.MemberFunctionDeclaration: return 5; - case SyntaxKind.MemberVariableDeclaration: return 3; - case SyntaxKind.ConstructorDeclaration: return 5; - case SyntaxKind.IndexMemberDeclaration: return 3; - case SyntaxKind.GetAccessor: return 5; - case SyntaxKind.SetAccessor: return 5; - case SyntaxKind.PropertySignature: return 3; - case SyntaxKind.CallSignature: return 3; - case SyntaxKind.ConstructSignature: return 2; - case SyntaxKind.IndexSignature: return 4; - case SyntaxKind.MethodSignature: return 3; - case SyntaxKind.Block: return 3; - case SyntaxKind.IfStatement: return 6; - case SyntaxKind.VariableStatement: return 3; - case SyntaxKind.ExpressionStatement: return 2; - case SyntaxKind.ReturnStatement: return 3; - case SyntaxKind.SwitchStatement: return 7; - case SyntaxKind.BreakStatement: return 3; - case SyntaxKind.ContinueStatement: return 3; - case SyntaxKind.ForStatement: return 10; - case SyntaxKind.ForInStatement: return 8; - case SyntaxKind.EmptyStatement: return 1; - case SyntaxKind.ThrowStatement: return 3; - case SyntaxKind.WhileStatement: return 5; - case SyntaxKind.TryStatement: return 4; - case SyntaxKind.LabeledStatement: return 3; - case SyntaxKind.DoStatement: return 7; - case SyntaxKind.DebuggerStatement: return 2; - case SyntaxKind.WithStatement: return 5; - case SyntaxKind.PrefixUnaryExpression: return 2; - case SyntaxKind.DeleteExpression: return 2; - case SyntaxKind.TypeOfExpression: return 2; - case SyntaxKind.VoidExpression: return 2; - case SyntaxKind.ConditionalExpression: return 5; - case SyntaxKind.BinaryExpression: return 3; - case SyntaxKind.PostfixUnaryExpression: return 2; - case SyntaxKind.MemberAccessExpression: return 3; - case SyntaxKind.InvocationExpression: return 2; - case SyntaxKind.ArrayLiteralExpression: return 3; - case SyntaxKind.ObjectLiteralExpression: return 3; - case SyntaxKind.ObjectCreationExpression: return 3; - case SyntaxKind.ParenthesizedExpression: return 3; - case SyntaxKind.ParenthesizedArrowFunctionExpression: return 4; - case SyntaxKind.SimpleArrowFunctionExpression: return 4; - case SyntaxKind.CastExpression: return 4; - case SyntaxKind.ElementAccessExpression: return 4; - case SyntaxKind.FunctionExpression: return 4; - case SyntaxKind.OmittedExpression: return 0; - case SyntaxKind.TemplateExpression: return 2; - case SyntaxKind.TemplateAccessExpression: return 2; - case SyntaxKind.VariableDeclaration: return 2; - case SyntaxKind.VariableDeclarator: return 3; - case SyntaxKind.ArgumentList: return 4; - case SyntaxKind.ParameterList: return 3; - case SyntaxKind.TypeArgumentList: return 3; - case SyntaxKind.TypeParameterList: return 3; - case SyntaxKind.HeritageClause: return 2; - case SyntaxKind.EqualsValueClause: return 2; - case SyntaxKind.CaseSwitchClause: return 4; - case SyntaxKind.DefaultSwitchClause: return 3; - case SyntaxKind.ElseClause: return 2; - case SyntaxKind.CatchClause: return 6; - case SyntaxKind.FinallyClause: return 2; - case SyntaxKind.TemplateClause: return 2; - case SyntaxKind.TypeParameter: return 2; - case SyntaxKind.Constraint: return 2; - case SyntaxKind.SimplePropertyAssignment: return 3; - case SyntaxKind.FunctionPropertyAssignment: return 3; - case SyntaxKind.Parameter: return 6; - case SyntaxKind.EnumElement: return 2; - case SyntaxKind.TypeAnnotation: return 2; - case SyntaxKind.ExternalModuleReference: return 4; - case SyntaxKind.ModuleNameModuleReference: return 1; - default: return 0; - } - } - - function sourceUnitChildAt(node: SourceUnitSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.moduleElements; - case 1: return node.endOfFileToken; - } - } - function qualifiedNameChildAt(node: QualifiedNameSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.left; - case 1: return node.dotToken; - case 2: return node.right; - } - } - function objectTypeChildAt(node: ObjectTypeSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.openBraceToken; - case 1: return node.typeMembers; - case 2: return node.closeBraceToken; - } - } - function functionTypeChildAt(node: FunctionTypeSyntax, index: number): ISyntaxElement { - 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: ArrayTypeSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.type; - case 1: return node.openBracketToken; - case 2: return node.closeBracketToken; - } - } - function constructorTypeChildAt(node: ConstructorTypeSyntax, index: number): ISyntaxElement { - 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: GenericTypeSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.name; - case 1: return node.typeArgumentList; - } - } - function typeQueryChildAt(node: TypeQuerySyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.typeOfKeyword; - case 1: return node.name; - } - } - function tupleTypeChildAt(node: TupleTypeSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.openBracketToken; - case 1: return node.types; - case 2: return node.closeBracketToken; - } - } - function unionTypeChildAt(node: UnionTypeSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.left; - case 1: return node.barToken; - case 2: return node.right; - } - } - function parenthesizedTypeChildAt(node: ParenthesizedTypeSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.openParenToken; - case 1: return node.type; - case 2: return node.closeParenToken; - } - } - function interfaceDeclarationChildAt(node: InterfaceDeclarationSyntax, index: number): ISyntaxElement { - 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: FunctionDeclarationSyntax, index: number): ISyntaxElement { - 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: ModuleDeclarationSyntax, index: number): ISyntaxElement { - 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: ClassDeclarationSyntax, index: number): ISyntaxElement { - 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: EnumDeclarationSyntax, index: number): ISyntaxElement { - 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: ImportDeclarationSyntax, index: number): ISyntaxElement { - 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: ExportAssignmentSyntax, index: number): ISyntaxElement { - 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: MemberFunctionDeclarationSyntax, index: number): ISyntaxElement { - 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: MemberVariableDeclarationSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.modifiers; - case 1: return node.variableDeclarator; - case 2: return node.semicolonToken; - } - } - function constructorDeclarationChildAt(node: ConstructorDeclarationSyntax, index: number): ISyntaxElement { - 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: IndexMemberDeclarationSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.modifiers; - case 1: return node.indexSignature; - case 2: return node.semicolonToken; - } - } - function getAccessorChildAt(node: GetAccessorSyntax, index: number): ISyntaxElement { - 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: SetAccessorSyntax, index: number): ISyntaxElement { - 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: PropertySignatureSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.propertyName; - case 1: return node.questionToken; - case 2: return node.typeAnnotation; - } - } - function callSignatureChildAt(node: CallSignatureSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.typeParameterList; - case 1: return node.parameterList; - case 2: return node.typeAnnotation; - } - } - function constructSignatureChildAt(node: ConstructSignatureSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.newKeyword; - case 1: return node.callSignature; - } - } - function indexSignatureChildAt(node: IndexSignatureSyntax, index: number): ISyntaxElement { - 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: MethodSignatureSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.propertyName; - case 1: return node.questionToken; - case 2: return node.callSignature; - } - } - function blockChildAt(node: BlockSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.openBraceToken; - case 1: return node.statements; - case 2: return node.closeBraceToken; - } - } - function ifStatementChildAt(node: IfStatementSyntax, index: number): ISyntaxElement { - 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: VariableStatementSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.modifiers; - case 1: return node.variableDeclaration; - case 2: return node.semicolonToken; - } - } - function expressionStatementChildAt(node: ExpressionStatementSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.expression; - case 1: return node.semicolonToken; - } - } - function returnStatementChildAt(node: ReturnStatementSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.returnKeyword; - case 1: return node.expression; - case 2: return node.semicolonToken; - } - } - function switchStatementChildAt(node: SwitchStatementSyntax, index: number): ISyntaxElement { - 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: BreakStatementSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.breakKeyword; - case 1: return node.identifier; - case 2: return node.semicolonToken; - } - } - function continueStatementChildAt(node: ContinueStatementSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.continueKeyword; - case 1: return node.identifier; - case 2: return node.semicolonToken; - } - } - function forStatementChildAt(node: ForStatementSyntax, index: number): ISyntaxElement { - 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: ForInStatementSyntax, index: number): ISyntaxElement { - 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: EmptyStatementSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.semicolonToken; - } - } - function throwStatementChildAt(node: ThrowStatementSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.throwKeyword; - case 1: return node.expression; - case 2: return node.semicolonToken; - } - } - function whileStatementChildAt(node: WhileStatementSyntax, index: number): ISyntaxElement { - 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: TryStatementSyntax, index: number): ISyntaxElement { - 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: LabeledStatementSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.identifier; - case 1: return node.colonToken; - case 2: return node.statement; - } - } - function doStatementChildAt(node: DoStatementSyntax, index: number): ISyntaxElement { - 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: DebuggerStatementSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.debuggerKeyword; - case 1: return node.semicolonToken; - } - } - function withStatementChildAt(node: WithStatementSyntax, index: number): ISyntaxElement { - 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: PrefixUnaryExpressionSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.operatorToken; - case 1: return node.operand; - } - } - function deleteExpressionChildAt(node: DeleteExpressionSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.deleteKeyword; - case 1: return node.expression; - } - } - function typeOfExpressionChildAt(node: TypeOfExpressionSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.typeOfKeyword; - case 1: return node.expression; - } - } - function voidExpressionChildAt(node: VoidExpressionSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.voidKeyword; - case 1: return node.expression; - } - } - function conditionalExpressionChildAt(node: ConditionalExpressionSyntax, index: number): ISyntaxElement { - 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: BinaryExpressionSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.left; - case 1: return node.operatorToken; - case 2: return node.right; - } - } - function postfixUnaryExpressionChildAt(node: PostfixUnaryExpressionSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.operand; - case 1: return node.operatorToken; - } - } - function memberAccessExpressionChildAt(node: MemberAccessExpressionSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.expression; - case 1: return node.dotToken; - case 2: return node.name; - } - } - function invocationExpressionChildAt(node: InvocationExpressionSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.expression; - case 1: return node.argumentList; - } - } - function arrayLiteralExpressionChildAt(node: ArrayLiteralExpressionSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.openBracketToken; - case 1: return node.expressions; - case 2: return node.closeBracketToken; - } - } - function objectLiteralExpressionChildAt(node: ObjectLiteralExpressionSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.openBraceToken; - case 1: return node.propertyAssignments; - case 2: return node.closeBraceToken; - } - } - function objectCreationExpressionChildAt(node: ObjectCreationExpressionSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.newKeyword; - case 1: return node.expression; - case 2: return node.argumentList; - } - } - function parenthesizedExpressionChildAt(node: ParenthesizedExpressionSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.openParenToken; - case 1: return node.expression; - case 2: return node.closeParenToken; - } - } - function parenthesizedArrowFunctionExpressionChildAt(node: ParenthesizedArrowFunctionExpressionSyntax, index: number): ISyntaxElement { - 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: SimpleArrowFunctionExpressionSyntax, index: number): ISyntaxElement { - 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: CastExpressionSyntax, index: number): ISyntaxElement { - 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: ElementAccessExpressionSyntax, index: number): ISyntaxElement { - 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: FunctionExpressionSyntax, index: number): ISyntaxElement { - 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: OmittedExpressionSyntax, index: number): ISyntaxElement { - throw Errors.invalidOperation(); - } - function templateExpressionChildAt(node: TemplateExpressionSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.templateStartToken; - case 1: return node.templateClauses; - } - } - function templateAccessExpressionChildAt(node: TemplateAccessExpressionSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.expression; - case 1: return node.templateExpression; - } - } - function variableDeclarationChildAt(node: VariableDeclarationSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.varKeyword; - case 1: return node.variableDeclarators; - } - } - function variableDeclaratorChildAt(node: VariableDeclaratorSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.propertyName; - case 1: return node.typeAnnotation; - case 2: return node.equalsValueClause; - } - } - function argumentListChildAt(node: ArgumentListSyntax, index: number): ISyntaxElement { - 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: ParameterListSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.openParenToken; - case 1: return node.parameters; - case 2: return node.closeParenToken; - } - } - function typeArgumentListChildAt(node: TypeArgumentListSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.lessThanToken; - case 1: return node.typeArguments; - case 2: return node.greaterThanToken; - } - } - function typeParameterListChildAt(node: TypeParameterListSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.lessThanToken; - case 1: return node.typeParameters; - case 2: return node.greaterThanToken; - } - } - function heritageClauseChildAt(node: HeritageClauseSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.extendsOrImplementsKeyword; - case 1: return node.typeNames; - } - } - function equalsValueClauseChildAt(node: EqualsValueClauseSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.equalsToken; - case 1: return node.value; - } - } - function caseSwitchClauseChildAt(node: CaseSwitchClauseSyntax, index: number): ISyntaxElement { - 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: DefaultSwitchClauseSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.defaultKeyword; - case 1: return node.colonToken; - case 2: return node.statements; - } - } - function elseClauseChildAt(node: ElseClauseSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.elseKeyword; - case 1: return node.statement; - } - } - function catchClauseChildAt(node: CatchClauseSyntax, index: number): ISyntaxElement { - 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: FinallyClauseSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.finallyKeyword; - case 1: return node.block; - } - } - function templateClauseChildAt(node: TemplateClauseSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.expression; - case 1: return node.templateMiddleOrEndToken; - } - } - function typeParameterChildAt(node: TypeParameterSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.identifier; - case 1: return node.constraint; - } - } - function constraintChildAt(node: ConstraintSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.extendsKeyword; - case 1: return node.typeOrExpression; - } - } - function simplePropertyAssignmentChildAt(node: SimplePropertyAssignmentSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.propertyName; - case 1: return node.colonToken; - case 2: return node.expression; - } - } - function functionPropertyAssignmentChildAt(node: FunctionPropertyAssignmentSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.propertyName; - case 1: return node.callSignature; - case 2: return node.block; - } - } - function parameterChildAt(node: ParameterSyntax, index: number): ISyntaxElement { - 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: EnumElementSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.propertyName; - case 1: return node.equalsValueClause; - } - } - function typeAnnotationChildAt(node: TypeAnnotationSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.colonToken; - case 1: return node.type; - } - } - function externalModuleReferenceChildAt(node: ExternalModuleReferenceSyntax, index: number): ISyntaxElement { - 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: ModuleNameModuleReferenceSyntax, index: number): ISyntaxElement { - switch (index) { - case 0: return node.moduleName; - } - } - export function childAt(element: ISyntaxElement, index: number): ISyntaxElement { - if (isList(element)) { return (element)[index]; } - switch (element.kind()) { - case SyntaxKind.SourceUnit: return sourceUnitChildAt(element, index); - case SyntaxKind.QualifiedName: return qualifiedNameChildAt(element, index); - case SyntaxKind.ObjectType: return objectTypeChildAt(element, index); - case SyntaxKind.FunctionType: return functionTypeChildAt(element, index); - case SyntaxKind.ArrayType: return arrayTypeChildAt(element, index); - case SyntaxKind.ConstructorType: return constructorTypeChildAt(element, index); - case SyntaxKind.GenericType: return genericTypeChildAt(element, index); - case SyntaxKind.TypeQuery: return typeQueryChildAt(element, index); - case SyntaxKind.TupleType: return tupleTypeChildAt(element, index); - case SyntaxKind.UnionType: return unionTypeChildAt(element, index); - case SyntaxKind.ParenthesizedType: return parenthesizedTypeChildAt(element, index); - case SyntaxKind.InterfaceDeclaration: return interfaceDeclarationChildAt(element, index); - case SyntaxKind.FunctionDeclaration: return functionDeclarationChildAt(element, index); - case SyntaxKind.ModuleDeclaration: return moduleDeclarationChildAt(element, index); - case SyntaxKind.ClassDeclaration: return classDeclarationChildAt(element, index); - case SyntaxKind.EnumDeclaration: return enumDeclarationChildAt(element, index); - case SyntaxKind.ImportDeclaration: return importDeclarationChildAt(element, index); - case SyntaxKind.ExportAssignment: return exportAssignmentChildAt(element, index); - case SyntaxKind.MemberFunctionDeclaration: return memberFunctionDeclarationChildAt(element, index); - case SyntaxKind.MemberVariableDeclaration: return memberVariableDeclarationChildAt(element, index); - case SyntaxKind.ConstructorDeclaration: return constructorDeclarationChildAt(element, index); - case SyntaxKind.IndexMemberDeclaration: return indexMemberDeclarationChildAt(element, index); - case SyntaxKind.GetAccessor: return getAccessorChildAt(element, index); - case SyntaxKind.SetAccessor: return setAccessorChildAt(element, index); - case SyntaxKind.PropertySignature: return propertySignatureChildAt(element, index); - case SyntaxKind.CallSignature: return callSignatureChildAt(element, index); - case SyntaxKind.ConstructSignature: return constructSignatureChildAt(element, index); - case SyntaxKind.IndexSignature: return indexSignatureChildAt(element, index); - case SyntaxKind.MethodSignature: return methodSignatureChildAt(element, index); - case SyntaxKind.Block: return blockChildAt(element, index); - case SyntaxKind.IfStatement: return ifStatementChildAt(element, index); - case SyntaxKind.VariableStatement: return variableStatementChildAt(element, index); - case SyntaxKind.ExpressionStatement: return expressionStatementChildAt(element, index); - case SyntaxKind.ReturnStatement: return returnStatementChildAt(element, index); - case SyntaxKind.SwitchStatement: return switchStatementChildAt(element, index); - case SyntaxKind.BreakStatement: return breakStatementChildAt(element, index); - case SyntaxKind.ContinueStatement: return continueStatementChildAt(element, index); - case SyntaxKind.ForStatement: return forStatementChildAt(element, index); - case SyntaxKind.ForInStatement: return forInStatementChildAt(element, index); - case SyntaxKind.EmptyStatement: return emptyStatementChildAt(element, index); - case SyntaxKind.ThrowStatement: return throwStatementChildAt(element, index); - case SyntaxKind.WhileStatement: return whileStatementChildAt(element, index); - case SyntaxKind.TryStatement: return tryStatementChildAt(element, index); - case SyntaxKind.LabeledStatement: return labeledStatementChildAt(element, index); - case SyntaxKind.DoStatement: return doStatementChildAt(element, index); - case SyntaxKind.DebuggerStatement: return debuggerStatementChildAt(element, index); - case SyntaxKind.WithStatement: return withStatementChildAt(element, index); - case SyntaxKind.PrefixUnaryExpression: return prefixUnaryExpressionChildAt(element, index); - case SyntaxKind.DeleteExpression: return deleteExpressionChildAt(element, index); - case SyntaxKind.TypeOfExpression: return typeOfExpressionChildAt(element, index); - case SyntaxKind.VoidExpression: return voidExpressionChildAt(element, index); - case SyntaxKind.ConditionalExpression: return conditionalExpressionChildAt(element, index); - case SyntaxKind.BinaryExpression: return binaryExpressionChildAt(element, index); - case SyntaxKind.PostfixUnaryExpression: return postfixUnaryExpressionChildAt(element, index); - case SyntaxKind.MemberAccessExpression: return memberAccessExpressionChildAt(element, index); - case SyntaxKind.InvocationExpression: return invocationExpressionChildAt(element, index); - case SyntaxKind.ArrayLiteralExpression: return arrayLiteralExpressionChildAt(element, index); - case SyntaxKind.ObjectLiteralExpression: return objectLiteralExpressionChildAt(element, index); - case SyntaxKind.ObjectCreationExpression: return objectCreationExpressionChildAt(element, index); - case SyntaxKind.ParenthesizedExpression: return parenthesizedExpressionChildAt(element, index); - case SyntaxKind.ParenthesizedArrowFunctionExpression: return parenthesizedArrowFunctionExpressionChildAt(element, index); - case SyntaxKind.SimpleArrowFunctionExpression: return simpleArrowFunctionExpressionChildAt(element, index); - case SyntaxKind.CastExpression: return castExpressionChildAt(element, index); - case SyntaxKind.ElementAccessExpression: return elementAccessExpressionChildAt(element, index); - case SyntaxKind.FunctionExpression: return functionExpressionChildAt(element, index); - case SyntaxKind.OmittedExpression: return omittedExpressionChildAt(element, index); - case SyntaxKind.TemplateExpression: return templateExpressionChildAt(element, index); - case SyntaxKind.TemplateAccessExpression: return templateAccessExpressionChildAt(element, index); - case SyntaxKind.VariableDeclaration: return variableDeclarationChildAt(element, index); - case SyntaxKind.VariableDeclarator: return variableDeclaratorChildAt(element, index); - case SyntaxKind.ArgumentList: return argumentListChildAt(element, index); - case SyntaxKind.ParameterList: return parameterListChildAt(element, index); - case SyntaxKind.TypeArgumentList: return typeArgumentListChildAt(element, index); - case SyntaxKind.TypeParameterList: return typeParameterListChildAt(element, index); - case SyntaxKind.HeritageClause: return heritageClauseChildAt(element, index); - case SyntaxKind.EqualsValueClause: return equalsValueClauseChildAt(element, index); - case SyntaxKind.CaseSwitchClause: return caseSwitchClauseChildAt(element, index); - case SyntaxKind.DefaultSwitchClause: return defaultSwitchClauseChildAt(element, index); - case SyntaxKind.ElseClause: return elseClauseChildAt(element, index); - case SyntaxKind.CatchClause: return catchClauseChildAt(element, index); - case SyntaxKind.FinallyClause: return finallyClauseChildAt(element, index); - case SyntaxKind.TemplateClause: return templateClauseChildAt(element, index); - case SyntaxKind.TypeParameter: return typeParameterChildAt(element, index); - case SyntaxKind.Constraint: return constraintChildAt(element, index); - case SyntaxKind.SimplePropertyAssignment: return simplePropertyAssignmentChildAt(element, index); - case SyntaxKind.FunctionPropertyAssignment: return functionPropertyAssignmentChildAt(element, index); - case SyntaxKind.Parameter: return parameterChildAt(element, index); - case SyntaxKind.EnumElement: return enumElementChildAt(element, index); - case SyntaxKind.TypeAnnotation: return typeAnnotationChildAt(element, index); - case SyntaxKind.ExternalModuleReference: return externalModuleReferenceChildAt(element, index); - case SyntaxKind.ModuleNameModuleReference: return moduleNameModuleReferenceChildAt(element, index); - } - } -} \ No newline at end of file diff --git a/src/services/syntax/syntaxUtilities.ts b/src/services/syntax/syntaxUtilities.ts index 06525cf81b6..13d988926b0 100644 --- a/src/services/syntax/syntaxUtilities.ts +++ b/src/services/syntax/syntaxUtilities.ts @@ -1,9 +1,19 @@ /// module TypeScript { - export class SyntaxUtilities { - public static isAnyFunctionExpressionOrDeclaration(ast: ISyntaxElement): boolean { - switch (ast.kind()) { + export function childCount(element: ISyntaxElement): number { + if (isList(element)) { return (element).length; } + return (element).childCount; + } + + export function childAt(element: ISyntaxElement, index: number): ISyntaxElement { + if (isList(element)) { return (element)[index]; } + return (element).childAt(index); + } + + export module SyntaxUtilities { + export function isAnyFunctionExpressionOrDeclaration(ast: ISyntaxElement): boolean { + switch (ast.kind) { case SyntaxKind.SimpleArrowFunctionExpression: case SyntaxKind.ParenthesizedArrowFunctionExpression: case SyntaxKind.FunctionExpression: @@ -19,7 +29,7 @@ module TypeScript { return false; } - public static isLastTokenOnLine(token: ISyntaxToken, text: ISimpleText): boolean { + export function isLastTokenOnLine(token: ISyntaxToken, text: ISimpleText): boolean { var _nextToken = nextToken(token, text); if (_nextToken === undefined) { return true; @@ -32,9 +42,9 @@ module TypeScript { return tokenLine !== nextTokenLine; } - public static isLeftHandSizeExpression(element: ISyntaxElement) { + export function isLeftHandSizeExpression(element: ISyntaxElement) { if (element) { - switch (element.kind()) { + switch (element.kind) { case SyntaxKind.MemberAccessExpression: case SyntaxKind.ElementAccessExpression: case SyntaxKind.TemplateAccessExpression: @@ -60,9 +70,9 @@ module TypeScript { return false; } - public static isSwitchClause(element: ISyntaxElement) { + export function isSwitchClause(element: ISyntaxElement) { if (element) { - switch (element.kind()) { + switch (element.kind) { case SyntaxKind.CaseSwitchClause: case SyntaxKind.DefaultSwitchClause: return true; @@ -72,9 +82,9 @@ module TypeScript { return false; } - public static isTypeMember(element: ISyntaxElement) { + export function isTypeMember(element: ISyntaxElement) { if (element) { - switch (element.kind()) { + switch (element.kind) { case SyntaxKind.ConstructSignature: case SyntaxKind.MethodSignature: case SyntaxKind.IndexSignature: @@ -87,9 +97,9 @@ module TypeScript { return false; } - public static isClassElement(element: ISyntaxElement) { + export function isClassElement(element: ISyntaxElement) { if (element) { - switch (element.kind()) { + switch (element.kind) { case SyntaxKind.ConstructorDeclaration: case SyntaxKind.IndexMemberDeclaration: case SyntaxKind.MemberFunctionDeclaration: @@ -104,9 +114,9 @@ module TypeScript { return false; } - public static isModuleElement(element: ISyntaxElement) { + export function isModuleElement(element: ISyntaxElement) { if (element) { - switch (element.kind()) { + switch (element.kind) { case SyntaxKind.ImportDeclaration: case SyntaxKind.ExportAssignment: case SyntaxKind.ClassDeclaration: @@ -141,9 +151,9 @@ module TypeScript { return false; } - public static isStatement(element: ISyntaxElement) { + export function isStatement(element: ISyntaxElement) { if (element) { - switch (element.kind()) { + switch (element.kind) { case SyntaxKind.FunctionDeclaration: case SyntaxKind.VariableStatement: case SyntaxKind.Block: @@ -170,11 +180,11 @@ module TypeScript { return false; } - public static isAngleBracket(positionedElement: ISyntaxElement): boolean { + export function isAngleBracket(positionedElement: ISyntaxElement): boolean { var element = positionedElement; var parent = positionedElement.parent; - if (parent && (element.kind() === SyntaxKind.LessThanToken || element.kind() === SyntaxKind.GreaterThanToken)) { - switch (parent.kind()) { + if (parent && (element.kind === SyntaxKind.LessThanToken || element.kind === SyntaxKind.GreaterThanToken)) { + switch (parent.kind) { case SyntaxKind.TypeArgumentList: case SyntaxKind.TypeParameterList: case SyntaxKind.CastExpression: @@ -185,10 +195,10 @@ module TypeScript { return false; } - public static getToken(list: ISyntaxToken[], kind: SyntaxKind): ISyntaxToken { + export function getToken(list: ISyntaxToken[], kind: SyntaxKind): ISyntaxToken { for (var i = 0, n = list.length; i < n; i++) { var token = list[i]; - if (token.kind() === kind) { + if (token.kind === kind) { return token; } } @@ -196,16 +206,16 @@ module TypeScript { return undefined; } - public static containsToken(list: ISyntaxToken[], kind: SyntaxKind): boolean { + export function containsToken(list: ISyntaxToken[], kind: SyntaxKind): boolean { return !!SyntaxUtilities.getToken(list, kind); } - public static hasExportKeyword(moduleElement: IModuleElementSyntax): boolean { + export function hasExportKeyword(moduleElement: IModuleElementSyntax): boolean { return !!SyntaxUtilities.getExportKeyword(moduleElement); } - public static getExportKeyword(moduleElement: IModuleElementSyntax): ISyntaxToken { - switch (moduleElement.kind()) { + export function getExportKeyword(moduleElement: IModuleElementSyntax): ISyntaxToken { + switch (moduleElement.kind) { case SyntaxKind.ModuleDeclaration: case SyntaxKind.ClassDeclaration: case SyntaxKind.FunctionDeclaration: @@ -219,13 +229,13 @@ module TypeScript { } } - public static isAmbientDeclarationSyntax(positionNode: ISyntaxNode): boolean { + export function isAmbientDeclarationSyntax(positionNode: ISyntaxNode): boolean { if (!positionNode) { return false; } var node = positionNode; - switch (node.kind()) { + switch (node.kind) { case SyntaxKind.ModuleDeclaration: case SyntaxKind.ClassDeclaration: case SyntaxKind.FunctionDeclaration: diff --git a/src/services/syntax/syntaxVisitor.generated.ts b/src/services/syntax/syntaxVisitor.generated.ts index 4eca73a7765..7900aaad1dc 100644 --- a/src/services/syntax/syntaxVisitor.generated.ts +++ b/src/services/syntax/syntaxVisitor.generated.ts @@ -3,7 +3,7 @@ module TypeScript { export function visitNodeOrToken(visitor: ISyntaxVisitor, element: ISyntaxNodeOrToken): any { if (element === undefined) { return undefined; } - switch (element.kind()) { + switch (element.kind) { case SyntaxKind.SourceUnit: return visitor.visitSourceUnit(element); case SyntaxKind.QualifiedName: return visitor.visitQualifiedName(element); case SyntaxKind.ObjectType: return visitor.visitObjectType(element); @@ -93,6 +93,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.ComputedPropertyName: return visitor.visitComputedPropertyName(element); case SyntaxKind.ExternalModuleReference: return visitor.visitExternalModuleReference(element); case SyntaxKind.ModuleNameModuleReference: return visitor.visitModuleNameModuleReference(element); default: return visitor.visitToken(element); @@ -190,6 +191,7 @@ module TypeScript { visitParameter(node: ParameterSyntax): any; visitEnumElement(node: EnumElementSyntax): any; visitTypeAnnotation(node: TypeAnnotationSyntax): 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 7fb54355ca8..f7df58a3bb2 100644 --- a/src/services/syntax/syntaxWalker.generated.ts +++ b/src/services/syntax/syntaxWalker.generated.ts @@ -151,7 +151,7 @@ module TypeScript { public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): void { this.visitList(node.modifiers); - this.visitToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature); visitNodeOrToken(this, node.block); this.visitOptionalToken(node.semicolonToken); @@ -180,7 +180,7 @@ module TypeScript { public visitGetAccessor(node: GetAccessorSyntax): void { this.visitList(node.modifiers); this.visitToken(node.getKeyword); - this.visitToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature); visitNodeOrToken(this, node.block); } @@ -188,13 +188,13 @@ module TypeScript { public visitSetAccessor(node: SetAccessorSyntax): void { this.visitList(node.modifiers); this.visitToken(node.setKeyword); - this.visitToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature); visitNodeOrToken(this, node.block); } public visitPropertySignature(node: PropertySignatureSyntax): void { - this.visitToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.visitOptionalToken(node.questionToken); visitNodeOrToken(this, node.typeAnnotation); } @@ -218,7 +218,7 @@ module TypeScript { } public visitMethodSignature(node: MethodSignatureSyntax): void { - this.visitToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.visitOptionalToken(node.questionToken); visitNodeOrToken(this, node.callSignature); } @@ -483,7 +483,7 @@ module TypeScript { } public visitVariableDeclarator(node: VariableDeclaratorSyntax): void { - this.visitToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.typeAnnotation); visitNodeOrToken(this, node.equalsValueClause); } @@ -571,13 +571,13 @@ module TypeScript { } public visitSimplePropertyAssignment(node: SimplePropertyAssignmentSyntax): void { - this.visitToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); this.visitToken(node.colonToken); visitNodeOrToken(this, node.expression); } public visitFunctionPropertyAssignment(node: FunctionPropertyAssignmentSyntax): void { - this.visitToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.callSignature); visitNodeOrToken(this, node.block); } @@ -592,7 +592,7 @@ module TypeScript { } public visitEnumElement(node: EnumElementSyntax): void { - this.visitToken(node.propertyName); + visitNodeOrToken(this, node.propertyName); visitNodeOrToken(this, node.equalsValueClause); } @@ -601,6 +601,12 @@ module TypeScript { visitNodeOrToken(this, node.type); } + public visitComputedPropertyName(node: ComputedPropertyNameSyntax): void { + this.visitToken(node.openBracketToken); + visitNodeOrToken(this, node.expression); + this.visitToken(node.closeBracketToken); + } + public visitExternalModuleReference(node: ExternalModuleReferenceSyntax): void { this.visitToken(node.requireKeyword); this.visitToken(node.openParenToken); diff --git a/src/services/syntax/testUtilities.ts b/src/services/syntax/testUtilities.ts index 1febd184a8c..8a77c3f8314 100644 --- a/src/services/syntax/testUtilities.ts +++ b/src/services/syntax/testUtilities.ts @@ -9,10 +9,10 @@ module TypeScript { if (node1 === node2) { return true; } if (!node1 || !node2) { return false; } - Debug.assert(node1.kind() === TypeScript.SyntaxKind.SourceUnit || node1.parent); - Debug.assert(node2.kind() === TypeScript.SyntaxKind.SourceUnit || node2.parent); + Debug.assert(node1.kind === TypeScript.SyntaxKind.SourceUnit || node1.parent); + Debug.assert(node2.kind === TypeScript.SyntaxKind.SourceUnit || node2.parent); - if (node1.kind() !== node2.kind()) { return false; } + if (node1.kind !== node2.kind) { return false; } if (childCount(node1) !== childCount(node2)) { return false; } for (var i = 0, n = childCount(node1); i < n; i++) { @@ -41,8 +41,8 @@ module TypeScript { return false; } - Debug.assert(node1.kind() === TypeScript.SyntaxKind.SourceUnit || node1.parent); - Debug.assert(node2.kind() === TypeScript.SyntaxKind.SourceUnit || node2.parent); + Debug.assert(node1.kind === TypeScript.SyntaxKind.SourceUnit || node1.parent); + Debug.assert(node2.kind === TypeScript.SyntaxKind.SourceUnit || node2.parent); if (TypeScript.isToken(node1)) { return TypeScript.isToken(node2) ? tokenStructuralEquals(node1, node2, text1, text2) : false; @@ -63,7 +63,7 @@ module TypeScript { Debug.assert(token1.parent); Debug.assert(token2.parent); - return token1.kind() === token2.kind() && + return token1.kind === token2.kind && TypeScript.width(token1) === TypeScript.width(token2) && token1.fullWidth() === token2.fullWidth() && token1.fullStart() === token2.fullStart() && @@ -135,10 +135,10 @@ module TypeScript { return false; } - Debug.assert(element1.kind() === SyntaxKind.SourceUnit || element1.parent); - Debug.assert(element2.kind() === SyntaxKind.SourceUnit || element2.parent); + Debug.assert(element1.kind === SyntaxKind.SourceUnit || element1.parent); + Debug.assert(element2.kind === SyntaxKind.SourceUnit || element2.parent); - if (element2.kind() !== element2.kind()) { + if (element2.kind !== element2.kind) { return false; } diff --git a/src/services/syntax/utilities.generated.ts b/src/services/syntax/utilities.generated.ts new file mode 100644 index 00000000000..a01618fae48 --- /dev/null +++ b/src/services/syntax/utilities.generated.ts @@ -0,0 +1,4 @@ + var fixedWidthArray = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 5, 8, 8, 7, 6, 2, 4, 5, 7, 3, 8, 2, 2, 10, 3, 4, 6, 6, 4, 5, 4, 3, 6, 3, 4, 5, 4, 5, 5, 4, 6, 7, 6, 5, 10, 9, 3, 7, 7, 9, 6, 6, 5, 3, 7, 11, 7, 3, 6, 7, 6, 3, 6, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 2, 2, 2, 1, 2]; + function fixedWidthTokenLength(kind: SyntaxKind) { + return fixedWidthArray[kind]; + } diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 2cc5c827b4f..8dcd06f5621 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -238,7 +238,7 @@ module ts { } if (isAnyFunction(node) || node.kind === SyntaxKind.ClassDeclaration || node.kind === SyntaxKind.InterfaceDeclaration) { - return (node).typeParameters; + return (node).typeParameters; } return undefined; diff --git a/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt b/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt index a3e8acd7d17..22fdeb099bc 100644 --- a/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt +++ b/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt @@ -6,10 +6,10 @@ tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(8,16): error TS10 tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(3,55): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(5,54): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,52): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,51): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(3,55): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(5,54): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,52): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,51): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts (12 errors) ==== @@ -21,13 +21,13 @@ tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,51): error TS2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. public get AnnotatedSetter_SetterLast() { return ""; } ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. public set AnnotatedSetter_SetterLast(a: number) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -39,13 +39,13 @@ tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,51): error TS2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. public set AnnotatedGetter_GetterLast(aStr) { aStr = 0; } ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. public get AnnotatedGetter_GetterLast(): string { return ""; } ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.js b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.js index f34ac61d86d..1ba54d47f1c 100644 --- a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.js +++ b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.js @@ -50,12 +50,12 @@ var r3 = null + b; var r4 = null + 1; var r5 = null + c; var r6 = null + 0 /* a */; -var r7 = null + E['a']; +var r7 = null + 0 /* 'a' */; var r8 = b + null; var r9 = 1 + null; var r10 = c + null; var r11 = 0 /* a */ + null; -var r12 = E['a'] + null; +var r12 = 0 /* 'a' */ + null; // null + string var r13 = null + d; var r14 = null + ''; diff --git a/tests/baselines/reference/additionOperatorWithNumberAndEnum.js b/tests/baselines/reference/additionOperatorWithNumberAndEnum.js index 63e038265d6..05bca7a4c0c 100644 --- a/tests/baselines/reference/additionOperatorWithNumberAndEnum.js +++ b/tests/baselines/reference/additionOperatorWithNumberAndEnum.js @@ -29,4 +29,4 @@ var r4 = b + b; var r5 = 0 + a; var r6 = 0 /* a */ + 0; var r7 = 0 /* a */ + 1 /* b */; -var r8 = E['a'] + E['b']; +var r8 = 0 /* 'a' */ + 1 /* 'b' */; diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.js b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.js index a6a1b2ef555..cb89d242a18 100644 --- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.js +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.js @@ -50,12 +50,12 @@ var r3 = undefined + b; var r4 = undefined + 1; var r5 = undefined + c; var r6 = undefined + 0 /* a */; -var r7 = undefined + E['a']; +var r7 = undefined + 0 /* 'a' */; var r8 = b + undefined; var r9 = 1 + undefined; var r10 = c + undefined; var r11 = 0 /* a */ + undefined; -var r12 = E['a'] + undefined; +var r12 = 0 /* 'a' */ + undefined; // undefined + string var r13 = undefined + d; var r14 = undefined + ''; diff --git a/tests/baselines/reference/aliasAssignments.errors.txt b/tests/baselines/reference/aliasAssignments.errors.txt index 54190485c3d..90a3672780f 100644 --- a/tests/baselines/reference/aliasAssignments.errors.txt +++ b/tests/baselines/reference/aliasAssignments.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2323: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. +tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. Property 'someClass' is missing in type 'Number'. -tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2323: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'. +tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2322: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'. ==== tests/cases/compiler/aliasAssignments_1.ts (2 errors) ==== @@ -8,12 +8,12 @@ tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2323: Type 'typeof "tes var x = moduleA; x = 1; // Should be error ~ -!!! error TS2323: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. -!!! error TS2323: Property 'someClass' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. +!!! error TS2322: Property 'someClass' is missing in type 'Number'. var y = 1; y = moduleA; // should be error ~ -!!! error TS2323: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'. +!!! error TS2322: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'. ==== tests/cases/compiler/aliasAssignments_moduleA.ts (0 errors) ==== export class someClass { diff --git a/tests/baselines/reference/ambiguousOverload.errors.txt b/tests/baselines/reference/ambiguousOverload.errors.txt index 93d2fe848cc..936e6e71220 100644 --- a/tests/baselines/reference/ambiguousOverload.errors.txt +++ b/tests/baselines/reference/ambiguousOverload.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/ambiguousOverload.ts(5,5): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/ambiguousOverload.ts(11,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/ambiguousOverload.ts(5,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/ambiguousOverload.ts(11,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/ambiguousOverload.ts (2 errors) ==== @@ -9,7 +9,7 @@ tests/cases/compiler/ambiguousOverload.ts(11,5): error TS2323: Type 'string' is var x: number = foof("s", null); var y: string = foof("s", null); ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. function foof2(bar: string, x): string; function foof2(bar: string, y): number; @@ -17,4 +17,4 @@ tests/cases/compiler/ambiguousOverload.ts(11,5): error TS2323: Type 'string' is var x2: string = foof2("s", null); var y2: number = foof2("s", null); ~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt index 53caecf63cb..812bbe15da4 100644 --- a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt +++ b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2323: Type 'number' is not assignable to type 'IArguments'. +tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2322: Type 'number' is not assignable to type 'IArguments'. Property 'length' is missing in type 'Number'. @@ -7,6 +7,6 @@ tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS function foo(a) { arguments = 10; /// This shouldnt be of type number and result in error. ~~~~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'IArguments'. -!!! error TS2323: Property 'length' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'IArguments'. +!!! error TS2322: Property 'length' is missing in type 'Number'. } \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest1.errors.txt b/tests/baselines/reference/arrayAssignmentTest1.errors.txt index 48037451fb2..d3a7fafed05 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest1.errors.txt @@ -1,46 +1,46 @@ -tests/cases/compiler/arrayAssignmentTest1.ts(46,5): error TS2323: Type 'undefined[]' is not assignable to type 'I1'. +tests/cases/compiler/arrayAssignmentTest1.ts(46,5): error TS2322: Type 'undefined[]' is not assignable to type 'I1'. Property 'IM1' is missing in type 'undefined[]'. -tests/cases/compiler/arrayAssignmentTest1.ts(47,5): error TS2323: Type 'undefined[]' is not assignable to type 'C1'. +tests/cases/compiler/arrayAssignmentTest1.ts(47,5): error TS2322: Type 'undefined[]' is not assignable to type 'C1'. Property 'IM1' is missing in type 'undefined[]'. -tests/cases/compiler/arrayAssignmentTest1.ts(48,5): error TS2323: Type 'undefined[]' is not assignable to type 'C2'. +tests/cases/compiler/arrayAssignmentTest1.ts(48,5): error TS2322: Type 'undefined[]' is not assignable to type 'C2'. Property 'C2M1' is missing in type 'undefined[]'. -tests/cases/compiler/arrayAssignmentTest1.ts(49,5): error TS2323: Type 'undefined[]' is not assignable to type 'C3'. +tests/cases/compiler/arrayAssignmentTest1.ts(49,5): error TS2322: Type 'undefined[]' is not assignable to type 'C3'. Property 'CM3M1' is missing in type 'undefined[]'. -tests/cases/compiler/arrayAssignmentTest1.ts(60,1): error TS2323: Type 'C3[]' is not assignable to type 'I1[]'. +tests/cases/compiler/arrayAssignmentTest1.ts(60,1): error TS2322: Type 'C3[]' is not assignable to type 'I1[]'. Type 'C3' is not assignable to type 'I1'. Property 'IM1' is missing in type 'C3'. -tests/cases/compiler/arrayAssignmentTest1.ts(64,1): error TS2323: Type 'I1[]' is not assignable to type 'C1[]'. +tests/cases/compiler/arrayAssignmentTest1.ts(64,1): error TS2322: Type 'I1[]' is not assignable to type 'C1[]'. Type 'I1' is not assignable to type 'C1'. Property 'C1M1' is missing in type 'I1'. -tests/cases/compiler/arrayAssignmentTest1.ts(65,1): error TS2323: Type 'C3[]' is not assignable to type 'C1[]'. +tests/cases/compiler/arrayAssignmentTest1.ts(65,1): error TS2322: Type 'C3[]' is not assignable to type 'C1[]'. Type 'C3' is not assignable to type 'C1'. Property 'IM1' is missing in type 'C3'. -tests/cases/compiler/arrayAssignmentTest1.ts(68,1): error TS2323: Type 'C1[]' is not assignable to type 'C2[]'. +tests/cases/compiler/arrayAssignmentTest1.ts(68,1): error TS2322: Type 'C1[]' is not assignable to type 'C2[]'. Type 'C1' is not assignable to type 'C2'. Property 'C2M1' is missing in type 'C1'. -tests/cases/compiler/arrayAssignmentTest1.ts(69,1): error TS2323: Type 'I1[]' is not assignable to type 'C2[]'. +tests/cases/compiler/arrayAssignmentTest1.ts(69,1): error TS2322: Type 'I1[]' is not assignable to type 'C2[]'. Type 'I1' is not assignable to type 'C2'. Property 'C2M1' is missing in type 'I1'. -tests/cases/compiler/arrayAssignmentTest1.ts(70,1): error TS2323: Type 'C3[]' is not assignable to type 'C2[]'. +tests/cases/compiler/arrayAssignmentTest1.ts(70,1): error TS2322: Type 'C3[]' is not assignable to type 'C2[]'. Type 'C3' is not assignable to type 'C2'. Property 'C2M1' is missing in type 'C3'. -tests/cases/compiler/arrayAssignmentTest1.ts(75,1): error TS2323: Type 'C2[]' is not assignable to type 'C3[]'. +tests/cases/compiler/arrayAssignmentTest1.ts(75,1): error TS2322: Type 'C2[]' is not assignable to type 'C3[]'. Type 'C2' is not assignable to type 'C3'. -tests/cases/compiler/arrayAssignmentTest1.ts(76,1): error TS2323: Type 'C1[]' is not assignable to type 'C3[]'. +tests/cases/compiler/arrayAssignmentTest1.ts(76,1): error TS2322: Type 'C1[]' is not assignable to type 'C3[]'. Type 'C1' is not assignable to type 'C3'. -tests/cases/compiler/arrayAssignmentTest1.ts(77,1): error TS2323: Type 'I1[]' is not assignable to type 'C3[]'. +tests/cases/compiler/arrayAssignmentTest1.ts(77,1): error TS2322: Type 'I1[]' is not assignable to type 'C3[]'. Type 'I1' is not assignable to type 'C3'. -tests/cases/compiler/arrayAssignmentTest1.ts(79,1): error TS2323: Type '() => C1' is not assignable to type 'any[]'. +tests/cases/compiler/arrayAssignmentTest1.ts(79,1): error TS2322: Type '() => C1' is not assignable to type 'any[]'. Property 'push' is missing in type '() => C1'. -tests/cases/compiler/arrayAssignmentTest1.ts(80,1): error TS2323: Type '{ one: number; }' is not assignable to type 'any[]'. +tests/cases/compiler/arrayAssignmentTest1.ts(80,1): error TS2322: Type '{ one: number; }' is not assignable to type 'any[]'. Property 'length' is missing in type '{ one: number; }'. -tests/cases/compiler/arrayAssignmentTest1.ts(82,1): error TS2323: Type 'C1' is not assignable to type 'any[]'. +tests/cases/compiler/arrayAssignmentTest1.ts(82,1): error TS2322: Type 'C1' is not assignable to type 'any[]'. Property 'length' is missing in type 'C1'. -tests/cases/compiler/arrayAssignmentTest1.ts(83,1): error TS2323: Type 'C2' is not assignable to type 'any[]'. +tests/cases/compiler/arrayAssignmentTest1.ts(83,1): error TS2322: Type 'C2' is not assignable to type 'any[]'. Property 'length' is missing in type 'C2'. -tests/cases/compiler/arrayAssignmentTest1.ts(84,1): error TS2323: Type 'C3' is not assignable to type 'any[]'. +tests/cases/compiler/arrayAssignmentTest1.ts(84,1): error TS2322: Type 'C3' is not assignable to type 'any[]'. Property 'length' is missing in type 'C3'. -tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2323: Type 'I1' is not assignable to type 'any[]'. +tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2322: Type 'I1' is not assignable to type 'any[]'. Property 'length' is missing in type 'I1'. @@ -92,20 +92,20 @@ tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2323: Type 'I1' is n var i1_error: I1 = []; // should be an error - is ~~~~~~~~ -!!! error TS2323: Type 'undefined[]' is not assignable to type 'I1'. -!!! error TS2323: Property 'IM1' is missing in type 'undefined[]'. +!!! error TS2322: Type 'undefined[]' is not assignable to type 'I1'. +!!! error TS2322: Property 'IM1' is missing in type 'undefined[]'. var c1_error: C1 = []; // should be an error - is ~~~~~~~~ -!!! error TS2323: Type 'undefined[]' is not assignable to type 'C1'. -!!! error TS2323: Property 'IM1' is missing in type 'undefined[]'. +!!! error TS2322: Type 'undefined[]' is not assignable to type 'C1'. +!!! error TS2322: Property 'IM1' is missing in type 'undefined[]'. var c2_error: C2 = []; // should be an error - is ~~~~~~~~ -!!! error TS2323: Type 'undefined[]' is not assignable to type 'C2'. -!!! error TS2323: Property 'C2M1' is missing in type 'undefined[]'. +!!! error TS2322: Type 'undefined[]' is not assignable to type 'C2'. +!!! error TS2322: Property 'C2M1' is missing in type 'undefined[]'. var c3_error: C3 = []; // should be an error - is ~~~~~~~~ -!!! error TS2323: Type 'undefined[]' is not assignable to type 'C3'. -!!! error TS2323: Property 'CM3M1' is missing in type 'undefined[]'. +!!! error TS2322: Type 'undefined[]' is not assignable to type 'C3'. +!!! error TS2322: Property 'CM3M1' is missing in type 'undefined[]'. arr_any = arr_i1; // should be ok - is @@ -118,78 +118,78 @@ tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2323: Type 'I1' is n arr_i1 = arr_c2; // should be ok - subtype relationship - is arr_i1 = arr_c3; // should be an error - is ~~~~~~ -!!! error TS2323: Type 'C3[]' is not assignable to type 'I1[]'. -!!! error TS2323: Type 'C3' is not assignable to type 'I1'. -!!! error TS2323: Property 'IM1' is missing in type 'C3'. +!!! error TS2322: Type 'C3[]' is not assignable to type 'I1[]'. +!!! error TS2322: Type 'C3' is not assignable to type 'I1'. +!!! error TS2322: Property 'IM1' is missing in type 'C3'. arr_c1 = arr_c1; // should be ok - subtype relationship - is arr_c1 = arr_c2; // should be ok - subtype relationship - is arr_c1 = arr_i1; // should be an error - is ~~~~~~ -!!! error TS2323: Type 'I1[]' is not assignable to type 'C1[]'. -!!! error TS2323: Type 'I1' is not assignable to type 'C1'. -!!! error TS2323: Property 'C1M1' is missing in type 'I1'. +!!! error TS2322: Type 'I1[]' is not assignable to type 'C1[]'. +!!! error TS2322: Type 'I1' is not assignable to type 'C1'. +!!! error TS2322: Property 'C1M1' is missing in type 'I1'. arr_c1 = arr_c3; // should be an error - is ~~~~~~ -!!! error TS2323: Type 'C3[]' is not assignable to type 'C1[]'. -!!! error TS2323: Type 'C3' is not assignable to type 'C1'. -!!! error TS2323: Property 'IM1' is missing in type 'C3'. +!!! error TS2322: Type 'C3[]' is not assignable to type 'C1[]'. +!!! error TS2322: Type 'C3' is not assignable to type 'C1'. +!!! error TS2322: Property 'IM1' is missing in type 'C3'. arr_c2 = arr_c2; // should be ok - subtype relationship - is arr_c2 = arr_c1; // should be an error - subtype relationship - is ~~~~~~ -!!! error TS2323: Type 'C1[]' is not assignable to type 'C2[]'. -!!! error TS2323: Type 'C1' is not assignable to type 'C2'. -!!! error TS2323: Property 'C2M1' is missing in type 'C1'. +!!! error TS2322: Type 'C1[]' is not assignable to type 'C2[]'. +!!! error TS2322: Type 'C1' is not assignable to type 'C2'. +!!! error TS2322: Property 'C2M1' is missing in type 'C1'. arr_c2 = arr_i1; // should be an error - subtype relationship - is ~~~~~~ -!!! error TS2323: Type 'I1[]' is not assignable to type 'C2[]'. -!!! error TS2323: Type 'I1' is not assignable to type 'C2'. -!!! error TS2323: Property 'C2M1' is missing in type 'I1'. +!!! error TS2322: Type 'I1[]' is not assignable to type 'C2[]'. +!!! error TS2322: Type 'I1' is not assignable to type 'C2'. +!!! error TS2322: Property 'C2M1' is missing in type 'I1'. arr_c2 = arr_c3; // should be an error - is ~~~~~~ -!!! error TS2323: Type 'C3[]' is not assignable to type 'C2[]'. -!!! error TS2323: Type 'C3' is not assignable to type 'C2'. -!!! error TS2323: Property 'C2M1' is missing in type 'C3'. +!!! error TS2322: Type 'C3[]' is not assignable to type 'C2[]'. +!!! error TS2322: Type 'C3' is not assignable to type 'C2'. +!!! error TS2322: Property 'C2M1' is missing in type 'C3'. // "clean up bug" occurs at this point // if you move these three expressions to another file, they raise an error // something to do with state from the above propagating forward? arr_c3 = arr_c2_2; // should be an error - is ~~~~~~ -!!! error TS2323: Type 'C2[]' is not assignable to type 'C3[]'. -!!! error TS2323: Type 'C2' is not assignable to type 'C3'. +!!! error TS2322: Type 'C2[]' is not assignable to type 'C3[]'. +!!! error TS2322: Type 'C2' is not assignable to type 'C3'. arr_c3 = arr_c1_2; // should be an error - is ~~~~~~ -!!! error TS2323: Type 'C1[]' is not assignable to type 'C3[]'. -!!! error TS2323: Type 'C1' is not assignable to type 'C3'. +!!! error TS2322: Type 'C1[]' is not assignable to type 'C3[]'. +!!! error TS2322: Type 'C1' is not assignable to type 'C3'. arr_c3 = arr_i1_2; // should be an error - is ~~~~~~ -!!! error TS2323: Type 'I1[]' is not assignable to type 'C3[]'. -!!! error TS2323: Type 'I1' is not assignable to type 'C3'. +!!! error TS2322: Type 'I1[]' is not assignable to type 'C3[]'. +!!! error TS2322: Type 'I1' is not assignable to type 'C3'. arr_any = f1; // should be an error - is ~~~~~~~ -!!! error TS2323: Type '() => C1' is not assignable to type 'any[]'. -!!! error TS2323: Property 'push' is missing in type '() => C1'. +!!! error TS2322: Type '() => C1' is not assignable to type 'any[]'. +!!! error TS2322: Property 'push' is missing in type '() => C1'. arr_any = o1; // should be an error - is ~~~~~~~ -!!! error TS2323: Type '{ one: number; }' is not assignable to type 'any[]'. -!!! error TS2323: Property 'length' is missing in type '{ one: number; }'. +!!! error TS2322: Type '{ one: number; }' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type '{ one: number; }'. arr_any = a1; // should be ok - is arr_any = c1; // should be an error - is ~~~~~~~ -!!! error TS2323: Type 'C1' is not assignable to type 'any[]'. -!!! error TS2323: Property 'length' is missing in type 'C1'. +!!! error TS2322: Type 'C1' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'C1'. arr_any = c2; // should be an error - is ~~~~~~~ -!!! error TS2323: Type 'C2' is not assignable to type 'any[]'. -!!! error TS2323: Property 'length' is missing in type 'C2'. +!!! error TS2322: Type 'C2' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'C2'. arr_any = c3; // should be an error - is ~~~~~~~ -!!! error TS2323: Type 'C3' is not assignable to type 'any[]'. -!!! error TS2323: Property 'length' is missing in type 'C3'. +!!! error TS2322: Type 'C3' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'C3'. arr_any = i1; // should be an error - is ~~~~~~~ -!!! error TS2323: Type 'I1' is not assignable to type 'any[]'. -!!! error TS2323: Property 'length' is missing in type 'I1'. \ No newline at end of file +!!! error TS2322: Type 'I1' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'I1'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest2.errors.txt b/tests/baselines/reference/arrayAssignmentTest2.errors.txt index d1bd15d6db5..a2cc6b3b954 100644 --- a/tests/baselines/reference/arrayAssignmentTest2.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest2.errors.txt @@ -1,25 +1,25 @@ -tests/cases/compiler/arrayAssignmentTest2.ts(47,1): error TS2323: Type 'C2[]' is not assignable to type 'C3[]'. +tests/cases/compiler/arrayAssignmentTest2.ts(47,1): error TS2322: Type 'C2[]' is not assignable to type 'C3[]'. Type 'C2' is not assignable to type 'C3'. Property 'CM3M1' is missing in type 'C2'. -tests/cases/compiler/arrayAssignmentTest2.ts(48,1): error TS2323: Type 'C1[]' is not assignable to type 'C3[]'. +tests/cases/compiler/arrayAssignmentTest2.ts(48,1): error TS2322: Type 'C1[]' is not assignable to type 'C3[]'. Type 'C1' is not assignable to type 'C3'. Property 'CM3M1' is missing in type 'C1'. -tests/cases/compiler/arrayAssignmentTest2.ts(49,1): error TS2323: Type 'I1[]' is not assignable to type 'C3[]'. +tests/cases/compiler/arrayAssignmentTest2.ts(49,1): error TS2322: Type 'I1[]' is not assignable to type 'C3[]'. Type 'I1' is not assignable to type 'C3'. Property 'CM3M1' is missing in type 'I1'. -tests/cases/compiler/arrayAssignmentTest2.ts(51,1): error TS2323: Type '() => C1' is not assignable to type 'any[]'. +tests/cases/compiler/arrayAssignmentTest2.ts(51,1): error TS2322: Type '() => C1' is not assignable to type 'any[]'. Property 'push' is missing in type '() => C1'. -tests/cases/compiler/arrayAssignmentTest2.ts(52,1): error TS2323: Type '() => any' is not assignable to type 'any[]'. +tests/cases/compiler/arrayAssignmentTest2.ts(52,1): error TS2322: Type '() => any' is not assignable to type 'any[]'. Property 'push' is missing in type '() => any'. -tests/cases/compiler/arrayAssignmentTest2.ts(53,1): error TS2323: Type '{ one: number; }' is not assignable to type 'any[]'. +tests/cases/compiler/arrayAssignmentTest2.ts(53,1): error TS2322: Type '{ one: number; }' is not assignable to type 'any[]'. Property 'length' is missing in type '{ one: number; }'. -tests/cases/compiler/arrayAssignmentTest2.ts(55,1): error TS2323: Type 'C1' is not assignable to type 'any[]'. +tests/cases/compiler/arrayAssignmentTest2.ts(55,1): error TS2322: Type 'C1' is not assignable to type 'any[]'. Property 'length' is missing in type 'C1'. -tests/cases/compiler/arrayAssignmentTest2.ts(56,1): error TS2323: Type 'C2' is not assignable to type 'any[]'. +tests/cases/compiler/arrayAssignmentTest2.ts(56,1): error TS2322: Type 'C2' is not assignable to type 'any[]'. Property 'length' is missing in type 'C2'. -tests/cases/compiler/arrayAssignmentTest2.ts(57,1): error TS2323: Type 'C3' is not assignable to type 'any[]'. +tests/cases/compiler/arrayAssignmentTest2.ts(57,1): error TS2322: Type 'C3' is not assignable to type 'any[]'. Property 'length' is missing in type 'C3'. -tests/cases/compiler/arrayAssignmentTest2.ts(58,1): error TS2323: Type 'I1' is not assignable to type 'any[]'. +tests/cases/compiler/arrayAssignmentTest2.ts(58,1): error TS2322: Type 'I1' is not assignable to type 'any[]'. Property 'length' is missing in type 'I1'. @@ -72,47 +72,47 @@ tests/cases/compiler/arrayAssignmentTest2.ts(58,1): error TS2323: Type 'I1' is n // "clean up error" occurs at this point arr_c3 = arr_c2_2; // should be an error - is ~~~~~~ -!!! error TS2323: Type 'C2[]' is not assignable to type 'C3[]'. -!!! error TS2323: Type 'C2' is not assignable to type 'C3'. -!!! error TS2323: Property 'CM3M1' is missing in type 'C2'. +!!! error TS2322: Type 'C2[]' is not assignable to type 'C3[]'. +!!! error TS2322: Type 'C2' is not assignable to type 'C3'. +!!! error TS2322: Property 'CM3M1' is missing in type 'C2'. arr_c3 = arr_c1_2; // should be an error - is ~~~~~~ -!!! error TS2323: Type 'C1[]' is not assignable to type 'C3[]'. -!!! error TS2323: Type 'C1' is not assignable to type 'C3'. -!!! error TS2323: Property 'CM3M1' is missing in type 'C1'. +!!! error TS2322: Type 'C1[]' is not assignable to type 'C3[]'. +!!! error TS2322: Type 'C1' is not assignable to type 'C3'. +!!! error TS2322: Property 'CM3M1' is missing in type 'C1'. arr_c3 = arr_i1_2; // should be an error - is ~~~~~~ -!!! error TS2323: Type 'I1[]' is not assignable to type 'C3[]'. -!!! error TS2323: Type 'I1' is not assignable to type 'C3'. -!!! error TS2323: Property 'CM3M1' is missing in type 'I1'. +!!! error TS2322: Type 'I1[]' is not assignable to type 'C3[]'. +!!! error TS2322: Type 'I1' is not assignable to type 'C3'. +!!! error TS2322: Property 'CM3M1' is missing in type 'I1'. arr_any = f1; // should be an error - is ~~~~~~~ -!!! error TS2323: Type '() => C1' is not assignable to type 'any[]'. -!!! error TS2323: Property 'push' is missing in type '() => C1'. +!!! error TS2322: Type '() => C1' is not assignable to type 'any[]'. +!!! error TS2322: Property 'push' is missing in type '() => C1'. arr_any = function () { return null;} // should be an error - is ~~~~~~~ -!!! error TS2323: Type '() => any' is not assignable to type 'any[]'. -!!! error TS2323: Property 'push' is missing in type '() => any'. +!!! error TS2322: Type '() => any' is not assignable to type 'any[]'. +!!! error TS2322: Property 'push' is missing in type '() => any'. arr_any = o1; // should be an error - is ~~~~~~~ -!!! error TS2323: Type '{ one: number; }' is not assignable to type 'any[]'. -!!! error TS2323: Property 'length' is missing in type '{ one: number; }'. +!!! error TS2322: Type '{ one: number; }' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type '{ one: number; }'. arr_any = a1; // should be ok - is arr_any = c1; // should be an error - is ~~~~~~~ -!!! error TS2323: Type 'C1' is not assignable to type 'any[]'. -!!! error TS2323: Property 'length' is missing in type 'C1'. +!!! error TS2322: Type 'C1' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'C1'. arr_any = c2; // should be an error - is ~~~~~~~ -!!! error TS2323: Type 'C2' is not assignable to type 'any[]'. -!!! error TS2323: Property 'length' is missing in type 'C2'. +!!! error TS2322: Type 'C2' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'C2'. arr_any = c3; // should be an error - is ~~~~~~~ -!!! error TS2323: Type 'C3' is not assignable to type 'any[]'. -!!! error TS2323: Property 'length' is missing in type 'C3'. +!!! error TS2322: Type 'C3' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'C3'. arr_any = i1; // should be an error - is ~~~~~~~ -!!! error TS2323: Type 'I1' is not assignable to type 'any[]'. -!!! error TS2323: Property 'length' is missing in type 'I1'. +!!! error TS2322: Type 'I1' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'I1'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest4.errors.txt b/tests/baselines/reference/arrayAssignmentTest4.errors.txt index 2ef303cc2bb..ecded3a3bfd 100644 --- a/tests/baselines/reference/arrayAssignmentTest4.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest4.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/arrayAssignmentTest4.ts(24,1): error TS2323: Type '() => any' is not assignable to type 'any[]'. +tests/cases/compiler/arrayAssignmentTest4.ts(24,1): error TS2322: Type '() => any' is not assignable to type 'any[]'. Property 'push' is missing in type '() => any'. -tests/cases/compiler/arrayAssignmentTest4.ts(25,1): error TS2323: Type 'C3' is not assignable to type 'any[]'. +tests/cases/compiler/arrayAssignmentTest4.ts(25,1): error TS2322: Type 'C3' is not assignable to type 'any[]'. Property 'length' is missing in type 'C3'. @@ -30,10 +30,10 @@ tests/cases/compiler/arrayAssignmentTest4.ts(25,1): error TS2323: Type 'C3' is n arr_any = function () { return null;} // should be an error - is ~~~~~~~ -!!! error TS2323: Type '() => any' is not assignable to type 'any[]'. -!!! error TS2323: Property 'push' is missing in type '() => any'. +!!! error TS2322: Type '() => any' is not assignable to type 'any[]'. +!!! error TS2322: Property 'push' is missing in type '() => any'. arr_any = c3; // should be an error - is ~~~~~~~ -!!! error TS2323: Type 'C3' is not assignable to type 'any[]'. -!!! error TS2323: Property 'length' is missing in type 'C3'. +!!! error TS2322: Type 'C3' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'C3'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest5.errors.txt b/tests/baselines/reference/arrayAssignmentTest5.errors.txt index 37252bbf1d1..3a45cad9ad7 100644 --- a/tests/baselines/reference/arrayAssignmentTest5.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/arrayAssignmentTest5.ts(23,17): error TS2323: Type 'IToken[]' is not assignable to type 'IStateToken[]'. +tests/cases/compiler/arrayAssignmentTest5.ts(23,17): error TS2322: Type 'IToken[]' is not assignable to type 'IStateToken[]'. Type 'IToken' is not assignable to type 'IStateToken'. Property 'state' is missing in type 'IToken'. @@ -28,9 +28,9 @@ tests/cases/compiler/arrayAssignmentTest5.ts(23,17): error TS2323: Type 'IToken[ var lineTokens:ILineTokens= this.tokenize(line, state, true); var tokens:IStateToken[]= lineTokens.tokens; ~~~~~~ -!!! error TS2323: Type 'IToken[]' is not assignable to type 'IStateToken[]'. -!!! error TS2323: Type 'IToken' is not assignable to type 'IStateToken'. -!!! error TS2323: Property 'state' is missing in type 'IToken'. +!!! error TS2322: Type 'IToken[]' is not assignable to type 'IStateToken[]'. +!!! error TS2322: Type 'IToken' is not assignable to type 'IStateToken'. +!!! error TS2322: Property 'state' is missing in type 'IToken'. if (tokens.length === 0) { return this.onEnter(line, tokens, offset); // <== this should produce an error since onEnter can not be called with (string, IStateToken[], offset) } diff --git a/tests/baselines/reference/arraySigChecking.errors.txt b/tests/baselines/reference/arraySigChecking.errors.txt index 50eb6a0cc9d..b70b659773c 100644 --- a/tests/baselines/reference/arraySigChecking.errors.txt +++ b/tests/baselines/reference/arraySigChecking.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/arraySigChecking.ts(11,17): error TS1023: An index signature parameter type must be 'string' or 'number'. -tests/cases/compiler/arraySigChecking.ts(18,5): error TS2323: Type 'void[]' is not assignable to type 'string[]'. +tests/cases/compiler/arraySigChecking.ts(18,5): error TS2322: Type 'void[]' is not assignable to type 'string[]'. Type 'void' is not assignable to type 'string'. -tests/cases/compiler/arraySigChecking.ts(22,1): error TS2323: Type 'number[][]' is not assignable to type 'number[][][]'. +tests/cases/compiler/arraySigChecking.ts(22,1): error TS2322: Type 'number[][]' is not assignable to type 'number[][][]'. Type 'number[]' is not assignable to type 'number[][]'. Type 'number' is not assignable to type 'number[]'. Property 'length' is missing in type 'Number'. @@ -29,17 +29,17 @@ tests/cases/compiler/arraySigChecking.ts(22,1): error TS2323: Type 'number[][]' var myVar: myInt; var strArray: string[] = [myVar.voidFn()]; ~~~~~~~~ -!!! error TS2323: Type 'void[]' is not assignable to type 'string[]'. -!!! error TS2323: Type 'void' is not assignable to type 'string'. +!!! error TS2322: Type 'void[]' is not assignable to type 'string[]'. +!!! error TS2322: Type 'void' is not assignable to type 'string'. var myArray: number[][][]; myArray = [[1, 2]]; ~~~~~~~ -!!! error TS2323: Type 'number[][]' is not assignable to type 'number[][][]'. -!!! error TS2323: Type 'number[]' is not assignable to type 'number[][]'. -!!! error TS2323: Type 'number' is not assignable to type 'number[]'. -!!! error TS2323: Property 'length' is missing in type 'Number'. +!!! error TS2322: Type 'number[][]' is not assignable to type 'number[][][]'. +!!! error TS2322: Type 'number[]' is not assignable to type 'number[][]'. +!!! error TS2322: Type 'number' is not assignable to type 'number[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. function isEmpty(l: { length: number }) { return l.length === 0; diff --git a/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt b/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt index 807227cc10b..0dcff3de422 100644 --- a/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt +++ b/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt @@ -2,9 +2,9 @@ tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts( tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,30): error TS1109: Expression expected. tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,22): error TS1005: '=' expected. tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,32): error TS1109: Expression expected. -tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,5): error TS2323: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. +tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,5): error TS2322: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. Property 'isArray' is missing in type 'Number'. -tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,5): error TS2323: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. +tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,5): error TS2322: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. ==== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts (6 errors) ==== @@ -19,12 +19,12 @@ tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts( ~ !!! error TS1109: Expression expected. ~~~ -!!! error TS2323: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. -!!! error TS2323: Property 'isArray' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. +!!! error TS2322: Property 'isArray' is missing in type 'Number'. var xs4: typeof Array; ~ !!! error TS1005: '=' expected. ~ !!! error TS1109: Expression expected. ~~~ -!!! error TS2323: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionContexts.errors.txt b/tests/baselines/reference/arrowFunctionContexts.errors.txt index 2f8a4f1a377..5ffe9d1ec34 100644 --- a/tests/baselines/reference/arrowFunctionContexts.errors.txt +++ b/tests/baselines/reference/arrowFunctionContexts.errors.txt @@ -1,12 +1,12 @@ tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(3,7): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(3,7): error TS2410: All symbols within a 'with' block will be resolved to 'any'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(19,1): error TS2304: Cannot find name 'window'. -tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(31,9): error TS2323: Type '() => number' is not assignable to type 'E'. +tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(31,9): error TS2322: Type '() => number' is not assignable to type 'E'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(32,16): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(44,11): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(44,11): error TS2410: All symbols within a 'with' block will be resolved to 'any'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(60,5): error TS2304: Cannot find name 'window'. -tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(72,13): error TS2323: Type '() => number' is not assignable to type 'E'. +tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(72,13): error TS2322: Type '() => number' is not assignable to type 'E'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(73,20): error TS2332: 'this' cannot be referenced in current location. @@ -49,7 +49,7 @@ tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(73,20): e enum E { x = () => 4, // Error expected ~~~~~~~ -!!! error TS2323: Type '() => number' is not assignable to type 'E'. +!!! error TS2322: Type '() => number' is not assignable to type 'E'. y = (() => this).length // error, can't use this in enum ~~~~ !!! error TS2332: 'this' cannot be referenced in current location. @@ -100,7 +100,7 @@ tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(73,20): e enum E { x = () => 4, // Error expected ~~~~~~~ -!!! error TS2323: Type '() => number' is not assignable to type 'E'. +!!! error TS2322: Type '() => number' is not assignable to type 'E'. y = (() => this).length ~~~~ !!! error TS2332: 'this' cannot be referenced in current location. diff --git a/tests/baselines/reference/assignFromBooleanInterface.errors.txt b/tests/baselines/reference/assignFromBooleanInterface.errors.txt index 48f06b7409e..4b06603a9bf 100644 --- a/tests/baselines/reference/assignFromBooleanInterface.errors.txt +++ b/tests/baselines/reference/assignFromBooleanInterface.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface.ts(3,1): error TS2323: Type 'Boolean' is not assignable to type 'boolean'. +tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface.ts(3,1): error TS2322: Type 'Boolean' is not assignable to type 'boolean'. ==== tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface.ts(3 var a: Boolean; x = a; ~ -!!! error TS2323: Type 'Boolean' is not assignable to type 'boolean'. +!!! error TS2322: Type 'Boolean' is not assignable to type 'boolean'. a = x; \ No newline at end of file diff --git a/tests/baselines/reference/assignFromBooleanInterface2.errors.txt b/tests/baselines/reference/assignFromBooleanInterface2.errors.txt index 495f8cc432d..66d55e00d86 100644 --- a/tests/baselines/reference/assignFromBooleanInterface2.errors.txt +++ b/tests/baselines/reference/assignFromBooleanInterface2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(19,1): error TS2323: Type 'Boolean' is not assignable to type 'boolean'. -tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(20,1): error TS2323: Type 'NotBoolean' is not assignable to type 'boolean'. +tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(19,1): error TS2322: Type 'Boolean' is not assignable to type 'boolean'. +tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts(20,1): error TS2322: Type 'NotBoolean' is not assignable to type 'boolean'. ==== tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts (2 errors) ==== @@ -23,9 +23,9 @@ tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts( x = a; // expected error ~ -!!! error TS2323: Type 'Boolean' is not assignable to type 'boolean'. +!!! error TS2322: Type 'Boolean' is not assignable to type 'boolean'. x = b; // expected error ~ -!!! error TS2323: Type 'NotBoolean' is not assignable to type 'boolean'. +!!! error TS2322: Type 'NotBoolean' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignFromNumberInterface.errors.txt b/tests/baselines/reference/assignFromNumberInterface.errors.txt index 5a65c08de4a..0c8c4a5f5ac 100644 --- a/tests/baselines/reference/assignFromNumberInterface.errors.txt +++ b/tests/baselines/reference/assignFromNumberInterface.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/primitives/number/assignFromNumberInterface.ts(3,1): error TS2323: Type 'Number' is not assignable to type 'number'. +tests/cases/conformance/types/primitives/number/assignFromNumberInterface.ts(3,1): error TS2322: Type 'Number' is not assignable to type 'number'. ==== tests/cases/conformance/types/primitives/number/assignFromNumberInterface.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/conformance/types/primitives/number/assignFromNumberInterface.ts(3,1 var a: Number; x = a; ~ -!!! error TS2323: Type 'Number' is not assignable to type 'number'. +!!! error TS2322: Type 'Number' is not assignable to type 'number'. a = x; \ No newline at end of file diff --git a/tests/baselines/reference/assignFromNumberInterface2.errors.txt b/tests/baselines/reference/assignFromNumberInterface2.errors.txt index 45a600658c2..fa53d8facdf 100644 --- a/tests/baselines/reference/assignFromNumberInterface2.errors.txt +++ b/tests/baselines/reference/assignFromNumberInterface2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts(23,1): error TS2323: Type 'Number' is not assignable to type 'number'. -tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts(24,1): error TS2323: Type 'NotNumber' is not assignable to type 'number'. +tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts(23,1): error TS2322: Type 'Number' is not assignable to type 'number'. +tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts(24,1): error TS2322: Type 'NotNumber' is not assignable to type 'number'. ==== tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts (2 errors) ==== @@ -27,9 +27,9 @@ tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts(24 x = a; // expected error ~ -!!! error TS2323: Type 'Number' is not assignable to type 'number'. +!!! error TS2322: Type 'Number' is not assignable to type 'number'. x = b; // expected error ~ -!!! error TS2323: Type 'NotNumber' is not assignable to type 'number'. +!!! error TS2322: Type 'NotNumber' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignFromStringInterface.errors.txt b/tests/baselines/reference/assignFromStringInterface.errors.txt index 93f28853c8a..6ec8afad120 100644 --- a/tests/baselines/reference/assignFromStringInterface.errors.txt +++ b/tests/baselines/reference/assignFromStringInterface.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/primitives/string/assignFromStringInterface.ts(3,1): error TS2323: Type 'String' is not assignable to type 'string'. +tests/cases/conformance/types/primitives/string/assignFromStringInterface.ts(3,1): error TS2322: Type 'String' is not assignable to type 'string'. ==== tests/cases/conformance/types/primitives/string/assignFromStringInterface.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/conformance/types/primitives/string/assignFromStringInterface.ts(3,1 var a: String; x = a; ~ -!!! error TS2323: Type 'String' is not assignable to type 'string'. +!!! error TS2322: Type 'String' is not assignable to type 'string'. a = x; \ No newline at end of file diff --git a/tests/baselines/reference/assignFromStringInterface2.errors.txt b/tests/baselines/reference/assignFromStringInterface2.errors.txt index b34366a7ce7..2e3e518f75b 100644 --- a/tests/baselines/reference/assignFromStringInterface2.errors.txt +++ b/tests/baselines/reference/assignFromStringInterface2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts(46,1): error TS2323: Type 'String' is not assignable to type 'string'. -tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts(47,1): error TS2323: Type 'NotString' is not assignable to type 'string'. +tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts(46,1): error TS2322: Type 'String' is not assignable to type 'string'. +tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts(47,1): error TS2322: Type 'NotString' is not assignable to type 'string'. ==== tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts (2 errors) ==== @@ -50,9 +50,9 @@ tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts(47 x = a; // expected error ~ -!!! error TS2323: Type 'String' is not assignable to type 'string'. +!!! error TS2322: Type 'String' is not assignable to type 'string'. x = b; // expected error ~ -!!! error TS2323: Type 'NotString' is not assignable to type 'string'. +!!! error TS2322: Type 'NotString' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignToFn.errors.txt b/tests/baselines/reference/assignToFn.errors.txt index 6b1403b7df1..7f2c7855a35 100644 --- a/tests/baselines/reference/assignToFn.errors.txt +++ b/tests/baselines/reference/assignToFn.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignToFn.ts(8,5): error TS2323: Type 'string' is not assignable to type '(n: number) => boolean'. +tests/cases/compiler/assignToFn.ts(8,5): error TS2322: Type 'string' is not assignable to type '(n: number) => boolean'. ==== tests/cases/compiler/assignToFn.ts (1 errors) ==== @@ -11,6 +11,6 @@ tests/cases/compiler/assignToFn.ts(8,5): error TS2323: Type 'string' is not assi x.f="hello"; ~~~ -!!! error TS2323: Type 'string' is not assignable to type '(n: number) => boolean'. +!!! error TS2322: Type 'string' is not assignable to type '(n: number) => boolean'. } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompat1.errors.txt b/tests/baselines/reference/assignmentCompat1.errors.txt index 6f5fc93d136..57ce797f5b2 100644 --- a/tests/baselines/reference/assignmentCompat1.errors.txt +++ b/tests/baselines/reference/assignmentCompat1.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/assignmentCompat1.ts(4,1): error TS2323: Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }'. +tests/cases/compiler/assignmentCompat1.ts(4,1): error TS2322: Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }'. Property 'one' is missing in type '{ [x: string]: any; }'. -tests/cases/compiler/assignmentCompat1.ts(5,1): error TS2323: Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }'. +tests/cases/compiler/assignmentCompat1.ts(5,1): error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }'. Index signature is missing in type '{ one: number; }'. @@ -10,9 +10,9 @@ tests/cases/compiler/assignmentCompat1.ts(5,1): error TS2323: Type '{ one: numbe x = y; ~ -!!! error TS2323: Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }'. -!!! error TS2323: Property 'one' is missing in type '{ [x: string]: any; }'. +!!! error TS2322: Type '{ [x: string]: any; }' is not assignable to type '{ one: number; }'. +!!! error TS2322: Property 'one' is missing in type '{ [x: string]: any; }'. y = x; ~ -!!! error TS2323: Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }'. -!!! error TS2323: Index signature is missing in type '{ one: number; }'. \ No newline at end of file +!!! error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: any; }'. +!!! error TS2322: Index signature is missing in type '{ one: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt b/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt index 7b74aed499f..03dcee9baf3 100644 --- a/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt +++ b/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(17,1): error TS2323: Type '[number, string]' is not assignable to type 'number[]'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(17,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]'. Types of property 'pop' are incompatible. Type '() => string | number' is not assignable to type '() => number'. Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(18,1): error TS2323: Type '{}[]' is not assignable to type '[{}]'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(18,1): error TS2322: Type '{}[]' is not assignable to type '[{}]'. Property '0' is missing in type '{}[]'. @@ -26,13 +26,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // error numArray = numStrTuple; ~~~~~~~~ -!!! error TS2323: Type '[number, string]' is not assignable to type 'number[]'. -!!! error TS2323: Types of property 'pop' are incompatible. -!!! error TS2323: Type '() => string | number' is not assignable to type '() => number'. -!!! error TS2323: Type 'string | number' is not assignable to type 'number'. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '[number, string]' is not assignable to type 'number[]'. +!!! error TS2322: Types of property 'pop' are incompatible. +!!! error TS2322: Type '() => string | number' is not assignable to type '() => number'. +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. emptyObjTuple = emptyObjArray; ~~~~~~~~~~~~~ -!!! error TS2323: Type '{}[]' is not assignable to type '[{}]'. -!!! error TS2323: Property '0' is missing in type '{}[]'. +!!! error TS2322: Type '{}[]' is not assignable to type '[{}]'. +!!! error TS2322: Property '0' is missing in type '{}[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatBug2.errors.txt b/tests/baselines/reference/assignmentCompatBug2.errors.txt index 683846b26c1..15bf1111391 100644 --- a/tests/baselines/reference/assignmentCompatBug2.errors.txt +++ b/tests/baselines/reference/assignmentCompatBug2.errors.txt @@ -1,25 +1,25 @@ -tests/cases/compiler/assignmentCompatBug2.ts(1,5): error TS2323: Type '{ a: number; }' is not assignable to type '{ b: number; }'. +tests/cases/compiler/assignmentCompatBug2.ts(1,5): error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'. Property 'b' is missing in type '{ a: number; }'. -tests/cases/compiler/assignmentCompatBug2.ts(3,1): error TS2323: Type '{ a: number; }' is not assignable to type '{ b: number; }'. +tests/cases/compiler/assignmentCompatBug2.ts(3,1): error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'. Property 'b' is missing in type '{ a: number; }'. -tests/cases/compiler/assignmentCompatBug2.ts(15,1): error TS2323: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. +tests/cases/compiler/assignmentCompatBug2.ts(15,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'. -tests/cases/compiler/assignmentCompatBug2.ts(20,1): error TS2323: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. +tests/cases/compiler/assignmentCompatBug2.ts(20,1): error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'. -tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2323: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. +tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'. ==== tests/cases/compiler/assignmentCompatBug2.ts (5 errors) ==== var b2: { b: number;} = { a: 0 }; // error ~~ -!!! error TS2323: Type '{ a: number; }' is not assignable to type '{ b: number; }'. -!!! error TS2323: Property 'b' is missing in type '{ a: number; }'. +!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'. +!!! error TS2322: Property 'b' is missing in type '{ a: number; }'. b2 = { a: 0 }; // error ~~ -!!! error TS2323: Type '{ a: number; }' is not assignable to type '{ b: number; }'. -!!! error TS2323: Property 'b' is missing in type '{ a: number; }'. +!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ b: number; }'. +!!! error TS2322: Property 'b' is missing in type '{ a: number; }'. b2 = {b: 0, a: 0 }; @@ -33,16 +33,16 @@ tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2323: Type '{ f: (n: b3 = { ~~ -!!! error TS2323: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. -!!! error TS2323: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'. +!!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. +!!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'. f: (n) => { return 0; }, g: (s) => { return 0; }, }; // error b3 = { ~~ -!!! error TS2323: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. -!!! error TS2323: Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'. +!!! error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. +!!! error TS2322: Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'. f: (n) => { return 0; }, m: 0, }; // error @@ -57,8 +57,8 @@ tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2323: Type '{ f: (n: b3 = { ~~ -!!! error TS2323: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. -!!! error TS2323: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'. +!!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. +!!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'. f: (n) => { return 0; }, g: (s) => { return 0; }, n: 0, diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt index 8ad90d773f4..6a221ef144e 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures.errors.txt @@ -1,25 +1,25 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(35,1): error TS2323: Type 'S2' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(35,1): error TS2322: Type 'S2' is not assignable to type 'T'. Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(36,1): error TS2323: Type '(x: string) => void' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(36,1): error TS2322: Type '(x: string) => void' is not assignable to type 'T'. Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(37,1): error TS2323: Type '(x: string) => number' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(37,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'. Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(38,1): error TS2323: Type '(x: string) => string' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(38,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'. Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(39,1): error TS2323: Type 'S2' is not assignable to type '(x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(39,1): error TS2322: Type 'S2' is not assignable to type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(40,1): error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(40,1): error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(41,1): error TS2323: Type '(x: string) => number' is not assignable to type '(x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(41,1): error TS2322: Type '(x: string) => number' is not assignable to type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(42,1): error TS2323: Type '(x: string) => string' is not assignable to type '(x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures.ts(42,1): error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. @@ -61,42 +61,42 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // these are errors t = s2; ~ -!!! error TS2323: Type 'S2' is not assignable to type 'T'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'S2' is not assignable to type 'T'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. t = a3; ~ -!!! error TS2323: Type '(x: string) => void' is not assignable to type 'T'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: string) => void' is not assignable to type 'T'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. t = (x: string) => 1; ~ -!!! error TS2323: Type '(x: string) => number' is not assignable to type 'T'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. t = function (x: string) { return ''; } ~ -!!! error TS2323: Type '(x: string) => string' is not assignable to type 'T'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = s2; ~ -!!! error TS2323: Type 'S2' is not assignable to type '(x: number) => void'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'S2' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = a3; ~ -!!! error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = (x: string) => 1; ~ -!!! error TS2323: Type '(x: string) => number' is not assignable to type '(x: number) => void'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = function (x: string) { return ''; } ~ -!!! error TS2323: Type '(x: string) => string' is not assignable to type '(x: number) => void'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt index ff12410e875..e67f0a930c2 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt @@ -1,38 +1,38 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(31,1): error TS2323: Type '() => number' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(31,1): error TS2322: Type '() => number' is not assignable to type 'T'. Property 'f' is missing in type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(32,1): error TS2323: Type '(x: number) => string' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(32,1): error TS2322: Type '(x: number) => string' is not assignable to type 'T'. Property 'f' is missing in type '(x: number) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(33,1): error TS2323: Type '() => number' is not assignable to type '{ f(x: number): void; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(33,1): error TS2322: Type '() => number' is not assignable to type '{ f(x: number): void; }'. Property 'f' is missing in type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(34,1): error TS2323: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(34,1): error TS2322: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }'. Property 'f' is missing in type '(x: number) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(42,1): error TS2323: Type 'S2' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(42,1): error TS2322: Type 'S2' is not assignable to type 'T'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(43,1): error TS2323: Type '{ f(x: string): void; }' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(43,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(44,1): error TS2323: Type '(x: string) => number' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(44,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'. Property 'f' is missing in type '(x: string) => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(45,1): error TS2323: Type '(x: string) => string' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(45,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'. Property 'f' is missing in type '(x: string) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(46,1): error TS2323: Type 'S2' is not assignable to type '{ f(x: number): void; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(46,1): error TS2322: Type 'S2' is not assignable to type '{ f(x: number): void; }'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(47,1): error TS2323: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(47,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(48,1): error TS2323: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(48,1): error TS2322: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }'. Property 'f' is missing in type '(x: string) => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(49,1): error TS2323: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(49,1): error TS2322: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }'. Property 'f' is missing in type '(x: string) => string'. @@ -69,20 +69,20 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // errors t = () => 1; ~ -!!! error TS2323: Type '() => number' is not assignable to type 'T'. -!!! error TS2323: Property 'f' is missing in type '() => number'. +!!! error TS2322: Type '() => number' is not assignable to type 'T'. +!!! error TS2322: Property 'f' is missing in type '() => number'. t = function (x: number) { return ''; } ~ -!!! error TS2323: Type '(x: number) => string' is not assignable to type 'T'. -!!! error TS2323: Property 'f' is missing in type '(x: number) => string'. +!!! error TS2322: Type '(x: number) => string' is not assignable to type 'T'. +!!! error TS2322: Property 'f' is missing in type '(x: number) => string'. a = () => 1; ~ -!!! error TS2323: Type '() => number' is not assignable to type '{ f(x: number): void; }'. -!!! error TS2323: Property 'f' is missing in type '() => number'. +!!! error TS2322: Type '() => number' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2322: Property 'f' is missing in type '() => number'. a = function (x: number) { return ''; } ~ -!!! error TS2323: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }'. -!!! error TS2323: Property 'f' is missing in type '(x: number) => string'. +!!! error TS2322: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2322: Property 'f' is missing in type '(x: number) => string'. interface S2 { f(x: string): void; @@ -92,46 +92,46 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // these are errors t = s2; ~ -!!! error TS2323: Type 'S2' is not assignable to type 'T'. -!!! error TS2323: Types of property 'f' are incompatible. -!!! error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'S2' is not assignable to type 'T'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. t = a3; ~ -!!! error TS2323: Type '{ f(x: string): void; }' is not assignable to type 'T'. -!!! error TS2323: Types of property 'f' are incompatible. -!!! error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. t = (x: string) => 1; ~ -!!! error TS2323: Type '(x: string) => number' is not assignable to type 'T'. -!!! error TS2323: Property 'f' is missing in type '(x: string) => number'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'. +!!! error TS2322: Property 'f' is missing in type '(x: string) => number'. t = function (x: string) { return ''; } ~ -!!! error TS2323: Type '(x: string) => string' is not assignable to type 'T'. -!!! error TS2323: Property 'f' is missing in type '(x: string) => string'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'. +!!! error TS2322: Property 'f' is missing in type '(x: string) => string'. a = s2; ~ -!!! error TS2323: Type 'S2' is not assignable to type '{ f(x: number): void; }'. -!!! error TS2323: Types of property 'f' are incompatible. -!!! error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'S2' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = a3; ~ -!!! error TS2323: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }'. -!!! error TS2323: Types of property 'f' are incompatible. -!!! error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = (x: string) => 1; ~ -!!! error TS2323: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }'. -!!! error TS2323: Property 'f' is missing in type '(x: string) => number'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2322: Property 'f' is missing in type '(x: string) => number'. a = function (x: string) { return ''; } ~ -!!! error TS2323: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }'. -!!! error TS2323: Property 'f' is missing in type '(x: string) => string'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }'. +!!! error TS2322: Property 'f' is missing in type '(x: string) => string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt index 39735ec3844..e00d1eea042 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(52,9): error TS2323: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(52,9): error TS2322: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. Types of parameters 'y' and 'y' are incompatible. Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. Types of parameters 'arg2' and 'arg2' are incompatible. Type '{ foo: number; }' is not assignable to type 'Base'. Types of property 'foo' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(53,9): error TS2323: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(53,9): error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. Types of parameters 'y' and 'y' are incompatible. Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. @@ -64,18 +64,18 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b8: (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; a8 = b8; // error, { foo: number } and Base are incompatible ~~ -!!! error TS2323: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. -!!! error TS2323: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2323: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. -!!! error TS2323: Types of parameters 'arg2' and 'arg2' are incompatible. -!!! error TS2323: Type '{ foo: number; }' is not assignable to type 'Base'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. +!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. b8 = a8; // error, { foo: number } and Base are incompatible ~~ -!!! error TS2323: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. -!!! error TS2323: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2323: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. +!!! error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. var b10: (...x: T[]) => T; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt index 2bdd0ef61a9..f89bbfa5798 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(16,5): error TS2323: Type '(x: number) => number' is not assignable to type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(19,5): error TS2323: Type '(x: number) => number' is not assignable to type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(20,5): error TS2323: Type '(x: number, y?: number) => number' is not assignable to type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(22,5): error TS2323: Type '(x: number, y: number) => number' is not assignable to type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(33,5): error TS2323: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(39,5): error TS2323: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(45,5): error TS2323: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(16,5): error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(19,5): error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(20,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '() => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(22,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '() => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(33,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(39,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts(45,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithOptionalParameters.ts (7 errors) ==== @@ -25,19 +25,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = (x?: number) => 1; // ok, same number of required params a = (x: number) => 1; // error, too many required params ~ -!!! error TS2323: Type '(x: number) => number' is not assignable to type '() => number'. +!!! error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. a = b.a; // ok a = b.a2; // ok a = b.a3; // error ~ -!!! error TS2323: Type '(x: number) => number' is not assignable to type '() => number'. +!!! error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. a = b.a4; // error ~ -!!! error TS2323: Type '(x: number, y?: number) => number' is not assignable to type '() => number'. +!!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '() => number'. a = b.a5; // ok a = b.a6; // error ~ -!!! error TS2323: Type '(x: number, y: number) => number' is not assignable to type '() => number'. +!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '() => number'. var a2: (x?: number) => number; a2 = () => 1; // ok, same number of required params @@ -50,7 +50,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a2 = b.a5; // ok a2 = b.a6; // error ~~ -!!! error TS2323: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. +!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. var a3: (x: number) => number; a3 = () => 1; // ok, fewer required params @@ -58,7 +58,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = (x: number) => 1; // ok, same number of required params a3 = (x: number, y: number) => 1; // error, too many required params ~~ -!!! error TS2323: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. +!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. a3 = b.a; // ok a3 = b.a2; // ok a3 = b.a3; // ok @@ -66,7 +66,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = b.a5; // ok a3 = b.a6; // error ~~ -!!! error TS2323: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. +!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. var a4: (x: number, y?: number) => number; a4 = () => 1; // ok, fewer required params diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt index 79fa3452394..8eec8503e70 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt @@ -1,28 +1,28 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(13,5): error TS2323: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(13,5): error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. Types of parameters 'args' and 'args' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(17,5): error TS2323: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(17,5): error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. Types of parameters 'x' and 'args' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(26,5): error TS2323: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(26,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. Types of parameters 'args' and 'z' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(35,5): error TS2323: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(35,5): error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. Types of parameters 'y' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(36,5): error TS2323: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(36,5): error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. Types of parameters 'z' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(37,5): error TS2323: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(37,5): error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(41,5): error TS2323: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(41,5): error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. Types of parameters 'y' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(43,5): error TS2323: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(43,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. Types of parameters 'y' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(45,5): error TS2323: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(45,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. Types of parameters 'args' and 'z' are incompatible. Type 'string' is not assignable to type 'number'. @@ -42,17 +42,17 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = (...args: number[]) => 1; // ok, same number of required params a = (...args: string[]) => 1; // error, type mismatch ~ -!!! error TS2323: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. -!!! error TS2323: Types of parameters 'args' and 'args' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. +!!! error TS2322: Types of parameters 'args' and 'args' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = (x?: number) => 1; // ok, same number of required params a = (x?: number, y?: number, z?: number) => 1; // ok, same number of required params a = (x: number) => 1; // ok, rest param corresponds to infinite number of params a = (x?: string) => 1; // error, incompatible type ~ -!!! error TS2323: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. -!!! error TS2323: Types of parameters 'x' and 'args' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. +!!! error TS2322: Types of parameters 'x' and 'args' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var a2: (x: number, ...z: number[]) => number; @@ -63,9 +63,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a2 = (x: number, ...args: number[]) => 1; // ok, same number of required params a2 = (x: number, ...args: string[]) => 1; // should be type mismatch error ~~ -!!! error TS2323: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. -!!! error TS2323: Types of parameters 'args' and 'z' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'args' and 'z' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a2 = (x: number, y: number) => 1; // ok, rest param corresponds to infinite number of params a2 = (x: number, y?: number) => 1; // ok, same number of required params @@ -76,36 +76,36 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = (x: number, y: string) => 1; // ok, all present params match a3 = (x: number, y?: number, z?: number) => 1; // error ~~ -!!! error TS2323: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. -!!! error TS2323: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. a3 = (x: number, ...z: number[]) => 1; // error ~~ -!!! error TS2323: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. -!!! error TS2323: Types of parameters 'z' and 'y' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'z' and 'y' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. a3 = (x: string, y?: string, z?: string) => 1; // error ~~ -!!! error TS2323: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var a4: (x?: number, y?: string, ...z: number[]) => number; a4 = () => 1; // ok, fewer required params a4 = (x?: number, y?: number) => 1; // error, type mismatch ~~ -!!! error TS2323: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. -!!! error TS2323: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. a4 = (x: number) => 1; // ok, all present params match a4 = (x: number, y?: number) => 1; // error, second param has type mismatch ~~ -!!! error TS2323: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. -!!! error TS2323: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. a4 = (x?: number, y?: string) => 1; // ok, same number of required params with matching types a4 = (x: number, ...args: string[]) => 1; // error, rest params have type mismatch ~~ -!!! error TS2323: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. -!!! error TS2323: Types of parameters 'args' and 'z' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'args' and 'z' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures.errors.txt index f37aca50710..9c0c0d6a8fd 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(28,1): error TS2323: Type 'S2' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(29,1): error TS2323: Type '(x: string) => void' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(30,1): error TS2323: Type '(x: string) => number' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(31,1): error TS2323: Type '(x: string) => string' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(32,1): error TS2323: Type 'S2' is not assignable to type 'new (x: number) => void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(33,1): error TS2323: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(34,1): error TS2323: Type '(x: string) => number' is not assignable to type 'new (x: number) => void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(35,1): error TS2323: Type '(x: string) => string' is not assignable to type 'new (x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(28,1): error TS2322: Type 'S2' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(29,1): error TS2322: Type '(x: string) => void' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(30,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(31,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(32,1): error TS2322: Type 'S2' is not assignable to type 'new (x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(33,1): error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(34,1): error TS2322: Type '(x: string) => number' is not assignable to type 'new (x: number) => void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts(35,1): error TS2322: Type '(x: string) => string' is not assignable to type 'new (x: number) => void'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures.ts (8 errors) ==== @@ -38,26 +38,26 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // these are errors t = s2; ~ -!!! error TS2323: Type 'S2' is not assignable to type 'T'. +!!! error TS2322: Type 'S2' is not assignable to type 'T'. t = a3; ~ -!!! error TS2323: Type '(x: string) => void' is not assignable to type 'T'. +!!! error TS2322: Type '(x: string) => void' is not assignable to type 'T'. t = (x: string) => 1; ~ -!!! error TS2323: Type '(x: string) => number' is not assignable to type 'T'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'. t = function (x: string) { return ''; } ~ -!!! error TS2323: Type '(x: string) => string' is not assignable to type 'T'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'. a = s2; ~ -!!! error TS2323: Type 'S2' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type 'S2' is not assignable to type 'new (x: number) => void'. a = a3; ~ -!!! error TS2323: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. a = (x: string) => 1; ~ -!!! error TS2323: Type '(x: string) => number' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type 'new (x: number) => void'. a = function (x: string) { return ''; } ~ -!!! error TS2323: Type '(x: string) => string' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type 'new (x: number) => void'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt index 7756bb82bda..5e8fc6dd3a4 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt @@ -1,30 +1,30 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(23,1): error TS2323: Type '() => number' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(23,1): error TS2322: Type '() => number' is not assignable to type 'T'. Property 'f' is missing in type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(24,1): error TS2323: Type '(x: number) => string' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(24,1): error TS2322: Type '(x: number) => string' is not assignable to type 'T'. Property 'f' is missing in type '(x: number) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(25,1): error TS2323: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(25,1): error TS2322: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }'. Property 'f' is missing in type '() => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(26,1): error TS2323: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(26,1): error TS2322: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }'. Property 'f' is missing in type '(x: number) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(34,1): error TS2323: Type 'S2' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(34,1): error TS2322: Type 'S2' is not assignable to type 'T'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(35,1): error TS2323: Type '{ f(x: string): void; }' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(35,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(36,1): error TS2323: Type '(x: string) => number' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(36,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'. Property 'f' is missing in type '(x: string) => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(37,1): error TS2323: Type '(x: string) => string' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(37,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'. Property 'f' is missing in type '(x: string) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(38,1): error TS2323: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(38,1): error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(39,1): error TS2323: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(39,1): error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(40,1): error TS2323: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(40,1): error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'. Property 'f' is missing in type '(x: string) => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(41,1): error TS2323: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(41,1): error TS2322: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }'. Property 'f' is missing in type '(x: string) => string'. @@ -53,20 +53,20 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // errors t = () => 1; ~ -!!! error TS2323: Type '() => number' is not assignable to type 'T'. -!!! error TS2323: Property 'f' is missing in type '() => number'. +!!! error TS2322: Type '() => number' is not assignable to type 'T'. +!!! error TS2322: Property 'f' is missing in type '() => number'. t = function (x: number) { return ''; } ~ -!!! error TS2323: Type '(x: number) => string' is not assignable to type 'T'. -!!! error TS2323: Property 'f' is missing in type '(x: number) => string'. +!!! error TS2322: Type '(x: number) => string' is not assignable to type 'T'. +!!! error TS2322: Property 'f' is missing in type '(x: number) => string'. a = () => 1; ~ -!!! error TS2323: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }'. -!!! error TS2323: Property 'f' is missing in type '() => number'. +!!! error TS2322: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2322: Property 'f' is missing in type '() => number'. a = function (x: number) { return ''; } ~ -!!! error TS2323: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }'. -!!! error TS2323: Property 'f' is missing in type '(x: number) => string'. +!!! error TS2322: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2322: Property 'f' is missing in type '(x: number) => string'. interface S2 { f(x: string): void; @@ -76,38 +76,38 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme // these are errors t = s2; ~ -!!! error TS2323: Type 'S2' is not assignable to type 'T'. -!!! error TS2323: Types of property 'f' are incompatible. -!!! error TS2323: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type 'S2' is not assignable to type 'T'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. t = a3; ~ -!!! error TS2323: Type '{ f(x: string): void; }' is not assignable to type 'T'. -!!! error TS2323: Types of property 'f' are incompatible. -!!! error TS2323: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type 'T'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. t = (x: string) => 1; ~ -!!! error TS2323: Type '(x: string) => number' is not assignable to type 'T'. -!!! error TS2323: Property 'f' is missing in type '(x: string) => number'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'. +!!! error TS2322: Property 'f' is missing in type '(x: string) => number'. t = function (x: string) { return ''; } ~ -!!! error TS2323: Type '(x: string) => string' is not assignable to type 'T'. -!!! error TS2323: Property 'f' is missing in type '(x: string) => string'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'. +!!! error TS2322: Property 'f' is missing in type '(x: string) => string'. a = s2; ~ -!!! error TS2323: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'. -!!! error TS2323: Types of property 'f' are incompatible. -!!! error TS2323: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. a = a3; ~ -!!! error TS2323: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }'. -!!! error TS2323: Types of property 'f' are incompatible. -!!! error TS2323: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Type '{ f(x: string): void; }' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. a = (x: string) => 1; ~ -!!! error TS2323: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'. -!!! error TS2323: Property 'f' is missing in type '(x: string) => number'. +!!! error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2322: Property 'f' is missing in type '(x: string) => number'. a = function (x: string) { return ''; } ~ -!!! error TS2323: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }'. -!!! error TS2323: Property 'f' is missing in type '(x: string) => string'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }'. +!!! error TS2322: Property 'f' is missing in type '(x: string) => string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt index 60c1e7860be..804e31600e1 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt @@ -1,23 +1,23 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(52,9): error TS2323: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(52,9): error TS2322: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. Types of parameters 'y' and 'y' are incompatible. Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. Types of parameters 'arg2' and 'arg2' are incompatible. Type '{ foo: number; }' is not assignable to type 'Base'. Types of property 'foo' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(53,9): error TS2323: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(53,9): error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. Types of parameters 'y' and 'y' are incompatible. Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(77,9): error TS2323: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(77,9): error TS2322: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'. Types of parameters 'x' and 'x' are incompatible. Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(78,9): error TS2323: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(78,9): error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. Types of parameters 'x' and 'x' are incompatible. Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(81,9): error TS2323: Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(81,9): error TS2322: Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }'. Types of parameters 'x' and 'x' are incompatible. Type '(a: any) => any' is not assignable to type '{ new (a: T): T; new (a: T): T; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(82,9): error TS2323: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(82,9): error TS2322: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]'. Types of parameters 'x' and 'x' are incompatible. Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. @@ -76,18 +76,18 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b8: new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; a8 = b8; // error, type mismatch ~~ -!!! error TS2323: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. -!!! error TS2323: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2323: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. -!!! error TS2323: Types of parameters 'arg2' and 'arg2' are incompatible. -!!! error TS2323: Type '{ foo: number; }' is not assignable to type 'Base'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U' is not assignable to type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. +!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. b8 = a8; // error ~~ -!!! error TS2323: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. -!!! error TS2323: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2323: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. +!!! error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. var b10: new (...x: T[]) => T; @@ -113,26 +113,26 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b16: new (x: (a: T) => T) => T[]; a16 = b16; // error ~~~ -!!! error TS2323: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. +!!! error TS2322: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. b16 = a16; // error ~~~ -!!! error TS2323: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. +!!! error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. var b17: new (x: (a: T) => T) => any[]; a17 = b17; // error ~~~ -!!! error TS2323: Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type '(a: any) => any' is not assignable to type '{ new (a: T): T; new (a: T): T; }'. +!!! error TS2322: Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new (a: T): T; new (a: T): T; }'. b17 = a17; // error ~~~ -!!! error TS2323: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. +!!! error TS2322: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. } module WithGenericSignaturesInBaseType { diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt index 3a477e0c9ec..df56af3ee98 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(16,5): error TS2323: Type 'new (x: number) => number' is not assignable to type 'new () => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(17,5): error TS2323: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(19,5): error TS2323: Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(27,5): error TS2323: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(35,5): error TS2323: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(16,5): error TS2322: Type 'new (x: number) => number' is not assignable to type 'new () => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(17,5): error TS2322: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(19,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(27,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(35,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts (5 errors) ==== @@ -23,14 +23,14 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b.a2; // ok a = b.a3; // error ~ -!!! error TS2323: Type 'new (x: number) => number' is not assignable to type 'new () => number'. +!!! error TS2322: Type 'new (x: number) => number' is not assignable to type 'new () => number'. a = b.a4; // error ~ -!!! error TS2323: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. +!!! error TS2322: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. a = b.a5; // ok a = b.a6; // error ~ -!!! error TS2323: Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'. +!!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'. var a2: new (x?: number) => number; a2 = b.a; // ok @@ -40,7 +40,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a2 = b.a5; // ok a2 = b.a6; // error ~~ -!!! error TS2323: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. +!!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. var a3: new (x: number) => number; a3 = b.a; // ok @@ -50,7 +50,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = b.a5; // ok a3 = b.a6; // error ~~ -!!! error TS2323: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. +!!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. var a4: new (x: number, y?: number) => number; a4 = b.a; // ok diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt index 18d853f006f..a18da8fd8f7 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(14,13): error TS2323: Type '(x: T) => any' is not assignable to type '() => T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(23,13): error TS2323: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(65,9): error TS2323: Type '(x: T) => T' is not assignable to type '() => T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(66,9): error TS2323: Type '(x: T, y?: T) => T' is not assignable to type '() => T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(107,13): error TS2323: Type '(x: T) => any' is not assignable to type '() => T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(116,13): error TS2323: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(14,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(23,13): error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(65,9): error TS2322: Type '(x: T) => T' is not assignable to type '() => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(66,9): error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '() => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(107,13): error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts(116,13): error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.ts (6 errors) ==== @@ -22,7 +22,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a = (x?: T) => null; // ok, same T of required params this.a = (x: T) => null; // error, too many required params ~~~~~~ -!!! error TS2323: Type '(x: T) => any' is not assignable to type '() => T'. +!!! error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. this.a2 = () => null; // ok, same T of required params this.a2 = (x?: T) => null; // ok, same T of required params @@ -33,7 +33,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a3 = (x: T) => null; // ok, same T of required params this.a3 = (x: T, y: T) => null; // error, too many required params ~~~~~~~ -!!! error TS2323: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. +!!! error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. this.a4 = () => null; // ok, fewer required params this.a4 = (x?: T, y?: T) => null; // ok, fewer required params @@ -77,10 +77,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme b.a = t.a2; b.a = t.a3; ~~~ -!!! error TS2323: Type '(x: T) => T' is not assignable to type '() => T'. +!!! error TS2322: Type '(x: T) => T' is not assignable to type '() => T'. b.a = t.a4; ~~~ -!!! error TS2323: Type '(x: T, y?: T) => T' is not assignable to type '() => T'. +!!! error TS2322: Type '(x: T, y?: T) => T' is not assignable to type '() => T'. b.a = t.a5; b.a2 = t.a; @@ -123,7 +123,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a = (x?: T) => null; // ok, same T of required params this.a = (x: T) => null; // error, too many required params ~~~~~~ -!!! error TS2323: Type '(x: T) => any' is not assignable to type '() => T'. +!!! error TS2322: Type '(x: T) => any' is not assignable to type '() => T'. this.a2 = () => null; // ok, same T of required params this.a2 = (x?: T) => null; // ok, same T of required params @@ -134,7 +134,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme this.a3 = (x: T) => null; // ok, same T of required params this.a3 = (x: T, y: T) => null; // error, too many required params ~~~~~~~ -!!! error TS2323: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. +!!! error TS2322: Type '(x: T, y: T) => any' is not assignable to type '(x: T) => T'. this.a4 = () => null; // ok, fewer required params this.a4 = (x?: T, y?: T) => null; // ok, fewer required params diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt index 5e82ac41f11..0a9b50ff0b8 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt @@ -1,21 +1,21 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(14,1): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(14,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(18,1): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(18,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(32,9): error TS2323: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(32,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(33,9): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(33,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. Index signatures are incompatible. Type 'T' is not assignable to type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(36,9): error TS2323: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(36,9): error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(37,9): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(37,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. Index signatures are incompatible. Type 'T' is not assignable to type 'Derived2'. @@ -36,19 +36,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; b = a; // error ~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Base' is not assignable to type 'Derived'. -!!! error TS2323: Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2322: Property 'bar' is missing in type 'Base'. var b2: { [x: number]: Derived2; } a = b2; b2 = a; // error ~~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. -!!! error TS2323: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2322: Property 'baz' is missing in type 'Base'. module Generics { class A { @@ -64,26 +64,26 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b: { [x: number]: Derived; } a = b; // error ~ -!!! error TS2323: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Derived' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'T'. b = a; // error ~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'T' is not assignable to type 'Derived'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived'. var b2: { [x: number]: Derived2; } a = b2; // error ~ -!!! error TS2323: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'T'. b2 = a; // error ~~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'T' is not assignable to type 'Derived2'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived2'. var b3: { [x: number]: T; } a = b3; // ok diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt index 2cbc15b4b70..b15f2f7905d 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt @@ -1,21 +1,21 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(14,1): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(14,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(18,1): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(18,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(32,9): error TS2323: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(32,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(33,9): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(33,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. Index signatures are incompatible. Type 'T' is not assignable to type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(36,9): error TS2323: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(36,9): error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(37,9): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(37,9): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. Index signatures are incompatible. Type 'T' is not assignable to type 'Derived2'. @@ -36,19 +36,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; b = a; // error ~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Base' is not assignable to type 'Derived'. -!!! error TS2323: Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2322: Property 'bar' is missing in type 'Base'. var b2: { [x: number]: Derived2; } a = b2; b2 = a; // error ~~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. -!!! error TS2323: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2322: Property 'baz' is missing in type 'Base'. module Generics { interface A { @@ -64,26 +64,26 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b: { [x: number]: Derived; } a = b; // error ~ -!!! error TS2323: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Derived' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'T'. b = a; // error ~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'T' is not assignable to type 'Derived'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived'. var b2: { [x: number]: Derived2; } a = b2; // error ~ -!!! error TS2323: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: number]: Derived2; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'T'. b2 = a; // error ~~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'T' is not assignable to type 'Derived2'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived2'. var b3: { [x: number]: T; } a = b3; // ok diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt index 966b5f1b55f..61f9e082a48 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt @@ -1,12 +1,12 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(14,1): error TS2323: Type '{ [x: number]: Base; }' is not assignable to type 'A'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(14,1): error TS2322: Type '{ [x: number]: Base; }' is not assignable to type 'A'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(23,1): error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(23,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. Index signatures are incompatible. Type 'Derived' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(33,9): error TS2323: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(33,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. @@ -27,10 +27,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; // error ~ -!!! error TS2323: Type '{ [x: number]: Base; }' is not assignable to type 'A'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Base' is not assignable to type 'Derived'. -!!! error TS2323: Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type '{ [x: number]: Base; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2322: Property 'bar' is missing in type 'Base'. b = a; // ok class B2 extends A { @@ -41,10 +41,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b2; // ok b2 = a; // error ~~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Derived' is not assignable to type 'Derived2'. -!!! error TS2323: Property 'baz' is missing in type 'Derived'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'. +!!! error TS2322: Property 'baz' is missing in type 'Derived'. module Generics { class A { @@ -56,9 +56,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b: { [x: number]: Derived; }; a = b; // error ~ -!!! error TS2323: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Derived' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'T'. b = a; // ok var b2: { [x: number]: T; }; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt index 719aa2b3022..0fdae0b7cfa 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt @@ -1,55 +1,55 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(24,5): error TS2323: Type 'T' is not assignable to type 'S'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(24,5): error TS2322: Type 'T' is not assignable to type 'S'. Types of property 'foo' are incompatible. Type 'Derived2' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(25,5): error TS2323: Type 'S' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(25,5): error TS2322: Type 'S' is not assignable to type 'T'. Types of property 'foo' are incompatible. Type 'Derived' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(29,5): error TS2323: Type 'T2' is not assignable to type 'S2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(29,5): error TS2322: Type 'T2' is not assignable to type 'S2'. Types of property 'foo' are incompatible. Type 'Derived2' is not assignable to type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(30,5): error TS2323: Type 'S2' is not assignable to type 'T2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(30,5): error TS2322: Type 'S2' is not assignable to type 'T2'. Types of property 'foo' are incompatible. Type 'Derived' is not assignable to type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(31,5): error TS2323: Type 'T' is not assignable to type 'S2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(31,5): error TS2322: Type 'T' is not assignable to type 'S2'. Types of property 'foo' are incompatible. Type 'Derived2' is not assignable to type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(32,5): error TS2323: Type '{ foo: Derived2; }' is not assignable to type 'S2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(32,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type 'S2'. Types of property 'foo' are incompatible. Type 'Derived2' is not assignable to type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(35,5): error TS2323: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(35,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. Types of property 'foo' are incompatible. Type 'Derived2' is not assignable to type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(36,5): error TS2323: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(36,5): error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. Types of property 'foo' are incompatible. Type 'Derived' is not assignable to type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(41,5): error TS2323: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(41,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. Types of property 'foo' are incompatible. Type 'Derived2' is not assignable to type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(42,5): error TS2323: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(42,5): error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. Types of property 'foo' are incompatible. Type 'Derived' is not assignable to type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(43,5): error TS2323: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(43,5): error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. Types of property 'foo' are incompatible. Type 'Derived2' is not assignable to type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(44,5): error TS2323: Type 'T2' is not assignable to type '{ foo: Derived; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(44,5): error TS2322: Type 'T2' is not assignable to type '{ foo: Derived; }'. Types of property 'foo' are incompatible. Type 'Derived2' is not assignable to type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(45,5): error TS2323: Type 'T' is not assignable to type '{ foo: Derived; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(45,5): error TS2322: Type 'T' is not assignable to type '{ foo: Derived; }'. Types of property 'foo' are incompatible. Type 'Derived2' is not assignable to type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(70,5): error TS2323: Type 'S' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(70,5): error TS2322: Type 'S' is not assignable to type 'T'. Types of property 'foo' are incompatible. Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(75,5): error TS2323: Type 'S2' is not assignable to type 'T2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(75,5): error TS2322: Type 'S2' is not assignable to type 'T2'. Types of property 'foo' are incompatible. Type 'Base' is not assignable to type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(81,5): error TS2323: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(81,5): error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. Types of property 'foo' are incompatible. Type 'Base' is not assignable to type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(87,5): error TS2323: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(87,5): error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. Types of property 'foo' are incompatible. Type 'Base' is not assignable to type 'Derived2'. @@ -80,80 +80,80 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme s = t; // error ~ -!!! error TS2323: Type 'T' is not assignable to type 'S'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'. -!!! error TS2323: Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type 'T' is not assignable to type 'S'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. +!!! error TS2322: Property 'bar' is missing in type 'Derived2'. t = s; // error ~ -!!! error TS2323: Type 'S' is not assignable to type 'T'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type 'Derived' is not assignable to type 'Derived2'. -!!! error TS2323: Property 'baz' is missing in type 'Derived'. +!!! error TS2322: Type 'S' is not assignable to type 'T'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'. +!!! error TS2322: Property 'baz' is missing in type 'Derived'. s = s2; // ok s = a2; // ok s2 = t2; // error ~~ -!!! error TS2323: Type 'T2' is not assignable to type 'S2'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'. +!!! error TS2322: Type 'T2' is not assignable to type 'S2'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. t2 = s2; // error ~~ -!!! error TS2323: Type 'S2' is not assignable to type 'T2'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type 'Derived' is not assignable to type 'Derived2'. +!!! error TS2322: Type 'S2' is not assignable to type 'T2'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'. s2 = t; // error ~~ -!!! error TS2323: Type 'T' is not assignable to type 'S2'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'. +!!! error TS2322: Type 'T' is not assignable to type 'S2'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. s2 = b; // error ~~ -!!! error TS2323: Type '{ foo: Derived2; }' is not assignable to type 'S2'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'. +!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type 'S2'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. s2 = a2; // ok a = b; // error ~ -!!! error TS2323: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'. +!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. b = a; // error ~ -!!! error TS2323: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type 'Derived' is not assignable to type 'Derived2'. +!!! error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'. a = s; // ok a = s2; // ok a = a2; // ok a2 = b2; // error ~~ -!!! error TS2323: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'. +!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. b2 = a2; // error ~~ -!!! error TS2323: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type 'Derived' is not assignable to type 'Derived2'. +!!! error TS2322: Type '{ foo: Derived; }' is not assignable to type '{ foo: Derived2; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'. a2 = b; // error ~~ -!!! error TS2323: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'. +!!! error TS2322: Type '{ foo: Derived2; }' is not assignable to type '{ foo: Derived; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. a2 = t2; // error ~~ -!!! error TS2323: Type 'T2' is not assignable to type '{ foo: Derived; }'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'. +!!! error TS2322: Type 'T2' is not assignable to type '{ foo: Derived; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. a2 = t; // error ~~ -!!! error TS2323: Type 'T' is not assignable to type '{ foo: Derived; }'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived'. +!!! error TS2322: Type 'T' is not assignable to type '{ foo: Derived; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. } module WithBase { @@ -180,19 +180,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme s = t; // ok t = s; // error ~ -!!! error TS2323: Type 'S' is not assignable to type 'T'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. -!!! error TS2323: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'S' is not assignable to type 'T'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2322: Property 'baz' is missing in type 'Base'. s = s2; // ok s = a2; // ok s2 = t2; // ok t2 = s2; // error ~~ -!!! error TS2323: Type 'S2' is not assignable to type 'T2'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2322: Type 'S2' is not assignable to type 'T2'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. s2 = t; // ok s2 = b; // ok s2 = a2; // ok @@ -200,9 +200,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; // ok b = a; // error ~ -!!! error TS2323: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. a = s; // ok a = s2; // ok a = a2; // ok @@ -210,9 +210,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a2 = b2; // ok b2 = a2; // error ~~ -!!! error TS2323: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2322: Type '{ foo: Base; }' is not assignable to type '{ foo: Derived2; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. a2 = b; // ok a2 = t2; // ok a2 = t; // ok diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt index 8c0a69c2663..f9f7e48c685 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(13,1): error TS2323: Type 'I' is not assignable to type 'C'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(13,1): error TS2322: Type 'I' is not assignable to type 'C'. Property 'foo' is missing in type 'I'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(14,1): error TS2323: Type 'C' is not assignable to type 'I'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(14,1): error TS2322: Type 'C' is not assignable to type 'I'. Property 'fooo' is missing in type 'C'. @@ -19,9 +19,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme c = i; // error ~ -!!! error TS2323: Type 'I' is not assignable to type 'C'. -!!! error TS2323: Property 'foo' is missing in type 'I'. +!!! error TS2322: Type 'I' is not assignable to type 'C'. +!!! error TS2322: Property 'foo' is missing in type 'I'. i = c; // error ~ -!!! error TS2323: Type 'C' is not assignable to type 'I'. -!!! error TS2323: Property 'fooo' is missing in type 'C'. \ No newline at end of file +!!! error TS2322: Type 'C' is not assignable to type 'I'. +!!! error TS2322: Property 'fooo' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt index 8040ceb3003..c1093ab0ffe 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.errors.txt @@ -1,50 +1,50 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(31,5): error TS2323: Type 'E' is not assignable to type '{ foo: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(31,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(36,5): error TS2323: Type 'E' is not assignable to type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(36,5): error TS2322: Type 'E' is not assignable to type 'Base'. Property 'foo' is private in type 'E' but not in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(41,5): error TS2323: Type 'E' is not assignable to type 'I'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(41,5): error TS2322: Type 'E' is not assignable to type 'I'. Property 'foo' is private in type 'E' but not in type 'I'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(46,5): error TS2323: Type 'E' is not assignable to type 'D'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(46,5): error TS2322: Type 'E' is not assignable to type 'D'. Property 'foo' is private in type 'E' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(48,5): error TS2323: Type '{ foo: string; }' is not assignable to type 'E'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(48,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'E'. Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(49,5): error TS2323: Type 'Base' is not assignable to type 'E'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(49,5): error TS2322: Type 'Base' is not assignable to type 'E'. Property 'foo' is private in type 'E' but not in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(50,5): error TS2323: Type 'I' is not assignable to type 'E'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(50,5): error TS2322: Type 'I' is not assignable to type 'E'. Property 'foo' is private in type 'E' but not in type 'I'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(51,5): error TS2323: Type 'D' is not assignable to type 'E'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(51,5): error TS2322: Type 'D' is not assignable to type 'E'. Property 'foo' is private in type 'E' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(81,5): error TS2323: Type 'Base' is not assignable to type '{ foo: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(81,5): error TS2322: Type 'Base' is not assignable to type '{ foo: string; }'. Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(82,5): error TS2323: Type 'I' is not assignable to type '{ foo: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(82,5): error TS2322: Type 'I' is not assignable to type '{ foo: string; }'. Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(84,5): error TS2323: Type 'E' is not assignable to type '{ foo: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(84,5): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(86,5): error TS2323: Type '{ foo: string; }' is not assignable to type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(86,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'Base'. Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(88,5): error TS2323: Type 'D' is not assignable to type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(88,5): error TS2322: Type 'D' is not assignable to type 'Base'. Property 'foo' is private in type 'Base' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(89,5): error TS2323: Type 'E' is not assignable to type 'Base'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(89,5): error TS2322: Type 'E' is not assignable to type 'Base'. Types have separate declarations of a private property 'foo'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(92,5): error TS2323: Type '{ foo: string; }' is not assignable to type 'I'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(92,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'I'. Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(94,5): error TS2323: Type 'D' is not assignable to type 'I'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(94,5): error TS2322: Type 'D' is not assignable to type 'I'. Property 'foo' is private in type 'I' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(95,5): error TS2323: Type 'E' is not assignable to type 'I'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(95,5): error TS2322: Type 'E' is not assignable to type 'I'. Types have separate declarations of a private property 'foo'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(99,5): error TS2323: Type 'Base' is not assignable to type 'D'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(99,5): error TS2322: Type 'Base' is not assignable to type 'D'. Property 'foo' is private in type 'Base' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(100,5): error TS2323: Type 'I' is not assignable to type 'D'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(100,5): error TS2322: Type 'I' is not assignable to type 'D'. Property 'foo' is private in type 'I' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(101,5): error TS2323: Type 'E' is not assignable to type 'D'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(101,5): error TS2322: Type 'E' is not assignable to type 'D'. Property 'foo' is private in type 'E' but not in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(103,5): error TS2323: Type '{ foo: string; }' is not assignable to type 'E'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(103,5): error TS2322: Type '{ foo: string; }' is not assignable to type 'E'. Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(104,5): error TS2323: Type 'Base' is not assignable to type 'E'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(104,5): error TS2322: Type 'Base' is not assignable to type 'E'. Types have separate declarations of a private property 'foo'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(105,5): error TS2323: Type 'I' is not assignable to type 'E'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(105,5): error TS2322: Type 'I' is not assignable to type 'E'. Types have separate declarations of a private property 'foo'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2323: Type 'D' is not assignable to type 'E'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersAccessibility.ts(106,5): error TS2322: Type 'D' is not assignable to type 'E'. Property 'foo' is private in type 'E' but not in type 'D'. @@ -81,49 +81,49 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = d; a = e; // error ~ -!!! error TS2323: Type 'E' is not assignable to type '{ foo: string; }'. -!!! error TS2323: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. +!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. b = a; b = i; b = d; b = e; // error ~ -!!! error TS2323: Type 'E' is not assignable to type 'Base'. -!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'Base'. +!!! error TS2322: Type 'E' is not assignable to type 'Base'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'Base'. i = a; i = b; i = d; i = e; // error ~ -!!! error TS2323: Type 'E' is not assignable to type 'I'. -!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'I'. +!!! error TS2322: Type 'E' is not assignable to type 'I'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'I'. d = a; d = b; d = i; d = e; // error ~ -!!! error TS2323: Type 'E' is not assignable to type 'D'. -!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'D'. +!!! error TS2322: Type 'E' is not assignable to type 'D'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'. e = a; // errror ~ -!!! error TS2323: Type '{ foo: string; }' is not assignable to type 'E'. -!!! error TS2323: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. +!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'E'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. e = b; // errror ~ -!!! error TS2323: Type 'Base' is not assignable to type 'E'. -!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'Base'. +!!! error TS2322: Type 'Base' is not assignable to type 'E'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'Base'. e = i; // errror ~ -!!! error TS2323: Type 'I' is not assignable to type 'E'. -!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'I'. +!!! error TS2322: Type 'I' is not assignable to type 'E'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'I'. e = d; // errror ~ -!!! error TS2323: Type 'D' is not assignable to type 'E'. -!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'D'. +!!! error TS2322: Type 'D' is not assignable to type 'E'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'. e = e; } @@ -155,78 +155,78 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; // error ~ -!!! error TS2323: Type 'Base' is not assignable to type '{ foo: string; }'. -!!! error TS2323: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. +!!! error TS2322: Type 'Base' is not assignable to type '{ foo: string; }'. +!!! error TS2322: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. a = i; // error ~ -!!! error TS2323: Type 'I' is not assignable to type '{ foo: string; }'. -!!! error TS2323: Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. +!!! error TS2322: Type 'I' is not assignable to type '{ foo: string; }'. +!!! error TS2322: Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. a = d; a = e; // error ~ -!!! error TS2323: Type 'E' is not assignable to type '{ foo: string; }'. -!!! error TS2323: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. +!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. b = a; // error ~ -!!! error TS2323: Type '{ foo: string; }' is not assignable to type 'Base'. -!!! error TS2323: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. +!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'Base'. +!!! error TS2322: Property 'foo' is private in type 'Base' but not in type '{ foo: string; }'. b = i; b = d; // error ~ -!!! error TS2323: Type 'D' is not assignable to type 'Base'. -!!! error TS2323: Property 'foo' is private in type 'Base' but not in type 'D'. +!!! error TS2322: Type 'D' is not assignable to type 'Base'. +!!! error TS2322: Property 'foo' is private in type 'Base' but not in type 'D'. b = e; // error ~ -!!! error TS2323: Type 'E' is not assignable to type 'Base'. -!!! error TS2323: Types have separate declarations of a private property 'foo'. +!!! error TS2322: Type 'E' is not assignable to type 'Base'. +!!! error TS2322: Types have separate declarations of a private property 'foo'. b = b; i = a; // error ~ -!!! error TS2323: Type '{ foo: string; }' is not assignable to type 'I'. -!!! error TS2323: Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. +!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'I'. +!!! error TS2322: Property 'foo' is private in type 'I' but not in type '{ foo: string; }'. i = b; i = d; // error ~ -!!! error TS2323: Type 'D' is not assignable to type 'I'. -!!! error TS2323: Property 'foo' is private in type 'I' but not in type 'D'. +!!! error TS2322: Type 'D' is not assignable to type 'I'. +!!! error TS2322: Property 'foo' is private in type 'I' but not in type 'D'. i = e; // error ~ -!!! error TS2323: Type 'E' is not assignable to type 'I'. -!!! error TS2323: Types have separate declarations of a private property 'foo'. +!!! error TS2322: Type 'E' is not assignable to type 'I'. +!!! error TS2322: Types have separate declarations of a private property 'foo'. i = i; d = a; d = b; // error ~ -!!! error TS2323: Type 'Base' is not assignable to type 'D'. -!!! error TS2323: Property 'foo' is private in type 'Base' but not in type 'D'. +!!! error TS2322: Type 'Base' is not assignable to type 'D'. +!!! error TS2322: Property 'foo' is private in type 'Base' but not in type 'D'. d = i; // error ~ -!!! error TS2323: Type 'I' is not assignable to type 'D'. -!!! error TS2323: Property 'foo' is private in type 'I' but not in type 'D'. +!!! error TS2322: Type 'I' is not assignable to type 'D'. +!!! error TS2322: Property 'foo' is private in type 'I' but not in type 'D'. d = e; // error ~ -!!! error TS2323: Type 'E' is not assignable to type 'D'. -!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'D'. +!!! error TS2322: Type 'E' is not assignable to type 'D'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'. e = a; // errror ~ -!!! error TS2323: Type '{ foo: string; }' is not assignable to type 'E'. -!!! error TS2323: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. +!!! error TS2322: Type '{ foo: string; }' is not assignable to type 'E'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type '{ foo: string; }'. e = b; // errror ~ -!!! error TS2323: Type 'Base' is not assignable to type 'E'. -!!! error TS2323: Types have separate declarations of a private property 'foo'. +!!! error TS2322: Type 'Base' is not assignable to type 'E'. +!!! error TS2322: Types have separate declarations of a private property 'foo'. e = i; // errror ~ -!!! error TS2323: Type 'I' is not assignable to type 'E'. -!!! error TS2323: Types have separate declarations of a private property 'foo'. +!!! error TS2322: Type 'I' is not assignable to type 'E'. +!!! error TS2322: Types have separate declarations of a private property 'foo'. e = d; // errror ~ -!!! error TS2323: Type 'D' is not assignable to type 'E'. -!!! error TS2323: Property 'foo' is private in type 'E' but not in type 'D'. +!!! error TS2322: Type 'D' is not assignable to type 'E'. +!!! error TS2322: Property 'foo' is private in type 'E' but not in type 'D'. e = e; } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt index 2f931d4fc89..b378086ca5e 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(73,5): error TS2323: Type 'D' is not assignable to type 'C'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(73,5): error TS2322: Type 'D' is not assignable to type 'C'. Property 'opt' is optional in type 'D' but required in type 'C'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(74,5): error TS2323: Type 'E' is not assignable to type 'C'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(74,5): error TS2322: Type 'E' is not assignable to type 'C'. Property 'opt' is optional in type 'E' but required in type 'C'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(78,5): error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(78,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(79,5): error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(79,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(83,5): error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(83,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(84,5): error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality.ts(84,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. @@ -87,34 +87,34 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme c = d; // error ~ -!!! error TS2323: Type 'D' is not assignable to type 'C'. -!!! error TS2323: Property 'opt' is optional in type 'D' but required in type 'C'. +!!! error TS2322: Type 'D' is not assignable to type 'C'. +!!! error TS2322: Property 'opt' is optional in type 'D' but required in type 'C'. c = e; // error ~ -!!! error TS2323: Type 'E' is not assignable to type 'C'. -!!! error TS2323: Property 'opt' is optional in type 'E' but required in type 'C'. +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Property 'opt' is optional in type 'E' but required in type 'C'. c = f; // ok c = a; // ok a = d; // error ~ -!!! error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'. -!!! error TS2323: Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. +!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. a = e; // error ~ -!!! error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'. -!!! error TS2323: Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. +!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. a = f; // ok a = c; // ok b = d; // error ~ -!!! error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'. -!!! error TS2323: Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. +!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is optional in type 'D' but required in type '{ opt: Base; }'. b = e; // error ~ -!!! error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'. -!!! error TS2323: Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. +!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is optional in type 'E' but required in type '{ opt: Base; }'. b = f; // ok b = a; // ok b = c; // ok diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt index 3bce83ada4b..de2751beaca 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt @@ -1,20 +1,20 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(74,5): error TS2323: Type 'D' is not assignable to type 'C'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(74,5): error TS2322: Type 'D' is not assignable to type 'C'. Property 'opt' is missing in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(75,5): error TS2323: Type 'E' is not assignable to type 'C'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(75,5): error TS2322: Type 'E' is not assignable to type 'C'. Property 'opt' is missing in type 'E'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(76,5): error TS2323: Type 'F' is not assignable to type 'C'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(76,5): error TS2322: Type 'F' is not assignable to type 'C'. Property 'opt' is missing in type 'F'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(79,5): error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(79,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. Property 'opt' is missing in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(80,5): error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(80,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. Property 'opt' is missing in type 'E'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(81,5): error TS2323: Type 'F' is not assignable to type '{ opt: Base; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(81,5): error TS2322: Type 'F' is not assignable to type '{ opt: Base; }'. Property 'opt' is missing in type 'F'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(84,5): error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(84,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. Property 'opt' is missing in type 'D'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(85,5): error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(85,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. Property 'opt' is missing in type 'E'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(86,5): error TS2323: Type 'F' is not assignable to type '{ opt: Base; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(86,5): error TS2322: Type 'F' is not assignable to type '{ opt: Base; }'. Property 'opt' is missing in type 'F'. @@ -94,44 +94,44 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme c = d; // error ~ -!!! error TS2323: Type 'D' is not assignable to type 'C'. -!!! error TS2323: Property 'opt' is missing in type 'D'. +!!! error TS2322: Type 'D' is not assignable to type 'C'. +!!! error TS2322: Property 'opt' is missing in type 'D'. c = e; // error ~ -!!! error TS2323: Type 'E' is not assignable to type 'C'. -!!! error TS2323: Property 'opt' is missing in type 'E'. +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Property 'opt' is missing in type 'E'. c = f; // error ~ -!!! error TS2323: Type 'F' is not assignable to type 'C'. -!!! error TS2323: Property 'opt' is missing in type 'F'. +!!! error TS2322: Type 'F' is not assignable to type 'C'. +!!! error TS2322: Property 'opt' is missing in type 'F'. c = a; // ok a = d; // error ~ -!!! error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'. -!!! error TS2323: Property 'opt' is missing in type 'D'. +!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is missing in type 'D'. a = e; // error ~ -!!! error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'. -!!! error TS2323: Property 'opt' is missing in type 'E'. +!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is missing in type 'E'. a = f; // error ~ -!!! error TS2323: Type 'F' is not assignable to type '{ opt: Base; }'. -!!! error TS2323: Property 'opt' is missing in type 'F'. +!!! error TS2322: Type 'F' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is missing in type 'F'. a = c; // ok b = d; // error ~ -!!! error TS2323: Type 'D' is not assignable to type '{ opt: Base; }'. -!!! error TS2323: Property 'opt' is missing in type 'D'. +!!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is missing in type 'D'. b = e; // error ~ -!!! error TS2323: Type 'E' is not assignable to type '{ opt: Base; }'. -!!! error TS2323: Property 'opt' is missing in type 'E'. +!!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is missing in type 'E'. b = f; // error ~ -!!! error TS2323: Type 'F' is not assignable to type '{ opt: Base; }'. -!!! error TS2323: Property 'opt' is missing in type 'F'. +!!! error TS2322: Type 'F' is not assignable to type '{ opt: Base; }'. +!!! error TS2322: Property 'opt' is missing in type 'F'. b = a; // ok b = c; // ok } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt index b70cee86a4d..d86c73f5cf8 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt @@ -1,60 +1,60 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(21,5): error TS2323: Type 'T' is not assignable to type 'S'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(21,5): error TS2322: Type 'T' is not assignable to type 'S'. Property ''1'' is missing in type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(22,5): error TS2323: Type 'S' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(22,5): error TS2322: Type 'S' is not assignable to type 'T'. Property ''1.'' is missing in type 'S'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(24,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(24,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S'. Property ''1'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(26,5): error TS2323: Type 'T2' is not assignable to type 'S2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(26,5): error TS2322: Type 'T2' is not assignable to type 'S2'. Property ''1'' is missing in type 'T2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(27,5): error TS2323: Type 'S2' is not assignable to type 'T2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(27,5): error TS2322: Type 'S2' is not assignable to type 'T2'. Property ''1.0'' is missing in type 'S2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(28,5): error TS2323: Type 'T' is not assignable to type 'S2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(28,5): error TS2322: Type 'T' is not assignable to type 'S2'. Property ''1'' is missing in type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(29,5): error TS2323: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(29,5): error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2'. Property ''1'' is missing in type '{ '1.0': string; baz?: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(30,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(30,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2'. Property ''1'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(32,5): error TS2323: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(32,5): error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type '{ '1.0': string; baz?: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(33,5): error TS2323: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(33,5): error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }'. Property ''1.0'' is missing in type '{ '1.': string; bar?: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(34,5): error TS2323: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(34,5): error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type 'S'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(35,5): error TS2323: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(35,5): error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type 'S2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(36,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(36,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(38,5): error TS2323: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(38,5): error TS2322: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }'. Property ''1.0'' is missing in type '{ '1': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(39,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(39,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }'. Property ''1'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(42,5): error TS2323: Type 'T' is not assignable to type '{ '1.0': string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(42,5): error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }'. Property ''1.0'' is missing in type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(65,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(65,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S'. Property ''1'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(71,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S2'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(71,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2'. Property ''1'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(73,5): error TS2323: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(73,5): error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type '{ 1.0: string; baz?: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(74,5): error TS2323: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(74,5): error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }'. Property '1.0' is missing in type '{ '1.': string; bar?: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(75,5): error TS2323: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(75,5): error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type 'S'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(76,5): error TS2323: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(76,5): error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type 'S2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(77,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(77,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(78,5): error TS2323: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(78,5): error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. Property ''1.'' is missing in type '{ 1.: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(80,5): error TS2323: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(80,5): error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }'. Property ''1.0'' is missing in type '{ 1.: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(81,5): error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(81,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }'. Property '1.' is missing in type '{ '1.0': string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(82,5): error TS2323: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(82,5): error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }'. Property ''1.0'' is missing in type '{ 1.0: string; baz?: string; }'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(83,5): error TS2323: Type 'T2' is not assignable to type '{ '1.0': string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(83,5): error TS2322: Type 'T2' is not assignable to type '{ '1.0': string; }'. Property ''1.0'' is missing in type 'T2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(84,5): error TS2323: Type 'T' is not assignable to type '{ '1.0': string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(84,5): error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }'. Property ''1.0'' is missing in type 'T'. @@ -81,74 +81,74 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme s = t; ~ -!!! error TS2323: Type 'T' is not assignable to type 'S'. -!!! error TS2323: Property ''1'' is missing in type 'T'. +!!! error TS2322: Type 'T' is not assignable to type 'S'. +!!! error TS2322: Property ''1'' is missing in type 'T'. t = s; ~ -!!! error TS2323: Type 'S' is not assignable to type 'T'. -!!! error TS2323: Property ''1.'' is missing in type 'S'. +!!! error TS2322: Type 'S' is not assignable to type 'T'. +!!! error TS2322: Property ''1.'' is missing in type 'S'. s = s2; // ok s = a2; ~ -!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S'. -!!! error TS2323: Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S'. +!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. s2 = t2; ~~ -!!! error TS2323: Type 'T2' is not assignable to type 'S2'. -!!! error TS2323: Property ''1'' is missing in type 'T2'. +!!! error TS2322: Type 'T2' is not assignable to type 'S2'. +!!! error TS2322: Property ''1'' is missing in type 'T2'. t2 = s2; ~~ -!!! error TS2323: Type 'S2' is not assignable to type 'T2'. -!!! error TS2323: Property ''1.0'' is missing in type 'S2'. +!!! error TS2322: Type 'S2' is not assignable to type 'T2'. +!!! error TS2322: Property ''1.0'' is missing in type 'S2'. s2 = t; ~~ -!!! error TS2323: Type 'T' is not assignable to type 'S2'. -!!! error TS2323: Property ''1'' is missing in type 'T'. +!!! error TS2322: Type 'T' is not assignable to type 'S2'. +!!! error TS2322: Property ''1'' is missing in type 'T'. s2 = b; ~~ -!!! error TS2323: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2'. -!!! error TS2323: Property ''1'' is missing in type '{ '1.0': string; baz?: string; }'. +!!! error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2'. +!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; baz?: string; }'. s2 = a2; ~~ -!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S2'. -!!! error TS2323: Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2'. +!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. a = b; ~ -!!! error TS2323: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. -!!! error TS2323: Property ''1.'' is missing in type '{ '1.0': string; baz?: string; }'. +!!! error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type '{ '1.0': string; baz?: string; }'. b = a; ~ -!!! error TS2323: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }'. -!!! error TS2323: Property ''1.0'' is missing in type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }'. +!!! error TS2322: Property ''1.0'' is missing in type '{ '1.': string; bar?: string; }'. a = s; ~ -!!! error TS2323: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. -!!! error TS2323: Property ''1.'' is missing in type 'S'. +!!! error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type 'S'. a = s2; ~ -!!! error TS2323: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. -!!! error TS2323: Property ''1.'' is missing in type 'S2'. +!!! error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type 'S2'. a = a2; ~ -!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. -!!! error TS2323: Property ''1.'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type '{ '1.0': string; }'. a2 = b2; ~~ -!!! error TS2323: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }'. -!!! error TS2323: Property ''1.0'' is missing in type '{ '1': string; }'. +!!! error TS2322: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }'. +!!! error TS2322: Property ''1.0'' is missing in type '{ '1': string; }'. b2 = a2; ~~ -!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }'. -!!! error TS2323: Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }'. +!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. a2 = b; // ok a2 = t2; // ok a2 = t; ~~ -!!! error TS2323: Type 'T' is not assignable to type '{ '1.0': string; }'. -!!! error TS2323: Property ''1.0'' is missing in type 'T'. +!!! error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }'. +!!! error TS2322: Property ''1.0'' is missing in type 'T'. } module NumbersAndStrings { @@ -173,8 +173,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme s = s2; // ok s = a2; // error ~ -!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S'. -!!! error TS2323: Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S'. +!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. s2 = t2; // ok t2 = s2; // ok @@ -182,52 +182,52 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme s2 = b; // ok s2 = a2; // error ~~ -!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type 'S2'. -!!! error TS2323: Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2'. +!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. a = b; // error ~ -!!! error TS2323: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. -!!! error TS2323: Property ''1.'' is missing in type '{ 1.0: string; baz?: string; }'. +!!! error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type '{ 1.0: string; baz?: string; }'. b = a; // error ~ -!!! error TS2323: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }'. -!!! error TS2323: Property '1.0' is missing in type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }'. +!!! error TS2322: Property '1.0' is missing in type '{ '1.': string; bar?: string; }'. a = s; // error ~ -!!! error TS2323: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. -!!! error TS2323: Property ''1.'' is missing in type 'S'. +!!! error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type 'S'. a = s2; // error ~ -!!! error TS2323: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. -!!! error TS2323: Property ''1.'' is missing in type 'S2'. +!!! error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type 'S2'. a = a2; // error ~ -!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. -!!! error TS2323: Property ''1.'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type '{ '1.0': string; }'. a = b2; // error ~ -!!! error TS2323: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. -!!! error TS2323: Property ''1.'' is missing in type '{ 1.: string; }'. +!!! error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type '{ 1.: string; }'. a2 = b2; // error ~~ -!!! error TS2323: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }'. -!!! error TS2323: Property ''1.0'' is missing in type '{ 1.: string; }'. +!!! error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }'. +!!! error TS2322: Property ''1.0'' is missing in type '{ 1.: string; }'. b2 = a2; // error ~~ -!!! error TS2323: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }'. -!!! error TS2323: Property '1.' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }'. +!!! error TS2322: Property '1.' is missing in type '{ '1.0': string; }'. a2 = b; // error ~~ -!!! error TS2323: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }'. -!!! error TS2323: Property ''1.0'' is missing in type '{ 1.0: string; baz?: string; }'. +!!! error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }'. +!!! error TS2322: Property ''1.0'' is missing in type '{ 1.0: string; baz?: string; }'. a2 = t2; // error ~~ -!!! error TS2323: Type 'T2' is not assignable to type '{ '1.0': string; }'. -!!! error TS2323: Property ''1.0'' is missing in type 'T2'. +!!! error TS2322: Type 'T2' is not assignable to type '{ '1.0': string; }'. +!!! error TS2322: Property ''1.0'' is missing in type 'T2'. a2 = t; // error ~~ -!!! error TS2323: Type 'T' is not assignable to type '{ '1.0': string; }'. -!!! error TS2323: Property ''1.0'' is missing in type 'T'. +!!! error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }'. +!!! error TS2322: Property ''1.0'' is missing in type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt b/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt index e5741c8601e..3bea0c46716 100644 --- a/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/assignmentCompatWithOverloads.ts(17,1): error TS2323: Type '(x: string) => string' is not assignable to type '(s1: string) => number'. +tests/cases/compiler/assignmentCompatWithOverloads.ts(17,1): error TS2322: Type '(x: string) => string' is not assignable to type '(s1: string) => number'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/assignmentCompatWithOverloads.ts(19,1): error TS2323: Type '(x: number) => number' is not assignable to type '(s1: string) => number'. +tests/cases/compiler/assignmentCompatWithOverloads.ts(19,1): error TS2322: Type '(x: number) => number' is not assignable to type '(s1: string) => number'. Types of parameters 'x' and 's1' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/assignmentCompatWithOverloads.ts(21,1): error TS2323: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number'. +tests/cases/compiler/assignmentCompatWithOverloads.ts(21,1): error TS2322: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2323: Type 'typeof C' is not assignable to type 'new (x: number) => void'. +tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2322: Type 'typeof C' is not assignable to type 'new (x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. @@ -29,19 +29,19 @@ tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2323: Type g = f2; // Error ~ -!!! error TS2323: Type '(x: string) => string' is not assignable to type '(s1: string) => number'. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type '(s1: string) => number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. g = f3; // Error ~ -!!! error TS2323: Type '(x: number) => number' is not assignable to type '(s1: string) => number'. -!!! error TS2323: Types of parameters 'x' and 's1' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '(x: number) => number' is not assignable to type '(s1: string) => number'. +!!! error TS2322: Types of parameters 'x' and 's1' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. g = f4; // Error ~ -!!! error TS2323: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number'. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '{ (x: string): string; (x: number): number; }' is not assignable to type '(s1: string) => number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. class C { constructor(x: string); @@ -52,6 +52,6 @@ tests/cases/compiler/assignmentCompatWithOverloads.ts(30,1): error TS2323: Type d = C; // Error ~ -!!! error TS2323: Type 'typeof C' is not assignable to type 'new (x: number) => void'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'typeof C' is not assignable to type 'new (x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt index a560ddc5b68..f002c70e90b 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt @@ -1,27 +1,27 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(15,1): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(15,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(19,1): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(19,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(33,5): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(33,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(41,5): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(41,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(46,9): error TS2323: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(46,9): error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(47,9): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(47,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. Index signatures are incompatible. Type 'T' is not assignable to type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(50,9): error TS2323: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(50,9): error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(51,9): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. Index signatures are incompatible. Type 'T' is not assignable to type 'Derived2'. @@ -43,19 +43,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; // ok b = a; // error ~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Base' is not assignable to type 'Derived'. -!!! error TS2323: Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2322: Property 'bar' is missing in type 'Base'. var b2: { [x: string]: Derived2; } a = b2; // ok b2 = a; // error ~~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. -!!! error TS2323: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2322: Property 'baz' is missing in type 'Base'. module Generics { class A { @@ -71,9 +71,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a1 = b1; // ok b1 = a1; // error ~~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. class B2 extends A { [x: string]: Derived2; // ok @@ -83,34 +83,34 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a1 = b2; // ok b2 = a1; // error ~~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. function foo() { var b3: { [x: string]: Derived; }; var a3: A; a3 = b3; // error ~~ -!!! error TS2323: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Derived' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'T'. b3 = a3; // error ~~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'T' is not assignable to type 'Derived'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived'. var b4: { [x: string]: Derived2; }; a3 = b4; // error ~~ -!!! error TS2323: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'T'. b4 = a3; // error ~~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'T' is not assignable to type 'Derived2'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived2'. } } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt index 672e51b74ae..c322364280e 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt @@ -1,27 +1,27 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(15,1): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(15,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived'. Property 'bar' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(19,1): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(19,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived2'. Property 'baz' is missing in type 'Base'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(33,5): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(33,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(41,5): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(41,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived2'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(46,9): error TS2323: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(46,9): error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(47,9): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(47,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. Index signatures are incompatible. Type 'T' is not assignable to type 'Derived'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(50,9): error TS2323: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(50,9): error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. Index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(51,9): error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(51,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. Index signatures are incompatible. Type 'T' is not assignable to type 'Derived2'. @@ -43,19 +43,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = b; // ok b = a; // error ~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Base' is not assignable to type 'Derived'. -!!! error TS2323: Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2322: Property 'bar' is missing in type 'Base'. var b2: { [x: string]: Derived2; } a = b2; // ok b2 = a; // error ~~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. -!!! error TS2323: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2322: Property 'baz' is missing in type 'Base'. module Generics { interface A { @@ -71,9 +71,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a1 = b1; // ok b1 = a1; // error ~~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Base' is not assignable to type 'Derived'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived'. interface B2 extends A { [x: string]: Derived2; // ok @@ -83,34 +83,34 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a1 = b2; // ok b2 = a1; // error ~~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Base' is not assignable to type 'Derived2'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. function foo() { var b3: { [x: string]: Derived; }; var a3: A; a3 = b3; // error ~~ -!!! error TS2323: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Derived' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: string]: Derived; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived' is not assignable to type 'T'. b3 = a3; // error ~~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'T' is not assignable to type 'Derived'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived'. var b4: { [x: string]: Derived2; }; a3 = b4; // error ~~ -!!! error TS2323: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'Derived2' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: string]: Derived2; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'Derived2' is not assignable to type 'T'. b4 = a3; // error ~~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'T' is not assignable to type 'Derived2'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'Derived2'. } } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt index 03f9a5de6b1..a31b2ef3025 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer3.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(7,8): error TS2304: Cannot find name 'A'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(20,9): error TS2323: Type '{ [x: string]: string; }' is not assignable to type 'A'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(20,9): error TS2322: Type '{ [x: string]: string; }' is not assignable to type 'A'. Index signatures are incompatible. Type 'string' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(21,9): error TS2323: Type 'A' is not assignable to type '{ [x: string]: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer3.ts(21,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: string; }'. Index signatures are incompatible. Type 'T' is not assignable to type 'string'. @@ -31,13 +31,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme var b: { [x: string]: string; } a = b; // error ~ -!!! error TS2323: Type '{ [x: string]: string; }' is not assignable to type 'A'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'T'. +!!! error TS2322: Type '{ [x: string]: string; }' is not assignable to type 'A'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'T'. b = a; // error ~ -!!! error TS2323: Type 'A' is not assignable to type '{ [x: string]: string; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'T' is not assignable to type 'string'. +!!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'string'. } } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability10.errors.txt b/tests/baselines/reference/assignmentCompatability10.errors.txt index 6b553d2f5d4..883bf1c277c 100644 --- a/tests/baselines/reference/assignmentCompatability10.errors.txt +++ b/tests/baselines/reference/assignmentCompatability10.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability10.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicAndOptional'. +tests/cases/compiler/assignmentCompatability10.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicAndOptional'. Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithPublicAndOptional'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability10.ts(9,1): error TS2323: Type 'inte } __test2__.__val__x4 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicAndOptional'. -!!! error TS2323: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithPublicAndOptional'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicAndOptional'. +!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability11.errors.txt b/tests/baselines/reference/assignmentCompatability11.errors.txt index 135daf32d8e..21d49c6d3ae 100644 --- a/tests/baselines/reference/assignmentCompatability11.errors.txt +++ b/tests/baselines/reference/assignmentCompatability11.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability11.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. +tests/cases/compiler/assignmentCompatability11.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. Types of property 'two' are incompatible. Type 'string' is not assignable to type 'number'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability11.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. -!!! error TS2323: Types of property 'two' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability12.errors.txt b/tests/baselines/reference/assignmentCompatability12.errors.txt index f896763d608..07b65bdc463 100644 --- a/tests/baselines/reference/assignmentCompatability12.errors.txt +++ b/tests/baselines/reference/assignmentCompatability12.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability12.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. +tests/cases/compiler/assignmentCompatability12.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability12.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. -!!! error TS2323: Types of property 'one' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability13.errors.txt b/tests/baselines/reference/assignmentCompatability13.errors.txt index 33434bd0c20..ea7e62c422f 100644 --- a/tests/baselines/reference/assignmentCompatability13.errors.txt +++ b/tests/baselines/reference/assignmentCompatability13.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability13.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. +tests/cases/compiler/assignmentCompatability13.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability13.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. -!!! error TS2323: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. +!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability14.errors.txt b/tests/baselines/reference/assignmentCompatability14.errors.txt index a104fd73775..2ba77622f33 100644 --- a/tests/baselines/reference/assignmentCompatability14.errors.txt +++ b/tests/baselines/reference/assignmentCompatability14.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability14.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. +tests/cases/compiler/assignmentCompatability14.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'boolean'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability14.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. -!!! error TS2323: Types of property 'one' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability15.errors.txt b/tests/baselines/reference/assignmentCompatability15.errors.txt index 6952d9780cc..c56719d0895 100644 --- a/tests/baselines/reference/assignmentCompatability15.errors.txt +++ b/tests/baselines/reference/assignmentCompatability15.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability15.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean; }'. +tests/cases/compiler/assignmentCompatability15.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean; }'. Types of property 'two' are incompatible. Type 'string' is not assignable to type 'boolean'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability15.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean; }'. -!!! error TS2323: Types of property 'two' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean; }'. +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability16.errors.txt b/tests/baselines/reference/assignmentCompatability16.errors.txt index 7234065e263..266d72b3232 100644 --- a/tests/baselines/reference/assignmentCompatability16.errors.txt +++ b/tests/baselines/reference/assignmentCompatability16.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability16.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. +tests/cases/compiler/assignmentCompatability16.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'any[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability16.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. -!!! error TS2323: Types of property 'one' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'any[]'. -!!! error TS2323: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability17.errors.txt b/tests/baselines/reference/assignmentCompatability17.errors.txt index 306d3df4a90..b37f39d082f 100644 --- a/tests/baselines/reference/assignmentCompatability17.errors.txt +++ b/tests/baselines/reference/assignmentCompatability17.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability17.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }'. +tests/cases/compiler/assignmentCompatability17.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }'. Types of property 'two' are incompatible. Type 'string' is not assignable to type 'any[]'. Property 'push' is missing in type 'String'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability17.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }'. -!!! error TS2323: Types of property 'two' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'any[]'. -!!! error TS2323: Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }'. +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'any[]'. +!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability18.errors.txt b/tests/baselines/reference/assignmentCompatability18.errors.txt index e19b8133556..2be4a037575 100644 --- a/tests/baselines/reference/assignmentCompatability18.errors.txt +++ b/tests/baselines/reference/assignmentCompatability18.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability18.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. +tests/cases/compiler/assignmentCompatability18.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'number[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability18.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. -!!! error TS2323: Types of property 'one' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'number[]'. -!!! error TS2323: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'number[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability19.errors.txt b/tests/baselines/reference/assignmentCompatability19.errors.txt index ab552ef2a29..ae97af6aa7e 100644 --- a/tests/baselines/reference/assignmentCompatability19.errors.txt +++ b/tests/baselines/reference/assignmentCompatability19.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability19.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }'. +tests/cases/compiler/assignmentCompatability19.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }'. Types of property 'two' are incompatible. Type 'string' is not assignable to type 'number[]'. Property 'push' is missing in type 'String'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability19.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }'. -!!! error TS2323: Types of property 'two' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number[]'. -!!! error TS2323: Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }'. +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number[]'. +!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability20.errors.txt b/tests/baselines/reference/assignmentCompatability20.errors.txt index 001331c1afd..750310ac5cc 100644 --- a/tests/baselines/reference/assignmentCompatability20.errors.txt +++ b/tests/baselines/reference/assignmentCompatability20.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability20.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. +tests/cases/compiler/assignmentCompatability20.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability20.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. -!!! error TS2323: Types of property 'one' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string[]'. -!!! error TS2323: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability21.errors.txt b/tests/baselines/reference/assignmentCompatability21.errors.txt index 1ff8585b2f8..8da52fe42c6 100644 --- a/tests/baselines/reference/assignmentCompatability21.errors.txt +++ b/tests/baselines/reference/assignmentCompatability21.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability21.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }'. +tests/cases/compiler/assignmentCompatability21.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }'. Types of property 'two' are incompatible. Type 'string' is not assignable to type 'string[]'. Property 'push' is missing in type 'String'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability21.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }'. -!!! error TS2323: Types of property 'two' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'string[]'. -!!! error TS2323: Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }'. +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'string[]'. +!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability22.errors.txt b/tests/baselines/reference/assignmentCompatability22.errors.txt index 6ac985e5de0..f0799a92f5c 100644 --- a/tests/baselines/reference/assignmentCompatability22.errors.txt +++ b/tests/baselines/reference/assignmentCompatability22.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability22.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. +tests/cases/compiler/assignmentCompatability22.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'boolean[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability22.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. -!!! error TS2323: Types of property 'one' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'boolean[]'. -!!! error TS2323: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'boolean[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability23.errors.txt b/tests/baselines/reference/assignmentCompatability23.errors.txt index 315f3bc12bc..a005eaa02d1 100644 --- a/tests/baselines/reference/assignmentCompatability23.errors.txt +++ b/tests/baselines/reference/assignmentCompatability23.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability23.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }'. +tests/cases/compiler/assignmentCompatability23.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }'. Types of property 'two' are incompatible. Type 'string' is not assignable to type 'boolean[]'. Property 'push' is missing in type 'String'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability23.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }'. -!!! error TS2323: Types of property 'two' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'boolean[]'. -!!! error TS2323: Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }'. +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'boolean[]'. +!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability24.errors.txt b/tests/baselines/reference/assignmentCompatability24.errors.txt index 14cd2eb41d4..0f4a535d413 100644 --- a/tests/baselines/reference/assignmentCompatability24.errors.txt +++ b/tests/baselines/reference/assignmentCompatability24.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability24.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. +tests/cases/compiler/assignmentCompatability24.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. ==== tests/cases/compiler/assignmentCompatability24.ts (1 errors) ==== @@ -12,4 +12,4 @@ tests/cases/compiler/assignmentCompatability24.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability25.errors.txt b/tests/baselines/reference/assignmentCompatability25.errors.txt index 76f462d635d..7f7e7f73ee0 100644 --- a/tests/baselines/reference/assignmentCompatability25.errors.txt +++ b/tests/baselines/reference/assignmentCompatability25.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability25.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. +tests/cases/compiler/assignmentCompatability25.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. Types of property 'two' are incompatible. Type 'string' is not assignable to type 'number'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability25.ts(9,1): error TS2323: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. -!!! error TS2323: Types of property 'two' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability26.errors.txt b/tests/baselines/reference/assignmentCompatability26.errors.txt index 6b6497a5f6d..a005850e49c 100644 --- a/tests/baselines/reference/assignmentCompatability26.errors.txt +++ b/tests/baselines/reference/assignmentCompatability26.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability26.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. +tests/cases/compiler/assignmentCompatability26.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability26.ts(9,1): error TS2323: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. -!!! error TS2323: Types of property 'one' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability27.errors.txt b/tests/baselines/reference/assignmentCompatability27.errors.txt index 2751bd38f19..180a51b3cf0 100644 --- a/tests/baselines/reference/assignmentCompatability27.errors.txt +++ b/tests/baselines/reference/assignmentCompatability27.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability27.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. +tests/cases/compiler/assignmentCompatability27.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability27.ts(9,1): error TS2323: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. -!!! error TS2323: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. +!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability28.errors.txt b/tests/baselines/reference/assignmentCompatability28.errors.txt index 756411d654c..2360d0b1e9d 100644 --- a/tests/baselines/reference/assignmentCompatability28.errors.txt +++ b/tests/baselines/reference/assignmentCompatability28.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability28.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. +tests/cases/compiler/assignmentCompatability28.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'boolean'. @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentCompatability28.ts(9,1): error TS2323: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. -!!! error TS2323: Types of property 'one' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability29.errors.txt b/tests/baselines/reference/assignmentCompatability29.errors.txt index 88f936d1466..194ae4ab675 100644 --- a/tests/baselines/reference/assignmentCompatability29.errors.txt +++ b/tests/baselines/reference/assignmentCompatability29.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability29.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. +tests/cases/compiler/assignmentCompatability29.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'any[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability29.ts(9,1): error TS2323: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. -!!! error TS2323: Types of property 'one' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'any[]'. -!!! error TS2323: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'any[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability30.errors.txt b/tests/baselines/reference/assignmentCompatability30.errors.txt index cba16799c66..b025705517c 100644 --- a/tests/baselines/reference/assignmentCompatability30.errors.txt +++ b/tests/baselines/reference/assignmentCompatability30.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability30.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. +tests/cases/compiler/assignmentCompatability30.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'number[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability30.ts(9,1): error TS2323: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. -!!! error TS2323: Types of property 'one' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'number[]'. -!!! error TS2323: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'number[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability31.errors.txt b/tests/baselines/reference/assignmentCompatability31.errors.txt index c7f48f70835..8e19905eba7 100644 --- a/tests/baselines/reference/assignmentCompatability31.errors.txt +++ b/tests/baselines/reference/assignmentCompatability31.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability31.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. +tests/cases/compiler/assignmentCompatability31.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability31.ts(9,1): error TS2323: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. -!!! error TS2323: Types of property 'one' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string[]'. -!!! error TS2323: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability32.errors.txt b/tests/baselines/reference/assignmentCompatability32.errors.txt index 07e8b7de26f..6d6321f5e50 100644 --- a/tests/baselines/reference/assignmentCompatability32.errors.txt +++ b/tests/baselines/reference/assignmentCompatability32.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability32.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. +tests/cases/compiler/assignmentCompatability32.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'boolean[]'. Property 'length' is missing in type 'Number'. @@ -15,7 +15,7 @@ tests/cases/compiler/assignmentCompatability32.ts(9,1): error TS2323: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. -!!! error TS2323: Types of property 'one' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'boolean[]'. -!!! error TS2323: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'boolean[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability33.errors.txt b/tests/baselines/reference/assignmentCompatability33.errors.txt index 27a87764b61..e2352625280 100644 --- a/tests/baselines/reference/assignmentCompatability33.errors.txt +++ b/tests/baselines/reference/assignmentCompatability33.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability33.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. +tests/cases/compiler/assignmentCompatability33.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. ==== tests/cases/compiler/assignmentCompatability33.ts (1 errors) ==== @@ -12,4 +12,4 @@ tests/cases/compiler/assignmentCompatability33.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability34.errors.txt b/tests/baselines/reference/assignmentCompatability34.errors.txt index 9ac0a97011c..2dd9cba6470 100644 --- a/tests/baselines/reference/assignmentCompatability34.errors.txt +++ b/tests/baselines/reference/assignmentCompatability34.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability34.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tnumber) => Tnumber'. +tests/cases/compiler/assignmentCompatability34.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tnumber) => Tnumber'. ==== tests/cases/compiler/assignmentCompatability34.ts (1 errors) ==== @@ -12,4 +12,4 @@ tests/cases/compiler/assignmentCompatability34.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tnumber) => Tnumber'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tnumber) => Tnumber'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability35.errors.txt b/tests/baselines/reference/assignmentCompatability35.errors.txt index 06f83c1e78f..faad78c10fc 100644 --- a/tests/baselines/reference/assignmentCompatability35.errors.txt +++ b/tests/baselines/reference/assignmentCompatability35.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability35.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: number]: number; }'. +tests/cases/compiler/assignmentCompatability35.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: number]: number; }'. Index signature is missing in type 'interfaceWithPublicAndOptional'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability35.ts(9,1): error TS2323: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: number]: number; }'. -!!! error TS2323: Index signature is missing in type 'interfaceWithPublicAndOptional'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: number]: number; }'. +!!! error TS2322: Index signature is missing in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability36.errors.txt b/tests/baselines/reference/assignmentCompatability36.errors.txt index eb02058ad8b..d8c43a3f363 100644 --- a/tests/baselines/reference/assignmentCompatability36.errors.txt +++ b/tests/baselines/reference/assignmentCompatability36.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability36.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: string]: any; }'. +tests/cases/compiler/assignmentCompatability36.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: string]: any; }'. Index signature is missing in type 'interfaceWithPublicAndOptional'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability36.ts(9,1): error TS2323: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: string]: any; }'. -!!! error TS2323: Index signature is missing in type 'interfaceWithPublicAndOptional'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ [x: string]: any; }'. +!!! error TS2322: Index signature is missing in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability37.errors.txt b/tests/baselines/reference/assignmentCompatability37.errors.txt index 7ce5905816b..452b72fe8ff 100644 --- a/tests/baselines/reference/assignmentCompatability37.errors.txt +++ b/tests/baselines/reference/assignmentCompatability37.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability37.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tnumber) => any'. +tests/cases/compiler/assignmentCompatability37.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tnumber) => any'. ==== tests/cases/compiler/assignmentCompatability37.ts (1 errors) ==== @@ -12,4 +12,4 @@ tests/cases/compiler/assignmentCompatability37.ts(9,1): error TS2323: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tnumber) => any'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tnumber) => any'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability38.errors.txt b/tests/baselines/reference/assignmentCompatability38.errors.txt index d23685d9f99..5f7918374c1 100644 --- a/tests/baselines/reference/assignmentCompatability38.errors.txt +++ b/tests/baselines/reference/assignmentCompatability38.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability38.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tstring) => any'. +tests/cases/compiler/assignmentCompatability38.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tstring) => any'. ==== tests/cases/compiler/assignmentCompatability38.ts (1 errors) ==== @@ -12,4 +12,4 @@ tests/cases/compiler/assignmentCompatability38.ts(9,1): error TS2323: Type 'inte } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tstring) => any'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tstring) => any'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability39.errors.txt b/tests/baselines/reference/assignmentCompatability39.errors.txt index 4c7f14ba68f..6389a9ad87f 100644 --- a/tests/baselines/reference/assignmentCompatability39.errors.txt +++ b/tests/baselines/reference/assignmentCompatability39.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability39.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPublic'. +tests/cases/compiler/assignmentCompatability39.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPublic'. Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithTwoPublic'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability39.ts(9,1): error TS2323: Type 'inte } __test2__.__val__x2 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPublic'. -!!! error TS2323: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithTwoPublic'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPublic'. +!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithTwoPublic'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability40.errors.txt b/tests/baselines/reference/assignmentCompatability40.errors.txt index 9282af2c121..d60f7dcdeb6 100644 --- a/tests/baselines/reference/assignmentCompatability40.errors.txt +++ b/tests/baselines/reference/assignmentCompatability40.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability40.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPrivate'. +tests/cases/compiler/assignmentCompatability40.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPrivate'. Property 'one' is private in type 'classWithPrivate' but not in type 'interfaceWithPublicAndOptional'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability40.ts(9,1): error TS2323: Type 'inte } __test2__.__val__x5 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPrivate'. -!!! error TS2323: Property 'one' is private in type 'classWithPrivate' but not in type 'interfaceWithPublicAndOptional'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPrivate'. +!!! error TS2322: Property 'one' is private in type 'classWithPrivate' but not in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability41.errors.txt b/tests/baselines/reference/assignmentCompatability41.errors.txt index 75c3ddd90bf..ad0b7b7cfe3 100644 --- a/tests/baselines/reference/assignmentCompatability41.errors.txt +++ b/tests/baselines/reference/assignmentCompatability41.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability41.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPrivate'. +tests/cases/compiler/assignmentCompatability41.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPrivate'. Property 'one' is private in type 'classWithTwoPrivate' but not in type 'interfaceWithPublicAndOptional'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability41.ts(9,1): error TS2323: Type 'inte } __test2__.__val__x6 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPrivate'. -!!! error TS2323: Property 'one' is private in type 'classWithTwoPrivate' but not in type 'interfaceWithPublicAndOptional'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPrivate'. +!!! error TS2322: Property 'one' is private in type 'classWithTwoPrivate' but not in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability42.errors.txt b/tests/baselines/reference/assignmentCompatability42.errors.txt index bd20a1d56b2..e86b261e682 100644 --- a/tests/baselines/reference/assignmentCompatability42.errors.txt +++ b/tests/baselines/reference/assignmentCompatability42.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability42.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicPrivate'. +tests/cases/compiler/assignmentCompatability42.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicPrivate'. Property 'two' is private in type 'classWithPublicPrivate' but not in type 'interfaceWithPublicAndOptional'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability42.ts(9,1): error TS2323: Type 'inte } __test2__.__val__x7 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicPrivate'. -!!! error TS2323: Property 'two' is private in type 'classWithPublicPrivate' but not in type 'interfaceWithPublicAndOptional'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithPublicPrivate'. +!!! error TS2322: Property 'two' is private in type 'classWithPublicPrivate' but not in type 'interfaceWithPublicAndOptional'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability43.errors.txt b/tests/baselines/reference/assignmentCompatability43.errors.txt index 9cc919f34bf..a1f596ef7e2 100644 --- a/tests/baselines/reference/assignmentCompatability43.errors.txt +++ b/tests/baselines/reference/assignmentCompatability43.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentCompatability43.ts(9,1): error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'interfaceTwo'. +tests/cases/compiler/assignmentCompatability43.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'interfaceTwo'. Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'interfaceTwo'. @@ -13,5 +13,5 @@ tests/cases/compiler/assignmentCompatability43.ts(9,1): error TS2323: Type 'inte } __test2__.__val__obj2 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'interfaceWithPublicAndOptional' is not assignable to type 'interfaceTwo'. -!!! error TS2323: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'interfaceTwo'. \ No newline at end of file +!!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'interfaceTwo'. +!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'interfaceTwo'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt index 29764fec7a7..e5db4f9ab96 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt +++ b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(10,1): error TS2323: Type 'string' is not assignable to type 'Applicable'. +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(10,1): error TS2322: Type 'string' is not assignable to type 'Applicable'. Property 'apply' is missing in type 'String'. -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(11,1): error TS2323: Type 'string[]' is not assignable to type 'Applicable'. +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(11,1): error TS2322: Type 'string[]' is not assignable to type 'Applicable'. Property 'apply' is missing in type 'string[]'. -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(12,1): error TS2323: Type 'number' is not assignable to type 'Applicable'. +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(12,1): error TS2322: Type 'number' is not assignable to type 'Applicable'. Property 'apply' is missing in type 'Number'. -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(13,1): error TS2323: Type '{}' is not assignable to type 'Applicable'. +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(13,1): error TS2322: Type '{}' is not assignable to type 'Applicable'. Property 'apply' is missing in type '{}'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Applicable'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(23,4): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Applicable'. @@ -25,20 +25,20 @@ tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-functi // Should fail x = ''; ~ -!!! error TS2323: Type 'string' is not assignable to type 'Applicable'. -!!! error TS2323: Property 'apply' is missing in type 'String'. +!!! error TS2322: Type 'string' is not assignable to type 'Applicable'. +!!! error TS2322: Property 'apply' is missing in type 'String'. x = ['']; ~ -!!! error TS2323: Type 'string[]' is not assignable to type 'Applicable'. -!!! error TS2323: Property 'apply' is missing in type 'string[]'. +!!! error TS2322: Type 'string[]' is not assignable to type 'Applicable'. +!!! error TS2322: Property 'apply' is missing in type 'string[]'. x = 4; ~ -!!! error TS2323: Type 'number' is not assignable to type 'Applicable'. -!!! error TS2323: Property 'apply' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'Applicable'. +!!! error TS2322: Property 'apply' is missing in type 'Number'. x = {}; ~ -!!! error TS2323: Type '{}' is not assignable to type 'Applicable'. -!!! error TS2323: Property 'apply' is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type 'Applicable'. +!!! error TS2322: Property 'apply' is missing in type '{}'. // Should work function f() { }; diff --git a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt index 2abefbf7099..f3ff6f1b792 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt +++ b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(10,1): error TS2323: Type 'string' is not assignable to type 'Callable'. +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(10,1): error TS2322: Type 'string' is not assignable to type 'Callable'. Property 'call' is missing in type 'String'. -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(11,1): error TS2323: Type 'string[]' is not assignable to type 'Callable'. +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(11,1): error TS2322: Type 'string[]' is not assignable to type 'Callable'. Property 'call' is missing in type 'string[]'. -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(12,1): error TS2323: Type 'number' is not assignable to type 'Callable'. +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(12,1): error TS2322: Type 'number' is not assignable to type 'Callable'. Property 'call' is missing in type 'Number'. -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(13,1): error TS2323: Type '{}' is not assignable to type 'Callable'. +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(13,1): error TS2322: Type '{}' is not assignable to type 'Callable'. Property 'call' is missing in type '{}'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Callable'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(23,4): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Callable'. @@ -25,20 +25,20 @@ tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-functio // Should fail x = ''; ~ -!!! error TS2323: Type 'string' is not assignable to type 'Callable'. -!!! error TS2323: Property 'call' is missing in type 'String'. +!!! error TS2322: Type 'string' is not assignable to type 'Callable'. +!!! error TS2322: Property 'call' is missing in type 'String'. x = ['']; ~ -!!! error TS2323: Type 'string[]' is not assignable to type 'Callable'. -!!! error TS2323: Property 'call' is missing in type 'string[]'. +!!! error TS2322: Type 'string[]' is not assignable to type 'Callable'. +!!! error TS2322: Property 'call' is missing in type 'string[]'. x = 4; ~ -!!! error TS2323: Type 'number' is not assignable to type 'Callable'. -!!! error TS2323: Property 'call' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'Callable'. +!!! error TS2322: Property 'call' is missing in type 'Number'. x = {}; ~ -!!! error TS2323: Type '{}' is not assignable to type 'Callable'. -!!! error TS2323: Property 'call' is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type 'Callable'. +!!! error TS2322: Property 'call' is missing in type '{}'. // Should work function f() { }; diff --git a/tests/baselines/reference/assignmentStricterConstraints.errors.txt b/tests/baselines/reference/assignmentStricterConstraints.errors.txt index f5234a44fd1..bf3751dda74 100644 --- a/tests/baselines/reference/assignmentStricterConstraints.errors.txt +++ b/tests/baselines/reference/assignmentStricterConstraints.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/assignmentStricterConstraints.ts(1,22): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/assignmentStricterConstraints.ts(2,5): error TS2323: Type 'S' is not assignable to type 'T'. +tests/cases/compiler/assignmentStricterConstraints.ts(2,5): error TS2322: Type 'S' is not assignable to type 'T'. ==== tests/cases/compiler/assignmentStricterConstraints.ts (2 errors) ==== @@ -8,7 +8,7 @@ tests/cases/compiler/assignmentStricterConstraints.ts(2,5): error TS2323: Type ' !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x = y ~ -!!! error TS2323: Type 'S' is not assignable to type 'T'. +!!! error TS2322: Type 'S' is not assignable to type 'T'. } var g = function (x: T, y: S): void { } diff --git a/tests/baselines/reference/assignmentToObject.errors.txt b/tests/baselines/reference/assignmentToObject.errors.txt index 4be2392fce1..aa1222bd799 100644 --- a/tests/baselines/reference/assignmentToObject.errors.txt +++ b/tests/baselines/reference/assignmentToObject.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignmentToObject.ts(3,5): error TS2323: Type '{ toString: number; }' is not assignable to type 'Object'. +tests/cases/compiler/assignmentToObject.ts(3,5): error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'. Types of property 'toString' are incompatible. Type 'number' is not assignable to type '() => string'. @@ -8,7 +8,7 @@ tests/cases/compiler/assignmentToObject.ts(3,5): error TS2323: Type '{ toString: var b: {} = a; // ok var c: Object = a; // should be error ~ -!!! error TS2323: Type '{ toString: number; }' is not assignable to type 'Object'. -!!! error TS2323: Types of property 'toString' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type '() => string'. +!!! error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type '() => string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt index 82ca1be0cfc..2e85ee101f5 100644 --- a/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt +++ b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/assignmentToObjectAndFunction.ts(1,5): error TS2323: Type '{ toString: number; }' is not assignable to type 'Object'. +tests/cases/compiler/assignmentToObjectAndFunction.ts(1,5): error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'. Types of property 'toString' are incompatible. Type 'number' is not assignable to type '() => string'. -tests/cases/compiler/assignmentToObjectAndFunction.ts(8,5): error TS2323: Type '{}' is not assignable to type 'Function'. +tests/cases/compiler/assignmentToObjectAndFunction.ts(8,5): error TS2322: Type '{}' is not assignable to type 'Function'. Property 'apply' is missing in type '{}'. -tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2323: Type 'typeof bad' is not assignable to type 'Function'. +tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type 'typeof bad' is not assignable to type 'Function'. Types of property 'apply' are incompatible. Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'. @@ -11,9 +11,9 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2323: Type ==== tests/cases/compiler/assignmentToObjectAndFunction.ts (3 errors) ==== var errObj: Object = { toString: 0 }; // Error, incompatible toString ~~~~~~ -!!! error TS2323: Type '{ toString: number; }' is not assignable to type 'Object'. -!!! error TS2323: Types of property 'toString' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type '() => string'. +!!! error TS2322: Type '{ toString: number; }' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type '() => string'. var goodObj: Object = { toString(x?) { return ""; @@ -22,8 +22,8 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2323: Type var errFun: Function = {}; // Error for no call signature ~~~~~~ -!!! error TS2323: Type '{}' is not assignable to type 'Function'. -!!! error TS2323: Property 'apply' is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type 'Function'. +!!! error TS2322: Property 'apply' is missing in type '{}'. function foo() { } module foo { @@ -46,6 +46,6 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2323: Type var badFundule: Function = bad; // error ~~~~~~~~~~ -!!! error TS2323: Type 'typeof bad' is not assignable to type 'Function'. -!!! error TS2323: Types of property 'apply' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'. \ No newline at end of file +!!! error TS2322: Type 'typeof bad' is not assignable to type 'Function'. +!!! error TS2322: Types of property 'apply' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type '(thisArg: any, argArray?: any) => any'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt index 67dee955566..a50ffdf72d7 100644 --- a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt +++ b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt @@ -1,29 +1,29 @@ -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(4,1): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(5,1): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(13,1): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(14,1): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(15,1): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(4,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(5,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(13,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(14,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(15,1): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(17,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(25,5): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(31,1): error TS2323: Type '{ x: string; }' is not assignable to type 'typeof M3'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(31,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(32,1): error TS2323: Type '{ x: string; }' is not assignable to type 'typeof M3'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(32,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(33,1): error TS2323: Type '{ x: string; }' is not assignable to type 'typeof M3'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(33,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(37,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(38,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(43,5): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(44,5): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(48,5): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(49,5): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(54,5): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(55,5): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(56,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(43,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(44,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(48,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(49,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(54,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(55,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(56,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(62,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(63,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(69,1): error TS2364: Invalid left-hand side of assignment expression. @@ -36,10 +36,10 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize (x) = 3; // OK x = ''; // Error ~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (x) = ''; // Error ~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. module M { export var y: number; @@ -49,13 +49,13 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize (M.y) = 3; // OK M.y = ''; // Error ~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (M).y = ''; // Error ~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (M.y) = ''; // Error ~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. M = { y: 3 }; // Error ~ @@ -79,19 +79,19 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize M2.M3 = { x: '' }; // Error ~~~~~ -!!! error TS2323: Type '{ x: string; }' is not assignable to type 'typeof M3'. -!!! error TS2323: Types of property 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (M2).M3 = { x: '' }; // Error ~~~~~~~ -!!! error TS2323: Type '{ x: string; }' is not assignable to type 'typeof M3'. -!!! error TS2323: Types of property 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (M2.M3) = { x: '' }; // Error ~~~~~~~ -!!! error TS2323: Type '{ x: string; }' is not assignable to type 'typeof M3'. -!!! error TS2323: Types of property 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. function fn() { } @@ -107,32 +107,32 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize (x) = 3; // OK x = ''; // Error ~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (x) = ''; // Error ~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (y).t = 3; // OK (y.t) = 3; // OK (y).t = ''; // Error ~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (y.t) = ''; // Error ~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. y['t'] = 3; // OK (y)['t'] = 3; // OK (y['t']) = 3; // OK y['t'] = ''; // Error ~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (y)['t'] = ''; // Error ~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (y['t']) = ''; // Error ~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. } enum E { diff --git a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt index 8a5899d2377..a951a2b1a66 100644 --- a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt +++ b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(15,5): error TS2323: Type '{}' is not assignable to type '{ [x: number]: Foo; }'. +tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(15,5): error TS2322: Type '{}' is not assignable to type '{ [x: number]: Foo; }'. Index signature is missing in type '{}'. -tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(19,5): error TS2323: Type '() => void' is not assignable to type '{ [x: number]: Bar; }'. +tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(19,5): error TS2322: Type '() => void' is not assignable to type '{ [x: number]: Bar; }'. Index signature is missing in type '() => void'. @@ -21,14 +21,14 @@ tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignatur var v1: { ~~ -!!! error TS2323: Type '{}' is not assignable to type '{ [x: number]: Foo; }'. -!!! error TS2323: Index signature is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type '{ [x: number]: Foo; }'. +!!! error TS2322: Index signature is missing in type '{}'. [n: number]: Foo } = o; // Should be allowed var v2: { ~~ -!!! error TS2323: Type '() => void' is not assignable to type '{ [x: number]: Bar; }'. -!!! error TS2323: Index signature is missing in type '() => void'. +!!! error TS2322: Type '() => void' is not assignable to type '{ [x: number]: Bar; }'. +!!! error TS2322: Index signature is missing in type '() => void'. [n: number]: Bar } = f; // Should be allowed \ No newline at end of file diff --git a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js index 9cd5a63912e..710af4edfa7 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js @@ -30,11 +30,11 @@ var ENUM1; // enum type var var ResultIsNumber1 = ~ENUM1; // enum type expressions -var ResultIsNumber2 = ~ENUM1["A"]; -var ResultIsNumber3 = ~(0 /* A */ + ENUM1["B"]); +var ResultIsNumber2 = ~0 /* "A" */; +var ResultIsNumber3 = ~(0 /* A */ + 1 /* "B" */); // multiple ~ operators -var ResultIsNumber4 = ~~~(ENUM1["A"] + 1 /* B */); +var ResultIsNumber4 = ~~~(0 /* "A" */ + 1 /* B */); // miss assignment operators ~ENUM1; -~ENUM1["A"]; -~0 /* A */, ~ENUM1["B"]; +~0 /* "A" */; +~0 /* A */, ~1 /* "B" */; diff --git a/tests/baselines/reference/callConstructAssignment.errors.txt b/tests/baselines/reference/callConstructAssignment.errors.txt index e3f850a1855..42949cf585d 100644 --- a/tests/baselines/reference/callConstructAssignment.errors.txt +++ b/tests/baselines/reference/callConstructAssignment.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/callConstructAssignment.ts(7,1): error TS2323: Type 'new () => any' is not assignable to type '() => void'. -tests/cases/compiler/callConstructAssignment.ts(8,1): error TS2323: Type '() => void' is not assignable to type 'new () => any'. +tests/cases/compiler/callConstructAssignment.ts(7,1): error TS2322: Type 'new () => any' is not assignable to type '() => void'. +tests/cases/compiler/callConstructAssignment.ts(8,1): error TS2322: Type '() => void' is not assignable to type 'new () => any'. ==== tests/cases/compiler/callConstructAssignment.ts (2 errors) ==== @@ -11,7 +11,7 @@ tests/cases/compiler/callConstructAssignment.ts(8,1): error TS2323: Type '() => foo = bar; // error ~~~ -!!! error TS2323: Type 'new () => any' is not assignable to type '() => void'. +!!! error TS2322: Type 'new () => any' is not assignable to type '() => void'. bar = foo; // error ~~~ -!!! error TS2323: Type '() => void' is not assignable to type 'new () => any'. \ No newline at end of file +!!! error TS2322: Type '() => void' is not assignable to type 'new () => any'. \ No newline at end of file diff --git a/tests/baselines/reference/callOverloadViaElementAccessExpression.errors.txt b/tests/baselines/reference/callOverloadViaElementAccessExpression.errors.txt index 9c85dad20e9..cc8599ca91f 100644 --- a/tests/baselines/reference/callOverloadViaElementAccessExpression.errors.txt +++ b/tests/baselines/reference/callOverloadViaElementAccessExpression.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/callOverloadViaElementAccessExpression.ts(10,5): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/callOverloadViaElementAccessExpression.ts(11,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/callOverloadViaElementAccessExpression.ts(10,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/callOverloadViaElementAccessExpression.ts(11,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/callOverloadViaElementAccessExpression.ts (2 errors) ==== @@ -14,7 +14,7 @@ tests/cases/compiler/callOverloadViaElementAccessExpression.ts(11,5): error TS23 var c = new C(); var r: string = c['foo'](1); ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var r2: number = c['foo'](''); ~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt index 1f018be434a..35718ca9612 100644 --- a/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt +++ b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt @@ -13,7 +13,7 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWith tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(24,20): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(34,6): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(35,9): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(45,32): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(45,32): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts (16 errors) ==== @@ -91,7 +91,7 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWith ~ !!! error TS1015: Parameter cannot have question mark and initializer. ~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. b: (x?: any = '') => { } ~ !!! error TS1015: Parameter cannot have question mark and initializer. diff --git a/tests/baselines/reference/chainedAssignment1.errors.txt b/tests/baselines/reference/chainedAssignment1.errors.txt index 6c95a2f4362..3fa654c62cc 100644 --- a/tests/baselines/reference/chainedAssignment1.errors.txt +++ b/tests/baselines/reference/chainedAssignment1.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/chainedAssignment1.ts(21,1): error TS2323: Type 'Z' is not assignable to type 'X'. +tests/cases/compiler/chainedAssignment1.ts(21,1): error TS2322: Type 'Z' is not assignable to type 'X'. Property 'a' is missing in type 'Z'. -tests/cases/compiler/chainedAssignment1.ts(21,6): error TS2323: Type 'Z' is not assignable to type 'Y'. +tests/cases/compiler/chainedAssignment1.ts(21,6): error TS2322: Type 'Z' is not assignable to type 'Y'. Property 'a' is missing in type 'Z'. -tests/cases/compiler/chainedAssignment1.ts(22,1): error TS2323: Type 'Z' is not assignable to type 'Y'. +tests/cases/compiler/chainedAssignment1.ts(22,1): error TS2322: Type 'Z' is not assignable to type 'Y'. ==== tests/cases/compiler/chainedAssignment1.ts (3 errors) ==== @@ -28,11 +28,11 @@ tests/cases/compiler/chainedAssignment1.ts(22,1): error TS2323: Type 'Z' is not var c3 = new Z(); c1 = c2 = c3; // a bug made this not report the same error as below ~~ -!!! error TS2323: Type 'Z' is not assignable to type 'X'. -!!! error TS2323: Property 'a' is missing in type 'Z'. +!!! error TS2322: Type 'Z' is not assignable to type 'X'. +!!! error TS2322: Property 'a' is missing in type 'Z'. ~~ -!!! error TS2323: Type 'Z' is not assignable to type 'Y'. -!!! error TS2323: Property 'a' is missing in type 'Z'. +!!! error TS2322: Type 'Z' is not assignable to type 'Y'. +!!! error TS2322: Property 'a' is missing in type 'Z'. c2 = c3; // Error TS111: Cannot convert Z to Y ~~ -!!! error TS2323: Type 'Z' is not assignable to type 'Y'. \ No newline at end of file +!!! error TS2322: Type 'Z' is not assignable to type 'Y'. \ No newline at end of file diff --git a/tests/baselines/reference/chainedAssignment3.errors.txt b/tests/baselines/reference/chainedAssignment3.errors.txt index 1c760f9b37c..8a64a35cbc0 100644 --- a/tests/baselines/reference/chainedAssignment3.errors.txt +++ b/tests/baselines/reference/chainedAssignment3.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/chainedAssignment3.ts(18,1): error TS2323: Type 'A' is not assignable to type 'B'. +tests/cases/compiler/chainedAssignment3.ts(18,1): error TS2322: Type 'A' is not assignable to type 'B'. Property 'value' is missing in type 'A'. -tests/cases/compiler/chainedAssignment3.ts(19,5): error TS2323: Type 'A' is not assignable to type 'B'. +tests/cases/compiler/chainedAssignment3.ts(19,5): error TS2322: Type 'A' is not assignable to type 'B'. ==== tests/cases/compiler/chainedAssignment3.ts (2 errors) ==== @@ -23,11 +23,11 @@ tests/cases/compiler/chainedAssignment3.ts(19,5): error TS2323: Type 'A' is not // error cases b = a = new A(); ~ -!!! error TS2323: Type 'A' is not assignable to type 'B'. -!!! error TS2323: Property 'value' is missing in type 'A'. +!!! error TS2322: Type 'A' is not assignable to type 'B'. +!!! error TS2322: Property 'value' is missing in type 'A'. a = b = new A(); ~ -!!! error TS2323: Type 'A' is not assignable to type 'B'. +!!! error TS2322: Type 'A' is not assignable to type 'B'. \ No newline at end of file diff --git a/tests/baselines/reference/chainedAssignmentChecking.errors.txt b/tests/baselines/reference/chainedAssignmentChecking.errors.txt index 957c088ab52..ac3bade0aae 100644 --- a/tests/baselines/reference/chainedAssignmentChecking.errors.txt +++ b/tests/baselines/reference/chainedAssignmentChecking.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/chainedAssignmentChecking.ts(21,1): error TS2323: Type 'Z' is not assignable to type 'X'. +tests/cases/compiler/chainedAssignmentChecking.ts(21,1): error TS2322: Type 'Z' is not assignable to type 'X'. Property 'a' is missing in type 'Z'. -tests/cases/compiler/chainedAssignmentChecking.ts(21,6): error TS2323: Type 'Z' is not assignable to type 'Y'. +tests/cases/compiler/chainedAssignmentChecking.ts(21,6): error TS2322: Type 'Z' is not assignable to type 'Y'. Property 'a' is missing in type 'Z'. @@ -27,9 +27,9 @@ tests/cases/compiler/chainedAssignmentChecking.ts(21,6): error TS2323: Type 'Z' c1 = c2 = c3; // Should be error ~~ -!!! error TS2323: Type 'Z' is not assignable to type 'X'. -!!! error TS2323: Property 'a' is missing in type 'Z'. +!!! error TS2322: Type 'Z' is not assignable to type 'X'. +!!! error TS2322: Property 'a' is missing in type 'Z'. ~~ -!!! error TS2323: Type 'Z' is not assignable to type 'Y'. -!!! error TS2323: Property 'a' is missing in type 'Z'. +!!! error TS2322: Type 'Z' is not assignable to type 'Y'. +!!! error TS2322: Property 'a' is missing in type 'Z'. \ No newline at end of file diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt index 26df8a15ca0..e307cc9be89 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(7,43): error TS2345: Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'. tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(10,29): error TS2345: Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'. -tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(32,9): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(36,9): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(37,9): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(32,9): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(36,9): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(37,9): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts (5 errors) ==== @@ -43,16 +43,16 @@ tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParamete // Should get an error that we are assigning a string to a number (new Chain2(i)).then(ii => t).then(tt => s).value.x = ""; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. // Staying at T or S should keep the constraint. // Get an error when we assign a string to a number in both cases (new Chain2(i)).then(ii => t).then(tt => t).then(tt => t).then(tt => t).value.x = ""; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. (new Chain2(i)).then(ii => s).then(ss => s).then(ss => s).then(ss => s).value.x = ""; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. return null; } diff --git a/tests/baselines/reference/classImplementsClass2.errors.txt b/tests/baselines/reference/classImplementsClass2.errors.txt index 8287eb92ce7..49eeed75fe0 100644 --- a/tests/baselines/reference/classImplementsClass2.errors.txt +++ b/tests/baselines/reference/classImplementsClass2.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/classImplementsClass2.ts(2,7): error TS2420: Class 'C' incorrectly implements interface 'A'. Property 'foo' is missing in type 'C'. -tests/cases/compiler/classImplementsClass2.ts(13,1): error TS2323: Type 'C' is not assignable to type 'C2'. +tests/cases/compiler/classImplementsClass2.ts(13,1): error TS2322: Type 'C' is not assignable to type 'C2'. Property 'foo' is missing in type 'C'. @@ -22,5 +22,5 @@ tests/cases/compiler/classImplementsClass2.ts(13,1): error TS2323: Type 'C' is n c = c2; c2 = c; ~~ -!!! error TS2323: Type 'C' is not assignable to type 'C2'. -!!! error TS2323: Property 'foo' is missing in type 'C'. \ No newline at end of file +!!! error TS2322: Type 'C' is not assignable to type 'C2'. +!!! error TS2322: Property 'foo' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/classImplementsClass4.errors.txt b/tests/baselines/reference/classImplementsClass4.errors.txt index 2de30155c8d..ecc9d6d8582 100644 --- a/tests/baselines/reference/classImplementsClass4.errors.txt +++ b/tests/baselines/reference/classImplementsClass4.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/classImplementsClass4.ts(5,7): error TS2420: Class 'C' incorrectly implements interface 'A'. Property 'x' is missing in type 'C'. -tests/cases/compiler/classImplementsClass4.ts(16,1): error TS2323: Type 'C' is not assignable to type 'C2'. +tests/cases/compiler/classImplementsClass4.ts(16,1): error TS2322: Type 'C' is not assignable to type 'C2'. Property 'x' is missing in type 'C'. @@ -25,5 +25,5 @@ tests/cases/compiler/classImplementsClass4.ts(16,1): error TS2323: Type 'C' is n c = c2; c2 = c; ~~ -!!! error TS2323: Type 'C' is not assignable to type 'C2'. -!!! error TS2323: Property 'x' is missing in type 'C'. \ No newline at end of file +!!! error TS2322: Type 'C' is not assignable to type 'C2'. +!!! error TS2322: Property 'x' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/classImplementsClass5.errors.txt b/tests/baselines/reference/classImplementsClass5.errors.txt index 6b5533e65f1..076120fdbaf 100644 --- a/tests/baselines/reference/classImplementsClass5.errors.txt +++ b/tests/baselines/reference/classImplementsClass5.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/classImplementsClass5.ts(5,7): error TS2420: Class 'C' incorrectly implements interface 'A'. Types have separate declarations of a private property 'x'. -tests/cases/compiler/classImplementsClass5.ts(16,1): error TS2323: Type 'C2' is not assignable to type 'C'. +tests/cases/compiler/classImplementsClass5.ts(16,1): error TS2322: Type 'C2' is not assignable to type 'C'. Types have separate declarations of a private property 'x'. -tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2323: Type 'C' is not assignable to type 'C2'. +tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2322: Type 'C' is not assignable to type 'C2'. Types have separate declarations of a private property 'x'. @@ -27,9 +27,9 @@ tests/cases/compiler/classImplementsClass5.ts(17,1): error TS2323: Type 'C' is n var c2: C2; c = c2; ~ -!!! error TS2323: Type 'C2' is not assignable to type 'C'. -!!! error TS2323: Types have separate declarations of a private property 'x'. +!!! error TS2322: Type 'C2' is not assignable to type 'C'. +!!! error TS2322: Types have separate declarations of a private property 'x'. c2 = c; ~~ -!!! error TS2323: Type 'C' is not assignable to type 'C2'. -!!! error TS2323: Types have separate declarations of a private property 'x'. \ No newline at end of file +!!! error TS2322: Type 'C' is not assignable to type 'C2'. +!!! error TS2322: Types have separate declarations of a private property 'x'. \ No newline at end of file diff --git a/tests/baselines/reference/classMemberInitializerScoping.errors.txt b/tests/baselines/reference/classMemberInitializerScoping.errors.txt index 7df3c0518b6..dddc7a82a3f 100644 --- a/tests/baselines/reference/classMemberInitializerScoping.errors.txt +++ b/tests/baselines/reference/classMemberInitializerScoping.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/classMemberInitializerScoping.ts(3,17): error TS2301: Initializer of instance member variable 'y' cannot reference identifier 'aaa' declared in the constructor. -tests/cases/compiler/classMemberInitializerScoping.ts(6,9): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/classMemberInitializerScoping.ts(6,9): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/classMemberInitializerScoping.ts (2 errors) ==== @@ -12,7 +12,7 @@ tests/cases/compiler/classMemberInitializerScoping.ts(6,9): error TS2323: Type ' constructor(aaa) { this.y = ''; // was: error, cannot assign string to number ~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. } } diff --git a/tests/baselines/reference/classSideInheritance3.errors.txt b/tests/baselines/reference/classSideInheritance3.errors.txt index 48d7165adcd..c845defa5b8 100644 --- a/tests/baselines/reference/classSideInheritance3.errors.txt +++ b/tests/baselines/reference/classSideInheritance3.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/classSideInheritance3.ts(16,5): error TS2323: Type 'typeof B' is not assignable to type 'typeof A'. -tests/cases/compiler/classSideInheritance3.ts(17,5): error TS2323: Type 'typeof B' is not assignable to type 'new (x: string) => A'. +tests/cases/compiler/classSideInheritance3.ts(16,5): error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. +tests/cases/compiler/classSideInheritance3.ts(17,5): error TS2322: Type 'typeof B' is not assignable to type 'new (x: string) => A'. ==== tests/cases/compiler/classSideInheritance3.ts (2 errors) ==== @@ -20,8 +20,8 @@ tests/cases/compiler/classSideInheritance3.ts(17,5): error TS2323: Type 'typeof var r1: typeof A = B; // error ~~ -!!! error TS2323: Type 'typeof B' is not assignable to type 'typeof A'. +!!! error TS2322: Type 'typeof B' is not assignable to type 'typeof A'. var r2: new (x: string) => A = B; // error ~~ -!!! error TS2323: Type 'typeof B' is not assignable to type 'new (x: string) => A'. +!!! error TS2322: Type 'typeof B' is not assignable to type 'new (x: string) => A'. var r3: typeof A = C; // ok \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt b/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt index 5d0d67067e5..ecf7e5ed1dc 100644 --- a/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt +++ b/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(10,1): error TS2323: Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(11,1): error TS2323: Type 'number' is not assignable to type 'boolean'. -tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(13,1): error TS2323: Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(14,1): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(16,1): error TS2323: Type 'boolean' is not assignable to type 'string'. -tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(17,1): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(10,1): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(11,1): error TS2322: Type 'number' is not assignable to type 'boolean'. +tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(13,1): error TS2322: Type 'boolean' is not assignable to type 'number'. +tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(14,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(16,1): error TS2322: Type 'boolean' is not assignable to type 'string'. +tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(17,1): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts (6 errors) ==== @@ -18,22 +18,22 @@ tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignment //Expect errors when the results type is different form the second operand resultIsBoolean = (BOOLEAN, STRING); ~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. resultIsBoolean = (BOOLEAN, NUMBER); ~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'boolean'. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. resultIsNumber = (NUMBER, BOOLEAN); ~~~~~~~~~~~~~~ -!!! error TS2323: Type 'boolean' is not assignable to type 'number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. resultIsNumber = (NUMBER, STRING); ~~~~~~~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. resultIsString = (STRING, BOOLEAN); ~~~~~~~~~~~~~~ -!!! error TS2323: Type 'boolean' is not assignable to type 'string'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string'. resultIsString = (STRING, NUMBER); ~~~~~~~~~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt b/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt index 75cd76e407e..32e8464a195 100644 --- a/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt +++ b/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(6,5): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(12,9): error TS2323: Type 'T2' is not assignable to type 'T1'. +tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(6,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(12,9): error TS2322: Type 'T2' is not assignable to type 'T1'. ==== tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts (2 errors) ==== @@ -10,7 +10,7 @@ tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOpera } var resultIsString: number = foo(1, "123"); //error here ~~~~~~~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. //TypeParameters function foo1() { @@ -18,5 +18,5 @@ tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOpera var y: T2; var result: T1 = (x, y); //error here ~~~~~~ -!!! error TS2323: Type 'T2' is not assignable to type 'T1'. +!!! error TS2322: Type 'T2' is not assignable to type 'T1'. } \ No newline at end of file diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt b/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt index bedfb8deba3..535e4eb1a30 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(5,1): error TS2323: Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(8,1): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(11,1): error TS2323: Type 'string' is not assignable to type 'E'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(14,1): error TS2323: Type 'string' is not assignable to type '{ a: string; }'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(5,1): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(8,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(11,1): error TS2322: Type 'string' is not assignable to type 'E'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(14,1): error TS2322: Type 'string' is not assignable to type '{ a: string; }'. Property 'a' is missing in type 'String'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(17,1): error TS2323: Type 'string' is not assignable to type 'void'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(17,1): error TS2322: Type 'string' is not assignable to type 'void'. ==== tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts (5 errors) ==== @@ -13,25 +13,25 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen var x1: boolean; x1 += ''; ~~ -!!! error TS2323: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. var x2: number; x2 += ''; ~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var x3: E; x3 += ''; ~~ -!!! error TS2323: Type 'string' is not assignable to type 'E'. +!!! error TS2322: Type 'string' is not assignable to type 'E'. var x4: {a: string}; x4 += ''; ~~ -!!! error TS2323: Type 'string' is not assignable to type '{ a: string; }'. -!!! error TS2323: Property 'a' is missing in type 'String'. +!!! error TS2322: Type 'string' is not assignable to type '{ a: string; }'. +!!! error TS2322: Property 'a' is missing in type 'String'. var x5: void; x5 += ''; ~~ -!!! error TS2323: Type 'string' is not assignable to type 'void'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'void'. \ No newline at end of file diff --git a/tests/baselines/reference/conditionalExpression1.errors.txt b/tests/baselines/reference/conditionalExpression1.errors.txt index 35066561a38..0e291986785 100644 --- a/tests/baselines/reference/conditionalExpression1.errors.txt +++ b/tests/baselines/reference/conditionalExpression1.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/conditionalExpression1.ts(1,5): error TS2323: Type 'string | number' is not assignable to type 'boolean'. +tests/cases/compiler/conditionalExpression1.ts(1,5): error TS2322: Type 'string | number' is not assignable to type 'boolean'. Type 'string' is not assignable to type 'boolean'. ==== tests/cases/compiler/conditionalExpression1.ts (1 errors) ==== var x: boolean = (true ? 1 : ""); // should be an error ~ -!!! error TS2323: Type 'string | number' is not assignable to type 'boolean'. -!!! error TS2323: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt index 27c08308c33..954e8af856f 100644 --- a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt +++ b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt @@ -1,16 +1,16 @@ -tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(15,5): error TS2323: Type 'A | B' is not assignable to type 'A'. +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(15,5): error TS2322: Type 'A | B' is not assignable to type 'A'. Type 'B' is not assignable to type 'A'. Property 'propertyA' is missing in type 'B'. -tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(16,5): error TS2323: Type 'A | B' is not assignable to type 'B'. +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(16,5): error TS2322: Type 'A | B' is not assignable to type 'B'. Type 'A' is not assignable to type 'B'. Property 'propertyB' is missing in type 'A'. -tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(18,5): error TS2323: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number'. +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(18,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number'. Type '(n: X) => string' is not assignable to type '(t: X) => number'. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(19,5): error TS2323: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string'. +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(19,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string'. Type '(m: X) => number' is not assignable to type '(t: X) => string'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(20,5): error TS2323: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean'. +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithoutIdenticalBCT.ts(20,5): error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean'. Type '(m: X) => number' is not assignable to type '(t: X) => boolean'. Type 'number' is not assignable to type 'boolean'. @@ -32,27 +32,27 @@ tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithou //Be contextually typed and and bct is not identical, results in errors that union type is not assignable to target var result2: A = true ? a : b; ~~~~~~~ -!!! error TS2323: Type 'A | B' is not assignable to type 'A'. -!!! error TS2323: Type 'B' is not assignable to type 'A'. -!!! error TS2323: Property 'propertyA' is missing in type 'B'. +!!! error TS2322: Type 'A | B' is not assignable to type 'A'. +!!! error TS2322: Type 'B' is not assignable to type 'A'. +!!! error TS2322: Property 'propertyA' is missing in type 'B'. var result3: B = true ? a : b; ~~~~~~~ -!!! error TS2323: Type 'A | B' is not assignable to type 'B'. -!!! error TS2323: Type 'A' is not assignable to type 'B'. -!!! error TS2323: Property 'propertyB' is missing in type 'A'. +!!! error TS2322: Type 'A | B' is not assignable to type 'B'. +!!! error TS2322: Type 'A' is not assignable to type 'B'. +!!! error TS2322: Property 'propertyB' is missing in type 'A'. var result4: (t: X) => number = true ? (m) => m.propertyX1 : (n) => n.propertyX2; ~~~~~~~ -!!! error TS2323: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number'. -!!! error TS2323: Type '(n: X) => string' is not assignable to type '(t: X) => number'. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => number'. +!!! error TS2322: Type '(n: X) => string' is not assignable to type '(t: X) => number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var result5: (t: X) => string = true ? (m) => m.propertyX1 : (n) => n.propertyX2; ~~~~~~~ -!!! error TS2323: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string'. -!!! error TS2323: Type '(m: X) => number' is not assignable to type '(t: X) => string'. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => string'. +!!! error TS2322: Type '(m: X) => number' is not assignable to type '(t: X) => string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var result6: (t: X) => boolean = true ? (m) => m.propertyX1 : (n) => n.propertyX2; ~~~~~~~ -!!! error TS2323: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean'. -!!! error TS2323: Type '(m: X) => number' is not assignable to type '(t: X) => boolean'. -!!! error TS2323: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2322: Type '((m: X) => number) | ((n: X) => string)' is not assignable to type '(t: X) => boolean'. +!!! error TS2322: Type '(m: X) => number' is not assignable to type '(t: X) => boolean'. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/constEnumDeclarations.js b/tests/baselines/reference/constEnumDeclarations.js new file mode 100644 index 00000000000..1cbacb13bbd --- /dev/null +++ b/tests/baselines/reference/constEnumDeclarations.js @@ -0,0 +1,28 @@ +//// [constEnumDeclarations.ts] + +const enum E { + A = 1, + B = 2, + C = A | B +} + +const enum E2 { + A = 1, + B, + C +} + +//// [constEnumDeclarations.js] + + +//// [constEnumDeclarations.d.ts] +declare const enum E { + A = 1, + B = 2, + C = 3, +} +declare const enum E2 { + A = 1, + B = 2, + C = 3, +} diff --git a/tests/baselines/reference/constEnumDeclarations.types b/tests/baselines/reference/constEnumDeclarations.types new file mode 100644 index 00000000000..9dc87eadef7 --- /dev/null +++ b/tests/baselines/reference/constEnumDeclarations.types @@ -0,0 +1,30 @@ +=== tests/cases/compiler/constEnumDeclarations.ts === + +const enum E { +>E : E + + A = 1, +>A : E + + B = 2, +>B : E + + C = A | B +>C : E +>A | B : number +>A : E +>B : E +} + +const enum E2 { +>E2 : E2 + + A = 1, +>A : E2 + + B, +>B : E2 + + C +>C : E2 +} diff --git a/tests/baselines/reference/constEnumErrors.errors.txt b/tests/baselines/reference/constEnumErrors.errors.txt new file mode 100644 index 00000000000..541f814af98 --- /dev/null +++ b/tests/baselines/reference/constEnumErrors.errors.txt @@ -0,0 +1,85 @@ +tests/cases/compiler/constEnumErrors.ts(1,12): error TS2300: Duplicate identifier 'E'. +tests/cases/compiler/constEnumErrors.ts(5,8): error TS2300: Duplicate identifier 'E'. +tests/cases/compiler/constEnumErrors.ts(12,9): error TS4083: In 'const' enum declarations member initializer must be constant expression. +tests/cases/compiler/constEnumErrors.ts(14,9): error TS4083: In 'const' enum declarations member initializer must be constant expression. +tests/cases/compiler/constEnumErrors.ts(15,10): error TS4083: In 'const' enum declarations member initializer must be constant expression. +tests/cases/compiler/constEnumErrors.ts(22,13): error TS4085: Index expression arguments in 'const' enums must be of type 'string'. +tests/cases/compiler/constEnumErrors.ts(24,13): error TS4085: Index expression arguments in 'const' enums must be of type 'string'. +tests/cases/compiler/constEnumErrors.ts(26,9): error TS4084: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. +tests/cases/compiler/constEnumErrors.ts(27,10): error TS4084: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. +tests/cases/compiler/constEnumErrors.ts(32,5): error TS4084: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. +tests/cases/compiler/constEnumErrors.ts(40,9): error TS4086: 'const' enum member initializer was evaluated to a non-finite value. +tests/cases/compiler/constEnumErrors.ts(41,9): error TS4086: 'const' enum member initializer was evaluated to a non-finite value. +tests/cases/compiler/constEnumErrors.ts(42,9): error TS4087: 'const' enum member initializer was evaluated to disallowed value 'NaN'. + + +==== tests/cases/compiler/constEnumErrors.ts (13 errors) ==== + const enum E { + ~ +!!! error TS2300: Duplicate identifier 'E'. + A + } + + module E { + ~ +!!! error TS2300: Duplicate identifier 'E'. + var x = 1; + } + + const enum E1 { + // illegal case + // forward reference to the element of the same enum + X = Y, + ~ +!!! error TS4083: In 'const' enum declarations member initializer must be constant expression. + // forward reference to the element of the same enum + Y = E1.Z, + ~~~~ +!!! error TS4083: In 'const' enum declarations member initializer must be constant expression. + Y1 = E1["Z"] + ~~~~~~~ +!!! error TS4083: In 'const' enum declarations member initializer must be constant expression. + } + + const enum E2 { + A + } + + var y0 = E2[1] + ~ +!!! error TS4085: Index expression arguments in 'const' enums must be of type 'string'. + var name = "A"; + var y1 = E2[name]; + ~~~~ +!!! error TS4085: Index expression arguments in 'const' enums must be of type 'string'. + + var x = E2; + ~~ +!!! error TS4084: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. + var y = [E2]; + ~~ +!!! error TS4084: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. + + function foo(t: any): void { + } + + foo(E2); + ~~ +!!! error TS4084: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. + + const enum NaNOrInfinity { + A = 9007199254740992, + B = A * A, + C = B * B, + D = C * C, + E = D * D, + F = E * E, // overflow + ~~~~~ +!!! error TS4086: 'const' enum member initializer was evaluated to a non-finite value. + G = 1 / 0, // overflow + ~~~~~ +!!! error TS4086: 'const' enum member initializer was evaluated to a non-finite value. + H = 0 / 0 // NaN + ~~~~~ +!!! error TS4087: 'const' enum member initializer was evaluated to disallowed value 'NaN'. + } \ No newline at end of file diff --git a/tests/baselines/reference/constEnumExternalModule.js b/tests/baselines/reference/constEnumExternalModule.js new file mode 100644 index 00000000000..4054ba788cb --- /dev/null +++ b/tests/baselines/reference/constEnumExternalModule.js @@ -0,0 +1,19 @@ +//// [tests/cases/compiler/constEnumExternalModule.ts] //// + +//// [m1.ts] +const enum E { + V = 100 +} + +export = E +//// [m2.ts] +import A = require('m1') +var v = A.V; + +//// [m1.js] +define(["require", "exports"], function (require, exports) { +}); +//// [m2.js] +define(["require", "exports"], function (require, exports) { + var v = 100 /* V */; +}); diff --git a/tests/baselines/reference/constEnumExternalModule.types b/tests/baselines/reference/constEnumExternalModule.types new file mode 100644 index 00000000000..9c7b43a24d4 --- /dev/null +++ b/tests/baselines/reference/constEnumExternalModule.types @@ -0,0 +1,21 @@ +=== tests/cases/compiler/m2.ts === +import A = require('m1') +>A : typeof A + +var v = A.V; +>v : A +>A.V : A +>A : typeof A +>V : A + +=== tests/cases/compiler/m1.ts === +const enum E { +>E : E + + V = 100 +>V : E +} + +export = E +>E : E + diff --git a/tests/baselines/reference/constEnums.js b/tests/baselines/reference/constEnums.js new file mode 100644 index 00000000000..4f85cc59d0e --- /dev/null +++ b/tests/baselines/reference/constEnums.js @@ -0,0 +1,223 @@ +//// [constEnums.ts] +const enum Enum1 { + A0 = 100, +} + +const enum Enum1 { + // correct cases + A, + B, + C = 10, + D = A | B, + E = A | 1, + F = 1 | A, + G = (1 & 1), + H = ~(A | B), + I = A >>> 1, + J = 1 & A, + K = ~(1 | 5), + L = ~D, + M = E << B, + N = E << 1, + O = E >> B, + P = E >> 1, + Q = -D, + R = C & 5, + S = 5 & C, + T = C | D, + U = C | 1, + V = 10 | D, + W = Enum1.V, + + // correct cases: reference to the enum member from different enum declaration + W1 = A0, + W2 = Enum1.A0, + W3 = Enum1["A0"], + W4 = Enum1["W"], +} + + +module A { + export module B { + export module C { + export const enum E { + V1 = 1, + V2 = A.B.C.E.V1 | 100 + } + } + } +} + +module A { + export module B { + export module C { + export const enum E { + V3 = A.B.C.E["V2"] & 200, + } + } + } +} + +module A1 { + export module B { + export module C { + export const enum E { + V1 = 10, + V2 = 110, + } + } + } +} + +module A2 { + export module B { + export module C { + export const enum E { + V1 = 10, + V2 = 110, + } + } + // module C will be classified as value + export module C { + var x = 1 + } + } +} + +import I = A.B.C.E; +import I1 = A1.B; +import I2 = A2.B; + +function foo0(e: I): void { + if (e === I.V1) { + } + else if (e === I.V2) { + } +} + +function foo1(e: I1.C.E): void { + if (e === I1.C.E.V1) { + } + else if (e === I1.C.E.V2) { + } +} + +function foo2(e: I2.C.E): void { + if (e === I2.C.E.V1) { + } + else if (e === I2.C.E.V2) { + } +} + + +function foo(x: Enum1) { + switch (x) { + case Enum1.A: + case Enum1.B: + case Enum1.C: + case Enum1.D: + case Enum1.E: + case Enum1.F: + case Enum1.G: + case Enum1.H: + case Enum1.I: + case Enum1.J: + case Enum1.K: + case Enum1.L: + case Enum1.M: + case Enum1.N: + case Enum1.O: + case Enum1.P: + case Enum1.Q: + case Enum1.R: + case Enum1.S: + case Enum1["T"]: + case Enum1.U: + case Enum1.V: + case Enum1.W: + case Enum1.W1: + case Enum1.W2: + case Enum1.W3: + case Enum1.W4: + break; + } +} + +function bar(e: A.B.C.E): number { + switch (e) { + case A.B.C.E.V1: return 1; + case A.B.C.E.V2: return 1; + case A.B.C.E.V3: return 1; + } +} + +//// [constEnums.js] +var A2; +(function (A2) { + var B; + (function (B) { + // module C will be classified as value + var C; + (function (C) { + var x = 1; + })(C = B.C || (B.C = {})); + })(B = A2.B || (A2.B = {})); +})(A2 || (A2 = {})); +var I2 = A2.B; +function foo0(e) { + if (e === 1 /* V1 */) { + } + else if (e === 101 /* V2 */) { + } +} +function foo1(e) { + if (e === 10 /* V1 */) { + } + else if (e === 110 /* V2 */) { + } +} +function foo2(e) { + if (e === 10 /* V1 */) { + } + else if (e === 110 /* V2 */) { + } +} +function foo(x) { + switch (x) { + case 0 /* A */: + case 1 /* B */: + case 10 /* C */: + case 1 /* D */: + case 1 /* E */: + case 1 /* F */: + case 1 /* G */: + case -2 /* H */: + case 0 /* I */: + case 0 /* J */: + case -6 /* K */: + case -2 /* L */: + case 2 /* M */: + case 2 /* N */: + case 0 /* O */: + case 0 /* P */: + case -1 /* Q */: + case 0 /* R */: + case 0 /* S */: + case 11 /* "T" */: + case 11 /* U */: + case 11 /* V */: + case 11 /* W */: + case 100 /* W1 */: + case 100 /* W2 */: + case 100 /* W3 */: + case 11 /* W4 */: + break; + } +} +function bar(e) { + switch (e) { + case 1 /* V1 */: return 1; + case 101 /* V2 */: return 1; + case 64 /* V3 */: return 1; + } +} diff --git a/tests/baselines/reference/constEnums.types b/tests/baselines/reference/constEnums.types new file mode 100644 index 00000000000..396b2e1c32b --- /dev/null +++ b/tests/baselines/reference/constEnums.types @@ -0,0 +1,556 @@ +=== tests/cases/compiler/constEnums.ts === +const enum Enum1 { +>Enum1 : Enum1 + + A0 = 100, +>A0 : Enum1 +} + +const enum Enum1 { +>Enum1 : Enum1 + + // correct cases + A, +>A : Enum1 + + B, +>B : Enum1 + + C = 10, +>C : Enum1 + + D = A | B, +>D : Enum1 +>A | B : number +>A : Enum1 +>B : Enum1 + + E = A | 1, +>E : Enum1 +>A | 1 : number +>A : Enum1 + + F = 1 | A, +>F : Enum1 +>1 | A : number +>A : Enum1 + + G = (1 & 1), +>G : Enum1 +>(1 & 1) : number +>1 & 1 : number + + H = ~(A | B), +>H : Enum1 +>~(A | B) : number +>(A | B) : number +>A | B : number +>A : Enum1 +>B : Enum1 + + I = A >>> 1, +>I : Enum1 +>A >>> 1 : number +>A : Enum1 + + J = 1 & A, +>J : Enum1 +>1 & A : number +>A : Enum1 + + K = ~(1 | 5), +>K : Enum1 +>~(1 | 5) : number +>(1 | 5) : number +>1 | 5 : number + + L = ~D, +>L : Enum1 +>~D : number +>D : Enum1 + + M = E << B, +>M : Enum1 +>E << B : number +>E : Enum1 +>B : Enum1 + + N = E << 1, +>N : Enum1 +>E << 1 : number +>E : Enum1 + + O = E >> B, +>O : Enum1 +>E >> B : number +>E : Enum1 +>B : Enum1 + + P = E >> 1, +>P : Enum1 +>E >> 1 : number +>E : Enum1 + + Q = -D, +>Q : Enum1 +>-D : number +>D : Enum1 + + R = C & 5, +>R : Enum1 +>C & 5 : number +>C : Enum1 + + S = 5 & C, +>S : Enum1 +>5 & C : number +>C : Enum1 + + T = C | D, +>T : Enum1 +>C | D : number +>C : Enum1 +>D : Enum1 + + U = C | 1, +>U : Enum1 +>C | 1 : number +>C : Enum1 + + V = 10 | D, +>V : Enum1 +>10 | D : number +>D : Enum1 + + W = Enum1.V, +>W : Enum1 +>Enum1.V : Enum1 +>Enum1 : typeof Enum1 +>V : Enum1 + + // correct cases: reference to the enum member from different enum declaration + W1 = A0, +>W1 : Enum1 +>A0 : Enum1 + + W2 = Enum1.A0, +>W2 : Enum1 +>Enum1.A0 : Enum1 +>Enum1 : typeof Enum1 +>A0 : Enum1 + + W3 = Enum1["A0"], +>W3 : Enum1 +>Enum1["A0"] : Enum1 +>Enum1 : typeof Enum1 + + W4 = Enum1["W"], +>W4 : Enum1 +>Enum1["W"] : Enum1 +>Enum1 : typeof Enum1 +} + + +module A { +>A : typeof A + + export module B { +>B : typeof B + + export module C { +>C : typeof C + + export const enum E { +>E : E + + V1 = 1, +>V1 : E + + V2 = A.B.C.E.V1 | 100 +>V2 : E +>A.B.C.E.V1 | 100 : number +>A.B.C.E.V1 : E +>A.B.C.E : typeof E +>A.B.C : typeof C +>A.B : typeof B +>A : typeof A +>B : typeof B +>C : typeof C +>E : typeof E +>V1 : E + } + } + } +} + +module A { +>A : typeof A + + export module B { +>B : typeof B + + export module C { +>C : typeof C + + export const enum E { +>E : E + + V3 = A.B.C.E["V2"] & 200, +>V3 : E +>A.B.C.E["V2"] & 200 : number +>A.B.C.E["V2"] : E +>A.B.C.E : typeof E +>A.B.C : typeof C +>A.B : typeof B +>A : typeof A +>B : typeof B +>C : typeof C +>E : typeof E + } + } + } +} + +module A1 { +>A1 : typeof A1 + + export module B { +>B : typeof B + + export module C { +>C : typeof C + + export const enum E { +>E : E + + V1 = 10, +>V1 : E + + V2 = 110, +>V2 : E + } + } + } +} + +module A2 { +>A2 : typeof A2 + + export module B { +>B : typeof B + + export module C { +>C : typeof C + + export const enum E { +>E : E + + V1 = 10, +>V1 : E + + V2 = 110, +>V2 : E + } + } + // module C will be classified as value + export module C { +>C : typeof C + + var x = 1 +>x : number + } + } +} + +import I = A.B.C.E; +>I : typeof I +>A : typeof A +>B : typeof A.B +>C : typeof A.B.C +>E : I + +import I1 = A1.B; +>I1 : typeof I1 +>A1 : typeof A1 +>B : typeof I1 + +import I2 = A2.B; +>I2 : typeof I2 +>A2 : typeof A2 +>B : typeof I2 + +function foo0(e: I): void { +>foo0 : (e: I) => void +>e : I +>I : I + + if (e === I.V1) { +>e === I.V1 : boolean +>e : I +>I.V1 : I +>I : typeof I +>V1 : I + } + else if (e === I.V2) { +>e === I.V2 : boolean +>e : I +>I.V2 : I +>I : typeof I +>V2 : I + } +} + +function foo1(e: I1.C.E): void { +>foo1 : (e: I1.C.E) => void +>e : I1.C.E +>I1 : unknown +>C : unknown +>E : I1.C.E + + if (e === I1.C.E.V1) { +>e === I1.C.E.V1 : boolean +>e : I1.C.E +>I1.C.E.V1 : I1.C.E +>I1.C.E : typeof I1.C.E +>I1.C : typeof I1.C +>I1 : typeof I1 +>C : typeof I1.C +>E : typeof I1.C.E +>V1 : I1.C.E + } + else if (e === I1.C.E.V2) { +>e === I1.C.E.V2 : boolean +>e : I1.C.E +>I1.C.E.V2 : I1.C.E +>I1.C.E : typeof I1.C.E +>I1.C : typeof I1.C +>I1 : typeof I1 +>C : typeof I1.C +>E : typeof I1.C.E +>V2 : I1.C.E + } +} + +function foo2(e: I2.C.E): void { +>foo2 : (e: I2.C.E) => void +>e : I2.C.E +>I2 : unknown +>C : unknown +>E : I2.C.E + + if (e === I2.C.E.V1) { +>e === I2.C.E.V1 : boolean +>e : I2.C.E +>I2.C.E.V1 : I2.C.E +>I2.C.E : typeof I2.C.E +>I2.C : typeof I2.C +>I2 : typeof I2 +>C : typeof I2.C +>E : typeof I2.C.E +>V1 : I2.C.E + } + else if (e === I2.C.E.V2) { +>e === I2.C.E.V2 : boolean +>e : I2.C.E +>I2.C.E.V2 : I2.C.E +>I2.C.E : typeof I2.C.E +>I2.C : typeof I2.C +>I2 : typeof I2 +>C : typeof I2.C +>E : typeof I2.C.E +>V2 : I2.C.E + } +} + + +function foo(x: Enum1) { +>foo : (x: Enum1) => void +>x : Enum1 +>Enum1 : Enum1 + + switch (x) { +>x : Enum1 + + case Enum1.A: +>Enum1.A : Enum1 +>Enum1 : typeof Enum1 +>A : Enum1 + + case Enum1.B: +>Enum1.B : Enum1 +>Enum1 : typeof Enum1 +>B : Enum1 + + case Enum1.C: +>Enum1.C : Enum1 +>Enum1 : typeof Enum1 +>C : Enum1 + + case Enum1.D: +>Enum1.D : Enum1 +>Enum1 : typeof Enum1 +>D : Enum1 + + case Enum1.E: +>Enum1.E : Enum1 +>Enum1 : typeof Enum1 +>E : Enum1 + + case Enum1.F: +>Enum1.F : Enum1 +>Enum1 : typeof Enum1 +>F : Enum1 + + case Enum1.G: +>Enum1.G : Enum1 +>Enum1 : typeof Enum1 +>G : Enum1 + + case Enum1.H: +>Enum1.H : Enum1 +>Enum1 : typeof Enum1 +>H : Enum1 + + case Enum1.I: +>Enum1.I : Enum1 +>Enum1 : typeof Enum1 +>I : Enum1 + + case Enum1.J: +>Enum1.J : Enum1 +>Enum1 : typeof Enum1 +>J : Enum1 + + case Enum1.K: +>Enum1.K : Enum1 +>Enum1 : typeof Enum1 +>K : Enum1 + + case Enum1.L: +>Enum1.L : Enum1 +>Enum1 : typeof Enum1 +>L : Enum1 + + case Enum1.M: +>Enum1.M : Enum1 +>Enum1 : typeof Enum1 +>M : Enum1 + + case Enum1.N: +>Enum1.N : Enum1 +>Enum1 : typeof Enum1 +>N : Enum1 + + case Enum1.O: +>Enum1.O : Enum1 +>Enum1 : typeof Enum1 +>O : Enum1 + + case Enum1.P: +>Enum1.P : Enum1 +>Enum1 : typeof Enum1 +>P : Enum1 + + case Enum1.Q: +>Enum1.Q : Enum1 +>Enum1 : typeof Enum1 +>Q : Enum1 + + case Enum1.R: +>Enum1.R : Enum1 +>Enum1 : typeof Enum1 +>R : Enum1 + + case Enum1.S: +>Enum1.S : Enum1 +>Enum1 : typeof Enum1 +>S : Enum1 + + case Enum1["T"]: +>Enum1["T"] : Enum1 +>Enum1 : typeof Enum1 + + case Enum1.U: +>Enum1.U : Enum1 +>Enum1 : typeof Enum1 +>U : Enum1 + + case Enum1.V: +>Enum1.V : Enum1 +>Enum1 : typeof Enum1 +>V : Enum1 + + case Enum1.W: +>Enum1.W : Enum1 +>Enum1 : typeof Enum1 +>W : Enum1 + + case Enum1.W1: +>Enum1.W1 : Enum1 +>Enum1 : typeof Enum1 +>W1 : Enum1 + + case Enum1.W2: +>Enum1.W2 : Enum1 +>Enum1 : typeof Enum1 +>W2 : Enum1 + + case Enum1.W3: +>Enum1.W3 : Enum1 +>Enum1 : typeof Enum1 +>W3 : Enum1 + + case Enum1.W4: +>Enum1.W4 : Enum1 +>Enum1 : typeof Enum1 +>W4 : Enum1 + + break; + } +} + +function bar(e: A.B.C.E): number { +>bar : (e: I) => number +>e : I +>A : unknown +>B : unknown +>C : unknown +>E : I + + switch (e) { +>e : I + + case A.B.C.E.V1: return 1; +>A.B.C.E.V1 : I +>A.B.C.E : typeof I +>A.B.C : typeof A.B.C +>A.B : typeof A.B +>A : typeof A +>B : typeof A.B +>C : typeof A.B.C +>E : typeof I +>V1 : I + + case A.B.C.E.V2: return 1; +>A.B.C.E.V2 : I +>A.B.C.E : typeof I +>A.B.C : typeof A.B.C +>A.B : typeof A.B +>A : typeof A +>B : typeof A.B +>C : typeof A.B.C +>E : typeof I +>V2 : I + + case A.B.C.E.V3: return 1; +>A.B.C.E.V3 : I +>A.B.C.E : typeof I +>A.B.C : typeof A.B.C +>A.B : typeof A.B +>A : typeof A +>B : typeof A.B +>C : typeof A.B.C +>E : typeof I +>V3 : I + } +} diff --git a/tests/baselines/reference/constructorAsType.errors.txt b/tests/baselines/reference/constructorAsType.errors.txt index ca17d41623d..b0d30295cde 100644 --- a/tests/baselines/reference/constructorAsType.errors.txt +++ b/tests/baselines/reference/constructorAsType.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/constructorAsType.ts(1,5): error TS2323: Type '() => { name: string; }' is not assignable to type 'new () => { name: string; }'. +tests/cases/compiler/constructorAsType.ts(1,5): error TS2322: Type '() => { name: string; }' is not assignable to type 'new () => { name: string; }'. ==== tests/cases/compiler/constructorAsType.ts (1 errors) ==== var Person:new () => {name: string;} = function () {return {name:"joe"};}; ~~~~~~ -!!! error TS2323: Type '() => { name: string; }' is not assignable to type 'new () => { name: string; }'. +!!! error TS2322: Type '() => { name: string; }' is not assignable to type 'new () => { name: string; }'. var Person2:{new() : {name:string;};}; diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt b/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt index c241aa8096d..2fb24c0d5d8 100644 --- a/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(3,17): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(10,17): error TS2323: Type 'number' is not assignable to type 'T'. -tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(10,27): error TS2323: Type 'T' is not assignable to type 'U'. -tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(17,17): error TS2323: Type 'Date' is not assignable to type 'T'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(3,17): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(10,17): error TS2322: Type 'number' is not assignable to type 'T'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(10,27): error TS2322: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(17,17): error TS2322: Type 'Date' is not assignable to type 'T'. ==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts (4 errors) ==== @@ -9,7 +9,7 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co constructor(x); constructor(public x: string = 1) { // error ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var y = x; } } @@ -18,9 +18,9 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co constructor(x: T, y: U); constructor(x: T = 1, public y: U = x) { // error ~~~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'T'. +!!! error TS2322: Type 'number' is not assignable to type 'T'. ~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. var z = x; } } @@ -29,7 +29,7 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co constructor(x); constructor(x: T = new Date()) { // error ~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'Date' is not assignable to type 'T'. +!!! error TS2322: Type 'Date' is not assignable to type 'T'. var y = x; } } \ No newline at end of file diff --git a/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt b/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt index 8bb04c59554..87af1b85f2d 100644 --- a/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt +++ b/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterShadowsOuterScopes.ts(8,9): error TS2301: Initializer of instance member variable 'b' cannot reference identifier 'x' declared in the constructor. -tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterShadowsOuterScopes.ts(10,9): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterShadowsOuterScopes.ts(10,9): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterShadowsOuterScopes.ts(16,9): error TS2301: Initializer of instance member variable 'b' cannot reference identifier 'y' declared in the constructor. @@ -17,7 +17,7 @@ tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterS constructor(x: string) { x = 2; // error, x is string ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. } } diff --git a/tests/baselines/reference/contextualTypeWithTuple.errors.txt b/tests/baselines/reference/contextualTypeWithTuple.errors.txt index d093e176455..875d7b5e20a 100644 --- a/tests/baselines/reference/contextualTypeWithTuple.errors.txt +++ b/tests/baselines/reference/contextualTypeWithTuple.errors.txt @@ -1,17 +1,17 @@ -tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(3,5): error TS2323: Type '[number, string, boolean]' is not assignable to type '[number, string]'. +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(3,5): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. Types of property 'pop' are incompatible. Type '() => string | number | boolean' is not assignable to type '() => string | number'. Type 'string | number | boolean' is not assignable to type 'string | number'. Type 'boolean' is not assignable to type 'string | number'. Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(8,1): error TS2323: Type '[number, string, boolean]' is not assignable to type '[number, string]'. -tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(11,1): error TS2323: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]'. +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(8,1): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(11,1): error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]'. Types of property '0' are incompatible. Type '{}' is not assignable to type '{ a: string; }'. Property 'a' is missing in type '{}'. -tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(12,1): error TS2323: Type '[number, string]' is not assignable to type '[number, string, boolean]'. +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(12,1): error TS2322: Type '[number, string]' is not assignable to type '[number, string, boolean]'. Property '2' is missing in type '[number, string]'. -tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(13,5): error TS2323: Type '[string, string, number]' is not assignable to type '[string, string]'. +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(13,5): error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]'. Types of property 'pop' are incompatible. Type '() => string | number' is not assignable to type '() => string'. Type 'string | number' is not assignable to type 'string'. @@ -23,36 +23,36 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(13,5): error TS23 var numStrTuple: [number, string] = [5, "hello"]; var numStrTuple2: [number, string] = [5, "foo", true]; ~~~~~~~~~~~~ -!!! error TS2323: Type '[number, string, boolean]' is not assignable to type '[number, string]'. -!!! error TS2323: Types of property 'pop' are incompatible. -!!! error TS2323: Type '() => string | number | boolean' is not assignable to type '() => string | number'. -!!! error TS2323: Type 'string | number | boolean' is not assignable to type 'string | number'. -!!! error TS2323: Type 'boolean' is not assignable to type 'string | number'. -!!! error TS2323: Type 'boolean' is not assignable to type 'number'. +!!! error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. +!!! error TS2322: Types of property 'pop' are incompatible. +!!! error TS2322: Type '() => string | number | boolean' is not assignable to type '() => string | number'. +!!! error TS2322: Type 'string | number | boolean' is not assignable to type 'string | number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string | number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. var numStrBoolTuple: [number, string, boolean] = [5, "foo", true]; var objNumTuple: [{ a: string }, number] = [{ a: "world" }, 5]; var strTupleTuple: [string, [number, {}]] = ["bar", [5, { x: 1, y: 1 }]]; numStrTuple = numStrTuple2; numStrTuple = numStrBoolTuple; ~~~~~~~~~~~ -!!! error TS2323: Type '[number, string, boolean]' is not assignable to type '[number, string]'. +!!! error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. // error objNumTuple = [ {}, 5]; ~~~~~~~~~~~ -!!! error TS2323: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]'. -!!! error TS2323: Types of property '0' are incompatible. -!!! error TS2323: Type '{}' is not assignable to type '{ a: string; }'. -!!! error TS2323: Property 'a' is missing in type '{}'. +!!! error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]'. +!!! error TS2322: Types of property '0' are incompatible. +!!! error TS2322: Type '{}' is not assignable to type '{ a: string; }'. +!!! error TS2322: Property 'a' is missing in type '{}'. numStrBoolTuple = numStrTuple; ~~~~~~~~~~~~~~~ -!!! error TS2323: Type '[number, string]' is not assignable to type '[number, string, boolean]'. -!!! error TS2323: Property '2' is missing in type '[number, string]'. +!!! error TS2322: Type '[number, string]' is not assignable to type '[number, string, boolean]'. +!!! error TS2322: Property '2' is missing in type '[number, string]'. var strStrTuple: [string, string] = ["foo", "bar", 5]; ~~~~~~~~~~~ -!!! error TS2323: Type '[string, string, number]' is not assignable to type '[string, string]'. -!!! error TS2323: Types of property 'pop' are incompatible. -!!! error TS2323: Type '() => string | number' is not assignable to type '() => string'. -!!! error TS2323: Type 'string | number' is not assignable to type 'string'. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]'. +!!! error TS2322: Types of property 'pop' are incompatible. +!!! error TS2322: Type '() => string | number' is not assignable to type '() => string'. +!!! error TS2322: Type 'string | number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping.errors.txt b/tests/baselines/reference/contextualTyping.errors.txt index 5e415cf13a1..3dce1018e3e 100644 --- a/tests/baselines/reference/contextualTyping.errors.txt +++ b/tests/baselines/reference/contextualTyping.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/contextualTyping.ts(189,18): error TS2384: Overload signatures must all be ambient or non-ambient. tests/cases/compiler/contextualTyping.ts(197,15): error TS2300: Duplicate identifier 'Point'. tests/cases/compiler/contextualTyping.ts(207,10): error TS2300: Duplicate identifier 'Point'. -tests/cases/compiler/contextualTyping.ts(230,5): error TS2323: Type '{}' is not assignable to type 'B'.\n Property 'x' is missing in type '{}'. +tests/cases/compiler/contextualTyping.ts(230,5): error TS2322: Type '{}' is not assignable to type 'B'.\n Property 'x' is missing in type '{}'. ==== tests/cases/compiler/contextualTyping.ts (4 errors) ==== @@ -242,5 +242,5 @@ tests/cases/compiler/contextualTyping.ts(230,5): error TS2323: Type '{}' is not interface B extends A { } var x: B = { }; ~ -!!! error TS2323: Type '{}' is not assignable to type 'B'.\n Property 'x' is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type 'B'.\n Property 'x' is missing in type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping11.errors.txt b/tests/baselines/reference/contextualTyping11.errors.txt index c619258a20a..a7879725814 100644 --- a/tests/baselines/reference/contextualTyping11.errors.txt +++ b/tests/baselines/reference/contextualTyping11.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/contextualTyping11.ts(1,13): error TS2323: Type 'foo[]' is not assignable to type '{ id: number; }[]'. +tests/cases/compiler/contextualTyping11.ts(1,13): error TS2322: Type 'foo[]' is not assignable to type '{ id: number; }[]'. Type 'foo' is not assignable to type '{ id: number; }'. Property 'id' is missing in type 'foo'. @@ -6,6 +6,6 @@ tests/cases/compiler/contextualTyping11.ts(1,13): error TS2323: Type 'foo[]' is ==== tests/cases/compiler/contextualTyping11.ts (1 errors) ==== class foo { public bar:{id:number;}[] = [({})]; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'foo[]' is not assignable to type '{ id: number; }[]'. -!!! error TS2323: Type 'foo' is not assignable to type '{ id: number; }'. -!!! error TS2323: Property 'id' is missing in type 'foo'. \ No newline at end of file +!!! error TS2322: Type 'foo[]' is not assignable to type '{ id: number; }[]'. +!!! error TS2322: Type 'foo' is not assignable to type '{ id: number; }'. +!!! error TS2322: Property 'id' is missing in type 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping21.errors.txt b/tests/baselines/reference/contextualTyping21.errors.txt index 8b3522066d4..d40192c6240 100644 --- a/tests/baselines/reference/contextualTyping21.errors.txt +++ b/tests/baselines/reference/contextualTyping21.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/contextualTyping21.ts(1,36): error TS2323: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]'. +tests/cases/compiler/contextualTyping21.ts(1,36): error TS2322: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]'. Type 'number | { id: number; }' is not assignable to type '{ id: number; }'. Type 'number' is not assignable to type '{ id: number; }'. Property 'id' is missing in type 'Number'. @@ -7,7 +7,7 @@ tests/cases/compiler/contextualTyping21.ts(1,36): error TS2323: Type '(number | ==== tests/cases/compiler/contextualTyping21.ts (1 errors) ==== var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, 1]; ~~~ -!!! error TS2323: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]'. -!!! error TS2323: Type 'number | { id: number; }' is not assignable to type '{ id: number; }'. -!!! error TS2323: Type 'number' is not assignable to type '{ id: number; }'. -!!! error TS2323: Property 'id' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]'. +!!! error TS2322: Type 'number | { id: number; }' is not assignable to type '{ id: number; }'. +!!! error TS2322: Type 'number' is not assignable to type '{ id: number; }'. +!!! error TS2322: Property 'id' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping24.errors.txt b/tests/baselines/reference/contextualTyping24.errors.txt index 66161aa329e..a172600e1c5 100644 --- a/tests/baselines/reference/contextualTyping24.errors.txt +++ b/tests/baselines/reference/contextualTyping24.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/contextualTyping24.ts(1,55): error TS2323: Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. +tests/cases/compiler/contextualTyping24.ts(1,55): error TS2322: Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. Types of parameters 'a' and 'a' are incompatible. Type 'string' is not assignable to type '{ (): number; (i: number): number; }'. @@ -6,6 +6,6 @@ tests/cases/compiler/contextualTyping24.ts(1,55): error TS2323: Type '(a: string ==== tests/cases/compiler/contextualTyping24.ts (1 errors) ==== var foo:(a:{():number; (i:number):number; })=>number; foo = function(a:string){return 5}; ~~~ -!!! error TS2323: Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. -!!! error TS2323: Types of parameters 'a' and 'a' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type '{ (): number; (i: number): number; }'. \ No newline at end of file +!!! error TS2322: Type '(a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. +!!! error TS2322: Types of parameters 'a' and 'a' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type '{ (): number; (i: number): number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping5.errors.txt b/tests/baselines/reference/contextualTyping5.errors.txt index f2f6cea14b1..5105f67190c 100644 --- a/tests/baselines/reference/contextualTyping5.errors.txt +++ b/tests/baselines/reference/contextualTyping5.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/contextualTyping5.ts(1,13): error TS2323: Type '{}' is not assignable to type '{ id: number; }'. +tests/cases/compiler/contextualTyping5.ts(1,13): error TS2322: Type '{}' is not assignable to type '{ id: number; }'. Property 'id' is missing in type '{}'. ==== tests/cases/compiler/contextualTyping5.ts (1 errors) ==== class foo { public bar:{id:number;} = { }; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type '{}' is not assignable to type '{ id: number; }'. -!!! error TS2323: Property 'id' is missing in type '{}'. \ No newline at end of file +!!! error TS2322: Type '{}' is not assignable to type '{ id: number; }'. +!!! error TS2322: Property 'id' is missing in type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt b/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt index 8b14d0aa301..26b06abf782 100644 --- a/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt +++ b/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2323: Type '(number | Date)[]' is not assignable to type 'I'. +tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2322: Type '(number | Date)[]' is not assignable to type 'I'. Index signatures are incompatible. Type 'number | Date' is not assignable to type 'Date'. Type 'number' is not assignable to type 'Date'. @@ -12,11 +12,11 @@ tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2323: Typ var x3: I = [new Date(), 1]; ~~ -!!! error TS2323: Type '(number | Date)[]' is not assignable to type 'I'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'number | Date' is not assignable to type 'Date'. -!!! error TS2323: Type 'number' is not assignable to type 'Date'. -!!! error TS2323: Property 'toDateString' is missing in type 'Number'. +!!! error TS2322: Type '(number | Date)[]' is not assignable to type 'I'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'number | Date' is not assignable to type 'Date'. +!!! error TS2322: Type 'number' is not assignable to type 'Date'. +!!! error TS2322: Property 'toDateString' is missing in type 'Number'. var r2 = x3[1]; r2.getDate(); \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt b/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt index 9cd1475b6e8..08fe22c08e0 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/contextualTypingOfConditionalExpression2.ts(11,5): error TS2323: Type '((a: C) => number) | ((b: number) => void)' is not assignable to type '(a: A) => void'. +tests/cases/compiler/contextualTypingOfConditionalExpression2.ts(11,5): error TS2322: Type '((a: C) => number) | ((b: number) => void)' is not assignable to type '(a: A) => void'. Type '(b: number) => void' is not assignable to type '(a: A) => void'. Types of parameters 'b' and 'a' are incompatible. Type 'number' is not assignable to type 'A'. @@ -18,9 +18,9 @@ tests/cases/compiler/contextualTypingOfConditionalExpression2.ts(11,5): error TS var x2: (a: A) => void = true ? (a: C) => a.foo : (b: number) => { }; ~~ -!!! error TS2323: Type '((a: C) => number) | ((b: number) => void)' is not assignable to type '(a: A) => void'. -!!! error TS2323: Type '(b: number) => void' is not assignable to type '(a: A) => void'. -!!! error TS2323: Types of parameters 'b' and 'a' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'A'. -!!! error TS2323: Property 'foo' is missing in type 'Number'. +!!! error TS2322: Type '((a: C) => number) | ((b: number) => void)' is not assignable to type '(a: A) => void'. +!!! error TS2322: Type '(b: number) => void' is not assignable to type '(a: A) => void'. +!!! error TS2322: Types of parameters 'b' and 'a' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'A'. +!!! error TS2322: Property 'foo' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt b/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt index 7f4d749a3a0..b388d1b0e4a 100644 --- a/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt +++ b/tests/baselines/reference/contextualTypingOfObjectLiterals.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/contextualTypingOfObjectLiterals.ts(4,1): error TS2323: Type '{ x: string; }' is not assignable to type '{ [x: string]: string; }'. +tests/cases/compiler/contextualTypingOfObjectLiterals.ts(4,1): error TS2322: Type '{ x: string; }' is not assignable to type '{ [x: string]: string; }'. Index signature is missing in type '{ x: string; }'. tests/cases/compiler/contextualTypingOfObjectLiterals.ts(10,3): error TS2345: Argument of type '{ x: string; }' is not assignable to parameter of type '{ [x: string]: string; }'. @@ -9,8 +9,8 @@ tests/cases/compiler/contextualTypingOfObjectLiterals.ts(10,3): error TS2345: Ar obj1 = {}; // Ok obj1 = obj2; // Error - indexer doesn't match ~~~~ -!!! error TS2323: Type '{ x: string; }' is not assignable to type '{ [x: string]: string; }'. -!!! error TS2323: Index signature is missing in type '{ x: string; }'. +!!! error TS2322: Type '{ x: string; }' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2322: Index signature is missing in type '{ x: string; }'. function f(x: { [s: string]: string }) { } diff --git a/tests/baselines/reference/contextuallyTypingRestParameters.errors.txt b/tests/baselines/reference/contextuallyTypingRestParameters.errors.txt index 369d10e88c2..b64c255c867 100644 --- a/tests/baselines/reference/contextuallyTypingRestParameters.errors.txt +++ b/tests/baselines/reference/contextuallyTypingRestParameters.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/contextuallyTypingRestParameters.ts(3,9): error TS2323: Type 'string[]' is not assignable to type 'string'. -tests/cases/compiler/contextuallyTypingRestParameters.ts(5,9): error TS2323: Type 'string[]' is not assignable to type 'string'. +tests/cases/compiler/contextuallyTypingRestParameters.ts(3,9): error TS2322: Type 'string[]' is not assignable to type 'string'. +tests/cases/compiler/contextuallyTypingRestParameters.ts(5,9): error TS2322: Type 'string[]' is not assignable to type 'string'. ==== tests/cases/compiler/contextuallyTypingRestParameters.ts (2 errors) ==== @@ -7,10 +7,10 @@ tests/cases/compiler/contextuallyTypingRestParameters.ts(5,9): error TS2323: Typ var t = y; var x2: string = t; // This should be error ~~ -!!! error TS2323: Type 'string[]' is not assignable to type 'string'. +!!! error TS2322: Type 'string[]' is not assignable to type 'string'. var x3: string[] = t; // No error var y2: string = y; // This should be error ~~ -!!! error TS2323: Type 'string[]' is not assignable to type 'string'. +!!! error TS2322: Type 'string[]' is not assignable to type 'string'. var y3: string[] = y; // No error }; \ No newline at end of file diff --git a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.errors.txt b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.errors.txt index a1ed83ada1b..717d76309a5 100644 --- a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.errors.txt +++ b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/crashInsourcePropertyIsRelatableToTargetProperty.ts(5,1): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. -tests/cases/compiler/crashInsourcePropertyIsRelatableToTargetProperty.ts(9,5): error TS2323: Type '(x: "hi", items: string[]) => typeof foo' is not assignable to type 'D'. +tests/cases/compiler/crashInsourcePropertyIsRelatableToTargetProperty.ts(9,5): error TS2322: Type '(x: "hi", items: string[]) => typeof foo' is not assignable to type 'D'. Property 'x' is missing in type '(x: "hi", items: string[]) => typeof foo'. @@ -16,6 +16,6 @@ tests/cases/compiler/crashInsourcePropertyIsRelatableToTargetProperty.ts(9,5): e } var a: D = foo("hi", []); ~ -!!! error TS2323: Type '(x: "hi", items: string[]) => typeof foo' is not assignable to type 'D'. -!!! error TS2323: Property 'x' is missing in type '(x: "hi", items: string[]) => typeof foo'. +!!! error TS2322: Type '(x: "hi", items: string[]) => typeof foo' is not assignable to type 'D'. +!!! error TS2322: Property 'x' is missing in type '(x: "hi", items: string[]) => typeof foo'. \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithEnumType.js b/tests/baselines/reference/decrementOperatorWithEnumType.js index 13947a6a948..15247ea4225 100644 --- a/tests/baselines/reference/decrementOperatorWithEnumType.js +++ b/tests/baselines/reference/decrementOperatorWithEnumType.js @@ -22,8 +22,8 @@ var ENUM1; })(ENUM1 || (ENUM1 = {})); ; // expression -var ResultIsNumber1 = --ENUM1["A"]; +var ResultIsNumber1 = --0 /* "A" */; var ResultIsNumber2 = 0 /* A */--; // miss assignment operator ---ENUM1["A"]; +--0 /* "A" */; ENUM1[A]--; diff --git a/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt index ff1f29a695d..156fdcc4c7a 100644 --- a/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt +++ b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/defaultArgsInFunctionExpressions.ts(4,19): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -tests/cases/compiler/defaultArgsInFunctionExpressions.ts(5,1): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/defaultArgsInFunctionExpressions.ts(8,20): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/defaultArgsInFunctionExpressions.ts(11,1): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(5,1): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(8,20): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(11,1): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(14,51): error TS2352: Neither type 'string' nor type 'number' is assignable to the other. -tests/cases/compiler/defaultArgsInFunctionExpressions.ts(17,41): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(17,41): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(20,62): error TS2352: Neither type 'string' nor type 'number' is assignable to the other. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2304: Cannot find name 'T'. @@ -17,17 +17,17 @@ tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2304: C !!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. s = f(); ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. // Type check the default argument with the type annotation var f2 = function (a: string = 3) { return a; }; // Should error, but be of type (a: string) => string; ~~~~~~~~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. s = f2(''); s = f2(); n = f2(); ~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. // Contextually type the default arg with the type annotation var f3 = function (a: (s: string) => any = (s) => s) { }; @@ -37,7 +37,7 @@ tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2304: C // Type check using the function's contextual type var f4: (a: number) => void = function (a = "") { }; ~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. // Contextually type the default arg using the function's contextual type var f5: (a: (s: string) => any) => void = function (a = s => s) { }; diff --git a/tests/baselines/reference/deleteOperator1.errors.txt b/tests/baselines/reference/deleteOperator1.errors.txt index 095d4c37100..964bdec9ea2 100644 --- a/tests/baselines/reference/deleteOperator1.errors.txt +++ b/tests/baselines/reference/deleteOperator1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/deleteOperator1.ts(4,5): error TS2323: Type 'boolean' is not assignable to type 'number'. +tests/cases/compiler/deleteOperator1.ts(4,5): error TS2322: Type 'boolean' is not assignable to type 'number'. ==== tests/cases/compiler/deleteOperator1.ts (1 errors) ==== @@ -7,4 +7,4 @@ tests/cases/compiler/deleteOperator1.ts(4,5): error TS2323: Type 'boolean' is no var y: any = delete a; var z: number = delete a; ~ -!!! error TS2323: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/deleteOperatorWithEnumType.js b/tests/baselines/reference/deleteOperatorWithEnumType.js index e694790091c..b87ab8298a7 100644 --- a/tests/baselines/reference/deleteOperatorWithEnumType.js +++ b/tests/baselines/reference/deleteOperatorWithEnumType.js @@ -39,11 +39,11 @@ var ENUM1; var ResultIsBoolean1 = delete ENUM; var ResultIsBoolean2 = delete ENUM1; // enum type expressions -var ResultIsBoolean3 = delete ENUM1["A"]; -var ResultIsBoolean4 = delete (ENUM[0] + ENUM1["B"]); +var ResultIsBoolean3 = delete 0 /* "A" */; +var ResultIsBoolean4 = delete (ENUM[0] + 1 /* "B" */); // multiple delete operators var ResultIsBoolean5 = delete delete ENUM; -var ResultIsBoolean6 = delete delete delete (ENUM[0] + ENUM1["B"]); +var ResultIsBoolean6 = delete delete delete (ENUM[0] + 1 /* "B" */); // miss assignment operators delete ENUM; delete ENUM1; diff --git a/tests/baselines/reference/derivedClassTransitivity.errors.txt b/tests/baselines/reference/derivedClassTransitivity.errors.txt index cd10113717d..c6b620beb18 100644 --- a/tests/baselines/reference/derivedClassTransitivity.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity.ts(18,1): error TS2323: Type 'E' is not assignable to type 'C'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C'. Types of property 'foo' are incompatible. Type '(x?: string) => void' is not assignable to type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. @@ -25,10 +25,10 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra var e: E; c = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'C'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type '(x?: string) => void' is not assignable to type '(x: number) => void'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x?: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var r = c.foo(1); var r2 = e.foo(''); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity2.errors.txt b/tests/baselines/reference/derivedClassTransitivity2.errors.txt index 7141b2fdc52..a8d2003c876 100644 --- a/tests/baselines/reference/derivedClassTransitivity2.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity2.ts(18,1): error TS2323: Type 'E' is not assignable to type 'C'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity2.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C'. Types of property 'foo' are incompatible. Type '(x: number, y?: string) => void' is not assignable to type '(x: number, y: number) => void'. Types of parameters 'y' and 'y' are incompatible. @@ -25,10 +25,10 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra var e: E; c = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'C'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type '(x: number, y?: string) => void' is not assignable to type '(x: number, y: number) => void'. -!!! error TS2323: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x: number, y?: string) => void' is not assignable to type '(x: number, y: number) => void'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var r = c.foo(1, 1); var r2 = e.foo(1, ''); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity3.errors.txt b/tests/baselines/reference/derivedClassTransitivity3.errors.txt index eb3cea00e71..9d301255dfd 100644 --- a/tests/baselines/reference/derivedClassTransitivity3.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity3.ts(18,1): error TS2323: Type 'E' is not assignable to type 'C'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity3.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C'. Types of property 'foo' are incompatible. Type '(x: string, y?: number) => void' is not assignable to type '(x: string, y: string) => void'. Types of parameters 'y' and 'y' are incompatible. @@ -25,10 +25,10 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra var e: E; c = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'C'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type '(x: string, y?: number) => void' is not assignable to type '(x: string, y: string) => void'. -!!! error TS2323: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x: string, y?: number) => void' is not assignable to type '(x: string, y: string) => void'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var r = c.foo('', ''); var r2 = e.foo('', 1); \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassTransitivity4.errors.txt b/tests/baselines/reference/derivedClassTransitivity4.errors.txt index b6f9f9c8028..c1a80e0a1d7 100644 --- a/tests/baselines/reference/derivedClassTransitivity4.errors.txt +++ b/tests/baselines/reference/derivedClassTransitivity4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity4.ts(18,1): error TS2323: Type 'E' is not assignable to type 'C'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTransitivity4.ts(18,1): error TS2322: Type 'E' is not assignable to type 'C'. Types of property 'foo' are incompatible. Type '(x?: string) => void' is not assignable to type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. @@ -26,11 +26,11 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassTra var e: E; c = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'C'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type '(x?: string) => void' is not assignable to type '(x: number) => void'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x?: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var r = c.foo(1); ~~~~~ !!! error TS2445: Property 'foo' is protected and only accessible within class 'C' and its subclasses. diff --git a/tests/baselines/reference/derivedClassWithAny.errors.txt b/tests/baselines/reference/derivedClassWithAny.errors.txt index 42e7f1b38a1..aa91979706b 100644 --- a/tests/baselines/reference/derivedClassWithAny.errors.txt +++ b/tests/baselines/reference/derivedClassWithAny.errors.txt @@ -4,7 +4,7 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(27,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(38,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(44,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(57,1): error TS2323: Type 'E' is not assignable to type 'C'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithAny.ts(57,1): error TS2322: Type 'E' is not assignable to type 'C'. Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. @@ -80,8 +80,8 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWit c = d; c = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'C'. -!!! error TS2323: Types of property 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var r = c.foo(); // e.foo would return string \ No newline at end of file diff --git a/tests/baselines/reference/derivedGenericClassWithAny.errors.txt b/tests/baselines/reference/derivedGenericClassWithAny.errors.txt index 91111563a71..ab28ccc9c8d 100644 --- a/tests/baselines/reference/derivedGenericClassWithAny.errors.txt +++ b/tests/baselines/reference/derivedGenericClassWithAny.errors.txt @@ -2,9 +2,9 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericC tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(11,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(19,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(30,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(30,25): error TS2323: Type 'string' is not assignable to type 'T'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(32,16): error TS2323: Type 'string' is not assignable to type 'T'. -tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(41,1): error TS2323: Type 'E' is not assignable to type 'C'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(30,25): error TS2322: Type 'string' is not assignable to type 'T'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(32,16): error TS2322: Type 'string' is not assignable to type 'T'. +tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericClassWithAny.ts(41,1): error TS2322: Type 'E' is not assignable to type 'C'. Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. @@ -49,11 +49,11 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericC ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~ -!!! error TS2323: Type 'string' is not assignable to type 'T'. +!!! error TS2322: Type 'string' is not assignable to type 'T'. foo(): T { return ''; // error ~~ -!!! error TS2323: Type 'string' is not assignable to type 'T'. +!!! error TS2322: Type 'string' is not assignable to type 'T'. } } @@ -64,7 +64,7 @@ tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedGenericC c = d; c = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'C'. -!!! error TS2323: Types of property 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var r = c.foo(); // e.foo would return string \ No newline at end of file diff --git a/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt b/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt new file mode 100644 index 00000000000..b9890e925c4 --- /dev/null +++ b/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt @@ -0,0 +1,72 @@ +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(4,6): error TS2456: Type alias 'T0' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(6,6): error TS2456: Type alias 'T0_2' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(11,6): error TS2456: Type alias 'T1' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(14,6): error TS2456: Type alias 'T2' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(16,6): error TS2456: Type alias 'T2_1' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(19,6): error TS2456: Type alias 'T3' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(22,6): error TS2456: Type alias 'T4' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(26,6): error TS2456: Type alias 'T5' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(30,6): error TS2456: Type alias 'T7' circularly references itself. + + +==== tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts (9 errors) ==== + // It is an error for the type specified in a type alias to depend on that type alias + + // A type alias directly depends on the type it aliases. + type T0 = T0 + ~~ +!!! error TS2456: Type alias 'T0' circularly references itself. + type T0_1 = T0_2 + type T0_2 = T0_3 + ~~~~ +!!! error TS2456: Type alias 'T0_2' circularly references itself. + type T0_3 = T0_1 + + // A type reference directly depends on the referenced type and each of the type arguments, if any. + interface I {} + type T1 = I + ~~ +!!! error TS2456: Type alias 'T1' circularly references itself. + + // A union type directly depends on each of the constituent types. + type T2 = T2 | string + ~~ +!!! error TS2456: Type alias 'T2' circularly references itself. + class C {} + type T2_1 = T2_1[] | number + ~~~~ +!!! error TS2456: Type alias 'T2_1' circularly references itself. + + // An array type directly depends on its element type. + type T3 = T3[] + ~~ +!!! error TS2456: Type alias 'T3' circularly references itself. + + // A tuple type directly depends on each of its element types. + type T4 = [number, T4] + ~~ +!!! error TS2456: Type alias 'T4' circularly references itself. + + // A type query directly depends on the type of the referenced entity. + var x: T5[] = [] + type T5 = typeof x + ~~ +!!! error TS2456: Type alias 'T5' circularly references itself. + + class C1 {} + type T6 = T7 | number + type T7 = typeof yy + ~~ +!!! error TS2456: Type alias 'T7' circularly references itself. + var yy: [string, T8[]]; + type T8 = C + + // legal cases + type T9 = () => T9 + type T10 = { x: T10 } | { new(v: T10): string } + type T11 = T12[] + type T12 = [T13, string] + type T13 = typeof zz + var zz: { x: T11 } + + \ No newline at end of file diff --git a/tests/baselines/reference/directDependenceBetweenTypeAliases.js b/tests/baselines/reference/directDependenceBetweenTypeAliases.js new file mode 100644 index 00000000000..370e33483fc --- /dev/null +++ b/tests/baselines/reference/directDependenceBetweenTypeAliases.js @@ -0,0 +1,60 @@ +//// [directDependenceBetweenTypeAliases.ts] +// It is an error for the type specified in a type alias to depend on that type alias + +// A type alias directly depends on the type it aliases. +type T0 = T0 +type T0_1 = T0_2 +type T0_2 = T0_3 +type T0_3 = T0_1 + +// A type reference directly depends on the referenced type and each of the type arguments, if any. +interface I {} +type T1 = I + +// A union type directly depends on each of the constituent types. +type T2 = T2 | string +class C {} +type T2_1 = T2_1[] | number + +// An array type directly depends on its element type. +type T3 = T3[] + +// A tuple type directly depends on each of its element types. +type T4 = [number, T4] + +// A type query directly depends on the type of the referenced entity. +var x: T5[] = [] +type T5 = typeof x + +class C1 {} +type T6 = T7 | number +type T7 = typeof yy +var yy: [string, T8[]]; +type T8 = C + +// legal cases +type T9 = () => T9 +type T10 = { x: T10 } | { new(v: T10): string } +type T11 = T12[] +type T12 = [T13, string] +type T13 = typeof zz +var zz: { x: T11 } + + + +//// [directDependenceBetweenTypeAliases.js] +// It is an error for the type specified in a type alias to depend on that type alias +var C = (function () { + function C() { + } + return C; +})(); +// A type query directly depends on the type of the referenced entity. +var x = []; +var C1 = (function () { + function C1() { + } + return C1; +})(); +var yy; +var zz; diff --git a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt index 241a90f0419..cd2402161c3 100644 --- a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt +++ b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt @@ -2,15 +2,15 @@ tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(3,5): error TS1098: Typ 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 TS2323: Type 'number' is not assignable to type '{ (): any; x: number; }'. +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) ==== var f: { ~ -!!! error TS2323: Type 'number' is not assignable to type '{ (): any; x: number; }'. -!!! error TS2323: Property 'x' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ (): any; x: number; }'. +!!! error TS2322: Property 'x' is missing in type 'Number'. x: number; <- ~ diff --git a/tests/baselines/reference/enumAssignability.errors.txt b/tests/baselines/reference/enumAssignability.errors.txt index 8ea3b5a368c..4a060ac3456 100644 --- a/tests/baselines/reference/enumAssignability.errors.txt +++ b/tests/baselines/reference/enumAssignability.errors.txt @@ -1,31 +1,31 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(9,1): error TS2323: Type 'F' is not assignable to type 'E'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(10,1): error TS2323: Type 'E' is not assignable to type 'F'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(29,9): error TS2323: Type 'E' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(30,9): error TS2323: Type 'E' is not assignable to type 'boolean'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(31,9): error TS2323: Type 'E' is not assignable to type 'Date'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(9,1): error TS2322: Type 'F' is not assignable to type 'E'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(10,1): error TS2322: Type 'E' is not assignable to type 'F'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(29,9): error TS2322: Type 'E' is not assignable to type 'string'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(30,9): error TS2322: Type 'E' is not assignable to type 'boolean'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(31,9): error TS2322: Type 'E' is not assignable to type 'Date'. Property 'toDateString' is missing in type 'Number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(33,9): error TS2323: Type 'E' is not assignable to type 'void'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(36,9): error TS2323: Type 'E' is not assignable to type '() => {}'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(37,9): error TS2323: Type 'E' is not assignable to type 'Function'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(33,9): error TS2322: Type 'E' is not assignable to type 'void'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(36,9): error TS2322: Type 'E' is not assignable to type '() => {}'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(37,9): error TS2322: Type 'E' is not assignable to type 'Function'. Property 'apply' is missing in type 'Number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(38,9): error TS2323: Type 'E' is not assignable to type '(x: number) => string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(39,5): error TS2323: Type 'E' is not assignable to type 'C'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(38,9): error TS2322: Type 'E' is not assignable to type '(x: number) => string'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(39,5): error TS2322: Type 'E' is not assignable to type 'C'. Property 'foo' is missing in type 'Number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(40,5): error TS2323: Type 'E' is not assignable to type 'I'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(40,5): error TS2322: Type 'E' is not assignable to type 'I'. Property 'foo' is missing in type 'Number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(41,9): error TS2323: Type 'E' is not assignable to type 'number[]'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(41,9): error TS2322: Type 'E' is not assignable to type 'number[]'. Property 'length' is missing in type 'Number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(42,9): error TS2323: Type 'E' is not assignable to type '{ foo: string; }'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(42,9): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. Property 'foo' is missing in type 'Number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(43,9): error TS2323: Type 'E' is not assignable to type '(x: T) => T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(45,9): error TS2323: Type 'E' is not assignable to type 'String'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(43,9): error TS2322: Type 'E' is not assignable to type '(x: T) => T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(45,9): error TS2322: Type 'E' is not assignable to type 'String'. Property 'charAt' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(47,21): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(48,9): error TS2323: Type 'E' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(49,9): error TS2323: Type 'E' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(50,9): error TS2323: Type 'E' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(51,13): error TS2323: Type 'E' is not assignable to type 'A'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(52,13): error TS2323: Type 'E' is not assignable to type 'B'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(48,9): error TS2322: Type 'E' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(49,9): error TS2322: Type 'E' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(50,9): error TS2322: Type 'E' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(51,13): error TS2322: Type 'E' is not assignable to type 'A'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(52,13): error TS2322: Type 'E' is not assignable to type 'B'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts (21 errors) ==== @@ -39,10 +39,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi e = f; ~ -!!! error TS2323: Type 'F' is not assignable to type 'E'. +!!! error TS2322: Type 'F' is not assignable to type 'E'. f = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'F'. +!!! error TS2322: Type 'E' is not assignable to type 'F'. e = 1; // ok f = 1; // ok var x: number = e; // ok @@ -63,72 +63,72 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi var b: number = e; // ok var c: string = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'string'. +!!! error TS2322: Type 'E' is not assignable to type 'string'. var d: boolean = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'boolean'. +!!! error TS2322: Type 'E' is not assignable to type 'boolean'. var ee: Date = e; ~~ -!!! error TS2323: Type 'E' is not assignable to type 'Date'. -!!! error TS2323: Property 'toDateString' is missing in type 'Number'. +!!! error TS2322: Type 'E' is not assignable to type 'Date'. +!!! error TS2322: Property 'toDateString' is missing in type 'Number'. var f: any = e; // ok var g: void = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'void'. +!!! error TS2322: Type 'E' is not assignable to type 'void'. var h: Object = e; var i: {} = e; var j: () => {} = e; ~ -!!! error TS2323: Type 'E' is not assignable to type '() => {}'. +!!! error TS2322: Type 'E' is not assignable to type '() => {}'. var k: Function = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'Function'. -!!! error TS2323: Property 'apply' is missing in type 'Number'. +!!! error TS2322: Type 'E' is not assignable to type 'Function'. +!!! error TS2322: Property 'apply' is missing in type 'Number'. var l: (x: number) => string = e; ~ -!!! error TS2323: Type 'E' is not assignable to type '(x: number) => string'. +!!! error TS2322: Type 'E' is not assignable to type '(x: number) => string'. ac = e; ~~ -!!! error TS2323: Type 'E' is not assignable to type 'C'. -!!! error TS2323: Property 'foo' is missing in type 'Number'. +!!! error TS2322: Type 'E' is not assignable to type 'C'. +!!! error TS2322: Property 'foo' is missing in type 'Number'. ai = e; ~~ -!!! error TS2323: Type 'E' is not assignable to type 'I'. -!!! error TS2323: Property 'foo' is missing in type 'Number'. +!!! error TS2322: Type 'E' is not assignable to type 'I'. +!!! error TS2322: Property 'foo' is missing in type 'Number'. var m: number[] = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'number[]'. -!!! error TS2323: Property 'length' is missing in type 'Number'. +!!! error TS2322: Type 'E' is not assignable to type 'number[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. var n: { foo: string } = e; ~ -!!! error TS2323: Type 'E' is not assignable to type '{ foo: string; }'. -!!! error TS2323: Property 'foo' is missing in type 'Number'. +!!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. +!!! error TS2322: Property 'foo' is missing in type 'Number'. var o: (x: T) => T = e; ~ -!!! error TS2323: Type 'E' is not assignable to type '(x: T) => T'. +!!! error TS2322: Type 'E' is not assignable to type '(x: T) => T'. var p: Number = e; var q: String = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'String'. -!!! error TS2323: Property 'charAt' is missing in type 'Number'. +!!! error TS2322: Type 'E' is not assignable to type 'String'. +!!! error TS2322: Property 'charAt' is missing in type 'Number'. function foo(x: T, y: U, z: V) { ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'T'. +!!! error TS2322: Type 'E' is not assignable to type 'T'. y = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'U'. +!!! error TS2322: Type 'E' is not assignable to type 'U'. z = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'V'. +!!! error TS2322: Type 'E' is not assignable to type 'V'. var a: A = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'A'. +!!! error TS2322: Type 'E' is not assignable to type 'A'. var b: B = e; ~ -!!! error TS2323: Type 'E' is not assignable to type 'B'. +!!! error TS2322: Type 'E' is not assignable to type 'B'. } } \ No newline at end of file diff --git a/tests/baselines/reference/enumAssignmentCompat.errors.txt b/tests/baselines/reference/enumAssignmentCompat.errors.txt index f2a093f2046..3cddaf45966 100644 --- a/tests/baselines/reference/enumAssignmentCompat.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/enumAssignmentCompat.ts(26,5): error TS2323: Type 'typeof W' is not assignable to type 'number'. -tests/cases/compiler/enumAssignmentCompat.ts(28,5): error TS2323: Type 'W' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat.ts(26,5): error TS2322: Type 'typeof W' is not assignable to type 'number'. +tests/cases/compiler/enumAssignmentCompat.ts(28,5): error TS2322: Type 'W' is not assignable to type 'typeof W'. Property 'D' is missing in type 'Number'. -tests/cases/compiler/enumAssignmentCompat.ts(30,5): error TS2323: Type 'number' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat.ts(32,5): error TS2323: Type 'W' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat.ts(30,5): error TS2322: Type 'number' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat.ts(32,5): error TS2322: Type 'W' is not assignable to type 'WStatic'. Property 'a' is missing in type 'Number'. -tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2323: Type 'number' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type 'number' is not assignable to type 'WStatic'. ==== tests/cases/compiler/enumAssignmentCompat.ts (5 errors) ==== @@ -35,24 +35,24 @@ tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2323: Type 'number' var y: typeof W = W; var z: number = W; // error ~ -!!! error TS2323: Type 'typeof W' is not assignable to type 'number'. +!!! error TS2322: Type 'typeof W' is not assignable to type 'number'. var a: number = W.a; var b: typeof W = W.a; // error ~ -!!! error TS2323: Type 'W' is not assignable to type 'typeof W'. -!!! error TS2323: Property 'D' is missing in type 'Number'. +!!! error TS2322: Type 'W' is not assignable to type 'typeof W'. +!!! error TS2322: Property 'D' is missing in type 'Number'. var c: typeof W.a = W.a; var d: typeof W = 3; // error ~ -!!! error TS2323: Type 'number' is not assignable to type 'typeof W'. +!!! error TS2322: Type 'number' is not assignable to type 'typeof W'. var e: typeof W.a = 4; var f: WStatic = W.a; // error ~ -!!! error TS2323: Type 'W' is not assignable to type 'WStatic'. -!!! error TS2323: Property 'a' is missing in type 'Number'. +!!! error TS2322: Type 'W' is not assignable to type 'WStatic'. +!!! error TS2322: Property 'a' is missing in type 'Number'. var g: WStatic = 5; // error ~ -!!! error TS2323: Type 'number' is not assignable to type 'WStatic'. +!!! error TS2322: Type 'number' is not assignable to type 'WStatic'. var h: W = 3; var i: W = W.a; i = W.a; diff --git a/tests/baselines/reference/enumAssignmentCompat2.errors.txt b/tests/baselines/reference/enumAssignmentCompat2.errors.txt index 9b2263455ec..d87d6acf6a0 100644 --- a/tests/baselines/reference/enumAssignmentCompat2.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat2.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/enumAssignmentCompat2.ts(25,5): error TS2323: Type 'typeof W' is not assignable to type 'number'. -tests/cases/compiler/enumAssignmentCompat2.ts(27,5): error TS2323: Type 'W' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat2.ts(25,5): error TS2322: Type 'typeof W' is not assignable to type 'number'. +tests/cases/compiler/enumAssignmentCompat2.ts(27,5): error TS2322: Type 'W' is not assignable to type 'typeof W'. Property 'a' is missing in type 'Number'. -tests/cases/compiler/enumAssignmentCompat2.ts(29,5): error TS2323: Type 'number' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat2.ts(31,5): error TS2323: Type 'W' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat2.ts(29,5): error TS2322: Type 'number' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat2.ts(31,5): error TS2322: Type 'W' is not assignable to type 'WStatic'. Property 'a' is missing in type 'Number'. -tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2323: Type 'number' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type 'number' is not assignable to type 'WStatic'. ==== tests/cases/compiler/enumAssignmentCompat2.ts (5 errors) ==== @@ -34,24 +34,24 @@ tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2323: Type 'number' var y: typeof W = W; var z: number = W; // error ~ -!!! error TS2323: Type 'typeof W' is not assignable to type 'number'. +!!! error TS2322: Type 'typeof W' is not assignable to type 'number'. var a: number = W.a; var b: typeof W = W.a; // error ~ -!!! error TS2323: Type 'W' is not assignable to type 'typeof W'. -!!! error TS2323: Property 'a' is missing in type 'Number'. +!!! error TS2322: Type 'W' is not assignable to type 'typeof W'. +!!! error TS2322: Property 'a' is missing in type 'Number'. var c: typeof W.a = W.a; var d: typeof W = 3; // error ~ -!!! error TS2323: Type 'number' is not assignable to type 'typeof W'. +!!! error TS2322: Type 'number' is not assignable to type 'typeof W'. var e: typeof W.a = 4; var f: WStatic = W.a; // error ~ -!!! error TS2323: Type 'W' is not assignable to type 'WStatic'. -!!! error TS2323: Property 'a' is missing in type 'Number'. +!!! error TS2322: Type 'W' is not assignable to type 'WStatic'. +!!! error TS2322: Property 'a' is missing in type 'Number'. var g: WStatic = 5; // error ~ -!!! error TS2323: Type 'number' is not assignable to type 'WStatic'. +!!! error TS2322: Type 'number' is not assignable to type 'WStatic'. var h: W = 3; var i: W = W.a; i = W.a; diff --git a/tests/baselines/reference/enumErrors.errors.txt b/tests/baselines/reference/enumErrors.errors.txt index 4f930ef2ab9..ca13ceba4ae 100644 --- a/tests/baselines/reference/enumErrors.errors.txt +++ b/tests/baselines/reference/enumErrors.errors.txt @@ -2,13 +2,13 @@ tests/cases/conformance/enums/enumErrors.ts(2,6): error TS2431: Enum name cannot tests/cases/conformance/enums/enumErrors.ts(3,6): error TS2431: Enum name cannot be 'number' tests/cases/conformance/enums/enumErrors.ts(4,6): error TS2431: Enum name cannot be 'string' tests/cases/conformance/enums/enumErrors.ts(5,6): error TS2431: Enum name cannot be 'boolean' -tests/cases/conformance/enums/enumErrors.ts(9,9): error TS2323: Type 'Number' is not assignable to type 'E5'. -tests/cases/conformance/enums/enumErrors.ts(20,9): error TS2323: Type 'E9' is not assignable to type 'E10'. -tests/cases/conformance/enums/enumErrors.ts(21,9): error TS2323: Type 'E9' is not assignable to type 'E10'. -tests/cases/conformance/enums/enumErrors.ts(26,9): error TS2323: Type 'string' is not assignable to type 'E11'. -tests/cases/conformance/enums/enumErrors.ts(27,9): error TS2323: Type 'Date' is not assignable to type 'E11'. +tests/cases/conformance/enums/enumErrors.ts(9,9): error TS2322: Type 'Number' is not assignable to type 'E5'. +tests/cases/conformance/enums/enumErrors.ts(20,9): error TS2322: Type 'E9' is not assignable to type 'E10'. +tests/cases/conformance/enums/enumErrors.ts(21,9): error TS2322: Type 'E9' is not assignable to type 'E10'. +tests/cases/conformance/enums/enumErrors.ts(26,9): error TS2322: Type 'string' is not assignable to type 'E11'. +tests/cases/conformance/enums/enumErrors.ts(27,9): error TS2322: Type 'Date' is not assignable to type 'E11'. tests/cases/conformance/enums/enumErrors.ts(28,9): error TS2304: Cannot find name 'window'. -tests/cases/conformance/enums/enumErrors.ts(29,9): error TS2323: Type '{}' is not assignable to type 'E11'. +tests/cases/conformance/enums/enumErrors.ts(29,9): error TS2322: Type '{}' is not assignable to type 'E11'. ==== tests/cases/conformance/enums/enumErrors.ts (11 errors) ==== @@ -30,7 +30,7 @@ tests/cases/conformance/enums/enumErrors.ts(29,9): error TS2323: Type '{}' is no enum E5 { C = new Number(30) ~~~~~~~~~~~~~~ -!!! error TS2323: Type 'Number' is not assignable to type 'E5'. +!!! error TS2322: Type 'Number' is not assignable to type 'E5'. } enum E9 { @@ -43,25 +43,25 @@ tests/cases/conformance/enums/enumErrors.ts(29,9): error TS2323: Type '{}' is no enum E10 { A = E9.A, ~~~~ -!!! error TS2323: Type 'E9' is not assignable to type 'E10'. +!!! error TS2322: Type 'E9' is not assignable to type 'E10'. B = E9.B ~~~~ -!!! error TS2323: Type 'E9' is not assignable to type 'E10'. +!!! error TS2322: Type 'E9' is not assignable to type 'E10'. } // Enum with computed member intializer of other types enum E11 { A = '', ~~ -!!! error TS2323: Type 'string' is not assignable to type 'E11'. +!!! error TS2322: Type 'string' is not assignable to type 'E11'. B = new Date(), ~~~~~~~~~~ -!!! error TS2323: Type 'Date' is not assignable to type 'E11'. +!!! error TS2322: Type 'Date' is not assignable to type 'E11'. C = window, ~~~~~~ !!! error TS2304: Cannot find name 'window'. D = {} ~~ -!!! error TS2323: Type '{}' is not assignable to type 'E11'. +!!! error TS2322: Type '{}' is not assignable to type 'E11'. } \ No newline at end of file diff --git a/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt b/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt index 757b311f3cd..5b66a377307 100644 --- a/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt +++ b/tests/baselines/reference/errorOnContextuallyTypedReturnType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(1,5): error TS2323: Type '() => void' is not assignable to type '() => boolean'. +tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(1,5): error TS2322: Type '() => void' is not assignable to type '() => boolean'. Type 'void' is not assignable to type 'boolean'. tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(2,37): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. @@ -6,8 +6,8 @@ tests/cases/compiler/errorOnContextuallyTypedReturnType.ts(2,37): error TS2355: ==== tests/cases/compiler/errorOnContextuallyTypedReturnType.ts (2 errors) ==== var n1: () => boolean = function () { }; // expect an error here ~~ -!!! error TS2323: Type '() => void' is not assignable to type '() => boolean'. -!!! error TS2323: Type 'void' is not assignable to type 'boolean'. +!!! error TS2322: Type '() => void' is not assignable to type '() => boolean'. +!!! error TS2322: Type 'void' is not assignable to type 'boolean'. var n2: () => boolean = function ():boolean { }; // expect an error here ~~~~~~~ !!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. diff --git a/tests/baselines/reference/errorWithTruncatedType.errors.txt b/tests/baselines/reference/errorWithTruncatedType.errors.txt index f16dce347a5..f073f7c50a4 100644 --- a/tests/baselines/reference/errorWithTruncatedType.errors.txt +++ b/tests/baselines/reference/errorWithTruncatedType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/errorWithTruncatedType.ts(11,5): error TS2323: Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propert...' is not assignable to type 'string'. +tests/cases/compiler/errorWithTruncatedType.ts(11,5): error TS2322: Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propert...' is not assignable to type 'string'. ==== tests/cases/compiler/errorWithTruncatedType.ts (1 errors) ==== @@ -14,5 +14,5 @@ tests/cases/compiler/errorWithTruncatedType.ts(11,5): error TS2323: Type '{ prop // String representation of type of 'x' should be truncated in error message var s: string = x; ~ -!!! error TS2323: Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propert...' is not assignable to type 'string'. +!!! error TS2322: Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propert...' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt index 023569e0762..4ebb93b10a7 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt @@ -1,35 +1,35 @@ -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(34,5): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(35,5): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(36,5): error TS2323: Type 'number' is not assignable to type 'Date'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(34,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(35,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(36,5): error TS2322: Type 'number' is not assignable to type 'Date'. Property 'toDateString' is missing in type 'Number'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(38,5): error TS2323: Type 'number' is not assignable to type 'void'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(40,5): error TS2323: Type 'D<{}>' is not assignable to type 'I'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(38,5): error TS2322: Type 'number' is not assignable to type 'void'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(40,5): error TS2322: Type 'D<{}>' is not assignable to type 'I'. Property 'id' is missing in type 'D<{}>'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(41,5): error TS2323: Type 'D<{}>' is not assignable to type 'C'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(41,5): error TS2322: Type 'D<{}>' is not assignable to type 'C'. Property 'id' is missing in type 'D<{}>'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(42,5): error TS2323: Type 'C' is not assignable to type 'D'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(42,5): error TS2322: Type 'C' is not assignable to type 'D'. Property 'source' is missing in type 'C'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(43,5): error TS2323: Type '{ id: string; }' is not assignable to type 'I'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(43,5): error TS2322: Type '{ id: string; }' is not assignable to type 'I'. Types of property 'id' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(44,5): error TS2323: Type 'C' is not assignable to type '{ id: string; }'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(44,5): error TS2322: Type 'C' is not assignable to type '{ id: string; }'. Types of property 'id' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(46,5): error TS2323: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(46,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(47,5): error TS2323: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(47,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(48,5): error TS2323: Type '(x: string) => string' is not assignable to type '(x: string) => number'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(48,5): error TS2322: Type '(x: string) => string' is not assignable to type '(x: string) => number'. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(50,5): error TS2323: Type 'typeof N' is not assignable to type 'typeof M'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(50,5): error TS2322: Type 'typeof N' is not assignable to type 'typeof M'. Types of property 'A' are incompatible. Type 'typeof A' is not assignable to type 'typeof A'. Type 'A' is not assignable to type 'A'. Property 'name' is missing in type 'A'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(51,5): error TS2323: Type 'A' is not assignable to type 'A'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(52,5): error TS2323: Type '(x: number) => boolean' is not assignable to type '(x: number) => string'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(51,5): error TS2322: Type 'A' is not assignable to type 'A'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(52,5): error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: number) => string'. Type 'boolean' is not assignable to type 'string'. @@ -69,70 +69,70 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd var aNumber: number = 'this is a string'; ~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var aString: string = 9.9; ~~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var aDate: Date = 9.9; ~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'Date'. -!!! error TS2323: Property 'toDateString' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'Date'. +!!! error TS2322: Property 'toDateString' is missing in type 'Number'. var aVoid: void = 9.9; ~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type 'number' is not assignable to type 'void'. var anInterface: I = new D(); ~~~~~~~~~~~ -!!! error TS2323: Type 'D<{}>' is not assignable to type 'I'. -!!! error TS2323: Property 'id' is missing in type 'D<{}>'. +!!! error TS2322: Type 'D<{}>' is not assignable to type 'I'. +!!! error TS2322: Property 'id' is missing in type 'D<{}>'. var aClass: C = new D(); ~~~~~~ -!!! error TS2323: Type 'D<{}>' is not assignable to type 'C'. -!!! error TS2323: Property 'id' is missing in type 'D<{}>'. +!!! error TS2322: Type 'D<{}>' is not assignable to type 'C'. +!!! error TS2322: Property 'id' is missing in type 'D<{}>'. var aGenericClass: D = new C(); ~~~~~~~~~~~~~ -!!! error TS2323: Type 'C' is not assignable to type 'D'. -!!! error TS2323: Property 'source' is missing in type 'C'. +!!! error TS2322: Type 'C' is not assignable to type 'D'. +!!! error TS2322: Property 'source' is missing in type 'C'. var anObjectLiteral: I = { id: 'a string' }; ~~~~~~~~~~~~~~~ -!!! error TS2323: Type '{ id: string; }' is not assignable to type 'I'. -!!! error TS2323: Types of property 'id' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '{ id: string; }' is not assignable to type 'I'. +!!! error TS2322: Types of property 'id' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var anOtherObjectLiteral: { id: string } = new C(); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'C' is not assignable to type '{ id: string; }'. -!!! error TS2323: Types of property 'id' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'C' is not assignable to type '{ id: string; }'. +!!! error TS2322: Types of property 'id' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var aFunction: typeof F = F2; ~~~~~~~~~ -!!! error TS2323: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var anOtherFunction: (x: string) => number = F2; ~~~~~~~~~~~~~~~ -!!! error TS2323: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: string) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var aLambda: typeof F = (x) => 'a string'; ~~~~~~~ -!!! error TS2323: Type '(x: string) => string' is not assignable to type '(x: string) => number'. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: string) => number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var aModule: typeof M = N; ~~~~~~~ -!!! error TS2323: Type 'typeof N' is not assignable to type 'typeof M'. -!!! error TS2323: Types of property 'A' are incompatible. -!!! error TS2323: Type 'typeof A' is not assignable to type 'typeof A'. -!!! error TS2323: Type 'A' is not assignable to type 'A'. -!!! error TS2323: Property 'name' is missing in type 'A'. +!!! error TS2322: Type 'typeof N' is not assignable to type 'typeof M'. +!!! error TS2322: Types of property 'A' are incompatible. +!!! error TS2322: Type 'typeof A' is not assignable to type 'typeof A'. +!!! error TS2322: Type 'A' is not assignable to type 'A'. +!!! error TS2322: Property 'name' is missing in type 'A'. var aClassInModule: M.A = new N.A(); ~~~~~~~~~~~~~~ -!!! error TS2323: Type 'A' is not assignable to type 'A'. +!!! error TS2322: Type 'A' is not assignable to type 'A'. var aFunctionInModule: typeof M.F2 = F2; ~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type '(x: number) => boolean' is not assignable to type '(x: number) => string'. -!!! error TS2323: Type 'boolean' is not assignable to type 'string'. +!!! error TS2322: Type '(x: number) => boolean' is not assignable to type '(x: number) => string'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt b/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt index 049e91b9b3d..a44c95377dc 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType2.errors.txt @@ -2,8 +2,8 @@ tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(7,7): error TS2420: C Types of property 'bar' are incompatible. Type '() => string' is not assignable to type '() => number'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(12,5): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(16,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(12,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(16,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/extendAndImplementTheSameBaseType2.ts (3 errors) ==== @@ -25,10 +25,10 @@ tests/cases/compiler/extendAndImplementTheSameBaseType2.ts(16,5): error TS2323: var d: D = new D(); var r: string = d.foo; ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var r2: number = d.foo; var r3: string = d.bar(); var r4: number = d.bar(); ~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/extendGenericArray.errors.txt b/tests/baselines/reference/extendGenericArray.errors.txt index 9a427267f1f..a524d522190 100644 --- a/tests/baselines/reference/extendGenericArray.errors.txt +++ b/tests/baselines/reference/extendGenericArray.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/extendGenericArray.ts(6,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/extendGenericArray.ts(6,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/extendGenericArray.ts (1 errors) ==== @@ -9,4 +9,4 @@ tests/cases/compiler/extendGenericArray.ts(6,5): error TS2323: Type 'string' is var arr: string[] = []; var x: number = arr.foo(); ~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/extendGenericArray2.errors.txt b/tests/baselines/reference/extendGenericArray2.errors.txt index f411207b225..169020fc1b2 100644 --- a/tests/baselines/reference/extendGenericArray2.errors.txt +++ b/tests/baselines/reference/extendGenericArray2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/extendGenericArray2.ts(8,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/extendGenericArray2.ts(8,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/extendGenericArray2.ts (1 errors) ==== @@ -11,4 +11,4 @@ tests/cases/compiler/extendGenericArray2.ts(8,5): error TS2323: Type 'string' is var arr: string[] = []; var y: number = arr.x; ~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/functionAssignment.errors.txt b/tests/baselines/reference/functionAssignment.errors.txt index c588d7fdc43..19fd0897f98 100644 --- a/tests/baselines/reference/functionAssignment.errors.txt +++ b/tests/baselines/reference/functionAssignment.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionAssignment.ts(22,5): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/functionAssignment.ts(22,5): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/functionAssignment.ts(34,17): error TS2339: Property 'length' does not exist on type 'number'. @@ -26,7 +26,7 @@ tests/cases/compiler/functionAssignment.ts(34,17): error TS2339: Property 'lengt var n = ''; n = 4; ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. }); function f3(a: { a: number; b: number; }) { } diff --git a/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt b/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt index dc46ff3ff1f..86c4728dda2 100644 --- a/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt +++ b/tests/baselines/reference/functionSignatureAssignmentCompat1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionSignatureAssignmentCompat1.ts(10,5): error TS2323: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc'. +tests/cases/compiler/functionSignatureAssignmentCompat1.ts(10,5): error TS2322: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc'. Types of parameters 'delimiter' and 'eventEmitter' are incompatible. Type 'string' is not assignable to type 'number'. @@ -15,7 +15,7 @@ tests/cases/compiler/functionSignatureAssignmentCompat1.ts(10,5): error TS2323: var c: ParserFunc = parsers.raw; // ok! var d: ParserFunc = parsers.readline; // not ok ~ -!!! error TS2323: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc'. -!!! error TS2323: Types of parameters 'delimiter' and 'eventEmitter' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc'. +!!! error TS2322: Types of parameters 'delimiter' and 'eventEmitter' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var e: ParserFunc = parsers.readline(); // ok \ No newline at end of file diff --git a/tests/baselines/reference/fuzzy.errors.txt b/tests/baselines/reference/fuzzy.errors.txt index 22e1f48ae0f..699841f8870 100644 --- a/tests/baselines/reference/fuzzy.errors.txt +++ b/tests/baselines/reference/fuzzy.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/fuzzy.ts(13,18): error TS2420: Class 'C' incorrectly implements interface 'I'. Property 'alsoWorks' is missing in type 'C'. -tests/cases/compiler/fuzzy.ts(21,20): error TS2323: Type '{ anything: number; oneI: C; }' is not assignable to type 'R'. +tests/cases/compiler/fuzzy.ts(21,20): error TS2322: Type '{ anything: number; oneI: C; }' is not assignable to type 'R'. Types of property 'oneI' are incompatible. Type 'C' is not assignable to type 'I'. tests/cases/compiler/fuzzy.ts(25,20): error TS2352: Neither type '{ oneI: C; }' nor type 'R' is assignable to the other. @@ -33,9 +33,9 @@ tests/cases/compiler/fuzzy.ts(25,20): error TS2352: Neither type '{ oneI: C; }' doesntWork():R { return { anything:1, oneI:this }; ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type '{ anything: number; oneI: C; }' is not assignable to type 'R'. -!!! error TS2323: Types of property 'oneI' are incompatible. -!!! error TS2323: Type 'C' is not assignable to type 'I'. +!!! error TS2322: Type '{ anything: number; oneI: C; }' is not assignable to type 'R'. +!!! error TS2322: Types of property 'oneI' are incompatible. +!!! error TS2322: Type 'C' is not assignable to type 'I'. } worksToo():R { diff --git a/tests/baselines/reference/genericArrayAssignment1.errors.txt b/tests/baselines/reference/genericArrayAssignment1.errors.txt index e555bbcf3f7..a0a6b020542 100644 --- a/tests/baselines/reference/genericArrayAssignment1.errors.txt +++ b/tests/baselines/reference/genericArrayAssignment1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericArrayAssignment1.ts(4,1): error TS2323: Type 'number[]' is not assignable to type 'string[]'. +tests/cases/compiler/genericArrayAssignment1.ts(4,1): error TS2322: Type 'number[]' is not assignable to type 'string[]'. Type 'number' is not assignable to type 'string'. @@ -8,5 +8,5 @@ tests/cases/compiler/genericArrayAssignment1.ts(4,1): error TS2323: Type 'number s = n; ~ -!!! error TS2323: Type 'number[]' is not assignable to type 'string[]'. -!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'number[]' is not assignable to type 'string[]'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericArrayMethods1.errors.txt b/tests/baselines/reference/genericArrayMethods1.errors.txt index 7341cde82d3..b5e766c54c4 100644 --- a/tests/baselines/reference/genericArrayMethods1.errors.txt +++ b/tests/baselines/reference/genericArrayMethods1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/genericArrayMethods1.ts(1,5): error TS2323: Type 'number[]' is not assignable to type 'string[]'. +tests/cases/compiler/genericArrayMethods1.ts(1,5): error TS2322: Type 'number[]' is not assignable to type 'string[]'. Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/genericArrayMethods1.ts (1 errors) ==== var x:string[] = [0,1].slice(0); // this should be an error ~ -!!! error TS2323: Type 'number[]' is not assignable to type 'string[]'. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number[]' is not assignable to type 'string[]'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt index 965523476a7..f335319cafd 100644 --- a/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt +++ b/tests/baselines/reference/genericAssignmentCompatWithInterfaces1.errors.txt @@ -1,17 +1,17 @@ -tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(12,5): error TS2323: Type '{ x: A; }' is not assignable to type 'I'. +tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(12,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I'. Types of property 'x' are incompatible. Type 'A' is not assignable to type 'Comparable'. Types of property 'compareTo' are incompatible. Type '(other: number) => number' is not assignable to type '(other: string) => number'. Types of parameters 'other' and 'other' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(13,5): error TS2323: Type '{ x: A; }' is not assignable to type 'I'. +tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(13,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I'. Types of property 'x' are incompatible. Type 'A' is not assignable to type 'Comparable'. -tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(16,5): error TS2323: Type '{ x: A; }' is not assignable to type 'I'. +tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(16,5): error TS2322: Type '{ x: A; }' is not assignable to type 'I'. Types of property 'x' are incompatible. Type 'A' is not assignable to type 'Comparable'. -tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(17,5): error TS2323: Type 'K' is not assignable to type 'I'. +tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(17,5): error TS2322: Type 'K' is not assignable to type 'I'. Types of property 'x' are incompatible. Type 'A' is not assignable to type 'Comparable'. @@ -30,29 +30,29 @@ tests/cases/compiler/genericAssignmentCompatWithInterfaces1.ts(17,5): error TS23 var z = { x: new A() }; var a1: I = { x: new A() }; ~~ -!!! error TS2323: Type '{ x: A; }' is not assignable to type 'I'. -!!! error TS2323: Types of property 'x' are incompatible. -!!! error TS2323: Type 'A' is not assignable to type 'Comparable'. -!!! error TS2323: Types of property 'compareTo' are incompatible. -!!! error TS2323: Type '(other: number) => number' is not assignable to type '(other: string) => number'. -!!! error TS2323: Types of parameters 'other' and 'other' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '{ x: A; }' is not assignable to type 'I'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'A' is not assignable to type 'Comparable'. +!!! error TS2322: Types of property 'compareTo' are incompatible. +!!! error TS2322: Type '(other: number) => number' is not assignable to type '(other: string) => number'. +!!! error TS2322: Types of parameters 'other' and 'other' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var a2: I = function (): { x: A } { ~~ -!!! error TS2323: Type '{ x: A; }' is not assignable to type 'I'. -!!! error TS2323: Types of property 'x' are incompatible. -!!! error TS2323: Type 'A' is not assignable to type 'Comparable'. +!!! error TS2322: Type '{ x: A; }' is not assignable to type 'I'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'A' is not assignable to type 'Comparable'. var z = { x: new A() }; return z; } (); var a3: I = z; ~~ -!!! error TS2323: Type '{ x: A; }' is not assignable to type 'I'. -!!! error TS2323: Types of property 'x' are incompatible. -!!! error TS2323: Type 'A' is not assignable to type 'Comparable'. +!!! error TS2322: Type '{ x: A; }' is not assignable to type 'I'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'A' is not assignable to type 'Comparable'. var a4: I = >z; ~~ -!!! error TS2323: Type 'K' is not assignable to type 'I'. -!!! error TS2323: Types of property 'x' are incompatible. -!!! error TS2323: Type 'A' is not assignable to type 'Comparable'. +!!! error TS2322: Type 'K' is not assignable to type 'I'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'A' is not assignable to type 'Comparable'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.errors.txt index ec1f654863f..2a7bfd696cc 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts(15,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts(18,9): error TS2413: Numeric index type 'T' is not assignable to string index type 'Object'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts(23,9): error TS2323: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts(23,9): error TS2322: Type 'T' is not assignable to type 'U'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts (3 errors) ==== @@ -32,5 +32,5 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObj var e = r2['1']; var u: U = r2[1]; // ok ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt index 45a64e62e5e..e9fae450377 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(5,33): error TS2323: Type 'number' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(5,33): error TS2322: Type 'number' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(6,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(6,37): error TS2323: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(6,37): error TS2322: Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(7,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(7,37): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(7,37): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(8,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(8,31): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(8,56): error TS2323: Type 'U' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(8,56): error TS2322: Type 'U' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(9,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(9,31): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(9,50): error TS2323: Type 'V' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(9,50): error TS2322: Type 'V' is not assignable to type 'U'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts (11 errors) ==== @@ -18,28 +18,28 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericC function foo2(x: T = undefined) { return x; } // ok function foo3(x: T = 1) { } // error ~~~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'T'. +!!! error TS2322: Type 'number' is not assignable to type 'T'. function foo4(x: T, y: U = x) { } // error ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. function foo5(x: U, y: T = x) { } // ok ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. function foo6(x: T, y: U, z: V = y) { } // error ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~ -!!! error TS2323: Type 'U' is not assignable to type 'V'. +!!! error TS2322: Type 'U' is not assignable to type 'V'. function foo7(x: V, y: U = x) { } // should be ok ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~~~~ !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~ -!!! error TS2323: Type 'V' is not assignable to type 'U'. \ No newline at end of file +!!! error TS2322: Type 'V' is not assignable to type 'U'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithTupleType.errors.txt b/tests/baselines/reference/genericCallWithTupleType.errors.txt index 930d3128452..bcf580320e5 100644 --- a/tests/baselines/reference/genericCallWithTupleType.errors.txt +++ b/tests/baselines/reference/genericCallWithTupleType.errors.txt @@ -1,18 +1,18 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(12,1): error TS2323: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(12,1): error TS2322: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]'. Types of property 'pop' are incompatible. Type '() => string | number | boolean' is not assignable to type '() => string | number'. Type 'string | number | boolean' is not assignable to type 'string | number'. Type 'boolean' is not assignable to type 'string | number'. Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(14,1): error TS2323: Type '{ a: string; }' is not assignable to type 'string | number'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(14,1): error TS2322: Type '{ a: string; }' is not assignable to type 'string | number'. Type '{ a: string; }' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,1): error TS2323: Type '[number, string]' is not assignable to type '[string, number]'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,1): error TS2322: Type '[number, string]' is not assignable to type '[string, number]'. Types of property '0' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(23,1): error TS2323: Type '[{}, {}]' is not assignable to type '[string, number]'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(23,1): error TS2322: Type '[{}, {}]' is not assignable to type '[string, number]'. Types of property '0' are incompatible. Type '{}' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(24,1): error TS2323: Type '[{}]' is not assignable to type '[{}, {}]'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(24,1): error TS2322: Type '[{}]' is not assignable to type '[{}, {}]'. Property '1' is missing in type '[{}]'. @@ -30,17 +30,17 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTup var e2 = i1.tuple1[1]; // number i1.tuple1 = ["foo", 5, false, true]; ~~~~~~~~~ -!!! error TS2323: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]'. -!!! error TS2323: Types of property 'pop' are incompatible. -!!! error TS2323: Type '() => string | number | boolean' is not assignable to type '() => string | number'. -!!! error TS2323: Type 'string | number | boolean' is not assignable to type 'string | number'. -!!! error TS2323: Type 'boolean' is not assignable to type 'string | number'. -!!! error TS2323: Type 'boolean' is not assignable to type 'number'. +!!! error TS2322: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]'. +!!! error TS2322: Types of property 'pop' are incompatible. +!!! error TS2322: Type '() => string | number | boolean' is not assignable to type '() => string | number'. +!!! error TS2322: Type 'string | number | boolean' is not assignable to type 'string | number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string | number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. var e3 = i1.tuple1[2]; // {} i1.tuple1[3] = { a: "string" }; ~~~~~~~~~~~~ -!!! error TS2323: Type '{ a: string; }' is not assignable to type 'string | number'. -!!! error TS2323: Type '{ a: string; }' is not assignable to type 'number'. +!!! error TS2322: Type '{ a: string; }' is not assignable to type 'string | number'. +!!! error TS2322: Type '{ a: string; }' is not assignable to type 'number'. var e4 = i1.tuple1[3]; // {} i2.tuple1 = ["foo", 5]; i2.tuple1 = ["foo", "bar"]; @@ -50,16 +50,16 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTup // error i1.tuple1 = [5, "foo"]; ~~~~~~~~~ -!!! error TS2323: Type '[number, string]' is not assignable to type '[string, number]'. -!!! error TS2323: Types of property '0' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '[number, string]' is not assignable to type '[string, number]'. +!!! error TS2322: Types of property '0' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. i1.tuple1 = [{}, {}]; ~~~~~~~~~ -!!! error TS2323: Type '[{}, {}]' is not assignable to type '[string, number]'. -!!! error TS2323: Types of property '0' are incompatible. -!!! error TS2323: Type '{}' is not assignable to type 'string'. +!!! error TS2322: Type '[{}, {}]' is not assignable to type '[string, number]'. +!!! error TS2322: Types of property '0' are incompatible. +!!! error TS2322: Type '{}' is not assignable to type 'string'. i2.tuple1 = [{}]; ~~~~~~~~~ -!!! error TS2323: Type '[{}]' is not assignable to type '[{}, {}]'. -!!! error TS2323: Property '1' is missing in type '[{}]'. +!!! error TS2322: Type '[{}]' is not assignable to type '[{}, {}]'. +!!! error TS2322: Property '1' is missing in type '[{}]'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCloneReturnTypes.errors.txt b/tests/baselines/reference/genericCloneReturnTypes.errors.txt index 626f53bddea..0e54ebc02cf 100644 --- a/tests/baselines/reference/genericCloneReturnTypes.errors.txt +++ b/tests/baselines/reference/genericCloneReturnTypes.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericCloneReturnTypes.ts(25,1): error TS2323: Type 'Bar' is not assignable to type 'Bar'. +tests/cases/compiler/genericCloneReturnTypes.ts(25,1): error TS2322: Type 'Bar' is not assignable to type 'Bar'. Type 'string' is not assignable to type 'number'. @@ -29,5 +29,5 @@ tests/cases/compiler/genericCloneReturnTypes.ts(25,1): error TS2323: Type 'Bar' is not assignable to type 'Bar'. -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'Bar' is not assignable to type 'Bar'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCloneReturnTypes2.errors.txt b/tests/baselines/reference/genericCloneReturnTypes2.errors.txt index c531ea31ccc..1ac5a862075 100644 --- a/tests/baselines/reference/genericCloneReturnTypes2.errors.txt +++ b/tests/baselines/reference/genericCloneReturnTypes2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericCloneReturnTypes2.ts(15,5): error TS2323: Type 'MyList' is not assignable to type 'MyList'. +tests/cases/compiler/genericCloneReturnTypes2.ts(15,5): error TS2322: Type 'MyList' is not assignable to type 'MyList'. Type 'string' is not assignable to type 'number'. @@ -19,5 +19,5 @@ tests/cases/compiler/genericCloneReturnTypes2.ts(15,5): error TS2323: Type 'MyLi var c: MyList = a.clone(); // bug was there was an error on this line var d: MyList = a.clone(); // error ~ -!!! error TS2323: Type 'MyList' is not assignable to type 'MyList'. -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'MyList' is not assignable to type 'MyList'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt index 51aac95daad..4ae63b6fc8e 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericDerivedTypeWithSpecializedBase.ts(11,1): error TS2323: Type 'B' is not assignable to type 'A'. +tests/cases/compiler/genericDerivedTypeWithSpecializedBase.ts(11,1): error TS2322: Type 'B' is not assignable to type 'A'. Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. @@ -16,7 +16,7 @@ tests/cases/compiler/genericDerivedTypeWithSpecializedBase.ts(11,1): error TS232 var y: B; x = y; // error ~ -!!! error TS2323: Type 'B' is not assignable to type 'A'. -!!! error TS2323: Types of property 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'B' is not assignable to type 'A'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt index 798557ef72d..38818b59863 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericDerivedTypeWithSpecializedBase2.ts(11,1): error TS2323: Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>'. +tests/cases/compiler/genericDerivedTypeWithSpecializedBase2.ts(11,1): error TS2322: Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>'. Types of property 'x' are incompatible. Type 'string' is not assignable to type '{ length: number; foo: number; }'. Property 'foo' is missing in type 'String'. @@ -17,8 +17,8 @@ tests/cases/compiler/genericDerivedTypeWithSpecializedBase2.ts(11,1): error TS23 var y: B; x = y; // error ~ -!!! error TS2323: Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>'. -!!! error TS2323: Types of property 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type '{ length: number; foo: number; }'. -!!! error TS2323: Property 'foo' is missing in type 'String'. +!!! error TS2322: Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type '{ length: number; foo: number; }'. +!!! error TS2322: Property 'foo' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/genericGetter.errors.txt b/tests/baselines/reference/genericGetter.errors.txt index 0b39758ad6c..3a8edb602e0 100644 --- a/tests/baselines/reference/genericGetter.errors.txt +++ b/tests/baselines/reference/genericGetter.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/genericGetter.ts(3,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/genericGetter.ts(9,5): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/genericGetter.ts(9,5): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/genericGetter.ts (2 errors) ==== @@ -15,4 +15,4 @@ tests/cases/compiler/genericGetter.ts(9,5): error TS2323: Type 'number' is not a var c = new C(); var r: string = c.x; ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericGetter3.errors.txt b/tests/baselines/reference/genericGetter3.errors.txt index a96a3cf8f5d..24b44af28ee 100644 --- a/tests/baselines/reference/genericGetter3.errors.txt +++ b/tests/baselines/reference/genericGetter3.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/genericGetter3.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/genericGetter3.ts(11,5): error TS2323: Type 'A' is not assignable to type 'string'. +tests/cases/compiler/genericGetter3.ts(11,5): error TS2322: Type 'A' is not assignable to type 'string'. ==== tests/cases/compiler/genericGetter3.ts (2 errors) ==== @@ -17,4 +17,4 @@ tests/cases/compiler/genericGetter3.ts(11,5): error TS2323: Type 'A' is var c = new C(); var r: string = c.x; ~ -!!! error TS2323: Type 'A' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'A' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericSpecializations3.errors.txt b/tests/baselines/reference/genericSpecializations3.errors.txt index e8e8804c0cc..ccaa839f9d0 100644 --- a/tests/baselines/reference/genericSpecializations3.errors.txt +++ b/tests/baselines/reference/genericSpecializations3.errors.txt @@ -3,12 +3,12 @@ tests/cases/compiler/genericSpecializations3.ts(8,7): error TS2420: Class 'IntFo Type '(x: string) => string' is not assignable to type '(x: number) => number'. Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/genericSpecializations3.ts(28,1): error TS2323: Type 'StringFoo2' is not assignable to type 'IntFoo'. +tests/cases/compiler/genericSpecializations3.ts(28,1): error TS2322: Type 'StringFoo2' is not assignable to type 'IntFoo'. Types of property 'foo' are incompatible. Type '(x: string) => string' is not assignable to type '(x: number) => number'. Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/genericSpecializations3.ts(29,1): error TS2323: Type 'IntFoo' is not assignable to type 'StringFoo2'. +tests/cases/compiler/genericSpecializations3.ts(29,1): error TS2322: Type 'IntFoo' is not assignable to type 'StringFoo2'. Types of property 'foo' are incompatible. Type '(x: number) => number' is not assignable to type '(x: string) => string'. Types of parameters 'x' and 'x' are incompatible. @@ -51,18 +51,18 @@ tests/cases/compiler/genericSpecializations3.ts(29,1): error TS2323: Type 'IntFo intFoo = stringFoo2; // error ~~~~~~ -!!! error TS2323: Type 'StringFoo2' is not assignable to type 'IntFoo'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type '(x: string) => string' is not assignable to type '(x: number) => number'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'StringFoo2' is not assignable to type 'IntFoo'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x: string) => string' is not assignable to type '(x: number) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. stringFoo2 = intFoo; // error ~~~~~~~~~~ -!!! error TS2323: Type 'IntFoo' is not assignable to type 'StringFoo2'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type '(x: number) => number' is not assignable to type '(x: string) => string'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'IntFoo' is not assignable to type 'StringFoo2'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x: number) => number' is not assignable to type '(x: string) => string'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. class StringFoo3 implements IFoo { // error diff --git a/tests/baselines/reference/genericTypeAssertions1.errors.txt b/tests/baselines/reference/genericTypeAssertions1.errors.txt index 4178b6730cd..5479c5f948e 100644 --- a/tests/baselines/reference/genericTypeAssertions1.errors.txt +++ b/tests/baselines/reference/genericTypeAssertions1.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/genericTypeAssertions1.ts(3,5): error TS2323: Type 'A' is not assignable to type 'A'. +tests/cases/compiler/genericTypeAssertions1.ts(3,5): error TS2322: Type 'A' is not assignable to type 'A'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/genericTypeAssertions1.ts(4,5): error TS2323: Type 'A>' is not assignable to type 'A'. +tests/cases/compiler/genericTypeAssertions1.ts(4,5): error TS2322: Type 'A>' is not assignable to type 'A'. Type 'A' is not assignable to type 'number'. tests/cases/compiler/genericTypeAssertions1.ts(4,21): error TS2352: Neither type 'A' nor type 'A>' is assignable to the other. Type 'number' is not assignable to type 'A'. @@ -11,12 +11,12 @@ tests/cases/compiler/genericTypeAssertions1.ts(4,21): error TS2352: Neither type var foo = new A(); var r: A = >new A(); // error ~ -!!! error TS2323: Type 'A' is not assignable to type 'A'. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'A' is not assignable to type 'A'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var r2: A = >>foo; // error ~~ -!!! error TS2323: Type 'A>' is not assignable to type 'A'. -!!! error TS2323: Type 'A' is not assignable to type 'number'. +!!! error TS2322: Type 'A>' is not assignable to type 'A'. +!!! error TS2322: Type 'A' is not assignable to type 'number'. ~~~~~~~~~~~~~~~~~ !!! error TS2352: Neither type 'A' nor type 'A>' is assignable to the other. !!! error TS2352: Type 'number' is not assignable to type 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeAssertions2.errors.txt b/tests/baselines/reference/genericTypeAssertions2.errors.txt index e2f4fab7b7b..eda4c83646c 100644 --- a/tests/baselines/reference/genericTypeAssertions2.errors.txt +++ b/tests/baselines/reference/genericTypeAssertions2.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/genericTypeAssertions2.ts(10,5): error TS2323: Type 'B' is not assignable to type 'A'. +tests/cases/compiler/genericTypeAssertions2.ts(10,5): error TS2322: Type 'B' is not assignable to type 'A'. Types of property 'foo' are incompatible. Type '(x: string) => void' is not assignable to type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/genericTypeAssertions2.ts(11,5): error TS2323: Type 'A' is not assignable to type 'B'. +tests/cases/compiler/genericTypeAssertions2.ts(11,5): error TS2322: Type 'A' is not assignable to type 'B'. Property 'bar' is missing in type 'A'. tests/cases/compiler/genericTypeAssertions2.ts(13,21): error TS2352: Neither type 'undefined[]' nor type 'A' is assignable to the other. Property 'foo' is missing in type 'undefined[]'. @@ -21,15 +21,15 @@ tests/cases/compiler/genericTypeAssertions2.ts(13,21): error TS2352: Neither typ var r: A = >new B(); var r2: A = >new B(); // error ~~ -!!! error TS2323: Type 'B' is not assignable to type 'A'. -!!! error TS2323: Types of property 'foo' are incompatible. -!!! error TS2323: Type '(x: string) => void' is not assignable to type '(x: number) => void'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'B' is not assignable to type 'A'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type '(x: string) => void' is not assignable to type '(x: number) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var r3: B = >new B(); // error ~~ -!!! error TS2323: Type 'A' is not assignable to type 'B'. -!!! error TS2323: Property 'bar' is missing in type 'A'. +!!! error TS2322: Type 'A' is not assignable to type 'B'. +!!! error TS2322: Property 'bar' is missing in type 'A'. var r4: A = >new A(); var r5: A = >[]; // error ~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/genericTypeAssertions4.errors.txt b/tests/baselines/reference/genericTypeAssertions4.errors.txt index 2a29eac6220..055de774b39 100644 --- a/tests/baselines/reference/genericTypeAssertions4.errors.txt +++ b/tests/baselines/reference/genericTypeAssertions4.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/genericTypeAssertions4.ts(19,5): error TS2323: Type 'A' is not assignable to type 'T'. -tests/cases/compiler/genericTypeAssertions4.ts(20,5): error TS2323: Type 'B' is not assignable to type 'T'. -tests/cases/compiler/genericTypeAssertions4.ts(21,5): error TS2323: Type 'C' is not assignable to type 'T'. +tests/cases/compiler/genericTypeAssertions4.ts(19,5): error TS2322: Type 'A' is not assignable to type 'T'. +tests/cases/compiler/genericTypeAssertions4.ts(20,5): error TS2322: Type 'B' is not assignable to type 'T'. +tests/cases/compiler/genericTypeAssertions4.ts(21,5): error TS2322: Type 'C' is not assignable to type 'T'. tests/cases/compiler/genericTypeAssertions4.ts(23,9): error TS2352: Neither type 'B' nor type 'T' is assignable to the other. tests/cases/compiler/genericTypeAssertions4.ts(24,9): error TS2352: Neither type 'C' nor type 'T' is assignable to the other. @@ -26,13 +26,13 @@ tests/cases/compiler/genericTypeAssertions4.ts(24,9): error TS2352: Neither type var y = x; y = a; // error: cannot convert A to T ~ -!!! error TS2323: Type 'A' is not assignable to type 'T'. +!!! error TS2322: Type 'A' is not assignable to type 'T'. y = b; // error: cannot convert B to T ~ -!!! error TS2323: Type 'B' is not assignable to type 'T'. +!!! error TS2322: Type 'B' is not assignable to type 'T'. y = c; // error: cannot convert C to T ~ -!!! error TS2323: Type 'C' is not assignable to type 'T'. +!!! error TS2322: Type 'C' is not assignable to type 'T'. y = a; y = b; // error: cannot convert B to T ~~~~ diff --git a/tests/baselines/reference/genericTypeAssertions5.errors.txt b/tests/baselines/reference/genericTypeAssertions5.errors.txt index 3c53a791b9b..e315a7f122a 100644 --- a/tests/baselines/reference/genericTypeAssertions5.errors.txt +++ b/tests/baselines/reference/genericTypeAssertions5.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/genericTypeAssertions5.ts(19,5): error TS2323: Type 'A' is not assignable to type 'T'. -tests/cases/compiler/genericTypeAssertions5.ts(20,5): error TS2323: Type 'B' is not assignable to type 'T'. -tests/cases/compiler/genericTypeAssertions5.ts(21,5): error TS2323: Type 'C' is not assignable to type 'T'. +tests/cases/compiler/genericTypeAssertions5.ts(19,5): error TS2322: Type 'A' is not assignable to type 'T'. +tests/cases/compiler/genericTypeAssertions5.ts(20,5): error TS2322: Type 'B' is not assignable to type 'T'. +tests/cases/compiler/genericTypeAssertions5.ts(21,5): error TS2322: Type 'C' is not assignable to type 'T'. tests/cases/compiler/genericTypeAssertions5.ts(23,9): error TS2352: Neither type 'B' nor type 'T' is assignable to the other. tests/cases/compiler/genericTypeAssertions5.ts(24,9): error TS2352: Neither type 'C' nor type 'T' is assignable to the other. @@ -26,13 +26,13 @@ tests/cases/compiler/genericTypeAssertions5.ts(24,9): error TS2352: Neither type var y = x; y = a; // error: cannot convert A to T ~ -!!! error TS2323: Type 'A' is not assignable to type 'T'. +!!! error TS2322: Type 'A' is not assignable to type 'T'. y = b; // error: cannot convert B to T ~ -!!! error TS2323: Type 'B' is not assignable to type 'T'. +!!! error TS2322: Type 'B' is not assignable to type 'T'. y = c; // error: cannot convert C to T ~ -!!! error TS2323: Type 'C' is not assignable to type 'T'. +!!! error TS2322: Type 'C' is not assignable to type 'T'. y = a; y = b; // error: cannot convert B to T ~~~~ diff --git a/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt index 13ab681e4e5..ae93d059f9a 100644 --- a/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt +++ b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.errors.txt @@ -5,7 +5,7 @@ tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(4,7): error TS2420 Type 'T' is not assignable to type '{ a: number; }'. Types of property 'a' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(8,5): error TS2323: Type 'X<{ a: string; }>' is not assignable to type 'I'. +tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(8,5): error TS2322: Type 'X<{ a: string; }>' is not assignable to type 'I'. Types of property 'f' are incompatible. Type '(a: { a: string; }) => void' is not assignable to type '(a: { a: number; }) => void'. Types of parameters 'a' and 'a' are incompatible. @@ -32,11 +32,11 @@ tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts(8,5): error TS2323 var x = new X<{ a: string }>(); var i: I = x; // Should not be allowed -- type of 'f' is incompatible with 'I' ~ -!!! error TS2323: Type 'X<{ a: string; }>' is not assignable to type 'I'. -!!! error TS2323: Types of property 'f' are incompatible. -!!! error TS2323: Type '(a: { a: string; }) => void' is not assignable to type '(a: { a: number; }) => void'. -!!! error TS2323: Types of parameters 'a' and 'a' are incompatible. -!!! error TS2323: Type '{ a: string; }' is not assignable to type '{ a: number; }'. -!!! error TS2323: Types of property 'a' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'X<{ a: string; }>' is not assignable to type 'I'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '(a: { a: string; }) => void' is not assignable to type '(a: { a: number; }) => void'. +!!! error TS2322: Types of parameters 'a' and 'a' are incompatible. +!!! error TS2322: Type '{ a: string; }' is not assignable to type '{ a: number; }'. +!!! error TS2322: Types of property 'a' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/generics4.errors.txt b/tests/baselines/reference/generics4.errors.txt index 5824ce7958a..06bfa122901 100644 --- a/tests/baselines/reference/generics4.errors.txt +++ b/tests/baselines/reference/generics4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/generics4.ts(7,1): error TS2323: Type 'C' is not assignable to type 'C'. +tests/cases/compiler/generics4.ts(7,1): error TS2322: Type 'C' is not assignable to type 'C'. Type 'Y' is not assignable to type 'X'. Types of property 'f' are incompatible. Type '() => boolean' is not assignable to type '() => string'. @@ -14,8 +14,8 @@ tests/cases/compiler/generics4.ts(7,1): error TS2323: Type 'C' is not assigna a = b; // Not ok - return types of "f" are different ~ -!!! error TS2323: Type 'C' is not assignable to type 'C'. -!!! error TS2323: Type 'Y' is not assignable to type 'X'. -!!! error TS2323: Types of property 'f' are incompatible. -!!! error TS2323: Type '() => boolean' is not assignable to type '() => string'. -!!! error TS2323: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'C' is not assignable to type 'C'. +!!! error TS2322: Type 'Y' is not assignable to type 'X'. +!!! error TS2322: Types of property 'f' are incompatible. +!!! error TS2322: Type '() => boolean' is not assignable to type '() => string'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt b/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt index 1c9d42c9abc..69d367bb21c 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt +++ b/tests/baselines/reference/getAndSetNotIdenticalType2.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/getAndSetNotIdenticalType2.ts(5,9): error TS1056: Accessors tests/cases/compiler/getAndSetNotIdenticalType2.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/getAndSetNotIdenticalType2.ts(5,5): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/compiler/getAndSetNotIdenticalType2.ts(8,5): error TS2380: 'get' and 'set' accessor must have the same type. -tests/cases/compiler/getAndSetNotIdenticalType2.ts(9,9): error TS2323: Type 'A' is not assignable to type 'A'. +tests/cases/compiler/getAndSetNotIdenticalType2.ts(9,9): error TS2322: Type 'A' is not assignable to type 'A'. Type 'string' is not assignable to type 'T'. @@ -27,8 +27,8 @@ tests/cases/compiler/getAndSetNotIdenticalType2.ts(9,9): error TS2323: Type 'A' is not assignable to type 'A'. -!!! error TS2323: Type 'string' is not assignable to type 'T'. +!!! error TS2322: Type 'A' is not assignable to type 'A'. +!!! error TS2322: Type 'string' is not assignable to type 'T'. } ~~~~~ !!! error TS2380: 'get' and 'set' accessor must have the same type. diff --git a/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt b/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt index 7590f50815d..bca86419f62 100644 --- a/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt +++ b/tests/baselines/reference/getAndSetNotIdenticalType3.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/getAndSetNotIdenticalType3.ts(5,9): error TS1056: Accessors tests/cases/compiler/getAndSetNotIdenticalType3.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/getAndSetNotIdenticalType3.ts(5,5): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/compiler/getAndSetNotIdenticalType3.ts(8,5): error TS2380: 'get' and 'set' accessor must have the same type. -tests/cases/compiler/getAndSetNotIdenticalType3.ts(9,9): error TS2323: Type 'A' is not assignable to type 'A'. +tests/cases/compiler/getAndSetNotIdenticalType3.ts(9,9): error TS2322: Type 'A' is not assignable to type 'A'. Type 'string' is not assignable to type 'number'. @@ -27,8 +27,8 @@ tests/cases/compiler/getAndSetNotIdenticalType3.ts(9,9): error TS2323: Type 'A' is not assignable to type 'A'. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'A' is not assignable to type 'A'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. } ~~~~~ !!! error TS2380: 'get' and 'set' accessor must have the same type. diff --git a/tests/baselines/reference/i3.errors.txt b/tests/baselines/reference/i3.errors.txt index 39a62340d53..ef7aefa4598 100644 --- a/tests/baselines/reference/i3.errors.txt +++ b/tests/baselines/reference/i3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/i3.ts(6,1): error TS2323: Type 'I3' is not assignable to type '{ one: number; }'. +tests/cases/compiler/i3.ts(6,1): error TS2322: Type 'I3' is not assignable to type '{ one: number; }'. Property 'one' is optional in type 'I3' but required in type '{ one: number; }'. @@ -10,5 +10,5 @@ tests/cases/compiler/i3.ts(6,1): error TS2323: Type 'I3' is not assignable to ty i = x; x = i; ~ -!!! error TS2323: Type 'I3' is not assignable to type '{ one: number; }'. -!!! error TS2323: Property 'one' is optional in type 'I3' but required in type '{ one: number; }'. \ No newline at end of file +!!! error TS2322: Type 'I3' is not assignable to type '{ one: number; }'. +!!! error TS2322: Property 'one' is optional in type 'I3' but required in type '{ one: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/incompatibleGenericTypes.errors.txt b/tests/baselines/reference/incompatibleGenericTypes.errors.txt index 04c00f4fa20..e5dc6ed5b3c 100644 --- a/tests/baselines/reference/incompatibleGenericTypes.errors.txt +++ b/tests/baselines/reference/incompatibleGenericTypes.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/incompatibleGenericTypes.ts(10,5): error TS2323: Type 'I1' is not assignable to type 'I1'. +tests/cases/compiler/incompatibleGenericTypes.ts(10,5): error TS2322: Type 'I1' is not assignable to type 'I1'. Type 'boolean' is not assignable to type 'number'. @@ -14,5 +14,5 @@ tests/cases/compiler/incompatibleGenericTypes.ts(10,5): error TS2323: Type 'I1 = v1; ~~ -!!! error TS2323: Type 'I1' is not assignable to type 'I1'. -!!! error TS2323: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'I1' is not assignable to type 'I1'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index 9b66a6e8c64..14dfa883f45 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -17,10 +17,10 @@ tests/cases/compiler/incompatibleTypes.ts(33,7): error TS2420: Class 'C4' incorr tests/cases/compiler/incompatibleTypes.ts(42,5): error TS2345: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. tests/cases/compiler/incompatibleTypes.ts(49,5): error TS2345: Argument of type '{ e: number; f: number; }' is not assignable to parameter of type '{ c: { b: string; }; d: string; }'. Property 'c' is missing in type '{ e: number; f: number; }'. -tests/cases/compiler/incompatibleTypes.ts(66,5): error TS2323: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. +tests/cases/compiler/incompatibleTypes.ts(66,5): error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. Property 'a' is missing in type '{ e: number; f: number; }'. -tests/cases/compiler/incompatibleTypes.ts(72,5): error TS2323: Type 'number' is not assignable to type '() => string'. -tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2323: Type '(a: any) => number' is not assignable to type '() => any'. +tests/cases/compiler/incompatibleTypes.ts(72,5): error TS2322: Type 'number' is not assignable to type '() => string'. +tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => number' is not assignable to type '() => any'. ==== tests/cases/compiler/incompatibleTypes.ts (9 errors) ==== @@ -116,8 +116,8 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2323: Type '(a: any) => var o1: { a: { a: string; }; b: string; } = { e: 0, f: 0 }; ~~ -!!! error TS2323: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. -!!! error TS2323: Property 'a' is missing in type '{ e: number; f: number; }'. +!!! error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. +!!! error TS2322: Property 'a' is missing in type '{ e: number; f: number; }'. var a1 = [{ e: 0, f: 0 }, { e: 0, f: 0 }, { e: 0, g: 0 }]; @@ -125,9 +125,9 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2323: Type '(a: any) => var i1c1: { (): string; } = 5; ~~~~ -!!! error TS2323: Type 'number' is not assignable to type '() => string'. +!!! error TS2322: Type 'number' is not assignable to type '() => string'. var fp1: () =>any = a => 0; ~~~ -!!! error TS2323: Type '(a: any) => number' is not assignable to type '() => any'. +!!! error TS2322: Type '(a: any) => number' is not assignable to type '() => any'. \ No newline at end of file diff --git a/tests/baselines/reference/incrementOperatorWithEnumType.js b/tests/baselines/reference/incrementOperatorWithEnumType.js index 2baa326f399..590815ffec5 100644 --- a/tests/baselines/reference/incrementOperatorWithEnumType.js +++ b/tests/baselines/reference/incrementOperatorWithEnumType.js @@ -22,8 +22,8 @@ var ENUM1; })(ENUM1 || (ENUM1 = {})); ; // expression -var ResultIsNumber1 = ++ENUM1["B"]; +var ResultIsNumber1 = ++1 /* "B" */; var ResultIsNumber2 = 1 /* B */++; // miss assignment operator -++ENUM1["B"]; +++1 /* "B" */; 1 /* B */++; diff --git a/tests/baselines/reference/indexIntoArraySubclass.errors.txt b/tests/baselines/reference/indexIntoArraySubclass.errors.txt index 297ef6a960b..1628e12d22f 100644 --- a/tests/baselines/reference/indexIntoArraySubclass.errors.txt +++ b/tests/baselines/reference/indexIntoArraySubclass.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/indexIntoArraySubclass.ts(4,1): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/indexIntoArraySubclass.ts(4,1): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/indexIntoArraySubclass.ts (1 errors) ==== @@ -7,4 +7,4 @@ tests/cases/compiler/indexIntoArraySubclass.ts(4,1): error TS2323: Type 'number' var r = x2[0]; // string r = 0; //error ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/indexerAssignability.errors.txt b/tests/baselines/reference/indexerAssignability.errors.txt index 8f7f1c11d6c..9f28fc1e9e0 100644 --- a/tests/baselines/reference/indexerAssignability.errors.txt +++ b/tests/baselines/reference/indexerAssignability.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/indexerAssignability.ts(5,1): error TS2323: Type '{ [x: number]: string; }' is not assignable to type '{ [x: string]: string; }'. +tests/cases/compiler/indexerAssignability.ts(5,1): error TS2322: Type '{ [x: number]: string; }' is not assignable to type '{ [x: string]: string; }'. Index signature is missing in type '{ [x: number]: string; }'. -tests/cases/compiler/indexerAssignability.ts(6,1): error TS2323: Type '{}' is not assignable to type '{ [x: string]: string; }'. +tests/cases/compiler/indexerAssignability.ts(6,1): error TS2322: Type '{}' is not assignable to type '{ [x: string]: string; }'. Index signature is missing in type '{}'. -tests/cases/compiler/indexerAssignability.ts(8,1): error TS2323: Type '{}' is not assignable to type '{ [x: number]: string; }'. +tests/cases/compiler/indexerAssignability.ts(8,1): error TS2322: Type '{}' is not assignable to type '{ [x: number]: string; }'. Index signature is missing in type '{}'. @@ -13,16 +13,16 @@ tests/cases/compiler/indexerAssignability.ts(8,1): error TS2323: Type '{}' is no a = b; ~ -!!! error TS2323: Type '{ [x: number]: string; }' is not assignable to type '{ [x: string]: string; }'. -!!! error TS2323: Index signature is missing in type '{ [x: number]: string; }'. +!!! error TS2322: Type '{ [x: number]: string; }' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2322: Index signature is missing in type '{ [x: number]: string; }'. a = c; ~ -!!! error TS2323: Type '{}' is not assignable to type '{ [x: string]: string; }'. -!!! error TS2323: Index signature is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2322: Index signature is missing in type '{}'. b = a; b = c; ~ -!!! error TS2323: Type '{}' is not assignable to type '{ [x: number]: string; }'. -!!! error TS2323: Index signature is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type '{ [x: number]: string; }'. +!!! error TS2322: Index signature is missing in type '{}'. c = a; c = b; \ No newline at end of file diff --git a/tests/baselines/reference/inferSetterParamType.errors.txt b/tests/baselines/reference/inferSetterParamType.errors.txt index 9b01d9c4bc6..c9232d3fac7 100644 --- a/tests/baselines/reference/inferSetterParamType.errors.txt +++ b/tests/baselines/reference/inferSetterParamType.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/inferSetterParamType.ts(3,9): error TS1056: Accessors are o tests/cases/compiler/inferSetterParamType.ts(6,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inferSetterParamType.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inferSetterParamType.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/inferSetterParamType.ts(13,16): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/inferSetterParamType.ts(13,16): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/inferSetterParamType.ts (5 errors) ==== @@ -26,7 +26,7 @@ tests/cases/compiler/inferSetterParamType.ts(13,16): error TS2323: Type 'number' !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 0; // should be an error - can't coerce infered return type to match setter annotated type ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. } set bar(n:string) { ~~~ diff --git a/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt b/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt index 0c87fb6d22d..9dfb41c0fac 100644 --- a/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt +++ b/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(4,1): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(5,1): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(4,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(5,1): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts (2 errors) ==== @@ -8,8 +8,8 @@ tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(5,1): error } f({ x: [null] }, { x: [1] }).x[0] = "" // ok ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. f({ x: [1] }, { x: [null] }).x[0] = "" // was error TS2011: Cannot convert 'string' to 'number'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/infiniteExpansionThroughInstantiation.errors.txt b/tests/baselines/reference/infiniteExpansionThroughInstantiation.errors.txt index adbc31af210..c8367bef57b 100644 --- a/tests/baselines/reference/infiniteExpansionThroughInstantiation.errors.txt +++ b/tests/baselines/reference/infiniteExpansionThroughInstantiation.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation.ts(16,1): error TS2323: Type 'OwnerList' is not assignable to type 'List'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation.ts(16,1): error TS2322: Type 'OwnerList' is not assignable to type 'List'. Types of property 'data' are incompatible. Type 'List' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation.ts(21,5): error TS2323: Type 'OwnerList' is not assignable to type 'List'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation.ts(21,5): error TS2322: Type 'OwnerList' is not assignable to type 'List'. Types of property 'data' are incompatible. Type 'List' is not assignable to type 'T'. @@ -24,18 +24,18 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansion var ownerList: OwnerList; list = ownerList; ~~~~ -!!! error TS2323: Type 'OwnerList' is not assignable to type 'List'. -!!! error TS2323: Types of property 'data' are incompatible. -!!! error TS2323: Type 'List' is not assignable to type 'string'. +!!! error TS2322: Type 'OwnerList' is not assignable to type 'List'. +!!! error TS2322: Types of property 'data' are incompatible. +!!! error TS2322: Type 'List' is not assignable to type 'string'. function other(x: T) { var list: List; var ownerList: OwnerList; list = ownerList; ~~~~ -!!! error TS2323: Type 'OwnerList' is not assignable to type 'List'. -!!! error TS2323: Types of property 'data' are incompatible. -!!! error TS2323: Type 'List' is not assignable to type 'T'. +!!! error TS2322: Type 'OwnerList' is not assignable to type 'List'. +!!! error TS2322: Types of property 'data' are incompatible. +!!! error TS2322: Type 'List' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/inheritance1.errors.txt b/tests/baselines/reference/inheritance1.errors.txt index 65cba48d34e..f33dd120e76 100644 --- a/tests/baselines/reference/inheritance1.errors.txt +++ b/tests/baselines/reference/inheritance1.errors.txt @@ -2,23 +2,23 @@ tests/cases/compiler/inheritance1.ts(14,7): error TS2420: Class 'ImageBase' inco Property 'select' is missing in type 'ImageBase'. tests/cases/compiler/inheritance1.ts(18,7): error TS2420: Class 'Locations' incorrectly implements interface 'SelectableControl'. Property 'state' is missing in type 'Locations'. -tests/cases/compiler/inheritance1.ts(31,1): error TS2323: Type 'Control' is not assignable to type 'Button'. +tests/cases/compiler/inheritance1.ts(31,1): error TS2322: Type 'Control' is not assignable to type 'Button'. Property 'select' is missing in type 'Control'. -tests/cases/compiler/inheritance1.ts(37,1): error TS2323: Type 'Control' is not assignable to type 'TextBox'. +tests/cases/compiler/inheritance1.ts(37,1): error TS2322: Type 'Control' is not assignable to type 'TextBox'. Property 'select' is missing in type 'Control'. -tests/cases/compiler/inheritance1.ts(40,1): error TS2323: Type 'ImageBase' is not assignable to type 'SelectableControl'. -tests/cases/compiler/inheritance1.ts(46,1): error TS2323: Type 'Image1' is not assignable to type 'SelectableControl'. +tests/cases/compiler/inheritance1.ts(40,1): error TS2322: Type 'ImageBase' is not assignable to type 'SelectableControl'. +tests/cases/compiler/inheritance1.ts(46,1): error TS2322: Type 'Image1' is not assignable to type 'SelectableControl'. Property 'select' is missing in type 'Image1'. -tests/cases/compiler/inheritance1.ts(52,1): error TS2323: Type 'Locations' is not assignable to type 'SelectableControl'. -tests/cases/compiler/inheritance1.ts(53,1): error TS2323: Type 'Locations' is not assignable to type 'Control'. +tests/cases/compiler/inheritance1.ts(52,1): error TS2322: Type 'Locations' is not assignable to type 'SelectableControl'. +tests/cases/compiler/inheritance1.ts(53,1): error TS2322: Type 'Locations' is not assignable to type 'Control'. Property 'state' is missing in type 'Locations'. -tests/cases/compiler/inheritance1.ts(55,1): error TS2323: Type 'Control' is not assignable to type 'Locations'. +tests/cases/compiler/inheritance1.ts(55,1): error TS2322: Type 'Control' is not assignable to type 'Locations'. Property 'select' is missing in type 'Control'. -tests/cases/compiler/inheritance1.ts(58,1): error TS2323: Type 'Locations1' is not assignable to type 'SelectableControl'. +tests/cases/compiler/inheritance1.ts(58,1): error TS2322: Type 'Locations1' is not assignable to type 'SelectableControl'. Property 'state' is missing in type 'Locations1'. -tests/cases/compiler/inheritance1.ts(59,1): error TS2323: Type 'Locations1' is not assignable to type 'Control'. +tests/cases/compiler/inheritance1.ts(59,1): error TS2322: Type 'Locations1' is not assignable to type 'Control'. Property 'state' is missing in type 'Locations1'. -tests/cases/compiler/inheritance1.ts(61,1): error TS2323: Type 'Control' is not assignable to type 'Locations1'. +tests/cases/compiler/inheritance1.ts(61,1): error TS2322: Type 'Control' is not assignable to type 'Locations1'. Property 'select' is missing in type 'Control'. @@ -61,8 +61,8 @@ tests/cases/compiler/inheritance1.ts(61,1): error TS2323: Type 'Control' is not b = sc; b = c; ~ -!!! error TS2323: Type 'Control' is not assignable to type 'Button'. -!!! error TS2323: Property 'select' is missing in type 'Control'. +!!! error TS2322: Type 'Control' is not assignable to type 'Button'. +!!! error TS2322: Property 'select' is missing in type 'Control'. var t: TextBox; sc = t; @@ -70,13 +70,13 @@ tests/cases/compiler/inheritance1.ts(61,1): error TS2323: Type 'Control' is not t = sc; t = c; ~ -!!! error TS2323: Type 'Control' is not assignable to type 'TextBox'. -!!! error TS2323: Property 'select' is missing in type 'Control'. +!!! error TS2322: Type 'Control' is not assignable to type 'TextBox'. +!!! error TS2322: Property 'select' is missing in type 'Control'. var i: ImageBase; sc = i; ~~ -!!! error TS2323: Type 'ImageBase' is not assignable to type 'SelectableControl'. +!!! error TS2322: Type 'ImageBase' is not assignable to type 'SelectableControl'. c = i; i = sc; i = c; @@ -84,8 +84,8 @@ tests/cases/compiler/inheritance1.ts(61,1): error TS2323: Type 'Control' is not var i1: Image1; sc = i1; ~~ -!!! error TS2323: Type 'Image1' is not assignable to type 'SelectableControl'. -!!! error TS2323: Property 'select' is missing in type 'Image1'. +!!! error TS2322: Type 'Image1' is not assignable to type 'SelectableControl'. +!!! error TS2322: Property 'select' is missing in type 'Image1'. c = i1; i1 = sc; i1 = c; @@ -93,28 +93,28 @@ tests/cases/compiler/inheritance1.ts(61,1): error TS2323: Type 'Control' is not var l: Locations; sc = l; ~~ -!!! error TS2323: Type 'Locations' is not assignable to type 'SelectableControl'. +!!! error TS2322: Type 'Locations' is not assignable to type 'SelectableControl'. c = l; ~ -!!! error TS2323: Type 'Locations' is not assignable to type 'Control'. -!!! error TS2323: Property 'state' is missing in type 'Locations'. +!!! error TS2322: Type 'Locations' is not assignable to type 'Control'. +!!! error TS2322: Property 'state' is missing in type 'Locations'. l = sc; l = c; ~ -!!! error TS2323: Type 'Control' is not assignable to type 'Locations'. -!!! error TS2323: Property 'select' is missing in type 'Control'. +!!! error TS2322: Type 'Control' is not assignable to type 'Locations'. +!!! error TS2322: Property 'select' is missing in type 'Control'. var l1: Locations1; sc = l1; ~~ -!!! error TS2323: Type 'Locations1' is not assignable to type 'SelectableControl'. -!!! error TS2323: Property 'state' is missing in type 'Locations1'. +!!! error TS2322: Type 'Locations1' is not assignable to type 'SelectableControl'. +!!! error TS2322: Property 'state' is missing in type 'Locations1'. c = l1; ~ -!!! error TS2323: Type 'Locations1' is not assignable to type 'Control'. -!!! error TS2323: Property 'state' is missing in type 'Locations1'. +!!! error TS2322: Type 'Locations1' is not assignable to type 'Control'. +!!! error TS2322: Property 'state' is missing in type 'Locations1'. l1 = sc; l1 = c; ~~ -!!! error TS2323: Type 'Control' is not assignable to type 'Locations1'. -!!! error TS2323: Property 'select' is missing in type 'Control'. \ No newline at end of file +!!! error TS2322: Type 'Control' is not assignable to type 'Locations1'. +!!! error TS2322: Property 'select' is missing in type 'Control'. \ No newline at end of file diff --git a/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt b/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt index 93f66768b35..b5e56d2f4e3 100644 --- a/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt +++ b/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/innerTypeCheckOfLambdaArgument.ts(10,7): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/innerTypeCheckOfLambdaArgument.ts(10,7): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/innerTypeCheckOfLambdaArgument.ts (1 errors) ==== @@ -13,7 +13,7 @@ tests/cases/compiler/innerTypeCheckOfLambdaArgument.ts(10,7): error TS2323: Type // otherwise, there's a bug in overload resolution / partial typechecking var k: string = 10; ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. } ); \ No newline at end of file diff --git a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt index 4a52cbeecfc..080316f8daf 100644 --- a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt +++ b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/instanceMemberAssignsToClassPrototype.ts(7,9): error TS2323: Type '() => void' is not assignable to type '(x: number) => number'. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/instanceMemberAssignsToClassPrototype.ts(7,9): error TS2322: Type '() => void' is not assignable to type '(x: number) => number'. Type 'void' is not assignable to type 'number'. @@ -11,8 +11,8 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclara bar(x: number): number { C.prototype.bar = () => { } // error ~~~~~~~~~~~~~~~ -!!! error TS2323: Type '() => void' is not assignable to type '(x: number) => number'. -!!! error TS2323: Type 'void' is not assignable to type 'number'. +!!! error TS2322: Type '() => void' is not assignable to type '(x: number) => number'. +!!! error TS2322: Type 'void' is not assignable to type 'number'. C.prototype.bar = (x) => x; // ok C.prototype.bar = (x: number) => 1; // ok return 1; diff --git a/tests/baselines/reference/intTypeCheck.errors.txt b/tests/baselines/reference/intTypeCheck.errors.txt index 01235160e2f..e6cfc73230a 100644 --- a/tests/baselines/reference/intTypeCheck.errors.txt +++ b/tests/baselines/reference/intTypeCheck.errors.txt @@ -13,79 +13,79 @@ tests/cases/compiler/intTypeCheck.ts(174,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(188,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(202,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(83,5): error TS2386: Overload signatures must all be optional or required. -tests/cases/compiler/intTypeCheck.ts(97,5): error TS2323: Type 'Object' is not assignable to type 'i1'. +tests/cases/compiler/intTypeCheck.ts(97,5): error TS2322: Type 'Object' is not assignable to type 'i1'. Property 'p' is missing in type 'Object'. tests/cases/compiler/intTypeCheck.ts(98,16): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(99,5): error TS2323: Type 'Base' is not assignable to type 'i1'. +tests/cases/compiler/intTypeCheck.ts(99,5): error TS2322: Type 'Base' is not assignable to type 'i1'. Property 'p' is missing in type 'Base'. -tests/cases/compiler/intTypeCheck.ts(101,5): error TS2323: Type '() => void' is not assignable to type 'i1'. +tests/cases/compiler/intTypeCheck.ts(101,5): error TS2322: Type '() => void' is not assignable to type 'i1'. Property 'p' is missing in type '() => void'. -tests/cases/compiler/intTypeCheck.ts(104,5): error TS2323: Type 'boolean' is not assignable to type 'i1'. +tests/cases/compiler/intTypeCheck.ts(104,5): error TS2322: Type 'boolean' is not assignable to type 'i1'. Property 'p' is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(104,21): error TS2304: Cannot find name 'i1'. tests/cases/compiler/intTypeCheck.ts(105,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(110,5): error TS2323: Type '{}' is not assignable to type 'i2'. -tests/cases/compiler/intTypeCheck.ts(111,5): error TS2323: Type 'Object' is not assignable to type 'i2'. +tests/cases/compiler/intTypeCheck.ts(110,5): error TS2322: Type '{}' is not assignable to type 'i2'. +tests/cases/compiler/intTypeCheck.ts(111,5): error TS2322: Type 'Object' is not assignable to type 'i2'. tests/cases/compiler/intTypeCheck.ts(112,17): error TS2350: Only a void function can be called with the 'new' keyword. -tests/cases/compiler/intTypeCheck.ts(113,5): error TS2323: Type 'Base' is not assignable to type 'i2'. -tests/cases/compiler/intTypeCheck.ts(118,5): error TS2323: Type 'boolean' is not assignable to type 'i2'. +tests/cases/compiler/intTypeCheck.ts(113,5): error TS2322: Type 'Base' is not assignable to type 'i2'. +tests/cases/compiler/intTypeCheck.ts(118,5): error TS2322: Type 'boolean' is not assignable to type 'i2'. tests/cases/compiler/intTypeCheck.ts(118,22): error TS2304: Cannot find name 'i2'. tests/cases/compiler/intTypeCheck.ts(119,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(124,5): error TS2323: Type '{}' is not assignable to type 'i3'. -tests/cases/compiler/intTypeCheck.ts(125,5): error TS2323: Type 'Object' is not assignable to type 'i3'. -tests/cases/compiler/intTypeCheck.ts(127,5): error TS2323: Type 'Base' is not assignable to type 'i3'. -tests/cases/compiler/intTypeCheck.ts(129,5): error TS2323: Type '() => void' is not assignable to type 'i3'. -tests/cases/compiler/intTypeCheck.ts(132,5): error TS2323: Type 'boolean' is not assignable to type 'i3'. +tests/cases/compiler/intTypeCheck.ts(124,5): error TS2322: Type '{}' is not assignable to type 'i3'. +tests/cases/compiler/intTypeCheck.ts(125,5): error TS2322: Type 'Object' is not assignable to type 'i3'. +tests/cases/compiler/intTypeCheck.ts(127,5): error TS2322: Type 'Base' is not assignable to type 'i3'. +tests/cases/compiler/intTypeCheck.ts(129,5): error TS2322: Type '() => void' is not assignable to type 'i3'. +tests/cases/compiler/intTypeCheck.ts(132,5): error TS2322: Type 'boolean' is not assignable to type 'i3'. tests/cases/compiler/intTypeCheck.ts(132,22): error TS2304: Cannot find name 'i3'. tests/cases/compiler/intTypeCheck.ts(133,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(139,5): error TS2323: Type 'Object' is not assignable to type 'i4'. +tests/cases/compiler/intTypeCheck.ts(139,5): error TS2322: Type 'Object' is not assignable to type 'i4'. Index signature is missing in type 'Object'. tests/cases/compiler/intTypeCheck.ts(140,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(141,5): error TS2323: Type 'Base' is not assignable to type 'i4'. +tests/cases/compiler/intTypeCheck.ts(141,5): error TS2322: Type 'Base' is not assignable to type 'i4'. Index signature is missing in type 'Base'. -tests/cases/compiler/intTypeCheck.ts(143,5): error TS2323: Type '() => void' is not assignable to type 'i4'. +tests/cases/compiler/intTypeCheck.ts(143,5): error TS2322: Type '() => void' is not assignable to type 'i4'. Index signature is missing in type '() => void'. -tests/cases/compiler/intTypeCheck.ts(146,5): error TS2323: Type 'boolean' is not assignable to type 'i4'. +tests/cases/compiler/intTypeCheck.ts(146,5): error TS2322: Type 'boolean' is not assignable to type 'i4'. Index signature is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(146,22): error TS2304: Cannot find name 'i4'. tests/cases/compiler/intTypeCheck.ts(147,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(152,5): error TS2323: Type '{}' is not assignable to type 'i5'. +tests/cases/compiler/intTypeCheck.ts(152,5): error TS2322: Type '{}' is not assignable to type 'i5'. Property 'p' is missing in type '{}'. -tests/cases/compiler/intTypeCheck.ts(153,5): error TS2323: Type 'Object' is not assignable to type 'i5'. +tests/cases/compiler/intTypeCheck.ts(153,5): error TS2322: Type 'Object' is not assignable to type 'i5'. Property 'p' is missing in type 'Object'. tests/cases/compiler/intTypeCheck.ts(154,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(155,5): error TS2323: Type 'Base' is not assignable to type 'i5'. +tests/cases/compiler/intTypeCheck.ts(155,5): error TS2322: Type 'Base' is not assignable to type 'i5'. Property 'p' is missing in type 'Base'. -tests/cases/compiler/intTypeCheck.ts(157,5): error TS2323: Type '() => void' is not assignable to type 'i5'. +tests/cases/compiler/intTypeCheck.ts(157,5): error TS2322: Type '() => void' is not assignable to type 'i5'. Property 'p' is missing in type '() => void'. -tests/cases/compiler/intTypeCheck.ts(160,5): error TS2323: Type 'boolean' is not assignable to type 'i5'. +tests/cases/compiler/intTypeCheck.ts(160,5): error TS2322: Type 'boolean' is not assignable to type 'i5'. Property 'p' is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(160,22): error TS2304: Cannot find name 'i5'. tests/cases/compiler/intTypeCheck.ts(161,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(166,5): error TS2323: Type '{}' is not assignable to type 'i6'. -tests/cases/compiler/intTypeCheck.ts(167,5): error TS2323: Type 'Object' is not assignable to type 'i6'. +tests/cases/compiler/intTypeCheck.ts(166,5): error TS2322: Type '{}' is not assignable to type 'i6'. +tests/cases/compiler/intTypeCheck.ts(167,5): error TS2322: Type 'Object' is not assignable to type 'i6'. tests/cases/compiler/intTypeCheck.ts(168,17): error TS2350: Only a void function can be called with the 'new' keyword. -tests/cases/compiler/intTypeCheck.ts(169,5): error TS2323: Type 'Base' is not assignable to type 'i6'. -tests/cases/compiler/intTypeCheck.ts(171,5): error TS2323: Type '() => void' is not assignable to type 'i6'. +tests/cases/compiler/intTypeCheck.ts(169,5): error TS2322: Type 'Base' is not assignable to type 'i6'. +tests/cases/compiler/intTypeCheck.ts(171,5): error TS2322: Type '() => void' is not assignable to type 'i6'. Type 'void' is not assignable to type 'number'. -tests/cases/compiler/intTypeCheck.ts(174,5): error TS2323: Type 'boolean' is not assignable to type 'i6'. +tests/cases/compiler/intTypeCheck.ts(174,5): error TS2322: Type 'boolean' is not assignable to type 'i6'. tests/cases/compiler/intTypeCheck.ts(174,22): error TS2304: Cannot find name 'i6'. tests/cases/compiler/intTypeCheck.ts(175,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(180,5): error TS2323: Type '{}' is not assignable to type 'i7'. -tests/cases/compiler/intTypeCheck.ts(181,5): error TS2323: Type 'Object' is not assignable to type 'i7'. +tests/cases/compiler/intTypeCheck.ts(180,5): error TS2322: Type '{}' is not assignable to type 'i7'. +tests/cases/compiler/intTypeCheck.ts(181,5): error TS2322: Type 'Object' is not assignable to type 'i7'. tests/cases/compiler/intTypeCheck.ts(183,17): error TS2352: Neither type 'Base' nor type 'i7' is assignable to the other. -tests/cases/compiler/intTypeCheck.ts(185,5): error TS2323: Type '() => void' is not assignable to type 'i7'. -tests/cases/compiler/intTypeCheck.ts(188,5): error TS2323: Type 'boolean' is not assignable to type 'i7'. +tests/cases/compiler/intTypeCheck.ts(185,5): error TS2322: Type '() => void' is not assignable to type 'i7'. +tests/cases/compiler/intTypeCheck.ts(188,5): error TS2322: Type 'boolean' is not assignable to type 'i7'. tests/cases/compiler/intTypeCheck.ts(188,22): error TS2304: Cannot find name 'i7'. tests/cases/compiler/intTypeCheck.ts(189,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(195,5): error TS2323: Type 'Object' is not assignable to type 'i8'. +tests/cases/compiler/intTypeCheck.ts(195,5): error TS2322: Type 'Object' is not assignable to type 'i8'. Index signature is missing in type 'Object'. tests/cases/compiler/intTypeCheck.ts(196,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/intTypeCheck.ts(197,5): error TS2323: Type 'Base' is not assignable to type 'i8'. +tests/cases/compiler/intTypeCheck.ts(197,5): error TS2322: Type 'Base' is not assignable to type 'i8'. Index signature is missing in type 'Base'. -tests/cases/compiler/intTypeCheck.ts(199,5): error TS2323: Type '() => void' is not assignable to type 'i8'. +tests/cases/compiler/intTypeCheck.ts(199,5): error TS2322: Type '() => void' is not assignable to type 'i8'. Index signature is missing in type '() => void'. -tests/cases/compiler/intTypeCheck.ts(202,5): error TS2323: Type 'boolean' is not assignable to type 'i8'. +tests/cases/compiler/intTypeCheck.ts(202,5): error TS2322: Type 'boolean' is not assignable to type 'i8'. Index signature is missing in type 'Boolean'. 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. @@ -204,28 +204,28 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit }; var obj2: i1 = new Object(); ~~~~ -!!! error TS2323: Type 'Object' is not assignable to type 'i1'. -!!! error TS2323: Property 'p' is missing in type 'Object'. +!!! error TS2322: Type 'Object' is not assignable to type 'i1'. +!!! error TS2322: Property 'p' is missing in type 'Object'. var obj3: i1 = new obj0; ~~~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var obj4: i1 = new Base; ~~~~ -!!! error TS2323: Type 'Base' is not assignable to type 'i1'. -!!! error TS2323: Property 'p' is missing in type 'Base'. +!!! error TS2322: Type 'Base' is not assignable to type 'i1'. +!!! error TS2322: Property 'p' is missing in type 'Base'. var obj5: i1 = null; var obj6: i1 = function () { }; ~~~~ -!!! error TS2323: Type '() => void' is not assignable to type 'i1'. -!!! error TS2323: Property 'p' is missing in type '() => void'. +!!! error TS2322: Type '() => void' is not assignable to type 'i1'. +!!! error TS2322: Property 'p' is missing in type '() => void'. //var obj7: i1 = function foo() { }; var obj8: i1 = anyVar; var obj9: i1 = new anyVar; ~ !!! error TS1109: Expression expected. ~~~~ -!!! error TS2323: Type 'boolean' is not assignable to type 'i1'. -!!! error TS2323: Property 'p' is missing in type 'Boolean'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i1'. +!!! error TS2322: Property 'p' is missing in type 'Boolean'. ~~ !!! error TS2304: Cannot find name 'i1'. var obj10: i1 = new {}; @@ -237,16 +237,16 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj11: i2; var obj12: i2 = {}; ~~~~~ -!!! error TS2323: Type '{}' is not assignable to type 'i2'. +!!! error TS2322: Type '{}' is not assignable to type 'i2'. var obj13: i2 = new Object(); ~~~~~ -!!! error TS2323: Type 'Object' is not assignable to type 'i2'. +!!! error TS2322: Type 'Object' is not assignable to type 'i2'. var obj14: i2 = new obj11; ~~~~~~~~~ !!! error TS2350: Only a void function can be called with the 'new' keyword. var obj15: i2 = new Base; ~~~~~ -!!! error TS2323: Type 'Base' is not assignable to type 'i2'. +!!! error TS2322: Type 'Base' is not assignable to type 'i2'. var obj16: i2 = null; var obj17: i2 = function ():any { return 0; }; //var obj18: i2 = function foo() { }; @@ -255,7 +255,7 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit ~ !!! error TS1109: Expression expected. ~~~~~ -!!! error TS2323: Type 'boolean' is not assignable to type 'i2'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i2'. ~~ !!! error TS2304: Cannot find name 'i2'. var obj21: i2 = new {}; @@ -267,25 +267,25 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj22: i3; var obj23: i3 = {}; ~~~~~ -!!! error TS2323: Type '{}' is not assignable to type 'i3'. +!!! error TS2322: Type '{}' is not assignable to type 'i3'. var obj24: i3 = new Object(); ~~~~~ -!!! error TS2323: Type 'Object' is not assignable to type 'i3'. +!!! error TS2322: Type 'Object' is not assignable to type 'i3'. var obj25: i3 = new obj22; var obj26: i3 = new Base; ~~~~~ -!!! error TS2323: Type 'Base' is not assignable to type 'i3'. +!!! error TS2322: Type 'Base' is not assignable to type 'i3'. var obj27: i3 = null; var obj28: i3 = function () { }; ~~~~~ -!!! error TS2323: Type '() => void' is not assignable to type 'i3'. +!!! error TS2322: Type '() => void' is not assignable to type 'i3'. //var obj29: i3 = function foo() { }; var obj30: i3 = anyVar; var obj31: i3 = new anyVar; ~ !!! error TS1109: Expression expected. ~~~~~ -!!! error TS2323: Type 'boolean' is not assignable to type 'i3'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i3'. ~~ !!! error TS2304: Cannot find name 'i3'. var obj32: i3 = new {}; @@ -298,28 +298,28 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj34: i4 = {}; var obj35: i4 = new Object(); ~~~~~ -!!! error TS2323: Type 'Object' is not assignable to type 'i4'. -!!! error TS2323: Index signature is missing in type 'Object'. +!!! error TS2322: Type 'Object' is not assignable to type 'i4'. +!!! error TS2322: Index signature is missing in type 'Object'. var obj36: i4 = new obj33; ~~~~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var obj37: i4 = new Base; ~~~~~ -!!! error TS2323: Type 'Base' is not assignable to type 'i4'. -!!! error TS2323: Index signature is missing in type 'Base'. +!!! error TS2322: Type 'Base' is not assignable to type 'i4'. +!!! error TS2322: Index signature is missing in type 'Base'. var obj38: i4 = null; var obj39: i4 = function () { }; ~~~~~ -!!! error TS2323: Type '() => void' is not assignable to type 'i4'. -!!! error TS2323: Index signature is missing in type '() => void'. +!!! error TS2322: Type '() => void' is not assignable to type 'i4'. +!!! error TS2322: Index signature is missing in type '() => void'. //var obj40: i4 = function foo() { }; var obj41: i4 = anyVar; var obj42: i4 = new anyVar; ~ !!! error TS1109: Expression expected. ~~~~~ -!!! error TS2323: Type 'boolean' is not assignable to type 'i4'. -!!! error TS2323: Index signature is missing in type 'Boolean'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i4'. +!!! error TS2322: Index signature is missing in type 'Boolean'. ~~ !!! error TS2304: Cannot find name 'i4'. var obj43: i4 = new {}; @@ -331,32 +331,32 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj44: i5; var obj45: i5 = {}; ~~~~~ -!!! error TS2323: Type '{}' is not assignable to type 'i5'. -!!! error TS2323: Property 'p' is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type 'i5'. +!!! error TS2322: Property 'p' is missing in type '{}'. var obj46: i5 = new Object(); ~~~~~ -!!! error TS2323: Type 'Object' is not assignable to type 'i5'. -!!! error TS2323: Property 'p' is missing in type 'Object'. +!!! error TS2322: Type 'Object' is not assignable to type 'i5'. +!!! error TS2322: Property 'p' is missing in type 'Object'. var obj47: i5 = new obj44; ~~~~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var obj48: i5 = new Base; ~~~~~ -!!! error TS2323: Type 'Base' is not assignable to type 'i5'. -!!! error TS2323: Property 'p' is missing in type 'Base'. +!!! error TS2322: Type 'Base' is not assignable to type 'i5'. +!!! error TS2322: Property 'p' is missing in type 'Base'. var obj49: i5 = null; var obj50: i5 = function () { }; ~~~~~ -!!! error TS2323: Type '() => void' is not assignable to type 'i5'. -!!! error TS2323: Property 'p' is missing in type '() => void'. +!!! error TS2322: Type '() => void' is not assignable to type 'i5'. +!!! error TS2322: Property 'p' is missing in type '() => void'. //var obj51: i5 = function foo() { }; var obj52: i5 = anyVar; var obj53: i5 = new anyVar; ~ !!! error TS1109: Expression expected. ~~~~~ -!!! error TS2323: Type 'boolean' is not assignable to type 'i5'. -!!! error TS2323: Property 'p' is missing in type 'Boolean'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i5'. +!!! error TS2322: Property 'p' is missing in type 'Boolean'. ~~ !!! error TS2304: Cannot find name 'i5'. var obj54: i5 = new {}; @@ -368,28 +368,28 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj55: i6; var obj56: i6 = {}; ~~~~~ -!!! error TS2323: Type '{}' is not assignable to type 'i6'. +!!! error TS2322: Type '{}' is not assignable to type 'i6'. var obj57: i6 = new Object(); ~~~~~ -!!! error TS2323: Type 'Object' is not assignable to type 'i6'. +!!! error TS2322: Type 'Object' is not assignable to type 'i6'. var obj58: i6 = new obj55; ~~~~~~~~~ !!! error TS2350: Only a void function can be called with the 'new' keyword. var obj59: i6 = new Base; ~~~~~ -!!! error TS2323: Type 'Base' is not assignable to type 'i6'. +!!! error TS2322: Type 'Base' is not assignable to type 'i6'. var obj60: i6 = null; var obj61: i6 = function () { }; ~~~~~ -!!! error TS2323: Type '() => void' is not assignable to type 'i6'. -!!! error TS2323: Type 'void' is not assignable to type 'number'. +!!! error TS2322: Type '() => void' is not assignable to type 'i6'. +!!! error TS2322: Type 'void' is not assignable to type 'number'. //var obj62: i6 = function foo() { }; var obj63: i6 = anyVar; var obj64: i6 = new anyVar; ~ !!! error TS1109: Expression expected. ~~~~~ -!!! error TS2323: Type 'boolean' is not assignable to type 'i6'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i6'. ~~ !!! error TS2304: Cannot find name 'i6'. var obj65: i6 = new {}; @@ -401,10 +401,10 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj66: i7; var obj67: i7 = {}; ~~~~~ -!!! error TS2323: Type '{}' is not assignable to type 'i7'. +!!! error TS2322: Type '{}' is not assignable to type 'i7'. var obj68: i7 = new Object(); ~~~~~ -!!! error TS2323: Type 'Object' is not assignable to type 'i7'. +!!! error TS2322: Type 'Object' is not assignable to type 'i7'. var obj69: i7 = new obj66; var obj70: i7 = new Base; ~~~~~~~~~~~~ @@ -412,14 +412,14 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj71: i7 = null; var obj72: i7 = function () { }; ~~~~~ -!!! error TS2323: Type '() => void' is not assignable to type 'i7'. +!!! error TS2322: Type '() => void' is not assignable to type 'i7'. //var obj73: i7 = function foo() { }; var obj74: i7 = anyVar; var obj75: i7 = new anyVar; ~ !!! error TS1109: Expression expected. ~~~~~ -!!! error TS2323: Type 'boolean' is not assignable to type 'i7'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i7'. ~~ !!! error TS2304: Cannot find name 'i7'. var obj76: i7 = new {}; @@ -432,28 +432,28 @@ tests/cases/compiler/intTypeCheck.ts(203,17): error TS2351: Cannot use 'new' wit var obj78: i8 = {}; var obj79: i8 = new Object(); ~~~~~ -!!! error TS2323: Type 'Object' is not assignable to type 'i8'. -!!! error TS2323: Index signature is missing in type 'Object'. +!!! error TS2322: Type 'Object' is not assignable to type 'i8'. +!!! error TS2322: Index signature is missing in type 'Object'. var obj80: i8 = new obj77; ~~~~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var obj81: i8 = new Base; ~~~~~ -!!! error TS2323: Type 'Base' is not assignable to type 'i8'. -!!! error TS2323: Index signature is missing in type 'Base'. +!!! error TS2322: Type 'Base' is not assignable to type 'i8'. +!!! error TS2322: Index signature is missing in type 'Base'. var obj82: i8 = null; var obj83: i8 = function () { }; ~~~~~ -!!! error TS2323: Type '() => void' is not assignable to type 'i8'. -!!! error TS2323: Index signature is missing in type '() => void'. +!!! error TS2322: Type '() => void' is not assignable to type 'i8'. +!!! error TS2322: Index signature is missing in type '() => void'. //var obj84: i8 = function foo() { }; var obj85: i8 = anyVar; var obj86: i8 = new anyVar; ~ !!! error TS1109: Expression expected. ~~~~~ -!!! error TS2323: Type 'boolean' is not assignable to type 'i8'. -!!! error TS2323: Index signature is missing in type 'Boolean'. +!!! error TS2322: Type 'boolean' is not assignable to type 'i8'. +!!! error TS2322: Index signature is missing in type 'Boolean'. ~~ !!! error TS2304: Cannot find name 'i8'. var obj87: i8 = new {}; diff --git a/tests/baselines/reference/interfaceAssignmentCompat.errors.txt b/tests/baselines/reference/interfaceAssignmentCompat.errors.txt index d9791d5e6b8..35cf2df71ff 100644 --- a/tests/baselines/reference/interfaceAssignmentCompat.errors.txt +++ b/tests/baselines/reference/interfaceAssignmentCompat.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/interfaceAssignmentCompat.ts(32,18): error TS2345: Argument of type '(a: IFrenchEye, b: IFrenchEye) => number' is not assignable to parameter of type '(a: IEye, b: IEye) => number'. tests/cases/compiler/interfaceAssignmentCompat.ts(37,29): error TS2339: Property '_map' does not exist on type 'typeof Color'. -tests/cases/compiler/interfaceAssignmentCompat.ts(42,13): error TS2323: Type 'IEye' is not assignable to type 'IFrenchEye'. -tests/cases/compiler/interfaceAssignmentCompat.ts(44,9): error TS2323: Type 'IEye[]' is not assignable to type 'IFrenchEye[]'. +tests/cases/compiler/interfaceAssignmentCompat.ts(42,13): error TS2322: Type 'IEye' is not assignable to type 'IFrenchEye'. +tests/cases/compiler/interfaceAssignmentCompat.ts(44,9): error TS2322: Type 'IEye[]' is not assignable to type 'IFrenchEye[]'. Type 'IEye' is not assignable to type 'IFrenchEye'. @@ -53,12 +53,12 @@ tests/cases/compiler/interfaceAssignmentCompat.ts(44,9): error TS2323: Type 'IEy for (var j=z.length=1;j>=0;j--) { eeks[j]=z[j]; // nope: element assignment ~~~~~~~ -!!! error TS2323: Type 'IEye' is not assignable to type 'IFrenchEye'. +!!! error TS2322: Type 'IEye' is not assignable to type 'IFrenchEye'. } eeks=z; // nope: array assignment ~~~~ -!!! error TS2323: Type 'IEye[]' is not assignable to type 'IFrenchEye[]'. -!!! error TS2323: Type 'IEye' is not assignable to type 'IFrenchEye'. +!!! error TS2322: Type 'IEye[]' is not assignable to type 'IFrenchEye[]'. +!!! error TS2322: Type 'IEye' is not assignable to type 'IFrenchEye'. return result; } } diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.errors.txt b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.errors.txt index daa91c8822b..f624560b7c0 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.errors.txt +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(21,1): error TS2323: Type 'C' is not assignable to type 'I'. +tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(21,1): error TS2322: Type 'C' is not assignable to type 'I'. Property 'other' is missing in type 'C'. -tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(24,1): error TS2323: Type 'I' is not assignable to type 'D'. +tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(24,1): error TS2322: Type 'I' is not assignable to type 'D'. Property 'bar' is missing in type 'I'. -tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(27,1): error TS2323: Type 'C' is not assignable to type 'D'. +tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(27,1): error TS2322: Type 'C' is not assignable to type 'D'. Property 'other' is missing in type 'C'. @@ -29,17 +29,17 @@ tests/cases/compiler/interfaceExtendsClassWithPrivate1.ts(27,1): error TS2323: T c = i; i = c; // error ~ -!!! error TS2323: Type 'C' is not assignable to type 'I'. -!!! error TS2323: Property 'other' is missing in type 'C'. +!!! error TS2322: Type 'C' is not assignable to type 'I'. +!!! error TS2322: Property 'other' is missing in type 'C'. i = d; d = i; // error ~ -!!! error TS2323: Type 'I' is not assignable to type 'D'. -!!! error TS2323: Property 'bar' is missing in type 'I'. +!!! error TS2322: Type 'I' is not assignable to type 'D'. +!!! error TS2322: Property 'bar' is missing in type 'I'. c = d; d = c; // error ~ -!!! error TS2323: Type 'C' is not assignable to type 'D'. -!!! error TS2323: Property 'other' is missing in type 'C'. \ No newline at end of file +!!! error TS2322: Type 'C' is not assignable to type 'D'. +!!! error TS2322: Property 'other' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceImplementation1.errors.txt b/tests/baselines/reference/interfaceImplementation1.errors.txt index 5a6b870b55a..45b011c6929 100644 --- a/tests/baselines/reference/interfaceImplementation1.errors.txt +++ b/tests/baselines/reference/interfaceImplementation1.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2420: Class 'C1' Property 'iObj' is private in type 'C1' but not in type 'I1'. tests/cases/compiler/interfaceImplementation1.ts(12,7): error TS2420: Class 'C1' incorrectly implements interface 'I2'. Property 'iFn' is private in type 'C1' but not in type 'I2'. -tests/cases/compiler/interfaceImplementation1.ts(34,5): error TS2323: Type '() => C2' is not assignable to type 'I4'. +tests/cases/compiler/interfaceImplementation1.ts(34,5): error TS2322: Type '() => C2' is not assignable to type 'I4'. ==== tests/cases/compiler/interfaceImplementation1.ts (3 errors) ==== @@ -47,7 +47,7 @@ tests/cases/compiler/interfaceImplementation1.ts(34,5): error TS2323: Type '() = var a:I4 = function(){ ~ -!!! error TS2323: Type '() => C2' is not assignable to type 'I4'. +!!! error TS2322: Type '() => C2' is not assignable to type 'I4'. return new C2(); } new a(); diff --git a/tests/baselines/reference/interfaceInheritance.errors.txt b/tests/baselines/reference/interfaceInheritance.errors.txt index b598ba4a985..c96053b8a84 100644 --- a/tests/baselines/reference/interfaceInheritance.errors.txt +++ b/tests/baselines/reference/interfaceInheritance.errors.txt @@ -1,11 +1,11 @@ tests/cases/compiler/interfaceInheritance.ts(22,7): error TS2420: Class 'C1' incorrectly implements interface 'I2'. Property 'i1P1' is missing in type 'C1'. -tests/cases/compiler/interfaceInheritance.ts(30,1): error TS2323: Type 'I3' is not assignable to type 'I2'. +tests/cases/compiler/interfaceInheritance.ts(30,1): error TS2322: Type 'I3' is not assignable to type 'I2'. Property 'i1P1' is missing in type 'I3'. -tests/cases/compiler/interfaceInheritance.ts(37,1): error TS2323: Type 'I5' is not assignable to type 'I4'. +tests/cases/compiler/interfaceInheritance.ts(37,1): error TS2322: Type 'I5' is not assignable to type 'I4'. Types of property 'one' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/interfaceInheritance.ts(38,1): error TS2323: Type 'I4' is not assignable to type 'I5'. +tests/cases/compiler/interfaceInheritance.ts(38,1): error TS2322: Type 'I4' is not assignable to type 'I5'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string'. @@ -45,8 +45,8 @@ tests/cases/compiler/interfaceInheritance.ts(38,1): error TS2323: Type 'I4' is n i1 = i2; i2 = i3; // should be an error - i3 does not implement the members of i1 ~~ -!!! error TS2323: Type 'I3' is not assignable to type 'I2'. -!!! error TS2323: Property 'i1P1' is missing in type 'I3'. +!!! error TS2322: Type 'I3' is not assignable to type 'I2'. +!!! error TS2322: Property 'i1P1' is missing in type 'I3'. var c1: C1; @@ -55,13 +55,13 @@ tests/cases/compiler/interfaceInheritance.ts(38,1): error TS2323: Type 'I4' is n i4 = i5; // should be an error ~~ -!!! error TS2323: Type 'I5' is not assignable to type 'I4'. -!!! error TS2323: Types of property 'one' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'I5' is not assignable to type 'I4'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. i5 = i4; // should be an error ~~ -!!! error TS2323: Type 'I4' is not assignable to type 'I5'. -!!! error TS2323: Types of property 'one' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'I4' is not assignable to type 'I5'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt b/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt index 2d800b4befd..3ac4f122e58 100644 --- a/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt +++ b/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt @@ -1,55 +1,55 @@ -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(2,1): error TS2323: Type 'number' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(3,1): error TS2323: Type 'boolean' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(4,1): error TS2323: Type 'string' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(5,1): error TS2323: Type '{}' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(9,1): error TS2323: Type 'typeof C' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(10,1): error TS2323: Type 'C' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(14,1): error TS2323: Type 'I' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(17,1): error TS2323: Type 'typeof M' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(20,5): error TS2323: Type 'T' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(22,1): error TS2323: Type '(a: T) => void' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(2,1): error TS2322: Type 'number' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(3,1): error TS2322: Type 'boolean' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(4,1): error TS2322: Type 'string' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(5,1): error TS2322: Type '{}' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(9,1): error TS2322: Type 'typeof C' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(10,1): error TS2322: Type 'C' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(14,1): error TS2322: Type 'I' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(17,1): error TS2322: Type 'typeof M' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(20,5): error TS2322: Type 'T' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(22,1): error TS2322: Type '(a: T) => void' is not assignable to type 'void'. ==== tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts (10 errors) ==== var x: void; x = 1; ~ -!!! error TS2323: Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type 'number' is not assignable to type 'void'. x = true; ~ -!!! error TS2323: Type 'boolean' is not assignable to type 'void'. +!!! error TS2322: Type 'boolean' is not assignable to type 'void'. x = ''; ~ -!!! error TS2323: Type 'string' is not assignable to type 'void'. +!!! error TS2322: Type 'string' is not assignable to type 'void'. x = {} ~ -!!! error TS2323: Type '{}' is not assignable to type 'void'. +!!! error TS2322: Type '{}' is not assignable to type 'void'. class C { foo: string; } var c: C; x = C; ~ -!!! error TS2323: Type 'typeof C' is not assignable to type 'void'. +!!! error TS2322: Type 'typeof C' is not assignable to type 'void'. x = c; ~ -!!! error TS2323: Type 'C' is not assignable to type 'void'. +!!! error TS2322: Type 'C' is not assignable to type 'void'. interface I { foo: string; } var i: I; x = i; ~ -!!! error TS2323: Type 'I' is not assignable to type 'void'. +!!! error TS2322: Type 'I' is not assignable to type 'void'. module M { export var x = 1; } x = M; ~ -!!! error TS2323: Type 'typeof M' is not assignable to type 'void'. +!!! error TS2322: Type 'typeof M' is not assignable to type 'void'. function f(a: T) { x = a; ~ -!!! error TS2323: Type 'T' is not assignable to type 'void'. +!!! error TS2322: Type 'T' is not assignable to type 'void'. } x = f; ~ -!!! error TS2323: Type '(a: T) => void' is not assignable to type 'void'. \ No newline at end of file +!!! error TS2322: Type '(a: T) => void' is not assignable to type 'void'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidBooleanAssignments.errors.txt b/tests/baselines/reference/invalidBooleanAssignments.errors.txt index 2a725e0f71d..84ced226113 100644 --- a/tests/baselines/reference/invalidBooleanAssignments.errors.txt +++ b/tests/baselines/reference/invalidBooleanAssignments.errors.txt @@ -1,14 +1,14 @@ -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(3,5): error TS2323: Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(4,5): error TS2323: Type 'boolean' is not assignable to type 'string'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(5,5): error TS2323: Type 'boolean' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(9,5): error TS2323: Type 'boolean' is not assignable to type 'E'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(12,5): error TS2323: Type 'boolean' is not assignable to type 'C'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(3,5): error TS2322: Type 'boolean' is not assignable to type 'number'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(4,5): error TS2322: Type 'boolean' is not assignable to type 'string'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(5,5): error TS2322: Type 'boolean' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(9,5): error TS2322: Type 'boolean' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(12,5): error TS2322: Type 'boolean' is not assignable to type 'C'. Property 'foo' is missing in type 'Boolean'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(15,5): error TS2323: Type 'boolean' is not assignable to type 'I'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(15,5): error TS2322: Type 'boolean' is not assignable to type 'I'. Property 'bar' is missing in type 'Boolean'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(17,5): error TS2323: Type 'boolean' is not assignable to type '() => string'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(17,5): error TS2322: Type 'boolean' is not assignable to type '() => string'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(21,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(24,5): error TS2323: Type 'boolean' is not assignable to type 'T'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(24,5): error TS2322: Type 'boolean' is not assignable to type 'T'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26,1): error TS2364: Invalid left-hand side of assignment expression. @@ -17,35 +17,35 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26 var a: number = x; ~ -!!! error TS2323: Type 'boolean' is not assignable to type 'number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. var b: string = x; ~ -!!! error TS2323: Type 'boolean' is not assignable to type 'string'. +!!! error TS2322: Type 'boolean' is not assignable to type 'string'. var c: void = x; ~ -!!! error TS2323: Type 'boolean' is not assignable to type 'void'. +!!! error TS2322: Type 'boolean' is not assignable to type 'void'. var d: typeof undefined = x; enum E { A } var e: E = x; ~ -!!! error TS2323: Type 'boolean' is not assignable to type 'E'. +!!! error TS2322: Type 'boolean' is not assignable to type 'E'. class C { foo: string } var f: C = x; ~ -!!! error TS2323: Type 'boolean' is not assignable to type 'C'. -!!! error TS2323: Property 'foo' is missing in type 'Boolean'. +!!! error TS2322: Type 'boolean' is not assignable to type 'C'. +!!! error TS2322: Property 'foo' is missing in type 'Boolean'. interface I { bar: string } var g: I = x; ~ -!!! error TS2323: Type 'boolean' is not assignable to type 'I'. -!!! error TS2323: Property 'bar' is missing in type 'Boolean'. +!!! error TS2322: Type 'boolean' is not assignable to type 'I'. +!!! error TS2322: Property 'bar' is missing in type 'Boolean'. var h: { (): string } = x; ~ -!!! error TS2323: Type 'boolean' is not assignable to type '() => string'. +!!! error TS2322: Type 'boolean' is not assignable to type '() => string'. var h2: { toString(): string } = x; // no error module M { export var a = 1; } @@ -56,7 +56,7 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26 function i(a: T) { a = x; ~ -!!! error TS2323: Type 'boolean' is not assignable to type 'T'. +!!! error TS2322: Type 'boolean' is not assignable to type 'T'. } i = x; ~ diff --git a/tests/baselines/reference/invalidEnumAssignments.errors.txt b/tests/baselines/reference/invalidEnumAssignments.errors.txt index 6e9c46d4239..962e4bf62d5 100644 --- a/tests/baselines/reference/invalidEnumAssignments.errors.txt +++ b/tests/baselines/reference/invalidEnumAssignments.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(14,1): error TS2323: Type 'E2' is not assignable to type 'E'. -tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(15,1): error TS2323: Type 'E' is not assignable to type 'E2'. -tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(16,1): error TS2323: Type 'void' is not assignable to type 'E'. -tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(17,1): error TS2323: Type '{}' is not assignable to type 'E'. -tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(18,1): error TS2323: Type 'string' is not assignable to type 'E'. -tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(21,5): error TS2323: Type 'T' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(14,1): error TS2322: Type 'E2' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(15,1): error TS2322: Type 'E' is not assignable to type 'E2'. +tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(16,1): error TS2322: Type 'void' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(17,1): error TS2322: Type '{}' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(18,1): error TS2322: Type 'string' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(21,5): error TS2322: Type 'T' is not assignable to type 'E'. ==== tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts (6 errors) ==== @@ -22,22 +22,22 @@ tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(21,5): e e = E2.A; ~ -!!! error TS2323: Type 'E2' is not assignable to type 'E'. +!!! error TS2322: Type 'E2' is not assignable to type 'E'. e2 = E.A; ~~ -!!! error TS2323: Type 'E' is not assignable to type 'E2'. +!!! error TS2322: Type 'E' is not assignable to type 'E2'. e = null; ~ -!!! error TS2323: Type 'void' is not assignable to type 'E'. +!!! error TS2322: Type 'void' is not assignable to type 'E'. e = {}; ~ -!!! error TS2323: Type '{}' is not assignable to type 'E'. +!!! error TS2322: Type '{}' is not assignable to type 'E'. e = ''; ~ -!!! error TS2323: Type 'string' is not assignable to type 'E'. +!!! error TS2322: Type 'string' is not assignable to type 'E'. function f(a: T) { e = a; ~ -!!! error TS2323: Type 'T' is not assignable to type 'E'. +!!! error TS2322: Type 'T' is not assignable to type 'E'. } \ No newline at end of file diff --git a/tests/baselines/reference/invalidNumberAssignments.errors.txt b/tests/baselines/reference/invalidNumberAssignments.errors.txt index b2f8123c911..7eb5e6cb897 100644 --- a/tests/baselines/reference/invalidNumberAssignments.errors.txt +++ b/tests/baselines/reference/invalidNumberAssignments.errors.txt @@ -1,16 +1,16 @@ -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(3,5): error TS2323: Type 'number' is not assignable to type 'boolean'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(4,5): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(5,5): error TS2323: Type 'number' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(9,5): error TS2323: Type 'number' is not assignable to type 'C'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(3,5): error TS2322: Type 'number' is not assignable to type 'boolean'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(4,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(5,5): error TS2322: Type 'number' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(9,5): error TS2322: Type 'number' is not assignable to type 'C'. Property 'foo' is missing in type 'Number'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(12,5): error TS2323: Type 'number' is not assignable to type 'I'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(12,5): error TS2322: Type 'number' is not assignable to type 'I'. Property 'bar' is missing in type 'Number'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(14,5): error TS2323: Type 'number' is not assignable to type '{ baz: string; }'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. Property 'baz' is missing in type 'Number'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(15,5): error TS2323: Type 'number' is not assignable to type '{ 0: number; }'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. Property '0' is missing in type 'Number'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(21,5): error TS2323: Type 'number' is not assignable to type 'T'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(21,5): error TS2322: Type 'number' is not assignable to type 'T'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression. @@ -19,35 +19,35 @@ tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1 var a: boolean = x; ~ -!!! error TS2323: Type 'number' is not assignable to type 'boolean'. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. var b: string = x; ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var c: void = x; ~ -!!! error TS2323: Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type 'number' is not assignable to type 'void'. var d: typeof undefined = x; class C { foo: string; } var e: C = x; ~ -!!! error TS2323: Type 'number' is not assignable to type 'C'. -!!! error TS2323: Property 'foo' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'C'. +!!! error TS2322: Property 'foo' is missing in type 'Number'. interface I { bar: string; } var f: I = x; ~ -!!! error TS2323: Type 'number' is not assignable to type 'I'. -!!! error TS2323: Property 'bar' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'I'. +!!! error TS2322: Property 'bar' is missing in type 'Number'. var g: { baz: string } = 1; ~ -!!! error TS2323: Type 'number' is not assignable to type '{ baz: string; }'. -!!! error TS2323: Property 'baz' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. +!!! error TS2322: Property 'baz' is missing in type 'Number'. var g2: { 0: number } = 1; ~~ -!!! error TS2323: Type 'number' is not assignable to type '{ 0: number; }'. -!!! error TS2323: Property '0' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. +!!! error TS2322: Property '0' is missing in type 'Number'. module M { export var x = 1; } M = x; @@ -57,7 +57,7 @@ tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1 function i(a: T) { a = x; ~ -!!! error TS2323: Type 'number' is not assignable to type 'T'. +!!! error TS2322: Type 'number' is not assignable to type 'T'. } i = x; ~ diff --git a/tests/baselines/reference/invalidReturnStatements.errors.txt b/tests/baselines/reference/invalidReturnStatements.errors.txt index c32f266c0e7..780166e07c2 100644 --- a/tests/baselines/reference/invalidReturnStatements.errors.txt +++ b/tests/baselines/reference/invalidReturnStatements.errors.txt @@ -2,9 +2,9 @@ tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(2 tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(3,17): 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/conformance/statements/returnStatements/invalidReturnStatements.ts(4,17): 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/conformance/statements/returnStatements/invalidReturnStatements.ts(5,17): 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/conformance/statements/returnStatements/invalidReturnStatements.ts(16,29): error TS2323: Type '{ id: number; }' is not assignable to type 'D'. +tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(16,29): error TS2322: Type '{ id: number; }' is not assignable to type 'D'. Property 'name' is missing in type '{ id: number; }'. -tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(18,29): error TS2323: Type 'C' is not assignable to type 'D'. +tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(18,29): error TS2322: Type 'C' is not assignable to type 'D'. Property 'name' is missing in type 'C'. @@ -34,12 +34,12 @@ tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(1 } function fn10(): D { return { id: 12 }; } ~~~~~~~~~~ -!!! error TS2323: Type '{ id: number; }' is not assignable to type 'D'. -!!! error TS2323: Property 'name' is missing in type '{ id: number; }'. +!!! error TS2322: Type '{ id: number; }' is not assignable to type 'D'. +!!! error TS2322: Property 'name' is missing in type '{ id: number; }'. function fn11(): D { return new C(); } ~~~~~~~ -!!! error TS2323: Type 'C' is not assignable to type 'D'. -!!! error TS2323: Property 'name' is missing in type 'C'. +!!! error TS2322: Type 'C' is not assignable to type 'D'. +!!! error TS2322: Property 'name' is missing in type 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidStringAssignments.errors.txt b/tests/baselines/reference/invalidStringAssignments.errors.txt index 7e73f9b634b..e67106bef92 100644 --- a/tests/baselines/reference/invalidStringAssignments.errors.txt +++ b/tests/baselines/reference/invalidStringAssignments.errors.txt @@ -1,18 +1,18 @@ -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(3,5): error TS2323: Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(4,5): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(5,5): error TS2323: Type 'string' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(9,5): error TS2323: Type 'string' is not assignable to type 'C'. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(3,5): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(4,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(5,5): error TS2322: Type 'string' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(9,5): error TS2322: Type 'string' is not assignable to type 'C'. Property 'foo' is missing in type 'String'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(12,5): error TS2323: Type 'string' is not assignable to type 'I'. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(12,5): error TS2322: Type 'string' is not assignable to type 'I'. Property 'bar' is missing in type 'String'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(14,5): error TS2323: Type 'number' is not assignable to type '{ baz: string; }'. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. Property 'baz' is missing in type 'Number'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(15,5): error TS2323: Type 'number' is not assignable to type '{ 0: number; }'. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. Property '0' is missing in type 'Number'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(21,5): error TS2323: Type 'string' is not assignable to type 'T'. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(21,5): error TS2322: Type 'string' is not assignable to type 'T'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5): error TS2323: Type 'string' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5): error TS2322: Type 'string' is not assignable to type 'E'. ==== tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts (11 errors) ==== @@ -20,35 +20,35 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5 var a: boolean = x; ~ -!!! error TS2323: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. var b: number = x; ~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var c: void = x; ~ -!!! error TS2323: Type 'string' is not assignable to type 'void'. +!!! error TS2322: Type 'string' is not assignable to type 'void'. var d: typeof undefined = x; class C { foo: string; } var e: C = x; ~ -!!! error TS2323: Type 'string' is not assignable to type 'C'. -!!! error TS2323: Property 'foo' is missing in type 'String'. +!!! error TS2322: Type 'string' is not assignable to type 'C'. +!!! error TS2322: Property 'foo' is missing in type 'String'. interface I { bar: string; } var f: I = x; ~ -!!! error TS2323: Type 'string' is not assignable to type 'I'. -!!! error TS2323: Property 'bar' is missing in type 'String'. +!!! error TS2322: Type 'string' is not assignable to type 'I'. +!!! error TS2322: Property 'bar' is missing in type 'String'. var g: { baz: string } = 1; ~ -!!! error TS2323: Type 'number' is not assignable to type '{ baz: string; }'. -!!! error TS2323: Property 'baz' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. +!!! error TS2322: Property 'baz' is missing in type 'Number'. var g2: { 0: number } = 1; ~~ -!!! error TS2323: Type 'number' is not assignable to type '{ 0: number; }'. -!!! error TS2323: Property '0' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. +!!! error TS2322: Property '0' is missing in type 'Number'. module M { export var x = 1; } M = x; @@ -58,7 +58,7 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5 function i(a: T) { a = x; ~ -!!! error TS2323: Type 'string' is not assignable to type 'T'. +!!! error TS2322: Type 'string' is not assignable to type 'T'. } i = x; ~ @@ -67,4 +67,4 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5 enum E { A } var j: E = x; ~ -!!! error TS2323: Type 'string' is not assignable to type 'E'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'E'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidVoidAssignments.errors.txt b/tests/baselines/reference/invalidVoidAssignments.errors.txt index 5dc20a63f3a..64decc2f5e2 100644 --- a/tests/baselines/reference/invalidVoidAssignments.errors.txt +++ b/tests/baselines/reference/invalidVoidAssignments.errors.txt @@ -1,18 +1,18 @@ -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(3,5): error TS2323: Type 'void' is not assignable to type 'boolean'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(4,5): error TS2323: Type 'void' is not assignable to type 'string'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(5,5): error TS2323: Type 'void' is not assignable to type 'number'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(9,5): error TS2323: Type 'void' is not assignable to type 'C'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(12,5): error TS2323: Type 'void' is not assignable to type 'I'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(14,5): error TS2323: Type 'number' is not assignable to type '{ baz: string; }'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(3,5): error TS2322: Type 'void' is not assignable to type 'boolean'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(4,5): error TS2322: Type 'void' is not assignable to type 'string'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(5,5): error TS2322: Type 'void' is not assignable to type 'number'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(9,5): error TS2322: Type 'void' is not assignable to type 'C'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(12,5): error TS2322: Type 'void' is not assignable to type 'I'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. Property 'baz' is missing in type 'Number'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(15,5): error TS2323: Type 'number' is not assignable to type '{ 0: number; }'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. Property '0' is missing in type 'Number'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(21,5): error TS2323: Type 'void' is not assignable to type 'T'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(21,5): error TS2322: Type 'void' is not assignable to type 'T'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(26,1): error TS2323: Type 'typeof E' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(27,1): error TS2323: Type 'E' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): error TS2323: Type '{ f: () => void; }' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(26,1): error TS2322: Type 'typeof E' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(27,1): error TS2322: Type 'E' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): error TS2322: Type '{ f: () => void; }' is not assignable to type 'void'. ==== tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts (13 errors) ==== @@ -20,33 +20,33 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): e var a: boolean = x; ~ -!!! error TS2323: Type 'void' is not assignable to type 'boolean'. +!!! error TS2322: Type 'void' is not assignable to type 'boolean'. var b: string = x; ~ -!!! error TS2323: Type 'void' is not assignable to type 'string'. +!!! error TS2322: Type 'void' is not assignable to type 'string'. var c: number = x; ~ -!!! error TS2323: Type 'void' is not assignable to type 'number'. +!!! error TS2322: Type 'void' is not assignable to type 'number'. var d: typeof undefined = x; class C { foo: string; } var e: C = x; ~ -!!! error TS2323: Type 'void' is not assignable to type 'C'. +!!! error TS2322: Type 'void' is not assignable to type 'C'. interface I { bar: string; } var f: I = x; ~ -!!! error TS2323: Type 'void' is not assignable to type 'I'. +!!! error TS2322: Type 'void' is not assignable to type 'I'. var g: { baz: string } = 1; ~ -!!! error TS2323: Type 'number' is not assignable to type '{ baz: string; }'. -!!! error TS2323: Property 'baz' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. +!!! error TS2322: Property 'baz' is missing in type 'Number'. var g2: { 0: number } = 1; ~~ -!!! error TS2323: Type 'number' is not assignable to type '{ 0: number; }'. -!!! error TS2323: Property '0' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. +!!! error TS2322: Property '0' is missing in type 'Number'. module M { export var x = 1; } M = x; @@ -56,7 +56,7 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): e function i(a: T) { a = x; ~ -!!! error TS2323: Type 'void' is not assignable to type 'T'. +!!! error TS2322: Type 'void' is not assignable to type 'T'. } i = x; ~ @@ -65,11 +65,11 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): e enum E { A } x = E; ~ -!!! error TS2323: Type 'typeof E' is not assignable to type 'void'. +!!! error TS2322: Type 'typeof E' is not assignable to type 'void'. x = E.A; ~ -!!! error TS2323: Type 'E' is not assignable to type 'void'. +!!! error TS2322: Type 'E' is not assignable to type 'void'. x = { f() { } } ~ -!!! error TS2323: Type '{ f: () => void; }' is not assignable to type 'void'. \ No newline at end of file +!!! error TS2322: Type '{ f: () => void; }' is not assignable to type 'void'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidVoidValues.errors.txt b/tests/baselines/reference/invalidVoidValues.errors.txt index db20d7d7fcc..b8a4400e4e0 100644 --- a/tests/baselines/reference/invalidVoidValues.errors.txt +++ b/tests/baselines/reference/invalidVoidValues.errors.txt @@ -1,62 +1,62 @@ -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(2,1): error TS2323: Type 'number' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(3,1): error TS2323: Type 'string' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(4,1): error TS2323: Type 'boolean' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(7,1): error TS2323: Type 'typeof E' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(8,1): error TS2323: Type 'E' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(12,1): error TS2323: Type 'C' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(16,1): error TS2323: Type 'I' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(18,1): error TS2323: Type '{ f: () => void; }' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(21,1): error TS2323: Type 'typeof M' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(24,5): error TS2323: Type 'T' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(26,1): error TS2323: Type '(a: T) => void' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(2,1): error TS2322: Type 'number' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(3,1): error TS2322: Type 'string' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(4,1): error TS2322: Type 'boolean' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(7,1): error TS2322: Type 'typeof E' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(8,1): error TS2322: Type 'E' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(12,1): error TS2322: Type 'C' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(16,1): error TS2322: Type 'I' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(18,1): error TS2322: Type '{ f: () => void; }' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(21,1): error TS2322: Type 'typeof M' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(24,5): error TS2322: Type 'T' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(26,1): error TS2322: Type '(a: T) => void' is not assignable to type 'void'. ==== tests/cases/conformance/types/primitives/void/invalidVoidValues.ts (11 errors) ==== var x: void; x = 1; ~ -!!! error TS2323: Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type 'number' is not assignable to type 'void'. x = ''; ~ -!!! error TS2323: Type 'string' is not assignable to type 'void'. +!!! error TS2322: Type 'string' is not assignable to type 'void'. x = true; ~ -!!! error TS2323: Type 'boolean' is not assignable to type 'void'. +!!! error TS2322: Type 'boolean' is not assignable to type 'void'. enum E { A } x = E; ~ -!!! error TS2323: Type 'typeof E' is not assignable to type 'void'. +!!! error TS2322: Type 'typeof E' is not assignable to type 'void'. x = E.A; ~ -!!! error TS2323: Type 'E' is not assignable to type 'void'. +!!! error TS2322: Type 'E' is not assignable to type 'void'. class C { foo: string } var a: C; x = a; ~ -!!! error TS2323: Type 'C' is not assignable to type 'void'. +!!! error TS2322: Type 'C' is not assignable to type 'void'. interface I { foo: string } var b: I; x = b; ~ -!!! error TS2323: Type 'I' is not assignable to type 'void'. +!!! error TS2322: Type 'I' is not assignable to type 'void'. x = { f() {} } ~ -!!! error TS2323: Type '{ f: () => void; }' is not assignable to type 'void'. +!!! error TS2322: Type '{ f: () => void; }' is not assignable to type 'void'. module M { export var x = 1; } x = M; ~ -!!! error TS2323: Type 'typeof M' is not assignable to type 'void'. +!!! error TS2322: Type 'typeof M' is not assignable to type 'void'. function f(a: T) { x = a; ~ -!!! error TS2323: Type 'T' is not assignable to type 'void'. +!!! error TS2322: Type 'T' is not assignable to type 'void'. } x = f; ~ -!!! error TS2323: Type '(a: T) => void' is not assignable to type 'void'. \ No newline at end of file +!!! error TS2322: Type '(a: T) => void' is not assignable to type 'void'. \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithEnumType.js b/tests/baselines/reference/logicalNotOperatorWithEnumType.js index 69ea283051d..89ee1a14833 100644 --- a/tests/baselines/reference/logicalNotOperatorWithEnumType.js +++ b/tests/baselines/reference/logicalNotOperatorWithEnumType.js @@ -37,11 +37,11 @@ var ENUM1; // enum type var var ResultIsBoolean1 = !ENUM; // enum type expressions -var ResultIsBoolean2 = !ENUM["B"]; -var ResultIsBoolean3 = !(1 /* B */ + ENUM["C"]); +var ResultIsBoolean2 = !1 /* "B" */; +var ResultIsBoolean3 = !(1 /* B */ + 2 /* "C" */); // multiple ! operators var ResultIsBoolean4 = !!ENUM; -var ResultIsBoolean5 = !!!(ENUM["B"] + 2 /* C */); +var ResultIsBoolean5 = !!!(1 /* "B" */ + 2 /* C */); // miss assignment operators !ENUM; !ENUM1; diff --git a/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt b/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt index b273526b4f1..744ebed7d08 100644 --- a/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt +++ b/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/matchReturnTypeInAllBranches.ts(30,20): error TS2323: Type 'number' is not assignable to type 'boolean'. +tests/cases/compiler/matchReturnTypeInAllBranches.ts(30,20): error TS2322: Type 'number' is not assignable to type 'boolean'. ==== tests/cases/compiler/matchReturnTypeInAllBranches.ts (1 errors) ==== @@ -33,7 +33,7 @@ tests/cases/compiler/matchReturnTypeInAllBranches.ts(30,20): error TS2323: Type { return 12345; ~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'boolean'. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. } } } diff --git a/tests/baselines/reference/memberOverride.errors.txt b/tests/baselines/reference/memberOverride.errors.txt index c63803f5aa1..0fd0fb57e67 100644 --- a/tests/baselines/reference/memberOverride.errors.txt +++ b/tests/baselines/reference/memberOverride.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/memberOverride.ts(4,5): error TS2300: Duplicate identifier 'a'. tests/cases/compiler/memberOverride.ts(5,5): error TS2300: Duplicate identifier 'a'. -tests/cases/compiler/memberOverride.ts(8,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/memberOverride.ts(8,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/memberOverride.ts (3 errors) ==== @@ -17,4 +17,4 @@ tests/cases/compiler/memberOverride.ts(8,5): error TS2323: Type 'string' is not var n: number = x.a; ~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/multiLineErrors.errors.txt b/tests/baselines/reference/multiLineErrors.errors.txt index f0f5070269b..23a6278b4fb 100644 --- a/tests/baselines/reference/multiLineErrors.errors.txt +++ b/tests/baselines/reference/multiLineErrors.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/multiLineErrors.ts(3,22): 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/multiLineErrors.ts(21,1): error TS2323: Type 'A2' is not assignable to type 'A1'. +tests/cases/compiler/multiLineErrors.ts(21,1): error TS2322: Type 'A2' is not assignable to type 'A1'. Types of property 'x' are incompatible. Type '{ y: string; }' is not assignable to type '{ y: number; }'. Types of property 'y' are incompatible. @@ -34,9 +34,9 @@ tests/cases/compiler/multiLineErrors.ts(21,1): error TS2323: Type 'A2' is not as var t2: A2; t1 = t2; ~~ -!!! error TS2323: Type 'A2' is not assignable to type 'A1'. -!!! error TS2323: Types of property 'x' are incompatible. -!!! error TS2323: Type '{ y: string; }' is not assignable to type '{ y: number; }'. -!!! error TS2323: Types of property 'y' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'A2' is not assignable to type 'A1'. +!!! error TS2322: Types of property 'x' are incompatible. +!!! error TS2322: Type '{ y: string; }' is not assignable to type '{ y: number; }'. +!!! error TS2322: Types of property 'y' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithEnumType.js b/tests/baselines/reference/negateOperatorWithEnumType.js index 876bed45cc2..77458f442df 100644 --- a/tests/baselines/reference/negateOperatorWithEnumType.js +++ b/tests/baselines/reference/negateOperatorWithEnumType.js @@ -33,10 +33,10 @@ var ENUM1; // enum type var var ResultIsNumber1 = -ENUM; // expressions -var ResultIsNumber2 = -ENUM1["B"]; -var ResultIsNumber3 = -(1 /* B */ + ENUM1[""]); +var ResultIsNumber2 = -1 /* "B" */; +var ResultIsNumber3 = -(1 /* B */ + 2 /* "" */); // miss assignment operators -ENUM; -ENUM1; --ENUM1["B"]; +-1 /* "B" */; -ENUM, ENUM1; diff --git a/tests/baselines/reference/noImplicitAnyIndexing.js b/tests/baselines/reference/noImplicitAnyIndexing.js index ebadbd9a121..91dbcae730c 100644 --- a/tests/baselines/reference/noImplicitAnyIndexing.js +++ b/tests/baselines/reference/noImplicitAnyIndexing.js @@ -61,7 +61,7 @@ var strRepresentation2 = MyEmusEnum[0 /* emu */]; // Should be implicit 'any' ; property access fails, no string indexer. var strRepresentation3 = MyEmusEnum["monehh"]; // Should be okay; should be a MyEmusEnum -var strRepresentation4 = MyEmusEnum["emu"]; +var strRepresentation4 = 0 /* "emu" */; // Should report an implicit 'any'. var x = {}["hi"]; // Should report an implicit 'any'. diff --git a/tests/baselines/reference/numberToString.errors.txt b/tests/baselines/reference/numberToString.errors.txt index d703632d18b..07cc9009a67 100644 --- a/tests/baselines/reference/numberToString.errors.txt +++ b/tests/baselines/reference/numberToString.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/numberToString.ts(2,12): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/numberToString.ts(2,12): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/numberToString.ts(9,4): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. @@ -6,7 +6,7 @@ tests/cases/compiler/numberToString.ts(9,4): error TS2345: Argument of type 'num function f1(n:number):string { return n; // error return type mismatch ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. } function f2(s:string):void { diff --git a/tests/baselines/reference/numericIndexExpressions.errors.txt b/tests/baselines/reference/numericIndexExpressions.errors.txt index 5832cca76c6..2c3b8d76796 100644 --- a/tests/baselines/reference/numericIndexExpressions.errors.txt +++ b/tests/baselines/reference/numericIndexExpressions.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/numericIndexExpressions.ts(10,1): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/numericIndexExpressions.ts(11,1): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/numericIndexExpressions.ts(14,1): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/numericIndexExpressions.ts(15,1): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/numericIndexExpressions.ts(10,1): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/numericIndexExpressions.ts(11,1): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/numericIndexExpressions.ts(14,1): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/numericIndexExpressions.ts(15,1): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/numericIndexExpressions.ts (4 errors) ==== @@ -16,15 +16,15 @@ tests/cases/compiler/numericIndexExpressions.ts(15,1): error TS2323: Type 'numbe var x: Numbers1; x[1] = 4; // error ~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. x['1'] = 4; // error ~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var y: Strings1; y['1'] = 4; // should be error ~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. y[1] = 4; // should be error ~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt index 6e3a7cf50c8..19f2c700ccf 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt @@ -7,7 +7,7 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(21,5): error TS2412: Property '3.0' of type 'MyNumber' is not assignable to numeric index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(50,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(68,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2323: Type '{ [x: number]: string | number; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: any; X: string; foo: () => string; }' is not assignable to type '{ [x: number]: string; }'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2322: Type '{ [x: number]: string | number; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: any; X: string; foo: () => string; }' is not assignable to type '{ [x: number]: string; }'. Index signatures are incompatible. Type 'string | number' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. @@ -108,10 +108,10 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo // error var b: { [x: number]: string; } = { ~ -!!! error TS2323: Type '{ [x: number]: string | number; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: any; X: string; foo: () => string; }' is not assignable to type '{ [x: number]: string; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'string | number' is not assignable to type 'string'. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '{ [x: number]: string | number; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: any; X: string; foo: () => string; }' is not assignable to type '{ [x: number]: string; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'string | number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. a: '', b: 1, c: () => { }, diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt index adda2ec61d5..7f73ac6da0a 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(16,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(25,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(34,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(39,5): error TS2323: Type '{ [x: number]: number | A; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(39,5): error TS2322: Type '{ [x: number]: number | A; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }'. Index signatures are incompatible. Type 'number | A' is not assignable to type 'A'. Type 'number' is not assignable to type 'A'. @@ -54,10 +54,10 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo // error var b: { [x: number]: A } = { ~ -!!! error TS2323: Type '{ [x: number]: number | A; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'number | A' is not assignable to type 'A'. -!!! error TS2323: Type 'number' is not assignable to type 'A'. +!!! error TS2322: Type '{ [x: number]: number | A; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'number | A' is not assignable to type 'A'. +!!! error TS2322: Type 'number' is not assignable to type 'A'. 1.0: new A(), 2.0: new B(), "2.5": new B(), diff --git a/tests/baselines/reference/numericIndexerConstraint1.errors.txt b/tests/baselines/reference/numericIndexerConstraint1.errors.txt index 15ab0d557b0..42cf293fe60 100644 --- a/tests/baselines/reference/numericIndexerConstraint1.errors.txt +++ b/tests/baselines/reference/numericIndexerConstraint1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/numericIndexerConstraint1.ts(3,5): error TS2323: Type 'number' is not assignable to type 'Foo'. +tests/cases/compiler/numericIndexerConstraint1.ts(3,5): error TS2322: Type 'number' is not assignable to type 'Foo'. Property 'foo' is missing in type 'Number'. @@ -7,6 +7,6 @@ tests/cases/compiler/numericIndexerConstraint1.ts(3,5): error TS2323: Type 'numb var x: { [index: string]: number; }; var result: Foo = x["one"]; // error ~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'Foo'. -!!! error TS2323: Property 'foo' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'Foo'. +!!! error TS2322: Property 'foo' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstraint2.errors.txt b/tests/baselines/reference/numericIndexerConstraint2.errors.txt index cb65a5bffcc..4260f60becf 100644 --- a/tests/baselines/reference/numericIndexerConstraint2.errors.txt +++ b/tests/baselines/reference/numericIndexerConstraint2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/numericIndexerConstraint2.ts(4,1): error TS2323: Type '{ one: number; }' is not assignable to type '{ [x: string]: Foo; }'. +tests/cases/compiler/numericIndexerConstraint2.ts(4,1): error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: Foo; }'. Index signature is missing in type '{ one: number; }'. @@ -8,5 +8,5 @@ tests/cases/compiler/numericIndexerConstraint2.ts(4,1): error TS2323: Type '{ on var a: { one: number; }; x = a; ~ -!!! error TS2323: Type '{ one: number; }' is not assignable to type '{ [x: string]: Foo; }'. -!!! error TS2323: Index signature is missing in type '{ one: number; }'. \ No newline at end of file +!!! error TS2322: Type '{ one: number; }' is not assignable to type '{ [x: string]: Foo; }'. +!!! error TS2322: Index signature is missing in type '{ one: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstraint5.errors.txt b/tests/baselines/reference/numericIndexerConstraint5.errors.txt index 5bccc56ce0d..445fc771218 100644 --- a/tests/baselines/reference/numericIndexerConstraint5.errors.txt +++ b/tests/baselines/reference/numericIndexerConstraint5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/numericIndexerConstraint5.ts(2,5): error TS2323: Type '{ 0: Date; name: string; }' is not assignable to type '{ [x: number]: string; }'. +tests/cases/compiler/numericIndexerConstraint5.ts(2,5): error TS2322: Type '{ 0: Date; name: string; }' is not assignable to type '{ [x: number]: string; }'. Index signature is missing in type '{ 0: Date; name: string; }'. @@ -6,5 +6,5 @@ tests/cases/compiler/numericIndexerConstraint5.ts(2,5): error TS2323: Type '{ 0: var x = { name: "x", 0: new Date() }; var z: { [name: number]: string } = x; ~ -!!! error TS2323: Type '{ 0: Date; name: string; }' is not assignable to type '{ [x: number]: string; }'. -!!! error TS2323: Index signature is missing in type '{ 0: Date; name: string; }'. \ No newline at end of file +!!! error TS2322: Type '{ 0: Date; name: string; }' is not assignable to type '{ [x: number]: string; }'. +!!! error TS2322: Index signature is missing in type '{ 0: Date; name: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerTyping1.errors.txt b/tests/baselines/reference/numericIndexerTyping1.errors.txt index 2c5217bf5c6..3717a79a0ad 100644 --- a/tests/baselines/reference/numericIndexerTyping1.errors.txt +++ b/tests/baselines/reference/numericIndexerTyping1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/numericIndexerTyping1.ts(9,5): error TS2323: Type 'Date' is not assignable to type 'string'. -tests/cases/compiler/numericIndexerTyping1.ts(12,5): error TS2323: Type 'Date' is not assignable to type 'string'. +tests/cases/compiler/numericIndexerTyping1.ts(9,5): error TS2322: Type 'Date' is not assignable to type 'string'. +tests/cases/compiler/numericIndexerTyping1.ts(12,5): error TS2322: Type 'Date' is not assignable to type 'string'. ==== tests/cases/compiler/numericIndexerTyping1.ts (2 errors) ==== @@ -13,9 +13,9 @@ tests/cases/compiler/numericIndexerTyping1.ts(12,5): error TS2323: Type 'Date' i var i: I; var r: string = i[1]; // error: numeric indexer returns the type of the string indexer ~ -!!! error TS2323: Type 'Date' is not assignable to type 'string'. +!!! error TS2322: Type 'Date' is not assignable to type 'string'. var i2: I2; var r2: string = i2[1]; // error: numeric indexer returns the type of the string indexer ~~ -!!! error TS2323: Type 'Date' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'Date' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerTyping2.errors.txt b/tests/baselines/reference/numericIndexerTyping2.errors.txt index 2736c9d6789..5f2278c6ac1 100644 --- a/tests/baselines/reference/numericIndexerTyping2.errors.txt +++ b/tests/baselines/reference/numericIndexerTyping2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/numericIndexerTyping2.ts(9,5): error TS2323: Type 'Date' is not assignable to type 'string'. -tests/cases/compiler/numericIndexerTyping2.ts(12,5): error TS2323: Type 'Date' is not assignable to type 'string'. +tests/cases/compiler/numericIndexerTyping2.ts(9,5): error TS2322: Type 'Date' is not assignable to type 'string'. +tests/cases/compiler/numericIndexerTyping2.ts(12,5): error TS2322: Type 'Date' is not assignable to type 'string'. ==== tests/cases/compiler/numericIndexerTyping2.ts (2 errors) ==== @@ -13,9 +13,9 @@ tests/cases/compiler/numericIndexerTyping2.ts(12,5): error TS2323: Type 'Date' i var i: I; var r: string = i[1]; // error: numeric indexer returns the type of the string indexer ~ -!!! error TS2323: Type 'Date' is not assignable to type 'string'. +!!! error TS2322: Type 'Date' is not assignable to type 'string'. var i2: I2; var r2: string = i2[1]; // error: numeric indexer returns the type of the string indexere ~~ -!!! error TS2323: Type 'Date' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'Date' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt b/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt index 9fa3e39919a..0b218d3227b 100644 --- a/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt +++ b/tests/baselines/reference/objectLitStructuralTypeMismatch.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/objectLitStructuralTypeMismatch.ts(2,5): error TS2323: Type '{ b: number; }' is not assignable to type '{ a: number; }'. +tests/cases/compiler/objectLitStructuralTypeMismatch.ts(2,5): error TS2322: Type '{ b: number; }' is not assignable to type '{ a: number; }'. Property 'a' is missing in type '{ b: number; }'. @@ -6,5 +6,5 @@ tests/cases/compiler/objectLitStructuralTypeMismatch.ts(2,5): error TS2323: Type // Shouldn't compile var x: { a: number; } = { b: 5 }; ~ -!!! error TS2323: Type '{ b: number; }' is not assignable to type '{ a: number; }'. -!!! error TS2323: Property 'a' is missing in type '{ b: number; }'. \ No newline at end of file +!!! error TS2322: Type '{ b: number; }' is not assignable to type '{ a: number; }'. +!!! error TS2322: Property 'a' is missing in type '{ b: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralErrors.errors.txt b/tests/baselines/reference/objectLiteralErrors.errors.txt index 1fc92ac5a48..91b9aaeecdc 100644 --- a/tests/baselines/reference/objectLiteralErrors.errors.txt +++ b/tests/baselines/reference/objectLiteralErrors.errors.txt @@ -92,7 +92,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,13) tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,46): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,12): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,43): error TS2380: 'get' and 'set' accessor must have the same type. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(44,29): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(44,29): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,12): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,51): error TS2380: 'get' and 'set' accessor must have the same type. @@ -331,7 +331,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,51) !!! error TS2380: 'get' and 'set' accessor must have the same type. var g2 = { get a() { return 4; }, set a(n: string) { } }; ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var g3 = { get a(): number { return undefined; }, set a(n: string) { } }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2380: 'get' and 'set' accessor must have the same type. diff --git a/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt b/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt index 534a5a46208..ef084477f6d 100644 --- a/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt +++ b/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/objectLiteralIndexerErrors.ts(13,5): error TS2323: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [x: string]: A; [x: number]: B; }'. +tests/cases/compiler/objectLiteralIndexerErrors.ts(13,5): error TS2322: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [x: string]: A; [x: number]: B; }'. Index signatures are incompatible. Type 'A' is not assignable to type 'B'. @@ -18,7 +18,7 @@ tests/cases/compiler/objectLiteralIndexerErrors.ts(13,5): error TS2323: Type '{ var o1: { [s: string]: A;[n: number]: B; } = { x: b, 0: a }; // both indexers are A ~~ -!!! error TS2323: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [x: string]: A; [x: number]: B; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'A' is not assignable to type 'B'. +!!! error TS2322: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [x: string]: A; [x: number]: B; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'A' is not assignable to type 'B'. o1 = { x: c, 0: a }; // string indexer is any, number indexer is A \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt b/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt index b3b1c6ec6f0..3f499b0a580 100644 --- a/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt +++ b/tests/baselines/reference/objectLiteralWithNumericPropertyName.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/objectLiteralWithNumericPropertyName.ts(4,5): error TS2323: Type '{ 0: number; }' is not assignable to type 'A'. +tests/cases/compiler/objectLiteralWithNumericPropertyName.ts(4,5): error TS2322: Type '{ 0: number; }' is not assignable to type 'A'. Types of property '0' are incompatible. Type 'number' is not assignable to type 'string'. @@ -9,9 +9,9 @@ tests/cases/compiler/objectLiteralWithNumericPropertyName.ts(4,5): error TS2323: } var x: A = { ~ -!!! error TS2323: Type '{ 0: number; }' is not assignable to type 'A'. -!!! error TS2323: Types of property '0' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '{ 0: number; }' is not assignable to type 'A'. +!!! error TS2322: Types of property '0' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. 0: 3 }; \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt index 3568899773e..c4ee3ea17b2 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat.errors.txt @@ -1,12 +1,12 @@ -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(7,1): error TS2323: Type 'I' is not assignable to type 'Object'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(7,1): error TS2322: Type 'I' is not assignable to type 'Object'. Types of property 'toString' are incompatible. Type '() => void' is not assignable to type '() => string'. Type 'void' is not assignable to type 'string'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(14,1): error TS2323: Type 'C' is not assignable to type 'Object'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(14,1): error TS2322: Type 'C' is not assignable to type 'Object'. Types of property 'toString' are incompatible. Type '() => void' is not assignable to type '() => string'. Type 'void' is not assignable to type 'string'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(20,1): error TS2323: Type '{ toString: () => void; }' is not assignable to type 'Object'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat.ts(20,1): error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'. Types of property 'toString' are incompatible. Type '() => void' is not assignable to type '() => string'. Type 'void' is not assignable to type 'string'. @@ -21,10 +21,10 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC var o: Object; o = i; // error ~ -!!! error TS2323: Type 'I' is not assignable to type 'Object'. -!!! error TS2323: Types of property 'toString' are incompatible. -!!! error TS2323: Type '() => void' is not assignable to type '() => string'. -!!! error TS2323: Type 'void' is not assignable to type 'string'. +!!! error TS2322: Type 'I' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => void' is not assignable to type '() => string'. +!!! error TS2322: Type 'void' is not assignable to type 'string'. i = o; // ok class C { @@ -33,10 +33,10 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC var c: C; o = c; // error ~ -!!! error TS2323: Type 'C' is not assignable to type 'Object'. -!!! error TS2323: Types of property 'toString' are incompatible. -!!! error TS2323: Type '() => void' is not assignable to type '() => string'. -!!! error TS2323: Type 'void' is not assignable to type 'string'. +!!! error TS2322: Type 'C' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => void' is not assignable to type '() => string'. +!!! error TS2322: Type 'void' is not assignable to type 'string'. c = o; // ok var a = { @@ -44,8 +44,8 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC } o = a; // error ~ -!!! error TS2323: Type '{ toString: () => void; }' is not assignable to type 'Object'. -!!! error TS2323: Types of property 'toString' are incompatible. -!!! error TS2323: Type '() => void' is not assignable to type '() => string'. -!!! error TS2323: Type 'void' is not assignable to type 'string'. +!!! error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => void' is not assignable to type '() => string'. +!!! error TS2322: Type 'void' is not assignable to type 'string'. a = o; // ok \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt index 3eed6774826..a88796b390e 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt +++ b/tests/baselines/reference/objectTypeHidingMembersOfObjectAssignmentCompat2.errors.txt @@ -1,20 +1,20 @@ -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(7,1): error TS2323: Type 'I' is not assignable to type 'Object'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(7,1): error TS2322: Type 'I' is not assignable to type 'Object'. Types of property 'toString' are incompatible. Type '() => number' is not assignable to type '() => string'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(8,1): error TS2323: Type 'Object' is not assignable to type 'I'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'. Types of property 'toString' are incompatible. Type '() => string' is not assignable to type '() => number'. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(14,1): error TS2323: Type 'C' is not assignable to type 'Object'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(14,1): error TS2322: Type 'C' is not assignable to type 'Object'. Types of property 'toString' are incompatible. Type '() => number' is not assignable to type '() => string'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(15,1): error TS2323: Type 'Object' is not assignable to type 'C'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(15,1): error TS2322: Type 'Object' is not assignable to type 'C'. Types of property 'toString' are incompatible. Type '() => string' is not assignable to type '() => number'. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(20,1): error TS2323: Type '{ toString: () => void; }' is not assignable to type 'Object'. +tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentCompat2.ts(20,1): error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'. Types of property 'toString' are incompatible. Type '() => void' is not assignable to type '() => string'. Type 'void' is not assignable to type 'string'. @@ -29,16 +29,16 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC var o: Object; o = i; // error ~ -!!! error TS2323: Type 'I' is not assignable to type 'Object'. -!!! error TS2323: Types of property 'toString' are incompatible. -!!! error TS2323: Type '() => number' is not assignable to type '() => string'. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'I' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => number' is not assignable to type '() => string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. i = o; // error ~ -!!! error TS2323: Type 'Object' is not assignable to type 'I'. -!!! error TS2323: Types of property 'toString' are incompatible. -!!! error TS2323: Type '() => string' is not assignable to type '() => number'. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'Object' is not assignable to type 'I'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => string' is not assignable to type '() => number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. class C { toString(): number { return 1; } @@ -46,24 +46,24 @@ tests/cases/conformance/types/members/objectTypeHidingMembersOfObjectAssignmentC var c: C; o = c; // error ~ -!!! error TS2323: Type 'C' is not assignable to type 'Object'. -!!! error TS2323: Types of property 'toString' are incompatible. -!!! error TS2323: Type '() => number' is not assignable to type '() => string'. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'C' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => number' is not assignable to type '() => string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. c = o; // error ~ -!!! error TS2323: Type 'Object' is not assignable to type 'C'. -!!! error TS2323: Types of property 'toString' are incompatible. -!!! error TS2323: Type '() => string' is not assignable to type '() => number'. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'Object' is not assignable to type 'C'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => string' is not assignable to type '() => number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var a = { toString: () => { } } o = a; // error ~ -!!! error TS2323: Type '{ toString: () => void; }' is not assignable to type 'Object'. -!!! error TS2323: Types of property 'toString' are incompatible. -!!! error TS2323: Type '() => void' is not assignable to type '() => string'. -!!! error TS2323: Type 'void' is not assignable to type 'string'. +!!! error TS2322: Type '{ toString: () => void; }' is not assignable to type 'Object'. +!!! error TS2322: Types of property 'toString' are incompatible. +!!! error TS2322: Type '() => void' is not assignable to type '() => string'. +!!! error TS2322: Type 'void' is not assignable to type 'string'. a = o; // ok \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt index 982fcf05b3b..30b40f431a7 100644 --- a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt +++ b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts(8,1): error TS2323: Type 'Object' is not assignable to type 'I'. -tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts(14,1): error TS2323: Type 'Object' is not assignable to type '() => void'. +tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'. +tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts(14,1): error TS2322: Type 'Object' is not assignable to type '() => void'. ==== tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts (2 errors) ==== @@ -12,7 +12,7 @@ tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOf f = i; i = f; ~ -!!! error TS2323: Type 'Object' is not assignable to type 'I'. +!!! error TS2322: Type 'Object' is not assignable to type 'I'. var a: { (): void @@ -20,4 +20,4 @@ tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOf f = a; a = f; ~ -!!! error TS2323: Type 'Object' is not assignable to type '() => void'. \ No newline at end of file +!!! error TS2322: Type 'Object' is not assignable to type '() => void'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt index 1544fb5bebe..0faba936715 100644 --- a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt +++ b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts(8,1): error TS2323: Type 'Object' is not assignable to type 'I'. -tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts(14,1): error TS2323: Type 'Object' is not assignable to type 'new () => any'. +tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'. +tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts(14,1): error TS2322: Type 'Object' is not assignable to type 'new () => any'. ==== tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts (2 errors) ==== @@ -12,7 +12,7 @@ tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMemb f = i; i = f; ~ -!!! error TS2323: Type 'Object' is not assignable to type 'I'. +!!! error TS2322: Type 'Object' is not assignable to type 'I'. var a: { new(): any @@ -20,4 +20,4 @@ tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMemb f = a; a = f; ~ -!!! error TS2323: Type 'Object' is not assignable to type 'new () => any'. \ No newline at end of file +!!! error TS2322: Type 'Object' is not assignable to type 'new () => any'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.errors.txt b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.errors.txt index 11698f0a51c..582d7719a89 100644 --- a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.errors.txt +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedProperty.ts(13,1): error TS2323: Type 'List' is not assignable to type 'List'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedProperty.ts(13,1): error TS2322: Type 'List' is not assignable to type 'List'. Type 'string' is not assignable to type 'number'. @@ -17,5 +17,5 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRec list1 = list2; // ok list1 = list3; // error ~~~~~ -!!! error TS2323: Type 'List' is not assignable to type 'List'. -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'List' is not assignable to type 'List'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.errors.txt b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.errors.txt index 53a32b6aad5..6349a452821 100644 --- a/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.errors.txt +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedProperty2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedProperty2.ts(13,1): error TS2323: Type 'List' is not assignable to type 'List'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedProperty2.ts(13,1): error TS2322: Type 'List' is not assignable to type 'List'. Type 'string' is not assignable to type 'number'. @@ -17,5 +17,5 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRec list1 = list2; // ok list1 = list3; // error ~~~~~ -!!! error TS2323: Type 'List' is not assignable to type 'List'. -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'List' is not assignable to type 'List'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt b/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt index 20951b6571e..91a92dbd54c 100644 --- a/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt @@ -1,16 +1,16 @@ -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(20,1): error TS2323: Type 'MyList' is not assignable to type 'List'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(20,1): error TS2322: Type 'MyList' is not assignable to type 'List'. Types of property 'data' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(22,1): error TS2323: Type 'MyList' is not assignable to type 'List'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(22,1): error TS2322: Type 'MyList' is not assignable to type 'List'. Types of property 'data' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(30,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(31,5): error TS2323: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(30,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(31,5): error TS2322: Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(41,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(42,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(43,5): error TS2323: Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(48,5): error TS2323: Type 'T' is not assignable to type 'List'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(50,5): error TS2323: Type 'T' is not assignable to type 'MyList'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(42,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(43,5): error TS2322: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(48,5): error TS2322: Type 'T' is not assignable to type 'List'. +tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(50,5): error TS2322: Type 'T' is not assignable to type 'MyList'. ==== tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts (9 errors) ==== @@ -35,15 +35,15 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRec list1 = myList1; // error, not nominally equal list1 = myList2; // error, type mismatch ~~~~~ -!!! error TS2323: Type 'MyList' is not assignable to type 'List'. -!!! error TS2323: Types of property 'data' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'MyList' is not assignable to type 'List'. +!!! error TS2322: Types of property 'data' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. list2 = myList1; // error, not nominally equal ~~~~~ -!!! error TS2323: Type 'MyList' is not assignable to type 'List'. -!!! error TS2323: Types of property 'data' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'MyList' is not assignable to type 'List'. +!!! error TS2322: Types of property 'data' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. list2 = myList2; // error, type mismatch var rList1 = new List>(); @@ -53,10 +53,10 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRec function foo, U extends MyList>(t: T, u: U) { t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. u = t; // error ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. var a: List; var b: MyList; @@ -71,20 +71,20 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRec !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. u = t; // was error, ok after constraint made illegal, doesn't matter ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. var a: List; var b: MyList; a = t; // error ~ -!!! error TS2323: Type 'T' is not assignable to type 'List'. +!!! error TS2322: Type 'T' is not assignable to type 'List'. a = u; // error b = t; // ok ~ -!!! error TS2323: Type 'T' is not assignable to type 'MyList'. +!!! error TS2322: Type 'T' is not assignable to type 'MyList'. b = u; // ok } \ No newline at end of file diff --git a/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt b/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt index c1c687f345a..52fb45e40d2 100644 --- a/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt +++ b/tests/baselines/reference/optionalFunctionArgAssignability.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/optionalFunctionArgAssignability.ts(7,1): error TS2323: Type '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' is not assignable to type '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise'. +tests/cases/compiler/optionalFunctionArgAssignability.ts(7,1): error TS2322: Type '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' is not assignable to type '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise'. Types of parameters 'onFulFill' and 'onFulfill' are incompatible. Type '(value: number) => any' is not assignable to type '(value: string) => any'. Types of parameters 'value' and 'value' are incompatible. @@ -14,9 +14,9 @@ tests/cases/compiler/optionalFunctionArgAssignability.ts(7,1): error TS2323: Typ var b = function then(onFulFill?: (value: number) => U, onReject?: (reason: any) => U): Promise { return null }; a = b; // error because number is not assignable to string ~ -!!! error TS2323: Type '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' is not assignable to type '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise'. -!!! error TS2323: Types of parameters 'onFulFill' and 'onFulfill' are incompatible. -!!! error TS2323: Type '(value: number) => any' is not assignable to type '(value: string) => any'. -!!! error TS2323: Types of parameters 'value' and 'value' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise' is not assignable to type '(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise'. +!!! error TS2322: Types of parameters 'onFulFill' and 'onFulfill' are incompatible. +!!! error TS2322: Type '(value: number) => any' is not assignable to type '(value: string) => any'. +!!! error TS2322: Types of parameters 'value' and 'value' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt b/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt index a3c76815e30..de02509d124 100644 --- a/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt +++ b/tests/baselines/reference/optionalParamAssignmentCompat.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/optionalParamAssignmentCompat.ts(10,5): error TS2323: Type '(p1?: string) => I1' is not assignable to type 'I1'. +tests/cases/compiler/optionalParamAssignmentCompat.ts(10,5): error TS2322: Type '(p1?: string) => I1' is not assignable to type 'I1'. Types of parameters 'p1' and 'p1' are incompatible. Type 'string' is not assignable to type 'number'. @@ -15,7 +15,7 @@ tests/cases/compiler/optionalParamAssignmentCompat.ts(10,5): error TS2323: Type var c: I1 = i2.p1; // should be ok var d: I1 = i2.m1; // should error ~ -!!! error TS2323: Type '(p1?: string) => I1' is not assignable to type 'I1'. -!!! error TS2323: Types of parameters 'p1' and 'p1' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(p1?: string) => I1' is not assignable to type 'I1'. +!!! error TS2322: Types of parameters 'p1' and 'p1' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalParamTypeComparison.errors.txt b/tests/baselines/reference/optionalParamTypeComparison.errors.txt index c3fe7cc5d5d..98a07570c65 100644 --- a/tests/baselines/reference/optionalParamTypeComparison.errors.txt +++ b/tests/baselines/reference/optionalParamTypeComparison.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/optionalParamTypeComparison.ts(4,1): error TS2323: Type '(s: string, b?: boolean) => void' is not assignable to type '(s: string, n?: number) => void'. +tests/cases/compiler/optionalParamTypeComparison.ts(4,1): error TS2322: Type '(s: string, b?: boolean) => void' is not assignable to type '(s: string, n?: number) => void'. Types of parameters 'b' and 'n' are incompatible. Type 'boolean' is not assignable to type 'number'. -tests/cases/compiler/optionalParamTypeComparison.ts(5,1): error TS2323: Type '(s: string, n?: number) => void' is not assignable to type '(s: string, b?: boolean) => void'. +tests/cases/compiler/optionalParamTypeComparison.ts(5,1): error TS2322: Type '(s: string, n?: number) => void' is not assignable to type '(s: string, b?: boolean) => void'. Types of parameters 'n' and 'b' are incompatible. Type 'number' is not assignable to type 'boolean'. @@ -12,11 +12,11 @@ tests/cases/compiler/optionalParamTypeComparison.ts(5,1): error TS2323: Type '(s f = g; ~ -!!! error TS2323: Type '(s: string, b?: boolean) => void' is not assignable to type '(s: string, n?: number) => void'. -!!! error TS2323: Types of parameters 'b' and 'n' are incompatible. -!!! error TS2323: Type 'boolean' is not assignable to type 'number'. +!!! error TS2322: Type '(s: string, b?: boolean) => void' is not assignable to type '(s: string, n?: number) => void'. +!!! error TS2322: Types of parameters 'b' and 'n' are incompatible. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. g = f; ~ -!!! error TS2323: Type '(s: string, n?: number) => void' is not assignable to type '(s: string, b?: boolean) => void'. -!!! error TS2323: Types of parameters 'n' and 'b' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2322: Type '(s: string, n?: number) => void' is not assignable to type '(s: string, b?: boolean) => void'. +!!! error TS2322: Types of parameters 'n' and 'b' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalPropertiesTest.errors.txt b/tests/baselines/reference/optionalPropertiesTest.errors.txt index 1059d05abea..a4b721e92ef 100644 --- a/tests/baselines/reference/optionalPropertiesTest.errors.txt +++ b/tests/baselines/reference/optionalPropertiesTest.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/optionalPropertiesTest.ts(14,1): error TS2323: Type '{ name: string; }' is not assignable to type 'IFoo'. +tests/cases/compiler/optionalPropertiesTest.ts(14,1): error TS2322: Type '{ name: string; }' is not assignable to type 'IFoo'. Property 'id' is missing in type '{ name: string; }'. -tests/cases/compiler/optionalPropertiesTest.ts(25,5): error TS2323: Type '{}' is not assignable to type 'i1'. +tests/cases/compiler/optionalPropertiesTest.ts(25,5): error TS2322: Type '{}' is not assignable to type 'i1'. Property 'M' is missing in type '{}'. -tests/cases/compiler/optionalPropertiesTest.ts(26,5): error TS2323: Type '{}' is not assignable to type 'i3'. +tests/cases/compiler/optionalPropertiesTest.ts(26,5): error TS2322: Type '{}' is not assignable to type 'i3'. Property 'M' is missing in type '{}'. -tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2323: Type 'i2' is not assignable to type 'i1'. +tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2322: Type 'i2' is not assignable to type 'i1'. Property 'M' is optional in type 'i2' but required in type 'i1'. @@ -24,8 +24,8 @@ tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2323: Type 'i2' is foo = { id: 1234, name: "test" }; // Ok foo = { name: "test" }; // Error, id missing ~~~ -!!! error TS2323: Type '{ name: string; }' is not assignable to type 'IFoo'. -!!! error TS2323: Property 'id' is missing in type '{ name: string; }'. +!!! error TS2322: Type '{ name: string; }' is not assignable to type 'IFoo'. +!!! error TS2322: Property 'id' is missing in type '{ name: string; }'. foo = {id: 1234, print:()=>{}} // Ok var s = foo.name || "default"; @@ -38,12 +38,12 @@ tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2323: Type 'i2' is var test1: i1 = {}; ~~~~~ -!!! error TS2323: Type '{}' is not assignable to type 'i1'. -!!! error TS2323: Property 'M' is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type 'i1'. +!!! error TS2322: Property 'M' is missing in type '{}'. var test2: i3 = {}; ~~~~~ -!!! error TS2323: Type '{}' is not assignable to type 'i3'. -!!! error TS2323: Property 'M' is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type 'i3'. +!!! error TS2322: Property 'M' is missing in type '{}'. var test3: i2 = {}; var test4: i4 = {}; var test5: i1 = { M: function () { } }; @@ -59,5 +59,5 @@ tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2323: Type 'i2' is var test10_2: i2; test10_1 = test10_2; ~~~~~~~~ -!!! error TS2323: Type 'i2' is not assignable to type 'i1'. -!!! error TS2323: Property 'M' is optional in type 'i2' but required in type 'i1'. \ No newline at end of file +!!! error TS2322: Type 'i2' is not assignable to type 'i1'. +!!! error TS2322: Property 'M' is optional in type 'i2' but required in type 'i1'. \ No newline at end of file diff --git a/tests/baselines/reference/overEagerReturnTypeSpecialization.errors.txt b/tests/baselines/reference/overEagerReturnTypeSpecialization.errors.txt index 241bbb5729d..c18a965a6dc 100644 --- a/tests/baselines/reference/overEagerReturnTypeSpecialization.errors.txt +++ b/tests/baselines/reference/overEagerReturnTypeSpecialization.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/overEagerReturnTypeSpecialization.ts(8,5): error TS2323: Type 'I1' is not assignable to type 'I1'. +tests/cases/compiler/overEagerReturnTypeSpecialization.ts(8,5): error TS2322: Type 'I1' is not assignable to type 'I1'. Type 'number' is not assignable to type 'string'. @@ -12,8 +12,8 @@ tests/cases/compiler/overEagerReturnTypeSpecialization.ts(8,5): error TS2323: Ty declare var v1: I1; var r1: I1 = v1.func(num => num.toString()) // Correctly returns an I1 ~~ -!!! error TS2323: Type 'I1' is not assignable to type 'I1'. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'I1' is not assignable to type 'I1'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. .func(str => str.length); // should error var r2: I1 = v1.func(num => num.toString()) // Correctly returns an I1 diff --git a/tests/baselines/reference/overload1.errors.txt b/tests/baselines/reference/overload1.errors.txt index c4d3d999880..a1d8c5a6232 100644 --- a/tests/baselines/reference/overload1.errors.txt +++ b/tests/baselines/reference/overload1.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/overload1.ts(27,5): error TS2323: Type 'C' is not assignable to type 'string'. -tests/cases/compiler/overload1.ts(29,1): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/overload1.ts(27,5): error TS2322: Type 'C' is not assignable to type 'string'. +tests/cases/compiler/overload1.ts(29,1): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/overload1.ts(31,3): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/overload1.ts(32,3): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/overload1.ts(33,1): error TS2323: Type 'C' is not assignable to type 'string'. +tests/cases/compiler/overload1.ts(33,1): error TS2322: Type 'C' is not assignable to type 'string'. tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. @@ -35,11 +35,11 @@ tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type 'number' var e:string=x.g(new O.A()); // matches overload but bad assignment ~ -!!! error TS2323: Type 'C' is not assignable to type 'string'. +!!! error TS2322: Type 'C' is not assignable to type 'string'. var y:string=x.f(3); // good y=x.f("nope"); // can't assign number to string ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var z:string=x.g(x.g(3,3)); // good z=x.g(2,2,2); // no match ~~~~~~~~~~ @@ -49,7 +49,7 @@ tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type 'number' !!! error TS2346: Supplied parameters do not match any signature of call target. z=x.g(new O.B()); // ambiguous (up and down conversion) ~ -!!! error TS2323: Type 'C' is not assignable to type 'string'. +!!! error TS2322: Type 'C' is not assignable to type 'string'. z=x.h(2,2); // no match ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. diff --git a/tests/baselines/reference/overloadingOnConstants1.errors.txt b/tests/baselines/reference/overloadingOnConstants1.errors.txt index e52a2a10e5b..f134a146500 100644 --- a/tests/baselines/reference/overloadingOnConstants1.errors.txt +++ b/tests/baselines/reference/overloadingOnConstants1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/overloadingOnConstants1.ts(22,5): error TS2323: Type 'Base' is not assignable to type 'Derived1'. +tests/cases/compiler/overloadingOnConstants1.ts(22,5): error TS2322: Type 'Base' is not assignable to type 'Derived1'. Property 'bar' is missing in type 'Base'. -tests/cases/compiler/overloadingOnConstants1.ts(23,5): error TS2323: Type 'Derived1' is not assignable to type 'Derived3'. +tests/cases/compiler/overloadingOnConstants1.ts(23,5): error TS2322: Type 'Derived1' is not assignable to type 'Derived3'. Property 'biz' is missing in type 'Derived1'. -tests/cases/compiler/overloadingOnConstants1.ts(24,5): error TS2323: Type 'Derived2' is not assignable to type 'Derived1'. +tests/cases/compiler/overloadingOnConstants1.ts(24,5): error TS2322: Type 'Derived2' is not assignable to type 'Derived1'. Property 'bar' is missing in type 'Derived2'. -tests/cases/compiler/overloadingOnConstants1.ts(25,5): error TS2323: Type 'Derived3' is not assignable to type 'Derived1'. +tests/cases/compiler/overloadingOnConstants1.ts(25,5): error TS2322: Type 'Derived3' is not assignable to type 'Derived1'. Property 'bar' is missing in type 'Derived3'. @@ -32,17 +32,17 @@ tests/cases/compiler/overloadingOnConstants1.ts(25,5): error TS2323: Type 'Deriv // these are errors var htmlElement2: Derived1 = d2.createElement("yo") ~~~~~~~~~~~~ -!!! error TS2323: Type 'Base' is not assignable to type 'Derived1'. -!!! error TS2323: Property 'bar' is missing in type 'Base'. +!!! error TS2322: Type 'Base' is not assignable to type 'Derived1'. +!!! error TS2322: Property 'bar' is missing in type 'Base'. var htmlCanvasElement2: Derived3 = d2.createElement("canvas"); ~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'Derived1' is not assignable to type 'Derived3'. -!!! error TS2323: Property 'biz' is missing in type 'Derived1'. +!!! error TS2322: Type 'Derived1' is not assignable to type 'Derived3'. +!!! error TS2322: Property 'biz' is missing in type 'Derived1'. var htmlDivElement2: Derived1 = d2.createElement("div"); ~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'Derived2' is not assignable to type 'Derived1'. -!!! error TS2323: Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Type 'Derived2' is not assignable to type 'Derived1'. +!!! error TS2322: Property 'bar' is missing in type 'Derived2'. var htmlSpanElement2: Derived1 = d2.createElement("span"); ~~~~~~~~~~~~~~~~ -!!! error TS2323: Type 'Derived3' is not assignable to type 'Derived1'. -!!! error TS2323: Property 'bar' is missing in type 'Derived3'. \ No newline at end of file +!!! error TS2322: Type 'Derived3' is not assignable to type 'Derived1'. +!!! error TS2322: Property 'bar' is missing in type 'Derived3'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt index 80472228380..4a119c5ca22 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(14,37): error TS2345: Argument of type 'D' is not assignable to parameter of type 'A'. -tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(16,38): error TS2344: Type 'D' does not satisfy the constraint 'A'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(18,27): error TS2345: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,12): error TS2344: Type 'D' does not satisfy the constraint 'A'. @@ -22,13 +22,13 @@ tests/cases/compiler/overloadresolutionWithConstraintCheckingDeferred.ts(19,12): var result: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. ~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. ~ !!! error TS2345: Argument of type 'D' is not assignable to parameter of type 'A'. var result2: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. ~~~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. ~~~~~~~~ !!! error TS2344: Type 'D' does not satisfy the constraint 'A'. diff --git a/tests/baselines/reference/parseTypes.errors.txt b/tests/baselines/reference/parseTypes.errors.txt index ccaf7be59bf..baa5aaff738 100644 --- a/tests/baselines/reference/parseTypes.errors.txt +++ b/tests/baselines/reference/parseTypes.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/parseTypes.ts(9,1): error TS2323: Type '(s: string) => void' is not assignable to type '() => number'. -tests/cases/compiler/parseTypes.ts(10,1): error TS2323: Type '(s: string) => void' is not assignable to type '() => number'. -tests/cases/compiler/parseTypes.ts(11,1): error TS2323: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'. +tests/cases/compiler/parseTypes.ts(9,1): error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. +tests/cases/compiler/parseTypes.ts(10,1): error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. +tests/cases/compiler/parseTypes.ts(11,1): error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'. Index signature is missing in type '(s: string) => void'. -tests/cases/compiler/parseTypes.ts(12,1): error TS2323: Type '(s: string) => void' is not assignable to type 'new () => number'. +tests/cases/compiler/parseTypes.ts(12,1): error TS2322: Type '(s: string) => void' is not assignable to type 'new () => number'. ==== tests/cases/compiler/parseTypes.ts (4 errors) ==== @@ -16,15 +16,15 @@ tests/cases/compiler/parseTypes.ts(12,1): error TS2323: Type '(s: string) => voi y=f; y=g; ~ -!!! error TS2323: Type '(s: string) => void' is not assignable to type '() => number'. +!!! error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. x=g; ~ -!!! error TS2323: Type '(s: string) => void' is not assignable to type '() => number'. +!!! error TS2322: Type '(s: string) => void' is not assignable to type '() => number'. w=g; ~ -!!! error TS2323: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'. -!!! error TS2323: Index signature is missing in type '(s: string) => void'. +!!! error TS2322: Type '(s: string) => void' is not assignable to type '{ [x: number]: number; }'. +!!! error TS2322: Index signature is missing in type '(s: string) => void'. z=g; ~ -!!! error TS2323: Type '(s: string) => void' is not assignable to type 'new () => number'. +!!! error TS2322: Type '(s: string) => void' is not assignable to type 'new () => number'. \ No newline at end of file diff --git a/tests/baselines/reference/parserAutomaticSemicolonInsertion1.errors.txt b/tests/baselines/reference/parserAutomaticSemicolonInsertion1.errors.txt index 4e67a4e8641..ee17b6f82aa 100644 --- a/tests/baselines/reference/parserAutomaticSemicolonInsertion1.errors.txt +++ b/tests/baselines/reference/parserAutomaticSemicolonInsertion1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAutomaticSemicolonInsertion1.ts(8,1): error TS2323: Type 'Object' is not assignable to type 'I'. -tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAutomaticSemicolonInsertion1.ts(14,1): error TS2323: Type 'Object' is not assignable to type '() => void'. +tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAutomaticSemicolonInsertion1.ts(8,1): error TS2322: Type 'Object' is not assignable to type 'I'. +tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAutomaticSemicolonInsertion1.ts(14,1): error TS2322: Type 'Object' is not assignable to type '() => void'. ==== tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAutomaticSemicolonInsertion1.ts (2 errors) ==== @@ -12,7 +12,7 @@ tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAut o = i; i = o; ~ -!!! error TS2323: Type 'Object' is not assignable to type 'I'. +!!! error TS2322: Type 'Object' is not assignable to type 'I'. var a: { (): void @@ -20,5 +20,5 @@ tests/cases/conformance/parser/ecmascript5/AutomaticSemicolonInsertion/parserAut o = a; a = o; ~ -!!! error TS2323: Type 'Object' is not assignable to type '() => void'. +!!! error TS2322: Type 'Object' is not assignable to type '() => void'. \ No newline at end of file diff --git a/tests/baselines/reference/parserObjectCreation1.errors.txt b/tests/baselines/reference/parserObjectCreation1.errors.txt index 876f49c5bed..0787d17c605 100644 --- a/tests/baselines/reference/parserObjectCreation1.errors.txt +++ b/tests/baselines/reference/parserObjectCreation1.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/parser/ecmascript5/Generics/parserObjectCreation1.ts(1,5): error TS2323: Type 'number[][]' is not assignable to type 'number[]'. +tests/cases/conformance/parser/ecmascript5/Generics/parserObjectCreation1.ts(1,5): error TS2322: Type 'number[][]' is not assignable to type 'number[]'. Type 'number[]' is not assignable to type 'number'. ==== tests/cases/conformance/parser/ecmascript5/Generics/parserObjectCreation1.ts (1 errors) ==== var autoToken: number[] = new Array(1); ~~~~~~~~~ -!!! error TS2323: Type 'number[][]' is not assignable to type 'number[]'. -!!! error TS2323: Type 'number[]' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'number[][]' is not assignable to type 'number[]'. +!!! error TS2322: Type 'number[]' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithEnumType.js b/tests/baselines/reference/plusOperatorWithEnumType.js index 4d6eaad892e..1ce6036d5ce 100644 --- a/tests/baselines/reference/plusOperatorWithEnumType.js +++ b/tests/baselines/reference/plusOperatorWithEnumType.js @@ -35,8 +35,8 @@ var ENUM1; var ResultIsNumber1 = +ENUM; var ResultIsNumber2 = +ENUM1; // enum type expressions -var ResultIsNumber3 = +ENUM1["A"]; -var ResultIsNumber4 = +(ENUM[0] + ENUM1["B"]); +var ResultIsNumber3 = +0 /* "A" */; +var ResultIsNumber4 = +(ENUM[0] + 1 /* "B" */); // miss assignment operators +ENUM; +ENUM1; diff --git a/tests/baselines/reference/preserveConstEnums.js b/tests/baselines/reference/preserveConstEnums.js new file mode 100644 index 00000000000..3f27825283f --- /dev/null +++ b/tests/baselines/reference/preserveConstEnums.js @@ -0,0 +1,11 @@ +//// [preserveConstEnums.ts] +const enum E { + Value = 1, Value2 = Value +} + +//// [preserveConstEnums.js] +var E; +(function (E) { + E[E["Value"] = 1] = "Value"; + E[E["Value2"] = 1] = "Value2"; +})(E || (E = {})); diff --git a/tests/baselines/reference/preserveConstEnums.types b/tests/baselines/reference/preserveConstEnums.types new file mode 100644 index 00000000000..080cdbffb2b --- /dev/null +++ b/tests/baselines/reference/preserveConstEnums.types @@ -0,0 +1,9 @@ +=== tests/cases/compiler/preserveConstEnums.ts === +const enum E { +>E : E + + Value = 1, Value2 = Value +>Value : E +>Value2 : E +>Value : E +} diff --git a/tests/baselines/reference/primitiveMembers.errors.txt b/tests/baselines/reference/primitiveMembers.errors.txt index d0ed1da7cce..7a1ed5c8e53 100644 --- a/tests/baselines/reference/primitiveMembers.errors.txt +++ b/tests/baselines/reference/primitiveMembers.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/primitiveMembers.ts(24,35): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. tests/cases/compiler/primitiveMembers.ts(25,56): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. tests/cases/compiler/primitiveMembers.ts(5,3): error TS2339: Property 'toBAZ' does not exist on type 'number'. -tests/cases/compiler/primitiveMembers.ts(11,1): error TS2323: Type 'Number' is not assignable to type 'number'. +tests/cases/compiler/primitiveMembers.ts(11,1): error TS2322: Type 'Number' is not assignable to type 'number'. ==== tests/cases/compiler/primitiveMembers.ts (4 errors) ==== @@ -19,7 +19,7 @@ tests/cases/compiler/primitiveMembers.ts(11,1): error TS2323: Type 'Number' is n n = N; // should not work, as 'number' has a different brand ~ -!!! error TS2323: Type 'Number' is not assignable to type 'number'. +!!! error TS2322: Type 'Number' is not assignable to type 'number'. N = n; // should work var o: Object = {} diff --git a/tests/baselines/reference/propertyAssignment.errors.txt b/tests/baselines/reference/propertyAssignment.errors.txt index 3f5aca52c87..20894f159e0 100644 --- a/tests/baselines/reference/propertyAssignment.errors.txt +++ b/tests/baselines/reference/propertyAssignment.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/propertyAssignment.ts(6,14): error TS1022: An index signature parameter must have a type annotation. -tests/cases/compiler/propertyAssignment.ts(14,1): error TS2323: Type '{ x: number; }' is not assignable to type 'new () => any'. -tests/cases/compiler/propertyAssignment.ts(16,1): error TS2323: Type '{ x: number; }' is not assignable to type '() => void'. +tests/cases/compiler/propertyAssignment.ts(14,1): error TS2322: Type '{ x: number; }' is not assignable to type 'new () => any'. +tests/cases/compiler/propertyAssignment.ts(16,1): error TS2322: Type '{ x: number; }' is not assignable to type '() => void'. ==== tests/cases/compiler/propertyAssignment.ts (3 errors) ==== @@ -21,8 +21,8 @@ tests/cases/compiler/propertyAssignment.ts(16,1): error TS2323: Type '{ x: numbe foo1 = bar1; // should be an error ~~~~ -!!! error TS2323: Type '{ x: number; }' is not assignable to type 'new () => any'. +!!! error TS2322: Type '{ x: number; }' is not assignable to type 'new () => any'. foo2 = bar2; foo3 = bar3; // should be an error ~~~~ -!!! error TS2323: Type '{ x: number; }' is not assignable to type '() => void'. \ No newline at end of file +!!! error TS2322: Type '{ x: number; }' is not assignable to type '() => void'. \ No newline at end of file diff --git a/tests/baselines/reference/propertyParameterWithQuestionMark.errors.txt b/tests/baselines/reference/propertyParameterWithQuestionMark.errors.txt index 681d2c5ea9a..b3970c216eb 100644 --- a/tests/baselines/reference/propertyParameterWithQuestionMark.errors.txt +++ b/tests/baselines/reference/propertyParameterWithQuestionMark.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/propertyParameterWithQuestionMark.ts(6,5): error TS2323: Type '{}' is not assignable to type 'C'. +tests/cases/compiler/propertyParameterWithQuestionMark.ts(6,5): error TS2322: Type '{}' is not assignable to type 'C'. Property 'x' is missing in type '{}'. -tests/cases/compiler/propertyParameterWithQuestionMark.ts(8,1): error TS2323: Type '{ x?: any; }' is not assignable to type 'C'. +tests/cases/compiler/propertyParameterWithQuestionMark.ts(8,1): error TS2322: Type '{ x?: any; }' is not assignable to type 'C'. Property 'x' is optional in type '{ x?: any; }' but required in type 'C'. @@ -12,11 +12,11 @@ tests/cases/compiler/propertyParameterWithQuestionMark.ts(8,1): error TS2323: Ty // x should not be an optional property var v: C = {}; // Should fail ~ -!!! error TS2323: Type '{}' is not assignable to type 'C'. -!!! error TS2323: Property 'x' is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type 'C'. +!!! error TS2322: Property 'x' is missing in type '{}'. var v2: { x? } v = v2; // Should fail ~ -!!! error TS2323: Type '{ x?: any; }' is not assignable to type 'C'. -!!! error TS2323: Property 'x' is optional in type '{ x?: any; }' but required in type 'C'. +!!! error TS2322: Type '{ x?: any; }' is not assignable to type 'C'. +!!! error TS2322: Property 'x' is optional in type '{ x?: any; }' but required in type 'C'. var v3: { x } = new C; // Should succeed \ No newline at end of file diff --git a/tests/baselines/reference/protectedMembers.errors.txt b/tests/baselines/reference/protectedMembers.errors.txt index cab3a682400..10ea00cf10f 100644 --- a/tests/baselines/reference/protectedMembers.errors.txt +++ b/tests/baselines/reference/protectedMembers.errors.txt @@ -9,9 +9,9 @@ tests/cases/compiler/protectedMembers.ts(48,1): error TS2445: Property 'sx' is p tests/cases/compiler/protectedMembers.ts(49,1): error TS2445: Property 'sf' is protected and only accessible within class 'C2' and its subclasses. tests/cases/compiler/protectedMembers.ts(68,9): error TS2446: Property 'x' is protected and only accessible through an instance of class 'C'. tests/cases/compiler/protectedMembers.ts(69,9): error TS2446: Property 'x' is protected and only accessible through an instance of class 'C'. -tests/cases/compiler/protectedMembers.ts(98,1): error TS2323: Type 'B1' is not assignable to type 'A1'. +tests/cases/compiler/protectedMembers.ts(98,1): error TS2322: Type 'B1' is not assignable to type 'A1'. Property 'x' is protected but type 'B1' is not a class derived from 'A1'. -tests/cases/compiler/protectedMembers.ts(99,1): error TS2323: Type 'A1' is not assignable to type 'B1'. +tests/cases/compiler/protectedMembers.ts(99,1): error TS2322: Type 'A1' is not assignable to type 'B1'. Property 'x' is protected in type 'A1' but public in type 'B1'. tests/cases/compiler/protectedMembers.ts(112,7): error TS2415: Class 'B3' incorrectly extends base class 'A3'. Property 'x' is protected in type 'B3' but public in type 'A3'. @@ -139,12 +139,12 @@ tests/cases/compiler/protectedMembers.ts(112,7): error TS2415: Class 'B3' incorr var b1: B1; a1 = b1; // Error, B1 doesn't derive from A1 ~~ -!!! error TS2323: Type 'B1' is not assignable to type 'A1'. -!!! error TS2323: Property 'x' is protected but type 'B1' is not a class derived from 'A1'. +!!! error TS2322: Type 'B1' is not assignable to type 'A1'. +!!! error TS2322: Property 'x' is protected but type 'B1' is not a class derived from 'A1'. b1 = a1; // Error, x is protected in A1 but public in B1 ~~ -!!! error TS2323: Type 'A1' is not assignable to type 'B1'. -!!! error TS2323: Property 'x' is protected in type 'A1' but public in type 'B1'. +!!! error TS2322: Type 'A1' is not assignable to type 'B1'. +!!! error TS2322: Property 'x' is protected in type 'A1' but public in type 'B1'. class A2 { protected x; diff --git a/tests/baselines/reference/qualify.errors.txt b/tests/baselines/reference/qualify.errors.txt index 761dbab6b1b..a2f59733fae 100644 --- a/tests/baselines/reference/qualify.errors.txt +++ b/tests/baselines/reference/qualify.errors.txt @@ -1,16 +1,16 @@ -tests/cases/compiler/qualify.ts(21,13): error TS2323: Type 'number' is not assignable to type 'I'. +tests/cases/compiler/qualify.ts(21,13): error TS2322: Type 'number' is not assignable to type 'I'. Property 'p' is missing in type 'Number'. -tests/cases/compiler/qualify.ts(30,13): error TS2323: Type 'number' is not assignable to type 'I2'. +tests/cases/compiler/qualify.ts(30,13): error TS2322: Type 'number' is not assignable to type 'I2'. Property 'q' is missing in type 'Number'. -tests/cases/compiler/qualify.ts(45,13): error TS2323: Type 'I4' is not assignable to type 'I3'. +tests/cases/compiler/qualify.ts(45,13): error TS2322: Type 'I4' is not assignable to type 'I3'. Property 'zeep' is missing in type 'I4'. -tests/cases/compiler/qualify.ts(46,13): error TS2323: Type 'I4' is not assignable to type 'I3[]'. +tests/cases/compiler/qualify.ts(46,13): error TS2322: Type 'I4' is not assignable to type 'I3[]'. Property 'length' is missing in type 'I4'. -tests/cases/compiler/qualify.ts(47,13): error TS2323: Type 'I4' is not assignable to type '() => I3'. -tests/cases/compiler/qualify.ts(48,13): error TS2323: Type 'I4' is not assignable to type '(k: I3) => void'. -tests/cases/compiler/qualify.ts(49,13): error TS2323: Type 'I4' is not assignable to type '{ k: I3; }'. +tests/cases/compiler/qualify.ts(47,13): error TS2322: Type 'I4' is not assignable to type '() => I3'. +tests/cases/compiler/qualify.ts(48,13): error TS2322: Type 'I4' is not assignable to type '(k: I3) => void'. +tests/cases/compiler/qualify.ts(49,13): error TS2322: Type 'I4' is not assignable to type '{ k: I3; }'. Property 'k' is missing in type 'I4'. -tests/cases/compiler/qualify.ts(58,5): error TS2323: Type 'I' is not assignable to type 'I'. +tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable to type 'I'. Property 'p' is missing in type 'I'. @@ -37,8 +37,8 @@ tests/cases/compiler/qualify.ts(58,5): error TS2323: Type 'I' is not assignable export module U { var z:I=3; ~ -!!! error TS2323: Type 'number' is not assignable to type 'I'. -!!! error TS2323: Property 'p' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'I'. +!!! error TS2322: Property 'p' is missing in type 'Number'. export interface I2 { q; } @@ -49,8 +49,8 @@ tests/cases/compiler/qualify.ts(58,5): error TS2323: Type 'I' is not assignable export module U2 { var z:T.U.I2=3; ~ -!!! error TS2323: Type 'number' is not assignable to type 'I2'. -!!! error TS2323: Property 'q' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'I2'. +!!! error TS2322: Property 'q' is missing in type 'Number'. } } @@ -67,22 +67,22 @@ tests/cases/compiler/qualify.ts(58,5): error TS2323: Type 'I' is not assignable var v1:I4; var v2:K1.I3=v1; ~~ -!!! error TS2323: Type 'I4' is not assignable to type 'I3'. -!!! error TS2323: Property 'zeep' is missing in type 'I4'. +!!! error TS2322: Type 'I4' is not assignable to type 'I3'. +!!! error TS2322: Property 'zeep' is missing in type 'I4'. var v3:K1.I3[]=v1; ~~ -!!! error TS2323: Type 'I4' is not assignable to type 'I3[]'. -!!! error TS2323: Property 'length' is missing in type 'I4'. +!!! error TS2322: Type 'I4' is not assignable to type 'I3[]'. +!!! error TS2322: Property 'length' is missing in type 'I4'. var v4:()=>K1.I3=v1; ~~ -!!! error TS2323: Type 'I4' is not assignable to type '() => I3'. +!!! error TS2322: Type 'I4' is not assignable to type '() => I3'. var v5:(k:K1.I3)=>void=v1; ~~ -!!! error TS2323: Type 'I4' is not assignable to type '(k: I3) => void'. +!!! error TS2322: Type 'I4' is not assignable to type '(k: I3) => void'. var v6:{k:K1.I3;}=v1; ~~ -!!! error TS2323: Type 'I4' is not assignable to type '{ k: I3; }'. -!!! error TS2323: Property 'k' is missing in type 'I4'. +!!! error TS2322: Type 'I4' is not assignable to type '{ k: I3; }'. +!!! error TS2322: Property 'k' is missing in type 'I4'. } } @@ -93,7 +93,7 @@ tests/cases/compiler/qualify.ts(58,5): error TS2323: Type 'I' is not assignable var y:I; var x:T.I=y; ~ -!!! error TS2323: Type 'I' is not assignable to type 'I'. -!!! error TS2323: Property 'p' is missing in type 'I'. +!!! error TS2322: Type 'I' is not assignable to type 'I'. +!!! error TS2322: Property 'p' is missing in type 'I'. \ No newline at end of file diff --git a/tests/baselines/reference/recursiveFunctionTypes.errors.txt b/tests/baselines/reference/recursiveFunctionTypes.errors.txt index c287a713e2b..30f6c7aa41f 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.errors.txt +++ b/tests/baselines/reference/recursiveFunctionTypes.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/recursiveFunctionTypes.ts(1,35): error TS2323: Type 'number' is not assignable to type '() => typeof fn'. -tests/cases/compiler/recursiveFunctionTypes.ts(3,5): error TS2323: Type '() => typeof fn' is not assignable to type 'number'. -tests/cases/compiler/recursiveFunctionTypes.ts(4,5): error TS2323: Type '() => typeof fn' is not assignable to type '() => number'. +tests/cases/compiler/recursiveFunctionTypes.ts(1,35): error TS2322: Type 'number' is not assignable to type '() => typeof fn'. +tests/cases/compiler/recursiveFunctionTypes.ts(3,5): error TS2322: Type '() => typeof fn' is not assignable to type 'number'. +tests/cases/compiler/recursiveFunctionTypes.ts(4,5): error TS2322: Type '() => typeof fn' is not assignable to type '() => number'. Type '() => typeof fn' is not assignable to type 'number'. tests/cases/compiler/recursiveFunctionTypes.ts(11,16): 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/recursiveFunctionTypes.ts(12,16): 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/recursiveFunctionTypes.ts(17,5): error TS2323: Type '() => I' is not assignable to type 'number'. +tests/cases/compiler/recursiveFunctionTypes.ts(17,5): error TS2322: Type '() => I' is not assignable to type 'number'. tests/cases/compiler/recursiveFunctionTypes.ts(22,5): error TS2345: Argument of type 'number' is not assignable to parameter of type '(t: typeof g) => void'. -tests/cases/compiler/recursiveFunctionTypes.ts(25,1): error TS2323: Type 'number' is not assignable to type '() => any'. +tests/cases/compiler/recursiveFunctionTypes.ts(25,1): error TS2322: Type 'number' is not assignable to type '() => any'. tests/cases/compiler/recursiveFunctionTypes.ts(30,1): error TS2394: Overload signature is not compatible with function implementation. tests/cases/compiler/recursiveFunctionTypes.ts(33,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/recursiveFunctionTypes.ts(34,4): error TS2345: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. @@ -17,15 +17,15 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of ==== tests/cases/compiler/recursiveFunctionTypes.ts (13 errors) ==== function fn(): typeof fn { return 1; } ~ -!!! error TS2323: Type 'number' is not assignable to type '() => typeof fn'. +!!! error TS2322: Type 'number' is not assignable to type '() => typeof fn'. var x: number = fn; // error ~ -!!! error TS2323: Type '() => typeof fn' is not assignable to type 'number'. +!!! error TS2322: Type '() => typeof fn' is not assignable to type 'number'. var y: () => number = fn; // ok ~ -!!! error TS2323: Type '() => typeof fn' is not assignable to type '() => number'. -!!! error TS2323: Type '() => typeof fn' is not assignable to type 'number'. +!!! error TS2322: Type '() => typeof fn' is not assignable to type '() => number'. +!!! error TS2322: Type '() => typeof fn' is not assignable to type 'number'. var f: () => typeof g; var g: () => typeof f; @@ -44,7 +44,7 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of var a: number = f3; // error ~ -!!! error TS2323: Type '() => I' is not assignable to type 'number'. +!!! error TS2322: Type '() => I' is not assignable to type 'number'. class C { static g(t: typeof C.g){ } @@ -56,7 +56,7 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of var f4: () => typeof f4; f4 = 3; // error ~~ -!!! error TS2323: Type 'number' is not assignable to type '() => any'. +!!! error TS2322: Type 'number' is not assignable to type '() => any'. function f5() { return f5; } diff --git a/tests/baselines/reference/redefineArray.errors.txt b/tests/baselines/reference/redefineArray.errors.txt index 86c8c8aee33..ad47f15c521 100644 --- a/tests/baselines/reference/redefineArray.errors.txt +++ b/tests/baselines/reference/redefineArray.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/redefineArray.ts(1,1): error TS2323: Type '(n: number, s: string) => number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. +tests/cases/compiler/redefineArray.ts(1,1): error TS2322: Type '(n: number, s: string) => number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. Property 'isArray' is missing in type '(n: number, s: string) => number'. ==== tests/cases/compiler/redefineArray.ts (1 errors) ==== Array = function (n:number, s:string) {return n;}; ~~~~~ -!!! error TS2323: Type '(n: number, s: string) => number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. -!!! error TS2323: Property 'isArray' is missing in type '(n: number, s: string) => number'. \ No newline at end of file +!!! error TS2322: Type '(n: number, s: string) => number' is not assignable to type '{ (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }'. +!!! error TS2322: Property 'isArray' is missing in type '(n: number, s: string) => number'. \ No newline at end of file diff --git a/tests/baselines/reference/reservedNamesInAliases.errors.txt b/tests/baselines/reference/reservedNamesInAliases.errors.txt new file mode 100644 index 00000000000..9f2d87c5409 --- /dev/null +++ b/tests/baselines/reference/reservedNamesInAliases.errors.txt @@ -0,0 +1,30 @@ +tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,6): error TS1003: Identifier expected. +tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,11): error TS1005: ';' expected. +tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(2,6): error TS2457: Type alias name cannot be 'any' +tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(3,6): error TS2457: Type alias name cannot be 'number' +tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(4,6): error TS2457: Type alias name cannot be 'boolean' +tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(5,6): error TS2457: Type alias name cannot be 'string' +tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,13): error TS2304: Cannot find name 'I'. + + +==== tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts (7 errors) ==== + interface I {} + type any = I; + ~~~ +!!! error TS2457: Type alias name cannot be 'any' + type number = I; + ~~~~~~ +!!! error TS2457: Type alias name cannot be 'number' + type boolean = I; + ~~~~~~~ +!!! error TS2457: Type alias name cannot be 'boolean' + type string = I; + ~~~~~~ +!!! error TS2457: Type alias name cannot be 'string' + type void = I; + ~~~~ +!!! error TS1003: Identifier expected. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS2304: Cannot find name 'I'. \ No newline at end of file diff --git a/tests/baselines/reference/restArgAssignmentCompat.errors.txt b/tests/baselines/reference/restArgAssignmentCompat.errors.txt index a7397ffc157..2ea07395099 100644 --- a/tests/baselines/reference/restArgAssignmentCompat.errors.txt +++ b/tests/baselines/reference/restArgAssignmentCompat.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/restArgAssignmentCompat.ts(7,1): error TS2323: Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void'. +tests/cases/compiler/restArgAssignmentCompat.ts(7,1): error TS2322: Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'number[]'. Property 'length' is missing in type 'Number'. @@ -13,9 +13,9 @@ tests/cases/compiler/restArgAssignmentCompat.ts(7,1): error TS2323: Type '(...x: var n = g; n = f; ~ -!!! error TS2323: Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void'. -!!! error TS2323: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'number[]'. -!!! error TS2323: Property 'length' is missing in type 'Number'. +!!! error TS2322: Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'number[]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. n([4], 'foo'); \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationStatements.js b/tests/baselines/reference/sourceMapValidationStatements.js index 85a4dc33889..8a4b565e9b0 100644 --- a/tests/baselines/reference/sourceMapValidationStatements.js +++ b/tests/baselines/reference/sourceMapValidationStatements.js @@ -136,22 +136,19 @@ function f() { z = 10; } switch (obj.z) { - case 0: - { - x++; - break; - } - case 1: - { - x--; - break; - } - default: - { - x *= 2; - x = 50; - break; - } + case 0: { + x++; + break; + } + case 1: { + x--; + break; + } + default: { + x *= 2; + x = 50; + break; + } } while (x < 10) { x++; diff --git a/tests/baselines/reference/sourceMapValidationStatements.js.map b/tests/baselines/reference/sourceMapValidationStatements.js.map index a8ff3d46038..02b5c0bb806 100644 --- a/tests/baselines/reference/sourceMapValidationStatements.js.map +++ b/tests/baselines/reference/sourceMapValidationStatements.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationStatements.js.map] -{"version":3,"file":"sourceMapValidationStatements.js","sourceRoot":"","sources":["sourceMapValidationStatements.ts"],"names":["f"],"mappings":"AAAA,SAAS,CAAC;IACNA,IAAIA,CAACA,CAACA;IACNA,IAAIA,CAACA,GAAGA,CAACA,CAACA;IACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,EAAEA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;QAC1BA,CAACA,IAAIA,CAACA,CAACA;QACPA,CAACA,IAAIA,CAACA,CAACA;IACXA,CAACA;IACDA,EAAEA,CAACA,CAACA,CAACA,GAAGA,EAAEA,CAACA,CAACA,CAACA;QACTA,CAACA,IAAIA,CAACA,CAACA;IACXA,CAACA;IAACA,IAAIA,CAACA,CAACA;QACJA,CAACA,IAAIA,EAAEA,CAACA;QACRA,CAACA,EAAEA,CAACA;IACRA,CAACA;IACDA,IAAIA,CAACA,GAAGA;QACJA,CAACA;QACDA,CAACA;QACDA,CAACA;KACJA,CAACA;IACFA,IAAIA,GAAGA,GAAGA;QACNA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,OAAOA;KACbA,CAACA;IACFA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACdA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA;QACbA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;IACfA,CAACA;IACDA,IAAAA,CAACA;QACGA,GAAGA,CAACA,CAACA,GAAGA,MAAMA,CAACA;IACnBA,CAAEA;IAAAA,KAAKA,CAACA,CAACA,CAACA,CAACA,CAATA,CAACA;QACCA,EAAEA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,EAAEA,CAACA,CAACA,CAACA;YACbA,GAAGA,CAACA,CAACA,GAAGA,EAAEA,CAACA;QACfA,CAACA;QAACA,IAAIA,CAACA,CAACA;YACJA,GAAGA,CAACA,CAACA,GAAGA,KAAKA,CAACA;QAClBA,CAACA;IACLA,CAACA;IACDA,IAAAA,CAACA;QACGA,MAAMA,IAAIA,KAAKA,EAAEA,CAACA;IACtBA,CAAEA;IAAAA,KAAKA,CAACA,CAACA,EAAEA,CAACA,CAAVA,CAACA;QACCA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;IACfA,CAACA;YAACA,CAACA;QACCA,CAACA,GAAGA,EAAEA,CAACA;IACXA,CAACA;IACDA,MAAMA,GAAGA,EAAEA,CAACA;QACRA,CAACA,GAAGA,CAACA,CAACA;QACNA,CAACA,GAAGA,EAAEA,CAACA;IACXA,CAACA;IACDA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA;QACZA,KAAKA,CAACA;YAAEA,CAACA;gBACLA,CAACA,EAAEA,CAACA;gBACJA,KAAKA,CAACA;YAEVA,CAACA;QACDA,KAAKA,CAACA;YAAEA,CAACA;gBACLA,CAACA,EAAEA,CAACA;gBACJA,KAAKA,CAACA;YAEVA,CAACA;QACDA;YAASA,CAACA;gBACNA,CAACA,IAAIA,CAACA,CAACA;gBACPA,CAACA,GAAGA,EAAEA,CAACA;gBACPA,KAAKA,CAACA;YAEVA,CAACA;IACLA,CAACA;IACDA,OAAOA,CAACA,GAAGA,EAAEA,EAAEA,CAACA;QACZA,CAACA,EAAEA,CAACA;IACRA,CAACA;IACDA,GAAGA,CAACA;QACAA,CAACA,EAAEA,CAACA;IACRA,CAACA,QAAQA,CAACA,GAAGA,CAACA,EAACA;IACfA,CAACA,GAAGA,CAACA,CAACA;IACNA,IAAIA,CAACA,GAAGA,CAACA,CAACA,IAAIA,CAACA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAACA;IACjCA,CAACA,CAACA,IAAIA,CAACA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAACA;IACzBA,CAACA,KAAKA,CAACA,CAACA;IACRA,CAACA,GAAGA,CAACA,GAAGA,EAAEA,CAACA;IACXA,IAAIA,CAACA,GAAGA,CAACA,CAACA;IACVA,MAAMA,CAACA;AACXA,CAACA;AACD,IAAI,CAAC,GAAG;IACJ,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACd,CAAC,CAAC;AACF,CAAC,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationStatements.js","sourceRoot":"","sources":["sourceMapValidationStatements.ts"],"names":["f"],"mappings":"AAAA,SAAS,CAAC;IACNA,IAAIA,CAACA,CAACA;IACNA,IAAIA,CAACA,GAAGA,CAACA,CAACA;IACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,EAAEA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;QAC1BA,CAACA,IAAIA,CAACA,CAACA;QACPA,CAACA,IAAIA,CAACA,CAACA;IACXA,CAACA;IACDA,EAAEA,CAACA,CAACA,CAACA,GAAGA,EAAEA,CAACA,CAACA,CAACA;QACTA,CAACA,IAAIA,CAACA,CAACA;IACXA,CAACA;IAACA,IAAIA,CAACA,CAACA;QACJA,CAACA,IAAIA,EAAEA,CAACA;QACRA,CAACA,EAAEA,CAACA;IACRA,CAACA;IACDA,IAAIA,CAACA,GAAGA;QACJA,CAACA;QACDA,CAACA;QACDA,CAACA;KACJA,CAACA;IACFA,IAAIA,GAAGA,GAAGA;QACNA,CAACA,EAAEA,CAACA;QACJA,CAACA,EAAEA,OAAOA;KACbA,CAACA;IACFA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;QACdA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA;QACbA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;IACfA,CAACA;IACDA,IAAAA,CAACA;QACGA,GAAGA,CAACA,CAACA,GAAGA,MAAMA,CAACA;IACnBA,CAAEA;IAAAA,KAAKA,CAACA,CAACA,CAACA,CAACA,CAATA,CAACA;QACCA,EAAEA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,EAAEA,CAACA,CAACA,CAACA;YACbA,GAAGA,CAACA,CAACA,GAAGA,EAAEA,CAACA;QACfA,CAACA;QAACA,IAAIA,CAACA,CAACA;YACJA,GAAGA,CAACA,CAACA,GAAGA,KAAKA,CAACA;QAClBA,CAACA;IACLA,CAACA;IACDA,IAAAA,CAACA;QACGA,MAAMA,IAAIA,KAAKA,EAAEA,CAACA;IACtBA,CAAEA;IAAAA,KAAKA,CAACA,CAACA,EAAEA,CAACA,CAAVA,CAACA;QACCA,IAAIA,CAACA,GAAGA,EAAEA,CAACA;IACfA,CAACA;YAACA,CAACA;QACCA,CAACA,GAAGA,EAAEA,CAACA;IACXA,CAACA;IACDA,MAAMA,GAAGA,EAAEA,CAACA;QACRA,CAACA,GAAGA,CAACA,CAACA;QACNA,CAACA,GAAGA,EAAEA,CAACA;IACXA,CAACA;IACDA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA;QACZA,KAAKA,CAACA,EAAEA,CAACA;YACLA,CAACA,EAAEA,CAACA;YACJA,KAAKA,CAACA;QAEVA,CAACA;QACDA,KAAKA,CAACA,EAAEA,CAACA;YACLA,CAACA,EAAEA,CAACA;YACJA,KAAKA,CAACA;QAEVA,CAACA;QACDA,SAASA,CAACA;YACNA,CAACA,IAAIA,CAACA,CAACA;YACPA,CAACA,GAAGA,EAAEA,CAACA;YACPA,KAAKA,CAACA;QAEVA,CAACA;IACLA,CAACA;IACDA,OAAOA,CAACA,GAAGA,EAAEA,EAAEA,CAACA;QACZA,CAACA,EAAEA,CAACA;IACRA,CAACA;IACDA,GAAGA,CAACA;QACAA,CAACA,EAAEA,CAACA;IACRA,CAACA,QAAQA,CAACA,GAAGA,CAACA,EAACA;IACfA,CAACA,GAAGA,CAACA,CAACA;IACNA,IAAIA,CAACA,GAAGA,CAACA,CAACA,IAAIA,CAACA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAACA;IACjCA,CAACA,CAACA,IAAIA,CAACA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAACA;IACzBA,CAACA,KAAKA,CAACA,CAACA;IACRA,CAACA,GAAGA,CAACA,GAAGA,EAAEA,CAACA;IACXA,IAAIA,CAACA,GAAGA,CAACA,CAACA;IACVA,MAAMA,CAACA;AACXA,CAACA;AACD,IAAI,CAAC,GAAG;IACJ,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACd,CAAC,CAAC;AACF,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt b/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt index d997557cdfe..1a288e3a830 100644 --- a/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt @@ -936,200 +936,191 @@ sourceFile:sourceMapValidationStatements.ts 9 >Emitted(52, 20) Source(47, 20) + SourceIndex(0) name (f) 10>Emitted(52, 21) Source(47, 21) + SourceIndex(0) name (f) --- ->>> case 0: +>>> case 0: { 1 >^^^^^^^^ 2 > ^^^^^ 3 > ^ +4 > ^^ +5 > ^ 1 > > 2 > case 3 > 0 +4 > : +5 > { 1 >Emitted(53, 9) Source(48, 9) + SourceIndex(0) name (f) 2 >Emitted(53, 14) Source(48, 14) + SourceIndex(0) name (f) 3 >Emitted(53, 15) Source(48, 15) + SourceIndex(0) name (f) +4 >Emitted(53, 17) Source(48, 17) + SourceIndex(0) name (f) +5 >Emitted(53, 18) Source(48, 18) + SourceIndex(0) name (f) --- ->>> { +>>> x++; 1 >^^^^^^^^^^^^ 2 > ^ -3 > ^^^^^^^^-> -1 >: -2 > { -1 >Emitted(54, 13) Source(48, 17) + SourceIndex(0) name (f) -2 >Emitted(54, 14) Source(48, 18) + SourceIndex(0) name (f) +3 > ^^ +4 > ^ +5 > ^^^-> +1 > + > +2 > x +3 > ++ +4 > ; +1 >Emitted(54, 13) Source(49, 13) + SourceIndex(0) name (f) +2 >Emitted(54, 14) Source(49, 14) + SourceIndex(0) name (f) +3 >Emitted(54, 16) Source(49, 16) + SourceIndex(0) name (f) +4 >Emitted(54, 17) Source(49, 17) + SourceIndex(0) name (f) --- ->>> x++; -1->^^^^^^^^^^^^^^^^ -2 > ^ -3 > ^^ -4 > ^ -5 > ^^^-> +>>> break; +1->^^^^^^^^^^^^ +2 > ^^^^^ +3 > ^ 1-> > -2 > x -3 > ++ -4 > ; -1->Emitted(55, 17) Source(49, 13) + SourceIndex(0) name (f) -2 >Emitted(55, 18) Source(49, 14) + SourceIndex(0) name (f) -3 >Emitted(55, 20) Source(49, 16) + SourceIndex(0) name (f) -4 >Emitted(55, 21) Source(49, 17) + SourceIndex(0) name (f) +2 > break +3 > ; +1->Emitted(55, 13) Source(50, 13) + SourceIndex(0) name (f) +2 >Emitted(55, 18) Source(50, 18) + SourceIndex(0) name (f) +3 >Emitted(55, 19) Source(50, 19) + SourceIndex(0) name (f) --- ->>> break; -1->^^^^^^^^^^^^^^^^ -2 > ^^^^^ -3 > ^ -1-> - > -2 > break -3 > ; -1->Emitted(56, 17) Source(50, 13) + SourceIndex(0) name (f) -2 >Emitted(56, 22) Source(50, 18) + SourceIndex(0) name (f) -3 >Emitted(56, 23) Source(50, 19) + SourceIndex(0) name (f) ---- ->>> } -1 >^^^^^^^^^^^^ -2 > ^ -3 > ^^^-> +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^-> 1 > > > -2 > } -1 >Emitted(57, 13) Source(52, 9) + SourceIndex(0) name (f) -2 >Emitted(57, 14) Source(52, 10) + SourceIndex(0) name (f) +2 > } +1 >Emitted(56, 9) Source(52, 9) + SourceIndex(0) name (f) +2 >Emitted(56, 10) Source(52, 10) + SourceIndex(0) name (f) --- ->>> case 1: +>>> case 1: { 1->^^^^^^^^ 2 > ^^^^^ 3 > ^ +4 > ^^ +5 > ^ 1-> > 2 > case 3 > 1 -1->Emitted(58, 9) Source(53, 9) + SourceIndex(0) name (f) -2 >Emitted(58, 14) Source(53, 14) + SourceIndex(0) name (f) -3 >Emitted(58, 15) Source(53, 15) + SourceIndex(0) name (f) +4 > : +5 > { +1->Emitted(57, 9) Source(53, 9) + SourceIndex(0) name (f) +2 >Emitted(57, 14) Source(53, 14) + SourceIndex(0) name (f) +3 >Emitted(57, 15) Source(53, 15) + SourceIndex(0) name (f) +4 >Emitted(57, 17) Source(53, 17) + SourceIndex(0) name (f) +5 >Emitted(57, 18) Source(53, 18) + SourceIndex(0) name (f) --- ->>> { +>>> x--; 1 >^^^^^^^^^^^^ 2 > ^ -3 > ^^^^^^^^-> -1 >: -2 > { -1 >Emitted(59, 13) Source(53, 17) + SourceIndex(0) name (f) -2 >Emitted(59, 14) Source(53, 18) + SourceIndex(0) name (f) +3 > ^^ +4 > ^ +5 > ^^^-> +1 > + > +2 > x +3 > -- +4 > ; +1 >Emitted(58, 13) Source(54, 13) + SourceIndex(0) name (f) +2 >Emitted(58, 14) Source(54, 14) + SourceIndex(0) name (f) +3 >Emitted(58, 16) Source(54, 16) + SourceIndex(0) name (f) +4 >Emitted(58, 17) Source(54, 17) + SourceIndex(0) name (f) --- ->>> x--; -1->^^^^^^^^^^^^^^^^ -2 > ^ -3 > ^^ -4 > ^ -5 > ^^^-> +>>> break; +1->^^^^^^^^^^^^ +2 > ^^^^^ +3 > ^ 1-> > -2 > x -3 > -- -4 > ; -1->Emitted(60, 17) Source(54, 13) + SourceIndex(0) name (f) -2 >Emitted(60, 18) Source(54, 14) + SourceIndex(0) name (f) -3 >Emitted(60, 20) Source(54, 16) + SourceIndex(0) name (f) -4 >Emitted(60, 21) Source(54, 17) + SourceIndex(0) name (f) +2 > break +3 > ; +1->Emitted(59, 13) Source(55, 13) + SourceIndex(0) name (f) +2 >Emitted(59, 18) Source(55, 18) + SourceIndex(0) name (f) +3 >Emitted(59, 19) Source(55, 19) + SourceIndex(0) name (f) --- ->>> break; -1->^^^^^^^^^^^^^^^^ -2 > ^^^^^ -3 > ^ -1-> - > -2 > break -3 > ; -1->Emitted(61, 17) Source(55, 13) + SourceIndex(0) name (f) -2 >Emitted(61, 22) Source(55, 18) + SourceIndex(0) name (f) -3 >Emitted(61, 23) Source(55, 19) + SourceIndex(0) name (f) ---- ->>> } -1 >^^^^^^^^^^^^ -2 > ^ -3 > ^^^^-> +>>> } +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^-> 1 > > > -2 > } -1 >Emitted(62, 13) Source(57, 9) + SourceIndex(0) name (f) -2 >Emitted(62, 14) Source(57, 10) + SourceIndex(0) name (f) +2 > } +1 >Emitted(60, 9) Source(57, 9) + SourceIndex(0) name (f) +2 >Emitted(60, 10) Source(57, 10) + SourceIndex(0) name (f) --- ->>> default: +>>> default: { 1->^^^^^^^^ -2 > ^^^^^^-> +2 > ^^^^^^^^^ +3 > ^ +4 > ^^-> 1-> > -1->Emitted(63, 9) Source(58, 9) + SourceIndex(0) name (f) +2 > default: +3 > { +1->Emitted(61, 9) Source(58, 9) + SourceIndex(0) name (f) +2 >Emitted(61, 18) Source(58, 18) + SourceIndex(0) name (f) +3 >Emitted(61, 19) Source(58, 19) + SourceIndex(0) name (f) --- ->>> { +>>> x *= 2; 1->^^^^^^^^^^^^ 2 > ^ -3 > ^^^^^^^^^^^-> -1->default: -2 > { -1->Emitted(64, 13) Source(58, 18) + SourceIndex(0) name (f) -2 >Emitted(64, 14) Source(58, 19) + SourceIndex(0) name (f) ---- ->>> x *= 2; -1->^^^^^^^^^^^^^^^^ -2 > ^ -3 > ^^^^ -4 > ^ -5 > ^ -6 > ^-> +3 > ^^^^ +4 > ^ +5 > ^ +6 > ^-> 1-> > -2 > x -3 > *= -4 > 2 -5 > ; -1->Emitted(65, 17) Source(59, 13) + SourceIndex(0) name (f) -2 >Emitted(65, 18) Source(59, 14) + SourceIndex(0) name (f) -3 >Emitted(65, 22) Source(59, 18) + SourceIndex(0) name (f) -4 >Emitted(65, 23) Source(59, 19) + SourceIndex(0) name (f) -5 >Emitted(65, 24) Source(59, 20) + SourceIndex(0) name (f) +2 > x +3 > *= +4 > 2 +5 > ; +1->Emitted(62, 13) Source(59, 13) + SourceIndex(0) name (f) +2 >Emitted(62, 14) Source(59, 14) + SourceIndex(0) name (f) +3 >Emitted(62, 18) Source(59, 18) + SourceIndex(0) name (f) +4 >Emitted(62, 19) Source(59, 19) + SourceIndex(0) name (f) +5 >Emitted(62, 20) Source(59, 20) + SourceIndex(0) name (f) --- ->>> x = 50; -1->^^^^^^^^^^^^^^^^ -2 > ^ -3 > ^^^ -4 > ^^ -5 > ^ +>>> x = 50; +1->^^^^^^^^^^^^ +2 > ^ +3 > ^^^ +4 > ^^ +5 > ^ 1-> > -2 > x -3 > = -4 > 50 -5 > ; -1->Emitted(66, 17) Source(60, 13) + SourceIndex(0) name (f) -2 >Emitted(66, 18) Source(60, 14) + SourceIndex(0) name (f) -3 >Emitted(66, 21) Source(60, 17) + SourceIndex(0) name (f) -4 >Emitted(66, 23) Source(60, 19) + SourceIndex(0) name (f) -5 >Emitted(66, 24) Source(60, 20) + SourceIndex(0) name (f) +2 > x +3 > = +4 > 50 +5 > ; +1->Emitted(63, 13) Source(60, 13) + SourceIndex(0) name (f) +2 >Emitted(63, 14) Source(60, 14) + SourceIndex(0) name (f) +3 >Emitted(63, 17) Source(60, 17) + SourceIndex(0) name (f) +4 >Emitted(63, 19) Source(60, 19) + SourceIndex(0) name (f) +5 >Emitted(63, 20) Source(60, 20) + SourceIndex(0) name (f) --- ->>> break; -1 >^^^^^^^^^^^^^^^^ -2 > ^^^^^ -3 > ^ +>>> break; +1 >^^^^^^^^^^^^ +2 > ^^^^^ +3 > ^ 1 > > -2 > break -3 > ; -1 >Emitted(67, 17) Source(61, 13) + SourceIndex(0) name (f) -2 >Emitted(67, 22) Source(61, 18) + SourceIndex(0) name (f) -3 >Emitted(67, 23) Source(61, 19) + SourceIndex(0) name (f) +2 > break +3 > ; +1 >Emitted(64, 13) Source(61, 13) + SourceIndex(0) name (f) +2 >Emitted(64, 18) Source(61, 18) + SourceIndex(0) name (f) +3 >Emitted(64, 19) Source(61, 19) + SourceIndex(0) name (f) --- ->>> } -1 >^^^^^^^^^^^^ -2 > ^ +>>> } +1 >^^^^^^^^ +2 > ^ 1 > > > -2 > } -1 >Emitted(68, 13) Source(63, 9) + SourceIndex(0) name (f) -2 >Emitted(68, 14) Source(63, 10) + SourceIndex(0) name (f) +2 > } +1 >Emitted(65, 9) Source(63, 9) + SourceIndex(0) name (f) +2 >Emitted(65, 10) Source(63, 10) + SourceIndex(0) name (f) --- >>> } 1 >^^^^ @@ -1138,8 +1129,8 @@ sourceFile:sourceMapValidationStatements.ts 1 > > 2 > } -1 >Emitted(69, 5) Source(64, 5) + SourceIndex(0) name (f) -2 >Emitted(69, 6) Source(64, 6) + SourceIndex(0) name (f) +1 >Emitted(66, 5) Source(64, 5) + SourceIndex(0) name (f) +2 >Emitted(66, 6) Source(64, 6) + SourceIndex(0) name (f) --- >>> while (x < 10) { 1->^^^^ @@ -1157,13 +1148,13 @@ sourceFile:sourceMapValidationStatements.ts 5 > 10 6 > ) 7 > { -1->Emitted(70, 5) Source(65, 5) + SourceIndex(0) name (f) -2 >Emitted(70, 12) Source(65, 12) + SourceIndex(0) name (f) -3 >Emitted(70, 13) Source(65, 13) + SourceIndex(0) name (f) -4 >Emitted(70, 16) Source(65, 16) + SourceIndex(0) name (f) -5 >Emitted(70, 18) Source(65, 18) + SourceIndex(0) name (f) -6 >Emitted(70, 20) Source(65, 20) + SourceIndex(0) name (f) -7 >Emitted(70, 21) Source(65, 21) + SourceIndex(0) name (f) +1->Emitted(67, 5) Source(65, 5) + SourceIndex(0) name (f) +2 >Emitted(67, 12) Source(65, 12) + SourceIndex(0) name (f) +3 >Emitted(67, 13) Source(65, 13) + SourceIndex(0) name (f) +4 >Emitted(67, 16) Source(65, 16) + SourceIndex(0) name (f) +5 >Emitted(67, 18) Source(65, 18) + SourceIndex(0) name (f) +6 >Emitted(67, 20) Source(65, 20) + SourceIndex(0) name (f) +7 >Emitted(67, 21) Source(65, 21) + SourceIndex(0) name (f) --- >>> x++; 1 >^^^^^^^^ @@ -1175,10 +1166,10 @@ sourceFile:sourceMapValidationStatements.ts 2 > x 3 > ++ 4 > ; -1 >Emitted(71, 9) Source(66, 9) + SourceIndex(0) name (f) -2 >Emitted(71, 10) Source(66, 10) + SourceIndex(0) name (f) -3 >Emitted(71, 12) Source(66, 12) + SourceIndex(0) name (f) -4 >Emitted(71, 13) Source(66, 13) + SourceIndex(0) name (f) +1 >Emitted(68, 9) Source(66, 9) + SourceIndex(0) name (f) +2 >Emitted(68, 10) Source(66, 10) + SourceIndex(0) name (f) +3 >Emitted(68, 12) Source(66, 12) + SourceIndex(0) name (f) +4 >Emitted(68, 13) Source(66, 13) + SourceIndex(0) name (f) --- >>> } 1 >^^^^ @@ -1187,8 +1178,8 @@ sourceFile:sourceMapValidationStatements.ts 1 > > 2 > } -1 >Emitted(72, 5) Source(67, 5) + SourceIndex(0) name (f) -2 >Emitted(72, 6) Source(67, 6) + SourceIndex(0) name (f) +1 >Emitted(69, 5) Source(67, 5) + SourceIndex(0) name (f) +2 >Emitted(69, 6) Source(67, 6) + SourceIndex(0) name (f) --- >>> do { 1->^^^^ @@ -1199,9 +1190,9 @@ sourceFile:sourceMapValidationStatements.ts > 2 > do 3 > { -1->Emitted(73, 5) Source(68, 5) + SourceIndex(0) name (f) -2 >Emitted(73, 8) Source(68, 8) + SourceIndex(0) name (f) -3 >Emitted(73, 9) Source(68, 9) + SourceIndex(0) name (f) +1->Emitted(70, 5) Source(68, 5) + SourceIndex(0) name (f) +2 >Emitted(70, 8) Source(68, 8) + SourceIndex(0) name (f) +3 >Emitted(70, 9) Source(68, 9) + SourceIndex(0) name (f) --- >>> x--; 1->^^^^^^^^ @@ -1214,10 +1205,10 @@ sourceFile:sourceMapValidationStatements.ts 2 > x 3 > -- 4 > ; -1->Emitted(74, 9) Source(69, 9) + SourceIndex(0) name (f) -2 >Emitted(74, 10) Source(69, 10) + SourceIndex(0) name (f) -3 >Emitted(74, 12) Source(69, 12) + SourceIndex(0) name (f) -4 >Emitted(74, 13) Source(69, 13) + SourceIndex(0) name (f) +1->Emitted(71, 9) Source(69, 9) + SourceIndex(0) name (f) +2 >Emitted(71, 10) Source(69, 10) + SourceIndex(0) name (f) +3 >Emitted(71, 12) Source(69, 12) + SourceIndex(0) name (f) +4 >Emitted(71, 13) Source(69, 13) + SourceIndex(0) name (f) --- >>> } while (x > 4); 1->^^^^ @@ -1235,13 +1226,13 @@ sourceFile:sourceMapValidationStatements.ts 5 > > 6 > 4 7 > ) -1->Emitted(75, 5) Source(70, 5) + SourceIndex(0) name (f) -2 >Emitted(75, 6) Source(70, 6) + SourceIndex(0) name (f) -3 >Emitted(75, 14) Source(70, 14) + SourceIndex(0) name (f) -4 >Emitted(75, 15) Source(70, 15) + SourceIndex(0) name (f) -5 >Emitted(75, 18) Source(70, 18) + SourceIndex(0) name (f) -6 >Emitted(75, 19) Source(70, 19) + SourceIndex(0) name (f) -7 >Emitted(75, 21) Source(70, 20) + SourceIndex(0) name (f) +1->Emitted(72, 5) Source(70, 5) + SourceIndex(0) name (f) +2 >Emitted(72, 6) Source(70, 6) + SourceIndex(0) name (f) +3 >Emitted(72, 14) Source(70, 14) + SourceIndex(0) name (f) +4 >Emitted(72, 15) Source(70, 15) + SourceIndex(0) name (f) +5 >Emitted(72, 18) Source(70, 18) + SourceIndex(0) name (f) +6 >Emitted(72, 19) Source(70, 19) + SourceIndex(0) name (f) +7 >Emitted(72, 21) Source(70, 20) + SourceIndex(0) name (f) --- >>> x = y; 1 >^^^^ @@ -1256,11 +1247,11 @@ sourceFile:sourceMapValidationStatements.ts 3 > = 4 > y 5 > ; -1 >Emitted(76, 5) Source(71, 5) + SourceIndex(0) name (f) -2 >Emitted(76, 6) Source(71, 6) + SourceIndex(0) name (f) -3 >Emitted(76, 9) Source(71, 9) + SourceIndex(0) name (f) -4 >Emitted(76, 10) Source(71, 10) + SourceIndex(0) name (f) -5 >Emitted(76, 11) Source(71, 11) + SourceIndex(0) name (f) +1 >Emitted(73, 5) Source(71, 5) + SourceIndex(0) name (f) +2 >Emitted(73, 6) Source(71, 6) + SourceIndex(0) name (f) +3 >Emitted(73, 9) Source(71, 9) + SourceIndex(0) name (f) +4 >Emitted(73, 10) Source(71, 10) + SourceIndex(0) name (f) +5 >Emitted(73, 11) Source(71, 11) + SourceIndex(0) name (f) --- >>> var z = (x == 1) ? x + 1 : x - 1; 1->^^^^ @@ -1300,24 +1291,24 @@ sourceFile:sourceMapValidationStatements.ts 16> - 17> 1 18> ; -1->Emitted(77, 5) Source(72, 5) + SourceIndex(0) name (f) -2 >Emitted(77, 9) Source(72, 9) + SourceIndex(0) name (f) -3 >Emitted(77, 10) Source(72, 10) + SourceIndex(0) name (f) -4 >Emitted(77, 13) Source(72, 13) + SourceIndex(0) name (f) -5 >Emitted(77, 14) Source(72, 14) + SourceIndex(0) name (f) -6 >Emitted(77, 15) Source(72, 15) + SourceIndex(0) name (f) -7 >Emitted(77, 19) Source(72, 19) + SourceIndex(0) name (f) -8 >Emitted(77, 20) Source(72, 20) + SourceIndex(0) name (f) -9 >Emitted(77, 21) Source(72, 21) + SourceIndex(0) name (f) -10>Emitted(77, 24) Source(72, 24) + SourceIndex(0) name (f) -11>Emitted(77, 25) Source(72, 25) + SourceIndex(0) name (f) -12>Emitted(77, 28) Source(72, 28) + SourceIndex(0) name (f) -13>Emitted(77, 29) Source(72, 29) + SourceIndex(0) name (f) -14>Emitted(77, 32) Source(72, 32) + SourceIndex(0) name (f) -15>Emitted(77, 33) Source(72, 33) + SourceIndex(0) name (f) -16>Emitted(77, 36) Source(72, 36) + SourceIndex(0) name (f) -17>Emitted(77, 37) Source(72, 37) + SourceIndex(0) name (f) -18>Emitted(77, 38) Source(72, 38) + SourceIndex(0) name (f) +1->Emitted(74, 5) Source(72, 5) + SourceIndex(0) name (f) +2 >Emitted(74, 9) Source(72, 9) + SourceIndex(0) name (f) +3 >Emitted(74, 10) Source(72, 10) + SourceIndex(0) name (f) +4 >Emitted(74, 13) Source(72, 13) + SourceIndex(0) name (f) +5 >Emitted(74, 14) Source(72, 14) + SourceIndex(0) name (f) +6 >Emitted(74, 15) Source(72, 15) + SourceIndex(0) name (f) +7 >Emitted(74, 19) Source(72, 19) + SourceIndex(0) name (f) +8 >Emitted(74, 20) Source(72, 20) + SourceIndex(0) name (f) +9 >Emitted(74, 21) Source(72, 21) + SourceIndex(0) name (f) +10>Emitted(74, 24) Source(72, 24) + SourceIndex(0) name (f) +11>Emitted(74, 25) Source(72, 25) + SourceIndex(0) name (f) +12>Emitted(74, 28) Source(72, 28) + SourceIndex(0) name (f) +13>Emitted(74, 29) Source(72, 29) + SourceIndex(0) name (f) +14>Emitted(74, 32) Source(72, 32) + SourceIndex(0) name (f) +15>Emitted(74, 33) Source(72, 33) + SourceIndex(0) name (f) +16>Emitted(74, 36) Source(72, 36) + SourceIndex(0) name (f) +17>Emitted(74, 37) Source(72, 37) + SourceIndex(0) name (f) +18>Emitted(74, 38) Source(72, 38) + SourceIndex(0) name (f) --- >>> (x == 1) ? x + 1 : x - 1; 1 >^^^^ @@ -1351,21 +1342,21 @@ sourceFile:sourceMapValidationStatements.ts 13> - 14> 1 15> ; -1 >Emitted(78, 5) Source(73, 5) + SourceIndex(0) name (f) -2 >Emitted(78, 6) Source(73, 6) + SourceIndex(0) name (f) -3 >Emitted(78, 7) Source(73, 7) + SourceIndex(0) name (f) -4 >Emitted(78, 11) Source(73, 11) + SourceIndex(0) name (f) -5 >Emitted(78, 12) Source(73, 12) + SourceIndex(0) name (f) -6 >Emitted(78, 13) Source(73, 13) + SourceIndex(0) name (f) -7 >Emitted(78, 16) Source(73, 16) + SourceIndex(0) name (f) -8 >Emitted(78, 17) Source(73, 17) + SourceIndex(0) name (f) -9 >Emitted(78, 20) Source(73, 20) + SourceIndex(0) name (f) -10>Emitted(78, 21) Source(73, 21) + SourceIndex(0) name (f) -11>Emitted(78, 24) Source(73, 24) + SourceIndex(0) name (f) -12>Emitted(78, 25) Source(73, 25) + SourceIndex(0) name (f) -13>Emitted(78, 28) Source(73, 28) + SourceIndex(0) name (f) -14>Emitted(78, 29) Source(73, 29) + SourceIndex(0) name (f) -15>Emitted(78, 30) Source(73, 30) + SourceIndex(0) name (f) +1 >Emitted(75, 5) Source(73, 5) + SourceIndex(0) name (f) +2 >Emitted(75, 6) Source(73, 6) + SourceIndex(0) name (f) +3 >Emitted(75, 7) Source(73, 7) + SourceIndex(0) name (f) +4 >Emitted(75, 11) Source(73, 11) + SourceIndex(0) name (f) +5 >Emitted(75, 12) Source(73, 12) + SourceIndex(0) name (f) +6 >Emitted(75, 13) Source(73, 13) + SourceIndex(0) name (f) +7 >Emitted(75, 16) Source(73, 16) + SourceIndex(0) name (f) +8 >Emitted(75, 17) Source(73, 17) + SourceIndex(0) name (f) +9 >Emitted(75, 20) Source(73, 20) + SourceIndex(0) name (f) +10>Emitted(75, 21) Source(73, 21) + SourceIndex(0) name (f) +11>Emitted(75, 24) Source(73, 24) + SourceIndex(0) name (f) +12>Emitted(75, 25) Source(73, 25) + SourceIndex(0) name (f) +13>Emitted(75, 28) Source(73, 28) + SourceIndex(0) name (f) +14>Emitted(75, 29) Source(73, 29) + SourceIndex(0) name (f) +15>Emitted(75, 30) Source(73, 30) + SourceIndex(0) name (f) --- >>> x === 1; 1 >^^^^ @@ -1380,11 +1371,11 @@ sourceFile:sourceMapValidationStatements.ts 3 > === 4 > 1 5 > ; -1 >Emitted(79, 5) Source(74, 5) + SourceIndex(0) name (f) -2 >Emitted(79, 6) Source(74, 6) + SourceIndex(0) name (f) -3 >Emitted(79, 11) Source(74, 11) + SourceIndex(0) name (f) -4 >Emitted(79, 12) Source(74, 12) + SourceIndex(0) name (f) -5 >Emitted(79, 13) Source(74, 13) + SourceIndex(0) name (f) +1 >Emitted(76, 5) Source(74, 5) + SourceIndex(0) name (f) +2 >Emitted(76, 6) Source(74, 6) + SourceIndex(0) name (f) +3 >Emitted(76, 11) Source(74, 11) + SourceIndex(0) name (f) +4 >Emitted(76, 12) Source(74, 12) + SourceIndex(0) name (f) +5 >Emitted(76, 13) Source(74, 13) + SourceIndex(0) name (f) --- >>> x = z = 40; 1->^^^^ @@ -1402,13 +1393,13 @@ sourceFile:sourceMapValidationStatements.ts 5 > = 6 > 40 7 > ; -1->Emitted(80, 5) Source(75, 5) + SourceIndex(0) name (f) -2 >Emitted(80, 6) Source(75, 6) + SourceIndex(0) name (f) -3 >Emitted(80, 9) Source(75, 9) + SourceIndex(0) name (f) -4 >Emitted(80, 10) Source(75, 10) + SourceIndex(0) name (f) -5 >Emitted(80, 13) Source(75, 13) + SourceIndex(0) name (f) -6 >Emitted(80, 15) Source(75, 15) + SourceIndex(0) name (f) -7 >Emitted(80, 16) Source(75, 16) + SourceIndex(0) name (f) +1->Emitted(77, 5) Source(75, 5) + SourceIndex(0) name (f) +2 >Emitted(77, 6) Source(75, 6) + SourceIndex(0) name (f) +3 >Emitted(77, 9) Source(75, 9) + SourceIndex(0) name (f) +4 >Emitted(77, 10) Source(75, 10) + SourceIndex(0) name (f) +5 >Emitted(77, 13) Source(75, 13) + SourceIndex(0) name (f) +6 >Emitted(77, 15) Source(75, 15) + SourceIndex(0) name (f) +7 >Emitted(77, 16) Source(75, 16) + SourceIndex(0) name (f) --- >>> eval("y"); 1 >^^^^ @@ -1424,12 +1415,12 @@ sourceFile:sourceMapValidationStatements.ts 4 > "y" 5 > ) 6 > ; -1 >Emitted(81, 5) Source(76, 5) + SourceIndex(0) name (f) -2 >Emitted(81, 9) Source(76, 9) + SourceIndex(0) name (f) -3 >Emitted(81, 10) Source(76, 10) + SourceIndex(0) name (f) -4 >Emitted(81, 13) Source(76, 13) + SourceIndex(0) name (f) -5 >Emitted(81, 14) Source(76, 14) + SourceIndex(0) name (f) -6 >Emitted(81, 15) Source(76, 15) + SourceIndex(0) name (f) +1 >Emitted(78, 5) Source(76, 5) + SourceIndex(0) name (f) +2 >Emitted(78, 9) Source(76, 9) + SourceIndex(0) name (f) +3 >Emitted(78, 10) Source(76, 10) + SourceIndex(0) name (f) +4 >Emitted(78, 13) Source(76, 13) + SourceIndex(0) name (f) +5 >Emitted(78, 14) Source(76, 14) + SourceIndex(0) name (f) +6 >Emitted(78, 15) Source(76, 15) + SourceIndex(0) name (f) --- >>> return; 1 >^^^^ @@ -1439,9 +1430,9 @@ sourceFile:sourceMapValidationStatements.ts > 2 > return 3 > ; -1 >Emitted(82, 5) Source(77, 5) + SourceIndex(0) name (f) -2 >Emitted(82, 11) Source(77, 11) + SourceIndex(0) name (f) -3 >Emitted(82, 12) Source(77, 12) + SourceIndex(0) name (f) +1 >Emitted(79, 5) Source(77, 5) + SourceIndex(0) name (f) +2 >Emitted(79, 11) Source(77, 11) + SourceIndex(0) name (f) +3 >Emitted(79, 12) Source(77, 12) + SourceIndex(0) name (f) --- >>>} 1 > @@ -1450,8 +1441,8 @@ sourceFile:sourceMapValidationStatements.ts 1 > > 2 >} -1 >Emitted(83, 1) Source(78, 1) + SourceIndex(0) name (f) -2 >Emitted(83, 2) Source(78, 2) + SourceIndex(0) name (f) +1 >Emitted(80, 1) Source(78, 1) + SourceIndex(0) name (f) +2 >Emitted(80, 2) Source(78, 2) + SourceIndex(0) name (f) --- >>>var b = function () { 1-> @@ -1464,10 +1455,10 @@ sourceFile:sourceMapValidationStatements.ts 2 >var 3 > b 4 > = -1->Emitted(84, 1) Source(79, 1) + SourceIndex(0) -2 >Emitted(84, 5) Source(79, 5) + SourceIndex(0) -3 >Emitted(84, 6) Source(79, 6) + SourceIndex(0) -4 >Emitted(84, 9) Source(79, 9) + SourceIndex(0) +1->Emitted(81, 1) Source(79, 1) + SourceIndex(0) +2 >Emitted(81, 5) Source(79, 5) + SourceIndex(0) +3 >Emitted(81, 6) Source(79, 6) + SourceIndex(0) +4 >Emitted(81, 9) Source(79, 9) + SourceIndex(0) --- >>> var x = 10; 1->^^^^ @@ -1483,12 +1474,12 @@ sourceFile:sourceMapValidationStatements.ts 4 > = 5 > 10 6 > ; -1->Emitted(85, 5) Source(80, 5) + SourceIndex(0) -2 >Emitted(85, 9) Source(80, 9) + SourceIndex(0) -3 >Emitted(85, 10) Source(80, 10) + SourceIndex(0) -4 >Emitted(85, 13) Source(80, 13) + SourceIndex(0) -5 >Emitted(85, 15) Source(80, 15) + SourceIndex(0) -6 >Emitted(85, 16) Source(80, 16) + SourceIndex(0) +1->Emitted(82, 5) Source(80, 5) + SourceIndex(0) +2 >Emitted(82, 9) Source(80, 9) + SourceIndex(0) +3 >Emitted(82, 10) Source(80, 10) + SourceIndex(0) +4 >Emitted(82, 13) Source(80, 13) + SourceIndex(0) +5 >Emitted(82, 15) Source(80, 15) + SourceIndex(0) +6 >Emitted(82, 16) Source(80, 16) + SourceIndex(0) --- >>> x = x + 1; 1 >^^^^ @@ -1506,13 +1497,13 @@ sourceFile:sourceMapValidationStatements.ts 5 > + 6 > 1 7 > ; -1 >Emitted(86, 5) Source(81, 5) + SourceIndex(0) -2 >Emitted(86, 6) Source(81, 6) + SourceIndex(0) -3 >Emitted(86, 9) Source(81, 9) + SourceIndex(0) -4 >Emitted(86, 10) Source(81, 10) + SourceIndex(0) -5 >Emitted(86, 13) Source(81, 13) + SourceIndex(0) -6 >Emitted(86, 14) Source(81, 14) + SourceIndex(0) -7 >Emitted(86, 15) Source(81, 15) + SourceIndex(0) +1 >Emitted(83, 5) Source(81, 5) + SourceIndex(0) +2 >Emitted(83, 6) Source(81, 6) + SourceIndex(0) +3 >Emitted(83, 9) Source(81, 9) + SourceIndex(0) +4 >Emitted(83, 10) Source(81, 10) + SourceIndex(0) +5 >Emitted(83, 13) Source(81, 13) + SourceIndex(0) +6 >Emitted(83, 14) Source(81, 14) + SourceIndex(0) +7 >Emitted(83, 15) Source(81, 15) + SourceIndex(0) --- >>>}; 1 > @@ -1523,9 +1514,9 @@ sourceFile:sourceMapValidationStatements.ts > 2 >} 3 > ; -1 >Emitted(87, 1) Source(82, 1) + SourceIndex(0) -2 >Emitted(87, 2) Source(82, 2) + SourceIndex(0) -3 >Emitted(87, 3) Source(82, 3) + SourceIndex(0) +1 >Emitted(84, 1) Source(82, 1) + SourceIndex(0) +2 >Emitted(84, 2) Source(82, 2) + SourceIndex(0) +3 >Emitted(84, 3) Source(82, 3) + SourceIndex(0) --- >>>f(); 1-> @@ -1538,9 +1529,9 @@ sourceFile:sourceMapValidationStatements.ts 2 >f 3 > () 4 > ; -1->Emitted(88, 1) Source(83, 1) + SourceIndex(0) -2 >Emitted(88, 2) Source(83, 2) + SourceIndex(0) -3 >Emitted(88, 4) Source(83, 4) + SourceIndex(0) -4 >Emitted(88, 5) Source(83, 5) + SourceIndex(0) +1->Emitted(85, 1) Source(83, 1) + SourceIndex(0) +2 >Emitted(85, 2) Source(83, 2) + SourceIndex(0) +3 >Emitted(85, 4) Source(83, 4) + SourceIndex(0) +4 >Emitted(85, 5) Source(83, 5) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationStatements.js.map \ No newline at end of file diff --git a/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt index 4bb3baf2f84..db23c2a19f6 100644 --- a/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt +++ b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/staticMemberAssignsToConstructorFunctionMembers.ts(7,9): error TS2323: Type '() => void' is not assignable to type '(x: number) => number'. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/staticMemberAssignsToConstructorFunctionMembers.ts(7,9): error TS2322: Type '() => void' is not assignable to type '(x: number) => number'. Type 'void' is not assignable to type 'number'. @@ -11,8 +11,8 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclara static bar(x: number): number { C.bar = () => { } // error ~~~~~ -!!! error TS2323: Type '() => void' is not assignable to type '(x: number) => number'. -!!! error TS2323: Type 'void' is not assignable to type 'number'. +!!! error TS2322: Type '() => void' is not assignable to type '(x: number) => number'. +!!! error TS2322: Type 'void' is not assignable to type 'number'. C.bar = (x) => x; // ok C.bar = (x: number) => 1; // ok return 1; diff --git a/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.errors.txt b/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.errors.txt index 6e855cdfeb2..59626540806 100644 --- a/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.errors.txt +++ b/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(12,1): error TS2323: Type 'C' is not assignable to type 'A'. +tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(12,1): error TS2322: Type 'C' is not assignable to type 'A'. Property 'name' is missing in type 'C'. -tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(13,1): error TS2323: Type 'typeof B' is not assignable to type 'A'. +tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(13,1): error TS2322: Type 'typeof B' is not assignable to type 'A'. Property 'name' is missing in type 'typeof B'. -tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(16,5): error TS2323: Type 'C' is not assignable to type 'B'. +tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(16,5): error TS2322: Type 'C' is not assignable to type 'B'. Property 'name' is missing in type 'C'. -tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(17,1): error TS2323: Type 'typeof B' is not assignable to type 'B'. +tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.ts(17,1): error TS2322: Type 'typeof B' is not assignable to type 'B'. Property 'name' is missing in type 'typeof B'. @@ -22,22 +22,22 @@ tests/cases/compiler/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment. var a: A = new B(); a = new C(); // error name is missing ~ -!!! error TS2323: Type 'C' is not assignable to type 'A'. -!!! error TS2323: Property 'name' is missing in type 'C'. +!!! error TS2322: Type 'C' is not assignable to type 'A'. +!!! error TS2322: Property 'name' is missing in type 'C'. a = B; // error name is missing ~ -!!! error TS2323: Type 'typeof B' is not assignable to type 'A'. -!!! error TS2323: Property 'name' is missing in type 'typeof B'. +!!! error TS2322: Type 'typeof B' is not assignable to type 'A'. +!!! error TS2322: Property 'name' is missing in type 'typeof B'. a = C; var b: B = new C(); // error name is missing ~ -!!! error TS2323: Type 'C' is not assignable to type 'B'. -!!! error TS2323: Property 'name' is missing in type 'C'. +!!! error TS2322: Type 'C' is not assignable to type 'B'. +!!! error TS2322: Property 'name' is missing in type 'C'. b = B; // error name is missing ~ -!!! error TS2323: Type 'typeof B' is not assignable to type 'B'. -!!! error TS2323: Property 'name' is missing in type 'typeof B'. +!!! error TS2322: Type 'typeof B' is not assignable to type 'B'. +!!! error TS2322: Property 'name' is missing in type 'typeof B'. b = C; b = a; diff --git a/tests/baselines/reference/stringIndexerAssignments1.errors.txt b/tests/baselines/reference/stringIndexerAssignments1.errors.txt index b4ca39eaa2f..3939ceba1bb 100644 --- a/tests/baselines/reference/stringIndexerAssignments1.errors.txt +++ b/tests/baselines/reference/stringIndexerAssignments1.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/stringIndexerAssignments1.ts(4,1): error TS2323: Type '{ one: string; }' is not assignable to type '{ [x: string]: string; one: string; }'. +tests/cases/compiler/stringIndexerAssignments1.ts(4,1): error TS2322: Type '{ one: string; }' is not assignable to type '{ [x: string]: string; one: string; }'. Index signature is missing in type '{ one: string; }'. -tests/cases/compiler/stringIndexerAssignments1.ts(5,1): error TS2323: Type '{ one: number; two: string; }' is not assignable to type '{ [x: string]: string; one: string; }'. +tests/cases/compiler/stringIndexerAssignments1.ts(5,1): error TS2322: Type '{ one: number; two: string; }' is not assignable to type '{ [x: string]: string; one: string; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string'. @@ -11,11 +11,11 @@ tests/cases/compiler/stringIndexerAssignments1.ts(5,1): error TS2323: Type '{ on var b: { one: number; two: string; }; x = a; ~ -!!! error TS2323: Type '{ one: string; }' is not assignable to type '{ [x: string]: string; one: string; }'. -!!! error TS2323: Index signature is missing in type '{ one: string; }'. +!!! error TS2322: Type '{ one: string; }' is not assignable to type '{ [x: string]: string; one: string; }'. +!!! error TS2322: Index signature is missing in type '{ one: string; }'. x = b; // error ~ -!!! error TS2323: Type '{ one: number; two: string; }' is not assignable to type '{ [x: string]: string; one: string; }'. -!!! error TS2323: Types of property 'one' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '{ one: number; two: string; }' is not assignable to type '{ [x: string]: string; one: string; }'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/stringIndexerAssignments2.errors.txt b/tests/baselines/reference/stringIndexerAssignments2.errors.txt index 73472081d9a..256a9820a0c 100644 --- a/tests/baselines/reference/stringIndexerAssignments2.errors.txt +++ b/tests/baselines/reference/stringIndexerAssignments2.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/stringIndexerAssignments2.ts(19,1): error TS2323: Type 'C2' is not assignable to type 'C1'. +tests/cases/compiler/stringIndexerAssignments2.ts(19,1): error TS2322: Type 'C2' is not assignable to type 'C1'. Index signature is missing in type 'C2'. -tests/cases/compiler/stringIndexerAssignments2.ts(20,1): error TS2323: Type 'C3' is not assignable to type 'C1'. +tests/cases/compiler/stringIndexerAssignments2.ts(20,1): error TS2322: Type 'C3' is not assignable to type 'C1'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string'. @@ -26,10 +26,10 @@ tests/cases/compiler/stringIndexerAssignments2.ts(20,1): error TS2323: Type 'C3' x = a; ~ -!!! error TS2323: Type 'C2' is not assignable to type 'C1'. -!!! error TS2323: Index signature is missing in type 'C2'. +!!! error TS2322: Type 'C2' is not assignable to type 'C1'. +!!! error TS2322: Index signature is missing in type 'C2'. x = b; ~ -!!! error TS2323: Type 'C3' is not assignable to type 'C1'. -!!! error TS2323: Types of property 'one' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'C3' is not assignable to type 'C1'. +!!! error TS2322: Types of property 'one' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt index cc9d56cff57..e4e8de59185 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt @@ -24,7 +24,7 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(71,5): error TS2411: Property 'foo' of type '() => string' is not assignable to string index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(73,5): error TS2411: Property '"4.0"' of type 'number' is not assignable to string index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(74,5): error TS2411: Property 'f' of type 'MyString' is not assignable to string index type 'string'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2323: Type '{ [x: string]: string | number | MyString | (() => void); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo: () => string; }' is not assignable to type '{ [x: string]: string; }'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2322: Type '{ [x: string]: string | number | MyString | (() => void); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo: () => string; }' is not assignable to type '{ [x: string]: string; }'. Index signatures are incompatible. Type 'string | number | MyString | (() => void)' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. @@ -160,10 +160,10 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon // error var b: { [x: string]: string; } = { ~ -!!! error TS2323: Type '{ [x: string]: string | number | MyString | (() => void); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo: () => string; }' is not assignable to type '{ [x: string]: string; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'string | number | MyString | (() => void)' is not assignable to type 'string'. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '{ [x: string]: string | number | MyString | (() => void); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo: () => string; }' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'string | number | MyString | (() => void)' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. a: '', b: 1, c: () => { }, diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.errors.txt b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.errors.txt index 4e3a0152b56..faef7905453 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.errors.txt +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.errors.txt @@ -4,7 +4,7 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(24,5): error TS2411: Property 'd' of type 'string' is not assignable to string index type 'A'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(31,5): error TS2411: Property 'c' of type 'number' is not assignable to string index type 'A'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(32,5): error TS2411: Property 'd' of type 'string' is not assignable to string index type 'A'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(36,5): error TS2323: Type '{ [x: string]: typeof A; a: typeof A; b: typeof B; }' is not assignable to type '{ [x: string]: A; }'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations2.ts(36,5): error TS2322: Type '{ [x: string]: typeof A; a: typeof A; b: typeof B; }' is not assignable to type '{ [x: string]: A; }'. Index signatures are incompatible. Type 'typeof A' is not assignable to type 'A'. Property 'foo' is missing in type 'typeof A'. @@ -60,10 +60,10 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon // error var b: { [x: string]: A } = { ~ -!!! error TS2323: Type '{ [x: string]: typeof A; a: typeof A; b: typeof B; }' is not assignable to type '{ [x: string]: A; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'typeof A' is not assignable to type 'A'. -!!! error TS2323: Property 'foo' is missing in type 'typeof A'. +!!! error TS2322: Type '{ [x: string]: typeof A; a: typeof A; b: typeof B; }' is not assignable to type '{ [x: string]: A; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'typeof A' is not assignable to type 'A'. +!!! error TS2322: Property 'foo' is missing in type 'typeof A'. a: A, b: B } \ No newline at end of file diff --git a/tests/baselines/reference/superCallAssignResult.errors.txt b/tests/baselines/reference/superCallAssignResult.errors.txt index 5a710c2327a..bc9e2a0dc55 100644 --- a/tests/baselines/reference/superCallAssignResult.errors.txt +++ b/tests/baselines/reference/superCallAssignResult.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/superCallAssignResult.ts(8,9): error TS2323: Type 'number' is not assignable to type 'void'. +tests/cases/compiler/superCallAssignResult.ts(8,9): error TS2322: Type 'number' is not assignable to type 'void'. ==== tests/cases/compiler/superCallAssignResult.ts (1 errors) ==== @@ -11,6 +11,6 @@ tests/cases/compiler/superCallAssignResult.ts(8,9): error TS2323: Type 'number' var x = super(5); // Should be of type void, not E. x = 5; ~ -!!! error TS2323: Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type 'number' is not assignable to type 'void'. } } \ No newline at end of file diff --git a/tests/baselines/reference/switchAssignmentCompat.errors.txt b/tests/baselines/reference/switchAssignmentCompat.errors.txt index c4695a6e8eb..6a2755365ab 100644 --- a/tests/baselines/reference/switchAssignmentCompat.errors.txt +++ b/tests/baselines/reference/switchAssignmentCompat.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/switchAssignmentCompat.ts(4,10): error TS2323: Type 'typeof Foo' is not assignable to type 'number'. +tests/cases/compiler/switchAssignmentCompat.ts(4,10): error TS2322: Type 'typeof Foo' is not assignable to type 'number'. ==== tests/cases/compiler/switchAssignmentCompat.ts (1 errors) ==== @@ -7,6 +7,6 @@ tests/cases/compiler/switchAssignmentCompat.ts(4,10): error TS2323: Type 'typeof switch (0) { case Foo: break; // Error expected ~~~ -!!! error TS2323: Type 'typeof Foo' is not assignable to type 'number'. +!!! error TS2322: Type 'typeof Foo' is not assignable to type 'number'. } \ No newline at end of file diff --git a/tests/baselines/reference/switchAssignmentCompat.js b/tests/baselines/reference/switchAssignmentCompat.js index 28384f8a271..7b3f2af80bb 100644 --- a/tests/baselines/reference/switchAssignmentCompat.js +++ b/tests/baselines/reference/switchAssignmentCompat.js @@ -13,6 +13,5 @@ var Foo = (function () { return Foo; })(); switch (0) { - case Foo: - break; + case Foo: break; } diff --git a/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt b/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt index f5f5c6a3c64..de739af007d 100644 --- a/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt +++ b/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(4,10): error TS2323: Type 'typeof Foo' is not assignable to type 'number'. -tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(5,10): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(7,10): error TS2323: Type 'boolean' is not assignable to type 'number'. +tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(4,10): error TS2322: Type 'typeof Foo' is not assignable to type 'number'. +tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(5,10): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(7,10): error TS2322: Type 'boolean' is not assignable to type 'number'. ==== tests/cases/compiler/switchCasesExpressionTypeMismatch.ts (3 errors) ==== @@ -9,14 +9,14 @@ tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(7,10): error TS2323: T switch (0) { case Foo: break; // Error ~~~ -!!! error TS2323: Type 'typeof Foo' is not assignable to type 'number'. +!!! error TS2322: Type 'typeof Foo' is not assignable to type 'number'. case "sss": break; // Error ~~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. case 123: break; // No Error case true: break; // Error ~~~~ -!!! error TS2323: Type 'boolean' is not assignable to type 'number'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. } var s: any = 0; diff --git a/tests/baselines/reference/switchCasesExpressionTypeMismatch.js b/tests/baselines/reference/switchCasesExpressionTypeMismatch.js index f8d5b446a8d..a35dc633e35 100644 --- a/tests/baselines/reference/switchCasesExpressionTypeMismatch.js +++ b/tests/baselines/reference/switchCasesExpressionTypeMismatch.js @@ -25,23 +25,15 @@ var Foo = (function () { return Foo; })(); switch (0) { - case Foo: - break; - case "sss": - break; - case 123: - break; - case true: - break; + case Foo: break; + case "sss": break; + case 123: break; + case true: break; } var s = 0; switch (s) { - case Foo: - break; - case "sss": - break; - case 123: - break; - case true: - break; + case Foo: break; + case "sss": break; + case 123: break; + case true: break; } diff --git a/tests/baselines/reference/switchFallThroughs.js b/tests/baselines/reference/switchFallThroughs.js index b38c6b6f0ab..53f221bd467 100644 --- a/tests/baselines/reference/switchFallThroughs.js +++ b/tests/baselines/reference/switchFallThroughs.js @@ -26,10 +26,9 @@ function R1(index) { var a = 'a'; return a; case 3: - case 4: - { - return 'b'; - } + case 4: { + return 'b'; + } case 5: default: return 'c'; diff --git a/tests/baselines/reference/targetTypeBaseCalls.errors.txt b/tests/baselines/reference/targetTypeBaseCalls.errors.txt index 60a98d2244e..37a00c9798d 100644 --- a/tests/baselines/reference/targetTypeBaseCalls.errors.txt +++ b/tests/baselines/reference/targetTypeBaseCalls.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/targetTypeBaseCalls.ts(9,19): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/targetTypeBaseCalls.ts(13,23): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/targetTypeBaseCalls.ts(17,61): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/targetTypeBaseCalls.ts(9,19): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/targetTypeBaseCalls.ts(13,23): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/targetTypeBaseCalls.ts(17,61): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/targetTypeBaseCalls.ts (3 errors) ==== @@ -14,17 +14,17 @@ tests/cases/compiler/targetTypeBaseCalls.ts(17,61): error TS2323: Type 'number' foo(function(s) { s = 5 }); // Error, can’t assign number to string ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. new Foo(function(s) { s = 5 }); // error, if types are applied correctly ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. class Bar extends Foo { constructor() { super(function(s) { s = 5 }) } } // error, if types are applied correctly ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/targetTypeTest3.errors.txt b/tests/baselines/reference/targetTypeTest3.errors.txt index af82adcace0..f5dab732ed3 100644 --- a/tests/baselines/reference/targetTypeTest3.errors.txt +++ b/tests/baselines/reference/targetTypeTest3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/targetTypeTest3.ts(4,5): error TS2323: Type '(string | number)[]' is not assignable to type 'string[]'. +tests/cases/compiler/targetTypeTest3.ts(4,5): error TS2322: Type '(string | number)[]' is not assignable to type 'string[]'. Type 'string | number' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. @@ -9,9 +9,9 @@ tests/cases/compiler/targetTypeTest3.ts(4,5): error TS2323: Type '(string | numb var a : string[] = [1,2,"3"]; // should produce an error ~ -!!! error TS2323: Type '(string | number)[]' is not assignable to type 'string[]'. -!!! error TS2323: Type 'string | number' is not assignable to type 'string'. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '(string | number)[]' is not assignable to type 'string[]'. +!!! error TS2322: Type 'string | number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. function func1(stuff:any[]) { return stuff; } diff --git a/tests/baselines/reference/targetTypeVoidFunc.errors.txt b/tests/baselines/reference/targetTypeVoidFunc.errors.txt index b084bf10aef..14c3cb37c3a 100644 --- a/tests/baselines/reference/targetTypeVoidFunc.errors.txt +++ b/tests/baselines/reference/targetTypeVoidFunc.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/targetTypeVoidFunc.ts(2,12): error TS2323: Type '() => void' is not assignable to type 'new () => number'. +tests/cases/compiler/targetTypeVoidFunc.ts(2,12): error TS2322: Type '() => void' is not assignable to type 'new () => number'. ==== tests/cases/compiler/targetTypeVoidFunc.ts (1 errors) ==== function f1(): { new (): number; } { return function () { return; } ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Type '() => void' is not assignable to type 'new () => number'. +!!! error TS2322: Type '() => void' is not assignable to type 'new () => number'. }; var x = f1(); diff --git a/tests/baselines/reference/thisWhenTypeCheckFails.errors.txt b/tests/baselines/reference/thisWhenTypeCheckFails.errors.txt index ae4603a1adb..aa12f7039b0 100644 --- a/tests/baselines/reference/thisWhenTypeCheckFails.errors.txt +++ b/tests/baselines/reference/thisWhenTypeCheckFails.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/thisWhenTypeCheckFails.ts(4,17): error TS2323: Type 'void' is not assignable to type 'string'. +tests/cases/compiler/thisWhenTypeCheckFails.ts(4,17): error TS2322: Type 'void' is not assignable to type 'string'. ==== tests/cases/compiler/thisWhenTypeCheckFails.ts (1 errors) ==== @@ -7,7 +7,7 @@ tests/cases/compiler/thisWhenTypeCheckFails.ts(4,17): error TS2323: Type 'void' var k = () => { var s: string = this.n(); ~ -!!! error TS2323: Type 'void' is not assignable to type 'string'. +!!! error TS2322: Type 'void' is not assignable to type 'string'. } } } diff --git a/tests/baselines/reference/tupleTypes.errors.txt b/tests/baselines/reference/tupleTypes.errors.txt index 6fdbd8a2f12..d1257be13ef 100644 --- a/tests/baselines/reference/tupleTypes.errors.txt +++ b/tests/baselines/reference/tupleTypes.errors.txt @@ -1,25 +1,25 @@ tests/cases/compiler/tupleTypes.ts(1,9): error TS1122: A tuple type element list cannot be empty. -tests/cases/compiler/tupleTypes.ts(14,1): error TS2323: Type 'undefined[]' is not assignable to type '[number, string]'. +tests/cases/compiler/tupleTypes.ts(14,1): error TS2322: Type 'undefined[]' is not assignable to type '[number, string]'. Property '0' is missing in type 'undefined[]'. -tests/cases/compiler/tupleTypes.ts(15,1): error TS2323: Type '[number]' is not assignable to type '[number, string]'. +tests/cases/compiler/tupleTypes.ts(15,1): error TS2322: Type '[number]' is not assignable to type '[number, string]'. Property '1' is missing in type '[number]'. -tests/cases/compiler/tupleTypes.ts(17,1): error TS2323: Type '[string, number]' is not assignable to type '[number, string]'. +tests/cases/compiler/tupleTypes.ts(17,1): error TS2322: Type '[string, number]' is not assignable to type '[number, string]'. Types of property '0' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/tupleTypes.ts(41,1): error TS2323: Type 'undefined[]' is not assignable to type '[number, string]'. -tests/cases/compiler/tupleTypes.ts(47,1): error TS2323: Type '[number, string]' is not assignable to type 'number[]'. +tests/cases/compiler/tupleTypes.ts(41,1): error TS2322: Type 'undefined[]' is not assignable to type '[number, string]'. +tests/cases/compiler/tupleTypes.ts(47,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]'. Types of property 'pop' are incompatible. Type '() => string | number' is not assignable to type '() => number'. Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/tupleTypes.ts(49,1): error TS2323: Type '[number, {}]' is not assignable to type 'number[]'. +tests/cases/compiler/tupleTypes.ts(49,1): error TS2322: Type '[number, {}]' is not assignable to type 'number[]'. Types of property 'pop' are incompatible. Type '() => {}' is not assignable to type '() => number'. Type '{}' is not assignable to type 'number'. -tests/cases/compiler/tupleTypes.ts(50,1): error TS2323: Type '[number, number]' is not assignable to type '[number, string]'. +tests/cases/compiler/tupleTypes.ts(50,1): error TS2322: Type '[number, number]' is not assignable to type '[number, string]'. Types of property '1' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/tupleTypes.ts(51,1): error TS2323: Type '[number, {}]' is not assignable to type '[number, string]'. +tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is not assignable to type '[number, string]'. Types of property '1' are incompatible. Type '{}' is not assignable to type 'string'. @@ -42,18 +42,18 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2323: Type '[number, {}]' is n t = []; // Error ~ -!!! error TS2323: Type 'undefined[]' is not assignable to type '[number, string]'. -!!! error TS2323: Property '0' is missing in type 'undefined[]'. +!!! error TS2322: Type 'undefined[]' is not assignable to type '[number, string]'. +!!! error TS2322: Property '0' is missing in type 'undefined[]'. t = [1]; // Error ~ -!!! error TS2323: Type '[number]' is not assignable to type '[number, string]'. -!!! error TS2323: Property '1' is missing in type '[number]'. +!!! error TS2322: Type '[number]' is not assignable to type '[number, string]'. +!!! error TS2322: Property '1' is missing in type '[number]'. t = [1, "hello"]; // Ok t = ["hello", 1]; // Error ~ -!!! error TS2323: Type '[string, number]' is not assignable to type '[number, string]'. -!!! error TS2323: Types of property '0' are incompatible. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '[string, number]' is not assignable to type '[number, string]'. +!!! error TS2322: Types of property '0' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. t = [1, "hello", 2]; // Ok var tf: [string, (x: string) => number] = ["hello", x => x.length]; @@ -79,7 +79,7 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2323: Type '[number, {}]' is n tt = [undefined, undefined]; tt = []; // Error ~~ -!!! error TS2323: Type 'undefined[]' is not assignable to type '[number, string]'. +!!! error TS2322: Type 'undefined[]' is not assignable to type '[number, string]'. var a: number[]; var a1: [number, string]; @@ -87,28 +87,28 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2323: Type '[number, {}]' is n var a3: [number, {}]; a = a1; // Error ~ -!!! error TS2323: Type '[number, string]' is not assignable to type 'number[]'. -!!! error TS2323: Types of property 'pop' are incompatible. -!!! error TS2323: Type '() => string | number' is not assignable to type '() => number'. -!!! error TS2323: Type 'string | number' is not assignable to type 'number'. -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '[number, string]' is not assignable to type 'number[]'. +!!! error TS2322: Types of property 'pop' are incompatible. +!!! error TS2322: Type '() => string | number' is not assignable to type '() => number'. +!!! error TS2322: Type 'string | number' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a = a2; a = a3; // Error ~ -!!! error TS2323: Type '[number, {}]' is not assignable to type 'number[]'. -!!! error TS2323: Types of property 'pop' are incompatible. -!!! error TS2323: Type '() => {}' is not assignable to type '() => number'. -!!! error TS2323: Type '{}' is not assignable to type 'number'. +!!! error TS2322: Type '[number, {}]' is not assignable to type 'number[]'. +!!! error TS2322: Types of property 'pop' are incompatible. +!!! error TS2322: Type '() => {}' is not assignable to type '() => number'. +!!! error TS2322: Type '{}' is not assignable to type 'number'. a1 = a2; // Error ~~ -!!! error TS2323: Type '[number, number]' is not assignable to type '[number, string]'. -!!! error TS2323: Types of property '1' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '[number, number]' is not assignable to type '[number, string]'. +!!! error TS2322: Types of property '1' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. a1 = a3; // Error ~~ -!!! error TS2323: Type '[number, {}]' is not assignable to type '[number, string]'. -!!! error TS2323: Types of property '1' are incompatible. -!!! error TS2323: Type '{}' is not assignable to type 'string'. +!!! error TS2322: Type '[number, {}]' is not assignable to type '[number, string]'. +!!! error TS2322: Types of property '1' are incompatible. +!!! error TS2322: Type '{}' is not assignable to type 'string'. a3 = a1; a3 = a2; \ No newline at end of file diff --git a/tests/baselines/reference/typeAliases.js b/tests/baselines/reference/typeAliases.js new file mode 100644 index 00000000000..0cf0dd92402 --- /dev/null +++ b/tests/baselines/reference/typeAliases.js @@ -0,0 +1,126 @@ +//// [typeAliases.ts] +// Writing a reference to a type alias has exactly the same effect as writing the aliased type itself. + +type T1 = number; +var x1: number; +var x1: T1; + +type T2 = string; +var x2: string; +var x2: T2; + +type T3 = boolean; +var x3: boolean; +var x3: T3; + +type T4 = void; +var x4: void; +var x4: T4; + +type T5 = any; +var x5: any; +var x5: T5; + +interface I6 { x : string } +type T6 = I6; +var x6: I6; +var x6: T6; + +class C7 { x: boolean } +type T7 = C7; +var x7: C7; +var x7: T7; + +type T8 = string | boolean; +var x8: string | boolean; +var x8: T8; + +type T9 = () => string; +var x9: () => string; +var x9: T9; + +type T10 = { x: number }; +var x10: { x: number }; +var x10: T10; + +type T11 = { new(): boolean }; +var x11: { new(): boolean }; +var x11: T11; + +interface I13 { x: string }; +type T13 = I13; +var x13_1: I13; +var x13_2: T13 + +declare function foo13(t1: T1, t2: T13): void; +foo13(x13_1, x13_2); +foo13(x13_2, x13_1); + +type T14 = string; +var x14: T14; + +declare function foo14_1(x: T14): void; + +declare function foo14_2(x: "click"): void; +declare function foo14_2(x: T14): void; + +type Meters = number + +enum E { x = 10 } + +declare function f15(a: string): boolean; +declare function f15(a: Meters): string; +f15(E.x).toLowerCase(); + +type StringAndBoolean = [string, boolean] +declare function f16(s: StringAndBoolean): string; +var x: [string, boolean]; +f16(x); + +var y: StringAndBoolean = ["1", false]; +y[0].toLowerCase(); + +//// [typeAliases.js] +// Writing a reference to a type alias has exactly the same effect as writing the aliased type itself. +var x1; +var x1; +var x2; +var x2; +var x3; +var x3; +var x4; +var x4; +var x5; +var x5; +var x6; +var x6; +var C7 = (function () { + function C7() { + } + return C7; +})(); +var x7; +var x7; +var x8; +var x8; +var x9; +var x9; +var x10; +var x10; +var x11; +var x11; +; +var x13_1; +var x13_2; +foo13(x13_1, x13_2); +foo13(x13_2, x13_1); +var x14; +var E; +(function (E) { + E[E["x"] = 10] = "x"; +})(E || (E = {})); +f15(10 /* x */).toLowerCase(); +var x; +f16(x); +var y = ["1", false]; +y[0].toLowerCase(); diff --git a/tests/baselines/reference/typeAliases.types b/tests/baselines/reference/typeAliases.types new file mode 100644 index 00000000000..f6e4afd571e --- /dev/null +++ b/tests/baselines/reference/typeAliases.types @@ -0,0 +1,241 @@ +=== tests/cases/conformance/types/typeAliases/typeAliases.ts === +// Writing a reference to a type alias has exactly the same effect as writing the aliased type itself. + +type T1 = number; +>T1 : number + +var x1: number; +>x1 : number + +var x1: T1; +>x1 : number +>T1 : number + +type T2 = string; +>T2 : string + +var x2: string; +>x2 : string + +var x2: T2; +>x2 : string +>T2 : string + +type T3 = boolean; +>T3 : boolean + +var x3: boolean; +>x3 : boolean + +var x3: T3; +>x3 : boolean +>T3 : boolean + +type T4 = void; +>T4 : void + +var x4: void; +>x4 : void + +var x4: T4; +>x4 : void +>T4 : void + +type T5 = any; +>T5 : any + +var x5: any; +>x5 : any + +var x5: T5; +>x5 : any +>T5 : any + +interface I6 { x : string } +>I6 : I6 +>x : string + +type T6 = I6; +>T6 : I6 +>I6 : I6 + +var x6: I6; +>x6 : I6 +>I6 : I6 + +var x6: T6; +>x6 : I6 +>T6 : I6 + +class C7 { x: boolean } +>C7 : C7 +>x : boolean + +type T7 = C7; +>T7 : C7 +>C7 : C7 + +var x7: C7; +>x7 : C7 +>C7 : C7 + +var x7: T7; +>x7 : C7 +>T7 : C7 + +type T8 = string | boolean; +>T8 : string | boolean + +var x8: string | boolean; +>x8 : string | boolean + +var x8: T8; +>x8 : string | boolean +>T8 : string | boolean + +type T9 = () => string; +>T9 : () => string + +var x9: () => string; +>x9 : () => string + +var x9: T9; +>x9 : () => string +>T9 : () => string + +type T10 = { x: number }; +>T10 : { x: number; } +>x : number + +var x10: { x: number }; +>x10 : { x: number; } +>x : number + +var x10: T10; +>x10 : { x: number; } +>T10 : { x: number; } + +type T11 = { new(): boolean }; +>T11 : new () => boolean + +var x11: { new(): boolean }; +>x11 : new () => boolean + +var x11: T11; +>x11 : new () => boolean +>T11 : new () => boolean + +interface I13 { x: string }; +>I13 : I13 +>x : string + +type T13 = I13; +>T13 : I13 +>I13 : I13 + +var x13_1: I13; +>x13_1 : I13 +>I13 : I13 + +var x13_2: T13 +>x13_2 : I13 +>T13 : I13 + +declare function foo13(t1: T1, t2: T13): void; +>foo13 : (t1: T1, t2: I13) => void +>T1 : T1 +>I13 : I13 +>T2 : T2 +>T13 : I13 +>t1 : T1 +>T1 : T1 +>t2 : I13 +>T13 : I13 + +foo13(x13_1, x13_2); +>foo13(x13_1, x13_2) : void +>foo13 : (t1: T1, t2: I13) => void +>x13_1 : I13 +>x13_2 : I13 + +foo13(x13_2, x13_1); +>foo13(x13_2, x13_1) : void +>foo13 : (t1: T1, t2: I13) => void +>x13_2 : I13 +>x13_1 : I13 + +type T14 = string; +>T14 : string + +var x14: T14; +>x14 : string +>T14 : string + +declare function foo14_1(x: T14): void; +>foo14_1 : (x: string) => void +>x : string +>T14 : string + +declare function foo14_2(x: "click"): void; +>foo14_2 : { (x: "click"): void; (x: string): void; } +>x : "click" + +declare function foo14_2(x: T14): void; +>foo14_2 : { (x: "click"): void; (x: string): void; } +>x : string +>T14 : string + +type Meters = number +>Meters : number + +enum E { x = 10 } +>E : E +>x : E + +declare function f15(a: string): boolean; +>f15 : { (a: string): boolean; (a: number): string; } +>a : string + +declare function f15(a: Meters): string; +>f15 : { (a: string): boolean; (a: number): string; } +>a : number +>Meters : number + +f15(E.x).toLowerCase(); +>f15(E.x).toLowerCase() : string +>f15(E.x).toLowerCase : () => string +>f15(E.x) : string +>f15 : { (a: string): boolean; (a: number): string; } +>E.x : E +>E : typeof E +>x : E +>toLowerCase : () => string + +type StringAndBoolean = [string, boolean] +>StringAndBoolean : [string, boolean] + +declare function f16(s: StringAndBoolean): string; +>f16 : (s: [string, boolean]) => string +>s : [string, boolean] +>StringAndBoolean : [string, boolean] + +var x: [string, boolean]; +>x : [string, boolean] + +f16(x); +>f16(x) : string +>f16 : (s: [string, boolean]) => string +>x : [string, boolean] + +var y: StringAndBoolean = ["1", false]; +>y : [string, boolean] +>StringAndBoolean : [string, boolean] +>["1", false] : [string, boolean] + +y[0].toLowerCase(); +>y[0].toLowerCase() : string +>y[0].toLowerCase : () => string +>y[0] : string +>y : [string, boolean] +>toLowerCase : () => string + diff --git a/tests/baselines/reference/typeAliasesForObjectTypes.errors.txt b/tests/baselines/reference/typeAliasesForObjectTypes.errors.txt new file mode 100644 index 00000000000..d957b589953 --- /dev/null +++ b/tests/baselines/reference/typeAliasesForObjectTypes.errors.txt @@ -0,0 +1,39 @@ +tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts(14,8): error TS1005: '=' expected. +tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts(14,12): error TS1005: '(' expected. +tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts(4,22): error TS2312: An interface may only extend a class or another interface. +tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts(5,21): error TS2422: A class may only implement another class or interface. +tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts(10,6): error TS2300: Duplicate identifier 'T2'. +tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts(11,6): error TS2300: Duplicate identifier 'T2'. +tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts(14,19): error TS2304: Cannot find name 'T'. + + +==== tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts (7 errors) ==== + type T1 = { x: string } + + // An interface can be named in an extends or implements clause, but a type alias for an object type literal cannot. + interface I1 extends T1 { y: string } + ~~ +!!! error TS2312: An interface may only extend a class or another interface. + class C1 implements T1 { + ~~ +!!! error TS2422: A class may only implement another class or interface. + x: string; + } + + // An interface can have multiple merged declarations, but a type alias for an object type literal cannot. + type T2 = { x: string } + ~~ +!!! error TS2300: Duplicate identifier 'T2'. + type T2 = { y: number } + ~~ +!!! error TS2300: Duplicate identifier 'T2'. + + // An interface can have type parameters, but a type alias for an object type literal cannot. + type T3 = { x: T } + ~ +!!! error TS1005: '=' expected. + ~ +!!! error TS1005: '(' expected. + ~ +!!! error TS2304: Cannot find name 'T'. + \ No newline at end of file diff --git a/tests/baselines/reference/typeArgumentsShouldDisallowNonGenericOverloads.errors.txt b/tests/baselines/reference/typeArgumentsShouldDisallowNonGenericOverloads.errors.txt index c0d90304de0..1f1620ed3c1 100644 --- a/tests/baselines/reference/typeArgumentsShouldDisallowNonGenericOverloads.errors.txt +++ b/tests/baselines/reference/typeArgumentsShouldDisallowNonGenericOverloads.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/typeArgumentsShouldDisallowNonGenericOverloads.ts(10,5): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/typeArgumentsShouldDisallowNonGenericOverloads.ts(11,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/typeArgumentsShouldDisallowNonGenericOverloads.ts(10,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/typeArgumentsShouldDisallowNonGenericOverloads.ts(11,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/typeArgumentsShouldDisallowNonGenericOverloads.ts (2 errors) ==== @@ -14,7 +14,7 @@ tests/cases/compiler/typeArgumentsShouldDisallowNonGenericOverloads.ts(11,5): er var w: string = foo("hi"); // should error ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var z: number = foo("hi"); // should error ~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.errors.txt b/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.errors.txt index dd7447d2148..e8c9bd6fc20 100644 --- a/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.errors.txt +++ b/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(2,7): error TS2323: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(3,5): error TS2323: Type 'Object' is not assignable to type 'string'. +tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(2,7): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(3,5): error TS2322: Type 'Object' is not assignable to type 'string'. tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(4,15): error TS2339: Property 'NonexistantMethod' does not exist on type 'number[]'. tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(5,5): error TS2304: Cannot find name 'derp'. @@ -8,10 +8,10 @@ tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(5,5): error var functions = [function () { var k: string = 10; ~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. k = new Object(); ~ -!!! error TS2323: Type 'Object' is not assignable to type 'string'. +!!! error TS2322: Type 'Object' is not assignable to type 'string'. [1, 2, 3].NonexistantMethod(); ~~~~~~~~~~~~~~~~~ !!! error TS2339: Property 'NonexistantMethod' does not exist on type 'number[]'. diff --git a/tests/baselines/reference/typeComparisonCaching.errors.txt b/tests/baselines/reference/typeComparisonCaching.errors.txt index 3cbedebb7d2..8a94bdf835c 100644 --- a/tests/baselines/reference/typeComparisonCaching.errors.txt +++ b/tests/baselines/reference/typeComparisonCaching.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/typeComparisonCaching.ts(26,1): error TS2323: Type 'B' is not assignable to type 'A'. +tests/cases/compiler/typeComparisonCaching.ts(26,1): error TS2322: Type 'B' is not assignable to type 'A'. Types of property 's' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/typeComparisonCaching.ts(27,1): error TS2323: Type 'D' is not assignable to type 'C'. +tests/cases/compiler/typeComparisonCaching.ts(27,1): error TS2322: Type 'D' is not assignable to type 'C'. Types of property 'q' are incompatible. Type 'B' is not assignable to type 'A'. @@ -34,12 +34,12 @@ tests/cases/compiler/typeComparisonCaching.ts(27,1): error TS2323: Type 'D' is n a = b; ~ -!!! error TS2323: Type 'B' is not assignable to type 'A'. -!!! error TS2323: Types of property 's' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'B' is not assignable to type 'A'. +!!! error TS2322: Types of property 's' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. c = d; // Should not be allowed ~ -!!! error TS2323: Type 'D' is not assignable to type 'C'. -!!! error TS2323: Types of property 'q' are incompatible. -!!! error TS2323: Type 'B' is not assignable to type 'A'. +!!! error TS2322: Type 'D' is not assignable to type 'C'. +!!! error TS2322: Types of property 'q' are incompatible. +!!! error TS2322: Type 'B' is not assignable to type 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/typeIdentityConsidersBrands.errors.txt b/tests/baselines/reference/typeIdentityConsidersBrands.errors.txt index 2cae46779a8..99264a00351 100644 --- a/tests/baselines/reference/typeIdentityConsidersBrands.errors.txt +++ b/tests/baselines/reference/typeIdentityConsidersBrands.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeIdentityConsidersBrands.ts(30,1): error TS2323: Type 'X_1' is not assignable to type 'Y_1'. +tests/cases/compiler/typeIdentityConsidersBrands.ts(30,1): error TS2322: Type 'X_1' is not assignable to type 'Y_1'. Types have separate declarations of a private property 'name'. tests/cases/compiler/typeIdentityConsidersBrands.ts(31,6): error TS2345: Argument of type 'Y_1' is not assignable to parameter of type 'X_1'. @@ -35,8 +35,8 @@ tests/cases/compiler/typeIdentityConsidersBrands.ts(31,6): error TS2345: Argumen a2 = b2; // should error ~~ -!!! error TS2323: Type 'X_1' is not assignable to type 'Y_1'. -!!! error TS2323: Types have separate declarations of a private property 'name'. +!!! error TS2322: Type 'X_1' is not assignable to type 'Y_1'. +!!! error TS2322: Types have separate declarations of a private property 'name'. foo2(a2); // should error ~~ !!! error TS2345: Argument of type 'Y_1' is not assignable to parameter of type 'X_1'. diff --git a/tests/baselines/reference/typeInfer1.errors.txt b/tests/baselines/reference/typeInfer1.errors.txt index a56668e62f3..cce736e2531 100644 --- a/tests/baselines/reference/typeInfer1.errors.txt +++ b/tests/baselines/reference/typeInfer1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeInfer1.ts(11,5): error TS2323: Type '{ Moo: () => string; }' is not assignable to type 'ITextWriter2'. +tests/cases/compiler/typeInfer1.ts(11,5): error TS2322: Type '{ Moo: () => string; }' is not assignable to type 'ITextWriter2'. Property 'Write' is missing in type '{ Moo: () => string; }'. @@ -15,7 +15,7 @@ tests/cases/compiler/typeInfer1.ts(11,5): error TS2323: Type '{ Moo: () => strin var yyyyyyyy: ITextWriter2 = { ~~~~~~~~ -!!! error TS2323: Type '{ Moo: () => string; }' is not assignable to type 'ITextWriter2'. -!!! error TS2323: Property 'Write' is missing in type '{ Moo: () => string; }'. +!!! error TS2322: Type '{ Moo: () => string; }' is not assignable to type 'ITextWriter2'. +!!! error TS2322: Property 'Write' is missing in type '{ Moo: () => string; }'. Moo: function() { return "cow"; } } \ No newline at end of file diff --git a/tests/baselines/reference/typeMatch1.errors.txt b/tests/baselines/reference/typeMatch1.errors.txt index ae6eff78528..d0bcd71065e 100644 --- a/tests/baselines/reference/typeMatch1.errors.txt +++ b/tests/baselines/reference/typeMatch1.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/typeMatch1.ts(18,1): error TS2323: Type 'D' is not assignable to type 'C'. +tests/cases/compiler/typeMatch1.ts(18,1): error TS2322: Type 'D' is not assignable to type 'C'. Types have separate declarations of a private property 'x'. -tests/cases/compiler/typeMatch1.ts(19,1): error TS2323: Type 'typeof C' is not assignable to type 'C'. +tests/cases/compiler/typeMatch1.ts(19,1): error TS2322: Type 'typeof C' is not assignable to type 'C'. Property 'x' is missing in type 'typeof C'. tests/cases/compiler/typeMatch1.ts(20,1): error TS2365: Operator '==' cannot be applied to types 'typeof C' and 'typeof D'. @@ -25,12 +25,12 @@ tests/cases/compiler/typeMatch1.ts(20,1): error TS2365: Operator '==' cannot be x6 = x7; ~~ -!!! error TS2323: Type 'D' is not assignable to type 'C'. -!!! error TS2323: Types have separate declarations of a private property 'x'. +!!! error TS2322: Type 'D' is not assignable to type 'C'. +!!! error TS2322: Types have separate declarations of a private property 'x'. x6=C; ~~ -!!! error TS2323: Type 'typeof C' is not assignable to type 'C'. -!!! error TS2323: Property 'x' is missing in type 'typeof C'. +!!! error TS2322: Type 'typeof C' is not assignable to type 'C'. +!!! error TS2322: Property 'x' is missing in type 'typeof C'. C==D; ~~~~ !!! error TS2365: Operator '==' cannot be applied to types 'typeof C' and 'typeof D'. diff --git a/tests/baselines/reference/typeMatch2.errors.txt b/tests/baselines/reference/typeMatch2.errors.txt index 867ccb93387..4db4828064e 100644 --- a/tests/baselines/reference/typeMatch2.errors.txt +++ b/tests/baselines/reference/typeMatch2.errors.txt @@ -1,17 +1,17 @@ -tests/cases/compiler/typeMatch2.ts(3,2): error TS2323: Type '{}' is not assignable to type '{ x: number; y: number; }'. +tests/cases/compiler/typeMatch2.ts(3,2): error TS2322: Type '{}' is not assignable to type '{ x: number; y: number; }'. Property 'x' is missing in type '{}'. -tests/cases/compiler/typeMatch2.ts(4,5): error TS2323: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. +tests/cases/compiler/typeMatch2.ts(4,5): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. Property 'y' is missing in type '{ x: number; }'. -tests/cases/compiler/typeMatch2.ts(6,5): error TS2323: Type '{ x: number; z: number; }' is not assignable to type '{ x: number; y: number; }'. +tests/cases/compiler/typeMatch2.ts(6,5): error TS2322: Type '{ x: number; z: number; }' is not assignable to type '{ x: number; y: number; }'. Property 'y' is missing in type '{ x: number; z: number; }'. -tests/cases/compiler/typeMatch2.ts(18,5): error TS2323: Type 'Animal[]' is not assignable to type 'Giraffe[]'. +tests/cases/compiler/typeMatch2.ts(18,5): error TS2322: Type 'Animal[]' is not assignable to type 'Giraffe[]'. Type 'Animal' is not assignable to type 'Giraffe'. Property 'g' is missing in type 'Animal'. -tests/cases/compiler/typeMatch2.ts(22,5): error TS2323: Type '{ f1: number; f2: Animal[]; }' is not assignable to type '{ f1: number; f2: Giraffe[]; }'. +tests/cases/compiler/typeMatch2.ts(22,5): error TS2322: Type '{ f1: number; f2: Animal[]; }' is not assignable to type '{ f1: number; f2: Giraffe[]; }'. Types of property 'f2' are incompatible. Type 'Animal[]' is not assignable to type 'Giraffe[]'. Type 'Animal' is not assignable to type 'Giraffe'. -tests/cases/compiler/typeMatch2.ts(35,5): error TS2323: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. +tests/cases/compiler/typeMatch2.ts(35,5): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. Property 'y' is missing in type '{ x: number; }'. @@ -20,17 +20,17 @@ tests/cases/compiler/typeMatch2.ts(35,5): error TS2323: Type '{ x: number; }' is var a = { x: 1, y: 2 }; a = {}; // error ~ -!!! error TS2323: Type '{}' is not assignable to type '{ x: number; y: number; }'. -!!! error TS2323: Property 'x' is missing in type '{}'. +!!! error TS2322: Type '{}' is not assignable to type '{ x: number; y: number; }'. +!!! error TS2322: Property 'x' is missing in type '{}'. a = { x: 1 }; // error ~ -!!! error TS2323: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. -!!! error TS2323: Property 'y' is missing in type '{ x: number; }'. +!!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. +!!! error TS2322: Property 'y' is missing in type '{ x: number; }'. a = { x: 1, y: 2, z: 3 }; a = { x: 1, z: 3 }; // error ~ -!!! error TS2323: Type '{ x: number; z: number; }' is not assignable to type '{ x: number; y: number; }'. -!!! error TS2323: Property 'y' is missing in type '{ x: number; z: number; }'. +!!! error TS2322: Type '{ x: number; z: number; }' is not assignable to type '{ x: number; y: number; }'. +!!! error TS2322: Property 'y' is missing in type '{ x: number; z: number; }'. } class Animal { private a; } @@ -44,18 +44,18 @@ tests/cases/compiler/typeMatch2.ts(35,5): error TS2323: Type '{ x: number; }' is aa = gg; gg = aa; // error ~~ -!!! error TS2323: Type 'Animal[]' is not assignable to type 'Giraffe[]'. -!!! error TS2323: Type 'Animal' is not assignable to type 'Giraffe'. -!!! error TS2323: Property 'g' is missing in type 'Animal'. +!!! error TS2322: Type 'Animal[]' is not assignable to type 'Giraffe[]'. +!!! error TS2322: Type 'Animal' is not assignable to type 'Giraffe'. +!!! error TS2322: Property 'g' is missing in type 'Animal'. var xa = { f1: 5, f2: aa }; var xb = { f1: 5, f2: gg }; xa = xb; // Should be ok xb = xa; // Not ok ~~ -!!! error TS2323: Type '{ f1: number; f2: Animal[]; }' is not assignable to type '{ f1: number; f2: Giraffe[]; }'. -!!! error TS2323: Types of property 'f2' are incompatible. -!!! error TS2323: Type 'Animal[]' is not assignable to type 'Giraffe[]'. -!!! error TS2323: Type 'Animal' is not assignable to type 'Giraffe'. +!!! error TS2322: Type '{ f1: number; f2: Animal[]; }' is not assignable to type '{ f1: number; f2: Giraffe[]; }'. +!!! error TS2322: Types of property 'f2' are incompatible. +!!! error TS2322: Type 'Animal[]' is not assignable to type 'Giraffe[]'. +!!! error TS2322: Type 'Animal' is not assignable to type 'Giraffe'. } function f4() { @@ -70,8 +70,8 @@ tests/cases/compiler/typeMatch2.ts(35,5): error TS2323: Type '{ x: number; }' is a = { x: 1, y: _any, z:1 }; a = { x: 1 }; // error ~ -!!! error TS2323: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. -!!! error TS2323: Property 'y' is missing in type '{ x: number; }'. +!!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. +!!! error TS2322: Property 'y' is missing in type '{ x: number; }'. var mf = function m(n) { return false; }; var zf = function z(n: number) { return true; }; mf=zf; diff --git a/tests/baselines/reference/typeName1.errors.txt b/tests/baselines/reference/typeName1.errors.txt index 6b896001b5a..64a32663875 100644 --- a/tests/baselines/reference/typeName1.errors.txt +++ b/tests/baselines/reference/typeName1.errors.txt @@ -1,32 +1,32 @@ -tests/cases/compiler/typeName1.ts(9,5): error TS2323: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. +tests/cases/compiler/typeName1.ts(9,5): error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. Property 'f' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(10,5): error TS2323: Type 'number' is not assignable to type '{ f(s: string): number; }'. +tests/cases/compiler/typeName1.ts(10,5): error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; }'. Property 'f' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(11,5): error TS2323: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. -tests/cases/compiler/typeName1.ts(12,5): error TS2323: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. +tests/cases/compiler/typeName1.ts(11,5): error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. +tests/cases/compiler/typeName1.ts(12,5): error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. Property 'x' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(13,5): error TS2323: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. +tests/cases/compiler/typeName1.ts(13,5): error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. Property 'x' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(14,5): error TS2323: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. +tests/cases/compiler/typeName1.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. Property 'z' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(15,5): error TS2323: Type 'number' is not assignable to type '(s: string) => boolean'. -tests/cases/compiler/typeName1.ts(16,5): error TS2323: Type 'number' is not assignable to type '{ (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }'. +tests/cases/compiler/typeName1.ts(15,5): error TS2322: Type 'number' is not assignable to type '(s: string) => boolean'. +tests/cases/compiler/typeName1.ts(16,5): error TS2322: Type 'number' is not assignable to type '{ (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }'. Property 'z' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(16,10): error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. -tests/cases/compiler/typeName1.ts(17,5): error TS2323: Type 'number' is not assignable to type 'I'. +tests/cases/compiler/typeName1.ts(17,5): error TS2322: Type 'number' is not assignable to type 'I'. Property 'k' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(18,5): error TS2323: Type 'number' is not assignable to type 'I[][][][]'. +tests/cases/compiler/typeName1.ts(18,5): error TS2322: Type 'number' is not assignable to type 'I[][][][]'. Property 'length' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(19,5): error TS2323: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]'. +tests/cases/compiler/typeName1.ts(19,5): error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]'. Property 'length' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(20,5): error TS2323: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }; }[][]'. +tests/cases/compiler/typeName1.ts(20,5): error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }; }[][]'. Property 'length' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(20,50): error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. -tests/cases/compiler/typeName1.ts(21,5): error TS2323: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. +tests/cases/compiler/typeName1.ts(21,5): error TS2322: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. Property 'x' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(22,5): error TS2323: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. +tests/cases/compiler/typeName1.ts(22,5): error TS2322: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. Property 'f' is missing in type 'Number'. -tests/cases/compiler/typeName1.ts(23,5): error TS2323: Type 'typeof C' is not assignable to type 'number'. +tests/cases/compiler/typeName1.ts(23,5): error TS2322: Type 'typeof C' is not assignable to type 'number'. ==== tests/cases/compiler/typeName1.ts (17 errors) ==== @@ -40,65 +40,65 @@ tests/cases/compiler/typeName1.ts(23,5): error TS2323: Type 'typeof C' is not as var x1:{ f(s:string):number;f(n:number):string; }=3; ~~ -!!! error TS2323: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. -!!! error TS2323: Property 'f' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. +!!! error TS2322: Property 'f' is missing in type 'Number'. var x2:{ f(s:string):number; } =3; ~~ -!!! error TS2323: Type 'number' is not assignable to type '{ f(s: string): number; }'. -!!! error TS2323: Property 'f' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; }'. +!!! error TS2322: Property 'f' is missing in type 'Number'. var x3:{ (s:string):number;(n:number):string; }=3; ~~ -!!! error TS2323: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. +!!! error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. var x4:{ x;y;z:number;f(n:number):string;f(s:string):number; }=3; ~~ -!!! error TS2323: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. -!!! error TS2323: Property 'x' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. +!!! error TS2322: Property 'x' is missing in type 'Number'. var x5:{ (s:string):number;(n:number):string;x;y;z:number;f(n:number):string;f(s:string):number; }=3; ~~ -!!! error TS2323: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. -!!! error TS2323: Property 'x' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. +!!! error TS2322: Property 'x' is missing in type 'Number'. var x6:{ z:number;f:{(n:number):string;(s:string):number;}; }=3; ~~ -!!! error TS2323: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. -!!! error TS2323: Property 'z' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. +!!! error TS2322: Property 'z' is missing in type 'Number'. var x7:(s:string)=>boolean=3; ~~ -!!! error TS2323: Type 'number' is not assignable to type '(s: string) => boolean'. +!!! error TS2322: Type 'number' is not assignable to type '(s: string) => boolean'. var x8:{ z:I;[s:string]:{ x; y; };[n:number]:{x; y;};():boolean; }=3; ~~ -!!! error TS2323: Type 'number' is not assignable to type '{ (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }'. -!!! error TS2323: Property 'z' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }'. +!!! error TS2322: Property 'z' is missing in type 'Number'. ~~~~ !!! error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. var x9:I=3; ~~ -!!! error TS2323: Type 'number' is not assignable to type 'I'. -!!! error TS2323: Property 'k' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'I'. +!!! error TS2322: Property 'k' is missing in type 'Number'. var x10:I[][][][]=3; ~~~ -!!! error TS2323: Type 'number' is not assignable to type 'I[][][][]'. -!!! error TS2323: Property 'length' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'I[][][][]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. var x11:{z:I;x:boolean;}[][]=3; ~~~ -!!! error TS2323: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]'. -!!! error TS2323: Property 'length' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. var x12:{z:I;x:boolean;y:(s:string)=>boolean;w:{ z:I;[s:string]:{ x; y; };[n:number]:{x; y;};():boolean; };}[][]=3; ~~~ -!!! error TS2323: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }; }[][]'. -!!! error TS2323: Property 'length' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [x: string]: { x: any; y: any; }; [x: number]: { x: any; y: any; }; z: I; }; }[][]'. +!!! error TS2322: Property 'length' is missing in type 'Number'. ~~~~ !!! error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. var x13:{ new(): number; new(n:number):number; x: string; w: {y: number;}; (): {}; } = 3; ~~~ -!!! error TS2323: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. -!!! error TS2323: Property 'x' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. +!!! error TS2322: Property 'x' is missing in type 'Number'. var x14:{ f(x:number):boolean; p; q; ():string; }=3; ~~~ -!!! error TS2323: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. -!!! error TS2323: Property 'f' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. +!!! error TS2322: Property 'f' is missing in type 'Number'. var x15:number=C; ~~~ -!!! error TS2323: Type 'typeof C' is not assignable to type 'number'. +!!! error TS2322: Type 'typeof C' is not assignable to type 'number'. diff --git a/tests/baselines/reference/typeOfOperator1.errors.txt b/tests/baselines/reference/typeOfOperator1.errors.txt index c703d3721db..764463a3087 100644 --- a/tests/baselines/reference/typeOfOperator1.errors.txt +++ b/tests/baselines/reference/typeOfOperator1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeOfOperator1.ts(3,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/typeOfOperator1.ts(3,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/typeOfOperator1.ts (1 errors) ==== @@ -6,4 +6,4 @@ tests/cases/compiler/typeOfOperator1.ts(3,5): error TS2323: Type 'string' is not var y: string = typeof x; var z: number = typeof x; ~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence.errors.txt index 96db3e9110c..f47266f2850 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/typeParameterArgumentEquivalence.ts(4,5): error TS2323: Type '(item: T) => boolean' is not assignable to type '(item: number) => boolean'. +tests/cases/compiler/typeParameterArgumentEquivalence.ts(4,5): error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: number) => boolean'. Types of parameters 'item' and 'item' are incompatible. Type 'T' is not assignable to type 'number'. -tests/cases/compiler/typeParameterArgumentEquivalence.ts(5,5): error TS2323: Type '(item: number) => boolean' is not assignable to type '(item: T) => boolean'. +tests/cases/compiler/typeParameterArgumentEquivalence.ts(5,5): error TS2322: Type '(item: number) => boolean' is not assignable to type '(item: T) => boolean'. Types of parameters 'item' and 'item' are incompatible. Type 'number' is not assignable to type 'T'. @@ -12,13 +12,13 @@ tests/cases/compiler/typeParameterArgumentEquivalence.ts(5,5): error TS2323: Typ var y: (item: T) => boolean; x = y; // Should be an error ~ -!!! error TS2323: Type '(item: T) => boolean' is not assignable to type '(item: number) => boolean'. -!!! error TS2323: Types of parameters 'item' and 'item' are incompatible. -!!! error TS2323: Type 'T' is not assignable to type 'number'. +!!! error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: number) => boolean'. +!!! error TS2322: Types of parameters 'item' and 'item' are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'number'. y = x; // Shound be an error ~ -!!! error TS2323: Type '(item: number) => boolean' is not assignable to type '(item: T) => boolean'. -!!! error TS2323: Types of parameters 'item' and 'item' are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'T'. +!!! error TS2322: Type '(item: number) => boolean' is not assignable to type '(item: T) => boolean'. +!!! error TS2322: Types of parameters 'item' and 'item' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence2.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence2.errors.txt index f1350ebe853..2aa8d77ba6d 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence2.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/typeParameterArgumentEquivalence2.ts(4,5): error TS2323: Type '(item: T) => boolean' is not assignable to type '(item: U) => boolean'. +tests/cases/compiler/typeParameterArgumentEquivalence2.ts(4,5): error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: U) => boolean'. Types of parameters 'item' and 'item' are incompatible. Type 'T' is not assignable to type 'U'. -tests/cases/compiler/typeParameterArgumentEquivalence2.ts(5,5): error TS2323: Type '(item: U) => boolean' is not assignable to type '(item: T) => boolean'. +tests/cases/compiler/typeParameterArgumentEquivalence2.ts(5,5): error TS2322: Type '(item: U) => boolean' is not assignable to type '(item: T) => boolean'. Types of parameters 'item' and 'item' are incompatible. Type 'U' is not assignable to type 'T'. @@ -12,13 +12,13 @@ tests/cases/compiler/typeParameterArgumentEquivalence2.ts(5,5): error TS2323: Ty var y: (item: T) => boolean; x = y; // Should be an error ~ -!!! error TS2323: Type '(item: T) => boolean' is not assignable to type '(item: U) => boolean'. -!!! error TS2323: Types of parameters 'item' and 'item' are incompatible. -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type '(item: T) => boolean' is not assignable to type '(item: U) => boolean'. +!!! error TS2322: Types of parameters 'item' and 'item' are incompatible. +!!! error TS2322: Type 'T' is not assignable to type 'U'. y = x; // Shound be an error ~ -!!! error TS2323: Type '(item: U) => boolean' is not assignable to type '(item: T) => boolean'. -!!! error TS2323: Types of parameters 'item' and 'item' are incompatible. -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type '(item: U) => boolean' is not assignable to type '(item: T) => boolean'. +!!! error TS2322: Types of parameters 'item' and 'item' are incompatible. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence3.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence3.errors.txt index 59ac7d39e26..1f126d7c00d 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence3.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence3.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/typeParameterArgumentEquivalence3.ts(4,5): error TS2323: Type '(item: any) => boolean' is not assignable to type '(item: any) => T'. +tests/cases/compiler/typeParameterArgumentEquivalence3.ts(4,5): error TS2322: Type '(item: any) => boolean' is not assignable to type '(item: any) => T'. Type 'boolean' is not assignable to type 'T'. -tests/cases/compiler/typeParameterArgumentEquivalence3.ts(5,5): error TS2323: Type '(item: any) => T' is not assignable to type '(item: any) => boolean'. +tests/cases/compiler/typeParameterArgumentEquivalence3.ts(5,5): error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => boolean'. Type 'T' is not assignable to type 'boolean'. @@ -10,11 +10,11 @@ tests/cases/compiler/typeParameterArgumentEquivalence3.ts(5,5): error TS2323: Ty var y: (item) => boolean; x = y; // Should be an error ~ -!!! error TS2323: Type '(item: any) => boolean' is not assignable to type '(item: any) => T'. -!!! error TS2323: Type 'boolean' is not assignable to type 'T'. +!!! error TS2322: Type '(item: any) => boolean' is not assignable to type '(item: any) => T'. +!!! error TS2322: Type 'boolean' is not assignable to type 'T'. y = x; // Shound be an error ~ -!!! error TS2323: Type '(item: any) => T' is not assignable to type '(item: any) => boolean'. -!!! error TS2323: Type 'T' is not assignable to type 'boolean'. +!!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => boolean'. +!!! error TS2322: Type 'T' is not assignable to type 'boolean'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence4.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence4.errors.txt index f62a5a0e4e7..c7b19e8725c 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence4.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence4.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/typeParameterArgumentEquivalence4.ts(4,5): error TS2323: Type '(item: any) => T' is not assignable to type '(item: any) => U'. +tests/cases/compiler/typeParameterArgumentEquivalence4.ts(4,5): error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => U'. Type 'T' is not assignable to type 'U'. -tests/cases/compiler/typeParameterArgumentEquivalence4.ts(5,5): error TS2323: Type '(item: any) => U' is not assignable to type '(item: any) => T'. +tests/cases/compiler/typeParameterArgumentEquivalence4.ts(5,5): error TS2322: Type '(item: any) => U' is not assignable to type '(item: any) => T'. Type 'U' is not assignable to type 'T'. @@ -10,11 +10,11 @@ tests/cases/compiler/typeParameterArgumentEquivalence4.ts(5,5): error TS2323: Ty var y: (item) => T; x = y; // Should be an error ~ -!!! error TS2323: Type '(item: any) => T' is not assignable to type '(item: any) => U'. -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. y = x; // Shound be an error ~ -!!! error TS2323: Type '(item: any) => U' is not assignable to type '(item: any) => T'. -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type '(item: any) => U' is not assignable to type '(item: any) => T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterArgumentEquivalence5.errors.txt b/tests/baselines/reference/typeParameterArgumentEquivalence5.errors.txt index 41d0162af5b..82290733a9e 100644 --- a/tests/baselines/reference/typeParameterArgumentEquivalence5.errors.txt +++ b/tests/baselines/reference/typeParameterArgumentEquivalence5.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/typeParameterArgumentEquivalence5.ts(4,5): error TS2323: Type '() => (item: any) => T' is not assignable to type '() => (item: any) => U'. +tests/cases/compiler/typeParameterArgumentEquivalence5.ts(4,5): error TS2322: Type '() => (item: any) => T' is not assignable to type '() => (item: any) => U'. Type '(item: any) => T' is not assignable to type '(item: any) => U'. Type 'T' is not assignable to type 'U'. -tests/cases/compiler/typeParameterArgumentEquivalence5.ts(5,5): error TS2323: Type '() => (item: any) => U' is not assignable to type '() => (item: any) => T'. +tests/cases/compiler/typeParameterArgumentEquivalence5.ts(5,5): error TS2322: Type '() => (item: any) => U' is not assignable to type '() => (item: any) => T'. Type '(item: any) => U' is not assignable to type '(item: any) => T'. Type 'U' is not assignable to type 'T'. @@ -12,13 +12,13 @@ tests/cases/compiler/typeParameterArgumentEquivalence5.ts(5,5): error TS2323: Ty var y: () => (item) => T; x = y; // Should be an error ~ -!!! error TS2323: Type '() => (item: any) => T' is not assignable to type '() => (item: any) => U'. -!!! error TS2323: Type '(item: any) => T' is not assignable to type '(item: any) => U'. -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type '() => (item: any) => T' is not assignable to type '() => (item: any) => U'. +!!! error TS2322: Type '(item: any) => T' is not assignable to type '(item: any) => U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. y = x; // Shound be an error ~ -!!! error TS2323: Type '() => (item: any) => U' is not assignable to type '() => (item: any) => T'. -!!! error TS2323: Type '(item: any) => U' is not assignable to type '(item: any) => T'. -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type '() => (item: any) => U' is not assignable to type '() => (item: any) => T'. +!!! error TS2322: Type '(item: any) => U' is not assignable to type '(item: any) => T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAssignability.errors.txt b/tests/baselines/reference/typeParameterAssignability.errors.txt index 34032da1d06..0e8546097d0 100644 --- a/tests/baselines/reference/typeParameterAssignability.errors.txt +++ b/tests/baselines/reference/typeParameterAssignability.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability.ts(4,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability.ts(5,5): error TS2323: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability.ts(5,5): error TS2322: Type 'T' is not assignable to type 'U'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability.ts (2 errors) ==== @@ -8,8 +8,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara function foo(t: T, u: U) { t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. u = t; // error ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAssignability2.errors.txt b/tests/baselines/reference/typeParameterAssignability2.errors.txt index 8fe620cae88..b3cc924d419 100644 --- a/tests/baselines/reference/typeParameterAssignability2.errors.txt +++ b/tests/baselines/reference/typeParameterAssignability2.errors.txt @@ -1,50 +1,50 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(3,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(4,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(5,5): error TS2323: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(5,5): error TS2322: Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(8,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(9,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(10,5): error TS2323: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(9,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(10,5): error TS2322: Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(13,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(13,28): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(14,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(15,5): error TS2323: Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(17,5): error TS2323: Type 'V' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(18,5): error TS2323: Type 'T' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(20,5): error TS2323: Type 'V' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(21,5): error TS2323: Type 'U' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(14,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(15,5): error TS2322: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(17,5): error TS2322: Type 'V' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(18,5): error TS2322: Type 'T' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(20,5): error TS2322: Type 'V' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(21,5): error TS2322: Type 'U' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(24,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(24,28): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(25,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(26,5): error TS2323: Type 'V' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(27,5): error TS2323: Type 'Date' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(29,5): error TS2323: Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(30,5): error TS2323: Type 'V' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(31,5): error TS2323: Type 'Date' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(33,5): error TS2323: Type 'T' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(34,5): error TS2323: Type 'U' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(35,5): error TS2323: Type 'Date' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(38,5): error TS2323: Type 'T' is not assignable to type 'Date'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(39,5): error TS2323: Type 'U' is not assignable to type 'Date'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(25,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(26,5): error TS2322: Type 'V' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(27,5): error TS2322: Type 'Date' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(29,5): error TS2322: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(30,5): error TS2322: Type 'V' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(31,5): error TS2322: Type 'Date' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(33,5): error TS2322: Type 'T' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(34,5): error TS2322: Type 'U' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(35,5): error TS2322: Type 'Date' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(38,5): error TS2322: Type 'T' is not assignable to type 'Date'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(39,5): error TS2322: Type 'U' is not assignable to type 'Date'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(44,31): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(44,44): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(45,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(46,5): error TS2323: Type 'V' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(47,5): error TS2323: Type 'Date' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(49,5): error TS2323: Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(50,5): error TS2323: Type 'V' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(51,5): error TS2323: Type 'Date' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(53,5): error TS2323: Type 'T' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(54,5): error TS2323: Type 'U' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(55,5): error TS2323: Type 'Date' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(58,5): error TS2323: Type 'T' is not assignable to type 'Date'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(59,5): error TS2323: Type 'U' is not assignable to type 'Date'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(45,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(46,5): error TS2322: Type 'V' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(47,5): error TS2322: Type 'Date' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(49,5): error TS2322: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(50,5): error TS2322: Type 'V' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(51,5): error TS2322: Type 'Date' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(53,5): error TS2322: Type 'T' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(54,5): error TS2322: Type 'U' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(55,5): error TS2322: Type 'Date' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(58,5): error TS2322: Type 'T' is not assignable to type 'Date'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(59,5): error TS2322: Type 'U' is not assignable to type 'Date'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(63,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(64,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(65,5): error TS2323: Type 'V' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(67,5): error TS2323: Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(68,5): error TS2323: Type 'V' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(70,5): error TS2323: Type 'T' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(71,5): error TS2323: Type 'U' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(64,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(65,5): error TS2322: Type 'V' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(67,5): error TS2322: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(68,5): error TS2322: Type 'V' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(70,5): error TS2322: Type 'T' is not assignable to type 'V'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(71,5): error TS2322: Type 'U' is not assignable to type 'V'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts (47 errors) ==== @@ -55,10 +55,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. u = t; // ok ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. } function foo2(t: T, u: U) { @@ -66,10 +66,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. u = t; // ok ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. } function foo3(t: T, u: U, v: V) { @@ -79,24 +79,24 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. u = t; ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. t = v; // error ~ -!!! error TS2323: Type 'V' is not assignable to type 'T'. +!!! error TS2322: Type 'V' is not assignable to type 'T'. v = t; // ok ~ -!!! error TS2323: Type 'T' is not assignable to type 'V'. +!!! error TS2322: Type 'T' is not assignable to type 'V'. u = v; // error ~ -!!! error TS2323: Type 'V' is not assignable to type 'U'. +!!! error TS2322: Type 'V' is not assignable to type 'U'. v = u; // ok ~ -!!! error TS2323: Type 'U' is not assignable to type 'V'. +!!! error TS2322: Type 'U' is not assignable to type 'V'. } function foo4(t: T, u: U, v: V) { @@ -106,41 +106,41 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. t = v; // error ~ -!!! error TS2323: Type 'V' is not assignable to type 'T'. +!!! error TS2322: Type 'V' is not assignable to type 'T'. t = new Date(); // error ~ -!!! error TS2323: Type 'Date' is not assignable to type 'T'. +!!! error TS2322: Type 'Date' is not assignable to type 'T'. u = t; ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. u = v; // error ~ -!!! error TS2323: Type 'V' is not assignable to type 'U'. +!!! error TS2322: Type 'V' is not assignable to type 'U'. u = new Date(); // error ~ -!!! error TS2323: Type 'Date' is not assignable to type 'U'. +!!! error TS2322: Type 'Date' is not assignable to type 'U'. v = t; ~ -!!! error TS2323: Type 'T' is not assignable to type 'V'. +!!! error TS2322: Type 'T' is not assignable to type 'V'. v = u; ~ -!!! error TS2323: Type 'U' is not assignable to type 'V'. +!!! error TS2322: Type 'U' is not assignable to type 'V'. v = new Date(); // ok ~ -!!! error TS2323: Type 'Date' is not assignable to type 'V'. +!!! error TS2322: Type 'Date' is not assignable to type 'V'. var d: Date; d = t; // ok ~ -!!! error TS2323: Type 'T' is not assignable to type 'Date'. +!!! error TS2322: Type 'T' is not assignable to type 'Date'. d = u; // ok ~ -!!! error TS2323: Type 'U' is not assignable to type 'Date'. +!!! error TS2322: Type 'U' is not assignable to type 'Date'. d = v; // ok } @@ -152,41 +152,41 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. t = v; // error ~ -!!! error TS2323: Type 'V' is not assignable to type 'T'. +!!! error TS2322: Type 'V' is not assignable to type 'T'. t = new Date(); // error ~ -!!! error TS2323: Type 'Date' is not assignable to type 'T'. +!!! error TS2322: Type 'Date' is not assignable to type 'T'. u = t; ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. u = v; // error ~ -!!! error TS2323: Type 'V' is not assignable to type 'U'. +!!! error TS2322: Type 'V' is not assignable to type 'U'. u = new Date(); // error ~ -!!! error TS2323: Type 'Date' is not assignable to type 'U'. +!!! error TS2322: Type 'Date' is not assignable to type 'U'. v = t; ~ -!!! error TS2323: Type 'T' is not assignable to type 'V'. +!!! error TS2322: Type 'T' is not assignable to type 'V'. v = u; ~ -!!! error TS2323: Type 'U' is not assignable to type 'V'. +!!! error TS2322: Type 'U' is not assignable to type 'V'. v = new Date(); // ok ~ -!!! error TS2323: Type 'Date' is not assignable to type 'V'. +!!! error TS2322: Type 'Date' is not assignable to type 'V'. var d: Date; d = t; // ok ~ -!!! error TS2323: Type 'T' is not assignable to type 'Date'. +!!! error TS2322: Type 'T' is not assignable to type 'Date'. d = u; // ok ~ -!!! error TS2323: Type 'U' is not assignable to type 'Date'. +!!! error TS2322: Type 'U' is not assignable to type 'Date'. d = v; // ok } @@ -195,22 +195,22 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. t = v; // error ~ -!!! error TS2323: Type 'V' is not assignable to type 'T'. +!!! error TS2322: Type 'V' is not assignable to type 'T'. u = t; // ok ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. u = v; // error ~ -!!! error TS2323: Type 'V' is not assignable to type 'U'. +!!! error TS2322: Type 'V' is not assignable to type 'U'. v = t; // error ~ -!!! error TS2323: Type 'T' is not assignable to type 'V'. +!!! error TS2322: Type 'T' is not assignable to type 'V'. v = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'V'. +!!! error TS2322: Type 'U' is not assignable to type 'V'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAssignability3.errors.txt b/tests/baselines/reference/typeParameterAssignability3.errors.txt index c5152a1e3fd..7dbb24ef643 100644 --- a/tests/baselines/reference/typeParameterAssignability3.errors.txt +++ b/tests/baselines/reference/typeParameterAssignability3.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(14,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(15,5): error TS2323: Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(22,9): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(23,9): error TS2323: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(14,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(15,5): error TS2322: Type 'T' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(22,9): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts(23,9): error TS2322: Type 'T' is not assignable to type 'U'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability3.ts (4 errors) ==== @@ -20,10 +20,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara t = u; // error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. u = t; // error ~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. } class C { @@ -32,9 +32,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara r = () => { this.t = this.u; // error ~~~~~~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. this.u = this.t; // error ~~~~~~ -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. } } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAssignmentCompat1.errors.txt b/tests/baselines/reference/typeParameterAssignmentCompat1.errors.txt index a2692184aff..d3bc25c00b1 100644 --- a/tests/baselines/reference/typeParameterAssignmentCompat1.errors.txt +++ b/tests/baselines/reference/typeParameterAssignmentCompat1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/typeParameterAssignmentCompat1.ts(8,5): error TS2323: Type 'Foo' is not assignable to type 'Foo'. +tests/cases/compiler/typeParameterAssignmentCompat1.ts(8,5): error TS2322: Type 'Foo' is not assignable to type 'Foo'. Type 'U' is not assignable to type 'T'. -tests/cases/compiler/typeParameterAssignmentCompat1.ts(9,12): error TS2323: Type 'Foo' is not assignable to type 'Foo'. +tests/cases/compiler/typeParameterAssignmentCompat1.ts(9,12): error TS2322: Type 'Foo' is not assignable to type 'Foo'. Type 'T' is not assignable to type 'U'. -tests/cases/compiler/typeParameterAssignmentCompat1.ts(16,9): error TS2323: Type 'Foo' is not assignable to type 'Foo'. +tests/cases/compiler/typeParameterAssignmentCompat1.ts(16,9): error TS2322: Type 'Foo' is not assignable to type 'Foo'. Type 'U' is not assignable to type 'T'. -tests/cases/compiler/typeParameterAssignmentCompat1.ts(17,16): error TS2323: Type 'Foo' is not assignable to type 'Foo'. +tests/cases/compiler/typeParameterAssignmentCompat1.ts(17,16): error TS2322: Type 'Foo' is not assignable to type 'Foo'. Type 'T' is not assignable to type 'U'. @@ -18,12 +18,12 @@ tests/cases/compiler/typeParameterAssignmentCompat1.ts(17,16): error TS2323: Typ var y: Foo; x = y; // should be an error ~ -!!! error TS2323: Type 'Foo' is not assignable to type 'Foo'. -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'Foo' is not assignable to type 'Foo'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return x; ~ -!!! error TS2323: Type 'Foo' is not assignable to type 'Foo'. -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'Foo' is not assignable to type 'Foo'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. } class C { @@ -32,11 +32,11 @@ tests/cases/compiler/typeParameterAssignmentCompat1.ts(17,16): error TS2323: Typ var y: Foo; x = y; // should be an error ~ -!!! error TS2323: Type 'Foo' is not assignable to type 'Foo'. -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'Foo' is not assignable to type 'Foo'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return x; ~ -!!! error TS2323: Type 'Foo' is not assignable to type 'Foo'. -!!! error TS2323: Type 'T' is not assignable to type 'U'. +!!! error TS2322: Type 'Foo' is not assignable to type 'Foo'. +!!! error TS2322: Type 'T' is not assignable to type 'U'. } } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAssignmentWithConstraints.errors.txt b/tests/baselines/reference/typeParameterAssignmentWithConstraints.errors.txt index c3b552b2057..3ada2e3c375 100644 --- a/tests/baselines/reference/typeParameterAssignmentWithConstraints.errors.txt +++ b/tests/baselines/reference/typeParameterAssignmentWithConstraints.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/typeParameterAssignmentWithConstraints.ts(1,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/typeParameterAssignmentWithConstraints.ts(4,5): error TS2323: Type 'B' is not assignable to type 'A'. +tests/cases/compiler/typeParameterAssignmentWithConstraints.ts(4,5): error TS2322: Type 'B' is not assignable to type 'A'. ==== tests/cases/compiler/typeParameterAssignmentWithConstraints.ts (2 errors) ==== @@ -10,5 +10,5 @@ tests/cases/compiler/typeParameterAssignmentWithConstraints.ts(4,5): error TS232 var b: B; a = b; // Error: Can't convert B to A ~ -!!! error TS2323: Type 'B' is not assignable to type 'A'. +!!! error TS2322: Type 'B' is not assignable to type 'A'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterHasSelfAsConstraint.errors.txt b/tests/baselines/reference/typeParameterHasSelfAsConstraint.errors.txt index c109e612913..409aa5ebfb6 100644 --- a/tests/baselines/reference/typeParameterHasSelfAsConstraint.errors.txt +++ b/tests/baselines/reference/typeParameterHasSelfAsConstraint.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/typeParameterHasSelfAsConstraint.ts(1,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/typeParameterHasSelfAsConstraint.ts(2,12): error TS2323: Type 'T' is not assignable to type 'number'. +tests/cases/compiler/typeParameterHasSelfAsConstraint.ts(2,12): error TS2322: Type 'T' is not assignable to type 'number'. ==== tests/cases/compiler/typeParameterHasSelfAsConstraint.ts (2 errors) ==== @@ -8,7 +8,7 @@ tests/cases/compiler/typeParameterHasSelfAsConstraint.ts(2,12): error TS2323: Ty !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. return x; ~ -!!! error TS2323: Type 'T' is not assignable to type 'number'. +!!! error TS2322: Type 'T' is not assignable to type 'number'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint.errors.txt b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint.errors.txt index a1b2886911d..9860b9ac59f 100644 --- a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint.errors.txt +++ b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint.errors.txt @@ -1,21 +1,21 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(3,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(4,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(5,12): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(5,12): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(8,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(9,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(10,12): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(9,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(10,12): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(13,22): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(14,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(15,12): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(14,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(15,12): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(18,20): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(19,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(20,12): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(19,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(20,12): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(23,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(24,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(25,12): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(24,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(25,12): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(28,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(29,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(30,12): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(29,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(30,12): error TS2322: Type 'U' is not assignable to type 'T'. ==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts (18 errors) ==== @@ -26,10 +26,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } function foo2(x: T, y: U): T { @@ -37,10 +37,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } var f = function (x: T, y: U): T { @@ -48,10 +48,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } var f2 = function (x: T, y: U): T { @@ -59,10 +59,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } var f3 = (x: T, y: U): T => { @@ -70,10 +70,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } var f4 = (x: T, y: U): T => { @@ -81,8 +81,8 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed !!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint2.errors.txt b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint2.errors.txt index e349962121f..12b90ac8525 100644 --- a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint2.errors.txt +++ b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint2.errors.txt @@ -1,21 +1,21 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(4,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(7,13): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(8,20): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(7,13): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(8,20): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(13,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(16,13): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(17,20): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(16,13): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(17,20): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(22,22): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(25,13): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(26,20): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(25,13): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(26,20): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(31,20): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(34,13): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(35,20): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(34,13): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(35,20): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(40,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(43,13): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(44,20): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(43,13): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(44,20): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(49,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(52,13): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(53,20): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(52,13): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(53,20): error TS2322: Type 'U' is not assignable to type 'T'. ==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts (18 errors) ==== @@ -29,10 +29,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed function baz(a: X, b: Y): T { x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } @@ -44,10 +44,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed function baz(a: X, b: Y): T { x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } @@ -59,10 +59,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed var g = function (a: X, b: Y): T { x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } @@ -74,10 +74,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed var g = function baz(a: X, b: Y): T { x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } @@ -89,10 +89,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed var g = (a: X, b: Y): T => { x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } @@ -104,10 +104,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed var g = (a: X, b: Y): T => { x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.errors.txt b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.errors.txt index 97b4754a874..983f2798554 100644 --- a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.errors.txt +++ b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(4,12): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(4,25): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(5,8): error TS2304: Cannot find name 'W'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(8,16): error TS2323: Type 'W' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(8,16): error TS2322: Type 'W' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(12,16): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(12,29): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(15,8): error TS2304: Cannot find name 'W'. @@ -10,20 +10,20 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(19,43): 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/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(20,47): error TS2304: Cannot find name 'X'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(20,47): 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/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(22,13): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(23,20): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(22,13): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(23,20): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(28,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(28,44): error TS2304: Cannot find name 'W'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(28,44): 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/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(29,47): error TS2304: Cannot find name 'Y'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(29,47): 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/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(31,13): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(32,20): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(31,13): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(32,20): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(37,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(38,47): error TS2304: Cannot find name 'X'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(38,53): error TS2304: Cannot find name 'Y'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(40,13): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(41,20): error TS2323: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(40,13): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(41,20): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(46,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(46,30): error TS2304: Cannot find name 'V'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(46,36): error TS2304: Cannot find name 'X'. @@ -45,7 +45,7 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed var r: T; return x; ~ -!!! error TS2323: Type 'W' is not assignable to type 'T'. +!!! error TS2322: Type 'W' is not assignable to type 'T'. } } @@ -77,10 +77,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed function baz(a: X, b: Y): T { x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } @@ -100,10 +100,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed function baz(a: X, b: Y): T { x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } @@ -119,10 +119,10 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed var g = (a: X, b: Y): T => { x = y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } diff --git a/tests/baselines/reference/typeParametersShouldNotBeEqual.errors.txt b/tests/baselines/reference/typeParametersShouldNotBeEqual.errors.txt index 77579ef752b..6f5e2766c8c 100644 --- a/tests/baselines/reference/typeParametersShouldNotBeEqual.errors.txt +++ b/tests/baselines/reference/typeParametersShouldNotBeEqual.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/typeParametersShouldNotBeEqual.ts(4,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/compiler/typeParametersShouldNotBeEqual.ts(5,5): error TS2323: Type 'Object' is not assignable to type 'T'. +tests/cases/compiler/typeParametersShouldNotBeEqual.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/compiler/typeParametersShouldNotBeEqual.ts(5,5): error TS2322: Type 'Object' is not assignable to type 'T'. ==== tests/cases/compiler/typeParametersShouldNotBeEqual.ts (2 errors) ==== @@ -8,10 +8,10 @@ tests/cases/compiler/typeParametersShouldNotBeEqual.ts(5,5): error TS2323: Type x = x; // Ok x = y; // Error ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. x = z; // Error ~ -!!! error TS2323: Type 'Object' is not assignable to type 'T'. +!!! error TS2322: Type 'Object' is not assignable to type 'T'. z = x; // Ok } \ No newline at end of file diff --git a/tests/baselines/reference/typeParametersShouldNotBeEqual2.errors.txt b/tests/baselines/reference/typeParametersShouldNotBeEqual2.errors.txt index 7330fdb35f6..0d9375140ab 100644 --- a/tests/baselines/reference/typeParametersShouldNotBeEqual2.errors.txt +++ b/tests/baselines/reference/typeParametersShouldNotBeEqual2.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(4,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(5,5): error TS2323: Type 'V' is not assignable to type 'T'. -tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(6,5): error TS2323: Type 'T' is not assignable to type 'V'. -tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(7,5): error TS2323: Type 'V' is not assignable to type 'U'. -tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(8,5): error TS2323: Type 'U' is not assignable to type 'V'. -tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(9,5): error TS2323: Type 'Object' is not assignable to type 'T'. +tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(5,5): error TS2322: Type 'V' is not assignable to type 'T'. +tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(6,5): error TS2322: Type 'T' is not assignable to type 'V'. +tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(7,5): error TS2322: Type 'V' is not assignable to type 'U'. +tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(8,5): error TS2322: Type 'U' is not assignable to type 'V'. +tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(9,5): error TS2322: Type 'Object' is not assignable to type 'T'. ==== tests/cases/compiler/typeParametersShouldNotBeEqual2.ts (6 errors) ==== @@ -12,22 +12,22 @@ tests/cases/compiler/typeParametersShouldNotBeEqual2.ts(9,5): error TS2323: Type x = x; // Ok x = y; // Ok ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. x = z; // Error ~ -!!! error TS2323: Type 'V' is not assignable to type 'T'. +!!! error TS2322: Type 'V' is not assignable to type 'T'. z = x; // Error ~ -!!! error TS2323: Type 'T' is not assignable to type 'V'. +!!! error TS2322: Type 'T' is not assignable to type 'V'. y = z; // Error ~ -!!! error TS2323: Type 'V' is not assignable to type 'U'. +!!! error TS2322: Type 'V' is not assignable to type 'U'. z = y; // Error ~ -!!! error TS2323: Type 'U' is not assignable to type 'V'. +!!! error TS2322: Type 'U' is not assignable to type 'V'. x = zz; // Error ~ -!!! error TS2323: Type 'Object' is not assignable to type 'T'. +!!! error TS2322: Type 'Object' is not assignable to type 'T'. zz = x; // Ok } \ No newline at end of file diff --git a/tests/baselines/reference/typeParametersShouldNotBeEqual3.errors.txt b/tests/baselines/reference/typeParametersShouldNotBeEqual3.errors.txt index 04509cd14a8..5b1a8e9ae7e 100644 --- a/tests/baselines/reference/typeParametersShouldNotBeEqual3.errors.txt +++ b/tests/baselines/reference/typeParametersShouldNotBeEqual3.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/typeParametersShouldNotBeEqual3.ts(4,5): error TS2323: Type 'U' is not assignable to type 'T'. -tests/cases/compiler/typeParametersShouldNotBeEqual3.ts(5,5): error TS2323: Type 'Object' is not assignable to type 'T'. +tests/cases/compiler/typeParametersShouldNotBeEqual3.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'. +tests/cases/compiler/typeParametersShouldNotBeEqual3.ts(5,5): error TS2322: Type 'Object' is not assignable to type 'T'. ==== tests/cases/compiler/typeParametersShouldNotBeEqual3.ts (2 errors) ==== @@ -8,10 +8,10 @@ tests/cases/compiler/typeParametersShouldNotBeEqual3.ts(5,5): error TS2323: Type x = x; // Ok x = y; // Ok ~ -!!! error TS2323: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. x = z; // Ok ~ -!!! error TS2323: Type 'Object' is not assignable to type 'T'. +!!! error TS2322: Type 'Object' is not assignable to type 'T'. z = x; // Ok } \ No newline at end of file diff --git a/tests/baselines/reference/typeofAmbientExternalModules.errors.txt b/tests/baselines/reference/typeofAmbientExternalModules.errors.txt index 007581e54f2..cde3247b7cd 100644 --- a/tests/baselines/reference/typeofAmbientExternalModules.errors.txt +++ b/tests/baselines/reference/typeofAmbientExternalModules.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/typeofAmbientExternalModules_2.ts(7,1): error TS2323: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"'. +tests/cases/compiler/typeofAmbientExternalModules_2.ts(7,1): error TS2322: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"'. Property 'C' is missing in type 'typeof D'. -tests/cases/compiler/typeofAmbientExternalModules_2.ts(9,1): error TS2323: Type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"' is not assignable to type 'typeof D'. +tests/cases/compiler/typeofAmbientExternalModules_2.ts(9,1): error TS2322: Type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"' is not assignable to type 'typeof D'. Property 'prototype' is missing in type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"'. @@ -13,13 +13,13 @@ tests/cases/compiler/typeofAmbientExternalModules_2.ts(9,1): error TS2323: Type var y1: typeof ext = ext; y1 = exp; ~~ -!!! error TS2323: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"'. -!!! error TS2323: Property 'C' is missing in type 'typeof D'. +!!! error TS2322: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"'. +!!! error TS2322: Property 'C' is missing in type 'typeof D'. var y2: typeof exp = exp; y2 = ext; ~~ -!!! error TS2323: Type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"' is not assignable to type 'typeof D'. -!!! error TS2323: Property 'prototype' is missing in type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"'. +!!! error TS2322: Type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"' is not assignable to type 'typeof D'. +!!! error TS2322: Property 'prototype' is missing in type 'typeof "tests/cases/compiler/typeofAmbientExternalModules_0"'. ==== tests/cases/compiler/typeofAmbientExternalModules_0.ts (0 errors) ==== export class C { foo: string; } diff --git a/tests/baselines/reference/typeofExternalModules.errors.txt b/tests/baselines/reference/typeofExternalModules.errors.txt index a7610f299da..05b56c9fe1b 100644 --- a/tests/baselines/reference/typeofExternalModules.errors.txt +++ b/tests/baselines/reference/typeofExternalModules.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/typeofExternalModules_core.ts(5,1): error TS2323: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofExternalModules_external"'. +tests/cases/compiler/typeofExternalModules_core.ts(5,1): error TS2322: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofExternalModules_external"'. Property 'C' is missing in type 'typeof D'. -tests/cases/compiler/typeofExternalModules_core.ts(7,1): error TS2323: Type 'typeof "tests/cases/compiler/typeofExternalModules_external"' is not assignable to type 'typeof D'. +tests/cases/compiler/typeofExternalModules_core.ts(7,1): error TS2322: Type 'typeof "tests/cases/compiler/typeofExternalModules_external"' is not assignable to type 'typeof D'. Property 'prototype' is missing in type 'typeof "tests/cases/compiler/typeofExternalModules_external"'. @@ -11,13 +11,13 @@ tests/cases/compiler/typeofExternalModules_core.ts(7,1): error TS2323: Type 'typ var y1: typeof ext = ext; y1 = exp; ~~ -!!! error TS2323: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofExternalModules_external"'. -!!! error TS2323: Property 'C' is missing in type 'typeof D'. +!!! error TS2322: Type 'typeof D' is not assignable to type 'typeof "tests/cases/compiler/typeofExternalModules_external"'. +!!! error TS2322: Property 'C' is missing in type 'typeof D'. var y2: typeof exp = exp; y2 = ext; ~~ -!!! error TS2323: Type 'typeof "tests/cases/compiler/typeofExternalModules_external"' is not assignable to type 'typeof D'. -!!! error TS2323: Property 'prototype' is missing in type 'typeof "tests/cases/compiler/typeofExternalModules_external"'. +!!! error TS2322: Type 'typeof "tests/cases/compiler/typeofExternalModules_external"' is not assignable to type 'typeof D'. +!!! error TS2322: Property 'prototype' is missing in type 'typeof "tests/cases/compiler/typeofExternalModules_external"'. ==== tests/cases/compiler/typeofExternalModules_external.ts (0 errors) ==== export class C { } diff --git a/tests/baselines/reference/typeofInternalModules.errors.txt b/tests/baselines/reference/typeofInternalModules.errors.txt index 7743f70946f..c98456c3404 100644 --- a/tests/baselines/reference/typeofInternalModules.errors.txt +++ b/tests/baselines/reference/typeofInternalModules.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/typeofInternalModules.ts(15,16): error TS2304: Cannot find name 'importUninst'. tests/cases/compiler/typeofInternalModules.ts(17,9): error TS2304: Cannot find name 'Outer'. -tests/cases/compiler/typeofInternalModules.ts(19,1): error TS2323: Type 'typeof Outer' is not assignable to type 'typeof instantiated'. +tests/cases/compiler/typeofInternalModules.ts(19,1): error TS2322: Type 'typeof Outer' is not assignable to type 'typeof instantiated'. Property 'C' is missing in type 'typeof Outer'. tests/cases/compiler/typeofInternalModules.ts(21,16): error TS2304: Cannot find name 'importUninst'. -tests/cases/compiler/typeofInternalModules.ts(23,1): error TS2323: Type 'typeof instantiated' is not assignable to type 'typeof Outer'. +tests/cases/compiler/typeofInternalModules.ts(23,1): error TS2322: Type 'typeof instantiated' is not assignable to type 'typeof Outer'. Property 'instantiated' is missing in type 'typeof instantiated'. @@ -32,8 +32,8 @@ tests/cases/compiler/typeofInternalModules.ts(23,1): error TS2323: Type 'typeof var x5: typeof importInst; x5 = Outer; ~~ -!!! error TS2323: Type 'typeof Outer' is not assignable to type 'typeof instantiated'. -!!! error TS2323: Property 'C' is missing in type 'typeof Outer'. +!!! error TS2322: Type 'typeof Outer' is not assignable to type 'typeof instantiated'. +!!! error TS2322: Property 'C' is missing in type 'typeof Outer'. x5 = Outer.instantiated; var x6: typeof importUninst; ~~~~~~~~~~~~ @@ -41,6 +41,6 @@ tests/cases/compiler/typeofInternalModules.ts(23,1): error TS2323: Type 'typeof var x7: typeof Outer = Outer; x7 = importInst; ~~ -!!! error TS2323: Type 'typeof instantiated' is not assignable to type 'typeof Outer'. -!!! error TS2323: Property 'instantiated' is missing in type 'typeof instantiated'. +!!! error TS2322: Type 'typeof instantiated' is not assignable to type 'typeof Outer'. +!!! error TS2322: Property 'instantiated' is missing in type 'typeof instantiated'. \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithEnumType.js b/tests/baselines/reference/typeofOperatorWithEnumType.js index 272feacf63d..900b610cef4 100644 --- a/tests/baselines/reference/typeofOperatorWithEnumType.js +++ b/tests/baselines/reference/typeofOperatorWithEnumType.js @@ -44,15 +44,15 @@ var ENUM1; var ResultIsString1 = typeof ENUM; var ResultIsString2 = typeof ENUM1; // enum type expressions -var ResultIsString3 = typeof ENUM1["A"]; -var ResultIsString4 = typeof (ENUM[0] + ENUM1["B"]); +var ResultIsString3 = typeof 0 /* "A" */; +var ResultIsString4 = typeof (ENUM[0] + 1 /* "B" */); // multiple typeof operators var ResultIsString5 = typeof typeof ENUM; var ResultIsString6 = typeof typeof typeof (ENUM[0] + 1 /* B */); // miss assignment operators typeof ENUM; typeof ENUM1; -typeof ENUM1["B"]; +typeof 1 /* "B" */; typeof ENUM, ENUM1; // use typeof in type query var z; diff --git a/tests/baselines/reference/typeofSimple.errors.txt b/tests/baselines/reference/typeofSimple.errors.txt index a978782d399..845a9fbbce3 100644 --- a/tests/baselines/reference/typeofSimple.errors.txt +++ b/tests/baselines/reference/typeofSimple.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeofSimple.ts(3,5): error TS2323: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/typeofSimple.ts(3,5): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/typeofSimple.ts(8,21): error TS2304: Cannot find name 'J'. @@ -7,7 +7,7 @@ tests/cases/compiler/typeofSimple.ts(8,21): error TS2304: Cannot find name 'J'. var v2: typeof v; var v3: string = v2; // Not assignment compatible ~~ -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. interface I { x: T; } interface J { } diff --git a/tests/baselines/reference/typesOnlyExternalModuleStillHasInstance.errors.txt b/tests/baselines/reference/typesOnlyExternalModuleStillHasInstance.errors.txt index d90944c906a..4af38220c07 100644 --- a/tests/baselines/reference/typesOnlyExternalModuleStillHasInstance.errors.txt +++ b/tests/baselines/reference/typesOnlyExternalModuleStillHasInstance.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/externalModules/foo_1.ts(5,5): error TS2323: Type 'typeof "tests/cases/conformance/externalModules/foo_0"' is not assignable to type '{ M2: Object; }'. +tests/cases/conformance/externalModules/foo_1.ts(5,5): error TS2322: Type 'typeof "tests/cases/conformance/externalModules/foo_0"' is not assignable to type '{ M2: Object; }'. Property 'M2' is missing in type 'typeof "tests/cases/conformance/externalModules/foo_0"'. @@ -9,8 +9,8 @@ tests/cases/conformance/externalModules/foo_1.ts(5,5): error TS2323: Type 'typeo var x: typeof foo0 = {}; var y: {M2: Object} = foo0; ~ -!!! error TS2323: Type 'typeof "tests/cases/conformance/externalModules/foo_0"' is not assignable to type '{ M2: Object; }'. -!!! error TS2323: Property 'M2' is missing in type 'typeof "tests/cases/conformance/externalModules/foo_0"'. +!!! error TS2322: Type 'typeof "tests/cases/conformance/externalModules/foo_0"' is not assignable to type '{ M2: Object; }'. +!!! error TS2322: Property 'M2' is missing in type 'typeof "tests/cases/conformance/externalModules/foo_0"'. ==== tests/cases/conformance/externalModules/foo_0.ts (0 errors) ==== export interface Person { diff --git a/tests/baselines/reference/typesWithPrivateConstructor.errors.txt b/tests/baselines/reference/typesWithPrivateConstructor.errors.txt index 6e259a66925..010831effe8 100644 --- a/tests/baselines/reference/typesWithPrivateConstructor.errors.txt +++ b/tests/baselines/reference/typesWithPrivateConstructor.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(4,5): error TS1089: 'private' modifier cannot appear on a constructor declaration. tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(11,5): error TS1089: 'private' modifier cannot appear on a constructor declaration. tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(12,5): error TS1089: 'private' modifier cannot appear on a constructor declaration. -tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(8,5): error TS2323: Type 'Function' is not assignable to type '() => void'. +tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(8,5): error TS2322: Type 'Function' is not assignable to type '() => void'. tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(15,10): error TS2346: Supplied parameters do not match any signature of call target. @@ -17,7 +17,7 @@ tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(15,10): err var c = new C(); var r: () => void = c.constructor; ~ -!!! error TS2323: Type 'Function' is not assignable to type '() => void'. +!!! error TS2322: Type 'Function' is not assignable to type '() => void'. class C2 { private constructor(x: number); diff --git a/tests/baselines/reference/typesWithPublicConstructor.errors.txt b/tests/baselines/reference/typesWithPublicConstructor.errors.txt index 562d0b255eb..a3d66c3520a 100644 --- a/tests/baselines/reference/typesWithPublicConstructor.errors.txt +++ b/tests/baselines/reference/typesWithPublicConstructor.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/members/typesWithPublicConstructor.ts(8,5): error TS2323: Type 'Function' is not assignable to type '() => void'. +tests/cases/conformance/types/members/typesWithPublicConstructor.ts(8,5): error TS2322: Type 'Function' is not assignable to type '() => void'. tests/cases/conformance/types/members/typesWithPublicConstructor.ts(15,10): error TS2346: Supplied parameters do not match any signature of call target. @@ -12,7 +12,7 @@ tests/cases/conformance/types/members/typesWithPublicConstructor.ts(15,10): erro var c = new C(); var r: () => void = c.constructor; ~ -!!! error TS2323: Type 'Function' is not assignable to type '() => void'. +!!! error TS2322: Type 'Function' is not assignable to type '() => void'. class C2 { public constructor(x: number); diff --git a/tests/baselines/reference/unionTypeInference.js b/tests/baselines/reference/unionTypeInference.js new file mode 100644 index 00000000000..bdaa340f6ea --- /dev/null +++ b/tests/baselines/reference/unionTypeInference.js @@ -0,0 +1,60 @@ +//// [unionTypeInference.ts] +// Verify that inferences made *to* a type parameter in a union type are secondary +// to inferences made directly to that type parameter + +function f(x: T, y: string|T): T { + return x; +} + +var a1: number; +var a1 = f(1, 2); +var a2: number; +var a2 = f(1, "hello"); +var a3: number; +var a3 = f(1, a1 || "hello"); +var a4: any; +var a4 = f(undefined, "abc"); + +function g(value: [string, T]): T { + return value[1]; +} + +var b1: boolean; +var b1 = g(["string", true]); + +function h(x: string|boolean|T): T { + return typeof x === "string" || typeof x === "boolean" ? undefined : x; +} + +var c1: number; +var c1 = h(5); +var c2: string; +var c2 = h("abc"); + + +//// [unionTypeInference.js] +// Verify that inferences made *to* a type parameter in a union type are secondary +// to inferences made directly to that type parameter +function f(x, y) { + return x; +} +var a1; +var a1 = f(1, 2); +var a2; +var a2 = f(1, "hello"); +var a3; +var a3 = f(1, a1 || "hello"); +var a4; +var a4 = f(undefined, "abc"); +function g(value) { + return value[1]; +} +var b1; +var b1 = g(["string", true]); +function h(x) { + return typeof x === "string" || typeof x === "boolean" ? undefined : x; +} +var c1; +var c1 = h(5); +var c2; +var c2 = h("abc"); diff --git a/tests/baselines/reference/unionTypeInference.types b/tests/baselines/reference/unionTypeInference.types new file mode 100644 index 00000000000..d685fc4ec6b --- /dev/null +++ b/tests/baselines/reference/unionTypeInference.types @@ -0,0 +1,109 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts === +// Verify that inferences made *to* a type parameter in a union type are secondary +// to inferences made directly to that type parameter + +function f(x: T, y: string|T): T { +>f : (x: T, y: string | T) => T +>T : T +>x : T +>T : T +>y : string | T +>T : T +>T : T + + return x; +>x : T +} + +var a1: number; +>a1 : number + +var a1 = f(1, 2); +>a1 : number +>f(1, 2) : number +>f : (x: T, y: string | T) => T + +var a2: number; +>a2 : number + +var a2 = f(1, "hello"); +>a2 : number +>f(1, "hello") : number +>f : (x: T, y: string | T) => T + +var a3: number; +>a3 : number + +var a3 = f(1, a1 || "hello"); +>a3 : number +>f(1, a1 || "hello") : number +>f : (x: T, y: string | T) => T +>a1 || "hello" : string | number +>a1 : number + +var a4: any; +>a4 : any + +var a4 = f(undefined, "abc"); +>a4 : any +>f(undefined, "abc") : any +>f : (x: T, y: string | T) => T +>undefined : undefined + +function g(value: [string, T]): T { +>g : (value: [string, T]) => T +>T : T +>value : [string, T] +>T : T +>T : T + + return value[1]; +>value[1] : T +>value : [string, T] +} + +var b1: boolean; +>b1 : boolean + +var b1 = g(["string", true]); +>b1 : boolean +>g(["string", true]) : boolean +>g : (value: [string, T]) => T +>["string", true] : [string, boolean] + +function h(x: string|boolean|T): T { +>h : (x: string | boolean | T) => T +>T : T +>x : string | boolean | T +>T : T +>T : T + + return typeof x === "string" || typeof x === "boolean" ? undefined : x; +>typeof x === "string" || typeof x === "boolean" ? undefined : x : T +>typeof x === "string" || typeof x === "boolean" : boolean +>typeof x === "string" : boolean +>typeof x : string +>x : string | boolean | T +>typeof x === "boolean" : boolean +>typeof x : string +>x : boolean | T +>undefined : undefined +>x : T +} + +var c1: number; +>c1 : number + +var c1 = h(5); +>c1 : number +>h(5) : number +>h : (x: string | boolean | T) => T + +var c2: string; +>c2 : string + +var c2 = h("abc"); +>c2 : string +>h("abc") : string +>h : (x: string | boolean | T) => T + diff --git a/tests/baselines/reference/voidOperatorWithEnumType.js b/tests/baselines/reference/voidOperatorWithEnumType.js index 8d20842ea7b..478ac85651b 100644 --- a/tests/baselines/reference/voidOperatorWithEnumType.js +++ b/tests/baselines/reference/voidOperatorWithEnumType.js @@ -39,13 +39,13 @@ var ENUM1; var ResultIsAny1 = void ENUM; var ResultIsAny2 = void ENUM1; // enum type expressions -var ResultIsAny3 = void ENUM1["A"]; -var ResultIsAny4 = void (ENUM[0] + ENUM1["B"]); +var ResultIsAny3 = void 0 /* "A" */; +var ResultIsAny4 = void (ENUM[0] + 1 /* "B" */); // multiple void operators var ResultIsAny5 = void void ENUM; var ResultIsAny6 = void void void (ENUM[0] + 1 /* B */); // miss assignment operators void ENUM; void ENUM1; -void ENUM1["B"]; +void 1 /* "B" */; void ENUM, ENUM1; diff --git a/tests/baselines/reference/widenToAny1.errors.txt b/tests/baselines/reference/widenToAny1.errors.txt index 940637008f4..082f93e00be 100644 --- a/tests/baselines/reference/widenToAny1.errors.txt +++ b/tests/baselines/reference/widenToAny1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/widenToAny1.ts(5,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/widenToAny1.ts(5,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/widenToAny1.ts (1 errors) ==== @@ -8,5 +8,5 @@ tests/cases/compiler/widenToAny1.ts(5,5): error TS2323: Type 'string' is not ass } var z1: number = foo1({ x: undefined, y: "def" }); // Best common type is any ~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/widenToAny2.errors.txt b/tests/baselines/reference/widenToAny2.errors.txt index cdd5e53ec1a..a931c592762 100644 --- a/tests/baselines/reference/widenToAny2.errors.txt +++ b/tests/baselines/reference/widenToAny2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/widenToAny2.ts(4,5): error TS2323: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/widenToAny2.ts(4,5): error TS2322: Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/widenToAny2.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/compiler/widenToAny2.ts(4,5): error TS2323: Type 'string' is not ass } var z3:number = foo3([undefined, "def"]); // Type is any, but should be string ~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/widenedTypes.errors.txt b/tests/baselines/reference/widenedTypes.errors.txt index c65e2873416..7374bd23b77 100644 --- a/tests/baselines/reference/widenedTypes.errors.txt +++ b/tests/baselines/reference/widenedTypes.errors.txt @@ -2,11 +2,11 @@ tests/cases/compiler/widenedTypes.ts(2,1): error TS2358: The left-hand side of a tests/cases/compiler/widenedTypes.ts(5,1): error TS2360: The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'. tests/cases/compiler/widenedTypes.ts(6,7): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter tests/cases/compiler/widenedTypes.ts(8,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. -tests/cases/compiler/widenedTypes.ts(11,1): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/widenedTypes.ts(18,1): error TS2323: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/widenedTypes.ts(23,5): error TS2323: Type 'number[]' is not assignable to type 'string[]'. +tests/cases/compiler/widenedTypes.ts(11,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/widenedTypes.ts(18,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/widenedTypes.ts(23,5): error TS2322: Type 'number[]' is not assignable to type 'string[]'. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/widenedTypes.ts(24,5): error TS2323: Type '{ [x: string]: number; x: number; y: null; }' is not assignable to type '{ [x: string]: string; }'. +tests/cases/compiler/widenedTypes.ts(24,5): error TS2322: Type '{ [x: string]: number; x: number; y: null; }' is not assignable to type '{ [x: string]: string; }'. Index signatures are incompatible. Type 'number' is not assignable to type 'string'. @@ -32,7 +32,7 @@ tests/cases/compiler/widenedTypes.ts(24,5): error TS2323: Type '{ [x: string]: n var t = [3, (3, null)]; t[3] = ""; ~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var x: typeof undefined = 3; x = 3; @@ -41,17 +41,17 @@ tests/cases/compiler/widenedTypes.ts(24,5): error TS2323: Type '{ [x: string]: n var u = [3, (y = null)]; u[3] = ""; ~~~~ -!!! error TS2323: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var ob: { x: typeof undefined } = { x: "" }; // Highlights the difference between array literals and object literals var arr: string[] = [3, null]; // not assignable because null is not widened. BCT is {} ~~~ -!!! error TS2323: Type 'number[]' is not assignable to type 'string[]'. -!!! error TS2323: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type 'number[]' is not assignable to type 'string[]'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. var obj: { [x: string]: string; } = { x: 3, y: null }; // assignable because null is widened, and therefore BCT is any ~~~ -!!! error TS2323: Type '{ [x: string]: number; x: number; y: null; }' is not assignable to type '{ [x: string]: string; }'. -!!! error TS2323: Index signatures are incompatible. -!!! error TS2323: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type '{ [x: string]: number; x: number; y: null; }' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2322: Index signatures are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt b/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt index 57a4d7e5bc2..5afc7361a23 100644 --- a/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt +++ b/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/wrappedRecursiveGenericType.ts(13,1): error TS2323: Type 'number' is not assignable to type 'X'. +tests/cases/compiler/wrappedRecursiveGenericType.ts(13,1): error TS2322: Type 'number' is not assignable to type 'X'. Property 'e' is missing in type 'Number'. -tests/cases/compiler/wrappedRecursiveGenericType.ts(14,1): error TS2323: Type 'number' is not assignable to type 'X'. +tests/cases/compiler/wrappedRecursiveGenericType.ts(14,1): error TS2322: Type 'number' is not assignable to type 'X'. ==== tests/cases/compiler/wrappedRecursiveGenericType.ts (2 errors) ==== @@ -18,8 +18,8 @@ tests/cases/compiler/wrappedRecursiveGenericType.ts(14,1): error TS2323: Type 'n x.a.val = 5; // val -> number x.a.b.val = 5; // val -> X (This should be an error) ~~~~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'X'. -!!! error TS2323: Property 'e' is missing in type 'Number'. +!!! error TS2322: Type 'number' is not assignable to type 'X'. +!!! error TS2322: Property 'e' is missing in type 'Number'. x.a.b.a.val = 5; // val -> X (This should be an error) ~~~~~~~~~~~ -!!! error TS2323: Type 'number' is not assignable to type 'X'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'X'. \ No newline at end of file diff --git a/tests/cases/compiler/constEnumDeclarations.ts b/tests/cases/compiler/constEnumDeclarations.ts new file mode 100644 index 00000000000..c3c11f55aa3 --- /dev/null +++ b/tests/cases/compiler/constEnumDeclarations.ts @@ -0,0 +1,13 @@ +// @declaration: true + +const enum E { + A = 1, + B = 2, + C = A | B +} + +const enum E2 { + A = 1, + B, + C +} \ No newline at end of file diff --git a/tests/cases/compiler/constEnumErrors.ts b/tests/cases/compiler/constEnumErrors.ts new file mode 100644 index 00000000000..87e6b7ccb98 --- /dev/null +++ b/tests/cases/compiler/constEnumErrors.ts @@ -0,0 +1,43 @@ +const enum E { + A +} + +module E { + var x = 1; +} + +const enum E1 { + // illegal case + // forward reference to the element of the same enum + X = Y, + // forward reference to the element of the same enum + Y = E1.Z, + Y1 = E1["Z"] +} + +const enum E2 { + A +} + +var y0 = E2[1] +var name = "A"; +var y1 = E2[name]; + +var x = E2; +var y = [E2]; + +function foo(t: any): void { +} + +foo(E2); + +const enum NaNOrInfinity { + A = 9007199254740992, + B = A * A, + C = B * B, + D = C * C, + E = D * D, + F = E * E, // overflow + G = 1 / 0, // overflow + H = 0 / 0 // NaN +} \ No newline at end of file diff --git a/tests/cases/compiler/constEnumExternalModule.ts b/tests/cases/compiler/constEnumExternalModule.ts new file mode 100644 index 00000000000..d15240fe64d --- /dev/null +++ b/tests/cases/compiler/constEnumExternalModule.ts @@ -0,0 +1,10 @@ +//@module: amd +//@Filename: m1.ts +const enum E { + V = 100 +} + +export = E +//@Filename: m2.ts +import A = require('m1') +var v = A.V; \ No newline at end of file diff --git a/tests/cases/compiler/constEnums.ts b/tests/cases/compiler/constEnums.ts new file mode 100644 index 00000000000..72b75a3f31e --- /dev/null +++ b/tests/cases/compiler/constEnums.ts @@ -0,0 +1,151 @@ +const enum Enum1 { + A0 = 100, +} + +const enum Enum1 { + // correct cases + A, + B, + C = 10, + D = A | B, + E = A | 1, + F = 1 | A, + G = (1 & 1), + H = ~(A | B), + I = A >>> 1, + J = 1 & A, + K = ~(1 | 5), + L = ~D, + M = E << B, + N = E << 1, + O = E >> B, + P = E >> 1, + Q = -D, + R = C & 5, + S = 5 & C, + T = C | D, + U = C | 1, + V = 10 | D, + W = Enum1.V, + + // correct cases: reference to the enum member from different enum declaration + W1 = A0, + W2 = Enum1.A0, + W3 = Enum1["A0"], + W4 = Enum1["W"], +} + + +module A { + export module B { + export module C { + export const enum E { + V1 = 1, + V2 = A.B.C.E.V1 | 100 + } + } + } +} + +module A { + export module B { + export module C { + export const enum E { + V3 = A.B.C.E["V2"] & 200, + } + } + } +} + +module A1 { + export module B { + export module C { + export const enum E { + V1 = 10, + V2 = 110, + } + } + } +} + +module A2 { + export module B { + export module C { + export const enum E { + V1 = 10, + V2 = 110, + } + } + // module C will be classified as value + export module C { + var x = 1 + } + } +} + +import I = A.B.C.E; +import I1 = A1.B; +import I2 = A2.B; + +function foo0(e: I): void { + if (e === I.V1) { + } + else if (e === I.V2) { + } +} + +function foo1(e: I1.C.E): void { + if (e === I1.C.E.V1) { + } + else if (e === I1.C.E.V2) { + } +} + +function foo2(e: I2.C.E): void { + if (e === I2.C.E.V1) { + } + else if (e === I2.C.E.V2) { + } +} + + +function foo(x: Enum1) { + switch (x) { + case Enum1.A: + case Enum1.B: + case Enum1.C: + case Enum1.D: + case Enum1.E: + case Enum1.F: + case Enum1.G: + case Enum1.H: + case Enum1.I: + case Enum1.J: + case Enum1.K: + case Enum1.L: + case Enum1.M: + case Enum1.N: + case Enum1.O: + case Enum1.P: + case Enum1.Q: + case Enum1.R: + case Enum1.S: + case Enum1["T"]: + case Enum1.U: + case Enum1.V: + case Enum1.W: + case Enum1.W1: + case Enum1.W2: + case Enum1.W3: + case Enum1.W4: + break; + } +} + +function bar(e: A.B.C.E): number { + switch (e) { + case A.B.C.E.V1: return 1; + case A.B.C.E.V2: return 1; + case A.B.C.E.V3: return 1; + } +} \ No newline at end of file diff --git a/tests/cases/compiler/preserveConstEnums.ts b/tests/cases/compiler/preserveConstEnums.ts new file mode 100644 index 00000000000..d83c84b403d --- /dev/null +++ b/tests/cases/compiler/preserveConstEnums.ts @@ -0,0 +1,4 @@ +// @preserveConstEnums: true +const enum E { + Value = 1, Value2 = Value +} \ No newline at end of file diff --git a/tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts b/tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts new file mode 100644 index 00000000000..049a0101f5d --- /dev/null +++ b/tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts @@ -0,0 +1,41 @@ +// It is an error for the type specified in a type alias to depend on that type alias + +// A type alias directly depends on the type it aliases. +type T0 = T0 +type T0_1 = T0_2 +type T0_2 = T0_3 +type T0_3 = T0_1 + +// A type reference directly depends on the referenced type and each of the type arguments, if any. +interface I {} +type T1 = I + +// A union type directly depends on each of the constituent types. +type T2 = T2 | string +class C {} +type T2_1 = T2_1[] | number + +// An array type directly depends on its element type. +type T3 = T3[] + +// A tuple type directly depends on each of its element types. +type T4 = [number, T4] + +// A type query directly depends on the type of the referenced entity. +var x: T5[] = [] +type T5 = typeof x + +class C1 {} +type T6 = T7 | number +type T7 = typeof yy +var yy: [string, T8[]]; +type T8 = C + +// legal cases +type T9 = () => T9 +type T10 = { x: T10 } | { new(v: T10): string } +type T11 = T12[] +type T12 = [T13, string] +type T13 = typeof zz +var zz: { x: T11 } + diff --git a/tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts b/tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts new file mode 100644 index 00000000000..3b115573830 --- /dev/null +++ b/tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts @@ -0,0 +1,6 @@ +interface I {} +type any = I; +type number = I; +type boolean = I; +type string = I; +type void = I; \ No newline at end of file diff --git a/tests/cases/conformance/types/typeAliases/typeAliases.ts b/tests/cases/conformance/types/typeAliases/typeAliases.ts new file mode 100644 index 00000000000..b9d28f4cc35 --- /dev/null +++ b/tests/cases/conformance/types/typeAliases/typeAliases.ts @@ -0,0 +1,80 @@ +// Writing a reference to a type alias has exactly the same effect as writing the aliased type itself. + +type T1 = number; +var x1: number; +var x1: T1; + +type T2 = string; +var x2: string; +var x2: T2; + +type T3 = boolean; +var x3: boolean; +var x3: T3; + +type T4 = void; +var x4: void; +var x4: T4; + +type T5 = any; +var x5: any; +var x5: T5; + +interface I6 { x : string } +type T6 = I6; +var x6: I6; +var x6: T6; + +class C7 { x: boolean } +type T7 = C7; +var x7: C7; +var x7: T7; + +type T8 = string | boolean; +var x8: string | boolean; +var x8: T8; + +type T9 = () => string; +var x9: () => string; +var x9: T9; + +type T10 = { x: number }; +var x10: { x: number }; +var x10: T10; + +type T11 = { new(): boolean }; +var x11: { new(): boolean }; +var x11: T11; + +interface I13 { x: string }; +type T13 = I13; +var x13_1: I13; +var x13_2: T13 + +declare function foo13(t1: T1, t2: T13): void; +foo13(x13_1, x13_2); +foo13(x13_2, x13_1); + +type T14 = string; +var x14: T14; + +declare function foo14_1(x: T14): void; + +declare function foo14_2(x: "click"): void; +declare function foo14_2(x: T14): void; + +type Meters = number + +enum E { x = 10 } + +declare function f15(a: string): boolean; +declare function f15(a: Meters): string; +f15(E.x).toLowerCase(); + +type StringAndBoolean = [string, boolean] +declare function f16(s: StringAndBoolean): string; +var x: [string, boolean]; +f16(x); + +var y: StringAndBoolean = ["1", false]; +y[0].toLowerCase(); \ No newline at end of file diff --git a/tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts b/tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts new file mode 100644 index 00000000000..f1fd2a58bac --- /dev/null +++ b/tests/cases/conformance/types/typeAliases/typeAliasesForObjectTypes.ts @@ -0,0 +1,14 @@ +type T1 = { x: string } + +// An interface can be named in an extends or implements clause, but a type alias for an object type literal cannot. +interface I1 extends T1 { y: string } +class C1 implements T1 { + x: string; +} + +// An interface can have multiple merged declarations, but a type alias for an object type literal cannot. +type T2 = { x: string } +type T2 = { y: number } + +// An interface can have type parameters, but a type alias for an object type literal cannot. +type T3 = { x: T } diff --git a/tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts b/tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts new file mode 100644 index 00000000000..39def706622 --- /dev/null +++ b/tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts @@ -0,0 +1,31 @@ +// Verify that inferences made *to* a type parameter in a union type are secondary +// to inferences made directly to that type parameter + +function f(x: T, y: string|T): T { + return x; +} + +var a1: number; +var a1 = f(1, 2); +var a2: number; +var a2 = f(1, "hello"); +var a3: number; +var a3 = f(1, a1 || "hello"); +var a4: any; +var a4 = f(undefined, "abc"); + +function g(value: [string, T]): T { + return value[1]; +} + +var b1: boolean; +var b1 = g(["string", true]); + +function h(x: string|boolean|T): T { + return typeof x === "string" || typeof x === "boolean" ? undefined : x; +} + +var c1: number; +var c1 = h(5); +var c2: string; +var c2 = h("abc");