mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Base: Add test page for exceptions
Created a simple page where you can check that the exceptions appear in the JS console.
This commit is contained in:
parent
40aad77ab1
commit
db23e2d546
Notes:
sideshowbarker
2024-07-17 22:55:25 +09:00
Author: https://github.com/wentwrong Commit: https://github.com/SerenityOS/serenity/commit/db23e2d546 Pull-request: https://github.com/SerenityOS/serenity/pull/15517 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/davidot Reviewed-by: https://github.com/linusg
2 changed files with 44 additions and 0 deletions
43
Base/res/html/misc/exceptions.html
Normal file
43
Base/res/html/misc/exceptions.html
Normal file
|
@ -0,0 +1,43 @@
|
|||
<!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>
|
|
@ -177,6 +177,7 @@
|
|||
<li><a href="worker_parent.html">Workers</a></li>
|
||||
<li><a href="storage.html">Web Storage API</a></li>
|
||||
<li><a href="private-element-test.html">Test for rejecting private elements on special objects</a></li>
|
||||
<li><a href="exceptions.html">Exceptions</a></li>
|
||||
<li><h3>Canvas</h3></li>
|
||||
<li><a href="canvas.html">canvas 2D test</a></li>
|
||||
<li><a href="canvas-rotate.html">canvas rotate()</a></li>
|
||||
|
|
Loading…
Reference in a new issue