Skip to content

Commit

Permalink
style(lint): fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Seth Yates committed Sep 18, 2016
1 parent 4c62ea5 commit 3e94717
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
1 change: 0 additions & 1 deletion .jscsrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"preset": "google",
"esnext": true,
"maximumLineLength": null,
"validateQuoteMarks": { "mark": "'", "escape": true }
}
2 changes: 1 addition & 1 deletion src/postscribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const OPTIONS = {
*
* @param {Error} e The error
*/
error(e) { new Error(e.msg); },
error(e) { throw new Error(e.msg); },

/**
* Whether to let scripts w/ async attribute set fall out of the queue.
Expand Down
22 changes: 10 additions & 12 deletions src/write-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,23 +544,19 @@ export default class WriteStream {

function success() {
cleanup();
if (done != null) done();
if (done != null) {
done();
}
done = null;
}

function failure(err) {
cleanup();
error(err);
if (done != null) done();
done = null;
}

function addEventListener(el, evt, handler) {
if (el.addEventListener) {
el.addEventListener(evt, handler, false);
} else if (el.attachEvent) {
el.attachEvent(`on${evt}`, handler);
if (done != null) {
done();
}
done = null;
}

function reattachEventListener(el, evt) {
Expand All @@ -579,7 +575,7 @@ export default class WriteStream {
try {
el._onload.apply(this, Array.prototype.slice.call(arguments, 0));
} catch (err) {
failure({msg: `onload handler failed ${err} @ ${el.src}`})
failure({msg: `onload handler failed ${err} @ ${el.src}`});
}
}
success();
Expand All @@ -590,9 +586,11 @@ export default class WriteStream {
try {
el._onerror.apply(this, Array.prototype.slice.call(arguments, 0));
} catch (err) {
failure({msg: `onerror handler failed ${err} @ ${el.src}`});
return;
}
}
failure({msg: `remote script failed ${el.src}`})
failure({msg: `remote script failed ${el.src}`});
},

onreadystatechange() {
Expand Down
1 change: 0 additions & 1 deletion test/bugs/issue262.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* globals sinon */
import postscribe from '../../src/postscribe';

describe('bugs', () => {
Expand Down
1 change: 0 additions & 1 deletion test/unit/api.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* globals sinon */
import postscribe from '../../src/postscribe';

describe('api', () => {
Expand Down

0 comments on commit 3e94717

Please sign in to comment.