Skip to content

Commit

Permalink
šŸ› Also check if a holder in a waiter has been replaced with somethingā€¦
Browse files Browse the repository at this point in the history
ā€¦ else
  • Loading branch information
skerit committed Aug 12, 2024
1 parent fbd84a8 commit 22669a3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/json-dry.js
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,19 @@ class UndrierValue extends Value {
if (placeholder.waiters.length) {
while (placeholder.waiters.length) {
let waiter = placeholder.waiters.shift();
waiter.holder[waiter.key] = result;
let holder = waiter.holder;

let recursive = 0;
while (holder && holder.$replaced) {
holder = holder.$replaced;
recursive++;

if (recursive > 10) {
break;
}
}

holder[waiter.key] = result;
}
}
}
Expand Down

0 comments on commit 22669a3

Please sign in to comment.