Looking at the clear method on fastdom-promised, the task.delete is called using the "task" function instead of the "promise" object, which is what was used for the key in the map. The method clears the task from fastdom itself, but it leaves the promise in the _tasks(map). You can verify this by checking map.size after calling clear.
let promise = fastdom.measure(()=>{}, this);
// tries to delete the function, not the promise form _tasks.map
fastdom.clear(promise);
// fails with size equal to 1
expect(fastdom._tasks.size).toBe(0);
I found this while trying to write a unit test on my clear method.
Looking at the clear method on fastdom-promised, the task.delete is called using the "task" function instead of the "promise" object, which is what was used for the key in the map. The method clears the task from fastdom itself, but it leaves the promise in the _tasks(map). You can verify this by checking map.size after calling clear.
I found this while trying to write a unit test on my clear method.
line 42 in fastdom-promised should be