Author: leo
Date: Sun Jul 31 07:38:08 2005
New Revision: 8757
Added:
branches/leo-ctx5/classes/super.pmc (contents, props changed)
- copied, changed from r8756, trunk/classes/super.pmc
Modified:
branches/leo-ctx5/MANIFEST
branches/leo-ctx5/t/pmc/object-meths.t
Log:
merge -r8755:8756 from trunk; adjust Super.find_method
Modified: branches/leo-ctx5/MANIFEST
==============================================================================
--- branches/leo-ctx5/MANIFEST (original)
+++ branches/leo-ctx5/MANIFEST Sun Jul 31 07:38:08 2005
@@ -124,6 +124,7 @@ classes/slice.pmc
classes/string.pmc []
classes/stringarray.pmc []
classes/sub.pmc []
+classes/super.pmc []
classes/timer.pmc []
classes/tqueue.pmc []
classes/undef.pmc []
Copied: branches/leo-ctx5/classes/super.pmc (from r8756,
trunk/classes/super.pmc)
==============================================================================
--- trunk/classes/super.pmc (original)
+++ branches/leo-ctx5/classes/super.pmc Sun Jul 31 07:38:08 2005
@@ -102,7 +102,7 @@ Find the method for C<*name> in the pare
real_exception(INTERP, NULL, E_TypeError,
"no object bound to super");
}
- interpreter->ctx.current_object = obj;
+ interpreter->current_object = obj;
mro = obj->vtable->mro;
class = VTABLE_get_pmc_keyed_int(INTERP, mro, 1);
return VTABLE_find_method(INTERP, class, name);
Modified: branches/leo-ctx5/t/pmc/object-meths.t
==============================================================================
--- branches/leo-ctx5/t/pmc/object-meths.t (original)
+++ branches/leo-ctx5/t/pmc/object-meths.t Sun Jul 31 07:38:08 2005
@@ -16,7 +16,7 @@ Tests PMC object methods.
=cut
-use Parrot::Test tests => 30;
+use Parrot::Test tests => 31;
use Test::More;
output_like(<<'CODE', <<'OUTPUT', "callmethod - unknown method");
@@ -974,4 +974,34 @@ CODE
foofoo
OUTPUT
+pir_output_is(<<'CODE', <<'OUTPUT', "super 1");
+.sub main @MAIN
+ .local pmc o, cl
+ cl = newclass 'Parent'
+ cl = subclass cl, 'Child'
+ o = new 'Child'
+ o."foo"()
+.end
+
+.namespace ['Parent']
+.sub foo method
+ print "Parent foo\n"
+ self."bar"()
+.end
+.sub bar method
+ print "Parent bar\n"
+.end
+
+.namespace ['Child']
+.sub foo method
+ print "Child foo\n"
+ .local pmc s
+ s = new .Super, self
+ s."foo"()
+.end
+CODE
+Child foo
+Parent foo
+Parent bar
+OUTPUT