aboutsummaryrefslogtreecommitdiffstats
path: root/test/widgetsSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2011-02-16 11:53:11 -0500
committerMisko Hevery2011-02-25 09:23:30 -0800
commit9e67da420b60a417204ab53e8a16aa291f2b1ca0 (patch)
tree895790e2d46c966445df1e4985ed6a207961d1fd /test/widgetsSpec.js
parent5fc2b96b97a99286fb5734abef86dde16aeb3e55 (diff)
downloadangular.js-9e67da420b60a417204ab53e8a16aa291f2b1ca0.tar.bz2
Corrected an issue where properties inherited from __proto__ show up in ng:repeat.
Closses #112
Diffstat (limited to 'test/widgetsSpec.js')
-rw-r--r--test/widgetsSpec.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js
index d4d0e43a..183fbe6a 100644
--- a/test/widgetsSpec.js
+++ b/test/widgetsSpec.js
@@ -727,6 +727,18 @@ describe("widget", function(){
expect(element.text()).toEqual('misko:swe;shyam:set;');
});
+ it('should not ng:repeat over parent properties', function(){
+ var Class = function(){};
+ Class.prototype.abc = function(){};
+ Class.prototype.value = 'abc';
+
+ var scope = compile('<ul><li ng:repeat="(key, value) in items" ng:bind="key + \':\' + value + \';\' "></li></ul>');
+ scope.items = new Class();
+ scope.items.name = 'value';
+ scope.$eval();
+ expect(element.text()).toEqual('name:value;');
+ });
+
it('should error on wrong parsing of ng:repeat', function(){
var scope = compile('<ul><li ng:repeat="i dont parse"></li></ul>');