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: * michael@0: * Date: 05 July 2002 michael@0: * SUMMARY: Testing local var having same name as switch label inside function michael@0: * michael@0: * The code below crashed while compiling in JS1.1 or JS1.2 michael@0: * See http://bugzilla.mozilla.org/show_bug.cgi?id=144834 michael@0: * michael@0: */ michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 144834; michael@0: var summary = 'Local var having same name as switch label inside function'; michael@0: michael@0: print(BUGNUMBER); michael@0: print(summary); michael@0: michael@0: michael@0: function RedrawSched() michael@0: { michael@0: var MinBound; michael@0: michael@0: switch (i) michael@0: { michael@0: case MinBound : michael@0: } michael@0: } michael@0: michael@0: michael@0: /* michael@0: * Also try eval scope - michael@0: */ michael@0: var s = ''; michael@0: s += 'function RedrawSched()'; michael@0: s += '{'; michael@0: s += ' var MinBound;'; michael@0: s += ''; michael@0: s += ' switch (i)'; michael@0: s += ' {'; michael@0: s += ' case MinBound :'; michael@0: s += ' }'; michael@0: s += '}'; michael@0: eval(s); michael@0: michael@0: AddTestCase('Do not crash', 'No Crash', 'No Crash'); michael@0: test();