fix(javascript): preserve exact static property keys (#3480)

* fix(javascript): preserve Electron options with static empty keys

* fix(javascript): retain exact computed member keys
This commit is contained in:
ShuaixinHuang
2026-10-15 14:59:06 +08:00
committed by GitHub
parent 3e88e21705
commit ce89706145
7 changed files with 323 additions and 8 deletions
@@ -693,11 +693,8 @@ export const calleeName = (node: t.Node): string => {
const memberPropertyName = (
node: t.MemberExpression | t.OptionalMemberExpression,
): string =>
node.computed &&
!t.isStringLiteral(node.property) &&
!t.isNumericLiteral(node.property)
? `[computed@${String(node.property.start ?? -1)}]`
: semanticStaticPropertyName(node.property, node.computed);
semanticStaticPropertyKey(node.property, node.computed) ??
(node.computed ? `[computed@${String(node.property.start ?? -1)}]` : "");
/**
* Return a string literal value without evaluating an expression. A template