JS backend: support for explicit delegation, fixes after review