mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-04 08:37:11 +02:00
Stringify argument using implicit rather than explicit conversion
Reported internally by team. Explicit conversion was causing an exception to be thrown when the type argument was not supporting `toString()`, for example when `type` argument was literal `null`.
This commit is contained in:
parent
a22d4cdd54
commit
975d894419
@ -216,7 +216,7 @@
|
||||
self.EventTarget.prototype.addEventListener,
|
||||
{
|
||||
apply: function(target, thisArg, args) {
|
||||
const type = args[0].toString();
|
||||
const type = String(args[0]);
|
||||
const handler = String(args[1]);
|
||||
if (
|
||||
needle1.test(type) === false ||
|
||||
@ -238,7 +238,7 @@
|
||||
self.EventTarget.prototype.addEventListener,
|
||||
{
|
||||
apply: function(target, thisArg, args) {
|
||||
const type = args[0].toString();
|
||||
const type = String(args[0]);
|
||||
const handler = String(args[1]);
|
||||
log('uBO: addEventListener("%s", %s)', type, handler);
|
||||
return target.apply(thisArg, args);
|
||||
|
Loading…
Reference in New Issue
Block a user