Add call stack to RuntimeException based errors

This commit is contained in:
Bartłomiej Pluta
2019-07-10 12:53:58 +02:00
parent d10df10282
commit 9ea2202d14
7 changed files with 39 additions and 24 deletions

View File

@@ -27,9 +27,7 @@ class Environment():
def _invokeBuiltinMethod(self, object, name, args):
for method in self.methods:
if method.name == name:
self.callStack.append(CallStackItem(name))
ret = method.call(self, [object, *args])
self.callStack.pop(-1)
if ret is not None:
return (True, ret)
@@ -65,9 +63,7 @@ class Environment():
def _invokeBuiltinFunction(self, name, args):
for function in self.functions:
if function.name == name:
self.callStack.append(CallStackItem(name))
ret = function.call(self, args)
self.callStack.pop(-1)
if ret is not None:
return (True, ret)