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
Conversation
Hi @finico, thanks for the PR. Nice find! |
There was a problem hiding this 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.
There was a problem hiding this 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
)
@aladdin-add I agree, but it is a case from linked issue. I just wanted to fix it. |
merged, thanks for contributing! :) |
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])
eslint/lib/linter/linter.js
Line 315 in 8eaa9b2
was
true
because ofObject.prototype.toString