canjs / can-zone

A context for tracking asynchronous activity in JavaScript applications.
https://v4.canjs.com/doc/can-zone.html
MIT License
91 stars 4 forks source link

removeEventListener throws when passed an undefined handler #161

Closed phillipskevin closed 6 years ago

phillipskevin commented 6 years ago

This will throw:

new Zone().run(function(){
  var handler = undefined;
  el.removeEventListener("some-test", handler);
})

because of https://github.com/canjs/can-zone/blob/5028693a5a653a1ab8147eb686cb238cda2bbca5/lib/tasks.js#L244.

phillipskevin commented 6 years ago

failing test here: https://github.com/canjs/can-zone/commit/951680a211216f8149a34c9ec316420469c072cb