aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-05-21 15:41:22 +0000
committers-ol <s-ol@users.noreply.github.com>2020-05-21 15:41:26 +0000
commita3c9976f1ed4a033c3eb8671dc0fa4bb1c274c6a (patch)
treea9ab3ecfd9be8e5d3767d63d4872f32599119834
parentindexing into types (diff)
downloadalive-a3c9976f1ed4a033c3eb8671dc0fa4bb1c274c6a.tar.gz
alive-a3c9976f1ed4a033c3eb8671dc0fa4bb1c274c6a.zip
dont error when running empty files
-rw-r--r--alv/builtin.moon3
1 files changed, 2 insertions, 1 deletions
diff --git a/alv/builtin.moon b/alv/builtin.moon
index f4e4d56..c3dfcda 100644
--- a/alv/builtin.moon
+++ b/alv/builtin.moon
@@ -250,7 +250,8 @@ Evaluate `expr1`, `expr2`, … and return the value of the last expression."
eval: (scope, tail) =>
scope = Scope scope
children = [expr\eval scope for expr in *tail]
- RTNode :children, result: children[#children].result
+ last = children[#children]
+ RTNode :children, result: last and last.result
if_ = Constant.meta
meta: