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 authored and GitHub committed 2026-10-15 15:59:06 +09:00
1 parent 3e88e21705
commit ce89706145
7 files changed
+323 -8

No files matched your search

@@ -65,9 +65,8 @@ export const objectProperty = (
if (!t.isObjectExpression(object)) return { status: "dynamic" };
for (const property of object.properties.toReversed()) {
if (t.isSpreadElement(property)) return { status: "dynamic" };
const key = semanticStaticPropertyName(property.key, property.computed);
if (key === "" && !t.isStringLiteral(property.key))
return { status: "dynamic" };
const key = semanticStaticPropertyKey(property.key, property.computed);
if (key === null) return { status: "dynamic" };
if (key !== name) continue;
return t.isObjectProperty(property)
? { status: "explicit", property }