summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/reflect-parse/builderExceptions.js
blob: d22ab473fe5939d196821ec74e5708649018b62f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// |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")
        throw e;
    thrown = true;
}
if (!thrown)
    throw new Error("builder exception not propagated");

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