test: use const for all require() calls
PR-URL: https://github.com/nodejs/node/pull/10550 Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
parent
1605a2e02a
commit
ff1efa6087
@ -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) {
|
||||||
|
@ -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());
|
||||||
|
@ -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());
|
||||||
|
@ -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');
|
||||||
|
@ -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.
|
||||||
|
@ -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;
|
||||||
|
@ -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');
|
||||||
|
|
||||||
|
@ -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,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');
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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');
|
||||||
|
|
||||||
|
@ -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');
|
||||||
|
@ -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);
|
||||||
|
@ -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+'),
|
||||||
|
@ -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;
|
||||||
|
@ -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({
|
||||||
|
@ -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: {
|
||||||
|
@ -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,
|
||||||
|
@ -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');
|
||||||
|
@ -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
vendored
6
test/fixtures/GH-892-request.js
vendored
@ -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
vendored
2
test/fixtures/a.js
vendored
@ -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
vendored
2
test/fixtures/a1.js
vendored
@ -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
vendored
6
test/fixtures/b/c.js
vendored
@ -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
vendored
2
test/fixtures/break-in-module/main.js
vendored
@ -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
vendored
2
test/fixtures/child-process-spawn-node.js
vendored
@ -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);
|
||||||
|
@ -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
vendored
2
test/fixtures/cluster-preload-test.js
vendored
@ -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
vendored
6
test/fixtures/cluster-preload.js
vendored
@ -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
vendored
2
test/fixtures/create-file.js
vendored
@ -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
vendored
2
test/fixtures/cycles/folder/foo.js
vendored
@ -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
vendored
2
test/fixtures/cycles/root.js
vendored
@ -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
vendored
8
test/fixtures/echo-close-check.js
vendored
@ -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
vendored
4
test/fixtures/echo.js
vendored
@ -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
vendored
4
test/fixtures/listen-on-socket-and-exit.js
vendored
@ -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
vendored
2
test/fixtures/module-require/parent/index.js
vendored
@ -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
generated
vendored
2
test/fixtures/node_modules/baz/index.js
generated
vendored
@ -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
generated
vendored
2
test/fixtures/node_modules/foo.js
generated
vendored
@ -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
vendored
2
test/fixtures/not-main-module.js
vendored
@ -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');
|
||||||
|
@ -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
vendored
2
test/fixtures/path-resolve.js
vendored
@ -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
vendored
2
test/fixtures/path.js
vendored
@ -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
vendored
2
test/fixtures/print-chars-from-buffer.js
vendored
@ -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
vendored
2
test/fixtures/print-chars.js
vendored
@ -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
vendored
2
test/fixtures/recvfd.js
vendored
@ -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
vendored
2
test/fixtures/stdio-filter.js
vendored
@ -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
vendored
2
test/fixtures/test-init-native/fs.js
vendored
@ -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
vendored
2
test/fixtures/test-regress-GH-4015.js
vendored
@ -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
vendored
2
test/fixtures/uncaught-exceptions/domain.js
vendored
@ -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
generated
vendored
2
test/gc/node_modules/bindings/README.md
generated
vendored
@ -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
generated
vendored
2
test/gc/node_modules/bindings/bindings.js
generated
vendored
@ -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
generated
vendored
2
test/gc/node_modules/nan/tools/1to2.js
generated
vendored
@ -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
generated
vendored
4
test/gc/node_modules/weak/README.md
generated
vendored
@ -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
generated
vendored
2
test/gc/node_modules/weak/build/Makefile
generated
vendored
@ -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
generated
vendored
21
test/gc/node_modules/weak/build/config.gypi
generated
vendored
@ -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
generated
vendored
30
test/gc/node_modules/weak/build/weakref.target.mk
generated
vendored
@ -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
generated
vendored
4
test/gc/node_modules/weak/lib/weak.js
generated
vendored
@ -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.
|
||||||
|
@ -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');
|
||||||
|
@ -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',
|
||||||
|
@ -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);
|
||||||
|
@ -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,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();
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
@ -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();
|
||||||
|
@ -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,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,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 = [];
|
||||||
|
@ -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');
|
||||||
|
|
||||||
|
@ -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');
|
||||||
|
|
||||||
|
@ -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');
|
||||||
|
|
||||||
|
@ -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');
|
||||||
|
|
||||||
|
@ -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');
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
@ -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');
|
||||||
|
@ -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');
|
||||||
|
|
||||||
|
@ -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';
|
||||||
|
|
||||||
|
@ -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'
|
||||||
|
@ -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]);
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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
|
||||||
});
|
});
|
||||||
|
@ -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') {
|
||||||
|
@ -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');
|
||||||
|
@ -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');
|
||||||
|
@ -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);
|
||||||
|
@ -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
|
||||||
|
@ -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) {
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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') {
|
||||||
|
@ -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);
|
||||||
|
@ -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;
|
||||||
|
@ -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
|
||||||
|
@ -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();
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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];
|
||||||
|
|
||||||
|
@ -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({
|
||||||
|
@ -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();
|
||||||
|
@ -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) {
|
||||||
|
@ -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) {
|
||||||
|
@ -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();
|
||||||
|
@ -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 have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user