From 975d89441907f694303f21bd717ec80fa15a0d02 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 16 Jul 2020 09:55:06 -0400 Subject: [PATCH] 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`. --- assets/resources/scriptlets.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/resources/scriptlets.js b/assets/resources/scriptlets.js index faca87a89..537190e3c 100644 --- a/assets/resources/scriptlets.js +++ b/assets/resources/scriptlets.js @@ -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);