Ticket #1747: unique.patch
| File unique.patch, 3.6 KB (added by rworth, 5 years ago) |
|---|
-
src/core.js
Property changes on: src\ajax.js ___________________________________________________________________ Name: svn:eol-style + native
1093 1093 try { 1094 1094 1095 1095 for ( var i = 0, length = array.length; i < length; i++ ) { 1096 var id = jQuery.data( array[ i ] );1096 var id = array[ i ]; 1097 1097 1098 if ("object" == typeof array[ i ]) 1099 id = jQuery.data( array[ i ] ); 1100 1098 1101 if ( !done[ id ] ) { 1099 1102 done[ id ] = true; 1100 1103 ret.push( array[ i ] ); -
test/unit/core.js
Property changes on: src\core.js ___________________________________________________________________ Name: svn:eol-style + native Property changes on: src\event.js ___________________________________________________________________ Name: svn:eol-style + native Property changes on: src\fx.js ___________________________________________________________________ Name: svn:eol-style + native Property changes on: src\intro.js ___________________________________________________________________ Name: svn:eol-style + native Property changes on: src\offset.js ___________________________________________________________________ Name: svn:eol-style + native Property changes on: src\outro.js ___________________________________________________________________ Name: svn:eol-style + native Property changes on: src\selector.js ___________________________________________________________________ Name: svn:eol-style + native Property changes on: test\unit\ajax.js ___________________________________________________________________ Name: svn:eol-style + native
1074 1074 // Disabled, randomly fails 1075 1075 //ok( $("#iframe").contents()[0].body, "Check existance of IFrame body" ); 1076 1076 }); 1077 1078 test("$.unique(array)", function() { 1079 expect(9); 1080 isSet( $.unique([]), [], "Check .unique() with empty array" ); 1081 isSet( $.unique([1, 2, 3]), [1, 2, 3], "Check with array of ints, no duplicates." ); 1082 isSet( $.unique([1, 1, 2, 2, 3, 3]), [1, 2, 3], "Check with array of ints, duplicates." ); 1083 isSet( $.unique(['a', 'b', 'c']), ['a', 'b', 'c'], "Check with array of strings, no duplicates." ); 1084 isSet( $.unique(['a', 'a', 'b', 'b', 'c', 'c']), ['a', 'b', 'c'], "Check with array of strings, duplicates." ); 1085 var arr1 = [1, 2], arr2 = ['a', 'b']; 1086 isSet( $.unique([arr1, arr2]), [arr1, arr2], "Check with array of arrays, no duplicates." ); 1087 isSet( $.unique([arr1, arr2, arr1, arr2]), [arr1, arr2], "Check with array of arrays, duplicates." ); 1088 var obj1 = {"":"obj1"}, obj2 = {"":"obj2"}; 1089 isSet( $.unique([obj1, obj2]), [obj1, obj2], "Check with array of objects, no duplicates." ); 1090 isSet( $.unique([obj1, obj2, obj1, obj2]), [obj1, obj2], "Check with array of objects, duplicates." ); 1091 });
