Port the diffviewer to ES6.
Review Request #8070 — Created March 21, 2016 and discarded
This change ports the
js/diffviewer
and the diff viewer page's view
and model to ES6.
Ran JS tests.
Description | From | Last Updated |
---|---|---|
/** |
david | |
/** |
david | |
/** |
david | |
/** |
david | |
Returns? |
david | |
Clamp. Also needs Args/Returns. |
david | |
/** |
david | |
Can you move these definitions down to where they're needed (at a glance, iconView can be defined much lower, and … |
david | |
The IIFE isn't necessary in this file. |
david | |
Render. Also needs Returns. |
david | |
Probably slightly more idiomatic to use $.each(). |
david | |
This is only used once, so you could move it into the conditional. |
david | |
Could be one statement with ?: |
david | |
/**, Create. Also needs Args/Returns. |
david | |
/**, Place. Also needs Args/Returns. |
david | |
let/const? |
david | |
/**, Place. |
david | |
This can be cleaned up a lot now: const hiddenCommentBlockViews = this._hiddenCommentBlockViews; this._hiddenCommentBlockViews = []; let prevBeginRowIndex; for (let commentBlockView … |
david | |
Doc comment? |
david | |
Can clean up with let/const and _.groupBy |
david | |
/** |
david | |
let/const? |
david | |
/**, Args |
david | |
const? |
david | |
let/const? |
david | |
/** |
david | |
let/const? |
david | |
/** |
david | |
let/const? |
david | |
/** |
david | |
/**, Args. |
david | |
/** |
david | |
/**, Args. |
david | |
/**, Args. |
david | |
/**, Args. |
david | |
const |
david | |
/**, Args. |
david | |
const. |
david | |
const |
david | |
const. |
david | |
const. |
david | |
This file hasn't been converted very much... |
david | |
Two /*s here. |
david |
- Diff:
-
Revision 2 (+692 -515)
-
Tool: PEP8 Style Checker Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/js/diffviewer/models/tests/diffReviewableModelTests.es6.js reviewboard/static/rb/js/diffviewer/views/diffCommentsHintView.es6.js reviewboard/static/rb/js/diffviewer/views/paginationView.js reviewboard/static/rb/js/diffviewer/views/chunkHighlighterView.es6.js reviewboard/static/rb/js/diffviewer/models/diffCommentBlockModel.es6.js reviewboard/static/rb/js/pages/models/diffViewerPageModel.es6.js reviewboard/static/rb/js/diffviewer/models/diffCommentsHintModel.es6.js reviewboard/static/rb/js/diffviewer/models/tests/diffRevisionModelTests.es6.js reviewboard/static/rb/js/diffviewer/views/diffReviewableView.es6.js reviewboard/static/rb/js/diffviewer/models/diffRevisionModel.es6.js reviewboard/static/rb/js/diffviewer/models/diffCommentsHintModel.js reviewboard/static/rb/js/diffviewer/views/paginationView.es6.js reviewboard/static/rb/js/views/imageReviewableView.js reviewboard/static/rb/js/diffviewer/models/tests/paginationModelTests.es6.js reviewboard/static/rb/js/diffviewer/models/diffFileModel.es6.js reviewboard/static/rb/js/diffviewer/models/paginationModel.es6.js reviewboard/static/rb/js/diffviewer/models/diffReviewableModel.es6.js reviewboard/static/rb/js/diffviewer/collections/diffFileCollection.js reviewboard/static/rb/js/pages/views/diffViewerPageView.es6.js reviewboard/static/rb/js/diffviewer/views/diffRevisionLabelView.es6.js reviewboard/static/rb/js/diffviewer/views/diffCommentBlockView.es6.js reviewboard/static/rb/js/diffviewer/models/tests/diffFileModelTests.es6.js reviewboard/static/rb/js/diffviewer/views/diffComplexityIconView.es6.js reviewboard/static/rb/js/diffviewer/views/diffFileIndexView.es6.js reviewboard/static/rb/js/diffviewer/views/diffRevisionSelectorView.es6.js reviewboard/static/rb/js/views/textBasedReviewableView.js reviewboard/static/rb/js/diffviewer/views/diffCommentBlockView.js reviewboard/static/rb/js/views/dummyReviewableView.js Tool: Pyflakes Processed Files: reviewboard/staticbundles.py Ignored Files: reviewboard/static/rb/js/diffviewer/models/tests/diffReviewableModelTests.es6.js reviewboard/static/rb/js/diffviewer/views/diffCommentsHintView.es6.js reviewboard/static/rb/js/diffviewer/views/paginationView.js reviewboard/static/rb/js/diffviewer/views/chunkHighlighterView.es6.js reviewboard/static/rb/js/diffviewer/models/diffCommentBlockModel.es6.js reviewboard/static/rb/js/pages/models/diffViewerPageModel.es6.js reviewboard/static/rb/js/diffviewer/models/diffCommentsHintModel.es6.js reviewboard/static/rb/js/diffviewer/models/tests/diffRevisionModelTests.es6.js reviewboard/static/rb/js/diffviewer/views/diffReviewableView.es6.js reviewboard/static/rb/js/diffviewer/models/diffRevisionModel.es6.js reviewboard/static/rb/js/diffviewer/models/diffCommentsHintModel.js reviewboard/static/rb/js/diffviewer/views/paginationView.es6.js reviewboard/static/rb/js/views/imageReviewableView.js reviewboard/static/rb/js/diffviewer/models/tests/paginationModelTests.es6.js reviewboard/static/rb/js/diffviewer/models/diffFileModel.es6.js reviewboard/static/rb/js/diffviewer/models/paginationModel.es6.js reviewboard/static/rb/js/diffviewer/models/diffReviewableModel.es6.js reviewboard/static/rb/js/diffviewer/collections/diffFileCollection.js reviewboard/static/rb/js/pages/views/diffViewerPageView.es6.js reviewboard/static/rb/js/diffviewer/views/diffRevisionLabelView.es6.js reviewboard/static/rb/js/diffviewer/views/diffCommentBlockView.es6.js reviewboard/static/rb/js/diffviewer/models/tests/diffFileModelTests.es6.js reviewboard/static/rb/js/diffviewer/views/diffComplexityIconView.es6.js reviewboard/static/rb/js/diffviewer/views/diffFileIndexView.es6.js reviewboard/static/rb/js/diffviewer/views/diffRevisionSelectorView.es6.js reviewboard/static/rb/js/views/textBasedReviewableView.js reviewboard/static/rb/js/diffviewer/views/diffCommentBlockView.js reviewboard/static/rb/js/views/dummyReviewableView.js
-
-
-
-
-
-
-
-
-
Can you move these definitions down to where they're needed (at a glance,
iconView
can be defined much lower, and probably others too). -
-
-
-
-
-
-
-
-
-
This can be cleaned up a lot now:
const hiddenCommentBlockViews = this._hiddenCommentBlockViews; this._hiddenCommentBlockViews = []; let prevBeginRowIndex; for (let commentBlockView of hiddenCommentBlockViews) { prevBeginRowIndex = this._placeCommentBlockView( commentBlockView, prevBeginRowIndex); }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-