mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 21:06:50 -05:00
Handle non literal computed name when trying to get the name for object literal property name in json object (#37988)
Fixes #37984
This commit is contained in:
@@ -1721,7 +1721,7 @@ namespace ts {
|
||||
errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element.name, Diagnostics.String_literal_with_double_quotes_expected));
|
||||
}
|
||||
|
||||
const textOfKey = getTextOfPropertyName(element.name);
|
||||
const textOfKey = isComputedNonLiteralName(element.name) ? undefined : getTextOfPropertyName(element.name);
|
||||
const keyText = textOfKey && unescapeLeadingUnderscores(textOfKey);
|
||||
const option = keyText && knownOptions ? knownOptions.get(keyText) : undefined;
|
||||
if (keyText && extraKeyDiagnostics && !option) {
|
||||
|
||||
Reference in New Issue
Block a user