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

Unified Diff: lib/appSupport.js

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 | « chrome/content/errors.html ('k') | lib/io.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/appSupport.js
===================================================================
--- a/lib/appSupport.js
+++ b/lib/appSupport.js
@@ -479,17 +479,17 @@ switch (application)
if (!parent || !(parent.compareDocumentPosition(browser) & Ci.nsIDOMNode.DOCUMENT_POSITION_CONTAINED_BY))
parent = browser.parentNode;
_addBottomBar(window, parent, element);
};
exports.removeBottomBar = _removeBottomBar;
- function BrowserChangeListener(window, callback)
+ let BrowserChangeListener = function(window, callback)
{
this.window = window;
this.callback = callback;
this.onSelect = this.onSelect.bind(this);
this.attach();
};
BrowserChangeListener.prototype = {
window: null,
@@ -686,17 +686,17 @@ switch (application)
case "fennec2":
{
exports.isKnownWindow = function fmn_isKnownWindow(/**Window*/ window) window.document.documentElement.id == "main-window";
exports.getBrowser = function fmn_getBrowser(window) window.BrowserApp.selectedBrowser;
exports.addTab = function fmn_addTab(window, url, event) window.BrowserApp.addTab(url, {selected: true});
- function BrowserChangeListener(window, callback)
+ let BrowserChangeListener = function(window, callback)
{
this.window = window;
this.callback = callback;
this.onSelect = this.onSelect.bind(this);
this.attach();
};
BrowserChangeListener.prototype = {
window: null,
@@ -830,17 +830,17 @@ switch (application)
};
let {Filter} = require("filterClasses");
let {Prefs} = require("prefs");
let {Policy} = require("contentPolicy");
let {UI} = require("ui");
let {Utils} = require("utils");
- function toggleWhitelist(window)
+ let toggleWhitelist = function(window)
{
if (!Prefs.enabled)
{
Prefs.enabled = true;
return;
}
let location = exports.getCurrentLocation(window);
@@ -855,17 +855,17 @@ switch (application)
if (!host)
return;
if (Policy.isWhitelisted(location.spec))
UI.removeWhitelist(window);
else
UI.toggleFilter(Filter.fromText("@@||" + host + "^$document"));
- }
+ };
let menuItem = null;
onShutdown.add(function()
{
let window = null;
for (window in UI.applicationWindows)
break;
« no previous file with comments | « chrome/content/errors.html ('k') | lib/io.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld