summaryrefslogtreecommitdiff
path: root/node_modules/@babel/traverse/lib/context.js
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-05-14 14:05:49 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-05-14 14:05:49 +0800
commit06823fbf1c2e763a5bf76c3990ca98fbbcd98691 (patch)
tree4280bece3888d12a022093bf1a9cd1b049393602 /node_modules/@babel/traverse/lib/context.js
parent1368909b3cd552dbb0d12d5863c597f5be46177d (diff)
updated node_modules
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;