fix(javascript): preserve capture and property-key effect ownership

This commit is contained in:
morluto committed 2026-10-24 04:16:47 +08:00
1 parent b3433d0187
commit c6ac60acfe
7 files changed
+129 -7

No files matched your search

@@ -4,6 +4,7 @@ import {
semanticOpaqueBindingReadMayHaveChanged,
} from "./javascriptSemanticOpaqueEffects.js";
import * as t from "@babel/types";
import { semanticKnownSymbolKey } from "./javascriptSemanticPropertyKeys.js";
import { logicalRightOperand } from "./javascriptSymbolicControlFlow.js";
import {
@@ -864,6 +865,16 @@ const evaluateObject = (
}
continue;
}
if (
property.computed &&
semanticKnownSymbolKey(property.key, context.state)
) {
// The string-slot lattice omits symbol names, but they cannot overwrite
// established string fields. Keep the omitted inventory explicit.
unknownProperties = true;
if (omittedProperties !== null) omittedProperties += 1;
continue;
}
const name = semanticStaticPropertyKey(property.key, property.computed);
if (name === null) {
unknownProperties = true;