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

Fix: creating of enabledGlobals object without prototype (fixes #11929) #11935

Merged
merged 2 commits into from Jul 6, 2019

Conversation

finico
Copy link
Contributor

@finico finico commented Jul 3, 2019

What is the purpose of this pull request? (put an "X" next to item)

[x] Bug fix

issue: #11929

What changes did you make? (Give an overview)

There was an issue when there were comments like /*global toString:true*/
Therefor if (enabledGlobals[id])

if (enabledGlobals[id]) {

was true because of Object.prototype.toString

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Jul 3, 2019
@platinumazure platinumazure self-requested a review July 3, 2019 13:10
@platinumazure platinumazure added accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features and removed triage An ESLint team member will look at this issue soon labels Jul 3, 2019
@platinumazure
Copy link
Member

Hi @finico, thanks for the PR. Nice find!

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! Would like another set of eyes on this.

Copy link
Member

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!
just a reminder: you don't have to specify globlas like toString: technically it's a global. if not defined, it will try to find global.toString => Object.prototype.toString (since global is an object, its prototype is on object.prototype )

@finico
Copy link
Contributor Author

finico commented Jul 3, 2019

@aladdin-add I agree, but it is a case from linked issue. I just wanted to fix it.

@aladdin-add aladdin-add changed the title Fix: creating of enabledGlobals object without prototype Fix: creating of enabledGlobals object without prototype (fixes #11929) Jul 3, 2019
@aladdin-add aladdin-add merged commit 1fb3620 into eslint:master Jul 6, 2019
@aladdin-add
Copy link
Member

merged, thanks for contributing! :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants