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>
v7.x
Michael Macherey 8 years ago
committed by James M Snell
parent
commit
d3d83be30c
  1. 14
      test/parallel/test-dgram-empty-packet.js

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

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

Loading…
Cancel
Save