Skip to content

Commit 5f93303

Browse files
committed
Fix mistaken assignment of behaviours. Thanks to Matthew Shonkwiler for advice it.
1 parent 478c02a commit 5f93303

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Strategy/4/MallardDuck.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var MallardDuck = function(){
22
Duck.apply(this);
3-
this.oFlyBehavior = new Quack();
4-
this.oQuackBehavior = new FlyWithWings();
3+
this.oFlyBehavior = new FlyWithWings();
4+
this.oQuackBehavior = new Quack();
55
};
66
MallardDuck.prototype = new Duck();
77
MallardDuck.prototype.display = function(){

Strategy/4/RedheadDuck.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var RedheadDuck = function(){
22
Duck.apply(this);
3-
this.oFlyBehavior = new Quack();
4-
this.oQuackBehavior = new FlyWithWings();
3+
this.oFlyBehavior = new FlyWithWings();
4+
this.oQuackBehavior = new Quack();
55
};
66
RedheadDuck.prototype = new Duck();
77
RedheadDuck.prototype.display = function(){

0 commit comments

Comments
 (0)