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: 2001-07-11 michael@0: * michael@0: * SUMMARY: Testing eval scope inside a function. michael@0: * See http://bugzilla.mozilla.org/show_bug.cgi?id=77578 michael@0: */ michael@0: //----------------------------------------------------------------------------- michael@0: var UBound = 0; michael@0: var BUGNUMBER = 77578; michael@0: var summary = 'Testing eval scope inside a function'; michael@0: var cnEquals = '='; michael@0: var status = ''; michael@0: var statusitems = []; michael@0: var actual = ''; michael@0: var actualvalues = []; michael@0: var expect= ''; michael@0: var expectedvalues = []; michael@0: michael@0: michael@0: // various versions of JavaScript - michael@0: var JS_VER = [100, 110, 120, 130, 140, 150]; michael@0: michael@0: // Note contrast with local variables i,j,k defined below - michael@0: var i = 999; michael@0: var j = 999; michael@0: var k = 999; michael@0: michael@0: michael@0: //-------------------------------------------------- michael@0: test(); michael@0: //-------------------------------------------------- michael@0: michael@0: michael@0: function test() michael@0: { michael@0: enterFunc ('test'); michael@0: printBugNumber(BUGNUMBER); michael@0: printStatus (summary); michael@0: michael@0: // Run tests A,B,C on each version of JS and store results michael@0: for (var n=0; n!=JS_VER.length; n++) michael@0: { michael@0: testA(JS_VER[n]); michael@0: } michael@0: for (var n=0; n!=JS_VER.length; n++) michael@0: { michael@0: testB(JS_VER[n]); michael@0: } michael@0: for (var n=0; n!=JS_VER.length; n++) michael@0: { michael@0: testC(JS_VER[n]); michael@0: } michael@0: michael@0: michael@0: // Compare actual values to expected values - michael@0: for (var i=0; i