From 955d3c77fa168df429eb965409dd135992a63b1b Mon Sep 17 00:00:00 2001 From: sjpsega Date: Wed, 7 Aug 2013 11:04:23 +0800 Subject: [PATCH] bugfix,in some spacial js environment,it will happen. --- underscore.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/underscore.js b/underscore.js index 392a3509e..4c010578d 100644 --- a/underscore.js +++ b/underscore.js @@ -311,6 +311,9 @@ criteria : iterator.call(context, value, index, list) }; }).sort(function(left, right) { + if(left === right){ + return 0; + } var a = left.criteria; var b = right.criteria; if (a !== b) {