Well, you can use a custom ContextFactory that creates Context  
instances with a WrapFactory configured for not wrapping primitives.  
That way you extracted it in a single place and needn't bother with it  
whenever you enter a Context.

Attila.

On 2008.05.22., at 15:33, Kris Zyp wrote:

> Is there any way to make Rhino globally default to not wrapping Java
> primitives (String, Number, Boolean, and Character)? It appears that
> you
> disable this per Context by getting the WrapFactory and calling
> setJavaPrimitiveWrap(false). It seems like one would want this to
> normally
> be false, and have it default to false without having to set it to
> false for
> the WrapFactory for each Context. Getting a NativeJavaObject as the
> result
> of a method that is supposed to return a string is rather surprising
> to me.
> Is there a reason why this defaults to true? Is there a way to make
> it
> globally default to false?
> Thanks,
> Kris

_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to