aboutsummaryrefslogtreecommitdiff
path: root/docs/bqn.js
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-01-19 08:01:17 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2022-01-19 08:01:17 -0500
commit8f0aa14fa695ff3aa3b3ed96c02fdb2ab99f272c (patch)
treeaed4c343ca600436d758e62cbe418095aa7b786b /docs/bqn.js
parent09d37e824f26c5675db18a6a358b0f5f280ec79c (diff)
Fix fill computation for arrays imported from JS
Diffstat (limited to 'docs/bqn.js')
-rw-r--r--docs/bqn.js2
1 files changed, 1 insertions, 1 deletions
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");
}