Subj : Re: Calling a function before it's declared To : netscape.public.mozilla.jseng From : Brook Monroe Date : Wed Nov 24 2004 10:51 am Igor Bukanov wrote: > Egor Senin wrote: > >> Hi ! >> >> Is there any way to make the following code work in Rhino: >> >> funcThatIsDeclaredLater(); >> function funcThatIsDeclaredLater(){ // do something >> } >> >> The problem is that the function is declared after it's called. >> >> Egor. > > > > That is definitely supported by Rhino. But I guess you in fact have to > deal with something like: > > if (foo) { > bar(); > function bar() { } > } > > Right? If so, see > http://groups.google.com/groups?hl=en&lr=&threadm=d9195cb5.0411021418.7bfd64b8%40posting.google.com&rnum=1&prev=/groups%3Fq%3DFUNCTION_EXPRESSION_STATEMENT%26hl%3Den%26lr%3D%26group%3Dnetscape.public.mozilla.jseng%26selm%3Dd9195cb5.0411021418.7bfd64b8%2540posting.google.com%26rnum%3D1 > > > Regards, Igor I guess this is a testament to the dangers of working outside ECMA-262. .