function checkDefineThrows(sb, obj, prop, desc) { var result = Cu.evalInSandbox('(function() { try { Object.defineProperty(' + obj + ', "' + prop + '", ' + desc.toSource() + '); return "nothrow"; } catch (e) { return e.toString(); }})();', sb); Assert.notEqual(result, 'nothrow'); Assert.ok(!!/denied|prohibited/.exec(result)); Assert.ok(result.includes(prop)); // Make sure the prop name is in the error message.
}
function run_test() { var chromeSB = new Cu.Sandbox(this); var contentSB = new Cu.Sandbox('http://www.example.org');
Cu.evalInSandbox('(' + setupChromeSandbox.toSource() + ')()', chromeSB);
contentSB.chromeObj = chromeSB.chromeObj;
contentSB.chromeArr = chromeSB.chromeArr;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.