mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +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,
|
self.EventTarget.prototype.addEventListener,
|
||||||
{
|
{
|
||||||
apply: function(target, thisArg, args) {
|
apply: function(target, thisArg, args) {
|
||||||
const type = args[0].toString();
|
const type = String(args[0]);
|
||||||
const handler = String(args[1]);
|
const handler = String(args[1]);
|
||||||
if (
|
if (
|
||||||
needle1.test(type) === false ||
|
needle1.test(type) === false ||
|
||||||
@ -238,7 +238,7 @@
|
|||||||
self.EventTarget.prototype.addEventListener,
|
self.EventTarget.prototype.addEventListener,
|
||||||
{
|
{
|
||||||
apply: function(target, thisArg, args) {
|
apply: function(target, thisArg, args) {
|
||||||
const type = args[0].toString();
|
const type = String(args[0]);
|
||||||
const handler = String(args[1]);
|
const handler = String(args[1]);
|
||||||
log('uBO: addEventListener("%s", %s)', type, handler);
|
log('uBO: addEventListener("%s", %s)', type, handler);
|
||||||
return target.apply(thisArg, args);
|
return target.apply(thisArg, args);
|
||||||
|
Loading…
Reference in New Issue
Block a user