Skip to content

4.9 regression for visitEachChild #51542

Closed
@simllll

Description

@simllll

Bug Report

🔎 Search Terms

visitEachChild, SourceFile

🕗 Version & Regression Information

  • This changed between versions 4.8. and 4.9

💻 Code

I'm using ts-patch that allows me to apply a transformer, in this case I use https://github.com/kimamula/ts-transformer-keys.
What it does is that it traveres all nodes and does some simply modification on it, it stopped working on ts 4.9 though.
(see also nonara/ts-patch#81)

After digging into it, it touched all nodes in 4.8:

visitNode SourceFile
visitNode ImportDeclaration
visitNode StringLiteral
... etc

but in 4.9 it didn't go any further after the first node (stopped after visitNode SourceFile), so I was looking into related changes and found https://github.com/microsoft/TypeScript/pull/50266/files#diff-044e53f5c31ee19a4e3fca606c4b4ab8d5618ec9b740aa2e01960a8fbbad6eb2R1288

If you compare the change with the preivous lines:
https://github.com/microsoft/TypeScript/pull/50266/files#diff-044e53f5c31ee19a4e3fca606c4b4ab8d5618ec9b740aa2e01960a8fbbad6eb2L1282

it turns out that visitLexicalEnvironment(node.statements, visitor, context, /start/ undefined, /ensureUseStrict/ undefined, nodesVisitor));
got some more parameters, especially the "nodesVisitor".

If I remove this paramter again, all things are working again! Therefore I assume this is a bug, but please double check my findings :)

🙁 Actual behavior

Not traversing the tree correctly.

🙂 Expected behavior

Should work like in ts 4.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: TransformsRelates to the public transform APIFix AvailableA PR has been opened for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions