|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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 * Date: 14 October 2001 |
|
8 * |
|
9 * SUMMARY: Regression test for Bugzilla bug 104584 |
|
10 * See http://bugzilla.mozilla.org/show_bug.cgi?id=104584 |
|
11 * |
|
12 * Testing that we don't crash on this code. The idea is to |
|
13 * call F,G WITHOUT providing an argument. This caused a crash |
|
14 * on the second call to obj.toString() or print(obj) below - |
|
15 */ |
|
16 |
|
17 //----------------------------------------------------------------------------- |
|
18 var BUGNUMBER = 104584; |
|
19 var summary = "Testing that we don't crash on this code -"; |
|
20 |
|
21 printBugNumber(BUGNUMBER); |
|
22 printStatus (summary); |
|
23 |
|
24 F(); |
|
25 G(); |
|
26 |
|
27 reportCompare('No Crash', 'No Crash', ''); |
|
28 |
|
29 function F(obj) |
|
30 { |
|
31 if(!obj) |
|
32 obj = {}; |
|
33 obj.toString(); |
|
34 gc(); |
|
35 obj.toString(); |
|
36 } |
|
37 |
|
38 |
|
39 function G(obj) |
|
40 { |
|
41 if(!obj) |
|
42 obj = {}; |
|
43 print(obj); |
|
44 gc(); |
|
45 print(obj); |
|
46 } |