isDeclarationName: support ComputedPropertyName (#22123)

* isDeclarationName: support ComputedPropertyName

* update additional baseline
This commit is contained in:
Andy
2018-02-22 15:53:49 -08:00
committed by GitHub
parent 75fa945f00
commit a299d2dd1c
887 changed files with 2503 additions and 50 deletions

View File

@@ -23094,7 +23094,7 @@ namespace ts {
const rootChain = () => chainDiagnosticMessages(
/*details*/ undefined,
Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2,
unescapeLeadingUnderscores(declaredProp.escapedName),
symbolToString(declaredProp),
typeToString(typeWithThis),
typeToString(baseWithThis)
);

View File

@@ -1860,16 +1860,9 @@ namespace ts {
return false;
}
// True if the given identifier, string literal, or number literal is the name of a declaration node
// True if `name` is the name of a declaration node
export function isDeclarationName(name: Node): boolean {
switch (name.kind) {
case SyntaxKind.Identifier:
case SyntaxKind.StringLiteral:
case SyntaxKind.NumericLiteral:
return isDeclaration(name.parent) && name.parent.name === name;
default:
return false;
}
return !isSourceFile(name) && !isBindingPattern(name) && isDeclaration(name.parent) && name.parent.name === name;
}
// See GH#16030

View File

@@ -1532,7 +1532,7 @@ namespace Harness {
}
if (typesError && symbolsError) {
throw new Error(typesError.message + Harness.IO.newLine() + symbolsError.message);
throw new Error(typesError.stack + Harness.IO.newLine() + symbolsError.stack);
}
if (typesError) {