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


Quelle  bug1762575-3.js   Sprache: JAVA

 
// Test implementation details when arguments object keep strong references
// to their elements.

function checkWeakRef(f, isCleared = true) {
  let [wr, args] = f({});

  assertEq(wr.deref() !== undefined, true);

  clearKeptObjects();
  gc();

  // In an ideal world, the reference is always cleared. But in specific
  // circumstances we're currently keeping the reference alive. Should this
  // ever change, feel free to update this test case accordingly. IOW having
  // |isCleared == false| is okay for spec correctness, but it isn't optimal.
  assertEq(wr.deref() === undefined, isCleared);
}

checkWeakRef(function() {
  // Create a weak-ref for the first argument.
  let wr = new WeakRef(arguments[0]);

  // Clear the reference from the arguments object.
  arguments[0] = null;

  // Let the arguments object escape.
  return [wr, arguments];
});

checkWeakRef(function() {
  // Create a weak-ref for the first argument.
  let wr = new WeakRef(arguments[0]);

  // Clear the reference from the arguments object.
  Object.defineProperty(arguments, 0, {value: null});

  // Let the arguments object escape.
  return [wr, arguments];
});

checkWeakRef(function self() {
  // Create a weak-ref for the first argument.
  let wr = new WeakRef(arguments[0]);

  // Delete operation doesn't clear the reference!
  delete arguments[0];

  // Let the arguments object escape.
  return [wr, arguments];
}, /*isCleared=*/ false);

checkWeakRef(function() {
  "use strict";

  // Create a weak-ref for the first argument.
  let wr = new WeakRef(arguments[0]);

  // Clear the reference from the arguments object.
  arguments[0] = null;

  // Let the arguments object escape.
  return [wr, arguments];
});

checkWeakRef(function() {
  "use strict";

  // Create a weak-ref for the first argument.
  let wr = new WeakRef(arguments[0]);

  // This define operation doesn't clear the reference!
  Object.defineProperty(arguments, 0, {value: null});

  // Let the arguments object escape.
  return [wr, arguments];
}, /*isCleared=*/ false);

checkWeakRef(function() {
  "use strict";

  // Create a weak-ref for the first argument.
  let wr = new WeakRef(arguments[0]);

  // Delete operation doesn't clear the reference!
  delete arguments[0];

  // Let the arguments object escape.
  return [wr, arguments];
}, /*isCleared=*/ false);

Messung V0.5
C=70 H=100 G=86

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