-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: #1768 Reviewed-By: Evan Lucas <[email protected]>
- Loading branch information
1 parent
9da168b
commit 39dde32
Showing
5 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |