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:
@@ -14,7 +14,7 @@
|
||||
// =========================================================================
|
||||
|
||||
var NIL = Object.freeze({ _nil: true, toString: function() { return "nil"; } });
|
||||
var SX_VERSION = "2026-03-07T09:23:03Z";
|
||||
var SX_VERSION = "2026-03-07T09:40:17Z";
|
||||
|
||||
function isNil(x) { return x === NIL || x === null || x === undefined; }
|
||||
function isSxTruthy(x) { return x !== false && !isNil(x); }
|
||||
@@ -4220,10 +4220,10 @@ callExpr.push(dictGet(kwargs, k)); } }
|
||||
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);
|
||||
@@ -4259,11 +4259,11 @@ callExpr.push(dictGet(kwargs, k)); } }
|
||||
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