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

Support wrapping subs with prototypes #6

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

Commits on Apr 4, 2019

  1. support wrapping subs with prototypes

    While Class::Method::Modifiers is primarily meant to wrap methods, it
    can also be used to wrap functions.  Functions may have prototypes, so
    it would be better if they could maintained in the wrapper.
    
    This works similarly to the lvalue attribute.  If a before or after is
    applied, the wrapper takes its prototype from the sub being wrapped.  If
    an around is applied, the modifier sub's prototype is used.  This is
    rather strange for arounds, as the parameters it is passed will still
    include the wrapped sub as the first parameter, so the parameters won't
    match the prototype exactly.  Even with that oddness, it still seems to
    be the best option.  This also means an around could change the
    prototype, which will throw warnings.
    haarg committed Apr 4, 2019
    Configuration menu
    Copy the full SHA
    5ed8d18 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2e6e9ef View commit details
    Browse the repository at this point in the history