summaryrefslogtreecommitdiffstats
path: root/js/src/tests/js1_8_5/reflect-parse/builderExceptions.js
blob: e8430dbfa41e57294e46b1947f1619efb3c83dd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// |reftest| skip-if(!xulRuntime.shell)
// Ensure that exceptions thrown by builder methods propagate.
var thrown = false;
try {
    Reflect.parse("42", { builder: { program: function() { throw "expected" } } });
} catch (e if e === "expected") {
    thrown = true;
}
if (!thrown)
    throw new Error("builder exception not propagated");

if (typeof reportCompare === 'function')
    reportCompare(true, true);