Граф коммитов

5985 Коммитов

Автор SHA1 Сообщение Дата
igor%mir2.org 31ff23cd2e Simpler SyntxError handling:
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.
2004-08-09 18:04:18 +00:00
igor%mir2.org ca75e5c0c8 Fixing bug 254915: proper name lookup etc. 2004-08-09 16:57:06 +00:00
igor%mir2.org 5f71fe6973 Top call scope tracking changes:
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.
2004-08-09 11:00:47 +00:00
timeless%mozdev.org 6c37f8cb60 Bug 240521 Crash [@ jsd_NewThreadState] when script is null
r=rginda sr=dmose
2004-08-08 19:56:49 +00:00
igor%mir2.org 792304a2a9 Fixing bug 254778: proper treatment of labels 2004-08-08 13:45:09 +00:00
igor%mir2.org c70ca4f034 More switch parsing/code generation cleanups: now IRFactory constructs the proper parsed tree for the switch statement which removed the need for tree mutations in NodeTransformer and during code generation. 2004-08-07 20:08:38 +00:00
igor%mir2.org 0426521c68 Cleanup for code generation in interpreter: store itsICodeTop as instance variable to avoid clattering code with explicit passing of iCodeTop, 2004-08-07 15:42:13 +00:00
igor%mir2.org 4731a8f0f9 Switch parsing cleanup including reporting syntax error on duplicated default label 2004-08-07 15:39:55 +00:00
igor%mir2.org 87d0f3525d Preparations for 1.6R1 2004-08-06 16:05:40 +00:00
igor%mir2.org 8bcaa1a262 Class-Path entry for Rhino: xmlbean.jar 2004-08-06 15:49:25 +00:00
igor%mir2.org 0d8bd6fe39 Cleanup of call code generation: now it is split into separated functions for optimized/standard function calls. 2004-08-06 15:08:38 +00:00
igor%mir2.org 11ce08544d Removal of no longer used debug name index in Token.CALL/Token.REF_CALL: ScriptRuntime.get(Elem|Prop|Name|Value)FunctionAndThis takes care about debugging themselves. 2004-08-06 15:02:48 +00:00
brendan%mozilla.org 1efe559390 Fix bug 254375 by quoting negative integer property ids in js_obj_toSource. 2004-08-05 08:06:26 +00:00
brendan%mozilla.org ee79316ac0 Remove deadwood left by last checkin (254382, r=cst). 2004-08-05 07:52:45 +00:00
igor%mir2.org 743dad92a4 GeneratedClassLoader is API class and should be listed in apiClasses.properties 2004-08-05 06:06:30 +00:00
brendan%mozilla.org 056f902a8b Comment fixes to track bug 254067. 2004-08-04 18:40:55 +00:00
brendan%mozilla.org 90fdd75baf JSOP_SETGVAR tweak: don't store rval needlessly in the optimized case, there's no chance it has changed. 2004-08-04 18:08:17 +00:00
brendan%mozilla.org d197533455 Remove bogus instanceof equivalence of distinct constructor function objects
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.
2004-08-04 17:56:31 +00:00
igor%mir2.org 0cf7fb3e59 Restoring ScriptRuntime.call: BSF uses it! 2004-08-04 17:42:56 +00:00
igor%mir2.org 53e6af4c84 Allow to pass JS-wrapped instances of org.apache.xmlbeans.XmlCursor and org.apache.xmlbeans.XmlObject to XML constructor to make proper XML objects from them. 2004-08-04 17:32:48 +00:00
igor%mir2.org ec4ab45708 Preparations for Rhino 1.6R1 RC1 2004-08-04 17:28:11 +00:00
igor%mir2.org 4a8da93dda 1. Recently introduced ScriptableObject.default(Prototype|ParentScope)() methods had problems with serialization and are removed now. XML code explicitly sets parent/prototype. To simplify that ScriptableObject now contains a special constructor taking scope and prototype arguments.
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.
2004-08-04 12:54:03 +00:00
brendan%mozilla.org 52ea52a643 Whitespace cleanup. 2004-08-04 02:28:58 +00:00
igor%mir2.org 35ca775423 Preparations for 1.6R1 RC1 2004-08-03 17:13:40 +00:00
igor%mir2.org b73081a5a8 Cosmetics: untabify 2004-08-02 17:49:04 +00:00
brendan%mozilla.org de19ea1b37 Fix trunk version of patch for bug 252892 to handle JSOP_{GET,SET}GVAR (253952). 2004-08-02 17:17:55 +00:00
igor%mir2.org 73d09ce2c9 Added runtime support to allow custom wrapping of XML objects 2004-08-02 14:46:33 +00:00
igor%mir2.org 81e82296c8 Use ScriptRuntime.notAFunction to report bad ScriptableObject.callMethod arguments 2004-08-02 14:44:03 +00:00
igor%mir2.org e32e12b401 Explicit ScriptRuntime methods to get function and function this for all cases of method calls:
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.
2004-08-01 23:21:17 +00:00
igor%mir2.org 49d1f565ca More compatibility renames: to simplify life for applications that use old IdScriptable/IdFunction/IdFunctionMaster I farther renamed:
IdFunction -> IdFunctionObject
IdFunctionMaster -> IdFunctionCall
2004-07-30 13:18:30 +00:00
igor%mir2.org 52f9db3360 Compatibility rename: due to changes in IdScrittable any code that sublasses
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.
2004-07-30 10:31:00 +00:00
igor%mir2.org 1502b14734 The previous patch introduced regression: it is posible for slots array to be filled with slot objects and REMOVED tags. Thus getSlotPosition can loop through the whole table. This patch restores the old and proper state of affairs. 2004-07-30 07:52:30 +00:00
brendan%mozilla.org 1b2f9a0128 - Decorate PN_LIST nodes with pn_extra flags whose constant names describe
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).
2004-07-30 00:00:09 +00:00
igor%mir2.org 6cc1245e38 Using single ScriptRuntime.toStringIdOrIndex to convert object id to string of index key instead of multiple calls to getStringId/getIntId. 2004-07-29 22:47:05 +00:00
igor%mir2.org df2c699cd7 Calling proper ScriptRuntime.call taking scope argument instead of eprectaed old form. 2004-07-29 22:44:45 +00:00
igor%mir2.org b6ed88ed6d New "scratch" field for int indexes to allow to return more then one result from index parsing functions. 2004-07-29 22:42:50 +00:00
igor%mir2.org 1bd4e8e9db Explicitly throw IllegalStateException to indicate code bug when hashtable scan end up in infinite loop. 2004-07-29 22:40:47 +00:00
brendan%mozilla.org 652a45f1d5 Improve JSRESOLVE_DETECTING to handle typeof, ==, !=, etc.; don't give undefined property strict warning for detecting cases (253150, r=shaver). 2004-07-29 20:44:20 +00:00
igor%mir2.org 2bf6166f45 Adding E4X example contributed by John Schneider from AgileDelta, Inc., http://www.agiledelta.com/ . 2004-07-29 15:55:41 +00:00
igor%mir2.org 8a6fdf912e Fixing missed context wrapping in debugger/Dim and proper button enable/dosable in debugger/DebugGui 2004-07-29 12:51:35 +00:00
igor%mir2.org 47eb21b587 Fixing under allocation of ids array while enumerating properties. 2004-07-29 12:46:46 +00:00
igor%mir2.org c62ea82d3d Better error propagation from failed class loading: RuntimeError instances are rethrown while ClassNotFound, LinkageError etc. are caught. 2004-07-29 12:45:55 +00:00
igor%mir2.org 43d1beb31a Renaming StringIdMap to Main and ipdating documentation 2004-07-29 10:44:59 +00:00
igor%mir2.org 7f304859c1 Cleanup patch from Mario Cormier <mcormier@miranda.com> to fix bug 253323:
Parser contained useless this.decompiler = decompiler assignment.
2004-07-29 08:28:42 +00:00
igor%mir2.org 88a3913994 Committing E4X runtime implementation: see enhancement report 242805.
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!
2004-07-28 23:43:17 +00:00
igor%mir2.org 0659e0b714 Committing E4X parser and runtime proxies: see enhancement report 242805.
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!
2004-07-28 21:11:02 +00:00
igor%mir2.org ef41e24058 Added ScriptableObject.equivalentValues to allow for custom equality operator support. 2004-07-28 15:23:11 +00:00
igor%mir2.org d3d45e59da Added Reference.has() for future use. 2004-07-28 15:21:02 +00:00
igor%mir2.org 8799f9f62b Ignore any exception during script class initialization unless it is an instance of RhinoException. In this way lazily class loading or incompatible with the current JVMs jars will simply hide the script variables. 2004-07-28 15:20:08 +00:00
igor%mir2.org e47e67719d Always call Scriptable.has(name, start) as obj.has(name, obj) since the start argument is useless in Scriptable.has and in this way it is possible to add temporary assertions to the code checking this. 2004-07-28 13:27:39 +00:00