summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-09-24 07:52:57 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-09-24 07:52:57 -0400
commitf93acbb03f1ea669499bfb39d201ae8dd48f101b (patch)
tree92fb5e7eb7efe61893c60ff43a4f3c83d1fa91db /lib
parent5d3756215c0141917e0a6dfc048d638d116fe462 (diff)
Might have fixed demo/listEdit
Diffstat (limited to 'lib')
-rw-r--r--lib/js/urweb.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index d4c0f9b7..8170249b 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -115,7 +115,7 @@ function doExn(v) {
var disconnectHandlers = null;
function flift(f) {
- return {c:"l", b:f};
+ return {env:cons(f,null), body:{c:"v", n:1}};
}
function onDisconnect(f) {
@@ -217,7 +217,7 @@ function populate(node) {
var s = node.signal;
var oldSources = node.sources;
try {
- var sr = exec0(s.env, s.body);
+ var sr = execF(s, null);
var newSources = sr._sources;
for (var sp = oldSources; sp; sp = sp.next)
@@ -260,10 +260,10 @@ function sr(v) {
function sb(x,y) {
return {env:cons(y,cons(x,null)),
body:{c:"=",
- e1:{c:"a", f:{c:"v", n:1}, x:{c:"c", v:null}},
+ e1:{c:"a", f:{c:"v", n:2}, x:{c:"c", v:null}},
e2:{c:"=",
e1:{c:"a",
- f:{c:"a", f:{c:"v", n:1}, x:{c:".", r:{c:"v", n:0}, f:"data"}},
+ f:{c:"a", f:{c:"v", n:2}, x:{c:".", r:{c:"v", n:0}, f:"data"}},
x:{c:"c", v:null}},
e2:{c:"r", l:cons(
{n:"sources", v:{c:"f", f:union, a:cons({c:".", r:{c:"v", n:1}, f:"sources"},
@@ -633,7 +633,7 @@ function rc(uri, parse, k, needsSig) {
if (isok) {
try {
- k(parse(xhr.responseText));
+ execF(k, parse(xhr.responseText));
} catch (v) {
doExn(v);
}
@@ -783,7 +783,7 @@ function rv(chn, parse, k) {
enqueue(ch.listeners, function(msg) { k(parse(msg))(null); });
} else {
try {
- k(parse(msg))(null);
+ execF(execF(k, parse(msg)), null);
} catch (v) {
doExn(v);
}
@@ -1025,6 +1025,10 @@ function exec(e) {
return r;
}
+function execF(f, x) {
+ return exec0(cons(x, f.env), f.body);
+}
+
// App-specific code