// Test a polymorphic call site for (var n = 0; n < 50; n++) { for (var i = 0; i < funcs.length; i++) {
assertEq(funcs[i](0.5, 2), expected[i]);
}
}
// Test a polymorphic spread call site var spreadinput = [0.5, 2]; for (var n = 0; n < 50; n++) { for (var i = 0; i < funcs.length; i++) {
assertEq(funcs[i](...spreadinput), expected[i]);
}
}
// Test constructors
function f1(x) {this[0] = x; this.length = 3;} function f2(x) {this[0] = x; this.length = 3;} function f3(x) {this[0] = x; this.length = 3;} function f4(x) {this[0] = x; this.length = 3;} function f5(x) {this[0] = x; this.length = 3;} function f6(x) {this[0] = x; this.length = 3;} function f7(x) {this[0] = x; this.length = 3;} function f8(x) {this[0] = x; this.length = 3;} function f9(x) {this[0] = x; this.length = 3;}
var constructors = [f1,f2,f3,f4,f5,f6,f7,f8,f9,Array];
// Test a polymorphic constructor site for (var n = 0; n < 50; n++) { for (var i = 0; i < constructors.length; i++) {
let x = new constructors[i](1,2,3);
assertEq(x.length, 3);
assertEq(x[0], 1);
}
}
var constructorinput = [1,2,3]; // Test a polymorphic spread constructor site for (var n = 0; n < 50; n++) { for (var i = 0; i < constructors.length; i++) {
let x = new constructors[i](...constructorinput);
assertEq(x.length, 3);
assertEq(x[0], 1);
}
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.0 Sekunden
(vorverarbeitet)
¤
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.