summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-09-22 15:12:09 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-09-22 15:12:09 -0400
commitee1639d9e3afa41c85382ab991e2229a91be4c21 (patch)
tree53528b85a9933aa85de2178d4f23249408427d4c /lib
parent5053cc1cc65d193cc4d3298a9d2485c0139a9bf9 (diff)
Quoting JavaScript working
Diffstat (limited to 'lib')
-rw-r--r--lib/js/urweb.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 13f93867..a1b4b1d2 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -181,7 +181,7 @@ function freeClosure(n) {
}
function cr(n) {
- return closures[n]();
+ return closures[n];
}
function flatten(cls, tr) {
@@ -863,6 +863,7 @@ function exec0(env, e) {
stack = stack.next;
} else {
e = fr.a.data;
+ if (e == null) alert("Oh no!");
fr.a = fr.a.next;
}
break;
@@ -983,9 +984,11 @@ function exec0(env, e) {
e = e.e;
break;
case "e":
- var env0 = env;
- var e0 = e.e;
- e = {c: "c", v: cs(function() { return exec0(env0, e0); })};
+ e = {c: "c", v: cs({c: "wc", env: env, body: e.e})};
+ break;
+ case "wc":
+ env = e.env;
+ e = e.body;
break;
default:
throw ("Unknown Ur expression kind " + e.c);
@@ -996,7 +999,7 @@ function exec0(env, e) {
function exec(e) {
var r = exec0(null, e);
- if (r != null && r.body)
+ if (r != null && r.body != null)
return function(v) { return exec0(cons(v, r.env), r.body); };
else
return r;