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

Quelle  for-in-proto-properties.js

  Sprache: JAVA
 

function testNonEnumerableVisited() {
    // Non-enumerable properties must still be included in the duplicate-property
    // checking.

    var proto1 = Object.create(null);
    Object.defineProperty(proto1, "x", {enumerable: true, value: 1});

    var proto2 = Object.create(proto1);
    Object.defineProperty(proto2, "x", {enumerable: false, value: 1});

    for (var p in proto2) {
        throw "Shouldn't enumerate any properties";
    }

    var o = Object.create(proto2);
    for (var p in o) {
        throw "Shouldn't enumerate any properties";
    }
}
testNonEnumerableVisited();

function testEnumerableOnProto() {
    var iter = o => {
        var props = [];
        for (var p in o) { props.push(p); }
        return props;
    };

    // Test dense elements on the proto chain are included.
    var props = iter(Object.create({01}));
    assertEq(JSON.stringify(props), '["0"]');

    // Test typed array elements on the proto chain are included.
    props = iter(Object.create(new Int32Array(2)));
    assertEq(JSON.stringify(props), '["0","1"]');

    // Test sparse elements on the proto chain are included.
    props = iter(Object.create({12345671}));
    assertEq(JSON.stringify(props), '["1234567"]');
}
testEnumerableOnProto();

Messung V0.5 in Prozent
C=92 H=75 G=83

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

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