Moving applet from Oracle jre: first tries

helpcrypto helpcrypto helpcrypto at gmail.com
Tue Oct 16 04:24:59 PDT 2012


Hello again.

Considering the bug resolved (I havent downloaded source+patch), I
have continued with testing.
Now, I have detected an error? (not a crash) when using JSObject, that
differs from 'official' oracle jre behaviour.

	public abstract class MyApplet extends Applet {
		public static Applet applet = null;
		@Override
		public void init() {
			applet = this;
		}
		public JSObject testFunction() {
			return AccessController.doPrivileged(new PrivilegedAction<JSObject>() {
				@Override
				public JSObject run() {
					JSObject win = JSObject.getWindow(applet);
					JSObject js = (JSObject) win.eval("new Object();");
					//...
					js.setMember("code", 0);
					return js;
					}
				});
			}
		}
	}

On javascript side, invoking this way:
	var obj=applet.testFunction();
	alert(obj.code);
Doesn't work, and says undefined. obj is [object] and I cant enumerate
properties using:
	var txt='';
	for(var a in cert){
		txt+='obj['+a+']='+obj[a]+'\n';
	}
	alert(txt);
The same code works on Oracle and obj.code==0 :)

According to http://icedtea.classpath.org/wiki/IcedTea-Web, as Im
using netscape.javascript.JSObject, I should add plugin.jar to my
classpath when building, but it should work/run properly on pages.

Any ideas? Should I add plugin.jar somewhere? Should I file another bug report?

Thanks a lot for your help!



More information about the distro-pkg-dev mailing list