Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore settings on Object.prototype #4835

Open
wants to merge 1 commit into
base: 5.x
Choose a base branch
from

Conversation

EvanHahn
Copy link
Contributor

Before:

app.get('hasOwnProperty');
// => [Function: hasOwnProperty]

app.enabled('hasOwnProperty');
// => true

After:

app.get('hasOwnProperty');
// => undefined

app.enabled('hasOwnProperty');
// => false

See #4802 for more details. Similar to #4803, but for Express 5.

Comment on lines 57 to 58
this.cache = {};
this.engines = {};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This makes me think: should other things, like this.cache and app.locals, use Object.create(null) too?

Copy link
Member

Choose a reason for hiding this comment

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

Yea, esp for 5, it should all be at least a null object these days.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would you like me to make a pull request for that?

Copy link
Member

Choose a reason for hiding this comment

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

Sure, that would be most welcome!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. I'll try to do that in the next month.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in #4861.

test/app.locals.js Show resolved Hide resolved
test/config.js Show resolved Hide resolved
@EvanHahn EvanHahn force-pushed the ignore-settings-on-object-prototype-5.x branch from 5057a23 to e49bb35 Compare February 26, 2022 05:02
@EvanHahn
Copy link
Contributor Author

Just rebased this.

@EvanHahn
Copy link
Contributor Author

Anything else I should do here? No rush from me, just wanna make sure I'm not blocking anything.

@dougwilson
Copy link
Member

Hey! No, these 5.x changes are good. I'm just waiting to merge after the 4.x branch is merged in to reduce the merge conflicts is all. That should be very soon, as the 4.x changes landed are supposed to be out next week! Thank you for your hard work and discovering this issue. API is more sane now thanks to you 😊

@EvanHahn
Copy link
Contributor Author

Great, thanks!!

If there are other things that need doing, feel free to reach out to me@evanhahn.com and I'll see if I can help.

@EvanHahn
Copy link
Contributor Author

This has been open for over a year. No rush from me, but let me know if there's anything I can do to move this along.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants