Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/layout/reftests/css-valid/input/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

 test_union_nullable.py   Interaktion und
Portierbarkeitunbekannt

 
import WebIDL


def WebIDLTest(parser, harness):
    threw = False
    try:
        parser.parse(
            """
            interface OneNullableInUnion {
              undefined foo((object? or DOMString?) arg);
            };
        """
        )

        parser.finish()
    except WebIDL.WebIDLError:
        threw = True

    harness.ok(threw, "Two nullable member types of a union should have thrown.")

    parser.reset()
    threw = False

    try:
        parser.parse(
            """
            interface NullableInNullableUnion {
              undefined foo((object? or DOMString)? arg);
            };
        """
        )

        parser.finish()
    except WebIDL.WebIDLError:
        threw = True

    harness.ok(
        threw,
        "A nullable union type with a nullable member type should have " "thrown.",
    )

    parser.reset()
    threw = False

    try:
        parser.parse(
            """
            interface NullableInUnionNullableUnionHelper {
            };
            interface NullableInUnionNullableUnion {
              undefined foo(((object? or DOMString) or NullableInUnionNullableUnionHelper)? arg);
            };
        """
        )

        parser.finish()
    except WebIDL.WebIDLError:
        threw = True

    harness.ok(
        threw,
        "A nullable union type with a nullable member type should have " "thrown.",
    )

Messung V0.5
C=94 H=99 G=96

[ Konzepte0.2Was zu einem Entwurf gehört  Wie die Entwicklung von Software durchgeführt wird  ]