From 3cc3914a5c157cc2c710b3fbb3a9539961fd6e6a Mon Sep 17 00:00:00 2001 From: Evan Niessen-Derry Date: Wed, 29 Jun 2016 22:18:04 -0500 Subject: [PATCH] Fixed the completion display issues Fat-arrow function syntax has a lexical `this`, which causes `this.groups` to be undefined, throwing an error upon sourcing. I believe this is because it's pulling the `this` variable from the object syntax constructor immediately surrounding it, instead of from the completion.noscriptSites function, but I'm not positive. --- plugins/noscript.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/noscript.js b/plugins/noscript.js index eab95e97..0a475ec6 100755 --- a/plugins/noscript.js +++ b/plugins/noscript.js @@ -188,8 +188,10 @@ completion.noscriptSites = function (context) { context.generate = getSites; context.keys = { text: util.identity, - description: site => groupDesc[this.highlight] + - (this.groups.untrusted && this.highlight != "NoScriptUntrusted" ? " (untrusted)" : ""), + description: function (site) { + return groupDesc[this.highlight] + + (this.groups.untrusted && this.highlight != "NoScriptUntrusted" ? " (untrusted)" : "") + }, highlight: function (site) { return this.groups.temp ? "NoScriptTemp" :