mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 15:45:27 -05:00
isDeclarationName: support ComputedPropertyName (#22123)
* isDeclarationName: support ComputedPropertyName * update additional baseline
This commit is contained in:
@@ -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)
|
||||
);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user