Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e6a9f9e

Browse files
committed
refactor: simplify trim fn now that IE9 has String#trim
1 parent 441ab52 commit e6a9f9e

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/Angular.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -575,19 +575,9 @@ function isPromiseLike(obj) {
575575
}
576576

577577

578-
var trim = (function() {
579-
// native trim is way faster: http://jsperf.com/angular-trim-test
580-
// but IE doesn't have it... :-(
581-
// TODO: we should move this into IE/ES5 polyfill
582-
if (!String.prototype.trim) {
583-
return function(value) {
584-
return isString(value) ? value.replace(/^\s\s*/, '').replace(/\s\s*$/, '') : value;
585-
};
586-
}
587-
return function(value) {
588-
return isString(value) ? value.trim() : value;
589-
};
590-
})();
578+
var trim = function(value) {
579+
return isString(value) ? value.trim() : value;
580+
};
591581

592582

593583
/**

0 commit comments

Comments
 (0)