X-Git-Url: http://nitlanguage.org diff --git a/src/interpreter/naive_interpreter.nit b/src/interpreter/naive_interpreter.nit index d417d9e..9236d99 100644 --- a/src/interpreter/naive_interpreter.nit +++ b/src/interpreter/naive_interpreter.nit @@ -1012,9 +1012,6 @@ redef class AMethPropdef return v.int32_instance(recvval.to_i32) else if pname == "to_u32" then return v.uint32_instance(recvval.to_u32) - else if pname == "rand" then - var res = recvval.rand - return v.int_instance(res) end else if cname == "Byte" then var recvval = args[0].to_b @@ -1140,8 +1137,6 @@ redef class AMethPropdef return v.float_instance(args[0].to_f.log) else if pname == "pow" then return v.float_instance(args[0].to_f.pow(args[1].to_f)) - else if pname == "rand" then - return v.float_instance(args[0].to_f.rand) else if pname == "abs" then return v.float_instance(args[0].to_f.abs) else if pname == "hypot_with" then @@ -1848,7 +1843,13 @@ redef class AWithExpr v.callsite(method_start, [expr]) v.stmt(self.n_block) v.is_escape(self.break_mark) # Clear the break + + # Execute the finally without an escape + var old_mark = v.escapemark + v.escapemark = null v.callsite(method_finish, [expr]) + # Restore the escape unless another escape was provided + if v.escapemark == null then v.escapemark = old_mark end end