mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 06:23:37 -05:00
Rename duration timeout setter/getter.
This commit is contained in:
parent
b7e0edcabc
commit
6e6d6140cc
1 changed files with 5 additions and 5 deletions
|
@ -432,7 +432,7 @@ class BoostMotor {
|
|||
*/
|
||||
set status (value) {
|
||||
this._clearRotationState();
|
||||
this._clearTimeout();
|
||||
this._clearDurationTimeout();
|
||||
this._status = value;
|
||||
}
|
||||
|
||||
|
@ -505,7 +505,7 @@ class BoostMotor {
|
|||
milliseconds = Math.max(0, milliseconds);
|
||||
this.status = BoostMotorState.ON_FOR_TIME;
|
||||
this._turnOn();
|
||||
this._setNewTimeout(this.turnOff, milliseconds);
|
||||
this._setNewDurationTimeout(this.turnOff, milliseconds);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -558,7 +558,7 @@ class BoostMotor {
|
|||
* Clear the motor action timeout, if any. Safe to call even when there is no pending timeout.
|
||||
* @private
|
||||
*/
|
||||
_clearTimeout () {
|
||||
_clearDurationTimeout () {
|
||||
if (this._pendingDurationTimeoutId !== null) {
|
||||
clearTimeout(this._pendingDurationTimeoutId);
|
||||
this._pendingDurationTimeoutId = null;
|
||||
|
@ -573,8 +573,8 @@ class BoostMotor {
|
|||
* @param {int} delay - wait this many milliseconds before calling the callback.
|
||||
* @private
|
||||
*/
|
||||
_setNewTimeout (callback, delay) {
|
||||
this._clearTimeout();
|
||||
_setNewDurationTimeout (callback, delay) {
|
||||
this._clearDurationTimeout();
|
||||
const timeoutID = setTimeout(() => {
|
||||
if (this._pendingDurationTimeoutId === timeoutID) {
|
||||
this._pendingDurationTimeoutId = null;
|
||||
|
|
Loading…
Reference in a new issue