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

Quelle  8.2.1.js

  Sprache: JAVA
 

// |reftest| skip-if(!this.hasOwnProperty("Tuple"))
/*
8.2.1 The Tuple Constructor
The Tuple constructor:

is the intrinsic object %Tuple%.
*/


assertEq(typeof Tuple, "function");
assertEq(typeof Tuple.prototype, "object");

/*
is the initial value of the "Tuple" property of the global object.
*/

assertEq(this.Tuple, Tuple);

/*
creates and initializes a new Tuple object when called as a function.
*/

assertEq(Tuple(), #[]);
assertEq(Tuple(1), #[1]);
assertEq(Tuple("a"1true), #["a"1true]);
/* 8.2.1.1
3. For each element e of items,
a. If Type(e) is Object, throw a TypeError exception.
*/

assertThrowsInstanceOf(() => Tuple("a"new Object()), TypeError,
                       "Object in Tuple");

/*
is not intended to be used with the new operator or to be subclassed.
*/

/* 8.2.1.1
1. If NewTarget is not undefined, throw a TypeError exception.
*/

assertThrowsInstanceOf(() => new Tuple(123), TypeError, "Tuple is not intended to be used with the new operator");


/* It may be used as the value of an extends clause of a class definition but a super call to the Tuple constructor will cause an exception.
*/

class C extends Tuple{}; // class declaration is allowed
// super() is called implicitly
assertThrowsInstanceOf (() => new C(), TypeError, "super call to Tuple constructor");
class D extends Tuple {
    constructor() {
        super();
    }
};
// Explicit call to super() will also throw
assertThrowsInstanceOf(() => new D(), TypeError, "super call to Tuple constructor");

reportCompare(00);




Messung V0.5 in Prozent
C=83 H=100 G=91

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