FunctionExecutionContext should use the parent if possible
This commit is contained in:
1 parent
4a593f9693
commit
8fc2add242
1 file changed
+10
-6
@@ -323,12 +323,16 @@ class BoundMethod(AbstractFunction):
|
|||||||
if arguments is None:
|
if arguments is None:
|
||||||
arguments = AnonymousInstanceArguments(self._instance)
|
arguments = AnonymousInstanceArguments(self._instance)
|
||||||
|
|
||||||
return FunctionExecutionContext(
|
arguments = InstanceArguments(self._instance, arguments)
|
||||||
self.evaluator,
|
|
||||||
self.parent_context,
|
if isinstance(self._function, compiled.CompiledObject):
|
||||||
self,
|
# This is kind of weird, because it's coming from a compiled object
|
||||||
InstanceArguments(self._instance, arguments)
|
# and we're not sure if we want that in the future.
|
||||||
)
|
return FunctionExecutionContext(
|
||||||
|
self.evaluator, self.parent_context, self, arguments
|
||||||
|
)
|
||||||
|
|
||||||
|
return self._function.get_function_execution(arguments)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '<%s: %s>' % (self.__class__.__name__, self._function)
|
return '<%s: %s>' % (self.__class__.__name__, self._function)
|
||||||
|
|||||||
Reference in new issue
Block a user