Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/ion/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 767 B image not shown  

Quelle  apply-native-array.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(x) {
  // FunApply to a native function with an array.
  return Array.apply(null, x);
}

// 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(x);
  assertEq(arraysEqual(result, expected), true);
}

Messung V0.5
C=91 H=91 G=90

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