summaryrefslogtreecommitdiff
path: root/lists.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-04-12 10:11:45 +0200
committerjmoenig <jens@moenig.org>2013-04-12 10:11:45 +0200
commit54415a2cfcf68763c4836b540d23737ed4c99a50 (patch)
tree770faaafacef4efde595206236c332d58208d18d /lists.js
parenta03d8fba4d353e9fa7b8bf950ac120d677586303 (diff)
downloadsnap-byow-54415a2cfcf68763c4836b540d23737ed4c99a50.tar.gz
snap-byow-54415a2cfcf68763c4836b540d23737ed4c99a50.zip
Lists: fix for typecasting bug in CONTAINS primitive
Diffstat (limited to 'lists.js')
-rw-r--r--lists.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/lists.js b/lists.js
index 71f8f65..7382840 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*/
-modules.lists = '2013-April-08';
+modules.lists = '2013-April-12';
var List;
var ListWatcherMorph;
@@ -215,7 +215,7 @@ List.prototype.contains = function (element) {
return true;
}
if (!isNaN(num)) {
- if (this.first === num) {
+ if (parseFloat(this.first) === num) {
return true;
}
}
@@ -229,7 +229,8 @@ List.prototype.contains = function (element) {
return true;
}
if (!isNaN(num)) {
- return (contains(this.contents, num));
+ return (contains(this.contents, num))
+ || contains(this.contents, num.toString());
}
return false;
};