From: Jesse Luehrs Date: Sat, 7 May 2011 19:48:00 +0000 (-0500) Subject: setting weaken should be based on the passed in cache value X-Git-Tag: 2.0100~120 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=85db9063790a152f0b6f4a29cb9dc0955acaffcd;p=gitmo%2FMoose.git setting weaken should be based on the passed in cache value --- diff --git a/lib/Class/MOP/Package.pm b/lib/Class/MOP/Package.pm index cca1cb6..062706f 100644 --- a/lib/Class/MOP/Package.pm +++ b/lib/Class/MOP/Package.pm @@ -96,6 +96,7 @@ sub create { my ($class, %options) = @_; my $cache_ok = delete $options{cache}; + $options{weaken} = !$cache_ok unless exists $options{weaken}; my $cache_key; if ($cache_ok) { @@ -109,8 +110,6 @@ sub create { } } - $options{weaken} = !$cache_ok unless exists $options{weaken}; - my $package_name = $class->_anon_package_prefix . ++$ANON_SERIAL; my $meta = $class->create($package_name, %options);