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

Quelle  syntax-error.js   Sprache: JAVA

 
// |reftest| shell-option(--enable-shadow-realms) skip-if(!xulRuntime.shell)

let sr = new ShadowRealm();

try {
    sr.evaluate("var x /");
    assertEq(truefalse"Should have thrown");
catch (e) {
    assertEq(e instanceof SyntaxError, true"Same Global Error")
    assertEq(/unterminated regular expression literal/.test(e.message), true"Should have reported a sensible error message");
}

try {
    sr.evaluate("var x =");
    assertEq(truefalse"Should have thrown");
catch (e) {
    assertEq(e instanceof SyntaxError, true"Same Global Error")
    assertEq(/expected expression/.test(e.message), true"Should have reported a sensible error message");
}


try {
    sr.evaluate("#x in this");
    assertEq(truefalse"Should have thrown");
catch (e) {
    assertEq(e instanceof SyntaxError, true"Same Global Error")
    assertEq(/reference to undeclared private field or method/.test(e.message), true"Should have reported a sensible error message");
}



if (typeof reportCompare === 'function')
    reportCompare(truetrue);

Messung V0.5
C=84 H=96 G=90

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

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