diff --git a/libs/control.js b/libs/control.js index f9453af4..c59e7cfe 100644 --- a/libs/control.js +++ b/libs/control.js @@ -2603,6 +2603,7 @@ control.prototype.playSound = function (sound) { source.noteOn(0); } catch (ee) { + console.log(ee); } } } diff --git a/libs/loader.js b/libs/loader.js index ea6cd51d..d86b3c2c 100644 --- a/libs/loader.js +++ b/libs/loader.js @@ -136,6 +136,7 @@ loader.prototype.loadAnimates = function () { image.src = t2; data.images.push(image); } catch (e) { + console.log(e); data.images.push(null); } } diff --git a/libs/utils.js b/libs/utils.js index 5893a0a2..9557c912 100644 --- a/libs/utils.js +++ b/libs/utils.js @@ -151,7 +151,9 @@ utils.prototype.getLocalStorage = function(key, defaultValue) { try { return JSON.parse(output); } - catch (ee) {} + catch (ee) { + // Ignore, use default value + } } return JSON.parse(value); } diff --git a/main.js b/main.js index 740a0c49..a30bdfbf 100644 --- a/main.js +++ b/main.js @@ -313,7 +313,7 @@ main.prototype.listen = function () { window.onresize = function () { try { main.core.resize(main.dom.body.clientWidth, main.dom.body.clientHeight); - }catch (e) {} + }catch (e) { console.log(e); } } ////// 在界面上按下某按键时 ////// @@ -321,7 +321,7 @@ main.dom.body.onkeydown = function(e) { try { if (main.core.isPlaying() || main.core.status.lockControl) main.core.onkeyDown(e); - } catch (ee) {} + } catch (ee) { console.log(ee); } } ////// 在界面上放开某按键时 ////// @@ -329,7 +329,7 @@ main.dom.body.onkeyup = function(e) { try { if (main.core.isPlaying() || main.core.status.lockControl) main.core.onkeyUp(e); - } catch (ee) {} + } catch (ee) { console.log(ee); } } ////// 开始选择时 ////// @@ -344,7 +344,7 @@ main.dom.data.onmousedown = function (e) { var loc = main.core.getClickLoc(e.clientX, e.clientY); if (loc == null) return; main.core.ondown(loc); - } catch (ee) {} + } catch (ee) { console.log(ee); } } ////// 鼠标移动时 ////// @@ -354,14 +354,14 @@ main.dom.data.onmousemove = function (e) { var loc = main.core.getClickLoc(e.clientX, e.clientY); if (loc == null) return; main.core.onmove(loc); - }catch (ee) {} + }catch (ee) { console.log(ee); } } ////// 鼠标放开时 ////// main.dom.data.onmouseup = function () { try { main.core.onup(); - }catch (e) {} + }catch (e) { console.log(e); } } ////// 鼠标滑轮滚动时 ////// @@ -371,7 +371,7 @@ main.dom.data.onmousewheel = function(e) { main.core.onmousewheel(Math.sign(e.wheelDelta)) else if (e.detail) main.core.onmousewheel(Math.sign(e.detail)); - } catch (ee) {} + } catch (ee) { console.log(ee); } } ////// 手指在触摸屏开始触摸时 ////// @@ -381,7 +381,7 @@ main.dom.data.ontouchstart = function (e) { var loc = main.core.getClickLoc(e.targetTouches[0].clientX, e.targetTouches[0].clientY); if (loc == null) return; main.core.ondown(loc); - }catch (ee) {} + }catch (ee) { console.log(ee); } } ////// 手指在触摸屏上移动时 ////// @@ -391,7 +391,7 @@ main.dom.data.ontouchmove = function (e) { var loc = main.core.getClickLoc(e.targetTouches[0].clientX, e.targetTouches[0].clientY); if (loc == null) return; main.core.onmove(loc); - }catch (ee) {} + }catch (ee) { console.log(ee); } } ////// 手指离开触摸屏时 ////// @@ -400,6 +400,7 @@ main.dom.data.ontouchend = function (e) { e.preventDefault(); main.core.onup(); } catch (e) { + console.log(e); } }