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.
|
* Disconnects from the current BLE socket and resets state.
|
||||||
*/
|
*/
|
||||||
disconnect () {
|
disconnect () {
|
||||||
console.log('BOOST DISCONNECT CALLED');
|
|
||||||
|
|
||||||
if (this._ble) {
|
if (this._ble) {
|
||||||
this._ble.disconnect();
|
this._ble.disconnect();
|
||||||
}
|
}
|
||||||
|
@ -839,8 +837,6 @@ class Boost {
|
||||||
* Reset all the state and timeout/interval ids.
|
* Reset all the state and timeout/interval ids.
|
||||||
*/
|
*/
|
||||||
reset () {
|
reset () {
|
||||||
console.log('BOOST RESET CALLED');
|
|
||||||
|
|
||||||
this._ports = [];
|
this._ports = [];
|
||||||
this._motors = [];
|
this._motors = [];
|
||||||
this._sensors = {
|
this._sensors = {
|
||||||
|
|
|
@ -599,9 +599,7 @@ class EV3 {
|
||||||
/**
|
/**
|
||||||
* Called by the runtime when user wants to disconnect from the EV3 peripheral.
|
* Called by the runtime when user wants to disconnect from the EV3 peripheral.
|
||||||
*/
|
*/
|
||||||
disconnect() {
|
disconnect () {
|
||||||
console.log('EV3 DISCONNECT CALLED');
|
|
||||||
|
|
||||||
if (this._bt) {
|
if (this._bt) {
|
||||||
this._bt.disconnect();
|
this._bt.disconnect();
|
||||||
}
|
}
|
||||||
|
@ -612,9 +610,7 @@ class EV3 {
|
||||||
/**
|
/**
|
||||||
* Reset all the state and timeout/interval ids.
|
* Reset all the state and timeout/interval ids.
|
||||||
*/
|
*/
|
||||||
reset() {
|
reset () {
|
||||||
console.log('EV3 RESET CALLED');
|
|
||||||
|
|
||||||
this._sensorPorts = [];
|
this._sensorPorts = [];
|
||||||
this._motorPorts = [];
|
this._motorPorts = [];
|
||||||
this._sensors = {
|
this._sensors = {
|
||||||
|
|
|
@ -209,9 +209,7 @@ class GdxFor {
|
||||||
* Called by the runtime when a user exits the connection popup.
|
* Called by the runtime when a user exits the connection popup.
|
||||||
* Disconnect from the GDX FOR.
|
* Disconnect from the GDX FOR.
|
||||||
*/
|
*/
|
||||||
disconnect() {
|
disconnect () {
|
||||||
console.log('GDXFOR DISCONNECT CALLED');
|
|
||||||
|
|
||||||
if (this._ble) {
|
if (this._ble) {
|
||||||
this._ble.disconnect();
|
this._ble.disconnect();
|
||||||
}
|
}
|
||||||
|
@ -223,8 +221,6 @@ class GdxFor {
|
||||||
* Reset all the state and timeout/interval ids.
|
* Reset all the state and timeout/interval ids.
|
||||||
*/
|
*/
|
||||||
reset () {
|
reset () {
|
||||||
console.log('GDXFOR RESET CALLED');
|
|
||||||
|
|
||||||
this._sensors = {
|
this._sensors = {
|
||||||
force: 0,
|
force: 0,
|
||||||
accelerationX: 0,
|
accelerationX: 0,
|
||||||
|
|
|
@ -238,9 +238,7 @@ class MicroBit {
|
||||||
/**
|
/**
|
||||||
* Disconnect from the micro:bit.
|
* Disconnect from the micro:bit.
|
||||||
*/
|
*/
|
||||||
disconnect() {
|
disconnect () {
|
||||||
console.log('MICROBIT DISCONNECT CALLED');
|
|
||||||
|
|
||||||
if (this._ble) {
|
if (this._ble) {
|
||||||
this._ble.disconnect();
|
this._ble.disconnect();
|
||||||
}
|
}
|
||||||
|
@ -251,9 +249,7 @@ class MicroBit {
|
||||||
/**
|
/**
|
||||||
* Reset all the state and timeout/interval ids.
|
* Reset all the state and timeout/interval ids.
|
||||||
*/
|
*/
|
||||||
reset() {
|
reset () {
|
||||||
console.log('MICROBIT RESET CALLED');
|
|
||||||
|
|
||||||
if (this._timeoutID) {
|
if (this._timeoutID) {
|
||||||
window.clearTimeout(this._timeoutID);
|
window.clearTimeout(this._timeoutID);
|
||||||
this._timeoutID = null;
|
this._timeoutID = null;
|
||||||
|
|
|
@ -609,9 +609,7 @@ class WeDo2 {
|
||||||
/**
|
/**
|
||||||
* Disconnects from the current BLE socket.
|
* Disconnects from the current BLE socket.
|
||||||
*/
|
*/
|
||||||
disconnect() {
|
disconnect () {
|
||||||
console.log('WEDO2 DISCONNECT CALLED');
|
|
||||||
|
|
||||||
if (this._ble) {
|
if (this._ble) {
|
||||||
this._ble.disconnect();
|
this._ble.disconnect();
|
||||||
}
|
}
|
||||||
|
@ -622,9 +620,7 @@ class WeDo2 {
|
||||||
/**
|
/**
|
||||||
* Reset all the state and timeout/interval ids.
|
* Reset all the state and timeout/interval ids.
|
||||||
*/
|
*/
|
||||||
reset() {
|
reset () {
|
||||||
console.log('WEDO2 RESET CALLED');
|
|
||||||
|
|
||||||
this._ports = ['none', 'none'];
|
this._ports = ['none', 'none'];
|
||||||
this._motors = [null, null];
|
this._motors = [null, null];
|
||||||
this._sensors = {
|
this._sensors = {
|
||||||
|
|
|
@ -72,8 +72,6 @@ class BLE extends JSONRPC {
|
||||||
* Close the websocket.
|
* Close the websocket.
|
||||||
*/
|
*/
|
||||||
disconnect () {
|
disconnect () {
|
||||||
console.log('BLE DISCONNECT CALLED');
|
|
||||||
|
|
||||||
if (this._connected) {
|
if (this._connected) {
|
||||||
this._connected = false;
|
this._connected = false;
|
||||||
}
|
}
|
||||||
|
@ -203,10 +201,8 @@ class BLE extends JSONRPC {
|
||||||
* Disconnect the socket, and if the extension using this socket has a
|
* Disconnect the socket, and if the extension using this socket has a
|
||||||
* reset callback, call it. Finally, emit an error to the runtime.
|
* reset callback, call it. Finally, emit an error to the runtime.
|
||||||
*/
|
*/
|
||||||
handleDisconnectError (e) {
|
handleDisconnectError (/* e */) {
|
||||||
console.error(`BLE error: ${JSON.stringify(e)}`);
|
// log.error(`BLE error: ${JSON.stringify(e)}`);
|
||||||
console.error(e);
|
|
||||||
console.log('BLE HANDLEDISCONNECTERROR CALLED');
|
|
||||||
|
|
||||||
if (!this._connected) return;
|
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.
|
* Close the websocket.
|
||||||
*/
|
*/
|
||||||
disconnect() {
|
disconnect () {
|
||||||
console.log('BT DISCONNECT CALLED');
|
|
||||||
|
|
||||||
if (this._connected) {
|
if (this._connected) {
|
||||||
this._connected = false;
|
this._connected = false;
|
||||||
}
|
}
|
||||||
|
@ -149,10 +147,8 @@ class BT extends JSONRPC {
|
||||||
* Disconnect the socket, and if the extension using this socket has a
|
* Disconnect the socket, and if the extension using this socket has a
|
||||||
* reset callback, call it. Finally, emit an error to the runtime.
|
* reset callback, call it. Finally, emit an error to the runtime.
|
||||||
*/
|
*/
|
||||||
handleDisconnectError (e) {
|
handleDisconnectError (/* e */) {
|
||||||
console.error(`BT error: ${JSON.stringify(e)}`);
|
// log.error(`BT error: ${JSON.stringify(e)}`);
|
||||||
console.error(e);
|
|
||||||
console.log('BT HANDLEDISCONNECTERROR CALLED');
|
|
||||||
|
|
||||||
if (!this._connected) return;
|
if (!this._connected) return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue