[svn:parrot] r38382 - in trunk: runtime/parrot/library t/library

pmichaud at svn.parrot.org pmichaud at svn.parrot.org
Tue Apr 28 02:12:29 UTC 2009


Author: pmichaud
Date: Tue Apr 28 02:12:28 2009
New Revision: 38382
URL: https://trac.parrot.org/parrot/changeset/38382

Log:
[p6object]:  Update stringification of protoobjects (TT #168).

Modified:
   trunk/runtime/parrot/library/P6object.pir
   trunk/t/library/p6object.t

Modified: trunk/runtime/parrot/library/P6object.pir
==============================================================================
--- trunk/runtime/parrot/library/P6object.pir	Tue Apr 28 01:57:49 2009	(r38381)
+++ trunk/runtime/parrot/library/P6object.pir	Tue Apr 28 02:12:28 2009	(r38382)
@@ -604,7 +604,7 @@
 
 =item get_string()  (vtable method)
 
-Returns the "shortname" of the protoobject's class.
+Returns the "shortname" of the protoobject's class and parens.
 
 =cut
 
@@ -612,8 +612,10 @@
 
 .sub 'VTABLE_get_string' :method :vtable('get_string')
     $P0 = self.'HOW'()
-    $P1 = getattribute $P0, 'shortname'
-    .return ($P1)
+    $P1 = getattribute $P0, 'longname'
+    $S0 = $P1
+    $S0 = concat $S0, '()'
+    .return ($S0)
 .end
 
 =item defined()  (vtable method)

Modified: trunk/t/library/p6object.t
==============================================================================
--- trunk/t/library/p6object.t	Tue Apr 28 01:57:49 2009	(r38381)
+++ trunk/t/library/p6object.t	Tue Apr 28 02:12:28 2009	(r38382)
@@ -151,7 +151,7 @@
     is_same($P0, jklproto, 'return from .new_class =:= Foo::JKL')
     $P0 = get_hll_global 'Foo::JKL'
     isa_nok($P0, 'P6protoobject', '["Foo::JKL"]')
-    jklobj = p6obj_tests(jklproto, 'Foo::JKL', 'shortname'=>'JKL', 'isa'=>'P6object', 'can'=>'foo')
+    jklobj = p6obj_tests(jklproto, 'Foo::JKL', 'isa'=>'P6object', 'can'=>'foo')
 
     ##  add a method to a class
     $P0 = get_hll_global ['ABC'], 'foo'
@@ -201,6 +201,8 @@
     shortname = hash_default(options, 'shortname', classname)
     typename =  hash_default(options, 'typename',  classname)
 
+    shortname = concat shortname, '()'
+
     .local string msg
 
     isa_ok(proto, 'P6protoobject', classname)


More information about the parrot-commits mailing list