Since changes to fix bug 254778 made the parser the sole source of syntax error reports, it removed the need to check for errors after tree transformation.
The patch removes those checks and moves all reporting about syntax errors into omj/Parser.java.
Since E4X implementation needs to know the activation scope for tracking of default namespaces, previously an elaborated schema was added to set/restore the activation scope which relied on the fact that scrip and function with activation record should always call special entry/exit functions.
But that does not work for functions without activation records since they never call any special entry/exit pairs. So if application call such function directly, the function would not store its top scope anywhere and the E4X subsystem would not be able to get E4X library object.
The patch fixes with introduction of 2 functions, hasTopCall and doTopCall to ScriptRuntime and adding the following code prefix to each implementation of Callable.call that can start execution of script code:
public Object call(Context cx, Scriptable scope,
Scriptable thisObj, Object[] args)
throws JavaScriptException
{
// Prefix start
if (!ScriptRuntime.hasTopCall(cx)) {
return ScriptRuntime.doTopCall(this, cx, scope, thisObj, args);
}
// Prefix end
...
In this way there is always registered top scope during script execution and the previous elaborated schema became unnecessary so I reverted that part to almost pre-E4x state.
that have the same native or script internally. We no longer need this hack,
given regexp cloning done for precompiled scripts and functions (i.e., those
not eval'd or compile-and-go executed via a JS_Evaluate* API).
Fix a script_compile bug found during the scan of JSFRAME_EVAL occasioned by
the instanceof fix.
Bug 254067, r=shaver@mozilla.org.
2. xml/XMLObject do not define lib() method and instead defines few abstract methods to create "with" proxies and perform addition.
3. XMLLib implementation is stored in the scope using ScriptableObject.associateValue() and does not depend on presence of proper XML object.
ScriptRuntime.get(Name|Prop|Elem|Value)FunctionAndThis provides uniform way to get function object and its this during function calls. It allowed to simplify handling of method calls both in interpreter and optimizer and opened a way to implement independent processing of function and property namespaces.
it has to be updated. This is done for Rhino classes and since IdScriptable
is not a part of public API, it should not matter. But in reality someone can
subclass IdScriptable in application code.
To help with upgrade in such cases I renamed IdScriptable into
IdScriptableObject. In this way the application using IdScriptable code can add
old IdScriptable class to its CLASSPATH and be able to run again without the
need to recompile/change anything in the source.
their meaning better, adding a flag for 'for (var x ... in o)'.
- Set these flags from the parser, in a future-proof way (|=, not =, given the
zero initialized pn_extra flags member of pn_list).
- Test list flags in the code generator, including PNX_FORINVAR in conjunction
with whether the for..in loop is of the oddball form 'for (var x = i in o)'.
- Thereby fix failure to emit a JSOP_DEFVAR in the case that a function wraps
a for..in loop in a with statement (252892, r=shaver).
- The same fix cured another bug, not reported, where 'for (var x = i in o)'
in a function without any 'with' statement would emit the wrong opcode
(JSOP_FORNAME, not JSOP_FORVAR).
This is based on code contributed to Rhino by AgileDelta, Inc, www.agiledelta.com and in particular by
Ethan Hugg
Terry Lucas
Milen Nankov
John Schneider
Thanks!
This is based on code contributed to Rhino by AgileDelta, Inc, www.agiledelta.com and in particular by
Ethan Hugg
Terry Lucas
Milen Nankov
John Schneider
Thanks!