[MacRuby] #1111: MacRuby throws an exception when undefine the String#length.
#1111: MacRuby throws an exception when undefine the String#length. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Test: {{{ $ ruby -v -e 'String.class_eval{ undef :length }' ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0] $ ruby19 -v -e 'String.class_eval{ undef :length }' ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.5.0] $ macruby -v -e 'String.class_eval{ undef :length }' MacRuby 0.9 (ruby 1.9.2) [universal-darwin10.0, x86_64] -e:1:in `<main>': cannot undefine method `length' because it is a native method (RuntimeError) }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1111> MacRuby <http://macruby.org/>
#1111: MacRuby throws an exception when undefine the String#length. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by lsansonetti@…): That is expected: we cannot allow the user to change native methods such as NSString -length because it can cause unexpected crashes later in the process. However, as String is RubyString (a subclass), maybe this exception shouldn't be raised here. -- Ticket URL: <http://www.macruby.org/trac/ticket/1111#comment:1> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby