Closed Bug 13416 Opened 20 years ago Closed 20 years ago

Rhino: invalid bytecode

Categories

(Core :: JavaScript Engine, defect, P3)

All
Windows NT
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: norrisboyd, Assigned: rogerl)

Details

Subject:
        Rhino and invalid bytecode
   Date:
        Wed, 08 Sep 1999 15:06:10 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        norris@netscape.com
    CC:
        Howard Lin <howard@softcom.com>




I'm getting this error (see attached bug1.txt):
java.lang.Error: Unknown icode : 127 @ pc : 27

I think this is triggered by the JS call:
g.drawImage(bgImg,0,0,Color.white,null);

See the attached output and JS file.

Andrew

--
Andrew Wason
SoftCom, Inc.
aw@softcom.com



   bug1.js

          Name:
                bug1.js
          Type:
                Plain Text (text/plain)




   bug1.txt

          Name:
                bug1.txt
           Type:
                Plain Text (text/plain)



bug1.js:
importPackage(Packages.javax.swing);
importPackage(java.awt);
importPackage(java.net);
importPackage(java.lang);

var bgImg = Toolkit.getDefaultToolkit().getImage(new
        URL("http://www.mozilla.org/rhino/rhino50.jpg"));

var foo = new JComponent() {
        paint: function(g) {
                g.drawImage(bgImg,0,0,Color.white,null);
                super.paint(g);
        }
};

var f = new Frame();
f.add(foo, BorderLayout.CENTER);
f.setSize(300,300);
f.setVisible(true);


bug1.txt:
java.lang.RuntimeException: Unknown icode : 127 @ pc : 27
        at org.mozilla.javascript.Interpreter.interpret(Interpreter.java, Compil
        at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.j
        at org.mozilla.javascript.NativeClosure.call(NativeClosure.java:56)
        at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1256)
        at org.mozilla.javascript.FlattenedObject.call(FlattenedObject.java:234)
        at org.mozilla.javascript.FlattenedObject.callMethod(FlattenedObject.jav
        at org.mozilla.javascript.JavaAdapter.callMethod(JavaAdapter.java:156)
        at adapter0.paint(<adapter>)
        at java.awt.Container.paint(Container.java:773)
        at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:117)
        at java.awt.Component.dispatchEventImpl(Component.java:2447)
        at java.awt.Container.dispatchEventImpl(Container.java:1035)
        at java.awt.Window.dispatchEventImpl(Window.java:749)
        at java.awt.Component.dispatchEvent(Component.java:2307)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:287)
        at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:10
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:92)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:83)
Exception occurred during event dispatching:
java.lang.Error: Unknown icode : 127 @ pc : 27
        at org.mozilla.javascript.JavaAdapter.callMethod(JavaAdapter.java:162)
        at adapter0.paint(<adapter>)
        at java.awt.Container.paint(Container.java:773)
        at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:117)
        at java.awt.Component.dispatchEventImpl(Component.java:2447)
        at java.awt.Container.dispatchEventImpl(Container.java:1035)
        at java.awt.Window.dispatchEventImpl(Window.java:749)
        at java.awt.Component.dispatchEvent(Component.java:2307)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:287)
        at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:10
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:92)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:83)
Assignee: norris → rogerl
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Problem was caused by use of 'super' keyword - which has been reserved but not
implemented by Javascript. Unfortunately the keyword wasn't being error'd but
had turned into an illegal PRIMARY node.
You need to log in before you can comment on or make changes to this bug.