[#41278] [BUG:1.9] BINARY should not be ASCII-compatible — Yugui <yugui@...>

WXVndWkbJEIkRyQ5ISMbKEIKCgo+IBskQiRHISIkKiQqJGAkTSQzJDMkXiRHJE41RE9AJEclKyVQ

15 messages 2010/05/11

[#41407] [Bug #3339] win32ole test failure — Usaku NAKAMURA <redmine@...>

Bug #3339: win32ole test failure

20 messages 2010/05/25
[#41411] Re: [Bug #3339] win32ole test failure — Masaki Suketa <masaki.suketa@...> 2010/05/25

助田です。

[#41412] Re: [Bug #3339] win32ole test failure — "U.Nakamura" <usa@...> 2010/05/25

こんにちは、なかむら(う)です。

[ruby-dev:41387] Re: [Bug #3316] Kernel#caller returns nil as well

From: Nobuhiro IMAI <nov@...>
Date: 2010-05-21 15:59:29 UTC
List: ruby-dev #41387
いまいです。

From: Yusuke ENDOH <mame_at_tsg.ne.jp>
Date: Thu, 20 May 2010 21:58:42 +0900

> 遠藤です。
> 
> 2010年5月20日4:47 Nobuhiro IMAI <nov@yo.rim.or.jp>:
>> が、これだと、caller(0) で返る配列のサイズを越える数を引数として渡して
>> も空配列が返るようになってしまっているようです。
> 
> ぐああ、問題を誤解していました。nil が帰ることがあるのは元からなんですね。
> 以下のパッチで再挑戦します。それから頂いたパッチは取り込んでおきます。

トップレベル云々の話で混乱させてしまったかもしれません。ごめんなさい。

これで、1.8 と同じ挙動になっていると思います。という訳で、せっかくパッ
チを取り込んでいただいたのに、RDoc の方が間違いになってしまいました。
以下のパッチで正しい記述になると思います。ついでに、

* 他の場所に合わせて s/Array/array/
* 実際の出力に合わせて in `<main>' を追加
* caller(4) を修正、caller(5) を追加

という変更を加えています。合わせて取捨選択してください。
--
Nobuhiro IMAI <nov@yo.rim.or.jp>
Key fingerprint = F39E D552 545D 7C64 D690  F644 5A15 746C BD8E 7106


diff --git a/vm_eval.c b/vm_eval.c
index cff05a0..e609ca0 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1536,7 +1536,7 @@ rb_catch_obj(VALUE tag, VALUE (*func)(), VALUE data)
 
 /*
  *  call-seq:
- *     caller(start=1)    -> Array or nil
+ *     caller(start=1)    -> array or nil
  *
  *  Returns the current execution stack---an array containing strings in
  *  the form ``<em>file:line</em>'' or ``<em>file:line: in
@@ -1544,7 +1544,7 @@ rb_catch_obj(VALUE tag, VALUE (*func)(), VALUE data)
  *  determines the number of initial stack entries to omit from the
  *  result.
  *
- *  Returns +nil+ if _start_ is greater than or equal to the size of
+ *  Returns +nil+ if _start_ is greater than the size of
  *  current execution stack.
  *
  *     def a(skip)
@@ -1556,11 +1556,12 @@ rb_catch_obj(VALUE tag, VALUE (*func)(), VALUE data)
  *     def c(skip)
  *       b(skip)
  *     end
- *     c(0)   #=> ["prog:2:in `a'", "prog:5:in `b'", "prog:8:in `c'", "prog:10"]
- *     c(1)   #=> ["prog:5:in `b'", "prog:8:in `c'", "prog:11"]
- *     c(2)   #=> ["prog:8:in `c'", "prog:12"]
- *     c(3)   #=> ["prog:13"]
- *     c(4)   #=> nil
+ *     c(0)   #=> ["prog:2:in `a'", "prog:5:in `b'", "prog:8:in `c'", "prog:10:in `<main>'"]
+ *     c(1)   #=> ["prog:5:in `b'", "prog:8:in `c'", "prog:11:in `<main>'"]
+ *     c(2)   #=> ["prog:8:in `c'", "prog:12:in `<main>'"]
+ *     c(3)   #=> ["prog:13:in `<main>'"]
+ *     c(4)   #=> []
+ *     c(5)   #=> nil
  */
 
 static VALUE

In This Thread