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

Improvements for option freeze #1316

Open
valueof opened this issue Oct 21, 2013 · 4 comments
Open

Improvements for option freeze #1316

valueof opened this issue Oct 21, 2013 · 4 comments
Labels

Comments

@valueof
Copy link
Member

@valueof valueof commented Oct 21, 2013

New options freeze landed with #1276. This bug is about general improvements we can make to it. Feel free to add your own.

  • Can we re-use lists of variables from vars.js instead of having yet another list within the source code?
  • Should we add checks for Array.isArray etc?
@caitp
Copy link
Member

@caitp caitp commented Oct 21, 2013

The lists in vars.js look good in some ways, but they would still need to be filtered. For instance, we don't really care about modifying the global context for this warning. Then again, I suppose it wouldn't matter unless an expression contained window.prototype.foo or whatever, though.

Another improvement could be to also check for assignments to the deprecated __proto__ property.

@WanderingZombie
Copy link

@WanderingZombie WanderingZombie commented Mar 15, 2014

"Bad option freeze" is raised on standard jQuery $(document).ready(function () {});

@valueof
Copy link
Member Author

@valueof valueof commented Mar 24, 2014

@WanderingZombie This means you're using old version of JSHint.

@kangax
Copy link
Contributor

@kangax kangax commented Mar 24, 2014

Should we add checks for Array.isArray etc?

I think we should.

Can we re-use lists of variables from vars.js instead of having yet another list within the source code?

Any of ecmaIdentifiers seem fine. Optionally, we could make a distinction between native, ES-defined objects (Array, String, Object, etc.) and browser built-ins (alert, Audio, Blob, CanvasPattern, etc.).

Perhaps freeze: {native | browser} or even freeze: { native | dom | bom } (but not sure if that kind of granularity is needed).

@lukeapage lukeapage added the Proposal label Jun 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.