An event listener is registered outside any als.run() scope but emitted later from inside one. Wrapping the listener with AsyncResource.bind (or const bound = asyncResource.bind(fn)) fixes a context bug. What does bind actually do?
const bound = AsyncResource.bind(myListener);
emitter.on('data', bound);