lib/dentaku/calculator.rb in dentaku-2.0.5 vs lib/dentaku/calculator.rb in dentaku-2.0.6
- old
+ new
@@ -69,12 +69,17 @@
else
memory[key_or_hash.to_s.downcase] = value
end
if block_given?
- result = yield
- @memory = restore
- return result
+ begin
+ result = yield
+ @memory = restore
+ return result
+ rescue => e
+ @memory = restore
+ raise e
+ end
end
self
end
alias_method :bind, :store