Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
E4X support in mozilla?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 32 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mario Klaue  
View profile  
 More options Dec 30 2004, 6:30 pm
Newsgroups: netscape.public.mozilla.jseng
From: "Mario Klaue" <mario.kl...@snafu.de>
Date: Fri, 31 Dec 2004 00:30:59 +0100
Local: Thurs, Dec 30 2004 6:30 pm
Subject: E4X support in mozilla?
Hello,

does anybody know how and when to get the opportunity to play with
ECMAScript for XML (E4X) in a browser?

Thanks.

Mario Klaue


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brendan Eich  
View profile  
(1 user)  More options Dec 30 2004, 10:21 pm
Newsgroups: netscape.public.mozilla.jseng
From: Brendan Eich <bren...@meer.net>
Date: Thu, 30 Dec 2004 19:21:23 -0800
Local: Thurs, Dec 30 2004 10:21 pm
Subject: Re: E4X support in mozilla?

Mario Klaue wrote:
> Hello,

> does anybody know how and when to get the opportunity to play with
> ECMAScript for XML (E4X) in a browser?

It's about to be turned on for 1.8a6.  It will be enabled by default in
XUL scripts and in JS XPCOM components.  To enable it in HTML script
tags, you'll have to specify type="application/x-javascript;e4x=1" or
type="text/javascript;e4x=1" in the tag.

/be


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marek Lewczuk  
View profile  
 More options Jan 1 2005, 5:32 am
Newsgroups: netscape.public.mozilla.jseng
From: Marek Lewczuk <marek@_CUT-THIS-NOSPAM_lewczuk.com>
Date: Sat, 01 Jan 2005 11:32:43 +0100
Local: Sat, Jan 1 2005 5:32 am
Subject: Re: E4X support in mozilla?
Brendan Eich napisał(a):

> Mario Klaue wrote:

>> Hello,

>> does anybody know how and when to get the opportunity to play with
>> ECMAScript for XML (E4X) in a browser?

> It's about to be turned on for 1.8a6.  It will be enabled by default in
> XUL scripts and in JS XPCOM components.  To enable it in HTML script
> tags, you'll have to specify type="application/x-javascript;e4x=1" or
> type="text/javascript;e4x=1" in the tag.

> /be

Brendan,
Can you tell what is the current status of Javascript 2.0 ? Thanks in
advance for any answer.

ML


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Shanti Rao  
View profile  
 More options Jan 2 2005, 1:13 am
Newsgroups: netscape.public.mozilla.jseng
From: Shanti Rao <shanti...@yahoo.com>
Date: Sat, 01 Jan 2005 22:13:20 -0800
Local: Sun, Jan 2 2005 1:13 am
Subject: Re: E4X support in mozilla?

Hi Brendan,

Though terrified, I might as well make the best of it.

1. Is the version number going to change to 1.6 or similar?

2. How can I get the current SM code for E4X? Is it in the nightly tarballs?

Thanks,

Shanti


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brendan Eich  
View profile  
 More options Jan 2 2005, 12:43 pm
Newsgroups: netscape.public.mozilla.jseng
From: Brendan Eich <bren...@meer.net>
Date: Sun, 02 Jan 2005 09:43:20 -0800
Local: Sun, Jan 2 2005 12:43 pm
Subject: Re: E4X support in mozilla?

Shanti Rao wrote:
> Brendan Eich wrote:

>> To enable it in HTML script tags, you'll have to specify
>> type="application/x-javascript;e4x=1" or type="text/javascript;e4x=1"
>> in the tag.

>> /be

> Hi Brendan,

> Though terrified, I might as well make the best of it.

Why terrified?  E4X won't hurt ya! ;-)

> 1. Is the version number going to change to 1.6 or similar?

No.  E4X is orthogonal to the JS version.  The way to select it is with
the MIME type.  The language= attribute has been deprecated by HTML 4.x
for a while now (for all that's worth ;-).

> 2. How can I get the current SM code for E4X? Is it in the nightly
> tarballs?

It's in the CVS trunk so any release off the trunk (nightly builds,
didn't know we released tarballs) will have it.

/be


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Shanti Rao  
View profile  
 More options Jan 2 2005, 6:50 pm
Newsgroups: netscape.public.mozilla.jseng
From: Shanti Rao <shanti...@yahoo.com>
Date: Sun, 02 Jan 2005 15:50:49 -0800
Local: Sun, Jan 2 2005 6:50 pm
Subject: Re: E4X support in mozilla?

<rant>
Ain't broke, don't fix. It's not hard to write a fault-tolerant XML parser in
JS, and how do I know that the choices made in designing E4X are going to be
the ones I desire or expect? See earlier discussion about JS2.0 for inherent
reticence to embrace changes to languages that underpin complex systems.

E4X appears to take a vocabulary (E) and force it onto an object model (X). I
would have been a lot happier if the designers had started with a clear data
processing objective, and invented a vocabulary to match. What we have now
looks a lot like a camel.

Consider some sample code from
http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-357...

var twoemployees = e.employee.(@id == 0 || @id == 1);
for each (var p in e..employee) { ... }

What's this @ stuff? Perl is the language of obscure punctuation, not
JavaScript! I just know that some newbie is going to look at that and think
that they can get away with that sort of syntax for any JS object, then call
me and wonder why it doesn't work. Then they'll ask how many dots are supposed
to be between e and employee. And I won't have a clue?

I wish that the E4X designers had put compactness of syntax secondary to
clarity of purpose.
</rant>

>> 1. Is the version number going to change to 1.6 or similar?

> No.  E4X is orthogonal to the JS version.  The way to select it is with
> the MIME type.  The language= attribute has been deprecated by HTML 4.x
> for a while now (for all that's worth ;-).

There have been enough changes since 1.5rc6a that you might consider a new
version number. The ATLINE option is new, and XML hooks are pervasive.

I'm reading through jsxml.c, and notice that you sensibly observe that >
escaping isn't necessary. Can you explain the testcase

It will be interesting to figure out how namespaces work. Do namespaces go
into the global string hash table?

>> 2. How can I get the current SM code for E4X? Is it in the nightly
>> tarballs?

> It's in the CVS trunk so any release off the trunk (nightly builds,
> didn't know we released tarballs) will have it.

ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/nightly/latest-trunk/mo...

> /be

Thanks,

Shanti


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brendan Eich  
View profile  
 More options Jan 3 2005, 5:07 pm
Newsgroups: netscape.public.mozilla.jseng
From: Brendan Eich <bren...@meer.net>
Date: Mon, 03 Jan 2005 14:07:01 -0800
Local: Mon, Jan 3 2005 5:07 pm
Subject: Re: E4X support in mozilla?

Shanti Rao wrote:
> <rant>
> Ain't broke, don't fix. It's not hard to write a fault-tolerant XML
> parser in JS, and how do I know that the choices made in designing E4X
> are going to be the ones I desire or expect?

E4X folks designed (and hacked, a lot -- one prototype based on Rhino
predates the standard, woohoo!) with XQuery and other XML standards in
mind.  They separated data model from syntax, and built on xml-infoset
(errata notwithstanding; the spec's being fixed for ISO).

> See earlier discussion
> about JS2.0 for inherent reticence to embrace changes to languages that
> underpin complex systems.

That's a bit to general to work with. :-/

> E4X appears to take a vocabulary (E) and force it onto an object model
> (X). I would have been a lot happier if the designers had started with a
> clear data processing objective, and invented a vocabulary to match.

I'm pretty sure they did that, but I wasn't around, so I'll defer to
others who may know better.

> What we have now looks a lot like a camel.

Camels are useful, even if Ugly.  You know you're dangerously close to
insulting Perl here... ;-)

> Consider some sample code from
> http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-357...

> var twoemployees = e.employee.(@id == 0 || @id == 1);
> for each (var p in e..employee) { ... }

> What's this @ stuff?

Attributes are in a separate namespace with a distinct operator
prefixing literal name uses.  This is based directly on XQuery, IIRC.

> Perl is the language of obscure punctuation,

You're now over the edge.

Look, @attrname is not obscure, and if you don't like at-signs, think of
them as "at"tribute signs.  JS+E4X is not Perl by a long shot, but I'm
not about to join you in knocking Perl.  And I don't mean Perl 6,
either, I mean Perl 5, hack that it is.  Hacks can be useful.

> I just know that some newbie is going to look at that and
> think that they can get away with that sort of syntax for any JS object,
> then call me and wonder why it doesn't work.

They'll get a clear diagnostic.  You can't write 42() in JS and have it
evaluate to 42, either -- why aren't newbies confused by that?  Newbies
don't just throw in @ because it looks cool (or you have a lower grade
of newbie than you should tolerate).

> Then they'll ask how many
> dots are supposed to be between e and employee. And I won't have a clue?

... is used in C-like languages, but maybe three times is the charm.

> I wish that the E4X designers had put compactness of syntax secondary to
> clarity of purpose.

In a few places, I agree with you, but JS already loses to Python (never
mind Perl) in the estimation of people I respect because of JS's C/Java
verbosity, both for block structure and control keywords, and in the
lower-level sub-grammars.  And Python is winning while we all wait for
Perl 6.

So there has to be a fine balance between conciseness and readability,
and I think E4X gets it mostly right.

> There have been enough changes since 1.5rc6a that you might consider a
> new version number. The ATLINE option is new, and XML hooks are pervasive.

JSOPTION_ATLINE is a tiny API option for XUL preprocessing, it hardly
merits a version trip.

The XML hooks are indeed pervasive, but that's an implementation detail.
  The language doesn't change unless you both compile-time enable *and*
run-time enable E4X.  The version number is for the language, not for
the implementation.

> I'm reading through jsxml.c, and notice that you sensibly observe that >
> escaping isn't necessary. Can you explain the testcase

What testcase?

> It will be interesting to figure out how namespaces work. Do namespaces
> go into the global string hash table?

What global string hash table?  I think you are mixing up implementation
details, but if you have a language question about namespaces, I can
help.  E4X namespaces are being made consistent with namespaces in
Edition 4 (JS2, ActionScript 2).

/be


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Shanti Rao  
View profile  
 More options Jan 3 2005, 6:00 pm
Newsgroups: netscape.public.mozilla.jseng
From: Shanti Rao <shanti...@yahoo.com>
Date: Mon, 03 Jan 2005 15:00:16 -0800
Local: Mon, Jan 3 2005 6:00 pm
Subject: Re: E4X support in mozilla?

> don't just throw in @ because it looks cool (or you have a lower grade
> of newbie than you should tolerate).

