aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--registry.moon6
-rw-r--r--scope.moon2
2 files changed, 5 insertions, 3 deletions
diff --git a/registry.moon b/registry.moon
index 2a751cc..7268f6d 100644
--- a/registry.moon
+++ b/registry.moon
@@ -96,8 +96,10 @@ class Registry
update: (dt) =>
for typ, sexpr in @root\walk 'inout', false
continue unless typ == 'Xpr'
- -- continue unless sexpr.value and sexpr.value.update
- continue unless sexpr\head!.type == 'opdef'
+
+ head = sexpr\head!
+ continue unless head and head.type == 'opdef'
+ continue unless sexpr.value
ok, err = xpcall sexpr.value.update, tb, sexpr.value, dt
if not ok
diff --git a/scope.moon b/scope.moon
index 907269e..bba2db4 100644
--- a/scope.moon
+++ b/scope.moon
@@ -60,7 +60,7 @@ class Scope
start, rest = key\match '^(.-)/(.*)'
if not start
- return @parent\get key
+ return @parent and @parent\get key
scope = @get start
assert scope and scope.type == 'scope', "cant find '#{prefix}#{start}' for '#{prefix}#{key}'"