Mercurial > pub > Impl
diff Lib/IMPL/Class/Property/Direct.pm @ 52:15d720913562
security in work
author | wizard@linux-odin.local |
---|---|
date | Tue, 02 Mar 2010 20:12:02 +0300 |
parents | 16ada169ca75 |
children | 609b59c9f03c |
line wrap: on
line diff
--- a/Lib/IMPL/Class/Property/Direct.pm Mon Mar 01 17:25:36 2010 +0300 +++ b/Lib/IMPL/Class/Property/Direct.pm Tue Mar 02 20:12:02 2010 +0300 @@ -22,8 +22,8 @@ my $accessor_set_no = 'die new IMPL::Exception(\'The property is read only\',$name,$class) unless $set;'; my $accessor_set = 'return( $this->{$field} = @_ == 1 ? $_[0] : [@_] );'; my $accessor_get = 'return( $this->{$field} );'; -my $list_accessor_set = 'return( @{ ($this->{$field} = ( (@_ == 1 and ref $_[0] eq \'ARRAY\') ? $_[0] : [@_] ) || [] ) } );'; -my $list_accessor_get = 'return( @{ $this->{$field} || [] } );'; +my $list_accessor_set = 'return( @{ ($this->{$field} = IMPL::Object::List->new( ( (@_ == 1 and ref $_[0] eq \'ARRAY\') ? $_[0] : [@_] ) || [] ) } );'; +my $list_accessor_get = 'return( @{ $this->{$field} ? $this->{$field} : $this->{$field} = IMPL::Object::List->new() } );'; my $custom_accessor_get = 'unshift @_, $this and goto &$get;'; my $custom_accessor_set = 'unshift @_, $this and goto &$set;';