Commit Graph

36 Commits

Author SHA1 Message Date
igor%mir2.org
f33158e1f3 Fixing bug #306825: now shell.Global can be used as scope objects in servlets 2005-09-02 14:18:40 +00:00
igor%mir2.org
d6e61cc76d Implementing bug 306419: I added missed serialVersionUID declarations for Serializable classes. 2005-08-30 10:20:21 +00:00
igor%mir2.org
0a9495cbab Fixing 306258: now Rhino can be compiled with Ant under JDK 1.5 2005-08-28 19:51:23 +00:00
igor%mir2.org
c5deb378f3 Fix to make things compilable: getElemFunctionAndThis returns Callable, not Function nowdays. 2005-08-01 13:48:32 +00:00
igor%mir2.org
344cf0f06e Implementing bug 274467: Add JavaScript stack trace to exceptions
The changes are based on that patch from Attila Szegedi, szegedia@freemail.hu.
2005-02-16 19:57:03 +00:00
igor%mir2.org
b482de83cc Implementing bug 280047: Undefined no longer implements Scriptable 2005-01-27 16:35:39 +00:00
igor%mir2.org
31d9030dd0 Reverting Ref to the original implementation which did not pass an additional
"Scriptable target" argument to Ref.(get|set|has|delete) methods. The idea was
to optimize away in many cases creation of Ref instances, but given that modern
JVM can GC short-lived objects efficiently it does not sound right to have code
complexity now in the hope of slightly more efficient implementation later.
2005-01-22 20:26:08 +00:00
igor%mir2.org
b5245d48f0 Fixing bug 277537: implementing isXMLName() 2005-01-14 14:13:56 +00:00
igor%mir2.org
a65d6fbe1c Fixing bug 271545: XML() should bahave exactly as XML("") 2004-11-24 23:16:38 +00:00
igor%mir2.org
5ae3dc38e0 XML no longer implements Wrapper interface. Instead getXmlObject method
is added to access the implementation. In this way all functionality
of Java API in XmlObject is available to scripts if they need it.
2004-11-10 23:13:04 +00:00
igor%mir2.org
993454366a Minimizing memory footprint by eliminating class fields:
1. IdScriptableObject.maxInstanceId is replaced by overridden getMaxInstanceId()

2. BaseFunction.argumentsProperty is replaced by storing when necessary explicit "arguments" property in ScriptableObject hashmap.

3. NativeFunction.(argNames|argCount|version) is replaced by code that reconstruct the necessary values from embedded in class file or InterpreterData (see bug 264637)
2004-10-25 15:44:24 +00:00
igor%mir2.org
02b11dd425 Directory with external jars is renamed from jarlib to lib for consistency with other projects. 2004-10-22 12:36:36 +00:00
igor%mir2.org
4edb63b66a Changing (XML|XMLList).(propertyIsEnumeratable|attribute|child) to confirm to the published ECMA 357 specification. 2004-10-14 07:34:13 +00:00
igor%mir2.org
30a166de64 Removal of autowrapping of XmlObject as XML as it prevents to use full API of XmlObject in JS. Use XML(jsWrapOfXmObject) to get XML corresponding to XmlObject. 2004-10-10 22:54:01 +00:00
igor%mir2.org
f758947174 Implementing Wrapper interface in XML to unwrap to XmlObject and back 2004-10-08 21:04:41 +00:00
igor%mir2.org
c99ef9d21c Yet another reference reorganization:
References now are represented by the pairs (ref, ref_target) where ref is Ref (former Reference) instance and ref_target is Scriptable to apply the reference for.

To return the pair from Reference creation function Context.scratchRefTarget is used to store the target part.

This change allowed to extend XMLName from Ref eliminating the need for XMLReference.
2004-10-03 23:55:04 +00:00
igor%mir2.org
6116e53140 Better error reporting for undefined access:
I changes just added toObject(Contetx cx, Object obj) to
toObjectOrNull(Contetx cx, Object obj) which returns null when obj is undefined
or null. It forces the caller to check to the return status but then much
better error report can be generated since the caller knows the operation that was called upon the undefined or null value.
2004-10-02 22:14:02 +00:00
igor%mir2.org
141e7d2365 Removal of scope argument of runtime functions to access|modify object members. The only reason for the argument was the need to call toObject to convert target object to Scriptable, but since now there is topCallScope available, that one can always be used instead. 2004-10-02 09:45:44 +00:00
igor%mir2.org
402ae75fef Change ScriptRuntime.get(Elem|Prop)FunctionAndThis to treat XML objects specially to follow ECMA 357, 11.2.2.1, CalMethod. This is done to minimize the overhead of method calls as otherwise someXmlObject.method() would first construct XMLList and apply () to it later.
To implement the function call redirection functionality XMLObject.getExtraMethodSource is added() to return an additional object to use as method source.
2004-10-01 22:07:12 +00:00
igor%mir2.org
2208dc8f95 RUnit Software AS as the single owner of copyrights for the following list of files present in Mozilla CVS as of 2004-10-01 15:10 UTC changes the license of the files to NPL/GPL. This is done for consistency with the rest of the source code in Rhino.
List of the affected files:

