js/src/tests/js1_8_5/regress/regress-500528.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/js1_8_5/regress/regress-500528.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,22 @@
     1.4 +/*
     1.5 + * Any copyright is dedicated to the Public Domain.
     1.6 + * http://creativecommons.org/licenses/publicdomain/
     1.7 + * Contributor: Jason Orendorff
     1.8 + */
     1.9 +
    1.10 +// This test appeared in bug 497789 comment 78.
    1.11 +
    1.12 +var a = {x: 'a'},
    1.13 +    b1 = Object.create(a),
    1.14 +    c1 = Object.create(b1),
    1.15 +    b2 = Object.create(a),
    1.16 +    c2 = Object.create(b2);
    1.17 +
    1.18 +b2.x = 'b';  // foreshadowing a.x
    1.19 +
    1.20 +var s = '';
    1.21 +for each (var obj in [c1, c2])
    1.22 +    s += obj.x;
    1.23 +assertEq(s, 'ab');
    1.24 +
    1.25 +reportCompare(0, 0, "Property cache soundness: objects with the same shape but different prototypes.");

mercurial