regress-346801.js (1778B)
1 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 //----------------------------------------------------------------------------- 7 var BUGNUMBER = 346801; 8 var summary = 'Hang regression from bug 346021'; 9 var actual = ''; 10 var expect = 'No Hang'; 11 12 13 //----------------------------------------------------------------------------- 14 test(); 15 //----------------------------------------------------------------------------- 16 17 function test() 18 { 19 printBugNumber(BUGNUMBER); 20 printStatus (summary); 21 22 try 23 { 24 var Class = { 25 create: function() { 26 return function() { 27 this.initialize.apply(this, arguments); 28 } 29 } 30 } 31 32 Object.extend = function(destination, source) { 33 print("Start"); 34 // print(destination); 35 // print(source); 36 if(destination==source) 37 print("Same desination and source!"); 38 var i = 0; 39 for (property in source) { 40 // print(" " + property); 41 destination[property] = source[property]; 42 ++i; 43 if (i > 1000) { 44 throw "Hang"; 45 } 46 } 47 print("Finish"); 48 return destination; 49 } 50 51 var Ajax = { 52 }; 53 54 Ajax.Base = function() {}; 55 Ajax.Base.prototype = { 56 responseIsFailure: function() { } 57 } 58 59 Ajax.Request = Class.create(); 60 61 Ajax.Request.prototype = Object.extend(new Ajax.Base(), {}); 62 63 Ajax.Updater = Class.create(); 64 65 Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype); 66 actual = 'No Hang'; 67 } 68 catch(ex) 69 { 70 actual = ex + ''; 71 } 72 reportCompare(expect, actual, summary); 73 }