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

should global "let" be creating properties on window?

12 views
Skip to first unread message

al...@yahoo.com

unread,
Nov 8, 2011, 6:11:45 AM11/8/11
to
"In programs and classes let does not create properties on the global object
like var does; instead, it creates properties in an implicit block created
for the evaluation of statements in those contexts."
https://developer.mozilla.org/en/New_in_JavaScript_1.7

but in Fx8 the following does create a "window.a"

<script type="application/javascript;version=1.8">
let a = 1;
</scipt>


Martin Honnen

unread,
Nov 8, 2011, 12:11:04 PM11/8/11
to
It might be that the documentation is wrong, at least I tried Rhino and
it shows the same behaviour:

Rhino 1.7 release 3 2011 05 09
js> 'x' in this
false
js> let x = 1;
js> 'x' in this
true

al...@yahoo.com

unread,
Nov 8, 2011, 4:15:39 PM11/8/11
to
"Martin Honnen" <maho...@yahoo.de> wrote in message
news:wPudnf5Igos1_yTT...@mozilla.org...
> al...@yahoo.com wrote:
>> "In programs and classes let does not create properties on the global
>> object
>> like var does; instead, it creates properties in an implicit block
>> created
>> for the evaluation of statements in those contexts."
>> https://developer.mozilla.org/en/New_in_JavaScript_1.7
>>
>> but in Fx8 the following does create a "window.a"
>>
>> <script type="application/javascript;version=1.8">
>> let a = 1;
>> </scipt>
>
> It might be that the documentation is wrong

Is there a spec?

Who should be asked what's expected here?


Wes Garland

unread,
Nov 8, 2011, 6:16:01 PM11/8/11
to al...@yahoo.com, dev-tech-...@lists.mozilla.org
There is a spec, upcoming, in ES.next (ES6?) -- but the SpiderMonkey
implementation pre-dates this. I suspect it will be brought into alignment
in the not-too-distant future.

As for not creating props on global - avoiding that is uglier than the
alternative IMO.

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



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

Martin Honnen

unread,
Nov 9, 2011, 5:56:47 AM11/9/11
to
I have not been following this group respectively mailing list closely.
There was a time when developers of Spidermonkey read here and reacted
so you might want to wait some more time whether you get some more
qualified response.
As an alternative, https://developer.mozilla.org/en/SpiderMonkey
mentions an IRC channel irc://irc.mozilla.org/jsapi where you could try
to get a faster response.




Sheppy

unread,
Nov 9, 2011, 2:02:50 PM11/9/11
to
Can anyone clarify for me whether or not the docs need fixing, or
touch them up if they do? Thanks!

Eric Shepherd
Developer Documentation Lead
Mozilla
http://www.bitstampede.com/

al...@yahoo.com

unread,
Nov 10, 2011, 9:05:57 AM11/10/11
to
<al...@yahoo.com> wrote in message
news:hqqdnewdw9e6kyTT...@mozilla.org...
https://bugzilla.mozilla.org/show_bug.cgi?id=700859

I tried bugzilla, but no-one has responded there either. What does it take
to get a simple question answered?


Panos Astithas

unread,
Nov 10, 2011, 10:40:30 AM11/10/11
to al...@yahoo.com, dev-tech-...@lists.mozilla.org
Patience? Especially when the people with detailed knowledge to answer such
a question are in short supply :-)
Did you try #jslang or #jsapi?

Panos

Dave Herman

unread,
Nov 10, 2011, 4:53:11 PM11/10/11
to
Strange. The docs are totally wrong here. I've fixed them -- thanks
for bringing it up!

Dave
0 new messages