aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-06-16 14:43:45 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-06-16 14:43:45 -0700
commit65e62141a955420e10c22b14579c99aa07027e29 (patch)
treecb77a90fed8c8800fd1c02a2357a807c938492f9
parentba387574f23867d889a04f1586e6dd9597e8bad8 (diff)
skip a frame if Module.preMainLoop returns false
-rw-r--r--src/library_browser.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/library_browser.js b/src/library_browser.js
index 8e86371e..357bd96b 100644
--- a/src/library_browser.js
+++ b/src/library_browser.js
@@ -44,7 +44,12 @@ mergeInto(LibraryManager.library, {
},
runIter: function(func) {
if (ABORT) return;
- if (Module['preMainLoop']) Module['preMainLoop']();
+ if (Module['preMainLoop']) {
+ var preRet = Module['preMainLoop']();
+ if (preRet === false) {
+ return; // |return false| skips a frame
+ }
+ }
try {
func();
} catch (e) {