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

Quelle  transplant.js   Sprache: JAVA

 
class Base {
  constructor(o) {
    return o;
  }
}

class A extends Base {
  #x = 10;
  static gx(o) {
    return o.#x
  }
  static sx(o, v) {
    o.#x = v;
  }
}

function transplantTest(transplantOptions, global) {
  var {object, transplant} = transplantableObject(transplantOptions);

  new A(object);
  assertEq(A.gx(object), 10);
  A.sx(object, 15);
  assertEq(A.gx(object), 15);

  transplant(global);

  assertEq(A.gx(object), 15);
  A.sx(object, 29);
  assertEq(A.gx(object), 29);
}

// Structure helpfully provided by bug1403679.js
const thisGlobal = this;
const otherGlobalSameCompartment = newGlobal({sameCompartmentAs: thisGlobal});
const otherGlobalNewCompartment = newGlobal({newCompartment: true});

const globals =
    [thisGlobal, otherGlobalSameCompartment, otherGlobalNewCompartment];

function testWithOptions(fn) {
  for (let global of globals) {
    for (let options of [{}, {proxy: true}, {object: new FakeDOMObject()}, ]) {
      fn(options, global);
    }
  }
}

testWithOptions(transplantTest)

Messung V0.5
C=98 H=81 G=89

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