Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: polyfill.js

Issue 29678657: Issue 4579 - Fix ESLint errors (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created Jan. 24, 2018, 4:06 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: polyfill.js
===================================================================
--- a/polyfill.js
+++ b/polyfill.js
@@ -125,17 +125,17 @@
};
Object.defineProperty(object, name, descriptor);
}
function wrapRuntimeOnMessage()
{
let {onMessage} = browser.runtime;
- let {addListener, removeListener, hasListener} = onMessage;
+ let {addListener, removeListener} = onMessage;
onMessage.addListener = function(listener)
{
if (typeof listener != "function")
throw new Error(invalidMessageListenerError);
// Don't add the same listener twice or we end up with multiple wrappers.
if (messageListeners.has(listener))
@@ -148,22 +148,23 @@
if (wait instanceof Promise)
{
wait.then(sendResponse, reason =>
{
try
{
sendResponse();
}
- finally
+ catch (error)
{
// sendResponse can throw if the internal port is closed; be sure
// to throw the original error.
- throw reason;
}
+
+ throw reason;
});
}
return !!wait;
};
addListener.call(onMessage, wrapper);
messageListeners.set(listener, wrapper);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld