From 8924479c59c0e4f79f71a9648786cb3cdab85cc5 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Wed, 29 Jan 2014 12:00:27 +1100 Subject: [PATCH 1/2] fix(shallowCopy) logic error where '$foo' would be ignored --- src/Angular.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Angular.js b/src/Angular.js index 21ce1ff7282d..fad5b05c28b8 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -772,7 +772,7 @@ function shallowCopy(src, dst) { for(var key in src) { // shallowCopy is only ever called by $compile nodeLinkFn, which has control over src // so we don't need to worry about using our custom hasOwnProperty here - if (src.hasOwnProperty(key) && key.charAt(0) !== '$' && key.charAt(1) !== '$') { + if (src.hasOwnProperty(key) && !(key.charAt(0) == '$' && key.charAt(1) == '$') ) { dst[key] = src[key]; } } From 8828d388ec5859a27373e3b95200844448d1bda4 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Wed, 29 Jan 2014 12:03:04 +1100 Subject: [PATCH 2/2] Update resource.js --- src/ngResource/resource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index 006f3d3799a2..d2bec09bee88 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -35,7 +35,7 @@ function shallowClearAndCopy(src, dst) { }); for (var key in src) { - if (src.hasOwnProperty(key) && key.charAt(0) !== '$' && key.charAt(1) !== '$') { + if (src.hasOwnProperty(key) && !(key.charAt(0) == '$' && key.charAt(1) == '$')) { dst[key] = src[key]; } }