diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-10-04 10:10:13 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-10-04 10:10:13 -0400 |
| commit | 7736299e2a2d3f52425c8982d42ff1eb3217fe6a (patch) | |
| tree | 6cbeb41f4b8283a0979add09791d71aa7e424667 /docs/bqn.js | |
| parent | 48c174f3b9a8d67c9fd388ab1e7115a3d6e42c4c (diff) | |
Error if a predicate in a single-body function fails (fixes #30)
Diffstat (limited to 'docs/bqn.js')
| -rw-r--r-- | docs/bqn.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/bqn.js b/docs/bqn.js index 2085e5ed..fbbea582 100644 --- a/docs/bqn.js +++ b/docs/bqn.js @@ -136,7 +136,7 @@ let run = (B,O,F,S,L,T,src,env) => { // Bytecode, Objects, Blocks, Bodies, Locat if (useenv) { c = "const e=env;"+c; env.vid=vid; } else if (imm) c = "const e=[...e2];e.vid=vid;e.p=oe;"+c; else c = "const fn=(x, w)=>{const e=[...e2];e.vid=vid;e.p=oe;e[0]=fn;e[1]=x;e[2]=w;"+c+"};"+repdf[type]+"return fn;"; - c="do {"+c+"} while (0);\n"; + c="do {"+c+"} while (0);\nthrow Error('No matching case');\n"; def = useenv ? "env" : ("new Array("+vid.length+").fill(null)"); } else { if (imm !== +(ind.length<2)) throw "Internal error: malformed block info"; |
