aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsunnylost2013-10-14 15:03:11 +0800
committerPete Bacon Darwin2013-11-26 06:45:47 +0000
commitc2e45c769ef7a45f2bd14870236fd8e8bed38246 (patch)
treea1aac4e3a538fdde3837d553961b64a31fcbc75c /src
parentb08427dde9307bb442e3632f24d7b7054a50350e (diff)
downloadangular.js-c2e45c769ef7a45f2bd14870236fd8e8bed38246.tar.bz2
refactor(angular.js): improve trim performance
According to Flagrant Badassery's blog http://blog.stevenlevithan.com/archives/faster-trim-javascript and this comparison http://jsperf.com/trim-function, this trim method is faster. Closes #4406
Diffstat (limited to 'src')
-rw-r--r--src/Angular.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Angular.js b/src/Angular.js
index 11222118..f4f83d55 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -544,7 +544,7 @@ var trim = (function() {
// TODO: we should move this into IE/ES5 polyfill
if (!String.prototype.trim) {
return function(value) {
- return isString(value) ? value.replace(/^\s*/, '').replace(/\s*$/, '') : value;
+ return isString(value) ? value.replace(/^\s\s*/, '').replace(/\s\s*$/, '') : value;
};
}
return function(value) {