From c72e70fb181bd841407d10f79c0cd23e89baeb9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Tue, 18 Jul 2023 23:19:27 +0200 Subject: [PATCH] Fix a false JSError reported by Phantomas --- modules/domQueries/scope.js | 2 +- test/webroot/js-errors.html | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/domQueries/scope.js b/modules/domQueries/scope.js index 5ebdb7410..7ee1e9f28 100644 --- a/modules/domQueries/scope.js +++ b/modules/domQueries/scope.js @@ -58,7 +58,7 @@ var context = phantomas.getDOMPath(this); // querying by BODY and body is the same (issue #419) - tagName = tagName.toLowerCase(); + if (tagName) tagName = tagName.toLowerCase(); phantomas.incrMetric("DOMqueriesByTagName"); phantomas.addOffender("DOMqueriesByTagName", { diff --git a/test/webroot/js-errors.html b/test/webroot/js-errors.html index fc92bf1d3..d253e8626 100644 --- a/test/webroot/js-errors.html +++ b/test/webroot/js-errors.html @@ -9,4 +9,11 @@ // and this one too, but the execution will never reach this linen window.Foo('test'); +