tree/directive.js: fix incorrect accept() code

Fixes #2191.