Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  call-any-native.js

  Sprache: JAVA
 

// Test non-constructor calls

var funcs = [Math.max, Math.min, Math.floor, Math.ceil, Math.sin,
             Math.cos, Math.tan, Math.log, Math.acos, Math.asin];

// Calculate expected values
var expected = [Math.max(0.52), Math.min(0.52),
                Math.floor(0.52), Math.ceil(0.52),
                Math.sin(0.52), Math.cos(0.52),
                Math.tan(0.52), Math.log(0.52),
                Math.acos(0.52), Math.asin(0.52)];

// Test a polymorphic call site
for (var n = 0; n < 50; n++) {
    for (var i = 0; i < funcs.length; i++) {
        assertEq(funcs[i](0.52), expected[i]);
    }
}

// Test a polymorphic spread call site
var spreadinput = [0.52];
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 in Prozent
C=92 H=81 G=86

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






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik