joyent/node — pull request #8202 by sam-github (2014-08-19 19:40:12+00:00)
Title: Fix child_process.spawn arg checking

Docs described both args and options as optional, indicating that
options could be provided with args missing, but that feature
is not implemented.

It was implemented in 67e9298fb65, but doing so caused:

spawn('file', 'args')

to be interpreted as

spawn('file', [], 'args')

Which is completely consisten with how the other child_process APIs that have optional args and options work (cf. https://github.com/joyent/node/blob/v0.10/lib/child_process.js#L610), but not backwards compatible in terms of TypeError exceptions, (cf. joyent/node#7456).

Instead of 67e9298fb65 being reverted, and the documentation being
updated, a series of commits (92875501d23c187, 7bd08c5062b) was
introduced to bring the old behaviour back, with no change to the documentation.

This PR reverts the whole sorry mess, making the code exactly what it used to be, and instead changes the docs to make it clear that args is not optional if you want to provide an options object.

If you want, just pick the head commit that updates the docs so they describe how it actually works.