patches.js: fix: ancestors and descendants