Browse Source

test: use const for all require() calls

PR-URL: https://github.com/nodejs/node/pull/10550
Reviewed-By: Rich Trott <rtrott@gmail.com>
v6
cjihrig 8 years ago
parent
commit
ff1efa6087
  1. 2
      test/addons/async-hello-world/test.js
  2. 2
      test/addons/hello-world-function-export/test.js
  3. 2
      test/addons/hello-world/test.js
  4. 2
      test/addons/load-long-path/test.js
  5. 10
      test/addons/repl-domain-abort/test.js
  6. 4
      test/debugger/helper-debugger-repl.js
  7. 2
      test/debugger/test-debugger-repl-break-in-module.js
  8. 2
      test/debugger/test-debugger-repl-restart.js
  9. 2
      test/debugger/test-debugger-repl-term.js
  10. 2
      test/debugger/test-debugger-repl-utf8.js
  11. 2
      test/debugger/test-debugger-repl.js
  12. 10
      test/disabled/test-debug-brk-file.js
  13. 2
      test/disabled/test-dgram-send-error.js
  14. 6
      test/disabled/test-fs-largefile.js
  15. 6
      test/disabled/test-http-abort-stream-end.js
  16. 4
      test/disabled/test-https-loop-to-google.js
  17. 6
      test/disabled/test-readline.js
  18. 14
      test/disabled/test-sendfd.js
  19. 4
      test/disabled/test-setuidgid.js
  20. 12
      test/disabled/tls_server.js
  21. 6
      test/fixtures/GH-892-request.js
  22. 2
      test/fixtures/a.js
  23. 2
      test/fixtures/a1.js
  24. 6
      test/fixtures/b/c.js
  25. 2
      test/fixtures/break-in-module/main.js
  26. 2
      test/fixtures/child-process-spawn-node.js
  27. 2
      test/fixtures/child_process_should_emit_error.js
  28. 2
      test/fixtures/cluster-preload-test.js
  29. 6
      test/fixtures/cluster-preload.js
  30. 2
      test/fixtures/create-file.js
  31. 2
      test/fixtures/cycles/folder/foo.js
  32. 2
      test/fixtures/cycles/root.js
  33. 8
      test/fixtures/echo-close-check.js
  34. 4
      test/fixtures/echo.js
  35. 4
      test/fixtures/listen-on-socket-and-exit.js
  36. 2
      test/fixtures/module-require/parent/index.js
  37. 2
      test/fixtures/node_modules/baz/index.js
  38. 2
      test/fixtures/node_modules/foo.js
  39. 2
      test/fixtures/not-main-module.js
  40. 2
      test/fixtures/parent-process-nonpersistent.js
  41. 2
      test/fixtures/path-resolve.js
  42. 2
      test/fixtures/path.js
  43. 2
      test/fixtures/print-chars-from-buffer.js
  44. 2
      test/fixtures/print-chars.js
  45. 2
      test/fixtures/recvfd.js
  46. 2
      test/fixtures/stdio-filter.js
  47. 2
      test/fixtures/test-init-native/fs.js
  48. 2
      test/fixtures/test-regress-GH-4015.js
  49. 2
      test/fixtures/uncaught-exceptions/domain.js
  50. 2
      test/gc/node_modules/bindings/README.md
  51. 2
      test/gc/node_modules/bindings/bindings.js
  52. 2
      test/gc/node_modules/nan/tools/1to2.js
  53. 4
      test/gc/node_modules/weak/README.md
  54. 2
      test/gc/node_modules/weak/build/Makefile
  55. 21
      test/gc/node_modules/weak/build/config.gypi
  56. 30
      test/gc/node_modules/weak/build/weakref.target.mk
  57. 4
      test/gc/node_modules/weak/lib/weak.js
  58. 8
      test/internet/test-dgram-send-cb-quelches-error.js
  59. 6
      test/internet/test-dns-cares-domains.js
  60. 4
      test/internet/test-dns-txt-sigsegv.js
  61. 6
      test/internet/test-http-https-default-ports.js
  62. 4
      test/internet/test-net-connect-timeout.js
  63. 2
      test/internet/test-net-connect-unref.js
  64. 4
      test/internet/test-tls-connnect-melissadata.js
  65. 2
      test/message/error_exit.js
  66. 2
      test/message/eval_messages.js
  67. 2
      test/message/stdin_messages.js
  68. 2
      test/message/undefined_reference_in_new_context.js
  69. 2
      test/message/vm_display_runtime_error.js
  70. 2
      test/message/vm_display_syntax_error.js
  71. 2
      test/message/vm_dont_display_runtime_error.js
  72. 2
      test/message/vm_dont_display_syntax_error.js
  73. 4
      test/parallel/test-assert.js
  74. 2
      test/parallel/test-beforeexit-event-exit.js
  75. 4
      test/parallel/test-child-process-constructor.js
  76. 6
      test/parallel/test-child-process-default-options.js
  77. 6
      test/parallel/test-child-process-env.js
  78. 8
      test/parallel/test-child-process-exit-code.js
  79. 4
      test/parallel/test-child-process-fork-exec-argv.js
  80. 8
      test/parallel/test-child-process-fork-exec-path.js
  81. 6
      test/parallel/test-child-process-fork-net2.js
  82. 4
      test/parallel/test-child-process-fork-ref.js
  83. 2
      test/parallel/test-child-process-fork-ref2.js
  84. 4
      test/parallel/test-child-process-fork.js
  85. 4
      test/parallel/test-child-process-fork3.js
  86. 4
      test/parallel/test-child-process-internal.js
  87. 4
      test/parallel/test-child-process-set-blocking.js
  88. 4
      test/parallel/test-child-process-silent.js
  89. 4
      test/parallel/test-child-process-spawnsync-env.js
  90. 4
      test/parallel/test-child-process-spawnsync-timeout.js
  91. 4
      test/parallel/test-child-process-stdin-ipc.js
  92. 6
      test/parallel/test-child-process-stdio-inherit.js
  93. 4
      test/parallel/test-cluster-disconnect-with-no-workers.js
  94. 8
      test/parallel/test-cluster-eaddrinuse.js
  95. 4
      test/parallel/test-cluster-fork-env.js
  96. 8
      test/parallel/test-cluster-listening-port.js
  97. 8
      test/parallel/test-cluster-message.js
  98. 8
      test/parallel/test-cluster-rr-domain-listen.js
  99. 8
      test/parallel/test-cluster-send-deadlock.js
  100. 4
      test/parallel/test-cluster-setup-master-cumulative.js

2
test/addons/async-hello-world/test.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
const common = require('../../common'); const common = require('../../common');
var assert = require('assert'); const assert = require('assert');
const binding = require(`./build/${common.buildType}/binding`); const binding = require(`./build/${common.buildType}/binding`);
binding(5, common.mustCall(function(err, val) { binding(5, common.mustCall(function(err, val) {

2
test/addons/hello-world-function-export/test.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
const common = require('../../common'); const common = require('../../common');
var assert = require('assert'); const assert = require('assert');
const binding = require(`./build/${common.buildType}/binding`); const binding = require(`./build/${common.buildType}/binding`);
assert.strictEqual(binding(), 'world'); assert.strictEqual(binding(), 'world');
console.log('binding.hello() =', binding()); console.log('binding.hello() =', binding());

2
test/addons/hello-world/test.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
const common = require('../../common'); const common = require('../../common');
var assert = require('assert'); const assert = require('assert');
const binding = require(`./build/${common.buildType}/binding`); const binding = require(`./build/${common.buildType}/binding`);
assert.strictEqual(binding.hello(), 'world'); assert.strictEqual(binding.hello(), 'world');
console.log('binding.hello() =', binding.hello()); console.log('binding.hello() =', binding.hello());

2
test/addons/load-long-path/test.js

@ -32,6 +32,6 @@ var contents = fs.readFileSync(addonPath);
fs.writeFileSync(addonDestinationPath, contents); fs.writeFileSync(addonDestinationPath, contents);
// Attempt to load at long path destination // Attempt to load at long path destination
var addon = require(addonDestinationPath); const addon = require(addonDestinationPath);
assert.notEqual(addon, null); assert.notEqual(addon, null);
assert.strictEqual(addon.hello(), 'world'); assert.strictEqual(addon.hello(), 'world');

10
test/addons/repl-domain-abort/test.js

@ -1,9 +1,9 @@
'use strict'; 'use strict';
var common = require('../../common'); const common = require('../../common');
var assert = require('assert'); const assert = require('assert');
var repl = require('repl'); const repl = require('repl');
var stream = require('stream'); const stream = require('stream');
var path = require('path'); const path = require('path');
var buildType = process.config.target_defaults.default_configuration; var buildType = process.config.target_defaults.default_configuration;
var buildPath = path.join(__dirname, 'build', buildType, 'binding'); var buildPath = path.join(__dirname, 'build', buildType, 'binding');
// On Windows, escape backslashes in the path before passing it to REPL. // On Windows, escape backslashes in the path before passing it to REPL.

4
test/debugger/helper-debugger-repl.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
const common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
process.env.NODE_DEBUGGER_TIMEOUT = 2000; process.env.NODE_DEBUGGER_TIMEOUT = 2000;
var port = common.PORT; var port = common.PORT;

2
test/debugger/test-debugger-repl-break-in-module.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var repl = require('./helper-debugger-repl.js'); const repl = require('./helper-debugger-repl.js');
repl.startDebugger('break-in-module/main.js'); repl.startDebugger('break-in-module/main.js');

2
test/debugger/test-debugger-repl-restart.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var repl = require('./helper-debugger-repl.js'); const repl = require('./helper-debugger-repl.js');
repl.startDebugger('breakpoints.js'); repl.startDebugger('breakpoints.js');
var linesWithBreakpoint = [ var linesWithBreakpoint = [

2
test/debugger/test-debugger-repl-term.js

@ -2,7 +2,7 @@
require('../common'); require('../common');
process.env.NODE_FORCE_READLINE = 1; process.env.NODE_FORCE_READLINE = 1;
var repl = require('./helper-debugger-repl.js'); const repl = require('./helper-debugger-repl.js');
repl.startDebugger('breakpoints.js'); repl.startDebugger('breakpoints.js');

2
test/debugger/test-debugger-repl-utf8.js

@ -1,5 +1,5 @@
'use strict'; 'use strict';
var common = require('../common'); const common = require('../common');
var script = common.fixturesDir + '/breakpoints_utf8.js'; var script = common.fixturesDir + '/breakpoints_utf8.js';
process.env.NODE_DEBUGGER_TEST_SCRIPT = script; process.env.NODE_DEBUGGER_TEST_SCRIPT = script;

2
test/debugger/test-debugger-repl.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var repl = require('./helper-debugger-repl.js'); const repl = require('./helper-debugger-repl.js');
repl.startDebugger('breakpoints.js'); repl.startDebugger('breakpoints.js');

10
test/disabled/test-debug-brk-file.js

@ -1,9 +1,9 @@
'use strict'; 'use strict';
var common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
var path = require('path'); const path = require('path');
var net = require('net'); const net = require('net');
var isDone = false; var isDone = false;
var targetPath = path.resolve(common.fixturesDir, 'debug-target.js'); var targetPath = path.resolve(common.fixturesDir, 'debug-target.js');

2
test/disabled/test-dgram-send-error.js

@ -10,7 +10,7 @@
const common = require('../common'); const common = require('../common');
var ITERATIONS = 1000; var ITERATIONS = 1000;
var assert = require('assert'), const assert = require('assert'),
dgram = require('dgram'); dgram = require('dgram');
var buf = Buffer.alloc(1024, 42); var buf = Buffer.alloc(1024, 42);

6
test/disabled/test-fs-largefile.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
var common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var path = require('path'), const path = require('path'),
fs = require('fs'), fs = require('fs'),
filepath = path.join(common.tmpDir, 'large.txt'), filepath = path.join(common.tmpDir, 'large.txt'),
fd = fs.openSync(filepath, 'w+'), fd = fs.openSync(filepath, 'w+'),

6
test/disabled/test-http-abort-stream-end.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
var common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var http = require('http'); const http = require('http');
var maxSize = 1024; var maxSize = 1024;
var size = 0; var size = 0;

4
test/disabled/test-https-loop-to-google.js

@ -5,8 +5,8 @@
// Tested on node 0.5.0-pre commit 9851574 // Tested on node 0.5.0-pre commit 9851574
var common = require('../common'); const common = require('../common');
var https = require('https'); const https = require('https');
for (var i = 0; i < 10; ++i) { for (var i = 0; i < 10; ++i) {
https.get({ https.get({

6
test/disabled/test-readline.js

@ -1,9 +1,9 @@
'use strict'; 'use strict';
// Can't test this when 'make test' doesn't assign a tty to the stdout. // Can't test this when 'make test' doesn't assign a tty to the stdout.
// Yet another use-case for require('tty').spawn ? // Yet another use-case for require('tty').spawn ?
var common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var readline = require('readline'); const readline = require('readline');
var key = { var key = {
xterm: { xterm: {

14
test/disabled/test-sendfd.js

@ -26,15 +26,15 @@
// seen in a response yet. This is intended to ensure that all blobs // seen in a response yet. This is intended to ensure that all blobs
// sent out have been relayed back to us. // sent out have been relayed back to us.
var common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var buffer = require('buffer'); const buffer = require('buffer');
var child_process = require('child_process'); const child_process = require('child_process');
var fs = require('fs'); const fs = require('fs');
var net = require('net'); const net = require('net');
var netBinding = process.binding('net'); var netBinding = process.binding('net');
var path = require('path'); const path = require('path');
var DATA = { var DATA = {
'ppid' : process.pid, 'ppid' : process.pid,

4
test/disabled/test-setuidgid.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
// Requires special privileges // Requires special privileges
var common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var oldgid = process.getgid(); var oldgid = process.getgid();
process.setgid('nobody'); process.setgid('nobody');

12
test/disabled/tls_server.js

@ -1,11 +1,11 @@
'use strict'; 'use strict';
var common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var util = require('util'); const util = require('util');
var net = require('net'); const net = require('net');
var fs = require('fs'); const fs = require('fs');
var crypto = require('crypto'); const crypto = require('crypto');
var keyPem = fs.readFileSync(common.fixturesDir + '/cert.pem'); var keyPem = fs.readFileSync(common.fixturesDir + '/cert.pem');
var certPem = fs.readFileSync(common.fixturesDir + '/cert.pem'); var certPem = fs.readFileSync(common.fixturesDir + '/cert.pem');

6
test/fixtures/GH-892-request.js

@ -1,8 +1,8 @@
// Called by test/pummel/test-regress-GH-892.js // Called by test/pummel/test-regress-GH-892.js
var https = require('https'); const https = require('https');
var fs = require('fs'); const fs = require('fs');
var assert = require('assert'); const assert = require('assert');
var PORT = parseInt(process.argv[2]); var PORT = parseInt(process.argv[2]);
var bytesExpected = parseInt(process.argv[3]); var bytesExpected = parseInt(process.argv[3]);

2
test/fixtures/a.js

@ -1,4 +1,4 @@
var c = require('./b/c'); const c = require('./b/c');
console.error('load fixtures/a.js'); console.error('load fixtures/a.js');

2
test/fixtures/a1.js

@ -1,4 +1,4 @@
var c = require('./b/c'); const c = require('./b/c');
console.error('load fixtures/a.js'); console.error('load fixtures/a.js');

6
test/fixtures/b/c.js

@ -1,8 +1,8 @@
var d = require('./d'); const d = require('./d');
var assert = require('assert'); const assert = require('assert');
var package = require('./package'); const package = require('./package');
assert.equal('world', package.hello); assert.equal('world', package.hello);

2
test/fixtures/break-in-module/main.js

@ -1,4 +1,4 @@
var mod = require('./mod.js'); const mod = require('./mod.js');
mod.hello(); mod.hello();
mod.hello(); mod.hello();
debugger; debugger;

2
test/fixtures/child-process-spawn-node.js

@ -1,4 +1,4 @@
var assert = require('assert'); const assert = require('assert');
function onmessage(m) { function onmessage(m) {
console.log('CHILD got message:', m); console.log('CHILD got message:', m);

2
test/fixtures/child_process_should_emit_error.js

@ -1,4 +1,4 @@
var exec = require('child_process').exec; const exec = require('child_process').exec;
[0, 1].forEach(function(i) { [0, 1].forEach(function(i) {
exec('ls', function(err, stdout, stderr) { exec('ls', function(err, stdout, stderr) {

2
test/fixtures/cluster-preload-test.js

@ -1,4 +1,4 @@
var cluster = require('cluster'); const cluster = require('cluster');
if (cluster.isMaster) { if (cluster.isMaster) {
cluster.fork(); // one child cluster.fork(); // one child
cluster.on('exit', function(worker, code, signal) { cluster.on('exit', function(worker, code, signal) {

6
test/fixtures/cluster-preload.js

@ -1,12 +1,12 @@
var assert = require('assert'); const assert = require('assert');
// https://github.com/nodejs/node/issues/1803 // https://github.com/nodejs/node/issues/1803
// this module is used as a preload module. It should have a parent with the // this module is used as a preload module. It should have a parent with the
// module search paths initialized from the current working directory // module search paths initialized from the current working directory
assert.ok(module.parent); assert.ok(module.parent);
var expectedPaths = require('module')._nodeModulePaths(process.cwd()); const expectedPaths = require('module')._nodeModulePaths(process.cwd());
assert.deepEqual(module.parent.paths, expectedPaths); assert.deepEqual(module.parent.paths, expectedPaths);
var cluster = require('cluster'); const cluster = require('cluster');
cluster.isMaster || process.exit(42 + cluster.worker.id); // +42 to distinguish cluster.isMaster || process.exit(42 + cluster.worker.id); // +42 to distinguish
// from exit(1) for other random reasons // from exit(1) for other random reasons

2
test/fixtures/create-file.js

@ -1,4 +1,4 @@
var fs = require('fs'); const fs = require('fs');
var file_name = process.argv[2]; var file_name = process.argv[2];
var file_size = parseInt(process.argv[3]); var file_size = parseInt(process.argv[3]);

2
test/fixtures/cycles/folder/foo.js

@ -1,4 +1,4 @@
var root = require('./../root'); const root = require('./../root');
exports.hello = function() { exports.hello = function() {
return root.calledFromFoo(); return root.calledFromFoo();

2
test/fixtures/cycles/root.js

@ -1,4 +1,4 @@
var foo = exports.foo = require('./folder/foo'); const foo = exports.foo = require('./folder/foo');
exports.hello = 'hello'; exports.hello = 'hello';
exports.sayHello = function() { exports.sayHello = function() {

8
test/fixtures/echo-close-check.js

@ -1,7 +1,7 @@
var common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var net = require('net'); const net = require('net');
var fs = require('fs'); const fs = require('fs');
process.stdout.write('hello world\r\n'); process.stdout.write('hello world\r\n');

4
test/fixtures/echo.js

@ -1,5 +1,5 @@
var common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
process.stdout.write('hello world\r\n'); process.stdout.write('hello world\r\n');

4
test/fixtures/listen-on-socket-and-exit.js

@ -1,7 +1,7 @@
// child process that listens on a socket, allows testing of an EADDRINUSE condition // child process that listens on a socket, allows testing of an EADDRINUSE condition
var common = require('../common'); const common = require('../common');
var net = require('net'); const net = require('net');
common.refreshTmpDir(); common.refreshTmpDir();

2
test/fixtures/module-require/parent/index.js

@ -1,4 +1,4 @@
var child = require('../child'); const child = require('../child');
//console.log(child.module.require, child.module); //console.log(child.module.require, child.module);
console.log(child.module.require('target')); console.log(child.module.require('target'));
console.log(child.loaded); console.log(child.loaded);

2
test/fixtures/node_modules/baz/index.js

@ -1,7 +1,7 @@
console.error(__filename); console.error(__filename);
console.error(module.paths.join('\n') + '\n'); console.error(module.paths.join('\n') + '\n');
// this should work, and get the one that doesn't throw // this should work, and get the one that doesn't throw
var assert = require('assert'); const assert = require('assert');
assert.equal(require('bar'), require('../bar.js')); assert.equal(require('bar'), require('../bar.js'));
// this should work, and get the one in ./node_modules/asdf.js // this should work, and get the one in ./node_modules/asdf.js

2
test/fixtures/node_modules/foo.js

@ -1,4 +1,4 @@
console.error(__filename); console.error(__filename);
console.error(module.paths.join('\n') + '\n'); console.error(module.paths.join('\n') + '\n');
var assert = require('assert'); const assert = require('assert');
assert.equal(require('baz'), require('./baz/index.js')); assert.equal(require('baz'), require('./baz/index.js'));

2
test/fixtures/not-main-module.js

@ -1,4 +1,4 @@
var assert = require('assert'); const assert = require('assert');
assert.notEqual(module, require.main, 'require.main should not == module'); assert.notEqual(module, require.main, 'require.main should not == module');
assert.notEqual(module, process.mainModule, assert.notEqual(module, process.mainModule,
'process.mainModule should not === module'); 'process.mainModule should not === module');

2
test/fixtures/parent-process-nonpersistent.js

@ -1,5 +1,5 @@
var spawn = require('child_process').spawn, const spawn = require('child_process').spawn,
path = require('path'), path = require('path'),
childPath = path.join(__dirname, 'child-process-persistent.js'); childPath = path.join(__dirname, 'child-process-persistent.js');

2
test/fixtures/path-resolve.js

@ -1,4 +1,4 @@
// Tests resolving a path in the context of a spawned process. // Tests resolving a path in the context of a spawned process.
// See https://github.com/nodejs/node/issues/7215 // See https://github.com/nodejs/node/issues/7215
var path = require('path'); const path = require('path');
console.log(path.resolve(process.argv[2])); console.log(path.resolve(process.argv[2]));

2
test/fixtures/path.js

@ -1,5 +1,5 @@
// This is actually more a fixture than a test. It is used to make // This is actually more a fixture than a test. It is used to make
var common = require('../common'); const common = require('../common');
// sure that require('./path') and require('path') do different things. // sure that require('./path') and require('path') do different things.
// It has to be in the same directory as the test 'test-module-loading.js' // It has to be in the same directory as the test 'test-module-loading.js'
// and it has to have the same name as an internal module. // and it has to have the same name as an internal module.

2
test/fixtures/print-chars-from-buffer.js

@ -1,4 +1,4 @@
var assert = require('assert'); const assert = require('assert');
var n = parseInt(process.argv[2]); var n = parseInt(process.argv[2]);

2
test/fixtures/print-chars.js

@ -1,4 +1,4 @@
var assert = require('assert'); const assert = require('assert');
var n = parseInt(process.argv[2]); var n = parseInt(process.argv[2]);

2
test/fixtures/recvfd.js

@ -1,7 +1,7 @@
// See test/simple/test-sendfd.js for a complete description of what this // See test/simple/test-sendfd.js for a complete description of what this
// script is doing and how it fits into the test as a whole. // script is doing and how it fits into the test as a whole.
var net = require('net'); const net = require('net');
var receivedData = []; var receivedData = [];
var receivedFDs = []; var receivedFDs = [];

2
test/fixtures/stdio-filter.js

@ -1,4 +1,4 @@
var util = require('util'); const util = require('util');
var regexIn = process.argv[2]; var regexIn = process.argv[2];
var replacement = process.argv[3]; var replacement = process.argv[3];

2
test/fixtures/test-init-native/fs.js

@ -1,5 +1,5 @@
(function() { (function() {
var fs = require('fs'); const fs = require('fs');
if (fs.readFile) { if (fs.readFile) {
require('util').print('fs loaded successfully'); require('util').print('fs loaded successfully');
} }

2
test/fixtures/test-regress-GH-4015.js

@ -1,4 +1,4 @@
var fs = require('fs'); const fs = require('fs');
function load() { function load() {
fs.statSync('.'); fs.statSync('.');

2
test/fixtures/uncaught-exceptions/domain.js

@ -1,4 +1,4 @@
var domain = require('domain'); const domain = require('domain');
var d = domain.create(); var d = domain.create();
d.on('error', function(err) { d.on('error', function(err) {

2
test/gc/node_modules/bindings/README.md

@ -35,7 +35,7 @@ Example
and architecture is as simple as: and architecture is as simple as:
``` js ``` js
var bindings = require('bindings')('binding.node') const bindings = require('bindings')('binding.node')
// Use your bindings defined in your C files // Use your bindings defined in your C files
bindings.your_c_function() bindings.your_c_function()

2
test/gc/node_modules/bindings/bindings.js

@ -3,7 +3,7 @@
* Module dependencies. * Module dependencies.
*/ */
var fs = require('fs') const fs = require('fs')
, path = require('path') , path = require('path')
, join = path.join , join = path.join
, dirname = path.dirname , dirname = path.dirname

2
test/gc/node_modules/nan/tools/1to2.js

@ -7,7 +7,7 @@
* MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md> * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
********************************************************************/ ********************************************************************/
var commander = require('commander'), const commander = require('commander'),
fs = require('fs'), fs = require('fs'),
glob = require('glob'), glob = require('glob'),
groups = [], groups = [],

4
test/gc/node_modules/weak/README.md

@ -36,7 +36,7 @@ Here's an example of calling a `cleanup()` function on a Object before it gets
garbage collected: garbage collected:
``` js ``` js
var weak = require('weak') const weak = require('weak')
// we are going to "monitor" this Object and invoke "cleanup" // we are going to "monitor" this Object and invoke "cleanup"
// before the object is garbage collected // before the object is garbage collected
@ -80,7 +80,7 @@ at the highest scope possible (top-level being the best). Named functions
work really well for this: work really well for this:
``` js ``` js
var http = require('http') const http = require('http')
, weak = require('weak') , weak = require('weak')
http.createServer(function (req, res) { http.createServer(function (req, res) {

2
test/gc/node_modules/weak/build/Makefile

@ -326,7 +326,7 @@ ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
endif endif
quiet_cmd_regen_makefile = ACTION Regenerating $@ quiet_cmd_regen_makefile = ACTION Regenerating $@
cmd_regen_makefile = cd $(srcdir); /Users/trott/io.js/deps/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/Users/trott/io.js/test/gc/node_modules/weak/build/config.gypi -I/Users/trott/io.js/deps/npm/node_modules/node-gyp/addon.gypi -I/Users/trott/io.js/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/trott/io.js" "-Dnode_gyp_dir=/Users/trott/io.js/deps/npm/node_modules/node-gyp" "-Dnode_lib_file=node.lib" "-Dmodule_root_dir=/Users/trott/io.js/test/gc/node_modules/weak" binding.gyp cmd_regen_makefile = cd $(srcdir); /Users/cjihrig/iojs/node/deps/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/Users/cjihrig/iojs/node/test/gc/node_modules/weak/build/config.gypi -I/Users/cjihrig/iojs/node/deps/npm/node_modules/node-gyp/addon.gypi -I/Users/cjihrig/iojs/node/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/cjihrig/iojs/node" "-Dnode_gyp_dir=/Users/cjihrig/iojs/node/deps/npm/node_modules/node-gyp" "-Dnode_lib_file=node.lib" "-Dmodule_root_dir=/Users/cjihrig/iojs/node/test/gc/node_modules/weak" binding.gyp
Makefile: $(srcdir)/../../../../deps/npm/node_modules/node-gyp/addon.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../common.gypi Makefile: $(srcdir)/../../../../deps/npm/node_modules/node-gyp/addon.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../common.gypi
$(call do_cmd,regen_makefile) $(call do_cmd,regen_makefile)

21
test/gc/node_modules/weak/build/config.gypi

@ -9,47 +9,58 @@
}, },
"variables": { "variables": {
"asan": 0, "asan": 0,
"coverage": "false",
"debug_devtools": "node",
"force_dynamic_crt": 0,
"host_arch": "x64", "host_arch": "x64",
"icu_data_file": "icudt57l.dat", "icu_data_file": "icudt58l.dat",
"icu_data_in": "../../deps/icu-small/source/data/in/icudt57l.dat", "icu_data_in": "../../deps/icu-small/source/data/in/icudt58l.dat",
"icu_endianness": "l", "icu_endianness": "l",
"icu_gyp_path": "tools/icu/icu-generic.gyp", "icu_gyp_path": "tools/icu/icu-generic.gyp",
"icu_locales": "en,root", "icu_locales": "en,root",
"icu_path": "deps/icu-small", "icu_path": "deps/icu-small",
"icu_small": "true", "icu_small": "true",
"icu_ver_major": "57", "icu_ver_major": "58",
"llvm_version": 0, "llvm_version": 0,
"node_byteorder": "little", "node_byteorder": "little",
"node_enable_d8": "false",
"node_enable_v8_vtunejit": "false", "node_enable_v8_vtunejit": "false",
"node_install_npm": "true", "node_install_npm": "true",
"node_module_version": 51,
"node_no_browser_globals": "false", "node_no_browser_globals": "false",
"node_prefix": "/usr/local", "node_prefix": "/usr/local",
"node_release_urlbase": "", "node_release_urlbase": "",
"node_shared": "false",
"node_shared_cares": "false", "node_shared_cares": "false",
"node_shared_http_parser": "false", "node_shared_http_parser": "false",
"node_shared_libuv": "false", "node_shared_libuv": "false",
"node_shared_openssl": "false", "node_shared_openssl": "false",
"node_shared_zlib": "false", "node_shared_zlib": "false",
"node_tag": "", "node_tag": "",
"node_use_bundled_v8": "true",
"node_use_dtrace": "true", "node_use_dtrace": "true",
"node_use_etw": "false", "node_use_etw": "false",
"node_use_lttng": "false", "node_use_lttng": "false",
"node_use_openssl": "true", "node_use_openssl": "true",
"node_use_perfctr": "false", "node_use_perfctr": "false",
"node_use_v8_platform": "true",
"openssl_fips": "", "openssl_fips": "",
"openssl_no_asm": 0, "openssl_no_asm": 0,
"shlib_suffix": "51.dylib",
"target_arch": "x64", "target_arch": "x64",
"uv_parent_path": "/deps/uv/", "uv_parent_path": "/deps/uv/",
"uv_use_dtrace": "true", "uv_use_dtrace": "true",
"v8_enable_gdbjit": 0, "v8_enable_gdbjit": 0,
"v8_enable_i18n_support": 1, "v8_enable_i18n_support": 1,
"v8_inspector": "true",
"v8_no_strict_aliasing": 1, "v8_no_strict_aliasing": 1,
"v8_optimized_debug": 0, "v8_optimized_debug": 0,
"v8_random_seed": 0, "v8_random_seed": 0,
"v8_use_snapshot": "true", "v8_use_snapshot": "true",
"want_separate_host_toolset": 0, "want_separate_host_toolset": 0,
"xcode_version": "7.0", "want_separate_host_toolset_mkpeephole": 0,
"nodedir": "/Users/trott/io.js", "xcode_version": "8.0",
"nodedir": "/Users/cjihrig/iojs/node",
"copy_dev_lib": "false", "copy_dev_lib": "false",
"standalone_static_library": 1 "standalone_static_library": 1
} }

30
test/gc/node_modules/weak/build/weakref.target.mk

@ -4,6 +4,9 @@ TOOLSET := target
TARGET := weakref TARGET := weakref
DEFS_Debug := \ DEFS_Debug := \
'-DNODE_GYP_MODULE_NAME=weakref' \ '-DNODE_GYP_MODULE_NAME=weakref' \
'-DUSING_UV_SHARED=1' \
'-DUSING_V8_SHARED=1' \
'-DV8_DEPRECATION_WARNINGS=1' \
'-D_DARWIN_USE_64_BIT_INODE=1' \ '-D_DARWIN_USE_64_BIT_INODE=1' \
'-D_LARGEFILE_SOURCE' \ '-D_LARGEFILE_SOURCE' \
'-D_FILE_OFFSET_BITS=64' \ '-D_FILE_OFFSET_BITS=64' \
@ -29,6 +32,7 @@ CFLAGS_C_Debug := \
# Flags passed to only C++ files. # Flags passed to only C++ files.
CFLAGS_CC_Debug := \ CFLAGS_CC_Debug := \
-std=gnu++0x \ -std=gnu++0x \
-stdlib=libc++ \
-fno-rtti \ -fno-rtti \
-fno-exceptions \ -fno-exceptions \
-fno-threadsafe-statics \ -fno-threadsafe-statics \
@ -41,14 +45,17 @@ CFLAGS_OBJC_Debug :=
CFLAGS_OBJCC_Debug := CFLAGS_OBJCC_Debug :=
INCS_Debug := \ INCS_Debug := \
-I/Users/trott/io.js/include/node \ -I/Users/cjihrig/iojs/node/include/node \
-I/Users/trott/io.js/src \ -I/Users/cjihrig/iojs/node/src \
-I/Users/trott/io.js/deps/uv/include \ -I/Users/cjihrig/iojs/node/deps/uv/include \
-I/Users/trott/io.js/deps/v8/include \ -I/Users/cjihrig/iojs/node/deps/v8/include \
-I$(srcdir)/../nan -I$(srcdir)/../nan
DEFS_Release := \ DEFS_Release := \
'-DNODE_GYP_MODULE_NAME=weakref' \ '-DNODE_GYP_MODULE_NAME=weakref' \
'-DUSING_UV_SHARED=1' \
'-DUSING_V8_SHARED=1' \
'-DV8_DEPRECATION_WARNINGS=1' \
'-D_DARWIN_USE_64_BIT_INODE=1' \ '-D_DARWIN_USE_64_BIT_INODE=1' \
'-D_LARGEFILE_SOURCE' \ '-D_LARGEFILE_SOURCE' \
'-D_FILE_OFFSET_BITS=64' \ '-D_FILE_OFFSET_BITS=64' \
@ -72,6 +79,7 @@ CFLAGS_C_Release := \
# Flags passed to only C++ files. # Flags passed to only C++ files.
CFLAGS_CC_Release := \ CFLAGS_CC_Release := \
-std=gnu++0x \ -std=gnu++0x \
-stdlib=libc++ \
-fno-rtti \ -fno-rtti \
-fno-exceptions \ -fno-exceptions \
-fno-threadsafe-statics \ -fno-threadsafe-statics \
@ -84,10 +92,10 @@ CFLAGS_OBJC_Release :=
CFLAGS_OBJCC_Release := CFLAGS_OBJCC_Release :=
INCS_Release := \ INCS_Release := \
-I/Users/trott/io.js/include/node \ -I/Users/cjihrig/iojs/node/include/node \
-I/Users/trott/io.js/src \ -I/Users/cjihrig/iojs/node/src \
-I/Users/trott/io.js/deps/uv/include \ -I/Users/cjihrig/iojs/node/deps/uv/include \
-I/Users/trott/io.js/deps/v8/include \ -I/Users/cjihrig/iojs/node/deps/v8/include \
-I$(srcdir)/../nan -I$(srcdir)/../nan
OBJS := \ OBJS := \
@ -125,7 +133,8 @@ LDFLAGS_Debug := \
-Wl,-search_paths_first \ -Wl,-search_paths_first \
-mmacosx-version-min=10.7 \ -mmacosx-version-min=10.7 \
-arch x86_64 \ -arch x86_64 \
-L$(builddir) -L$(builddir) \
-stdlib=libc++
LIBTOOLFLAGS_Debug := \ LIBTOOLFLAGS_Debug := \
-undefined dynamic_lookup \ -undefined dynamic_lookup \
@ -138,7 +147,8 @@ LDFLAGS_Release := \
-Wl,-search_paths_first \ -Wl,-search_paths_first \
-mmacosx-version-min=10.7 \ -mmacosx-version-min=10.7 \
-arch x86_64 \ -arch x86_64 \
-L$(builddir) -L$(builddir) \
-stdlib=libc++
LIBTOOLFLAGS_Release := \ LIBTOOLFLAGS_Release := \
-undefined dynamic_lookup \ -undefined dynamic_lookup \

4
test/gc/node_modules/weak/lib/weak.js

@ -3,8 +3,8 @@
* Module dependencies. * Module dependencies.
*/ */
var Emitter = require('events').EventEmitter; const Emitter = require('events').EventEmitter;
var bindings = require('bindings')('weakref.node'); const bindings = require('bindings')('weakref.node');
/** /**
* Set global weak callback function. * Set global weak callback function.

8
test/internet/test-dgram-send-cb-quelches-error.js

@ -1,9 +1,9 @@
'use strict'; 'use strict';
var common = require('../common'); const common = require('../common');
var mustCall = common.mustCall; var mustCall = common.mustCall;
var assert = require('assert'); const assert = require('assert');
var dgram = require('dgram'); const dgram = require('dgram');
var dns = require('dns'); const dns = require('dns');
var socket = dgram.createSocket('udp4'); var socket = dgram.createSocket('udp4');
var buffer = Buffer.from('gary busey'); var buffer = Buffer.from('gary busey');

6
test/internet/test-dns-cares-domains.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert'); const assert = require('assert');
var dns = require('dns'); const dns = require('dns');
var domain = require('domain'); const domain = require('domain');
var methods = [ var methods = [
'resolve4', 'resolve4',

4
test/internet/test-dns-txt-sigsegv.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert'); const assert = require('assert');
var dns = require('dns'); const dns = require('dns');
dns.resolveTxt('www.microsoft.com', function(err, records) { dns.resolveTxt('www.microsoft.com', function(err, records) {
assert.equal(err, null); assert.equal(err, null);

6
test/internet/test-http-https-default-ports.js

@ -1,13 +1,13 @@
'use strict'; 'use strict';
var common = require('../common'); const common = require('../common');
if (!common.hasCrypto) { if (!common.hasCrypto) {
common.skip('missing crypto'); common.skip('missing crypto');
return; return;
} }
var https = require('https'); const https = require('https');
var http = require('http'); const http = require('http');
https.get('https://www.google.com/', common.mustCall(function(res) { https.get('https://www.google.com/', common.mustCall(function(res) {
res.resume(); res.resume();

4
test/internet/test-net-connect-timeout.js

@ -4,8 +4,8 @@
// https://groups.google.com/forum/#!topic/nodejs-dev/jR7-5UDqXkw // https://groups.google.com/forum/#!topic/nodejs-dev/jR7-5UDqXkw
const common = require('../common'); const common = require('../common');
var net = require('net'); const net = require('net');
var assert = require('assert'); const assert = require('assert');
var start = new Date(); var start = new Date();

2
test/internet/test-net-connect-unref.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
const common = require('../common'); const common = require('../common');
var net = require('net'); const net = require('net');
var client; var client;
var TIMEOUT = 10 * 1000; var TIMEOUT = 10 * 1000;

4
test/internet/test-tls-connnect-melissadata.js

@ -2,13 +2,13 @@
// Test for authorized access to the server which has a cross root // Test for authorized access to the server which has a cross root
// certification between Starfield Class 2 and ValiCert Class 2 // certification between Starfield Class 2 and ValiCert Class 2
var common = require('../common'); const common = require('../common');
if (!common.hasCrypto) { if (!common.hasCrypto) {
common.skip('missing crypto'); common.skip('missing crypto');
return; return;
} }
var tls = require('tls'); const tls = require('tls');
var socket = tls.connect(443, 'address.melissadata.net', function() { var socket = tls.connect(443, 'address.melissadata.net', function() {
socket.resume(); socket.resume();
socket.destroy(); socket.destroy();

2
test/message/error_exit.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert'); const assert = require('assert');
process.on('exit', function(code) { process.on('exit', function(code) {
console.error('Exiting with code=%d', code); console.error('Exiting with code=%d', code);

2
test/message/eval_messages.js

@ -2,7 +2,7 @@
require('../common'); require('../common');
var spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
function run(cmd, strict, cb) { function run(cmd, strict, cb) {
var args = []; var args = [];

2
test/message/stdin_messages.js

@ -2,7 +2,7 @@
require('../common'); require('../common');
var spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
function run(cmd, strict, cb) { function run(cmd, strict, cb) {
var args = []; var args = [];

2
test/message/undefined_reference_in_new_context.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var vm = require('vm'); const vm = require('vm');
console.error('before'); console.error('before');

2
test/message/vm_display_runtime_error.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var vm = require('vm'); const vm = require('vm');
console.error('beginning'); console.error('beginning');

2
test/message/vm_display_syntax_error.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var vm = require('vm'); const vm = require('vm');
console.error('beginning'); console.error('beginning');

2
test/message/vm_dont_display_runtime_error.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var vm = require('vm'); const vm = require('vm');
console.error('beginning'); console.error('beginning');

2
test/message/vm_dont_display_syntax_error.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var vm = require('vm'); const vm = require('vm');
console.error('beginning'); console.error('beginning');

4
test/parallel/test-assert.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert'); const assert = require('assert');
var a = require('assert'); const a = require('assert');
function makeBlock(f) { function makeBlock(f) {
var args = Array.prototype.slice.call(arguments, 1); var args = Array.prototype.slice.call(arguments, 1);

2
test/parallel/test-beforeexit-event-exit.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert'); const assert = require('assert');
process.on('beforeExit', function() { process.on('beforeExit', function() {
assert(false, 'exit should not allow this to occur'); assert(false, 'exit should not allow this to occur');

4
test/parallel/test-child-process-constructor.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert'); const assert = require('assert');
var child_process = require('child_process'); const child_process = require('child_process');
var ChildProcess = child_process.ChildProcess; var ChildProcess = child_process.ChildProcess;
assert.strictEqual(typeof ChildProcess, 'function'); assert.strictEqual(typeof ChildProcess, 'function');

6
test/parallel/test-child-process-default-options.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
var common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
process.env.HELLO = 'WORLD'; process.env.HELLO = 'WORLD';

6
test/parallel/test-child-process-env.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
var common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
var env = { var env = {
'HELLO': 'WORLD' 'HELLO': 'WORLD'

8
test/parallel/test-child-process-exit-code.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
var common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
var path = require('path'); const path = require('path');
var exitScript = path.join(common.fixturesDir, 'exit.js'); var exitScript = path.join(common.fixturesDir, 'exit.js');
var exitChild = spawn(process.argv[0], [exitScript, 23]); var exitChild = spawn(process.argv[0], [exitScript, 23]);

4
test/parallel/test-child-process-fork-exec-argv.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert'); const assert = require('assert');
var child_process = require('child_process'); const child_process = require('child_process');
var spawn = child_process.spawn; var spawn = child_process.spawn;
var fork = child_process.fork; var fork = child_process.fork;

8
test/parallel/test-child-process-fork-exec-path.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
const common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var fs = require('fs'); const fs = require('fs');
var path = require('path'); const path = require('path');
var msg = {test: 'this'}; var msg = {test: 'this'};
var nodePath = process.execPath; var nodePath = process.execPath;
var copyPath = path.join(common.tmpDir, 'node-copy.exe'); var copyPath = path.join(common.tmpDir, 'node-copy.exe');
@ -25,7 +25,7 @@ if (process.env.FORK) {
// slow but simple // slow but simple
var envCopy = JSON.parse(JSON.stringify(process.env)); var envCopy = JSON.parse(JSON.stringify(process.env));
envCopy.FORK = 'true'; envCopy.FORK = 'true';
var child = require('child_process').fork(__filename, { const child = require('child_process').fork(__filename, {
execPath: copyPath, execPath: copyPath,
env: envCopy env: envCopy
}); });

6
test/parallel/test-child-process-fork-net2.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
const common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var fork = require('child_process').fork; const fork = require('child_process').fork;
var net = require('net'); const net = require('net');
var count = 12; var count = 12;
if (process.argv[2] === 'child') { if (process.argv[2] === 'child') {

4
test/parallel/test-child-process-fork-ref.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert'); const assert = require('assert');
var fork = require('child_process').fork; const fork = require('child_process').fork;
if (process.argv[2] === 'child') { if (process.argv[2] === 'child') {
process.send('1'); process.send('1');

2
test/parallel/test-child-process-fork-ref2.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var fork = require('child_process').fork; const fork = require('child_process').fork;
if (process.argv[2] === 'child') { if (process.argv[2] === 'child') {
console.log('child -> call disconnect'); console.log('child -> call disconnect');

4
test/parallel/test-child-process-fork.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
const common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var fork = require('child_process').fork; const fork = require('child_process').fork;
var args = ['foo', 'bar']; var args = ['foo', 'bar'];
var n = fork(common.fixturesDir + '/child-process-spawn-node.js', args); var n = fork(common.fixturesDir + '/child-process-spawn-node.js', args);

4
test/parallel/test-child-process-fork3.js

@ -1,5 +1,5 @@
'use strict'; 'use strict';
var common = require('../common'); const common = require('../common');
var child_process = require('child_process'); const child_process = require('child_process');
child_process.fork(common.fixturesDir + '/empty.js'); // should not hang child_process.fork(common.fixturesDir + '/empty.js'); // should not hang

4
test/parallel/test-child-process-internal.js

@ -1,6 +1,6 @@
'use strict'; 'use strict';
const common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
//messages //messages
var PREFIX = 'NODE_'; var PREFIX = 'NODE_';
@ -18,7 +18,7 @@ if (process.argv[2] === 'child') {
} else { } else {
var fork = require('child_process').fork; const fork = require('child_process').fork;
var child = fork(process.argv[1], ['child']); var child = fork(process.argv[1], ['child']);
child.once('message', common.mustCall(function(data) { child.once('message', common.mustCall(function(data) {

4
test/parallel/test-child-process-set-blocking.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
const common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var ch = require('child_process'); const ch = require('child_process');
var SIZE = 100000; var SIZE = 100000;

4
test/parallel/test-child-process-silent.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert'); const assert = require('assert');
var childProcess = require('child_process'); const childProcess = require('child_process');
// Child pipe test // Child pipe test
if (process.argv[2] === 'pipe') { if (process.argv[2] === 'pipe') {

4
test/parallel/test-child-process-spawnsync-env.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert'); const assert = require('assert');
var cp = require('child_process'); const cp = require('child_process');
if (process.argv[2] === 'child') { if (process.argv[2] === 'child') {
console.log(process.env.foo); console.log(process.env.foo);

4
test/parallel/test-child-process-spawnsync-timeout.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert'); const assert = require('assert');
var spawnSync = require('child_process').spawnSync; const spawnSync = require('child_process').spawnSync;
var TIMER = 200; var TIMER = 200;
var SLEEP = 5000; var SLEEP = 5000;

4
test/parallel/test-child-process-stdin-ipc.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
const common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
if (process.argv[2] === 'child') { if (process.argv[2] === 'child') {
// Just reference stdin, it should start it // Just reference stdin, it should start it

6
test/parallel/test-child-process-stdio-inherit.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
var common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var spawn = require('child_process').spawn; const spawn = require('child_process').spawn;
if (process.argv[2] === 'parent') if (process.argv[2] === 'parent')
parent(); parent();

4
test/parallel/test-cluster-disconnect-with-no-workers.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert'); const assert = require('assert');
var cluster = require('cluster'); const cluster = require('cluster');
var disconnected; var disconnected;

8
test/parallel/test-cluster-eaddrinuse.js

@ -3,10 +3,10 @@
// leave the master process in a confused state. Releasing the port and // leave the master process in a confused state. Releasing the port and
// trying again should Just Work[TM]. // trying again should Just Work[TM].
var common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var fork = require('child_process').fork; const fork = require('child_process').fork;
var net = require('net'); const net = require('net');
var id = '' + process.argv[2]; var id = '' + process.argv[2];

4
test/parallel/test-cluster-fork-env.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert'); const assert = require('assert');
var cluster = require('cluster'); const cluster = require('cluster');
if (cluster.isWorker) { if (cluster.isWorker) {
const result = cluster.worker.send({ const result = cluster.worker.send({

8
test/parallel/test-cluster-listening-port.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
var common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var cluster = require('cluster'); const cluster = require('cluster');
var net = require('net'); const net = require('net');
if (cluster.isMaster) { if (cluster.isMaster) {
cluster.fork(); cluster.fork();

8
test/parallel/test-cluster-message.js

@ -1,8 +1,8 @@
'use strict'; 'use strict';
var common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var cluster = require('cluster'); const cluster = require('cluster');
var net = require('net'); const net = require('net');
function forEach(obj, fn) { function forEach(obj, fn) {
Object.keys(obj).forEach(function(name, index) { Object.keys(obj).forEach(function(name, index) {

8
test/parallel/test-cluster-rr-domain-listen.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
var common = require('../common'); const common = require('../common');
var cluster = require('cluster'); const cluster = require('cluster');
var domain = require('domain'); const domain = require('domain');
// RR is the default for v0.11.9+ so the following line is redundant: // RR is the default for v0.11.9+ so the following line is redundant:
// cluster.schedulingPolicy = cluster.SCHED_RR; // cluster.schedulingPolicy = cluster.SCHED_RR;
@ -10,7 +10,7 @@ if (cluster.isWorker) {
var d = domain.create(); var d = domain.create();
d.run(function() { }); d.run(function() { });
var http = require('http'); const http = require('http');
http.Server(function() { }).listen(common.PORT, '127.0.0.1'); http.Server(function() { }).listen(common.PORT, '127.0.0.1');
} else if (cluster.isMaster) { } else if (cluster.isMaster) {

8
test/parallel/test-cluster-send-deadlock.js

@ -2,10 +2,10 @@
// Testing mutual send of handles: from master to worker, and from worker to // Testing mutual send of handles: from master to worker, and from worker to
// master. // master.
var common = require('../common'); const common = require('../common');
var assert = require('assert'); const assert = require('assert');
var cluster = require('cluster'); const cluster = require('cluster');
var net = require('net'); const net = require('net');
if (cluster.isMaster) { if (cluster.isMaster) {
var worker = cluster.fork(); var worker = cluster.fork();

4
test/parallel/test-cluster-setup-master-cumulative.js

@ -1,7 +1,7 @@
'use strict'; 'use strict';
require('../common'); require('../common');
var assert = require('assert'); const assert = require('assert');
var cluster = require('cluster'); const cluster = require('cluster');
assert(cluster.isMaster); assert(cluster.isMaster);

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save