Skip to content

Commit

Permalink
static mc -> instance mc
Browse files Browse the repository at this point in the history
  • Loading branch information
flashdesignory committed Dec 20, 2024
1 parent 110c94a commit fd6dd12
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions resources/shared/test-invoker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ class RAFTestInvoker extends BaseRAFTestInvoker {
}

class AsyncRAFTestInvoker extends BaseRAFTestInvoker {
static mc = new MessageChannel();
constructor(syncCallback, asyncCallback, reportCallback, params) {
super(syncCallback, asyncCallback, reportCallback, params);
this.mc = new MessageChannel();
}
_scheduleCallbacks(resolve) {
let gotTimer = false;
let gotMessage = false;
Expand Down Expand Up @@ -63,16 +66,16 @@ class AsyncRAFTestInvoker extends BaseRAFTestInvoker {
tryTriggerAsyncCallback();
});

AsyncRAFTestInvoker.mc.port1.addEventListener(
this.mc.port1.addEventListener(
"message",
function () {
gotMessage = true;
tryTriggerAsyncCallback();
},
{ once: true }
);
AsyncRAFTestInvoker.mc.port1.start();
AsyncRAFTestInvoker.mc.port2.postMessage("speedometer");
this.mc.port1.start();
this.mc.port2.postMessage("speedometer");
});
}
}
Expand Down

0 comments on commit fd6dd12

Please sign in to comment.