Skip to content

Commit

Permalink
fix BaseContext "this" with Array.forEach
Browse files Browse the repository at this point in the history
  • Loading branch information
nros committed Nov 7, 2017
1 parent 99b3532 commit 503784b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/BaseContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ BaseContext.prototype.setError = function setError(newError) {
};

BaseContext.prototype.finished = function finished(data) {

if (this.onFinishCallbacks && Array.isArray(this.onFinishCallbacks) && this.onFinishCallbacks.length > 0) {
var _this = this;
this.onFinishCallbacks.forEach(function (listener) {
if (typeof listener === "function") {
listener(this.error);
listener(_this.error);
}
})
}
Expand Down

0 comments on commit 503784b

Please sign in to comment.