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

Unified Diff: lib/ui.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 | « lib/typoAppIntegration.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/ui.js
===================================================================
--- a/lib/ui.js
+++ b/lib/ui.js
@@ -1711,28 +1711,28 @@ let UI = exports.UI =
let data = RequestNotifier.getDataForNode(wnd.frameElement, true);
if (data && !data[1].filter)
addMenuItem(data);
}
// Look for a background image
if (!hadImage)
{
- function extractImageURL(computedStyle, property)
+ let extractImageURL = function(computedStyle, property)
{
let value = computedStyle.getPropertyCSSValue(property);
// CSSValueList
if ("length" in value && value.length >= 1)
value = value[0];
// CSSValuePrimitiveType
if ("primitiveType" in value && value.primitiveType == value.CSS_URI)
return Utils.unwrapURL(value.getStringValue()).spec;
return null;
- }
+ };
let node = target;
while (node)
{
if (node.nodeType == Ci.nsIDOMNode.ELEMENT_NODE)
{
let style = wnd.getComputedStyle(node, "");
let bgImage = extractImageURL(style, "background-image") || extractImageURL(style, "list-style-image");
« no previous file with comments | « lib/typoAppIntegration.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld