Skip to content

Some misc STYLEGUIDE.md conformance in .../scriptStorage.js#713

Merged
Martii merged 1 commit intoOpenUserJS:masterfrom
Martii:someMiscSTYLEGUIDEConformance
Aug 18, 2015
Merged

Some misc STYLEGUIDE.md conformance in .../scriptStorage.js#713
Martii merged 1 commit intoOpenUserJS:masterfrom
Martii:someMiscSTYLEGUIDEConformance

Conversation

@Martii
Copy link
Copy Markdown
Member

@Martii Martii commented Aug 18, 2015

  • Misplaced var declarations ... closer to current ES5.x implementation for some... others just misplaced
  • Reordered on first use for all vars... not as critical but good for debugging
  • Changed s3 early initialization... shouldn't need to be and if it did it should always be NOTE:d with a comment
  • Some newlines for white space usage... easier reading/debugging
  • Any require statements all at top... require functions become cached and always stay loaded after first use... so really shouldn't be attempting to optimize these in our code... only perceived benefit is startup pm time but is loaded elsewhere so no real benefit. (skipped one node native but may catch it later)
  • Some notation of WARNING: statement on incomplete error handling
  • White-space trim that my editor didn't catch on a previous commit even though it is on all the time everywhere. :\
  • WARNING: note added for resaving script model object for no apparent reason... again should be notated.
  • Max line length of 100 conformance

Applies with #285, #486, #390, and #19 ... perhaps some more... very minimal change in project behavior here which is why it is isolated.

* Misplaced `var` declarations ... closer to current ES5.x implementation for some others just misplaced
* Reordered on first use for all vars... not as critical but good for debugging
* Changed `s3` early initialization... shouldn't need to be **and if it did** it should always be `NOTE:`d with a comment
* Some newlines for white space usage... easier reading/debugging
* Any `require` statements all at top... `require` functions become cached and always stay loaded after first use... so really shouldn't be attempting to optimize these in our code... only perceived benefit is startup pm time but is loaded elsewhere so no real benefit.
* Some notation of `WARNING:` statement on incomplete error handling
* White-space trim that my editor didn't catch on a previous commit even though it is on all the time everywhere. :\
* `WARNING:` note added for resaving script model object for no apparent reason... again should be notated.
* Max line length of 100 conformance

Applies with OpenUserJS#285, OpenUserJS#486, OpenUserJS#390, and OpenUserJS#19 ... perhaps some more... very minimal change in project behavior here which is why it is isolated.
@Martii Martii added the CODE Some other Code related issue and it should clearly describe what it is affecting in a comment. label Aug 18, 2015
Martii added a commit that referenced this pull request Aug 18, 2015
Some misc STYLEGUIDE.md conformance in `.../scriptStorage.js`

Auto-merge
@Martii Martii merged commit e5993bf into OpenUserJS:master Aug 18, 2015
@Martii Martii deleted the someMiscSTYLEGUIDEConformance branch August 18, 2015 18:48
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@sizzlemctwizzle Cc: @Zren
Is there a particular reason why we are resaving the Script object here?

Seems to me this may be a logic issue if it is truly needed as the function name implies that it is just sendScript... possible migration artifact as well. e.g. dead code and/or undocumented migration point.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We need to save the script object it to increment the install counter.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ahh good point that I missed... different train of thought when STYLEGUIDE'ing... thanks.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Although no error handling present if there is a connection failure... even if just internal notification.

Martii pushed a commit to Martii/OpenUserJS.org that referenced this pull request Aug 19, 2015
* Clarified what this section of code is doing and not doing

Post OpenUserJS#713 fix
@Martii Martii mentioned this pull request Aug 19, 2015
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

CODE Some other Code related issue and it should clearly describe what it is affecting in a comment.

Development

Successfully merging this pull request may close these issues.

2 participants