mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Lint (remove logs, add spaces)
This commit is contained in:
parent
3712b6fe72
commit
4bf5f85d9a
7 changed files with 12 additions and 40 deletions
|
@ -826,8 +826,6 @@ class Boost {
|
|||
* Disconnects from the current BLE socket and resets state.
|
||||
*/
|
||||
disconnect () {
|
||||
console.log('BOOST DISCONNECT CALLED');
|
||||
|
||||
if (this._ble) {
|
||||
this._ble.disconnect();
|
||||
}
|
||||
|
@ -839,8 +837,6 @@ class Boost {
|
|||
* Reset all the state and timeout/interval ids.
|
||||
*/
|
||||
reset () {
|
||||
console.log('BOOST RESET CALLED');
|
||||
|
||||
this._ports = [];
|
||||
this._motors = [];
|
||||
this._sensors = {
|
||||
|
|
|
@ -599,9 +599,7 @@ class EV3 {
|
|||
/**
|
||||
* Called by the runtime when user wants to disconnect from the EV3 peripheral.
|
||||
*/
|
||||
disconnect() {
|
||||
console.log('EV3 DISCONNECT CALLED');
|
||||
|
||||
disconnect () {
|
||||
if (this._bt) {
|
||||
this._bt.disconnect();
|
||||
}
|
||||
|
@ -612,9 +610,7 @@ class EV3 {
|
|||
/**
|
||||
* Reset all the state and timeout/interval ids.
|
||||
*/
|
||||
reset() {
|
||||
console.log('EV3 RESET CALLED');
|
||||
|
||||
reset () {
|
||||
this._sensorPorts = [];
|
||||
this._motorPorts = [];
|
||||
this._sensors = {
|
||||
|
|
|
@ -209,9 +209,7 @@ class GdxFor {
|
|||
* Called by the runtime when a user exits the connection popup.
|
||||
* Disconnect from the GDX FOR.
|
||||
*/
|
||||
disconnect() {
|
||||
console.log('GDXFOR DISCONNECT CALLED');
|
||||
|
||||
disconnect () {
|
||||
if (this._ble) {
|
||||
this._ble.disconnect();
|
||||
}
|
||||
|
@ -223,8 +221,6 @@ class GdxFor {
|
|||
* Reset all the state and timeout/interval ids.
|
||||
*/
|
||||
reset () {
|
||||
console.log('GDXFOR RESET CALLED');
|
||||
|
||||
this._sensors = {
|
||||
force: 0,
|
||||
accelerationX: 0,
|
||||
|
|
|
@ -238,9 +238,7 @@ class MicroBit {
|
|||
/**
|
||||
* Disconnect from the micro:bit.
|
||||
*/
|
||||
disconnect() {
|
||||
console.log('MICROBIT DISCONNECT CALLED');
|
||||
|
||||
disconnect () {
|
||||
if (this._ble) {
|
||||
this._ble.disconnect();
|
||||
}
|
||||
|
@ -251,9 +249,7 @@ class MicroBit {
|
|||
/**
|
||||
* Reset all the state and timeout/interval ids.
|
||||
*/
|
||||
reset() {
|
||||
console.log('MICROBIT RESET CALLED');
|
||||
|
||||
reset () {
|
||||
if (this._timeoutID) {
|
||||
window.clearTimeout(this._timeoutID);
|
||||
this._timeoutID = null;
|
||||
|
|
|
@ -609,9 +609,7 @@ class WeDo2 {
|
|||
/**
|
||||
* Disconnects from the current BLE socket.
|
||||
*/
|
||||
disconnect() {
|
||||
console.log('WEDO2 DISCONNECT CALLED');
|
||||
|
||||
disconnect () {
|
||||
if (this._ble) {
|
||||
this._ble.disconnect();
|
||||
}
|
||||
|
@ -622,9 +620,7 @@ class WeDo2 {
|
|||
/**
|
||||
* Reset all the state and timeout/interval ids.
|
||||
*/
|
||||
reset() {
|
||||
console.log('WEDO2 RESET CALLED');
|
||||
|
||||
reset () {
|
||||
this._ports = ['none', 'none'];
|
||||
this._motors = [null, null];
|
||||
this._sensors = {
|
||||
|
|
|
@ -72,8 +72,6 @@ class BLE extends JSONRPC {
|
|||
* Close the websocket.
|
||||
*/
|
||||
disconnect () {
|
||||
console.log('BLE DISCONNECT CALLED');
|
||||
|
||||
if (this._connected) {
|
||||
this._connected = false;
|
||||
}
|
||||
|
@ -203,10 +201,8 @@ class BLE extends JSONRPC {
|
|||
* Disconnect the socket, and if the extension using this socket has a
|
||||
* reset callback, call it. Finally, emit an error to the runtime.
|
||||
*/
|
||||
handleDisconnectError (e) {
|
||||
console.error(`BLE error: ${JSON.stringify(e)}`);
|
||||
console.error(e);
|
||||
console.log('BLE HANDLEDISCONNECTERROR CALLED');
|
||||
handleDisconnectError (/* e */) {
|
||||
// log.error(`BLE error: ${JSON.stringify(e)}`);
|
||||
|
||||
if (!this._connected) return;
|
||||
|
||||
|
|
10
src/io/bt.js
10
src/io/bt.js
|
@ -78,9 +78,7 @@ class BT extends JSONRPC {
|
|||
/**
|
||||
* Close the websocket.
|
||||
*/
|
||||
disconnect() {
|
||||
console.log('BT DISCONNECT CALLED');
|
||||
|
||||
disconnect () {
|
||||
if (this._connected) {
|
||||
this._connected = false;
|
||||
}
|
||||
|
@ -149,10 +147,8 @@ class BT extends JSONRPC {
|
|||
* Disconnect the socket, and if the extension using this socket has a
|
||||
* reset callback, call it. Finally, emit an error to the runtime.
|
||||
*/
|
||||
handleDisconnectError (e) {
|
||||
console.error(`BT error: ${JSON.stringify(e)}`);
|
||||
console.error(e);
|
||||
console.log('BT HANDLEDISCONNECTERROR CALLED');
|
||||
handleDisconnectError (/* e */) {
|
||||
// log.error(`BT error: ${JSON.stringify(e)}`);
|
||||
|
||||
if (!this._connected) return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue