summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testDeepBailFromHasInstance.js
blob: 33646da6c49cd6c5bcd8d723bd9fb2e8d01b332a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
var arr = [StopIteration, StopIteration, StopIteration, StopIteration, {}];
var obj = {};
var x;
var result = 'no error';
try {
    for (var i = 0; i < arr.length; i++)
        x = (obj instanceof arr[i]);  // last iteration throws, triggering deep bail
} catch (exc) {
    result = exc.constructor.name;
}
assertEq(result, 'TypeError');