gecko-dev/js
jband%netscape.com 04eeab08bf r=shaver@mozilla.org
- 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).
1999-10-29 05:42:41 +00:00
..
benchmarks Add benchmarks. 1999-06-04 18:44:17 +00:00
js2/java Changes to get traditional functions with args. working 1999-06-15 00:57:05 +00:00
jsd ignore Makefile and js 1999-09-07 05:03:42 +00:00
jsdj Change MOZILLA_HOME to MOZILLA_FIVE_HOME so that we dont fight Communicator 1999-03-11 20:00:57 +00:00
jsj Deleting obsolete contents of jsj directory 1998-09-24 00:32:24 +00:00
macbuild Really change to using the NSComponent library. the opt target still had NSStartup. r=moose. 1999-10-27 06:31:40 +00:00
ref The files in this directory are all obsolete. JavaScript development 1998-10-16 22:18:00 +00:00
rhino Fix spelling of contributor's name. 1999-10-28 17:43:43 +00:00
semantics Changed bottom expressions to syntax error throws 1999-10-20 20:58:07 +00:00
src r=shaver@mozilla.org 1999-10-29 05:42:41 +00:00
tests Changed commandline option for classpath to 'classpath' instead of 'cp' 1999-10-27 22:22:56 +00:00
.cvsignore more anal tricks. 1999-06-26 05:01:40 +00:00
landbranch.pl Tweaks 1999-04-27 05:08:14 +00:00
Makefile.in Cleaned it up and eliminated the pointless #!gmake. 1999-09-02 00:06:06 +00:00
makefile.win removed jsj for MOZ_JAVA 1998-08-01 00:03:31 +00:00