// Properties cleared in the middle of a single function constructor.
function foo(x, y) { this.f = 0; this.g = x + y; this.h = 2;
}
var called = false; var a = 0; var b = {valueOf: function() { Object.defineProperty(Object.prototype, 'g', {set: function() { called = true }}) }}; var c = new foo(a, b);
assertEq(called, true);
assertEq(c.g, undefined);
// Properties cleared in the middle of a constructor callee.
function foo2(x, y) { this.a = 0; this.b = 1;
bar2.call(this, x, y); this.c = 2;
} function bar2(x, y) { this.d = x + y; this.e = 3;
}
var called2 = false; var xa = 0; var xb = {valueOf: function() { Object.defineProperty(Object.prototype, 'e', {set: function() { called2 = true }}) }}; var xc = new foo2(xa, xb);
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.