foam-framework / foam

Feature-Oriented Active Modeller
Apache License 2.0
787 stars 55 forks source link

Get rid of UNSUBSCRIBE_EXCEPTION #528

Open adamvy-google opened 8 years ago

adamvy-google commented 8 years ago

Use some programatic means of unsubscribing.

kgrgreer commented 8 years ago

Pass subscription or subscription destructor as extra argument to listeners so that they can easily unsubscribe without throwing an Exception. Will avoid the use of non-error Exceptions and will be faster because try/catch blocks disable V8 JIT.

bshepherdson commented 8 years ago

Isn't it only finally that destroys optimizations? In any case, we should do this.

kgrgreer commented 8 years ago

No, try/catch is sufficient: http://www.html5rocks.com/en/tutorials/speed/v8/