From f68e0d1864b11b15014334dc44e4a11692667573 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. PR-URL: https://github.com/nodejs/node/pull/8896 Reviewed-By: Luigi Pinca Reviewed-By: Ilkka Myller Reviewed-By: Brian White Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig --- 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) {