Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[fix] runtime, cpsjs: On client side the cps runtime never returns th…

…e next computation
  • Loading branch information...
commit 90d99ab0ec2f1e5df5d98c6a0b42498925530096 1 parent 5108c26
@BourgerieQuentin BourgerieQuentin authored
Showing with 17 additions and 2 deletions.
  1. +17 −2 compiler/qmlcps/qmlCpsClientLib.js
View
19 compiler/qmlcps/qmlCpsClientLib.js
@@ -12,6 +12,13 @@
/**
* @author Quentin Bourgerie
+ *
+ *
+ * /!\ This file is shared between server (node) and client, it's why you can
+ * found the Ifstatic preprocessing directive. Indeed even if the client code
+ * is not cps rewrited, the cps runtime is anyway used by the client (stdlib).
+ * But the client cps runtime is a bit different than the server cps
+ * runtime. It's why they are Ifstatic preprocessing directive.
*/
/**
@@ -292,8 +299,12 @@ function loop_schedule()
} else {
task = tasks.shift();
var r = task();
- for(var i=0; i<100 && r && r !== js_void; i++) r =execute1(r[0], r[1]);
- if (r && r !== js_void) push(task_from_return(r[0], [r[1]]));
+ #<Ifstatic:OPABSL_NODE>
+ for(var i=0; i<100 && r; i++) r =execute1(r[0], r[1]);
+ if (r) push(task_from_return(r[0], [r[1]]));
+ #<Else>
+ execute1(r[0], r[1])
+ #<End>
}
}
} catch(e) {
@@ -328,7 +339,11 @@ function return_(k, x){
function execute(k, x){
var r;
+ #<Ifstatic:OPABSL_NODE>
if (r = execute1(k, x)) push(task_from_return(r[0], [r[1]]));
+ #<Else>
+ execute1(k, x);
+ #<End>
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.