|
@@ -30,13 +30,10 @@ class JSInterpreter(object):
|
|
def __init__(self, code, objects=None):
|
|
def __init__(self, code, objects=None):
|
|
if objects is None:
|
|
if objects is None:
|
|
objects = {}
|
|
objects = {}
|
|
- self.code = self._remove_comments(code)
|
|
|
|
|
|
+ self.code = code
|
|
self._functions = {}
|
|
self._functions = {}
|
|
self._objects = objects
|
|
self._objects = objects
|
|
|
|
|
|
- def _remove_comments(self, code):
|
|
|
|
- return re.sub(r'(?s)/\*.*?\*/', '', code)
|
|
|
|
-
|
|
|
|
def interpret_statement(self, stmt, local_vars, allow_recursion=100):
|
|
def interpret_statement(self, stmt, local_vars, allow_recursion=100):
|
|
if allow_recursion < 0:
|
|
if allow_recursion < 0:
|
|
raise ExtractorError('Recursion limit reached')
|
|
raise ExtractorError('Recursion limit reached')
|