Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Port fix for bare except from amo-validator

  • Loading branch information...
commit eb97eac776b8a11a6e681067aa263f5b4a3e7e67 1 parent 2fb8dcc
Matt Basta authored
2  appvalidator/testcases/javascript/call_definitions.py
View
@@ -88,7 +88,7 @@ def wrap(wrapper, arguments, traverser):
# ", ".join(map(str, params)))
try:
return JSLiteral(func(*params), traverser=traverser)
- except:
+ except (ValueError, TypeError, OverflowError):
# If we cannot compute output, just return nothing.
return JSLiteral(None, traverser=traverser)
9 tests/js/test_operators.py
View
@@ -227,3 +227,12 @@ def test_simple_operators_when_dirty(self):
""" +
"""y += y + x;""" * 100) # This bit makes the validator's head explode.
+ def test_wrapped_python_exceptions(self):
+ """
+ Test that OverflowErrors in traversal don't crash the validation
+ process.
+ """
+
+ self.run_script("""
+ var x = Math.exp(-4*1000000*-0.0641515994108);
+ """)
Please sign in to comment.
Something went wrong with that request. Please try again.