Skip to content

Commit 4f9cd17

Browse files
committed
Fix methods setFlyBehavior and setQuackBehavior to do the correct job.
1 parent 59f1d75 commit 4f9cd17

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Strategy/4/Duck.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ var Duck = function(){
44
};
55
Duck.prototype.setFlyBehavior = function(oFlyBehavior)
66
{
7-
this.oFlyBehavior.fly();
7+
this.oFlyBehavior = oFlyBehavior;
88
};
9-
Duck.prototype.setQuackBehavior = function(oFlyBehavior)
9+
Duck.prototype.setQuackBehavior = function(oQuackBehavior)
1010
{
11-
this.oQuackBehavior.quack();
11+
this.oQuackBehavior = oQuackBehavior;
1212
};
1313
Duck.prototype.performFly = function(){
1414
this.oFlyBehavior.fly();

0 commit comments

Comments
 (0)