summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilson Page <wilsonpage@me.com>2013-10-25 14:03:02 +0100
committerWilson Page <wilsonpage@me.com>2013-10-25 14:03:02 +0100
commit65720667dc4a934da89bbbea816802dcbd9ffc87 (patch)
tree2db60bd948084a518e4089d0a43c5a9ee415c837
parent243271c63839795426d7e3306c076629e81a69a0 (diff)
parent274ed9e4a11e8912d356a3283d90c33068d1cf01 (diff)
downloadfastdom-65720667dc4a934da89bbbea816802dcbd9ffc87.zip
fastdom-65720667dc4a934da89bbbea816802dcbd9ffc87.tar.gz
fastdom-65720667dc4a934da89bbbea816802dcbd9ffc87.tar.bz2
Merge remote-tracking branch 'rowan/master' into error-handling
-rw-r--r--index.js17
1 files changed, 12 insertions, 5 deletions
diff --git a/index.js b/index.js
index 32f1693..0e8f48f 100644
--- a/index.js
+++ b/index.js
@@ -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;