[svn:parrot] r43451 - branches/pge_no_namespace_methods/src

chromatic at svn.parrot.org chromatic at svn.parrot.org
Thu Jan 14 08:09:56 UTC 2010


Author: chromatic
Date: Thu Jan 14 08:09:55 2010
New Revision: 43451
URL: https://trac.parrot.org/parrot/changeset/43451

Log:
[src] Made fetching a method from a NameSpace throw an exception.  This is a
temporary patch to help pmichaud and I revise PGE and TGE not to fetch methods
directly from namespaces.  When TT #389 gets fixed, that won't work.

Remember not to merge this commit back to trunk.

Modified:
   branches/pge_no_namespace_methods/src/global.c

Modified: branches/pge_no_namespace_methods/src/global.c
==============================================================================
--- branches/pge_no_namespace_methods/src/global.c	Thu Jan 14 08:06:31 2010	(r43450)
+++ branches/pge_no_namespace_methods/src/global.c	Thu Jan 14 08:09:55 2010	(r43451)
@@ -655,6 +655,15 @@
     res = Parrot_find_global_n(interp, ns, globalname);
     if (!res)
         res = PMCNULL;
+    else if (res->vtable->base_type == enum_class_Sub) {
+        Parrot_Sub_attributes *sub;
+        PMC_get_sub(interp, res, sub);
+
+        if (sub->comp_flags & SUB_COMP_FLAG_METHOD) {
+            Parrot_ex_throw_from_c_args(interp, next, EXCEPTION_SYNTAX_ERROR,
+                "Fetching method from NS");
+        }
+    }
 
     return res;
 }


More information about the parrot-commits mailing list