/* isnotintendedtobeusedwiththenewoperatorortobesubclassed.
*/ /* 8.2.1.1 1.IfNewTargetisnotundefined,throwaTypeErrorexception.
*/
assertThrowsInstanceOf(() => new Tuple(1, 2, 3), 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");
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.