fix(javascript): retain runtime scope in bundled module relationships

This commit is contained in:
dakjdakd
2026-10-11 01:36:12 +08:00
committed by Ysopwnable
parent 0d89978333
commit c1217e711b
14 changed files with 394 additions and 42 deletions
@@ -130,7 +130,11 @@ export const finalizeLocatedFindings = <
values: readonly LocatedJavaScriptFinding<Value>[],
modules: JavaScriptModuleRangeIndex,
): Value[] =>
values.map(({ offset, value }) => ({
...value,
module_key: modules.find(offset)?.key ?? null,
}));
values.map(({ offset, value }) => {
const module = modules.find(offset);
return {
...value,
module_key: module?.key ?? null,
...(module === undefined ? {} : { module_runtime: module.runtime }),
};
});