2020-04-13 17:31:13 +00:00
|
|
|
load("test-common.js");
|
|
|
|
|
2020-03-25 15:09:23 +00:00
|
|
|
try {
|
|
|
|
throw 1;
|
2020-04-13 13:11:09 +00:00
|
|
|
assertNotReached();
|
2020-03-25 15:09:23 +00:00
|
|
|
} catch (e) {
|
|
|
|
assert(e === 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
throw [99];
|
2020-04-13 13:11:09 +00:00
|
|
|
assertNotReached();
|
2020-03-25 15:09:23 +00:00
|
|
|
} catch (e) {
|
|
|
|
assert(typeof e === "object");
|
|
|
|
assert(e.length === 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
function foo() {
|
|
|
|
throw "hello";
|
2020-04-13 13:11:09 +00:00
|
|
|
assertNotReached();
|
2020-03-25 15:09:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
foo();
|
2020-04-13 13:11:09 +00:00
|
|
|
assertNotReached();
|
2020-03-25 15:09:23 +00:00
|
|
|
} catch (e) {
|
|
|
|
assert(e === "hello");
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log("PASS");
|