michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* michael@0: * Date: 14 October 2001 michael@0: * michael@0: * SUMMARY: Regression test for Bugzilla bug 104584 michael@0: * See http://bugzilla.mozilla.org/show_bug.cgi?id=104584 michael@0: * michael@0: * Testing that we don't crash on this code. The idea is to michael@0: * call F,G WITHOUT providing an argument. This caused a crash michael@0: * on the second call to obj.toString() or print(obj) below - michael@0: */ michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 104584; michael@0: var summary = "Testing that we don't crash on this code -"; michael@0: michael@0: printBugNumber(BUGNUMBER); michael@0: printStatus (summary); michael@0: michael@0: F(); michael@0: G(); michael@0: michael@0: reportCompare('No Crash', 'No Crash', ''); michael@0: michael@0: function F(obj) michael@0: { michael@0: if(!obj) michael@0: obj = {}; michael@0: obj.toString(); michael@0: gc(); michael@0: obj.toString(); michael@0: } michael@0: michael@0: michael@0: function G(obj) michael@0: { michael@0: if(!obj) michael@0: obj = {}; michael@0: print(obj); michael@0: gc(); michael@0: print(obj); michael@0: }