Skip to content

Commit 3a60f85

Browse files
refactor: update visit method to spawn context for every node type
- Change visit method to use context.spawn(nodeType) when calling node methods - Ensures all methods receive properly contextualized calls with nodeType in parentNodeTypes - Makes context spawning more consistent throughout the entire deparser - All 279 test suites continue to pass with this more thorough approach Co-Authored-By: Dan Lynch <[email protected]>
1 parent c94e430 commit 3a60f85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/deparser/src/deparser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export class Deparser implements DeparserVisitor {
224224

225225
const methodName = nodeType as keyof this;
226226
if (typeof this[methodName] === 'function') {
227-
const result = (this[methodName] as any)(nodeData, context);
227+
const result = (this[methodName] as any)(nodeData, context.spawn(nodeType));
228228

229229
return result;
230230
}

0 commit comments

Comments
 (0)