summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-deleteProperty-error-02.js
blob: e685b93f46466104bcab20baedbe2818fdea09b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var g = newGlobal({newCompartment: true});
var dbg = Debugger(g);
dbg.onDebuggerStatement = function (frame) {
    try {
        frame.arguments[0].deleteProperty("x");
    } catch (exc) {
        assertEq(exc instanceof Debugger.DebuggeeWouldRun, true);
        return;
    }
    throw new Error("deleteProperty should throw");
};

g.evaluate("function h(obj) { debugger; } \n" +
           "h(new Proxy({}, \n" +
           "            { deleteProperty: function () { \n" +
           "                var e = new ReferenceError('diaf', 'fail'); \n" +
           "                throw e; \n" +
           "              } \n" +
           "            }));");