(self, function_name)
| 1046 | return obj |
| 1047 | |
| 1048 | def extract_function(self, function_name): |
| 1049 | func_m = re.search(r'(?x)(?:function\s+%s|[{;,]\s*%s\s*=\s*function|var\s+%s\s*=\s*function)\s*\((?P<args>[^)]*)\)\s*\{(?P<code>[^}]+)\}' |
| 1050 | % (re.escape(function_name), re.escape(function_name), re.escape(function_name)), self.code) |
| 1051 | if func_m is None: |
| 1052 | raise JSInterpreterError('Could not find JS function %r' % function_name) |
| 1053 | |
| 1054 | argnames = func_m.group('args').split(',') |
| 1055 | |
| 1056 | return self.build_function(argnames, func_m.group('code')) |
| 1057 | |
| 1058 | def call_function(self, function_name, *args): |
| 1059 | f = self.extract_function(function_name) |
no test coverage detected