summaryrefslogtreecommitdiff
path: root/ext/mixed/js/text-scanner.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-11-08 22:19:54 -0500
committerGitHub <noreply@github.com>2020-11-08 22:19:54 -0500
commit8edb478d0adbc7c09e827f1606f9e7a6660dec65 (patch)
treed7776da1117456d94b2ef8861150637eca60143d /ext/mixed/js/text-scanner.js
parent681065e5549e3f6bf54e416120884481bded5b6e (diff)
Update keyboard/mouse modifiers to return an array rather than a set (#1015)
Diffstat (limited to 'ext/mixed/js/text-scanner.js')
-rw-r--r--ext/mixed/js/text-scanner.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/mixed/js/text-scanner.js b/ext/mixed/js/text-scanner.js
index f4b8df68..189afd07 100644
--- a/ext/mixed/js/text-scanner.js
+++ b/ext/mixed/js/text-scanner.js
@@ -817,11 +817,12 @@ class TextScanner extends EventDispatcher {
_getMatchingInputGroup(modifiers, type) {
let fallback = null;
+ const modifiersSet = new Set(modifiers);
for (let i = 0, ii = this._inputs.length; i < ii; ++i) {
const input = this._inputs[i];
const {include, exclude, types} = input;
if (!types.has(type)) { continue; }
- if (this._setHasAll(modifiers, include) && (exclude.length === 0 || !this._setHasAll(modifiers, exclude))) {
+ if (this._setHasAll(modifiersSet, include) && (exclude.length === 0 || !this._setHasAll(modifiersSet, exclude))) {
if (include.length > 0) {
return {index: i, empty: false, input};
} else if (fallback === null) {