sub linearized_isa;
-sub new_object {
- my $self = shift;
- my %args = (@_ == 1 ? %{$_[0]} : @_);
-
- my $object = bless {}, $self->name;
-
- $self->_initialize_object($object, \%args);
- return $object;
-}
+sub new_object;
sub clone_object {
my $class = shift;
return values %attrs;
}
+sub new_object {
+ my $self = shift;
+ my %args = (@_ == 1 ? %{$_[0]} : @_);
+
+ my $object = bless {}, $self->name;
+
+ $self->_initialize_object($object, \%args);
+ return $object;
+}
+
sub _initialize_object{
my($self, $object, $args, $ignore_triggers) = @_;
package Mouse::Util;
use Mouse::Exporter; # enables strict and warnings
+sub get_linear_isa($;$); # must be here
+
BEGIN{
# Because Mouse::Util is loaded first in all the Mouse sub-modules,
# XS loader is placed here, not in Mouse.pm.
} else {
# VVVVV CODE TAKEN FROM MRO::COMPAT VVVVV
my $_get_linear_isa_dfs; # this recurses so it isn't pretty
- $_get_linear_isa_dfs = sub {
+ $_get_linear_isa_dfs = sub ($;$){
no strict 'refs';
my $classname = shift;
}
}
-
- no warnings 'once';
*get_linear_isa = $get_linear_isa;
}
return 0 if ref($class);
return 0 unless defined($class);
- return 1 if $class =~ /^\w+(?:::\w+)*$/;
+ return 1 if $class =~ /\A \w+ (?: :: \w+ )* \z/xms;
return 0;
}
}
SV*
-new_object_(SV* meta, ...)
+new_object(SV* meta, ...)
CODE:
{
AV* const xc = mouse_get_xc(aTHX_ meta);
RETVAL = mouse_instance_create(aTHX_ MOUSE_xc_stash(xc));
mouse_class_initialize_object(aTHX_ meta, RETVAL, args, FALSE);
}
-
+OUTPUT:
+ RETVAL
void
_initialize_object(SV* meta, SV* object, HV* args, bool ignore_triggers = FALSE)