From 75c402ce84a443898d7eefa922df6f000c7865f9 Mon Sep 17 00:00:00 2001 From: Michael Macherey Date: Sun, 2 Oct 2016 01:00:06 +0200 Subject: [PATCH] test: cleanup/update test-dgram-empty-packet.js * Changed some `var` to `const` and 'let' * Changed `==` to `===` for clarity. --- test/parallel/test-dgram-empty-packet.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/parallel/test-dgram-empty-packet.js b/test/parallel/test-dgram-empty-packet.js index 1c7e7205d1edf2..34bce4e07aede7 100644 --- a/test/parallel/test-dgram-empty-packet.js +++ b/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) {