summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2016-10-26 09:37:17 -0500
committerMike Greiling <mike@pixelcog.com>2016-12-02 17:38:57 -0600
commit825fea63a39aa586b07ba9ffc62252a90435c8ad (patch)
tree4f55755fb62142864c0445b41bb72fdc9a022e63
parent1d3b77683dc13bdf354436c9f6b16e6842810488 (diff)
downloadgitlab-ce-825fea63a39aa586b07ba9ffc62252a90435c8ad.tar.gz
remove array destructuring until we can fix babel config
-rw-r--r--app/assets/javascripts/diff.js.es68
1 files changed, 6 insertions, 2 deletions
diff --git a/app/assets/javascripts/diff.js.es6 b/app/assets/javascripts/diff.js.es6
index 343285cebd1..462658419be 100644
--- a/app/assets/javascripts/diff.js.es6
+++ b/app/assets/javascripts/diff.js.es6
@@ -22,7 +22,11 @@
handleClickUnfold(event) {
const $target = $(event.target);
- const [oldLineNumber, newLineNumber] = this.lineNumbers($target.parent());
+ // current babel config relies on iterators implementation, so we cannot simply do:
+ // const [oldLineNumber, newLineNumber] = this.lineNumbers($target.parent());
+ const ref = this.lineNumbers($target.parent());
+ const oldLineNumber = ref[0];
+ const newLineNumber = ref[1];
const offset = newLineNumber - oldLineNumber;
const bottom = $target.hasClass('js-unfold-bottom');
let since, to;
@@ -38,7 +42,7 @@
to = lineNumber;
// make sure we aren't loading more than we need
- const [prevOldLine, prevNewLine] = this.lineNumbers($target.parent().prev());
+ const prevNewLine = this.lineNumbers($target.parent().prev())[1];
if (since <= prevNewLine + 1) {
since = prevNewLine + 1;
unfold = false;