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

Quelle  ergonomic-1.js

  Sprache: JAVA
 

class Base {
  constructor(o) {
    return o;
  }
}

class A extends Base {
  #x = 12;
  #y = 13;
  static has(o) {
    return A.evalStr(o, '#x in o');
  }

  static evalStr(o, str) {
    return eval(str);
  }
}

var obj = {};
assertEq(A.has(obj), false);
new A(obj);
assertEq(A.has(obj), true);

A.evalStr(obj, `#x in o in o`)  // 'false' in o

function assertSyntaxError(functionText) {
  let threw = false;
  let exception = undefined;
  try {
    A.evalStr({}, functionText)
  } catch (e) {
    exception = e;
    threw = true;
  }
  assertEq(threw, true);
  assertEq(exception instanceof SyntaxError, true);
}

assertSyntaxError(`#x`);
assertSyntaxError(`#x == undefined`);
assertSyntaxError(`1 + #x in o`)
assertSyntaxError(`#z in o`);

assertSyntaxError(`for (#x in o) { return 1;}`)
assertSyntaxError(`!#x in o`)
assertSyntaxError(`+#x in o`)
assertSyntaxError(`-#x in o`)
assertSyntaxError(`~#x in o`)
assertSyntaxError(`void #x in o`)
assertSyntaxError(`typeof #x in o`)
assertSyntaxError(`++#x in o`)
assertSyntaxError(`--#x in o`)

assertSyntaxError(`#x in #y in o`)
assertSyntaxError(`{} instanceof #x in o`)
assertSyntaxError(`10 > #x in o`)
var threw = true
try {
  eval(`class Async {
    #x;
    async func(o) {
      await #x in o;
    }
  }`);
  threw = false;
catch (e) {
  assertEq(e instanceof SyntaxError, true);
}
assertEq(threw, true);

Messung V0.5 in Prozent
C=94 H=91 G=92

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

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