summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-03-28 10:27:48 +0100
committerAndreas Kling <kling@serenityos.org>2020-03-28 10:27:48 +0100
commit0cbbf6f5ebf6ea074d640063c6a964247b4bbc62 (patch)
tree6327da61e98565c7b1aad67132aef4d44c34852c
parentc50fbf6da06b1296d760fd983a3ca19ebccbe02b (diff)
downloadserenity-0cbbf6f5ebf6ea074d640063c6a964247b4bbc62.zip
LibJS: Add a tiny little test for the ReferenceError exception
-rw-r--r--Libraries/LibJS/Tests/exception-ReferenceError.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/Libraries/LibJS/Tests/exception-ReferenceError.js b/Libraries/LibJS/Tests/exception-ReferenceError.js
new file mode 100644
index 0000000000..2fe47e25a9
--- /dev/null
+++ b/Libraries/LibJS/Tests/exception-ReferenceError.js
@@ -0,0 +1,9 @@
+function assert(x) { if (!x) console.log("FAIL"); }
+
+try {
+ i < 3;
+} catch (e) {
+ assert(e.name === "ReferenceError");
+}
+
+console.log("PASS");