Incorrect access of map values
authorAlexander Ebert <ebert@woltlab.com>
Fri, 16 Oct 2020 23:28:23 +0000 (01:28 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 28 Oct 2020 11:29:57 +0000 (12:29 +0100)
wcfsetup/install/files/js/WoltLabSuite/Core/Dom/Traverse.js
wcfsetup/install/files/ts/WoltLabSuite/Core/Dom/Traverse.ts

index 1da77f0476b3b6fa0e10879ec77c6aeae8f462de..82e7a72887bf369d9dd223746219c8b389d393ca 100644 (file)
@@ -23,7 +23,7 @@ define(["require", "exports"], function (require, exports) {
         }
         const children = [];
         for (let i = 0; i < element.childElementCount; i++) {
-            if (_test[type](element.children[i], value)) {
+            if (_test.get(type)(element.children[i], value)) {
                 children.push(element.children[i]);
             }
         }
@@ -38,7 +38,7 @@ define(["require", "exports"], function (require, exports) {
             if (target === untilElement) {
                 return null;
             }
-            if (_test[type](target, value)) {
+            if (_test.get(type)(target, value)) {
                 return target;
             }
             target = target.parentNode;
@@ -50,7 +50,7 @@ define(["require", "exports"], function (require, exports) {
             throw new TypeError('Expected a valid element as first argument.');
         }
         if (element instanceof Element) {
-            if (element[siblingType] !== null && _test[type](element[siblingType], value)) {
+            if (element[siblingType] !== null && _test.get(type)(element[siblingType], value)) {
                 return element[siblingType];
             }
         }
index d57cc855b7becb9e2c60c1bd8da87c1e63017cc1..4ae5e7cf7f5f5ce013e77efb90bc95ca6085e326 100644 (file)
@@ -29,7 +29,7 @@ function _getChildren(element: Element, type: Type, value: string): Element[] {
 
   const children: Element[] = [];
   for (let i = 0; i < element.childElementCount; i++) {
-    if (_test[type](element.children[i], value)) {
+    if (_test.get(type)!(element.children[i], value)) {
       children.push(element.children[i]);
     }
   }
@@ -48,7 +48,7 @@ function _getParent(element: Element, type: Type, value: string, untilElement?:
       return null;
     }
 
-    if (_test[type](target, value)) {
+    if (_test.get(type)!(target, value)) {
       return target;
     }
 
@@ -64,7 +64,7 @@ function _getSibling(element: Element, siblingType: string, type: Type, value: s
   }
 
   if (element instanceof Element) {
-    if (element[siblingType] !== null && _test[type](element[siblingType], value)) {
+    if (element[siblingType] !== null && _test.get(type)!(element[siblingType], value)) {
       return element[siblingType];
     }
   }