The maxRecursion parameter is reduced by one in each recursive call. The intention is to raise an exception when it drops below zero. This currently doesn't work because maxRecursion is reset to 3 whenever it is below zero.
This pull request fixes the problem by only setting maxRecursion = 3 when the parameter was undefined. It also adds a test to ensure that maxRecursion actually works now.
The
maxRecursion
parameter is reduced by one in each recursive call. The intention is to raise an exception when it drops below zero. This currently doesn't work becausemaxRecursion
is reset to 3 whenever it is below zero.This pull request fixes the problem by only setting
maxRecursion = 3
when the parameter was undefined. It also adds a test to ensure thatmaxRecursion
actually works now.