Skip to content

Commit

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

This file was deleted.

Expand Up @@ -1745,7 +1745,12 @@ private void removeMethod(VirtualFrame frame, DynamicObject module, String name)

if (Layouts.MODULE.getFields(module).getMethod(name) != null) {
Layouts.MODULE.getFields(module).removeMethod(name);
methodRemovedNode.call(frame, module, "method_removed", getSymbol(name));
if(Layouts.CLASS.isClass(module) && Layouts.CLASS.getIsSingleton(module)){
final DynamicObject receiver = Layouts.CLASS.getAttached(module);
methodRemovedNode.call(frame, receiver, "singleton_method_removed", getSymbol(name));
} else {
methodRemovedNode.call(frame, module, "method_removed", getSymbol(name));
}
} else {
errorProfile.enter();
throw new RaiseException(coreExceptions().nameErrorMethodNotDefinedIn(module, name, this));
Expand Down

0 comments on commit edb207a

Please sign in to comment.