Oh...that's a bit confusing. What should I use in my template if I want to hide the frame elements containing the TOC, if there's no actual TOC present? Is there an existing function for this?
ETA: Okay, I think I figured this out. The comments in the function seem to indicate the opposite of what actually happens:
* @param bool $return Should the TOC be returned instead to be printed?
This defaults to false, and the language of the comment in code suggests that it should be "true" if the TOC should be "returned to be printed".
False returns the TOC;
True does not, and instead returns a string of the TOC content. I think this should be more clear in the source code.