Skip to content

Commit 777d1d2

Browse files
petebacondarwinnetman92
authored andcommitted
refact(filter): move hasCustomToString into shared namespace to be reused
1 parent 07658ee commit 777d1d2

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/.jshintrc

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"isBlob": false,
5656
"isBoolean": false,
5757
"isPromiseLike": false,
58+
"hasCustomToString": false,
5859
"trim": false,
5960
"escapeForRegexp": false,
6061
"isElement": false,

src/Angular.js

+5
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,11 @@ identity.$inject = [];
464464

465465
function valueFn(value) {return function() {return value;};}
466466

467+
function hasCustomToString(obj) {
468+
return isFunction(obj.toString) && obj.toString !== Object.prototype.toString;
469+
}
470+
471+
467472
/**
468473
* @ngdoc function
469474
* @name angular.isUndefined

src/ng/filter/filter.js

-4
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,6 @@ function filterFilter() {
163163
};
164164
}
165165

166-
function hasCustomToString(obj) {
167-
return isFunction(obj.toString) && obj.toString !== Object.prototype.toString;
168-
}
169-
170166
// Helper functions for `filterFilter`
171167
function createPredicateFn(expression, comparator, matchAgainstAnyProp) {
172168
var shouldMatchPrimitives = isObject(expression) && ('$' in expression);

0 commit comments

Comments
 (0)