[前][次][番号順一覧][スレッド一覧][生データ]

yarv-dev:1073

From: sheepman <sheepman sheepman.sakura.ne.jp>
Date: Sun, 30 Jul 2006 10:28:55 +0900
Subject: [yarv-dev:1073] open> stack message when StandardError raised

こんにちは、sheepman です。
例外が発生した時に表示されるスタックが、実際のものとは異なっています。

$ cat t.rb
class C

  Class.class_eval %{
    define_method(:raize, lambda { raise StandardError })
  }

  def f
    cl = self.class
    cl.raize
  end

end

c = C.new
c.f

$ ruby-2.0 -v t.rb
ruby 2.0.0 (Base: Ruby 1.9.0 2006-04-08) [i686-linux]
YARVCore 0.4.1 Rev: 527 (2006-07-19) [opts: [direct threaded code] [inline method cache] ]
(eval):2:in `raise': StandardError (StandardError)
        from (eval):2:in `block (2 levels) in <class:C>'
        from t.rb:9:in `class'
        from t.rb:9:in `f'
        from t.rb:15:in `<main>'

この下から3行目の「from t.rb:9:in `class'」は実際は「from t.rb:9:in `raize'」が正しいんだと思います。
self.class が呼ばれているのは8行目だし。

-- 
sheepman / TAMURA Takashi
sheepman sheepman.sakura.ne.jp


--
ML: yarv-dev quickml.atdot.net
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧][生データ]

->    1073 2006-07-30 10:28 [sheepman sheepman.sa] open> stack message when StandardError raised
      1084 2006-08-17 22:45 ┗[ko1 atdot.net       ] fixed> Re: open> stack message when StandardError raised