fix(semantics): preserve empty string property keys (#764)

Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
This commit is contained in:
Rudy Mizrahi Celekli
2026-10-07 10:23:43 +08:00
committed by GitHub
parent dd3640548f
commit 630bdafcac
11 changed files with 149 additions and 33 deletions
+3 -6
View File
@@ -12,7 +12,7 @@ import {
collectSemanticReferences,
immutableSemanticBindings,
immutableSemanticScopes,
semanticStaticPropertyName,
semanticStaticPropertyKey,
} from "./javascriptSemanticProjection.js";
import type {
JavaScriptSemanticAnalysisState,
@@ -481,14 +481,11 @@ const bindPattern = (input: BindPatternInput): void => {
projection: [],
});
else {
const name = semanticStaticPropertyName(
property.key,
property.computed,
);
const name = semanticStaticPropertyKey(property.key, property.computed);
bindPattern({
...input,
pattern: property.value,
projection: [...projection, name === "" ? null : name],
projection: [...projection, name],
});
}
}