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

Unified Diff: packagerGecko.py

Issue 11237002: Provide an XMLHttpRequest constructor if used in JS modules (Closed)
Patch Set: Created July 25, 2013, 3:43 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 | « bootstrap.js.tmpl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packagerGecko.py
===================================================================
--- a/packagerGecko.py
+++ b/packagerGecko.py
@@ -187,30 +187,33 @@ def fixupLocales(params, files):
else:
files[path] = reference[file]['_origData'].encode('utf-8')
def addMissingFiles(params, files):
templateData = {
'hasChrome': False,
'hasChromeRequires': False,
'hasShutdownHandlers': False,
+ 'hasXMLHttpRequest': False,
'hasVersionPref': False,
'chromeWindows': [],
'requires': {},
'metadata': params['metadata'],
'multicompartment': params['multicompartment'],
'applications': dict((v, k) for k, v in KNOWN_APPS.iteritems()),
}
def checkScript(name):
content = files[name]
for match in re.finditer(r'(?:^|\s)require\(\s*"([\w\-]+)"\s*\)', content):
templateData['requires'][match.group(1)] = True
if name.startswith('chrome/content/'):
templateData['hasChromeRequires'] = True
+ if name.startswith('lib/') and re.search(r'\bXMLHttpRequest\b', content):
+ templateData['hasXMLHttpRequest'] = True
if name == 'defaults/prefs.js':
if re.search(r'\.currentVersion"', content):
templateData['hasVersionPref'] = True
if not '/' in name or name.startswith('lib/'):
if re.search(r'(?:^|\s)onShutdown\.', content):
templateData['hasShutdownHandlers'] = True
for name, content in files.iteritems():
« no previous file with comments | « bootstrap.js.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld