js/src/tests/js1_5/GC/regress-104584.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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/. */
     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  */
    17 //-----------------------------------------------------------------------------
    18 var BUGNUMBER = 104584;
    19 var summary = "Testing that we don't crash on this code -";
    21 printBugNumber(BUGNUMBER);
    22 printStatus (summary);
    24 F();
    25 G();
    27 reportCompare('No Crash', 'No Crash', '');
    29 function F(obj)
    30 {
    31   if(!obj)
    32     obj = {};
    33   obj.toString();
    34   gc();
    35   obj.toString();
    36 }
    39 function G(obj)
    40 {
    41   if(!obj)
    42     obj = {};
    43   print(obj);
    44   gc();
    45   print(obj);
    46 }

mercurial