@generaltranslation/vue-extractor 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/LICENSE.md +105 -0
  2. package/dist/config.d.ts +2 -0
  3. package/dist/config.js +2 -0
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.js +2 -0
  6. package/dist/internal/compilerAst.d.ts +43 -0
  7. package/dist/internal/compilerAst.js +77 -0
  8. package/dist/internal/compilerAst.js.map +1 -0
  9. package/dist/internal/config/resolveVueCompilerOptions.d.ts +23 -0
  10. package/dist/internal/config/resolveVueCompilerOptions.js +987 -0
  11. package/dist/internal/config/resolveVueCompilerOptions.js.map +1 -0
  12. package/dist/internal/extractFromVueSource.d.ts +9 -0
  13. package/dist/internal/extractFromVueSource.js +332 -0
  14. package/dist/internal/extractFromVueSource.js.map +1 -0
  15. package/dist/internal/script/analyze.d.ts +13 -0
  16. package/dist/internal/script/analyze.js +4761 -0
  17. package/dist/internal/script/analyze.js.map +1 -0
  18. package/dist/internal/script/jsx.d.ts +36 -0
  19. package/dist/internal/script/jsx.js +667 -0
  20. package/dist/internal/script/jsx.js.map +1 -0
  21. package/dist/internal/script/knownValues.d.ts +14 -0
  22. package/dist/internal/script/knownValues.js +148 -0
  23. package/dist/internal/script/knownValues.js.map +1 -0
  24. package/dist/internal/script/localModules.d.ts +80 -0
  25. package/dist/internal/script/localModules.js +364 -0
  26. package/dist/internal/script/localModules.js.map +1 -0
  27. package/dist/internal/script/model.d.ts +317 -0
  28. package/dist/internal/script/model.js +1 -0
  29. package/dist/internal/script/parser.d.ts +3 -0
  30. package/dist/internal/script/parser.js +21 -0
  31. package/dist/internal/script/parser.js.map +1 -0
  32. package/dist/internal/script/replay.d.ts +53 -0
  33. package/dist/internal/script/replay.js +1611 -0
  34. package/dist/internal/script/replay.js.map +1 -0
  35. package/dist/internal/script/snapshot.d.ts +25 -0
  36. package/dist/internal/script/snapshot.js +293 -0
  37. package/dist/internal/script/snapshot.js.map +1 -0
  38. package/dist/internal/script/syntax.d.ts +21 -0
  39. package/dist/internal/script/syntax.js +46 -0
  40. package/dist/internal/script/syntax.js.map +1 -0
  41. package/dist/internal/script.d.ts +2 -0
  42. package/dist/internal/script.js +2 -0
  43. package/dist/internal/stringCalls.d.ts +7 -0
  44. package/dist/internal/stringCalls.js +82 -0
  45. package/dist/internal/stringCalls.js.map +1 -0
  46. package/dist/internal/template.d.ts +4 -0
  47. package/dist/internal/template.js +2198 -0
  48. package/dist/internal/template.js.map +1 -0
  49. package/dist/internal/templatePath.d.ts +12 -0
  50. package/dist/internal/templatePath.js +23 -0
  51. package/dist/internal/templatePath.js.map +1 -0
  52. package/dist/internal/types.d.ts +69 -0
  53. package/dist/internal/types.js +1 -0
  54. package/dist/internal/utils.d.ts +19 -0
  55. package/dist/internal/utils.js +149 -0
  56. package/dist/internal/utils.js.map +1 -0
  57. package/dist/internal/vueCompiler.d.ts +35 -0
  58. package/dist/internal/vueCompiler.js +320 -0
  59. package/dist/internal/vueCompiler.js.map +1 -0
  60. package/dist/types.d.ts +80 -0
  61. package/dist/types.js +1 -0
  62. package/package.json +78 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay.js","names":[],"sources":["../../../src/internal/script/replay.ts"],"sourcesContent":["import type { Binding, NodePath, Scope } from '@babel/traverse';\nimport type * as t from '@babel/types';\nimport {\n appendTemplatePath,\n recursiveTemplatePathSegment,\n unknownTemplatePathSegment,\n} from '../templatePath.js';\nimport type { TemplateContainerKind } from '../types.js';\nimport { unwrapExpression, type StaticPrimitiveResult } from '../utils.js';\nimport type {\n ComponentFactoryCandidate,\n ComponentMemberCandidate,\n ContainerIdentityReplay,\n ContainerWrapperKind,\n ContainerWritePolicy,\n KnownValue,\n ReplayCollectionReference,\n ReplayComputedReference,\n ReplayContainerIdentity,\n ReplayContainerReference,\n ReplayContainerSnapshot,\n ReplayEvaluationContext,\n ReplayGetterReference,\n ReplayLeaf,\n ReplayLeafState,\n ReplayMethodReference,\n ReplayRefReference,\n ReplayUnsafe,\n ReplayValue,\n ScopedExpression,\n ScriptState,\n VueScriptAnalysis,\n} from './model.js';\n\n/** Static-analysis operations consumed by the source-ordered replay SCC. */\nexport type ReplayAnalysisDependencies = {\n ordinaryGlobalValues: ReadonlySet<string>;\n readonlyArrayTransforms: ReadonlySet<string>;\n bindingReadsUnsafeMutableImport: (\n binding: Binding,\n state: ScriptState\n ) => boolean;\n collectFunctionReturnExpressions: (\n fn: t.Function,\n scope: Scope,\n state: ScriptState\n ) => ScopedExpression[];\n collectPatternBindingNames: (pattern: t.Node) => string[];\n composeContainerWritePolicy: (\n wrapper: ContainerWrapperKind,\n inner: ContainerWritePolicy | undefined\n ) => ContainerWritePolicy;\n knownValueKey: (value: KnownValue) => string;\n readDefiniteArrayInteger: (\n node: t.Node | undefined,\n fallback: number,\n scope: Scope,\n state: ScriptState\n ) => number | undefined;\n readResolvedMemberPath: (\n node: t.Node,\n scope: Scope,\n state: ScriptState\n ) => string | undefined;\n readResolvedMemberProperty: (\n node: t.MemberExpression | t.OptionalMemberExpression,\n scope: Scope,\n state: ScriptState\n ) => string | undefined;\n readResolvedPropertyKey: (\n property: { computed: boolean; key: t.Node },\n scope: Scope,\n state: ScriptState\n ) => string | undefined;\n readStaticFromScope: (\n node: t.Node | null | undefined,\n scope: Scope,\n seen: Set<Binding>,\n atPosition: number,\n analysis?: VueScriptAnalysis,\n allowNumericGlobals?: boolean\n ) => StaticPrimitiveResult;\n resolveCalledFunction: (\n node: t.Node | null | undefined,\n scope: Scope,\n state: ScriptState,\n seen: Set<t.Node>\n ) => (ScopedExpression & { node: t.Function }) | undefined;\n resolveComputedGetter: (\n node: t.Node,\n scope: Scope,\n state: ScriptState\n ) => (ScopedExpression & { node: t.Function }) | undefined;\n resolveKnownExpression: (\n node: t.Node | null | undefined,\n scope: Scope,\n state: ScriptState,\n seen: Set<Binding>\n ) => KnownValue | undefined;\n};\n\n/** Narrow replay queries used by the surrounding script analyzer. */\nexport type ReplayAnalysis = {\n evaluateReplayAtPosition: (\n node: t.Node,\n scope: Scope,\n atPosition: number,\n state: ScriptState\n ) => ReplayValue | undefined;\n readDefiniteReplayGTContainerPaths: (\n binding: Binding,\n state: ScriptState\n ) => Set<string> | null | undefined;\n readReplayComponentCandidates: (\n binding: Binding,\n basePath: string,\n state: ScriptState\n ) => ComponentMemberCandidate[] | undefined;\n readReplayComponentFactoryCandidates: (\n binding: Binding,\n basePath: string,\n state: ScriptState\n ) => ComponentFactoryCandidate[] | undefined;\n readReplayContainerMetadata: (\n binding: Binding,\n basePath: string,\n state: ScriptState\n ) =>\n | {\n arrayLengths: Map<string, number>;\n kinds: Map<string, TemplateContainerKind>;\n }\n | undefined;\n readReplayLeafState: (\n binding: Binding,\n state: ScriptState\n ) => ReplayLeafState | undefined;\n readSafeReplayLeafOverride: (\n binding: Binding,\n replayLeaf: ReplayLeafState | undefined,\n state: ScriptState\n ) => Extract<ReplayLeafState, { status: 'leaf' }> | undefined;\n isReplayGetterStringLeaf: (value: ReplayLeaf) => boolean;\n replayBindingRetainsUnsafeIdentity: (\n binding: Binding,\n state: ScriptState\n ) => boolean;\n};\n\n/**\n * Creates the finite source-ordered identity analyzer used by script analysis.\n * Dependencies are injected so the replay evaluator remains one cohesive SCC\n * without creating a runtime import cycle back to the script orchestrator.\n */\nexport function createReplayAnalysis({\n ordinaryGlobalValues: ORDINARY_GLOBAL_VALUES,\n readonlyArrayTransforms: READONLY_ARRAY_TRANSFORMS,\n bindingReadsUnsafeMutableImport,\n collectFunctionReturnExpressions,\n collectPatternBindingNames,\n composeContainerWritePolicy,\n knownValueKey,\n readDefiniteArrayInteger,\n readResolvedMemberPath,\n readResolvedMemberProperty,\n readResolvedPropertyKey,\n readStaticFromScope,\n resolveCalledFunction,\n resolveComputedGetter,\n resolveKnownExpression,\n}: ReplayAnalysisDependencies): ReplayAnalysis {\n const replayUnsafe: ReplayUnsafe = { type: 'unsafe' };\n\n /** Creates one fresh runtime container identity for source-ordered replay. */\n function createReplayContainer(\n snapshot: ReplayContainerSnapshot\n ): ReplayContainerReference {\n return {\n type: 'container',\n identity: { escaped: false, snapshot },\n writePolicy: 'forward',\n };\n }\n\n /** Returns a reference with the write behavior Vue applies to one wrapper. */\n function wrapReplayContainer(\n value: ReplayContainerReference,\n wrapper: ContainerWrapperKind\n ): ReplayContainerReference {\n return {\n type: 'container',\n identity: value.identity,\n writePolicy: composeContainerWritePolicy(wrapper, value.writePolicy),\n };\n }\n\n /** Applies a Vue proxy wrapper to a container, ref, or computed reference. */\n function wrapReplayReference(\n value:\n | ReplayCollectionReference\n | ReplayComputedReference\n | ReplayContainerReference\n | ReplayRefReference,\n wrapper: ContainerWrapperKind\n ):\n | ReplayCollectionReference\n | ReplayComputedReference\n | ReplayContainerReference\n | ReplayRefReference {\n if (value.type === 'container') return wrapReplayContainer(value, wrapper);\n return {\n ...value,\n writePolicy: composeContainerWritePolicy(wrapper, value.writePolicy),\n };\n }\n\n /** Marks an escaped identity and every nested identity reachable through it. */\n function markReplayContainerEscaped(\n value: ReplayContainerReference,\n seen: Set<object> = new Set()\n ): void {\n if (seen.has(value.identity)) return;\n seen.add(value.identity);\n value.identity.escaped = true;\n const entries =\n value.identity.snapshot.kind === 'array'\n ? value.identity.snapshot.entries\n : value.identity.snapshot.entries.values();\n for (const entry of entries) {\n if (entry?.type === 'container') markReplayContainerEscaped(entry, seen);\n if (entry?.type === 'ref') markReplayRefEscaped(entry, seen);\n if (entry?.type === 'collection') {\n markReplayCollectionEscaped(entry, seen);\n }\n }\n if (value.identity.snapshot.kind === 'object') {\n const prototype = value.identity.snapshot.prototype;\n if (prototype) markReplayContainerEscaped(prototype, seen);\n }\n }\n\n /** Marks a ref and every container reachable through its current value unsafe. */\n function markReplayRefEscaped(\n value: ReplayRefReference,\n seen: Set<object> = new Set()\n ): void {\n if (seen.has(value.identity)) return;\n seen.add(value.identity);\n value.identity.escaped = true;\n const current = value.identity.value;\n if (current?.type === 'container')\n markReplayContainerEscaped(current, seen);\n if (current?.type === 'ref') markReplayRefEscaped(current, seen);\n if (current?.type === 'collection') {\n markReplayCollectionEscaped(current, seen);\n }\n }\n\n /** Marks a Map or Set abstraction unsafe after an unmodelled escape. */\n function markReplayCollectionEscaped(\n value: ReplayCollectionReference,\n seen: Set<object> = new Set()\n ): void {\n if (seen.has(value.identity)) return;\n seen.add(value.identity);\n value.identity.escaped = true;\n for (const entry of value.identity.entries.values()) {\n if (entry.type === 'container') markReplayContainerEscaped(entry, seen);\n if (entry.type === 'ref') markReplayRefEscaped(entry, seen);\n if (entry.type === 'collection') markReplayCollectionEscaped(entry, seen);\n }\n }\n\n /** Marks any mutable replay value unsafe after an unsupported operation. */\n function markReplayValueEscaped(value: ReplayValue | undefined): void {\n if (value?.type === 'container') markReplayContainerEscaped(value);\n if (value?.type === 'ref') markReplayRefEscaped(value);\n if (value?.type === 'collection') markReplayCollectionEscaped(value);\n if (value?.type === 'function') {\n for (const captured of value.substitutions.values()) {\n markReplayValueEscaped(captured);\n }\n for (const captured of value.boundArguments) {\n markReplayValueEscaped(captured);\n }\n }\n }\n\n /** Reads a ref value through the proxy policy currently wrapping the ref. */\n function readReplayRefValue(\n value: ReplayRefReference\n ): ReplayValue | undefined {\n if (value.identity.escaped) return replayUnsafe;\n const current = value.identity.value;\n if (\n current?.type === 'collection' ||\n current?.type === 'container' ||\n current?.type === 'ref' ||\n current?.type === 'computed'\n ) {\n if (value.writePolicy === 'readonly-deep') {\n return wrapReplayReference(current, 'readonly');\n }\n }\n return current?.type === 'leaf'\n ? { ...current, exactSelection: true, selectionKind: 'ref' }\n : current;\n }\n\n /** Applies Vue's deep readonly conversion to a value read through a proxy. */\n function wrapReplayReadValue(\n value: ReplayValue | undefined,\n policy: ContainerWritePolicy\n ): ReplayValue | undefined {\n if (\n value &&\n policy === 'readonly-deep' &&\n (value.type === 'collection' ||\n value.type === 'computed' ||\n value.type === 'container' ||\n value.type === 'ref')\n ) {\n return wrapReplayReference(value, 'readonly');\n }\n return value;\n }\n\n /** Evaluates a supported property getter against the current replay state. */\n function evaluateReplayGetter(\n value: ReplayGetterReference,\n receiver: ReplayContainerReference,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): ReplayValue | undefined {\n if (!context.allowGetterEffects) {\n const body = value.getter.node.body;\n if (\n body.type === 'BlockStatement' &&\n (body.body.length !== 1 || body.body[0]?.type !== 'ReturnStatement')\n ) {\n return undefined;\n }\n const returns = collectFunctionReturnExpressions(\n value.getter.node,\n value.getter.scope,\n state\n );\n return returns.length === 1\n ? evaluateReplayExpression(returns[0]!.node, returns[0]!.scope, state, {\n ...context,\n substitutions: new Map(value.substitutions),\n thisValue: receiver,\n })\n : undefined;\n }\n const result = executeReplayFunction(\n value.getter,\n [],\n state,\n {\n ...context,\n substitutions: new Map(value.substitutions),\n thisValue: receiver,\n },\n receiver\n );\n return result.executed ? result.value : undefined;\n }\n\n /** Reads a child using prototype lookup and Vue proxy conversion rules. */\n function readReplayContainerEntry(\n value: ReplayContainerReference,\n property: string,\n state: ScriptState,\n context: ReplayEvaluationContext,\n seen: Set<ReplayContainerIdentity> = new Set(),\n receiver: ReplayContainerReference = value\n ): ReplayValue | undefined {\n if (value.identity.escaped || seen.has(value.identity)) return replayUnsafe;\n const snapshot = value.identity.snapshot;\n let entry: ReplayValue | undefined;\n if (snapshot.kind === 'array') {\n entry = /^(0|[1-9]\\d*)$/.test(property)\n ? snapshot.entries[Number(property)]\n : undefined;\n } else if (snapshot.entries.has(property)) {\n entry = snapshot.entries.get(property);\n } else if (snapshot.prototype) {\n entry = readReplayContainerEntry(\n snapshot.prototype,\n property,\n state,\n context,\n new Set(seen).add(value.identity),\n receiver\n );\n }\n let fromGetter = false;\n if (entry?.type === 'getter') {\n fromGetter = true;\n entry = evaluateReplayGetter(entry, receiver, state, context);\n }\n if (entry?.type === 'method') {\n entry = { ...entry, receiver };\n }\n if (entry?.type === 'leaf') {\n entry = {\n ...entry,\n exactSelection: true,\n selectionKind: fromGetter ? 'getter' : 'member',\n };\n }\n return wrapReplayReadValue(entry, value.writePolicy);\n }\n\n /** Lists the property names visible through a finite object prototype chain. */\n function readReplayVisibleObjectKeys(\n value: ReplayContainerReference,\n seen: Set<ReplayContainerIdentity> = new Set()\n ): Set<string> | undefined {\n if (\n value.identity.escaped ||\n value.identity.snapshot.kind !== 'object' ||\n seen.has(value.identity)\n ) {\n return undefined;\n }\n const keys = value.identity.snapshot.prototype\n ? readReplayVisibleObjectKeys(\n value.identity.snapshot.prototype,\n new Set(seen).add(value.identity)\n )\n : new Set<string>();\n if (!keys) return undefined;\n for (const key of value.identity.snapshot.entries.keys()) keys.add(key);\n return keys;\n }\n\n /** Lists every value a template can select from one finite container. */\n function readReplayVisibleContainerEntries(\n value: ReplayContainerReference,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): Array<readonly [string, ReplayValue | undefined]> | undefined {\n if (value.identity.escaped) return undefined;\n const snapshot = value.identity.snapshot;\n if (snapshot.kind === 'array') {\n return snapshot.entries.map((entry, index) => [String(index), entry]);\n }\n const keys = readReplayVisibleObjectKeys(value);\n if (!keys) return undefined;\n const entries: Array<readonly [string, ReplayValue]> = [];\n for (const key of keys) {\n const entry = readReplayContainerEntry(value, key, state, context);\n if (!entry) return undefined;\n entries.push([key, entry]);\n }\n return entries;\n }\n\n /** Resolves whether a non-container value is definitely `<T>` at this point. */\n function createReplayLeaf(\n node: t.Node,\n scope: Scope,\n state: ScriptState\n ): ReplayLeaf {\n const expression = unwrapExpression(node) ?? node;\n const known = resolveKnownExpression(expression, scope, state, new Set());\n const knownValue =\n known?.type === 'component' ||\n known?.type === 'string' ||\n known?.type === 'vue-builtin'\n ? known\n : undefined;\n if (known) {\n return {\n type: 'leaf',\n expression: { node: expression, scope },\n hasGT: known.type === 'component' && known.name === 'T',\n knownValue,\n };\n }\n const primitive = readStaticFromScope(\n expression,\n scope,\n new Set(),\n expression.end ?? Number.POSITIVE_INFINITY,\n state.analysis\n );\n const ordinaryGlobal =\n expression.type === 'Identifier' &&\n !scope.getBinding(expression.name) &&\n ORDINARY_GLOBAL_VALUES.has(expression.name);\n return {\n type: 'leaf',\n expression: { node: expression, scope },\n hasGT: primitive.ok || ordinaryGlobal ? false : undefined,\n knownValue,\n };\n }\n\n /** Reads a statically named member chain from a replayed container. */\n function evaluateReplayMember(\n node: t.MemberExpression | t.OptionalMemberExpression,\n scope: Scope,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): ReplayValue | undefined {\n const object = evaluateReplayExpression(node.object, scope, state, context);\n const property = readResolvedMemberProperty(node, scope, state);\n if (property === undefined) return undefined;\n if (object?.type === 'unsafe') return object;\n if (object?.type === 'container') {\n return readReplayContainerEntry(object, property, state, context);\n }\n if (property !== 'value') return undefined;\n if (object?.type === 'ref') return readReplayRefValue(object);\n if (object?.type === 'computed') {\n return evaluateReplayComputed(object, state, context);\n }\n return undefined;\n }\n\n /** Shallow-copies the enumerable own entries of one container reference. */\n function copyReplayContainerEntries(\n value: ReplayContainerReference,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): ReplayContainerSnapshot | undefined {\n if (value.identity.escaped) return undefined;\n const snapshot = value.identity.snapshot;\n if (snapshot.kind === 'array') {\n return {\n kind: 'array',\n entries: snapshot.entries.map((_entry, index) =>\n readReplayContainerEntry(value, String(index), state, context)\n ),\n };\n }\n return {\n kind: 'object',\n entries: new Map(\n [...snapshot.entries.keys()].flatMap((key) => {\n const entry = readReplayContainerEntry(value, key, state, context);\n return entry ? [[key, entry] as const] : [];\n })\n ),\n };\n }\n\n /** Evaluates one finite array literal without losing nested object identity. */\n function evaluateReplayArray(\n node: t.ArrayExpression,\n scope: Scope,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): ReplayContainerReference | ReplayUnsafe | undefined {\n const entries: Array<ReplayValue | undefined> = [];\n for (const element of node.elements) {\n if (!element) {\n entries.push(undefined);\n continue;\n }\n if (element.type === 'SpreadElement') {\n const spread = evaluateReplayExpression(\n element.argument,\n scope,\n state,\n context\n );\n if (spread?.type === 'unsafe') return spread;\n if (spread?.type === 'container' && spread.identity.escaped) {\n return replayUnsafe;\n }\n if (\n spread?.type !== 'container' ||\n spread.identity.snapshot.kind !== 'array'\n ) {\n return undefined;\n }\n const copied = copyReplayContainerEntries(spread, state, context);\n if (!copied || copied.kind !== 'array') return undefined;\n entries.push(...copied.entries);\n continue;\n }\n entries.push(evaluateReplayExpression(element, scope, state, context));\n }\n return createReplayContainer({ kind: 'array', entries });\n }\n\n /** Evaluates one finite object literal with JavaScript shallow-spread semantics. */\n function evaluateReplayObject(\n node: t.ObjectExpression,\n scope: Scope,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): ReplayContainerReference | ReplayUnsafe | undefined {\n const entries = new Map<string, ReplayValue>();\n const setters = new Map<string, ReplayMethodReference>();\n for (const property of node.properties) {\n if (property.type === 'SpreadElement') {\n const spread = evaluateReplayExpression(\n property.argument,\n scope,\n state,\n context\n );\n if (spread?.type === 'unsafe') return spread;\n if (spread?.type === 'container' && spread.identity.escaped) {\n return replayUnsafe;\n }\n if (\n spread?.type !== 'container' ||\n spread.identity.snapshot.kind !== 'object'\n ) {\n return undefined;\n }\n const copied = copyReplayContainerEntries(spread, state, context);\n if (!copied || copied.kind !== 'object') return undefined;\n for (const [key, value] of copied.entries) entries.set(key, value);\n continue;\n }\n if (property.type === 'ObjectMethod' && property.kind === 'get') {\n const key = readResolvedPropertyKey(property, scope, state);\n if (key === undefined) return undefined;\n entries.set(key, {\n type: 'getter',\n getter: {\n node: property,\n scope: state.scopes.get(property) ?? scope,\n },\n substitutions: new Map(context.substitutions),\n });\n continue;\n }\n if (property.type === 'ObjectMethod' && property.kind === 'method') {\n const key = readResolvedPropertyKey(property, scope, state);\n if (key === undefined) return undefined;\n entries.set(key, {\n type: 'method',\n callable: {\n node: property,\n scope: state.scopes.get(property) ?? scope,\n },\n substitutions: new Map(context.substitutions),\n });\n continue;\n }\n if (property.type === 'ObjectMethod' && property.kind === 'set') {\n const key = readResolvedPropertyKey(property, scope, state);\n if (key === undefined) return undefined;\n setters.set(key, {\n type: 'method',\n callable: {\n node: property,\n scope: state.scopes.get(property) ?? scope,\n },\n substitutions: new Map(context.substitutions),\n });\n continue;\n }\n if (property.type !== 'ObjectProperty') return undefined;\n const key = readResolvedPropertyKey(property, scope, state);\n if (key === undefined) return undefined;\n const value = evaluateReplayExpression(\n property.value,\n scope,\n state,\n context\n );\n if (!value) return undefined;\n entries.set(key, value);\n }\n return createReplayContainer({ kind: 'object', entries, setters });\n }\n\n /** Evaluates a computed getter against the current, not captured, bindings. */\n function evaluateReplayComputed(\n value: ReplayComputedReference,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): ReplayValue | undefined {\n const returns = collectFunctionReturnExpressions(\n value.getter.node,\n value.getter.scope,\n state\n );\n if (returns.length !== 1) return undefined;\n const result = evaluateReplayExpression(\n returns[0]!.node,\n returns[0]!.scope,\n state,\n context\n );\n return result &&\n (result.type === 'collection' ||\n result.type === 'container' ||\n result.type === 'ref' ||\n result.type === 'computed')\n ? wrapReplayReference(\n result,\n value.writePolicy === 'readonly-deep'\n ? 'readonly'\n : value.writePolicy === 'readonly-shallow'\n ? 'shallow-readonly'\n : 'unref'\n )\n : result;\n }\n\n /** Evaluates an expression while applying its supported direct side effects. */\n function executeReplayExpression(\n node: t.Expression,\n scope: Scope,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): ReplayValue | undefined {\n const expression = unwrapExpression(node);\n if (\n expression?.type === 'UnaryExpression' &&\n expression.operator === 'delete' &&\n (expression.argument.type === 'MemberExpression' ||\n expression.argument.type === 'OptionalMemberExpression')\n ) {\n return applyReplayMemberDelete(expression.argument, scope, state, context)\n ? createReplayLeaf(expression, scope, state)\n : undefined;\n }\n if (expression?.type !== 'AssignmentExpression') {\n return evaluateReplayExpression(node, scope, state, context);\n }\n if (expression.operator !== '=') return undefined;\n const replacement = evaluateReplayExpression(\n expression.right,\n scope,\n state,\n context\n );\n if (expression.left.type === 'Identifier') {\n const binding = scope.getBinding(expression.left.name);\n if (binding) {\n if (replacement?.type === 'unsafe') context.unsafeBindings.add(binding);\n else context.unsafeBindings.delete(binding);\n context.values.set(binding, replacement);\n }\n return replacement;\n }\n if (\n expression.left.type === 'MemberExpression' ||\n expression.left.type === 'OptionalMemberExpression'\n ) {\n return applyReplayMemberAssignment(\n expression.left,\n expression.right,\n scope,\n state,\n context\n )\n ? replacement\n : undefined;\n }\n return undefined;\n }\n\n /** Executes one finite local function body with captured identities intact. */\n function executeReplayFunction(\n callable: ScopedExpression & { node: t.Function },\n arguments_: ReplayValue[],\n state: ScriptState,\n context: ReplayEvaluationContext,\n thisValue: ReplayValue | undefined = context.thisValue\n ): { executed: boolean; value: ReplayValue | undefined } {\n if (state.activeReplayFunctions.has(callable.node)) {\n return { executed: false, value: undefined };\n }\n const functionScope = state.scopes.get(callable.node) ?? callable.scope;\n const substitutions = new Map(context.substitutions);\n for (const [index, parameter] of callable.node.params.entries()) {\n const name =\n parameter.type === 'Identifier'\n ? parameter.name\n : parameter.type === 'RestElement' &&\n parameter.argument.type === 'Identifier'\n ? parameter.argument.name\n : undefined;\n if (!name) return { executed: false, value: undefined };\n const binding = functionScope.getBinding(name);\n if (!binding) return { executed: false, value: undefined };\n if (parameter.type === 'RestElement') {\n substitutions.set(\n binding,\n createReplayContainer({\n kind: 'array',\n entries: arguments_.slice(index),\n })\n );\n break;\n }\n const argument = arguments_[index];\n if (!argument) return { executed: false, value: undefined };\n substitutions.set(binding, argument);\n }\n const localContext = {\n ...context,\n substitutions,\n thisValue,\n };\n state.activeReplayFunctions.add(callable.node);\n try {\n if (callable.node.body.type !== 'BlockStatement') {\n return {\n executed: true,\n value: executeReplayExpression(\n callable.node.body,\n functionScope,\n state,\n localContext\n ),\n };\n }\n const bodyPath = state.paths.get(callable.node.body);\n const statements = bodyPath?.isBlockStatement()\n ? bodyPath.get('body')\n : undefined;\n if (!statements || !Array.isArray(statements)) {\n return { executed: false, value: undefined };\n }\n for (const statement of statements) {\n if (statement.isReturnStatement()) {\n return {\n executed: true,\n value: statement.node.argument\n ? executeReplayExpression(\n statement.node.argument,\n statement.scope,\n state,\n localContext\n )\n : undefined,\n };\n }\n if (\n !statement.isVariableDeclaration() &&\n !statement.isExpressionStatement()\n ) {\n return { executed: false, value: undefined };\n }\n replayContainerStatement(\n statement as NodePath<t.Node>,\n state,\n localContext\n );\n }\n return { executed: true, value: undefined };\n } finally {\n state.activeReplayFunctions.delete(callable.node);\n }\n }\n\n /** Reads one exact callback return for array transform replay. */\n function evaluateReplayCallback(\n callback: ScopedExpression & { node: t.Function },\n argument: ReplayValue,\n source: ReplayContainerReference,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): ReplayValue | undefined {\n const result = executeReplayFunction(callback, [argument], state, context);\n if (!result.executed) {\n invalidateReplayFunctionCaptures(callback.node, state, context);\n markReplayContainerEscaped(source);\n return undefined;\n }\n return result.value;\n }\n\n /** Detects writes hidden inside an expression-bodied callback. */\n function replayExpressionHasWrites(\n node: t.Node,\n state: ScriptState\n ): boolean {\n const path = state.paths.get(node);\n if (!path) return true;\n let writes = false;\n const mark = (candidate: NodePath<t.Node>): void => {\n writes = true;\n candidate.stop();\n };\n path.traverse({\n AssignmentExpression: mark,\n UpdateExpression: mark,\n UnaryExpression(candidate) {\n if (candidate.node.operator === 'delete') mark(candidate);\n },\n });\n return writes;\n }\n\n /** Applies a finite array copy transform at the exact call position. */\n function evaluateReplayArrayTransform(\n value: ReplayContainerReference,\n method: string,\n call: t.CallExpression | t.OptionalCallExpression,\n scope: Scope,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): ReplayContainerReference | ReplayUnsafe | undefined {\n if (value.identity.escaped) return replayUnsafe;\n if (value.identity.snapshot.kind !== 'array') return undefined;\n if (\n call.arguments.some(\n (argument) =>\n argument.type === 'ArgumentPlaceholder' ||\n argument.type === 'SpreadElement'\n )\n ) {\n return undefined;\n }\n const copied = copyReplayContainerEntries(value, state, context);\n if (!copied || copied.kind !== 'array') return undefined;\n const entries = copied.entries;\n const argumentNode = (index: number): t.Expression | undefined => {\n const argument = call.arguments[index];\n return argument && argument.type !== 'ArgumentPlaceholder'\n ? (argument as t.Expression)\n : undefined;\n };\n if (method === 'slice') {\n const start = readDefiniteArrayInteger(argumentNode(0), 0, scope, state);\n const end = readDefiniteArrayInteger(\n argumentNode(1),\n entries.length,\n scope,\n state\n );\n return start === undefined || end === undefined\n ? undefined\n : createReplayContainer({\n kind: 'array',\n entries: entries.slice(start, end),\n });\n }\n if (method === 'concat') {\n for (const argument of call.arguments) {\n const item = evaluateReplayExpression(\n argument as t.Expression,\n scope,\n state,\n context\n );\n if (!item) return undefined;\n if (\n item.type === 'container' &&\n item.identity.snapshot.kind === 'array'\n ) {\n const flattened = copyReplayContainerEntries(item, state, context);\n if (!flattened || flattened.kind !== 'array') return undefined;\n entries.push(...flattened.entries);\n } else {\n entries.push(item);\n }\n }\n return createReplayContainer({ kind: 'array', entries });\n }\n if (method === 'map') {\n const callbackNode = argumentNode(0);\n const callback = callbackNode\n ? resolveCalledFunction(callbackNode, scope, state, new Set())\n : undefined;\n if (!callback) return undefined;\n const mapped: Array<ReplayValue | undefined> = [];\n for (const entry of entries) {\n if (!entry) {\n mapped.push(undefined);\n continue;\n }\n const result = evaluateReplayCallback(\n callback,\n entry,\n value,\n state,\n context\n );\n if (!result) return undefined;\n mapped.push(result);\n }\n return createReplayContainer({ kind: 'array', entries: mapped });\n }\n if (method === 'toSpliced') {\n const start = readDefiniteArrayInteger(argumentNode(0), 0, scope, state);\n const deleteCount = readDefiniteArrayInteger(\n argumentNode(1),\n call.arguments.length === 0\n ? 0\n : call.arguments.length === 1\n ? entries.length\n : 0,\n scope,\n state\n );\n if (start === undefined || deleteCount === undefined) return undefined;\n const inserted: ReplayValue[] = [];\n for (const argument of call.arguments.slice(2)) {\n const item = evaluateReplayExpression(\n argument as t.Expression,\n scope,\n state,\n context\n );\n if (!item) return undefined;\n inserted.push(item);\n }\n entries.splice(start, Math.max(0, deleteCount), ...inserted);\n return createReplayContainer({ kind: 'array', entries });\n }\n if (method === 'toReversed') {\n return createReplayContainer({\n kind: 'array',\n entries: entries.reverse(),\n });\n }\n if (method === 'toSorted') {\n return entries.length <= 1\n ? createReplayContainer({ kind: 'array', entries })\n : undefined;\n }\n if (method === 'with') {\n const index = readDefiniteArrayInteger(argumentNode(0), 0, scope, state);\n const replacement = argumentNode(1);\n if (index === undefined || !replacement) return undefined;\n const normalized = index < 0 ? entries.length + index : index;\n if (normalized < 0 || normalized >= entries.length) return undefined;\n const item = evaluateReplayExpression(replacement, scope, state, context);\n if (!item) return undefined;\n entries[normalized] = item;\n return createReplayContainer({ kind: 'array', entries });\n }\n return undefined;\n }\n\n /** Mutates one replayed array when the built-in operation is deterministic. */\n function applyReplayArrayMutation(\n value: ReplayContainerReference,\n method: string,\n call: t.CallExpression | t.OptionalCallExpression,\n scope: Scope,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): boolean {\n if (value.identity.snapshot.kind !== 'array') return false;\n if (value.writePolicy !== 'forward') return true;\n if (\n call.arguments.some(\n (argument) =>\n argument.type === 'ArgumentPlaceholder' ||\n argument.type === 'SpreadElement'\n )\n ) {\n markReplayContainerEscaped(value);\n return false;\n }\n const entries = value.identity.snapshot.entries;\n const evaluated = call.arguments.map((argument) =>\n evaluateReplayExpression(argument as t.Expression, scope, state, context)\n );\n if (evaluated.some((entry) => !entry)) {\n markReplayContainerEscaped(value);\n return false;\n }\n const items = evaluated as ReplayValue[];\n if (method === 'pop') entries.pop();\n else if (method === 'shift') entries.shift();\n else if (method === 'push') entries.push(...items);\n else if (method === 'unshift') entries.unshift(...items);\n else if (method === 'splice') {\n const first = call.arguments[0] as t.Expression | undefined;\n const second = call.arguments[1] as t.Expression | undefined;\n const start = readDefiniteArrayInteger(first, 0, scope, state);\n const deleteCount = readDefiniteArrayInteger(\n second,\n call.arguments.length === 0\n ? 0\n : call.arguments.length === 1\n ? entries.length\n : 0,\n scope,\n state\n );\n if (start === undefined || deleteCount === undefined) {\n markReplayContainerEscaped(value);\n return false;\n }\n entries.splice(start, Math.max(0, deleteCount), ...items.slice(2));\n } else {\n return false;\n }\n return true;\n }\n\n /** Evaluates known wrappers, transforms, and mutators in source order. */\n function evaluateReplayCall(\n node: t.CallExpression | t.OptionalCallExpression,\n scope: Scope,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): ReplayValue | undefined {\n const wrapper = resolveKnownExpression(\n node.callee,\n scope,\n state,\n new Set()\n );\n const first = node.arguments[0];\n if (\n wrapper?.type === 'container-wrapper' &&\n first &&\n first.type !== 'ArgumentPlaceholder' &&\n first.type !== 'SpreadElement'\n ) {\n const value = evaluateReplayExpression(first, scope, state, context);\n if (value?.type === 'unsafe') return value;\n if (wrapper.kind === 'unref') {\n if (value?.type === 'ref') return readReplayRefValue(value);\n if (value?.type === 'computed') {\n return evaluateReplayComputed(value, state, context);\n }\n return value;\n }\n return value &&\n (value.type === 'container' ||\n value.type === 'collection' ||\n value.type === 'ref' ||\n value.type === 'computed')\n ? wrapReplayReference(value, wrapper.kind)\n : undefined;\n }\n if (\n wrapper?.type === 'identity' &&\n first &&\n first.type !== 'ArgumentPlaceholder' &&\n first.type !== 'SpreadElement'\n ) {\n return evaluateReplayExpression(first, scope, state, context);\n }\n if (wrapper?.type === 'vue-wrapper' && wrapper.kind === 'ref') {\n const initial =\n first &&\n first.type !== 'ArgumentPlaceholder' &&\n first.type !== 'SpreadElement'\n ? evaluateReplayExpression(first, scope, state, context)\n : createReplayLeaf(node, scope, state);\n return {\n type: 'ref',\n identity: { escaped: false, value: initial },\n writePolicy: 'forward',\n };\n }\n if (wrapper?.type === 'vue-wrapper' && wrapper.kind === 'computed') {\n const getter =\n first &&\n first.type !== 'ArgumentPlaceholder' &&\n first.type !== 'SpreadElement'\n ? resolveComputedGetter(first, scope, state)\n : undefined;\n return getter\n ? { type: 'computed', getter, writePolicy: 'forward' }\n : undefined;\n }\n if (wrapper?.type === 'hook') {\n return createReplayLeaf(node, scope, state);\n }\n\n const calleePath = readResolvedMemberPath(node.callee, scope, state);\n if (calleePath === 'Array.from' && !scope.getBinding('Array')) {\n if (\n node.arguments.length > 1 ||\n !first ||\n first.type === 'ArgumentPlaceholder' ||\n first.type === 'SpreadElement'\n ) {\n return undefined;\n }\n const source = evaluateReplayExpression(first, scope, state, context);\n if (source?.type === 'unsafe') return source;\n if (source?.type === 'collection') {\n if (source.identity.escaped) return replayUnsafe;\n if (source.identity.kind === 'map' && source.iteration === 'entries') {\n return undefined;\n }\n return createReplayContainer({\n kind: 'array',\n entries: [...source.identity.entries.values()],\n });\n }\n if (\n source?.type !== 'container' ||\n source.identity.snapshot.kind !== 'array'\n ) {\n return undefined;\n }\n if (source.identity.escaped) return replayUnsafe;\n const copied = copyReplayContainerEntries(source, state, context);\n return copied?.kind === 'array'\n ? createReplayContainer(copied)\n : undefined;\n }\n if (calleePath === 'Object.assign' && !scope.getBinding('Object')) {\n if (\n !first ||\n first.type === 'ArgumentPlaceholder' ||\n first.type === 'SpreadElement'\n ) {\n return undefined;\n }\n const target = evaluateReplayExpression(first, scope, state, context);\n if (\n target?.type !== 'container' ||\n target.identity.snapshot.kind !== 'object'\n ) {\n return undefined;\n }\n if (target.writePolicy !== 'forward') return target;\n for (const argument of node.arguments.slice(1)) {\n if (\n argument.type === 'ArgumentPlaceholder' ||\n argument.type === 'SpreadElement'\n ) {\n markReplayContainerEscaped(target);\n return undefined;\n }\n const source = evaluateReplayExpression(\n argument,\n scope,\n state,\n context\n );\n if (source?.type === 'unsafe') {\n markReplayContainerEscaped(target);\n return target;\n }\n if (\n source?.type !== 'container' ||\n source.identity.snapshot.kind !== 'object'\n ) {\n markReplayContainerEscaped(target);\n return undefined;\n }\n if (source.identity.escaped) {\n markReplayContainerEscaped(target);\n return target;\n }\n const copied = copyReplayContainerEntries(source, state, context);\n if (!copied || copied.kind !== 'object') return undefined;\n for (const [key, value] of copied.entries) {\n target.identity.snapshot.entries.set(key, value);\n }\n }\n return target;\n }\n if (calleePath === 'Object.create' && !scope.getBinding('Object')) {\n if (\n !first ||\n first.type === 'ArgumentPlaceholder' ||\n first.type === 'SpreadElement'\n ) {\n return undefined;\n }\n const prototype = evaluateReplayExpression(first, scope, state, context);\n if (\n prototype?.type !== 'container' ||\n prototype.identity.snapshot.kind !== 'object'\n ) {\n return undefined;\n }\n return createReplayContainer({\n kind: 'object',\n entries: new Map(),\n prototype,\n });\n }\n if (calleePath === 'Object.setPrototypeOf' && !scope.getBinding('Object')) {\n const prototypeNode = node.arguments[1];\n if (\n !first ||\n first.type === 'ArgumentPlaceholder' ||\n first.type === 'SpreadElement' ||\n !prototypeNode ||\n prototypeNode.type === 'ArgumentPlaceholder' ||\n prototypeNode.type === 'SpreadElement'\n ) {\n return undefined;\n }\n const target = evaluateReplayExpression(first, scope, state, context);\n const prototype = evaluateReplayExpression(\n prototypeNode,\n scope,\n state,\n context\n );\n if (\n target?.type !== 'container' ||\n target.identity.snapshot.kind !== 'object' ||\n target.writePolicy !== 'forward' ||\n prototype?.type !== 'container' ||\n prototype.identity.snapshot.kind !== 'object'\n ) {\n return undefined;\n }\n target.identity.snapshot.prototype = prototype;\n return target;\n }\n\n const replayCallee = evaluateReplayExpression(\n node.callee,\n scope,\n state,\n context\n );\n if (\n replayCallee?.type === 'leaf' &&\n (replayCallee.knownValue?.type === 'string' ||\n (replayCallee.expression.node.type === 'Identifier' &&\n !replayCallee.expression.scope.getBinding(\n replayCallee.expression.node.name\n ) &&\n ORDINARY_GLOBAL_VALUES.has(replayCallee.expression.node.name)))\n ) {\n return {\n type: 'leaf',\n expression: { node, scope },\n hasGT: false,\n };\n }\n if (replayCallee?.type === 'function') {\n const arguments_: ReplayValue[] = [];\n for (const argument of node.arguments) {\n if (\n argument.type === 'ArgumentPlaceholder' ||\n argument.type === 'SpreadElement'\n ) {\n markReplayValueEscaped(replayCallee);\n return undefined;\n }\n const value = evaluateReplayExpression(argument, scope, state, context);\n if (!value) {\n markReplayValueEscaped(replayCallee);\n return undefined;\n }\n arguments_.push(value);\n }\n const result = executeReplayFunction(\n replayCallee.callable,\n [...replayCallee.boundArguments, ...arguments_],\n state,\n {\n ...context,\n substitutions: new Map(replayCallee.substitutions),\n },\n replayCallee.thisValue\n );\n if (!result.executed) {\n markReplayValueEscaped(replayCallee);\n for (const argument of arguments_) markReplayValueEscaped(argument);\n return undefined;\n }\n return result.value ?? createReplayLeaf(node, scope, state);\n }\n if (replayCallee?.type === 'method' && replayCallee.receiver) {\n const arguments_: ReplayValue[] = [];\n for (const argument of node.arguments) {\n if (\n argument.type === 'ArgumentPlaceholder' ||\n argument.type === 'SpreadElement'\n ) {\n markReplayContainerEscaped(replayCallee.receiver);\n return undefined;\n }\n const value = evaluateReplayExpression(argument, scope, state, context);\n if (!value) {\n markReplayContainerEscaped(replayCallee.receiver);\n return undefined;\n }\n arguments_.push(value);\n }\n const result = executeReplayFunction(\n replayCallee.callable,\n arguments_,\n state,\n {\n ...context,\n substitutions: new Map(replayCallee.substitutions),\n },\n replayCallee.receiver\n );\n if (!result.executed) {\n markReplayContainerEscaped(replayCallee.receiver);\n return undefined;\n }\n return result.value ?? createReplayLeaf(node, scope, state);\n }\n\n const localFunction = resolveCalledFunction(\n node.callee,\n scope,\n state,\n new Set()\n );\n if (localFunction) {\n const arguments_: ReplayValue[] = [];\n for (const argument of node.arguments) {\n if (\n argument.type === 'ArgumentPlaceholder' ||\n argument.type === 'SpreadElement'\n ) {\n invalidateReplayFunctionCaptures(localFunction.node, state, context);\n return undefined;\n }\n const value = evaluateReplayExpression(argument, scope, state, context);\n if (!value) {\n invalidateReplayFunctionCaptures(localFunction.node, state, context);\n return undefined;\n }\n arguments_.push(value);\n }\n const result = executeReplayFunction(\n localFunction,\n arguments_,\n state,\n context\n );\n if (result.executed) {\n return result.value ?? createReplayLeaf(node, scope, state);\n }\n for (const argument of arguments_) markReplayValueEscaped(argument);\n invalidateReplayFunctionCaptures(localFunction.node, state, context);\n return undefined;\n }\n\n const callee = unwrapExpression(node.callee);\n if (\n callee?.type === 'MemberExpression' ||\n callee?.type === 'OptionalMemberExpression'\n ) {\n const value = evaluateReplayExpression(\n callee.object,\n scope,\n state,\n context\n );\n const method = readResolvedMemberProperty(callee, scope, state);\n if (value?.type === 'collection' && method) {\n if (value.identity.escaped) return replayUnsafe;\n if (method === 'values') return { ...value, iteration: 'values' };\n const firstArgument = node.arguments[0];\n const keyValue =\n firstArgument &&\n firstArgument.type !== 'ArgumentPlaceholder' &&\n firstArgument.type !== 'SpreadElement'\n ? evaluateReplayExpression(firstArgument, scope, state, context)\n : undefined;\n const key = keyValue ? replayCollectionKey(keyValue, state) : undefined;\n if (method === 'get' && value.identity.kind === 'map') {\n const entry =\n key === undefined ? undefined : value.identity.entries.get(key);\n return entry?.type === 'leaf'\n ? {\n ...entry,\n exactSelection: true,\n selectionKind: 'collection',\n }\n : entry;\n }\n if (method === 'set' && value.identity.kind === 'map') {\n if (value.writePolicy !== 'forward') return value;\n const next = node.arguments[1];\n const entry =\n next &&\n next.type !== 'ArgumentPlaceholder' &&\n next.type !== 'SpreadElement'\n ? evaluateReplayExpression(next, scope, state, context)\n : undefined;\n if (key === undefined || !entry) {\n markReplayCollectionEscaped(value);\n return undefined;\n }\n value.identity.entries.set(key, entry);\n const templateKey = keyValue\n ? replayCollectionTemplateKey(keyValue, context, state)\n : undefined;\n if (templateKey !== undefined) {\n value.identity.templateKeys.set(key, templateKey);\n }\n return value;\n }\n if (method === 'add' && value.identity.kind === 'set' && keyValue) {\n if (value.writePolicy !== 'forward') return value;\n value.identity.entries.set(\n key ?? `entry:${value.identity.entries.size}`,\n keyValue\n );\n return value;\n }\n if (method === 'delete' && key !== undefined) {\n if (value.writePolicy !== 'forward') {\n return createReplayLeaf(node, scope, state);\n }\n value.identity.entries.delete(key);\n value.identity.templateKeys.delete(key);\n return createReplayLeaf(node, scope, state);\n }\n markReplayCollectionEscaped(value);\n return undefined;\n }\n if (value?.type === 'container' && method) {\n const transformed = evaluateReplayArrayTransform(\n value,\n method,\n node,\n scope,\n state,\n context\n );\n if (transformed) return transformed;\n const callbackNode = node.arguments[0];\n const callback =\n callbackNode &&\n callbackNode.type !== 'ArgumentPlaceholder' &&\n callbackNode.type !== 'SpreadElement'\n ? resolveCalledFunction(callbackNode, scope, state, new Set())\n : undefined;\n if (\n callback &&\n method === 'forEach' &&\n value.identity.snapshot.kind === 'array'\n ) {\n for (const entry of value.identity.snapshot.entries) {\n if (!entry) continue;\n const result = executeReplayFunction(\n callback,\n [entry],\n state,\n context\n );\n if (!result.executed) {\n invalidateReplayFunctionCaptures(callback.node, state, context);\n markReplayContainerEscaped(value);\n return undefined;\n }\n }\n return createReplayLeaf(node, scope, state);\n }\n if (\n callback &&\n [\n 'every',\n 'filter',\n 'find',\n 'findIndex',\n 'findLast',\n 'findLastIndex',\n 'flatMap',\n 'forEach',\n 'reduce',\n 'reduceRight',\n 'some',\n ].includes(method)\n ) {\n invalidateReplayFunctionCaptures(callback.node, state, context);\n const body = callback.node.body;\n if (\n (body.type !== 'BlockStatement' &&\n replayExpressionHasWrites(body, state)) ||\n (body.type === 'BlockStatement' &&\n body.body.some(\n (statement) => statement.type !== 'ReturnStatement'\n ))\n ) {\n markReplayContainerEscaped(value);\n }\n }\n if (\n ['pop', 'push', 'shift', 'splice', 'unshift'].includes(method) &&\n applyReplayArrayMutation(value, method, node, scope, state, context)\n ) {\n return createReplayLeaf(node, scope, state);\n }\n if (!READONLY_ARRAY_TRANSFORMS.has(method)) {\n markReplayContainerEscaped(value);\n }\n return undefined;\n }\n }\n\n for (const argument of node.arguments) {\n if (\n argument.type === 'ArgumentPlaceholder' ||\n argument.type === 'SpreadElement'\n ) {\n continue;\n }\n const value = evaluateReplayExpression(argument, scope, state, context);\n if (value?.type === 'container') markReplayContainerEscaped(value);\n if (value?.type === 'ref') markReplayRefEscaped(value);\n if (value?.type === 'collection') markReplayCollectionEscaped(value);\n }\n return undefined;\n }\n\n /** Produces a stable key for the finite Map/Set values the replay supports. */\n function replayCollectionKey(\n value: ReplayValue,\n state: ScriptState\n ): string | undefined {\n if (value.type === 'leaf') {\n if (value.knownValue) return knownValueKey(value.knownValue);\n const primitive = readStaticFromScope(\n value.expression.node,\n value.expression.scope,\n new Set(),\n value.expression.node.end ?? Number.POSITIVE_INFINITY,\n state.analysis\n );\n return primitive.ok\n ? `${typeof primitive.value}:${String(primitive.value)}`\n : undefined;\n }\n if (\n value.type !== 'container' &&\n value.type !== 'ref' &&\n value.type !== 'collection'\n ) {\n return undefined;\n }\n const identity = value.identity;\n const existing = state.replayIdentityKeys.get(identity);\n if (existing) return existing;\n const key = `identity:${state.nextReplayIdentityKey++}`;\n state.replayIdentityKeys.set(identity, key);\n return key;\n }\n\n /** Names a collection key when the template can reference the same binding. */\n function replayCollectionTemplateKey(\n value: ReplayValue,\n context: ReplayEvaluationContext,\n state: ScriptState\n ): string | undefined {\n if (value.type === 'leaf') {\n const primitive = readStaticFromScope(\n value.expression.node,\n value.expression.scope,\n new Set(),\n value.expression.node.end ?? Number.POSITIVE_INFINITY,\n state.analysis\n );\n if (\n primitive.ok &&\n (typeof primitive.value === 'string' ||\n typeof primitive.value === 'number')\n ) {\n return String(primitive.value);\n }\n return readResolvedMemberPath(\n value.expression.node,\n value.expression.scope,\n state\n );\n }\n if (!('identity' in value)) return undefined;\n for (const [binding, candidate] of context.values) {\n if (\n candidate &&\n candidate.type === value.type &&\n 'identity' in candidate &&\n candidate.identity === value.identity\n ) {\n return binding.identifier.name;\n }\n }\n return undefined;\n }\n\n /** Evaluates finite Map, Set, and transparent Proxy constructors. */\n function evaluateReplayNewExpression(\n node: t.NewExpression,\n scope: Scope,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): ReplayValue | undefined {\n const callee = unwrapExpression(node.callee);\n if (callee?.type !== 'Identifier') {\n return undefined;\n }\n const localBinding = scope.getBinding(callee.name);\n if (localBinding) {\n const declaration = localBinding.path.node;\n const classNode =\n declaration.type === 'ClassDeclaration' ||\n declaration.type === 'ClassExpression'\n ? declaration\n : declaration.type === 'VariableDeclarator' &&\n declaration.init?.type === 'ClassExpression'\n ? declaration.init\n : undefined;\n if (!classNode || classNode.superClass || classNode.decorators?.length) {\n return undefined;\n }\n const prototypeEntries = new Map<string, ReplayValue>();\n const prototypeSetters = new Map<string, ReplayMethodReference>();\n const instanceEntries = new Map<string, ReplayValue>();\n const instance = createReplayContainer({\n kind: 'object',\n entries: instanceEntries,\n prototype: createReplayContainer({\n kind: 'object',\n entries: prototypeEntries,\n setters: prototypeSetters,\n }),\n });\n const instanceContext: ReplayEvaluationContext = {\n ...context,\n thisValue: instance,\n };\n let constructor: (ScopedExpression & { node: t.ClassMethod }) | undefined;\n for (const member of classNode.body.body) {\n if ('decorators' in member && member.decorators?.length)\n return undefined;\n if (member.type === 'ClassProperty' && !member.static) {\n if (!member.value) continue;\n const key = readResolvedPropertyKey(member, scope, state);\n if (key === undefined) return undefined;\n const value = evaluateReplayExpression(\n member.value,\n state.scopes.get(member.value) ?? scope,\n state,\n instanceContext\n );\n if (!value) return undefined;\n instanceEntries.set(key, value);\n continue;\n }\n if (member.type !== 'ClassMethod' || member.static) continue;\n if (member.kind === 'constructor') {\n constructor = {\n node: member,\n scope: state.scopes.get(member) ?? scope,\n };\n continue;\n }\n const key = readResolvedPropertyKey(member, scope, state);\n if (key === undefined) return undefined;\n if (member.kind === 'get') {\n prototypeEntries.set(key, {\n type: 'getter',\n getter: {\n node: member,\n scope: state.scopes.get(member) ?? scope,\n },\n substitutions: new Map(context.substitutions),\n });\n } else if (member.kind === 'method') {\n prototypeEntries.set(key, {\n type: 'method',\n callable: {\n node: member,\n scope: state.scopes.get(member) ?? scope,\n },\n substitutions: new Map(context.substitutions),\n });\n } else if (member.kind === 'set') {\n prototypeSetters.set(key, {\n type: 'method',\n callable: {\n node: member,\n scope: state.scopes.get(member) ?? scope,\n },\n substitutions: new Map(context.substitutions),\n });\n }\n }\n if (!constructor) return instance;\n const arguments_: ReplayValue[] = [];\n for (const argument of node.arguments) {\n if (\n argument.type === 'ArgumentPlaceholder' ||\n argument.type === 'SpreadElement'\n ) {\n return undefined;\n }\n const value = evaluateReplayExpression(argument, scope, state, context);\n if (!value) return undefined;\n arguments_.push(value);\n }\n const result = executeReplayFunction(\n constructor,\n arguments_,\n state,\n instanceContext,\n instance\n );\n if (!result.executed) {\n markReplayContainerEscaped(instance);\n return undefined;\n }\n return result.value?.type === 'container' ? result.value : instance;\n }\n const first = node.arguments[0];\n if (callee.name === 'Map' || callee.name === 'Set') {\n const entries = new Map<string, ReplayValue>();\n const templateKeys = new Map<string, string>();\n if (\n first &&\n first.type !== 'ArgumentPlaceholder' &&\n first.type !== 'SpreadElement'\n ) {\n const source = evaluateReplayExpression(first, scope, state, context);\n if (\n source?.type !== 'container' ||\n source.identity.snapshot.kind !== 'array'\n ) {\n return undefined;\n }\n const copied = copyReplayContainerEntries(source, state, context);\n if (!copied || copied.kind !== 'array') return undefined;\n for (const [index, item] of copied.entries.entries()) {\n if (!item) continue;\n if (callee.name === 'Set') {\n const key = replayCollectionKey(item, state) ?? `index:${index}`;\n entries.set(key, item);\n const templateKey = replayCollectionTemplateKey(\n item,\n context,\n state\n );\n if (templateKey !== undefined) templateKeys.set(key, templateKey);\n continue;\n }\n if (\n item.type !== 'container' ||\n item.identity.snapshot.kind !== 'array'\n ) {\n return undefined;\n }\n const keyValue = readReplayContainerEntry(item, '0', state, context);\n const mapValue = readReplayContainerEntry(item, '1', state, context);\n if (!keyValue || !mapValue) return undefined;\n const key = replayCollectionKey(keyValue, state);\n if (key === undefined) return undefined;\n entries.set(key, mapValue);\n const templateKey = replayCollectionTemplateKey(\n keyValue,\n context,\n state\n );\n if (templateKey !== undefined) templateKeys.set(key, templateKey);\n }\n }\n return {\n type: 'collection',\n identity: {\n entries,\n escaped: false,\n kind: callee.name === 'Map' ? 'map' : 'set',\n templateKeys,\n },\n iteration: callee.name === 'Map' ? 'entries' : 'values',\n writePolicy: 'forward',\n };\n }\n if (\n callee.name !== 'Proxy' ||\n !first ||\n first.type === 'ArgumentPlaceholder' ||\n first.type === 'SpreadElement'\n ) {\n return undefined;\n }\n const target = evaluateReplayExpression(first, scope, state, context);\n const handlerNode = node.arguments[1];\n if (\n !handlerNode ||\n handlerNode.type === 'ArgumentPlaceholder' ||\n handlerNode.type === 'SpreadElement'\n ) {\n return undefined;\n }\n const handler = unwrapExpression(handlerNode);\n if (handler?.type !== 'ObjectExpression') return undefined;\n if (handler.properties.length === 0) return target;\n const getProperty = handler.properties.find(\n (property) =>\n property.type === 'ObjectMethod' &&\n readResolvedPropertyKey(property, scope, state) === 'get'\n );\n if (getProperty?.type !== 'ObjectMethod') return undefined;\n const returns = collectFunctionReturnExpressions(getProperty, scope, state);\n if (returns.length !== 1) return undefined;\n const returned = evaluateReplayExpression(\n returns[0]!.node,\n returns[0]!.scope,\n state,\n context\n );\n return returned\n ? createReplayContainer({\n kind: 'object',\n entries: new Map([[unknownTemplatePathSegment, returned]]),\n })\n : undefined;\n }\n\n /** Evaluates the container identity or captured leaf produced by an expression. */\n function evaluateReplayExpression(\n node: t.Node,\n scope: Scope,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): ReplayValue | undefined {\n const expression = unwrapExpression(node);\n if (!expression) return undefined;\n if (expression.type === 'ThisExpression') {\n return context.thisValue;\n }\n if (expression.type === 'Identifier') {\n const binding = scope.getBinding(expression.name);\n if (binding) {\n const substituted = context.substitutions.get(binding);\n if (substituted) return substituted;\n if (context.values.has(binding)) return context.values.get(binding);\n }\n return createReplayLeaf(expression, scope, state);\n }\n if (\n expression.type === 'ArrowFunctionExpression' ||\n expression.type === 'FunctionExpression'\n ) {\n return {\n type: 'function',\n boundArguments: [],\n callable: {\n node: expression,\n scope: state.scopes.get(expression) ?? scope,\n },\n substitutions: new Map(context.substitutions),\n };\n }\n if (expression.type === 'ArrayExpression') {\n return evaluateReplayArray(expression, scope, state, context);\n }\n if (expression.type === 'ObjectExpression') {\n return evaluateReplayObject(expression, scope, state, context);\n }\n if (expression.type === 'NewExpression') {\n return evaluateReplayNewExpression(expression, scope, state, context);\n }\n if (\n expression.type === 'MemberExpression' ||\n expression.type === 'OptionalMemberExpression'\n ) {\n return (\n evaluateReplayMember(expression, scope, state, context) ??\n createReplayLeaf(expression, scope, state)\n );\n }\n if (\n expression.type === 'CallExpression' ||\n expression.type === 'OptionalCallExpression'\n ) {\n return evaluateReplayCall(expression, scope, state, context);\n }\n if (expression.type === 'SequenceExpression') {\n const last = expression.expressions.at(-1);\n return last\n ? evaluateReplayExpression(last, scope, state, context)\n : undefined;\n }\n if (expression.type === 'AssignmentExpression') {\n return evaluateReplayExpression(expression.right, scope, state, context);\n }\n return createReplayLeaf(expression, scope, state);\n }\n\n /** Splits a static member target into its base expression and property path. */\n function readReplayMemberTarget(\n node: t.MemberExpression | t.OptionalMemberExpression,\n scope: Scope,\n state: ScriptState\n ): { base: t.Expression | t.Super; properties: string[] } | undefined {\n const properties: string[] = [];\n let current: t.Expression | t.Super = node;\n while (\n current.type === 'MemberExpression' ||\n current.type === 'OptionalMemberExpression'\n ) {\n const property = readResolvedMemberProperty(current, scope, state);\n if (property === undefined) return undefined;\n properties.unshift(property);\n current = current.object;\n }\n return { base: current, properties };\n }\n\n /** Finds the accessor setter JavaScript would invoke for one property write. */\n function readReplayContainerSetter(\n value: ReplayContainerReference,\n property: string,\n receiver: ReplayContainerReference = value,\n seen: Set<ReplayContainerIdentity> = new Set()\n ): ReplayMethodReference | null | undefined {\n if (\n value.identity.escaped ||\n value.identity.snapshot.kind !== 'object' ||\n seen.has(value.identity)\n ) {\n return undefined;\n }\n const snapshot = value.identity.snapshot;\n const setter = snapshot.setters?.get(property);\n if (setter) return { ...setter, receiver };\n if (snapshot.entries.has(property)) {\n return snapshot.entries.get(property)?.type === 'getter'\n ? undefined\n : null;\n }\n return snapshot.prototype\n ? readReplayContainerSetter(\n snapshot.prototype,\n property,\n receiver,\n new Set(seen).add(value.identity)\n )\n : null;\n }\n\n /** Applies one direct or nested member assignment to a replayed identity. */\n function applyReplayMemberAssignment(\n left: t.MemberExpression | t.OptionalMemberExpression,\n right: t.Expression,\n scope: Scope,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): boolean {\n const target = readReplayMemberTarget(left, scope, state);\n if (!target || target.properties.length === 0) return false;\n let value = evaluateReplayExpression(target.base, scope, state, context);\n for (const property of target.properties.slice(0, -1)) {\n const child =\n value?.type === 'container'\n ? readReplayContainerEntry(value, property, state, context)\n : value?.type === 'ref' && property === 'value'\n ? readReplayRefValue(value)\n : value?.type === 'computed' && property === 'value'\n ? evaluateReplayComputed(value, state, context)\n : undefined;\n if (!child) {\n if (value?.type === 'container') markReplayContainerEscaped(value);\n if (value?.type === 'ref') markReplayRefEscaped(value);\n return false;\n }\n value = child;\n }\n const property = target.properties.at(-1)!;\n if (value?.type === 'ref') {\n if (property !== 'value') {\n markReplayRefEscaped(value);\n return false;\n }\n if (value.writePolicy !== 'forward') return true;\n value.identity.value = evaluateReplayExpression(\n right,\n scope,\n state,\n context\n );\n return value.identity.value !== undefined;\n }\n if (value?.type !== 'container') return false;\n if (value.writePolicy !== 'forward') return true;\n const snapshot = value.identity.snapshot;\n if (snapshot.kind === 'array' && property === 'length') {\n const length = readStaticFromScope(\n right,\n scope,\n new Set(),\n right.end ?? Number.POSITIVE_INFINITY,\n state.analysis,\n true\n );\n if (\n !length.ok ||\n typeof length.value !== 'number' ||\n !Number.isInteger(length.value) ||\n length.value < 0\n ) {\n markReplayContainerEscaped(value);\n return false;\n }\n snapshot.entries.length = length.value;\n return true;\n }\n const replacement = evaluateReplayExpression(right, scope, state, context);\n if (!replacement) {\n markReplayContainerEscaped(value);\n return false;\n }\n if (snapshot.kind === 'object') {\n const setter = readReplayContainerSetter(value, property);\n if (setter === undefined) {\n markReplayContainerEscaped(value);\n return false;\n }\n if (setter) {\n const result = executeReplayFunction(\n setter.callable,\n [replacement],\n state,\n { ...context, substitutions: new Map(setter.substitutions) },\n setter.receiver\n );\n if (!result.executed) {\n markReplayContainerEscaped(value);\n return false;\n }\n return true;\n }\n }\n if (snapshot.kind === 'array') {\n if (!/^(0|[1-9]\\d*)$/.test(property)) {\n markReplayContainerEscaped(value);\n return false;\n }\n snapshot.entries[Number(property)] = replacement;\n } else {\n snapshot.entries.set(property, replacement);\n }\n return true;\n }\n\n /** Applies JavaScript delete semantics to one replayed own property. */\n function applyReplayMemberDelete(\n argument: t.MemberExpression | t.OptionalMemberExpression,\n scope: Scope,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): boolean {\n const target = readReplayMemberTarget(argument, scope, state);\n if (!target || target.properties.length === 0) return false;\n let value = evaluateReplayExpression(target.base, scope, state, context);\n for (const property of target.properties.slice(0, -1)) {\n value =\n value?.type === 'container'\n ? readReplayContainerEntry(value, property, state, context)\n : value?.type === 'ref' && property === 'value'\n ? readReplayRefValue(value)\n : value?.type === 'computed' && property === 'value'\n ? evaluateReplayComputed(value, state, context)\n : undefined;\n if (!value) return false;\n }\n if (value?.type !== 'container') return false;\n if (value.writePolicy !== 'forward') return true;\n const property = target.properties.at(-1)!;\n const snapshot = value.identity.snapshot;\n if (snapshot.kind === 'array') {\n if (!/^(0|[1-9]\\d*)$/.test(property)) return false;\n snapshot.entries[Number(property)] = undefined;\n } else {\n snapshot.entries.delete(property);\n }\n return true;\n }\n\n /** Invalidates one replay binding and every identity reachable through it. */\n function invalidateReplayBinding(\n binding: Binding | undefined,\n context: ReplayEvaluationContext\n ): void {\n if (!binding || !context.values.has(binding)) return;\n const value = context.values.get(binding);\n if (value?.type === 'container') markReplayContainerEscaped(value);\n if (value?.type === 'ref') markReplayRefEscaped(value);\n if (value?.type === 'collection') markReplayCollectionEscaped(value);\n context.unsafeBindings.add(binding);\n context.values.set(binding, undefined);\n }\n\n /** Invalidates identities captured by a local callback we cannot execute. */\n function invalidateReplayFunctionCaptures(\n fn: t.Function,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): void {\n const path = state.paths.get(fn);\n if (!path) return;\n path.traverse({\n Identifier(identifierPath) {\n invalidateReplayBinding(\n identifierPath.scope.getBinding(identifierPath.node.name),\n context\n );\n },\n });\n }\n\n /** Invalidates only identities referenced by unsupported control flow. */\n function invalidateReplayStatement(\n path: NodePath<t.Node>,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): void {\n if (path.isIdentifier()) {\n invalidateReplayBinding(path.scope.getBinding(path.node.name), context);\n }\n path.traverse({\n CallExpression(callPath) {\n const callable = resolveCalledFunction(\n callPath.node.callee,\n callPath.scope,\n state,\n new Set()\n );\n if (callable) {\n invalidateReplayFunctionCaptures(callable.node, state, context);\n }\n for (const argument of callPath.node.arguments) {\n if (\n argument.type === 'ArgumentPlaceholder' ||\n argument.type === 'SpreadElement'\n ) {\n continue;\n }\n markReplayValueEscaped(\n evaluateReplayExpression(argument, callPath.scope, state, context)\n );\n }\n },\n OptionalCallExpression(callPath) {\n const callable = resolveCalledFunction(\n callPath.node.callee,\n callPath.scope,\n state,\n new Set()\n );\n if (callable) {\n invalidateReplayFunctionCaptures(callable.node, state, context);\n }\n for (const argument of callPath.node.arguments) {\n if (\n argument.type === 'ArgumentPlaceholder' ||\n argument.type === 'SpreadElement'\n ) {\n continue;\n }\n markReplayValueEscaped(\n evaluateReplayExpression(argument, callPath.scope, state, context)\n );\n }\n },\n Identifier(identifierPath) {\n invalidateReplayBinding(\n identifierPath.scope.getBinding(identifierPath.node.name),\n context\n );\n },\n });\n }\n\n /** Executes one direct sibling statement in the finite identity subset. */\n function replayContainerStatement(\n path: NodePath<t.Node>,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): void {\n if (path.isImportDeclaration() || path.isFunctionDeclaration()) return;\n if (path.isVariableDeclaration()) {\n for (const declarator of path.get('declarations')) {\n if (!declarator.isVariableDeclarator()) continue;\n if (declarator.node.id.type !== 'Identifier') {\n const source = declarator.node.init\n ? evaluateReplayExpression(\n declarator.node.init,\n declarator.scope,\n state,\n context\n )\n : undefined;\n const unsafe =\n source?.type === 'unsafe' ||\n (source?.type === 'container' && source.identity.escaped) ||\n (source?.type === 'collection' && source.identity.escaped) ||\n (source?.type === 'ref' && source.identity.escaped);\n if (unsafe) {\n for (const name of collectPatternBindingNames(declarator.node.id)) {\n const binding = declarator.scope.getBinding(name);\n if (!binding) continue;\n context.unsafeBindings.add(binding);\n context.values.set(binding, replayUnsafe);\n }\n continue;\n }\n invalidateReplayStatement(declarator, state, context);\n continue;\n }\n const binding = declarator.scope.getBinding(declarator.node.id.name);\n if (!binding) continue;\n const value = declarator.node.init\n ? evaluateReplayExpression(\n declarator.node.init,\n declarator.scope,\n state,\n context\n )\n : undefined;\n if (value?.type === 'unsafe') context.unsafeBindings.add(binding);\n else context.unsafeBindings.delete(binding);\n context.values.set(binding, value);\n }\n return;\n }\n if (!path.isExpressionStatement()) {\n invalidateReplayStatement(path, state, context);\n return;\n }\n const expression = unwrapExpression(path.node.expression);\n if (\n expression?.type === 'UnaryExpression' &&\n expression.operator === 'delete' &&\n (expression.argument.type === 'MemberExpression' ||\n expression.argument.type === 'OptionalMemberExpression')\n ) {\n if (\n !applyReplayMemberDelete(\n expression.argument,\n path.scope,\n state,\n context\n )\n ) {\n invalidateReplayStatement(path, state, context);\n }\n return;\n }\n if (expression?.type === 'AssignmentExpression') {\n if (expression.operator !== '=') {\n invalidateReplayStatement(path, state, context);\n return;\n }\n if (expression.left.type === 'Identifier') {\n const binding = path.scope.getBinding(expression.left.name);\n if (!binding) return;\n const value = evaluateReplayExpression(\n expression.right,\n path.scope,\n state,\n context\n );\n if (value?.type === 'unsafe') context.unsafeBindings.add(binding);\n else context.unsafeBindings.delete(binding);\n context.values.set(binding, value);\n return;\n }\n if (\n expression.left.type === 'MemberExpression' ||\n expression.left.type === 'OptionalMemberExpression'\n ) {\n if (\n !applyReplayMemberAssignment(\n expression.left,\n expression.right,\n path.scope,\n state,\n context\n )\n ) {\n invalidateReplayStatement(path, state, context);\n }\n return;\n }\n invalidateReplayStatement(path, state, context);\n return;\n }\n if (\n expression?.type === 'CallExpression' ||\n expression?.type === 'OptionalCallExpression'\n ) {\n evaluateReplayCall(expression, path.scope, state, context);\n return;\n }\n invalidateReplayStatement(path, state, context);\n }\n\n /** Replays one lexical statement list once and caches it for every binding. */\n function readContainerIdentityReplay(\n binding: Binding,\n state: ScriptState\n ): ContainerIdentityReplay | undefined {\n const statement = binding.path.getStatementParent();\n const bodyPath = statement?.parentPath;\n if (\n !statement ||\n !bodyPath ||\n (!bodyPath.isProgram() && !bodyPath.isBlockStatement())\n ) {\n return undefined;\n }\n const cached = state.containerIdentityReplays.get(bodyPath.node);\n if (cached) return cached;\n const context: ReplayEvaluationContext = {\n allowGetterEffects: true,\n substitutions: new Map(),\n unsafeBindings: new Set(),\n values: new Map(),\n };\n const body = bodyPath.get('body');\n if (!Array.isArray(body)) return undefined;\n for (const child of body) {\n replayContainerStatement(child as NodePath<t.Node>, state, context);\n }\n const replay = {\n unsafeBindings: context.unsafeBindings,\n values: context.values,\n };\n state.containerIdentityReplays.set(bodyPath.node, replay);\n return replay;\n }\n\n /** Replays earlier sibling statements and reads one call target in-place. */\n function evaluateReplayAtPosition(\n node: t.Node,\n scope: Scope,\n atPosition: number,\n state: ScriptState\n ): ReplayValue | undefined {\n const expression = unwrapExpression(node) ?? node;\n const nodePath = state.paths.get(expression) ?? state.paths.get(node);\n const statement = nodePath?.getStatementParent();\n const bodyPath = statement?.parentPath;\n if (\n !statement ||\n !bodyPath ||\n (!bodyPath.isProgram() && !bodyPath.isBlockStatement())\n ) {\n return undefined;\n }\n const body = bodyPath.get('body');\n if (!Array.isArray(body)) return undefined;\n const context: ReplayEvaluationContext = {\n allowGetterEffects: true,\n substitutions: new Map(),\n unsafeBindings: new Set(),\n values: new Map(),\n };\n for (const child of body) {\n if (\n child.node === statement.node ||\n (child.node.start ?? Number.POSITIVE_INFINITY) >= atPosition\n ) {\n break;\n }\n replayContainerStatement(child as NodePath<t.Node>, state, context);\n }\n return evaluateReplayExpression(expression, scope, state, context);\n }\n\n /** Applies Vue template top-level ref/computed unwrapping to replayed bindings. */\n function readReplayTemplateValue(\n value: ReplayValue | undefined,\n state: ScriptState,\n replay: ContainerIdentityReplay\n ): ReplayValue | undefined {\n const context: ReplayEvaluationContext = {\n substitutions: new Map(),\n unsafeBindings: replay.unsafeBindings,\n values: replay.values,\n };\n const seen = new Set<ReplayValue>();\n let current = value;\n while (\n current &&\n !seen.has(current) &&\n (current.type === 'ref' || current.type === 'computed')\n ) {\n seen.add(current);\n current =\n current.type === 'ref'\n ? readReplayRefValue(current)\n : evaluateReplayComputed(current, state, context);\n }\n return current;\n }\n\n /** Reads a final scalar component identity without reviving stale sources. */\n function readReplayLeafState(\n binding: Binding,\n state: ScriptState\n ): ReplayLeafState | undefined {\n const replay = readContainerIdentityReplay(binding, state);\n if (!replay || !replay.values.has(binding)) return undefined;\n const value = readReplayTemplateValue(\n replay.values.get(binding),\n state,\n replay\n );\n if (value?.type === 'unsafe') return { status: 'unsafe' };\n return value?.type === 'leaf' &&\n value.exactSelection &&\n value.hasGT !== undefined\n ? { status: 'leaf', value }\n : undefined;\n }\n\n /** Keeps exact replay from bypassing deliberate opaque-resolution boundaries. */\n function readSafeReplayLeafOverride(\n binding: Binding,\n replayLeaf: ReplayLeafState | undefined,\n state: ScriptState\n ): Extract<ReplayLeafState, { status: 'leaf' }> | undefined {\n if (replayLeaf?.status !== 'leaf') return undefined;\n const { value } = replayLeaf;\n if (bindingReadsUnsafeMutableImport(binding, state)) return undefined;\n if (value.knownValue?.type === 'vue-builtin') return undefined;\n if (\n value.selectionKind === 'ref' &&\n value.knownValue?.type === 'component'\n ) {\n return undefined;\n }\n return isReplayGetterStringLeaf(value) ? undefined : replayLeaf;\n }\n\n /** String translators selected through a getter remain intentionally opaque. */\n function isReplayGetterStringLeaf(value: ReplayLeaf): boolean {\n return (\n value.selectionKind === 'getter' && value.knownValue?.type === 'string'\n );\n }\n\n /** Detects unresolved mutable identities retained by one final replay value. */\n function replayBindingRetainsUnsafeIdentity(\n binding: Binding,\n state: ScriptState\n ): boolean {\n const replay = readContainerIdentityReplay(binding, state);\n if (!replay || replay.unsafeBindings.has(binding)) return Boolean(replay);\n const seen = new Set<object>();\n const visit = (value: ReplayValue | undefined): boolean => {\n if (!value) return false;\n if (value.type === 'unsafe') return true;\n if (value.type === 'container') {\n if (value.identity.escaped || seen.has(value.identity)) {\n return value.identity.escaped;\n }\n seen.add(value.identity);\n const snapshot = value.identity.snapshot;\n const entries =\n snapshot.kind === 'array'\n ? snapshot.entries\n : snapshot.entries.values();\n for (const entry of entries) {\n if (visit(entry)) return true;\n }\n return snapshot.kind === 'object' && snapshot.prototype\n ? visit(snapshot.prototype)\n : false;\n }\n if (value.type === 'ref') {\n if (value.identity.escaped || seen.has(value.identity)) {\n return value.identity.escaped;\n }\n seen.add(value.identity);\n return visit(value.identity.value);\n }\n if (value.type === 'collection') {\n if (value.identity.escaped || seen.has(value.identity)) {\n return value.identity.escaped;\n }\n seen.add(value.identity);\n return [...value.identity.entries.values()].some(visit);\n }\n if (value.type === 'function') {\n return (\n value.boundArguments.some(visit) ||\n [...value.substitutions.values()].some(visit)\n );\n }\n if (value.type === 'getter' || value.type === 'method') {\n return [...value.substitutions.values()].some(visit);\n }\n return false;\n };\n return visit(replay.values.get(binding));\n }\n\n /** Collects exact tainted-container paths from one final runtime identity. */\n function replayContainerIdentityHasGT(\n value: ReplayContainerReference,\n seen: Set<ReplayContainerIdentity>,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): boolean | undefined {\n if (value.identity.escaped) return undefined;\n if (seen.has(value.identity)) return false;\n const nextSeen = new Set(seen).add(value.identity);\n const visible = readReplayVisibleContainerEntries(value, state, context);\n if (!visible) return undefined;\n let unknown = false;\n for (const [, entry] of visible) {\n if (!entry) continue;\n if (entry.type === 'leaf') {\n if (entry.hasGT) return true;\n if (entry.hasGT === undefined) unknown = true;\n continue;\n }\n if (entry.type !== 'container') {\n unknown = true;\n continue;\n }\n const nested = replayContainerIdentityHasGT(\n entry,\n nextSeen,\n state,\n context\n );\n if (nested) return true;\n if (nested === undefined) unknown = true;\n }\n return unknown ? undefined : false;\n }\n\n /** Collects exact tainted-container paths from one final runtime identity. */\n function collectReplayGTContainerPaths(\n value: ReplayContainerReference,\n basePath: string,\n seen: Set<ReplayContainerIdentity>,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): Set<string> | undefined {\n if (value.identity.escaped) return new Set([basePath]);\n if (seen.has(value.identity)) {\n const hasGT = replayContainerIdentityHasGT(\n value,\n new Set(),\n state,\n context\n );\n return hasGT === undefined\n ? undefined\n : hasGT\n ? new Set([\n appendTemplatePath(basePath, recursiveTemplatePathSegment),\n ])\n : new Set();\n }\n const nextSeen = new Set(seen).add(value.identity);\n const result = new Set<string>();\n const entries = readReplayVisibleContainerEntries(value, state, context);\n if (!entries) return undefined;\n for (const [key, entry] of entries) {\n if (!entry) continue;\n if (entry.type === 'leaf') {\n if (entry.hasGT === undefined) return undefined;\n if (entry.hasGT) result.add(basePath);\n continue;\n }\n if (entry.type !== 'container') return undefined;\n const nested = collectReplayGTContainerPaths(\n entry,\n appendTemplatePath(basePath, key),\n nextSeen,\n state,\n context\n );\n if (!nested) return undefined;\n for (const path of nested) result.add(path);\n }\n return result;\n }\n\n /** Conservatively taints a finite Map/Set when any selected value can be T. */\n function collectReplayCollectionGTContainerPaths(\n value: ReplayCollectionReference,\n basePath: string,\n state: ScriptState,\n context: ReplayEvaluationContext\n ): Set<string> | undefined {\n if (value.identity.escaped) return new Set([basePath]);\n let nestedGT = false;\n for (const entry of value.identity.entries.values()) {\n if (entry.type === 'leaf') {\n if (entry.hasGT === undefined) return undefined;\n continue;\n }\n if (entry.type === 'container') {\n const nested = collectReplayGTContainerPaths(\n entry,\n basePath,\n new Set(),\n state,\n context\n );\n if (!nested) return undefined;\n nestedGT ||= nested.size > 0;\n continue;\n }\n return undefined;\n }\n return nestedGT ? new Set([basePath]) : new Set();\n }\n\n /** Reads exact final T-container paths when identity replay stayed finite. */\n function readDefiniteReplayGTContainerPaths(\n binding: Binding,\n state: ScriptState\n ): Set<string> | null | undefined {\n const replay = readContainerIdentityReplay(binding, state);\n if (!replay || !replay.values.has(binding)) return undefined;\n const context: ReplayEvaluationContext = {\n substitutions: new Map(),\n unsafeBindings: replay.unsafeBindings,\n values: replay.values,\n };\n const value = replay\n ? readReplayTemplateValue(replay.values.get(binding), state, replay)\n : undefined;\n if (value?.type === 'container') {\n return (\n collectReplayGTContainerPaths(\n value,\n binding.identifier.name,\n new Set(),\n state,\n context\n ) ?? null\n );\n }\n if (value?.type === 'collection') {\n return (\n collectReplayCollectionGTContainerPaths(\n value,\n binding.identifier.name,\n state,\n context\n ) ?? null\n );\n }\n if (value?.type === 'unsafe') return null;\n return value === undefined && replay.unsafeBindings.has(binding)\n ? null\n : undefined;\n }\n\n /** Reads exact final array/object shape from the same identity replay. */\n function readReplayContainerMetadata(\n binding: Binding,\n basePath: string,\n state: ScriptState\n ):\n | {\n arrayLengths: Map<string, number>;\n kinds: Map<string, TemplateContainerKind>;\n }\n | undefined {\n const replay = readContainerIdentityReplay(binding, state);\n if (!replay) return undefined;\n const context: ReplayEvaluationContext = {\n substitutions: new Map(),\n unsafeBindings: replay.unsafeBindings,\n values: replay.values,\n };\n const root = replay\n ? readReplayTemplateValue(replay.values.get(binding), state, replay)\n : undefined;\n if (root?.type === 'collection') {\n return root.identity.escaped\n ? undefined\n : {\n arrayLengths: new Map(),\n kinds: new Map([[basePath, 'object']]),\n };\n }\n if (root?.type !== 'container') return undefined;\n const arrayLengths = new Map<string, number>();\n const kinds = new Map<string, TemplateContainerKind>();\n const visit = (\n value: ReplayContainerReference,\n path: string,\n seen: Set<ReplayContainerIdentity>\n ): boolean => {\n if (value.identity.escaped) return false;\n if (seen.has(value.identity)) return true;\n const nextSeen = new Set(seen).add(value.identity);\n const snapshot = value.identity.snapshot;\n kinds.set(path, snapshot.kind);\n if (snapshot.kind === 'array')\n arrayLengths.set(path, snapshot.entries.length);\n const entries = readReplayVisibleContainerEntries(value, state, context);\n if (!entries) return false;\n for (const [key, entry] of entries) {\n if (\n entry?.type === 'container' &&\n !visit(entry, appendTemplatePath(path, key), nextSeen)\n ) {\n return false;\n }\n }\n return true;\n };\n return visit(root, basePath, new Set())\n ? { arrayLengths, kinds }\n : undefined;\n }\n\n /** Exposes exact component leaves from a replayed final container. */\n function readReplayComponentCandidates(\n binding: Binding,\n basePath: string,\n state: ScriptState\n ): ComponentMemberCandidate[] | undefined {\n const replay = readContainerIdentityReplay(binding, state);\n if (!replay) return undefined;\n const context: ReplayEvaluationContext = {\n substitutions: new Map(),\n unsafeBindings: replay.unsafeBindings,\n values: replay.values,\n };\n const root = replay\n ? readReplayTemplateValue(replay.values.get(binding), state, replay)\n : undefined;\n if (root?.type === 'collection') {\n if (root.identity.escaped) return undefined;\n const result: ComponentMemberCandidate[] = [];\n for (const [key, entry] of root.identity.entries) {\n if (entry.type !== 'leaf' || entry.hasGT === undefined)\n return undefined;\n if (!entry.knownValue) continue;\n const name = appendTemplatePath(\n basePath,\n root.identity.templateKeys.get(key) ?? unknownTemplatePathSegment\n );\n result.push({\n certain: !isReplayGetterStringLeaf(entry),\n name,\n value: entry.knownValue,\n });\n }\n return result;\n }\n if (root?.type !== 'container') return undefined;\n const result: ComponentMemberCandidate[] = [];\n const visit = (\n value: ReplayContainerReference,\n path: string,\n seen: Set<ReplayContainerIdentity>\n ): boolean => {\n if (value.identity.escaped) return false;\n if (seen.has(value.identity)) return true;\n const nextSeen = new Set(seen).add(value.identity);\n const entries = readReplayVisibleContainerEntries(value, state, context);\n if (!entries) return false;\n for (const [key, entry] of entries) {\n if (!entry) continue;\n const childPath = appendTemplatePath(path, key);\n if (entry.type === 'container') {\n if (!visit(entry, childPath, nextSeen)) return false;\n } else if (entry.type === 'leaf') {\n if (entry.hasGT === undefined) return false;\n if (entry.knownValue) {\n result.push({\n certain: !isReplayGetterStringLeaf(entry),\n name: childPath,\n value: entry.knownValue,\n });\n }\n } else {\n return false;\n }\n }\n return true;\n };\n return visit(root, basePath, new Set()) ? result : undefined;\n }\n\n /** Exposes pure receiver methods whose final return is a known component. */\n function readReplayComponentFactoryCandidates(\n binding: Binding,\n basePath: string,\n state: ScriptState\n ): ComponentFactoryCandidate[] | undefined {\n const replay = readContainerIdentityReplay(binding, state);\n if (!replay) return undefined;\n const context: ReplayEvaluationContext = {\n substitutions: new Map(),\n unsafeBindings: replay.unsafeBindings,\n values: replay.values,\n };\n const root = readReplayTemplateValue(\n replay.values.get(binding),\n state,\n replay\n );\n if (root?.type !== 'container') return undefined;\n const result: ComponentFactoryCandidate[] = [];\n const visit = (\n value: ReplayContainerReference,\n path: string,\n seen: Set<ReplayContainerIdentity>\n ): boolean => {\n if (value.identity.escaped) return false;\n if (seen.has(value.identity)) return true;\n const entries = readReplayVisibleContainerEntries(value, state, context);\n if (!entries) return false;\n const nextSeen = new Set(seen).add(value.identity);\n for (const [key, entry] of entries) {\n if (!entry) continue;\n const childPath = appendTemplatePath(path, key);\n if (entry.type === 'container') {\n if (!visit(entry, childPath, nextSeen)) return false;\n continue;\n }\n if (entry.type === 'leaf') {\n if (entry.hasGT === undefined) return false;\n continue;\n }\n if (entry.type !== 'method' || !entry.receiver) return false;\n const body = entry.callable.node.body;\n if (\n body.type === 'BlockStatement' &&\n (body.body.length !== 1 || body.body[0]?.type !== 'ReturnStatement')\n ) {\n return false;\n }\n const returns = collectFunctionReturnExpressions(\n entry.callable.node,\n entry.callable.scope,\n state\n );\n if (returns.length !== 1) return false;\n const returned = evaluateReplayExpression(\n returns[0]!.node,\n returns[0]!.scope,\n state,\n {\n ...context,\n substitutions: new Map(entry.substitutions),\n thisValue: entry.receiver,\n }\n );\n if (returned?.type !== 'leaf' || returned.hasGT === undefined) {\n return false;\n }\n if (\n returned.knownValue?.type === 'component' ||\n returned.knownValue?.type === 'vue-builtin'\n ) {\n result.push({\n gt:\n returned.knownValue.type === 'component' &&\n returned.knownValue.name === 'T',\n name: childPath,\n });\n }\n }\n return true;\n };\n return visit(root, basePath, new Set()) ? result : undefined;\n }\n\n return {\n evaluateReplayAtPosition,\n isReplayGetterStringLeaf,\n readDefiniteReplayGTContainerPaths,\n readReplayComponentCandidates,\n readReplayComponentFactoryCandidates,\n readReplayContainerMetadata,\n readReplayLeafState,\n readSafeReplayLeafOverride,\n replayBindingRetainsUnsafeIdentity,\n };\n}\n"],"mappings":";;;;;;;;AA0JA,SAAgB,qBAAqB,EACnC,sBAAsB,wBACtB,yBAAyB,2BACzB,iCACA,kCACA,4BACA,6BACA,eACA,0BACA,wBACA,4BACA,yBACA,qBACA,uBACA,uBACA,0BAC6C;CAC7C,MAAM,eAA6B,EAAE,MAAM,UAAU;;CAGrD,SAAS,sBACP,UAC0B;AAC1B,SAAO;GACL,MAAM;GACN,UAAU;IAAE,SAAS;IAAO;IAAU;GACtC,aAAa;GACd;;;CAIH,SAAS,oBACP,OACA,SAC0B;AAC1B,SAAO;GACL,MAAM;GACN,UAAU,MAAM;GAChB,aAAa,4BAA4B,SAAS,MAAM,YAAY;GACrE;;;CAIH,SAAS,oBACP,OAKA,SAKqB;AACrB,MAAI,MAAM,SAAS,YAAa,QAAO,oBAAoB,OAAO,QAAQ;AAC1E,SAAO;GACL,GAAG;GACH,aAAa,4BAA4B,SAAS,MAAM,YAAY;GACrE;;;CAIH,SAAS,2BACP,OACA,uBAAoB,IAAI,KAAK,EACvB;AACN,MAAI,KAAK,IAAI,MAAM,SAAS,CAAE;AAC9B,OAAK,IAAI,MAAM,SAAS;AACxB,QAAM,SAAS,UAAU;EACzB,MAAM,UACJ,MAAM,SAAS,SAAS,SAAS,UAC7B,MAAM,SAAS,SAAS,UACxB,MAAM,SAAS,SAAS,QAAQ,QAAQ;AAC9C,OAAK,MAAM,SAAS,SAAS;AAC3B,OAAI,OAAO,SAAS,YAAa,4BAA2B,OAAO,KAAK;AACxE,OAAI,OAAO,SAAS,MAAO,sBAAqB,OAAO,KAAK;AAC5D,OAAI,OAAO,SAAS,aAClB,6BAA4B,OAAO,KAAK;;AAG5C,MAAI,MAAM,SAAS,SAAS,SAAS,UAAU;GAC7C,MAAM,YAAY,M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KACV,IACE,SAAS,WAAW,SAAS,eAC7B,SAAS,WAAW,SAAS;KAC/B,MAAM;KACP,CAAC;;AAGN,UAAO;;AAET,SAAO,MAAM,MAAM,0BAAU,IAAI,KAAK,CAAC,GAAG,SAAS,KAAA;;AAGrD,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
