aboutsummaryrefslogtreecommitdiff
path: root/value.go
diff options
context:
space:
mode:
Diffstat (limited to 'value.go')
-rw-r--r--value.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/value.go b/value.go
index bd2aa34..eefc201 100644
--- a/value.go
+++ b/value.go
@@ -559,7 +559,10 @@ func (b *Builtin) Receiver() Value { return b.recv }
func (b *Builtin) String() string { return toString(b) }
func (b *Builtin) Type() string { return "builtin_function_or_method" }
func (b *Builtin) Call(thread *Thread, args Tuple, kwargs []Tuple) (Value, error) {
- return b.fn(thread, b, args, kwargs)
+ thread.frame = &Frame{parent: thread.frame, callable: b}
+ result, err := b.fn(thread, b, args, kwargs)
+ thread.frame = thread.frame.parent
+ return result, err
}
func (b *Builtin) Truth() Bool { return true }