Fix _remove_comments regex because of function that has “/*” in it:

function LB(a) {
        if ("undefined" != typeof a.selectNodes) {
            var b = Ad(a);
            "undefined" != typeof b.setProperty && b.setProperty("SelectionLanguage", "XPath");
            return a.selectNodes('vmap:Extensions/vmap:Extension[@type = "YTBreakTime"]/*[name() = "yt:BreakTime"]')
        }
        if (document.implementation.hasFeature("XPath", "3.0")) {
            var b = Ad(a),
                c = b.createNSResolver(b.documentElement);
            a = b.evaluate('vmap:Extensions/vmap:Extension[@type = "YTBreakTime"]/*[name() = "yt:BreakTime"]', a, c, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
            for (var b = [], c = a.snapshotLength, d = 0; d < c; d++) b.push(a.snapshotItem(d));
            return b
        }
        return []
    }
This commit is contained in:
Shaya G 2015-02-17 23:17:49 -05:00
parent 9cad27008b
commit f3e5d9dcd3

View File

@ -35,7 +35,7 @@ class JSInterpreter(object):
self._objects = objects
def _remove_comments(self, code):
return re.sub(r'(?s)/\*.*?\*/', '', code)
return re.sub(r'(?s)/\*[^\[].*?\*/', '', code)
def interpret_statement(self, stmt, local_vars, allow_recursion=100):
if allow_recursion < 0: