Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/xpconnect/tests/unit/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  test_bug930091.js

  Sprache: JAVA
 

function checkThrows(fn) {
  try {
    fn();
    ok(false"Should have thrown");
  } catch (e) {
    ok(/denied|insecure|prohibited/.test(e));
  }
}

function run_test() {
  var xosb = new Cu.Sandbox('http://www.example.org');
  var sb = new Cu.Sandbox('http://www.example.com');
  sb.ok = ok;
  sb.fun = function() { ok(false"Shouldn't ever reach me"); };
  sb.cow = { foopy: 2 };
  sb.payload = Cu.evalInSandbox('new Object()', xosb);
  Cu.evalInSandbox(checkThrows.toSource(), sb);
  Cu.evalInSandbox('checkThrows(function() { fun(payload); });', sb);
  Cu.evalInSandbox('checkThrows(function() { Function.prototype.call.call(fun, payload); });', sb);
  Cu.evalInSandbox('checkThrows(function() { Function.prototype.call.call(fun, null, payload); });', sb);
  Cu.evalInSandbox('checkThrows(function() { new fun(payload); });', sb);
  Cu.evalInSandbox('checkThrows(function() { cow.foopy = payload; });', sb);
  Cu.evalInSandbox('checkThrows(function() { Object.defineProperty(cow, "foopy", { value: payload }); });', sb);
  // These fail for a different reason, .bind can't access the length/name property on the function.
  Cu.evalInSandbox('checkThrows(function() { Function.bind.call(fun, null, payload); });', sb);
  Cu.evalInSandbox('checkThrows(function() { Function.bind.call(fun, payload); });', sb);
}

Messung V0.5 in Prozent
C=95 H=99 G=96

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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.