diff options
author | Roman Reiss <me@silverwind.io> | 2015-05-22 18:35:57 +0200 |
---|---|---|
committer | Roman Reiss <me@silverwind.io> | 2015-05-23 06:57:00 +0200 |
commit | 39dde3222e4733fc1b59c45e392d9ff1a88ae4cc (patch) | |
tree | 58561a0bbbbf02422b8b34d1b41e58fcb3b388b9 /test/parallel/test-ref-unref-return.js | |
parent | 9da168b71fb729635ad71e839630480e815623d0 (diff) | |
download | android-node-v8-39dde3222e4733fc1b59c45e392d9ff1a88ae4cc.tar.gz android-node-v8-39dde3222e4733fc1b59c45e392d9ff1a88ae4cc.tar.bz2 android-node-v8-39dde3222e4733fc1b59c45e392d9ff1a88ae4cc.zip |
net,dgram: return this from ref and unref methods
Modifies the following methods to return the instance instead
of undefined, to allow for chaining these methods:
- net.Server.ref
- net.Server.unref
- net.Socket.ref
- net.Socket.unref
- dgram.Socket.ref
- dgram.Socket.unref
PR-URL: https://github.com/nodejs/io.js/pull/1768
Reviewed-By: Evan Lucas <evanlucas@me.com>
Diffstat (limited to 'test/parallel/test-ref-unref-return.js')
-rw-r--r-- | test/parallel/test-ref-unref-return.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/parallel/test-ref-unref-return.js b/test/parallel/test-ref-unref-return.js new file mode 100644 index 0000000000..a82a433ab1 --- /dev/null +++ b/test/parallel/test-ref-unref-return.js @@ -0,0 +1,12 @@ +'use strict'; +var assert = require('assert'); +var net = require('net'); +var dgram = require('dgram'); +var common = require('../common'); + +assert.ok((new net.Server()).ref() instanceof net.Server); +assert.ok((new net.Server()).unref() instanceof net.Server); +assert.ok((new net.Socket()).ref() instanceof net.Socket); +assert.ok((new net.Socket()).unref() instanceof net.Socket); +assert.ok((new dgram.Socket('udp4')).ref() instanceof dgram.Socket); +assert.ok((new dgram.Socket('udp6')).unref() instanceof dgram.Socket); |