diff --git a/harness/atomicsHelper.js b/harness/atomicsHelper.js index fc8d63bfc64ff556d42ff4a0706f9f2de7ff79cc..df5141743cc8d7210da47226382be44fbeea3f72 100644 --- a/harness/atomicsHelper.js +++ b/harness/atomicsHelper.js @@ -36,10 +36,10 @@ function getReport() { * @param {Number} expected The number of agents that are expected to report as active. */ function waitUntil(i32a, index, expected) { - while (Atomics.load(i32a, index) !== expected) { + let agents = 0; + while ((agents = Atomics.load(i32a, index)) !== expected) { /* nothing */ } - const agents = Atomics.load(i32a, index); assert.sameValue(agents, expected, `'agents' equals the value of 'expected' (${expected})`); }