Skip to content

Commit

Permalink
[Truffle] Add BasicObject#singleton_method_undefined hook for undef_m…
Browse files Browse the repository at this point in the history
…ethod
  • Loading branch information
Brandon Fish committed Sep 5, 2016
1 parent edb207a commit c87a85d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.

This file was deleted.

Expand Up @@ -1820,7 +1820,12 @@ private void undefMethod(VirtualFrame frame, DynamicObject module, String name)
raiseIfFrozenNode.execute(frame);

Layouts.MODULE.getFields(module).undefMethod(getContext(), this, name);
methodUndefinedNode.call(frame, module, "method_undefined", getSymbol(name));
if (Layouts.CLASS.isClass(module) && Layouts.CLASS.getIsSingleton(module)) {
final DynamicObject receiver = Layouts.CLASS.getAttached(module);
methodUndefinedNode.call(frame, receiver, "singleton_method_undefined", getSymbol(name));
} else {
methodUndefinedNode.call(frame, module, "method_undefined", getSymbol(name));
}
}

}
Expand Down

0 comments on commit c87a85d

Please sign in to comment.