From 12e969119aff23e17068fa36f6a83d8655ced81e Mon Sep 17 00:00:00 2001 From: Kevin Andersen Date: Fri, 12 Apr 2019 14:07:26 -0400 Subject: [PATCH] Simplified the return value for when power is 0 in motorOnForRotation() --- src/extensions/scratch3_boost/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/scratch3_boost/index.js b/src/extensions/scratch3_boost/index.js index 87f1937f1..a791c5bb3 100644 --- a/src/extensions/scratch3_boost/index.js +++ b/src/extensions/scratch3_boost/index.js @@ -1696,7 +1696,7 @@ class Scratch3BoostBlocks { const motor = this._peripheral.motor(portID); if (motor) { // to avoid a hanging block if power is 0, return an immediately resolving promise. - if (motor.power === 0) return new Promise(resolve => resolve()); + if (motor.power === 0) return Promise.resolve(); return new Promise(resolve => { motor.turnOnForDegrees(degrees, sign); motor.pendingPromiseFunction = resolve;