Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/devtools/server/tests/xpcshell/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  test_symbols-02.js   Sprache: JAVA

 
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */


"use strict";

/**
 * Test that we don't run debuggee code when getting symbol names.
 */


const URL = "foo.js";

add_task(
  threadFrontTest(async ({ threadFront, debuggee }) => {
    await testSymbols(threadFront, debuggee);
  })
);

async function testSymbols(threadFront, debuggee) {
  const evalCode = () => {
    /* eslint-disable mozilla/var-only-at-top-level, no-extend-native, no-unused-vars */
    // prettier-ignore
    Cu.evalInSandbox(
      "(" + function () {
        Symbol.prototype.toString = () => {
          throw new Error("lololol");
        };
        var sym = Symbol("le troll");
        debugger;
      } + "())",
      debuggee,
      "1.8",
      URL,
      1
    );
    /* eslint-enable mozilla/var-only-at-top-level, no-extend-native, no-unused-vars */
  };

  const packet = await executeOnNextTickAndWaitForPause(evalCode, threadFront);
  const environment = await packet.frame.getEnvironment();
  const { sym } = environment.bindings.variables;

  equal(sym.value.type, "symbol");
  equal(sym.value.name, "le troll");
}

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

¤ Dauer der Verarbeitung: 0.16 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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.