Skip to content

Commit 94245f6

Browse files
authored
fix(parser): close WASM–native engine parity gap (#649) (#657)
Four root causes fixed across both engines: WASM JS/TS: extractConstantsWalk only walked root-level children, missing constants inside top-level blocks (if, try, for). Now recurses into all non-function scopes, matching native's recursive walk. WASM JS/TS: query pattern only matched property_identifier for methods, missing private #methods. Added private_property_identifier pattern. WASM Rust: extractRustParameters included self_parameter nodes that native correctly skips. Now skips them. Native JS: find_parent_of_types missed generator_function_declaration and generator_function, leaking constants from generator function bodies. Added both types to the scope filter. Native Rust: function_item handler emitted a duplicate entry for trait default-impl functions already captured by trait_item handler. Added parent guard matching WASM's existing skip logic.
1 parent 2c501aa commit 94245f6

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/extractors/rust.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ function extractRustParameters(paramListNode: TreeSitterNode | null): SubDeclara
228228
if (!param) continue;
229229
if (param.type === 'self_parameter') {
230230
// Skip self parameters — matches native engine behaviour
231+
continue;
231232
} else if (param.type === 'parameter') {
232233
const pattern = param.childForFieldName('pattern');
233234
if (pattern) {

0 commit comments

Comments
 (0)