Modernizr/Modernizr — pull request #1016 by stucox (2013-08-13 09:31:57+00:00)
Title: Fixing a scoping issue with multiple `Modernizr.on()` callbacks for a single test

There's a scoping issue in `src/addTest.js`:

If there are multiple callbacks for a test, the value of `cb` in this scope will be changed to the 2nd (then 3rd, then 4th etc) callback before the deferred function is executed even once – so the last callback gets executed multiple times, rather than each callback being called.

This PR fixes this.

+@SlexAxton