mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 09:02:40 +00:00

common.js contains code that checks for variables leaking into the global namespace. Load common.js in all tests that do not intentionally leak variables. PR-URL: https://github.com/nodejs/node/pull/3095 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
23 lines
524 B
JavaScript
23 lines
524 B
JavaScript
'use strict';
|
|
require('../common');
|
|
var path = require('path');
|
|
var assert = require('assert');
|
|
var spawn = require('child_process').spawn;
|
|
|
|
if (process.argv[2] !== 'child') {
|
|
var child = spawn(process.execPath, [__filename, 'child'], {
|
|
cwd: path.dirname(process.execPath)
|
|
});
|
|
|
|
var childArgv0 = '';
|
|
child.stdout.on('data', function(chunk) {
|
|
childArgv0 += chunk;
|
|
});
|
|
process.on('exit', function() {
|
|
assert.equal(childArgv0, process.execPath);
|
|
});
|
|
}
|
|
else {
|
|
process.stdout.write(process.argv[0]);
|
|
}
|