diff options
| author | Misko Hevery | 2010-05-07 12:09:14 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-05-07 12:09:14 -0700 |
| commit | 038a743e6f49c347a38edc0e54dcbb175905a475 (patch) | |
| tree | 8eb10232c94967159175bde5a9209aaf5ba07c67 /src/Angular.js | |
| parent | ac1d02d0658cb74ae3822e364f84809d78cda335 (diff) | |
| download | angular.js-038a743e6f49c347a38edc0e54dcbb175905a475.tar.bz2 | |
xhr bulk fixes
Diffstat (limited to 'src/Angular.js')
| -rw-r--r-- | src/Angular.js | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/Angular.js b/src/Angular.js index 3af21ced..2df6bbef 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -231,13 +231,14 @@ function isLeafNode (node) { function copy(source, destination){ if (!destination) { - if (isArray(source)) { - return copy(source, []); - } else if (isObject(source)) { - return copy(source, {}); - } else { - return source; + if (source) { + if (isArray(source)) { + return copy(source, []); + } else if (isObject(source)) { + return copy(source, {}); + } } + return source; } else { if (isArray(source)) { while(destination.length) { @@ -249,7 +250,11 @@ function copy(source, destination){ }); } foreach(source, function(value, key){ - destination[key] = isArray(value) ? copy(value, []) : (isObject(value) ? copy(value, {}) : value); + destination[key] = value ? + ( isArray(value) ? + copy(value, []) : + (isObject(value) ? copy(value, {}) : value)) : + value; }); return destination; } |
