[svn:parrot] r41823 - branches/pcc_reapply/src/call

allison at svn.parrot.org allison at svn.parrot.org
Sun Oct 11 09:41:27 UTC 2009


Author: allison
Date: Sun Oct 11 09:41:25 2009
New Revision: 41823
URL: https://trac.parrot.org/parrot/changeset/41823

Log:
[pcc] Turn on named parameter count checking again, with a smaller restriction
to duplicate the behavior of an old bug.

Modified:
   branches/pcc_reapply/src/call/args.c

Modified: branches/pcc_reapply/src/call/args.c
==============================================================================
--- branches/pcc_reapply/src/call/args.c	Sun Oct 11 09:25:00 2009	(r41822)
+++ branches/pcc_reapply/src/call/args.c	Sun Oct 11 09:41:25 2009	(r41823)
@@ -1265,17 +1265,21 @@
         param_index++;
     }
 
-    return; /* NO ERROR CHECKING for extra named parameters */
-#if 0
     /* Double check that all named arguments were assigned to parameters. */
     if (err_check) {
         PMC *named_arg_list = VTABLE_get_attr_str(interp, call_object, CONST_STRING(interp, "named"));
         if (!PMC_IS_NULL(named_arg_list)) {
             INTVAL named_arg_count = VTABLE_elements(interp, named_arg_list);
             if (PMC_IS_NULL(named_used_list))
-                    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                            "too many named arguments: %d passed, 0 used",
-                            named_arg_count);
+                return;
+                /* The 'return' above is a temporary hack to duplicate an old bug,
+                 * and will be replaced by the exception below at the next
+                 * deprecation point, see TT #1103
+
+                Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                        "too many named arguments: %d passed, 0 used",
+                        named_arg_count);
+                 */
             if (named_arg_count > named_count) {
                 /* At this point we know we have named arguments that weren't
                  * assigned to parameters. We're going to throw an exception
@@ -1303,7 +1307,6 @@
             }
         }
     }
-#endif
 }
 
 /*


More information about the parrot-commits mailing list