// Workaround for breakage caused by https://github.com/nodejs/node/pull/5950
// Those changes will be reverted in https://github.com/nodejs/node/pull/6537
// Revert #815 and #827 when the above changes land in Node.js
console.warn('WARNING: `npm link ava` detected: This breaks NYC coverage on early versions of Node 6.\nSee https://github.com/sindresorhus/ava/pull/815');
}
varenv=process.env;
// ensure NODE_PATH paths are absolute
@ -31,37 +42,47 @@ module.exports = function (file, opts) {
}:false
},opts);
// Workaround for breakage caused by https://github.com/nodejs/node/pull/5950
// Those changes will be reverted in https://github.com/nodejs/node/pull/6537
varps;
// Revert #815 when these changes land in Node.js
varexecArgv=process.execArgv;
varcwd=path.dirname(file);
// This whole if statement is copied straight out of Nodes `child_process`
if(process._eval!=null){// eslint-disable-line
varindex=execArgv.lastIndexOf(process._eval);
if(index>0){
// Remove the -e switch to avoid fork bombing ourselves.
execArgv=execArgv.slice();
execArgv.splice(index-1,2);
if(fixNpmLink){
// Workaround for breakage caused by https://github.com/nodejs/node/pull/5950
// Those changes will be reverted in https://github.com/nodejs/node/pull/6537
// Revert #815 and #827 when the above changes land in Node.js
varexecArgv=process.execArgv;
varcwd=path.dirname(file);
// This whole if statement is copied straight out of Nodes `child_process`
if(process._eval!=null){// eslint-disable-line
varindex=execArgv.lastIndexOf(process._eval);
if(index>0){
// Remove the -e switch to avoid fork bombing ourselves.