Browse Source

test: cleanup/update test-dgram-empty-packet.js

* Changed some `var` to `const` and 'let'
 * Changed `==` to `===` for clarity.

PR-URL: https://github.com/nodejs/node/pull/8896
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
v6
Michael Macherey 8 years ago
committed by Ilkka Myller
parent
commit
f68e0d1864
  1. 14
      test/parallel/test-dgram-empty-packet.js

14
test/parallel/test-dgram-empty-packet.js

@ -1,22 +1,22 @@
'use strict'; 'use strict';
var common = require('../common'); const common = require('../common');
const dgram = require('dgram');
var dgram = require('dgram'); let callbacks = 0;
var callbacks = 0; let timer;
var client;
var timer;
if (common.isOSX) { if (common.isOSX) {
common.skip('because of 17894467 Apple bug'); common.skip('because of 17894467 Apple bug');
return; return;
} }
client = dgram.createSocket('udp4'); const client = dgram.createSocket('udp4');
client.bind(0, function() { client.bind(0, function() {
function callback() { function callback() {
callbacks++; callbacks++;
if (callbacks == 2) { if (callbacks === 2) {
clearTimeout(timer); clearTimeout(timer);
client.close(); client.close();
} else if (callbacks > 2) { } else if (callbacks > 2) {

Loading…
Cancel
Save