[svn:parrot] r45827 - in trunk: src/pmc t/compilers/imcc/syn t/pmc

allison at svn.parrot.org allison at svn.parrot.org
Tue Apr 20 19:04:54 UTC 2010


Author: allison
Date: Tue Apr 20 19:04:53 2010
New Revision: 45827
URL: https://trac.parrot.org/parrot/changeset/45827

Log:
[cage] Apply final fix for TT #389, methods are no longer stored in
the namespace. Closing ticket.

Modified:
   trunk/src/pmc/namespace.pmc
   trunk/t/compilers/imcc/syn/subflags.t
   trunk/t/pmc/namespace-subs.t

Modified: trunk/src/pmc/namespace.pmc
==============================================================================
--- trunk/src/pmc/namespace.pmc	Tue Apr 20 18:39:13 2010	(r45826)
+++ trunk/src/pmc/namespace.pmc	Tue Apr 20 19:04:53 2010	(r45827)
@@ -132,6 +132,7 @@
     PMC              * const classobj = VTABLE_get_class(interp, self);
     STRING           * vtable_key     = STRINGNULL;
     Parrot_Sub_attributes *sub;
+    INTVAL stored = 0;
 
     PMC_get_sub(interp, value, sub);
 
@@ -156,6 +157,8 @@
             /* Insert it. */
             VTABLE_set_pmc_keyed_int(interp, vtable, sub->vtable_index, value);
         }
+        if (!(sub->comp_flags & SUB_COMP_FLAG_NSENTRY))
+            stored = 1;
     }
 
     if (sub->comp_flags & SUB_COMP_FLAG_METHOD) {
@@ -170,9 +173,12 @@
             method_name = sub->method_name;
         }
         add_to_class(interp, nsinfo, classobj, method_name, value);
+
+        if (!(sub->comp_flags & SUB_COMP_FLAG_NSENTRY))
+            stored = 1;
     }
 
-    return 0;
+    return stored;
 }
 
 PARROT_WARN_UNUSED_RESULT

Modified: trunk/t/compilers/imcc/syn/subflags.t
==============================================================================
--- trunk/t/compilers/imcc/syn/subflags.t	Tue Apr 20 18:39:13 2010	(r45826)
+++ trunk/t/compilers/imcc/syn/subflags.t	Tue Apr 20 19:04:53 2010	(r45827)
@@ -69,7 +69,7 @@
     isa_ok($P30, 'Sub', ":method sub found w/.const")
     $P0 = get_global 'method1'
     $I0 = isnull $P0
-    todo($I0, ":method sub not found in namespace")
+    ok($I0, ":method sub not found in namespace")
 
     ## :subid subs
     .const 'Sub' $P40 = 'subid1'

Modified: trunk/t/pmc/namespace-subs.t
==============================================================================
--- trunk/t/pmc/namespace-subs.t	Tue Apr 20 18:39:13 2010	(r45826)
+++ trunk/t/pmc/namespace-subs.t	Tue Apr 20 19:04:53 2010	(r45827)
@@ -73,8 +73,7 @@
     is($I1, 75, "Invoked stored method")
 
     $P2 = get_hll_global ['MethodTest'], 'methodtest'
-    todo(0, "Method not stored in namespace", "see TT #389")
-#    is_null($P2, "Method not stored in namespace")
+    is_null($P2, "Method not stored in namespace")
 .end
 
 .sub 'store_nsentry'


More information about the parrot-commits mailing list