assert: use util.inspect() to create error messages
authorcjihrig <cjihrig@gmail.com>
Fri, 30 Jan 2015 15:25:32 +0000 (10:25 -0500)
committercjihrig <cjihrig@gmail.com>
Sat, 31 Jan 2015 14:34:50 +0000 (09:34 -0500)
commit40e29dcbbf33d919f5cc0cbab5fa65a282adb04b
tree1c43373f5363564de3d310c950981c26821f1c92
parentbc2c85ceef7ac034830e4a4357d0aef69cd6e386
assert: use util.inspect() to create error messages

Currently, JSON.stringify() is used to create error messages
on failed assertions. This causes an error when stringifying
objects with circular references. This commit switches out
JSON.stringify() for util.inspect(), which can handle
circular references.

PR-URL: https://github.com/iojs/io.js/pull/668
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
lib/assert.js
test/parallel/test-assert.js