Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

jslint_com · This group has moved to Google Plus.

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 583
  • Category: JavaScript
  • Founded: Mar 7, 2008
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

Advanced
Messages Help
option.es5   Topic List   < Prev Topic  |  Next Topic >
Summarize Messages | View Threaded Sort by Date v  
#1269 From: Michael Lorton <mlorton@...>
Date: Wed Apr 7, 2010 2:32 pm
Subject: Re: [jslint] Re: option.es5
mlorton
Send Email Send Email
 
It makes reordering easier, editing the list less error-prone, and generating
Javascript from data a little simpler. Overall, probably a good thing.

M.




________________________________
From: Simon Kenyon Shepard <simon.shepard@...>
To: jslint_com@yahoogroups.com
Sent: Wed, April 7, 2010 5:26:29 AM
Subject: Re: [jslint] Re: option.es5

So, would I be correct in surmising that this change from ES3 to ES5 to
allow the trailing comma is for developer convenience as in the
aforementioned reordering example?

Out of curiosity are there any other reasons or examples where this would
come in useful?



On 6 April 2010 21:48, Michael Lorton <mlorton@...> wrote:

>
>
> > ES3 does not allow the trailing comma, so IE is correct when it rejects
> it.
>
> Distinguo: ES3 does not allow the trailing comma, so Internet Explorer is
> correct TO reject
> it.
>
> IE does the right thing the wrong way. It rejects the comma and gives an
> ambiguous message and the line number BUT NOT THE FILE NAME.
>
> Even assuming Microsoft employees should otherwise be allowed to live, this
> transgression (perversely maintained through every version of IE) is alone
> grounds for hunting them all down with dogs and shotguns.
>
> M.
>
> ________________________________
> From: Douglas Crockford <douglas@... <douglas%40crockford.com>>
>
> To: jslint_com@yahoogroups.com <jslint_com%40yahoogroups.com>
> Sent: Tue, April 6, 2010 12:35:27 PM
>
> Subject: [jslint] Re: option.es5
>
> --- In jslint_com@yahoogroups.com <jslint_com%40yahoogroups.com>, Rob
> Richardson <erobrich@...> wrote:
> >
> > I can see in certain circumstances that trailing commas could be deemed
> acceptable, though I'm still of the mindset that this is bad form in most
> JavaScript contexts. I'm failing to see how opting into this practice is
> linked to ES5 compatibility though. Does ES5 specifically dictate that
> trailing commas are acceptable?
>
> ES3 does not allow the trailing comma, so IE is correct when it rejects it.
>
> ES5 allows but does not require the trailing comma.
>
> There is often confusion between separators and terminators. Commas are
> separators. Semicolons are terminators.
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
> [Non-text portions of this message have been removed]
>
>
>



--
"We are the music makers, And we are the dreamers of dreams"


