Skip to content

Commit

Permalink
fix(filterMap): properly catch errors that could be thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
TylorS authored and Andre Medeiros committed Apr 14, 2016
1 parent 9536978 commit 8ff48a5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
10 changes: 9 additions & 1 deletion dist/xstream.js
Original file line number Diff line number Diff line change
Expand Up @@ -688,9 +688,17 @@ var FilterMapOperator = (function () {
this.ins._remove(this);
this.out = null;
};
FilterMapOperator.prototype._tryCatch = function (v) {
try {
this.out._n(this.project(v));
}
catch (e) {
this.out._e(e);
}
};
FilterMapOperator.prototype._n = function (v) {
if (this.predicate(v)) {
this.out._n(this.project(v));
this._tryCatch(v);
}
;
};
Expand Down
Loading

0 comments on commit 8ff48a5

Please sign in to comment.