Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Cleanup via JSHint #108

Merged
merged 1 commit into from Aug 13, 2015
Merged

Cleanup via JSHint #108

merged 1 commit into from Aug 13, 2015

Conversation

OlsonDev
Copy link
Contributor

  • Add missing semi-colons
  • Remove redundant semi-colons
  • Don't redeclare variables

Things I didn't take care of:

  • Use === to compare with 0; I would in my own projects though
  • Use === to compare with null; both places would then need || thing === undefined, not a fan of that
  • Wrap for...in bodies in hasOwnProperty checks; there were a lot of them but I assume prototype chain should be respected in all
  • __proto__ is deprecated; seems to be used properly
  • Function constructor is a form of eval; yeah, well...
  • Remove 10 unused variables: prop, object, obs, observer, target, callback, skipChanges, changeRecords (x2), array; besides prop they're all argument names. prop is used in the objectIsEmpty function and can't be removed

Add missing semi-colons
Remove redundant semi-colons
Don't redeclare variables
@jmesserly
Copy link
Contributor

Awesome! LGTM! Good choices on those skipped ones.

Use === to compare with 0; I would in my own projects though

yeah, === 0 would be fine with me, FWIW

Use === to compare with null; both places would then need || thing === undefined, not a fan of that

agreed, I'm not a fan either.

__proto__ is deprecated; seems to be used properly

fwiw, it's been sort-of un-deprecated now that it's specified in ES6 and so it'll be available across all engines: http://www.ecma-international.org/ecma-262/6.0/#sec-object.prototype.__proto__ ... though maybe Object.getPrototypeOf would be cleaner though.

jmesserly pushed a commit that referenced this pull request Aug 13, 2015
@jmesserly jmesserly merged commit bc0da99 into googlearchive:master Aug 13, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants