Skip to content

Commit ab1cb01

Browse files
committed
Design-Patterns-in-Javascript-5: Misspelling in Download.getDownloadedFailedState method (State Pattern)
1 parent 4f9cd17 commit ab1cb01

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

State/1/Download.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ Download.prototype.getDownloadedState = function()
3434
};
3535
Download.prototype.getDownloadedFailedState = function()
3636
{
37-
return new DownloadedFailedState(this);
37+
return new DownloadFailedState(this);
3838
};

State/1/states/DownloadPausedState.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ DownloadPausedState.prototype.pause = function(){
1212
throw new Error("You can't pause a paused download!");
1313
};
1414
DownloadPausedState.prototype.fail = function(){
15-
this.oDownload.setState(this.oDownload.getDownloadFailedState());
15+
this.oDownload.setState(this.oDownload.getDownloadedFailedState());
1616
console.log("Download has failed!");
1717
};
1818
DownloadPausedState.prototype.finish = function(){

State/1/states/DownloadingState.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ DownloadingState.prototype.pause = function(){
1212
console.log("Pause download!");
1313
};
1414
DownloadingState.prototype.fail = function(){
15-
this.oDownload.setState(this.oDownload.getDownloadFailedState());
15+
this.oDownload.setState(this.oDownload.getDownloadedFailedState());
1616
console.log("Download has failed!");
1717
};
1818
DownloadingState.prototype.finish = function(){

0 commit comments

Comments
 (0)