From c55d9d2832a46d9dc265fec36936b1313f5af6f6 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sun, 11 Feb 2024 20:44:17 -0700 Subject: birthdays --- src/components/function_box.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/components/function_box.tsx') diff --git a/src/components/function_box.tsx b/src/components/function_box.tsx index d116a47..b2221b4 100644 --- a/src/components/function_box.tsx +++ b/src/components/function_box.tsx @@ -20,7 +20,7 @@ export interface FunctionBoxProps extends NodeProps { arity?: number; - isChild?: boolean; + isChild?: boolean; // todo: attach DNA } type FunctionArgs = { node?: Node; val: any }[]; @@ -59,7 +59,7 @@ export class FunctionBox extends Node { this.arity = props?.arity ?? 1; if (props.fn) { - this.source = props.fn.toString(); + this.source = props.source ?? props.fn.toString(); this.function = props.fn; } else { this.source = props?.source ?? `(x: number): number => x + 2`; @@ -273,7 +273,7 @@ export class FunctionBox extends Node { , ); -- cgit v1.2.3-70-g09d2