{"id":13971693,"date":"2021-01-28T17:51:21","date_gmt":"2021-01-28T17:51:21","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/errors-in-fatal_error_handler\/"},"modified":"2021-01-28T17:51:21","modified_gmt":"2021-01-28T17:51:21","slug":"errors-in-fatal_error_handler","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/errors-in-fatal_error_handler\/","title":{"rendered":"Errors in fatal_error_handler"},"content":{"rendered":"<p>I think the fatal_error_handler code is incorrect.<\/p>\n<p>This registers a global error handler, with <code>window.onerror = function...<\/code>. The handler attempts to match the wording of the error, looking for deprecated jQuery functions.<\/p>\n<p>It uses <code>msg.match()<\/code>, which returns either null or an array, but the code to check for results says:<\/p>\n<p><code>if ( typeof erroredFunction !== &#039;object&#039; || typeof erroredFunction[1] === &quot;undefined&quot; || -1 === jQueryFunctions.indexOf( erroredFunction[1] ) )<\/code><\/p>\n<p>This doesn&#8217;t work when the result is null because <code>typeof null === &quot;object&quot;<\/code> in JavaScript.<\/p>\n","protected":false},"template":"","class_list":["post-13971693","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/13971693","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/13971693\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=13971693"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}