From c5a3d8fc5f899879ff571856f00b92fff6100190 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Tue, 16 Jun 2015 23:35:44 +0100 Subject: [PATCH] refact(filter): move `hasCustomToString` into shared namespace to be reused --- src/.jshintrc | 1 + src/Angular.js | 5 +++++ src/ng/filter/filter.js | 4 ---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/.jshintrc b/src/.jshintrc index 241e3feccb19..f5b8b6c54bfe 100644 --- a/src/.jshintrc +++ b/src/.jshintrc @@ -55,6 +55,7 @@ "isBlob": false, "isBoolean": false, "isPromiseLike": false, + "hasCustomToString": false, "trim": false, "escapeForRegexp": false, "isElement": false, diff --git a/src/Angular.js b/src/Angular.js index 1030e5410521..27b7cb73090d 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -464,6 +464,11 @@ identity.$inject = []; function valueFn(value) {return function() {return value;};} +function hasCustomToString(obj) { + return isFunction(obj.toString) && obj.toString !== Object.prototype.toString; +} + + /** * @ngdoc function * @name angular.isUndefined diff --git a/src/ng/filter/filter.js b/src/ng/filter/filter.js index 19ec1d4b6b3b..e63279c04d03 100644 --- a/src/ng/filter/filter.js +++ b/src/ng/filter/filter.js @@ -163,10 +163,6 @@ function filterFilter() { }; } -function hasCustomToString(obj) { - return isFunction(obj.toString) && obj.toString !== Object.prototype.toString; -} - // Helper functions for `filterFilter` function createPredicateFn(expression, comparator, matchAgainstAnyProp) { var shouldMatchPrimitives = isObject(expression) && ('$' in expression);