From 4b612f6e9d7007b510b8e767dacfcdf781fdf040 Mon Sep 17 00:00:00 2001 From: Steven Winston Date: Wed, 21 Jun 2017 23:53:52 +0300 Subject: [PATCH 1/5] test: removed unnecessary Buffer import --- test/disabled/test-sendfd.js | 19 +++++++++---------- .../test-dgram-broadcast-multi-process.js | 1 - test/pummel/test-https-no-reader.js | 1 - 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/test/disabled/test-sendfd.js b/test/disabled/test-sendfd.js index 89367369bbdba5..8dcc696f39e998 100644 --- a/test/disabled/test-sendfd.js +++ b/test/disabled/test-sendfd.js @@ -8,7 +8,7 @@ // persons to whom the Software is furnished to do so, subject to the // following conditions: // -// The above copyright notice and this permission notice shall be included +// The above copnotice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS @@ -50,7 +50,6 @@ const common = require('../common'); const assert = require('assert'); -const buffer = require('buffer'); const child_process = require('child_process'); const fs = require('fs'); const net = require('net'); @@ -58,13 +57,13 @@ var netBinding = process.binding('net'); const path = require('path'); var DATA = { - 'ppid' : process.pid, - 'ord' : 0 + 'ppid': process.pid, + 'ord': 0 }; var SOCK_PATH = path.join(__dirname, - '..', - path.basename(__filename, '.js') + '.sock'); + '..', + path.basename(__filename, '.js') + '.sock'); var logChild = function(d) { if (typeof d == 'object') { @@ -112,7 +111,7 @@ var srv = net.createServer(function(s) { var str = JSON.stringify(DATA) + '\n'; DATA.ord = DATA.ord + 1; - var buf = buffer.Buffer.allocUnsafe(str.length); + var buf = Buffer.allocUnsafe(str.length); buf.write(JSON.stringify(DATA) + '\n', 'utf8'); s.write(str, 'utf8', pipeFDs[1]); @@ -127,9 +126,9 @@ var srv = net.createServer(function(s) { srv.listen(SOCK_PATH); // Spawn a child running test/fixtures/recvfd.js -var cp = child_process.spawn(process.argv[0], - [path.join(common.fixturesDir, 'recvfd.js'), - SOCK_PATH]); +var cp = child_process.spawn(process.argv[0], [path.join(common.fixturesDir, 'recvfd.js'), + SOCK_PATH +]); cp.stdout.on('data', logChild); cp.stderr.on('data', logChild); diff --git a/test/internet/test-dgram-broadcast-multi-process.js b/test/internet/test-dgram-broadcast-multi-process.js index a79c05e18e1675..79e139248454d5 100644 --- a/test/internet/test-dgram-broadcast-multi-process.js +++ b/test/internet/test-dgram-broadcast-multi-process.js @@ -25,7 +25,6 @@ const assert = require('assert'); const dgram = require('dgram'); const util = require('util'); const networkInterfaces = require('os').networkInterfaces(); -const Buffer = require('buffer').Buffer; const fork = require('child_process').fork; const LOCAL_BROADCAST_HOST = '255.255.255.255'; const TIMEOUT = common.platformTimeout(5000); diff --git a/test/pummel/test-https-no-reader.js b/test/pummel/test-https-no-reader.js index 2a446bfbdd3add..cc77993a7312f6 100644 --- a/test/pummel/test-https-no-reader.js +++ b/test/pummel/test-https-no-reader.js @@ -29,7 +29,6 @@ if (!common.hasCrypto) { } const https = require('https'); -const Buffer = require('buffer').Buffer; const fs = require('fs'); const path = require('path'); From e903a963441c803363058a9af66f42805d1246e5 Mon Sep 17 00:00:00 2001 From: Steven Winston Date: Thu, 22 Jun 2017 00:15:31 +0300 Subject: [PATCH 2/5] Update test-sendfd.js --- test/disabled/test-sendfd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/disabled/test-sendfd.js b/test/disabled/test-sendfd.js index 8dcc696f39e998..62e7a5839e0146 100644 --- a/test/disabled/test-sendfd.js +++ b/test/disabled/test-sendfd.js @@ -8,7 +8,7 @@ // persons to whom the Software is furnished to do so, subject to the // following conditions: // -// The above copnotice and this permission notice shall be included +// The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS From daa93285bb4a8d476c3b6010b46d805946cbfede Mon Sep 17 00:00:00 2001 From: Steven Winston Date: Thu, 22 Jun 2017 00:17:47 +0300 Subject: [PATCH 3/5] reverted code --- test/disabled/test-sendfd.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/disabled/test-sendfd.js b/test/disabled/test-sendfd.js index 62e7a5839e0146..f1fe7119e51fb6 100644 --- a/test/disabled/test-sendfd.js +++ b/test/disabled/test-sendfd.js @@ -57,8 +57,8 @@ var netBinding = process.binding('net'); const path = require('path'); var DATA = { - 'ppid': process.pid, - 'ord': 0 + 'ppid' : process.pid, + 'ord' : 0 }; var SOCK_PATH = path.join(__dirname, From ac96ae951ec799e07621884e5c1f5fa1f4bae065 Mon Sep 17 00:00:00 2001 From: Steven Winston Date: Thu, 22 Jun 2017 00:18:43 +0300 Subject: [PATCH 4/5] reverted style change --- test/disabled/test-sendfd.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/disabled/test-sendfd.js b/test/disabled/test-sendfd.js index f1fe7119e51fb6..c9dd33f7e9e21b 100644 --- a/test/disabled/test-sendfd.js +++ b/test/disabled/test-sendfd.js @@ -62,8 +62,8 @@ var DATA = { }; var SOCK_PATH = path.join(__dirname, - '..', - path.basename(__filename, '.js') + '.sock'); + '..', + path.basename(__filename, '.js') + '.sock'); var logChild = function(d) { if (typeof d == 'object') { From 9e2e60de230bae94a91ff72dd90d8b3f37881b94 Mon Sep 17 00:00:00 2001 From: Steven Winston Date: Thu, 22 Jun 2017 00:20:35 +0300 Subject: [PATCH 5/5] reverted style change --- test/disabled/test-sendfd.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/disabled/test-sendfd.js b/test/disabled/test-sendfd.js index c9dd33f7e9e21b..3352e63532c127 100644 --- a/test/disabled/test-sendfd.js +++ b/test/disabled/test-sendfd.js @@ -126,9 +126,9 @@ var srv = net.createServer(function(s) { srv.listen(SOCK_PATH); // Spawn a child running test/fixtures/recvfd.js -var cp = child_process.spawn(process.argv[0], [path.join(common.fixturesDir, 'recvfd.js'), - SOCK_PATH -]); +var cp = child_process.spawn(process.argv[0], + [path.join(common.fixturesDir, 'recvfd.js'), + SOCK_PATH]); cp.stdout.on('data', logChild); cp.stderr.on('data', logChild);