Minor wording changes.
* jsDriver.pl
Display negative list in output, fix display of test list as part of output (which was broken by the multiple test-list change)
Added hours field in tastcase duration output (man that sparc20 is slow.)
jsDriver.pl now supports multiple lists to be specified in the -l argument,
and directory names as well. Directory names can also be used in list files.
'Negative' lists are supported as well. They consist of a list of tests to skip, and are of the same format as the regular lists.
* README-jsDriver.html
man-like html page describing how to use jsDriver.pl
Subject:
Rhino request URGENT
Date:
Thu, 02 Dec 1999 15:58:40 -0500
From:
slobo@espialgroup.com
To:
Norris Boyd <norris@netscape.com>
References:
1 , 2
Hello Norris
In Rhino, the following script gives the error : "function does not always return a value" during the parsing phase. The script
runs perfectly fine in Netscape 4.61. It is an urgent requirement. Many thanks in advance.
Steven
///////////////////////////////////////////////////////SCRIPT BEGIN ///////////////////////////////////////////////
function test (a) {
this.arg = a;
if (a>20)
return;
return this;
}
//print = alert;
function joe() {
a = new test (20);
print (a.arg);
a = new test (25);
print (a.arg);
}
joe();
///////////////////////////////////////////////////////SCRIPT END ///////////////////////////////////////////////
checked in some time ago, but this portion of the fix never made it
it. r=drapeau@eng.sun.com. Log error when LiveConnect cannot be
started due to an error in the Java VM.
apprunner to crash."), fix contributed by
jeff.dyer@compilercompany.com, r=drapeau@eng.sun.com. Checks whether
there's a current valid context; if there's no context, don't bother
checking if an exception is pending on that context.
Add target for windows systems.
* runtests2.pl
Add xpcshell option, no longer requires \n at end of list file.
* ecma/ExecutionContexts/10.1.3.js
Reformatted.
Make JS timing work under BeOS (added XP_BEOS next to XP_UNIX). r=mcafee
Make nsSigHandlers.cpp build under BeOS (strsignal returns const char *). r=mcafee
(More work is needed to conform to ECMA ed. 3 by removing Closure objects; also we want more efficient closure calling, soon.)
- Move mislocated call to js_FoldConstants from jsemit.c's js_EmitTree, the TOK_FUNCTION case, back to jsparse.c. This avoids redundant fold-walks over non-top-level functions. Folding should be done at tree-gen time, not at code-gen time.
- Eliminate dead code in if-else and ?: when folding constants.
- Release tempPool arena space before early return on error in js_FoldConstants, just to be nice (all arena space gets released eventually, when the compiler finishes).
Use nsCOMPtr to manage services (thank you dp, thank you).
Only push context on stack when actually executing JS via JSAPI.
Use nsXPIDLCString to simplify memory management (thank you waterson,
thank you).
Use generic module stuff.
r=fur,jband
make all targets "other_window" to reduce number of open windows.
* mklistpage.pl
make all targets "other_window" to reduce number of open windows.
* runtests2.pl
more hacking, still not done.
- jsinterp.c changes:
__- JSOP_CLOSURE comment fixes.
____(NB: ECMA ed 3 seems to require that we abolish the Closure object altogether, replacing it with a new Function object where we used to make a new closure. That says we should use JS_CloneFunctionObject or an internal form (js_).)
__- Use obj rather than the same-valued fp->scopeChain as fourth argument to js_ConstructObject.
__- JSOP_DEFFUN change to auto-clone when running a script in a different scope from the one the compiler used for static function scope linkage.
__- Remove bogus assertion from JSOP_DEFVAR/CONST: case.
- jsparse.c/.h changes:
__- Restored outerFun test to FunctionDef in jsparse.c, so that we make a closure if (outerFun || lambda || !funAtom) -- i.e., if we're compiling
____- A function statement within an active function via eval;
____- We're compiling a function expression statement (not at apparent-to-compiler top-level; part of some kind of compound statement, e.g. if or with);
____- Or the function, even at top statement level and not in another function, has no name.
__- Don't predefine local variables at compile time if they're in with statement
__- Enforce const at compile time for local consts
- Minor jsemit.[ch] cleanup.
- teach loader about unloading and deferring components
- turn off some DEBUG_shaver noise
- better error reporting
- use nsXPIDLCString
- use nsCOMPtr
- add missing cxstack->Pop() in the xpcshell
- Components.results.NS_ERROR_FACTORY_REGISTER_AGAIN (want better text for
error message)
- handle thrown-nsresult correctly where C++ calls JS without an active JS
stack
- remove missing cxstack->Pop() from TestXPC
r=jband,brendan
("[PP]Crash on startup because of Java Plug-in 1.3 for Netscape
Navigator.") Make the code more bulletproof by checking for NULL
arguments to several methods. If JVM isn't running, jEnv arg should
be NULL.
This doesn't entirely fix the problem of a JVM gone awry in all cases;
in the case of this particular bug, the Sun JDK 1.3 Beta HotSpot VM
caused an error, and there's no way for Mozilla code to detect this
failure mode. The fix for that half of the problem is to use the new
JDK 1.3 Early Access VM, which does not exhibit the problem.
to the xpconnect echo interface. This will help fix bug 17736. This includes
using nsITimer which is a pretty messed up xpcom interface w/o a factory.
- Added dump() to xpcshell to make it compatible with browsers debug
output method.
- reformat beard's leak fix to follow 80 column rule.
- Add a missing dont_AddRef to avoid a leak in some debug code.
r=mccabe
object - There's no clear documentation of the result, but the source
code unambiguously calls 'js_obj_toSource', which inserts the extra '()'
under the version1_2 flag, so I believe this is the correct result.
- Fix for bug 13419 - xpconnect calls wrapped JS objects on wrong JSContext.
Added code to use the nsThreadJSContextStack in order to call wrapped
JS object on the JSContext that is current for the running thread.
We've made the rule that xpconnect only supports one JSRuntime. We
partially enforce that here by enforcing that the JSContext on which
we will run code hails from the same JSRuntime as the JSContext on
which the wrapper for the JS code was built.
Because it is perfectly legal for the nsThreadJSContextStack to be empty
if a wrapped JS object is being called from code other than a DOM event,
this system will lazily create a JSContext for the current thread and
maintain it in TLS. This JSContext is used as necessary. If it uses such
a JSContext that was not already on the nsThreadJSContextStack then the
system will temporarily push that JSContext onto the nsThreadJSContextStack
during the course of the function call being performed. This is all managed
my a new auto class: AutoPushCompatibleJSContext. This is used in the two
places where wrapped JS code is called from native code.
[the two places where this system is invoked are currently disabled due to
the fact that the DOM code makes bad assumptions about the JSContext on
which DOM objects can be accessed. We are working to fix that and then this
code will be enabled.]
- Add #ifdef XPC_DETECT_LEADING_UPPERCASE_ACCESS_ERRORS code that will help
users when we do things like fix bug 14460. As soon as we make more of the
idl declarations of methods leadingLowercase then we will have
LeadingUppercase calls from JS breaking at runtime. It is expected that this
will especially be a problem for coders working with the same interfaces
from both C++ and JS (since from C++ an interface has LeadingUpper methods and
the *same* interface seen from JS has leadingLowecase names). This code
(as suggested by shaver) will print out an informative error message when
it detects the misuse. This is currently enabled for DEBUG builds only.
- Copy code from xpcshell to TestXPC to use the JSRuntimeSerivce.
r=norris@netscape.com
- Check to see if a wrapped JS object has a QueryInterface property before
trying to call that method. This is a speed optimization. It also and makes
norris happy because his perrenial breakpoint in jsReportErrorNumber is not
getting hit (even though the old code was safe).
code review and fixes (r=chouck@geocast.com). He needs this cuz he has no
knowledge of exact number of properties before new-style enumerating them.
- Patch up jsdbgapi.c a bit -- it needs to use OBJ_GET_ATTRIBUTES and new APIs
to do a better job describing properties to a debugger.
- Add JSMSG_CANT_DESCRIBE_PROPS for bogus non-native error case in jsdbgapi.c.
- Fix "Inappropriate" => "invalid" in JSMSG_BAD_ARRAY_LENGTH message.
Primarily fixes to properly handle nsIXPCSecurityManager vetos of
xpconnect activities.
- The code was not propagating security manager vetos of native wrapping up
through xpconnect internals. So, xpconnect was erroneously masking the
security exception with its own 'failed to convert param' exception.
This effects the signatures of nsXPCWrappedNative::GetNewOrUsedWrapper
and nsXPCWrappedJSClass::GetNewOrUsedClass.
- This propagation also helps with the problem that sometimes interfaces
are not set as [scriptable] and we did not make that clear as the source
of xpconnect's failure to convert a param in calling a method. Now this
specific class of exceptions is indicated in the JS exception object when
this happens.
- Added an explicit call to js_ForceGC on shutdown of xpcshell to aid in
avoiding 'false positives' in leak detection
- Return JS_FALSE rather than JS_TRUE when an exception is thrown in
xpcjsid to make the jsengine notices the exception.
- Move #includes that others added in xpcmodule.cpp to xpcprivate.h in
order to maintain the include conventions of this module.
- Avoid throwing an exception if it represents a security manager veto
and the security manager set an exception already.
- Replace uses of nsCOMTypeInfo<> added by scc with NS_GET_IID macros.
- Fixed a methodname misspelling because reviewers care about stuff
like that :)
Subject:
Re: another getClassLoader exception
Date:
Mon, 18 Oct 1999 22:01:24 -0400
From:
Andrew Wason <aw@softcom.com>
To:
norris@netscape.com (Norris Boyd)
CC:
Howard Lin <howard@softcom.com>
References:
1 , 2
At 05:03 PM 10/18/99 -0700, Norris Boyd wrote:
>Are you still seeing this problem?
Yes. I just did a CVS update to get the latest stuff and we still have
this problem.
I wrote a standalone sample program that duplicates the problem. Run
JSSupport and you should get this exception:
defineClass org.mozilla.javascript.gen.c2
Exception in thread "main" java.lang.NoClassDefFoundError:
org/mozilla/javascript/gen/c1
at java.lang.ClassLoader.resolveClass0(Native Method)
at java.lang.ClassLoader.resolveClass(ClassLoader.java:545)
at
JSSupport$MySecuritySupport$DataClassLoader.loadClass(JSSupport.java:89)
at JSSupport$MySecuritySupport.defineClass(JSSupport.java:47)
at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java,
Compiled Code)
at org.mozilla.javascript.Context.compile(Context.java:1761)
at org.mozilla.javascript.Context.compile(Context.java:1691)
at org.mozilla.javascript.Context.compileReader(Context.java:810)
at org.mozilla.javascript.Context.evaluateReader(Context.java:725)
at org.mozilla.javascript.Context.evaluateString(Context.java:692)
at JSSupport.<init>(JSSupport.java:20)
at JSSupport.main(JSSupport.java:9)
Andrew
>--N
>
>Andrew Wason wrote:
>
> > At 04:54 PM 10/12/99 -0700, Norris Boyd wrote:
> > >I just checked in changes so that the class calling ScriptRuntime (c5
> in your
> > >case) will load the class itself using the normal Java classloading
> mechanism
> > >rather than an explicit call to the class loader. I pushed the bits up
> to the
> > >ftp site, but it takes a bit to propagate.
> >
> > I get this exception now (debugging statements are from my code):
> >
> > SecuritySupport.defineClass org.mozilla.javascript.gen.c5
> > DataClassLoader.loadClass org.mozilla.javascript.gen.c5
> > DataClassLoader.loadClass org.mozilla.javascript.gen.c4
> > using default loader com.softcom.realjava.PluginClassLoader@da9486a0
> > java.lang.NoClassDefFoundError: org/mozilla/javascript/gen/c4
> > at java.lang.ClassLoader.resolveClass0(Native Method)
> > at java.lang.ClassLoader.resolveClass(ClassLoader.java:545)
> > at
> >
> com.softcom.realjava.plugins.RealJavaScript$RealJavaScriptSecuritySupport$Da
> > taClassLoader.loadClass(RealJavaScript.java:410)
> > at
> >
> com.softcom.realjava.plugins.RealJavaScript$RealJavaScriptSecuritySupport.de
> > fineClass(RealJavaScript.java:352)
> > at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java,
> > Compiled Code)
> > at org.mozilla.javascript.Context.compile(Context.java:1761)
> > at org.mozilla.javascript.Context.compile(Context.java:1691)
> > at org.mozilla.javascript.Context.compileReader(Context.java:810)
> >
> > So when c5 is being loaded by my SecuritySupport, it also needs to load c4.
> > I decompiled org.mozilla.javascript.gen.c5 and it's constant pool
> > references CLASS org.mozilla.javascript.gen.c4, so c5 is dependent on c4
> > being loadable. Is the problem that c5 is being loaded before the
> > optimizer has defined c4?
> >
> > I get the above exception for some classes and not others. It seems
> > consistent that I always get it for classes with dependencies on other
> > optimizer classes that haven't been generated yet.
> >
> > Andrew
> >
> > --
> > Andrew Wason
> > SoftCom, Inc.
> > aw@softcom.com
--
Andrew Wason
SoftCom, Inc.
aw@softcom.com
JSSupport.java
Name:
JSSupport.java
Type:
Java Source File (text/java)
Encoding:
base64
Implement nsIXPCNativeCallContext to meet user feature
requirements. This allows simpler implementation of reflection of
native classes into JavaScript in cases where they need to
support legacy interfaces that include optional parameters and
method name overloading. This also provides a general mechanism
for native methods to discover if they were called from JS code,
exactly what JS parameters were passed, explicitly return jsvals,
and throw explicit jsvals without interference from xpconnect.
With test cases.