mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-07-02 14:48:32 -05:00
Update LKG
This commit is contained in:
183
lib/tsc.js
183
lib/tsc.js
@@ -661,12 +661,13 @@ var ts;
|
||||
if (!fileName) {
|
||||
return false;
|
||||
}
|
||||
var dotIndex = fileName.lastIndexOf(".");
|
||||
if (dotIndex < 0) {
|
||||
return false;
|
||||
for (var _i = 0; _i < ts.supportedExtensions.length; _i++) {
|
||||
var extension = ts.supportedExtensions[_i];
|
||||
if (fileExtensionIs(fileName, extension)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
var extension = fileName.slice(dotIndex, fileName.length);
|
||||
return ts.supportedExtensions.indexOf(extension) >= 0;
|
||||
return false;
|
||||
}
|
||||
ts.isSupportedSourceFileName = isSupportedSourceFileName;
|
||||
var extensionsToRemove = [".d.ts", ".ts", ".js", ".tsx", ".jsx"];
|
||||
@@ -748,7 +749,7 @@ var ts;
|
||||
function copyListRemovingItem(item, list) {
|
||||
var copiedList = [];
|
||||
for (var i = 0, len = list.length; i < len; i++) {
|
||||
if (list[i] != item) {
|
||||
if (list[i] !== item) {
|
||||
copiedList.push(list[i]);
|
||||
}
|
||||
}
|
||||
@@ -1510,7 +1511,6 @@ var ts;
|
||||
Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: { code: 2515, category: ts.DiagnosticCategory.Error, key: "Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'." },
|
||||
All_declarations_of_an_abstract_method_must_be_consecutive: { code: 2516, category: ts.DiagnosticCategory.Error, key: "All declarations of an abstract method must be consecutive." },
|
||||
Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { code: 2517, category: ts.DiagnosticCategory.Error, key: "Cannot assign an abstract constructor type to a non-abstract constructor type." },
|
||||
Only_an_ambient_class_can_be_merged_with_an_interface: { code: 2518, category: ts.DiagnosticCategory.Error, key: "Only an ambient class can be merged with an interface." },
|
||||
Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { code: 2520, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions." },
|
||||
Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { code: 2521, category: ts.DiagnosticCategory.Error, key: "Expression resolves to variable declaration '{0}' that compiler uses to support async functions." },
|
||||
The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_function_expression: { code: 2522, category: ts.DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an async arrow function. Consider using a standard async function expression." },
|
||||
@@ -13387,7 +13387,9 @@ var ts;
|
||||
function getSignatureFromDeclaration(declaration) {
|
||||
var links = getNodeLinks(declaration);
|
||||
if (!links.resolvedSignature) {
|
||||
var classType = declaration.kind === 144 ? getDeclaredTypeOfClassOrInterface(declaration.parent.symbol) : undefined;
|
||||
var classType = declaration.kind === 144 ?
|
||||
getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol))
|
||||
: undefined;
|
||||
var typeParameters = classType ? classType.localTypeParameters :
|
||||
declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined;
|
||||
var parameters = [];
|
||||
@@ -17186,83 +17188,83 @@ var ts;
|
||||
}
|
||||
}
|
||||
function getEffectiveDecoratorFirstArgumentType(node) {
|
||||
switch (node.kind) {
|
||||
case 214:
|
||||
case 186:
|
||||
if (node.kind === 214) {
|
||||
var classSymbol = getSymbolOfNode(node);
|
||||
return getTypeOfSymbol(classSymbol);
|
||||
}
|
||||
if (node.kind === 138) {
|
||||
node = node.parent;
|
||||
if (node.kind === 144) {
|
||||
var classSymbol = getSymbolOfNode(node);
|
||||
return getTypeOfSymbol(classSymbol);
|
||||
case 138:
|
||||
node = node.parent;
|
||||
if (node.kind === 144) {
|
||||
var classSymbol_1 = getSymbolOfNode(node);
|
||||
return getTypeOfSymbol(classSymbol_1);
|
||||
}
|
||||
case 141:
|
||||
case 143:
|
||||
case 145:
|
||||
case 146:
|
||||
return getParentTypeOfClassElement(node);
|
||||
default:
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
}
|
||||
}
|
||||
if (node.kind === 141 ||
|
||||
node.kind === 143 ||
|
||||
node.kind === 145 ||
|
||||
node.kind === 146) {
|
||||
return getParentTypeOfClassElement(node);
|
||||
}
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
}
|
||||
function getEffectiveDecoratorSecondArgumentType(node) {
|
||||
switch (node.kind) {
|
||||
case 214:
|
||||
ts.Debug.fail("Class decorators should not have a second synthetic argument.");
|
||||
return unknownType;
|
||||
case 138:
|
||||
node = node.parent;
|
||||
if (node.kind === 144) {
|
||||
return anyType;
|
||||
}
|
||||
case 141:
|
||||
case 143:
|
||||
case 145:
|
||||
case 146:
|
||||
var element = node;
|
||||
switch (element.name.kind) {
|
||||
case 69:
|
||||
case 8:
|
||||
case 9:
|
||||
return getStringLiteralType(element.name);
|
||||
case 136:
|
||||
var nameType = checkComputedPropertyName(element.name);
|
||||
if (allConstituentTypesHaveKind(nameType, 16777216)) {
|
||||
return nameType;
|
||||
}
|
||||
else {
|
||||
return stringType;
|
||||
}
|
||||
default:
|
||||
ts.Debug.fail("Unsupported property name.");
|
||||
return unknownType;
|
||||
}
|
||||
default:
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
if (node.kind === 214) {
|
||||
ts.Debug.fail("Class decorators should not have a second synthetic argument.");
|
||||
return unknownType;
|
||||
}
|
||||
if (node.kind === 138) {
|
||||
node = node.parent;
|
||||
if (node.kind === 144) {
|
||||
return anyType;
|
||||
}
|
||||
}
|
||||
if (node.kind === 141 ||
|
||||
node.kind === 143 ||
|
||||
node.kind === 145 ||
|
||||
node.kind === 146) {
|
||||
var element = node;
|
||||
switch (element.name.kind) {
|
||||
case 69:
|
||||
case 8:
|
||||
case 9:
|
||||
return getStringLiteralType(element.name);
|
||||
case 136:
|
||||
var nameType = checkComputedPropertyName(element.name);
|
||||
if (allConstituentTypesHaveKind(nameType, 16777216)) {
|
||||
return nameType;
|
||||
}
|
||||
else {
|
||||
return stringType;
|
||||
}
|
||||
default:
|
||||
ts.Debug.fail("Unsupported property name.");
|
||||
return unknownType;
|
||||
}
|
||||
}
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
}
|
||||
function getEffectiveDecoratorThirdArgumentType(node) {
|
||||
switch (node.kind) {
|
||||
case 214:
|
||||
ts.Debug.fail("Class decorators should not have a third synthetic argument.");
|
||||
return unknownType;
|
||||
case 138:
|
||||
return numberType;
|
||||
case 141:
|
||||
ts.Debug.fail("Property decorators should not have a third synthetic argument.");
|
||||
return unknownType;
|
||||
case 143:
|
||||
case 145:
|
||||
case 146:
|
||||
var propertyType = getTypeOfNode(node);
|
||||
return createTypedPropertyDescriptorType(propertyType);
|
||||
default:
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
if (node.kind === 214) {
|
||||
ts.Debug.fail("Class decorators should not have a third synthetic argument.");
|
||||
return unknownType;
|
||||
}
|
||||
if (node.kind === 138) {
|
||||
return numberType;
|
||||
}
|
||||
if (node.kind === 141) {
|
||||
ts.Debug.fail("Property decorators should not have a third synthetic argument.");
|
||||
return unknownType;
|
||||
}
|
||||
if (node.kind === 143 ||
|
||||
node.kind === 145 ||
|
||||
node.kind === 146) {
|
||||
var propertyType = getTypeOfNode(node);
|
||||
return createTypedPropertyDescriptorType(propertyType);
|
||||
}
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
}
|
||||
function getEffectiveDecoratorArgumentType(node, argIndex) {
|
||||
if (argIndex === 0) {
|
||||
@@ -18906,7 +18908,10 @@ var ts;
|
||||
}
|
||||
function getEffectiveDeclarationFlags(n, flagsToCheck) {
|
||||
var flags = ts.getCombinedNodeFlags(n);
|
||||
if (n.parent.kind !== 215 && ts.isInAmbientContext(n)) {
|
||||
if (n.parent.kind !== 215 &&
|
||||
n.parent.kind !== 214 &&
|
||||
n.parent.kind !== 186 &&
|
||||
ts.isInAmbientContext(n)) {
|
||||
if (!(flags & 2)) {
|
||||
flags |= 1;
|
||||
}
|
||||
@@ -20101,9 +20106,6 @@ var ts;
|
||||
grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name);
|
||||
}
|
||||
checkClassLikeDeclaration(node);
|
||||
if (getSymbolOfNode(node).flags & 64 && !ts.isInAmbientContext(node)) {
|
||||
error(node, ts.Diagnostics.Only_an_ambient_class_can_be_merged_with_an_interface);
|
||||
}
|
||||
ts.forEach(node.members, checkSourceElement);
|
||||
}
|
||||
function checkClassLikeDeclaration(node) {
|
||||
@@ -20323,15 +20325,6 @@ var ts;
|
||||
checkIndexConstraints(type);
|
||||
}
|
||||
}
|
||||
if (symbol && symbol.declarations) {
|
||||
for (var _b = 0, _c = symbol.declarations; _b < _c.length; _b++) {
|
||||
var declaration = _c[_b];
|
||||
if (declaration.kind === 214 && !ts.isInAmbientContext(declaration)) {
|
||||
error(node, ts.Diagnostics.Only_an_ambient_class_can_be_merged_with_an_interface);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ts.forEach(ts.getInterfaceBaseTypeNodes(node), function (heritageElement) {
|
||||
if (!ts.isSupportedExpressionWithTypeArguments(heritageElement)) {
|
||||
@@ -29850,7 +29843,7 @@ var ts;
|
||||
ts.ioReadTime = 0;
|
||||
ts.ioWriteTime = 0;
|
||||
var emptyArray = [];
|
||||
ts.version = "1.7.0";
|
||||
ts.version = "1.7.2";
|
||||
function findConfigFile(searchPath) {
|
||||
var fileName = "tsconfig.json";
|
||||
while (true) {
|
||||
@@ -30748,7 +30741,8 @@ var ts;
|
||||
"amd": 2,
|
||||
"system": 4,
|
||||
"umd": 3,
|
||||
"es6": 5
|
||||
"es6": 5,
|
||||
"es2015": 5
|
||||
},
|
||||
description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es6,
|
||||
paramType: ts.Diagnostics.KIND,
|
||||
@@ -30876,7 +30870,12 @@ var ts;
|
||||
{
|
||||
name: "target",
|
||||
shortName: "t",
|
||||
type: { "es3": 0, "es5": 1, "es6": 2 },
|
||||
type: {
|
||||
"es3": 0,
|
||||
"es5": 1,
|
||||
"es6": 2,
|
||||
"es2015": 2
|
||||
},
|
||||
description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental,
|
||||
paramType: ts.Diagnostics.VERSION,
|
||||
error: ts.Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES6
|
||||
|
||||
185
lib/tsserver.js
185
lib/tsserver.js
@@ -661,12 +661,13 @@ var ts;
|
||||
if (!fileName) {
|
||||
return false;
|
||||
}
|
||||
var dotIndex = fileName.lastIndexOf(".");
|
||||
if (dotIndex < 0) {
|
||||
return false;
|
||||
for (var _i = 0; _i < ts.supportedExtensions.length; _i++) {
|
||||
var extension = ts.supportedExtensions[_i];
|
||||
if (fileExtensionIs(fileName, extension)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
var extension = fileName.slice(dotIndex, fileName.length);
|
||||
return ts.supportedExtensions.indexOf(extension) >= 0;
|
||||
return false;
|
||||
}
|
||||
ts.isSupportedSourceFileName = isSupportedSourceFileName;
|
||||
var extensionsToRemove = [".d.ts", ".ts", ".js", ".tsx", ".jsx"];
|
||||
@@ -748,7 +749,7 @@ var ts;
|
||||
function copyListRemovingItem(item, list) {
|
||||
var copiedList = [];
|
||||
for (var i = 0, len = list.length; i < len; i++) {
|
||||
if (list[i] != item) {
|
||||
if (list[i] !== item) {
|
||||
copiedList.push(list[i]);
|
||||
}
|
||||
}
|
||||
@@ -1510,7 +1511,6 @@ var ts;
|
||||
Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: { code: 2515, category: ts.DiagnosticCategory.Error, key: "Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'." },
|
||||
All_declarations_of_an_abstract_method_must_be_consecutive: { code: 2516, category: ts.DiagnosticCategory.Error, key: "All declarations of an abstract method must be consecutive." },
|
||||
Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { code: 2517, category: ts.DiagnosticCategory.Error, key: "Cannot assign an abstract constructor type to a non-abstract constructor type." },
|
||||
Only_an_ambient_class_can_be_merged_with_an_interface: { code: 2518, category: ts.DiagnosticCategory.Error, key: "Only an ambient class can be merged with an interface." },
|
||||
Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { code: 2520, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions." },
|
||||
Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { code: 2521, category: ts.DiagnosticCategory.Error, key: "Expression resolves to variable declaration '{0}' that compiler uses to support async functions." },
|
||||
The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_function_expression: { code: 2522, category: ts.DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an async arrow function. Consider using a standard async function expression." },
|
||||
@@ -3152,7 +3152,8 @@ var ts;
|
||||
"amd": 2,
|
||||
"system": 4,
|
||||
"umd": 3,
|
||||
"es6": 5
|
||||
"es6": 5,
|
||||
"es2015": 5
|
||||
},
|
||||
description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es6,
|
||||
paramType: ts.Diagnostics.KIND,
|
||||
@@ -3280,7 +3281,12 @@ var ts;
|
||||
{
|
||||
name: "target",
|
||||
shortName: "t",
|
||||
type: { "es3": 0, "es5": 1, "es6": 2 },
|
||||
type: {
|
||||
"es3": 0,
|
||||
"es5": 1,
|
||||
"es6": 2,
|
||||
"es2015": 2
|
||||
},
|
||||
description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental,
|
||||
paramType: ts.Diagnostics.VERSION,
|
||||
error: ts.Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES6
|
||||
@@ -13844,7 +13850,9 @@ var ts;
|
||||
function getSignatureFromDeclaration(declaration) {
|
||||
var links = getNodeLinks(declaration);
|
||||
if (!links.resolvedSignature) {
|
||||
var classType = declaration.kind === 144 ? getDeclaredTypeOfClassOrInterface(declaration.parent.symbol) : undefined;
|
||||
var classType = declaration.kind === 144 ?
|
||||
getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol))
|
||||
: undefined;
|
||||
var typeParameters = classType ? classType.localTypeParameters :
|
||||
declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined;
|
||||
var parameters = [];
|
||||
@@ -17643,83 +17651,83 @@ var ts;
|
||||
}
|
||||
}
|
||||
function getEffectiveDecoratorFirstArgumentType(node) {
|
||||
switch (node.kind) {
|
||||
case 214:
|
||||
case 186:
|
||||
if (node.kind === 214) {
|
||||
var classSymbol = getSymbolOfNode(node);
|
||||
return getTypeOfSymbol(classSymbol);
|
||||
}
|
||||
if (node.kind === 138) {
|
||||
node = node.parent;
|
||||
if (node.kind === 144) {
|
||||
var classSymbol = getSymbolOfNode(node);
|
||||
return getTypeOfSymbol(classSymbol);
|
||||
case 138:
|
||||
node = node.parent;
|
||||
if (node.kind === 144) {
|
||||
var classSymbol_1 = getSymbolOfNode(node);
|
||||
return getTypeOfSymbol(classSymbol_1);
|
||||
}
|
||||
case 141:
|
||||
case 143:
|
||||
case 145:
|
||||
case 146:
|
||||
return getParentTypeOfClassElement(node);
|
||||
default:
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
}
|
||||
}
|
||||
if (node.kind === 141 ||
|
||||
node.kind === 143 ||
|
||||
node.kind === 145 ||
|
||||
node.kind === 146) {
|
||||
return getParentTypeOfClassElement(node);
|
||||
}
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
}
|
||||
function getEffectiveDecoratorSecondArgumentType(node) {
|
||||
switch (node.kind) {
|
||||
case 214:
|
||||
ts.Debug.fail("Class decorators should not have a second synthetic argument.");
|
||||
return unknownType;
|
||||
case 138:
|
||||
node = node.parent;
|
||||
if (node.kind === 144) {
|
||||
return anyType;
|
||||
}
|
||||
case 141:
|
||||
case 143:
|
||||
case 145:
|
||||
case 146:
|
||||
var element = node;
|
||||
switch (element.name.kind) {
|
||||
case 69:
|
||||
case 8:
|
||||
case 9:
|
||||
return getStringLiteralType(element.name);
|
||||
case 136:
|
||||
var nameType = checkComputedPropertyName(element.name);
|
||||
if (allConstituentTypesHaveKind(nameType, 16777216)) {
|
||||
return nameType;
|
||||
}
|
||||
else {
|
||||
return stringType;
|
||||
}
|
||||
default:
|
||||
ts.Debug.fail("Unsupported property name.");
|
||||
return unknownType;
|
||||
}
|
||||
default:
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
if (node.kind === 214) {
|
||||
ts.Debug.fail("Class decorators should not have a second synthetic argument.");
|
||||
return unknownType;
|
||||
}
|
||||
if (node.kind === 138) {
|
||||
node = node.parent;
|
||||
if (node.kind === 144) {
|
||||
return anyType;
|
||||
}
|
||||
}
|
||||
if (node.kind === 141 ||
|
||||
node.kind === 143 ||
|
||||
node.kind === 145 ||
|
||||
node.kind === 146) {
|
||||
var element = node;
|
||||
switch (element.name.kind) {
|
||||
case 69:
|
||||
case 8:
|
||||
case 9:
|
||||
return getStringLiteralType(element.name);
|
||||
case 136:
|
||||
var nameType = checkComputedPropertyName(element.name);
|
||||
if (allConstituentTypesHaveKind(nameType, 16777216)) {
|
||||
return nameType;
|
||||
}
|
||||
else {
|
||||
return stringType;
|
||||
}
|
||||
default:
|
||||
ts.Debug.fail("Unsupported property name.");
|
||||
return unknownType;
|
||||
}
|
||||
}
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
}
|
||||
function getEffectiveDecoratorThirdArgumentType(node) {
|
||||
switch (node.kind) {
|
||||
case 214:
|
||||
ts.Debug.fail("Class decorators should not have a third synthetic argument.");
|
||||
return unknownType;
|
||||
case 138:
|
||||
return numberType;
|
||||
case 141:
|
||||
ts.Debug.fail("Property decorators should not have a third synthetic argument.");
|
||||
return unknownType;
|
||||
case 143:
|
||||
case 145:
|
||||
case 146:
|
||||
var propertyType = getTypeOfNode(node);
|
||||
return createTypedPropertyDescriptorType(propertyType);
|
||||
default:
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
if (node.kind === 214) {
|
||||
ts.Debug.fail("Class decorators should not have a third synthetic argument.");
|
||||
return unknownType;
|
||||
}
|
||||
if (node.kind === 138) {
|
||||
return numberType;
|
||||
}
|
||||
if (node.kind === 141) {
|
||||
ts.Debug.fail("Property decorators should not have a third synthetic argument.");
|
||||
return unknownType;
|
||||
}
|
||||
if (node.kind === 143 ||
|
||||
node.kind === 145 ||
|
||||
node.kind === 146) {
|
||||
var propertyType = getTypeOfNode(node);
|
||||
return createTypedPropertyDescriptorType(propertyType);
|
||||
}
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
}
|
||||
function getEffectiveDecoratorArgumentType(node, argIndex) {
|
||||
if (argIndex === 0) {
|
||||
@@ -19363,7 +19371,10 @@ var ts;
|
||||
}
|
||||
function getEffectiveDeclarationFlags(n, flagsToCheck) {
|
||||
var flags = ts.getCombinedNodeFlags(n);
|
||||
if (n.parent.kind !== 215 && ts.isInAmbientContext(n)) {
|
||||
if (n.parent.kind !== 215 &&
|
||||
n.parent.kind !== 214 &&
|
||||
n.parent.kind !== 186 &&
|
||||
ts.isInAmbientContext(n)) {
|
||||
if (!(flags & 2)) {
|
||||
flags |= 1;
|
||||
}
|
||||
@@ -20558,9 +20569,6 @@ var ts;
|
||||
grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name);
|
||||
}
|
||||
checkClassLikeDeclaration(node);
|
||||
if (getSymbolOfNode(node).flags & 64 && !ts.isInAmbientContext(node)) {
|
||||
error(node, ts.Diagnostics.Only_an_ambient_class_can_be_merged_with_an_interface);
|
||||
}
|
||||
ts.forEach(node.members, checkSourceElement);
|
||||
}
|
||||
function checkClassLikeDeclaration(node) {
|
||||
@@ -20780,15 +20788,6 @@ var ts;
|
||||
checkIndexConstraints(type);
|
||||
}
|
||||
}
|
||||
if (symbol && symbol.declarations) {
|
||||
for (var _b = 0, _c = symbol.declarations; _b < _c.length; _b++) {
|
||||
var declaration = _c[_b];
|
||||
if (declaration.kind === 214 && !ts.isInAmbientContext(declaration)) {
|
||||
error(node, ts.Diagnostics.Only_an_ambient_class_can_be_merged_with_an_interface);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ts.forEach(ts.getInterfaceBaseTypeNodes(node), function (heritageElement) {
|
||||
if (!ts.isSupportedExpressionWithTypeArguments(heritageElement)) {
|
||||
@@ -30307,7 +30306,7 @@ var ts;
|
||||
ts.ioReadTime = 0;
|
||||
ts.ioWriteTime = 0;
|
||||
var emptyArray = [];
|
||||
ts.version = "1.7.0";
|
||||
ts.version = "1.7.2";
|
||||
function findConfigFile(searchPath) {
|
||||
var fileName = "tsconfig.json";
|
||||
while (true) {
|
||||
@@ -42814,7 +42813,7 @@ var ts;
|
||||
if (!(--project.projectService.directoryWatchersRefCount[directory])) {
|
||||
this.log("Close directory watcher for: " + directory);
|
||||
project.projectService.directoryWatchersForTsconfig[directory].close();
|
||||
project.projectService.directoryWatchersForTsconfig[directory] = undefined;
|
||||
delete project.projectService.directoryWatchersForTsconfig[directory];
|
||||
}
|
||||
}
|
||||
this.inferredProjects = copyListRemovingItem(project, this.inferredProjects);
|
||||
|
||||
2
lib/typescript.d.ts
vendored
2
lib/typescript.d.ts
vendored
@@ -1359,6 +1359,7 @@ declare namespace ts {
|
||||
UMD = 3,
|
||||
System = 4,
|
||||
ES6 = 5,
|
||||
ES2015 = 5,
|
||||
}
|
||||
const enum JsxEmit {
|
||||
None = 0,
|
||||
@@ -1377,6 +1378,7 @@ declare namespace ts {
|
||||
ES3 = 0,
|
||||
ES5 = 1,
|
||||
ES6 = 2,
|
||||
ES2015 = 2,
|
||||
Latest = 2,
|
||||
}
|
||||
const enum LanguageVariant {
|
||||
|
||||
@@ -660,6 +660,7 @@ var ts;
|
||||
ModuleKind[ModuleKind["UMD"] = 3] = "UMD";
|
||||
ModuleKind[ModuleKind["System"] = 4] = "System";
|
||||
ModuleKind[ModuleKind["ES6"] = 5] = "ES6";
|
||||
ModuleKind[ModuleKind["ES2015"] = 5] = "ES2015";
|
||||
})(ts.ModuleKind || (ts.ModuleKind = {}));
|
||||
var ModuleKind = ts.ModuleKind;
|
||||
(function (JsxEmit) {
|
||||
@@ -677,6 +678,7 @@ var ts;
|
||||
ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3";
|
||||
ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5";
|
||||
ScriptTarget[ScriptTarget["ES6"] = 2] = "ES6";
|
||||
ScriptTarget[ScriptTarget["ES2015"] = 2] = "ES2015";
|
||||
ScriptTarget[ScriptTarget["Latest"] = 2] = "Latest";
|
||||
})(ts.ScriptTarget || (ts.ScriptTarget = {}));
|
||||
var ScriptTarget = ts.ScriptTarget;
|
||||
@@ -1517,12 +1519,13 @@ var ts;
|
||||
if (!fileName) {
|
||||
return false;
|
||||
}
|
||||
var dotIndex = fileName.lastIndexOf(".");
|
||||
if (dotIndex < 0) {
|
||||
return false;
|
||||
for (var _i = 0; _i < ts.supportedExtensions.length; _i++) {
|
||||
var extension = ts.supportedExtensions[_i];
|
||||
if (fileExtensionIs(fileName, extension)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
var extension = fileName.slice(dotIndex, fileName.length);
|
||||
return ts.supportedExtensions.indexOf(extension) >= 0;
|
||||
return false;
|
||||
}
|
||||
ts.isSupportedSourceFileName = isSupportedSourceFileName;
|
||||
var extensionsToRemove = [".d.ts", ".ts", ".js", ".tsx", ".jsx"];
|
||||
@@ -1611,7 +1614,7 @@ var ts;
|
||||
function copyListRemovingItem(item, list) {
|
||||
var copiedList = [];
|
||||
for (var i = 0, len = list.length; i < len; i++) {
|
||||
if (list[i] != item) {
|
||||
if (list[i] !== item) {
|
||||
copiedList.push(list[i]);
|
||||
}
|
||||
}
|
||||
@@ -2423,7 +2426,6 @@ var ts;
|
||||
Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: { code: 2515, category: ts.DiagnosticCategory.Error, key: "Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'." },
|
||||
All_declarations_of_an_abstract_method_must_be_consecutive: { code: 2516, category: ts.DiagnosticCategory.Error, key: "All declarations of an abstract method must be consecutive." },
|
||||
Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { code: 2517, category: ts.DiagnosticCategory.Error, key: "Cannot assign an abstract constructor type to a non-abstract constructor type." },
|
||||
Only_an_ambient_class_can_be_merged_with_an_interface: { code: 2518, category: ts.DiagnosticCategory.Error, key: "Only an ambient class can be merged with an interface." },
|
||||
Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { code: 2520, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions." },
|
||||
Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { code: 2521, category: ts.DiagnosticCategory.Error, key: "Expression resolves to variable declaration '{0}' that compiler uses to support async functions." },
|
||||
The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_function_expression: { code: 2522, category: ts.DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an async arrow function. Consider using a standard async function expression." },
|
||||
@@ -16635,7 +16637,9 @@ var ts;
|
||||
function getSignatureFromDeclaration(declaration) {
|
||||
var links = getNodeLinks(declaration);
|
||||
if (!links.resolvedSignature) {
|
||||
var classType = declaration.kind === 144 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(declaration.parent.symbol) : undefined;
|
||||
var classType = declaration.kind === 144 /* Constructor */ ?
|
||||
getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol))
|
||||
: undefined;
|
||||
var typeParameters = classType ? classType.localTypeParameters :
|
||||
declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined;
|
||||
var parameters = [];
|
||||
@@ -21121,35 +21125,33 @@ var ts;
|
||||
*/
|
||||
function getEffectiveDecoratorFirstArgumentType(node) {
|
||||
// The first argument to a decorator is its `target`.
|
||||
switch (node.kind) {
|
||||
case 214 /* ClassDeclaration */:
|
||||
case 186 /* ClassExpression */:
|
||||
// For a class decorator, the `target` is the type of the class (e.g. the
|
||||
// "static" or "constructor" side of the class)
|
||||
if (node.kind === 214 /* ClassDeclaration */) {
|
||||
// For a class decorator, the `target` is the type of the class (e.g. the
|
||||
// "static" or "constructor" side of the class)
|
||||
var classSymbol = getSymbolOfNode(node);
|
||||
return getTypeOfSymbol(classSymbol);
|
||||
}
|
||||
if (node.kind === 138 /* Parameter */) {
|
||||
// For a parameter decorator, the `target` is the parent type of the
|
||||
// parameter's containing method.
|
||||
node = node.parent;
|
||||
if (node.kind === 144 /* Constructor */) {
|
||||
var classSymbol = getSymbolOfNode(node);
|
||||
return getTypeOfSymbol(classSymbol);
|
||||
case 138 /* Parameter */:
|
||||
// For a parameter decorator, the `target` is the parent type of the
|
||||
// parameter's containing method.
|
||||
node = node.parent;
|
||||
if (node.kind === 144 /* Constructor */) {
|
||||
var classSymbol_1 = getSymbolOfNode(node);
|
||||
return getTypeOfSymbol(classSymbol_1);
|
||||
}
|
||||
// fall-through
|
||||
case 141 /* PropertyDeclaration */:
|
||||
case 143 /* MethodDeclaration */:
|
||||
case 145 /* GetAccessor */:
|
||||
case 146 /* SetAccessor */:
|
||||
// For a property or method decorator, the `target` is the
|
||||
// "static"-side type of the parent of the member if the member is
|
||||
// declared "static"; otherwise, it is the "instance"-side type of the
|
||||
// parent of the member.
|
||||
return getParentTypeOfClassElement(node);
|
||||
default:
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
}
|
||||
}
|
||||
if (node.kind === 141 /* PropertyDeclaration */ ||
|
||||
node.kind === 143 /* MethodDeclaration */ ||
|
||||
node.kind === 145 /* GetAccessor */ ||
|
||||
node.kind === 146 /* SetAccessor */) {
|
||||
// For a property or method decorator, the `target` is the
|
||||
// "static"-side type of the parent of the member if the member is
|
||||
// declared "static"; otherwise, it is the "instance"-side type of the
|
||||
// parent of the member.
|
||||
return getParentTypeOfClassElement(node);
|
||||
}
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
}
|
||||
/**
|
||||
* Returns the effective type for the second argument to a decorator.
|
||||
@@ -21168,49 +21170,46 @@ var ts;
|
||||
*/
|
||||
function getEffectiveDecoratorSecondArgumentType(node) {
|
||||
// The second argument to a decorator is its `propertyKey`
|
||||
switch (node.kind) {
|
||||
case 214 /* ClassDeclaration */:
|
||||
ts.Debug.fail("Class decorators should not have a second synthetic argument.");
|
||||
return unknownType;
|
||||
case 138 /* Parameter */:
|
||||
node = node.parent;
|
||||
if (node.kind === 144 /* Constructor */) {
|
||||
// For a constructor parameter decorator, the `propertyKey` will be `undefined`.
|
||||
return anyType;
|
||||
}
|
||||
// For a non-constructor parameter decorator, the `propertyKey` will be either
|
||||
// a string or a symbol, based on the name of the parameter's containing method.
|
||||
// fall-through
|
||||
case 141 /* PropertyDeclaration */:
|
||||
case 143 /* MethodDeclaration */:
|
||||
case 145 /* GetAccessor */:
|
||||
case 146 /* SetAccessor */:
|
||||
// The `propertyKey` for a property or method decorator will be a
|
||||
// string literal type if the member name is an identifier, number, or string;
|
||||
// otherwise, if the member name is a computed property name it will
|
||||
// be either string or symbol.
|
||||
var element = node;
|
||||
switch (element.name.kind) {
|
||||
case 69 /* Identifier */:
|
||||
case 8 /* NumericLiteral */:
|
||||
case 9 /* StringLiteral */:
|
||||
return getStringLiteralType(element.name);
|
||||
case 136 /* ComputedPropertyName */:
|
||||
var nameType = checkComputedPropertyName(element.name);
|
||||
if (allConstituentTypesHaveKind(nameType, 16777216 /* ESSymbol */)) {
|
||||
return nameType;
|
||||
}
|
||||
else {
|
||||
return stringType;
|
||||
}
|
||||
default:
|
||||
ts.Debug.fail("Unsupported property name.");
|
||||
return unknownType;
|
||||
}
|
||||
default:
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
if (node.kind === 214 /* ClassDeclaration */) {
|
||||
ts.Debug.fail("Class decorators should not have a second synthetic argument.");
|
||||
return unknownType;
|
||||
}
|
||||
if (node.kind === 138 /* Parameter */) {
|
||||
node = node.parent;
|
||||
if (node.kind === 144 /* Constructor */) {
|
||||
// For a constructor parameter decorator, the `propertyKey` will be `undefined`.
|
||||
return anyType;
|
||||
}
|
||||
}
|
||||
if (node.kind === 141 /* PropertyDeclaration */ ||
|
||||
node.kind === 143 /* MethodDeclaration */ ||
|
||||
node.kind === 145 /* GetAccessor */ ||
|
||||
node.kind === 146 /* SetAccessor */) {
|
||||
// The `propertyKey` for a property or method decorator will be a
|
||||
// string literal type if the member name is an identifier, number, or string;
|
||||
// otherwise, if the member name is a computed property name it will
|
||||
// be either string or symbol.
|
||||
var element = node;
|
||||
switch (element.name.kind) {
|
||||
case 69 /* Identifier */:
|
||||
case 8 /* NumericLiteral */:
|
||||
case 9 /* StringLiteral */:
|
||||
return getStringLiteralType(element.name);
|
||||
case 136 /* ComputedPropertyName */:
|
||||
var nameType = checkComputedPropertyName(element.name);
|
||||
if (allConstituentTypesHaveKind(nameType, 16777216 /* ESSymbol */)) {
|
||||
return nameType;
|
||||
}
|
||||
else {
|
||||
return stringType;
|
||||
}
|
||||
default:
|
||||
ts.Debug.fail("Unsupported property name.");
|
||||
return unknownType;
|
||||
}
|
||||
}
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
}
|
||||
/**
|
||||
* Returns the effective argument type for the third argument to a decorator.
|
||||
@@ -21222,27 +21221,28 @@ var ts;
|
||||
function getEffectiveDecoratorThirdArgumentType(node) {
|
||||
// The third argument to a decorator is either its `descriptor` for a method decorator
|
||||
// or its `parameterIndex` for a paramter decorator
|
||||
switch (node.kind) {
|
||||
case 214 /* ClassDeclaration */:
|
||||
ts.Debug.fail("Class decorators should not have a third synthetic argument.");
|
||||
return unknownType;
|
||||
case 138 /* Parameter */:
|
||||
// The `parameterIndex` for a parameter decorator is always a number
|
||||
return numberType;
|
||||
case 141 /* PropertyDeclaration */:
|
||||
ts.Debug.fail("Property decorators should not have a third synthetic argument.");
|
||||
return unknownType;
|
||||
case 143 /* MethodDeclaration */:
|
||||
case 145 /* GetAccessor */:
|
||||
case 146 /* SetAccessor */:
|
||||
// The `descriptor` for a method decorator will be a `TypedPropertyDescriptor<T>`
|
||||
// for the type of the member.
|
||||
var propertyType = getTypeOfNode(node);
|
||||
return createTypedPropertyDescriptorType(propertyType);
|
||||
default:
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
if (node.kind === 214 /* ClassDeclaration */) {
|
||||
ts.Debug.fail("Class decorators should not have a third synthetic argument.");
|
||||
return unknownType;
|
||||
}
|
||||
if (node.kind === 138 /* Parameter */) {
|
||||
// The `parameterIndex` for a parameter decorator is always a number
|
||||
return numberType;
|
||||
}
|
||||
if (node.kind === 141 /* PropertyDeclaration */) {
|
||||
ts.Debug.fail("Property decorators should not have a third synthetic argument.");
|
||||
return unknownType;
|
||||
}
|
||||
if (node.kind === 143 /* MethodDeclaration */ ||
|
||||
node.kind === 145 /* GetAccessor */ ||
|
||||
node.kind === 146 /* SetAccessor */) {
|
||||
// The `descriptor` for a method decorator will be a `TypedPropertyDescriptor<T>`
|
||||
// for the type of the member.
|
||||
var propertyType = getTypeOfNode(node);
|
||||
return createTypedPropertyDescriptorType(propertyType);
|
||||
}
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
}
|
||||
/**
|
||||
* Returns the effective argument type for the provided argument to a decorator.
|
||||
@@ -23265,7 +23265,12 @@ var ts;
|
||||
}
|
||||
function getEffectiveDeclarationFlags(n, flagsToCheck) {
|
||||
var flags = ts.getCombinedNodeFlags(n);
|
||||
if (n.parent.kind !== 215 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) {
|
||||
// children of classes (even ambient classes) should not be marked as ambient or export
|
||||
// because those flags have no useful semantics there.
|
||||
if (n.parent.kind !== 215 /* InterfaceDeclaration */ &&
|
||||
n.parent.kind !== 214 /* ClassDeclaration */ &&
|
||||
n.parent.kind !== 186 /* ClassExpression */ &&
|
||||
ts.isInAmbientContext(n)) {
|
||||
if (!(flags & 2 /* Ambient */)) {
|
||||
// It is nested in an ambient context, which means it is automatically exported
|
||||
flags |= 1 /* Export */;
|
||||
@@ -24859,10 +24864,6 @@ var ts;
|
||||
grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name);
|
||||
}
|
||||
checkClassLikeDeclaration(node);
|
||||
// Interfaces cannot be merged with non-ambient classes.
|
||||
if (getSymbolOfNode(node).flags & 64 /* Interface */ && !ts.isInAmbientContext(node)) {
|
||||
error(node, ts.Diagnostics.Only_an_ambient_class_can_be_merged_with_an_interface);
|
||||
}
|
||||
ts.forEach(node.members, checkSourceElement);
|
||||
}
|
||||
function checkClassLikeDeclaration(node) {
|
||||
@@ -25119,16 +25120,6 @@ var ts;
|
||||
checkIndexConstraints(type);
|
||||
}
|
||||
}
|
||||
// Interfaces cannot merge with non-ambient classes.
|
||||
if (symbol && symbol.declarations) {
|
||||
for (var _b = 0, _c = symbol.declarations; _b < _c.length; _b++) {
|
||||
var declaration = _c[_b];
|
||||
if (declaration.kind === 214 /* ClassDeclaration */ && !ts.isInAmbientContext(declaration)) {
|
||||
error(node, ts.Diagnostics.Only_an_ambient_class_can_be_merged_with_an_interface);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ts.forEach(ts.getInterfaceBaseTypeNodes(node), function (heritageElement) {
|
||||
if (!ts.isSupportedExpressionWithTypeArguments(heritageElement)) {
|
||||
@@ -35962,7 +35953,7 @@ var ts;
|
||||
/* @internal */ ts.ioWriteTime = 0;
|
||||
/** The version of the TypeScript compiler release */
|
||||
var emptyArray = [];
|
||||
ts.version = "1.7.0";
|
||||
ts.version = "1.7.2";
|
||||
function findConfigFile(searchPath) {
|
||||
var fileName = "tsconfig.json";
|
||||
while (true) {
|
||||
@@ -36948,7 +36939,8 @@ var ts;
|
||||
"amd": 2 /* AMD */,
|
||||
"system": 4 /* System */,
|
||||
"umd": 3 /* UMD */,
|
||||
"es6": 5 /* ES6 */
|
||||
"es6": 5 /* ES6 */,
|
||||
"es2015": 5 /* ES2015 */
|
||||
},
|
||||
description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es6,
|
||||
paramType: ts.Diagnostics.KIND,
|
||||
@@ -37077,7 +37069,12 @@ var ts;
|
||||
{
|
||||
name: "target",
|
||||
shortName: "t",
|
||||
type: { "es3": 0 /* ES3 */, "es5": 1 /* ES5 */, "es6": 2 /* ES6 */ },
|
||||
type: {
|
||||
"es3": 0 /* ES3 */,
|
||||
"es5": 1 /* ES5 */,
|
||||
"es6": 2 /* ES6 */,
|
||||
"es2015": 2 /* ES2015 */
|
||||
},
|
||||
description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental,
|
||||
paramType: ts.Diagnostics.VERSION,
|
||||
error: ts.Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES6
|
||||
|
||||
2
lib/typescriptServices.d.ts
vendored
2
lib/typescriptServices.d.ts
vendored
@@ -1359,6 +1359,7 @@ declare namespace ts {
|
||||
UMD = 3,
|
||||
System = 4,
|
||||
ES6 = 5,
|
||||
ES2015 = 5,
|
||||
}
|
||||
const enum JsxEmit {
|
||||
None = 0,
|
||||
@@ -1377,6 +1378,7 @@ declare namespace ts {
|
||||
ES3 = 0,
|
||||
ES5 = 1,
|
||||
ES6 = 2,
|
||||
ES2015 = 2,
|
||||
Latest = 2,
|
||||
}
|
||||
const enum LanguageVariant {
|
||||
|
||||
@@ -660,6 +660,7 @@ var ts;
|
||||
ModuleKind[ModuleKind["UMD"] = 3] = "UMD";
|
||||
ModuleKind[ModuleKind["System"] = 4] = "System";
|
||||
ModuleKind[ModuleKind["ES6"] = 5] = "ES6";
|
||||
ModuleKind[ModuleKind["ES2015"] = 5] = "ES2015";
|
||||
})(ts.ModuleKind || (ts.ModuleKind = {}));
|
||||
var ModuleKind = ts.ModuleKind;
|
||||
(function (JsxEmit) {
|
||||
@@ -677,6 +678,7 @@ var ts;
|
||||
ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3";
|
||||
ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5";
|
||||
ScriptTarget[ScriptTarget["ES6"] = 2] = "ES6";
|
||||
ScriptTarget[ScriptTarget["ES2015"] = 2] = "ES2015";
|
||||
ScriptTarget[ScriptTarget["Latest"] = 2] = "Latest";
|
||||
})(ts.ScriptTarget || (ts.ScriptTarget = {}));
|
||||
var ScriptTarget = ts.ScriptTarget;
|
||||
@@ -1517,12 +1519,13 @@ var ts;
|
||||
if (!fileName) {
|
||||
return false;
|
||||
}
|
||||
var dotIndex = fileName.lastIndexOf(".");
|
||||
if (dotIndex < 0) {
|
||||
return false;
|
||||
for (var _i = 0; _i < ts.supportedExtensions.length; _i++) {
|
||||
var extension = ts.supportedExtensions[_i];
|
||||
if (fileExtensionIs(fileName, extension)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
var extension = fileName.slice(dotIndex, fileName.length);
|
||||
return ts.supportedExtensions.indexOf(extension) >= 0;
|
||||
return false;
|
||||
}
|
||||
ts.isSupportedSourceFileName = isSupportedSourceFileName;
|
||||
var extensionsToRemove = [".d.ts", ".ts", ".js", ".tsx", ".jsx"];
|
||||
@@ -1611,7 +1614,7 @@ var ts;
|
||||
function copyListRemovingItem(item, list) {
|
||||
var copiedList = [];
|
||||
for (var i = 0, len = list.length; i < len; i++) {
|
||||
if (list[i] != item) {
|
||||
if (list[i] !== item) {
|
||||
copiedList.push(list[i]);
|
||||
}
|
||||
}
|
||||
@@ -2423,7 +2426,6 @@ var ts;
|
||||
Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: { code: 2515, category: ts.DiagnosticCategory.Error, key: "Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'." },
|
||||
All_declarations_of_an_abstract_method_must_be_consecutive: { code: 2516, category: ts.DiagnosticCategory.Error, key: "All declarations of an abstract method must be consecutive." },
|
||||
Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: { code: 2517, category: ts.DiagnosticCategory.Error, key: "Cannot assign an abstract constructor type to a non-abstract constructor type." },
|
||||
Only_an_ambient_class_can_be_merged_with_an_interface: { code: 2518, category: ts.DiagnosticCategory.Error, key: "Only an ambient class can be merged with an interface." },
|
||||
Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: { code: 2520, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions." },
|
||||
Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: { code: 2521, category: ts.DiagnosticCategory.Error, key: "Expression resolves to variable declaration '{0}' that compiler uses to support async functions." },
|
||||
The_arguments_object_cannot_be_referenced_in_an_async_arrow_function_Consider_using_a_standard_async_function_expression: { code: 2522, category: ts.DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an async arrow function. Consider using a standard async function expression." },
|
||||
@@ -16635,7 +16637,9 @@ var ts;
|
||||
function getSignatureFromDeclaration(declaration) {
|
||||
var links = getNodeLinks(declaration);
|
||||
if (!links.resolvedSignature) {
|
||||
var classType = declaration.kind === 144 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(declaration.parent.symbol) : undefined;
|
||||
var classType = declaration.kind === 144 /* Constructor */ ?
|
||||
getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol))
|
||||
: undefined;
|
||||
var typeParameters = classType ? classType.localTypeParameters :
|
||||
declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined;
|
||||
var parameters = [];
|
||||
@@ -21121,35 +21125,33 @@ var ts;
|
||||
*/
|
||||
function getEffectiveDecoratorFirstArgumentType(node) {
|
||||
// The first argument to a decorator is its `target`.
|
||||
switch (node.kind) {
|
||||
case 214 /* ClassDeclaration */:
|
||||
case 186 /* ClassExpression */:
|
||||
// For a class decorator, the `target` is the type of the class (e.g. the
|
||||
// "static" or "constructor" side of the class)
|
||||
if (node.kind === 214 /* ClassDeclaration */) {
|
||||
// For a class decorator, the `target` is the type of the class (e.g. the
|
||||
// "static" or "constructor" side of the class)
|
||||
var classSymbol = getSymbolOfNode(node);
|
||||
return getTypeOfSymbol(classSymbol);
|
||||
}
|
||||
if (node.kind === 138 /* Parameter */) {
|
||||
// For a parameter decorator, the `target` is the parent type of the
|
||||
// parameter's containing method.
|
||||
node = node.parent;
|
||||
if (node.kind === 144 /* Constructor */) {
|
||||
var classSymbol = getSymbolOfNode(node);
|
||||
return getTypeOfSymbol(classSymbol);
|
||||
case 138 /* Parameter */:
|
||||
// For a parameter decorator, the `target` is the parent type of the
|
||||
// parameter's containing method.
|
||||
node = node.parent;
|
||||
if (node.kind === 144 /* Constructor */) {
|
||||
var classSymbol_1 = getSymbolOfNode(node);
|
||||
return getTypeOfSymbol(classSymbol_1);
|
||||
}
|
||||
// fall-through
|
||||
case 141 /* PropertyDeclaration */:
|
||||
case 143 /* MethodDeclaration */:
|
||||
case 145 /* GetAccessor */:
|
||||
case 146 /* SetAccessor */:
|
||||
// For a property or method decorator, the `target` is the
|
||||
// "static"-side type of the parent of the member if the member is
|
||||
// declared "static"; otherwise, it is the "instance"-side type of the
|
||||
// parent of the member.
|
||||
return getParentTypeOfClassElement(node);
|
||||
default:
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
}
|
||||
}
|
||||
if (node.kind === 141 /* PropertyDeclaration */ ||
|
||||
node.kind === 143 /* MethodDeclaration */ ||
|
||||
node.kind === 145 /* GetAccessor */ ||
|
||||
node.kind === 146 /* SetAccessor */) {
|
||||
// For a property or method decorator, the `target` is the
|
||||
// "static"-side type of the parent of the member if the member is
|
||||
// declared "static"; otherwise, it is the "instance"-side type of the
|
||||
// parent of the member.
|
||||
return getParentTypeOfClassElement(node);
|
||||
}
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
}
|
||||
/**
|
||||
* Returns the effective type for the second argument to a decorator.
|
||||
@@ -21168,49 +21170,46 @@ var ts;
|
||||
*/
|
||||
function getEffectiveDecoratorSecondArgumentType(node) {
|
||||
// The second argument to a decorator is its `propertyKey`
|
||||
switch (node.kind) {
|
||||
case 214 /* ClassDeclaration */:
|
||||
ts.Debug.fail("Class decorators should not have a second synthetic argument.");
|
||||
return unknownType;
|
||||
case 138 /* Parameter */:
|
||||
node = node.parent;
|
||||
if (node.kind === 144 /* Constructor */) {
|
||||
// For a constructor parameter decorator, the `propertyKey` will be `undefined`.
|
||||
return anyType;
|
||||
}
|
||||
// For a non-constructor parameter decorator, the `propertyKey` will be either
|
||||
// a string or a symbol, based on the name of the parameter's containing method.
|
||||
// fall-through
|
||||
case 141 /* PropertyDeclaration */:
|
||||
case 143 /* MethodDeclaration */:
|
||||
case 145 /* GetAccessor */:
|
||||
case 146 /* SetAccessor */:
|
||||
// The `propertyKey` for a property or method decorator will be a
|
||||
// string literal type if the member name is an identifier, number, or string;
|
||||
// otherwise, if the member name is a computed property name it will
|
||||
// be either string or symbol.
|
||||
var element = node;
|
||||
switch (element.name.kind) {
|
||||
case 69 /* Identifier */:
|
||||
case 8 /* NumericLiteral */:
|
||||
case 9 /* StringLiteral */:
|
||||
return getStringLiteralType(element.name);
|
||||
case 136 /* ComputedPropertyName */:
|
||||
var nameType = checkComputedPropertyName(element.name);
|
||||
if (allConstituentTypesHaveKind(nameType, 16777216 /* ESSymbol */)) {
|
||||
return nameType;
|
||||
}
|
||||
else {
|
||||
return stringType;
|
||||
}
|
||||
default:
|
||||
ts.Debug.fail("Unsupported property name.");
|
||||
return unknownType;
|
||||
}
|
||||
default:
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
if (node.kind === 214 /* ClassDeclaration */) {
|
||||
ts.Debug.fail("Class decorators should not have a second synthetic argument.");
|
||||
return unknownType;
|
||||
}
|
||||
if (node.kind === 138 /* Parameter */) {
|
||||
node = node.parent;
|
||||
if (node.kind === 144 /* Constructor */) {
|
||||
// For a constructor parameter decorator, the `propertyKey` will be `undefined`.
|
||||
return anyType;
|
||||
}
|
||||
}
|
||||
if (node.kind === 141 /* PropertyDeclaration */ ||
|
||||
node.kind === 143 /* MethodDeclaration */ ||
|
||||
node.kind === 145 /* GetAccessor */ ||
|
||||
node.kind === 146 /* SetAccessor */) {
|
||||
// The `propertyKey` for a property or method decorator will be a
|
||||
// string literal type if the member name is an identifier, number, or string;
|
||||
// otherwise, if the member name is a computed property name it will
|
||||
// be either string or symbol.
|
||||
var element = node;
|
||||
switch (element.name.kind) {
|
||||
case 69 /* Identifier */:
|
||||
case 8 /* NumericLiteral */:
|
||||
case 9 /* StringLiteral */:
|
||||
return getStringLiteralType(element.name);
|
||||
case 136 /* ComputedPropertyName */:
|
||||
var nameType = checkComputedPropertyName(element.name);
|
||||
if (allConstituentTypesHaveKind(nameType, 16777216 /* ESSymbol */)) {
|
||||
return nameType;
|
||||
}
|
||||
else {
|
||||
return stringType;
|
||||
}
|
||||
default:
|
||||
ts.Debug.fail("Unsupported property name.");
|
||||
return unknownType;
|
||||
}
|
||||
}
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
}
|
||||
/**
|
||||
* Returns the effective argument type for the third argument to a decorator.
|
||||
@@ -21222,27 +21221,28 @@ var ts;
|
||||
function getEffectiveDecoratorThirdArgumentType(node) {
|
||||
// The third argument to a decorator is either its `descriptor` for a method decorator
|
||||
// or its `parameterIndex` for a paramter decorator
|
||||
switch (node.kind) {
|
||||
case 214 /* ClassDeclaration */:
|
||||
ts.Debug.fail("Class decorators should not have a third synthetic argument.");
|
||||
return unknownType;
|
||||
case 138 /* Parameter */:
|
||||
// The `parameterIndex` for a parameter decorator is always a number
|
||||
return numberType;
|
||||
case 141 /* PropertyDeclaration */:
|
||||
ts.Debug.fail("Property decorators should not have a third synthetic argument.");
|
||||
return unknownType;
|
||||
case 143 /* MethodDeclaration */:
|
||||
case 145 /* GetAccessor */:
|
||||
case 146 /* SetAccessor */:
|
||||
// The `descriptor` for a method decorator will be a `TypedPropertyDescriptor<T>`
|
||||
// for the type of the member.
|
||||
var propertyType = getTypeOfNode(node);
|
||||
return createTypedPropertyDescriptorType(propertyType);
|
||||
default:
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
if (node.kind === 214 /* ClassDeclaration */) {
|
||||
ts.Debug.fail("Class decorators should not have a third synthetic argument.");
|
||||
return unknownType;
|
||||
}
|
||||
if (node.kind === 138 /* Parameter */) {
|
||||
// The `parameterIndex` for a parameter decorator is always a number
|
||||
return numberType;
|
||||
}
|
||||
if (node.kind === 141 /* PropertyDeclaration */) {
|
||||
ts.Debug.fail("Property decorators should not have a third synthetic argument.");
|
||||
return unknownType;
|
||||
}
|
||||
if (node.kind === 143 /* MethodDeclaration */ ||
|
||||
node.kind === 145 /* GetAccessor */ ||
|
||||
node.kind === 146 /* SetAccessor */) {
|
||||
// The `descriptor` for a method decorator will be a `TypedPropertyDescriptor<T>`
|
||||
// for the type of the member.
|
||||
var propertyType = getTypeOfNode(node);
|
||||
return createTypedPropertyDescriptorType(propertyType);
|
||||
}
|
||||
ts.Debug.fail("Unsupported decorator target.");
|
||||
return unknownType;
|
||||
}
|
||||
/**
|
||||
* Returns the effective argument type for the provided argument to a decorator.
|
||||
@@ -23265,7 +23265,12 @@ var ts;
|
||||
}
|
||||
function getEffectiveDeclarationFlags(n, flagsToCheck) {
|
||||
var flags = ts.getCombinedNodeFlags(n);
|
||||
if (n.parent.kind !== 215 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) {
|
||||
// children of classes (even ambient classes) should not be marked as ambient or export
|
||||
// because those flags have no useful semantics there.
|
||||
if (n.parent.kind !== 215 /* InterfaceDeclaration */ &&
|
||||
n.parent.kind !== 214 /* ClassDeclaration */ &&
|
||||
n.parent.kind !== 186 /* ClassExpression */ &&
|
||||
ts.isInAmbientContext(n)) {
|
||||
if (!(flags & 2 /* Ambient */)) {
|
||||
// It is nested in an ambient context, which means it is automatically exported
|
||||
flags |= 1 /* Export */;
|
||||
@@ -24859,10 +24864,6 @@ var ts;
|
||||
grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name);
|
||||
}
|
||||
checkClassLikeDeclaration(node);
|
||||
// Interfaces cannot be merged with non-ambient classes.
|
||||
if (getSymbolOfNode(node).flags & 64 /* Interface */ && !ts.isInAmbientContext(node)) {
|
||||
error(node, ts.Diagnostics.Only_an_ambient_class_can_be_merged_with_an_interface);
|
||||
}
|
||||
ts.forEach(node.members, checkSourceElement);
|
||||
}
|
||||
function checkClassLikeDeclaration(node) {
|
||||
@@ -25119,16 +25120,6 @@ var ts;
|
||||
checkIndexConstraints(type);
|
||||
}
|
||||
}
|
||||
// Interfaces cannot merge with non-ambient classes.
|
||||
if (symbol && symbol.declarations) {
|
||||
for (var _b = 0, _c = symbol.declarations; _b < _c.length; _b++) {
|
||||
var declaration = _c[_b];
|
||||
if (declaration.kind === 214 /* ClassDeclaration */ && !ts.isInAmbientContext(declaration)) {
|
||||
error(node, ts.Diagnostics.Only_an_ambient_class_can_be_merged_with_an_interface);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ts.forEach(ts.getInterfaceBaseTypeNodes(node), function (heritageElement) {
|
||||
if (!ts.isSupportedExpressionWithTypeArguments(heritageElement)) {
|
||||
@@ -35962,7 +35953,7 @@ var ts;
|
||||
/* @internal */ ts.ioWriteTime = 0;
|
||||
/** The version of the TypeScript compiler release */
|
||||
var emptyArray = [];
|
||||
ts.version = "1.7.0";
|
||||
ts.version = "1.7.2";
|
||||
function findConfigFile(searchPath) {
|
||||
var fileName = "tsconfig.json";
|
||||
while (true) {
|
||||
@@ -36948,7 +36939,8 @@ var ts;
|
||||
"amd": 2 /* AMD */,
|
||||
"system": 4 /* System */,
|
||||
"umd": 3 /* UMD */,
|
||||
"es6": 5 /* ES6 */
|
||||
"es6": 5 /* ES6 */,
|
||||
"es2015": 5 /* ES2015 */
|
||||
},
|
||||
description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es6,
|
||||
paramType: ts.Diagnostics.KIND,
|
||||
@@ -37077,7 +37069,12 @@ var ts;
|
||||
{
|
||||
name: "target",
|
||||
shortName: "t",
|
||||
type: { "es3": 0 /* ES3 */, "es5": 1 /* ES5 */, "es6": 2 /* ES6 */ },
|
||||
type: {
|
||||
"es3": 0 /* ES3 */,
|
||||
"es5": 1 /* ES5 */,
|
||||
"es6": 2 /* ES6 */,
|
||||
"es2015": 2 /* ES2015 */
|
||||
},
|
||||
description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental,
|
||||
paramType: ts.Diagnostics.VERSION,
|
||||
error: ts.Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES6
|
||||
|
||||
Reference in New Issue
Block a user