The implementation in portage-2.1.9.40 does [[ -z $DOCS ]] while PMS section 10.1.9 says it should do ! declare -p DOCS.
This is fixed in git: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cba45f5b8f7d38993c7e93050a3771fd57fa8564
This is fixed in 2.1.9.41 and 2.2.0_alpha25.