blob: 7d76c93e7871e3a4e5796e90e428ca6485e58a4a [file] [edit]
(function() {
function thrower(n) {
if (n === 0) {
const e = new Error("boom");
e.code = 42;
throw e;
}
return thrower(n - 1);
}
let r = 0;
for (let i = 0; i < 50000; i++) {
try { thrower(40); } catch (e) { r = e.code; }
}
if (r !== 42)
throw new Error("Bad value!");
})();