You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
strX = 'some no foo'
begin
y='start'
puts y
foo
rescue => excp
strX = 'some foo error'
ensure
puts strX
puts 'end'
end
return
I get the output:
start
some foo error
end
Without the error line ( comment out 'foo') it's:
start
some no foo
end
In mod_mruby the scope of a variable is not carried into the ensure:
strX = 'some no foo'
begin
y='start'
Apache.echo y
foo
rescue => excp
strX = 'some foo error'
ensure
Apache.echo strX
Apache.echo 'end'
end
return
Output from this is:
start
end
The variable seen by the ensure is set to nil (tested by getting an error if you attempt " strX += 'more text' " or some other manipulation of the nil value string). This could be intentional, but I wanted to be sure that this was working as designed or a problem.
The text was updated successfully, but these errors were encountered:
if I execute the following code with mruby:
I get the output:
start
some foo error
end
Without the error line ( comment out 'foo') it's:
start
some no foo
end
In mod_mruby the scope of a variable is not carried into the ensure:
Output from this is:
start
end
The variable seen by the ensure is set to nil (tested by getting an error if you attempt " strX += 'more text' " or some other manipulation of the nil value string). This could be intentional, but I wanted to be sure that this was working as designed or a problem.
The text was updated successfully, but these errors were encountered: