diff options
author | Andreas Kling <kling@serenityos.org> | 2020-03-28 10:27:48 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-28 10:27:48 +0100 |
commit | 0cbbf6f5ebf6ea074d640063c6a964247b4bbc62 (patch) | |
tree | 6327da61e98565c7b1aad67132aef4d44c34852c /Libraries/LibJS | |
parent | c50fbf6da06b1296d760fd983a3ca19ebccbe02b (diff) | |
download | serenity-0cbbf6f5ebf6ea074d640063c6a964247b4bbc62.zip |
LibJS: Add a tiny little test for the ReferenceError exception
Diffstat (limited to 'Libraries/LibJS')
-rw-r--r-- | Libraries/LibJS/Tests/exception-ReferenceError.js | 9 |
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"); |