Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* |
michael@0 | 2 | * Any copyright is dedicated to the Public Domain. |
michael@0 | 3 | * http://creativecommons.org/licenses/publicdomain/ |
michael@0 | 4 | * Contributor: Jason Orendorff |
michael@0 | 5 | */ |
michael@0 | 6 | |
michael@0 | 7 | // This test appeared in bug 497789 comment 78. |
michael@0 | 8 | |
michael@0 | 9 | var a = {x: 'a'}, |
michael@0 | 10 | b1 = Object.create(a), |
michael@0 | 11 | c1 = Object.create(b1), |
michael@0 | 12 | b2 = Object.create(a), |
michael@0 | 13 | c2 = Object.create(b2); |
michael@0 | 14 | |
michael@0 | 15 | b2.x = 'b'; // foreshadowing a.x |
michael@0 | 16 | |
michael@0 | 17 | var s = ''; |
michael@0 | 18 | for each (var obj in [c1, c2]) |
michael@0 | 19 | s += obj.x; |
michael@0 | 20 | assertEq(s, 'ab'); |
michael@0 | 21 | |
michael@0 | 22 | reportCompare(0, 0, "Property cache soundness: objects with the same shape but different prototypes."); |