-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.10: add support for restricted stashes and ISAs #1
base: master
Are you sure you want to change the base?
Conversation
lib/Class/Unload.pm
Outdated
=cut | ||
|
||
sub unload { | ||
my ($self, $class) = @_; | ||
|
||
return unless Class::Inspector->loaded( $class ); | ||
|
||
if ($class =~ /^(main|CORE|Internals|utf8|UNIVERSAL|PerlIO|re)$/) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will catch class names with trailing newlines too. Please use \A
and \z
instead of the ambiguous and flag-dependent ^
and $
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in e7712e2
#} | ||
#elsif ($was_readonly) { | ||
# Internals::SvREADONLY(%{$symtab}, 1); | ||
#} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's merely a policy question. So far I think it's easier to keep it unlocked to be able to inspect and call methods on the subclasses. perl5 will e.g. fail with AUTOLOAD and DESTROY methods being magically chained down from subclasses, only cperl can handle restricted stashes. See updated PR
Class::Inspector cannot handle it neither.
I'll force push to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in e7712e2
classes can be locked and closed. handle all cases. protect internal core stashes from being deleted.
on unloaded classes
classes can be locked and closed. handle all cases.
protect internal core stashes from being deleted.