Well, my newbies are corporate IT-types. Visual Basic and JavaScript are what
they're familiar with, and they find Python scary and UNIX-centric (though
it's getting better) and Perl unreadable.

Perhaps it's inevetible that a language aquires complexity until it's
sufficient complex that an opportunity for a new language is created?

Shanti


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brendan Eich  
View profile  
 More options Jan 3 2005, 10:46 pm
Newsgroups: netscape.public.mozilla.jseng
From: Brendan Eich <bren...@meer.net>
Date: Mon, 03 Jan 2005 19:46:04 -0800
Local: Mon, Jan 3 2005 10:46 pm
Subject: Re: E4X support in mozilla?

Shanti Rao wrote:

> Perhaps it's inevetible that a language aquires complexity until it's
> sufficient complex that an opportunity for a new language is created?

Possibly, and there should be, and will be, new and better languages
(already are, but since worse is better, many "better" ones lost in a
Darwinian who's-on-first contest).

But I'd say JS+E4X is ahead of the curve, judging from the rise of XML
and the E4X envy seen among the Python and Ruby folks ;-).  And the
complexity is not terrible, but I agree it could be simpler.  Adding
namespaces is a big complexity increase, and all evidence we and others
(Micah Dubinko, e.g.) have say that namespaces are the most error-prone
part of practical XML.

But that's a problem not peculiar to E4X.

/be


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Shanti Rao  
View profile  
 More options Jan 4 2005, 1:43 pm
Newsgroups: netscape.public.mozilla.jseng
From: Shanti Rao <shanti...@yahoo.com>
Date: Tue, 04 Jan 2005 10:43:01 -0800
Local: Tues, Jan 4 2005 1:43 pm
Subject: Re: E4X support in mozilla?
Brendan,

1. What's JSScript::numGlobalVars for?

2. Do you recommend editing jsconfig.h to set JS_HAS_XML_SUPPORT = 1?

Thanks,

Shanti


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brendan Eich  
View profile  
 More options Jan 5 2005, 10:31 pm
Newsgroups: netscape.public.mozilla.jseng
From: Brendan Eich <bren...@meer.net>
Date: Wed, 05 Jan 2005 19:31:14 -0800
Local: Wed, Jan 5 2005 10:31 pm
Subject: Re: E4X support in mozilla?

