Skip to content

Commit

Permalink
chore(xsnap): add isReady to replay
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc authored and michaelfig committed Jul 1, 2021
1 parent 430451c commit 66f794b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/xsnap/src/replay.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ export function recordXSnap(options, folderPath, { writeFileSync }) {
const it = xsnap({ ...options, handleCommand });

return freeze({
isReady: async () => {
nextFile('isReady');
return it.isReady();
},
/** @param { Uint8Array } msg */
issueCommand: async msg => {
nextFile('issueCommand').put(msg);
Expand Down Expand Up @@ -215,6 +219,10 @@ export async function replayXSnap(
}
const file = rd.file(step);
switch (kind) {
case 'isReady':
// eslint-disable-next-line no-await-in-loop
await it.isReady();
break;
case 'evaluate':
running = it.evaluate(file.getText());
break;
Expand Down

0 comments on commit 66f794b

Please sign in to comment.