[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links



[Non-text portions of this message have been removed]




#1268 From: Simon Kenyon Shepard <simon.shepard@...>
Date: Wed Apr 7, 2010 12:26 pm
Subject: Re: [jslint] Re: option.es5
sks0001010
Send Email Send Email
 
So, would I be correct in surmising that this change from ES3 to ES5 to
allow the trailing comma is for developer convenience as in the
aforementioned reordering example?

Out of curiosity are there any other reasons or examples where this would
come in useful?



On 6 April 2010 21:48, Michael Lorton <mlorton@...> wrote:

>
>
> > ES3 does not allow the trailing comma, so IE is correct when it rejects
> it.
>
> Distinguo: ES3 does not allow the trailing comma, so Internet Explorer is
> correct TO reject
> it.
>
> IE does the right thing the wrong way. It rejects the comma and gives an
> ambiguous message and the line number BUT NOT THE FILE NAME.
>
> Even assuming Microsoft employees should otherwise be allowed to live, this
> transgression (perversely maintained through every version of IE) is alone
> grounds for hunting them all down with dogs and shotguns.
>
> M.
>
> ________________________________
> From: Douglas Crockford <douglas@... <douglas%40crockford.com>>
>
> To: jslint_com@yahoogroups.com <jslint_com%40yahoogroups.com>
> Sent: Tue, April 6, 2010 12:35:27 PM
>
> Subject: [jslint] Re: option.es5
>
> --- In jslint_com@yahoogroups.com <jslint_com%40yahoogroups.com>, Rob
> Richardson <erobrich@...> wrote:
> >
> > I can see in certain circumstances that trailing commas could be deemed
> acceptable, though I'm still of the mindset that this is bad form in most
> JavaScript contexts. I'm failing to see how opting into this practice is
> linked to ES5 compatibility though. Does ES5 specifically dictate that
> trailing commas are acceptable?
>
> ES3 does not allow the trailing comma, so IE is correct when it rejects it.
>
> ES5 allows but does not require the trailing comma.
>
> There is often confusion between separators and terminators. Commas are
> separators. Semicolons are terminators.
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
> [Non-text portions of this message have been removed]
>
>
>



--
"We are the music makers, And we are the dreamers of dreams"


[Non-text portions of this message have been removed]




#1267 From: "Douglas Crockford" <douglas@...>
Date: Tue Apr 6, 2010 8:12 pm
Subject: [jslint] Re: option.es5
douglascrock...
Send Email Send Email
 
--- In jslint_com@yahoogroups.com, Michael Lorton <mlorton@...> wrote:
> Even assuming Microsoft employees should otherwise be allowed to live, this
transgression (perversely maintained through every version of IE) is alone
grounds for hunting them all down with dogs and shotguns.


You are way out of line. Tone it down.




#1266 From: Michael Lorton <mlorton@...>
Date: Tue Apr 6, 2010 7:48 pm
Subject: Re: [jslint] Re: option.es5
mlorton
Send Email Send Email
 
>  ES3 does not allow the trailing comma, so IE is correct when it rejects
it.

Distinguo: ES3 does not allow the trailing comma, so Internet Explorer is
correct TO reject
it.

IE does the right thing the wrong way. It rejects the comma and gives an
ambiguous message and the line number BUT NOT THE FILE NAME.

Even assuming Microsoft employees should otherwise be allowed to live, this
transgression (perversely maintained through every version of IE) is alone
grounds for hunting them all down with dogs and shotguns.

M.




________________________________
From: Douglas Crockford <douglas@...>
To: jslint_com@yahoogroups.com
Sent: Tue, April 6, 2010 12:35:27 PM
Subject: [jslint] Re: option.es5

--- In jslint_com@yahoogroups.com, Rob Richardson <erobrich@...> wrote:
>
> I can see in certain circumstances that trailing commas could be deemed
acceptable, though I'm still of the mindset that this is bad form in most
JavaScript contexts. I'm failing to see how opting into this practice is linked
to ES5 compatibility though. Does ES5 specifically dictate that trailing commas
are acceptable?

ES3 does not allow the trailing comma, so IE is correct when it rejects it.

ES5 allows but does not require the trailing comma.

There is often confusion between separators and terminators. Commas are
separators. Semicolons are terminators.



------------------------------------

Yahoo! Groups Links



[Non-text portions of this message have been removed]




#1265 From: "Douglas Crockford" <douglas@...>
Date: Tue Apr 6, 2010 7:35 pm
Subject: [jslint] Re: option.es5
douglascrock...
Send Email Send Email
 
--- In jslint_com@yahoogroups.com, Rob Richardson <erobrich@...> wrote:
>
> I can see in certain circumstances that trailing commas could be deemed
acceptable, though I'm still of the mindset that this is bad form in most
JavaScript contexts. I'm failing to see how opting into this practice is linked
to ES5 compatibility though. Does ES5 specifically dictate that trailing commas
are acceptable?

ES3 does not allow the trailing comma, so IE is correct when it rejects it.

ES5 allows but does not require the trailing comma.

There is often confusion between separators and terminators. Commas are
separators. Semicolons are terminators.




#1264 From: Rob Richardson <erobrich@...>
Date: Tue Apr 6, 2010 7:16 pm
Subject: Re: [jslint] Re: option.es5
erobrich
Send Email Send Email
 
I can see in certain circumstances that trailing commas could be deemed
acceptable, though I'm still of the mindset that this is bad form in most
JavaScript contexts. I'm failing to see how opting into this practice is linked
to ES5 compatibility though. Does ES5 specifically dictate that trailing commas
are acceptable?

Rob





________________________________
From: Michael Mikowski <z_mikowski@...>
To: jslint_com@yahoogroups.com
Sent: Tue, April 6, 2010 11:56:46 AM
Subject: Re: [jslint] Re: option.es5


Whoops. Need more coffee. Should be var hash_example = {...}, not []. But
you get the idea.

____________ _________ _________ __
From: Michael Mikowski <z_mikowski@yahoo. com>
To: jslint_com@yahoogro ups.com
Sent: Tue, April 6, 2010 11:54:25 AM
Subject: Re: [jslint] Re: option.es5

There is a very good reason to allow for trailing commas (even though IE js
doesn't) -- Consider this 'object' (since we only use it as an associative array
here, we call it a hash):

var hash_example = [
foo : 'bar',
zing : 'zang',
one : 'two'
];

Now lets say I want to reorder the keys so they are alphabetical:

var hash_example = [
foo : 'bar',
one : 'two'
zing : 'zang',
];

Boom. Instant error -- in two places. Allowing trailing commas avoids this
problem nicely.

In Perl, a trailing comma is best practice, and omitting the trailing comma is
considered sloppy.

If IE would allow trailing commas, I'd use them consistently. Since it doesn't,
I use jslint to find the above errors :)

