PageRenderTime 16ms CodeModel.GetById 11ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/js/src/jit-test/tests/debug/Object-deleteProperty-error-01.js

http://github.com/zpao/v8monkey
JavaScript | 16 lines | 12 code | 3 blank | 1 comment | 0 complexity | e79eee1e96654eb736cb4358fdbe3fa9 MD5 | raw file
 1// Don't crash when a scripted proxy handler throws Error.prototype.
 2
 3var g = newGlobal('new-compartment');
 4var dbg = Debugger(g);
 5dbg.onDebuggerStatement = function (frame) {
 6    try {
 7        frame.arguments[0].deleteProperty("x");
 8    } catch (exc) {
 9        return;
10    }
11    throw new Error("deleteProperty should throw");
12};
13
14g.eval("function h(x) { debugger; }");
15g.eval("h(Proxy.create({delete: function () { throw Error.prototype; }}));");
16