Add test cases for #1944.
authorNathan Rajlich <nathan@tootallnate.net>
Wed, 26 Oct 2011 19:45:51 +0000 (12:45 -0700)
committerkoichik <koichik@improvement.jp>
Wed, 26 Oct 2011 19:58:51 +0000 (04:58 +0900)
test/simple/test-util-inspect.js

index 8c98ed21c05d5cd5e3e78058afd3ec9cbd513371..a2912f762c13ef61af3358fed4ba37f363ffb12d 100644 (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);
+});