Refactor #3985: arguments length check replaced by undefined check