From 932a3dc13ad1deac1d886dea61bd5b613a79fee0 Mon Sep 17 00:00:00 2001
From: echicken <>
Date: Mon, 4 Feb 2019 04:46:21 +0000
Subject: [PATCH] 'this' is not scoped correctly in private function, make a
 'self' instead and use it. (For ragnarok)

---
 exec/load/freqit_common.js | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/exec/load/freqit_common.js b/exec/load/freqit_common.js
index cdb57cf414..2e25dcbce6 100644
--- a/exec/load/freqit_common.js
+++ b/exec/load/freqit_common.js
@@ -40,13 +40,14 @@ var FREQIT = {
 		var file=undefined;
 		var count=0;
 
+        const self = this;
 		function handle_list(list) {
 			list.forEach(function(dir) {
-				if (this.dircache[dir] === undefined)
-					this.dircache[dir] = new FileBase(dir);
-				this.dircache[dir].forEach(function(fent) {
+				if (self.dircache[dir] === undefined)
+					self.dircache[dir] = new FileBase(dir);
+				self.dircache[dir].forEach(function(fent) {
 					if (wildmatch(fent.name, match, true))
-						this.add_file(fent.path, cb_data);
+						self.add_file(fent.path, cb_data);
 				});
 			});
 		}
-- 
GitLab