Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rurban
Copy link

@rurban rurban commented Feb 18, 2017

classes can be locked and closed. handle all cases.
protect internal core stashes from being deleted.

=cut

sub unload {
my ($self, $class) = @_;

return unless Class::Inspector->loaded( $class );

if ($class =~ /^(main|CORE|Internals|utf8|UNIVERSAL|PerlIO|re)$/) {
Copy link
Owner

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 $.

Copy link
Author

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);
#}
Copy link
Owner

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?

Copy link
Author

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.

Copy link
Author

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants