Skip to content

Commit

Permalink
Avoid unhandled rejection in Firefox 69
Browse files Browse the repository at this point in the history
This implements a workaround for this bug in Firefox 69: https://bugzilla.mozilla.org/show_bug.cgi?id=1561911

Closes #51
  • Loading branch information
Chasen Le Hara authored and chasenlehara committed Sep 4, 2019
1 parent e018a54 commit e9472f6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions can-ndjson-stream-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ conditionalAsyncTest('malformed json', function(assert) {
function errCheck() {
errorCaught = true;
}

// Firefox has a bug where an unhandled rejection is emitted from `new ReadableStream(source)` if `source.start()` rejects.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1561911 for more info.
// This line should be removed if the Firefox bug above is fixed.
QUnit.onUnhandledRejection = function() {};

var done = assert.async();
var allDone = reader.read().then(function read(result) {
if (result.start) {
Expand Down

0 comments on commit e9472f6

Please sign in to comment.