diff --git a/compiler/forget/src/HIR/BuildHIR.ts b/compiler/forget/src/HIR/BuildHIR.ts index 888dd79b2a..c9a7a60be7 100644 --- a/compiler/forget/src/HIR/BuildHIR.ts +++ b/compiler/forget/src/HIR/BuildHIR.ts @@ -1359,33 +1359,15 @@ function lowerExpression( }; } loweredFunc = lowering.unwrap(); - - let hasError = false; - const params: Array = []; - for (const p of expr.get("params")) { - if (!p.isIdentifier()) { - builder.errors.push({ - reason: `(BuildHIR::lowerExpression) Handle ${p.type} params in FunctionExpression`, - severity: ErrorSeverity.Todo, - nodePath: p, - }); - hasError = true; - continue; - } - params.push(p.node.name); - } - return hasError - ? { kind: "UnsupportedNode", node: exprNode, loc: exprLoc } - : { - kind: "FunctionExpression", - name, - params, - loweredFunc, - dependencies: captured.refs, - mutatedDeps: [], - expr: expr.node, - loc: exprLoc, - }; + return { + kind: "FunctionExpression", + name, + loweredFunc, + dependencies: captured.refs, + mutatedDeps: [], + expr: expr.node, + loc: exprLoc, + }; } case "TaggedTemplateExpression": { const expr = exprPath as NodePath; diff --git a/compiler/forget/src/HIR/HIR.ts b/compiler/forget/src/HIR/HIR.ts index b3ff115101..dac8836537 100644 --- a/compiler/forget/src/HIR/HIR.ts +++ b/compiler/forget/src/HIR/HIR.ts @@ -469,7 +469,6 @@ export type JsxAttribute = export type FunctionExpression = { kind: "FunctionExpression"; name: string | null; - params: Array; dependencies: Array; // TODO(gsn): Remove this mutatedDeps array and use dependencies as single // source of truth. diff --git a/compiler/forget/src/HIR/PrintHIR.ts b/compiler/forget/src/HIR/PrintHIR.ts index 8972160dec..32d4a3ead4 100644 --- a/compiler/forget/src/HIR/PrintHIR.ts +++ b/compiler/forget/src/HIR/PrintHIR.ts @@ -333,14 +333,11 @@ export function printInstructionValue(instrValue: ReactiveValue): string { break; } case "FunctionExpression": { - const params = instrValue.params.join(","); - const body = generate(instrValue.expr).code; + const fn = generate(instrValue.expr).code; const deps = instrValue.dependencies .map((i) => printIdentifier(i.identifier)) .join(","); - value = `Function ${instrValue.name ?? ""} @deps[${deps}] (${ - params ?? "" - }){${body}}`; + value = `Function @deps[${deps}]{${fn}}`; break; } case "TaggedTemplateExpression": { diff --git a/compiler/forget/src/ReactiveScopes/CodegenReactiveFunction.ts b/compiler/forget/src/ReactiveScopes/CodegenReactiveFunction.ts index cba3bc20d7..e51ddc8443 100644 --- a/compiler/forget/src/ReactiveScopes/CodegenReactiveFunction.ts +++ b/compiler/forget/src/ReactiveScopes/CodegenReactiveFunction.ts @@ -673,7 +673,6 @@ function codegenInstructionValue( case "FunctionExpression": { const id = instrValue.name !== null ? t.identifier(instrValue.name) : null; - const params = instrValue.params.map((p) => t.identifier(p)); value = instrValue.expr; break; }