Skip to content

Commit

Permalink
Break if request null
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwhit committed May 9, 2024
1 parent e5f0f6d commit 6d8b438
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cli/tsc/99_main_compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -1096,8 +1096,11 @@ delete Object.prototype.__proto__;
}

/** @typedef {[[string, number][], number, boolean] } PendingChange */
/**
* @template T
* @typedef {T | null} Option<T> */

/** @returns {Promise<[number, string, any[], PendingChange | null]>} */
/** @returns {Promise<[number, string, any[], Option<PendingChange>] | null>} */
async function pollRequests() {
return await ops.op_poll_requests();
}
Expand All @@ -1116,6 +1119,9 @@ delete Object.prototype.__proto__;

while (true) {
const request = await pollRequests();
if (request === null) {
break;
}
try {
serverRequest(request[0], request[1], request[2], request[3]);
} catch (err) {
Expand Down

0 comments on commit 6d8b438

Please sign in to comment.