summaryrefslogtreecommitdiff
path: root/node_modules/@babel/traverse/lib/context.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@babel/traverse/lib/context.js')
-rw-r--r--node_modules/@babel/traverse/lib/context.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/node_modules/@babel/traverse/lib/context.js b/node_modules/@babel/traverse/lib/context.js
index 9aa34f9c..fc9a067a 100644
--- a/node_modules/@babel/traverse/lib/context.js
+++ b/node_modules/@babel/traverse/lib/context.js
@@ -72,7 +72,10 @@ class TraversalContext {
this.priorityQueue = [];
const visited = new WeakSet();
let stop = false;
- for (const path of queue) {
+ let visitIndex = 0;
+ for (; visitIndex < queue.length;) {
+ const path = queue[visitIndex];
+ visitIndex++;
path.resync();
if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== this) {
path.pushContext(this);
@@ -94,8 +97,8 @@ class TraversalContext {
if (stop) break;
}
}
- for (const path of queue) {
- path.popContext();
+ for (let i = 0; i < visitIndex; i++) {
+ queue[i].popContext();
}
this.queue = null;
return stop;