Skip to content

Commit

Permalink
fix: explicit undefined typecheck (#48920)
Browse files Browse the repository at this point in the history
The current implementation is throwing wrongly if you set a falsy JS value (like `0` or `null`)

So right now this is fail even it's a legit implementation: `process.counter = 0`
  • Loading branch information
Kikobeats committed Apr 27, 2023
1 parent 678c697 commit 7b66e8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/src/server/web/sandbox/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function createProcessPolyfill(options: Pick<ModuleContextOptions, 'env'>) {
if (key === 'env') continue
Object.defineProperty(processPolyfill, key, {
get() {
if (overridenValue[key]) {
if (overridenValue[key] !== undefined) {
return overridenValue[key]
}
if (typeof (process as any)[key] === 'function') {
Expand Down

0 comments on commit 7b66e8a

Please sign in to comment.