Skip to content

Commit

Permalink
Fix Node.js 4 support (#5489)
Browse files Browse the repository at this point in the history
  • Loading branch information
ai authored and mjesun committed Feb 7, 2018
1 parent 9797f23 commit c8d1c79
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/jest-util/src/create_process_object.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ const BLACKLIST = new Set(['env', 'mainModule', '_events']);
// mimic it (see https://nodejs.org/api/process.html#process_process_env).

function createProcessEnv() {
if (typeof Proxy === 'undefined') {
return deepCyclicCopy(process.env);
}

// $FlowFixMe: Apparently Flow does not understand that this is a prototype.
const proto: Object = Object.getPrototypeOf(process.env);
const real = Object.create(proto);
Expand Down

0 comments on commit c8d1c79

Please sign in to comment.