From 8f0aa14fa695ff3aa3b3ed96c02fdb2ab99f272c Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 19 Jan 2022 08:01:17 -0500 Subject: Fix fill computation for arrays imported from JS --- docs/bqn.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/bqn.js') diff --git a/docs/bqn.js b/docs/bqn.js index e14bdf47..b1b2f1b0 100644 --- a/docs/bqn.js +++ b/docs/bqn.js @@ -516,7 +516,7 @@ let dojs = (x,w) => { let toBQN = x => { if (isnum(x)) return x; if (typeof x==='string') { if (Array.from(x).length!==1) throw Error("•JS: JS strings are one character; use Array.from for BQN strings"); return x; } - if (x instanceof Array) return arr(x.map(toBQN),x.sh||[x.length],toBQN(x.fill)); + if (x instanceof Array) return arr(x.map(toBQN),x.sh||[x.length],has(x.fill)?tofill(toBQN(x.fill)):x.fill); if (isfunc(x)) { let f=(a,b)=>toBQN(x(a,b)); f.m=x.m; return f; } throw Error("•JS: Unrecognized JS result"); } -- cgit v1.2.3