Skip to content

Commit 2465f46

Browse files
committed
Use same context when creating a new context::Fraction::Parser::Number
When creating a context::Fraction::Parser::Number, use the same context as the original object instead of the current context. This fixes issue #1337 with checking if an object created in the fraction context is equal to a number after the context has changed. This fix is by @dpvc.
1 parent 9dbb09a commit 2465f46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

macros/contexts/contextFraction.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ package context::Fraction::Parser::Number;
781781

782782
sub new {
783783
my $self = shift;
784-
my $num = &{ $self->super('new') }($self, @_);
784+
my $num = &{ $self->super('new', $_[0]->context) }($self, @_);
785785
$num->setExtensionClass('INTEGER') if $num->{value_string} =~ m/^[-+]?[0-9]+$/;
786786
return $num->mutate;
787787
}

0 commit comments

Comments
 (0)