Permalink
Browse files

Updated code to better reflect JS shell detection rules (bug 794309)

  • Loading branch information...
1 parent 28d9b2c commit a091905c7f84dd3127e76ad01cdcf7ccab1a6b40 @mattbasta committed Sep 26, 2012
Showing with 8 additions and 7 deletions.
  1. +1 −0 tests/js_helper.py
  2. +1 −0 validator/main.py
  3. +6 −7 validator/testcases/scripting.py
View
@@ -23,6 +23,7 @@ def _do_test_raw(script, path="foo.js", bootstrap=False, ignore_pollution=True,
"Performs a test on a JS file"
err = ErrorBundle(instant=True)
+ err.save_resource("SPIDERMONKEY", False)
if jetpack:
err.metadata["is_jetpack"] = True
View
@@ -127,6 +127,7 @@ def main():
determined=args.determined,
listed=not args.selfhosted,
overrides=overrides,
+ spidermonkey=SPIDERMONKEY_INSTALLATION,
for_appversions=for_appversions,
expectation=expectation,
timeout=timeout)
@@ -17,9 +17,12 @@
def test_js_file(err, filename, data, line=0, context=None, pollutable=False):
"Tests a JS file by parsing and analyzing its tokens"
- if SPIDERMONKEY_INSTALLATION is None or \
- err.get_resource("SPIDERMONKEY") is None: # Default value is False
+ spidermonkey = err.get_resource("SPIDERMONKEY")
+
+ if spidermonkey is None: # Default value is False
return
+ elif not spidermonkey:
+ spidermonkey = SPIDERMONKEY_INSTALLATION
if err.detected_type == PACKAGE_THEME:
err.warning(
@@ -37,11 +40,7 @@ def test_js_file(err, filename, data, line=0, context=None, pollutable=False):
before_tier = err.tier
err.set_tier(3)
- tree = get_tree(data,
- filename=filename,
- shell=(err and err.get_resource("SPIDERMONKEY")) or
- SPIDERMONKEY_INSTALLATION,
- err=err)
+ tree = get_tree(data, filename=filename, shell=spidermonkey, err=err)
if not tree:
if before_tier:
err.set_tier(before_tier)

0 comments on commit a091905

Please sign in to comment.