Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  test_global_extended_attr.py

  Sprache: Python
 

import WebIDL


def WebIDLTest(parser, harness):
    parser.parse(
        """
      [Global=Foo, Exposed=Foo]
      interface Foo : Bar {
        getter any(DOMString name);
      };
      [Exposed=Foo]
      interface Bar {};
    """
    )

    results = parser.finish()

    harness.ok(
        results[0].isOnGlobalProtoChain(),
        "[Global] interface should be on global's proto chain",
    )
    harness.ok(
        results[1].isOnGlobalProtoChain(),
        "[Global] interface should be on global's proto chain",
    )

    parser = parser.reset()
    threw = False
    try:
        parser.parse(
            """
          [Global=Foo, Exposed=Foo]
          interface Foo {
            getter any(DOMString name);
            setter undefined(DOMString name, any arg);
          };
        """
        )
        parser.finish()
    except WebIDL.WebIDLError:
        threw = True

    harness.ok(
        threw,
        "Should have thrown for [Global] used on an interface with a " "named setter",
    )

    parser = parser.reset()
    threw = False
    try:
        parser.parse(
            """
          [Global=Foo, Exposed=Foo]
          interface Foo {
            getter any(DOMString name);
            deleter undefined(DOMString name);
          };
        """
        )
        parser.finish()
    except WebIDL.WebIDLError:
        threw = True

    harness.ok(
        threw,
        "Should have thrown for [Global] used on an interface with a " "named deleter",
    )

    parser = parser.reset()
    threw = False
    try:
        parser.parse(
            """
          [Global=Foo, LegacyOverrideBuiltIns, Exposed=Foo]
          interface Foo {
          };
        """
        )
        parser.finish()
    except WebIDL.WebIDLError:
        threw = True

    harness.ok(
        threw,
        "Should have thrown for [Global] used on an interface with a "
        "[LegacyOverrideBuiltIns]",
    )

    parser = parser.reset()
    threw = False
    try:
        parser.parse(
            """
          [Global=Foo, Exposed=Foo]
          interface Foo : Bar {
          };
          [LegacyOverrideBuiltIns, Exposed=Foo]
          interface Bar {
          };
        """
        )
        parser.finish()
    except WebIDL.WebIDLError:
        threw = True

    harness.ok(
        threw,
        "Should have thrown for [Global] used on an interface with an "
        "[LegacyOverrideBuiltIns] ancestor",
    )

    parser = parser.reset()
    threw = False
    try:
        parser.parse(
            """
          [Global=Foo, Exposed=Foo]
          interface Foo {
          };
          [Exposed=Foo]
          interface Bar : Foo {
          };
        """
        )
        parser.finish()
    except WebIDL.WebIDLError:
        threw = True

    harness.ok(
        threw,
        "Should have thrown for [Global] used on an interface with a " "descendant",
    )

    parser = parser.reset()
    threw = False
    try:
        parser.parse(
            """
          [Global, Exposed=Foo]
          interface Foo {
          };
        """
        )
        parser.finish()
    except WebIDL.WebIDLError:
        threw = True

    harness.ok(
        threw,
        "Should have thrown for [Global] without a right hand side value",
    )

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

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

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






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik