Fixed the usage of |this| variable in async event handlers callbacks 49/182849/4
authorsurya.kumar7 <surya.kumar7@samsung.com>
Thu, 28 Jun 2018 09:21:49 +0000 (14:51 +0530)
committerMallikarjun Voleti <vm.arjun@samsung.com>
Thu, 28 Jun 2018 09:47:37 +0000 (09:47 +0000)
Updated the usage of |this| variables usage in asynchronous functions

Change-Id: I3a5e8ef13be84369d538f72002737307f1f02ff3
Signed-off-by: surya.kumar7 <surya.kumar7@samsung.com>
wrt/src/runtime.js

index 55b5c27..4d34751 100755 (executable)
@@ -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);
         });
     }
 }