Ticket #2528035 (closed enhancement)


Opened: 04/23/10
Last modified: 12/12/12
Status: closed
Type: enhancement
Resolution: wontfix


Adam Moore
Target Release:
Summary: Remove trailing commas (arrays and objects)

Although it probably isn't allowed to have trailing commas in arrays and obect initializers according to ECMA-262, many modern Javascript engines allow them.
I prefer coding styles with trailing commas usage, could the trailing commas removal feature make it into yuicompressor ?

Desired behavior:

[1,2,3,] => [1,2,3]
{ 'a' : 'b', } => { 'a' : 'b' }

Attaching a simple patch.

Type: enhancement Observed in Version: 2.4.2
Component: YUICompressor Severity: S3 (normal)
Assigned To: Adam Moore Target Release:
Location: Library Code Priority:
Tags: Relates To:
Browsers: N/A
Test Information:


Attachment #1: patch (download)

Change History


Posted: 04/23/10
  • component changed from None to YUICompressor
  • owner changed from George to Adam Moore
  • status changed from new to assigned

Adam Moore

YUI Contributor

Posted: 04/29/10
  • location changed to Library Code


Posted: 06/2/10
  • type changed from defect to enhancement

Jenny Donnelly

YUI Developer

Posted: 12/12/12
  • resolution changed to wontfix
  • status changed from assigned to closed

Thank you for your bug report. We are deprecating YUI Compressor in favor of yuglify. Please see our announcement for more information: http://www.yuiblog.com/blog/2012/10/16/state-of-yui-compressor/. We will consider migrating these legacy tickets to GitHub if there are community maintainers willing to step up and own them.