Subj : RE: WrapFactory.wrapAsJavaObject has null class argument To : netscape.public.mozilla.jseng From : Rod Macpherson Date : Thu Jul 07 2005 10:53 am To clarify the question (it is not a common one I am sure of that): I am supplying a WrapFactory to the engine. The engine independently calls wrapAsJavaObject with a valid object but a null class. When does the engine decide to pass a null value as the argument for the class parameter? -----Original Message----- From: mozilla-jseng-admin@mozilla.org [mailto:mozilla-jseng-admin@mozilla.org] On Behalf Of Rod Macpherson Sent: Wednesday, July 06, 2005 12:08 PM To: mozilla-jseng@mozilla.org Subject: WrapFactory.wrapAsJavaObject has null class argument Consider a Map that contains Model objects where both Map and Model return a Scriptable from my WrapFactory override: public Scriptable WrapFactory.wrapAsJavaObject(Context context, Scriptable scope, Object object, Class klass) Now consider this reference in JavaScript: myMap.myModel; The myMap object is processed by the WrapFactory and klass is java.util.Map; perfect. The myModel object is then processed but klass is null; crashes my code. The object looks fine: it's a Model type. How do I control what gets passed to wrapAsJavaObject? _______________________________________________ mozilla-jseng mailing list mozilla-jseng@mozilla.org http://mail.mozilla.org/listinfo/mozilla-jseng .