From 67b7df8e583971c42be49de0af93c3b6377cdbbd Mon Sep 17 00:00:00 2001 From: Matt Basta Date: Thu, 28 Apr 2011 03:20:20 +0000 Subject: [PATCH] Fixed some tracebacks --- validator/testcases/javascript/jstypes.py | 3 ++- validator/testcases/javascript/predefinedentities.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/validator/testcases/javascript/jstypes.py b/validator/testcases/javascript/jstypes.py index a7371e6..1f80d12 100644 --- a/validator/testcases/javascript/jstypes.py +++ b/validator/testcases/javascript/jstypes.py @@ -371,7 +371,8 @@ class JSArray(JSObject): # x = [4] # y = x * 3 // y = 12 since x equals "4" return u",".join([unicode(w.get_literal_value()) for - w in self.elements if + w in + self.elements if not (isinstance(w, JSWrapper) and w.value == self)]) def set(self, index, value, traverser=None): diff --git a/validator/testcases/javascript/predefinedentities.py b/validator/testcases/javascript/predefinedentities.py index cd171f2..88c9d59 100644 --- a/validator/testcases/javascript/predefinedentities.py +++ b/validator/testcases/javascript/predefinedentities.py @@ -113,11 +113,11 @@ GLOBAL_ENTITIES = { u"document": {"value": {u"createElement": {"dangerous": - lambda a, t: t(a[0]).get_literal_value() + lambda a, t: unicode(t(a[0]).get_literal_value()) .lower() == "script"}, u"createElementNS": {"dangerous": - lambda a, t: t(a[0]).get_literal_value() + lambda a, t: unicode(t(a[0]).get_literal_value()) .lower() == "script"}, u"loadOverlay": {"dangerous": True}}},