mirror of
https://github.com/morluto/rea
synced 2026-10-26 22:28:27 -04:00
fix(evidence): preserve literal keys and response body ownership
Retain exact empty and computed literal keys in JavaScript observations. Bind CDP response bodies to request occurrences, account for late responses, and validate the target after final progress callbacks.
This commit is contained in:
@@ -13,6 +13,7 @@ import type {
|
||||
} from "./javascriptStaticAnalysisTypes.js";
|
||||
import {
|
||||
readExactJavaScriptLiteral,
|
||||
semanticStaticPropertyKey,
|
||||
semanticStaticPropertyName,
|
||||
unwrapJavaScriptExpression,
|
||||
} from "./javascriptAstValues.js";
|
||||
@@ -131,15 +132,15 @@ export const moduleFactory = (
|
||||
/** Derive a literal or explicitly computed module key. */
|
||||
export const modulePropertyName = (
|
||||
property: t.ObjectMethod | t.ObjectProperty | t.SpreadElement,
|
||||
): string =>
|
||||
t.isObjectMethod(property) || t.isObjectProperty(property)
|
||||
? property.computed &&
|
||||
!t.isStringLiteral(property.key) &&
|
||||
!t.isNumericLiteral(property.key)
|
||||
? `[computed@${String(property.start ?? -1)}]`
|
||||
: semanticStaticPropertyName(property.key, property.computed) ||
|
||||
`[unknown@${String(property.start ?? -1)}]`
|
||||
): string => {
|
||||
if (!t.isObjectMethod(property) && !t.isObjectProperty(property))
|
||||
return `[unknown@${String(property.start ?? -1)}]`;
|
||||
const key = semanticStaticPropertyKey(property.key, property.computed);
|
||||
if (key !== null) return key;
|
||||
return property.computed
|
||||
? `[computed@${String(property.start ?? -1)}]`
|
||||
: `[unknown@${String(property.start ?? -1)}]`;
|
||||
};
|
||||
|
||||
/** Read the factory-local bundler require parameter when declared. */
|
||||
export const factoryRequireName = (
|
||||
|
||||
Reference in New Issue
Block a user