Skip to content

Commit

Permalink
Merge pull request #633 from kachick/implement-kernel-__callee__
Browse files Browse the repository at this point in the history
Implement Kernel#__callee__
  • Loading branch information
alex committed Apr 19, 2013
2 parents 6d108ef + ca5a51d commit 8bd0c53
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 0 additions & 3 deletions spec/tags/core/kernel/__callee___tags.txt
@@ -1,9 +1,6 @@
fails:Kernel.__callee__ returns the current method, even when aliased
fails:Kernel.__callee__ returns the original name when aliased method
fails:Kernel.__callee__ returns the caller from blocks too fails:Kernel.__callee__ returns the caller from blocks too
fails:Kernel.__callee__ returns the caller from define_method too fails:Kernel.__callee__ returns the caller from define_method too
fails:Kernel.__callee__ returns the caller from block inside define_method too fails:Kernel.__callee__ returns the caller from block inside define_method too
fails:Kernel.__callee__ returns the caller from a define_method called from the same class fails:Kernel.__callee__ returns the caller from a define_method called from the same class
fails:Kernel.__callee__ returns method name even from eval fails:Kernel.__callee__ returns method name even from eval
fails:Kernel.__callee__ returns nil when not called from a method fails:Kernel.__callee__ returns nil when not called from a method
fails:Kernel.__callee__ returns the caller when sent as a string
1 change: 1 addition & 0 deletions topaz/modules/kernel.py
Expand Up @@ -162,6 +162,7 @@ def method_binding(self, space):
return space.newbinding_fromframe(space.getexecutioncontext().gettoprubyframe()) return space.newbinding_fromframe(space.getexecutioncontext().gettoprubyframe())


@moduledef.function("__method__") @moduledef.function("__method__")
@moduledef.function("__callee__")
def method_method(self, space): def method_method(self, space):
frame = space.getexecutioncontext().gettoprubyframe() frame = space.getexecutioncontext().gettoprubyframe()
return space.newsymbol(frame.bytecode.name) return space.newsymbol(frame.bytecode.name)
Expand Down

0 comments on commit 8bd0c53

Please sign in to comment.