[MacRuby/MacRuby] ec6867: rewrite 351ebd7 and 954a8c7 because they cause cra...
Branch: refs/heads/master Home: https://github.com/MacRuby/MacRuby Commit: ec6867998331c873e79ce758a1fa701894d17a01 https://github.com/MacRuby/MacRuby/commit/ec6867998331c873e79ce758a1fa701894... Author: Watson <watson1978@gmail.com> Date: 2011-03-30 (Wed, 30 Mar 2011) Changed paths: M vm.cpp M vm_eval.c Log Message: ----------- rewrite 351ebd7 and 954a8c7 because they cause crash when refer to class variable within instance_{eval, exec}'s block. Test Script: {{{ require 'test/unit/assertions.rb' include Test::Unit::Assertions @@a = 4 assert_equal(4, 1.instance_eval { @@a } ) assert_equal(4, 1.instance_exec { @@a } ) assert_raise(TypeError){ 1.instance_eval { def foo; end } } assert_raise(TypeError){ 1.instance_eval { alias :foo :to_s} } assert_raise(TypeError){ 1.instance_exec { def foo; end } } assert_raise(TypeError){ 1.instance_exec { alias :foo :to_s} } puts :ok }}}
participants (1)
-
noreply@github.com