[js] support @:selfCall for extern methods (see #3441)