Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  bug1941446.js

  Sprache: JAVA
 

function generateObjectLiteral(propCount, computedPropCount) {
  const parts = [];

  for (let i = 0; i < propCount; i++) {
    parts.push(`prop${i}: ${i}`);
  }

  for (let i = 0; i < computedPropCount; i++) {
    parts.push(`["computedProp${i}"]: ${i}`);
  }

  return `let obj = {${parts.join(",")}}`;
}

function assertPropCount(obj, count) {
  assertEq(Object.keys(obj).length === count, true);
}

const objectSizes = [0124816255256];

// objects with computed properties only
function testComputedProperties() {
  for (let numOfProps of objectSizes) {
    let obj = Function(
      `${generateObjectLiteral(0, numOfProps)}; return obj;`
    ).call();
    assertPropCount(obj, numOfProps);
  }
}

// objects with one computed properties and the rest are normal;
function testMixedProperties() {
  for (let numOfProps of objectSizes) {
    let obj = Function(
      `${generateObjectLiteral(numOfProps, 1)}; return obj;`
    ).call();
    assertPropCount(obj, numOfProps + 1);
  }
}

// objects with normal properties only
function testNormalProperties() {
  for (let numOfProps of objectSizes) {
    let obj = Function(
      `${generateObjectLiteral(numOfProps, 0)}; return obj;`
    ).call();
    assertPropCount(obj, numOfProps);
  }
}

testNormalProperties();
testMixedProperties();
testComputedProperties();

Messung V0.5 in Prozent
C=92 H=50 G=73

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© 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.