mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
d0a1775369
Spelling fixes found by `codespell`.
29 lines
866 B
HTML
29 lines
866 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Unhandled Promise rejection with no [[ScriptOrModule]] for the current execution context</title>
|
|
</head>
|
|
<body>
|
|
<button onclick="
|
|
Promise.reject(new Error('Success!'));
|
|
window.timer = setTimeout(() => {
|
|
const element = document.createElement('p');
|
|
element.innerText = 'Did not receive unhandledrejection event in 100ms.';
|
|
element.style.color = 'red';
|
|
document.body.appendChild(element);
|
|
}, 100)
|
|
">
|
|
Click me to cause an unhandled promise rejection.
|
|
</button>
|
|
|
|
<script>
|
|
window.onunhandledrejection = (rejectionEvent) => {
|
|
clearTimeout(window.timer);
|
|
const element = document.createElement("p");
|
|
element.innerText = rejectionEvent.reason.message;
|
|
element.style.color = "green";
|
|
document.body.appendChild(element);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|