Skip to content
Permalink
Browse files

Merge pull request #701 from krekoten/bo_method_missing

BasicObject#method_missing works after removal
  • Loading branch information
alex committed May 14, 2013
2 parents 3a7b62a + f5f0bde commit e6911a38af30cdc1faccd34ce9f151b494cfde1d
Showing with 8 additions and 4 deletions.
  1. +0 −1 spec/tags/core/basicobject/basicobject_tags.txt
  2. +8 −3 topaz/objspace.py
@@ -1,4 +1,3 @@
fails:BasicObject raises NoMethodError for nonexistent methods after #method_missing is removed
fails:BasicObject raises NameError when referencing built-in constants
fails:BasicObject does not define built-in constants (according to defined?)
fails:BasicObject includes itself in its list of constants
@@ -585,9 +585,14 @@ def send_super(self, w_cls, w_receiver, name, args_w, block=None):
def _send_raw(self, name, raw_method, w_receiver, w_cls, args_w, block):
if raw_method is None:
method_missing = w_cls.find_method(self, "method_missing")
assert method_missing is not None
args_w.insert(0, self.newsymbol(name))
return method_missing.call(self, w_receiver, args_w, block)
if method_missing is None:
class_name = self.str_w(self.send(w_cls, "to_s"))
raise self.error(self.w_NoMethodError,
"undefined method `%s' for %s" % (name, class_name)
)
else:
args_w.insert(0, self.newsymbol(name))
return method_missing.call(self, w_receiver, args_w, block)
return raw_method.call(self, w_receiver, args_w, block)

def respond_to(self, w_receiver, name):

0 comments on commit e6911a3

Please sign in to comment.
You can’t perform that action at this time.