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

Owner: WINTER [...]
Requestors: rod.taylor [...]

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

Subject: Once drops arguments
Download (untitled) / with headers
text/plain 321b
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 = [];
text/x-perl 714b
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

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to