[MacRuby-devel] [MacRuby] #800: MacRuby throws an exception of "LocalJumpError" when use the `yield' in Proc.

2010-07-17 Thread MacRuby
#800: MacRuby throws an exception of "LocalJumpError" when use the `yield' in
Proc.
--+-
 Reporter:  watson1...@…  |   Owner:  lsansone...@…
 Type:  defect|  Status:  new  
 Priority:  blocker   |   Milestone:   
Component:  MacRuby   |Keywords:   
--+-
 Test Script:
 {{{
 #!ruby
 $ cat test_proc_3.rb
 def m
   a = 1
   m2 {
 a
   }
 end

 def m2
   b = 2
   Proc.new {
 [yield, b]
   }
 end

 p m.call # => expected "[1, 2]"
 }}}

 Result of Ruby 1.9.1:
 {{{
 $ ruby test_proc_3.rb
 [1, 2]
 }}}

 Result of MacRuby Trunk:
 {{{
 $ macruby test_proc_3.rb
 no block given (LocalJumpError)
 }}}

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] [MacRuby] #801: The eval is broken when calls eval with Class/Proc's binding.

2010-07-17 Thread MacRuby
#801: The eval is broken when calls eval with Class/Proc's binding.
--+-
 Reporter:  watson1...@…  |   Owner:  lsansone...@…
 Type:  defect|  Status:  new  
 Priority:  blocker   |   Milestone:   
Component:  MacRuby   |Keywords:   
--+-
 Test Script:
 {{{
 #!ruby
 $ cat test_eval_1.rb
 p "** 1"
 a1 = :ng
 def m
   a1 = :ok
   $b1 = binding
 end
 m
 p eval('a1', $b1)

 #--
 p "** 2"
 b = proc{
   a2 = :ok
   binding
 }.call
 a2 = :ng
 p eval('a2', b)

 #--
 p "** 3"
 INFO = :ng
 class C1
   INFO = :ok
   def m
 binding
   end
 end
 p eval('INFO', C1.new.m)

 #--
 p "** 4"
 class C2
   $b2 = binding
 end

 eval(%q{
   def m
 :ok
   end
 }, $b2)
 p C2.new.m
 }}}

 Result of Ruby 1.9.1:
 {{{
 $ ruby test_eval_1.rb
 "** 1"
 :ok
 "** 2"
 :ok
 "** 3"
 :ok
 "** 4"
 :ok
 }}}

 Result of MacRuby Trunk:
 {{{
 $ macruby test_eval_1.rb
 "** 1"
 :ok
 "** 2"
 :ng
 "** 3"
 :ng
 "** 4"
 /Users/watson/test/ruby/macruby/test_eval_1.rb:1:in `': private
 method `m' called for # (NoMethodError)
 }}}

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel