BackburnerJS / backburner.js

A rewrite of the Ember.js run loop as a generic microlibrary
MIT License
392 stars 80 forks source link

get `onError` only when necessary for `.run` #283

Closed bekzod closed 6 years ago

bekzod commented 6 years ago

try {} catch() finally {} and try {} catch() should probably perform equally (will try to add benchmarks for it) therefore it is better just use try {} catch() finally {}

bekzod commented 6 years ago

here is benchmark comparing try...catch https://jsperf.com/try-catch-overhead

bekzod commented 6 years ago

Either way is good i think you can close if you want

On 19 Jan 2018, at 01:00, Stefan Penner notifications@github.com wrote:

@stefanpenner commented on this pull request.

In lib/index.ts:

 this.begin();
  • if (onError) {
  • try {
  • return method.apply(target, args);
  • } catch (error) {
  • try {
  • return method.apply(target, args);
  • } catch (error) { @bekzod thoughts?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.