The control flow here seems wrong since we just "return" if !cancel.handler, but we "return false" otherwise.  I suggest changing this to invert the condition, so it's basically:
```
if (cancel.handler)
  cancel.handler();
```