aboutsummaryrefslogtreecommitdiffstats
path: root/src/Angular.js
diff options
context:
space:
mode:
authorAndy Hitchman2013-08-06 11:25:44 +1000
committerIgor Minar2013-08-09 00:17:34 -0700
commit5cca077e4a40a26cc2deee2a86a215f575f25b22 (patch)
tree5af5ddf4bb2ad93d499e10fcadd3f74465649210 /src/Angular.js
parente290aa8c13205009b763f65a661a7fbcabc867ab (diff)
downloadangular.js-5cca077e4a40a26cc2deee2a86a215f575f25b22.tar.bz2
fix(angular.copy): change angular.copy to correcly clone RegExp
angular.copy previously copied RegExp as an empty object. Change detects RegExp instance and clones into new RegExp. This change is based on a previous fix to allow Date to be copied. Closes #3473 Closes #3474
Diffstat (limited to 'src/Angular.js')
-rw-r--r--src/Angular.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Angular.js b/src/Angular.js
index 0a38b230..8fd77096 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -587,6 +587,8 @@ function copy(source, destination){
destination = copy(source, []);
} else if (isDate(source)) {
destination = new Date(source.getTime());
+ } else if (isRegExp(source)) {
+ destination = new RegExp(source.source);
} else if (isObject(source)) {
destination = copy(source, {});
}