Add test cases for #1944.

This commit is contained in:
Nathan Rajlich 2011-10-26 12:45:51 -07:00 committed by koichik
parent ebefe77bc0
commit 4fb2ac5be1

View File

@ -62,3 +62,16 @@ assert.ok(ex.indexOf('[type]') != -1);
// GH-1941
// should not throw:
assert.equal(util.inspect(Object.create(Date.prototype)), '{}')
// GH-1944
assert.doesNotThrow(function () {
var d = new Date();
d.toUTCString = null;
util.inspect(d);
});
assert.doesNotThrow(function () {
var r = /regexp/;
r.toString = null;
util.inspect(r);
});