@@ -0,0 +1,25 @@
1
+ import type { Binding, NodePath, Scope } from '@babel/traverse';
2
+ import type * as t from '@babel/types';
3
+ import { type StaticPrimitiveResult } from '../utils.js';
4
+ import type { CollectedObjectEntries, ContainerWritePolicy, FinalContainerSnapshot, KnownValue, ScopedExpression, ScriptState, VueScriptAnalysis } from './model.js';
5
+ /** Static-analysis operations consumed by finite snapshot evaluation. */
6
+ export type SnapshotAnalysisDependencies = {
7
+ readonlyArrayTransforms: ReadonlySet<string>;
8
+ collectObjectEntries: (node: t.Node, scope: Scope, seen: Set<t.Node>, atPosition?: number, state?: ScriptState) => CollectedObjectEntries;
9
+ collectTransformArrayEntries: (node: t.Node, scope: Scope, state: ScriptState, seen: Set<t.Node>, atPosition?: number) => Array<ScopedExpression | undefined> | undefined;
10
+ memberChainIsReadOnly: (memberPath: NodePath<t.MemberExpression | t.OptionalMemberExpression>) => boolean;
11
+ readBindingContainerWritePolicy: (binding: Binding, state: ScriptState, seen?: Set<Binding>) => ContainerWritePolicy | undefined;
12
+ readResolvedMemberPath: (node: t.Node, scope: Scope, state: ScriptState) => string | undefined;
13
+ readResolvedMemberProperty: (node: t.MemberExpression | t.OptionalMemberExpression, scope: Scope, state: ScriptState) => string | undefined;
14
+ readStaticFromScope: (node: t.Node | null | undefined, scope: Scope, seen: Set<Binding>, atPosition: number, analysis?: VueScriptAnalysis, allowNumericGlobals?: boolean) => StaticPrimitiveResult;
15
+ resolveKnownExpression: (node: t.Node | null | undefined, scope: Scope, state: ScriptState, seen: Set<Binding>) => KnownValue | undefined;
16
+ resolveVueTemplateContainerSources: (node: t.Node, scope: Scope, state: ScriptState) => ScopedExpression[] | undefined;
17
+ };
18
+ /** Narrow snapshot queries used by replay and conservative provenance. */
19
+ export type SnapshotAnalysis = {
20
+ readDefiniteArrayInteger: (node: t.Node | undefined, fallback: number, scope: Scope, state: ScriptState) => number | undefined;
21
+ readDefiniteFinalContainerHasGT: (binding: Binding, state: ScriptState) => boolean | undefined;
22
+ readDefiniteFinalContainerSnapshot: (binding: Binding, state: ScriptState) => FinalContainerSnapshot | undefined;
23
+ };
24
+ /** Creates the conservative finite-container snapshot analyzer. */
25
+ export declare function createSnapshotAnalysis({ readonlyArrayTransforms: READONLY_ARRAY_TRANSFORMS, collectObjectEntries, collectTransformArrayEntries, memberChainIsReadOnly, readBindingContainerWritePolicy, readResolvedMemberPath, readResolvedMemberProperty, readStaticFromScope, resolveKnownExpression, resolveVueTemplateContainerSources, }: SnapshotAnalysisDependencies): SnapshotAnalysis;