Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/src/tests/non262/PrivateName/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 969 B image not shown  

Quelle  error-locations.js   Sprache: JAVA

 
// |reftest|
function assertLineAndColumn(str, line, column) {
  try {
    eval(str);
    throw 'didn\'t syntaxerror, bad.'
  } catch (e) {
    assertEq(e instanceof SyntaxError, true);
    assertEq(e.lineNumber, line);
    assertEq(e.columnNumber, column);
  }
}

assertLineAndColumn(`class A { g() { return this.#x; }}`, 1, 29);
// Make sure we're reporting the first error, if there are multiple, in class
// exit context;
assertLineAndColumn(
    `class A { g() { return this.#x; } y() { return       this.#z + this.#y; } }`,
    1, 29);
assertLineAndColumn(`this.#x`, 1, 6);
// Make sure we're reporting the first error, if there are multiple, in
// non-class context;
assertLineAndColumn(`this.#x; this.#y; this.#z`, 1, 6);

assertLineAndColumn(
    `class A {
g() { return this.#x; }}`,
    2, 19);
assertLineAndColumn(
    `class A {

g() { return this.#x; } y() { return this.#y; }}`,
    3, 19);

if (typeof reportCompare === 'function') reportCompare(0, 0);

Messung V0.5
C=86 H=100 G=93

¤ Dauer der Verarbeitung: 0.19 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.