Cheers, Mike

____________ _________ _________ __
From: boyopeg <boyopeg@gmail. com>
To: jslint_com@yahoogro ups.com
Sent: Tue, April 6, 2010 9:47:41 AM
Subject: [jslint] Re: option.es5

It seems to me that the trailing comma in object notation is a rather bad coding
practice. I'm fine with JS parsers being able to ignore errors such as these.
But why should a style and syntax checking tool like JSLint be blind to such
sloppy code practices? Am I missing something with this option?

-noah

--- In jslint_com@yahoogro ups.com, "Douglas Crockford" <douglas@... > wrote:
>
> --- In jslint_com@yahoogro ups.com, "Douglas Crockford" <douglas@> wrote:
> >
> > There is a new option, Tolerate ES5 syntax. If you check this option, JSLint
will accept the new get/set syntax in object literals.
> >
> > It will require that the get and set functions be declared together, that
the get function have no parameters, and that the set function will have a
single parameter called 'value'.
> >
> > Please let me know if you find any problems.
>
>
> option.es5 will now relax the reserved word restriction on object
> literals and dot notation, and tolerate a dangling comma, so
>
> var object = {
> class: x.class,
> };
>
> is accepted.





[Non-text portions of this message have been removed]




#1263 From: Michael Mikowski <z_mikowski@...>
Date: Tue Apr 6, 2010 6:56 pm
Subject: Re: [jslint] Re: option.es5
z_mikowski
Send Email Send Email
 
Whoops.  Need more coffee.  Should be var hash_example = {...}, not [].   But
you get the idea.





________________________________
From: Michael Mikowski <z_mikowski@...>
To: jslint_com@yahoogroups.com
Sent: Tue, April 6, 2010 11:54:25 AM
Subject: Re: [jslint] Re: option.es5


There is a very good reason to allow for trailing commas (even though IE js
doesn't) -- Consider this 'object' (since we only use it as an associative array
here, we call it a hash):

var hash_example = [
foo : 'bar',
zing : 'zang',
one : 'two'
];

Now lets say I want to reorder the keys so they are alphabetical:

var hash_example = [
foo : 'bar',
one : 'two'
zing : 'zang',
];

Boom. Instant error -- in two places. Allowing trailing commas avoids this
problem nicely.

In Perl, a trailing comma is best practice, and omitting the trailing comma is
considered sloppy.

If IE would allow trailing commas, I'd use them consistently. Since it doesn't,
I use jslint to find the above errors :)



Cheers, Mike



________________________________
From: boyopeg <boyopeg@...>
To: jslint_com@yahoogroups.com
Sent: Tue, April 6, 2010 9:47:41 AM
Subject: [jslint] Re: option.es5


It seems to me that the trailing comma in object notation is a rather bad coding
practice. I'm fine with JS parsers being able to ignore errors such as these.
But why should a style and syntax checking tool like JSLint be blind to such
sloppy code practices? Am I missing something with this option?

-noah

--- In jslint_com@yahoogro ups.com, "Douglas Crockford" <douglas@... > wrote:
>
> --- In jslint_com@yahoogro ups.com, "Douglas Crockford" <douglas@> wrote:
> >
> > There is a new option, Tolerate ES5 syntax. If you check this option, JSLint
will accept the new get/set syntax in object literals.
> >
> > It will require that the get and set functions be declared together, that
the get function have no parameters, and that the set function will have a
single parameter called 'value'.
> >
> > Please let me know if you find any problems.
>
>
> option.es5 will now relax the reserved word restriction on object
> literals and dot notation, and tolerate a dangling comma, so
>
> var object = {
> class: x.class,
> };
>
> is accepted.
>




[Non-text portions of this message have been removed]




#1262 From: Michael Mikowski <z_mikowski@...>
Date: Tue Apr 6, 2010 6:54 pm
Subject: Re: [jslint] Re: option.es5
z_mikowski
Send Email Send Email
 
