This error is due to the implementation of the Wombat.prototype.overrideDataSet function.
In this function, a JavaScript Proxy object is utilized to override the .dataset attribute of an element.
The problem surfaces when the function wombat.startsWithOneOf assumes that the input is a string and attempts to call the indexOf method.
However, in certain scenarios, the input is not a string, which leads to the following error message:
TypeError: t.indexOf is not a function
at f.startsWithOneOf (wombat.js:1:17613)
at Object.get (wombat.js:1:47412)
at readData (dataset_hasownproperty.js:35:16)
at dataset_hasownproperty.js:53:9
at NodeList.forEach (<anonymous>)
at doCheck (dataset_hasownproperty.js:52:12)
A solution to this problem involves adding a check to confirm that target[prop] is a string before calling the startsWithOneOf function.
This could be implemented with the following code:
var result = target[prop];
if (typeof result === 'string' && wombat.startsWithOneOf(result, wombat.wb_prefixes)) {
return wombat.extractOriginalURL(result);
}
This solution prevents the error by first verifying if result is indeed a string before invoking the startsWithOneOf method. This way, it avoids the error message in cases where result is not a string.
This error is due to the implementation of the Wombat.prototype.overrideDataSet function. In this function, a JavaScript Proxy object is utilized to override the .dataset attribute of an element. The problem surfaces when the function wombat.startsWithOneOf assumes that the input is a string and attempts to call the indexOf method. However, in certain scenarios, the input is not a string, which leads to the following error message:
A solution to this problem involves adding a check to confirm that target[prop] is a string before calling the startsWithOneOf function. This could be implemented with the following code:
This solution prevents the error by first verifying if result is indeed a string before invoking the startsWithOneOf method. This way, it avoids the error message in cases where result is not a string.
hasOwnPropertyIssue.zip