Skip to content

Commit

Permalink
fix: Remove legacy ChildProcess resolution
Browse files Browse the repository at this point in the history
This commit removes the workaround used to access `cp.ChildProcess` in Node <= 0.10.
  • Loading branch information
demurgos committed May 10, 2019
1 parent 6e86337 commit d0c758d
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ wrap.runMain = runMain
const Module = require('module')
const fs = require('fs')
const cp = require('child_process')
let ChildProcess = cp.ChildProcess
const ChildProcess = cp.ChildProcess
const assert = require('assert')
const crypto = require('crypto')
const mkdirp = require('mkdirp')
Expand Down Expand Up @@ -41,15 +41,6 @@ const pathRe = isWindows ? /^PATH=/i : /^PATH=/
const colon = isWindows ? ';' : ':'

function wrap (argv, env, workingDir) {
if (!ChildProcess) {
const child = cp.spawn(process.execPath, [])
ChildProcess = child.constructor
if (process.platform === 'os390')
child.kill('SIGABRT')
else
child.kill('SIGKILL')
}

// spawn_sync available since Node v0.11
let spawnSyncBinding, spawnSync
try {
Expand Down

0 comments on commit d0c758d

Please sign in to comment.