Skip to content

Commit 58c27ba

Browse files
committed
Merge branch 'master' of github.com:facebook/immutable-js
Conflicts: dist/Immutable.min.js
2 parents 1b98b97 + 3715819 commit 58c27ba

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed

__tests__/IndexedSequence.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
///<reference path='../resources/jest.d.ts'/>
2+
///<reference path='../dist/Immutable.d.ts'/>
3+
jest.autoMockOff();
4+
5+
import jasmineCheck = require('jasmine-check');
6+
jasmineCheck.install();
7+
8+
import Immutable = require('immutable');
9+
10+
describe('IndexedSequence', () => {
11+
12+
it('maintains skipped offset', () => {
13+
var seq = Immutable.Sequence(['A', 'B', 'C', 'D', 'E']);
14+
15+
// This is what we expect for IndexedSequences
16+
var operated = seq.skip(1);
17+
expect(operated.entrySeq().toArray()).toEqual([
18+
[0, 'B'],
19+
[1, 'C'],
20+
[2, 'D'],
21+
[3, 'E']
22+
]);
23+
24+
expect(operated.first()).toEqual('B');
25+
});
26+
27+
});

dist/Immutable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ var $IndexedSequence = IndexedSequence;
683683
var skipSeq = skipFactory(this, amount, false);
684684
if (skipSeq !== this) {
685685
skipSeq.get = (function(index, notSetValue) {
686-
return $__0.get(index - amount, notSetValue);
686+
return $__0.get(index + amount, notSetValue);
687687
});
688688
}
689689
return skipSeq;

dist/Immutable.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Sequence.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ class IndexedSequence extends Sequence {
595595
skip(amount) {
596596
var skipSeq = skipFactory(this, amount, false);
597597
if (skipSeq !== this) {
598-
skipSeq.get = (index, notSetValue) => this.get(index - amount, notSetValue);
598+
skipSeq.get = (index, notSetValue) => this.get(index + amount, notSetValue);
599599
}
600600
return skipSeq;
601601
}

0 commit comments

Comments
 (0)