Skip to content

Commit

Permalink
Fix #40
Browse files Browse the repository at this point in the history
  • Loading branch information
ykzts committed Nov 13, 2016
1 parent 8bc6dc7 commit 7d2fa85
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/xmlhttprequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ function _receiveResponse(response) {
}

function _setDispatchProgressEvents(stream) {
const _properties = this._properties;
const _properties = this._properties || {};
const loadStartEvent = new ProgressEvent('loadstart');
this.dispatchEvent(loadStartEvent);
stream.on('data', () => {
const progressEvent = new ProgressEvent('progress', {
lengthComputable: _properties.lengthComputable,
loaded: _properties.loaded,
total: _properties.total
lengthComputable: _properties.lengthComputable || 0,
loaded: _properties.loaded || 0,
total: _properties.total || 0
});
this.dispatchEvent(progressEvent);
});
Expand Down

0 comments on commit 7d2fa85

Please sign in to comment.