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

Quelle  setelem-hole.js

  Sprache: JAVA
 

// Storing a typed value.
function test1() {
    var a = [];
    for (var i=0; i<130; i++) {
        a[i] = i + 1;
    }
    return a;
}

var arr = test1();
assertEq(arr.length, 130);

for (var i=0; i<130; i++)
    assertEq(arr[i], i + 1);

// Storing a Value.
function getValue(x) {
    var y = x & 0x3;
    if (y == 0return null;
    if (y == 1return true;
    if (y == 2return 1.23;
    if (y == 3return Math;
    assertEq(01);
}
getValue(0);
getValue(1);

function test2() {
    var a = [];
    for (var i=0; i<130; i++) {
        a[i] = getValue(i);
    }
    return a;
}

var arr = test2();
assertEq(arr.length, 130);

for (var i=0; i<130; i++)
    assertEq(arr[i], getValue(i));

// Make sure the length-property is not updated if it's greater than
// the (new) initialized length.
function test3(arr, start, end) {
    for (var i=start; i<end; i++) {
        arr[i] = 10;
    }
}
var a = new Array(200);
test3(a, 10130);
assertEq(a.length, 200);

for (var i=10; i<130; i++)
    assertEq(a[i], 10);

test3(a, 130220);
assertEq(a.length, 220);

// Test constant index.
function test4() {
    var a = [012345];
    for (var i=0; i<150; i++) {
        a[6] = i;
    }
    return a;
}
var arr = test4();
assertEq(arr[6], 149);

Messung V0.5 in Prozent
C=93 H=66 G=80

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet am  2026-06-08) ¤

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