From 1f2c9c5fc18b5a1db5a0014eda42becbd703afab Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Fri, 4 Mar 2011 10:15:48 -0500 Subject: [PATCH] added regression test for issue #95 --- test/objects.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/objects.js b/test/objects.js index d4bfac645..06fb4cd6e 100644 --- a/test/objects.js +++ b/test/objects.js @@ -4,6 +4,9 @@ $(document).ready(function() { test("objects: keys", function() { equals(_.keys({one : 1, two : 2}).join(', '), 'one, two', 'can extract the keys from an object'); + // the test above is not safe because it relies on for-in enumeration order + var a = []; a[1] = 0; + equals(_.keys(a).join(', '), '1', 'is not fooled by sparse arrays; see issue #95'); }); test("objects: values", function() {