Improvements for option freeze #1316

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

Comments

Projects
None yet
5 participants
@valueof
Member

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

This comment has been minimized.

Show comment
Hide comment
@caitp

caitp Oct 21, 2013

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@WanderingZombie

WanderingZombie Mar 15, 2014

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

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

@valueof

This comment has been minimized.

Show comment
Hide comment
@valueof

valueof Mar 24, 2014

Member

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

Member

valueof commented Mar 24, 2014

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

@kangax

This comment has been minimized.

Show comment
Hide comment
@kangax

kangax Mar 24, 2014

Contributor

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).

Contributor

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