FIX: ensures an anonymous shortcut fn can be used globally (#9605)

FIX: ensures an anonymous shortcut fn can be used globally (#9605)

diff --git a/app/assets/javascripts/discourse/app/lib/keyboard-shortcuts.js b/app/assets/javascripts/discourse/app/lib/keyboard-shortcuts.js
index b9b5ed2..2fe61c5 100644
--- a/app/assets/javascripts/discourse/app/lib/keyboard-shortcuts.js
+++ b/app/assets/javascripts/discourse/app/lib/keyboard-shortcuts.js
@@ -494,7 +494,7 @@ export default {
   _globalBindToFunction(func, binding) {
     let funcToBind = typeof func === "function" ? func : this[func];
     if (typeof funcToBind === "function") {
-      this.keyTrapper.bindGlobal(binding, this[func].bind(this));
+      this.keyTrapper.bindGlobal(binding, funcToBind.bind(this));
     }
   },
 

GitHub sha: 2d287ef1

This commit appears in #9605 which was merged by jjaffeux.