Shanti Rao wrote:
> Brendan,

> 1. What's JSScript::numGlobalVars for?

It counts one more than the greatest atom index of all declared global
variables and regular expressions in the script.  It's used for the fast
global optimization (see bug 169559, fixed, and follow-on bug 276249).

> 2. Do you recommend editing jsconfig.h to set JS_HAS_XML_SUPPORT = 1?

It's on in the CVS trunk, so I should think so! ;-)

/be


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Georg Maaß  
View profile  
 More options Jan 6 2005, 10:39 am
Newsgroups: netscape.public.mozilla.jseng
From: Georg Maaß <ge...@bioshop.de>
Date: Thu, 06 Jan 2005 16:39:41 +0100
Local: Thurs, Jan 6 2005 10:39 am
Subject: Re: E4X support in mozilla?

Brendan Eich wrote:
> You can't write 42() in JS and have it
> evaluate to 42,

Are you sure?

I get, what I expect:

Error: number is not a function

This is not 42.

--
Georg Maaß   -   bioshop.de    D-76227 Karlsruhe, Westmarkstraße 82
HTML, XML / JavaScript, C++, Java, PHP, VB / CGI, JSP, ASP, ASP.net
   - The ultimate DHTML engine: http://gml-modul.sourceforge.net -
                       http://sourceforge.net/projects/gml-modul


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brendan Eich  
View profile  
 More options Jan 6 2005, 1:46 pm
Newsgroups: netscape.public.mozilla.jseng
From: Brendan Eich <bren...@meer.net>
Date: Thu, 06 Jan 2005 10:46:39 -0800
Local: Thurs, Jan 6 2005 1:46 pm
Subject: Re: E4X support in mozilla?

Georg Maaß wrote:
> Brendan Eich wrote:

>> You can't write 42() in JS and have it evaluate to 42,

> Are you sure?

> I get, what I expect:

> Error: number is not a function

> This is not 42.

Right -- I wrote "can't", not "can" above ;-).

Have you had a chance to try E4X in SpiderMonkey yet?  The DOM binding
is not done yet, but you can write

<script type="text/javascript;e4x=1">
var x = <t><u id="1">one</u><u id="2">two</u><u id="3">three</u></t>;
alert(x.toXMLString());
</script>

