Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion macros/contexts/contextExtensions.pl
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,26 @@ sub extensionContext {
return $class;
}

#
# Trap any calls to super-class methods that aren't in the overridden
# class and pass them on to the original class.
#
sub AUTOLOAD {
our $AUTOLOAD;
my $self = shift;
return unless defined $self;
my $class = $self->extensionContext;
my $method = (split(/::/, $AUTOLOAD))[-1];
return if $method eq 'DESTROY';

if (substr($AUTOLOAD, 0, length($class) + 2) eq $class . '::') {
my $code = $self->super($method);
return &$code($self, @_) if $code;
}

die "Can't locate object method '$method' via package \"" . ref($self) . (getCaller() // '');
}

#################################################################################################
#################################################################################################

Expand Down Expand Up @@ -538,7 +558,10 @@ package context::Extensions::Data;
#
# Get the object's extensionData
#
sub extensionData { (shift)->typeRef->{ $self->extensionID } }
sub extensionData {
my $self = shift;
$self->typeRef->{ $self->extensionID };
}

#
# Set the object's extensionData (and the rest of its type)
Expand Down
Loading