diff --git a/src/classes/ClassHOW.pir b/src/classes/ClassHOW.pir index 294eda15521..53510d048bf 100644 --- a/src/classes/ClassHOW.pir +++ b/src/classes/ClassHOW.pir @@ -481,6 +481,19 @@ Accessor for hidden property. .return ($P0) .end + +=item add_method + +=cut + +.sub 'add_method' :method + .param pmc obj + .param string name + .param pmc meth + $P0 = getattribute self, 'parrotclass' + addmethod $P0, name, meth +.end + =back =cut diff --git a/src/parrot/Protoobject.pir b/src/parrot/Protoobject.pir index 2957d57e02a..8fecfc4e8d9 100644 --- a/src/parrot/Protoobject.pir +++ b/src/parrot/Protoobject.pir @@ -134,14 +134,14 @@ Indicate that objects in the class are mutable or immutable. .sub '!IMMUTABLE' :method $P0 = get_root_global [.RAKUDO_HLL ; 'Int'], 'Scalar' $P1 = self.'HOW'() - $P1.'add_method'('Scalar', $P0, 'to'=>self) + $P1.'add_method'(self, 'Scalar', $P0) .end .namespace ['P6protoobject'] .sub '!MUTABLE' :method $P0 = get_root_global [.RAKUDO_HLL ; 'Perl6Object'], 'Scalar' $P1 = self.'HOW'() - $P1.'add_method'('Scalar', $P0, 'to'=>self) + $P1.'add_method'(self, 'Scalar', $P0) .end =back