Skip to content

Rely on the call stack to clean up cache in _guessExecutionStatusRelativeTo#14649

Merged
nicolo-ribaudo merged 1 commit intobabel:mainfrom
nicolo-ribaudo:minor-refactor-gesrt
Jun 10, 2022
Merged

Rely on the call stack to clean up cache in _guessExecutionStatusRelativeTo#14649
nicolo-ribaudo merged 1 commit intobabel:mainfrom
nicolo-ribaudo:minor-refactor-gesrt

Conversation

@nicolo-ribaudo
Copy link
Copy Markdown
Member

@nicolo-ribaudo nicolo-ribaudo commented Jun 8, 2022

Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

Follow up to #14617 (cc @liuxingbaoyu)

This small refactor simplifies #14617 a bit so that we don't have to manually clean up executionStatusCache and track its "inited" status, but it's handled automatically by the engine. The number of lines of code in introspection.ts is still more or less the same, but the logic has been reduced.

Also, NodePath#_guessExecutionStatusRelativeToDifferentFunctions isn't used anymore so we can remove it in Babel 8.

I suggest reviewing with whitespace diff disabled.

@nicolo-ribaudo nicolo-ribaudo changed the title Rely on the call stack to clean up cache in `_guessExecutionStatusRel… Rely on the call stack to clean up cache in _guessExecutionStatusRelativeTo Jun 8, 2022
@babel-bot
Copy link
Copy Markdown
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/52179/

@liuxingbaoyu
Copy link
Copy Markdown
Member

Great job! Maybe we can make cache a third optional parameter by the way.

@JLHwung JLHwung added the PR: Internal 🏠 A type of pull request used for our changelog categories label Jun 10, 2022
@nicolo-ribaudo nicolo-ribaudo merged commit a5dacd9 into babel:main Jun 10, 2022
@nicolo-ribaudo nicolo-ribaudo deleted the minor-refactor-gesrt branch June 10, 2022 19:26
@nicolo-ribaudo
Copy link
Copy Markdown
Member Author

Great job! Maybe we can make cache a third optional parameter by the way.

I prefer to keep it an internal implementation detail, not exposed to publicly reachable functions.

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Sep 10, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: traverse PR: Internal 🏠 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants