[js] initial implementation of object emitter behavior