Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread of execution depends on event's listeners. #25

Open
Elergy opened this issue May 2, 2014 · 0 comments
Open

Thread of execution depends on event's listeners. #25

Elergy opened this issue May 2, 2014 · 0 comments

Comments

@Elergy
Copy link

Elergy commented May 2, 2014

If we have a few of subscribers and one of those throws an exception, our thread of execution well be interrupted.

For example:

var hub = new Mediator();
hub.on('test', function func1() { console.log(1); });
hub.on('test', function func2() { throw new Error('test error'); });
hub.on('test', function func3() { console.log(3); });

hub.trigger('test');
console.log(4);

Actual result:

1
throwing exception

Expected result:

1
3
4
and throwing exception with stacktrace
Elergy added a commit to Elergy/Mediator.js that referenced this issue May 2, 2014
Elergy added a commit to Elergy/Mediator.js that referenced this issue May 2, 2014
Elergy added a commit to Elergy/Mediator.js that referenced this issue May 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant