Skip Menu |

This queue is for tickets about the MooseX-Event CPAN distribution.

Report information
The Basics
Id: 73923
Status: resolved
Priority: 0/
Queue: MooseX-Event

People
Owner: WINTER [...] cpan.org
Requestors: rod.taylor [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: v0.2.0
Fixed in: (no value)



Subject: Once drops arguments
Once() seems to lose both the arguments and callers $self that was being called; on does not. Please see attached which creates the below output. Got event 'one' in Bar Watch via on, in Bar, from Foo, Args: $VAR1 = [ 'arg' ]; Got event 'one' in Bar Watch via once, in Bar, from , Args: $VAR1 = [];
Subject: failed_once.pl
use v5.12.4; package Foo; use MooseX::Event; has_events qw{one}; sub BUILD { my $self = shift; return; } package Bar; use Moose; use Data::Dumper; has foopack => (is => 'rw', isa => 'Foo', handles => [qw{on once emit}]); sub BUILD { my $self = shift; $self->on(one => sub {$self->someFunc('on', @_)}); $self->once(one => sub {$self->someFunc('once', @_)}); return; } sub someFunc { my ($self, $watchType, $emitObj, @args) = @_; say "Got event 'one' in Bar"; printf("Watch via %s, in %s, from %s, Args: %s\n", $watchType, ref $self, ref $emitObj, Data::Dumper::Dumper(\@args)); return; } package main; my $foo = Foo->new(); my $bar = Bar->new(foopack => $foo); $foo->emit(one => 'arg');
This is fixed as of MooseX-Event-0.3.0_2