Fix async map: use Lambda.params/body/closure (not _params/_body/_closure)
The Lambda constructor stores properties without underscore prefix, but asyncRenderMap/asyncRenderMapIndexed accessed them with underscores. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1590,10 +1590,10 @@ ASYNC_IO_JS = '''
|
||||
var item = c[i];
|
||||
var result;
|
||||
if (f && f._lambda) {
|
||||
var lenv = Object.create(f._closure || env);
|
||||
var lenv = Object.create(f.closure || env);
|
||||
for (var k in env) if (env.hasOwnProperty(k)) lenv[k] = env[k];
|
||||
lenv[f._params[0]] = item;
|
||||
result = asyncRenderToDom(f._body, lenv, null);
|
||||
lenv[f.params[0]] = item;
|
||||
result = asyncRenderToDom(f.body, lenv, null);
|
||||
} else if (typeof f === "function") {
|
||||
var r = f(item);
|
||||
result = isPromise(r) ? r.then(function(v) { return asyncRenderToDom(v, env, null); }) : asyncRenderToDom(r, env, null);
|
||||
@@ -1629,11 +1629,11 @@ ASYNC_IO_JS = '''
|
||||
var item = c[i];
|
||||
var result;
|
||||
if (f && f._lambda) {
|
||||
var lenv = Object.create(f._closure || env);
|
||||
var lenv = Object.create(f.closure || env);
|
||||
for (var k in env) if (env.hasOwnProperty(k)) lenv[k] = env[k];
|
||||
lenv[f._params[0]] = i;
|
||||
lenv[f._params[1]] = item;
|
||||
result = asyncRenderToDom(f._body, lenv, null);
|
||||
lenv[f.params[0]] = i;
|
||||
lenv[f.params[1]] = item;
|
||||
result = asyncRenderToDom(f.body, lenv, null);
|
||||
} else if (typeof f === "function") {
|
||||
var r = f(i, item);
|
||||
result = isPromise(r) ? r.then(function(v) { return asyncRenderToDom(v, env, null); }) : asyncRenderToDom(r, env, null);
|
||||
|
||||
Reference in New Issue
Block a user