Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.9 regression for visitEachChild #51542

Closed
simllll opened this issue Nov 15, 2022 · 2 comments · Fixed by #51543
Closed

4.9 regression for visitEachChild #51542

simllll opened this issue Nov 15, 2022 · 2 comments · Fixed by #51543
Labels
Bug A bug in TypeScript Domain: Transforms Relates to the public transform API Fix Available A PR has been opened for this issue

Comments

@simllll
Copy link
Contributor

simllll commented Nov 15, 2022

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

@samchon
Copy link

samchon commented Nov 25, 2022

@rbuckton @DanielRosenwasser may I ask you that when the TS 4.9.4 patch being published?

@DanielRosenwasser
Copy link
Member

Should be out now. Thanks for the patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Transforms Relates to the public transform API Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants