summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-06-25 15:11:32 -0400
committerJesse Luehrs <doy@tozt.net>2013-06-25 15:11:32 -0400
commit4057cb05c89bc4ba1a561c21e840885ad38975c8 (patch)
tree0e356fbf236a627f09740676f7724ba0dfb15889
parent4557c62c6c1b120e553fb3ef2dad8a7655013b7b (diff)
downloadclass-refresh-4057cb05c89bc4ba1a561c21e840885ad38975c8.tar.gz
class-refresh-4057cb05c89bc4ba1a561c21e840885ad38975c8.zip
nope, don't want to do this
this meant that modules that we hadn't seen before were always assumed to have changed, which can cause arbitrary (and possibly dangerous) modules to be reloaded. this can happen when you call ->refresh, then load a module, then call ->refresh again. in this case, there's no way to tell if the module has been modified since it was loaded, which means that we have to assume one way or the other. assuming that it hasn't can cause changes to be missed when ->refresh is called, but assuming that it has can cause modules (such as Moose) to be reloaded when we really can't support it.
-rw-r--r--lib/Class/Refresh.pm6
1 files changed, 0 insertions, 6 deletions
diff --git a/lib/Class/Refresh.pm b/lib/Class/Refresh.pm
index 2cbf0ca..24569ab 100644
--- a/lib/Class/Refresh.pm
+++ b/lib/Class/Refresh.pm
@@ -74,11 +74,6 @@ Returns a list of modules which have changed since the last call to C<refresh>.
sub modified_modules {
my $class = shift;
- if (!%CACHE) {
- $class->_update_cache_for($_) for keys %INC;
- return;
- }
-
my @ret;
for my $file (keys %CACHE) {
# refresh files that are in our
@@ -94,7 +89,6 @@ sub modified_modules {
}
else {
$class->_update_cache_for($file);
- push @ret, $class->_file_to_mod($file);
}
}