- 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.
git-svn-id: svn://10.0.0.236/trunk@53746 18797224-902f-48f8-a5cc-f745e15eee43
Fix for toString under 1.2 - calls toSource which provides extra '{}' that
doesn't match previous behaviour.
git-svn-id: svn://10.0.0.236/trunk@53704 18797224-902f-48f8-a5cc-f745e15eee43
Fixed handling of weird indices (NaN etc) for charCode and charCodeAt.
Bug #16984
git-svn-id: svn://10.0.0.236/trunk@53702 18797224-902f-48f8-a5cc-f745e15eee43
- 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
git-svn-id: svn://10.0.0.236/trunk@53049 18797224-902f-48f8-a5cc-f745e15eee43
("[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.
git-svn-id: svn://10.0.0.236/trunk@52888 18797224-902f-48f8-a5cc-f745e15eee43
Clear up build warnings, and quiet nsInterfaceInfomanager debug output unless DEBUG_iim. Makes startup a li'l less noisy. Fixes 15628.
r=jband
git-svn-id: svn://10.0.0.236/trunk@52695 18797224-902f-48f8-a5cc-f745e15eee43
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
git-svn-id: svn://10.0.0.236/trunk@52518 18797224-902f-48f8-a5cc-f745e15eee43
Opinion was that Script.exec() should execute in global scope, not caller.
git-svn-id: svn://10.0.0.236/trunk@52276 18797224-902f-48f8-a5cc-f745e15eee43
Fixed accidental eating of exceptions (match loop didn't terminate on
failure). New ECMA definition (again) of back reference format.
git-svn-id: svn://10.0.0.236/trunk@52275 18797224-902f-48f8-a5cc-f745e15eee43
- 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).
git-svn-id: svn://10.0.0.236/trunk@52197 18797224-902f-48f8-a5cc-f745e15eee43