aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Hitchman2013-08-06 11:25:44 +1000
committerIgor Minar2013-08-08 23:29:59 -0700
commitf80730f497cb1ecb78a814f01df79b69223ad633 (patch)
tree200a2351efceca5466f49631481ff5771cbabf5b /src
parent43997c15406d0401525f3d2d72914b28850905e1 (diff)
downloadangular.js-f80730f497cb1ecb78a814f01df79b69223ad633.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')
-rw-r--r--src/Angular.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Angular.js b/src/Angular.js
index 0252a720..1a90f8bc 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -611,6 +611,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, {});
}