mirror of
https://github.com/morluto/rea.git
synced 2026-11-10 08:47:00 +00:00
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:
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 }
|
||||
|
||||
Reference in new issue
Block a user