/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* * *Date:25November2002 *SUMMARY:Testingscope *Seehttp://bugzilla.mozilla.org/show_bug.cgi?id=181834 * *ThisbugonlybitinRhinointerpretedmode,whenthe *'compilefunctionswithdynamicscope'featurewasset. *
*/ //----------------------------------------------------------------------------- var UBound = 0; var BUGNUMBER = 181834; var summary = 'Testing scope'; var status = ''; var statusitems = []; var actual = ''; var actualvalues = []; var expect= ''; var expectedvalues = [];
/* *IfN<=0,|outer_d|justgetsincrementedonce, *sothereturnvalueshouldbe1inthiscase. * *IfN>0,weendupcallinginner()N+1times: *inner(N),inner(N-1),...,inner(0). * *Eachcalltoinner()increments|outer_d|by1. *Thelastcall,inner(0),returnsthefinalvalue *of|outer_d|,whichshouldbeN+1.
*/ function outer(N)
{ var outer_d = 0; return inner(N);
function setDynamicScope(flag)
{ if (this.Packages)
{ var cx = this.Packages.org.mozilla.javascript.Context.getCurrentContext();
cx.setCompileFunctionsWithDynamicScope(flag);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.