and other such things.  E4X is also enabled in JS XPCOM components, and
it's being used there for the Lightning project
(http://wiki.mozilla.org/index.php/Calendar:Lightning).

/be


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martin Honnen  
View profile  
 More options Jan 6 2005, 3:09 pm
Newsgroups: netscape.public.mozilla.jseng
From: Martin Honnen <mahotr...@yahoo.de>
Date: Thu, 06 Jan 2005 21:09:45 +0100
Local: Thurs, Jan 6 2005 3:09 pm
Subject: Re: E4X support in mozilla?

Brendan Eich wrote:
> <script type="text/javascript;e4x=1">
> var x = <t><u id="1">one</u><u id="2">two</u><u id="3">three</u></t>;
> alert(x.toXMLString());
> </script>

What is happening if I have several script elements in a HTML document,
some saying
   <script type="text/javascript;e4x=1">
some
   <script type="text/javascript">
will they share variables? It seems they do here with a Mozilla nightly
some days old.

It also seems
   typeof XML
is function event in
   <script type="text/javascript">
blocks. Does that mean it is possible to construct native XML object
with new XML() in <script type="text/javascript"> blocks, only parsing
of XML "literals" wouldn't work there?

As for that <script type="text/javascript;e4x=1"> Content-Type notation,
is that something that Mozilla has "invented" to enable web developers
to distinguish between "normal" JavaScript and E4X enabled JavaScript or
is that something the participants in the ECMA working group have agreed
on? Unfortunately Opera browers for instance try to consume such <script
type="text/javascript;e4x=1"> and then obviously throw syntax errors.

--

        Martin Honnen
        http://JavaScript.FAQTs.com/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Shanti Rao  
View profile  
 More options Jan 6 2005, 6:21 pm
Newsgroups: netscape.public.mozilla.jseng
From: Shanti Rao <shanti...@yahoo.com>
Date: Thu, 06 Jan 2005 15:21:33 -0800
Local: Thurs, Jan 6 2005 6:21 pm
Subject: Re: E4X support in mozilla?
Well, I've compiled it, and it seems to work. It even seems to coexist with my
existing XML classes. If anyone wants, there's a precompiled Windows binary at
www.jsdb.org.

Shanti


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brendan Eich  
View profile  
 More options Jan 6 2005, 6:47 pm
Newsgroups: netscape.public.mozilla.jseng
From: Brendan Eich <bren...@meer.net>
Date: Thu, 06 Jan 2005 15:47:36 -0800
Local: Thurs, Jan 6 2005 6:47 pm
Subject: Re: E4X support in mozilla?

Sure, scripts in the same document all share the same global object,
namely the window object.

This doesn't change, nor should it.

What does change, and it's big in terms of web compatibility, is that
the old-as-JS "script hiding hack" for hiding inline script content from
browsers that don't understand JS (are there any, nowadays?):

   <script language="JavaScript">
   <!-- hide from old browsers
   function foo() {...}
   // etc.
   // done hiding from old browsers -->
   </script>

does not work in <script type="text/javascript; e4x=1">...</script>
content, because E4X says that <!-- starts an XML comment.

> It also seems
>   typeof XML
> is function event in
>   <script type="text/javascript">
> blocks. Does that mean it is possible to construct native XML object
> with new XML() in <script type="text/javascript"> blocks, only parsing
> of XML "literals" wouldn't work there?

Yes.  I didn't want to add unnecessary runtime checks, and reckoned that
it's better to define XML unconditionally.  This smoked out some const
XML = ... cases in Firefox help, but they turned out to be dead consts,
and they were removed.

If predefining XML, XMLList, Namespace, QName, and isXMLName breaks
compatibility too much, we can add more runtime option-checking.  But I
want to find out, so getting this level of support into 1.8a6 should,
and getting that alpha wide distribution and testing among hackers who
can report good bugs, will help.

> As for that <script type="text/javascript;e4x=1"> Content-Type notation,
> is that something that Mozilla has "invented" to enable web developers
> to distinguish between "normal" JavaScript and E4X enabled JavaScript or
> is that something the participants in the ECMA working group have agreed
> on?

It's Mozilla-only, and E4X implemented in SpiderMonkey is the first such
browser implementation that I know of.  Someone tell me if there's
another browser that does E4X already.

I'm trying to get the ECMA TG1 group to help the w3c do the right thing
with the content types that the w3c has made up without bothering to
register them with the IETF (nowadays, with the IANA -- see
http://www.iana.org/).

> Unfortunately Opera browers for instance try to consume such <script
> type="text/javascript;e4x=1"> and then obviously throw syntax errors.

That is unfortunate.  Does Opera do anything with any version parameter
(or with "JavaScript1.2" as the language attribute's value, if type is
not used)?  We could make a new version of the language, but if it
doesn't help hide E4X content from other browsers, then there's no point.

As you'd expect from past history with other JS innovations (if anyone
recalls the JS1.2 and ECMA Editions 1-3 rollouts), attempts to use E4X
on the web will require good browser sniffing and content selection on
the server side, not just good script tag version/option control in
static content.

In the mean while, E4X is good for use in private pages, and especially
in JS XPCOM components and in XUL.  Even without the DOM two-way binding
that remains to be done, it's handy.

/be


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bob Clary  
View profile  
 More options Jan 6 2005, 7:38 pm
Newsgroups: netscape.public.mozilla.jseng
From: Bob Clary <m...@bclary.com>
Date: Thu, 06 Jan 2005 19:38:03 -0500
Local: Thurs, Jan 6 2005 7:38 pm
Subject: Re: E4X support in mozilla?

Brendan Eich wrote:
>> Unfortunately Opera browers for instance try to consume such <script
>> type="text/javascript;e4x=1"> and then obviously throw syntax errors.

> That is unfortunate.  Does Opera do anything with any version parameter
> (or with "JavaScript1.2" as the language attribute's value, if type is
> not used)?  We could make a new version of the language, but if it
> doesn't help hide E4X content from other browsers, then there's no point.

neither Opera or Konqueror respect language version specified by the
|language| or |type| attributes of the script tag. like mikey, they will
  attempt to execute anything.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Shanti Rao  
View profile  
 More options Jan 7 2005, 2:25 am
Newsgroups: netscape.public.mozilla.jseng
From: Shanti Rao <shanti...@yahoo.com>
Date: Thu, 06 Jan 2005 23:25:40 -0800
Local: Fri, Jan 7 2005 2:25 am
Subject: Re: E4X support in mozilla?

Brendan Eich wrote:
> Shanti Rao wrote:

>> Brendan,

>> 1. What's JSScript::numGlobalVars for?

> It counts one more than the greatest atom index of all declared global
> variables and regular expressions in the script.  It's used for the fast
> global optimization (see bug 169559, fixed, and follow-on bug 276249).

It looks like if you want to serialize a script, you're limited to 65535
global objects? I'm noticing that js_XDRScript() only keeps 16 bits at
jsscript.c#429. Does anyone even use that feature anymore? Is the iPlanet
server still in print?

Shanti


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martin Honnen  
View profile  
 More options Jan 7 2005, 10:11 am
Newsgroups: netscape.public.mozilla.jseng
From: Martin Honnen <mahotr...@yahoo.de>
Date: Fri, 07 Jan 2005 16:11:21 +0100
Local: Fri, Jan 7 2005 10:11 am
Subject: Re: E4X support in mozilla?

Brendan Eich wrote:
>> It also seems
>>   typeof XML
>> is function event in
>>   <script type="text/javascript">
>> blocks. Does that mean it is possible to construct native XML object
>> with new XML() in <script type="text/javascript"> blocks, only parsing
>> of XML "literals" wouldn't work there?

> Yes.  

Should trying to parse XML source from string with
   new XML('<root>content</root>')
work then in <script type="text/javascript" blocks?
It seems it doesn't, the XML function is available but calling it with
some well-formed XML causes an error, test case is here
<http://home.arcor.de/martin.honnen/javascript/200501/test2005010703.html>
Error in the JavaScript console is

Error: invalid XML markup
Source File:
Line: 1
Source Code:
<parent xmlns=''><god>Kibo</god></parent>

tested with Mozilla 1.8a nightly 2005010606.

If I use <script type="text/javascript; e4x=1"> then all is fine:
<http://home.arcor.de/martin.honnen/javascript/200501/test2005010702.html>
so maybe I am just misunderstanding your "yes" above.

Would it be possible to enable e4x in the xpcshell.exe that is build
with Mozilla nightlies? That way one could test core e4x functionality
there.

--

        Martin Honnen
        http://JavaScript.FAQTs.com/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brendan Eich  
View profile  
 More options Jan 7 2005, 1:10 pm
Newsgroups: netscape.public.mozilla.jseng
From: Brendan Eich <bren...@meer.net>
Date: Fri, 07 Jan 2005 10:10:08 -0800
Local: Fri, Jan 7 2005 1:10 pm
Subject: Re: E4X support in mozilla?

Shanti Rao wrote:
> It looks like if you want to serialize a script, you're limited to 65535
> global objects? I'm noticing that js_XDRScript() only keeps 16 bits at
> jsscript.c#429. Does anyone even use that feature anymore? Is the
> iPlanet server still in print?

Yes, XDR is used every time you restart Firefox, Thunderbird, Mozilla,
etc. as part of XUL FastLoad.

No, there's no new limit here: atom indexes stored as immediate operands
in bytecode were always two bytes, so always limited to maximum value of
65535.

/be


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brendan Eich  
View profile  
 More options Jan 7 2005, 1:14 pm
Newsgroups: netscape.public.mozilla.jseng
From: Brendan Eich <bren...@meer.net>
Date: Fri, 07 Jan 2005 10:14:57 -0800
Local: Fri, Jan 7 2005 1:14 pm
Subject: Re: E4X support in mozilla?

Martin Honnen wrote:

> Should trying to parse XML source from string with
>   new XML('<root>content</root>')
> work then in <script type="text/javascript" blocks?

No, you need to enable e4x=1.  Again, the XML constructor is exposed to
catch name collisions, not to be useful without the option parameter in
the MIME type.

If this seems wrong, let me know what's less wrong:
(1) turning off XML, etc., in the absence of e4x=1;
(2) magically turning E4X support on in spite of no e4x=1 when a script
calls XML, or Namespace, or ....

I think (2) is crazy.  (1) is do-able, but again, I wanted to smoke out
name collisions during 1.8a6.

/be


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martin Honnen  
View profile  
 More options Jan 7 2005, 2:56 pm
Newsgroups: netscape.public.mozilla.jseng
From: Martin Honnen <mahotr...@yahoo.de>
Date: Fri, 07 Jan 2005 20:56:36 +0100
Local: Fri, Jan 7 2005 2:56 pm
Subject: Re: E4X support in mozilla?

Brendan Eich wrote:
> Martin Honnen wrote:

>> Should trying to parse XML source from string with
>>   new XML('<root>content</root>')
>> work then in <script type="text/javascript" blocks?

> No, you need to enable e4x=1.  Again, the XML constructor is exposed to
> catch name collisions, not to be useful without the option parameter in
> the MIME type.

OK, fine with me, just wanted to understand.

--

        Martin Honnen
        http://JavaScript.FAQTs.com/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bob Clary  
View profile  
 More options Jan 7 2005, 8:34 pm
Newsgroups: netscape.public.mozilla.jseng
From: Bob Clary <m...@bclary.com>
Date: Fri, 07 Jan 2005 20:34:13 -0500
Local: Fri, Jan 7 2005 8:34 pm
Subject: Re: E4X support in mozilla?

Bob Clary wrote:

> neither Opera or Konqueror respect language version specified by the
> |language| or |type| attributes of the script tag. like mikey, they will
>  attempt to execute anything.

To clarify:

<http://bclary.com/2004/09/26/javascript/external.html>
<http://bclary.com/2004/09/26/javascript/inline.html>

Firefox 1.0 WinXPSP2
Executes language attribute version up to 1.5
Executes if type="text/javascript;version=xx" up to 1.5
Executes if type="text/javascript;e4x=1"
js language == 1.5
js type == 1.5
e4x == 1

MSIE6 WinXPSP2
Executes language attribute version up to 1.3
Executes if type="text/javascript", ignores if version specified
Ignores if type="text/javascript;e4x=1"
js language == 1.3
js type == default
e4x == undefined

Opera 7.54 WinXPSP2
Executes language attribute version up to 1.5
Executes if type="text/javascript;version=xx" up to anything
Executes if type="text/javascript;e4x=1"
js language == 1.5
js type == 99.99
e4x == 1

Konqueror 3.2.1 SuSe 9.1
Executes language attribute version up to anything
Executes if type="text/javascript;version=xx" up to anything
Executes if type="text/javascript;e4x=1"
js language == 99.99
js type == 99.99
e4x == 1


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nickolay Ponomarev  
View profile  
 More options Jan 8 2005, 3:38 am
Newsgroups: netscape.public.mozilla.jseng
From: "Nickolay Ponomarev" <asquee...@gmail.com>
Date: 8 Jan 2005 00:38:51 -0800
Local: Sat, Jan 8 2005 3:38 am
Subject: Re: E4X support in mozilla?

Brendan Eich wrote:
>In the mean while, E4X is good for use in private pages, and
>especially in JS XPCOM components and in XUL. Even without binding
>the DOM two-way  that remains to be done, it's handy.

Is E4X supposed to work in XUL scripts now? I tried to load the
following XUL file, and it didn't work (I tried it without type
attribute and from an extension; tested with 20040107 Firefox build).
Your example above (script in an HTML file) worked...

Nick

The XUL file:
----
<window
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript;e4x=1"><![CDATA[
var x = <t><u id="1">one</u><u id="2">two</u><u id="3">three</u></t>;
alert(x.toXMLString());
]]></script>
</window>
----


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Georg Maaß  
View profile  
 More options Jan 8 2005, 1:50 pm
Newsgroups: netscape.public.mozilla.jseng
From: Georg Maaß <ge...@bioshop.de>
Date: Sat, 08 Jan 2005 19:50:14 +0100
Local: Sat, Jan 8 2005 1:50 pm
Subject: Re: E4X support in mozilla?
Brendan Eich wrote:
> No, you need to enable e4x=1.  Again, the XML constructor is exposed to

                              ^
What is this 1? Is this a flag, or is it a version number, or what is
the meaning of this 1?

Greetings, Georg
--
Georg Maaß   -   bioshop.de    D-76227 Karlsruhe, Westmarkstraße 82
HTML, XML / JavaScript, C++, Java, PHP, VB / CGI, JSP, ASP, ASP.net
   - The ultimate DHTML engine: http://gml-modul.sourceforge.net -
                       http://sourceforge.net/projects/gml-modul


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 32   Newer >
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google