Skip to content

CanvasVisibility#testVisibility return value isn't strictly boolean #8202

Description

@Fyorl

Originally reported by Wasp#2005 https://discord.com/channels/170995199584108546/956306859491471420/1019723643724513312

ALL MODULES DISABLED? true
OS, Hosting, Browser (if applicable): Windows, NodeJS, Chrome
Short Description of bug: CanvasVisibility#testVisibility returns void if test fails, which could result in unintended behavior for downstream modules
Simple steps to reproduce the bug:

  1. Create a token and hide it on the GM side
  2. Log in as a player with visibility on the scene
  3. Run canvas.effects.visibility.testVisibility(canvas.tokens.placeables[0].center, { object: canvas.tokens.placeables[0] }); in the console
  4. It returns undefined instead of false

Screenshots and/or console errors:

image

Activity

  1. Fyorl commented on Sep 16, 2022

    @Fyorl
    ContributorAuthor

    We don't tend to exhaustively document void returns, but at least in this case I don't think it will be too much trouble to guarantee a boolean return.

  2. self-assigned this
    on Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Fields

Priority

None yet

Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions