From 07a3e59e3d75df496b520b97ddf30083cbd600f2 Mon Sep 17 00:00:00 2001 From: lichengyin Date: Thu, 12 Nov 2015 18:32:10 +0800 Subject: [PATCH] fix eslint error --- src/index.js | 2 +- src/util/auto_reload.js | 2 +- src/util/watch_compile.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index eef08d8d..459b180e 100644 --- a/src/index.js +++ b/src/index.js @@ -497,7 +497,7 @@ export default class { let reloadInstance = this.getReloadInstance(outPath); this.compileCallback = changedFiles => { reloadInstance.clearFilesCache(changedFiles); - }.bind(this); + }; let WatchCompile = require('./util/watch_compile.js'); let instance = new WatchCompile(srcPath, outPath, log, this.compileCallback); diff --git a/src/util/auto_reload.js b/src/util/auto_reload.js index 46e38384..b843cfbb 100644 --- a/src/util/auto_reload.js +++ b/src/util/auto_reload.js @@ -157,6 +157,6 @@ export default class extends think.base { } }catch(e){} return exportsObj; - } + }; } } \ No newline at end of file diff --git a/src/util/watch_compile.js b/src/util/watch_compile.js index a0fce182..73034793 100644 --- a/src/util/watch_compile.js +++ b/src/util/watch_compile.js @@ -123,8 +123,8 @@ export default class extends think.base { } }); //notify auto reload service to clear file cache - if(changedFiles.length){ - this.callback && this.callback(changedFiles); + if(changedFiles.length && this.callback){ + this.callback(changedFiles); } setTimeout(this.compile.bind(this), 100); }