Skip to content

Commit

Permalink
test: fix for activities in tick objects prune function
Browse files Browse the repository at this point in the history
PR-URL: nodejs#26163
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
asattelmaier authored and addaleax committed Mar 1, 2019
1 parent e02453c commit 8347dbe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/async-hooks/verify-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ function pruneTickObjects(activities) {
data: null
};

if (!Array.isArray(activities))
return activities;

while (tickObject.found) {
for (let i = 0; i < activities.length; i++) {
if (activities[i].type === 'TickObject') {
tickObject.index = i;
break;
} else if (i + 1 === activities.length) {
} else if (i + 1 >= activities.length) {
tickObject.found = false;
}
}
Expand Down

0 comments on commit 8347dbe

Please sign in to comment.