Fix resolveSuspense: iterate parsed exprs instead of passing array
parse() returns a list of expressions. resolveSuspense was passing the
entire array to renderToDom, which interpreted [(<> ...)] as a call
expression ((<> ...)) — causing "Not callable: {}". Now iterates
each expression individually, matching the public render() API.
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-07T19:23:11Z";
|
||||
var SX_VERSION = "2026-03-07T19:36:54Z";
|
||||
|
||||
function isNil(x) { return x === NIL || x === null || x === undefined; }
|
||||
function isSxTruthy(x) { return x !== false && !isNil(x); }
|
||||
@@ -701,7 +701,7 @@
|
||||
var evalCall = function(head, args, env) { return (function() {
|
||||
var f = trampoline(evalExpr(head, env));
|
||||
var evaluatedArgs = map(function(a) { return trampoline(evalExpr(a, env)); }, args);
|
||||
return (isSxTruthy((isSxTruthy(isCallable(f)) && isSxTruthy(!isSxTruthy(isLambda(f))) && !isSxTruthy(isComponent(f)))) ? apply(f, evaluatedArgs) : (isSxTruthy(isLambda(f)) ? callLambda(f, evaluatedArgs, env) : (isSxTruthy(isComponent(f)) ? callComponent(f, args, env) : (console.error("[sx-ref] Not callable:", inspect(f), "head:", inspect(head), "args:", inspect(args)), error((String("Not callable: ") + String(inspect(f))))))));
|
||||
return (isSxTruthy((isSxTruthy(isCallable(f)) && isSxTruthy(!isSxTruthy(isLambda(f))) && !isSxTruthy(isComponent(f)))) ? apply(f, evaluatedArgs) : (isSxTruthy(isLambda(f)) ? callLambda(f, evaluatedArgs, env) : (isSxTruthy(isComponent(f)) ? callComponent(f, args, env) : error((String("Not callable: ") + String(inspect(f)))))));
|
||||
})(); };
|
||||
|
||||
// call-lambda
|
||||
@@ -2460,11 +2460,10 @@ allKf = concat(allKf, styleValueKeyframes_(sv)); } }
|
||||
return (function() {
|
||||
var el = domQuery((String("[data-suspense=\"") + String(id) + String("\"]")));
|
||||
return (isSxTruthy(el) ? (function() {
|
||||
var ast = parse(sx);
|
||||
var exprs = parse(sx);
|
||||
var env = getRenderEnv(NIL);
|
||||
var node = renderToDom(ast, env, NIL);
|
||||
domSetTextContent(el, "");
|
||||
domAppend(el, node);
|
||||
{ var _c = exprs; for (var _i = 0; _i < _c.length; _i++) { var expr = _c[_i]; domAppend(el, renderToDom(expr, env, NIL)); } }
|
||||
processElements(el);
|
||||
sxHydrateElements(el);
|
||||
return domDispatch(el, "sx:resolved", {"id": id});
|
||||
|
||||
Reference in New Issue
Block a user