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

Unified Diff: messageResponder.js

Issue 29552642: Issue 5750 - Always require subscriptionInit, avoid "critical dependency" (Closed)
Patch Set: Created Sept. 22, 2017, 12:42 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: messageResponder.js
diff --git a/messageResponder.js b/messageResponder.js
index b9cb74fd5a6dbaaff8437113c15535d9f2c36819..1caa58529d8c2dbf982c431157260fdd5d57c772 100644
--- a/messageResponder.js
+++ b/messageResponder.js
@@ -49,22 +49,6 @@
return filterTypes;
});
- // Some modules doesn't exist on Firefox. Moreover,
- // require() throws an exception on Firefox in that case.
- // However, try/catch causes the whole function to to be
- // deoptimized on V8. So we wrap it into another function.
- function tryRequire(module)
- {
- try
- {
- return require(module);
- }
- catch (e)
- {
- return null;
- }
- }
-
function convertObject(keys, obj)
{
let result = {};
@@ -166,7 +150,7 @@
{
if (message.what == "issues")
{
- let subscriptionInit = tryRequire("subscriptionInit");
+ let subscriptionInit = require("subscriptionInit");
let result = subscriptionInit ? subscriptionInit.reinitialized : false;
return {filterlistsReinitialized: result};
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld