Skip to content

Allow overriden functions in mixins to receive the original function as an argument #6150

@mark-friedman

Description

@mark-friedman

Is your feature request related to a problem? Please describe.

It's difficult to create and use mixins which want to extend the behavior of existing functions in a block.

Describe the solution you'd like

I'd like for functions in mixins which override existing functions in the block to receive the original, overridden function as an argument. That would allow the mixin to better combine its behavior with the original blocks behavior by deciding whether and when to call the original function.

This feature would, presumably, only useful when opt_disableCheck is true, so the extra argument could be added only in that situation.

Additionally, there should probably be a way to add the opt_disableCheck flag to the extensions key of a Block's JSON descriptor so that you can use this feature without having to add the mixin imperatively via the Block.mixin() function.

Describe alternatives you've considered

I considered asking for something like the CLOS :before, :after and :around method specifiers (this feature request is basically just adding the :around specifier), but I'm not sure it's worth it.

Additional context

Note that there is some similarity of this issue to issue #4767, but it's not quite the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: feature requestDescribes a new feature and why it should be added

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions