regress-369696-02.js (1516B)
1 // |reftest| skip-if(!Object.prototype.toSource) 2 3 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ 4 /* This Source Code Form is subject to the terms of the Mozilla Public 5 * License, v. 2.0. If a copy of the MPL was not distributed with this 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 7 8 //----------------------------------------------------------------------------- 9 var BUGNUMBER = 369696; 10 var summary = 'Do not assert: map->depth > 0" in js_LeaveSharpObject'; 11 var actual = ''; 12 var expect = ''; 13 14 // Bug 762908 requires us to set sp=null; 15 if (this.window) window.SpecialPowers = null; 16 17 //----------------------------------------------------------------------------- 18 test(); 19 //----------------------------------------------------------------------------- 20 21 function test() 22 { 23 printBugNumber(BUGNUMBER); 24 printStatus (summary); 25 26 function fun() {} 27 n = fun.prototype; 28 n.__defineGetter__("prototype", n.toSource); 29 p = n.__lookupGetter__("prototype"); 30 n = p; 31 32 assertEq(n, Object.prototype.toSource); 33 assertEq(p, Object.prototype.toSource); 34 35 n["prototype"] = [n]; 36 n = p; 37 38 assertEq(n, Object.prototype.toSource); 39 assertEq(p, Object.prototype.toSource); 40 41 p2 = n["prototype"]; 42 43 assertEq(Array.isArray(p2), true); 44 assertEq(p2[0], Object.prototype.toSource); 45 46 n = p2; 47 48 assertEq(n.toString, Array.prototype.toString); 49 n.__defineGetter__("0", n.toString); 50 n = p; 51 52 assertEq(n, Object.prototype.toSource); 53 54 n.call(this); 55 56 reportCompare(expect, actual, summary); 57 }