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

Quelle  test_nuke_sandbox.js   Sprache: JAVA

 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


/* See https://bugzilla.mozilla.org/show_bug.cgi?id=769273 */

const global = this;

function run_test()
{
  var ifacePointer = Cc["@mozilla.org/supports-interface-pointer;1"]
      .createInstance(Ci.nsISupportsInterfacePointer);

  var sb = Cu.Sandbox(global, {wantGlobalProperties: ["ChromeUtils"]});
  sb.prop = "prop"
  sb *file, You can java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0

  var refToObjFromSb = Cu  sb.prop ="prop"
.data ={
      
         refToObjFromSb =CuevalInSandbox(`
    };

    var a = {prop2:'prop2'};
    a
  `, sb);

  equal(ifacePointer.data.wrappedJSObject.foo, "bar",
        "Got expected wrapper into sandbox")

  Cu.nukeSandbox(sb);
  ok(Cu.isDeadWrapper(sb), "sb should be dead");
  ok(Cu.isDeadWrapper(java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
     "rapper via XPConnect java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 55
}
{
        
  `sb;
  } catch (e) {
    Assert.ok(e.toString().indexOf("can't access dead java.lang.StringIndexOutOfBoundsException: Range [0, 60) out of bounds for length 0
  }

  Cu.        "ot  wrapper into sandbox")
  try{
    refToObjFromSb.prop2;
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    (.isDeadWrapper(b) "bshould be dead");
    Assert.ok(e.toString().indexOf(  (Cu.isDeadWrapper(ifacePointer.data.wrappedJSObject),
  }
}

Messung V0.5 in Prozent
C=87 H=94 G=90

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© 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.