There is a very good reason to allow for trailing commas (even though IE js
doesn't) -- Consider this 'object' (since we only use it as an associative array
here, we call it a hash):

var hash_example = [
foo : 'bar',
zing : 'zang',
one : 'two'
];

Now lets say I want to reorder the keys so they are alphabetical:

var hash_example = [
foo : 'bar',
one : 'two'
zing : 'zang',
];

Boom. Instant error -- in two places. Allowing trailing commas avoids this
problem nicely.

In Perl, a trailing comma is best practice, and omitting the trailing comma is
considered sloppy.

If IE would allow trailing commas, I'd use them consistently. Since it doesn't,
I use jslint to find the above errors :)



Cheers, Mike



________________________________
From: boyopeg <boyopeg@...>
To: jslint_com@yahoogroups.com
Sent: Tue, April 6, 2010 9:47:41 AM
Subject: [jslint] Re: option.es5


It seems to me that the trailing comma in object notation is a rather bad coding
practice. I'm fine with JS parsers being able to ignore errors such as these.
But why should a style and syntax checking tool like JSLint be blind to such
sloppy code practices? Am I missing something with this option?

-noah

--- In jslint_com@yahoogro ups.com, "Douglas Crockford" <douglas@... > wrote:
>
> --- In jslint_com@yahoogro ups.com, "Douglas Crockford" <douglas@> wrote:
> >
> > There is a new option, Tolerate ES5 syntax. If you check this option, JSLint
will accept the new get/set syntax in object literals.
> >
> > It will require that the get and set functions be declared together, that
the get function have no parameters, and that the set function will have a
single parameter called 'value'.
> >
> > Please let me know if you find any problems.
>
>
> option.es5 will now relax the reserved word restriction on object
> literals and dot notation, and tolerate a dangling comma, so
>
> var object = {
> class: x.class,
> };
>
> is accepted.
>




[Non-text portions of this message have been removed]




#1261 From: "boyopeg" <boyopeg@...>
Date: Tue Apr 6, 2010 4:47 pm
Subject: Re: option.es5
boyopeg
Send Email Send Email
 
It seems to me that the trailing comma in object notation is a rather bad coding
practice. I'm fine with JS parsers being able to ignore errors such as these.
But why should a style and syntax checking tool like JSLint be blind to such
sloppy code practices?  Am I missing something with this option? 

-noah

--- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
>
> --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@> wrote:
> >
> > There is a new option, Tolerate ES5 syntax. If you check this option, JSLint
will accept the new get/set syntax in object literals.
> >
> > It will require that the get and set functions be declared together, that
the get function have no parameters, and that the set function will have a
single parameter called 'value'.
> >
> > Please let me know if you find any problems.
>
>
> option.es5 will now relax the reserved word restriction on object
> literals and dot notation, and tolerate a dangling comma, so
>
> var object = {
> class: x.class,
> };
>
> is accepted.
>





#1260 From: "Douglas Crockford" <douglas@...>
Date: Tue Apr 6, 2010 4:18 pm
Subject: Re: option.es5
douglascrock...
Send Email Send Email
 
--- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
>
> There is a new option, Tolerate ES5 syntax. If you check this option, JSLint
will accept the new get/set syntax in object literals.
>
> It will require that the get and set functions be declared together, that the
get function have no parameters, and that the set function will have a single
parameter called 'value'.
>
> Please let me know if you find any problems.


option.es5 will now relax the reserved word restriction on object
literals and dot notation, and tolerate a dangling comma, so

var object = {
class: x.class,
};

is accepted.




#1259 From: Harry Whitfield <g7awz@...>
Date: Tue Apr 6, 2010 8:45 am
Subject: Re: [jslint] option.es5
harry152566
Send Email Send Email
 
The Widget Tester Widget (version 8.9) with JSLint Edition 2010-04-05 is now at

http://tinyurl.com/5unocx .

This version has the new "Tolerate ES5 syntax" option.

Harry.




#1258 From: "Douglas Crockford" <douglas@...>
Date: Tue Apr 6, 2010 12:07 am
Subject: option.es5
douglascrock...
Send Email Send Email
 
There is a new option, Tolerate ES5 syntax. If you check this option, JSLint
will accept the new get/set syntax in object literals.

It will require that the get and set functions be declared together, that the
get function have no parameters, and that the set function will have a single
parameter called 'value'.

Please let me know if you find any problems. Eventually it may recognize other
corrections with this option, such as dangling commas in array and object
literals.




 
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help