mirror of https://github.com/lukechilds/node.git
Browse Source
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>v2.3.1-release
Roman Reiss
10 years ago
5 changed files with 38 additions and 2 deletions
@ -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); |
Loading…
Reference in new issue