Fix a typo
[gitmo/Mouse.git] / xs-src / MouseUtil.xs
index 8704d89..92fa676 100644 (file)
@@ -91,8 +91,6 @@ mouse_throw_error(SV* const metaobject, SV* const data /* not used */, const cha
     va_list args;
     SV* message;
 
-    PERL_UNUSED_ARG(data); /* for moose-compat */
-
     assert(metaobject);
     assert(fmt);
 
@@ -103,13 +101,17 @@ mouse_throw_error(SV* const metaobject, SV* const data /* not used */, const cha
     {
         dSP;
         PUSHMARK(SP);
-        EXTEND(SP, 4);
+        EXTEND(SP, 6);
 
         PUSHs(metaobject);
         mPUSHs(message);
 
-        mPUSHs(newSVpvs("depth"));
-        mPUSHi(-1);
+        if(data){ /* extra arg, might be useful for debugging */
+            mPUSHs(newSVpvs("data"));
+            PUSHs(data);
+            mPUSHs(newSVpvs("depth"));
+            mPUSHi(-1);
+        }
 
         PUTBACK;