Skip to content

Commit

Permalink
Item14237: Made callback() \%params argument optional
Browse files Browse the repository at this point in the history
  • Loading branch information
vrurg committed Oct 16, 2017
1 parent 01eaba7 commit c9dae73
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/lib/Foswiki/Util/Callbacks.pm
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ sub deregisterCallback {

=begin TML
---+++ ObjectMethod callback($name, \%params)
---+++ ObjectMethod callback( $name [, \%params] )
Execute a callback defined by =$name=. Reference to =%params= is passed over
to registered callback subs in =params= profile key.
Expand All @@ -410,6 +410,7 @@ sub callback {
my ( $name, $params ) = @_;

$name = caller . "::$name" unless $name =~ /::/;
$params //= {};

ASSERT( $_registeredCBNames{$name}, "unknown callback '$name'" );
ASSERT( ref($params) eq 'HASH', "callback params must be a hashref" );
Expand Down

0 comments on commit c9dae73

Please sign in to comment.