mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 06:38:13 +00:00

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>
13 lines
518 B
JavaScript
13 lines
518 B
JavaScript
'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);
|