From a1b8945996de29978f3459a61e83b10f1999a0a3 Mon Sep 17 00:00:00 2001 From: eight Date: Tue, 12 Sep 2017 21:28:26 +0800 Subject: [PATCH] Fix: remove try-catch in util.js --- edit/util.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/edit/util.js b/edit/util.js index a04281ae..43325c27 100644 --- a/edit/util.js +++ b/edit/util.js @@ -55,6 +55,7 @@ function dirtyReporter() { } function onChange(cb) { + // make sure the callback doesn't throw onchanges.push(cb); } @@ -67,11 +68,7 @@ function dirtyReporter() { function emitChange() { for (const cb of onchanges) { - try { - cb(); - } catch (e) { - console.error(e); - } + cb(); } }