private object GetReturnValue()
{
if (this.context.HasReturnValue)
{
// TODO Review, only needed for some tests
if (this.context.Block.Closure != null)
{
this.context.Block.Closure.HasReturnValue = true;
this.context.Block.Closure.ReturnValue = this.context.ReturnValue;
}
return this.context.ReturnValue;
}
if (this.context.Block.IsMethod)
return this.context.Self;
if (this.context.Stack.Count == 0)
return null;
return this.context.Pop();
}