Skip to content

Commit

Permalink
fix(node:process): avoid recursive access
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Apr 16, 2023
1 parent b3b6f6b commit a1ba86c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/runtime/node/process/_process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,9 @@ Item.prototype.run = function () {
process.title = "unenv";

const _envShim = Object.create(null);
const _processEnv = globalThis.process?.env;
const _getEnv = (useShim: boolean) =>
globalThis.process?.env ||
globalThis.__env__ ||
(useShim ? _envShim : globalThis);
_processEnv || globalThis.__env__ || (useShim ? _envShim : globalThis);

process.env = new Proxy(_envShim, {
get(_, prop) {
Expand Down

0 comments on commit a1ba86c

Please sign in to comment.