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

Quelle  test_privileged_eval_blocking.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/. */


// Workaround for bug 1973683
add_setup(() => {
  Services.prefs.setBoolPref("extensions.webextensions.remote"true);
  registerCleanupFunction(() => {
    Services.prefs.clearUserPref("extensions.webextensions.remote");
  });
});

add_task(async function () {
  let errorObserved = new Promise(resolve => {
    const listener = {
      observe({ message }) {
        if (message.includes("eval() and eval-like")) {
          Services.console.unregisterListener(listener);
          resolve();
        }
      },
    };
    Services.console.registerListener(listener);
  });

  if (mozinfo.os == "android" && !mozinfo.nightly_build) {
    Assert.equal(
      // eslint-disable-next-line no-eval
      eval("42"),
      42,
      "eval on Android is not disabled yet outside of Nightly"
    );
  } else {
    Assert.throws(
      // eslint-disable-next-line no-eval
      () => eval("42"),
      EvalError,
      "eval() in privileged context should throw"
    );
  }

  await errorObserved;
});

Messung V0.5 in Prozent
C=96 H=100 G=97

¤ 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.