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