Subject:
Odd behaviour on placement of .jar files?!
Date:
Mon, 05 Jun 2000 10:46:08 -0700
From:
John Raykowski <xski@xski.org>
To:
nboyd@atg.com
Hello,
I didn't want to post this directly as a rhino bug 'coz I think it may
be more of a JDK thing, but I thought I'd toss it to you as well.
The goal is to create a JavaScript object that implements a Java
interface. Straightforward enough and the example on the page using
ActionListener works without a hitch. However, when I try to do the
same with my own interface, I get an error message: error instantiating
({0}): class {1} is interface or abstract (coming from
NativeJavaClass.construct).
Here's where it gets a bit strange. Normally, I run with the jar files
in jre/lib/ext. When I remove the rhino files from jre/lib/ext and
reference them explicitly on the commandline with the -cp option, it
works as expected and my script can implement the interface just fine.
Go figure.
Anyhoo, there ya go. Like I said, I think its a JDK issue, but I
thought you'd be interested. The attached zipfile contains a set of
sample code to demonstrate this problem.
Thanks heaps,
-jmr
Be conservative in handling the lifetime of the safe context created by XPConnect to execute JS Components, and save it off to be destroyed at cleanup time, even if some other safe context is registered with XPConnect via SetSafeJSContext.
r=vishy, a=brendan
a=brendan
bug: 27362
This fix makes it so nsCLiveconnect.cpp doesn't #include
files within an extern "C" {} block. To make this work, I
simply moved the extern "C" {} to the minimum necessary
range. This required placing an "ifdef __cplusplus extern "C""
block in jsj_private.h, since nsCLiveconnect.cpp is the only
c++ file that includes jsj_private.h.
The setter changes per-thread data - for the DOM/UI thread, this means that we can set the JS Context to one with DOM magic. This magic allows some DOM JS <-> XPConnect JS conversions to succeed, and in particular allows creation of a DOM window from within a JS component.
Unblocks nsbeta2 work by Vishy and Pavlov.
r=mccabe,vishy. a=brendan,sleestack.
resulting in a NullPointerException on the following code when run on the MS VM with -opt 9:
var testcases = getTestCases();
function getTestCases() {
return new Boolean(new MyObject(true));
}
function MyObject( value ) {
this.value = value;
this.valueOf = new Function( "return this.value" );
return this;
}