Skip to content

Commit 4e579b0

Browse files
committed
fix(native): exclude prototype patterns from WASM post-pass pre-filter
The regex /\b\w+\.\w+\s*=\s*function/ matched the substring 'prototype.bar = function' inside 'Foo.prototype.bar = function(){}', causing prototype files to be queued for WASM re-processing even though the Rust engine now handles those patterns natively. Added a negative lookahead to exclude the prototype shape, matching only function-as-object-property patterns like 'fn.method = function'. Fixes the duplicate-node risk flagged in Greptile review of #1339.
1 parent 5baf98c commit 4e579b0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/domain/graph/builder/stages/native-orchestrator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ async function runPostNativePrototypeMethods(
598598
const protoFiles = jsFiles.filter((relPath) => {
599599
try {
600600
const content = readFileSafe(path.join(rootDir, relPath));
601-
return /\b\w+\.\w+\s*=\s*function/.test(content);
601+
return /\b(?!prototype\.)\w+\.\w+\s*=\s*function/.test(content);
602602
} catch {
603603
return false;
604604
}

0 commit comments

Comments
 (0)