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

Side by Side 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.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | lib/appSupport.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 2
3 <html> 3 <html>
4 <head> 4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <title>Adblock Plus Errors</title> 6 <title>Adblock Plus Errors</title>
7 <style type="text/css"> 7 <style type="text/css">
8 .warning, .error 8 .warning, .error
9 { 9 {
10 border: 1px dashed black; 10 border: 1px dashed black;
(...skipping 18 matching lines...) Expand all
29 } 29 }
30 </style> 30 </style>
31 </head> 31 </head>
32 <body> 32 <body>
33 <button onclick="window.location.reload();">Refresh</button> 33 <button onclick="window.location.reload();">Refresh</button>
34 <button onclick="clearErrors();">Clear errors</button> 34 <button onclick="clearErrors();">Clear errors</button>
35 35
36 <script type="application/x-javascript;version=1.7"> 36 <script type="application/x-javascript;version=1.7">
37 let id = null; 37 let id = null;
38 try { 38 try {
39 function require(module)
40 {
41 let {Services} = Components.utils.import("resource://gre/modules/Service s.jsm");
42 let result = {};
43 result.wrappedJSObject = result;
44 Services.obs.notifyObservers(result, "adblockplus-require", module);
45 return result.exports;
46 }
47 let {addonVersion, addonID} = require("info"); 39 let {addonVersion, addonID} = require("info");
48 40
49 let text = "You are running Adblock Plus " + addonVersion; 41 let text = "You are running Adblock Plus " + addonVersion;
50 text += "."; 42 text += ".";
51 document.write("<p>" + text + "</p>"); 43 document.write("<p>" + text + "</p>");
52 44
53 id = addonID.replace(/[\{\}]/g, ""); 45 id = addonID.replace(/[\{\}]/g, "");
54 } catch (e) {} 46 } catch (e) {}
55 47
56 // See https://bugzilla.mozilla.org/show_bug.cgi?id=664695 - starting with 48 // See https://bugzilla.mozilla.org/show_bug.cgi?id=664695 - starting with
(...skipping 29 matching lines...) Expand all
86 document.write("<div class='" + type + "'>" + 78 document.write("<div class='" + type + "'>" +
87 html + 79 html +
88 "</div>"); 80 "</div>");
89 } 81 }
90 } 82 }
91 else 83 else
92 { 84 {
93 document.write("<p>No errors found.</p>"); 85 document.write("<p>No errors found.</p>");
94 } 86 }
95 87
88 function require(module)
89 {
90 let {Services} = Components.utils.import("resource://gre/modules/Services. jsm");
91 let result = {};
92 result.wrappedJSObject = result;
93 Services.obs.notifyObservers(result, "adblockplus-require", module);
94 return result.exports;
95 }
96
96 function encodeHTML(string) 97 function encodeHTML(string)
97 { 98 {
98 return string.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, " &gt;"); 99 return string.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, " &gt;");
99 } 100 }
100 101
101 function clearErrors() 102 function clearErrors()
102 { 103 {
103 Components.classes["@mozilla.org/consoleservice;1"] 104 Components.classes["@mozilla.org/consoleservice;1"]
104 .getService(Components.interfaces.nsIConsoleService) 105 .getService(Components.interfaces.nsIConsoleService)
105 .reset(); 106 .reset();
106 window.location.reload(); 107 window.location.reload();
107 } 108 }
108 </script> 109 </script>
109 </body> 110 </body>
110 </html> 111 </html>
OLDNEW
« 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