Skip to content

EvalContext discards context on recursion #93

@DeadlySurgeon

Description

@DeadlySurgeon

evaluator.EvalContext has some points where it calls Eval, which then just calls EvalContext with a background context, thus dropping the original context passed to it. This should be fixed so it instead calls EvalContext with the provided context.

EG: https://github.com/skx/monkey/blob/master/evaluator/evaluator.go#L56

func EvalContext(ctx context.Context, node ast.Node, env *object.Environment) object.Object {
        ...
	case *ast.ExpressionStatement:
		return Eval(node.Expression, env)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions