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

Quelle  argumentsList-many.js

  Sprache: JAVA
 

/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/licenses/publicdomain/ */


// SKIP test262 export
// Testing unspecified implementation limits.

// Tests for the argumentList argument to Reflect.apply and Reflect.construct.
// Many arguments can be passed.
var many = 65537;
var args = {length: many, 0"zero", [many - 1]: "last"};
function testMany(...args) {
    for (var i = 0; i < many; i++) {
        assertEq(i in args, true);
        assertEq(args[i], i === 0 ? "zero" : i === many - 1 ? "last" : undefined);
    }
    return this;
}
assertEq(Reflect.apply(testMany, "pass", args).toString(), "pass");
assertEq(Reflect.construct(testMany, args) instanceof testMany, true);
assertEq(Reflect.apply(new Proxy(testMany, {}), "pass", args).toString(), "pass");
assertEq(Reflect.construct(new Proxy(testMany, {}), args) instanceof testMany, true);

// If argumentsList.length is unreasonably huge, we get an error.
// (This is an implementation limit.)
var BOTH = [
    Reflect.apply,
    // Adapt Reflect.construct to accept the same arguments as Reflect.apply.
    (target, thisArgument, argumentList) => Reflect.construct(target, argumentList)
];

for (var method of BOTH) {
    for (var value of [1e12, 1e240, Infinity]) {
        assertThrowsInstanceOf(() => method(count, undefined, {length: value}),
                               Error);
    }
}

reportCompare(00);

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

¤ Dauer der Verarbeitung: 0.11 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.