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

Unified Diff: chrome/content/errors.html

Issue 9251039: Get rid of nested functions declarations that are not on top level (causes strict mode warnings) (Closed)
Patch Set: Created Jan. 23, 2013, 12:52 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 | lib/appSupport.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/errors.html
===================================================================
--- a/chrome/content/errors.html
+++ b/chrome/content/errors.html
@@ -31,24 +31,16 @@
</head>
<body>
<button onclick="window.location.reload();">Refresh</button>
<button onclick="clearErrors();">Clear errors</button>
<script type="application/x-javascript;version=1.7">
let id = null;
try {
- function require(module)
- {
- let {Services} = Components.utils.import("resource://gre/modules/Services.jsm");
- let result = {};
- result.wrappedJSObject = result;
- Services.obs.notifyObservers(result, "adblockplus-require", module);
- return result.exports;
- }
let {addonVersion, addonID} = require("info");
let text = "You are running Adblock Plus " + addonVersion;
text += ".";
document.write("<p>" + text + "</p>");
id = addonID.replace(/[\{\}]/g, "");
} catch (e) {}
@@ -88,16 +80,25 @@
"</div>");
}
}
else
{
document.write("<p>No errors found.</p>");
}
+ function require(module)
+ {
+ let {Services} = Components.utils.import("resource://gre/modules/Services.jsm");
+ let result = {};
+ result.wrappedJSObject = result;
+ Services.obs.notifyObservers(result, "adblockplus-require", module);
+ return result.exports;
+ }
+
function encodeHTML(string)
{
return string.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
}
function clearErrors()
{
Components.classes["@mozilla.org/consoleservice;1"]
« no previous file with comments | « no previous file | lib/appSupport.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld