JavaScript 1.7 in XUL?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

JavaScript 1.7 in XUL?

mixit
As referenced in
http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7, the
necessary flags to enable certain 1.7 features are:
  <script type="application/javascript;version=1.7"/>
in an HTML file, and:
   version(170);
in Javascript Shell.

However, I can't get either to work in XUL files. The expectation is
that the following should work but:

  <script src="chrome://myextension/content/library.js"
type="application/javascript;version=1.7" />

has no effect enabling the JS1.7 features like 'yield' or 'let'.

Has anyone had any success in enabling these features in XUL?
I'm not talking about the array comprehensions or multiple return
values as these work anyway
without the flags
but specificly those features associated with Iterators and Generators
like 'yield'.

regards
si

_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: JavaScript 1.7 in XUL?

Nickolay Ponomarev
On 21 Dec 2006 09:30:49 -0800, mixit <[hidden email]> wrote:
> As referenced in
> http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7, the
> necessary flags to enable certain 1.7 features are:
>   <script type="application/javascript;version=1.7"/>
> in an HTML file, and:
>    version(170);
> in Javascript Shell.
>
> However, I can't get either to work in XUL files.

As I said, this appears to work for me with a simple testcase. Post
the testcase you use.

Nickolay
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: JavaScript 1.7 in XUL?

mixit
In reply to this post by mixit
actually no, you didn't say you got this to work -  you said for me to
file bug report.
You are saying that your simple testcase works with chrome://
referrences?
If so then please post yours...

I'm putting together a test case that demonstrates this problem but it
won't be ready for a few hours
as I have to make it an extension

Nickolay Ponomarev wrote:

> On 21 Dec 2006 09:30:49 -0800, mixit <[hidden email]> wrote:
> > As referenced in
> > http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7, the
> > necessary flags to enable certain 1.7 features are:
> >   <script type="application/javascript;version=1.7"/>
> > in an HTML file, and:
> >    version(170);
> > in Javascript Shell.
> >
> > However, I can't get either to work in XUL files.
>
> As I said, this appears to work for me with a simple testcase. Post
> the testcase you use.
>
> Nickolay

_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: JavaScript 1.7 in XUL?

Nickolay Ponomarev
On 21 Dec 2006 10:10:27 -0800, mixit <[hidden email]> wrote:

> actually no, you didn't say you got this to work -  you said for me to
> file bug report.
> You are saying that your simple testcase works with chrome://
> referrences?
> If so then please post yours...
>
> I'm putting together a test case that demonstrates this problem but it
> won't be ready for a few hours
> as I have to make it an extension
>
The "WFM with a simple testcase." means that it works for me.

chrome://xultest/content/js17.xul:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="yourwindow"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript;version=1.7" src="js1.7.js"/>
<label value="Put your XUL here!"/>
</window>

chrome://xultest/content/js1.7.js
let x= 1;
alert(x);

also works fine with src="chrome://xultest/content/js1.7.js"

I should note that making me write testcases for people's questions
doesn't scale well.

Nickolay

> Nickolay Ponomarev wrote:
>
> > On 21 Dec 2006 09:30:49 -0800, mixit <[hidden email]> wrote:
> > > As referenced in
> > > http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7, the
> > > necessary flags to enable certain 1.7 features are:
> > >   <script type="application/javascript;version=1.7"/>
> > > in an HTML file, and:
> > >    version(170);
> > > in Javascript Shell.
> > >
> > > However, I can't get either to work in XUL files.
> >
> > As I said, this appears to work for me with a simple testcase. Post
> > the testcase you use.
> >
> > Nickolay
>
> _______________________________________________
> dev-tech-xul mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-tech-xul
>
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: JavaScript 1.7 in XUL?

mixit
In reply to this post by mixit
I found out what the problem was:

<script src="chrome://myextension/content/library.js"
type="application/javascript;version=1.7" />

must be FIRST access to the Javascript file.

It does not work after the file has already been accessed with a plain
old:

<script src="chrome://myextension/content/library.js"

.sorted.

mixit wrote:

> As referenced in
> http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7, the
> necessary flags to enable certain 1.7 features are:
>   <script type="application/javascript;version=1.7"/>
> in an HTML file, and:
>    version(170);
> in Javascript Shell.
>
> However, I can't get either to work in XUL files. The expectation is
> that the following should work but:
>
>   <script src="chrome://myextension/content/library.js"
> type="application/javascript;version=1.7" />
>
> has no effect enabling the JS1.7 features like 'yield' or 'let'.
>
> Has anyone had any success in enabling these features in XUL?
> I'm not talking about the array comprehensions or multiple return
> values as these work anyway
> without the flags
> but specificly those features associated with Iterators and Generators
> like 'yield'.
>
> regards
> si

_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: JavaScript 1.7 in XUL?

Nickolay Ponomarev
On 24 Dec 2006 02:17:45 -0800, mixit <[hidden email]> wrote:

> I found out what the problem was:
>
> <script src="chrome://myextension/content/library.js"
> type="application/javascript;version=1.7" />
>
> must be FIRST access to the Javascript file.
>
> It does not work after the file has already been accessed with a plain
> old:
>
> <script src="chrome://myextension/content/library.js"
>
> .sorted.
>
If you're sure, please file a bug about this, with a testcase.

Is this XUL-specific or happens in both XUL and HTML documents?

Nickolay

> mixit wrote:
>
> > As referenced in
> > http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7, the
> > necessary flags to enable certain 1.7 features are:
> >   <script type="application/javascript;version=1.7"/>
> > in an HTML file, and:
> >    version(170);
> > in Javascript Shell.
> >
> > However, I can't get either to work in XUL files. The expectation is
> > that the following should work but:
> >
> >   <script src="chrome://myextension/content/library.js"
> > type="application/javascript;version=1.7" />
> >
> > has no effect enabling the JS1.7 features like 'yield' or 'let'.
> >
> > Has anyone had any success in enabling these features in XUL?
> > I'm not talking about the array comprehensions or multiple return
> > values as these work anyway
> > without the flags
> > but specificly those features associated with Iterators and Generators
> > like 'yield'.
> >
> > regards
> > si
>
> _______________________________________________
> dev-tech-xul mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-tech-xul
>
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul