Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  bug2012018-3.js

  Sprache: JAVA
 

// Test various property suppression edge cases for for-in enumeration. Note that
// some of this is implementation-defined, but if our behavior changes we want to
// know about it.

function testBasic() {
  var proto = {y: 1};
  var obj = Object.create(proto);
  Object.assign(obj, {x: 2, y: 3});
  var log = "";
  for (var p in obj) {
    log += p;
    delete obj.y;
  }
  // proto.y took the place of obj.y.
  assertEq(log, "xy");
}
testBasic();

function testNonEnumerable() {
  var proto = {};
  Object.defineProperty(proto, "y", {value: 1, enumerable: false, writable: true});
  var obj = Object.create(proto);
  Object.assign(obj, {x: 2, y: 3});
  var log = "";
  for (var p in obj) {
    log += p;
    delete obj.y;
  }
  // proto.y is non-enumerable so "y" is suppressed.
  assertEq(log, "x");
}
testNonEnumerable();

function testDense() {
  var proto = {};
  proto[0] = 1;
  proto[1] = 2;
  var obj = Object.create(proto);
  Object.assign(obj, {0112});
  var log = "";
  for (var p in obj) {
    log += p;
    delete obj[1];
  }
  // proto[0] took the place of obj[0].
  assertEq(log, "01");
}
testDense();

function testIndexNonEnumerable() {
  var proto = {};
  proto[0] = 1;
  Object.defineProperty(proto, 1, {value: 2, enumerable: false, writable: true});
  var obj = Object.create(proto);
  Object.assign(obj, {0112});
  var log = "";
  for (var p in obj) {
    log += p;
    delete obj[1];
  }
  // proto[1] is non-enumerable so "1" is suppressed.
  assertEq(log, "0");
}
testIndexNonEnumerable();

Messung V0.5 in Prozent
C=86 H=88 G=86

¤ 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002