Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Parser API Using Incorrect Operator Associativity

23 views
Skip to first unread message

Masquerade

unread,
Feb 13, 2012, 6:45:42 AM2/13/12
to
This looks like another bug with the Parser API:

a=25;
b=10;
c=8;
e=(a-b-c);

the last assignment statement should mean:
e=((a-b)-c); // e==7

But the Parser API returns a tree that represents:

e=(a-(b-c)); //e==23, wrong result

Is it a real issue?

Many other binary operators suffer the same issue: L-R associativity
becomes R-L.

Jason Orendorff

unread,
Feb 13, 2012, 10:31:55 AM2/13/12
to Masquerade, dev-tech-js-en...@lists.mozilla.org
On 2/13/12 5:45 AM, Masquerade wrote:
> This looks like another bug with the Parser API:
>
> a=25;
> b=10;
> c=8;
> e=(a-b-c);
>
> the last assignment statement should mean:
> e=((a-b)-c); // e==7
>
> But the Parser API returns a tree that represents:
>
> e=(a-(b-c)); //e==23, wrong result
>
> Is it a real issue?

This is bug 630213. It was fixed about a year ago, so it works fine in
Firefox 10 (and several previous releases).

What SpiderMonkey source code are you using?

-j

Masquerade

unread,
Feb 14, 2012, 1:51:41 AM2/14/12
to
I am testing with jsshell of v1.8.5? Should I apply a fix
independently?

Masquerade

unread,
Feb 14, 2012, 2:07:39 AM2/14/12
to
>
> I am testing with jsshell of v1.8.5?  Should I apply a fix
> independently?- Hide quoted text -
>
> - Show quoted text -

here: http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz

This is the most recent standalone source code release.

Jason Orendorff

unread,
Feb 14, 2012, 3:26:52 PM2/14/12
to Masquerade, dev-tech-js-en...@lists.mozilla.org
Oh, don't use that. Use one of these.

Firefox 10 (the current release)
https://hg.mozilla.org/releases/mozilla-release/

Firefox 11 beta
https://hg.mozilla.org/releases/mozilla-beta/

Aurora (this will eventually become Firefox 12)
https://hg.mozilla.org/releases/mozilla-aurora/

Current development (Nightly)
https://hg.mozilla.org/mozilla-central/

I recommend the last one. It is the least stable, but at least if you
find a bug in it, it is not going to be a bug we have already fixed.

-j

Masquerade

unread,
Feb 15, 2012, 2:15:39 AM2/15/12
to
>
> Oh, don't use that. Use one of these.
>
>    Firefox 10 (the current release)
>    https://hg.mozilla.org/releases/mozilla-release/
>
>    Firefox 11 beta
>    https://hg.mozilla.org/releases/mozilla-beta/
>
>    Aurora (this will eventually become Firefox 12)
>    https://hg.mozilla.org/releases/mozilla-aurora/
>
>    Current development (Nightly)
>    https://hg.mozilla.org/mozilla-central/
>
> I recommend the last one. It is the least stable, but at least if you
> find a bug in it, it is not going to be a bug we have already fixed.
>
> -j
Thanks. But just want to clarify a few more points.

Since the links look like the whole Firefox source release, is the
standalone Spidermonkey under the js\ directory? If yes, should I
build it the same way as described in https://developer.mozilla.org
which is for v1.8.5? Also, is the JSAPI backward compatible with
v1.8.5?

Assuming the JSAPI isn't compatible, is it possible to apply the fix
manually into v1.8.5 source? Since bugzilla list out the diff output
for comparing the patch against the old source code.

Masquerade

unread,
Feb 15, 2012, 4:10:16 AM2/15/12
to
On Feb 15, 3:15 pm, Masquerade <msqwe...@yahoo.com> wrote:
> > Oh, don't use that. Use one of these.
>
> >    Firefox 10 (the current release)
> >    https://hg.mozilla.org/releases/mozilla-release/
>
> >    Firefox 11 beta
> >    https://hg.mozilla.org/releases/mozilla-beta/
>
> >    Aurora (this will eventually become Firefox 12)
> >    https://hg.mozilla.org/releases/mozilla-aurora/
>
> >    Current development (Nightly)
> >    https://hg.mozilla.org/mozilla-central/
>
> > I recommend the last one. It is the least stable, but at least if you
> > find a bug in it, it is not going to be a bug we have already fixed.
>
> > -j
>
> Thanks.  But just want to clarify a few more points.
>
> Since the links look like the whole Firefox source release, is the
> standalone Spidermonkey under the js\ directory? If yes, should I
> build it the same way as described inhttps://developer.mozilla.org
> which is for v1.8.5?  Also, is the JSAPI backward compatible with
> v1.8.5?
>
> Assuming the JSAPI isn't compatible, is it possible to apply the fix
> manually into v1.8.5 source? Since bugzilla list out the diff output
> for comparing the patch against the old source code.- Hide quoted text -
>
> - Show quoted text -

What I need is to embed a standalone version spidermonkey in my own
system. One of the use cases is to be able to use the Parser API.

Wes Garland

unread,
Feb 15, 2012, 7:32:36 AM2/15/12
to Masquerade, dev-tech-js-en...@lists.mozilla.org
On 15 February 2012 02:15, Masquerade <msqw...@yahoo.com> wrote:

