1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 06:34:59 +00:00
serenity/Libraries/LibJS/Tests/throw-basic.js
Brian Gianforcaro bc40908d32 LibJS: Use the native assert() implementation now avaiable in 'js -t'
Switch the LibJS test suite to use the native assert implementation
surfaced inside the js repl when it's launched in test mode.
2020-04-05 15:28:45 +02:00

24 lines
280 B
JavaScript

try {
throw 1;
} catch (e) {
assert(e === 1);
}
try {
throw [99];
} catch (e) {
assert(typeof e === "object");
assert(e.length === 1);
}
function foo() {
throw "hello";
}
try {
foo();
} catch (e) {
assert(e === "hello");
}
console.log("PASS");