| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent dc826ca commit 90a9917
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,13 +1,17 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | - require('../common'); | ||
| 2 | + const common = require('../common'); | ||
| 3 | 3 | const assert = require('assert'); | |
| 4 | 4 | const dgram = require('dgram'); | |
| 5 | 5 | ||
| 6 | 6 | const socket = dgram.createSocket('udp4'); | |
| 7 | 7 | ||
| 8 | - socket.on('listening', function() { | ||
| 8 | + socket.on('listening', common.mustCall(() => { | ||
| 9 | + assert.throws(() => { | ||
| 10 | + socket.bind(); | ||
| 11 | + }, /^Error: Socket is already bound$/); | ||
| 12 | + | ||
| 9 | 13 | socket.close(); | |
| 10 | - }); | ||
| 14 | + })); | ||
| 11 | 15 | ||
| 12 | 16 | const result = socket.bind(); // should not throw | |
| 13 | 17 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments