From fa0541c9fdef27d800843c0136a49fbaa75ce212 Mon Sep 17 00:00:00 2001 From: "surya.kumar7" Date: Thu, 28 Jun 2018 14:51:49 +0530 Subject: [PATCH] Fixed the usage of |this| variable in async event handlers callbacks Updated the usage of |this| variables usage in asynchronous functions Change-Id: I3a5e8ef13be84369d538f72002737307f1f02ff3 Signed-off-by: surya.kumar7 --- wrt/src/runtime.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/wrt/src/runtime.js b/wrt/src/runtime.js index 55b5c27..4d34751 100755 --- a/wrt/src/runtime.js +++ b/wrt/src/runtime.js @@ -29,7 +29,7 @@ class Runtime { }); app.on('will-quit', function(event) { runtime_debug('will-quit'); - this.extensionManager.deactivateAll(app); + _this.extensionManager.deactivateAll(app); return _this.killAllProcesses(); }); app.on('quit', function(event) { @@ -65,15 +65,15 @@ class Runtime { }); app.on('ready', function(event) { runtime_debug('ready'); - this.extensionManager = new ExtensionManager(EXTENSIONS_PATH); + _this.extensionManager = new ExtensionManager(EXTENSIONS_PATH); if (!options.noExtensions) { - this.extensionManager.build(); + _this.extensionManager.build(); } - this.extensionManager.activateAll(app); + _this.extensionManager.activateAll(app); if (wrt.isElectronLaunch()) { return; } - this.webApplication = new WebApplication(options); + _this.webApplication = new WebApplication(options); }); } onPause(web_window_id) { @@ -169,37 +169,37 @@ class Runtime { }); ipcMain.on(IPC_MESSAGE.EXTENSIONS.INSTALLED, (sender, name) => { runtime_debug('handleIpcMessages: INSTALLED ' + name); - this.extensionManager.build(); - return this.extensionManager.activate(app, name); + _this.extensionManager.build(); + return _this.extensionManager.activate(app, name); }); ipcMain.on(IPC_MESSAGE.EXTENSIONS.UNINSTALLED, (sender, name) => { runtime_debug('handleIpcMessages: UNINSTALLED ' + name); - return this.extensionManager.deactivate(app, name); + return _this.extensionManager.deactivate(app, name); }); ipcMain.on(IPC_MESSAGE.EXTENSIONS.ACTIVATE, (sender, name) => { runtime_debug('handleIpcMessages: ACTIVATE ' + name); - return this.extensionManager.activate(app, name); + return _this.extensionManager.activate(app, name); }); ipcMain.on(IPC_MESSAGE.EXTENSIONS.DEACTIVATE, (sender, name) => { runtime_debug('handleIpcMessages: DEACTIVATE ' + name); - return this.extensionManager.deactivate(app, name); + return _this.extensionManager.deactivate(app, name); }); ipcMain.on(IPC_MESSAGE.EXTENSIONS.INSTALLED, (sender, name) => { runtime_debug('handleIpcMessages: INSTALLED ' + name); - this.extensionManager.build(); - return this.extensionManager.activate(app, name); + _this.extensionManager.build(); + return _this.extensionManager.activate(app, name); }); ipcMain.on(IPC_MESSAGE.EXTENSIONS.UNINSTALLED, (sender, name) => { runtime_debug('handleIpcMessages: UNINSTALLED ' + name); - return this.extensionManager.deactivate(app, name); + return _this.extensionManager.deactivate(app, name); }); ipcMain.on(IPC_MESSAGE.EXTENSIONS.ACTIVATE, (sender, name) => { runtime_debug('handleIpcMessages: ACTIVATE ' + name); - return this.extensionManager.activate(app, name); + return _this.extensionManager.activate(app, name); }); ipcMain.on(IPC_MESSAGE.EXTENSIONS.DEACTIVATE, (sender, name) => { runtime_debug('handleIpcMessages: DEACTIVATE ' + name); - return this.extensionManager.deactivate(app, name); + return _this.extensionManager.deactivate(app, name); }); } } -- 2.7.4