git » jacl.git » commit e780ddf

fix analyzeBlock bug: if no forms, return null

author Alan Dipert
2019-11-01 04:19:14 UTC
committer Alan Dipert
2019-11-01 04:19:14 UTC
parent c99d0ba3071dad10a9ececcff39ad4871756d155

fix analyzeBlock bug: if no forms, return null

jacl.js +1 -1

diff --git a/jacl.js b/jacl.js
index 15e6b72..9652a48 100644
--- a/jacl.js
+++ b/jacl.js
@@ -854,7 +854,7 @@ const analyzeBlock = (env, parent, forms) => {
                .map(x => analyze(env.withContext('statement'), parent, x)),
       ret;
   if (forms.length <= 1) {
-    ret = analyze(env.withContext(env.context === 'statement' ? 'statement' : 'return'), parent, forms[0]);
+    ret = analyze(env.withContext(env.context === 'statement' ? 'statement' : 'return'), parent, forms.length ? forms[0] : null);
   } else {
     ret = analyze(
       env.withContext(env.context === 'statement' ? 'statement' : 'return'),