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

Unified Diff: lib/typoAppIntegration.js

Issue 9252108: Backport: Get rid of nested functions declarations that are not on top level (causes strict mode wa… (Closed)
Patch Set: Created Jan. 25, 2013, 9:54 a.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: lib/typoAppIntegration.js
===================================================================
--- a/lib/typoAppIntegration.js
+++ b/lib/typoAppIntegration.js
@@ -36,14 +36,14 @@
{
// URL Fixer
exports.isTypoCorrectionEnabled = function(window, prefix, domain, suffix) true;
-
+
break;
}
case "adblockplus":
{
// Adblock Plus
let {Prefs} = require("prefs");
-
+
// Do not ask to opt-in if user found setting
if (!Prefs.correctTyposAsked)
{
@@ -55,10 +55,10 @@
Prefs.removeListener(onPrefChange);
}
}
-
+
Prefs.addListener(onPrefChange);
}
-
+
exports.isTypoCorrectionEnabled = function(window, prefix, domain, suffix)
{
if (!Prefs.correctTyposAsked && !Prefs.correctTypos)
@@ -92,10 +92,10 @@
// We need to have persistence being set to 1 due to redirect which happens afterwards
exports.openInfobar(window, "adblockplus-infobar-correct-typos-ask", message, buttons, 1);
}
-
+
return Prefs.correctTypos;
};
-
+
break;
}
}
@@ -172,12 +172,12 @@
if (urlbar && urlbar._fireEvent && !functionHooks.has(window))
{
- function correctURL()
+ let correctURL = function()
{
let correction = corrector(window, urlbar.value);
if (correction)
urlbar.value = correction;
- }
+ };
let unhook = hook(urlbar, "_fireEvent", function(eventType)
{
@@ -315,13 +315,13 @@
if ("BrowserApp" in window && window.BrowserApp.observe && !functionHooks.has(window))
{
let innerUnhook = null;
- function cleanup()
+ let cleanup = function()
{
if (innerUnhook)
innerUnhook();
innerUnhook = null;
- }
+ };
let unhook = hook(window.BrowserApp, "observe", function(subject, topic, data)
{
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld