From: Dave Rolsky Date: Sat, 17 Jul 2010 16:04:48 +0000 (-0500) Subject: Quote all init_args X-Git-Tag: v0.10~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-StrictConstructor.git;a=commitdiff_plain;h=79b37c7d64fd8e6a3b667b3df3a9024eb7bb2e4a Quote all init_args --- diff --git a/Changes b/Changes index 811bda7..168535c 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,8 @@ - Ignore __INSTANCE__ when passed to the constructor. Patch by Jesse Luehrs. RT #59236. +- All init args are quoted in the inlined constructor. + 0.09 2010-07-14 diff --git a/lib/MooseX/StrictConstructor/Role/Meta/Method/Constructor.pm b/lib/MooseX/StrictConstructor/Role/Meta/Method/Constructor.pm index 4000083..1dd2142 100644 --- a/lib/MooseX/StrictConstructor/Role/Meta/Method/Constructor.pm +++ b/lib/MooseX/StrictConstructor/Role/Meta/Method/Constructor.pm @@ -3,6 +3,7 @@ package MooseX::StrictConstructor::Role::Meta::Method::Constructor; use strict; use warnings; +use B (); use Carp (); use Moose::Role; @@ -15,8 +16,8 @@ around '_generate_BUILDALL' => sub { $source .= ";\n" if $source; my @attrs = ( - "__INSTANCE__ => 1", - map {"$_ => 1,"} + "__INSTANCE__ => 1,", + map { B::perlstring($_) . ' => 1,' } grep {defined} map { $_->init_arg() } @{ $self->_attributes() } );