rdar://110740489 See also bug 152294 which did similar for the Web Inspector injected script. Something like this will fail each test: @pytest.mark.parametrize("expression", [ ("Promise.prototype.finally"), ("Promise.race"), ("window.Promise"), ("JSON.stringify"), ]) def test_callback(session, expression): session.url = "about:blank" response = execute_async_script(session, f""" let callback = arguments[0]; delete {expression}; callback('foobar'); """) assert_success(response, "foobar") Bug 204151 practically made this worse by introducing all the references to Promises on the common-path, and it's this case (and specifically with Promise.prototype.finally deleted) which was reported as rdar://110740489.