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


Quelle  apply-native-arguments.js   Sprache: JAVA

 
load(libdir + "array-compare.js");

const xs = [
  // Zero arguments.
  [],

  // Single argument.
  [1],

  // Few arguments. Even number of arguments.
  [1, 2],

  // Few arguments. Odd number of arguments.
  [1, 2, 3],

  // Many arguments. Even number of arguments.
  [1, 2, 3, 4, 5, 6, 7, 8, 9, 0],

  // Many arguments. Odd number of arguments.
  [1, 2, 3, 4, 5, 6, 7, 8, 9],
];

function f() {
  // FunApply to a native function with frame arguments.
  return Array.apply(null, arguments);
}

// Don't inline |f| into the top-level script.
with ({}) ;

for (let i = 0; i < 400; ++i) {
  let x = xs[i % xs.length];

  // NB: Array(1) creates the array `[,]`.
  let expected = x.length !== 1 ? x : [,];

  let result = f.apply(null, x);
  assertEq(arraysEqual(result, expected), true);
}

Messung V0.5
C=77 H=72 G=74

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge