]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/js1_5/Regress/regress-96128-n.js
2 * The contents of this file are subject to the Netscape Public
3 * License Version 1.1 (the "License"); you may not use this file
4 * except in compliance with the License. You may obtain a copy of
5 * the License at http://www.mozilla.org/NPL/
7 * Software distributed under the License is distributed on an "AS
8 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9 * implied. See the License for the specific language governing
10 * rights and limitations under the License.
12 * The Original Code is mozilla.org code.
14 * The Initial Developer of the Original Code is Netscape
15 * Communications Corporation. Portions created by Netscape are
16 * Copyright (C) 1998 Netscape Communications Corporation.
17 * All Rights Reserved.
19 * Contributor(s): jband@netscape.com, pschwartau@netscape.com
22 * SUMMARY: Negative test that JS infinite recursion protection works.
23 * We expect the code here to fail (i.e. exit code 3), but NOT crash.
25 * See http://bugzilla.mozilla.org/show_bug.cgi?id=96128
27 //-----------------------------------------------------------------------------
29 var summary
= 'Testing that JS infinite recursion protection works';
37 * Causes a stack overflow crash in debug builds of both the browser
38 * and the shell. In the release builds this is safely caught by the
39 * "too much recursion" mechanism. If I remove the 'new' from the code below
40 * this is safely caught in both debug and release builds. The 'new' causes a
41 * lookup for the Constructor name and seems to (at least) double the number
42 * of items on the C stack for the given interpLevel depth.
44 return new objRecurse();
49 //-----------------------------------------------------------------------------
51 //-----------------------------------------------------------------------------
58 printStatus (summary
);
60 // we expect this to fail (exit code 3), but NOT crash. -
61 var obj
= new objRecurse();