Moving applet from Oracle jre: first tries

Thomas Meyer thomas at m3y3r.de
Tue Oct 16 04:52:10 PDT 2012


Am Dienstag, den 16.10.2012, 13:24 +0200 schrieb helpcrypto helpcrypto:
> 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;
> 					}
> 				});
> 			}
> 		}
> 	}

It is not possible to instantiate an abstract class!

> 
> 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