summaryrefslogtreecommitdiff
path: root/lists.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-10-08 16:46:58 +0200
committerjmoenig <jens@moenig.org>2013-10-08 16:46:58 +0200
commit39ea1d542d72194b887efd57e2ccde7174b9d17c (patch)
treea2ff27d3fce0115e28305158aefcd1c7a26b7169 /lists.js
parent020cac64b183ba0edc07d3e3d624390d056f542d (diff)
downloadsnap-39ea1d542d72194b887efd57e2ccde7174b9d17c.tar.gz
snap-39ea1d542d72194b887efd57e2ccde7174b9d17c.zip
fixed type-issue for linked list indices
thanks, Nate, for reporting this issue
Diffstat (limited to 'lists.js')
-rw-r--r--lists.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/lists.js b/lists.js
index e70c385..2bbcd0b 100644
--- a/lists.js
+++ b/lists.js
@@ -61,7 +61,7 @@ PushButtonMorph, SyntaxElementMorph, Color, Point, WatcherMorph,
StringMorph, SpriteMorph, ScrollFrameMorph, CellMorph, ArrowMorph,
MenuMorph, snapEquals, Morph, isNil, localize, MorphicPreferences*/
-modules.lists = '2013-June-20';
+modules.lists = '2013-October-08';
var List;
var ListWatcherMorph;
@@ -200,11 +200,11 @@ List.prototype.length = function () {
};
List.prototype.at = function (index) {
- var value;
+ var value, idx = +index;
if (this.isLinked) {
- return index === 1 ? this.first : this.rest.at(index - 1);
+ return idx === 1 ? this.first : this.rest.at(idx - 1);
}
- value = this.contents[index - 1];
+ value = this.contents[idx - 1];
return isNil(value) ? '' : value;
};