mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-11 17:41:26 -06:00
Update LKG
This commit is contained in:
parent
f5a52ee7db
commit
58c8d345bc
24
lib/lib.d.ts
vendored
24
lib/lib.d.ts
vendored
@ -965,38 +965,22 @@ interface JSON {
|
||||
* If a member contains nested objects, the nested objects are transformed before the parent object is.
|
||||
*/
|
||||
parse(text: string, reviver?: (key: any, value: any) => any): any;
|
||||
/**
|
||||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
||||
* @param value A JavaScript value, usually an object or array, to be converted.
|
||||
*/
|
||||
stringify(value: any): string;
|
||||
/**
|
||||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
||||
* @param value A JavaScript value, usually an object or array, to be converted.
|
||||
* @param replacer A function that transforms the results.
|
||||
*/
|
||||
stringify(value: any, replacer: (key: string, value: any) => any): string;
|
||||
/**
|
||||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
||||
* @param value A JavaScript value, usually an object or array, to be converted.
|
||||
* @param replacer Array that transforms the results.
|
||||
*/
|
||||
stringify(value: any, replacer: any[]): string;
|
||||
/**
|
||||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
||||
* @param value A JavaScript value, usually an object or array, to be converted.
|
||||
* @param replacer A function that transforms the results.
|
||||
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
||||
*/
|
||||
stringify(value: any, replacer: (key: string, value: any) => any, space: string | number): string;
|
||||
stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string;
|
||||
/**
|
||||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
||||
* @param value A JavaScript value, usually an object or array, to be converted.
|
||||
* @param replacer Array that transforms the results.
|
||||
* @param replacer An array of strings and numbers that acts as a white list for selecting the object properties that will be stringified.
|
||||
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
||||
*/
|
||||
stringify(value: any, replacer: any[], space: string | number): string;
|
||||
stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.
|
||||
*/
|
||||
|
||||
24
lib/lib.es5.d.ts
vendored
24
lib/lib.es5.d.ts
vendored
@ -965,38 +965,22 @@ interface JSON {
|
||||
* If a member contains nested objects, the nested objects are transformed before the parent object is.
|
||||
*/
|
||||
parse(text: string, reviver?: (key: any, value: any) => any): any;
|
||||
/**
|
||||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
||||
* @param value A JavaScript value, usually an object or array, to be converted.
|
||||
*/
|
||||
stringify(value: any): string;
|
||||
/**
|
||||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
||||
* @param value A JavaScript value, usually an object or array, to be converted.
|
||||
* @param replacer A function that transforms the results.
|
||||
*/
|
||||
stringify(value: any, replacer: (key: string, value: any) => any): string;
|
||||
/**
|
||||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
||||
* @param value A JavaScript value, usually an object or array, to be converted.
|
||||
* @param replacer Array that transforms the results.
|
||||
*/
|
||||
stringify(value: any, replacer: any[]): string;
|
||||
/**
|
||||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
||||
* @param value A JavaScript value, usually an object or array, to be converted.
|
||||
* @param replacer A function that transforms the results.
|
||||
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
||||
*/
|
||||
stringify(value: any, replacer: (key: string, value: any) => any, space: string | number): string;
|
||||
stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string;
|
||||
/**
|
||||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
||||
* @param value A JavaScript value, usually an object or array, to be converted.
|
||||
* @param replacer Array that transforms the results.
|
||||
* @param replacer An array of strings and numbers that acts as a white list for selecting the object properties that will be stringified.
|
||||
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
||||
*/
|
||||
stringify(value: any, replacer: any[], space: string | number): string;
|
||||
stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.
|
||||
*/
|
||||
|
||||
24
lib/lib.es6.d.ts
vendored
24
lib/lib.es6.d.ts
vendored
@ -965,38 +965,22 @@ interface JSON {
|
||||
* If a member contains nested objects, the nested objects are transformed before the parent object is.
|
||||
*/
|
||||
parse(text: string, reviver?: (key: any, value: any) => any): any;
|
||||
/**
|
||||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
||||
* @param value A JavaScript value, usually an object or array, to be converted.
|
||||
*/
|
||||
stringify(value: any): string;
|
||||
/**
|
||||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
||||
* @param value A JavaScript value, usually an object or array, to be converted.
|
||||
* @param replacer A function that transforms the results.
|
||||
*/
|
||||
stringify(value: any, replacer: (key: string, value: any) => any): string;
|
||||
/**
|
||||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
||||
* @param value A JavaScript value, usually an object or array, to be converted.
|
||||
* @param replacer Array that transforms the results.
|
||||
*/
|
||||
stringify(value: any, replacer: any[]): string;
|
||||
/**
|
||||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
||||
* @param value A JavaScript value, usually an object or array, to be converted.
|
||||
* @param replacer A function that transforms the results.
|
||||
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
||||
*/
|
||||
stringify(value: any, replacer: (key: string, value: any) => any, space: string | number): string;
|
||||
stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string;
|
||||
/**
|
||||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
||||
* @param value A JavaScript value, usually an object or array, to be converted.
|
||||
* @param replacer Array that transforms the results.
|
||||
* @param replacer An array of strings and numbers that acts as a white list for selecting the object properties that will be stringified.
|
||||
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
||||
*/
|
||||
stringify(value: any, replacer: any[], space: string | number): string;
|
||||
stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.
|
||||
*/
|
||||
|
||||
365
lib/tsc.js
365
lib/tsc.js
@ -913,6 +913,10 @@ var ts;
|
||||
}
|
||||
return result.sort();
|
||||
}
|
||||
function getDirectories(path) {
|
||||
var folder = fso.GetFolder(path);
|
||||
return getNames(folder.subfolders);
|
||||
}
|
||||
function readDirectory(path, extension, exclude) {
|
||||
var result = [];
|
||||
exclude = ts.map(exclude, function (s) { return getCanonicalPath(ts.combinePaths(path, s)); });
|
||||
@ -967,6 +971,7 @@ var ts;
|
||||
getCurrentDirectory: function () {
|
||||
return new ActiveXObject("WScript.Shell").CurrentDirectory;
|
||||
},
|
||||
getDirectories: getDirectories,
|
||||
readDirectory: readDirectory,
|
||||
exit: function (exitCode) {
|
||||
try {
|
||||
@ -1114,6 +1119,9 @@ var ts;
|
||||
function directoryExists(path) {
|
||||
return fileSystemEntryExists(path, 1);
|
||||
}
|
||||
function getDirectories(path) {
|
||||
return ts.filter(_fs.readdirSync(path), function (p) { return fileSystemEntryExists(ts.combinePaths(path, p), 1); });
|
||||
}
|
||||
function readDirectory(path, extension, exclude) {
|
||||
var result = [];
|
||||
exclude = ts.map(exclude, function (s) { return getCanonicalPath(ts.combinePaths(path, s)); });
|
||||
@ -1206,6 +1214,7 @@ var ts;
|
||||
getCurrentDirectory: function () {
|
||||
return process.cwd();
|
||||
},
|
||||
getDirectories: getDirectories,
|
||||
readDirectory: readDirectory,
|
||||
getModifiedTime: function (path) {
|
||||
try {
|
||||
@ -1256,6 +1265,7 @@ var ts;
|
||||
createDirectory: ChakraHost.createDirectory,
|
||||
getExecutingFilePath: function () { return ChakraHost.executingFile; },
|
||||
getCurrentDirectory: function () { return ChakraHost.currentDirectory; },
|
||||
getDirectories: ChakraHost.getDirectories,
|
||||
readDirectory: ChakraHost.readDirectory,
|
||||
exit: ChakraHost.quit,
|
||||
realpath: realpath
|
||||
@ -1389,7 +1399,7 @@ var ts;
|
||||
or_expected: { code: 1144, category: ts.DiagnosticCategory.Error, key: "or_expected_1144", message: "'{' or ';' expected." },
|
||||
Declaration_expected: { code: 1146, category: ts.DiagnosticCategory.Error, key: "Declaration_expected_1146", message: "Declaration expected." },
|
||||
Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", message: "Import declarations in a namespace cannot reference a module." },
|
||||
Cannot_compile_modules_unless_the_module_flag_is_provided_with_a_valid_module_type_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_unless_the_module_flag_is_provided_with_a_valid_module_type_Consider_setting__1148", message: "Cannot compile modules unless the '--module' flag is provided with a valid module type. Consider setting the 'module' compiler option in a 'tsconfig.json' file." },
|
||||
Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148", message: "Cannot use imports, exports, or module augmentations when '--module' is 'none'." },
|
||||
File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing" },
|
||||
new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: ts.DiagnosticCategory.Error, key: "new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead_1150", message: "'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead." },
|
||||
const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized" },
|
||||
@ -1759,6 +1769,8 @@ var ts;
|
||||
this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation: { code: 2683, category: ts.DiagnosticCategory.Error, key: "this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683", message: "'this' implicitly has type 'any' because it does not have a type annotation." },
|
||||
The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1: { code: 2684, category: ts.DiagnosticCategory.Error, key: "The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684", message: "The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'." },
|
||||
The_this_types_of_each_signature_are_incompatible: { code: 2685, category: ts.DiagnosticCategory.Error, key: "The_this_types_of_each_signature_are_incompatible_2685", message: "The 'this' types of each signature are incompatible." },
|
||||
Identifier_0_must_be_imported_from_a_module: { code: 2686, category: ts.DiagnosticCategory.Error, key: "Identifier_0_must_be_imported_from_a_module_2686", message: "Identifier '{0}' must be imported from a module" },
|
||||
All_declarations_of_0_must_have_identical_modifiers: { code: 2687, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_0_must_have_identical_modifiers_2687", message: "All declarations of '{0}' must have identical modifiers." },
|
||||
Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import_declaration_0_is_using_private_name_1_4000", message: "Import declaration '{0}' is using private name '{1}'." },
|
||||
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", message: "Type parameter '{0}' of exported class has or is using private name '{1}'." },
|
||||
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", message: "Type parameter '{0}' of exported interface has or is using private name '{1}'." },
|
||||
@ -1852,7 +1864,7 @@ var ts;
|
||||
Option_paths_cannot_be_used_without_specifying_baseUrl_option: { code: 5060, category: ts.DiagnosticCategory.Error, key: "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", message: "Option 'paths' cannot be used without specifying '--baseUrl' option." },
|
||||
Pattern_0_can_have_at_most_one_Asterisk_character: { code: 5061, category: ts.DiagnosticCategory.Error, key: "Pattern_0_can_have_at_most_one_Asterisk_character_5061", message: "Pattern '{0}' can have at most one '*' character" },
|
||||
Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: { code: 5062, category: ts.DiagnosticCategory.Error, key: "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062", message: "Substitution '{0}' in pattern '{1}' in can have at most one '*' character" },
|
||||
Substututions_for_pattern_0_should_be_an_array: { code: 5063, category: ts.DiagnosticCategory.Error, key: "Substututions_for_pattern_0_should_be_an_array_5063", message: "Substututions for pattern '{0}' should be an array." },
|
||||
Substitutions_for_pattern_0_should_be_an_array: { code: 5063, category: ts.DiagnosticCategory.Error, key: "Substitutions_for_pattern_0_should_be_an_array_5063", message: "Substitutions for pattern '{0}' should be an array." },
|
||||
Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: { code: 5064, category: ts.DiagnosticCategory.Error, key: "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064", message: "Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'." },
|
||||
Concatenate_and_emit_output_to_single_file: { code: 6001, category: ts.DiagnosticCategory.Message, key: "Concatenate_and_emit_output_to_single_file_6001", message: "Concatenate and emit output to single file." },
|
||||
Generates_corresponding_d_ts_file: { code: 6002, category: ts.DiagnosticCategory.Message, key: "Generates_corresponding_d_ts_file_6002", message: "Generates corresponding '.d.ts' file." },
|
||||
@ -1865,6 +1877,7 @@ var ts;
|
||||
Do_not_emit_comments_to_output: { code: 6009, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_comments_to_output_6009", message: "Do not emit comments to output." },
|
||||
Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_outputs_6010", message: "Do not emit outputs." },
|
||||
Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: { code: 6011, category: ts.DiagnosticCategory.Message, key: "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", message: "Allow default imports from modules with no default export. This does not affect code emit, just typechecking." },
|
||||
Skip_type_checking_of_declaration_files: { code: 6012, category: ts.DiagnosticCategory.Message, key: "Skip_type_checking_of_declaration_files_6012", message: "Skip type checking of declaration files." },
|
||||
Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES2015'" },
|
||||
Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'" },
|
||||
Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print_this_message_6017", message: "Print this message." },
|
||||
@ -1966,6 +1979,7 @@ var ts;
|
||||
Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set: { code: 6128, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128", message: "======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========" },
|
||||
The_config_file_0_found_doesn_t_contain_any_source_files: { code: 6129, category: ts.DiagnosticCategory.Error, key: "The_config_file_0_found_doesn_t_contain_any_source_files_6129", message: "The config file '{0}' found doesn't contain any source files." },
|
||||
Resolving_real_path_for_0_result_1: { code: 6130, category: ts.DiagnosticCategory.Message, key: "Resolving_real_path_for_0_result_1_6130", message: "Resolving real path for '{0}', result '{1}'" },
|
||||
Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: { code: 6131, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131", message: "Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'." },
|
||||
Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_an_1_type_7005", message: "Variable '{0}' implicitly has an '{1}' type." },
|
||||
Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter_0_implicitly_has_an_1_type_7006", message: "Parameter '{0}' implicitly has an '{1}' type." },
|
||||
Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member_0_implicitly_has_an_1_type_7008", message: "Member '{0}' implicitly has an '{1}' type." },
|
||||
@ -5004,7 +5018,7 @@ var ts;
|
||||
}
|
||||
ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically;
|
||||
function getPropertyNameForPropertyNameNode(name) {
|
||||
if (name.kind === 69 || name.kind === 9 || name.kind === 8) {
|
||||
if (name.kind === 69 || name.kind === 9 || name.kind === 8 || name.kind === 142) {
|
||||
return name.text;
|
||||
}
|
||||
if (name.kind === 140) {
|
||||
@ -12050,10 +12064,10 @@ var ts;
|
||||
case 145:
|
||||
case 144:
|
||||
case 266:
|
||||
return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455);
|
||||
return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 0);
|
||||
case 253:
|
||||
case 254:
|
||||
return bindPropertyOrMethodOrAccessor(node, 4, 107455);
|
||||
return bindPropertyOrMethodOrAccessor(node, 4, 0);
|
||||
case 255:
|
||||
return bindPropertyOrMethodOrAccessor(node, 8, 107455);
|
||||
case 247:
|
||||
@ -12065,7 +12079,7 @@ var ts;
|
||||
return declareSymbolAndAddToSymbolTable(node, 131072, 0);
|
||||
case 147:
|
||||
case 146:
|
||||
return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263);
|
||||
return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 0 : 99263);
|
||||
case 220:
|
||||
return bindFunctionDeclaration(node);
|
||||
case 148:
|
||||
@ -12108,7 +12122,7 @@ var ts;
|
||||
case 238:
|
||||
return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608);
|
||||
case 228:
|
||||
return bindGlobalModuleExportDeclaration(node);
|
||||
return bindNamespaceExportDeclaration(node);
|
||||
case 231:
|
||||
return bindImportClause(node);
|
||||
case 236:
|
||||
@ -12144,13 +12158,13 @@ var ts;
|
||||
bindAnonymousDeclaration(node, 8388608, getDeclarationName(node));
|
||||
}
|
||||
else if (boundExpression.kind === 69 && node.kind === 235) {
|
||||
declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 107455 | 8388608);
|
||||
declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 0 | 8388608);
|
||||
}
|
||||
else {
|
||||
declareSymbol(container.symbol.exports, container.symbol, node, 4, 107455 | 8388608);
|
||||
declareSymbol(container.symbol.exports, container.symbol, node, 4, 0 | 8388608);
|
||||
}
|
||||
}
|
||||
function bindGlobalModuleExportDeclaration(node) {
|
||||
function bindNamespaceExportDeclaration(node) {
|
||||
if (node.modifiers && node.modifiers.length) {
|
||||
file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Modifiers_cannot_appear_here));
|
||||
}
|
||||
@ -12202,7 +12216,7 @@ var ts;
|
||||
function bindThisPropertyAssignment(node) {
|
||||
if (container.kind === 179 || container.kind === 220) {
|
||||
container.symbol.members = container.symbol.members || {};
|
||||
declareSymbol(container.symbol.members, container.symbol, node, 4, 107455 & ~4);
|
||||
declareSymbol(container.symbol.members, container.symbol, node, 4, 0 & ~4);
|
||||
}
|
||||
}
|
||||
function bindPrototypePropertyAssignment(node) {
|
||||
@ -12219,7 +12233,7 @@ var ts;
|
||||
if (!funcSymbol.members) {
|
||||
funcSymbol.members = {};
|
||||
}
|
||||
declareSymbol(funcSymbol.members, funcSymbol, leftSideOfAssignment, 4, 107455);
|
||||
declareSymbol(funcSymbol.members, funcSymbol, leftSideOfAssignment, 4, 0);
|
||||
}
|
||||
function bindCallExpression(node) {
|
||||
if (!file.commonJsModuleIndicator && ts.isRequireCall(node, false)) {
|
||||
@ -12295,7 +12309,7 @@ var ts;
|
||||
}
|
||||
if (ts.isParameterPropertyDeclaration(node)) {
|
||||
var classDeclaration = node.parent.parent;
|
||||
declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455);
|
||||
declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 0);
|
||||
}
|
||||
}
|
||||
function bindFunctionDeclaration(node) {
|
||||
@ -12595,7 +12609,7 @@ var ts;
|
||||
if (flags & 1)
|
||||
result |= 107454;
|
||||
if (flags & 4)
|
||||
result |= 107455;
|
||||
result |= 0;
|
||||
if (flags & 8)
|
||||
result |= 107455;
|
||||
if (flags & 16)
|
||||
@ -12851,6 +12865,7 @@ var ts;
|
||||
var propertyWithInvalidInitializer;
|
||||
var errorLocation = location;
|
||||
var grandparent;
|
||||
var isInExternalModule = false;
|
||||
loop: while (location) {
|
||||
if (location.locals && !isGlobalSourceFile(location)) {
|
||||
if (result = getSymbol(location.locals, name, meaning)) {
|
||||
@ -12882,6 +12897,7 @@ var ts;
|
||||
case 256:
|
||||
if (!ts.isExternalOrCommonJsModule(location))
|
||||
break;
|
||||
isInExternalModule = true;
|
||||
case 225:
|
||||
var moduleExports = getSymbolOfNode(location).exports;
|
||||
if (location.kind === 256 || ts.isAmbientModule(location)) {
|
||||
@ -13005,6 +13021,12 @@ var ts;
|
||||
checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation);
|
||||
}
|
||||
}
|
||||
if (result && isInExternalModule) {
|
||||
var decls = result.declarations;
|
||||
if (decls && decls.length === 1 && decls[0].kind === 228) {
|
||||
error(errorLocation, ts.Diagnostics.Identifier_0_must_be_imported_from_a_module, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -14480,7 +14502,7 @@ var ts;
|
||||
}
|
||||
function getTypeForBindingElementParent(node) {
|
||||
var symbol = getSymbolOfNode(node);
|
||||
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node);
|
||||
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, false);
|
||||
}
|
||||
function getTextOfPropertyName(name) {
|
||||
switch (name.kind) {
|
||||
@ -14585,7 +14607,7 @@ var ts;
|
||||
function addOptionality(type, optional) {
|
||||
return strictNullChecks && optional ? addNullableKind(type, 32) : type;
|
||||
}
|
||||
function getTypeForVariableLikeDeclaration(declaration) {
|
||||
function getTypeForVariableLikeDeclaration(declaration, includeOptionality) {
|
||||
if (declaration.flags & 134217728) {
|
||||
var type = getTypeForVariableLikeDeclarationFromJSDocComment(declaration);
|
||||
if (type && type !== unknownType) {
|
||||
@ -14602,7 +14624,7 @@ var ts;
|
||||
return getTypeForBindingElement(declaration);
|
||||
}
|
||||
if (declaration.type) {
|
||||
return addOptionality(getTypeFromTypeNode(declaration.type), !!declaration.questionToken);
|
||||
return addOptionality(getTypeFromTypeNode(declaration.type), declaration.questionToken && includeOptionality);
|
||||
}
|
||||
if (declaration.kind === 142) {
|
||||
var func = declaration.parent;
|
||||
@ -14621,11 +14643,11 @@ var ts;
|
||||
? getContextuallyTypedThisType(func)
|
||||
: getContextuallyTypedParameterType(declaration);
|
||||
if (type) {
|
||||
return addOptionality(type, !!declaration.questionToken);
|
||||
return addOptionality(type, declaration.questionToken && includeOptionality);
|
||||
}
|
||||
}
|
||||
if (declaration.initializer) {
|
||||
return addOptionality(checkExpressionCached(declaration.initializer), !!declaration.questionToken);
|
||||
return addOptionality(checkExpressionCached(declaration.initializer), declaration.questionToken && includeOptionality);
|
||||
}
|
||||
if (declaration.kind === 254) {
|
||||
return checkIdentifier(declaration.name);
|
||||
@ -14693,7 +14715,7 @@ var ts;
|
||||
: getTypeFromArrayBindingPattern(pattern, includePatternInType);
|
||||
}
|
||||
function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors) {
|
||||
var type = getTypeForVariableLikeDeclaration(declaration);
|
||||
var type = getTypeForVariableLikeDeclaration(declaration, true);
|
||||
if (type) {
|
||||
if (reportErrors) {
|
||||
reportErrorsFromWidening(declaration, type);
|
||||
@ -17010,7 +17032,7 @@ var ts;
|
||||
return isIdenticalTo(source, target);
|
||||
}
|
||||
if (!(target.flags & 134217728)) {
|
||||
if (target.flags & 1)
|
||||
if (target.flags & 1 || source.flags & 134217728)
|
||||
return -1;
|
||||
if (source.flags & 32) {
|
||||
if (!strictNullChecks || target.flags & (32 | 16) || source === emptyArrayElementType)
|
||||
@ -17030,7 +17052,7 @@ var ts;
|
||||
if (source.flags & 256 && target === stringType)
|
||||
return -1;
|
||||
if (relation === assignableRelation || relation === comparableRelation) {
|
||||
if (source.flags & (1 | 134217728))
|
||||
if (source.flags & 1)
|
||||
return -1;
|
||||
if (source === numberType && target.flags & 128)
|
||||
return -1;
|
||||
@ -17807,41 +17829,47 @@ var ts;
|
||||
getSignaturesOfType(type, 0).length === 0 &&
|
||||
getSignaturesOfType(type, 1).length === 0;
|
||||
}
|
||||
function createTransientSymbol(source, type) {
|
||||
var symbol = createSymbol(source.flags | 67108864, source.name);
|
||||
symbol.declarations = source.declarations;
|
||||
symbol.parent = source.parent;
|
||||
symbol.type = type;
|
||||
symbol.target = source;
|
||||
if (source.valueDeclaration) {
|
||||
symbol.valueDeclaration = source.valueDeclaration;
|
||||
}
|
||||
return symbol;
|
||||
}
|
||||
function transformTypeOfMembers(type, f) {
|
||||
var members = {};
|
||||
for (var _i = 0, _a = getPropertiesOfObjectType(type); _i < _a.length; _i++) {
|
||||
var property = _a[_i];
|
||||
var original = getTypeOfSymbol(property);
|
||||
var updated = f(original);
|
||||
members[property.name] = updated === original ? property : createTransientSymbol(property, updated);
|
||||
}
|
||||
;
|
||||
return members;
|
||||
}
|
||||
function getRegularTypeOfObjectLiteral(type) {
|
||||
if (type.flags & 1048576) {
|
||||
var regularType = type.regularType;
|
||||
if (!regularType) {
|
||||
regularType = createType(type.flags & ~1048576);
|
||||
regularType.symbol = type.symbol;
|
||||
regularType.members = type.members;
|
||||
regularType.properties = type.properties;
|
||||
regularType.callSignatures = type.callSignatures;
|
||||
regularType.constructSignatures = type.constructSignatures;
|
||||
regularType.stringIndexInfo = type.stringIndexInfo;
|
||||
regularType.numberIndexInfo = type.numberIndexInfo;
|
||||
type.regularType = regularType;
|
||||
}
|
||||
if (!(type.flags & 1048576)) {
|
||||
return type;
|
||||
}
|
||||
var regularType = type.regularType;
|
||||
if (regularType) {
|
||||
return regularType;
|
||||
}
|
||||
return type;
|
||||
var resolved = type;
|
||||
var members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral);
|
||||
var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.stringIndexInfo, resolved.numberIndexInfo);
|
||||
regularNew.flags = resolved.flags & ~1048576;
|
||||
type.regularType = regularNew;
|
||||
return regularNew;
|
||||
}
|
||||
function getWidenedTypeOfObjectLiteral(type) {
|
||||
var properties = getPropertiesOfObjectType(type);
|
||||
var members = {};
|
||||
ts.forEach(properties, function (p) {
|
||||
var propType = getTypeOfSymbol(p);
|
||||
var widenedType = getWidenedType(propType);
|
||||
if (propType !== widenedType) {
|
||||
var symbol = createSymbol(p.flags | 67108864, p.name);
|
||||
symbol.declarations = p.declarations;
|
||||
symbol.parent = p.parent;
|
||||
symbol.type = widenedType;
|
||||
symbol.target = p;
|
||||
if (p.valueDeclaration)
|
||||
symbol.valueDeclaration = p.valueDeclaration;
|
||||
p = symbol;
|
||||
}
|
||||
members[p.name] = p;
|
||||
var members = transformTypeOfMembers(type, function (prop) {
|
||||
var widened = getWidenedType(prop);
|
||||
return prop === widened ? prop : widened;
|
||||
});
|
||||
var stringIndexInfo = getIndexInfoOfType(type, 0);
|
||||
var numberIndexInfo = getIndexInfoOfType(type, 1);
|
||||
@ -19134,7 +19162,7 @@ var ts;
|
||||
}
|
||||
return nodeCheckFlag === 512
|
||||
? getBaseConstructorTypeOfClass(classType)
|
||||
: baseClassType;
|
||||
: getTypeWithThisArgument(baseClassType, classType.thisType);
|
||||
function isLegalUsageOfSuperExpression(container) {
|
||||
if (!container) {
|
||||
return false;
|
||||
@ -21182,7 +21210,7 @@ var ts;
|
||||
var types = void 0;
|
||||
var funcIsGenerator = !!func.asteriskToken;
|
||||
if (funcIsGenerator) {
|
||||
types = checkAndAggregateYieldOperandTypes(func.body, contextualMapper);
|
||||
types = checkAndAggregateYieldOperandTypes(func, contextualMapper);
|
||||
if (types.length === 0) {
|
||||
var iterableIteratorAny = createIterableIteratorType(anyType);
|
||||
if (compilerOptions.noImplicitAny) {
|
||||
@ -21192,8 +21220,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
else {
|
||||
var hasImplicitReturn = !!(func.flags & 32768);
|
||||
types = checkAndAggregateReturnExpressionTypes(func.body, contextualMapper, isAsync, hasImplicitReturn);
|
||||
types = checkAndAggregateReturnExpressionTypes(func, contextualMapper);
|
||||
if (!types) {
|
||||
return neverType;
|
||||
}
|
||||
@ -21240,9 +21267,9 @@ var ts;
|
||||
return widenedType;
|
||||
}
|
||||
}
|
||||
function checkAndAggregateYieldOperandTypes(body, contextualMapper) {
|
||||
function checkAndAggregateYieldOperandTypes(func, contextualMapper) {
|
||||
var aggregatedTypes = [];
|
||||
ts.forEachYieldExpression(body, function (yieldExpression) {
|
||||
ts.forEachYieldExpression(func.body, function (yieldExpression) {
|
||||
var expr = yieldExpression.expression;
|
||||
if (expr) {
|
||||
var type = checkExpressionCached(expr, contextualMapper);
|
||||
@ -21256,28 +21283,34 @@ var ts;
|
||||
});
|
||||
return aggregatedTypes;
|
||||
}
|
||||
function checkAndAggregateReturnExpressionTypes(body, contextualMapper, isAsync, hasImplicitReturn) {
|
||||
function checkAndAggregateReturnExpressionTypes(func, contextualMapper) {
|
||||
var isAsync = ts.isAsyncFunctionLike(func);
|
||||
var aggregatedTypes = [];
|
||||
var hasOmittedExpressions = false;
|
||||
ts.forEachReturnStatement(body, function (returnStatement) {
|
||||
var hasReturnWithNoExpression = !!(func.flags & 32768);
|
||||
var hasReturnOfTypeNever = false;
|
||||
ts.forEachReturnStatement(func.body, function (returnStatement) {
|
||||
var expr = returnStatement.expression;
|
||||
if (expr) {
|
||||
var type = checkExpressionCached(expr, contextualMapper);
|
||||
if (isAsync) {
|
||||
type = checkAwaitedType(type, body.parent, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member);
|
||||
type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member);
|
||||
}
|
||||
if (type !== neverType && !ts.contains(aggregatedTypes, type)) {
|
||||
if (type === neverType) {
|
||||
hasReturnOfTypeNever = true;
|
||||
}
|
||||
else if (!ts.contains(aggregatedTypes, type)) {
|
||||
aggregatedTypes.push(type);
|
||||
}
|
||||
}
|
||||
else {
|
||||
hasOmittedExpressions = true;
|
||||
hasReturnWithNoExpression = true;
|
||||
}
|
||||
});
|
||||
if (aggregatedTypes.length === 0 && !hasOmittedExpressions && !hasImplicitReturn) {
|
||||
if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever ||
|
||||
func.kind === 179 || func.kind === 180)) {
|
||||
return undefined;
|
||||
}
|
||||
if (strictNullChecks && aggregatedTypes.length && (hasOmittedExpressions || hasImplicitReturn)) {
|
||||
if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression) {
|
||||
if (!ts.contains(aggregatedTypes, undefinedType)) {
|
||||
aggregatedTypes.push(undefinedType);
|
||||
}
|
||||
@ -21407,7 +21440,9 @@ var ts;
|
||||
(expr.kind === 172 || expr.kind === 173) &&
|
||||
expr.expression.kind === 97) {
|
||||
var func = ts.getContainingFunction(expr);
|
||||
return !(func && func.kind === 148 && func.parent === symbol.valueDeclaration.parent);
|
||||
if (!(func && func.kind === 148))
|
||||
return true;
|
||||
return !(func.parent === symbol.valueDeclaration.parent || func === symbol.valueDeclaration.parent);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -22231,6 +22266,79 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
function checkClassForDuplicateDeclarations(node) {
|
||||
var getter = 1, setter = 2, property = getter | setter;
|
||||
var instanceNames = {};
|
||||
var staticNames = {};
|
||||
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
||||
var member = _a[_i];
|
||||
if (member.kind === 148) {
|
||||
for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) {
|
||||
var param = _c[_b];
|
||||
if (ts.isParameterPropertyDeclaration(param)) {
|
||||
addName(instanceNames, param.name, param.name.text, property);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
var static = ts.forEach(member.modifiers, function (m) { return m.kind === 113; });
|
||||
var names = static ? staticNames : instanceNames;
|
||||
var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name);
|
||||
if (memberName) {
|
||||
switch (member.kind) {
|
||||
case 149:
|
||||
addName(names, member.name, memberName, getter);
|
||||
break;
|
||||
case 150:
|
||||
addName(names, member.name, memberName, setter);
|
||||
break;
|
||||
case 145:
|
||||
addName(names, member.name, memberName, property);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function addName(names, location, name, meaning) {
|
||||
if (ts.hasProperty(names, name)) {
|
||||
var prev = names[name];
|
||||
if (prev & meaning) {
|
||||
error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location));
|
||||
}
|
||||
else {
|
||||
names[name] = prev | meaning;
|
||||
}
|
||||
}
|
||||
else {
|
||||
names[name] = meaning;
|
||||
}
|
||||
}
|
||||
}
|
||||
function checkObjectTypeForDuplicateDeclarations(node) {
|
||||
var names = {};
|
||||
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
||||
var member = _a[_i];
|
||||
if (member.kind == 144) {
|
||||
var memberName = void 0;
|
||||
switch (member.name.kind) {
|
||||
case 9:
|
||||
case 8:
|
||||
case 69:
|
||||
memberName = member.name.text;
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
if (ts.hasProperty(names, memberName)) {
|
||||
error(member.symbol.valueDeclaration.name, ts.Diagnostics.Duplicate_identifier_0, memberName);
|
||||
error(member.name, ts.Diagnostics.Duplicate_identifier_0, memberName);
|
||||
}
|
||||
else {
|
||||
names[memberName] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function checkTypeForDuplicateIndexSignatures(node) {
|
||||
if (node.kind === 222) {
|
||||
var nodeSymbol = getSymbolOfNode(node);
|
||||
@ -22449,6 +22557,7 @@ var ts;
|
||||
var type = getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
|
||||
checkIndexConstraints(type);
|
||||
checkTypeForDuplicateIndexSignatures(node);
|
||||
checkObjectTypeForDuplicateDeclarations(node);
|
||||
}
|
||||
}
|
||||
function checkArrayType(node) {
|
||||
@ -23208,6 +23317,10 @@ var ts;
|
||||
if (node.initializer) {
|
||||
checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, undefined);
|
||||
}
|
||||
if (!areDeclarationFlagsIdentical(node, symbol.valueDeclaration)) {
|
||||
error(symbol.valueDeclaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name));
|
||||
error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name));
|
||||
}
|
||||
}
|
||||
if (node.kind !== 145 && node.kind !== 144) {
|
||||
checkExportsOnMergedDeclarations(node);
|
||||
@ -23220,6 +23333,18 @@ var ts;
|
||||
checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
|
||||
}
|
||||
}
|
||||
function areDeclarationFlagsIdentical(left, right) {
|
||||
if (ts.hasQuestionToken(left) !== ts.hasQuestionToken(right)) {
|
||||
return false;
|
||||
}
|
||||
var interestingFlags = 8 |
|
||||
16 |
|
||||
256 |
|
||||
128 |
|
||||
64 |
|
||||
32;
|
||||
return (left.flags & interestingFlags) === (right.flags & interestingFlags);
|
||||
}
|
||||
function checkVariableDeclaration(node) {
|
||||
checkGrammarVariableDeclaration(node);
|
||||
return checkVariableLikeDeclaration(node);
|
||||
@ -23770,6 +23895,7 @@ var ts;
|
||||
var typeWithThis = getTypeWithThisArgument(type);
|
||||
var staticType = getTypeOfSymbol(symbol);
|
||||
checkTypeParameterListsIdentical(node, symbol);
|
||||
checkClassForDuplicateDeclarations(node);
|
||||
var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node);
|
||||
if (baseTypeNode) {
|
||||
var baseTypes = getBaseTypes(type);
|
||||
@ -23981,6 +24107,7 @@ var ts;
|
||||
checkIndexConstraints(type);
|
||||
}
|
||||
}
|
||||
checkObjectTypeForDuplicateDeclarations(node);
|
||||
}
|
||||
ts.forEach(ts.getInterfaceBaseTypeNodes(node), function (heritageElement) {
|
||||
if (!ts.isSupportedExpressionWithTypeArguments(heritageElement)) {
|
||||
@ -24735,10 +24862,8 @@ var ts;
|
||||
function checkSourceFileWorker(node) {
|
||||
var links = getNodeLinks(node);
|
||||
if (!(links.flags & 1)) {
|
||||
if (compilerOptions.skipDefaultLibCheck) {
|
||||
if (node.hasNoDefaultLib) {
|
||||
return;
|
||||
}
|
||||
if (compilerOptions.skipLibCheck && node.isDeclarationFile || compilerOptions.skipDefaultLibCheck && node.hasNoDefaultLib) {
|
||||
return;
|
||||
}
|
||||
checkGrammarSourceFile(node);
|
||||
potentialThisCollisions.length = 0;
|
||||
@ -25107,7 +25232,7 @@ var ts;
|
||||
return symbol && getTypeOfSymbol(symbol);
|
||||
}
|
||||
if (ts.isBindingPattern(node)) {
|
||||
return getTypeForVariableLikeDeclaration(node.parent);
|
||||
return getTypeForVariableLikeDeclaration(node.parent, true);
|
||||
}
|
||||
if (isInRightSideOfImportOrExportAssignment(node)) {
|
||||
var symbol = getSymbolAtLocation(node);
|
||||
@ -25546,7 +25671,7 @@ var ts;
|
||||
if (file.moduleAugmentations.length) {
|
||||
(augmentations || (augmentations = [])).push(file.moduleAugmentations);
|
||||
}
|
||||
if (file.wasReferenced && file.symbol && file.symbol.globalExports) {
|
||||
if (file.symbol && file.symbol.globalExports) {
|
||||
mergeSymbolTable(globals, file.symbol.globalExports);
|
||||
}
|
||||
});
|
||||
@ -26116,7 +26241,6 @@ var ts;
|
||||
if (prop.kind === 193 ||
|
||||
name_20.kind === 140) {
|
||||
checkGrammarComputedPropertyName(name_20);
|
||||
return "continue";
|
||||
}
|
||||
if (prop.kind === 254 && !inDestructuring && prop.objectAssignmentInitializer) {
|
||||
return { value: grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment) };
|
||||
@ -26146,17 +26270,21 @@ var ts;
|
||||
else {
|
||||
ts.Debug.fail("Unexpected syntax kind:" + prop.kind);
|
||||
}
|
||||
if (!ts.hasProperty(seen, name_20.text)) {
|
||||
seen[name_20.text] = currentKind;
|
||||
var effectiveName = ts.getPropertyNameForPropertyNameNode(name_20);
|
||||
if (effectiveName === undefined) {
|
||||
return "continue";
|
||||
}
|
||||
if (!ts.hasProperty(seen, effectiveName)) {
|
||||
seen[effectiveName] = currentKind;
|
||||
}
|
||||
else {
|
||||
var existingKind = seen[name_20.text];
|
||||
var existingKind = seen[effectiveName];
|
||||
if (currentKind === Property && existingKind === Property) {
|
||||
return "continue";
|
||||
grammarErrorOnNode(name_20, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name_20));
|
||||
}
|
||||
else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) {
|
||||
if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) {
|
||||
seen[name_20.text] = currentKind | existingKind;
|
||||
seen[effectiveName] = currentKind | existingKind;
|
||||
}
|
||||
else {
|
||||
return { value: grammarErrorOnNode(name_20, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name) };
|
||||
@ -34613,7 +34741,7 @@ var ts;
|
||||
skipTsx: true,
|
||||
traceEnabled: traceEnabled
|
||||
};
|
||||
var rootDir = options.typesRoot || (options.configFilePath ? ts.getDirectoryPath(options.configFilePath) : undefined);
|
||||
var rootDir = options.typesRoot || (options.configFilePath ? ts.getDirectoryPath(options.configFilePath) : (host.getCurrentDirectory && host.getCurrentDirectory()));
|
||||
if (traceEnabled) {
|
||||
if (containingFile === undefined) {
|
||||
if (rootDir === undefined) {
|
||||
@ -35116,12 +35244,25 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getDefaultTypeDirectiveNames(rootPath) {
|
||||
var localTypes = ts.combinePaths(rootPath, "types");
|
||||
var npmTypes = ts.combinePaths(rootPath, "node_modules/@types");
|
||||
var result = [];
|
||||
if (ts.sys.directoryExists(localTypes)) {
|
||||
result = result.concat(ts.sys.getDirectories(localTypes));
|
||||
}
|
||||
if (ts.sys.directoryExists(npmTypes)) {
|
||||
result = result.concat(ts.sys.getDirectories(npmTypes));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function getDefaultLibLocation() {
|
||||
return ts.getDirectoryPath(ts.normalizePath(ts.sys.getExecutingFilePath()));
|
||||
}
|
||||
var newLine = ts.getNewLineCharacter(options);
|
||||
var realpath = ts.sys.realpath && (function (path) { return ts.sys.realpath(path); });
|
||||
return {
|
||||
getDefaultTypeDirectiveNames: getDefaultTypeDirectiveNames,
|
||||
getSourceFile: getSourceFile,
|
||||
getDefaultLibLocation: getDefaultLibLocation,
|
||||
getDefaultLibFileName: function (options) { return ts.combinePaths(getDefaultLibLocation(), ts.getDefaultLibFileName(options)); },
|
||||
@ -35189,6 +35330,19 @@ var ts;
|
||||
}
|
||||
return resolutions;
|
||||
}
|
||||
function getDefaultTypeDirectiveNames(options, rootFiles, host) {
|
||||
if (options.types) {
|
||||
return options.types;
|
||||
}
|
||||
if (host && host.getDefaultTypeDirectiveNames) {
|
||||
var commonRoot = computeCommonSourceDirectoryOfFilenames(rootFiles, host.getCurrentDirectory(), function (f) { return host.getCanonicalFileName(f); });
|
||||
if (commonRoot) {
|
||||
return host.getDefaultTypeDirectiveNames(commonRoot);
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
ts.getDefaultTypeDirectiveNames = getDefaultTypeDirectiveNames;
|
||||
function createProgram(rootNames, options, host, oldProgram) {
|
||||
var program;
|
||||
var files = [];
|
||||
@ -35224,13 +35378,14 @@ var ts;
|
||||
var filesByName = ts.createFileMap();
|
||||
var filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? ts.createFileMap(function (fileName) { return fileName.toLowerCase(); }) : undefined;
|
||||
if (!tryReuseStructureFromOldProgram()) {
|
||||
if (options.types && options.types.length) {
|
||||
var resolutions = resolveTypeReferenceDirectiveNamesWorker(options.types, undefined);
|
||||
for (var i = 0; i < options.types.length; i++) {
|
||||
processTypeReferenceDirective(options.types[i], resolutions[i]);
|
||||
ts.forEach(rootNames, function (name) { return processRootFile(name, false); });
|
||||
var typeReferences = getDefaultTypeDirectiveNames(options, rootNames, host);
|
||||
if (typeReferences) {
|
||||
var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, undefined);
|
||||
for (var i = 0; i < typeReferences.length; i++) {
|
||||
processTypeReferenceDirective(typeReferences[i], resolutions[i]);
|
||||
}
|
||||
}
|
||||
ts.forEach(rootNames, function (name) { return processRootFile(name, false); });
|
||||
if (!skipDefaultLib) {
|
||||
if (!options.lib) {
|
||||
processRootFile(host.getDefaultLibFileName(options), true);
|
||||
@ -35807,9 +35962,6 @@ var ts;
|
||||
if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== ts.getNormalizedAbsolutePath(fileName, currentDirectory)) {
|
||||
reportFileNamesDifferOnlyInCasingError(fileName, file_1.fileName, refFile, refPos, refEnd);
|
||||
}
|
||||
if (file_1) {
|
||||
file_1.wasReferenced = file_1.wasReferenced || isReference;
|
||||
}
|
||||
return file_1;
|
||||
}
|
||||
var file = host.getSourceFile(fileName, options.target, function (hostErrorMessage) {
|
||||
@ -35822,7 +35974,6 @@ var ts;
|
||||
});
|
||||
filesByName.set(path, file);
|
||||
if (file) {
|
||||
file.wasReferenced = file.wasReferenced || isReference;
|
||||
file.path = path;
|
||||
if (host.useCaseSensitiveFileNames()) {
|
||||
var existingFile = filesByNameIgnoreCase.get(path);
|
||||
@ -35923,17 +36074,7 @@ var ts;
|
||||
!options.noResolve &&
|
||||
i < file.imports.length;
|
||||
if (shouldAddFile) {
|
||||
var importedFile = findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), false, false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end);
|
||||
if (importedFile && resolution.isExternalLibraryImport) {
|
||||
if (!ts.isExternalModule(importedFile) && importedFile.statements.length) {
|
||||
var start_5 = ts.getTokenPosOfNode(file.imports[i], file);
|
||||
fileProcessingDiagnostics.add(ts.createFileDiagnostic(file, start_5, file.imports[i].end - start_5, ts.Diagnostics.Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition, importedFile.fileName));
|
||||
}
|
||||
else if (importedFile.referencedFiles.length) {
|
||||
var firstRef = importedFile.referencedFiles[0];
|
||||
fileProcessingDiagnostics.add(ts.createFileDiagnostic(importedFile, firstRef.pos, firstRef.end - firstRef.pos, ts.Diagnostics.Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition));
|
||||
}
|
||||
}
|
||||
findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), false, false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -36018,7 +36159,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
else {
|
||||
programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Substututions_for_pattern_0_should_be_an_array, key));
|
||||
programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Substitutions_for_pattern_0_should_be_an_array, key));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -36067,13 +36208,19 @@ var ts;
|
||||
}
|
||||
else if (firstExternalModuleSourceFile && languageVersion < 2 && options.module === ts.ModuleKind.None) {
|
||||
var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator);
|
||||
programDiagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided_with_a_valid_module_type_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file));
|
||||
programDiagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none));
|
||||
}
|
||||
if (options.module === ts.ModuleKind.ES6 && languageVersion < 2) {
|
||||
programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_modules_into_es2015_when_targeting_ES5_or_lower));
|
||||
}
|
||||
if (outFile && options.module && !(options.module === ts.ModuleKind.AMD || options.module === ts.ModuleKind.System)) {
|
||||
programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? "out" : "outFile"));
|
||||
if (outFile) {
|
||||
if (options.module && !(options.module === ts.ModuleKind.AMD || options.module === ts.ModuleKind.System)) {
|
||||
programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? "out" : "outFile"));
|
||||
}
|
||||
else if (options.module === undefined && firstExternalModuleSourceFile) {
|
||||
var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator);
|
||||
programDiagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, options.out ? "out" : "outFile"));
|
||||
}
|
||||
}
|
||||
if (options.outDir ||
|
||||
options.sourceRoot ||
|
||||
@ -36156,6 +36303,11 @@ var ts;
|
||||
type: "boolean",
|
||||
description: ts.Diagnostics.Print_this_message
|
||||
},
|
||||
{
|
||||
name: "help",
|
||||
shortName: "?",
|
||||
type: "boolean"
|
||||
},
|
||||
{
|
||||
name: "init",
|
||||
type: "boolean",
|
||||
@ -36258,6 +36410,11 @@ var ts;
|
||||
name: "skipDefaultLibCheck",
|
||||
type: "boolean"
|
||||
},
|
||||
{
|
||||
name: "skipLibCheck",
|
||||
type: "boolean",
|
||||
description: ts.Diagnostics.Skip_type_checking_of_declaration_files
|
||||
},
|
||||
{
|
||||
name: "out",
|
||||
type: "string",
|
||||
|
||||
431
lib/tsserver.js
431
lib/tsserver.js
@ -918,6 +918,10 @@ var ts;
|
||||
}
|
||||
return result.sort();
|
||||
}
|
||||
function getDirectories(path) {
|
||||
var folder = fso.GetFolder(path);
|
||||
return getNames(folder.subfolders);
|
||||
}
|
||||
function readDirectory(path, extension, exclude) {
|
||||
var result = [];
|
||||
exclude = ts.map(exclude, function (s) { return getCanonicalPath(ts.combinePaths(path, s)); });
|
||||
@ -972,6 +976,7 @@ var ts;
|
||||
getCurrentDirectory: function () {
|
||||
return new ActiveXObject("WScript.Shell").CurrentDirectory;
|
||||
},
|
||||
getDirectories: getDirectories,
|
||||
readDirectory: readDirectory,
|
||||
exit: function (exitCode) {
|
||||
try {
|
||||
@ -1119,6 +1124,9 @@ var ts;
|
||||
function directoryExists(path) {
|
||||
return fileSystemEntryExists(path, 1);
|
||||
}
|
||||
function getDirectories(path) {
|
||||
return ts.filter(_fs.readdirSync(path), function (p) { return fileSystemEntryExists(ts.combinePaths(path, p), 1); });
|
||||
}
|
||||
function readDirectory(path, extension, exclude) {
|
||||
var result = [];
|
||||
exclude = ts.map(exclude, function (s) { return getCanonicalPath(ts.combinePaths(path, s)); });
|
||||
@ -1211,6 +1219,7 @@ var ts;
|
||||
getCurrentDirectory: function () {
|
||||
return process.cwd();
|
||||
},
|
||||
getDirectories: getDirectories,
|
||||
readDirectory: readDirectory,
|
||||
getModifiedTime: function (path) {
|
||||
try {
|
||||
@ -1261,6 +1270,7 @@ var ts;
|
||||
createDirectory: ChakraHost.createDirectory,
|
||||
getExecutingFilePath: function () { return ChakraHost.executingFile; },
|
||||
getCurrentDirectory: function () { return ChakraHost.currentDirectory; },
|
||||
getDirectories: ChakraHost.getDirectories,
|
||||
readDirectory: ChakraHost.readDirectory,
|
||||
exit: ChakraHost.quit,
|
||||
realpath: realpath
|
||||
@ -1394,7 +1404,7 @@ var ts;
|
||||
or_expected: { code: 1144, category: ts.DiagnosticCategory.Error, key: "or_expected_1144", message: "'{' or ';' expected." },
|
||||
Declaration_expected: { code: 1146, category: ts.DiagnosticCategory.Error, key: "Declaration_expected_1146", message: "Declaration expected." },
|
||||
Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", message: "Import declarations in a namespace cannot reference a module." },
|
||||
Cannot_compile_modules_unless_the_module_flag_is_provided_with_a_valid_module_type_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_unless_the_module_flag_is_provided_with_a_valid_module_type_Consider_setting__1148", message: "Cannot compile modules unless the '--module' flag is provided with a valid module type. Consider setting the 'module' compiler option in a 'tsconfig.json' file." },
|
||||
Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148", message: "Cannot use imports, exports, or module augmentations when '--module' is 'none'." },
|
||||
File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing" },
|
||||
new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: ts.DiagnosticCategory.Error, key: "new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead_1150", message: "'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead." },
|
||||
const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized" },
|
||||
@ -1764,6 +1774,8 @@ var ts;
|
||||
this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation: { code: 2683, category: ts.DiagnosticCategory.Error, key: "this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683", message: "'this' implicitly has type 'any' because it does not have a type annotation." },
|
||||
The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1: { code: 2684, category: ts.DiagnosticCategory.Error, key: "The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684", message: "The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'." },
|
||||
The_this_types_of_each_signature_are_incompatible: { code: 2685, category: ts.DiagnosticCategory.Error, key: "The_this_types_of_each_signature_are_incompatible_2685", message: "The 'this' types of each signature are incompatible." },
|
||||
Identifier_0_must_be_imported_from_a_module: { code: 2686, category: ts.DiagnosticCategory.Error, key: "Identifier_0_must_be_imported_from_a_module_2686", message: "Identifier '{0}' must be imported from a module" },
|
||||
All_declarations_of_0_must_have_identical_modifiers: { code: 2687, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_0_must_have_identical_modifiers_2687", message: "All declarations of '{0}' must have identical modifiers." },
|
||||
Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import_declaration_0_is_using_private_name_1_4000", message: "Import declaration '{0}' is using private name '{1}'." },
|
||||
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", message: "Type parameter '{0}' of exported class has or is using private name '{1}'." },
|
||||
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", message: "Type parameter '{0}' of exported interface has or is using private name '{1}'." },
|
||||
@ -1857,7 +1869,7 @@ var ts;
|
||||
Option_paths_cannot_be_used_without_specifying_baseUrl_option: { code: 5060, category: ts.DiagnosticCategory.Error, key: "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", message: "Option 'paths' cannot be used without specifying '--baseUrl' option." },
|
||||
Pattern_0_can_have_at_most_one_Asterisk_character: { code: 5061, category: ts.DiagnosticCategory.Error, key: "Pattern_0_can_have_at_most_one_Asterisk_character_5061", message: "Pattern '{0}' can have at most one '*' character" },
|
||||
Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: { code: 5062, category: ts.DiagnosticCategory.Error, key: "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062", message: "Substitution '{0}' in pattern '{1}' in can have at most one '*' character" },
|
||||
Substututions_for_pattern_0_should_be_an_array: { code: 5063, category: ts.DiagnosticCategory.Error, key: "Substututions_for_pattern_0_should_be_an_array_5063", message: "Substututions for pattern '{0}' should be an array." },
|
||||
Substitutions_for_pattern_0_should_be_an_array: { code: 5063, category: ts.DiagnosticCategory.Error, key: "Substitutions_for_pattern_0_should_be_an_array_5063", message: "Substitutions for pattern '{0}' should be an array." },
|
||||
Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: { code: 5064, category: ts.DiagnosticCategory.Error, key: "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064", message: "Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'." },
|
||||
Concatenate_and_emit_output_to_single_file: { code: 6001, category: ts.DiagnosticCategory.Message, key: "Concatenate_and_emit_output_to_single_file_6001", message: "Concatenate and emit output to single file." },
|
||||
Generates_corresponding_d_ts_file: { code: 6002, category: ts.DiagnosticCategory.Message, key: "Generates_corresponding_d_ts_file_6002", message: "Generates corresponding '.d.ts' file." },
|
||||
@ -1870,6 +1882,7 @@ var ts;
|
||||
Do_not_emit_comments_to_output: { code: 6009, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_comments_to_output_6009", message: "Do not emit comments to output." },
|
||||
Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_outputs_6010", message: "Do not emit outputs." },
|
||||
Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: { code: 6011, category: ts.DiagnosticCategory.Message, key: "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", message: "Allow default imports from modules with no default export. This does not affect code emit, just typechecking." },
|
||||
Skip_type_checking_of_declaration_files: { code: 6012, category: ts.DiagnosticCategory.Message, key: "Skip_type_checking_of_declaration_files_6012", message: "Skip type checking of declaration files." },
|
||||
Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES2015'" },
|
||||
Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'" },
|
||||
Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print_this_message_6017", message: "Print this message." },
|
||||
@ -1971,6 +1984,7 @@ var ts;
|
||||
Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set: { code: 6128, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128", message: "======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========" },
|
||||
The_config_file_0_found_doesn_t_contain_any_source_files: { code: 6129, category: ts.DiagnosticCategory.Error, key: "The_config_file_0_found_doesn_t_contain_any_source_files_6129", message: "The config file '{0}' found doesn't contain any source files." },
|
||||
Resolving_real_path_for_0_result_1: { code: 6130, category: ts.DiagnosticCategory.Message, key: "Resolving_real_path_for_0_result_1_6130", message: "Resolving real path for '{0}', result '{1}'" },
|
||||
Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: { code: 6131, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131", message: "Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'." },
|
||||
Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_an_1_type_7005", message: "Variable '{0}' implicitly has an '{1}' type." },
|
||||
Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter_0_implicitly_has_an_1_type_7006", message: "Parameter '{0}' implicitly has an '{1}' type." },
|
||||
Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member_0_implicitly_has_an_1_type_7008", message: "Member '{0}' implicitly has an '{1}' type." },
|
||||
@ -3537,6 +3551,11 @@ var ts;
|
||||
type: "boolean",
|
||||
description: ts.Diagnostics.Print_this_message
|
||||
},
|
||||
{
|
||||
name: "help",
|
||||
shortName: "?",
|
||||
type: "boolean"
|
||||
},
|
||||
{
|
||||
name: "init",
|
||||
type: "boolean",
|
||||
@ -3639,6 +3658,11 @@ var ts;
|
||||
name: "skipDefaultLibCheck",
|
||||
type: "boolean"
|
||||
},
|
||||
{
|
||||
name: "skipLibCheck",
|
||||
type: "boolean",
|
||||
description: ts.Diagnostics.Skip_type_checking_of_declaration_files
|
||||
},
|
||||
{
|
||||
name: "out",
|
||||
type: "string",
|
||||
@ -5758,7 +5782,7 @@ var ts;
|
||||
}
|
||||
ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically;
|
||||
function getPropertyNameForPropertyNameNode(name) {
|
||||
if (name.kind === 69 || name.kind === 9 || name.kind === 8) {
|
||||
if (name.kind === 69 || name.kind === 9 || name.kind === 8 || name.kind === 142) {
|
||||
return name.text;
|
||||
}
|
||||
if (name.kind === 140) {
|
||||
@ -12804,10 +12828,10 @@ var ts;
|
||||
case 145:
|
||||
case 144:
|
||||
case 266:
|
||||
return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455);
|
||||
return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 0);
|
||||
case 253:
|
||||
case 254:
|
||||
return bindPropertyOrMethodOrAccessor(node, 4, 107455);
|
||||
return bindPropertyOrMethodOrAccessor(node, 4, 0);
|
||||
case 255:
|
||||
return bindPropertyOrMethodOrAccessor(node, 8, 107455);
|
||||
case 247:
|
||||
@ -12819,7 +12843,7 @@ var ts;
|
||||
return declareSymbolAndAddToSymbolTable(node, 131072, 0);
|
||||
case 147:
|
||||
case 146:
|
||||
return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263);
|
||||
return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 0 : 99263);
|
||||
case 220:
|
||||
return bindFunctionDeclaration(node);
|
||||
case 148:
|
||||
@ -12862,7 +12886,7 @@ var ts;
|
||||
case 238:
|
||||
return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608);
|
||||
case 228:
|
||||
return bindGlobalModuleExportDeclaration(node);
|
||||
return bindNamespaceExportDeclaration(node);
|
||||
case 231:
|
||||
return bindImportClause(node);
|
||||
case 236:
|
||||
@ -12898,13 +12922,13 @@ var ts;
|
||||
bindAnonymousDeclaration(node, 8388608, getDeclarationName(node));
|
||||
}
|
||||
else if (boundExpression.kind === 69 && node.kind === 235) {
|
||||
declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 107455 | 8388608);
|
||||
declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 0 | 8388608);
|
||||
}
|
||||
else {
|
||||
declareSymbol(container.symbol.exports, container.symbol, node, 4, 107455 | 8388608);
|
||||
declareSymbol(container.symbol.exports, container.symbol, node, 4, 0 | 8388608);
|
||||
}
|
||||
}
|
||||
function bindGlobalModuleExportDeclaration(node) {
|
||||
function bindNamespaceExportDeclaration(node) {
|
||||
if (node.modifiers && node.modifiers.length) {
|
||||
file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Modifiers_cannot_appear_here));
|
||||
}
|
||||
@ -12956,7 +12980,7 @@ var ts;
|
||||
function bindThisPropertyAssignment(node) {
|
||||
if (container.kind === 179 || container.kind === 220) {
|
||||
container.symbol.members = container.symbol.members || {};
|
||||
declareSymbol(container.symbol.members, container.symbol, node, 4, 107455 & ~4);
|
||||
declareSymbol(container.symbol.members, container.symbol, node, 4, 0 & ~4);
|
||||
}
|
||||
}
|
||||
function bindPrototypePropertyAssignment(node) {
|
||||
@ -12973,7 +12997,7 @@ var ts;
|
||||
if (!funcSymbol.members) {
|
||||
funcSymbol.members = {};
|
||||
}
|
||||
declareSymbol(funcSymbol.members, funcSymbol, leftSideOfAssignment, 4, 107455);
|
||||
declareSymbol(funcSymbol.members, funcSymbol, leftSideOfAssignment, 4, 0);
|
||||
}
|
||||
function bindCallExpression(node) {
|
||||
if (!file.commonJsModuleIndicator && ts.isRequireCall(node, false)) {
|
||||
@ -13049,7 +13073,7 @@ var ts;
|
||||
}
|
||||
if (ts.isParameterPropertyDeclaration(node)) {
|
||||
var classDeclaration = node.parent.parent;
|
||||
declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455);
|
||||
declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 0);
|
||||
}
|
||||
}
|
||||
function bindFunctionDeclaration(node) {
|
||||
@ -13349,7 +13373,7 @@ var ts;
|
||||
if (flags & 1)
|
||||
result |= 107454;
|
||||
if (flags & 4)
|
||||
result |= 107455;
|
||||
result |= 0;
|
||||
if (flags & 8)
|
||||
result |= 107455;
|
||||
if (flags & 16)
|
||||
@ -13605,6 +13629,7 @@ var ts;
|
||||
var propertyWithInvalidInitializer;
|
||||
var errorLocation = location;
|
||||
var grandparent;
|
||||
var isInExternalModule = false;
|
||||
loop: while (location) {
|
||||
if (location.locals && !isGlobalSourceFile(location)) {
|
||||
if (result = getSymbol(location.locals, name, meaning)) {
|
||||
@ -13636,6 +13661,7 @@ var ts;
|
||||
case 256:
|
||||
if (!ts.isExternalOrCommonJsModule(location))
|
||||
break;
|
||||
isInExternalModule = true;
|
||||
case 225:
|
||||
var moduleExports = getSymbolOfNode(location).exports;
|
||||
if (location.kind === 256 || ts.isAmbientModule(location)) {
|
||||
@ -13759,6 +13785,12 @@ var ts;
|
||||
checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation);
|
||||
}
|
||||
}
|
||||
if (result && isInExternalModule) {
|
||||
var decls = result.declarations;
|
||||
if (decls && decls.length === 1 && decls[0].kind === 228) {
|
||||
error(errorLocation, ts.Diagnostics.Identifier_0_must_be_imported_from_a_module, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -15234,7 +15266,7 @@ var ts;
|
||||
}
|
||||
function getTypeForBindingElementParent(node) {
|
||||
var symbol = getSymbolOfNode(node);
|
||||
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node);
|
||||
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, false);
|
||||
}
|
||||
function getTextOfPropertyName(name) {
|
||||
switch (name.kind) {
|
||||
@ -15339,7 +15371,7 @@ var ts;
|
||||
function addOptionality(type, optional) {
|
||||
return strictNullChecks && optional ? addNullableKind(type, 32) : type;
|
||||
}
|
||||
function getTypeForVariableLikeDeclaration(declaration) {
|
||||
function getTypeForVariableLikeDeclaration(declaration, includeOptionality) {
|
||||
if (declaration.flags & 134217728) {
|
||||
var type = getTypeForVariableLikeDeclarationFromJSDocComment(declaration);
|
||||
if (type && type !== unknownType) {
|
||||
@ -15356,7 +15388,7 @@ var ts;
|
||||
return getTypeForBindingElement(declaration);
|
||||
}
|
||||
if (declaration.type) {
|
||||
return addOptionality(getTypeFromTypeNode(declaration.type), !!declaration.questionToken);
|
||||
return addOptionality(getTypeFromTypeNode(declaration.type), declaration.questionToken && includeOptionality);
|
||||
}
|
||||
if (declaration.kind === 142) {
|
||||
var func = declaration.parent;
|
||||
@ -15375,11 +15407,11 @@ var ts;
|
||||
? getContextuallyTypedThisType(func)
|
||||
: getContextuallyTypedParameterType(declaration);
|
||||
if (type) {
|
||||
return addOptionality(type, !!declaration.questionToken);
|
||||
return addOptionality(type, declaration.questionToken && includeOptionality);
|
||||
}
|
||||
}
|
||||
if (declaration.initializer) {
|
||||
return addOptionality(checkExpressionCached(declaration.initializer), !!declaration.questionToken);
|
||||
return addOptionality(checkExpressionCached(declaration.initializer), declaration.questionToken && includeOptionality);
|
||||
}
|
||||
if (declaration.kind === 254) {
|
||||
return checkIdentifier(declaration.name);
|
||||
@ -15447,7 +15479,7 @@ var ts;
|
||||
: getTypeFromArrayBindingPattern(pattern, includePatternInType);
|
||||
}
|
||||
function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors) {
|
||||
var type = getTypeForVariableLikeDeclaration(declaration);
|
||||
var type = getTypeForVariableLikeDeclaration(declaration, true);
|
||||
if (type) {
|
||||
if (reportErrors) {
|
||||
reportErrorsFromWidening(declaration, type);
|
||||
@ -17764,7 +17796,7 @@ var ts;
|
||||
return isIdenticalTo(source, target);
|
||||
}
|
||||
if (!(target.flags & 134217728)) {
|
||||
if (target.flags & 1)
|
||||
if (target.flags & 1 || source.flags & 134217728)
|
||||
return -1;
|
||||
if (source.flags & 32) {
|
||||
if (!strictNullChecks || target.flags & (32 | 16) || source === emptyArrayElementType)
|
||||
@ -17784,7 +17816,7 @@ var ts;
|
||||
if (source.flags & 256 && target === stringType)
|
||||
return -1;
|
||||
if (relation === assignableRelation || relation === comparableRelation) {
|
||||
if (source.flags & (1 | 134217728))
|
||||
if (source.flags & 1)
|
||||
return -1;
|
||||
if (source === numberType && target.flags & 128)
|
||||
return -1;
|
||||
@ -18561,41 +18593,47 @@ var ts;
|
||||
getSignaturesOfType(type, 0).length === 0 &&
|
||||
getSignaturesOfType(type, 1).length === 0;
|
||||
}
|
||||
function createTransientSymbol(source, type) {
|
||||
var symbol = createSymbol(source.flags | 67108864, source.name);
|
||||
symbol.declarations = source.declarations;
|
||||
symbol.parent = source.parent;
|
||||
symbol.type = type;
|
||||
symbol.target = source;
|
||||
if (source.valueDeclaration) {
|
||||
symbol.valueDeclaration = source.valueDeclaration;
|
||||
}
|
||||
return symbol;
|
||||
}
|
||||
function transformTypeOfMembers(type, f) {
|
||||
var members = {};
|
||||
for (var _i = 0, _a = getPropertiesOfObjectType(type); _i < _a.length; _i++) {
|
||||
var property = _a[_i];
|
||||
var original = getTypeOfSymbol(property);
|
||||
var updated = f(original);
|
||||
members[property.name] = updated === original ? property : createTransientSymbol(property, updated);
|
||||
}
|
||||
;
|
||||
return members;
|
||||
}
|
||||
function getRegularTypeOfObjectLiteral(type) {
|
||||
if (type.flags & 1048576) {
|
||||
var regularType = type.regularType;
|
||||
if (!regularType) {
|
||||
regularType = createType(type.flags & ~1048576);
|
||||
regularType.symbol = type.symbol;
|
||||
regularType.members = type.members;
|
||||
regularType.properties = type.properties;
|
||||
regularType.callSignatures = type.callSignatures;
|
||||
regularType.constructSignatures = type.constructSignatures;
|
||||
regularType.stringIndexInfo = type.stringIndexInfo;
|
||||
regularType.numberIndexInfo = type.numberIndexInfo;
|
||||
type.regularType = regularType;
|
||||
}
|
||||
if (!(type.flags & 1048576)) {
|
||||
return type;
|
||||
}
|
||||
var regularType = type.regularType;
|
||||
if (regularType) {
|
||||
return regularType;
|
||||
}
|
||||
return type;
|
||||
var resolved = type;
|
||||
var members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral);
|
||||
var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.stringIndexInfo, resolved.numberIndexInfo);
|
||||
regularNew.flags = resolved.flags & ~1048576;
|
||||
type.regularType = regularNew;
|
||||
return regularNew;
|
||||
}
|
||||
function getWidenedTypeOfObjectLiteral(type) {
|
||||
var properties = getPropertiesOfObjectType(type);
|
||||
var members = {};
|
||||
ts.forEach(properties, function (p) {
|
||||
var propType = getTypeOfSymbol(p);
|
||||
var widenedType = getWidenedType(propType);
|
||||
if (propType !== widenedType) {
|
||||
var symbol = createSymbol(p.flags | 67108864, p.name);
|
||||
symbol.declarations = p.declarations;
|
||||
symbol.parent = p.parent;
|
||||
symbol.type = widenedType;
|
||||
symbol.target = p;
|
||||
if (p.valueDeclaration)
|
||||
symbol.valueDeclaration = p.valueDeclaration;
|
||||
p = symbol;
|
||||
}
|
||||
members[p.name] = p;
|
||||
var members = transformTypeOfMembers(type, function (prop) {
|
||||
var widened = getWidenedType(prop);
|
||||
return prop === widened ? prop : widened;
|
||||
});
|
||||
var stringIndexInfo = getIndexInfoOfType(type, 0);
|
||||
var numberIndexInfo = getIndexInfoOfType(type, 1);
|
||||
@ -19888,7 +19926,7 @@ var ts;
|
||||
}
|
||||
return nodeCheckFlag === 512
|
||||
? getBaseConstructorTypeOfClass(classType)
|
||||
: baseClassType;
|
||||
: getTypeWithThisArgument(baseClassType, classType.thisType);
|
||||
function isLegalUsageOfSuperExpression(container) {
|
||||
if (!container) {
|
||||
return false;
|
||||
@ -21936,7 +21974,7 @@ var ts;
|
||||
var types = void 0;
|
||||
var funcIsGenerator = !!func.asteriskToken;
|
||||
if (funcIsGenerator) {
|
||||
types = checkAndAggregateYieldOperandTypes(func.body, contextualMapper);
|
||||
types = checkAndAggregateYieldOperandTypes(func, contextualMapper);
|
||||
if (types.length === 0) {
|
||||
var iterableIteratorAny = createIterableIteratorType(anyType);
|
||||
if (compilerOptions.noImplicitAny) {
|
||||
@ -21946,8 +21984,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
else {
|
||||
var hasImplicitReturn = !!(func.flags & 32768);
|
||||
types = checkAndAggregateReturnExpressionTypes(func.body, contextualMapper, isAsync, hasImplicitReturn);
|
||||
types = checkAndAggregateReturnExpressionTypes(func, contextualMapper);
|
||||
if (!types) {
|
||||
return neverType;
|
||||
}
|
||||
@ -21994,9 +22031,9 @@ var ts;
|
||||
return widenedType;
|
||||
}
|
||||
}
|
||||
function checkAndAggregateYieldOperandTypes(body, contextualMapper) {
|
||||
function checkAndAggregateYieldOperandTypes(func, contextualMapper) {
|
||||
var aggregatedTypes = [];
|
||||
ts.forEachYieldExpression(body, function (yieldExpression) {
|
||||
ts.forEachYieldExpression(func.body, function (yieldExpression) {
|
||||
var expr = yieldExpression.expression;
|
||||
if (expr) {
|
||||
var type = checkExpressionCached(expr, contextualMapper);
|
||||
@ -22010,28 +22047,34 @@ var ts;
|
||||
});
|
||||
return aggregatedTypes;
|
||||
}
|
||||
function checkAndAggregateReturnExpressionTypes(body, contextualMapper, isAsync, hasImplicitReturn) {
|
||||
function checkAndAggregateReturnExpressionTypes(func, contextualMapper) {
|
||||
var isAsync = ts.isAsyncFunctionLike(func);
|
||||
var aggregatedTypes = [];
|
||||
var hasOmittedExpressions = false;
|
||||
ts.forEachReturnStatement(body, function (returnStatement) {
|
||||
var hasReturnWithNoExpression = !!(func.flags & 32768);
|
||||
var hasReturnOfTypeNever = false;
|
||||
ts.forEachReturnStatement(func.body, function (returnStatement) {
|
||||
var expr = returnStatement.expression;
|
||||
if (expr) {
|
||||
var type = checkExpressionCached(expr, contextualMapper);
|
||||
if (isAsync) {
|
||||
type = checkAwaitedType(type, body.parent, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member);
|
||||
type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member);
|
||||
}
|
||||
if (type !== neverType && !ts.contains(aggregatedTypes, type)) {
|
||||
if (type === neverType) {
|
||||
hasReturnOfTypeNever = true;
|
||||
}
|
||||
else if (!ts.contains(aggregatedTypes, type)) {
|
||||
aggregatedTypes.push(type);
|
||||
}
|
||||
}
|
||||
else {
|
||||
hasOmittedExpressions = true;
|
||||
hasReturnWithNoExpression = true;
|
||||
}
|
||||
});
|
||||
if (aggregatedTypes.length === 0 && !hasOmittedExpressions && !hasImplicitReturn) {
|
||||
if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever ||
|
||||
func.kind === 179 || func.kind === 180)) {
|
||||
return undefined;
|
||||
}
|
||||
if (strictNullChecks && aggregatedTypes.length && (hasOmittedExpressions || hasImplicitReturn)) {
|
||||
if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression) {
|
||||
if (!ts.contains(aggregatedTypes, undefinedType)) {
|
||||
aggregatedTypes.push(undefinedType);
|
||||
}
|
||||
@ -22161,7 +22204,9 @@ var ts;
|
||||
(expr.kind === 172 || expr.kind === 173) &&
|
||||
expr.expression.kind === 97) {
|
||||
var func = ts.getContainingFunction(expr);
|
||||
return !(func && func.kind === 148 && func.parent === symbol.valueDeclaration.parent);
|
||||
if (!(func && func.kind === 148))
|
||||
return true;
|
||||
return !(func.parent === symbol.valueDeclaration.parent || func === symbol.valueDeclaration.parent);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -22985,6 +23030,79 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
function checkClassForDuplicateDeclarations(node) {
|
||||
var getter = 1, setter = 2, property = getter | setter;
|
||||
var instanceNames = {};
|
||||
var staticNames = {};
|
||||
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
||||
var member = _a[_i];
|
||||
if (member.kind === 148) {
|
||||
for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) {
|
||||
var param = _c[_b];
|
||||
if (ts.isParameterPropertyDeclaration(param)) {
|
||||
addName(instanceNames, param.name, param.name.text, property);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
var static = ts.forEach(member.modifiers, function (m) { return m.kind === 113; });
|
||||
var names = static ? staticNames : instanceNames;
|
||||
var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name);
|
||||
if (memberName) {
|
||||
switch (member.kind) {
|
||||
case 149:
|
||||
addName(names, member.name, memberName, getter);
|
||||
break;
|
||||
case 150:
|
||||
addName(names, member.name, memberName, setter);
|
||||
break;
|
||||
case 145:
|
||||
addName(names, member.name, memberName, property);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function addName(names, location, name, meaning) {
|
||||
if (ts.hasProperty(names, name)) {
|
||||
var prev = names[name];
|
||||
if (prev & meaning) {
|
||||
error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location));
|
||||
}
|
||||
else {
|
||||
names[name] = prev | meaning;
|
||||
}
|
||||
}
|
||||
else {
|
||||
names[name] = meaning;
|
||||
}
|
||||
}
|
||||
}
|
||||
function checkObjectTypeForDuplicateDeclarations(node) {
|
||||
var names = {};
|
||||
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
||||
var member = _a[_i];
|
||||
if (member.kind == 144) {
|
||||
var memberName = void 0;
|
||||
switch (member.name.kind) {
|
||||
case 9:
|
||||
case 8:
|
||||
case 69:
|
||||
memberName = member.name.text;
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
if (ts.hasProperty(names, memberName)) {
|
||||
error(member.symbol.valueDeclaration.name, ts.Diagnostics.Duplicate_identifier_0, memberName);
|
||||
error(member.name, ts.Diagnostics.Duplicate_identifier_0, memberName);
|
||||
}
|
||||
else {
|
||||
names[memberName] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function checkTypeForDuplicateIndexSignatures(node) {
|
||||
if (node.kind === 222) {
|
||||
var nodeSymbol = getSymbolOfNode(node);
|
||||
@ -23203,6 +23321,7 @@ var ts;
|
||||
var type = getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
|
||||
checkIndexConstraints(type);
|
||||
checkTypeForDuplicateIndexSignatures(node);
|
||||
checkObjectTypeForDuplicateDeclarations(node);
|
||||
}
|
||||
}
|
||||
function checkArrayType(node) {
|
||||
@ -23962,6 +24081,10 @@ var ts;
|
||||
if (node.initializer) {
|
||||
checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, undefined);
|
||||
}
|
||||
if (!areDeclarationFlagsIdentical(node, symbol.valueDeclaration)) {
|
||||
error(symbol.valueDeclaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name));
|
||||
error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name));
|
||||
}
|
||||
}
|
||||
if (node.kind !== 145 && node.kind !== 144) {
|
||||
checkExportsOnMergedDeclarations(node);
|
||||
@ -23974,6 +24097,18 @@ var ts;
|
||||
checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
|
||||
}
|
||||
}
|
||||
function areDeclarationFlagsIdentical(left, right) {
|
||||
if (ts.hasQuestionToken(left) !== ts.hasQuestionToken(right)) {
|
||||
return false;
|
||||
}
|
||||
var interestingFlags = 8 |
|
||||
16 |
|
||||
256 |
|
||||
128 |
|
||||
64 |
|
||||
32;
|
||||
return (left.flags & interestingFlags) === (right.flags & interestingFlags);
|
||||
}
|
||||
function checkVariableDeclaration(node) {
|
||||
checkGrammarVariableDeclaration(node);
|
||||
return checkVariableLikeDeclaration(node);
|
||||
@ -24524,6 +24659,7 @@ var ts;
|
||||
var typeWithThis = getTypeWithThisArgument(type);
|
||||
var staticType = getTypeOfSymbol(symbol);
|
||||
checkTypeParameterListsIdentical(node, symbol);
|
||||
checkClassForDuplicateDeclarations(node);
|
||||
var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node);
|
||||
if (baseTypeNode) {
|
||||
var baseTypes = getBaseTypes(type);
|
||||
@ -24735,6 +24871,7 @@ var ts;
|
||||
checkIndexConstraints(type);
|
||||
}
|
||||
}
|
||||
checkObjectTypeForDuplicateDeclarations(node);
|
||||
}
|
||||
ts.forEach(ts.getInterfaceBaseTypeNodes(node), function (heritageElement) {
|
||||
if (!ts.isSupportedExpressionWithTypeArguments(heritageElement)) {
|
||||
@ -25489,10 +25626,8 @@ var ts;
|
||||
function checkSourceFileWorker(node) {
|
||||
var links = getNodeLinks(node);
|
||||
if (!(links.flags & 1)) {
|
||||
if (compilerOptions.skipDefaultLibCheck) {
|
||||
if (node.hasNoDefaultLib) {
|
||||
return;
|
||||
}
|
||||
if (compilerOptions.skipLibCheck && node.isDeclarationFile || compilerOptions.skipDefaultLibCheck && node.hasNoDefaultLib) {
|
||||
return;
|
||||
}
|
||||
checkGrammarSourceFile(node);
|
||||
potentialThisCollisions.length = 0;
|
||||
@ -25861,7 +25996,7 @@ var ts;
|
||||
return symbol && getTypeOfSymbol(symbol);
|
||||
}
|
||||
if (ts.isBindingPattern(node)) {
|
||||
return getTypeForVariableLikeDeclaration(node.parent);
|
||||
return getTypeForVariableLikeDeclaration(node.parent, true);
|
||||
}
|
||||
if (isInRightSideOfImportOrExportAssignment(node)) {
|
||||
var symbol = getSymbolAtLocation(node);
|
||||
@ -26300,7 +26435,7 @@ var ts;
|
||||
if (file.moduleAugmentations.length) {
|
||||
(augmentations || (augmentations = [])).push(file.moduleAugmentations);
|
||||
}
|
||||
if (file.wasReferenced && file.symbol && file.symbol.globalExports) {
|
||||
if (file.symbol && file.symbol.globalExports) {
|
||||
mergeSymbolTable(globals, file.symbol.globalExports);
|
||||
}
|
||||
});
|
||||
@ -26870,7 +27005,6 @@ var ts;
|
||||
if (prop.kind === 193 ||
|
||||
name_20.kind === 140) {
|
||||
checkGrammarComputedPropertyName(name_20);
|
||||
return "continue";
|
||||
}
|
||||
if (prop.kind === 254 && !inDestructuring && prop.objectAssignmentInitializer) {
|
||||
return { value: grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment) };
|
||||
@ -26900,17 +27034,21 @@ var ts;
|
||||
else {
|
||||
ts.Debug.fail("Unexpected syntax kind:" + prop.kind);
|
||||
}
|
||||
if (!ts.hasProperty(seen, name_20.text)) {
|
||||
seen[name_20.text] = currentKind;
|
||||
var effectiveName = ts.getPropertyNameForPropertyNameNode(name_20);
|
||||
if (effectiveName === undefined) {
|
||||
return "continue";
|
||||
}
|
||||
if (!ts.hasProperty(seen, effectiveName)) {
|
||||
seen[effectiveName] = currentKind;
|
||||
}
|
||||
else {
|
||||
var existingKind = seen[name_20.text];
|
||||
var existingKind = seen[effectiveName];
|
||||
if (currentKind === Property && existingKind === Property) {
|
||||
return "continue";
|
||||
grammarErrorOnNode(name_20, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name_20));
|
||||
}
|
||||
else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) {
|
||||
if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) {
|
||||
seen[name_20.text] = currentKind | existingKind;
|
||||
seen[effectiveName] = currentKind | existingKind;
|
||||
}
|
||||
else {
|
||||
return { value: grammarErrorOnNode(name_20, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name) };
|
||||
@ -35367,7 +35505,7 @@ var ts;
|
||||
skipTsx: true,
|
||||
traceEnabled: traceEnabled
|
||||
};
|
||||
var rootDir = options.typesRoot || (options.configFilePath ? ts.getDirectoryPath(options.configFilePath) : undefined);
|
||||
var rootDir = options.typesRoot || (options.configFilePath ? ts.getDirectoryPath(options.configFilePath) : (host.getCurrentDirectory && host.getCurrentDirectory()));
|
||||
if (traceEnabled) {
|
||||
if (containingFile === undefined) {
|
||||
if (rootDir === undefined) {
|
||||
@ -35870,12 +36008,25 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getDefaultTypeDirectiveNames(rootPath) {
|
||||
var localTypes = ts.combinePaths(rootPath, "types");
|
||||
var npmTypes = ts.combinePaths(rootPath, "node_modules/@types");
|
||||
var result = [];
|
||||
if (ts.sys.directoryExists(localTypes)) {
|
||||
result = result.concat(ts.sys.getDirectories(localTypes));
|
||||
}
|
||||
if (ts.sys.directoryExists(npmTypes)) {
|
||||
result = result.concat(ts.sys.getDirectories(npmTypes));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function getDefaultLibLocation() {
|
||||
return ts.getDirectoryPath(ts.normalizePath(ts.sys.getExecutingFilePath()));
|
||||
}
|
||||
var newLine = ts.getNewLineCharacter(options);
|
||||
var realpath = ts.sys.realpath && (function (path) { return ts.sys.realpath(path); });
|
||||
return {
|
||||
getDefaultTypeDirectiveNames: getDefaultTypeDirectiveNames,
|
||||
getSourceFile: getSourceFile,
|
||||
getDefaultLibLocation: getDefaultLibLocation,
|
||||
getDefaultLibFileName: function (options) { return ts.combinePaths(getDefaultLibLocation(), ts.getDefaultLibFileName(options)); },
|
||||
@ -35943,6 +36094,19 @@ var ts;
|
||||
}
|
||||
return resolutions;
|
||||
}
|
||||
function getDefaultTypeDirectiveNames(options, rootFiles, host) {
|
||||
if (options.types) {
|
||||
return options.types;
|
||||
}
|
||||
if (host && host.getDefaultTypeDirectiveNames) {
|
||||
var commonRoot = computeCommonSourceDirectoryOfFilenames(rootFiles, host.getCurrentDirectory(), function (f) { return host.getCanonicalFileName(f); });
|
||||
if (commonRoot) {
|
||||
return host.getDefaultTypeDirectiveNames(commonRoot);
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
ts.getDefaultTypeDirectiveNames = getDefaultTypeDirectiveNames;
|
||||
function createProgram(rootNames, options, host, oldProgram) {
|
||||
var program;
|
||||
var files = [];
|
||||
@ -35978,13 +36142,14 @@ var ts;
|
||||
var filesByName = ts.createFileMap();
|
||||
var filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? ts.createFileMap(function (fileName) { return fileName.toLowerCase(); }) : undefined;
|
||||
if (!tryReuseStructureFromOldProgram()) {
|
||||
if (options.types && options.types.length) {
|
||||
var resolutions = resolveTypeReferenceDirectiveNamesWorker(options.types, undefined);
|
||||
for (var i = 0; i < options.types.length; i++) {
|
||||
processTypeReferenceDirective(options.types[i], resolutions[i]);
|
||||
ts.forEach(rootNames, function (name) { return processRootFile(name, false); });
|
||||
var typeReferences = getDefaultTypeDirectiveNames(options, rootNames, host);
|
||||
if (typeReferences) {
|
||||
var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, undefined);
|
||||
for (var i = 0; i < typeReferences.length; i++) {
|
||||
processTypeReferenceDirective(typeReferences[i], resolutions[i]);
|
||||
}
|
||||
}
|
||||
ts.forEach(rootNames, function (name) { return processRootFile(name, false); });
|
||||
if (!skipDefaultLib) {
|
||||
if (!options.lib) {
|
||||
processRootFile(host.getDefaultLibFileName(options), true);
|
||||
@ -36561,9 +36726,6 @@ var ts;
|
||||
if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== ts.getNormalizedAbsolutePath(fileName, currentDirectory)) {
|
||||
reportFileNamesDifferOnlyInCasingError(fileName, file_1.fileName, refFile, refPos, refEnd);
|
||||
}
|
||||
if (file_1) {
|
||||
file_1.wasReferenced = file_1.wasReferenced || isReference;
|
||||
}
|
||||
return file_1;
|
||||
}
|
||||
var file = host.getSourceFile(fileName, options.target, function (hostErrorMessage) {
|
||||
@ -36576,7 +36738,6 @@ var ts;
|
||||
});
|
||||
filesByName.set(path, file);
|
||||
if (file) {
|
||||
file.wasReferenced = file.wasReferenced || isReference;
|
||||
file.path = path;
|
||||
if (host.useCaseSensitiveFileNames()) {
|
||||
var existingFile = filesByNameIgnoreCase.get(path);
|
||||
@ -36677,17 +36838,7 @@ var ts;
|
||||
!options.noResolve &&
|
||||
i < file.imports.length;
|
||||
if (shouldAddFile) {
|
||||
var importedFile = findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), false, false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end);
|
||||
if (importedFile && resolution.isExternalLibraryImport) {
|
||||
if (!ts.isExternalModule(importedFile) && importedFile.statements.length) {
|
||||
var start_5 = ts.getTokenPosOfNode(file.imports[i], file);
|
||||
fileProcessingDiagnostics.add(ts.createFileDiagnostic(file, start_5, file.imports[i].end - start_5, ts.Diagnostics.Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition, importedFile.fileName));
|
||||
}
|
||||
else if (importedFile.referencedFiles.length) {
|
||||
var firstRef = importedFile.referencedFiles[0];
|
||||
fileProcessingDiagnostics.add(ts.createFileDiagnostic(importedFile, firstRef.pos, firstRef.end - firstRef.pos, ts.Diagnostics.Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition));
|
||||
}
|
||||
}
|
||||
findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), false, false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -36772,7 +36923,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
else {
|
||||
programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Substututions_for_pattern_0_should_be_an_array, key));
|
||||
programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Substitutions_for_pattern_0_should_be_an_array, key));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -36821,13 +36972,19 @@ var ts;
|
||||
}
|
||||
else if (firstExternalModuleSourceFile && languageVersion < 2 && options.module === ts.ModuleKind.None) {
|
||||
var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator);
|
||||
programDiagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided_with_a_valid_module_type_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file));
|
||||
programDiagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none));
|
||||
}
|
||||
if (options.module === ts.ModuleKind.ES6 && languageVersion < 2) {
|
||||
programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_modules_into_es2015_when_targeting_ES5_or_lower));
|
||||
}
|
||||
if (outFile && options.module && !(options.module === ts.ModuleKind.AMD || options.module === ts.ModuleKind.System)) {
|
||||
programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? "out" : "outFile"));
|
||||
if (outFile) {
|
||||
if (options.module && !(options.module === ts.ModuleKind.AMD || options.module === ts.ModuleKind.System)) {
|
||||
programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? "out" : "outFile"));
|
||||
}
|
||||
else if (options.module === undefined && firstExternalModuleSourceFile) {
|
||||
var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator);
|
||||
programDiagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, options.out ? "out" : "outFile"));
|
||||
}
|
||||
}
|
||||
if (options.outDir ||
|
||||
options.sourceRoot ||
|
||||
@ -37517,7 +37674,7 @@ var ts;
|
||||
(function (ts) {
|
||||
var NavigateTo;
|
||||
(function (NavigateTo) {
|
||||
function getNavigateToItems(program, cancellationToken, searchValue, maxResultCount) {
|
||||
function getNavigateToItems(program, checker, cancellationToken, searchValue, maxResultCount) {
|
||||
var patternMatcher = ts.createPatternMatcher(searchValue);
|
||||
var rawItems = [];
|
||||
var baseSensitivity = { sensitivity: "base" };
|
||||
@ -37550,6 +37707,17 @@ var ts;
|
||||
}
|
||||
}
|
||||
});
|
||||
rawItems = ts.filter(rawItems, function (item) {
|
||||
var decl = item.declaration;
|
||||
if (decl.kind === 231 || decl.kind === 234 || decl.kind === 229) {
|
||||
var importer = checker.getSymbolAtLocation(decl.name);
|
||||
var imported = checker.getAliasedSymbol(importer);
|
||||
return importer.name !== imported.name;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
rawItems.sort(compareNavigateToItems);
|
||||
if (maxResultCount !== undefined) {
|
||||
rawItems = rawItems.slice(0, maxResultCount);
|
||||
@ -37892,8 +38060,12 @@ var ts;
|
||||
return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement);
|
||||
case 153:
|
||||
return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement);
|
||||
case 224:
|
||||
return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.enumElement);
|
||||
case 255:
|
||||
return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement);
|
||||
case 222:
|
||||
return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.interfaceElement);
|
||||
case 151:
|
||||
return createItem(node, "()", ts.ScriptElementKind.callSignatureElement);
|
||||
case 152:
|
||||
@ -39263,7 +39435,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) {
|
||||
for (var i = exclusiveStartPosition - 1; i >= 0; --i) {
|
||||
for (var i = exclusiveStartPosition - 1; i >= 0; i--) {
|
||||
if (nodeHasTokens(children[i])) {
|
||||
return children[i];
|
||||
}
|
||||
@ -39889,18 +40061,17 @@ var ts;
|
||||
if (!isStarted) {
|
||||
scanner.scan();
|
||||
}
|
||||
var t;
|
||||
var pos = scanner.getStartPos();
|
||||
while (pos < endPos) {
|
||||
var t_1 = scanner.getToken();
|
||||
if (!ts.isTrivia(t_1)) {
|
||||
var t = scanner.getToken();
|
||||
if (!ts.isTrivia(t)) {
|
||||
break;
|
||||
}
|
||||
scanner.scan();
|
||||
var item = {
|
||||
pos: pos,
|
||||
end: scanner.getStartPos(),
|
||||
kind: t_1
|
||||
kind: t
|
||||
};
|
||||
pos = scanner.getStartPos();
|
||||
if (!leadingTrivia) {
|
||||
@ -41550,7 +41721,7 @@ var ts;
|
||||
else {
|
||||
parts = [];
|
||||
var startPos = commentRange.pos;
|
||||
for (var line = startLine; line < endLine; ++line) {
|
||||
for (var line = startLine; line < endLine; line++) {
|
||||
var endOfLine = ts.getEndLinePosition(line, sourceFile);
|
||||
parts.push({ pos: startPos, end: endOfLine });
|
||||
startPos = ts.getStartPositionOfLine(line + 1, sourceFile);
|
||||
@ -41568,7 +41739,7 @@ var ts;
|
||||
startLine++;
|
||||
}
|
||||
var delta = indentation - nonWhitespaceColumnInFirstPart.column;
|
||||
for (var i = startIndex, len = parts.length; i < len; ++i, ++startLine) {
|
||||
for (var i = startIndex, len = parts.length; i < len; i++, startLine++) {
|
||||
var startLinePos_1 = ts.getStartPositionOfLine(startLine, sourceFile);
|
||||
var nonWhitespaceCharacterAndColumn = i === 0
|
||||
? nonWhitespaceColumnInFirstPart
|
||||
@ -41584,7 +41755,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
function trimTrailingWhitespacesForLines(line1, line2, range) {
|
||||
for (var line = line1; line < line2; ++line) {
|
||||
for (var line = line1; line < line2; line++) {
|
||||
var lineStartPosition = ts.getStartPositionOfLine(line, sourceFile);
|
||||
var lineEndPosition = ts.getEndLinePosition(line, sourceFile);
|
||||
if (range && (ts.isComment(range.kind) || ts.isStringOrRegularExpressionOrTemplateLiteral(range.kind)) && range.pos <= lineEndPosition && range.end > lineEndPosition) {
|
||||
@ -41627,7 +41798,6 @@ var ts;
|
||||
}
|
||||
}
|
||||
function applyRuleEdits(rule, previousRange, previousStartLine, currentRange, currentStartLine) {
|
||||
var between;
|
||||
switch (rule.Operation.Action) {
|
||||
case 1:
|
||||
return;
|
||||
@ -41657,14 +41827,6 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
function isSomeBlock(kind) {
|
||||
switch (kind) {
|
||||
case 199:
|
||||
case 226:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function getOpenTokenForList(node, list) {
|
||||
switch (node.kind) {
|
||||
case 148:
|
||||
@ -41722,7 +41884,7 @@ var ts;
|
||||
internedTabsIndentation = [];
|
||||
}
|
||||
if (internedTabsIndentation[tabs] === undefined) {
|
||||
internedTabsIndentation[tabs] = tabString = repeat('\t', tabs);
|
||||
internedTabsIndentation[tabs] = tabString = repeat("\t", tabs);
|
||||
}
|
||||
else {
|
||||
tabString = internedTabsIndentation[tabs];
|
||||
@ -41747,7 +41909,7 @@ var ts;
|
||||
}
|
||||
function repeat(value, count) {
|
||||
var s = "";
|
||||
for (var i = 0; i < count; ++i) {
|
||||
for (var i = 0; i < count; i++) {
|
||||
s += value;
|
||||
}
|
||||
return s;
|
||||
@ -42015,7 +42177,7 @@ var ts;
|
||||
ts.Debug.assert(index >= 0 && index < list.length);
|
||||
var node = list[index];
|
||||
var lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile);
|
||||
for (var i = index - 1; i >= 0; --i) {
|
||||
for (var i = index - 1; i >= 0; i--) {
|
||||
if (list[i].kind === 24) {
|
||||
continue;
|
||||
}
|
||||
@ -42034,7 +42196,7 @@ var ts;
|
||||
function findFirstNonWhitespaceCharacterAndColumn(startPos, endPos, sourceFile, options) {
|
||||
var character = 0;
|
||||
var column = 0;
|
||||
for (var pos = startPos; pos < endPos; ++pos) {
|
||||
for (var pos = startPos; pos < endPos; pos++) {
|
||||
var ch = sourceFile.text.charCodeAt(pos);
|
||||
if (!ts.isWhiteSpace(ch)) {
|
||||
break;
|
||||
@ -44005,9 +44167,9 @@ var ts;
|
||||
log("getCompletionData: Get previous token 1: " + (new Date().getTime() - start));
|
||||
var contextToken = previousToken;
|
||||
if (contextToken && position <= contextToken.end && ts.isWord(contextToken.kind)) {
|
||||
var start_6 = new Date().getTime();
|
||||
var start_5 = new Date().getTime();
|
||||
contextToken = ts.findPrecedingToken(contextToken.getFullStart(), sourceFile);
|
||||
log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_6));
|
||||
log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_5));
|
||||
}
|
||||
var node = currentToken;
|
||||
var isRightOfDot = false;
|
||||
@ -44234,9 +44396,9 @@ var ts;
|
||||
|| contextToken.kind === 166
|
||||
|| contextToken.kind === 10
|
||||
|| ts.isTemplateLiteralKind(contextToken.kind)) {
|
||||
var start_7 = contextToken.getStart();
|
||||
var start_6 = contextToken.getStart();
|
||||
var end = contextToken.getEnd();
|
||||
if (start_7 < position && position < end) {
|
||||
if (start_6 < position && position < end) {
|
||||
return true;
|
||||
}
|
||||
if (position === end) {
|
||||
@ -45314,8 +45476,7 @@ var ts;
|
||||
}
|
||||
function getDocumentHighlights(fileName, position, filesToSearch) {
|
||||
synchronizeHostData();
|
||||
filesToSearch = ts.map(filesToSearch, ts.normalizeSlashes);
|
||||
var sourceFilesToSearch = ts.filter(program.getSourceFiles(), function (f) { return ts.contains(filesToSearch, f.fileName); });
|
||||
var sourceFilesToSearch = ts.map(filesToSearch, function (f) { return program.getSourceFile(f); });
|
||||
var sourceFile = getValidSourceFile(fileName);
|
||||
var node = ts.getTouchingWord(sourceFile, position);
|
||||
if (!node) {
|
||||
@ -46498,7 +46659,8 @@ var ts;
|
||||
}
|
||||
function getNavigateToItems(searchValue, maxResultCount) {
|
||||
synchronizeHostData();
|
||||
return ts.NavigateTo.getNavigateToItems(program, cancellationToken, searchValue, maxResultCount);
|
||||
var checker = getProgram().getTypeChecker();
|
||||
return ts.NavigateTo.getNavigateToItems(program, checker, cancellationToken, searchValue, maxResultCount);
|
||||
}
|
||||
function getEmitOutput(fileName) {
|
||||
synchronizeHostData();
|
||||
@ -51195,6 +51357,9 @@ var ts;
|
||||
LanguageServiceShimHostAdapter.prototype.getCurrentDirectory = function () {
|
||||
return this.shimHost.getCurrentDirectory();
|
||||
};
|
||||
LanguageServiceShimHostAdapter.prototype.getDirectories = function (path) {
|
||||
return this.shimHost.getDirectories(path);
|
||||
};
|
||||
LanguageServiceShimHostAdapter.prototype.getDefaultLibFileName = function (options) {
|
||||
return this.shimHost.getDefaultLibFileName(JSON.stringify(options));
|
||||
};
|
||||
|
||||
48
lib/tsserverlibrary.d.ts
vendored
48
lib/tsserverlibrary.d.ts
vendored
@ -247,7 +247,7 @@ declare namespace ts {
|
||||
ModuleDeclaration = 225,
|
||||
ModuleBlock = 226,
|
||||
CaseBlock = 227,
|
||||
GlobalModuleExportDeclaration = 228,
|
||||
NamespaceExportDeclaration = 228,
|
||||
ImportEqualsDeclaration = 229,
|
||||
ImportDeclaration = 230,
|
||||
ImportClause = 231,
|
||||
@ -925,7 +925,7 @@ declare namespace ts {
|
||||
interface NamespaceImport extends Declaration {
|
||||
name: Identifier;
|
||||
}
|
||||
interface GlobalModuleExportDeclaration extends DeclarationStatement {
|
||||
interface NamespaceExportDeclaration extends DeclarationStatement {
|
||||
name: Identifier;
|
||||
moduleReference: LiteralLikeNode;
|
||||
}
|
||||
@ -1087,7 +1087,6 @@ declare namespace ts {
|
||||
scriptKind: ScriptKind;
|
||||
externalModuleIndicator: Node;
|
||||
commonJsModuleIndicator: Node;
|
||||
wasReferenced?: boolean;
|
||||
identifiers: Map<string>;
|
||||
nodeCount: number;
|
||||
identifierCount: number;
|
||||
@ -1381,7 +1380,7 @@ declare namespace ts {
|
||||
FunctionScopedVariableExcludes = 107454,
|
||||
BlockScopedVariableExcludes = 107455,
|
||||
ParameterExcludes = 107455,
|
||||
PropertyExcludes = 107455,
|
||||
PropertyExcludes = 0,
|
||||
EnumMemberExcludes = 107455,
|
||||
FunctionExcludes = 106927,
|
||||
ClassExcludes = 899519,
|
||||
@ -1735,6 +1734,7 @@ declare namespace ts {
|
||||
allowJs?: boolean;
|
||||
noImplicitUseStrict?: boolean;
|
||||
strictNullChecks?: boolean;
|
||||
skipLibCheck?: boolean;
|
||||
listEmittedFiles?: boolean;
|
||||
lib?: string[];
|
||||
stripInternal?: boolean;
|
||||
@ -1967,6 +1967,7 @@ declare namespace ts {
|
||||
trace?(s: string): void;
|
||||
directoryExists?(directoryName: string): boolean;
|
||||
realpath?(path: string): string;
|
||||
getCurrentDirectory?(): string;
|
||||
}
|
||||
interface ResolvedModule {
|
||||
resolvedFileName: string;
|
||||
@ -1990,6 +1991,7 @@ declare namespace ts {
|
||||
getCancellationToken?(): CancellationToken;
|
||||
getDefaultLibFileName(options: CompilerOptions): string;
|
||||
getDefaultLibLocation?(): string;
|
||||
getDefaultTypeDirectiveNames?(rootPath: string): string[];
|
||||
writeFile: WriteFileCallback;
|
||||
getCurrentDirectory(): string;
|
||||
getCanonicalFileName(fileName: string): string;
|
||||
@ -2136,6 +2138,7 @@ declare namespace ts {
|
||||
createDirectory(path: string): void;
|
||||
getExecutingFilePath(): string;
|
||||
getCurrentDirectory(): string;
|
||||
getDirectories(path: string): string[];
|
||||
readDirectory(path: string, extension?: string, exclude?: string[]): string[];
|
||||
getModifiedTime?(path: string): Date;
|
||||
createHash?(data: string): string;
|
||||
@ -2820,7 +2823,7 @@ declare namespace ts {
|
||||
key: string;
|
||||
message: string;
|
||||
};
|
||||
Cannot_compile_modules_unless_the_module_flag_is_provided_with_a_valid_module_type_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file: {
|
||||
Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: {
|
||||
code: number;
|
||||
category: DiagnosticCategory;
|
||||
key: string;
|
||||
@ -5040,6 +5043,18 @@ declare namespace ts {
|
||||
key: string;
|
||||
message: string;
|
||||
};
|
||||
Identifier_0_must_be_imported_from_a_module: {
|
||||
code: number;
|
||||
category: DiagnosticCategory;
|
||||
key: string;
|
||||
message: string;
|
||||
};
|
||||
All_declarations_of_0_must_have_identical_modifiers: {
|
||||
code: number;
|
||||
category: DiagnosticCategory;
|
||||
key: string;
|
||||
message: string;
|
||||
};
|
||||
Import_declaration_0_is_using_private_name_1: {
|
||||
code: number;
|
||||
category: DiagnosticCategory;
|
||||
@ -5598,7 +5613,7 @@ declare namespace ts {
|
||||
key: string;
|
||||
message: string;
|
||||
};
|
||||
Substututions_for_pattern_0_should_be_an_array: {
|
||||
Substitutions_for_pattern_0_should_be_an_array: {
|
||||
code: number;
|
||||
category: DiagnosticCategory;
|
||||
key: string;
|
||||
@ -5676,6 +5691,12 @@ declare namespace ts {
|
||||
key: string;
|
||||
message: string;
|
||||
};
|
||||
Skip_type_checking_of_declaration_files: {
|
||||
code: number;
|
||||
category: DiagnosticCategory;
|
||||
key: string;
|
||||
message: string;
|
||||
};
|
||||
Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015: {
|
||||
code: number;
|
||||
category: DiagnosticCategory;
|
||||
@ -6282,6 +6303,12 @@ declare namespace ts {
|
||||
key: string;
|
||||
message: string;
|
||||
};
|
||||
Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: {
|
||||
code: number;
|
||||
category: DiagnosticCategory;
|
||||
key: string;
|
||||
message: string;
|
||||
};
|
||||
Variable_0_implicitly_has_an_1_type: {
|
||||
code: number;
|
||||
category: DiagnosticCategory;
|
||||
@ -7024,6 +7051,7 @@ declare namespace ts {
|
||||
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
|
||||
function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[];
|
||||
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
|
||||
function getDefaultTypeDirectiveNames(options: CompilerOptions, rootFiles: string[], host: CompilerHost): string[];
|
||||
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program): Program;
|
||||
}
|
||||
declare namespace ts.BreakpointResolver {
|
||||
@ -7033,7 +7061,7 @@ declare namespace ts.OutliningElementsCollector {
|
||||
function collectElements(sourceFile: SourceFile): OutliningSpan[];
|
||||
}
|
||||
declare namespace ts.NavigateTo {
|
||||
function getNavigateToItems(program: Program, cancellationToken: CancellationToken, searchValue: string, maxResultCount: number): NavigateToItem[];
|
||||
function getNavigateToItems(program: Program, checker: TypeChecker, cancellationToken: CancellationToken, searchValue: string, maxResultCount: number): NavigateToItem[];
|
||||
}
|
||||
declare namespace ts.NavigationBar {
|
||||
function getNavigationBarItems(sourceFile: SourceFile, compilerOptions: CompilerOptions): ts.NavigationBarItem[];
|
||||
@ -7431,7 +7459,7 @@ declare namespace ts.formatting {
|
||||
}
|
||||
}
|
||||
declare namespace ts.formatting {
|
||||
module Shared {
|
||||
namespace Shared {
|
||||
interface ITokenAccess {
|
||||
GetTokens(): SyntaxKind[];
|
||||
Contains(token: SyntaxKind): boolean;
|
||||
@ -7516,7 +7544,7 @@ declare namespace ts.formatting {
|
||||
function getIndentationString(indentation: number, options: FormatCodeOptions): string;
|
||||
}
|
||||
declare namespace ts.formatting {
|
||||
module SmartIndenter {
|
||||
namespace SmartIndenter {
|
||||
function getIndentation(position: number, sourceFile: SourceFile, options: EditorOptions): number;
|
||||
function getIndentationForNode(n: Node, ignoreActualIndentationRange: TextRange, sourceFile: SourceFile, options: FormatCodeOptions): number;
|
||||
function childStartsOnTheSameLineWithElseInIfStatement(parent: Node, child: TextRangeWithKind, childStartLine: number, sourceFile: SourceFile): boolean;
|
||||
@ -8487,6 +8515,7 @@ declare namespace ts {
|
||||
getLocalizedDiagnosticMessages(): string;
|
||||
getCancellationToken(): HostCancellationToken;
|
||||
getCurrentDirectory(): string;
|
||||
getDirectories(path: string): string[];
|
||||
getDefaultLibFileName(options: string): string;
|
||||
getNewLine?(): string;
|
||||
getProjectVersion?(): string;
|
||||
@ -8582,6 +8611,7 @@ declare namespace ts {
|
||||
getLocalizedDiagnosticMessages(): any;
|
||||
getCancellationToken(): HostCancellationToken;
|
||||
getCurrentDirectory(): string;
|
||||
getDirectories(path: string): string[];
|
||||
getDefaultLibFileName(options: CompilerOptions): string;
|
||||
}
|
||||
class CoreServicesShimHostAdapter implements ParseConfigHost, ModuleResolutionHost {
|
||||
|
||||
@ -918,6 +918,10 @@ var ts;
|
||||
}
|
||||
return result.sort();
|
||||
}
|
||||
function getDirectories(path) {
|
||||
var folder = fso.GetFolder(path);
|
||||
return getNames(folder.subfolders);
|
||||
}
|
||||
function readDirectory(path, extension, exclude) {
|
||||
var result = [];
|
||||
exclude = ts.map(exclude, function (s) { return getCanonicalPath(ts.combinePaths(path, s)); });
|
||||
@ -972,6 +976,7 @@ var ts;
|
||||
getCurrentDirectory: function () {
|
||||
return new ActiveXObject("WScript.Shell").CurrentDirectory;
|
||||
},
|
||||
getDirectories: getDirectories,
|
||||
readDirectory: readDirectory,
|
||||
exit: function (exitCode) {
|
||||
try {
|
||||
@ -1119,6 +1124,9 @@ var ts;
|
||||
function directoryExists(path) {
|
||||
return fileSystemEntryExists(path, 1);
|
||||
}
|
||||
function getDirectories(path) {
|
||||
return ts.filter(_fs.readdirSync(path), function (p) { return fileSystemEntryExists(ts.combinePaths(path, p), 1); });
|
||||
}
|
||||
function readDirectory(path, extension, exclude) {
|
||||
var result = [];
|
||||
exclude = ts.map(exclude, function (s) { return getCanonicalPath(ts.combinePaths(path, s)); });
|
||||
@ -1211,6 +1219,7 @@ var ts;
|
||||
getCurrentDirectory: function () {
|
||||
return process.cwd();
|
||||
},
|
||||
getDirectories: getDirectories,
|
||||
readDirectory: readDirectory,
|
||||
getModifiedTime: function (path) {
|
||||
try {
|
||||
@ -1261,6 +1270,7 @@ var ts;
|
||||
createDirectory: ChakraHost.createDirectory,
|
||||
getExecutingFilePath: function () { return ChakraHost.executingFile; },
|
||||
getCurrentDirectory: function () { return ChakraHost.currentDirectory; },
|
||||
getDirectories: ChakraHost.getDirectories,
|
||||
readDirectory: ChakraHost.readDirectory,
|
||||
exit: ChakraHost.quit,
|
||||
realpath: realpath
|
||||
@ -1394,7 +1404,7 @@ var ts;
|
||||
or_expected: { code: 1144, category: ts.DiagnosticCategory.Error, key: "or_expected_1144", message: "'{' or ';' expected." },
|
||||
Declaration_expected: { code: 1146, category: ts.DiagnosticCategory.Error, key: "Declaration_expected_1146", message: "Declaration expected." },
|
||||
Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", message: "Import declarations in a namespace cannot reference a module." },
|
||||
Cannot_compile_modules_unless_the_module_flag_is_provided_with_a_valid_module_type_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_unless_the_module_flag_is_provided_with_a_valid_module_type_Consider_setting__1148", message: "Cannot compile modules unless the '--module' flag is provided with a valid module type. Consider setting the 'module' compiler option in a 'tsconfig.json' file." },
|
||||
Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148", message: "Cannot use imports, exports, or module augmentations when '--module' is 'none'." },
|
||||
File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", message: "File name '{0}' differs from already included file name '{1}' only in casing" },
|
||||
new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: ts.DiagnosticCategory.Error, key: "new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead_1150", message: "'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead." },
|
||||
const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "const_declarations_must_be_initialized_1155", message: "'const' declarations must be initialized" },
|
||||
@ -1764,6 +1774,8 @@ var ts;
|
||||
this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation: { code: 2683, category: ts.DiagnosticCategory.Error, key: "this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683", message: "'this' implicitly has type 'any' because it does not have a type annotation." },
|
||||
The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1: { code: 2684, category: ts.DiagnosticCategory.Error, key: "The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684", message: "The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'." },
|
||||
The_this_types_of_each_signature_are_incompatible: { code: 2685, category: ts.DiagnosticCategory.Error, key: "The_this_types_of_each_signature_are_incompatible_2685", message: "The 'this' types of each signature are incompatible." },
|
||||
Identifier_0_must_be_imported_from_a_module: { code: 2686, category: ts.DiagnosticCategory.Error, key: "Identifier_0_must_be_imported_from_a_module_2686", message: "Identifier '{0}' must be imported from a module" },
|
||||
All_declarations_of_0_must_have_identical_modifiers: { code: 2687, category: ts.DiagnosticCategory.Error, key: "All_declarations_of_0_must_have_identical_modifiers_2687", message: "All declarations of '{0}' must have identical modifiers." },
|
||||
Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import_declaration_0_is_using_private_name_1_4000", message: "Import declaration '{0}' is using private name '{1}'." },
|
||||
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", message: "Type parameter '{0}' of exported class has or is using private name '{1}'." },
|
||||
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: ts.DiagnosticCategory.Error, key: "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", message: "Type parameter '{0}' of exported interface has or is using private name '{1}'." },
|
||||
@ -1857,7 +1869,7 @@ var ts;
|
||||
Option_paths_cannot_be_used_without_specifying_baseUrl_option: { code: 5060, category: ts.DiagnosticCategory.Error, key: "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", message: "Option 'paths' cannot be used without specifying '--baseUrl' option." },
|
||||
Pattern_0_can_have_at_most_one_Asterisk_character: { code: 5061, category: ts.DiagnosticCategory.Error, key: "Pattern_0_can_have_at_most_one_Asterisk_character_5061", message: "Pattern '{0}' can have at most one '*' character" },
|
||||
Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: { code: 5062, category: ts.DiagnosticCategory.Error, key: "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062", message: "Substitution '{0}' in pattern '{1}' in can have at most one '*' character" },
|
||||
Substututions_for_pattern_0_should_be_an_array: { code: 5063, category: ts.DiagnosticCategory.Error, key: "Substututions_for_pattern_0_should_be_an_array_5063", message: "Substututions for pattern '{0}' should be an array." },
|
||||
Substitutions_for_pattern_0_should_be_an_array: { code: 5063, category: ts.DiagnosticCategory.Error, key: "Substitutions_for_pattern_0_should_be_an_array_5063", message: "Substitutions for pattern '{0}' should be an array." },
|
||||
Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: { code: 5064, category: ts.DiagnosticCategory.Error, key: "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064", message: "Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'." },
|
||||
Concatenate_and_emit_output_to_single_file: { code: 6001, category: ts.DiagnosticCategory.Message, key: "Concatenate_and_emit_output_to_single_file_6001", message: "Concatenate and emit output to single file." },
|
||||
Generates_corresponding_d_ts_file: { code: 6002, category: ts.DiagnosticCategory.Message, key: "Generates_corresponding_d_ts_file_6002", message: "Generates corresponding '.d.ts' file." },
|
||||
@ -1870,6 +1882,7 @@ var ts;
|
||||
Do_not_emit_comments_to_output: { code: 6009, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_comments_to_output_6009", message: "Do not emit comments to output." },
|
||||
Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do_not_emit_outputs_6010", message: "Do not emit outputs." },
|
||||
Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: { code: 6011, category: ts.DiagnosticCategory.Message, key: "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", message: "Allow default imports from modules with no default export. This does not affect code emit, just typechecking." },
|
||||
Skip_type_checking_of_declaration_files: { code: 6012, category: ts.DiagnosticCategory.Message, key: "Skip_type_checking_of_declaration_files_6012", message: "Skip type checking of declaration files." },
|
||||
Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES2015_6015", message: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES2015'" },
|
||||
Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015_6016", message: "Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'" },
|
||||
Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print_this_message_6017", message: "Print this message." },
|
||||
@ -1971,6 +1984,7 @@ var ts;
|
||||
Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set: { code: 6128, category: ts.DiagnosticCategory.Message, key: "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128", message: "======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========" },
|
||||
The_config_file_0_found_doesn_t_contain_any_source_files: { code: 6129, category: ts.DiagnosticCategory.Error, key: "The_config_file_0_found_doesn_t_contain_any_source_files_6129", message: "The config file '{0}' found doesn't contain any source files." },
|
||||
Resolving_real_path_for_0_result_1: { code: 6130, category: ts.DiagnosticCategory.Message, key: "Resolving_real_path_for_0_result_1_6130", message: "Resolving real path for '{0}', result '{1}'" },
|
||||
Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: { code: 6131, category: ts.DiagnosticCategory.Error, key: "Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131", message: "Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'." },
|
||||
Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable_0_implicitly_has_an_1_type_7005", message: "Variable '{0}' implicitly has an '{1}' type." },
|
||||
Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter_0_implicitly_has_an_1_type_7006", message: "Parameter '{0}' implicitly has an '{1}' type." },
|
||||
Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member_0_implicitly_has_an_1_type_7008", message: "Member '{0}' implicitly has an '{1}' type." },
|
||||
@ -3537,6 +3551,11 @@ var ts;
|
||||
type: "boolean",
|
||||
description: ts.Diagnostics.Print_this_message
|
||||
},
|
||||
{
|
||||
name: "help",
|
||||
shortName: "?",
|
||||
type: "boolean"
|
||||
},
|
||||
{
|
||||
name: "init",
|
||||
type: "boolean",
|
||||
@ -3639,6 +3658,11 @@ var ts;
|
||||
name: "skipDefaultLibCheck",
|
||||
type: "boolean"
|
||||
},
|
||||
{
|
||||
name: "skipLibCheck",
|
||||
type: "boolean",
|
||||
description: ts.Diagnostics.Skip_type_checking_of_declaration_files
|
||||
},
|
||||
{
|
||||
name: "out",
|
||||
type: "string",
|
||||
@ -5758,7 +5782,7 @@ var ts;
|
||||
}
|
||||
ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically;
|
||||
function getPropertyNameForPropertyNameNode(name) {
|
||||
if (name.kind === 69 || name.kind === 9 || name.kind === 8) {
|
||||
if (name.kind === 69 || name.kind === 9 || name.kind === 8 || name.kind === 142) {
|
||||
return name.text;
|
||||
}
|
||||
if (name.kind === 140) {
|
||||
@ -12804,10 +12828,10 @@ var ts;
|
||||
case 145:
|
||||
case 144:
|
||||
case 266:
|
||||
return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 107455);
|
||||
return bindPropertyOrMethodOrAccessor(node, 4 | (node.questionToken ? 536870912 : 0), 0);
|
||||
case 253:
|
||||
case 254:
|
||||
return bindPropertyOrMethodOrAccessor(node, 4, 107455);
|
||||
return bindPropertyOrMethodOrAccessor(node, 4, 0);
|
||||
case 255:
|
||||
return bindPropertyOrMethodOrAccessor(node, 8, 107455);
|
||||
case 247:
|
||||
@ -12819,7 +12843,7 @@ var ts;
|
||||
return declareSymbolAndAddToSymbolTable(node, 131072, 0);
|
||||
case 147:
|
||||
case 146:
|
||||
return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 107455 : 99263);
|
||||
return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 536870912 : 0), ts.isObjectLiteralMethod(node) ? 0 : 99263);
|
||||
case 220:
|
||||
return bindFunctionDeclaration(node);
|
||||
case 148:
|
||||
@ -12862,7 +12886,7 @@ var ts;
|
||||
case 238:
|
||||
return declareSymbolAndAddToSymbolTable(node, 8388608, 8388608);
|
||||
case 228:
|
||||
return bindGlobalModuleExportDeclaration(node);
|
||||
return bindNamespaceExportDeclaration(node);
|
||||
case 231:
|
||||
return bindImportClause(node);
|
||||
case 236:
|
||||
@ -12898,13 +12922,13 @@ var ts;
|
||||
bindAnonymousDeclaration(node, 8388608, getDeclarationName(node));
|
||||
}
|
||||
else if (boundExpression.kind === 69 && node.kind === 235) {
|
||||
declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 107455 | 8388608);
|
||||
declareSymbol(container.symbol.exports, container.symbol, node, 8388608, 0 | 8388608);
|
||||
}
|
||||
else {
|
||||
declareSymbol(container.symbol.exports, container.symbol, node, 4, 107455 | 8388608);
|
||||
declareSymbol(container.symbol.exports, container.symbol, node, 4, 0 | 8388608);
|
||||
}
|
||||
}
|
||||
function bindGlobalModuleExportDeclaration(node) {
|
||||
function bindNamespaceExportDeclaration(node) {
|
||||
if (node.modifiers && node.modifiers.length) {
|
||||
file.bindDiagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Modifiers_cannot_appear_here));
|
||||
}
|
||||
@ -12956,7 +12980,7 @@ var ts;
|
||||
function bindThisPropertyAssignment(node) {
|
||||
if (container.kind === 179 || container.kind === 220) {
|
||||
container.symbol.members = container.symbol.members || {};
|
||||
declareSymbol(container.symbol.members, container.symbol, node, 4, 107455 & ~4);
|
||||
declareSymbol(container.symbol.members, container.symbol, node, 4, 0 & ~4);
|
||||
}
|
||||
}
|
||||
function bindPrototypePropertyAssignment(node) {
|
||||
@ -12973,7 +12997,7 @@ var ts;
|
||||
if (!funcSymbol.members) {
|
||||
funcSymbol.members = {};
|
||||
}
|
||||
declareSymbol(funcSymbol.members, funcSymbol, leftSideOfAssignment, 4, 107455);
|
||||
declareSymbol(funcSymbol.members, funcSymbol, leftSideOfAssignment, 4, 0);
|
||||
}
|
||||
function bindCallExpression(node) {
|
||||
if (!file.commonJsModuleIndicator && ts.isRequireCall(node, false)) {
|
||||
@ -13049,7 +13073,7 @@ var ts;
|
||||
}
|
||||
if (ts.isParameterPropertyDeclaration(node)) {
|
||||
var classDeclaration = node.parent.parent;
|
||||
declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 107455);
|
||||
declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4, 0);
|
||||
}
|
||||
}
|
||||
function bindFunctionDeclaration(node) {
|
||||
@ -13349,7 +13373,7 @@ var ts;
|
||||
if (flags & 1)
|
||||
result |= 107454;
|
||||
if (flags & 4)
|
||||
result |= 107455;
|
||||
result |= 0;
|
||||
if (flags & 8)
|
||||
result |= 107455;
|
||||
if (flags & 16)
|
||||
@ -13605,6 +13629,7 @@ var ts;
|
||||
var propertyWithInvalidInitializer;
|
||||
var errorLocation = location;
|
||||
var grandparent;
|
||||
var isInExternalModule = false;
|
||||
loop: while (location) {
|
||||
if (location.locals && !isGlobalSourceFile(location)) {
|
||||
if (result = getSymbol(location.locals, name, meaning)) {
|
||||
@ -13636,6 +13661,7 @@ var ts;
|
||||
case 256:
|
||||
if (!ts.isExternalOrCommonJsModule(location))
|
||||
break;
|
||||
isInExternalModule = true;
|
||||
case 225:
|
||||
var moduleExports = getSymbolOfNode(location).exports;
|
||||
if (location.kind === 256 || ts.isAmbientModule(location)) {
|
||||
@ -13759,6 +13785,12 @@ var ts;
|
||||
checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation);
|
||||
}
|
||||
}
|
||||
if (result && isInExternalModule) {
|
||||
var decls = result.declarations;
|
||||
if (decls && decls.length === 1 && decls[0].kind === 228) {
|
||||
error(errorLocation, ts.Diagnostics.Identifier_0_must_be_imported_from_a_module, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -15234,7 +15266,7 @@ var ts;
|
||||
}
|
||||
function getTypeForBindingElementParent(node) {
|
||||
var symbol = getSymbolOfNode(node);
|
||||
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node);
|
||||
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, false);
|
||||
}
|
||||
function getTextOfPropertyName(name) {
|
||||
switch (name.kind) {
|
||||
@ -15339,7 +15371,7 @@ var ts;
|
||||
function addOptionality(type, optional) {
|
||||
return strictNullChecks && optional ? addNullableKind(type, 32) : type;
|
||||
}
|
||||
function getTypeForVariableLikeDeclaration(declaration) {
|
||||
function getTypeForVariableLikeDeclaration(declaration, includeOptionality) {
|
||||
if (declaration.flags & 134217728) {
|
||||
var type = getTypeForVariableLikeDeclarationFromJSDocComment(declaration);
|
||||
if (type && type !== unknownType) {
|
||||
@ -15356,7 +15388,7 @@ var ts;
|
||||
return getTypeForBindingElement(declaration);
|
||||
}
|
||||
if (declaration.type) {
|
||||
return addOptionality(getTypeFromTypeNode(declaration.type), !!declaration.questionToken);
|
||||
return addOptionality(getTypeFromTypeNode(declaration.type), declaration.questionToken && includeOptionality);
|
||||
}
|
||||
if (declaration.kind === 142) {
|
||||
var func = declaration.parent;
|
||||
@ -15375,11 +15407,11 @@ var ts;
|
||||
? getContextuallyTypedThisType(func)
|
||||
: getContextuallyTypedParameterType(declaration);
|
||||
if (type) {
|
||||
return addOptionality(type, !!declaration.questionToken);
|
||||
return addOptionality(type, declaration.questionToken && includeOptionality);
|
||||
}
|
||||
}
|
||||
if (declaration.initializer) {
|
||||
return addOptionality(checkExpressionCached(declaration.initializer), !!declaration.questionToken);
|
||||
return addOptionality(checkExpressionCached(declaration.initializer), declaration.questionToken && includeOptionality);
|
||||
}
|
||||
if (declaration.kind === 254) {
|
||||
return checkIdentifier(declaration.name);
|
||||
@ -15447,7 +15479,7 @@ var ts;
|
||||
: getTypeFromArrayBindingPattern(pattern, includePatternInType);
|
||||
}
|
||||
function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors) {
|
||||
var type = getTypeForVariableLikeDeclaration(declaration);
|
||||
var type = getTypeForVariableLikeDeclaration(declaration, true);
|
||||
if (type) {
|
||||
if (reportErrors) {
|
||||
reportErrorsFromWidening(declaration, type);
|
||||
@ -17764,7 +17796,7 @@ var ts;
|
||||
return isIdenticalTo(source, target);
|
||||
}
|
||||
if (!(target.flags & 134217728)) {
|
||||
if (target.flags & 1)
|
||||
if (target.flags & 1 || source.flags & 134217728)
|
||||
return -1;
|
||||
if (source.flags & 32) {
|
||||
if (!strictNullChecks || target.flags & (32 | 16) || source === emptyArrayElementType)
|
||||
@ -17784,7 +17816,7 @@ var ts;
|
||||
if (source.flags & 256 && target === stringType)
|
||||
return -1;
|
||||
if (relation === assignableRelation || relation === comparableRelation) {
|
||||
if (source.flags & (1 | 134217728))
|
||||
if (source.flags & 1)
|
||||
return -1;
|
||||
if (source === numberType && target.flags & 128)
|
||||
return -1;
|
||||
@ -18561,41 +18593,47 @@ var ts;
|
||||
getSignaturesOfType(type, 0).length === 0 &&
|
||||
getSignaturesOfType(type, 1).length === 0;
|
||||
}
|
||||
function createTransientSymbol(source, type) {
|
||||
var symbol = createSymbol(source.flags | 67108864, source.name);
|
||||
symbol.declarations = source.declarations;
|
||||
symbol.parent = source.parent;
|
||||
symbol.type = type;
|
||||
symbol.target = source;
|
||||
if (source.valueDeclaration) {
|
||||
symbol.valueDeclaration = source.valueDeclaration;
|
||||
}
|
||||
return symbol;
|
||||
}
|
||||
function transformTypeOfMembers(type, f) {
|
||||
var members = {};
|
||||
for (var _i = 0, _a = getPropertiesOfObjectType(type); _i < _a.length; _i++) {
|
||||
var property = _a[_i];
|
||||
var original = getTypeOfSymbol(property);
|
||||
var updated = f(original);
|
||||
members[property.name] = updated === original ? property : createTransientSymbol(property, updated);
|
||||
}
|
||||
;
|
||||
return members;
|
||||
}
|
||||
function getRegularTypeOfObjectLiteral(type) {
|
||||
if (type.flags & 1048576) {
|
||||
var regularType = type.regularType;
|
||||
if (!regularType) {
|
||||
regularType = createType(type.flags & ~1048576);
|
||||
regularType.symbol = type.symbol;
|
||||
regularType.members = type.members;
|
||||
regularType.properties = type.properties;
|
||||
regularType.callSignatures = type.callSignatures;
|
||||
regularType.constructSignatures = type.constructSignatures;
|
||||
regularType.stringIndexInfo = type.stringIndexInfo;
|
||||
regularType.numberIndexInfo = type.numberIndexInfo;
|
||||
type.regularType = regularType;
|
||||
}
|
||||
if (!(type.flags & 1048576)) {
|
||||
return type;
|
||||
}
|
||||
var regularType = type.regularType;
|
||||
if (regularType) {
|
||||
return regularType;
|
||||
}
|
||||
return type;
|
||||
var resolved = type;
|
||||
var members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral);
|
||||
var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.stringIndexInfo, resolved.numberIndexInfo);
|
||||
regularNew.flags = resolved.flags & ~1048576;
|
||||
type.regularType = regularNew;
|
||||
return regularNew;
|
||||
}
|
||||
function getWidenedTypeOfObjectLiteral(type) {
|
||||
var properties = getPropertiesOfObjectType(type);
|
||||
var members = {};
|
||||
ts.forEach(properties, function (p) {
|
||||
var propType = getTypeOfSymbol(p);
|
||||
var widenedType = getWidenedType(propType);
|
||||
if (propType !== widenedType) {
|
||||
var symbol = createSymbol(p.flags | 67108864, p.name);
|
||||
symbol.declarations = p.declarations;
|
||||
symbol.parent = p.parent;
|
||||
symbol.type = widenedType;
|
||||
symbol.target = p;
|
||||
if (p.valueDeclaration)
|
||||
symbol.valueDeclaration = p.valueDeclaration;
|
||||
p = symbol;
|
||||
}
|
||||
members[p.name] = p;
|
||||
var members = transformTypeOfMembers(type, function (prop) {
|
||||
var widened = getWidenedType(prop);
|
||||
return prop === widened ? prop : widened;
|
||||
});
|
||||
var stringIndexInfo = getIndexInfoOfType(type, 0);
|
||||
var numberIndexInfo = getIndexInfoOfType(type, 1);
|
||||
@ -19888,7 +19926,7 @@ var ts;
|
||||
}
|
||||
return nodeCheckFlag === 512
|
||||
? getBaseConstructorTypeOfClass(classType)
|
||||
: baseClassType;
|
||||
: getTypeWithThisArgument(baseClassType, classType.thisType);
|
||||
function isLegalUsageOfSuperExpression(container) {
|
||||
if (!container) {
|
||||
return false;
|
||||
@ -21936,7 +21974,7 @@ var ts;
|
||||
var types = void 0;
|
||||
var funcIsGenerator = !!func.asteriskToken;
|
||||
if (funcIsGenerator) {
|
||||
types = checkAndAggregateYieldOperandTypes(func.body, contextualMapper);
|
||||
types = checkAndAggregateYieldOperandTypes(func, contextualMapper);
|
||||
if (types.length === 0) {
|
||||
var iterableIteratorAny = createIterableIteratorType(anyType);
|
||||
if (compilerOptions.noImplicitAny) {
|
||||
@ -21946,8 +21984,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
else {
|
||||
var hasImplicitReturn = !!(func.flags & 32768);
|
||||
types = checkAndAggregateReturnExpressionTypes(func.body, contextualMapper, isAsync, hasImplicitReturn);
|
||||
types = checkAndAggregateReturnExpressionTypes(func, contextualMapper);
|
||||
if (!types) {
|
||||
return neverType;
|
||||
}
|
||||
@ -21994,9 +22031,9 @@ var ts;
|
||||
return widenedType;
|
||||
}
|
||||
}
|
||||
function checkAndAggregateYieldOperandTypes(body, contextualMapper) {
|
||||
function checkAndAggregateYieldOperandTypes(func, contextualMapper) {
|
||||
var aggregatedTypes = [];
|
||||
ts.forEachYieldExpression(body, function (yieldExpression) {
|
||||
ts.forEachYieldExpression(func.body, function (yieldExpression) {
|
||||
var expr = yieldExpression.expression;
|
||||
if (expr) {
|
||||
var type = checkExpressionCached(expr, contextualMapper);
|
||||
@ -22010,28 +22047,34 @@ var ts;
|
||||
});
|
||||
return aggregatedTypes;
|
||||
}
|
||||
function checkAndAggregateReturnExpressionTypes(body, contextualMapper, isAsync, hasImplicitReturn) {
|
||||
function checkAndAggregateReturnExpressionTypes(func, contextualMapper) {
|
||||
var isAsync = ts.isAsyncFunctionLike(func);
|
||||
var aggregatedTypes = [];
|
||||
var hasOmittedExpressions = false;
|
||||
ts.forEachReturnStatement(body, function (returnStatement) {
|
||||
var hasReturnWithNoExpression = !!(func.flags & 32768);
|
||||
var hasReturnOfTypeNever = false;
|
||||
ts.forEachReturnStatement(func.body, function (returnStatement) {
|
||||
var expr = returnStatement.expression;
|
||||
if (expr) {
|
||||
var type = checkExpressionCached(expr, contextualMapper);
|
||||
if (isAsync) {
|
||||
type = checkAwaitedType(type, body.parent, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member);
|
||||
type = checkAwaitedType(type, func, ts.Diagnostics.Return_expression_in_async_function_does_not_have_a_valid_callable_then_member);
|
||||
}
|
||||
if (type !== neverType && !ts.contains(aggregatedTypes, type)) {
|
||||
if (type === neverType) {
|
||||
hasReturnOfTypeNever = true;
|
||||
}
|
||||
else if (!ts.contains(aggregatedTypes, type)) {
|
||||
aggregatedTypes.push(type);
|
||||
}
|
||||
}
|
||||
else {
|
||||
hasOmittedExpressions = true;
|
||||
hasReturnWithNoExpression = true;
|
||||
}
|
||||
});
|
||||
if (aggregatedTypes.length === 0 && !hasOmittedExpressions && !hasImplicitReturn) {
|
||||
if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever ||
|
||||
func.kind === 179 || func.kind === 180)) {
|
||||
return undefined;
|
||||
}
|
||||
if (strictNullChecks && aggregatedTypes.length && (hasOmittedExpressions || hasImplicitReturn)) {
|
||||
if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression) {
|
||||
if (!ts.contains(aggregatedTypes, undefinedType)) {
|
||||
aggregatedTypes.push(undefinedType);
|
||||
}
|
||||
@ -22161,7 +22204,9 @@ var ts;
|
||||
(expr.kind === 172 || expr.kind === 173) &&
|
||||
expr.expression.kind === 97) {
|
||||
var func = ts.getContainingFunction(expr);
|
||||
return !(func && func.kind === 148 && func.parent === symbol.valueDeclaration.parent);
|
||||
if (!(func && func.kind === 148))
|
||||
return true;
|
||||
return !(func.parent === symbol.valueDeclaration.parent || func === symbol.valueDeclaration.parent);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -22985,6 +23030,79 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
function checkClassForDuplicateDeclarations(node) {
|
||||
var getter = 1, setter = 2, property = getter | setter;
|
||||
var instanceNames = {};
|
||||
var staticNames = {};
|
||||
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
||||
var member = _a[_i];
|
||||
if (member.kind === 148) {
|
||||
for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) {
|
||||
var param = _c[_b];
|
||||
if (ts.isParameterPropertyDeclaration(param)) {
|
||||
addName(instanceNames, param.name, param.name.text, property);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
var static = ts.forEach(member.modifiers, function (m) { return m.kind === 113; });
|
||||
var names = static ? staticNames : instanceNames;
|
||||
var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name);
|
||||
if (memberName) {
|
||||
switch (member.kind) {
|
||||
case 149:
|
||||
addName(names, member.name, memberName, getter);
|
||||
break;
|
||||
case 150:
|
||||
addName(names, member.name, memberName, setter);
|
||||
break;
|
||||
case 145:
|
||||
addName(names, member.name, memberName, property);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function addName(names, location, name, meaning) {
|
||||
if (ts.hasProperty(names, name)) {
|
||||
var prev = names[name];
|
||||
if (prev & meaning) {
|
||||
error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location));
|
||||
}
|
||||
else {
|
||||
names[name] = prev | meaning;
|
||||
}
|
||||
}
|
||||
else {
|
||||
names[name] = meaning;
|
||||
}
|
||||
}
|
||||
}
|
||||
function checkObjectTypeForDuplicateDeclarations(node) {
|
||||
var names = {};
|
||||
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
||||
var member = _a[_i];
|
||||
if (member.kind == 144) {
|
||||
var memberName = void 0;
|
||||
switch (member.name.kind) {
|
||||
case 9:
|
||||
case 8:
|
||||
case 69:
|
||||
memberName = member.name.text;
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
if (ts.hasProperty(names, memberName)) {
|
||||
error(member.symbol.valueDeclaration.name, ts.Diagnostics.Duplicate_identifier_0, memberName);
|
||||
error(member.name, ts.Diagnostics.Duplicate_identifier_0, memberName);
|
||||
}
|
||||
else {
|
||||
names[memberName] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function checkTypeForDuplicateIndexSignatures(node) {
|
||||
if (node.kind === 222) {
|
||||
var nodeSymbol = getSymbolOfNode(node);
|
||||
@ -23203,6 +23321,7 @@ var ts;
|
||||
var type = getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);
|
||||
checkIndexConstraints(type);
|
||||
checkTypeForDuplicateIndexSignatures(node);
|
||||
checkObjectTypeForDuplicateDeclarations(node);
|
||||
}
|
||||
}
|
||||
function checkArrayType(node) {
|
||||
@ -23962,6 +24081,10 @@ var ts;
|
||||
if (node.initializer) {
|
||||
checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, undefined);
|
||||
}
|
||||
if (!areDeclarationFlagsIdentical(node, symbol.valueDeclaration)) {
|
||||
error(symbol.valueDeclaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name));
|
||||
error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name));
|
||||
}
|
||||
}
|
||||
if (node.kind !== 145 && node.kind !== 144) {
|
||||
checkExportsOnMergedDeclarations(node);
|
||||
@ -23974,6 +24097,18 @@ var ts;
|
||||
checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name);
|
||||
}
|
||||
}
|
||||
function areDeclarationFlagsIdentical(left, right) {
|
||||
if (ts.hasQuestionToken(left) !== ts.hasQuestionToken(right)) {
|
||||
return false;
|
||||
}
|
||||
var interestingFlags = 8 |
|
||||
16 |
|
||||
256 |
|
||||
128 |
|
||||
64 |
|
||||
32;
|
||||
return (left.flags & interestingFlags) === (right.flags & interestingFlags);
|
||||
}
|
||||
function checkVariableDeclaration(node) {
|
||||
checkGrammarVariableDeclaration(node);
|
||||
return checkVariableLikeDeclaration(node);
|
||||
@ -24524,6 +24659,7 @@ var ts;
|
||||
var typeWithThis = getTypeWithThisArgument(type);
|
||||
var staticType = getTypeOfSymbol(symbol);
|
||||
checkTypeParameterListsIdentical(node, symbol);
|
||||
checkClassForDuplicateDeclarations(node);
|
||||
var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node);
|
||||
if (baseTypeNode) {
|
||||
var baseTypes = getBaseTypes(type);
|
||||
@ -24735,6 +24871,7 @@ var ts;
|
||||
checkIndexConstraints(type);
|
||||
}
|
||||
}
|
||||
checkObjectTypeForDuplicateDeclarations(node);
|
||||
}
|
||||
ts.forEach(ts.getInterfaceBaseTypeNodes(node), function (heritageElement) {
|
||||
if (!ts.isSupportedExpressionWithTypeArguments(heritageElement)) {
|
||||
@ -25489,10 +25626,8 @@ var ts;
|
||||
function checkSourceFileWorker(node) {
|
||||
var links = getNodeLinks(node);
|
||||
if (!(links.flags & 1)) {
|
||||
if (compilerOptions.skipDefaultLibCheck) {
|
||||
if (node.hasNoDefaultLib) {
|
||||
return;
|
||||
}
|
||||
if (compilerOptions.skipLibCheck && node.isDeclarationFile || compilerOptions.skipDefaultLibCheck && node.hasNoDefaultLib) {
|
||||
return;
|
||||
}
|
||||
checkGrammarSourceFile(node);
|
||||
potentialThisCollisions.length = 0;
|
||||
@ -25861,7 +25996,7 @@ var ts;
|
||||
return symbol && getTypeOfSymbol(symbol);
|
||||
}
|
||||
if (ts.isBindingPattern(node)) {
|
||||
return getTypeForVariableLikeDeclaration(node.parent);
|
||||
return getTypeForVariableLikeDeclaration(node.parent, true);
|
||||
}
|
||||
if (isInRightSideOfImportOrExportAssignment(node)) {
|
||||
var symbol = getSymbolAtLocation(node);
|
||||
@ -26300,7 +26435,7 @@ var ts;
|
||||
if (file.moduleAugmentations.length) {
|
||||
(augmentations || (augmentations = [])).push(file.moduleAugmentations);
|
||||
}
|
||||
if (file.wasReferenced && file.symbol && file.symbol.globalExports) {
|
||||
if (file.symbol && file.symbol.globalExports) {
|
||||
mergeSymbolTable(globals, file.symbol.globalExports);
|
||||
}
|
||||
});
|
||||
@ -26870,7 +27005,6 @@ var ts;
|
||||
if (prop.kind === 193 ||
|
||||
name_20.kind === 140) {
|
||||
checkGrammarComputedPropertyName(name_20);
|
||||
return "continue";
|
||||
}
|
||||
if (prop.kind === 254 && !inDestructuring && prop.objectAssignmentInitializer) {
|
||||
return { value: grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment) };
|
||||
@ -26900,17 +27034,21 @@ var ts;
|
||||
else {
|
||||
ts.Debug.fail("Unexpected syntax kind:" + prop.kind);
|
||||
}
|
||||
if (!ts.hasProperty(seen, name_20.text)) {
|
||||
seen[name_20.text] = currentKind;
|
||||
var effectiveName = ts.getPropertyNameForPropertyNameNode(name_20);
|
||||
if (effectiveName === undefined) {
|
||||
return "continue";
|
||||
}
|
||||
if (!ts.hasProperty(seen, effectiveName)) {
|
||||
seen[effectiveName] = currentKind;
|
||||
}
|
||||
else {
|
||||
var existingKind = seen[name_20.text];
|
||||
var existingKind = seen[effectiveName];
|
||||
if (currentKind === Property && existingKind === Property) {
|
||||
return "continue";
|
||||
grammarErrorOnNode(name_20, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name_20));
|
||||
}
|
||||
else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) {
|
||||
if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) {
|
||||
seen[name_20.text] = currentKind | existingKind;
|
||||
seen[effectiveName] = currentKind | existingKind;
|
||||
}
|
||||
else {
|
||||
return { value: grammarErrorOnNode(name_20, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name) };
|
||||
@ -35367,7 +35505,7 @@ var ts;
|
||||
skipTsx: true,
|
||||
traceEnabled: traceEnabled
|
||||
};
|
||||
var rootDir = options.typesRoot || (options.configFilePath ? ts.getDirectoryPath(options.configFilePath) : undefined);
|
||||
var rootDir = options.typesRoot || (options.configFilePath ? ts.getDirectoryPath(options.configFilePath) : (host.getCurrentDirectory && host.getCurrentDirectory()));
|
||||
if (traceEnabled) {
|
||||
if (containingFile === undefined) {
|
||||
if (rootDir === undefined) {
|
||||
@ -35870,12 +36008,25 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getDefaultTypeDirectiveNames(rootPath) {
|
||||
var localTypes = ts.combinePaths(rootPath, "types");
|
||||
var npmTypes = ts.combinePaths(rootPath, "node_modules/@types");
|
||||
var result = [];
|
||||
if (ts.sys.directoryExists(localTypes)) {
|
||||
result = result.concat(ts.sys.getDirectories(localTypes));
|
||||
}
|
||||
if (ts.sys.directoryExists(npmTypes)) {
|
||||
result = result.concat(ts.sys.getDirectories(npmTypes));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function getDefaultLibLocation() {
|
||||
return ts.getDirectoryPath(ts.normalizePath(ts.sys.getExecutingFilePath()));
|
||||
}
|
||||
var newLine = ts.getNewLineCharacter(options);
|
||||
var realpath = ts.sys.realpath && (function (path) { return ts.sys.realpath(path); });
|
||||
return {
|
||||
getDefaultTypeDirectiveNames: getDefaultTypeDirectiveNames,
|
||||
getSourceFile: getSourceFile,
|
||||
getDefaultLibLocation: getDefaultLibLocation,
|
||||
getDefaultLibFileName: function (options) { return ts.combinePaths(getDefaultLibLocation(), ts.getDefaultLibFileName(options)); },
|
||||
@ -35943,6 +36094,19 @@ var ts;
|
||||
}
|
||||
return resolutions;
|
||||
}
|
||||
function getDefaultTypeDirectiveNames(options, rootFiles, host) {
|
||||
if (options.types) {
|
||||
return options.types;
|
||||
}
|
||||
if (host && host.getDefaultTypeDirectiveNames) {
|
||||
var commonRoot = computeCommonSourceDirectoryOfFilenames(rootFiles, host.getCurrentDirectory(), function (f) { return host.getCanonicalFileName(f); });
|
||||
if (commonRoot) {
|
||||
return host.getDefaultTypeDirectiveNames(commonRoot);
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
ts.getDefaultTypeDirectiveNames = getDefaultTypeDirectiveNames;
|
||||
function createProgram(rootNames, options, host, oldProgram) {
|
||||
var program;
|
||||
var files = [];
|
||||
@ -35978,13 +36142,14 @@ var ts;
|
||||
var filesByName = ts.createFileMap();
|
||||
var filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? ts.createFileMap(function (fileName) { return fileName.toLowerCase(); }) : undefined;
|
||||
if (!tryReuseStructureFromOldProgram()) {
|
||||
if (options.types && options.types.length) {
|
||||
var resolutions = resolveTypeReferenceDirectiveNamesWorker(options.types, undefined);
|
||||
for (var i = 0; i < options.types.length; i++) {
|
||||
processTypeReferenceDirective(options.types[i], resolutions[i]);
|
||||
ts.forEach(rootNames, function (name) { return processRootFile(name, false); });
|
||||
var typeReferences = getDefaultTypeDirectiveNames(options, rootNames, host);
|
||||
if (typeReferences) {
|
||||
var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, undefined);
|
||||
for (var i = 0; i < typeReferences.length; i++) {
|
||||
processTypeReferenceDirective(typeReferences[i], resolutions[i]);
|
||||
}
|
||||
}
|
||||
ts.forEach(rootNames, function (name) { return processRootFile(name, false); });
|
||||
if (!skipDefaultLib) {
|
||||
if (!options.lib) {
|
||||
processRootFile(host.getDefaultLibFileName(options), true);
|
||||
@ -36561,9 +36726,6 @@ var ts;
|
||||
if (file_1 && options.forceConsistentCasingInFileNames && ts.getNormalizedAbsolutePath(file_1.fileName, currentDirectory) !== ts.getNormalizedAbsolutePath(fileName, currentDirectory)) {
|
||||
reportFileNamesDifferOnlyInCasingError(fileName, file_1.fileName, refFile, refPos, refEnd);
|
||||
}
|
||||
if (file_1) {
|
||||
file_1.wasReferenced = file_1.wasReferenced || isReference;
|
||||
}
|
||||
return file_1;
|
||||
}
|
||||
var file = host.getSourceFile(fileName, options.target, function (hostErrorMessage) {
|
||||
@ -36576,7 +36738,6 @@ var ts;
|
||||
});
|
||||
filesByName.set(path, file);
|
||||
if (file) {
|
||||
file.wasReferenced = file.wasReferenced || isReference;
|
||||
file.path = path;
|
||||
if (host.useCaseSensitiveFileNames()) {
|
||||
var existingFile = filesByNameIgnoreCase.get(path);
|
||||
@ -36677,17 +36838,7 @@ var ts;
|
||||
!options.noResolve &&
|
||||
i < file.imports.length;
|
||||
if (shouldAddFile) {
|
||||
var importedFile = findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), false, false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end);
|
||||
if (importedFile && resolution.isExternalLibraryImport) {
|
||||
if (!ts.isExternalModule(importedFile) && importedFile.statements.length) {
|
||||
var start_5 = ts.getTokenPosOfNode(file.imports[i], file);
|
||||
fileProcessingDiagnostics.add(ts.createFileDiagnostic(file, start_5, file.imports[i].end - start_5, ts.Diagnostics.Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition, importedFile.fileName));
|
||||
}
|
||||
else if (importedFile.referencedFiles.length) {
|
||||
var firstRef = importedFile.referencedFiles[0];
|
||||
fileProcessingDiagnostics.add(ts.createFileDiagnostic(importedFile, firstRef.pos, firstRef.end - firstRef.pos, ts.Diagnostics.Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition));
|
||||
}
|
||||
}
|
||||
findSourceFile(resolution.resolvedFileName, ts.toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), false, false, file, ts.skipTrivia(file.text, file.imports[i].pos), file.imports[i].end);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -36772,7 +36923,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
else {
|
||||
programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Substututions_for_pattern_0_should_be_an_array, key));
|
||||
programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Substitutions_for_pattern_0_should_be_an_array, key));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -36821,13 +36972,19 @@ var ts;
|
||||
}
|
||||
else if (firstExternalModuleSourceFile && languageVersion < 2 && options.module === ts.ModuleKind.None) {
|
||||
var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator);
|
||||
programDiagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided_with_a_valid_module_type_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file));
|
||||
programDiagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none));
|
||||
}
|
||||
if (options.module === ts.ModuleKind.ES6 && languageVersion < 2) {
|
||||
programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_modules_into_es2015_when_targeting_ES5_or_lower));
|
||||
}
|
||||
if (outFile && options.module && !(options.module === ts.ModuleKind.AMD || options.module === ts.ModuleKind.System)) {
|
||||
programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? "out" : "outFile"));
|
||||
if (outFile) {
|
||||
if (options.module && !(options.module === ts.ModuleKind.AMD || options.module === ts.ModuleKind.System)) {
|
||||
programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? "out" : "outFile"));
|
||||
}
|
||||
else if (options.module === undefined && firstExternalModuleSourceFile) {
|
||||
var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator);
|
||||
programDiagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, options.out ? "out" : "outFile"));
|
||||
}
|
||||
}
|
||||
if (options.outDir ||
|
||||
options.sourceRoot ||
|
||||
@ -37517,7 +37674,7 @@ var ts;
|
||||
(function (ts) {
|
||||
var NavigateTo;
|
||||
(function (NavigateTo) {
|
||||
function getNavigateToItems(program, cancellationToken, searchValue, maxResultCount) {
|
||||
function getNavigateToItems(program, checker, cancellationToken, searchValue, maxResultCount) {
|
||||
var patternMatcher = ts.createPatternMatcher(searchValue);
|
||||
var rawItems = [];
|
||||
var baseSensitivity = { sensitivity: "base" };
|
||||
@ -37550,6 +37707,17 @@ var ts;
|
||||
}
|
||||
}
|
||||
});
|
||||
rawItems = ts.filter(rawItems, function (item) {
|
||||
var decl = item.declaration;
|
||||
if (decl.kind === 231 || decl.kind === 234 || decl.kind === 229) {
|
||||
var importer = checker.getSymbolAtLocation(decl.name);
|
||||
var imported = checker.getAliasedSymbol(importer);
|
||||
return importer.name !== imported.name;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
rawItems.sort(compareNavigateToItems);
|
||||
if (maxResultCount !== undefined) {
|
||||
rawItems = rawItems.slice(0, maxResultCount);
|
||||
@ -37892,8 +38060,12 @@ var ts;
|
||||
return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement);
|
||||
case 153:
|
||||
return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement);
|
||||
case 224:
|
||||
return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.enumElement);
|
||||
case 255:
|
||||
return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement);
|
||||
case 222:
|
||||
return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.interfaceElement);
|
||||
case 151:
|
||||
return createItem(node, "()", ts.ScriptElementKind.callSignatureElement);
|
||||
case 152:
|
||||
@ -39263,7 +39435,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) {
|
||||
for (var i = exclusiveStartPosition - 1; i >= 0; --i) {
|
||||
for (var i = exclusiveStartPosition - 1; i >= 0; i--) {
|
||||
if (nodeHasTokens(children[i])) {
|
||||
return children[i];
|
||||
}
|
||||
@ -39889,18 +40061,17 @@ var ts;
|
||||
if (!isStarted) {
|
||||
scanner.scan();
|
||||
}
|
||||
var t;
|
||||
var pos = scanner.getStartPos();
|
||||
while (pos < endPos) {
|
||||
var t_1 = scanner.getToken();
|
||||
if (!ts.isTrivia(t_1)) {
|
||||
var t = scanner.getToken();
|
||||
if (!ts.isTrivia(t)) {
|
||||
break;
|
||||
}
|
||||
scanner.scan();
|
||||
var item = {
|
||||
pos: pos,
|
||||
end: scanner.getStartPos(),
|
||||
kind: t_1
|
||||
kind: t
|
||||
};
|
||||
pos = scanner.getStartPos();
|
||||
if (!leadingTrivia) {
|
||||
@ -41550,7 +41721,7 @@ var ts;
|
||||
else {
|
||||
parts = [];
|
||||
var startPos = commentRange.pos;
|
||||
for (var line = startLine; line < endLine; ++line) {
|
||||
for (var line = startLine; line < endLine; line++) {
|
||||
var endOfLine = ts.getEndLinePosition(line, sourceFile);
|
||||
parts.push({ pos: startPos, end: endOfLine });
|
||||
startPos = ts.getStartPositionOfLine(line + 1, sourceFile);
|
||||
@ -41568,7 +41739,7 @@ var ts;
|
||||
startLine++;
|
||||
}
|
||||
var delta = indentation - nonWhitespaceColumnInFirstPart.column;
|
||||
for (var i = startIndex, len = parts.length; i < len; ++i, ++startLine) {
|
||||
for (var i = startIndex, len = parts.length; i < len; i++, startLine++) {
|
||||
var startLinePos_1 = ts.getStartPositionOfLine(startLine, sourceFile);
|
||||
var nonWhitespaceCharacterAndColumn = i === 0
|
||||
? nonWhitespaceColumnInFirstPart
|
||||
@ -41584,7 +41755,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
function trimTrailingWhitespacesForLines(line1, line2, range) {
|
||||
for (var line = line1; line < line2; ++line) {
|
||||
for (var line = line1; line < line2; line++) {
|
||||
var lineStartPosition = ts.getStartPositionOfLine(line, sourceFile);
|
||||
var lineEndPosition = ts.getEndLinePosition(line, sourceFile);
|
||||
if (range && (ts.isComment(range.kind) || ts.isStringOrRegularExpressionOrTemplateLiteral(range.kind)) && range.pos <= lineEndPosition && range.end > lineEndPosition) {
|
||||
@ -41627,7 +41798,6 @@ var ts;
|
||||
}
|
||||
}
|
||||
function applyRuleEdits(rule, previousRange, previousStartLine, currentRange, currentStartLine) {
|
||||
var between;
|
||||
switch (rule.Operation.Action) {
|
||||
case 1:
|
||||
return;
|
||||
@ -41657,14 +41827,6 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
function isSomeBlock(kind) {
|
||||
switch (kind) {
|
||||
case 199:
|
||||
case 226:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function getOpenTokenForList(node, list) {
|
||||
switch (node.kind) {
|
||||
case 148:
|
||||
@ -41722,7 +41884,7 @@ var ts;
|
||||
internedTabsIndentation = [];
|
||||
}
|
||||
if (internedTabsIndentation[tabs] === undefined) {
|
||||
internedTabsIndentation[tabs] = tabString = repeat('\t', tabs);
|
||||
internedTabsIndentation[tabs] = tabString = repeat("\t", tabs);
|
||||
}
|
||||
else {
|
||||
tabString = internedTabsIndentation[tabs];
|
||||
@ -41747,7 +41909,7 @@ var ts;
|
||||
}
|
||||
function repeat(value, count) {
|
||||
var s = "";
|
||||
for (var i = 0; i < count; ++i) {
|
||||
for (var i = 0; i < count; i++) {
|
||||
s += value;
|
||||
}
|
||||
return s;
|
||||
@ -42015,7 +42177,7 @@ var ts;
|
||||
ts.Debug.assert(index >= 0 && index < list.length);
|
||||
var node = list[index];
|
||||
var lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile);
|
||||
for (var i = index - 1; i >= 0; --i) {
|
||||
for (var i = index - 1; i >= 0; i--) {
|
||||
if (list[i].kind === 24) {
|
||||
continue;
|
||||
}
|
||||
@ -42034,7 +42196,7 @@ var ts;
|
||||
function findFirstNonWhitespaceCharacterAndColumn(startPos, endPos, sourceFile, options) {
|
||||
var character = 0;
|
||||
var column = 0;
|
||||
for (var pos = startPos; pos < endPos; ++pos) {
|
||||
for (var pos = startPos; pos < endPos; pos++) {
|
||||
var ch = sourceFile.text.charCodeAt(pos);
|
||||
if (!ts.isWhiteSpace(ch)) {
|
||||
break;
|
||||
@ -44005,9 +44167,9 @@ var ts;
|
||||
log("getCompletionData: Get previous token 1: " + (new Date().getTime() - start));
|
||||
var contextToken = previousToken;
|
||||
if (contextToken && position <= contextToken.end && ts.isWord(contextToken.kind)) {
|
||||
var start_6 = new Date().getTime();
|
||||
var start_5 = new Date().getTime();
|
||||
contextToken = ts.findPrecedingToken(contextToken.getFullStart(), sourceFile);
|
||||
log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_6));
|
||||
log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_5));
|
||||
}
|
||||
var node = currentToken;
|
||||
var isRightOfDot = false;
|
||||
@ -44234,9 +44396,9 @@ var ts;
|
||||
|| contextToken.kind === 166
|
||||
|| contextToken.kind === 10
|
||||
|| ts.isTemplateLiteralKind(contextToken.kind)) {
|
||||
var start_7 = contextToken.getStart();
|
||||
var start_6 = contextToken.getStart();
|
||||
var end = contextToken.getEnd();
|
||||
if (start_7 < position && position < end) {
|
||||
if (start_6 < position && position < end) {
|
||||
return true;
|
||||
}
|
||||
if (position === end) {
|
||||
@ -45314,8 +45476,7 @@ var ts;
|
||||
}
|
||||
function getDocumentHighlights(fileName, position, filesToSearch) {
|
||||
synchronizeHostData();
|
||||
filesToSearch = ts.map(filesToSearch, ts.normalizeSlashes);
|
||||
var sourceFilesToSearch = ts.filter(program.getSourceFiles(), function (f) { return ts.contains(filesToSearch, f.fileName); });
|
||||
var sourceFilesToSearch = ts.map(filesToSearch, function (f) { return program.getSourceFile(f); });
|
||||
var sourceFile = getValidSourceFile(fileName);
|
||||
var node = ts.getTouchingWord(sourceFile, position);
|
||||
if (!node) {
|
||||
@ -46498,7 +46659,8 @@ var ts;
|
||||
}
|
||||
function getNavigateToItems(searchValue, maxResultCount) {
|
||||
synchronizeHostData();
|
||||
return ts.NavigateTo.getNavigateToItems(program, cancellationToken, searchValue, maxResultCount);
|
||||
var checker = getProgram().getTypeChecker();
|
||||
return ts.NavigateTo.getNavigateToItems(program, checker, cancellationToken, searchValue, maxResultCount);
|
||||
}
|
||||
function getEmitOutput(fileName) {
|
||||
synchronizeHostData();
|
||||
@ -50961,6 +51123,9 @@ var ts;
|
||||
LanguageServiceShimHostAdapter.prototype.getCurrentDirectory = function () {
|
||||
return this.shimHost.getCurrentDirectory();
|
||||
};
|
||||
LanguageServiceShimHostAdapter.prototype.getDirectories = function (path) {
|
||||
return this.shimHost.getDirectories(path);
|
||||
};
|
||||
LanguageServiceShimHostAdapter.prototype.getDefaultLibFileName = function (options) {
|
||||
return this.shimHost.getDefaultLibFileName(JSON.stringify(options));
|
||||
};
|
||||
|
||||
40
lib/typescript.d.ts
vendored
40
lib/typescript.d.ts
vendored
@ -261,7 +261,7 @@ declare namespace ts {
|
||||
ModuleDeclaration = 225,
|
||||
ModuleBlock = 226,
|
||||
CaseBlock = 227,
|
||||
GlobalModuleExportDeclaration = 228,
|
||||
NamespaceExportDeclaration = 228,
|
||||
ImportEqualsDeclaration = 229,
|
||||
ImportDeclaration = 230,
|
||||
ImportClause = 231,
|
||||
@ -934,7 +934,7 @@ declare namespace ts {
|
||||
interface NamespaceImport extends Declaration {
|
||||
name: Identifier;
|
||||
}
|
||||
interface GlobalModuleExportDeclaration extends DeclarationStatement {
|
||||
interface NamespaceExportDeclaration extends DeclarationStatement {
|
||||
name: Identifier;
|
||||
moduleReference: LiteralLikeNode;
|
||||
}
|
||||
@ -1329,7 +1329,7 @@ declare namespace ts {
|
||||
FunctionScopedVariableExcludes = 107454,
|
||||
BlockScopedVariableExcludes = 107455,
|
||||
ParameterExcludes = 107455,
|
||||
PropertyExcludes = 107455,
|
||||
PropertyExcludes = 0,
|
||||
EnumMemberExcludes = 107455,
|
||||
FunctionExcludes = 106927,
|
||||
ClassExcludes = 899519,
|
||||
@ -1554,6 +1554,7 @@ declare namespace ts {
|
||||
allowJs?: boolean;
|
||||
noImplicitUseStrict?: boolean;
|
||||
strictNullChecks?: boolean;
|
||||
skipLibCheck?: boolean;
|
||||
listEmittedFiles?: boolean;
|
||||
lib?: string[];
|
||||
types?: string[];
|
||||
@ -1627,6 +1628,7 @@ declare namespace ts {
|
||||
trace?(s: string): void;
|
||||
directoryExists?(directoryName: string): boolean;
|
||||
realpath?(path: string): string;
|
||||
getCurrentDirectory?(): string;
|
||||
}
|
||||
interface ResolvedModule {
|
||||
resolvedFileName: string;
|
||||
@ -1650,6 +1652,7 @@ declare namespace ts {
|
||||
getCancellationToken?(): CancellationToken;
|
||||
getDefaultLibFileName(options: CompilerOptions): string;
|
||||
getDefaultLibLocation?(): string;
|
||||
getDefaultTypeDirectiveNames?(rootPath: string): string[];
|
||||
writeFile: WriteFileCallback;
|
||||
getCurrentDirectory(): string;
|
||||
getCanonicalFileName(fileName: string): string;
|
||||
@ -1693,6 +1696,7 @@ declare namespace ts {
|
||||
createDirectory(path: string): void;
|
||||
getExecutingFilePath(): string;
|
||||
getCurrentDirectory(): string;
|
||||
getDirectories(path: string): string[];
|
||||
readDirectory(path: string, extension?: string, exclude?: string[]): string[];
|
||||
getModifiedTime?(path: string): Date;
|
||||
createHash?(data: string): string;
|
||||
@ -1812,6 +1816,7 @@ declare namespace ts {
|
||||
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
|
||||
function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[];
|
||||
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
|
||||
function getDefaultTypeDirectiveNames(options: CompilerOptions, rootFiles: string[], host: CompilerHost): string[];
|
||||
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program): Program;
|
||||
}
|
||||
declare namespace ts {
|
||||
@ -2345,26 +2350,55 @@ declare namespace ts {
|
||||
namespace ScriptElementKind {
|
||||
const unknown: string;
|
||||
const warning: string;
|
||||
/** predefined type (void) or keyword (class) */
|
||||
const keyword: string;
|
||||
/** top level script node */
|
||||
const scriptElement: string;
|
||||
/** module foo {} */
|
||||
const moduleElement: string;
|
||||
/** class X {} */
|
||||
const classElement: string;
|
||||
/** var x = class X {} */
|
||||
const localClassElement: string;
|
||||
/** interface Y {} */
|
||||
const interfaceElement: string;
|
||||
/** type T = ... */
|
||||
const typeElement: string;
|
||||
/** enum E */
|
||||
const enumElement: string;
|
||||
/**
|
||||
* Inside module and script only
|
||||
* const v = ..
|
||||
*/
|
||||
const variableElement: string;
|
||||
/** Inside function */
|
||||
const localVariableElement: string;
|
||||
/**
|
||||
* Inside module and script only
|
||||
* function f() { }
|
||||
*/
|
||||
const functionElement: string;
|
||||
/** Inside function */
|
||||
const localFunctionElement: string;
|
||||
/** class X { [public|private]* foo() {} } */
|
||||
const memberFunctionElement: string;
|
||||
/** class X { [public|private]* [get|set] foo:number; } */
|
||||
const memberGetAccessorElement: string;
|
||||
const memberSetAccessorElement: string;
|
||||
/**
|
||||
* class X { [public|private]* foo:number; }
|
||||
* interface Y { foo:number; }
|
||||
*/
|
||||
const memberVariableElement: string;
|
||||
/** class X { constructor() { } } */
|
||||
const constructorImplementationElement: string;
|
||||
/** interface Y { ():number; } */
|
||||
const callSignatureElement: string;
|
||||
/** interface Y { []:number; } */
|
||||
const indexSignatureElement: string;
|
||||
/** interface Y { new():Y; } */
|
||||
const constructSignatureElement: string;
|
||||
/** function foo(*Y*: string) */
|
||||
const parameterElement: string;
|
||||
const typeParameterElement: string;
|
||||
const primitiveType: string;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
40
lib/typescriptServices.d.ts
vendored
40
lib/typescriptServices.d.ts
vendored
@ -261,7 +261,7 @@ declare namespace ts {
|
||||
ModuleDeclaration = 225,
|
||||
ModuleBlock = 226,
|
||||
CaseBlock = 227,
|
||||
GlobalModuleExportDeclaration = 228,
|
||||
NamespaceExportDeclaration = 228,
|
||||
ImportEqualsDeclaration = 229,
|
||||
ImportDeclaration = 230,
|
||||
ImportClause = 231,
|
||||
@ -934,7 +934,7 @@ declare namespace ts {
|
||||
interface NamespaceImport extends Declaration {
|
||||
name: Identifier;
|
||||
}
|
||||
interface GlobalModuleExportDeclaration extends DeclarationStatement {
|
||||
interface NamespaceExportDeclaration extends DeclarationStatement {
|
||||
name: Identifier;
|
||||
moduleReference: LiteralLikeNode;
|
||||
}
|
||||
@ -1329,7 +1329,7 @@ declare namespace ts {
|
||||
FunctionScopedVariableExcludes = 107454,
|
||||
BlockScopedVariableExcludes = 107455,
|
||||
ParameterExcludes = 107455,
|
||||
PropertyExcludes = 107455,
|
||||
PropertyExcludes = 0,
|
||||
EnumMemberExcludes = 107455,
|
||||
FunctionExcludes = 106927,
|
||||
ClassExcludes = 899519,
|
||||
@ -1554,6 +1554,7 @@ declare namespace ts {
|
||||
allowJs?: boolean;
|
||||
noImplicitUseStrict?: boolean;
|
||||
strictNullChecks?: boolean;
|
||||
skipLibCheck?: boolean;
|
||||
listEmittedFiles?: boolean;
|
||||
lib?: string[];
|
||||
types?: string[];
|
||||
@ -1627,6 +1628,7 @@ declare namespace ts {
|
||||
trace?(s: string): void;
|
||||
directoryExists?(directoryName: string): boolean;
|
||||
realpath?(path: string): string;
|
||||
getCurrentDirectory?(): string;
|
||||
}
|
||||
interface ResolvedModule {
|
||||
resolvedFileName: string;
|
||||
@ -1650,6 +1652,7 @@ declare namespace ts {
|
||||
getCancellationToken?(): CancellationToken;
|
||||
getDefaultLibFileName(options: CompilerOptions): string;
|
||||
getDefaultLibLocation?(): string;
|
||||
getDefaultTypeDirectiveNames?(rootPath: string): string[];
|
||||
writeFile: WriteFileCallback;
|
||||
getCurrentDirectory(): string;
|
||||
getCanonicalFileName(fileName: string): string;
|
||||
@ -1693,6 +1696,7 @@ declare namespace ts {
|
||||
createDirectory(path: string): void;
|
||||
getExecutingFilePath(): string;
|
||||
getCurrentDirectory(): string;
|
||||
getDirectories(path: string): string[];
|
||||
readDirectory(path: string, extension?: string, exclude?: string[]): string[];
|
||||
getModifiedTime?(path: string): Date;
|
||||
createHash?(data: string): string;
|
||||
@ -1812,6 +1816,7 @@ declare namespace ts {
|
||||
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
|
||||
function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[];
|
||||
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
|
||||
function getDefaultTypeDirectiveNames(options: CompilerOptions, rootFiles: string[], host: CompilerHost): string[];
|
||||
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program): Program;
|
||||
}
|
||||
declare namespace ts {
|
||||
@ -2345,26 +2350,55 @@ declare namespace ts {
|
||||
namespace ScriptElementKind {
|
||||
const unknown: string;
|
||||
const warning: string;
|
||||
/** predefined type (void) or keyword (class) */
|
||||
const keyword: string;
|
||||
/** top level script node */
|
||||
const scriptElement: string;
|
||||
/** module foo {} */
|
||||
const moduleElement: string;
|
||||
/** class X {} */
|
||||
const classElement: string;
|
||||
/** var x = class X {} */
|
||||
const localClassElement: string;
|
||||
/** interface Y {} */
|
||||
const interfaceElement: string;
|
||||
/** type T = ... */
|
||||
const typeElement: string;
|
||||
/** enum E */
|
||||
const enumElement: string;
|
||||
/**
|
||||
* Inside module and script only
|
||||
* const v = ..
|
||||
*/
|
||||
const variableElement: string;
|
||||
/** Inside function */
|
||||
const localVariableElement: string;
|
||||
/**
|
||||
* Inside module and script only
|
||||
* function f() { }
|
||||
*/
|
||||
const functionElement: string;
|
||||
/** Inside function */
|
||||
const localFunctionElement: string;
|
||||
/** class X { [public|private]* foo() {} } */
|
||||
const memberFunctionElement: string;
|
||||
/** class X { [public|private]* [get|set] foo:number; } */
|
||||
const memberGetAccessorElement: string;
|
||||
const memberSetAccessorElement: string;
|
||||
/**
|
||||
* class X { [public|private]* foo:number; }
|
||||
* interface Y { foo:number; }
|
||||
*/
|
||||
const memberVariableElement: string;
|
||||
/** class X { constructor() { } } */
|
||||
const constructorImplementationElement: string;
|
||||
/** interface Y { ():number; } */
|
||||
const callSignatureElement: string;
|
||||
/** interface Y { []:number; } */
|
||||
const indexSignatureElement: string;
|
||||
/** interface Y { new():Y; } */
|
||||
const constructSignatureElement: string;
|
||||
/** function foo(*Y*: string) */
|
||||
const parameterElement: string;
|
||||
const typeParameterElement: string;
|
||||
const primitiveType: string;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user