1. 20 Dec, 2017 2 commits
    • Yukihiro "Matz" Matsumoto's avatar
      Fixed method look-up for `method_missing` in OP_SUPER; ref #3905 · 165e7b18
      Yukihiro "Matz" Matsumoto authored
      Method look-up for `OP_SUPER` should start from the superclass of
      the `target_class` but if it fails, the look-up for `method_missing`
      should start from the class of the receiver.
      
      The following code explains the case:
      ```ruby
      class Bar
        def foo
          super
        end
      end
      
      class Foo<Bar
        def method_missing(mid, *)
          p mid
        end
      end
      ```
      Foo.new.foo
      165e7b18
    • Yukihiro "Matz" Matsumoto's avatar
      The superclass info should be taken from `TARGET_CLASS(ci->proc). · d0f60182
      Yukihiro "Matz" Matsumoto authored
      Not from `ci->target_class` that may be switched using `class_eval` etc.
      fix #3899, fix #3906
      
      We found out there is a mruby specific limitation that `super` may be
      screwed up when a method is defined in a module and `super` is called
      in the block with the target class switched (for example, `super` in
      `class_eval` block).  Now we raise `RuntimeError` for such cases.
      
      The following code works in CRuby but not in mruby.
      ```
      module M
        def foo
          "aaa".singleton_class.class_eval{super 2}
        end
      end
      class Foo
        def foo(*); end
      end
      class Bar<Foo
        include M
      end
      Bar.new.foo
      ```
      d0f60182
  2. 18 Dec, 2017 11 commits
  3. 17 Dec, 2017 1 commit
  4. 16 Dec, 2017 2 commits
  5. 15 Dec, 2017 1 commit
  6. 14 Dec, 2017 2 commits
  7. 13 Dec, 2017 21 commits