@@ -17,12 +17,12 @@ public static void initialize() {
17
17
carp .defineExport ("EXPORT" , "carp" , "croak" , "confess" );
18
18
carp .defineExport ("EXPORT_OK" , "cluck" , "longmess" , "shortmess" );
19
19
try {
20
- carp .registerMethod ("carp" , "$" );
21
- carp .registerMethod ("croak" , "$" );
22
- carp .registerMethod ("confess" , "$" );
23
- carp .registerMethod ("cluck" , "$" );
24
- carp .registerMethod ("longmess" , "$" );
25
- carp .registerMethod ("shortmess" , "$" );
20
+ carp .registerMethod ("carp" , null );
21
+ carp .registerMethod ("croak" , null );
22
+ carp .registerMethod ("confess" , null );
23
+ carp .registerMethod ("cluck" , null );
24
+ carp .registerMethod ("longmess" , null );
25
+ carp .registerMethod ("shortmess" , null );
26
26
} catch (NoSuchMethodException e ) {
27
27
System .err .println ("Warning: Missing Carp method: " + e .getMessage ());
28
28
}
@@ -53,9 +53,6 @@ public static RuntimeList shortmess(RuntimeArray args, int ctx) {
53
53
}
54
54
55
55
private static RuntimeList warnOrDie (RuntimeArray args , int ctx , boolean die , boolean backtrace ) {
56
- if (args .size () != 1 ) {
57
- throw new IllegalStateException ("Bad number of arguments for Carp method" );
58
- }
59
56
RuntimeScalar message = args .get (0 );
60
57
String formattedMessage = message .toString ();
61
58
@@ -81,9 +78,6 @@ private static RuntimeList warnOrDie(RuntimeArray args, int ctx, boolean die, bo
81
78
}
82
79
83
80
private static RuntimeList formatMessage (RuntimeArray args , int ctx , boolean longFormat ) {
84
- if (args .size () != 1 ) {
85
- throw new IllegalStateException ("Bad number of arguments for Carp method" );
86
- }
87
81
RuntimeScalar message = args .get (0 );
88
82
String formattedMessage = longFormat
89
83
? ErrorMessageUtil .stringifyException (new Throwable (message .toString ()))
0 commit comments