> Since the links look like the whole Firefox source release, is the
> standalone Spidermonkey under the js\ directory? If yes, should I
> build it the same way as described in https://developer.mozilla.org
> which is for v1.8.5? Also, is the JSAPI backward compatible with
> v1.8.5?
>

Yes, Yes, Mostly

(The biggest task when doing a source release is documenting API changes)


> Assuming the JSAPI isn't compatible, is it possible to apply the fix
> manually into v1.8.5 source? Since bugzilla list out the diff output
> for comparing the patch against the old source code.
>

*IF* the patch applies cleanly and is the only bug causing you problems,
then yes, this would work. Otherwise you are better off going with one of
the versions Jason suggested.

Wes

--
Wesley W. Garland
Director, Product Development
PageMail, Inc.
+1 613 542 2787 x 102

Masquerade

unread,
Feb 15, 2012, 10:20:09 AM2/15/12
to
On Feb 15, 8:32 pm, Wes Garland <w...@page.ca> wrote:
> On 15 February 2012 02:15, Masquerade <msqwe...@yahoo.com> wrote:
>
> > Since the links look like the whole Firefox source release, is the
> > standalone Spidermonkey under the js\ directory? If yes, should I
> > build it the same way as described inhttps://developer.mozilla.org
> > which is for v1.8.5?  Also, is the JSAPI backward compatible with
> > v1.8.5?
>
> Yes, Yes, Mostly
>
> (The biggest task when doing a source release is documenting API changes)
>
> > Assuming the JSAPI isn't compatible, is it possible to apply the fix
> > manually into v1.8.5 source? Since bugzilla list out the diff output
> > for comparing the patch against the old source code.
>
> *IF* the patch applies cleanly and is the only bug causing you problems,
> then yes, this would work.  Otherwise you are better off going with one of
> the versions Jason suggested.
>
> Wes
>
> --
> Wesley W. Garland
> Director, Product Development
> PageMail, Inc.
> +1 613 542 2787 x 102

Seems that the build isn't that straight forward. I followed every
steps for building v1.8.5 except the src directory is the js\src
directory of the FF10 release. I am using WinXPSP3 VC2010. I got
this message when running make:

cl : Command line warning D9025 : overriding '/Fdgenerated.pdb' with '/
Fdhost_ns
install_win.pdb'
make[1]: *** No rule to make target `RangedPtr.h', needed by
`export'. Stop.
make: *** [default] Error 2

Wes Garland

unread,
Feb 15, 2012, 10:36:44 AM2/15/12
to Masquerade, dev-tech-js-en...@lists.mozilla.org
I don't know anything about windows, but maybe you should check the
compiler requirements etc for building Firefox and match those.

Wes
> _______________________________________________
> dev-tech-js-engine-internals mailing list
> dev-tech-js-en...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Tom Schuster

unread,
Feb 15, 2012, 11:00:50 AM2/15/12
to Wes Garland, Masquerade, dev-tech-js-en...@lists.mozilla.org
You can get the latest nightly version of the js shell. Just look at
http://ftp.mozilla.org/pub/mozilla.org/mobile/nightly/

For example
http://ftp.mozilla.org/pub/mozilla.org/mobile/nightly/latest-mozilla-central-linux/jsshell-linux-i686.zip

Tom

On Wed, Feb 15, 2012 at 4:36 PM, Wes Garland <w...@page.ca> wrote:
> I don't know anything about windows, but maybe you should check the
> compiler requirements etc for building Firefox and match those.
>
> Wes
>
> On 15 February 2012 10:20, Masquerade <msqw...@yahoo.com> wrote:
>
>> _______________________________________________
>> dev-tech-js-engine-internals mailing list
>> dev-tech-js-en...@lists.mozilla.org
>> https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals
>>
>
>
>
> --
> Wesley W. Garland
> Director, Product Development
> PageMail, Inc.
> +1 613 542 2787 x 102

Terrence Cole

unread,
Feb 15, 2012, 1:18:51 PM2/15/12
to dev-tech-js-en...@lists.mozilla.org, msqw...@yahoo.com
I'm not sure exactly when it happens, but RangedPtr.h should get copied
into $objdir/dist/include/mozilla from $srcdir/mfbt when you configured.

What I do to build is:
1) Run autoconf-2.13 (version is important here) from inside
$srcdir/js/src.
2) Run $srcdir/js/src/configure from inside $objdir.
3) Run make from inside $objdir.

-Terrence

Masquerade

unread,
Feb 15, 2012, 2:04:26 PM2/15/12
to
I did run autoconf-2.13 before running configure and getting the error
msg.

A quick search reveals that there is no such a file called RangedPtr.h
in the whole js\src directory - not even under js\.

Jeff Walden

unread,
Feb 15, 2012, 11:20:28 PM2/15/12
to
On 02/14/2012 11:15 PM, Masquerade wrote:
> Since the links look like the whole Firefox source release, is the
> standalone Spidermonkey under the js\ directory?

Yes, but that directory's not sufficient to do a complete build. The JS engine depends upon a small set of files shared with the rest of Gecko, located in the mfbt/ directory. This allows us to share some macros, algorithms, data structures, and their implementations with the browser. If you have mfbt/ and js/src/, I think you have everything you need. To the best of my knowledge, you should still be able to build the JS engine using the standard configure/make process inside js/src/ -- it'll do a little extra work to pick up (and as of yesterday, also compile, in one instance) the mfbt/ files itself.

Jeff
0 new messages