michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/licenses/publicdomain/ michael@0: * Contributor: Jason Orendorff michael@0: */ michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 503860; michael@0: var summary = "Don't shadow a readonly or setter proto-property"; michael@0: var expect = "PASS"; michael@0: var actual = "FAIL"; michael@0: var a = {y: 1}; michael@0: michael@0: function B(){} michael@0: B.prototype.__defineSetter__('x', function setx(val) { actual = expect; }); michael@0: var b = new B; michael@0: b.y = 1; michael@0: michael@0: var arr = [a, b]; // same shape prior to bug 497789 fix michael@0: for (var obj of arr) michael@0: obj.x = 2; // should call b's setter but doesn't michael@0: michael@0: reportCompare(expect, actual, summary);