diff options
author | Connor Peet <connor@peet.io> | 2015-03-22 20:45:16 -0400 |
---|---|---|
committer | Brendan Ashworth <brendan.ashworth@me.com> | 2015-03-22 20:45:35 -0700 |
commit | 849319a260a7137b51e84f35ba81ed0da72f0603 (patch) | |
tree | a4155c846ce378548d67e0ce4aa06b341f9225b7 /test/parallel/test-util.js | |
parent | fe4434b77a069081222aa45add3ef4f6415bb29f (diff) | |
download | android-node-v8-849319a260a7137b51e84f35ba81ed0da72f0603.tar.gz android-node-v8-849319a260a7137b51e84f35ba81ed0da72f0603.tar.bz2 android-node-v8-849319a260a7137b51e84f35ba81ed0da72f0603.zip |
util: Check input to util.inherits
PR-URL: https://github.com/iojs/io.js/pull/1240
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Reviewed-By: Petka Antonov <petka_antonov@hotmail.com>
Diffstat (limited to 'test/parallel/test-util.js')
-rw-r--r-- | test/parallel/test-util.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/parallel/test-util.js b/test/parallel/test-util.js index 2fb4bc5609..03456d6439 100644 --- a/test/parallel/test-util.js +++ b/test/parallel/test-util.js @@ -78,3 +78,10 @@ assert.deepEqual(util._extend({a:1}, true), {a:1}); assert.deepEqual(util._extend({a:1}, false), {a:1}); assert.deepEqual(util._extend({a:1}, {b:2}), {a:1, b:2}); assert.deepEqual(util._extend({a:1, b:2}, {b:3}), {a:1, b:3}); + +// inherits +var ctor = function() {}; +assert.throws(function() { util.inherits(ctor, {}) }, TypeError); +assert.throws(function() { util.inherits(ctor, null) }, TypeError); +assert.throws(function() { util.inherits(null, ctor) }, TypeError); +assert.doesNotThrow(function() { util.inherits(ctor, ctor) }, TypeError); |