[Bug 1198] New: JSObject is not valid on Javascript side

bugzilla-daemon at icedtea.classpath.org bugzilla-daemon at icedtea.classpath.org
Mon Oct 22 04:41:35 PDT 2012


http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1198

          Priority: P3
            Bug ID: 1198
                CC: unassigned at icedtea.classpath.org
          Assignee: dbhole at redhat.com
           Summary: JSObject is not valid on Javascript side
          Severity: normal
    Classification: Unclassified
                OS: Linux
          Reporter: helpcrypto at gmail.com
          Hardware: x86
            Status: NEW
           Version: unspecified
         Component: Plugin
           Product: IcedTea-Web

I have detected an error (not a crash) when using JSObject, that differs from
'official' oracle jre behaviour.

Consider the following code:
    public 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);


This doesn't work, and says undefined. obj is [object] (but not a valid js
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. Should i do anything else?

Maybe related to http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=347 ?

Thanks a lot for your help!




Linux pc 3.2.0-31-generic-pae #50-Ubuntu SMP Fri Sep 7 16:39:45 UTC
2012 i686 athlon i386 GNU/Linux

java version "1.7.0_07"
OpenJDK Runtime Environment (IcedTea7 2.3.2) (7u7-2.3.2a-0ubuntu0.12.04.1)
OpenJDK Client VM (build 23.2-b09, mixed mode, sharing)

ii  icedtea-7-jre-jamvm                    7u7-2.3.2a-0ubuntu0.12.04.1
            Alternative JVM for OpenJDK, using JamVM
ii  openjdk-7-jre                          7u7-2.3.2a-0ubuntu0.12.04.1
            OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-7-jre-headless                 7u7-2.3.2a-0ubuntu0.12.04.1
            OpenJDK Java runtime, using Hotspot JIT (headless)
ii  openjdk-7-jre-lib                      7u7-2.3.2a-0ubuntu0.12.04.1
            OpenJDK Java runtime (architecture independent libraries)
ii  icedtea-7-jre-jamvm                    7u7-2.3.2a-0ubuntu0.12.04.1
            Alternative JVM for OpenJDK, using JamVM
ii  icedtea-7-plugin                       1.2-2ubuntu1.2
            web browser plugin based on OpenJDK and IcedTea to execute
Java applets
ii  icedtea-netx                           1.2-2ubuntu1.2
            NetX - implementation of the Java Network Launching
Protocol (JNLP)
ii  icedtea-netx-common                    1.2-2ubuntu1.2
            NetX - implementation of the Java Network Launching
Protocol (JNLP)

Mozilla Firefox 15.0.1
/etc/alternatives/mozilla-javaplugin.so ->
/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/IcedTeaPlugin.so

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20121022/4728ccd0/attachment.html 


More information about the distro-pkg-dev mailing list