On Dec 2, 5:37 am, [EMAIL PROTECTED] wrote:
> Hi All,
>
> we use our own WrapFactory Class to convert Java Dates to Javascript
> ones. However, I am running into a mysterious error from
> Context.newObject method as shown below. I assume that
> Context.newObject must use reflection to locate the Date constructor.
> We pass in the arguments for the Constructor as: new Object[] {new Long
> (dateObj.getTime())} Has anyone seen this before?
>
> org.mozilla.javascript.EvaluatorException: Constructor for "Date" not
> found. (642024300)#4)
> at org.mozilla.javascript.DefaultErrorReporter.runtimeError
> (DefaultErrorReporter.java:95)
> at org.mozilla.javascript.Context.reportRuntimeError(Context.java:
> 1054)
> at org.mozilla.javascript.Context.reportRuntimeError(Context.java:
> 1110)
> at org.mozilla.javascript.Context.reportRuntimeError1(Context.java:
> 1073)
> at org.mozilla.javascript.ScriptRuntime.getExistingCtor
> (ScriptRuntime.java:1119)
> at org.mozilla.javascript.Context.newObject(Context.java:1548)
This isn't about Java reflection--in this case Rhino is attempting to
look up the Date constructor by looking for property "Date" of the
global object. Perhaps you're passing the wrong scope in, or that
scope hasn't been initialized with Context.initStandardObjects?
--N
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino