From: dpvc v. a. <we...@ma...> - 2005-07-03 20:08:30
|
Log Message: ----------- Fixed a bug in the enable/disable routines that would cause them to always work on the current context rather than the one whose enable/disable method was being called. Modified Files: -------------- pg/lib/Parser/Context: Functions.pm Revision Data ------------- Index: Functions.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/Context/Functions.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -Llib/Parser/Context/Functions.pm -Llib/Parser/Context/Functions.pm -u -r1.5 -r1.6 --- lib/Parser/Context/Functions.pm +++ lib/Parser/Context/Functions.pm @@ -55,9 +55,9 @@ sub disable {Disable(@_)} sub Disable { - shift if ref($_[0]) ne ""; # pop off the $self reference - my @names = @_; my ($list,$name); my $context = Parser::Context->current; + if (ref($_[0]) ne "") {$context = (shift)->{context}} + my @names = @_; my ($list,$name); while ($name = shift(@names)) { $list = $Category{$name}; $list = [$name] if !$list && $context->{functions}{$name}; @@ -70,9 +70,9 @@ sub enable {Enable(@_)} sub Enable { - shift if ref($_[0]) ne ""; # pop off the $self reference - my @names = @_; my ($list,$name); my $context = Parser::Context->current; + if (ref($_[0]) ne "") {$context = (shift)->{context}} + my @names = @_; my ($list,$name); while ($name = shift(@names)) { $list = $Category{$name}; $list = [$name] if !$list && $context->{functions}{$name}; |