add m prefix to base and offset label members
interpreter.cpp,h
dual license
wrap interpret in a Context class
add RETURN_VOID case
js2.cpp
update to use context class
remove #if 0 code that'll probably never be used anyway.
jstypes.h
add defineProperty/function to JSObject
vmtypes.h
regerated opcode classes:
added RETURN_VOID, removed LOAD/SAVE_VAR
reverted bacl to the smaller print function (thanks to RETURN_VOID)
fixed branch printing issue
inherit print() from super if possible
tools/gencode.pl
generate smaller print functions again
don't generate print function if superclass can take care of it.
contextClassloader problem in ScriptRuntime.java
Date:
Tue, 11 Apr 2000 09:45:36 -0400
From:
"Howard Lin" <howard@softcom.com>
To:
"Norris Boyd" <norris@netscape.com>
CC:
"Andrew Wason" <aw@softcom.com>
Hi, Norris, we are trying to create a Java class in JavaScript. When security manager is on, everything works fine. But when security
manager is off, we got an error saying the "... is not defined". The problem is that in ScriptRuntime.java, when security is on,
getContextClassLoader is null due to SecurityException and Class.forName is used to find the class, which works fine. When security
is off, ContextClassLoaderMethod is invoked to find the class. Since we use a separate thread to load third party jar files,
ContextClassLoaderMethod will throw a ClassNotFound exception.
To illustrate this problem, I wrote a simple applet, evaluating a simple js file in its paint method, which is running on a separate thread.
When security is off, I got the following:
ReferenceError: "Global" is not defined.
at org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:
494)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java, Compile
d Code)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java, Compil
ed Code)
at org.mozilla.javascript.InterpretedScript.call(InterpretedScript.java:
67)
at org.mozilla.javascript.InterpretedScript.exec(InterpretedScript.java:
54)
at org.mozilla.javascript.Context.evaluateReader(Context.java:739)
at test.evaluate(test.java:26)
at test.paint(test.java:16)
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.Component.dispatchEvent(Component.java:2307)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:287)
at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:10
1)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:92)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:83)
When security is on, it runs fine. Or if the code moved to init method, it works fine regardless of security. We are using JDK 1.2.2.
Howard