How do I address an object value in a whose clause in AppleScript
Use its or of it, like this:

tell application "TextEdit"
    set theDoc to document of window 1
    get every window whose its document is theDoc
    -- or --&gt; get every window whose document of it is theDoc
end tell