From bfe5ac85d07efca89d41bb6344f1928566326f8e Mon Sep 17 00:00:00 2001 From: mattbasta Date: Thu, 20 Jan 2011 19:50:13 -0500 Subject: [PATCH] Updated error tier before tree is generated; bug 625690 --- validator/testcases/scripting.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/validator/testcases/scripting.py b/validator/testcases/scripting.py index f910baf..1db889e 100644 --- a/validator/testcases/scripting.py +++ b/validator/testcases/scripting.py @@ -20,6 +20,12 @@ def test_js_file(err, filename, data, line=0): err.get_resource("SPIDERMONKEY") is None: # Default value is False return + before_tier = None + # Set the tier to 4 (Security Tests) + if err is not None: + before_tier = err.tier + err.tier = 4 + # Get the AST tree for the JS code try: tree = _get_tree(filename, @@ -62,16 +68,16 @@ def test_js_file(err, filename, data, line=0): import sys etype, err, tb = sys.exc_info() raise exc, None, tb + + if before_tier: + err.tier = before_tier return if tree is None: + if before_tier: + err.tier = before_tier return None - # Set the tier to 4 (Security Tests) - if err is not None: - before_tier = err.tier - err.tier = 4 - context = ContextGenerator(data) if traverser.DEBUG: _do_test(err=err, filename=filename, line=line, context=context,