diff options
author | Wilson Page <wilsonpage@me.com> | 2013-10-25 14:03:02 +0100 |
---|---|---|
committer | Wilson Page <wilsonpage@me.com> | 2013-10-25 14:03:02 +0100 |
commit | 65720667dc4a934da89bbbea816802dcbd9ffc87 (patch) | |
tree | 2db60bd948084a518e4089d0a43c5a9ee415c837 | |
parent | 243271c63839795426d7e3306c076629e81a69a0 (diff) | |
parent | 274ed9e4a11e8912d356a3283d90c33068d1cf01 (diff) | |
download | fastdom-65720667dc4a934da89bbbea816802dcbd9ffc87.zip fastdom-65720667dc4a934da89bbbea816802dcbd9ffc87.tar.gz fastdom-65720667dc4a934da89bbbea816802dcbd9ffc87.tar.bz2 |
Merge remote-tracking branch 'rowan/master' into error-handling
-rw-r--r-- | index.js | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -333,17 +333,24 @@ raf(function frame() { var fn = self.frames.shift(); - // Run the frame - if (fn) fn(); - // If no more frames, // stop looping if (!self.frames.length) { self.looping = false; - return; + + // Otherwise, schedule the + // next frame + } else { + raf(frame); } - raf(frame); + // Run the frame. Note that + // this may throw an error + // in user code, but all + // fastdom tasks are dealt + // with already so the code + // will continue to iterate + if (fn) fn(); }); this.looping = true; |