robertkrimen / otto

A JavaScript interpreter in Go (golang)
http://godoc.org/github.com/robertkrimen/otto
MIT License
8.01k stars 584 forks source link

Support trailing comma after the last argument. #520

Closed linuxerwang closed 4 months ago

linuxerwang commented 4 months ago

Example:

function mergeObjects(x, y) { /* dummy body */}

mergeObjects(
    { "duck": "quack" },
    { "dog": "bark" }, // Allow trailing comma after the last argument.
);