mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
db23e2d546
Created a simple page where you can check that the exceptions appear in the JS console.
43 lines
1.2 KiB
HTML
43 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<title>Exceptions</title>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="test"></div>
|
|
<p>The following uncaught exceptions should be shown in the browser JS console:</p>
|
|
<ul>
|
|
<li>DOMException</li>
|
|
<li>SyntaxError</li>
|
|
<li>TypeError</li>
|
|
<li>ReferenceError</li>
|
|
<li>JS error thrown from an external script file</li>
|
|
<li>Unhandled promise rejection</li>
|
|
</ul>
|
|
<script>
|
|
// throws uncaught DOMException
|
|
document.getElementById("test").setAttribute("", "");
|
|
</script>
|
|
<script>
|
|
// throws uncaught SyntaxError
|
|
1 = 1
|
|
</script>
|
|
<script>
|
|
// throws uncaught TypeError
|
|
const a = 1;
|
|
a = 2;
|
|
</script>
|
|
<script>
|
|
// throws uncaught ReferenceError
|
|
xxx;
|
|
</script>
|
|
<script src="exceptions.js"></script>
|
|
<script>
|
|
Promise.resolve().then(() => {
|
|
throw "Unhandled promise rejection";
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|