Skip to content

Commit

Permalink
Underscore 1.0.1 -- bugfix release for _.isEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Mar 19, 2010
1 parent 1d78781 commit a657806
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
10 changes: 8 additions & 2 deletions index.html
Expand Up @@ -111,11 +111,11 @@ <h2>Downloads <i style="padding-left: 12px; font-size:12px;">(Right-click, and u
<p>
<table>
<tr>
<td><a href="underscore.js">Development Version (1.0.0)</a></td>
<td><a href="underscore.js">Development Version (1.0.1)</a></td>
<td><i>25kb, Uncompressed with Comments</i></td>
</tr>
<tr>
<td><a href="underscore-min.js">Production Version (1.0.0)</a></td>
<td><a href="underscore-min.js">Production Version (1.0.1)</a></td>
<td><i>2.5kb, Packed and Gzipped</i></td>
</tr>
</table>
Expand Down Expand Up @@ -1136,6 +1136,12 @@ <h2>Links &amp; Suggested Reading</h2>

<h2>Change Log</h2>

<p>
<b class="header">1.0.1</b><br />
Bugfix for <tt>_.isEqual</tt>, when comparing two objects with the same
number of undefined keys, but with different names.
</p>

<p>
<b class="header">1.0.0</b><br />
Things have been stable for many months now, so Underscore is now
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -7,5 +7,5 @@
"contributors" : [],
"dependencies" : [],
"lib" : ".",
"version" : "1.0.0"
"version" : "1.0.1"
}
1 change: 1 addition & 0 deletions test/objects.js
Expand Up @@ -58,6 +58,7 @@ $(document).ready(function() {
ok(_.isEqual(new Date(100), new Date(100)), 'identical dates are equal');
ok(_.isEqual((/hello/ig), (/hello/ig)), 'identical regexes are equal');
ok(!_.isEqual(null, [1]), 'a falsy is never equal to a truthy');
ok(!_.isEqual({x: 1, y: undefined}, {x: 1, z: 2}), 'object with the same number of undefined keys are not equal');
});

test("objects: isEmpty", function() {
Expand Down
4 changes: 2 additions & 2 deletions underscore-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions underscore.js
Expand Up @@ -55,7 +55,7 @@
root._ = _;

// Current version.
_.VERSION = '1.0.0';
_.VERSION = '1.0.1';

// ------------------------ Collection Functions: ---------------------------

Expand Down Expand Up @@ -485,7 +485,7 @@
// Different object sizes?
if (aKeys.length != bKeys.length) return false;
// Recursive comparison of contents.
for (var key in a) if (!_.isEqual(a[key], b[key])) return false;
for (var key in a) if (!(key in b) || !_.isEqual(a[key], b[key])) return false;
return true;
};

Expand Down

0 comments on commit a657806

Please sign in to comment.