diff --git a/src/.jshintrc b/src/.jshintrc index 0d009667dcfe..16db88d8501b 100644 --- a/src/.jshintrc +++ b/src/.jshintrc @@ -28,7 +28,6 @@ "manualUppercase": false, "isArrayLike": false, "forEach": false, - "sortedKeys": false, "forEachSorted": false, "reverseParams": false, "nextUid": false, diff --git a/src/Angular.js b/src/Angular.js index 52e74cbf396c..91b3ad9940db 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -22,7 +22,6 @@ nodeName_: true, isArrayLike: true, forEach: true, - sortedKeys: true, forEachSorted: true, reverseParams: true, nextUid: true, @@ -272,12 +271,8 @@ function forEach(obj, iterator, context) { return obj; } -function sortedKeys(obj) { - return Object.keys(obj).sort(); -} - function forEachSorted(obj, iterator, context) { - var keys = sortedKeys(obj); + var keys = Object.keys(obj).sort(); for (var i = 0; i < keys.length; i++) { iterator.call(context, obj[keys[i]], keys[i]); } diff --git a/test/.jshintrc b/test/.jshintrc index fb80f665e2ef..abea027a9349 100644 --- a/test/.jshintrc +++ b/test/.jshintrc @@ -26,7 +26,6 @@ "manualUppercase": false, "isArrayLike": false, "forEach": false, - "sortedKeys": false, "reverseParams": false, "nextUid": false, "setHashKey": false, diff --git a/test/AngularSpec.js b/test/AngularSpec.js index e63789100947..4d3eaba6bad4 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -699,13 +699,6 @@ describe('angular', function() { }); - describe('sortedKeys', function() { - it('should collect keys from object', function() { - expect(sortedKeys({c:0, b:0, a:0})).toEqual(['a', 'b', 'c']); - }); - }); - - describe('encodeUriSegment', function() { it('should correctly encode uri segment and not encode chars defined as pchar set in rfc3986', function() { diff --git a/test/helpers/testabilityPatch.js b/test/helpers/testabilityPatch.js index b349f1232557..855ab63f4ff6 100644 --- a/test/helpers/testabilityPatch.js +++ b/test/helpers/testabilityPatch.js @@ -74,19 +74,9 @@ afterEach(function() { // copied from Angular.js - // we need these two methods here so that we can run module tests with wrapped angular.js - function sortedKeys(obj) { - var keys = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - keys.push(key); - } - } - return keys.sort(); - } - + // we need this method here so that we can run module tests with wrapped angular.js function forEachSorted(obj, iterator, context) { - var keys = sortedKeys(obj); + var keys = Object.keys(obj).sort(); for (var i = 0; i < keys.length; i++) { iterator.call(context, obj[keys[i]], keys[i]); }