File tree Expand file tree Collapse file tree 1 file changed +3
-22
lines changed
Expand file tree Collapse file tree 1 file changed +3
-22
lines changed Original file line number Diff line number Diff line change 11module Debase
22 class Context
33 def frame_locals ( frame_no = 0 )
4- result = { }
5- binding = frame_binding ( frame_no )
6- locals = eval ( "local_variables" , binding )
7- if locals . respond_to? ( :each )
8- locals . each do |local |
9- result [ local . to_s ] = safe_eval ( local . to_s , binding )
10- end
11- else
12- result [ locals . to_s ] = safe_eval ( locals . to_s , binding )
13- end
14- result
4+ frame_binding ( frame_no ) . eval ( 'local_variables.inject({}){|h, v| h[v.to_s] = eval(v.to_s); h}' )
5+ rescue => e
6+ { 'debase-debug' => "*Evaluation error: '#{ e } '" }
157 end
168
179 def frame_class ( frame_no = 0 )
@@ -46,16 +38,5 @@ def at_line(file, line)
4638 def at_return ( file , line )
4739 handler . at_return ( self , file , line )
4840 end
49-
50- private
51-
52- def safe_eval ( expr , binding )
53- begin
54- eval ( expr , binding )
55- rescue => e
56- "*Evaluation error: '#{ e } '"
57- end
58- end
59-
6041 end
6142end
You can’t perform that action at this time.
0 commit comments