mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 10:41:56 -05:00
Merge pull request #38607 from a-tarasyuk/bug/38295
fix(38295): Duplicated object key in const not detected when the key is a number preceded by `-` or `+`
This commit is contained in:
@@ -3092,6 +3092,12 @@ namespace ts {
|
||||
else if (isStringOrNumericLiteralLike(nameExpression)) {
|
||||
return escapeLeadingUnderscores(nameExpression.text);
|
||||
}
|
||||
else if (isSignedNumericLiteral(nameExpression)) {
|
||||
if (nameExpression.operator === SyntaxKind.MinusToken) {
|
||||
return tokenToString(nameExpression.operator) + nameExpression.operand.text as __String;
|
||||
}
|
||||
return nameExpression.operand.text as __String;
|
||||
}
|
||||
return undefined;
|
||||
default:
|
||||
return Debug.assertNever(name);
|
||||
|
||||
Reference in New Issue
Block a user