11cb0ef41Sopenharmony_ci<!doctype html> 21cb0ef41Sopenharmony_ci<meta charset="utf-8"> 31cb0ef41Sopenharmony_ci<title>window.event is still set when 'beforeunload' result is coerced to string</title> 41cb0ef41Sopenharmony_ci<link rel="help" href="https://dom.spec.whatwg.org/#ref-for-window-current-event%E2%91%A1"> 51cb0ef41Sopenharmony_ci<link rel="help" href="https://webidl.spec.whatwg.org/#call-a-user-objects-operation"> 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ci<script src="/resources/testharness.js"></script> 81cb0ef41Sopenharmony_ci<script src="/resources/testharnessreport.js"></script> 91cb0ef41Sopenharmony_ci 101cb0ef41Sopenharmony_ci<iframe id="iframe" src="resources/event-global-is-still-set-when-coercing-beforeunload-result-frame.html"></iframe> 111cb0ef41Sopenharmony_ci<body> 121cb0ef41Sopenharmony_ci<script> 131cb0ef41Sopenharmony_ciwindow.onload = () => { 141cb0ef41Sopenharmony_ci async_test(t => { 151cb0ef41Sopenharmony_ci iframe.onload = t.step_func_done(() => { 161cb0ef41Sopenharmony_ci assert_equals(typeof window.currentEventInToString, "object"); 171cb0ef41Sopenharmony_ci assert_equals(window.currentEventInToString.type, "beforeunload"); 181cb0ef41Sopenharmony_ci }); 191cb0ef41Sopenharmony_ci 201cb0ef41Sopenharmony_ci iframe.contentWindow.location.href = "about:blank"; 211cb0ef41Sopenharmony_ci }); 221cb0ef41Sopenharmony_ci}; 231cb0ef41Sopenharmony_ci</script> 24