Skip to content

Commit

Permalink
Improve state scope check, see #193
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Aug 18, 2020
1 parent a8574eb commit 4b92a38
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions js/Tandem.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,16 @@ class Tandem {
}
}

/**
* Returns true if this Tandem has the specified ancestor Tandem.
* @param ancestor
* @returns {boolean}
* @public
*/
hasAncestor( ancestor ) {
return this.parentTandem === ancestor || ( this.parentTandem && this.parentTandem.hasAncestor( ancestor ) );
}

/**
* Removes a PhetioObject and signifies to listeners that it has been removed.
* @param {PhetioObject} phetioObject
Expand Down

0 comments on commit 4b92a38

Please sign in to comment.