diff --git a/main.ts b/main.ts index a2a97c90a2..e8eb37856a 100644 --- a/main.ts +++ b/main.ts @@ -34,11 +34,13 @@ let startCalled = false; startCalled = true; const msg = pb.Msg.decode(payload); - const cwd = msg.startCwd; - const argv = msg.startArgv; - const debugFlag = msg.startDebugFlag; - const mainJs = msg.startMainJs; - const mainMap = msg.startMainMap; + const { + startCwd: cwd, + startArgv: argv, + startDebugFlag: debugFlag, + startMainJs: mainJs, + startMainMap: mainMap + } = msg; debug = debugFlag; util.log("start", { cwd, argv, debugFlag }); diff --git a/timers.ts b/timers.ts index 136ae745cf..cddb859d9a 100644 --- a/timers.ts +++ b/timers.ts @@ -27,15 +27,14 @@ export function initTimers() { function onMessage(payload: Uint8Array) { const msg = pb.Msg.decode(payload); assert(msg.command === pb.Msg.Command.TIMER_READY); - const id = msg.timerReadyId; - const done = msg.timerReadyDone; - const timer = timers.get(id); + const { timerReadyId, timerReadyDone } = msg; + const timer = timers.get(timerReadyId); if (!timer) { return; } timer.cb(...timer.args); - if (done) { - timers.delete(id); + if (timerReadyDone) { + timers.delete(timerReadyId); } }