joyent/node — pull request #7178 by jugglinmike (2014-02-24 19:37:12+00:00)
Title: assert.deepEqual is not reflexive

The behavior of `assert.deepEqual` is dependent on the ordering of arguments.

```javascript
var assert = require('assert');
var args = (function() { return arguments; })();

assert.deepEqual([], args); // passes
assert.deepEqual(args, []); // throws
```

I recognize that this module's stability index is 5, but this non-reflexive behavior seems to be limited to the case of comparing an `arguments` object with an array and therefore inconsistent enough to warrant a patch.

In addition, [the in-line comment immediately preceding the branch](https://github.com/joyent/node/blob/dbae8b569fd1afa04cddac47b30379e4ebf3388a/lib/assert.js#L202-L203) suggests that using `Objects.keys` on an `arguments` object can cause unexpected results. This operation currently occurs any time only the second argument is an `arguments` object.

Relevant source: https://github.com/joyent/node/blob/dbae8b569fd1afa04cddac47b30379e4ebf3388a/lib/assert.js#L204-L211