* vm_trace.c (tracepoint_attr_defined_class): Clean up rdoc for
TracePoint#defined_class git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
dbc8565fa3
commit
ec3226d826
@ -1,3 +1,8 @@
|
|||||||
|
Tue Dec 18 13:17:00 2012 Zachary Scott <zachary@zacharyscott.net>
|
||||||
|
|
||||||
|
* vm_trace.c (tracepoint_attr_defined_class): Clean up rdoc for
|
||||||
|
TracePoint#defined_class
|
||||||
|
|
||||||
Tue Dec 18 12:15:59 2012 Eric Hodel <drbrain@segment7.net>
|
Tue Dec 18 12:15:59 2012 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
* lib/rubygems/specification.rb: Fixed ruby output of requirements
|
* lib/rubygems/specification.rb: Fixed ruby output of requirements
|
||||||
|
54
vm_trace.c
54
vm_trace.c
@ -835,36 +835,38 @@ tracepoint_attr_method_id(VALUE tpval)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return class or module the method being called.
|
* Return class or module of the method being called.
|
||||||
*
|
*
|
||||||
* class C; def foo; end; end
|
* class C; def foo; end; end
|
||||||
* trace = TracePoint.new(:call) do |tp|
|
* trace = TracePoint.new(:call) do |tp|
|
||||||
* tp.defined_class #=> C
|
* p tp.defined_class #=> C
|
||||||
* end.enable do
|
* end.enable do
|
||||||
* C.new.foo
|
* C.new.foo
|
||||||
* end
|
* end
|
||||||
*
|
*
|
||||||
* If method is defined by a module, then returns that module.
|
* If method is defined by a module, then that module is returned.
|
||||||
*
|
*
|
||||||
* module M; def foo; end; end
|
* module M; def foo; end; end
|
||||||
* class C; include M; end;
|
* class C; include M; end;
|
||||||
* trace = TracePoint.new(:call) do |tp|
|
* trace = TracePoint.new(:call) do |tp|
|
||||||
* tp.defined_class #=> M
|
* p tp.defined_class #=> M
|
||||||
* end.enable do
|
* end.enable do
|
||||||
* C.new.foo
|
* C.new.foo
|
||||||
* end
|
* end
|
||||||
*
|
*
|
||||||
* Note that TracePont#defined_class returns singleton class.
|
* <b>Note:</b> #defined_class returns singleton class.
|
||||||
* 6th block parameter of `set_trace_func' passes original class
|
*
|
||||||
* of attached by singleton class. This is a difference between
|
* 6th block parameter of Kernel#set_trace_func passes original class
|
||||||
* `set_trace_func' and TracePoint.
|
* of attached by singleton class.
|
||||||
*
|
*
|
||||||
* class C; def self.foo; end; end
|
* <b>This is a difference between Kernel#set_trace_func and TracePoint.</b>
|
||||||
* trace = TracePoint.new(:call) do |tp|
|
*
|
||||||
* tp.defined_class #=> #<Class:C>
|
* class C; def self.foo; end; end
|
||||||
* end.enable do
|
* trace = TracePoint.new(:call) do |tp|
|
||||||
* C.foo
|
* p tp.defined_class #=> #<Class:C>
|
||||||
* end
|
* end.enable do
|
||||||
|
* C.foo
|
||||||
|
* end
|
||||||
*/
|
*/
|
||||||
static VALUE
|
static VALUE
|
||||||
tracepoint_attr_defined_class(VALUE tpval)
|
tracepoint_attr_defined_class(VALUE tpval)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user