You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "John L. Webber" <Jo...@jentro.com> on 2004/12/15 14:05:45 UTC

importPackage broken in 2.1.6?

Hi all,

I checked the dev archives and the user archives before posting this, 
and I'm a little puzzled.

We have code like:

importPackage(Packages.com.foo);

var myFoo = new Foo(); //a com.foo.Foo

This worked fine under 2.1.3. Now with 2.1.6 I get the error message, 
"Implicit declaration of global variable '_packages_' forbidden. Please 
ensure all variables are explicitely declared with the 'var' keyword
         at 
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter$ThreadScope.put(FOM_JavaScriptInterpreter.java:459)
         at 
org.mozilla.javascript.ImporterTopLevel.importPackage(ImporterTopLevel.java:157)"


Is importPackage no longer valid, or am I missing something here?

Thanks,

John


-- 
---------------------------------------------------------
  Jentro Technologies GmbH
  John L. Webber, Software Development
---------------------------------------------------------
  Rosenheimer Str. 145e	    81671 München
  Tel. +49 89 189 169 80     mailto:John.Webber@jentro.com
  Fax  +49 89 189 169 99     http://www.jentro.com
---------------------------------------------------------
NOTICE: The information contained in this e-mail is confidential or may 
otherwise be legally privileged. It is intended for the named recipient 
only. If you have received it in error, please notify us immediately by 
reply or by calling the telephone number above and delete this message 
and all its attachments without any use or further distribution of its 
contents. Please note that any unauthorised review, copying, disclosing 
or otherwise making use of the information is strictly prohibited. Thank 
you.
---------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: importPackage broken in 2.1.6?

Posted by "John L. Webber" <Jo...@jentro.com>.
No, I tried your suggestion, but it produces the same error (at the line 
  importPackage(java.util)).

John

Jon Evans wrote:
> Hi John,
> I'm using an svn version as of about a week ago (so 2.1.6+) and it works 
> here.
> 
> Could you try:
> 
> importPackage(java.util);
> 
> var h = new ArrayList();
> 
> and see if that works?  Maybe there's something in your specific package 
> that it doesn't like.
> 
> Jon
> 
> 
-- 
---------------------------------------------------------
  Jentro Technologies GmbH
  John L. Webber, Software Development
---------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: importPackage broken in 2.1.6?

Posted by Jon Evans <jo...@misgl.com>.
Hi John,

On 17 Dec 2004, at 12:18, John L. Webber wrote:

> Thanks, I gave it a try, but it produced the same error message as 
> before
> ("Implicit declaration of global variable '_packages_' forbidden. 
> Please ensure all variables are explicitely declared with the 'var' 
> keyword").
>
> Does anyone else have any other ideas? At the moment this is 
> preventing us from migrating to 2.1.6 (or is it worth it migrating 
> from 2.1.3 to 2.1.6?)

I'm using an svn version as of about a week ago (so 2.1.6+) and it 
works here.

Could you try:

importPackage(java.util);

var h = new ArrayList();

and see if that works?  Maybe there's something in your specific 
package that it doesn't like.

Jon


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: importPackage broken in 2.1.6?

Posted by "John L. Webber" <Jo...@jentro.com>.
Hi Jon,

Thanks, I gave it a try, but it produced the same error message as before
("Implicit declaration of global variable '_packages_' forbidden. Please 
ensure all variables are explicitely declared with the 'var' keyword").

Does anyone else have any other ideas? At the moment this is preventing 
us from migrating to 2.1.6 (or is it worth it migrating from 2.1.3 to 
2.1.6?)

John

Jon Evans wrote:
> Hi John,
> Try
> 
> importPackage(com.foo);
> 
> Jon
-- 
---------------------------------------------------------
  Jentro Technologies GmbH
  John L. Webber, Software Development
---------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: importPackage broken in 2.1.6?

Posted by Jon Evans <jo...@misgl.com>.
Hi John,

On 15 Dec 2004, at 13:05, John L. Webber wrote:

> importPackage(Packages.com.foo);
>
> var myFoo = new Foo(); //a com.foo.Foo
>
> This worked fine under 2.1.3. Now with 2.1.6 I get the error message,  
> "Implicit declaration of global variable '_packages_' forbidden.  
> Please ensure all variables are explicitely declared with the 'var'  
> keyword
>         at  
> org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpre 
> ter$ThreadScope.put(FOM_JavaScriptInterpreter.java:459)
>         at  
> org.mozilla.javascript.ImporterTopLevel.importPackage(ImporterTopLevel. 
> java:157)"
>
>
> Is importPackage no longer valid, or am I missing something here?

Try

importPackage(com.foo);

Jon


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org