refactor(javascript): own property capture translation

This commit is contained in:
morluto
2026-10-22 08:52:56 +08:00
parent adfde012ec
commit 247c8f4eab
5 changed files with 42 additions and 34 deletions
@@ -1,4 +1,5 @@
import {
semanticCapturedSelectionsAfterPropertyRead,
semanticProjectedSourceFactsAtRead,
semanticProjectedSourceEligibilityAtRead,
semanticNormalizeCapturedSelections,
@@ -806,23 +807,10 @@ const loaderObjectPropertySources = (
.map((source) => ({
node: source.node,
path: [...source.path, ...remaining],
capturedSelections: [
...(semanticShiftCapturedSelections(
current.capturedSelections,
source.path.length - 1,
) ?? []),
...(source.capturedSelectionAt === undefined
? []
: [
{
at: source.capturedSelectionAt,
depth: source.path.length,
...(source.ownEnumerable
? { ownEnumerable: true as const }
: {}),
},
]),
],
capturedSelections: semanticCapturedSelectionsAfterPropertyRead(
current.capturedSelections,
source,
),
})),
);
};