From 2465f46e560abfafa25df212a61a9a19b0faebb7 Mon Sep 17 00:00:00 2001 From: Jaimos Skriletz Date: Thu, 6 Nov 2025 09:30:00 -0700 Subject: [PATCH] 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. --- macros/contexts/contextFraction.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros/contexts/contextFraction.pl b/macros/contexts/contextFraction.pl index 539db4e3e..4c559b523 100644 --- a/macros/contexts/contextFraction.pl +++ b/macros/contexts/contextFraction.pl @@ -781,7 +781,7 @@ package context::Fraction::Parser::Number; sub new { my $self = shift; - my $num = &{ $self->super('new') }($self, @_); + my $num = &{ $self->super('new', $_[0]->context) }($self, @_); $num->setExtensionClass('INTEGER') if $num->{value_string} =~ m/^[-+]?[0-9]+$/; return $num->mutate; }