Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Fix #3521 Use an object as the process.env proto #3523

Merged
merged 1 commit into from
Jun 26, 2012

Conversation

isaacs
Copy link

@isaacs isaacs commented Jun 24, 2012

For some reason, though, it looks like EnvGetter is not called for the
key __proto__, so I can't make the info->Data() accessible. However,
putting the Object.prototype keys there, in such a way that they are not
OwnProperties, and are supersceded by environs, makes process.env much
less weird.

Re: #3521

// Not found
return Undefined();
// Not found. Fetch from prototype.
return info.Data()->ToObject()->Get(property);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use info.Data().As<Object>()->Get(...) here, it's a teensy bit faster.

For some reason, though, it looks like EnvGetter is not called for the
key `__proto__`, so I can't make the info->Data() accessible.  However,
putting the Object.prototype keys there, in such a way that they are not
OwnProperties, and are supersceded by environs, makes process.env much
less weird.
@isaacs
Copy link
Author

isaacs commented Jun 26, 2012

Landed on master.

@isaacs isaacs closed this Jun 26, 2012
@isaacs isaacs merged commit e307468 into nodejs:master Jun 26, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants