Skip to content

Commit 3e4f12c

Browse files
author
Ben D'Angelo
committed
tested bug
1 parent d048567 commit 3e4f12c

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

spec/javascripts/src/core/entity_spec.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,25 @@ describe('entity', function(){
185185
ok(e.parent('','has', c.name))
186186
})
187187

188+
it('attr overwrite method', function(){
189+
190+
var called = false;
191+
192+
e.attr({
193+
blah:function(){}
194+
});
195+
196+
e.attr({
197+
blah:function(){
198+
called = true;
199+
}
200+
});
201+
202+
e.blah();
203+
204+
ok(called);
205+
});
206+
188207
it('should dispose of all components properly', function(){
189208
var called = false, called2 = false;
190209

src/core/entity.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,9 @@
446446
}
447447

448448
}else {
449+
var k = 'function';
449450
//defines property
450-
if(re.is(this[obj], 'function') && !re.is(value, 'function')){
451+
if(re.is(this[obj], k) && !re.is(value, k)){
451452
if(re.is(value, 'array')){
452453
this[obj].apply(this, value);
453454
} else {

0 commit comments

Comments
 (0)