diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-12-22 18:22:41 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-12-24 09:25:16 -0800 |
commit | 1e0dc09f4e713228ffdf46562c54edca29c94a9f (patch) | |
tree | c81bd34be59f521b5de39171f8b95800fa19a16b /regen/feature.pl | |
parent | 9c1e343294dbe2fdb560c07570dcae32cda1a4d8 (diff) | |
download | perl-1e0dc09f4e713228ffdf46562c54edca29c94a9f.tar.gz |
feature.pm: Set bundle hints when dis/enabling features
The core does not use these hints just yet, but feature.pm can start
setting them.
Currently, the hint bits for feature bundles (CURRENT_FEATURE_BUNDLE
in feature.h) are equal to FEATURE_BUNDLE_DEFAULT (0) by default.
feature.pm sets them to FEATURE_BUNDLE_CUSTOM when modifying
hint settings.
Diffstat (limited to 'regen/feature.pl')
-rwxr-xr-x | regen/feature.pl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/regen/feature.pl b/regen/feature.pl index 2e8e8eb9a4..cf3ba35d53 100755 --- a/regen/feature.pl +++ b/regen/feature.pl @@ -535,6 +535,11 @@ sub import { if (@_ == 0) { croak("No features specified"); } + if (my $features = current_bundle) { + # Features are enabled implicitly via bundle hints + unshift @_, @$features; + $^H |= $hint_mask; + } while (@_) { my $name = shift(@_); if (substr($name, 0, 1) eq ":") { @@ -562,6 +567,13 @@ sub import { sub unimport { my $class = shift; + if (my $features = current_bundle) { + # Features are enabled implicitly via bundle hints + # Pass them to import() to put them in a form we can handle. + import(undef, @$features); + $^H |= $hint_mask; + } + # A bare C<no feature> should disable *all* features if (!@_) { delete @^H{ values(%feature) }; |