Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/debug/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 935 B image not shown  

Quelle  optimized-out-arrow-this.js

  Sprache: JAVA
 

var g = newGlobal({newCompartment: true});
var dbg = new Debugger(g);

g.eval(`
function f() {
  // |this| in arrow-functions refers to the |this| binding in outer functions.
  // So when |frame.eval("this")| is executed, the outer |this| binding should
  // be returned, unless it has been optimised out.
  (() => {})();

  // Ensure a |this| binding is created for |f|.
  return this;
}
`);

var errors = [];

function enterFrame(frame) {
  // Disable the handler so we don't call it recursively through |frame.eval|.
  dbg.onEnterFrame = undefined;

  // Store the error when resolving |this| was unsuccessful.
  var r = frame.eval("this");
  if (r.throw) {
    errors.push(r.throw);
  }

  // Re-enable the handler.
  dbg.onEnterFrame = enterFrame;
};

dbg.onEnterFrame = enterFrame;

g.f();

assertEq(errors.length, 1);
assertEq(errors[0].unsafeDereference().toString(),
         "Error: variable 'this' has been optimized out");

Messung V0.5 in Prozent
C=80 H=100 G=90

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

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