1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/js1_5/Regress/regress-170193.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,77 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +/* 1.10 + * 1.11 + * Date: 22 Sep 2002 1.12 + * SUMMARY: adding prop after middle-delete of function w duplicate formal args 1.13 + * See http://bugzilla.mozilla.org/show_bug.cgi?id=170193 1.14 + * 1.15 + */ 1.16 +//----------------------------------------------------------------------------- 1.17 +var UBound = 0; 1.18 +var BUGNUMBER = 170193; 1.19 +var summary = 'adding property after middle-delete of function w duplicate formal args'; 1.20 +var status = ''; 1.21 +var statusitems = []; 1.22 +var actual = ''; 1.23 +var actualvalues = []; 1.24 +var expect= ''; 1.25 +var expectedvalues = []; 1.26 + 1.27 +/* 1.28 + * This sequence of steps used to cause the SpiderMonkey shell to hang - 1.29 + */ 1.30 +function f(a,a,b){} 1.31 +f.c=42; 1.32 +f.d=43; 1.33 +delete f.c; // "middle delete" 1.34 +f.e=44; 1.35 + 1.36 +status = inSection(1); 1.37 +actual = f.c; 1.38 +expect = undefined; 1.39 +addThis(); 1.40 + 1.41 +status = inSection(2); 1.42 +actual = f.d; 1.43 +expect = 43; 1.44 +addThis(); 1.45 + 1.46 +status = inSection(3); 1.47 +actual = f.e; 1.48 +expect = 44; 1.49 +addThis(); 1.50 + 1.51 + 1.52 + 1.53 +//----------------------------------------------------------------------------- 1.54 +test(); 1.55 +//----------------------------------------------------------------------------- 1.56 + 1.57 + 1.58 + 1.59 +function addThis() 1.60 +{ 1.61 + statusitems[UBound] = status; 1.62 + actualvalues[UBound] = actual; 1.63 + expectedvalues[UBound] = expect; 1.64 + UBound++; 1.65 +} 1.66 + 1.67 + 1.68 +function test() 1.69 +{ 1.70 + enterFunc('test'); 1.71 + printBugNumber(BUGNUMBER); 1.72 + printStatus(summary); 1.73 + 1.74 + for (var i=0; i<UBound; i++) 1.75 + { 1.76 + reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); 1.77 + } 1.78 + 1.79 + exitFunc ('test'); 1.80 +}