Skip to content

Omit trailing comma in object literal properties  #271

@mhegazy

Description

@mhegazy

Object literal with trailing commas, e.g.:

var x = {
    a: 1,
    b:2,
}

emit the comma in the generated js:

var x = {
    a: 1,
    b:2,
}

This is invalid ES3, and will break in CScript for instance:

cscript d:\test.js

Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

d:\test.js(4, 1) Microsoft JScript compilation error: Expected identifier, string or number

Metadata

Metadata

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions