From 4fb2ac5be1ec2be2c1d97b7c70be8423dbae2db4 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Wed, 26 Oct 2011 12:45:51 -0700 Subject: [PATCH] Add test cases for #1944. --- test/simple/test-util-inspect.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/simple/test-util-inspect.js b/test/simple/test-util-inspect.js index 8c98ed21c0..a2912f762c 100644 --- a/test/simple/test-util-inspect.js +++ b/test/simple/test-util-inspect.js @@ -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); +});