* Visits a node, saving and restoring state variables on the stack. * * @param node The node to visit.
(node, f)
| 91639 | * @param node The node to visit. |
| 91640 | */ |
| 91641 | function saveStateAndInvoke(node, f) { |
| 91642 | // Save state |
| 91643 | var savedCurrentScope = currentLexicalScope; |
| 91644 | var savedCurrentNameScope = currentNameScope; |
| 91645 | var savedCurrentScopeFirstDeclarationsOfName = currentScopeFirstDeclarationsOfName; |
| 91646 | var savedCurrentClassHasParameterProperties = currentClassHasParameterProperties; |
| 91647 | // Handle state changes before visiting a node. |
| 91648 | onBeforeVisitNode(node); |
| 91649 | var visited = f(node); |
| 91650 | // Restore state |
| 91651 | if (currentLexicalScope !== savedCurrentScope) { |
| 91652 | currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; |
| 91653 | } |
| 91654 | currentLexicalScope = savedCurrentScope; |
| 91655 | currentNameScope = savedCurrentNameScope; |
| 91656 | currentClassHasParameterProperties = savedCurrentClassHasParameterProperties; |
| 91657 | return visited; |
| 91658 | } |
| 91659 | /** |
| 91660 | * Performs actions that should always occur immediately before visiting a node. |
| 91661 | * |
no test coverage detected
searching dependent graphs…