regress-342960.js (1302B)
1 // |reftest| skip-if(!Object.prototype.toSource||(!xulRuntime.shell&&(Android||winWidget))) silentfail slow -- bug 528464 2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 //----------------------------------------------------------------------------- 8 var BUGNUMBER = 342960; 9 var summary = 'Do not crash on large string toSource'; 10 var actual = 'No Crash'; 11 var expect = 'No Crash'; 12 13 14 //----------------------------------------------------------------------------- 15 test(); 16 //----------------------------------------------------------------------------- 17 18 function test() 19 { 20 printBugNumber(BUGNUMBER); 21 printStatus (summary); 22 23 expectExitCode(0); 24 expectExitCode(5); 25 26 function v() 27 { 28 var meg=""; 29 var r=""; 30 var i; 31 print("don't interrupt the script. let it go."); 32 for(i=0;i<1024*1024;i++) meg += "v"; 33 for(i=0;i<1024/8;i++) r += meg; 34 var o={f1: r, f2: r, f3: r,f4: r,f5: r, f6: r, f7: r, f8: r,f9: r}; 35 print('done obj'); 36 var rr=r.toSource(); 37 print('done toSource()'); 38 } 39 40 v(); 41 42 reportCompare(expect, actual, summary); 43 }