Closed Bug 242805 Opened 20 years ago Closed 20 years ago

Implementation of E4X

Categories

(Rhino Graveyard :: E4X, enhancement)

head
x86
All
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: igor, Assigned: john.schneider)

Details

Attachments

(2 files, 6 obsolete files)

Rhino shoould support E4X extensions to ECMAScript standard.
Summary: Implementation of E4X → Implementation of E4X
You can not change the status of bugs you do not reported or own in bugzilla
unless you have special priviliges. But it is strange that you could not attach
anything. 

Assignee: igor → john.schneider
To John:

I reassigned the bug to you so you can change its status.
John Schneider wrote:
> Hi Igor,
> 
> Thanks again. Attached is the final draft of the E4X specification. Sorry,
> you didn't get a copy of this earlier. I sent one right after the final
> draft went to ECMA for approval, but I think I only sent it to Norris at the
> time. ECMA will post the final version on their web site once it is
> approved. Please let me know if there's anything else I can do to help. 

I assume that until the uproval the draft can not be made public, right? 

> Do you know approximately when you might have time to start the E4X review
> now that you have the spec? We were hoping to get any issues resolved and
> have a version people could download and try out before the standard is
> finalized in late June. 

Well, I can spend some time in June but would like to reiterate my suggesting
about splitting the changes in at least 2 parts, that is the parser changes and
the runtime. AFAICS the parser part is quite reasonable and can be included into
Rhino with simple exception throwing during code generation for e4x parse nodes. 

Then the runtime can be done added by parts together with the class compiler
support. 
Hi Igor,

I'm pleased to inform you that the patch adding the E4X feature set to Mozilla 
Rhino is complete! The attached patch contains the recursive diffs of the 
source code. Also, the full source code, object code and some examples may be 
found at ftp://ftp.mozilla.org/pub/mozilla.org/js/e4x_preview.zip. 

Thanks for all your assistance! You're comments and feedback have been very 
helpful and have improved the quality of the submission substantially. I'm 
anxious to see E4X included in Rhino 1.6! Please let me know if there's 
anything else I can do to assist.

  Thanks!,

  John
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Reopening to have the bug open until the code end up in Rhino CVS
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
This is the version of E4X patch against Rhino tip. During porting I made the
following changes:

1. There are no more static variables to hold prototypes for XML objects. This
is rather verbose change since it introduces omj.xml.XMLLib and passes its
instances to XMLObject, Namespace and QName constructors. XMLLib holds the
current XML settings and initialization scope allowing to setup prototype
chains for XML objects properly. 

2. New class omj.xml.XMLCtor implements all properties and methods of XML
constructor object which made unnecessary modifications in omj.IdFunction and
simplified XML code itself.

3. New class omj.xml.XMLWithScope subclasses omj.NativeWith with XML-specific
stuff which made changes to NativeWith unnecessary. 

4. Allow to pass the current test suite under JDK 1.1 without Apache classes
available. Previously JVM would try to access Apache classes on the first
attempt to check for XML class instance. Under JDK 1.1 it leads to class
initialization. That in turn would initialize static variables which required
to have XML classes. 


To apply the patch pull Rhino sources from CVS, go to mozilla/js/rhino and run 


patch -p1 -i ....e4x_against_rhino_tip.diff
This is the re-factored version of the previous patch that moves all code that
depends on xbean.jar classes into the separated top-level source dir
xmlimplsrc.

The patch assumes that xbean.jar should be placed into jaralib/xbean.jar and
not into external/xbean.jar .

The attached file is gzipped diff so to apply it pull Rhino sources from CVS,
go to mozilla/js/rhino, and run 

gunzip ...e4x_against_rhino_tip.diff.gz | patch -p1
Attachment #152953 - Attachment is obsolete: true
Attachment #153531 - Attachment is obsolete: true
I put Rhino sources with the last patch applied and compiled distribution at
http://www.mir2.org/igor/e4x/ for now.


Attached file Fixing missing xmlimplsrc/build.xml (obsolete) —
The previous version of the patch did not include xmlimplsrc/build.xml which
this version fixes. In addition it will automatically download xbean.jar if it
is not available during compilation with ant.

All the previous comments applies including the note that this is gzipped
unified diff due to bugzilla restrictions on the patch size.
Attachment #153932 - Attachment is obsolete: true
I updated http://www.mir2.org/igor/e4x/ to reflect the last version of the patch
Attached file Resolving compatibility issues (obsolete) —
This version of the patch makes E4X-specific code compatible with Scriptable
semantic leading to less surprises in applications. It also include various
optimizations to minimize number of created objects during XML property access.


http://www.mir2.org/igor/e4x/ is updated with the rebuilt distribution of Rhino
with the patch applied.
The default xml statement in E4X associates the namespace with the current
activation scope. In the previous versions of the patch the current execution
scope was used to set namespace objects. But it does not correspond to the
activation scope due to presence of with/catch statements. The patch addresses
and passes Context instead of Scriptable to many functions expecting to search
for default namespace declaration.

The patch also renames get/put/has/delete methods in XMLScriptable into
getXMLProperty/putXMLProperty/hasXMLProperty/deleteXMLProperty to emphasis
semantical separation from Scriptable method.

As usual the attachment is gzippped diff and http://www.mir2.org/igor/e4x/
contains uncopressed version and prebuilt distributions.
Attachment #153951 - Attachment is obsolete: true
Attachment #154234 - Attachment is obsolete: true
I think the last patch addresses all compatibility issues with the older Rhino
and I will start merging it tomorrow, 2004-07-27 with Rhino tip.
The previous drop was not the final story after all. I have already merged few
non-E4X-specific changes to Rhino CVS already and tag that version with
BEFORE_E4X. 

The version of the patch contains clear separation between E4X parsing and
runtime support. The patch effectively contains all the necessary parser and
code generation changes plus proxies for E4X runtime support. The proxies are
represented by only 2 classes, XMLLib and XMLObject in
org.mozilla.javascript.xml and contain all the necessary hooks that E4X runtime
has to implement.  Patch touches quite a few runtime places to make efficient
E4X support possible, mostly in the form of passing Context instances to most
runtime methods and properly maintaining activation records.

The XML implementation itself is provided in the separated patch (see the next
attachment).

Note that the patch is a normal uncompressed diff.
Attachment #154394 - Attachment is obsolete: true
I committed the last 2 patches: now Rhino CVS tip supports E4X!

I keep the bug open for now since CVS does not include yet examples and
documentation about E4X.
I added the example demostrating E4X features from the initial E4X drop to Rhino
CVS as  examples/E4X/e4x_example.js .

But it would be nice to populate the directory with more code.
I added the example demostrating E4X features from the initial E4X drop to Rhino
CVS as  examples/E4X/e4x_example.js .

But it would be nice to populate the directory with more samples.
Component: Core → E4X
Target Milestone: --- → 1.6R1
E4X test cases is now a part of js test suite that allows to mark the bug as fixed
Status: REOPENED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: