Skip to content

Commit c8d1c79

Browse files
aimjesun
authored andcommitted
Fix Node.js 4 support (jestjs#5489)
1 parent 9797f23 commit c8d1c79

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/jest-util/src/create_process_object.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ const BLACKLIST = new Set(['env', 'mainModule', '_events']);
1717
// mimic it (see https://nodejs.org/api/process.html#process_process_env).
1818

1919
function createProcessEnv() {
20+
if (typeof Proxy === 'undefined') {
21+
return deepCyclicCopy(process.env);
22+
}
23+
2024
// $FlowFixMe: Apparently Flow does not understand that this is a prototype.
2125
const proto: Object = Object.getPrototypeOf(process.env);
2226
const real = Object.create(proto);

0 commit comments

Comments
 (0)