Skip to content

Commit

Permalink
Fix other test in Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbmatter committed Mar 29, 2017
1 parent ad4894f commit 37c2927
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,15 @@ class PromiseWorker {
if (!this._worker) {
throw new Error('registerError can only be called from host, not inside Worker');
}

this._errorCallback = cb;

// Some browsers (Firefox) call onerror on every host, while others
// (Chrome) do nothing. Let's disable that everywhere, for consistency.
this._worker.addEventListener('error', (e: Event) => {
e.preventDefault();
e.stopPropagation();
});
}

_postMessageBi(obj: any[], targetHostID: number | void) {
Expand Down

0 comments on commit 37c2927

Please sign in to comment.