mozilla/js/rhino/src/org/mozilla/javascript/Callable.java
mozilla/js/rhino/src/org/mozilla/javascript/ClassCache.java
mozilla/js/rhino/src/org/mozilla/javascript/CompilerEnvirons.java
mozilla/js/rhino/src/org/mozilla/javascript/ContextAction.java
mozilla/js/rhino/src/org/mozilla/javascript/ContextFactory.java
mozilla/js/rhino/src/org/mozilla/javascript/Kit.java
mozilla/js/rhino/src/org/mozilla/javascript/Reference.java
mozilla/js/rhino/src/org/mozilla/javascript/SpecialRef.java
mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/GuiCallback.java
mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/test.js
mozilla/js/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLReference.java

Please contact igor@runitsoft.com if you have any questions about this.
2004-10-01 15:11:01 +00:00
igor%mir2.org
59af2f367b More Reference clenups: Reference.delete now returns boolean to follow JS semantic clother and Reference implementation for __proto__|__parent__ is moved to a separated file SpecialRef. 2004-10-01 13:32:14 +00:00
igor%mir2.org
e048fa7512 Replacing calls to XMLLib to construct special name objects to represent qulified names, attributes and descendants by calls to object to get Reference based on name type. It allowed to implement proper namespace resolution in qulified name without forcing activation creation and simplified code.
In addition XMLName is no longer leaked to interpretation stack which would allow to remove unnecessary casts to XMLName in future.
2004-09-30 22:52:40 +00:00
igor%mir2.org
9f63611ce1 1. Reference cleanup:
Signatures in Reference are changed to include Context and reference-related methods in ScriptRuntime accept/return explicit Reference type instead of generic Object as code generation ensure proper type.

2. x..y use explicit reference instead of special descendants mark XMLName:

In this way less code is necessary to support x..y operations and support for .. in non-xml objects is possible.
2004-09-29 20:58:16 +00:00
igor%mir2.org
1f3b183f24 1. Pass Context argument to XMLReference creation method to use it later
to check for strict mode.

2. Fix name lokup bug in XMLReference that caused in cases like
   foo.(@bar == 'something') to throw runtime exception if bar attribute
   does not exist in foo.
2004-09-28 21:56:33 +00:00
igor%mir2.org
985134c0ed 1. Replacing IdScriptableObject.wrap_* methods by their ScriptRuntime.wrap* counterparts since the wrap methods are useful not only for subclasses of IdScriptableObject.
2. Reorganizing execIdCall in few classes inherited from IdScriptableObject to shrink code size.
2004-09-10 18:02:06 +00:00
igor%mir2.org
0aa318e581 XMLLib.escapeXMLAttribute is required to add " arround the text to simplify code generation. 2004-09-10 17:40:59 +00:00
igor%mir2.org
db8822eccc Removal of "throws JavaSriptException" declaration:
JavaSriptException now inherits from RhinoException which inherits from RuntimeException and as such it does not necessary to declare it.

Moreover, it is wrong to use it for the documentation purpose since a  script can also throw EcmaError and WrappedException and a proper documentation would require to document those exceptions as well. But since almost all Rhino functions can potentially execute script code it means that wast majority of functions would bear the declarations, not only code overriding or calling explicitly Function.call/construct. And then the throw declarations would bring no information if it always would be "throws RhinoException". Thus it is better not to litter sources with the declarations at all.
2004-09-08 12:29:59 +00:00
igor%mir2.org
00faaf6ab8 Fixing bug 256691: forcing XML.hasSimpleContent() to return true for atributes and text. 2004-08-24 11:38:59 +00:00
igor%mir2.org
347734a288 Resolving bug 256387: XML objects got toSource implementation 2004-08-21 12:26:43 +00:00
igor%mir2.org
e056c6cd39 Resolving bug 256318: for consistancy with XMLObject.addValues ScriptableObject.equivalentValues also uses NOT_FOUND to indicate no operation available. 2004-08-20 18:05:50 +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
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
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
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